/* ATLANTIS admin. Tokens first; dark is the house look, light is its own selected set, not an inversion. */
:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --surface: #141312;
  --surface-2: #1b1a18;
  --surface-3: #252320;
  --raise: #2d2b27;
  --line: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f1efea;
  --text-2: #b9b5ab;
  --muted: #86827a;
  --faint: #5e5b55;
  --accent: #e8692f;
  --accent-2: #f27d47;
  --accent-soft: rgba(232, 105, 47, 0.13);
  --accent-ink: #170b05;
  --good: #34b84a;
  --good-soft: rgba(52, 184, 74, 0.13);
  --warn: #f2b134;
  --warn-soft: rgba(242, 177, 52, 0.13);
  --serious: #ef8a5f;
  --serious-soft: rgba(239, 138, 95, 0.13);
  --critical: #f07070;
  --critical-mark: #d64545;
  --critical-soft: rgba(214, 69, 69, 0.15);
  --s1: #3d8be8; --s2: #d95926; --s3: #1aa576; --s4: #c98a00;
  --s5: #d65686; --s6: #2e9a2e; --s7: #978cec; --s8: #e66767;
  --prev: #67645d;
  --grid: #1f1e1b;
  --axis: #36342f;
  --heat-0: #14243a; --heat-1: #12417a; --heat-2: #1d5cab; --heat-3: #3d8be8; --heat-4: #8fbcf1;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ee;
  --surface: #fdfdfb;
  --surface-2: #f2f1ec;
  --surface-3: #e8e6e0;
  --raise: #ffffff;
  --line: rgba(20, 18, 12, 0.08);
  --line-2: rgba(20, 18, 12, 0.15);
  --text: #15140f;
  --text-2: #4f4d48;
  --muted: #817e76;
  --faint: #a9a69e;
  --accent: #cc551c;
  --accent-2: #b84a14;
  --accent-soft: rgba(204, 85, 28, 0.1);
  --accent-ink: #ffffff;
  --good: #15802a;
  --good-soft: rgba(21, 128, 42, 0.1);
  --warn: #946400;
  --warn-soft: rgba(242, 177, 52, 0.2);
  --serious: #b7542b;
  --serious-soft: rgba(239, 138, 95, 0.16);
  --critical: #b8302f;
  --critical-mark: #d03b3b;
  --critical-soft: rgba(208, 59, 59, 0.1);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #e09a00;
  --s5: #e0709a; --s6: #1f8a1f; --s7: #4a3aa7; --s8: #e34948;
  --prev: #a9a69f;
  --grid: #ebe9e3;
  --axis: #cbc9c0;
  --heat-0: #e7effa; --heat-1: #b7d3f6; --heat-2: #6da7ec; --heat-3: #2a78d6; --heat-4: #184f95;
  --shadow: 0 16px 48px rgba(20, 18, 12, 0.13);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link { border-bottom: 1px solid var(--line-2); }
