/* Second Close app tokens from the approved Noomo reference. */
@font-face {
  font-family: TheSeasons; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/_nuxt/fonnts.com-theseasons-it.CUCq9ttA.otf') format('opentype');
}
@font-face {
  font-family: TTNeoris; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/_nuxt/TTNeorisTrialRegular.CykOY4gR.ttf') format('truetype');
}
:root {
  color-scheme: light;
  --bg: #edf4fc; --bg-2: #dbeafa;
  --surface: #ffffff; --surface-2: #f3f7fc; --surface-3: #e1ecf8;
  --ink: #16365b; --ink-2: #304d6c; --muted: #52667d;
  --line: #d1dfed; --line-2: #8199b1;
  --accent: #16365b; --accent-2: #89651c; --accent-wash: #f4e9d2; --on-accent: #ffffff;
  --s1: #89651c; --s2: #c06140; --s3: #397487; --s4: #9b6715; --s5: #346ba5;
  --q1: #e6f0fb; --q2: #bfd7f1; --q3: #8ab5e0; --q4: #527ead; --q5: #89651c; --q6: #16365b;
  --good: #277250; --warn: #ab7615; --serious: #be603d; --critical: #b73748;
  --grid: #dce6f0; --axis: #8199b1;
  --f-sans: TTNeoris, Arial, sans-serif;
  --f-display: TheSeasons, Georgia, serif;
  --f-mono: TTNeoris, Arial, sans-serif;
  --r-panel: 20px; --r-ctrl: 16px; --r-control: 16px; --r-chip: 999px; --r-mark: 3px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;
  --e-1: none; --e-2: 0 12px 28px -22px rgba(41,52,90,.3); --e-3: 0 24px 64px -32px rgba(6,11,29,.4);
  --ease-out: cubic-bezier(.65,.05,.36,1);
  --ease-in-out: cubic-bezier(.65,.05,.36,1);
  --ease-drawer: cubic-bezier(.65,.05,.36,1);
  --t-press: 140ms; --t-hover: 180ms; --t-enter: 220ms; --t-panel: 320ms;
  --rail: 236px; --chrome: rgba(237,244,252,.94);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #060b1d; --bg-2: #051125; --surface: #101b35; --surface-2: #182443; --surface-3: #263151;
    --ink: #f7faff; --ink-2: #edf4fc; --muted: #b0c2d5; --line: #344060; --line-2: #69769d;
    --accent: #edf4fc; --accent-2: #e8c780; --accent-wash: #263f5c; --on-accent: #060b1d;
    --s1: #e8c780; --s2: #e99c7e; --s3: #8bc2cf; --s4: #e8bf71; --s5: #93bde8;
    --q1: #17324e; --q2: #285077; --q3: #4579a9; --q4: #527ead; --q5: #9ac5ed; --q6: #dbeafa;
    --good: #8bc7a9; --warn: #e8bf71; --serious: #e99c7e; --critical: #f58fa0;
    --grid: #293354; --axis: #69769d; --chrome: rgba(6,11,29,.94);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060b1d; --bg-2: #051125; --surface: #101b35; --surface-2: #182443; --surface-3: #263151;
  --ink: #f7faff; --ink-2: #edf4fc; --muted: #b0c2d5; --line: #344060; --line-2: #69769d;
  --accent: #edf4fc; --accent-2: #e8c780; --accent-wash: #263f5c; --on-accent: #060b1d;
  --s1: #e8c780; --s2: #e99c7e; --s3: #8bc2cf; --s4: #e8bf71; --s5: #93bde8;
  --q1: #17324e; --q2: #285077; --q3: #4579a9; --q4: #527ead; --q5: #9ac5ed; --q6: #dbeafa;
  --good: #8bc7a9; --warn: #e8bf71; --serious: #e99c7e; --critical: #f58fa0;
  --grid: #293354; --axis: #69769d; --chrome: rgba(6,11,29,.94);
}

