/* Планер. Палитра: бумага диспетчерского стола, графитовые чернила, янтарный сигнал "ждёт меня". */
:root {
  --paper: #EEF1EC;
  --panel: #FFFFFF;
  --sunk: #E5E9E2;
  --ink: #16202B;
  --ink-2: #3A4552;
  --muted: #5F6A77;
  --line: #D3D8D0;
  --line-soft: #E3E7E0;
  --signal: #C98A0B;
  --signal-fill: #E7AE3A;
  --signal-soft: #FBF0D6;
  --signal-ink: #7A5200;
  --focus: #2F5BD0;
  --ok: #2E7D52;
  --danger: #B5382A;
  --c-me: #16202B;
  --c-cursor: #2F5BD0;
  --c-claude: #9B4A8C;
  --c-opencode: #11806F;
  --shadow: 0 1px 0 rgba(22, 32, 43, .04), 0 12px 32px -18px rgba(22, 32, 43, .28);
  --radius: 10px;
  --side-w: 252px;
  --panel-w: 600px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11161C;
    --panel: #181F27;
    --sunk: #0D1116;
    --ink: #E4E8EC;
    --ink-2: #C3CAD2;
    --muted: #949EAA;
    --line: #2B343F;
    --line-soft: #222A33;
    --signal: #E7AE3A;
    --signal-fill: #E7AE3A;
    --signal-soft: #2E2615;
    --signal-ink: #F1C76A;
    --focus: #7FA2FF;
    --ok: #5DBB86;
    --danger: #F07A68;
    --c-me: #E4E8EC;
    --c-cursor: #7FA2FF;
    --c-claude: #D58BC6;
    --c-opencode: #4CC0AE;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #11161C;
  --panel: #181F27;
  --sunk: #0D1116;
  --ink: #E4E8EC;
  --ink-2: #C3CAD2;
  --muted: #949EAA;
  --line: #2B343F;
  --line-soft: #222A33;
  --signal: #E7AE3A;
  --signal-fill: #E7AE3A;
  --signal-soft: #2E2615;
  --signal-ink: #F1C76A;
  --focus: #7FA2FF;
  --ok: #5DBB86;
  --danger: #F07A68;
  --c-me: #E4E8EC;
  --c-cursor: #7FA2FF;
  --c-claude: #D58BC6;
  --c-opencode: #4CC0AE;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 18px 12px 20px;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; text-decoration: none; }
.brand svg { flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-weight: 520;
}
.nav a:hover { background: color-mix(in oklab, var(--panel) 70%, transparent); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav a[aria-current="page"] .ic { color: var(--ink); }
.nav .count { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.nav .count.lit { background: var(--signal-fill); color: #241800; font-weight: 650; padding: 0 8px; border-radius: 999px; line-height: 22px; }
.nav-title { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nav-title button { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.nav-title button:hover { background: var(--panel); color: var(--ink); }
.nav .proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .dot-wait { width: 7px; height: 7px; border-radius: 50%; background: var(--signal-fill); flex: none; margin-right: -2px; }
.nav .dot-wait.off { background: transparent; }
.side-foot { margin-top: auto; }

.topbar { display: none; }
.main { min-width: 0; padding: 30px 44px 96px; }
.app.with-panel .main { transition: margin .18s ease-out; }
@media (min-width: 1500px) {
  .app.with-panel .main { margin-right: var(--panel-w); }
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; max-width: 1040px; }
.head.narrow { max-width: 820px; }
.head h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; }
.head .sub { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.head .sub a { color: var(--ink-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in oklab, var(--ink) 30%, var(--line)); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.btn.primary:hover { background: color-mix(in oklab, var(--ink) 88%, var(--focus)); }
.btn.signal { background: var(--signal-fill); border-color: var(--signal-fill); color: #241800; }
.btn.signal:hover { background: color-mix(in oklab, var(--signal-fill) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--panel); border-color: var(--line); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--paper); border-color: var(--line); color: var(--ink); }
.icon-btn .ic { width: 18px; height: 18px; }

.input, .select, textarea.input {
  min-height: 38px; padding: 7px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  max-width: 100%;
}
.input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--muted) 80%, transparent); }
.input:hover, .select:hover { border-color: color-mix(in oklab, var(--ink) 25%, var(--line)); }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%235F6A77' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
textarea.input { width: 100%; resize: vertical; line-height: 1.5; min-height: 84px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); min-height: 38px; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }

/* ---------- фильтры ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; max-width: 1040px; }
.filters .search { flex: 1 1 220px; min-width: 180px; padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.6' fill='none' stroke='%235F6A77' stroke-width='1.6'/%3E%3Cpath d='m10.5 10.5 3 3' stroke='%235F6A77' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; }
.filters .select { font-size: 14px; }
.filters .select.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.filters .reset { color: var(--muted); }

.quick { display: flex; gap: 8px; margin: 4px 0 6px; max-width: 1040px; }
.quick .input { flex: 1; background: transparent; border-style: dashed; }
.quick .input:focus { background: var(--panel); border-style: solid; }

/* ---------- списки задач ---------- */
.list { max-width: 1040px; }
.group { margin-top: 22px; }
.group:first-child { margin-top: 10px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 6px; color: var(--ink-2); font-weight: 650; font-size: 14px; }
.group-head .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-head a { text-decoration: none; }
.group-head a:hover { text-decoration: underline; }
.rows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 10px 14px 10px 10px; cursor: pointer; position: relative;
}
.row + .row { border-top: 1px solid var(--line-soft); }
.row:hover { background: color-mix(in oklab, var(--paper) 55%, var(--panel)); }
.row.sel { background: color-mix(in oklab, var(--focus) 8%, var(--panel)); }
.row.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--focus); }
.row .title { font-weight: 520; min-width: 0; overflow-wrap: anywhere; }
.row .title .id { color: var(--muted); font-weight: 450; font-size: 13px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.row.closed .title { color: var(--muted); font-weight: 450; }
.row.closed.done .title { text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 60%, transparent); }
.row .meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.row .meta .proj { color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.row .sub-count { font-variant-numeric: tabular-nums; }
.row .q-hint { grid-column: 2 / -1; color: var(--signal-ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio i { width: 3px; border-radius: 1px; background: currentColor; }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 12px; }
.prio.high { color: var(--signal); }
.prio.urgent { color: var(--danger); }
.due { font-variant-numeric: tabular-nums; }
.due.late { color: var(--danger); font-weight: 600; }

.agent { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.agent i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.agent.me i { background: transparent; box-shadow: inset 0 0 0 2px var(--c-me); }
.ag-me { --c: var(--c-me); } .ag-cursor { --c: var(--c-cursor); } .ag-claude { --c: var(--c-claude); } .ag-opencode { --c: var(--c-opencode); }

.st { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 0; padding: 0; background: transparent; cursor: pointer; color: var(--muted); }
.st:hover { background: var(--paper); }
.st svg { width: 16px; height: 16px; display: block; }
.st-in_progress { color: var(--focus); }
.st-waiting_me { color: var(--signal); }
.st-answered { color: var(--focus); }
.st-done { color: var(--ok); }
.st-waiting_other { color: var(--muted); }

.empty { max-width: 560px; padding: 36px 4px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 19px; font-weight: 650; margin: 0 0 6px; letter-spacing: -.01em; }
.empty p { margin: 0 0 16px; }

/* ---------- "Ждут меня" ---------- */
.lead { max-width: 820px; color: var(--muted); margin: -8px 0 22px; }
.strips { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--signal-fill);
  border-radius: 6px var(--radius) var(--radius) 6px;
  padding: 16px 20px 18px 18px;
  box-shadow: var(--shadow);
}
.strip.answered { border-left-color: var(--focus); box-shadow: none; }
.strip-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.strip-meta .proj { color: var(--ink-2); font-weight: 560; text-decoration: none; }
.strip-meta .proj:hover { text-decoration: underline; }
.strip-meta .age { margin-left: auto; color: var(--signal-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.strip.answered .strip-meta .age { color: var(--focus); }
.strip h3 { margin: 8px 0 12px; font-size: 18.5px; line-height: 1.3; font-weight: 660; letter-spacing: -.012em; }
.strip h3 button { all: unset; cursor: pointer; }
.strip h3 button:hover { text-decoration: underline; text-underline-offset: 3px; }
.strip h3 button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.strip h3 .id { color: var(--muted); font-weight: 450; font-size: 14px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.say { background: var(--paper); border-radius: 10px; padding: 12px 15px 13px; }
.say .who { font-size: 12.5px; font-weight: 650; color: var(--c, var(--ink-2)); margin-bottom: 4px; }
.say.mine { background: color-mix(in oklab, var(--focus) 7%, var(--panel)); border: 1px solid color-mix(in oklab, var(--focus) 18%, transparent); margin-top: 10px; }
.say.mine .who { color: var(--focus); }
.ctx { margin-top: 10px; color: var(--muted); font-size: 14px; }
.ctx summary { cursor: pointer; color: var(--ink-2); font-weight: 520; width: fit-content; }
.ctx .md { margin-top: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.opts .btn { font-weight: 560; }
.reply { margin-top: 12px; display: grid; gap: 10px; }
.reply textarea.input { min-height: 76px; background: var(--panel); }
.reply-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reply-bar .hint { color: var(--muted); font-size: 13px; margin-left: auto; }
.section-title { margin: 34px 0 10px; font-size: 15px; font-weight: 650; color: var(--ink-2); max-width: 820px; display: flex; gap: 10px; align-items: baseline; }
.section-title .n { color: var(--muted); font-weight: 500; }
.section-note { color: var(--muted); font-size: 14px; margin: -4px 0 12px; max-width: 820px; }

/* ---------- текст задачи (markdown) ---------- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md h4 { margin: 12px 0 4px; font-size: 15px; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; background: color-mix(in oklab, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--sunk); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 6px 0 10px; }
.md pre code { background: none; padding: 0; font-size: 13px; }
.md a { color: var(--focus); text-underline-offset: 2px; }

/* ---------- панель задачи ---------- */
.scrim { display: none; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
  width: min(var(--panel-w), 100vw);
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(22, 32, 43, .35);
  display: flex; flex-direction: column;
  animation: slide-in .16s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-bar .id { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.panel-bar .grow { flex: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; }
.status-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14px; }
.status-pick:hover { border-color: color-mix(in oklab, var(--ink) 30%, var(--line)); }
.status-pick svg { width: 16px; height: 16px; }
.status-pick.waiting_me { background: var(--signal-soft); border-color: color-mix(in oklab, var(--signal) 45%, transparent); color: var(--signal-ink); }
.title-edit {
  width: 100%; border: 1px solid transparent; background: transparent; resize: none; overflow: hidden;
  font-size: 22px; line-height: 1.28; font-weight: 680; letter-spacing: -.016em; padding: 4px 6px; margin: 0 -6px 12px; border-radius: 8px;
  min-height: 0;
}
.title-edit:hover { border-color: var(--line); }
.title-edit:focus { border-color: var(--line); background: var(--paper); outline: none; box-shadow: 0 0 0 2px color-mix(in oklab, var(--focus) 40%, transparent); }
.fields { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 2px 12px; align-items: center; margin-bottom: 18px; }
.fields > label, .fields > .lbl { color: var(--muted); font-size: 14px; }
.fields .val { min-height: 36px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fields .select, .fields .input { border-color: transparent; background-color: transparent; min-height: 34px; padding-top: 5px; padding-bottom: 5px; margin-left: -11px; width: calc(100% + 11px); }
.fields .select:hover, .fields .input:hover { border-color: var(--line); }
.fields .select:focus, .fields .input:focus { border-color: var(--line); background-color: var(--paper); }
.fields .plain { color: var(--ink-2); overflow-wrap: anywhere; }
.fields .plain small { color: var(--muted); font-size: 13px; }
.block { margin: 22px 0 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.block-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.block-head .n { color: var(--muted); font-weight: 500; margin-left: 6px; }
.desc { border-radius: 8px; padding: 2px 0; }
.desc.empty-desc { color: var(--muted); }
.qa { border-left: 4px solid var(--signal-fill); background: var(--signal-soft); border-radius: 4px 10px 10px 4px; padding: 12px 14px; }
.qa.answered { border-left-color: var(--focus); background: color-mix(in oklab, var(--focus) 7%, var(--panel)); }
.qa .who { font-size: 12.5px; font-weight: 650; margin-bottom: 4px; color: var(--signal-ink); }
.qa.answered .who { color: var(--focus); }
.qa .answer-view { margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in oklab, var(--focus) 30%, transparent); }
.qa .reply textarea.input { background: var(--panel); }
.subs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.subs .row { padding: 7px 10px 7px 8px; }
.subs .add { display: flex; gap: 8px; padding: 6px; border-top: 1px solid var(--line-soft); background: var(--paper); }
.subs .add .input { flex: 1; min-height: 34px; background: var(--panel); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.history li:first-child { border-top: 0; }
.history .h-who { font-weight: 600; color: var(--ink-2); }
.history .h-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history .h-text { grid-column: 1 / -1; color: var(--ink-2); }
.history .h-text.md { color: var(--ink); }
.note-add { display: grid; gap: 8px; margin-top: 8px; }
.note-add textarea.input { min-height: 60px; }
.danger-zone { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.stale { display: flex; align-items: center; gap: 10px; background: var(--signal-soft); color: var(--signal-ink); padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

/* ---------- меню ---------- */
.menu {
  position: fixed; z-index: 50; min-width: 210px; max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 5px; display: flex; flex-direction: column;
}
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; min-height: 36px; }
.menu button:hover, .menu button:focus-visible { background: var(--paper); outline: none; }
.menu button[aria-checked="true"] { font-weight: 650; }
.menu button svg { width: 16px; height: 16px; flex: none; }

/* ---------- подключения ---------- */
.cards { display: grid; gap: 16px; max-width: 860px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 680; letter-spacing: -.01em; }
.card > p { margin: 0 0 14px; color: var(--muted); max-width: 64ch; }
.steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; }
.steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.copy-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-line code, .token-box code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.copy-line code { flex: 1 1 260px; }
.kv { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.kv li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.kv .grow { flex: 1; min-width: 180px; }
.kv .muted { color: var(--muted); font-size: 13px; }
.kv li.revoked { opacity: .55; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-row .input { flex: 1 1 200px; }
.token-box { margin-top: 14px; border: 1px solid color-mix(in oklab, var(--signal) 45%, transparent); background: var(--signal-soft); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.token-box p { margin: 0; color: var(--signal-ink); font-weight: 560; }
.token-box pre { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.45; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13.5px; min-height: 32px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.rules { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-height: 340px; overflow: auto; white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; font-family: inherit; }

/* ---------- вход ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.gate-card .brand { padding: 0; margin-bottom: 18px; }
.gate-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.gate-card p { margin: 0 0 16px; color: var(--muted); }
.gate-card label { display: block; font-weight: 560; font-size: 14px; margin: 12px 0 6px; }
.gate-card .input { width: 100%; }
.gate-card .btn { width: 100%; margin-top: 18px; }
.gate-card code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.err { color: var(--danger); font-weight: 560; margin-top: 10px; font-size: 14px; }

/* ---------- уведомления ---------- */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 560; font-size: 14px; box-shadow: var(--shadow); pointer-events: auto; max-width: min(560px, calc(100vw - 32px)); }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- узкие экраны ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 86vw);
    background: var(--paper); transform: translateX(-102%); visibility: hidden;
    transition: transform .18s ease-out, visibility 0s linear .18s;
  }
  .app.nav-open .side {
    transform: none; visibility: visible; transition: transform .18s ease-out;
    box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .4);
  }
  .app.nav-open .scrim, .app.with-panel .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 14, 18, .32); }
  .app.nav-open .scrim { z-index: 35; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    padding: 10px 12px; background: color-mix(in oklab, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; font-size: 16px; }
  .topbar .grow { flex: 1; }
  .topbar .wait-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--signal-fill); color: #241800; font-weight: 650; border-radius: 999px; padding: 4px 11px; text-decoration: none; font-size: 14px; }
  .main { padding: 20px 16px 96px; }
  .head .new-btn { display: none; }
  .head h1 { font-size: 24px; }
  .row { grid-template-columns: 24px minmax(0, 1fr); }
  .row .meta { grid-column: 2; white-space: normal; flex-wrap: wrap; gap: 4px 12px; }
  .row .q-hint { grid-column: 2; white-space: normal; }
  .strip { padding: 14px 14px 16px 13px; }
  .strip-meta .age { margin-left: 0; }
  .panel { width: 100vw; border-left: 0; }
  .panel-body { padding: 16px 16px 40px; }
  .fields { grid-template-columns: 108px minmax(0, 1fr); }
  .reply-bar .hint { display: none; }
  .card { padding: 18px 16px; }
}
