/* ==========================================================================
   Cleanroom dashboard - design tokens
   Dark by default. Light theme follows the OS unless the reader chooses.
   Everything is a variable: one accent (indigo), mint = clean, coral = leak,
   amber = tainted. No external fonts, no icon libraries, no build step.
   ========================================================================== */
:root {
  --bg: #070A16;
  --surface: #0E1428;
  --surface-2: #131A31;
  --surface-3: #1A2340;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #E9EDF8;
  --ink-2: #AEB8D2;
  --mute: #7F8BAD;
  --acc: #7C8CFF;
  --acc-2: #A6B1FF;
  --acc-soft: rgba(124, 140, 255, .15);
  --good: #45D6A0;
  --good-soft: rgba(69, 214, 160, .13);
  --bad: #FF7A6B;
  --bad-soft: rgba(255, 122, 107, .13);
  --warn: #F2B33D;
  --warn-soft: rgba(242, 179, 61, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 24px 48px -28px rgba(0, 0, 0, .85);
  --glow-a: rgba(124, 140, 255, .30);
  --glow-b: rgba(69, 214, 160, .14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F2F5FC;
    --surface: #FFFFFF;
    --surface-2: #EFF3FB;
    --surface-3: #E4EAF7;
    --line: rgba(13, 22, 51, .15);
    --line-2: rgba(13, 22, 51, .27);
    --ink: #0E1633;
    --ink-2: #3B4568;
    --mute: #5F6783;
    --acc: #4A57E8;
    --acc-2: #3340C9;
    --acc-soft: rgba(74, 87, 232, .10);
    --good: #097453;
    --good-soft: rgba(9, 116, 83, .09);
    --bad: #B52A1D;
    --bad-soft: rgba(181, 42, 29, .09);
    --warn: #8F5804;
    --warn-soft: rgba(143, 88, 4, .11);
    --shadow-1: 0 1px 2px rgba(16, 26, 60, .06);
    --shadow-2: 0 22px 44px -26px rgba(16, 26, 60, .35);
    --glow-a: rgba(74, 87, 232, .18);
    --glow-b: rgba(12, 154, 105, .10);
  }
}

:root[data-theme="light"] {
  --bg: #F2F5FC;
  --surface: #FFFFFF;
  --surface-2: #EFF3FB;
  --surface-3: #E4EAF7;
  --line: rgba(13, 22, 51, .15);
  --line-2: rgba(13, 22, 51, .27);
  --ink: #0E1633;
  --ink-2: #3B4568;
  --mute: #5F6783;
  --acc: #4A57E8;
  --acc-2: #3340C9;
  --acc-soft: rgba(74, 87, 232, .10);
  --good: #097453;
  --good-soft: rgba(9, 116, 83, .09);
  --bad: #B52A1D;
  --bad-soft: rgba(181, 42, 29, .09);
  --warn: #8F5804;
  --warn-soft: rgba(143, 88, 4, .11);
  --shadow-1: 0 1px 2px rgba(16, 26, 60, .06);
  --shadow-2: 0 22px 44px -26px rgba(16, 26, 60, .35);
  --glow-a: rgba(74, 87, 232, .18);
  --glow-b: rgba(12, 154, 105, .10);
}

:root[data-theme="dark"] {
  --bg: #070A16;
  --surface: #0E1428;
  --surface-2: #131A31;
  --surface-3: #1A2340;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #E9EDF8;
  --ink-2: #AEB8D2;
  --mute: #7F8BAD;
  --acc: #7C8CFF;
  --acc-2: #A6B1FF;
  --acc-soft: rgba(124, 140, 255, .15);
  --good: #45D6A0;
  --good-soft: rgba(69, 214, 160, .13);
  --bad: #FF7A6B;
  --bad-soft: rgba(255, 122, 107, .13);
  --warn: #F2B33D;
  --warn-soft: rgba(242, 179, 61, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 24px 48px -28px rgba(0, 0, 0, .85);
  --glow-a: rgba(124, 140, 255, .30);
  --glow-b: rgba(69, 214, 160, .14);
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-padding-top: 88px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(60% 60% at 22% 0%, var(--glow-a), transparent 70%),
    radial-gradient(45% 55% at 88% 6%, var(--glow-b), transparent 72%);
  pointer-events: none;
  z-index: 0;
  opacity: .85;
}
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-2); }
h1, h2, h3 { margin: 0; letter-spacing: -.022em; }
p { margin: 0; }
.mute { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }
.only-mobile { display: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--acc-soft); }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 0 0 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--acc), color-mix(in srgb, var(--acc) 55%, var(--good)));
  box-shadow: 0 6px 18px -8px var(--acc);
  flex: none;
}
.brand-mark svg { width: 18px; height: 18px; display: block; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub {
  font-size: 11px; color: var(--mute); letter-spacing: .10em;
  text-transform: uppercase; font-weight: 600; margin-top: 1px;
}
.topbar-note {
  margin: 0 auto 0 16px;
  font-size: 12.5px;
  color: var(--mute);
  white-space: nowrap;
}

.seg {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.seg-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface-3);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.seg-btn .k { color: var(--mute); font-weight: 700; margin-right: 6px; }
.seg-btn[aria-pressed="true"] .k { color: var(--acc); }
.seg-btn .lbl-short { display: none; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: block; }
:root[data-theme="light"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="dark"]) .icon-btn .i-moon { display: none; }
}

