/* Design "Atelier": app shell with a sidebar, cards, quiet tables, help in tooltips. */
:root {
  --bg: #f7f7f8; --surface: #ffffff; --sunk: #f1f1f3; --hover: #f4f5f7; --line: #e6e6ea; --line-2: #d9d9df;
  --ink: #17171c; --ink-2: #55565f; --ink-3: #8a8b94;
  --accent: #0a66c2; --accent-soft: #e8f1fb; --on-accent: #ffffff;
  --good: #16803c; --good-bg: #e6f4ea;
  --warn: #a15c00; --warn-bg: #fdf1dc;
  --bad: #c4321f; --bad-bg: #fdecea;
  --idle: #6b6c75; --idle-bg: #efeff2;
  --s1: #d6e6f8; --s2: #9ec5f4; --s3: #6da7ec; --s4: #3987e5; --s5: #0a66c2; --s6: #184f95; --s7: #0d366b;
  --zone-home: #0a66c2; --zone-neighbour: #6da7ec; --zone-other: #c3c4cc;
  --pending: #dcdce2;
  --shadow: 0 1px 2px rgba(16, 16, 24, .04), 0 1px 1px rgba(16, 16, 24, .03);
  --shadow-lg: 0 12px 32px rgba(16, 16, 24, .14), 0 2px 6px rgba(16, 16, 24, .06);
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
  --side: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f12; --surface: #17171b; --sunk: #1e1e23; --hover: #1f1f25; --line: #27272e; --line-2: #34343c;
    --ink: #ededf0; --ink-2: #a9aab3; --ink-3: #75767f;
    --accent: #4c9bf0; --accent-soft: #14243a; --on-accent: #0b1220;
    --good: #4fc27a; --good-bg: #12291b; --warn: #f0b25a; --warn-bg: #33250f; --bad: #f07a6a; --bad-bg: #351815;
    --idle: #9a9ba4; --idle-bg: #232329;
    --s1: #14243a; --s2: #184f95; --s3: #1f5fae; --s4: #2a78d6; --s5: #4c9bf0; --s6: #7cb5f3; --s7: #a9cdf7;
    --zone-home: #4c9bf0; --zone-neighbour: #2a5a92; --zone-other: #4a4a52;
    --pending: #303037;
    --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f12; --surface: #17171b; --sunk: #1e1e23; --hover: #1f1f25; --line: #27272e; --line-2: #34343c;
  --ink: #ededf0; --ink-2: #a9aab3; --ink-3: #75767f;
  --accent: #4c9bf0; --accent-soft: #14243a; --on-accent: #0b1220;
  --good: #4fc27a; --good-bg: #12291b; --warn: #f0b25a; --warn-bg: #33250f; --bad: #f07a6a; --bad-bg: #351815;
  --idle: #9a9ba4; --idle-bg: #232329;
  --s1: #14243a; --s2: #184f95; --s3: #1f5fae; --s4: #2a78d6; --s5: #4c9bf0; --s6: #7cb5f3; --s7: #a9cdf7;
  --zone-home: #4c9bf0; --zone-neighbour: #2a5a92; --zone-other: #4a4a52;
  --pending: #303037;
  --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 15px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--ink-2); }
