/* Liftoff console. System fonts only, no external resources, no build.
   Direction: framed sheet. One tinted L-frame (sidebar + top bar) holds the work, which sits on a
   white sheet. Colour goes on data and status, not on chrome. The gate is the one loud thing:
   a stopped release reads in red from across the room, everything else stays quiet.

   Grid: sidebar 232 + sheet; sheet padding 32; one gap 20 everywhere. */

:root {
  color-scheme: light dark;
  --frame: #eceff1;
  --sheet: #ffffff;
  --raised: #f4f6f7;
  --active: #dfe3e6;
  --border: #e2e5e8;
  --rule: #eceef0;
  --control: #c9ced3;
  --text: #11161a;
  --muted: #5a6369;
  --faint: #8a9298;
  --accent: #0d6e86;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0f3;
  --ink-btn: #15191c;
  --ink-btn-text: #ffffff;
  --pos: #187a4a;
  --pos-soft: #ddf5e7;
  --pos-ink: #0b3d22;
  --neg: #c42a2a;
  --neg-soft: #fde9e7;
  --neg-ink: #7c1717;
  --neg-fill: #c42a2a;
  --warn: #9a5b00;
  --warn-soft: #fdf1d8;
  --warn-ink: #6b3b00;
  --neutral-soft: #e9ecee;
  --neutral-ink: #343a3f;
  --code-bg: #f1f3f4;
  --snippet-bg: #161b1f;
  --snippet-ink: #e4e8ea;
  --chart-1: #0d6e86;
  --chart-2: #8a9298;
  --grid: #e8eaec;
  --float-shadow: 0 12px 40px rgba(17, 22, 26, 0.16), 0 2px 6px rgba(17, 22, 26, 0.08);
  --r-sheet: 16px;
  --r-card: 10px;
  --r-ctl: 7px;
  --gap: 20px;
  --pad: 32px;
  --side-w: 232px;
  --top-h: 52px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame: #0c0d0e;
    --sheet: #151718;
    --raised: #1c1f21;
    --active: #262a2d;
    --border: #262a2d;
    --rule: #212426;
    --control: #3a3f43;
    --text: #eceff0;
    --muted: #a1a9ae;
    --faint: #737b80;
    --accent: #4cc0d8;
    --accent-ink: #061c22;
    --accent-soft: rgba(76, 192, 216, 0.13);
    --ink-btn: #eceff0;
    --ink-btn-text: #111315;
    --pos: #46c584;
    --pos-soft: rgba(70, 197, 132, 0.14);
    --pos-ink: #9be6bd;
    --neg: #ff6b63;
    --neg-soft: rgba(255, 107, 99, 0.14);
    --neg-ink: #ffb3ad;
    --neg-fill: #cf3a32;
    --warn: #f0b545;
    --warn-soft: rgba(240, 181, 69, 0.14);
    --warn-ink: #f7d38c;
    --neutral-soft: #24282b;
    --neutral-ink: #c4cace;
    --code-bg: #202326;
    --snippet-bg: #0b0c0d;
    --snippet-ink: #dfe4e6;
    --chart-1: #4cc0d8;
    --chart-2: #6b7378;
    --grid: #25292c;
    --float-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--frame); color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--sheet); padding: 8px 12px; }

/* ---------- Shell: tinted L-frame + white sheet ---------- */