/* ==========================================================================
   Bento grid
   ========================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}
.card {
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
  position: relative;
  min-width: 0;
}
.card.lift { transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
.card.lift:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.card-note { font-size: 12.5px; color: var(--mute); }
.card-sub { font-size: 13px; color: var(--mute); margin-top: -4px; margin-bottom: 14px; }

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 1080px) {
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  grid-column: span 7;
  overflow: hidden;
  padding: 26px 26px 24px;
}
.hero > * { position: relative; z-index: 1; }
@media (max-width: 1080px) { .hero { grid-column: span 12; } }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(62% 62% at 82% 18%, #000 10%, transparent 72%);
  mask-image: radial-gradient(62% 62% at 82% 18%, #000 10%, transparent 72%);
  opacity: .55;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -120px; top: -140px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-a), transparent 68%);
  pointer-events: none;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--mute);
  margin-bottom: 14px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 214px;
  gap: 26px;
  align-items: start;
}
.hero-main { min-width: 0; }
.hero-verdict {
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -.035em;
  margin: 0 0 14px;
  max-width: 15ch;
}
.hero-verdict .ok { color: var(--good); }
.hero-verdict .bad { color: var(--bad); }
.hero-verdict .warn { color: var(--warn); }
.hero-cert {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  max-width: 100%;
}
.hero-cert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.hero-cert.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); color: var(--bad); }
.hero-cert.bad .dot { background: var(--bad); }
.hero-meta {
  display: flex; flex-direction: column; gap: 11px;
  margin: 0; padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mrow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mrow dt {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--mute);
}
.mrow dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; }
  .mrow { min-width: 0; }
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge.real { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-soft); }
.badge.sim { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   Floor plan
   ========================================================================== */
.plan-card { grid-column: span 5; }
@media (max-width: 1080px) { .plan-card { grid-column: span 12; } }
.plan {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  overflow: hidden;
}
.plan svg { display: block; width: 100%; height: auto; }
.plan-wall { fill: color-mix(in srgb, var(--surface-3) 70%, transparent); stroke: var(--line-2); stroke-width: 1.2; }
.plan-room { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.plan-room.red { fill: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.plan-room.blue { fill: color-mix(in srgb, var(--acc) 12%, var(--surface)); }
.plan-room.gw { fill: color-mix(in srgb, var(--good) 13%, var(--surface)); stroke: color-mix(in srgb, var(--good) 55%, transparent); }
.plan-open { fill: color-mix(in srgb, var(--bad) 9%, var(--surface)); stroke: color-mix(in srgb, var(--bad) 45%, transparent); stroke-dasharray: 5 4; }
.plan-label { fill: var(--ink); font: 600 12px var(--sans); }
.plan-sub { fill: var(--mute); font: 500 9.5px var(--sans); }
.plan-txt { fill: var(--ink-2); font: 600 10px var(--mono); }
.plan-leak { stroke: var(--bad); stroke-width: 1.6; fill: none; stroke-dasharray: 6 6; animation: dash 1.1s linear infinite; }
.plan-link { stroke: var(--acc); stroke-width: 1.6; fill: none; stroke-dasharray: 4 5; opacity: .9; animation: dash 1.6s linear infinite; }
.plan-block { stroke: var(--mute); stroke-width: 1.4; }
.plan-vol { stroke: var(--bad); stroke-width: 2; fill: none; stroke-dasharray: 3 4; opacity: .9; }
.plan-dot { fill: var(--acc); }
.plan-dot.bad { fill: var(--bad); }
.plan-dot.good { fill: var(--good); }
@keyframes dash { to { stroke-dashoffset: -24; } }
.plan-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; color: var(--mute); }
.plan-legend span { display: inline-flex; align-items: center; gap: 7px; }
.plan-legend i { width: 20px; height: 0; border-top: 2px dashed var(--bad); }
.plan-legend i.acc { border-top-color: var(--acc); }
.plan-legend i.solid { border-top: 2px solid var(--mute); }
.plan-legend i.cross { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--surface-3); border: 1.4px solid var(--bad); position: relative; }
.plan-legend i.cross::after { content: ""; position: absolute; inset: 1px 3px; border-left: 1.4px solid var(--bad); border-right: 1.4px solid var(--bad); transform: rotate(45deg); }

