* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-h: 48px;
  --list-bg: #f1f2f4;
  --shadow: 0 1px 2px rgba(0,0,0,.15);
  --radius: 10px;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #172b4d;
  background: #f6f8fa;
  overflow: hidden;
}
#app { height: 100%; display: flex; flex-direction: column; }

button { font: inherit; cursor: pointer; border: none; border-radius: 6px; }
input, textarea, select { font: inherit; border: 1px solid #c9d2dc; border-radius: 6px; padding: 7px 10px; outline: none; }
input:focus, textarea:focus { border-color: #0079bf; box-shadow: 0 0 0 2px rgba(0,121,191,.2); }

.btn { padding: 7px 14px; background: #0079bf; color: #fff; }
.btn:hover { background: #026aa7; }
.btn-subtle { background: rgba(9,30,66,.06); color: #172b4d; }
.btn-subtle:hover { background: rgba(9,30,66,.13); }
.btn-danger { background: #eb5a46; color: #fff; }
.btn-danger:hover { background: #cf513d; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ---------- header ---------- */
.header {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: rgba(0,0,0,.28);
  color: #fff;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.header .logo { font-weight: 700; font-size: 16px; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.header .logo svg { width: 22px; height: 22px; }
.header .spacer { flex: 1; }
.header .userchip {
  width: 30px; height: 30px; border-radius: 50%;
  background: #dfe1e6; color: #172b4d; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}

/* ---------- auth ---------- */
.auth-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0079bf, #5067c5 60%, #89609e);
}
.auth-card {
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 34px 38px; width: 380px; max-width: calc(100vw - 30px);
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; text-align: center; }
.auth-card .sub { text-align: center; color: #5e6c84; margin-bottom: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .error { color: #eb5a46; font-size: 13px; min-height: 16px; }
.auth-card .switch { text-align: center; margin-top: 16px; color: #5e6c84; }
.auth-card .switch a { color: #0079bf; cursor: pointer; text-decoration: none; }
.auth-card .notice { background: #fff7e6; border: 1px solid #f2d600; border-radius: 6px; padding: 8px 10px; font-size: 13px; }

/* ---------- boards home ---------- */
.home { flex: 1; overflow-y: auto; padding: 30px clamp(16px, 6vw, 80px); }
.home h2 { margin: 18px 0 14px; font-size: 17px; display: flex; align-items: center; gap: 8px; color: #44546f; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.board-tile {
  height: 100px; border-radius: var(--radius); padding: 12px;
  color: #fff; font-weight: 700; cursor: pointer; position: relative;
  box-shadow: var(--shadow); transition: transform .08s, filter .15s;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-wrap: anywhere;
}
.board-tile:hover { filter: brightness(1.08); transform: translateY(-2px); }
.board-tile .tag { font-size: 11px; font-weight: 400; opacity: .85; }
.board-tile.create {
  background: rgba(9,30,66,.06); color: #44546f; font-weight: 500;
  align-items: center; justify-content: center; border: 2px dashed #c9d2dc;
}
.board-tile.create:hover { background: rgba(9,30,66,.12); }

/* ---------- board view ---------- */
.board-page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; background: rgba(0,0,0,.18); color: #fff; backdrop-filter: blur(4px);
}
.board-bar h1 { font-size: 17px; }
.board-bar h1 input {
  font-size: 17px; font-weight: 700; background: transparent; border: none; color: #fff; padding: 2px 6px; width: auto;
}
.board-bar h1 input:focus { background: #fff; color: #172b4d; }
.board-bar .filter-input { padding: 5px 10px; border-radius: 6px; border: none; width: 170px; }

.lists-scroll {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
}
.list {
  width: 274px; min-width: 220px; flex: 0 0 auto; max-height: 100%;
  background: var(--list-bg); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
}
.list.custom-bg { background-size: 22px 22px; }
.list-header { display: flex; align-items: center; padding: 10px 10px 4px; gap: 4px; cursor: grab; }
.list-header input {
  flex: 1; font-weight: 700; background: transparent; border: none; padding: 4px 8px; border-radius: 6px;
}
.list-header input:focus { background: #fff; }
.list-header .count { color: #626f86; font-size: 12px; padding: 0 4px; }
.list-cards { overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.list-footer { padding: 8px; }
.list-footer .add-card-btn { width: 100%; text-align: left; padding: 8px 10px; color: #44546f; background: transparent; border-radius: 8px; }
.list-footer .add-card-btn:hover { background: rgba(9,30,66,.08); }

.card {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 10px; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px;
}
.card:hover { border-color: #0079bf; }
.card.dragging { opacity: .4; transform: rotate(2deg); }
.card .labels { display: flex; gap: 4px; flex-wrap: wrap; }
.card .labels .pill { height: 8px; min-width: 36px; border-radius: 4px; }
.card .title { overflow-wrap: anywhere; }
.card .title.done { text-decoration: line-through; color: #626f86; }
.card .badges { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #626f86; align-items: center; }
.card .badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: 4px; }
.card .badge.due-over { background: #ffedeb; color: #ae2e24; }
.card .badge.due-soon { background: #fff7d6; color: #7f5f01; }
.card .badge.due-done { background: #dcfff1; color: #216e4e; }

.drop-hint { height: 36px; border-radius: 8px; background: rgba(0,121,191,.18); border: 2px dashed #0079bf; }

.add-list-btn {
  width: 274px; min-width: 274px; padding: 12px;
  background: rgba(255,255,255,.25); color: #fff; border-radius: 12px; text-align: left; font-weight: 500;
}
.add-list-btn:hover { background: rgba(255,255,255,.35); }
.add-list-form { width: 274px; min-width: 274px; background: var(--list-bg); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }

.inline-form { display: flex; flex-direction: column; gap: 8px; }
.inline-form .row { display: flex; gap: 8px; align-items: center; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; justify-content: center; align-items: flex-start;
  overflow-y: auto; padding: 46px 14px; z-index: 100;
}
.modal {
  background: #f4f5f7; border-radius: 14px; width: 740px; max-width: 100%;
  padding: 20px 22px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal .close-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: transparent; font-size: 18px; color: #44546f;
}
.modal .close-x:hover { background: rgba(9,30,66,.1); }
.modal h2 { font-size: 19px; margin-bottom: 4px; padding-right: 36px; }
.modal h2 input { font-size: 19px; font-weight: 700; width: 100%; background: transparent; border-color: transparent; padding: 2px 6px; }
.modal h2 input:focus { background: #fff; border-color: #0079bf; }
.modal .subtle { color: #5e6c84; font-size: 12px; margin-bottom: 14px; }
.modal-body { display: flex; gap: 18px; }
.modal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.modal-side { width: 170px; display: flex; flex-direction: column; gap: 8px; }
.modal-side .side-title { font-size: 12px; color: #5e6c84; font-weight: 600; }
.modal-side button { width: 100%; text-align: left; }

.section h3 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.section textarea { width: 100%; min-height: 70px; resize: vertical; background: #fff; }
.desc-view { background: rgba(9,30,66,.04); border-radius: 8px; padding: 10px; white-space: pre-wrap; cursor: pointer; min-height: 40px; overflow-wrap: anywhere; }
.desc-view.empty { color: #5e6c84; font-style: italic; }

.label-row { display: flex; gap: 6px; flex-wrap: wrap; }
.label-chip { padding: 4px 10px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 600; min-width: 44px; min-height: 24px; }
.label-chip.pick { opacity: .45; }
.label-chip.pick.on { opacity: 1; outline: 2px solid #172b4d; }

.checklist { background: #fff; border-radius: 10px; padding: 10px 12px; }
.checklist .cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.checklist .cl-head b { flex: 1; }
.progress { height: 6px; background: #dfe1e6; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress > div { height: 100%; background: #61bd4f; transition: width .2s; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.cl-item span { flex: 1; overflow-wrap: anywhere; }
.cl-item span.done { text-decoration: line-through; color: #626f86; }
.cl-item .del { visibility: hidden; color: #626f86; background: transparent; }
.cl-item:hover .del { visibility: visible; }

.comment { background: #fff; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.comment .meta { font-size: 12px; color: #5e6c84; margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.comment .meta b { color: #172b4d; }
.comment p { overflow-wrap: anywhere; }

.activity-item { font-size: 12.5px; color: #44546f; padding: 4px 0; border-bottom: 1px solid rgba(9,30,66,.06); }
.activity-item b { color: #172b4d; }
.activity-item .when { color: #8993a4; font-size: 11px; }

/* ---------- popover-меню ---------- */
.pop {
  position: absolute; z-index: 200; background: #fff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 12px; width: 300px;
}
.pop h4 { font-size: 13px; text-align: center; color: #44546f; margin-bottom: 10px; }
.pop .stack { display: flex; flex-direction: column; gap: 8px; }

.member-chip { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.member-chip .ava { width: 26px; height: 26px; border-radius: 50%; background: #0079bf; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.member-chip span { flex: 1; }

/* ---------- admin ---------- */
.admin-wrap { flex: 1; overflow-y: auto; padding: 30px clamp(16px, 6vw, 80px); }
.admin-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; max-width: 760px; }
.admin-card h3 { margin-bottom: 12px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #ebecf0; }
.admin-table th { color: #5e6c84; font-size: 12px; }
.toggle-row { display: flex; align-items: center; gap: 12px; }
.switch-ui { position: relative; width: 44px; height: 24px; background: #c9d2dc; border-radius: 12px; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.switch-ui.on { background: #61bd4f; }
.switch-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .15s;
}
.switch-ui.on::after { left: 22px; }

/* ---------- misc ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #172b4d; color: #fff; padding: 10px 18px; border-radius: 8px;
  z-index: 500; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: fade-in .2s;
}
@keyframes fade-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.public-banner { background: #fff7d6; color: #7f5f01; text-align: center; padding: 7px; font-size: 13px; }

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(9,30,66,.25); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(9,30,66,.4); }
::-webkit-scrollbar-track { background: rgba(255,255,255,.1); }

/* ================= v2: визуальный апгрейд и новые элементы ================= */

/* мягкие тени и переходы */
:root {
  --shadow: 0 1px 1px rgba(9,30,66,.2), 0 0 1px rgba(9,30,66,.12);
  --shadow-md: 0 4px 12px rgba(9,30,66,.18);
  --shadow-lg: 0 12px 32px rgba(9,30,66,.28);
}

/* header — стеклянный, с плавной тенью */
.header { box-shadow: 0 1px 6px rgba(0,0,0,.15); z-index: 30; }
.header .logo svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.header .userchip { transition: transform .12s, box-shadow .12s; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.header .userchip:hover { transform: scale(1.08); }
.header .btn-ghost { border-radius: 7px; padding: 6px 12px; transition: background .12s; }

/* кнопки — чуть живее */
.btn, .btn-subtle, .btn-danger { transition: background .12s, transform .06s, box-shadow .12s; }
.btn:active, .btn-subtle:active, .btn-danger:active { transform: translateY(1px); }
.btn { box-shadow: 0 1px 2px rgba(0,0,0,.18); }

/* доски-плитки — градиентный оверлей и иконка */
.board-tile { background-size: cover !important; }
.board-tile::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.28)); pointer-events: none;
}
.board-tile > * { position: relative; z-index: 1; }
.board-tile.create::before { display: none; }

/* списки — мягче, с анимацией появления */
.list { box-shadow: var(--shadow); animation: list-in .18s ease; }
@keyframes list-in { from { opacity: 0; transform: translateY(6px); } }
.list-cards { scrollbar-width: thin; }

/* карточка — обложка, приоритет, аватары */
.card { transition: box-shadow .12s, transform .06s, border-color .12s; }
.card:hover { box-shadow: var(--shadow-md); }
.card:active { transform: scale(.98); }
.card.is-done { opacity: .82; }
.card-cover { height: 34px; margin: -8px -10px 4px; border-radius: 6px 6px 0 0; }
.card .title .check { display: inline-flex; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; background: #22a06b; color: #fff; font-size: 11px; align-items: center; justify-content: center; vertical-align: middle; }
.card .labels .pill.named { min-width: auto; height: auto; padding: 2px 8px; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.3; }
.card .badge.prio { font-weight: 700; }
.card .badge.badge-ok { background: #dcfff1; color: #216e4e; }
.card-avatars { display: inline-flex; margin-left: auto; }
.card-avatars .ava { margin-left: -6px; border: 2px solid #fff; }
.badges { align-items: center; }

/* аватарки */
.ava { border-radius: 50%; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase; }

/* выбор участников в поповере */
.member-pick { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; padding: 6px 8px; border-radius: 8px; }
.member-pick:hover { background: rgba(9,30,66,.06); }
.member-pick.on { background: rgba(34,160,107,.12); }
.member-pick span { flex: 1; }
.member-pick .tick { flex: none; color: #22a06b; font-weight: 700; }

/* сетка обложек */
.cover-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cover-swatch { height: 30px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: transform .08s; display: flex; align-items: center; justify-content: center; }
.cover-swatch:hover { transform: scale(1.08); }
.cover-swatch.on { border-color: #172b4d; }
.cover-swatch.none { background: #f1f2f4; color: #626f86; }

/* модалка — обложка сверху и участники */
.modal { box-shadow: var(--shadow-lg); animation: modal-in .18s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px); } }
.modal-cover { height: 90px; margin: -20px -22px 14px; border-radius: 14px 14px 0 0; }
.assignee-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.assignee-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(9,30,66,.06); border-radius: 20px; padding: 3px 10px 3px 3px; font-size: 13px; }

/* поповер приоритета — цветная левая граница уже задаётся инлайном */
.pop .btn-subtle.on { background: rgba(0,121,191,.14); font-weight: 700; }

/* пустое состояние списка */
.list-empty { padding: 14px 10px; text-align: center; color: #8993a4; font-size: 12.5px; font-style: italic; }

/* адаптив для телефонов */
@media (max-width: 640px) {
  .modal-body { flex-direction: column; }
  .modal-side { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .modal-side button { width: auto; flex: 1 1 45%; }
  .board-bar { gap: 6px; }
  .board-bar .filter-input { width: 130px; }
}

/* ================= v3: диалоги, фоны, свободный холст, тёмная тема ================= */

/* --- собственные диалоги вместо браузерных --- */
.dlg-overlay {
  position: fixed; inset: 0; background: rgba(9,30,66,.55); z-index: 600;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in-plain .15s;
}
@keyframes fade-in-plain { from { opacity: 0; } }
.dlg {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 22px; width: 420px; max-width: 100%; animation: modal-in .18s ease;
}
.dlg h3 { font-size: 17px; margin-bottom: 12px; }
.dlg-text { color: #44546f; line-height: 1.5; }
.dlg-input { width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* --- выбор фона доски --- */
.bg-picker { margin-top: 6px; }
.bg-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.bg-tab { padding: 6px 12px; border-radius: 8px; background: rgba(9,30,66,.06); color: #44546f; }
.bg-tab.on { background: #0079bf; color: #fff; }
.bg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bg-swatch { height: 46px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; background-size: cover !important; display: flex; align-items: center; justify-content: center; transition: transform .08s; }
.bg-swatch:hover { transform: scale(1.05); }
.bg-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #0079bf; }
.bg-check { color: #fff; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.bg-image-form { display: flex; flex-direction: column; gap: 8px; }
.bg-hint { font-size: 12px; color: #5e6c84; }
.bg-preview { height: 70px; border-radius: 10px; margin-bottom: 12px; background-size: cover !important; box-shadow: inset 0 0 0 1px rgba(9,30,66,.1); }

/* --- свободный холст --- */
.lists-scroll.free-canvas { overflow: auto; display: block; padding: 0; position: relative; }
.free-area { position: relative; min-width: 2000px; min-height: 1400px; }
.free-card { position: absolute; user-select: none; touch-action: none; box-shadow: var(--shadow-md); }
.free-card.grabbing { cursor: grabbing; z-index: 50; box-shadow: var(--shadow-lg); transform: rotate(1deg); }
.free-card .resize-handle {
  position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(9,30,66,.35) 50%); border-radius: 0 0 6px 0;
}
.free-guides { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
.guide { position: absolute; background: #e774bb; }
.guide.v { top: 0; bottom: 0; width: 1px; }
.guide.h { left: 0; right: 0; height: 1px; }
.free-add-btn {
  position: fixed; right: 26px; bottom: 26px; width: 54px; height: 54px; border-radius: 50%;
  background: #0079bf; color: #fff; font-size: 28px; line-height: 1; box-shadow: var(--shadow-lg); z-index: 40;
}
.free-add-btn:hover { background: #026aa7; transform: scale(1.05); }

/* --- «Мои задачи» на главной --- */
.my-tasks { margin-bottom: 26px; }
.my-tasks h2 { display: flex; align-items: center; gap: 8px; }
.count-pill { background: #0079bf; color: #fff; border-radius: 12px; padding: 1px 9px; font-size: 12px; }
.my-tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.my-task {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; transition: transform .08s, box-shadow .12s;
}
.my-task:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mt-prio { width: 6px; align-self: stretch; border-radius: 4px; }
.mt-main { flex: 1; min-width: 0; }
.mt-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-sub { font-size: 12px; color: #626f86; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-due { font-size: 12px; color: #626f86; white-space: nowrap; }

.chip-btn { padding: 5px 10px; border-radius: 14px; background: transparent; border: 1.5px solid #c9d2dc; color: #44546f; }
.chip-btn.on { background: rgba(0,121,191,.12); border-color: #0079bf; font-weight: 700; }
.btn-ghost.active { background: rgba(255,255,255,.28); font-weight: 700; }
.theme-toggle { font-size: 16px; }

/* ================= тёмная тема ================= */
html.dark body { color: #c7d1db; background: #1d2125; }
html.dark { color-scheme: dark; }
html.dark .list { background: #22272b; }
html.dark .list-header input, html.dark .list-cards { color: #c7d1db; }
html.dark .card { background: #2c333a; color: #c7d1db; }
html.dark .card:hover { border-color: #4c9aff; }
html.dark .list-empty { color: #7c8894; }
html.dark input, html.dark textarea, html.dark select { background: #22272b; color: #c7d1db; border-color: #3d474f; }
html.dark .modal { background: #22272b; color: #c7d1db; }
html.dark .modal h2 input { color: #c7d1db; }
html.dark .desc-view { background: rgba(255,255,255,.05); }
html.dark .section textarea, html.dark .checklist, html.dark .comment { background: #2c333a; }
html.dark .pop, html.dark .dlg { background: #282e33; color: #c7d1db; }
html.dark .dlg-text { color: #a9b4bf; }
html.dark .btn-subtle { background: rgba(255,255,255,.08); color: #c7d1db; }
html.dark .btn-subtle:hover { background: rgba(255,255,255,.15); }
html.dark .admin-card, html.dark .my-task { background: #22272b; color: #c7d1db; }
html.dark .admin-table th, html.dark .admin-table td { border-color: #3d474f; }
html.dark .auth-card { background: #22272b; color: #c7d1db; }
html.dark .add-card-btn { color: #a9b4bf; }
html.dark .modal-side .btn-subtle { background: rgba(255,255,255,.08); }
html.dark .switch-ui { background: #3d474f; }
html.dark .bg-tab, html.dark .chip-btn { background: rgba(255,255,255,.08); color: #c7d1db; }
html.dark .free-add-btn { box-shadow: 0 6px 18px rgba(0,0,0,.5); }
html.dark .bar-btn { background: rgba(255,255,255,.1); color: #dfe6ee; }
html.dark .bar-btn:hover { background: rgba(255,255,255,.18); }
html.dark .list-menu-btn { color: #a9b4bf; }
html.dark .typo-preview, html.dark .presence-ava.more { background: #2c333a; color: #c7d1db; }

/* ================= стильные кнопки панели доски ================= */
.bar-btn {
  background: rgba(255,255,255,.16); color: #fff; border: none;
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .14s, transform .1s, box-shadow .14s;
  display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(3px);
}
.bar-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.bar-btn:active { transform: translateY(0); }
.bar-btn.active { background: #fff; color: #172b4d; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.bar-btn.danger:hover { background: #eb5a46; }
.bar-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #4bce97; box-shadow: 0 0 0 2px rgba(255,255,255,.4); }

/* аватар доски */
.board-ava {
  border-radius: 9px; background-size: cover; background-position: center;
  color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.3); text-transform: uppercase;
}

/* присутствие */
.presence-box { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.presence-box:hover { background: rgba(255,255,255,.14); }
.presence-avatars { display: flex; align-items: center; }
.presence-ava { margin-left: -8px; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.presence-ava:first-child { margin-left: 0; }
.presence-ava.guest { border-style: dashed; border-color: #ffd83d; }
.presence-ava.more {
  background: #45526b; color: #fff; font-size: 11px; font-weight: 700;
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.presence-count { font-size: 12px; color: rgba(255,255,255,.9); white-space: nowrap; }

/* ресайз и меню списка */
.list-resize {
  position: absolute; top: 0; right: -3px; width: 10px; height: 100%;
  cursor: ew-resize; z-index: 3; touch-action: none;
}
.list-resize::after {
  content: ''; position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 3px; height: 34px; border-radius: 3px; background: rgba(9,30,66,.18); opacity: 0; transition: opacity .15s;
}
.list:hover .list-resize::after { opacity: 1; }
.list-menu-btn {
  background: transparent; border: none; color: #626f86; font-size: 18px; line-height: 1;
  padding: 2px 8px; border-radius: 6px; cursor: pointer;
}
.list-menu-btn:hover { background: rgba(9,30,66,.1); }

/* типографика в настройках доски */
.typo-preview {
  padding: 14px 16px; border-radius: 10px; background: #f1f2f4; color: #172b4d;
  margin-bottom: 10px; border: 1px solid #dfe1e6;
}
.typo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.typo-row select { flex: 1; padding: 8px; border-radius: 8px; }
.typo-row input[type=range] { flex: 1; }
.range-val { min-width: 42px; text-align: right; color: #5e6c84; font-weight: 600; }
.board-ava-preview {
  width: 56px; height: 56px; border-radius: 12px; background-size: cover; background-position: center;
  background-color: #0079bf; color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase;
}

/* карточки доски на главной */
.board-tile .tile-head { display: flex; align-items: center; gap: 10px; }
.board-tile .tile-title { font-weight: 700; font-size: 15px; }

/* баннер на главной */
.home-banner {
  border-radius: 16px; overflow: hidden; margin-bottom: 22px; min-height: 180px;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
  display: flex; align-items: flex-end;
}
.home-banner-overlay {
  width: 100%; padding: 26px 28px;
  background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,.05));
  color: #fff;
}
.home-banner-overlay h1 { font-size: 26px; margin: 0 0 4px; }
.home-banner-overlay p { margin: 0; opacity: .92; }

/* более крупные и стильные кнопки действий в карточке */
.modal-side button.btn-subtle {
  padding: 10px 12px; font-size: 13.5px; font-weight: 600; border-radius: 9px;
  transition: background .14s, transform .1s;
}
.modal-side button.btn-subtle:hover { transform: translateX(2px); }
