:root {
  --bg: #f4f4f1;
  --panel: #ffffff;
  --panel-2: #fafaf8;
  --sunken: #ebebe6;
  --ink: #1d1d1b;
  --ink-2: #3f3e3a;
  --muted: #74736c;
  --faint: #a3a29a;
  --line: #e2e1db;
  --line-2: #d3d2ca;
  --accent: #2f5bd3;
  --accent-soft: #e6ecfb;
  --red: #c8372d;
  --red-soft: #fbe9e7;
  --amber: #a86a12;
  --amber-soft: #fbf0dc;
  --green: #2c8048;
  --green-soft: #e3f3e8;
  --violet: #7a4fd0;
  --teal: #16877c;
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.06), 0 1px 1px rgba(20, 20, 15, 0.04);
  --shadow-lg: 0 18px 50px rgba(20, 20, 15, 0.18), 0 2px 8px rgba(20, 20, 15, 0.08);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --panel: #1e1e1c;
    --panel-2: #232321;
    --sunken: #0f0f0e;
    --ink: #ecebe5;
    --ink-2: #cfcec7;
    --muted: #9b9a91;
    --faint: #6e6d66;
    --line: #2f2e2b;
    --line-2: #3d3c38;
    --accent: #85a5ff;
    --accent-soft: #1f2a47;
    --red: #ff8173;
    --red-soft: #3a1f1c;
    --amber: #e8b660;
    --amber-soft: #3a2e17;
    --green: #74d094;
    --green-soft: #183223;
    --violet: #b497ff;
    --teal: #5fd0c3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* кнопки и поля */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); color: var(--ink);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--faint); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 13px; border-radius: 6px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 26px; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); outline: none;
}
.select { padding-right: 4px; }
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > span { font-weight: 500; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 22px; height: 22px; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--sunken); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.search { position: relative; width: 240px; }
.search svg { position: absolute; left: 9px; top: 9px; color: var(--faint); }
.search .input { padding-left: 30px; height: 32px; }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 10.5px; font-weight: 650; color: #fff; letter-spacing: 0.02em;
}
.avatar.lg { width: 30px; height: 30px; font-size: 12px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 200px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 8px; border: 0; background: none; border-radius: 6px; color: var(--ink); cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--sunken); text-decoration: none; }
.menu .who { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

main.view { padding: 16px; }

/* фильтры */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border-radius: 9px; }
.chip { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer; color: var(--muted); }
.toggle.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.toolbar .sum { margin-left: auto; color: var(--muted); font-size: 13px; }