/* ---- base ------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-mark);
}
::selection { background: var(--accent-wash); color: var(--ink); }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: var(--r-ctrl); font-weight: 600;
}
.skip:focus { left: 8px; }

/* ---- shell ----------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.app > *, main, .view, .grid, .grid > *, .panel, .model, .model .body,
.model .body > *, .statrail, .tablewrap, .facets, .facet { min-width: 0; }
.tablewrap, .facet, .panel { max-width: 100%; }
main { overflow-x: clip; }

/* the rail is a translucent material, content scrolls under it */
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-5) var(--s-3) var(--s-4);
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { padding: 2px var(--s-2) var(--s-5); }
.brand .mark {
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.brand h1 {
  font-size: 19px; font-weight: 600; margin: 6px 0 2px;
  letter-spacing: -.018em; line-height: 1.15;
}
.brand .sub { font-size: 12px; color: var(--muted); letter-spacing: -.005em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; width: 100%; min-height: 38px;
  text-align: left; background: none; border: 0; cursor: pointer;
  padding: 9px var(--s-3); border-radius: var(--r-ctrl);
  color: var(--ink-2); font-size: 14px; line-height: 1.3; font-weight: 450;
  transition: background var(--t-hover) var(--ease-out),
              color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav button:hover { background: var(--surface-2); color: var(--ink); }
}
.nav button:active { transform: scale(.98); }
.nav button[aria-current="true"] {
  background: var(--accent-wash); color: var(--accent-2); font-weight: 600;
}

.rail .spacer { flex: 1; min-height: var(--s-4); }
.source {
  border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: var(--s-3); background: var(--surface-2);
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.source b { display: block; color: var(--ink-2); font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.theme-btn {
  margin-top: var(--s-2); width: 100%; min-height: 38px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: var(--r-ctrl);
  color: var(--muted); font-size: 12.5px;
  transition: border-color var(--t-hover) var(--ease-out),
              color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .theme-btn:hover { border-color: var(--line-2); color: var(--ink-2); }
}
.theme-btn:active { transform: scale(.98); }

/* ---- top bar: floating chrome, no hard divider ------------------ */
main { padding-bottom: var(--s-8); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: var(--s-5) clamp(16px, 3vw, 32px) var(--s-4);
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-5); flex-wrap: wrap;
}
/* scroll edge effect instead of a 1px rule */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 18px;
  background: linear-gradient(to bottom, var(--chrome), transparent);
  pointer-events: none;
}
.topbar h2 { font-size: 25px; font-weight: 600; margin: 0; letter-spacing: -.022em; line-height: 1.15; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 76ch; }

.view {
  padding: var(--s-5) clamp(16px, 3vw, 32px) 0;
  display: none;
}
.view.active { display: block; }
.view.enter > * { animation: rise var(--t-enter) var(--ease-out) both; }
.view.enter > *:nth-child(2) { animation-delay: 40ms; }
.view.enter > *:nth-child(3) { animation-delay: 80ms; }
.view.enter > *:nth-child(4) { animation-delay: 110ms; }
.view.enter > *:nth-child(n+5) { animation-delay: 140ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- panels ---------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: var(--s-4) var(--s-5); box-shadow: var(--e-1);
}
.panel > h3, .panel-h {
  font-size: 14px; font-weight: 600; margin: 0 0 2px; letter-spacing: -.008em;
}
.panel .cap { font-size: 12.5px; color: var(--muted); margin: 0 0 var(--s-3); max-width: 78ch; }
.grid { display: grid; gap: var(--s-3); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.mt { margin-top: var(--s-3); }

/* metrics breathe in a divided rail, not four separate cards */
.statrail {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); box-shadow: var(--e-1); overflow: hidden;
}
.statrail .cell {
  padding: var(--s-4) var(--s-5);
  border-right: 1px solid var(--line);
}
.statrail .cell:last-child { border-right: 0; }
.stat-label {
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.stat-value {
  font-size: 30px; font-weight: 600; letter-spacing: -.032em;
  margin: 8px 0 3px; line-height: 1.04; font-variant-numeric: tabular-nums;
}
.stat-value.accent { color: var(--accent); }
.stat-note { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.stat-note b { color: var(--ink-2); font-weight: 600; }

/* ---- chips, pills, scores -------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .02em;
  padding: 3px 9px; border-radius: var(--r-chip);
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.pill.priority    { background: var(--accent-wash); color: var(--accent-2); border-color: transparent; font-weight: 600; }
.pill.recoverable { background: color-mix(in srgb, var(--s1) 14%, transparent); color: var(--s1); border-color: transparent; }
.pill.watch       { background: color-mix(in srgb, var(--s4) 17%, transparent); color: color-mix(in srgb, var(--s4) 76%, var(--ink)); border-color: transparent; }
.pill.cold        { background: var(--surface-2); color: var(--muted); }
.pill.warm        { background: color-mix(in srgb, var(--serious) 18%, transparent); color: color-mix(in srgb, var(--serious) 70%, var(--ink)); border-color: transparent; font-weight: 600; }

.score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 24px; padding: 0 6px; border-radius: var(--r-mark);
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }

/* ---- tables ---------------------------------------------------- */
.tablewrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface); box-shadow: var(--e-1);
}
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left;
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 10px var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 10px var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background var(--t-hover) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  tbody tr.click:hover { background: var(--surface-2); }
}
tbody tr.click:active { background: var(--surface-3); }
tbody tr.sel { background: var(--accent-wash); }
td.r, th.r { text-align: right; }