/* ==========================================================================
   Stat tiles
   ========================================================================== */
.stats { grid-column: span 12; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.stat-value { font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-value.good { color: var(--good); }
.stat-value.bad { color: var(--bad); }
.stat-value.warn { color: var(--warn); }
.stat-sub { font-size: 12.5px; color: var(--mute); margin-top: 6px; }

/* ==========================================================================
   Findings timeline
   ========================================================================== */
.tl-wrap { grid-column: span 12; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
.tl { display: flex; gap: 0; min-width: 760px; position: relative; padding-top: 54px; }
.tl-rail {
  position: absolute; left: 0; right: 0; top: 29px; height: 2px;
  background: linear-gradient(90deg, var(--good), var(--good) var(--cut, 50%), var(--line-2) var(--cut, 50%));
  border-radius: 2px;
}
.tl-node { flex: 1 1 0; min-width: 92px; position: relative; padding: 0 6px; display: flex; }
.tl-dot {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--good);
  box-shadow: 0 0 0 4px var(--surface);
}
.tl-node.tainted .tl-dot { border-color: var(--warn); }
.tl-card {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 104px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.tl-node:hover .tl-card { transform: translateY(-2px); border-color: var(--line-2); }
.tl-node.tainted .tl-card { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface-2)); }
.tl-id { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--mute); }
.tl-text { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); flex: 1; }
.tl-status { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.tl-status.v { color: var(--good); }
.tl-status.t { color: var(--warn); }
.tl-receipt {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 10.5px var(--mono);
  color: var(--mute);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  align-self: flex-start;
  max-width: 100%;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.tl-receipt:hover { color: var(--ink-2); border-color: var(--line-2); }
.tl-receipt.copied { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.tl-receipt.failed { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.tl-receipt svg { width: 11px; height: 11px; flex: none; opacity: .7; }
.tl-mark {
  position: absolute; top: -48px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bad); white-space: nowrap;
  background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  padding: 2px 8px; border-radius: 999px;
}
.tl-mark .mk-short { display: none; }
.tl-summary { font-size: 14px; font-weight: 600; margin-top: 14px; }
.tl-summary.good { color: var(--good); }
.tl-summary.bad { color: var(--bad); }

/* ==========================================================================
   Leak meter
   ========================================================================== */
.meter-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.meter-row:last-child { border-bottom: 0; padding-bottom: 0; }
.meter-row:first-child { padding-top: 0; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.meter-tag { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.meter-tag.real { color: var(--good); background: var(--good-soft); }
.meter-tag.sim { color: var(--warn); background: var(--warn-soft); }
.meter-val { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.meter-track {
  position: relative; height: 8px; margin-top: 9px;
  background: var(--surface-3); border-radius: 999px; overflow: hidden;
}
.meter-fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--acc), var(--bad));
  width: 0;
  transition: width .9s var(--ease);
}
.meter-fill.zero { background: var(--good); }
.meter-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-top: 6px; font-variant-numeric: tabular-nums; }
.meter-note { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.meter-note b { color: var(--ink-2); }

/* ==========================================================================
   Mole chips
   ========================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--line-2); }
.chip .cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.chip.landed { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--bad); }
.chip.landed .cdot { background: var(--bad); }
.chip .cnote { color: var(--mute); font-weight: 500; }
.chip.landed .cnote { color: var(--bad); }

/* ==========================================================================
   Channels grid
   ========================================================================== */
.ch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; grid-auto-rows: 1fr; }
@media (max-width: 900px) { .ch-grid { grid-template-columns: repeat(2, 1fr); } }
.ch {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.ch:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ch.leak { border-color: color-mix(in srgb, var(--bad) 38%, transparent); background: var(--bad-soft); }
.ch-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--good-soft); color: var(--good); flex: none; }
.ch.leak .ch-ico { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }
.ch-ico svg { width: 14px; height: 14px; display: block; }
.ch-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.ch-detail { font-size: 12px; color: var(--mute); margin-top: 3px; line-height: 1.4; word-break: break-word; }
.ch.leak .ch-detail { color: var(--bad); }
.ch-state { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--good); }
.ch.leak .ch-state { color: var(--bad); }

/* ==========================================================================
   Diary ledger
   ========================================================================== */
.ledger-wrap { grid-column: span 12; }
.ledger-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease), border-color .16s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--acc-2); border-color: var(--acc-2); color: #fff; }
.btn svg { width: 15px; height: 15px; display: block; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); }

