@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/static/vendor/fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/static/vendor/fonts/golos-text-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/static/vendor/fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/static/vendor/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  --font: "Golos Text", ui-sans-serif, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --fs: 14px;
  --fs-s: 12.5px;
  --fs-xs: 11.5px;
  --r: 6px;
  --r-s: 4px;
  --gap: 12px;

  --bg: #f3f1ea;
  --surface: #fbfaf6;
  --surface-2: #efece3;
  --line: #dcd8cb;
  --line-strong: #c4bfaf;
  --text: #1c1c17;
  --muted: #6b685d;
  --faint: #9c988b;
  --ink: #16170f;
  --on-ink: #f6f5ee;
  --accent: #5d7a00;
  --accent-bg: #e4efb8;
  --focus: #6f9200;
  --gate-accent: #c8e64a;

  --grey: #77746a;    --grey-bg: #e6e3da;
  --blue: #1f5fbf;    --blue-bg: #dce8fa;
  --green: #2c7a3c;   --green-bg: #dcefdc;
  --orange: #b85a00;  --orange-bg: #fae6cf;
  --red: #b3261e;     --red-bg: #f8dcd9;

  --shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 8px 24px rgba(20, 20, 10, .08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11120e;
    --surface: #191a15;
    --surface-2: #22231d;
    --line: #2e2f27;
    --line-strong: #43453a;
    --text: #e8e6dc;
    --muted: #a19e91;
    --faint: #6f6c61;
    --ink: #e8e6dc;
    --on-ink: #16170f;
    --accent: #c8e64a;
    --accent-bg: #2d3512;
    --focus: #c8e64a;
    --gate-accent: #4f6a00;
    --grey: #a6a396;   --grey-bg: #2a2b24;
    --blue: #7fb0ff;   --blue-bg: #1b2a44;
    --green: #78cf86;  --green-bg: #183121;
    --orange: #f2a25a; --orange-bg: #3a2512;
    --red: #ff8a80;    --red-bg: #3d1a17;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11120e;
  --surface: #191a15;
  --surface-2: #22231d;
  --line: #2e2f27;
  --line-strong: #43453a;
  --text: #e8e6dc;
  --muted: #a19e91;
  --faint: #6f6c61;
  --ink: #e8e6dc;
  --on-ink: #16170f;
  --accent: #c8e64a;
  --accent-bg: #2d3512;
  --focus: #c8e64a;
  --gate-accent: #4f6a00;
  --grey: #a6a396;   --grey-bg: #2a2b24;
  --blue: #7fb0ff;   --blue-bg: #1b2a44;
  --green: #78cf86;  --green-bg: #183121;
  --orange: #f2a25a; --orange-bg: #3a2512;
  --red: #ff8a80;    --red-bg: #3d1a17;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs)/1.45 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 20px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 .5em; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-s); }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.gap-s { gap: 4px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: var(--gap); }
.hidden { display: none !important; }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 5px 8px;
  min-height: 30px;
  width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 2px var(--accent-bg); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
input.inline { border-color: transparent; background: transparent; padding: 3px 6px; min-height: 26px; }
input.inline:hover { border-color: var(--line); }
input.inline:focus { background: var(--surface); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; font-weight: 500;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { height: 26px; padding: 0 8px; font-size: var(--fs-s); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: var(--ink); opacity: .88; }
.btn.accent { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn.danger { background: var(--red-bg); color: var(--red); border-color: transparent; }
.btn.ok { background: var(--green-bg); color: var(--green); border-color: transparent; }

/* ---------- status, chips ---------- */
.status, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px; border-radius: 3px;
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; letter-spacing: .01em;
}
.chip { font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tone-grey { background: var(--grey-bg); color: var(--grey); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-orange { background: var(--orange-bg); color: var(--orange); }
.tone-red { background: var(--red-bg); color: var(--red); }
.chip.tone-grey, .chip.tone-blue, .chip.tone-green, .chip.tone-orange, .chip.tone-red { border-color: transparent; }
.crit { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; }
.prio { font: 700 10.5px/18px var(--mono); padding: 0 5px; border-radius: 3px; border: 1px solid currentColor; }
.prio.p1 { color: var(--text); background: var(--accent-bg); border-color: transparent; }
.prio.p2 { color: var(--muted); }
.prio.p3 { color: var(--faint); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; margin-left: 6px;
}
.count { color: var(--faint); font-weight: 500; margin-left: 6px; font-size: var(--fs-s); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 196px 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 52px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px; padding: 8px 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 4px; height: 36px; margin-bottom: 8px; font-weight: 700; letter-spacing: -0.01em; }
.brand b { color: var(--accent); margin-left: 3px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 9px;
  border-radius: var(--r-s); text-decoration: none; color: var(--muted); font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--ink); color: var(--on-ink); }
.nav-item.on .icon { color: var(--gate-accent); }
.nav-item .badge { margin-left: auto; }
.shell.collapsed .nav-item span, .shell.collapsed .brand span { display: none; }
.shell.collapsed .nav-item .badge { position: absolute; margin: -18px 0 0 16px; transform: scale(.85); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 52px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.whoami { color: var(--muted); font-weight: 500; padding: 0 4px; }
.content { padding: 16px; max-width: 1480px; width: 100%; }

.search { position: relative; display: flex; align-items: center; gap: 6px; width: min(420px, 100%); color: var(--muted); }
.search input { background: var(--surface); }
.search-results {
  position: absolute; top: 36px; left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.search-results a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r-s); text-decoration: none; color: var(--text); }
.search-results a:hover { background: var(--surface-2); }
.search-results small { color: var(--faint); }

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0; }
.page-head h1 input.inline { font: inherit; flex: 1; min-width: 0; }
.page-head select { width: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-pad { padding: 12px; }
.section { margin-top: 18px; }
.section > h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: var(--fs-s); }
.kv dd { margin: 0; min-width: 0; }

.empty { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--faint); }
.error-line { padding: 8px 12px; color: var(--red); background: var(--red-bg); border-radius: var(--r-s); }
.loading { display: flex; gap: 5px; padding: 18px; justify-content: center; }
.loading span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; }
.t th {
  text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
.t th button { all: unset; cursor: pointer; }
.t td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr.clickable { cursor: pointer; }
.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .title-cell { font-weight: 500; max-width: 520px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); min-height: 38px; }
.list > li:last-child { border-bottom: 0; }
.list > li:hover { background: var(--surface-2); }
.list .li-title { flex: 1; min-width: 0; }
.list .li-title a { text-decoration: none; font-weight: 500; }
.list .li-title small { display: block; color: var(--faint); font-size: var(--fs-xs); }
.list .li-actions { display: flex; gap: 4px; flex: none; }
.list select { width: auto; max-width: 150px; flex: none; }
.list input[type=date] { width: 140px; flex: none; }
.list .li-title input.inline { width: 100%; }