a.link:hover { border-bottom-color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.subtle, .dim { color: var(--muted); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade 0.2s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 14px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.brand .mark svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand b { font-weight: 600; letter-spacing: 0.16em; font-size: 13px; display: block; line-height: 1.15; }
.brand span { color: var(--muted); font-size: 11.5px; }
.nav-label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 6px; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; position: relative;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; font-size: 11px; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav .count.hot { background: var(--critical-soft); color: var(--critical); }
.side .spacer { flex: 1; min-height: 16px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); margin-top: 10px; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { color: var(--muted); font-size: 11.5px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.iconbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.main { min-width: 0; padding: 26px 32px 72px; max-width: 1600px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .grow { flex: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.overline { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- controls ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  color: var(--text-2); font-size: 13px; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--text);
  font-size: 13px; white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 500; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--critical); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.input, select.input, textarea.input {
  height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; min-width: 0; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; }
.search > svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; pointer-events: none; }
.search .input { padding-left: 33px; width: 280px; }
.search .drop { position: absolute; z-index: 15; top: 38px; left: 0; right: 0; min-width: 260px; padding: 6px; background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); }
.search .drop a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 7px; }
.search .drop a:hover, .search .drop a.sel { background: var(--surface-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-wide-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.section { margin-top: 16px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { font-size: 15px; font-weight: 600; margin: 0; }
.section-title span { color: var(--muted); font-size: 12.5px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; min-width: 0;
}
.card.flush { padding: 0; }
.card.flush > .card-head { padding: 16px 20px 6px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; min-width: 0; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .grow { flex: 1; }
.card-head .meta { color: var(--muted); font-size: 12.5px; }

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px 13px;
  min-width: 0; display: flex; flex-direction: column;
}
.tile .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.tile .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; min-height: 21px; }
.tile .spark { margin-top: auto; padding-top: 10px; height: 40px; }
.tile.hero .value { font-size: 38px; }
.pill {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--critical-soft); color: var(--critical); }
.d-good { color: var(--good); }
.d-bad { color: var(--critical); }
.d-flat { color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
table.t .ellip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.flush table.t th:first-child, .card.flush table.t td:first-child { padding-left: 20px; }
.card.flush table.t th:last-child, .card.flush table.t td:last-child { padding-right: 20px; }
.scroll-y { max-height: 480px; overflow-y: auto; }
.scroll-y table.t th { position: sticky; top: 0; z-index: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.serious { background: var(--serious-soft); color: var(--serious); }
.badge.critical { background: var(--critical-soft); color: var(--critical); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }
.dot.live { color: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.player-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.player-cell b { font-weight: 500; }
.bar-mini { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 5px; width: 92px; }
.bar-mini i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .ax text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .ax line { stroke: var(--grid); stroke-width: 1; }
.chart .ax .base { stroke: var(--axis); }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -2px 0 12px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.box { width: 10px; height: 10px; border-radius: 3px; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 150px; max-width: 320px;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px;
  box-shadow: var(--shadow); font-size: 12.5px;
}
.tip .t-title { color: var(--muted); font-size: 11.5px; margin-bottom: 5px; }
.tip .t-row { display: flex; align-items: center; gap: 8px; line-height: 1.65; }
.tip .t-row i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip .t-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .t-row span { color: var(--text-2); }
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--muted); }
.heat .cell { height: 24px; border-radius: 4px; background: var(--surface-2); outline: 1px solid transparent; }
.heat .cell:hover { outline-color: var(--text-2); }
.heat .hl { display: flex; align-items: center; }
.heat .hh { text-align: center; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.scale .ramp { display: flex; gap: 2px; }
.scale .ramp i { width: 20px; height: 8px; border-radius: 2px; display: block; }
.bars-list { display: flex; flex-direction: column; gap: 11px; }
.bars-list .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; font-size: 13px; }
.bars-list .row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-list .row .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bars-list .row .track i { display: block; height: 100%; border-radius: 6px; background: var(--s1); }
.bars-list .row .v { color: var(--text-2); font-variant-numeric: tabular-nums; }
table.cohort td.c { text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; padding: 4px 3px; }
table.cohort td.c span { display: block; border-radius: 5px; padding: 4px 0; min-width: 38px; }
table.cohort th.c { text-align: center; padding: 8px 3px; }

/* ---------- alerts & empty ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--surface-2); }
.alert .ic { margin-top: 1px; display: inline-flex; }
.alert .ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alert b { font-weight: 500; display: block; }
.alert span { color: var(--text-2); font-size: 12.5px; }
.alert.serious .ic { color: var(--serious); }
.alert.warning .ic { color: var(--warn); }
.alert.critical .ic { color: var(--critical); }
.alert.ok .ic { color: var(--good); }
.empty { color: var(--muted); padding: 34px 16px; text-align: center; font-size: 13px; line-height: 1.55; }
.empty b { display: block; color: var(--text-2); font-weight: 500; margin-bottom: 3px; font-size: 13.5px; }
.empty.left { text-align: left; padding: 6px 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px 11px; cursor: pointer; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; transition: border-color 0.12s, background 0.12s; }
.col.drop { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 500; font-size: 13px; }
.col-head .n { color: var(--muted); font-weight: 400; }
.col-head .st { width: 8px; height: 8px; border-radius: 50%; }
.cards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; }
.task {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: border-color 0.12s;
}
.task:hover { border-color: var(--line-2); }
.task.dragging { opacity: 0.45; }
.task .title { font-weight: 500; line-height: 1.38; }
.task .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.task .meta .push { margin-left: auto; }
.task .meta svg.ic-s { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.task .meta .cm, .task .meta .due { display: inline-flex; align-items: center; gap: 4px; }
.prio { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; }
.prio i { width: 3px; border-radius: 1px; background: var(--surface-3); }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 11px; }
.prio.p1 i:nth-child(1), .prio.p2 i:nth-child(-n+2), .prio.p3 i { background: var(--text-2); }
.prio.p4 i { background: var(--critical-mark); }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }
.avatar {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  font-size: 11px; font-weight: 600; color: #fff; flex: none;
}
.due.over { color: var(--critical); }

/* ---------- drawer & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 40; display: flex; justify-content: flex-end; }
.drawer {
  width: min(580px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--line-2);
  overflow-y: auto; padding: 22px 24px 44px; box-shadow: var(--shadow);
}
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 45; display: grid; place-items: center; padding: 16px; }
.modal { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(760px, 100%); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-2); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.err { color: var(--critical); font-size: 13px; min-height: 18px; }
.comments { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 14px; }
.comment { display: flex; gap: 10px; }
.comment .body { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; flex: 1; white-space: pre-wrap; word-break: break-word; }
.comment .body .by { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.log { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(640px 320px at 50% -40px, var(--accent-soft), transparent 70%), var(--bg); }
.login .box { width: min(370px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 28px 24px; box-shadow: var(--shadow); }
.login .brand { padding: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login .input { width: 100%; height: 40px; }
.login .btn { width: 100%; height: 40px; justify-content: center; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.loading { opacity: 0.55; transition: opacity 0.15s; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.flow .f { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.flow .f b { display: block; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.flow .f span { color: var(--text-2); font-size: 12.5px; }
.pill-online { color: var(--good); display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.group { cursor: pointer; transition: border-color 0.12s, background 0.12s; display: flex; flex-direction: column; }
.group:hover { border-color: var(--line-2); }
.group.on { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 75%), var(--surface); }
.group .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.group .top b { font-weight: 600; font-size: 14px; }
.group .big { font-size: 29px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.group .big small { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.group .spark { margin-top: auto; padding-top: 10px; height: 40px; }
.group.more { justify-content: center; gap: 2px; border-style: dashed; color: var(--text-2); min-height: 120px; }
.group.more:hover { color: var(--text); }
.group.more svg { width: 18px; height: 18px; margin-top: 10px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meter { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--s1); }
.meter.warn i { background: var(--warn); }
.meter.crit i { background: var(--critical-mark); }
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel .step { display: grid; grid-template-columns: 190px minmax(0, 1fr) 120px; gap: 14px; align-items: center; font-size: 13px; }
.funnel .bar { height: 28px; border-radius: 7px; background: var(--surface-3); overflow: hidden; }
.funnel .bar i { display: block; height: 100%; background: var(--s1); border-radius: 7px; }
.funnel .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.funnel .v b { color: var(--text); font-weight: 600; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.chip b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
button.chip { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 12.5px; transition: border-color 0.12s, color 0.12s; }
button.chip:hover { color: var(--text); border-color: var(--line-2); }
button.chip.on { border-color: var(--accent); color: var(--text); }
button.chip b { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font-size: 12.5px; }
.chips:empty { display: none; }

@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wide, .g-wide-r { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 0.18s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .main { padding: 18px 16px 56px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .search .input { width: 100%; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(4, minmax(260px, 86vw)); }
  .funnel .step { grid-template-columns: 1fr; gap: 4px; }
  .tile .value { font-size: 24px; }
}
#app { min-height: 100%; }
.login { min-height: 100vh; }
.grid.top { align-items: start; }
.cover-note {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text-2); font-size: 12.5px; line-height: 1.55;
}
.cover-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; stroke: var(--s1); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