.shell {
  display: grid; min-height: 100vh;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "side top" "side sheet";
}
.side { grid-area: side; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 12px 14px 14px; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 20px 0 6px; min-width: 0; }
.sheet {
  grid-area: sheet; background: var(--sheet); border: 1px solid var(--border);
  border-radius: var(--r-sheet); margin: 0 8px 8px 0; padding: 28px var(--pad) 48px; min-width: 0; outline: none;
}
body[data-view="login"] .shell { display: block; }
body[data-view="login"] .side, body[data-view="login"] .topbar { display: none; }
body[data-view="login"] .sheet { margin: 0; border: 0; border-radius: 0; padding: 0; background: transparent; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; padding: 6px 8px 18px; }
.brand-mark { width: 28px; height: 28px; flex: none; display: block; }
.brand-word { font-family: var(--font-display); font-weight: 750; font-size: 19px; letter-spacing: -0.02em; }
.brand-scope { display: block; font-size: 12px; color: var(--muted); font-weight: 450; letter-spacing: 0; margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--neutral-ink); font-weight: 500; text-decoration: none !important;
}
.nav-link svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.nav-link:hover { background: var(--raised); }
.nav-link.is-active { background: var(--active); color: var(--text); font-weight: 600; }
.nav-link.is-active svg { color: var(--text); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.scanner { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); padding: 0 10px; line-height: 1.35; }
.scanner .dot { margin-top: 5px; }
.me { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 10px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--border); }
.me-text { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-team { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .btn { grid-column: 2; justify-self: start; margin-left: -10px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.crumbs .here { color: var(--text); font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.topbar .menu-btn { display: none; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.is-ok .dot, .dot.is-ok { background: var(--pos); }
.is-bad .dot, .dot.is-bad { background: var(--neg); }
.is-wait .dot, .dot.is-wait { background: var(--warn); }

.offline-banner { display: none; position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink-btn); color: var(--ink-btn-text); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 40; box-shadow: var(--float-shadow); }
body.is-offline .offline-banner { display: block; }

/* ---------- Page head ---------- */

.page-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-text { min-width: 0; flex: 1 1 420px; }
.page-title { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-sub { margin-top: 8px; font-size: 16px; color: var(--muted); max-width: 760px; }
.page-sub b { color: var(--text); font-weight: 600; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: center; gap: 16px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-head .section-note { color: var(--muted); font-size: 14px; }
.section-head > :last-child:not(:first-child) { margin-left: auto; }

/* ---------- Buttons, pills, controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-ctl); border: 1px solid transparent; background: var(--neutral-soft); color: var(--text);
  font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background-color .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--active); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--ink-btn); color: var(--ink-btn-text); }
.btn-primary:hover { background: var(--ink-btn); opacity: .88; }
.btn-danger { background: var(--neg-fill); color: #fff; }
.btn-danger:hover { background: var(--neg-fill); opacity: .9; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-outline { background: transparent; border-color: var(--control); }
.btn-outline:hover { background: var(--raised); }
.btn-quiet-danger { background: transparent; color: var(--neg); border-color: var(--control); }
.btn-quiet-danger:hover { background: var(--neg-soft); border-color: var(--neg-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral-ink); }
.pill .dot { width: 7px; height: 7px; }
.pill-pos { background: var(--pos-soft); color: var(--pos-ink); }
.pill-pos .dot { background: var(--pos); }
.pill-neg { background: var(--neg-soft); color: var(--neg-ink); }
.pill-neg .dot { background: var(--neg); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-warn .dot { background: var(--warn); }
.pill-big { height: 30px; padding: 0 12px; font-size: 14px; border-radius: 15px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 5px; background: var(--code-bg); font-family: var(--mono); font-size: 12.5px; color: var(--neutral-ink); white-space: nowrap; }

.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--raised); border: 1px solid var(--border); gap: 2px; }
.seg-btn { height: 30px; padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font-weight: 550; font-size: 14px; display: inline-flex; align-items: center; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-on { background: var(--sheet); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.seg-btn .n { margin-left: 6px; color: var(--faint); font-weight: 500; }

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin: 4px 0 28px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; height: 42px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--text); font-weight: 650; }
.tab .n { margin-left: 6px; color: var(--faint); font-weight: 500; }

.input { height: 38px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--control); background: var(--sheet); color: var(--text); font: inherit; width: 100%; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input-code { font-family: var(--mono); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-error { color: var(--neg); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }

/* ---------- Panels, facts, strips ---------- */

.panel { background: var(--sheet); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px 22px; min-width: 0; }
.panel-title { font-size: 15px; font-weight: 650; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.panel-title .aside { margin-left: auto; font-size: 13px; font-weight: 450; color: var(--muted); }
.panel-quiet { background: var(--raised); border-color: transparent; }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--sheet); }
.strip > .cell { padding: 18px 22px; border-left: 1px solid var(--border); min-width: 0; }
.strip > .cell:first-child { border-left: 0; }
.cell-label { font-size: 13px; color: var(--muted); font-weight: 550; }
.cell-value { font-size: 28px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; margin-top: 6px; white-space: nowrap; }
.cell-value .unit { font-size: 15px; color: var(--muted); font-weight: 450; margin-left: 3px; letter-spacing: 0; }
.cell-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cell.is-bad .cell-value { color: var(--neg); }
.cell.is-good .cell-value { color: var(--pos); }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- States ---------- */

.empty { padding: 44px 0 36px; max-width: 560px; }
.empty-title { font-size: 20px; font-weight: 650; margin-bottom: 8px; }
.empty-text { color: var(--muted); margin-bottom: 18px; font-size: 15px; }
.pending-data { border: 1px dashed var(--control); border-radius: var(--r-card); padding: 22px 24px; color: var(--muted); }
.pending-data b { color: var(--text); font-weight: 600; display: block; margin-bottom: 4px; font-size: 16px; }
.error-box { color: var(--neg); }
.skeleton { color: var(--faint); padding: 24px 0; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 550; font-size: 13px; color: var(--muted); padding: 0 14px 10px 0; white-space: nowrap; }
.table td { padding: 12px 14px 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: var(--raised); }
.sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Login ---------- */

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, 1fr); }
.login-stage { padding: 44px 56px 56px; display: flex; flex-direction: column; gap: 56px; justify-content: center; position: relative; }
.login-stage > .brand { position: absolute; top: 40px; left: 56px; }
.login-stage .brand { padding: 0; }
.login-copy { max-width: 700px; }
.login-title { font-size: 54px; line-height: 1.04; letter-spacing: -0.035em; font-weight: 750; }
.login-lead { margin-top: 18px; font-size: 19px; line-height: 1.45; color: var(--muted); max-width: 560px; }
.login-flight { width: 100%; max-width: 760px; height: auto; display: block; }
.login-flight text { font: 600 15px var(--font); fill: var(--text); }
.login-flight .sub-t { font: 450 13px var(--font); fill: var(--muted); }
.login-flight .track { stroke: var(--control); stroke-width: 2; fill: none; }
.login-flight .track-go { stroke: var(--text); stroke-width: 2.5; fill: none; }
.login-flight .track-stop { stroke: var(--neg); stroke-width: 2.5; fill: none; }
.login-flight .node { fill: var(--sheet); stroke: var(--text); stroke-width: 2.5; }
.login-flight .node-stop { fill: var(--neg); }
.login-flight .gate { fill: var(--text); }
.login-flight .stop-t { fill: var(--neg); }
.login-flight .go-t { fill: var(--pos); }
.login-panel { background: var(--sheet); border-left: 1px solid var(--border); padding: 44px 56px; display: flex; flex-direction: column; justify-content: center; }
.login-panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.login-panel-head h2 { font-size: 22px; font-weight: 700; }
.login-note { margin-top: 18px; color: var(--muted); font-size: 14px; max-width: 420px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--sheet); cursor: pointer; text-align: left; transition: border-color .12s, background-color .12s; }
.user-choice:hover { border-color: var(--control); background: var(--raised); }
.user-choice:hover .user-go { opacity: 1; transform: translateX(0); }
.user-choice-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-choice-name { font-weight: 650; font-size: 16px; }
.user-choice-meta { color: var(--muted); font-size: 14px; }
.user-go { color: var(--muted); opacity: .4; transform: translateX(-4px); transition: opacity .12s, transform .12s; font-size: 18px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 14px; background: hsl(var(--hue, 190) 45% 90%); color: hsl(var(--hue, 190) 55% 24%); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--hue, 190) 30% 22%); color: hsl(var(--hue, 190) 60% 82%); } }
.login-error { color: var(--neg); margin-top: 12px; font-size: 14px; }
.login-error:empty { display: none; }