.ledger {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.ledger-scroll { max-height: 460px; overflow: auto; }
.ledger table { width: 100%; border-collapse: collapse; }
.ledger thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-3);
  font: 700 10.5px var(--sans);
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--mute);
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.ledger tbody td {
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.ledger tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.ledger tbody tr:hover td { background: var(--acc-soft); }
.ledger .c-idx { font: 500 11.5px var(--mono); color: var(--mute); width: 54px; }
.ledger .c-actor { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ledger .c-data { font: 500 12px var(--mono); color: var(--ink-2); word-break: break-word; }
.ledger .c-hash { width: 1%; white-space: nowrap; }
.hashchip {
  display: inline-block;
  font: 500 11px var(--mono);
  color: var(--mute);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.ledger .c-prev { width: 1%; white-space: nowrap; }
.prevcell { display: inline-flex; align-items: center; gap: 6px; }
.prevcell svg { width: 12px; height: 12px; color: var(--line-2); flex: none; }
.ledger tbody tr.broken td { background: var(--bad-soft) !important; color: var(--bad); font-weight: 700; }
.ledger tbody tr.broken .hashchip { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.ledger-note td { font-size: 12px !important; color: var(--mute) !important; background: transparent !important; font-style: italic; }
.ledger-empty { padding: 26px; text-align: center; color: var(--mute); font-size: 13px; }

.progress {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: transparent; overflow: hidden; z-index: 3;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--acc), var(--good));
  transition: width .12s linear;
}
.progress.on { background: var(--line); }
.verdict { font-size: 13.5px; font-weight: 700; margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.verdict svg { width: 15px; height: 15px; flex: none; }
.verdict.ok { color: var(--good); }
.verdict.bad { color: var(--bad); }
.verdict.idle { color: var(--mute); font-weight: 500; }

/* ==========================================================================
   Labels / links
   ========================================================================== */
.label-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.label-col { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.label-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.label-head .ldot { width: 8px; height: 8px; border-radius: 50%; }
.label-col.real .label-head { color: var(--good); }
.label-col.real .ldot { background: var(--good); }
.label-col.sim .label-head { color: var(--warn); }
.label-col.sim .ldot { background: var(--warn); }
.label-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.label-col li { font-size: 13px; color: var(--ink-2); padding-left: 16px; position: relative; }
.label-col li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 2px; border-radius: 2px; background: var(--line-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.footer-links a { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.footer-links svg { width: 14px; height: 14px; opacity: .8; }

/* ==========================================================================
   Skeleton + error states
   ========================================================================== */
.sk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.sk-line { height: 12px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-line.w40 { width: 40%; } .sk-line.w70 { width: 70%; } .sk-line.w90 { width: 90%; }
.sk-line.tall { height: 30px; width: 55%; margin-bottom: 16px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.err {
  grid-column: span 12;
  border: 1px solid color-mix(in srgb, var(--bad) 38%, transparent);
  background: var(--bad-soft);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}
.err h2 { font-size: 20px; margin-bottom: 6px; }
.err p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 16px; }
.err code { font: 500 12px var(--mono); background: var(--surface-3); padding: 2px 6px; border-radius: 5px; }

/* ==========================================================================
   Motion: staggered reveal when the run changes
   ========================================================================== */
.reveal { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.d1 { animation-delay: .04s; } .d2 { animation-delay: .10s; } .d3 { animation-delay: .16s; }
.d4 { animation-delay: .22s; } .d5 { animation-delay: .28s; } .d6 { animation-delay: .34s; }
.d7 { animation-delay: .40s; } .d8 { animation-delay: .46s; } .d9 { animation-delay: .52s; }

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 720px) {
  .wrap { padding: 0 14px 60px; }
  .topbar { margin: 0 0 16px; }
  .topbar-inner { padding: 8px 14px; gap: 10px; flex-wrap: nowrap; min-height: 0; }
  .brand { margin-right: 0; padding: 3px 4px; }
  .brand-name, .brand-sub { display: none; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .topbar-note { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .seg { order: 0; width: auto; flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .seg-btn { flex: 1 1 0; min-width: 0; padding: 9px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .seg-btn .k { display: none; }
  .seg-btn .lbl-full { display: none; }
  .seg-btn .lbl-short { display: inline; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { padding: 20px; }
  .hero-verdict { max-width: none; }
  .plan { overflow-x: auto; }
  .plan svg { min-width: 560px; }
  .plan-label { font-size: 15px; }
  .plan-sub { font-size: 12px; }
  .plan-txt { font-size: 13px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px; }
  .tl { min-width: 680px; }
  .hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-mark { font-size: 9px; padding: 2px 6px; }
  .tl-mark .mk-full { display: none; }
  .tl-mark .mk-short { display: inline; }
  .tl-receipt { padding: 9px 10px; }
  .ledger-scroll { max-height: 380px; }
  .ledger table { min-width: 620px; }
  .footer-links a { padding: 8px 0; }
  .ch-grid { grid-template-columns: 1fr; }
  .only-mobile { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .plan-leak, .plan-link { animation: none; }
  .meter-fill { transition: none; }
}