p { margin: 0; }
ul { margin: 0; padding-left: 18px; }
.mono { font-family: var(--f-mono); font-size: .9em; }
.num, .n { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.sub { color: var(--ink-2); max-width: 80ch; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--ink); }
code { font-family: var(--f-mono); font-size: 12px; background: var(--sunk); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 60; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--surface) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 14px 10px; display: flex; flex-direction: column; gap: 16px; z-index: 40; }
.ws { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--ink); }
.ws:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #0a66c2, #5b3fd1); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.ws b { display: block; font-weight: 600; line-height: 1.2; }
.ws small { display: block; color: var(--ink-3); font-size: 12px; }
.search { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk); color: var(--ink-3); cursor: pointer; font: inherit; text-align: left; }
.search:hover { border-color: var(--line-2); color: var(--ink-2); }
.search kbd, .kbd { margin-left: auto; font: 500 11px var(--f-body); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; background: var(--surface); color: var(--ink-3); }
.nav-group { display: grid; gap: 1px; }
.nav-group h6 { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-weight: 500; }
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item .badge { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav-item .soon { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.side .bottom { margin-top: auto; display: flex; align-items: center; gap: 4px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.side .bottom form { margin: 0; }
.avatar { width: 28px; height: 28px; border-radius: 99px; background: var(--sunk); display: grid; place-items: center; font-weight: 600; font-size: 11px; color: var(--ink-2); flex: none; }
.side .who { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 4px; }
.iconbtn { border: 0; background: none; width: 30px; height: 30px; padding: 0; border-radius: 7px; cursor: pointer; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn svg { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { color: var(--ink-3); display: flex; gap: 6px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: inherit; }
.crumbs b { color: var(--ink); font-weight: 600; }
.appbar .spacer { flex: 1; }
.menu-btn { display: none; }
.scrim { display: none; }
main.wrap { width: 100%; max-width: 1320px; padding: 24px 28px 64px; display: grid; gap: 20px; align-content: start; }
footer.foot { color: var(--ink-3); font-size: 12px; padding-top: 8px; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 10, 15, .35); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .appbar { padding-inline: 12px; }
  main.wrap { padding: 18px 16px 56px; }
  .tip > span { position: fixed; left: 16px; right: 16px; top: auto; transform: none; max-width: none; width: auto; margin-top: 24px; }
  .appbar .hide-sm { display: none; }
}

/* ---------- page header ---------- */
header.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
header.top .meta { display: grid; gap: 4px; min-width: 0; flex: 1 1 420px; }
header.top .meta .sub { color: var(--ink-3); }
header.top .actions { flex: none; }
.next { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; max-width: 100%; box-shadow: var(--shadow); flex: 0 1 380px; }
.next .eyebrow { font-size: 11.5px; }
.next.review { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.next code { display: block; overflow-x: auto; white-space: nowrap; padding: 6px 8px; overflow-wrap: normal; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--r); padding: 10px 14px; color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.error { color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }

/* ---------- tooltips ---------- */
.tip { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-3); font: 700 10px/1 var(--f-body); cursor: help; vertical-align: 1px; flex: none; }
.tip:hover, .tip:focus { color: var(--ink); border-color: var(--ink-3); outline: none; }
.tip > span { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(320px, 80vw); background: var(--ink); color: var(--bg); font: 400 12.5px/1.5 var(--f-body); padding: 9px 12px; border-radius: 8px; box-shadow: var(--shadow-lg); display: none; pointer-events: none; z-index: 50; text-align: left; letter-spacing: 0; text-transform: none; white-space: normal; }
.tip > span code { background: color-mix(in srgb, var(--bg) 18%, transparent); border-color: transparent; color: inherit; }
.tip:hover > span, .tip:focus > span { display: block; }
.tip.left > span { left: auto; right: -8px; transform: none; }

/* ---------- cards ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); }
.panel > h2:first-child, .panel-h h2 { display: flex; align-items: center; gap: 6px; }
.panel > * { min-width: 0; }
.panel-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.panel.flush { padding: 0; gap: 0; }
.panel.flush > .panel-h { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel.flush > .panel-b { padding: 16px; }
.panel.flush > .tscroll > table th:first-child, .panel.flush > .tscroll > table td:first-child { padding-left: 16px; }
.panel.flush > .tscroll > table th:last-child, .panel.flush > .tscroll > table td:last-child { padding-right: 16px; }
.panel.flush > p.muted { padding: 16px; }
section.block { display: grid; gap: 12px; min-width: 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.block-head .sub { color: var(--ink-3); font-size: 13px; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
.cols > * { min-width: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); align-content: start; min-width: 0; box-shadow: var(--shadow); }
.kpi .label { color: var(--ink-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .value { font-size: 26px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.kpi.hero .value { color: var(--accent); }
.kpi .foot { font-size: 12.5px; color: var(--ink-3); }
.kpi .spark { width: 100%; height: 34px; display: block; margin-top: 6px; }
a.kpi { color: inherit; transition: border-color .12s; }
a.kpi:hover { border-color: var(--line-2); text-decoration: none; }
.delta { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--idle); background: var(--idle-bg); }

/* ---------- brief ("En bref") ---------- */
.brief { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); box-shadow: var(--shadow); }
.brief-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.brief-h .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.brief p { font-size: 15px; line-height: 1.55; max-width: 92ch; }
.brief p b { font-weight: 600; }
.brief .actions { margin-top: 2px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--f-body); padding: 4px 8px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.good { color: var(--good); background: var(--good-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.idle { color: var(--idle); background: var(--idle-bg); }
.pill.info { color: var(--accent); background: var(--accent-soft); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- tables ---------- */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll.tall { max-height: 560px; overflow-y: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--ink-3); font-size: 12px; white-space: nowrap; background: var(--surface); }
.tscroll.tall th { position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.wrap { min-width: 18ch; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--hover); }
td.n, th.n { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 14ch; }
td a { font-weight: 500; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 3px; align-items: center; }
th button.sort:hover { color: var(--ink); }
th button.sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
th[aria-sort] button.sort { color: var(--accent); }
tr.tier-row td { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 14px; border-bottom: 0; background: none; }
tr.dim td { color: var(--ink-3); }
tr.total td { font-weight: 600; background: var(--sunk); }
.delta-bad { color: var(--bad); }
.delta-warn { color: var(--warn); }
table.kv th { width: 38%; color: var(--ink-3); font-weight: 400; font-size: 13px; white-space: normal; vertical-align: top; }
table.kv td { vertical-align: top; }
table.kv tr:hover { background: none; }
.rate { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.rate .mini { width: 44px; height: 5px; background: var(--sunk); border-radius: 9px; overflow: hidden; }
.rate .mini i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.rate-n { display: block; font-size: 11px; color: var(--ink-3); }
.best { color: var(--good); font-weight: 600; }

/* bars inside tables */
td.bar { width: 40%; min-width: 80px; }
.track { display: flex; gap: 2px; height: 12px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.track .seg { height: 100%; background: var(--accent); border-radius: 4px; min-width: 0; }
.track .seg.pale { background: var(--s2); }
.track .seg.out { background: var(--zone-other); }
.track .seg.home { background: var(--zone-home); }
.track .seg.neighbour { background: var(--zone-neighbour); }
.track .seg.other { background: var(--zone-other); }
.track .seg.neg { background: var(--bad); }
.track.pending { background: repeating-linear-gradient(135deg, var(--pending) 0 5px, transparent 5px 9px); border: 1px dashed var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; color: var(--ink-2); }
.legend .sw, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.sw.accent { background: var(--accent); } .sw.pale { background: var(--s2); } .sw.out { background: var(--zone-other); }
.sw.home { background: var(--zone-home); } .sw.neighbour { background: var(--zone-neighbour); }
.sw.good { background: var(--good); }

/* funnel */
table.funnel td { vertical-align: middle; }
table.funnel td.bar { width: 55%; }
table.funnel .track { height: 16px; }
table.funnel tr.final .seg { background: var(--s6); }
table.funnel td small { display: block; color: var(--ink-3); font-size: 11.5px; }
table.funnel tr.sep td { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 16px; background: none; }
.fun { display: grid; gap: 10px; }
.fun-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px 50px; gap: 10px; align-items: center; font-size: 13px; }
.fun-row .t { height: 22px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.fun-row .f { height: 100%; background: var(--accent); border-radius: 5px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.fun-row .f.low { background: var(--warn); }
.fun-row b, .fun-row small { text-align: right; font-variant-numeric: tabular-nums; }
.fun-row b { font-weight: 600; }
.fun-row small { font-size: 12px; color: var(--ink-3); }
.fun-row small.low { color: var(--warn); font-weight: 600; }

/* chart */
.chart { width: 100%; height: 240px; display: block; overflow: visible; }
.chart .hit:hover + .hl, .chart .hl.on { opacity: 1; }
.ctip { position: fixed; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; z-index: 60; min-width: 190px; }
.ctip b { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ctip div { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.ctip div span:last-child { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* meters */
.meters { display: grid; gap: 12px; }
.meters.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px 24px; }
.meter { display: grid; gap: 5px; }
.meter .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter .top span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.meter .mtrack { height: 6px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.meter .fill.hot { background: var(--warn); }
.meter .note { font-size: 12px; color: var(--ink-3); }

/* pipeline gates */
.gates { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.gate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.gate.current { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 0 3px 0 var(--accent); }
.gate.later { background: transparent; box-shadow: none; border-style: dashed; }
.gate .code { font: 500 11.5px var(--f-mono); color: var(--ink-3); }
.gate .name { font-weight: 600; color: var(--ink); }
.gate .detail { font-size: 12px; color: var(--ink-3); }

.checks { display: grid; }
.check { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.check:first-child { border-top: 0; padding-top: 0; }
.check .what { display: grid; gap: 3px; min-width: 0; }
.check .what p { color: var(--ink-2); font-size: 13px; }
@media (max-width: 480px) { .check { grid-template-columns: 1fr; gap: 6px; } }

.calc { display: grid; gap: 10px; }
.calc .line { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.calc .line:last-child { border-bottom: 0; }
.calc .line .k { color: var(--ink-2); font-size: 13px; }
.calc .line .k small { display: block; color: var(--ink-3); font-size: 11.5px; }
.calc .line .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; }
details summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 8px; }
pre.json { background: var(--sunk); border-radius: var(--r); padding: 10px; font: 12px/1.45 var(--f-mono); overflow-x: auto; max-height: 360px; }

/* ---------- forms and buttons ---------- */
form.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); align-items: end; }
form.filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); min-width: 0; }
form.filters .wide { grid-column: 1 / -1; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline select { width: auto; }
input, select, button { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100%; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
button { cursor: pointer; width: auto; font-weight: 500; box-shadow: var(--shadow); }
button:hover { border-color: var(--ink-3); }
button.primary, a.button, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer; font-weight: 500; text-align: center; padding: 7px 14px; border-radius: 8px; width: auto; font-size: 13.5px; }
button.primary:hover, a.button:hover, button.button:hover { filter: brightness(1.08); text-decoration: none; }
a.button.ghost, button.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
a.button.ghost:hover, button.ghost:hover { filter: none; border-color: var(--ink-3); }
button.danger { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); font-weight: 500; padding: 7px 14px; }
button.danger:hover { border-color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rowhead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; font-size: 13px; }
.statusform { display: grid; gap: 12px; }
.statusform label { display: grid; gap: 4px; }
label.inline, form.filters label.inline { display: flex; gap: 8px; align-items: center; }
label.inline input { width: auto; }
.linkbtn { background: none; border: 0; box-shadow: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

/* segmented control and tabs */
.segctl { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.segctl a, .segctl button { border: 0; box-shadow: none; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.segctl a:hover, .segctl button:hover { color: var(--ink); text-decoration: none; }
.segctl [aria-pressed="true"], .segctl [aria-current="page"], .segctl [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; max-width: 100%; }
.tabs button { flex: none; border: 0; box-shadow: none; background: none; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); font-weight: 500; white-space: nowrap; font-size: 13px; }
.tabs button:hover { background: var(--hover); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--sunk); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
select.compact { width: auto; padding: 5px 8px; font-size: 13px; }

/* steps list (how-to) */
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 13px; color: var(--ink-2); }
ol.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
ol.steps b { color: var(--ink); font-weight: 600; }

/* empty states */
.empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 28px 16px; color: var(--ink-3); }
.empty b { color: var(--ink-2); font-weight: 600; }

/* ---------- command palette ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 15, .4); display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 0; z-index: 70; }
.palette { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 15px; background: none; outline: none; }
.palette input:focus { outline: none; border-color: var(--line); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.palette li { padding: 8px 10px; border-radius: 7px; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.palette li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette li small { color: var(--ink-3); }
.palette .hint { padding: 8px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; display: flex; gap: 12px; }

/* ---------- Claude's overview (pipeline pages) ---------- */
.ai { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); max-width: 90ch; box-shadow: var(--shadow); }
.ai-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.ai .eyebrow { color: var(--accent); font-weight: 600; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 14vh auto 0; padding: 28px 24px; display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
@media (max-width: 440px) { .login { margin: 8vh 16px 0; } }
.login form { display: grid; gap: 10px; }
.login button.primary { width: 100%; padding: 9px; }
.login .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 22px; }
  .kpi .row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; } }