/* ---------- Pipeline: the flight path ---------- */

.flight { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); position: relative; margin: 4px 0 0; }
.fl-step { position: relative; padding-top: 30px; padding-right: 10px; min-width: 0; }
.fl-step::before { content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 2px; background: var(--control); }
.fl-step:first-child::before { left: 10px; }
.fl-step:last-child::before { right: auto; width: 0; }
.fl-ok::before { background: var(--text); }
.fl-node { position: absolute; top: 2px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--control); display: flex; align-items: center; justify-content: center; }
.fl-node svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fl-ok .fl-node { background: var(--text); border-color: var(--text); color: var(--sheet); }
.fl-failed .fl-node { background: var(--neg); border-color: var(--neg); color: #fff; width: 22px; height: 22px; top: 0; left: -2px; }
.fl-running .fl-node { border-color: var(--accent); }
.fl-running .fl-node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.fl-skipped .fl-node { border-style: dashed; }
.fl-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.fl-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.fl-skipped .fl-title, .fl-pending .fl-title { color: var(--faint); font-weight: 500; }
.fl-failed .fl-title { color: var(--neg); }
.fl-failed .fl-meta { color: var(--neg); }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fl-running .fl-node::after { animation: none; } }

/* mini flight path: one row in the feed */
.mini { display: inline-flex; align-items: center; gap: 0; flex: none; }
.mini i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--control); background: var(--sheet); display: block; }
.mini b { width: 10px; height: 1.5px; background: var(--control); display: block; }
.mini .ok { background: var(--text); border-color: var(--text); }
.mini .ok + b { background: var(--text); }
.mini .failed { background: var(--neg); border-color: var(--neg); width: 11px; height: 11px; }
.mini .running { border-color: var(--accent); background: var(--accent); }
.mini .skipped, .mini .pending { border-style: solid; border-color: var(--rule); }
.mini .skipped + b, .mini .pending + b { background: var(--rule); }

/* ---------- Gate report ---------- */

.pub-body { display: flex; flex-direction: column; gap: 26px; }
.report { display: flex; flex-direction: column; gap: 24px; }
.pub-error { background: var(--neg-soft); color: var(--neg-ink); border-radius: var(--r-card); padding: 14px 18px; white-space: pre-wrap; font-size: 14px; }
.pub-error b { display: block; font-size: 15px; margin-bottom: 4px; }