/* ---- controls -------------------------------------------------- */
.controls { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-3); }
.controls input[type="search"], .controls select, .btn, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctrl);
  padding: 8px 11px; font-size: 13.5px; color: var(--ink); min-height: 38px;
  transition: border-color var(--t-hover) var(--ease-out), box-shadow var(--t-hover) var(--ease-out);
}
.controls input[type="search"] { min-width: 220px; }
.controls input[type="search"]::placeholder { color: var(--muted); }
.controls input:focus, .controls select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
.btn {
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-weight: 500;
  transition: border-color var(--t-hover) var(--ease-out),
              background var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--line-2); } }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
}
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); min-height: 38px; cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---- drawer ---------------------------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(6, 11, 29, .38);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-panel) var(--ease-out);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(540px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--e-3);
  transform: translate3d(102%, 0, 0);
  transition: transform var(--t-panel) var(--ease-drawer);
  z-index: 60; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s-6) var(--s-6) var(--s-8);
  will-change: transform;
}
.drawer.open { transform: translate3d(0, 0, 0); }
.drawer .close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px;
  display: grid; place-items: center; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1; border-radius: var(--r-ctrl);
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .drawer .close:hover { background: var(--surface-2); color: var(--ink); } }
.drawer .close:active { transform: scale(.94); }
.drawer h3 { font-size: 21px; font-weight: 600; margin: 0 0 3px; letter-spacing: -.022em; padding-right: 40px; }
.drawer .sub { color: var(--muted); font-size: 13px; margin-bottom: var(--s-4); }