/* доска */
.board {
  display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 12px;
  height: calc(100vh - 136px); min-height: 360px; overflow-x: auto; padding-bottom: 8px;
}
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--sunken); border-radius: 12px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.col-head h2 { margin: 0; font-size: 13px; font-weight: 650; text-transform: none; }
.col-head .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.col-head .pts { margin-left: auto; color: var(--faint); font-size: 12px; }
.col-head .wip { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; color: var(--muted); background: var(--panel); cursor: default; }
.col-head .wip.over { color: var(--red); background: var(--red-soft); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cards { flex: 0 1 auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 8px; overflow-y: auto; min-height: 60px; }
.cards:empty::before { content: "Пусто"; display: grid; place-items: center; height: 56px; border: 1px dashed var(--line-2); border-radius: 9px; color: var(--faint); font-size: 12px; }
.col-foot { padding: 0 8px 8px; }
.col-foot .btn { width: 100%; justify-content: center; color: var(--muted); }
.col-foot .more { display: block; padding: 4px 4px 0; font-size: 12px; color: var(--muted); text-align: center; }

.card {
  position: relative;
  padding: 9px 10px 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow); cursor: pointer; user-select: none;
  touch-action: manipulation;
}
.card:hover { border-color: var(--line-2); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.card.cls-expedite::before { background: var(--red); }
.card.cls-fixed::before { background: var(--amber); }
.card.cls-intangible { background: var(--panel-2); }
.card.is-blocked { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.card.is-done .card-title { color: var(--muted); }
.card-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.card-top .key { font-family: var(--mono); font-size: 11px; }
.card-title { font-size: 13.5px; line-height: 1.38; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.card-meta .sp { flex: 1; }
.meta-i { display: inline-flex; align-items: center; gap: 3px; }
.meta-i svg.i { width: 13px; height: 13px; }
.meta-i.warn { color: var(--amber); }
.meta-i.bad { color: var(--red); }
.blocked-note { margin-top: 6px; padding: 4px 7px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 12px; display: flex; gap: 5px; align-items: flex-start; }
.blocked-note svg.i { width: 13px; height: 13px; margin-top: 2px; }
.grip { display: none; position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; place-items: center; color: var(--faint); touch-action: none; border-radius: 6px; }
@media (pointer: coarse) { .grip { display: grid; } .card { padding-right: 34px; } }

.type { display: inline-flex; align-items: center; gap: 4px; }
.type::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.t-feature { color: var(--accent); }
.t-bug { color: var(--red); }
.t-tech { color: var(--violet); }
.t-research { color: var(--teal); }
.t-task { color: var(--muted); }
.cls-badge { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.cls-badge.expedite { color: var(--red); }
.cls-badge.fixed { color: var(--amber); }
.cls-badge.intangible { color: var(--faint); }
.est { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--sunken); color: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.est.none { color: var(--faint); font-weight: 400; }
.tag { display: inline-block; padding: 0 6px; height: 18px; line-height: 18px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }

/* перетаскивание */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); transform-origin: 0 0; opacity: 0.95; rotate: 1.5deg; }
.drag-src { opacity: 0.35; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* бэклог */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.quick { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.quick-hint { padding: 0 12px 8px; font-size: 12px; color: var(--faint); background: var(--panel-2); border-bottom: 1px solid var(--line); margin-top: -1px; }
.rows:empty::before { content: "Здесь пока пусто"; display: block; padding: 28px; text-align: center; color: var(--faint); }
.lrow {
  display: grid; grid-template-columns: 18px 58px 1fr auto; gap: 10px; align-items: center;
  min-height: 44px; padding: 6px 12px 6px 6px; border-top: 1px solid var(--line); background: var(--panel); cursor: pointer;
}
.rows > .lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--panel-2); }
.lrow .handle { color: var(--faint); display: grid; place-items: center; cursor: grab; touch-action: none; height: 28px; }
.lrow .handle.off { visibility: hidden; }
.lrow .key { font: 11.5px var(--mono); color: var(--muted); }
.lrow .main { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lrow .title { overflow-wrap: anywhere; }
.lrow .right { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.lrow .forecast { color: var(--muted); font-size: 12px; white-space: nowrap; }
.lrow .status-badge { font-size: 11.5px; }
.lrow.is-blocked .title::before { content: "⛔ "; }
.est-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.est-btn:hover .est { outline: 1px solid var(--accent); }
.popover { position: absolute; z-index: 60; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 4px; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.s-backlog { color: var(--muted); } .s-backlog .dot { background: var(--faint); }
.s-todo { color: var(--ink-2); } .s-todo .dot { background: var(--ink-2); }
.s-doing { color: var(--accent); } .s-doing .dot { background: var(--accent); }
.s-review { color: var(--amber); } .s-review .dot { background: var(--amber); }
.s-done { color: var(--green); } .s-done .dot { background: var(--green); }

/* модалки */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15, 15, 12, 0.38); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 980px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.narrow { max-width: 560px; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); border-radius: 14px 14px 0 0; }
.modal-head .key { font: 13px var(--mono); color: var(--muted); white-space: nowrap; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.tview { display: grid; grid-template-columns: 1fr 270px; }
.tmain { padding: 16px 18px 20px; min-width: 0; }
.tside { padding: 14px; border-left: 1px solid var(--line); background: var(--panel-2); display: grid; gap: 12px; align-content: start; border-radius: 0 0 14px 0; }
.title-edit { width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; font-size: 20px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; background: transparent; resize: none; overflow: hidden; outline: none; }
.title-edit:hover { border-color: var(--line); }
.title-edit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 16px; }
.step { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px; }
.step:hover { color: var(--ink); border-color: var(--faint); }
.step.on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.step:disabled { cursor: default; }
.section-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.section-h .sp { flex: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); cursor: pointer; font-variant-numeric: tabular-nums; }
.pill:hover { border-color: var(--faint); }
.pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill:disabled { cursor: default; }
.side-row { display: grid; gap: 4px; }
.side-row > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.dates { font-size: 12px; color: var(--muted); display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.block-box { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; display: grid; gap: 6px; background: var(--panel); }
.block-box.on { border-color: var(--red); background: var(--red-soft); }

/* текст задачи */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; line-height: 1.3; }
.md h1 { font-size: 17px; } .md h2 { font-size: 15.5px; } .md h3 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md li.task { list-style: none; margin-left: -20px; display: flex; gap: 7px; align-items: flex-start; }
.md li.task input { margin-top: 3px; accent-color: var(--green); }
.md li.task.checked > span { color: var(--muted); text-decoration: line-through; }
.md code { font: 12.5px var(--mono); background: var(--sunken); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--sunken); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 8px; padding: 2px 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.desc { position: relative; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; cursor: text; }
.desc:hover { border-color: var(--line); }
.desc.empty { color: var(--faint); }
.hint-line { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--faint); font-weight: 400; }
.progress { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; margin: 2px 0 10px; }
.progress > div { height: 100%; background: var(--green); }

.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin: 20px 0 12px; }
.tab { padding: 6px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-color: var(--ink); }
.comment { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment .who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment .who b { font-weight: 600; }
.comment .who .acts { margin-left: auto; display: flex; gap: 2px; opacity: 0; }
.comment:hover .acts { opacity: 1; }
.composer { display: grid; gap: 8px; margin-top: 10px; }
.hist { display: grid; gap: 6px; font-size: 13px; }
.hist-row { display: flex; gap: 8px; align-items: baseline; color: var(--ink-2); }
.hist-row time { color: var(--faint); font-size: 12px; white-space: nowrap; margin-left: auto; }

/* поток */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12.5px; }
.tile.bad b { color: var(--red); }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 1400px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.panel h3 { margin: 0 0 2px; font-size: 14px; }
.panel .hint { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .bar { fill: var(--accent); }
.chart .bar.now { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.chart .val { fill: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.chart line { stroke: var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.t td { padding: 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
.agebar { height: 6px; border-radius: 3px; background: var(--sunken); position: relative; min-width: 80px; }
.agebar > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.agebar > div.over { background: var(--red); }
.agebar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); opacity: 0.5; }

/* лента */
.feed { max-width: 760px; }
.feed-day { margin: 18px 0 6px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.feed-row { display: grid; grid-template-columns: 44px 24px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.feed-row:hover { background: var(--panel); }
.feed-row time { color: var(--faint); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.feed-row .what { color: var(--ink-2); }
.feed-row .what b { font-weight: 600; color: var(--ink); }

/* настройки */
.settings { max-width: 820px; display: grid; gap: 14px; }
.settings .panel h3 { margin-bottom: 10px; }
.urow { display: grid; grid-template-columns: 30px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.urow:first-of-type { border-top: 0; }
.secret { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--ink); font: 12.5px var(--mono); overflow-wrap: anywhere; }
.secret code { flex: 1; min-width: 0; }
.wip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth form { width: 100%; max-width: 340px; display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.auth h1 { margin: 0 0 4px; font-size: 20px; display: flex; gap: 8px; align-items: center; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; translate: -50% 0; z-index: 90; display: grid; gap: 6px; justify-items: center; }
.toast { padding: 9px 14px; border-radius: 9px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; animation: pop 0.18s ease-out; }
.toast.bad { background: var(--red); color: #fff; }
.toast a { color: inherit; text-decoration: underline; }
@keyframes pop { from { opacity: 0; translate: 0 6px; } }

.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .search { width: 160px; }
  .panels { grid-template-columns: 1fr; }
  .tview { grid-template-columns: 1fr; }
  .tside { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; grid-template-columns: 1fr 1fr; }
  .tside .full { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .top > .grow { flex: 1; }
  .nav { order: 3; overflow-x: auto; }
  .search { order: 4; flex: 1 1 110px; width: auto; }
  .top .btn .lbl, .modal-head .btn .lbl { display: none; }
  .modal-head { border-radius: 0; }
  main.view { padding: 12px; }
  .board { grid-template-columns: repeat(4, 84vw); scroll-snap-type: x mandatory; gap: 10px; margin: 0 -12px; padding: 0 12px 8px; }
  .board { height: calc(100vh - 150px); }
  .col { scroll-snap-align: center; }
  .lrow { grid-template-columns: 18px 1fr; }
  .lrow .key { display: none; }
  .lrow .right { grid-column: 2; flex-wrap: wrap; }
  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; border: 0; }
  .urow { grid-template-columns: 30px 1fr auto; }
  .urow .hide-sm { display: none; }
  .wip-grid { grid-template-columns: 1fr; }
}