.verdict { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; padding: 24px 28px; border-radius: 12px; background: var(--raised); }
.verdict-word { font-size: 34px; line-height: 1.08; font-weight: 750; letter-spacing: -0.025em; display: flex; align-items: center; gap: 14px; }
.verdict-word svg { width: 32px; height: 32px; flex: none; }
.verdict-summary { margin-top: 8px; font-size: 16px; color: var(--muted); max-width: 720px; }
.verdict-side { display: flex; gap: 32px; align-items: center; }
.verdict-fig { display: flex; flex-direction: column; align-items: flex-start; }
.verdict-fig b { font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.verdict-fig span { font-size: 13px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.report-bad .verdict { background: var(--neg-soft); }
.report-bad .verdict-word { color: var(--neg); }
.report-bad .verdict-fig.is-blockers b { color: var(--neg); }
.report-warn .verdict { background: var(--warn-soft); }
.report-warn .verdict-word { color: var(--warn); }
.report-good .verdict { background: var(--pos-soft); }
.report-good .verdict-word { color: var(--pos); }
.report-good .verdict-summary, .report-bad .verdict-summary, .report-warn .verdict-summary { color: var(--text); opacity: .78; }

.report-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.checks-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.checks-nav-title { font-size: 13px; color: var(--muted); font-weight: 550; margin: 0 0 8px 10px; }
.check-link { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.check-link:hover:not(:disabled) { background: var(--raised); }
.check-link.is-on { background: var(--active); }
.check-link:disabled { cursor: default; }
.check-link .ck-name { font-weight: 600; font-size: 14px; }
.check-link .ck-n { font-size: 13px; font-weight: 650; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; }
.check-fail .ck-n { background: var(--neg-soft); color: var(--neg-ink); }
.check-warn .ck-n { background: var(--warn-soft); color: var(--warn-ink); }
.check-pass .ck-n, .check-skip .ck-n { color: var(--muted); font-weight: 500; }
.glyph { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.glyph svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-fail { background: var(--neg-fill); color: #fff; }
.g-warn { background: var(--warn); color: #fff; }
.g-pass { background: var(--pos-soft); color: var(--pos); }
.g-skip { background: var(--neutral-soft); color: var(--muted); }

.findings-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.findings-head h3 { font-size: 17px; font-weight: 650; }
.findings-head .btn { margin-left: auto; }
.findings { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-card); }
.check-group-title { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; font-size: 13px; font-weight: 650; color: var(--muted); border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.check-group-title:first-child { border-top: 0; }
.check-group-title.is-flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.check-note { padding: 0 18px 12px; color: var(--muted); font-size: 14px; }
.finding { border-top: 1px solid var(--rule); }
.check-group-title + .finding, .check-note + .finding { border-top: 0; }
.finding-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; width: 100%; padding: 12px 18px 12px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.finding-row:hover { background: var(--raised); }
.finding-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--faint); }
.sev-blocker .finding-bar { background: var(--neg); }
.sev-warning .finding-bar { background: var(--warn); }
.finding-title { font-size: 16px; font-weight: 650; line-height: 1.3; }
.finding-meta { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.finding-sev { font-weight: 650; }
.sev-blocker .finding-sev { color: var(--neg); }
.sev-warning .finding-sev { color: var(--warn); }
.finding-loc { font-family: var(--mono); font-size: 12.5px; }
.caret { width: 16px; height: 16px; stroke: var(--muted); stroke-width: 2; fill: none; transition: transform .15s; }
.is-open > .finding-row .caret, .is-open > .pub-toggle .caret { transform: rotate(90deg); }
.finding-body { display: none; padding: 2px 22px 20px 32px; }
.finding.is-open .finding-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; }
.finding-msg { grid-column: 1 / -1; font-size: 15px; max-width: 900px; }
.snippet { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--snippet-bg); color: var(--snippet-ink); overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre; align-self: start; }
.fix { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; align-self: start; }
.finding-body .fix:only-child, .finding-body .fix:first-child:last-child { grid-column: 1 / -1; }
.no-snippet .fix { grid-column: 1 / -1; }
.fix-label { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.fix p { font-size: 15px; white-space: pre-wrap; }
.clean { padding: 18px; color: var(--muted); }

/* ---------- Apps home ---------- */

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.platform-did { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)) auto; align-items: center; gap: 0; border-radius: var(--r-card); background: var(--raised); padding: 6px; margin-bottom: 28px; }
.platform-did > div { padding: 12px 18px; border-left: 1px solid var(--border); }
.platform-did > div:first-child { border-left: 0; }
.platform-did .pd-lead { font-weight: 650; font-size: 15px; }
.platform-did .pd-lead span { display: block; color: var(--muted); font-weight: 450; font-size: 13px; }
.platform-did b { font-size: 24px; font-weight: 550; letter-spacing: -0.02em; display: block; line-height: 1.1; }
.platform-did small { font-size: 13px; color: var(--muted); }
.platform-did .is-bad b { color: var(--neg); }
.platform-did .pd-go { border-left: 0; padding-right: 10px; }

.app-list { display: flex; flex-direction: column; gap: 12px; }
.app-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-card); cursor: pointer; transition: border-color .12s; }
.app-row:hover { border-color: var(--control); }
.app-row > div { padding: 18px 22px; border-left: 1px solid var(--rule); min-width: 0; }
.app-row > div:first-child { border-left: 0; }
.app-name-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.app-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.app-title a { color: var(--text); }
.app-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.app-tags { margin-top: 10px; font-size: 13px; color: var(--muted); }
.env-label { font-size: 13px; color: var(--muted); font-weight: 550; }
.env-line { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.env-ver { font-size: 22px; font-weight: 550; letter-spacing: -0.02em; }
.env-url { display: block; margin-top: 4px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-none { color: var(--faint); margin-top: 6px; font-size: 14px; }
.last-pub { display: flex; flex-direction: column; gap: 6px; }
.last-pub a { color: var(--text); }

.feed { border-top: 1px solid var(--border); }
.feed-row { display: grid; grid-template-columns: 140px 110px minmax(0, 1fr) 150px 170px 140px; align-items: center; gap: 16px; padding: 12px 6px; border-bottom: 1px solid var(--rule); color: var(--text); text-decoration: none !important; }
.feed-row:hover { background: var(--raised); }
.feed-app { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-env { color: var(--muted); font-size: 14px; }
.feed-what { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-what { display: flex; align-items: center; gap: 8px; }
.feed-what b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.feed-what.is-neg b { color: var(--neg); }
.feed-what.is-pos .dot { background: var(--pos); }
.feed-what.is-neg .dot { background: var(--neg); }
.feed-what.is-warn .dot { background: var(--warn); }
.feed-who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-when { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }
.feed-head { display: grid; grid-template-columns: 140px 110px minmax(0, 1fr) 150px 170px 140px; gap: 16px; padding: 0 6px 8px; font-size: 13px; color: var(--muted); font-weight: 550; }
.feed-head span:last-child { text-align: right; }

/* ---------- App page ---------- */

.app-head { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.app-head-main { flex: 1 1 520px; min-width: 0; }
.app-head-meta { display: flex; gap: 14px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.app-head .page-actions { padding-top: 2px; }

.console { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.live { border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.live.is-ok { border-left: 4px solid var(--pos); }
.live.is-bad { border-left: 4px solid var(--neg); }
.live.is-wait { border-left: 4px solid var(--warn); }
.live-state { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; flex-wrap: wrap; }
.live-state .dot { width: 12px; height: 12px; }
.live-ver { color: var(--muted); font-weight: 500; }
.live-url { font-size: 18px; font-weight: 600; word-break: break-all; }
.live-url a { color: var(--accent); }
.live-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
.live-facts > div { padding-right: 16px; min-width: 0; }
.live-facts > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.live-facts dt { font-size: 13px; color: var(--muted); }
.live-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 550; }
.live-facts dd small { display: block; font-weight: 450; color: var(--muted); font-size: 13px; }
.live-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

.wiring { display: flex; flex-direction: column; gap: 14px; background: var(--raised); border-radius: 12px; padding: 20px 22px; min-width: 0; }
.wiring h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.wiring .facts { font-size: 14px; }

.kpis { margin-top: var(--gap); }
.charts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.chart-card { margin: 0; border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 18px 10px; grid-column: span var(--span, 4); min-width: 0; }
.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-title { font-size: 14px; font-weight: 600; }
.chart-current { margin-left: auto; font-size: 18px; font-weight: 550; white-space: nowrap; }
.chart-current small { font-size: 13px; color: var(--muted); font-weight: 450; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-base { stroke: var(--control); stroke-width: 1; }
.ch-tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ch-empty { fill: var(--muted); font-size: 13px; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.ch-a { color: var(--chart-1); }
.ch-a.ch-line, .ch-line.ch-a { stroke: var(--chart-1); }
.ch-b.ch-line { stroke: var(--chart-2); }
.ch-bad.ch-line { stroke: var(--neg); }
.ch-a rect { fill: var(--chart-1); }
.ch-bad rect { fill: var(--neg); }
.ch-fill { stroke: none; opacity: .12; }
.ch-fill.ch-a { fill: var(--chart-1); }
.ch-dot { stroke: var(--sheet); stroke-width: 2; }
.ch-dot.ch-a { fill: var(--chart-1); }
.ch-dot.ch-b { fill: var(--chart-2); }
.ch-dot.ch-bad { fill: var(--neg); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 2px; display: inline-block; background: var(--chart-1); }
.swatch.ch-b { background: var(--chart-2); }
.swatch.sw-stderr { background: var(--neg); height: 10px; width: 3px; }
.swatch.sw-platform { background: var(--accent); height: 10px; width: 3px; }

/* publications tab */
.pub-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-card); }
.pub { border-top: 1px solid var(--rule); }
.pub:first-child { border-top: 0; }
.pub-row { display: flex; align-items: center; gap: 12px; padding: 0 18px 0 0; }
.pub-toggle { flex: 1; display: grid; grid-template-columns: 18px minmax(0, 1fr) 100px 150px 250px; align-items: center; gap: 14px; min-width: 0; padding: 14px 0 14px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.pub-toggle:hover { color: var(--text); }
.pub-row:hover { background: var(--raised); }
.pub-link { font-size: 13px; white-space: nowrap; }
.pub.is-open { background: var(--sheet); }
.pub.is-open > .pub-row { border-bottom: 1px solid var(--rule); }
.pub-detail { padding: 24px 24px 28px; }

/* releases */
.rel-list { border: 1px solid var(--border); border-radius: var(--r-card); }
.rel { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--rule); }
.rel:first-child { border-top: 0; }
.rel-version { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.rel-live .rel-version { color: var(--pos); }
.rel-failed .rel-version, .rel-rolled_back .rel-version { color: var(--faint); }
.rel-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.rel-note { margin-top: 4px; font-size: 14px; }
.rel-sub { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); align-items: center; flex-wrap: wrap; }

/* logs */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .muted:last-child { margin-left: auto; font-size: 14px; }
.logbox { background: var(--snippet-bg); color: var(--snippet-ink); border-radius: var(--r-card); height: min(64vh, 620px); overflow: auto; padding: 12px 0; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.logbox.is-paused { outline: 2px solid var(--warn); }
.log { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 0 16px 0 13px; border-left: 3px solid transparent; }
.log-ts { color: #7f8a90; }
.log-text { white-space: pre-wrap; word-break: break-word; }
.log-stderr { border-left-color: var(--neg); }
.log-stderr .log-text { color: #ffb4ad; }
.log-platform { border-left-color: #4cc0d8; }
.log-platform .log-text { color: #9fe2ef; }
.log-empty { padding: 12px 16px; color: #9aa4a9; }

/* events */
.event-list { border: 1px solid var(--border); border-radius: var(--r-card); }
.event { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 14px 18px; border-top: 1px solid var(--rule); }
.event:first-child { border-top: 0; }
.event-ts { color: var(--muted); font-size: 14px; }
.event-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.event-topic { font-weight: 600; font-size: 14px; }
.event-payload { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; word-break: break-all; }
.deliveries { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.delivery { display: inline-flex; align-items: center; gap: 6px; }
.dl-delivered .dot { background: var(--pos); }
.dl-failed .dot { background: var(--neg); }
.dl-pending .dot { background: var(--warn); }

/* secrets */
.secrets-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.secret-list { display: flex; flex-direction: column; }
.secret { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.secret:first-child { border-top: 0; }
.secret-name { font-weight: 600; font-size: 14px; }
.secret-mask { color: var(--faint); letter-spacing: 2px; }
.secret-form { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 16px; }

/* danger zone */
.danger { margin-top: 44px; border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; }
.danger h2 { font-size: 15px; font-weight: 650; }
.danger p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.danger-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Summary ---------- */

.sum-lead { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--gap); }
.barrier { border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px 18px; min-width: 0; }
.barrier svg { width: 100%; height: auto; display: block; overflow: visible; }
.barrier text { font-family: var(--font); }
.b-label { font-size: 13px; fill: var(--muted); }
.b-big { font-size: 30px; font-weight: 600; fill: var(--text); letter-spacing: -0.02em; }
.b-mid { font-size: 15px; font-weight: 600; fill: var(--text); }
.b-go { fill: var(--text); }
.b-stop { fill: var(--neg); }
.b-fail { fill: var(--warn); }
.b-track { fill: var(--raised); }
.b-gate { fill: var(--text); }
.b-flow { fill: none; stroke: var(--control); stroke-width: 1.5; }
.b-flow-stop { fill: none; stroke: var(--neg); stroke-width: 1.5; stroke-dasharray: 3 3; }
.t-neg { fill: var(--neg) !important; }
.t-warn { fill: var(--warn) !important; }
.t-muted { fill: var(--muted) !important; }

.stopped-card { border-radius: 12px; background: var(--neg-soft); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stopped-fig { font-size: 40px; line-height: 1; font-weight: 700; color: var(--neg); letter-spacing: -0.03em; }
.stopped-fig small { font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--neg-ink); margin-left: 6px; }
.stopped-card p { color: var(--neg-ink); font-size: 15px; }
.cats { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cat { display: grid; grid-template-columns: 150px minmax(0, 1fr) 30px; gap: 12px; align-items: center; font-size: 14px; color: var(--neg-ink); }
.cat-bar { height: 10px; border-radius: 2px; background: rgba(196, 42, 42, 0.14); position: relative; overflow: hidden; }
.cat-bar i { position: absolute; inset: 0 auto 0 0; background: var(--neg); border-radius: 2px; }
.cat .num { font-weight: 650; }
@media (prefers-color-scheme: dark) { .cat-bar { background: rgba(255, 107, 99, 0.16); } }

.sum-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.sum-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); }
.rank { display: flex; flex-direction: column; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 28px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.rank li:first-child { border-top: 0; }
.rank .r-title { min-width: 0; }
.rank .r-title code { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .r-bar { height: 6px; border-radius: 2px; background: var(--rule); position: relative; }
.rank .r-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--text); }
.rank.is-neg .r-bar i { background: var(--neg); }
.rank .num { font-weight: 650; }

.big-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.big-pair > div { padding-right: 16px; }
.big-pair > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.fig { font-size: 30px; font-weight: 550; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.fig .unit { font-size: 15px; color: var(--muted); font-weight: 450; margin-left: 3px; letter-spacing: 0; }
.fig.is-neg { color: var(--neg); }
.fig.is-pos { color: var(--pos); }
.fig-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.split { margin-top: 18px; }
.split-bar { display: flex; height: 12px; gap: 2px; border-radius: 2px; overflow: hidden; }
.split-bar i { display: block; height: 100%; }
.split-bar .s-go { background: var(--text); }
.split-bar .s-stop { background: var(--neg); }
.split-bar .s-wait { background: var(--warn); }
.split-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 4px; }
.money > div { padding-right: 14px; }
.money > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }

/* ---------- Socket ---------- */

.socket-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; border-radius: 12px; padding: 22px 24px; background: var(--raised); }
.socket-hero.is-stopped { background: var(--neg-soft); }
.socket-state { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.socket-state .dot { width: 12px; height: 12px; }
.is-stopped .socket-state { color: var(--neg); }
.socket-hero-text { margin-top: 6px; color: var(--muted); max-width: 700px; }
.is-stopped .socket-hero-text { color: var(--neg-ink); }
.socket-stats { display: flex; gap: 0; margin: 16px 0 0; }
.socket-stats > div { padding: 0 22px; border-left: 1px solid var(--border); }
.socket-stats > div:first-child { padding-left: 0; border-left: 0; }
.socket-stats dt { font-size: 13px; color: var(--muted); }
.socket-stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 550; }
.socket-stats .is-warn dd { color: var(--warn); }
.kill { width: 132px; height: 132px; border-radius: 50%; border: 0; font-size: 22px; font-weight: 750; cursor: pointer; letter-spacing: -0.01em; transition: transform .08s, opacity .12s; }
.kill:active { transform: scale(.97); }
.kill-stop { background: var(--neg-fill); color: #fff; }
.kill-resume { background: var(--ink-btn); color: var(--ink-btn-text); font-size: 17px; }
.kill-note { color: var(--muted); font-size: 14px; max-width: 220px; text-align: right; }

.tools { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--r-card); }
.tool { padding: 16px 18px; border-left: 1px solid var(--rule); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tool:first-child { border-left: 0; }
.tool-title { font-weight: 650; font-size: 15px; }
.tool-name { font-size: 12.5px; color: var(--muted); }
.tool-lim { font-size: 13px; color: var(--muted); }
.tool-lim b { color: var(--text); font-weight: 600; }
.risk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.risk i { display: inline-flex; gap: 2px; }
.risk i b { width: 6px; height: 12px; border-radius: 1px; background: var(--rule); display: block; }
.risk-read i b:nth-child(1) { background: var(--muted); }
.risk-write i b:nth-child(-n+2) { background: var(--warn); }
.risk-money i b { background: var(--neg); }
.risk-read { color: var(--muted); }
.risk-write { color: var(--warn); }
.risk-money { color: var(--neg); }

.intent-list { border: 1px solid var(--border); border-radius: var(--r-card); }
.intent { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--rule); }
.intent:first-child { border-top: 0; }
.intent-amount { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.intent-title { font-weight: 600; }
.intent-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 2px; }
.intent-pending { background: var(--warn-soft); }
.intent-pending:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
.chain { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.chain.is-bad { color: var(--neg); font-weight: 600; }

.audit { width: 100%; border-collapse: collapse; font-size: 14px; }
.audit th { text-align: left; font-weight: 550; font-size: 13px; color: var(--muted); padding: 0 14px 10px 0; white-space: nowrap; }
.audit td { padding: 9px 14px 9px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.audit td:first-child { width: 86px; color: var(--muted); white-space: nowrap; }
.audit td:nth-child(2) { white-space: nowrap; }
.audit td:nth-child(3), .audit td:nth-child(4) { white-space: nowrap; }
.dec { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.dec .dot { width: 7px; height: 7px; }
.dec-allowed, .dec-executed, .dec-confirmed { color: var(--pos); }
.dec-allowed .dot, .dec-executed .dot, .dec-confirmed .dot { background: var(--pos); }
.dec-denied, .dec-rejected { color: var(--neg); }
.dec-denied .dot, .dec-rejected .dot { background: var(--neg); }
.dec-pending { color: var(--warn); }
.dec-pending .dot { background: var(--warn); }
.audit-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.audit-more { margin-top: 12px; }

/* ---------- Policies ---------- */

.rulebook { border-top: 1px solid var(--border); }
.policy { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.policy-title { font-size: 17px; font-weight: 650; }
.policy-lines { display: flex; flex-direction: column; gap: 6px; font-size: 15px; max-width: 820px; }
.policy-lines li { padding-left: 18px; position: relative; }
.policy-lines li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 1px; background: var(--faint); }

/* ---------- Install / kit ---------- */

.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.method { border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.method.is-rec { grid-column: 1 / -1; border-color: var(--accent); border-width: 1.5px; }
.method.is-off { background: var(--raised); border-color: transparent; grid-column: 1 / -1; }
.method.is-rec ~ .method:last-child:nth-child(even) { grid-column: 1 / -1; }
.method-info { font-size: 13px; color: var(--muted); }
.bins { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.bins code { font-size: 12px; color: var(--muted); }
.method.is-off .method-title, .method.is-off .method-desc { color: var(--muted); }
.method-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.method-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.method-desc { font-size: 15px; max-width: 760px; }
.method-req { font-size: 14px; color: var(--muted); }
.method-req b { color: var(--text); font-weight: 600; }
.method-note { font-size: 14px; color: var(--warn-ink); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
.cmds { display: flex; flex-direction: column; gap: 6px; }
.cmd { display: flex; align-items: flex-start; gap: 10px; background: var(--snippet-bg); color: var(--snippet-ink); border-radius: 8px; padding: 6px 6px 6px 14px; min-width: 0; }
.cmd code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; padding: 6px 0; }
.cmd .btn { background: rgba(255,255,255,.1); color: var(--snippet-ink); flex: none; }
.cmd .btn:hover { background: rgba(255,255,255,.18); }
.cmd .tok { color: #f7d38c; }
.token-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border-radius: 12px; background: var(--raised); margin-bottom: var(--gap); }
.token-box.has-token { background: var(--warn-soft); }
.token-box b { font-weight: 650; }
.token-box p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.token-box.has-token p { color: var(--warn-ink); }
.say { margin-top: 28px; padding: 18px 22px; border-radius: 12px; background: var(--ink-btn); color: var(--ink-btn-text); font-size: 18px; font-weight: 600; }
.say span { opacity: .7; font-weight: 450; font-size: 15px; display: block; }
.kit-browser { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.kit-list { display: flex; flex-direction: column; gap: 2px; }
.kit-file { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.kit-file:hover { background: var(--raised); }
.kit-file.is-on { background: var(--active); }
.kit-path { font-size: 13px; font-weight: 600; color: var(--text); }
.kit-desc { font-size: 13px; color: var(--muted); }
.kit-viewer { border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; position: sticky; top: 16px; }
.kit-viewer-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--rule); }
.kit-viewer-head code { flex: 1; font-weight: 600; }
.kit-content { margin: 0; padding: 16px; max-height: calc(100vh - 110px); overflow: auto; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }

/* ---------- Dialog, toast ---------- */

.backdrop { position: fixed; inset: 0; background: rgba(10, 12, 14, 0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.dialog { width: min(520px, 100%); background: var(--sheet); border-radius: 14px; padding: 24px; box-shadow: var(--float-shadow); border: 1px solid var(--border); }
.dialog-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.dialog-body { color: var(--muted); font-size: 15px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body b, .dialog-body code { color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--ink-btn); color: var(--ink-btn-text); box-shadow: var(--float-shadow); font-size: 14px; z-index: 70; opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; pointer-events: none; border-left: 4px solid var(--faint); }
.toast.is-visible { opacity: 1; transform: none; }
.toast-good { border-left-color: var(--pos); }
.toast-bad { border-left-color: var(--neg); }

/* ---------- Confirm page (phone first) ---------- */

.confirm-page { background: var(--frame); min-height: 100vh; }
.confirm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 520px; margin: 0 auto; padding: 14px 16px 6px; }
.confirm-top .brand { padding: 0; }
.confirm-top-note { font-size: 13px; color: var(--muted); }
.confirm-main { max-width: 520px; margin: 0 auto; padding: 8px 12px 32px; }
.cf-card { background: var(--sheet); border: 1px solid var(--border); border-radius: 18px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.cf-status { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }
.cf-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.cf-pending .cf-status { color: var(--warn); }
.cf-pending .cf-mark { background: var(--warn); }
.cf-good .cf-status { color: var(--pos); }
.cf-good .cf-mark { background: var(--pos); }
.cf-bad .cf-status { color: var(--neg); }
.cf-bad .cf-mark { background: var(--neg); }
.cf-wait .cf-mark { background: var(--accent); }
.cf-text { color: var(--muted); font-size: 15px; }
.cf-hero { display: flex; flex-direction: column; gap: 4px; }
.cf-to { font-size: 15px; color: var(--muted); }
.cf-to b { color: var(--text); font-weight: 650; font-size: 22px; display: block; letter-spacing: -0.01em; line-height: 1.2; }
.cf-amount { font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; white-space: nowrap; }
.cf-amount.is-compact { font-size: 30px; }
.cf-what { font-size: 14px; color: var(--muted); }
.cf-receipt { background: var(--raised); border-radius: 12px; padding: 12px 16px; }
.cf-receipt h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cf-receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--control); font-size: 15px; }
.cf-receipt li:first-child { border-top: 0; }
.cf-receipt li span:last-child { white-space: nowrap; font-weight: 550; }
.cf-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15px; }
.cf-facts dt { color: var(--muted); }
.cf-facts dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.cf-left.is-low { color: var(--neg); }
.cf-once { font-size: 13px; color: var(--muted); }
.cf-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-confirm { background: var(--pos); color: #fff; height: 54px; font-size: 17px; border-radius: 12px; }
.btn-confirm:hover { background: var(--pos); opacity: .92; }
@media (prefers-color-scheme: dark) { .btn-confirm { color: #04170c; } }
.cf-actions .btn-outline { height: 48px; border-radius: 12px; font-size: 16px; }
.cf-raw { font-size: 12px; background: var(--raised); padding: 10px; border-radius: 8px; overflow-x: auto; }

/* ---------- Narrow screens ---------- */

@media (max-width: 1180px) {
  .feed-head { display: none; }
  .feed-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .feed-row .feed-env, .feed-row .feed-who { display: none; }
  .pub-toggle { grid-template-columns: 18px minmax(0, 1fr) 90px auto; }
  .pub-toggle .pt-who, .pub-toggle .pt-mini { display: none; }
  .app-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .app-row > div:nth-child(3) { border-left: 0; }
  .app-row > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .console, .sum-lead { grid-template-columns: minmax(0, 1fr); }
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { grid-column: span 1; }
  .sum-row { grid-template-columns: minmax(0, 1fr); }
  .platform-did { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-did > div:nth-child(odd) { border-left: 0; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool:nth-child(odd) { border-left: 0; }
  .tool:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 900px) {
  :root { --pad: 18px; }
  .login-stage > .brand { position: static; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "top" "side" "sheet"; }
  .side { position: static; height: auto; padding: 0 12px 8px; display: none; }
  body.menu-open .side { display: flex; }
  .side .brand { display: none; }
  .side-foot { margin-top: 12px; }
  .topbar { padding: 0 12px; height: 52px; }
  .topbar .menu-btn { display: inline-flex; }
  .top-right .scanner-mini { display: none; }
  .sheet { margin: 0; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding-top: 20px; }
  .page-title { font-size: 24px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-stage { padding: 24px 20px; gap: 20px; }
  .login-title { font-size: 32px; }
  .login-lead { font-size: 16px; }
  .login-panel { border-left: 0; padding: 24px 20px 32px; }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .checks-nav { position: static; flex-direction: row; overflow-x: auto; }
  .checks-nav-title { display: none; }
  .check-link { grid-template-columns: 20px auto auto; white-space: nowrap; width: auto; }
  .verdict { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .verdict-word { font-size: 26px; }
  .finding.is-open .finding-body { grid-template-columns: minmax(0, 1fr); padding-left: 18px; }
  .flight { grid-template-columns: minmax(0, 1fr); --n: 1; }
  .fl-step { padding: 0 0 12px 32px; }
  .fl-step::before { top: 10px; bottom: 0; left: 9px; right: auto; width: 2px; height: auto; }
  .fl-step:last-child::before { display: none; }
  .strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > .cell:nth-child(odd) { border-left: 0; }
  .strip > .cell:nth-child(n+3) { border-top: 1px solid var(--border); }
  .charts, .secrets-layout, .methods, .kit-browser, .sum-row-2 { grid-template-columns: minmax(0, 1fr); }
  .app-row { grid-template-columns: minmax(0, 1fr); }
  .app-row > div { border-left: 0 !important; }
  .app-row > div + div { border-top: 1px solid var(--rule); }
  .verdict-side { flex-wrap: wrap; gap: 16px 28px; }
  .big-pair, .money { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .big-pair > div + div, .money > div + div { padding-left: 0; border-left: 0; }
  .platform-did { grid-template-columns: minmax(0, 1fr); }
  .platform-did > div { border-left: 0; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool { border-left: 0 !important; }
  .tool + .tool { border-top: 1px solid var(--rule); }
  .page-head { align-items: flex-start; }
  .live-facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .live-facts > div + div { padding-left: 0; border-left: 0; }
  .policy { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .intent { grid-template-columns: minmax(0, 1fr) auto; }
  .intent .intent-main { grid-column: 1 / -1; grid-row: 2; }
  .socket-hero { grid-template-columns: minmax(0, 1fr); }
  .kill { width: 100%; height: 56px; border-radius: 12px; }
  .secret-form { grid-template-columns: minmax(0, 1fr); }
  .danger { grid-template-columns: minmax(0, 1fr); }
  .rel { grid-template-columns: 60px minmax(0, 1fr); }
  .rel > :last-child { grid-column: 2; justify-self: start; }
}