.section-label {
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin: var(--s-6) 0 var(--s-2); padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--s-3); font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li {
  padding: 8px 0 8px var(--s-5); position: relative; font-size: 13.2px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.reasons li:last-child { border-bottom: 0; }
.reasons li::before {
  content: ""; position: absolute; left: 3px; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.transcript {
  font-family: var(--f-mono); font-size: 12.2px; line-height: 1.75; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctrl);
  padding: var(--s-3) var(--s-4); max-height: 260px; overflow-y: auto;
}
.transcript mark { background: color-mix(in srgb, var(--s4) 32%, transparent); color: inherit; border-radius: 2px; padding: 0 2px; }

.message { border: 1px solid var(--line); border-radius: var(--r-ctrl); background: var(--surface-2); overflow: hidden; }
.message .subj { padding: 11px var(--s-4); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.message .body { padding: var(--s-3) var(--s-4); white-space: pre-wrap; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.message .foot {
  padding: 9px var(--s-4); border-top: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 11px; color: var(--muted);
  display: flex; gap: var(--s-4); flex-wrap: wrap;
}

/* ---- charts ---------------------------------------------------- */
.chart { width: 100%; max-width: 880px; height: auto; overflow: visible; display: block; margin: 0 auto; }
.chart text { font-family: var(--f-mono); font-size: 9.5px; fill: var(--muted); }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .lbl { font-family: var(--f-sans); font-size: 11px; fill: var(--ink-2); }
.chart .val { font-family: var(--f-mono); font-size: 10.5px; fill: var(--ink-2); }
.chart .mark-hover { opacity: 0; }
.chart g.hit:hover .mark-hover { opacity: 1; }
.chart g.hit { cursor: crosshair; }

.legend { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: var(--s-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

#tip {
  position: fixed; pointer-events: none; z-index: 90; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-ctrl); padding: 8px 11px;
  font-size: 12px; box-shadow: var(--e-2); max-width: 290px; line-height: 1.45;
  opacity: 0; transform: scale(.97);
  transition: opacity 125ms var(--ease-out), transform 125ms var(--ease-out);
}
#tip.on { opacity: 1; transform: scale(1); }
#tip b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---- model room ------------------------------------------------ */
.model {
  border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface);
  box-shadow: var(--e-1); overflow: hidden; margin-bottom: var(--s-3);
}
.model > header {
  display: flex; gap: var(--s-4); align-items: baseline; justify-content: space-between;
  padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line);
  background: var(--surface-2); flex-wrap: wrap;
}
.model > header h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.model > header .algo { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.model .body {
  padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-4) var(--s-5);
  grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr);
  align-items: start;
}
/* wide supporting tables span the full panel rather than squeezing into a column */
.model .body .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .model .body { grid-template-columns: 1fr; } }
.model .facts { display: grid; gap: var(--s-3); align-content: start; }
.model .facts div { font-size: 12.8px; color: var(--ink-2); line-height: 1.55; }
.model .facts .h {
  display: block; margin-bottom: 3px; font-size: 11.5px; font-weight: 600;
  color: var(--ink); letter-spacing: -.005em;
}
.metrics { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.metrics .m .v { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metrics .m .k { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.facets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-2); }
.facet { border: 1px solid var(--line); border-radius: var(--r-ctrl); padding: var(--s-2); }
.facet .t { font-size: 11.5px; font-weight: 600; margin-bottom: 2px; }
.facet .s { font-family: var(--f-mono); font-size: 10px; color: var(--muted); }

.callout {
  border-left: 3px solid var(--accent); background: var(--accent-wash);
  padding: var(--s-3) var(--s-4); border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0;
  font-size: 13.2px; color: var(--ink-2); line-height: 1.55;
}
.callout b { color: var(--ink); }
.callout.warnbox {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 11%, transparent);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--f-mono); font-size: 11px; padding: 5px 10px; border-radius: var(--r-chip);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  cursor: pointer; min-height: 30px; display: inline-flex; align-items: center;
  transition: border-color var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--accent); color: var(--accent); } }
.chip:active { transform: scale(.97); }
.chip.static { cursor: default; }
.chip.static:active { transform: none; }

textarea.tx { width: 100%; min-height: 190px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.65; resize: vertical; }

.barrow { display: grid; grid-template-columns: 132px 1fr 54px; gap: var(--s-3); align-items: center; font-size: 12.5px; margin-bottom: 7px; }
.barrow .track { height: 8px; background: var(--surface-3); border-radius: var(--r-chip); overflow: hidden; }
.barrow .fill {
  height: 100%; border-radius: var(--r-chip); background: var(--s1);
  transition: width var(--t-panel) var(--ease-out);
}
.barrow .n { font-family: var(--f-mono); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.runbar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.progress { flex: 1; min-width: 180px; height: 6px; background: var(--surface-3); border-radius: var(--r-chip); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-chip); }

/* ---- loading, empty, error states ------------------------------ */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; border-radius: var(--r-mark);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel-row { height: 14px; margin: 14px var(--s-3); }
.skel-panel { height: 190px; border-radius: var(--r-panel); }