/* ---------- today ---------- */
.gate {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--ink); color: var(--on-ink); border-radius: var(--r);
}
.gate .days { font: 700 22px/1 var(--font); color: var(--gate-accent); }
.gate .gate-text { opacity: .8; font-size: var(--fs-s); flex: 1; min-width: 220px; }
.cols4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.col > header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.col > header h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.col .list > li { padding: 7px 12px; align-items: flex-start; }
.since { font-size: var(--fs-s); color: var(--muted); margin-bottom: 12px; }

/* ---------- map ---------- */
.ribbon { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 0; overflow-x: auto; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ms { padding: 10px 12px; border-right: 1px solid var(--line); position: relative; cursor: pointer; }
.ms:last-child { border-right: 0; }
.ms.active { background: var(--accent-bg); }
.ms.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.ms.passed { opacity: .65; }
.ms.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.ms .ms-top { display: flex; justify-content: space-between; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.ms h2 { font-size: 14px; margin: 3px 0 6px; }
.ms .ms-gate { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.progress .bar { flex: 1; height: 4px; background: var(--grey-bg); border-radius: 2px; overflow: hidden; min-width: 40px; }
.progress .bar i { display: block; height: 100%; background: var(--green); }
.lanes { display: grid; grid-template-columns: repeat(var(--lanes, 4), minmax(0, 1fr)); gap: 12px; align-items: start; }
.lane > h3 { padding: 0 2px 8px; display: flex; justify-content: space-between; }
.lane .bcards { display: flex; flex-direction: column; gap: 8px; }
.bcard {
  display: block; text-decoration: none; padding: 10px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .12s;
}
.bcard:hover { border-color: var(--line-strong); }
.bcard.blocked { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.bcard.done { opacity: .6; }
.bcard .bc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.bcard .bc-title { font-weight: 600; line-height: 1.25; flex: 1; }
.bcard .bc-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 6px; }
.bcard .bc-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: var(--fs-xs); }
.dep { font-size: var(--fs-xs); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 3px; padding: 0 5px; height: 18px; display: inline-flex; align-items: center; }
.dep.blocking { color: var(--orange); border-color: var(--orange); }

/* ---------- branch ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.inline-text.editable { cursor: text; border-radius: var(--r-s); padding: 4px 6px; margin: -4px -6px; }
.inline-text.editable:hover { background: var(--surface-2); }
.inline-edit textarea { margin-bottom: 6px; }
.add-line { display: flex; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); }
.add-line input { min-height: 28px; }
.task-done .li-title { color: var(--faint); text-decoration: line-through; }

/* ---------- panel / modal ---------- */
.panel-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 5, .35); }
.panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100vw);
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: slide .16s ease-out;
}
.panel.wide { width: min(1100px, 100vw); }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.panel-head h2 { font-size: 15px; min-width: 0; }
.panel-body { padding: 14px; overflow-y: auto; flex: 1; }
.modal { position: absolute; left: 50%; top: 8vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 84vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.modal-body { padding: 14px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: var(--fs-s); color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.field small { color: var(--faint); font-size: var(--fs-xs); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: 7px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--ink); }

/* ---------- collapsible ---------- */
.collapsible { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.collapsible + .collapsible { margin-top: 8px; }
.collapsible-head { all: unset; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; padding: 8px 12px; font-weight: 600; }
.collapsible-head .icon { transition: transform .12s; color: var(--muted); }
.collapsible.open .collapsible-head .icon { transform: rotate(90deg); }
.collapsible-body { padding: 0 12px 12px; }

/* ---------- markdown ---------- */
.md { line-height: 1.55; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1 { font-size: 18px; margin: 1em 0 .4em; }
.md h2 { font-size: 16px; margin: 1em 0 .4em; }
.md h3 { font-size: 14px; margin: .9em 0 .3em; text-transform: none; letter-spacing: 0; color: var(--text); }
.md ul, .md ol { padding-left: 20px; margin: .3em 0 .6em; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: var(--r-s); overflow-x: auto; }
.md code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: .5em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; }
.md blockquote { margin: .5em 0; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.md img { max-width: 100%; }
.summary { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }

/* ---------- prompt / editor ---------- */
.prompt-text { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; max-height: 60vh; overflow: auto; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pcard { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.pcard .pc-title { font-weight: 600; line-height: 1.3; text-decoration: none; }
.pcard .pc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.pcard .pc-actions { display: flex; gap: 6px; margin-top: auto; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.editor textarea.src { font-family: var(--mono); font-size: 13px; min-height: 62vh; }
.editor .preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-height: 62vh; max-height: 75vh; overflow: auto; }
.side { display: flex; flex-direction: column; gap: 10px; }
.tg-msg { white-space: pre-wrap; background: var(--blue-bg); border-radius: 10px 10px 10px 2px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; overflow-wrap: anywhere; }
.tg-msg a { color: var(--blue); }

/* ---------- diff ---------- */
.diff { font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: 50vh; background: var(--surface); }
.diff div { padding: 1px 8px; white-space: pre-wrap; }
.diff .add { background: var(--green-bg); }
.diff .del { background: var(--red-bg); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 40%, transparent); }

/* ---------- bars ---------- */
.bars { display: flex; flex-direction: column; gap: 5px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; font-size: var(--fs-s); }
.bars .b i { display: block; height: 10px; background: var(--ink); border-radius: 2px; min-width: 2px; }
.month-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.month-bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: var(--fs-xs); color: var(--muted); }
.month-bars .m i { width: 100%; max-width: 34px; background: var(--ink); border-radius: 2px 2px 0 0; display: block; }

/* ---------- activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; font-size: var(--fs-s); }
.activity li { padding: 4px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.activity time { color: var(--faint); margin-right: 6px; font-variant-numeric: tabular-nums; }
.activity b { color: var(--text); font-weight: 500; }
.activity code { font-size: 11.5px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--ink); color: var(--on-ink); padding: 9px 14px; border-radius: var(--r); box-shadow: var(--shadow); max-width: 380px; font-weight: 500; }
.toast.error { background: var(--red); color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(340px, 100%); }
.login .mark { font: 700 26px/1 var(--font); letter-spacing: -.02em; margin-bottom: 18px; }
.login .mark b { color: var(--accent); }
.login .btn { width: 100%; justify-content: center; height: 36px; margin-top: 4px; }

.secret-box { font-family: var(--mono); background: var(--accent-bg); color: var(--text); padding: 10px; border-radius: var(--r-s); word-break: break-all; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .editor .side { grid-column: 1 / -1; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 56px; z-index: 40;
    flex-direction: row; justify-content: space-around; padding: 4px; border-right: 0; border-top: 1px solid var(--line); overflow: visible;
  }
  .brand { display: none; }
  .nav-item { flex-direction: column; justify-content: center; gap: 0; height: 46px; padding: 0 2px; flex: 1; min-width: 0; }
  .nav-item span { display: none; }
  .nav-item .badge { position: absolute; margin: -22px 0 0 18px; transform: scale(.85); }
  .main { padding-bottom: 64px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar .btn span, .whoami { display: none; }
  .content { padding: 12px 12px 16px; }
  .cols4, .lanes, .grid2 { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor textarea.src, .editor .preview { min-height: 40vh; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 6px; }
  .toolbar select, .toolbar input { min-width: 0; flex: 1 1 140px; }
  .t .hide-sm { display: none; }
}