.state {
  border: 1px dashed var(--line-2); border-radius: var(--r-panel);
  padding: var(--s-8) var(--s-5); text-align: center; background: var(--surface);
}
.state h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.state p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 13px; }
.state.error { border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.state .btn { margin-top: var(--s-4); }

footer.foot {
  margin: var(--s-8) clamp(16px, 3vw, 32px) 0; padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
}

/* ---- responsive ------------------------------------------------ */
@media (max-width: 820px) {
  :root { --rail: 0px; }
  .app { grid-template-columns: 1fr; }
  .rail {
    position: sticky; top: 0; z-index: 30; height: auto;
    padding: var(--s-3) var(--s-3) var(--s-2);
    padding-top: max(var(--s-3), env(safe-area-inset-top));
    flex-direction: column; gap: var(--s-2); align-items: stretch;
    background: var(--chrome);
    backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .rail .spacer, .rail .source { display: none; }
  .rail .theme-btn { display: block; width: fit-content; min-height: 36px; padding: 6px 12px; margin-top: 0; }
  .brand { padding: 0; display: flex; align-items: baseline; gap: var(--s-2); }
  .brand h1 { font-size: 17px; margin: 0; }
  .brand .sub { display: none; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: var(--s-1); scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { white-space: nowrap; min-height: 44px; padding: 10px var(--s-3); font-size: 13.5px; }

  body { font-size: 15px; }
  .topbar { position: static; padding: var(--s-4) var(--s-4) var(--s-3); backdrop-filter: none; background: transparent; }
  .topbar::after { display: none; }
  .topbar h2 { font-size: 21px; }
  .view { padding: var(--s-4) var(--s-4) 0; }
  .panel { padding: var(--s-3) var(--s-4); }
  .statrail { grid-template-columns: 1fr; }
  .statrail .cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .statrail .cell:last-child { border-bottom: 0; }
  .stat-value { font-size: 26px; }
  .model .body, .model > header { padding: var(--s-3) var(--s-4); }
  .metrics { gap: var(--s-4); }
  .controls { gap: 6px; }
  .controls input[type="search"], .controls select { min-width: 0; width: 100%; min-height: 44px; }
  .toggle { min-height: 44px; }
  .barrow { grid-template-columns: 100px 1fr 46px; gap: var(--s-2); font-size: 12px; }
  .drawer { width: 100vw; padding: var(--s-4) var(--s-4) var(--s-8); }
  .drawer .close { width: 44px; height: 44px; }
  /* let a dense table scroll sideways rather than wrapping every cell */
  .tablewrap table { min-width: 660px; }
  tbody td, thead th { padding: 12px var(--s-3); white-space: nowrap; }
  tbody td .tiny { white-space: normal; }
  .facets { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  footer.foot { margin: var(--s-7) var(--s-4) 0; }
}

/* ---- user preferences ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .drawer { transition: none; }
  .view.enter > * { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .rail { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(6, 11, 29, .55); }
}
@media (prefers-contrast: more) {
  :root { --line: var(--line-2); --muted: var(--ink-2); }
  .panel, .statrail, .tablewrap, .model { border-color: var(--line-2); }
}

/* Display hierarchy follows the landing page; data stays in the sans face. */
body { font-synthesis: none; }
a { color: var(--accent-2); }
.brand h1 { font-family: var(--f-sans); font-weight: 400; }
.brand .mark, .stat-label, thead th, .section-label, .metrics .m .k, footer.foot {
  letter-spacing: .04em;
}
.topbar { align-items: center; border-bottom: 1px solid var(--line-2); }
.topbar::after { display: none; }
.topbar h2 { font: italic 400 clamp(42px, 4.8vw, 76px)/1.06 var(--f-display); letter-spacing: -.025em; overflow-wrap: anywhere; }
.topbar p { font-size: 15px; margin-top: 12px; }
.rail { background: transparent; border-right-color: var(--line-2); }
.nav button[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 400; }
.panel, .statrail, .tablewrap, .model { border-color: transparent; }
.drawer h3 { font: italic 400 38px/1.12 var(--f-display); }
.btn { justify-content: center; text-decoration: none; }
.btn, .nav button, .chip { font-weight: 400; }
.btn:active, .nav button:active, .chip:active { transform: translateY(1px); }
.statrail .cell { padding-top: 24px; padding-bottom: 24px; }
.stat-value { font-weight: 400; }
@media (max-width: 820px) {
  .topbar h2 { font-size: clamp(40px, 8vw, 60px); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .rail { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .nav button:active, .chip:active, .theme-btn:active, .drawer .close:active { transform: none; }
}
