/* AffinorBio screening console
   Layout target is 1280 x 800 per view with no scrolling, and 390 px wide on phones. */

:root {
  --blue: #0B2E55;          /* Deep Nordic Blue, brand and primary */
  --blue-700: #123E6E;
  --spruce: #176D2C;        /* Spruce Green, positive status */
  --spruce-50: #E6F2E9;
  --teal: #00C2B2;          /* Signal Teal, accents and links */
  --teal-ink: #007A70;      /* teal dark enough for text on white */
  --teal-50: #E0F7F5;
  --mist: #F0F2F5;          /* Mist Grey, app background */
  --stage: #0B1B2E;         /* dark stage for the 3D view */
  --stage-text: #D9D9D9;
  --ink: #0E1C2C;
  --ink-2: #3B4A5C;
  --muted: #6A7787;
  --line: #E1E5EA;
  --line-2: #EDF0F3;
  --white: #FFFFFF;
  --bar-track: #E8ECF1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 46, 85, .06), 0 4px 16px rgba(11, 46, 85, .05);
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --base-g: #0B2E55;
  --base-t: #176D2C;
  --base-a: #00897D;
  --base-c: #6A7787;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01", "tnum";
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { flex: none; }

/* ------------------------------------------------------------ shell */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  min-height: 640px;
}

.sidebar {
  background: var(--blue);
  background-image:
    radial-gradient(120% 60% at 0% 100%, rgba(0, 194, 178, .16), transparent 60%),
    linear-gradient(180deg, #0B2E55 0%, #0A2749 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-mark {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  flex: none;
}
.brand-mark i {
  position: absolute; top: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.4px solid var(--teal);
}
.brand-mark i:first-child { left: 5px; }
.brand-mark i:last-child { left: 13px; border-color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: rgba(255, 255, 255, .62); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .74);
  text-decoration: none;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item[aria-current="page"] { background: rgba(255, 255, 255, .11); color: #fff; }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--teal);
}
.nav-item[aria-current="page"] svg { stroke: var(--teal); }
.nav-label { display: flex; align-items: center; gap: 9px; }
.nav-step {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 600;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
}
.nav-item[aria-current="page"] .nav-step { background: var(--teal); color: var(--stage); }
.nav-item:focus-visible, .btn:focus-visible, .tool:focus-visible, .pick:focus-visible, .rank-row:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}

.run-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-size: 12.5px;
}
.run-card .rc-label { color: rgba(255, 255, 255, .55); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.run-card .rc-name { font-weight: 600; font-size: 14px; margin-top: 4px; color: #fff; }
.run-card .rc-meta { color: rgba(255, 255, 255, .62); margin-top: 2px; }
.run-card .rc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.run-card .rc-stats b { display: block; font-size: 16px; color: #fff; font-weight: 650; }
.run-card .rc-stats span { color: rgba(255, 255, 255, .58); font-size: 11.5px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(6px);
}
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; }
.crumb-run { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { width: 5px; height: 5px; border-radius: 50%; background: #C3CBD5; flex: none; }
.crumb-view { font-weight: 600; color: var(--ink); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.run-date { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge-data { background: var(--teal-50); color: var(--teal-ink); box-shadow: inset 0 0 0 1px rgba(0, 194, 178, .35); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.views { flex: 1; min-height: 0; overflow: auto; }
.view { display: none; padding: 26px 32px 28px; }
.view.active { display: flex; flex-direction: column; gap: 20px; min-height: 100%; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-ink); }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; color: var(--blue); margin-top: 4px; }
.lead { color: var(--ink-2); margin-top: 6px; font-size: 14.5px; max-width: 720px; }
.head-actions { display: flex; gap: 10px; flex: none; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 0;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(11, 46, 85, .25), 0 6px 16px rgba(11, 46, 85, .18); }
.btn-primary svg { fill: var(--teal); stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary[disabled] { background: var(--spruce); cursor: default; box-shadow: none; }
.btn-primary[disabled] svg { fill: none; stroke: #fff; }
.btn-ghost { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px #C8D0DA; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line-2);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.card-head h2 { font-size: 15px; font-weight: 650; color: var(--ink); }
.count-chip { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--mist); border-radius: 999px; padding: 3px 10px; }
.panel-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------ tables */

.table-wrap { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th .unit { text-transform: none; letter-spacing: 0; font-weight: 500; color: #98A3B0; margin-left: 4px; }
.table td { padding: 16px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }

.cand-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.type-chip {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
  background: #E9EEF5; color: var(--blue);
}
.col-num { width: 52px; }
.idx { color: var(--muted); font-variant-numeric: tabular-nums; }
.seq {
  display: block;
  font-size: 13px; letter-spacing: .14em; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px;
}
.seq .g { color: var(--base-g); } .seq .t { color: var(--base-t); }
.seq .a { color: var(--base-a); } .seq .c { color: var(--base-c); }
.seq .u { color: var(--base-t); } .seq .x { color: var(--muted); }
.seq-track { display: flex; gap: 1px; height: 4px; margin-top: 6px; max-width: 300px; border-radius: 2px; overflow: hidden; }
.seq-track i { flex: 1; }

/* ------------------------------------------------------------ view 1 */

.grid-candidates { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; flex: 1; min-height: 0; }

.target-card {
  position: relative; overflow: hidden;
  background: var(--stage);
  border: 0;
  color: var(--stage-text);
  padding: 24px;
  display: flex; flex-direction: column;
}
.target-card::before {
  content: ""; position: absolute; right: -90px; top: -70px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 194, 178, .28), rgba(0, 194, 178, 0) 65%);
}
.target-card::after {
  content: ""; position: absolute; left: -60px; bottom: -120px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 109, 44, .35), rgba(23, 109, 44, 0) 65%);
}
.target-card > * { position: relative; z-index: 1; }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tc-label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.target-card .badge-data { background: rgba(0, 194, 178, .12); color: #7FE7DE; box-shadow: inset 0 0 0 1px rgba(0, 194, 178, .4); }
.tc-name { font-size: 25px; font-weight: 700; color: #fff; line-height: 1.2; margin-top: 18px; letter-spacing: -.01em; }
.tc-art { margin: 26px 0 10px; height: 190px; position: relative; }
.tc-art svg { width: 100%; height: 100%; }
.tc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); }
.fact .fl { font-size: 11.5px; color: rgba(217, 217, 217, .66); }
.fact .fv { font-size: 15px; font-weight: 600; color: #fff; margin-top: 2px; }
.fact.wide { grid-column: span 2; }

.table-card { display: flex; flex-direction: column; min-width: 0; }
.table-card .table-wrap { flex: none; }
.flow {
  list-style: none; margin: auto 0 0; padding: 16px 22px 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  border-top: 1px solid var(--line-2);
}
.flow li { display: flex; gap: 10px; align-items: flex-start; }
.flow-n {
  flex: none; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal-50); color: var(--teal-ink); font-size: 12px; font-weight: 700;
}
.flow li:last-child .flow-n { background: var(--spruce-50); color: var(--spruce); }
.flow b { display: block; font-size: 13px; color: var(--ink); }
.flow small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 1px; }

/* ------------------------------------------------------------ view 2 */

.grid-structure { display: grid; grid-template-columns: 172px minmax(0, 1fr) 364px; gap: 16px; flex: 1; min-height: 0; }

.picker { padding: 16px 10px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.picker .panel-label { padding: 0 8px; }
.picker-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.pick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left;
  padding: 10px 10px; border-radius: 10px;
  border: 0; background: transparent; cursor: pointer;
}
.pick:hover { background: var(--mist); }
.pick[aria-current="true"] { background: #E8EFF7; box-shadow: inset 0 0 0 1px #CAD8E8; }
.pick-name { font-weight: 600; font-size: 13.5px; display: block; }
.pick-sub { display: block; font-size: 12px; color: var(--muted); }
.pick-score {
  font-size: 12.5px; font-weight: 700; color: var(--blue);
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 7px; padding: 2px 7px; font-variant-numeric: tabular-nums;
}
.pick[aria-current="true"] .pick-score { background: var(--blue); color: #fff; box-shadow: none; }

.stage {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 40%, #12283F 0%, var(--stage) 70%);
  min-height: 420px;
}
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { outline: none; }
.stage-overlay { position: absolute; left: 16px; right: 16px; z-index: 2; pointer-events: none; }
.stage-top { top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stage-title { color: #fff; font-weight: 600; font-size: 14px; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.stage-tools { display: flex; gap: 6px; pointer-events: auto; }
.tool {
  height: 30px; padding: 0 11px; border-radius: 8px; border: 0; cursor: pointer; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--stage-text);
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.tool:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.tool[aria-pressed="true"] { background: rgba(0, 194, 178, .18); color: #9FF0E8; box-shadow: inset 0 0 0 1px rgba(0, 194, 178, .5); }
.stage-legend { bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--stage-text); }
.stage-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-target { background: #7C9CC4; }
.sw-cand { background: var(--teal); }
.sw-iface { background: #EAF1F8; }

.stage-placeholder {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: var(--stage-text);
}
.ph-art { position: relative; width: 120px; height: 80px; margin-bottom: 18px; }
.ph-art i { position: absolute; border-radius: 50%; }
.ph-art i:nth-child(1) { left: 6px; top: 8px; width: 64px; height: 64px; background: rgba(124, 156, 196, .3); box-shadow: inset 0 0 0 2px rgba(124, 156, 196, .6); }
.ph-art i:nth-child(2) { left: 56px; top: 22px; width: 44px; height: 44px; background: rgba(0, 194, 178, .25); box-shadow: inset 0 0 0 2px rgba(0, 194, 178, .7); }
.ph-art i:nth-child(3) { left: 58px; top: 36px; width: 10px; height: 10px; background: #EAF1F8; }
.ph-title { color: #fff; font-weight: 600; font-size: 16px; }
.ph-text { margin-top: 6px; max-width: 300px; font-size: 13px; color: rgba(217, 217, 217, .78); }
.stage-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--teal); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.readout { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; }
.ro-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ro-name { font-size: 18px; font-weight: 700; color: var(--blue); line-height: 1.2; }
.ro-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ro-score {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 12px; background: var(--mist);
}
.ring { width: 64px; height: 64px; flex: none; }
.ring .trk { stroke: #DCE2EA; }
.ring .val { stroke: var(--blue); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-size: 17px; font-weight: 700; fill: var(--blue); }
.ro-score .lbl { font-size: 12px; color: var(--muted); }
.ro-score .big { font-size: 15px; font-weight: 650; color: var(--ink); }
.ro-score .hint { font-size: 12px; color: var(--muted); margin-top: 1px; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat { padding: 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.stat .sl { font-size: 11px; color: var(--muted); line-height: 1.25; }
.stat .sv { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .sv small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.models-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: auto; }
.models-table th { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: right; padding: 6px 3px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.models-table th:first-child, .models-table td:first-child { text-align: left; padding-left: 0; }
.models-table th:last-child, .models-table td:last-child { padding-right: 0; }
.models-table td { text-align: right; padding: 7px 3px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.models-table tr.top td { font-weight: 650; color: var(--ink); }
.models-table tr:last-child td { border-bottom: 0; }
.top-chip { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--teal-50); color: var(--teal-ink); vertical-align: 1px; }
.ro-note { font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: flex-start; }
.ro-note svg { width: 14px; height: 14px; margin-top: 2px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }

/* ------------------------------------------------------------ view 3 */

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 15px 18px; }
.kpi .kl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .kv { font-size: 26px; font-weight: 700; color: var(--blue); margin-top: 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .ks { font-size: 12px; color: var(--muted); }
.kpi.accent .kv { color: var(--spruce); }

.rank-card { overflow: hidden; }
.rank-table td { padding-top: 14px; padding-bottom: 14px; }
.rank-row { cursor: pointer; transition: background .12s; }
.rank-row:hover { background: #F7F9FB; }
.col-rank { width: 70px; }
.rank-n {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  font-weight: 700; font-size: 14px;
  background: var(--mist); color: var(--ink-2);
}
.rank-row.is-short .rank-n { background: var(--blue); color: #fff; }
.rank-row:first-child .rank-n { box-shadow: 0 0 0 3px rgba(0, 194, 178, .35); }
.col-bar { width: 27%; }
.bar { display: flex; align-items: center; gap: 12px; }
.bar-track { position: relative; flex: 1; height: 12px; border-radius: 6px; background: var(--bar-track); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, #1C4A7E, var(--blue)); }
.rank-row.is-short .bar-fill { background: linear-gradient(90deg, #138A85, var(--blue) 75%); }
.bar-val { width: 40px; text-align: right; font-weight: 700; font-size: 15px; color: var(--blue); font-variant-numeric: tabular-nums; }
.sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.col-status { width: 124px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-short { background: var(--spruce-50); color: var(--spruce); }
.chip-hold { background: var(--mist); color: var(--muted); }
.chip-ready { background: var(--teal-50); color: var(--teal-ink); }
.chip-sent { background: var(--spruce); color: #fff; }
.chip-sent::before { background: #9FE0B0; }
.footnote { font-size: 12.5px; color: var(--muted); max-width: 900px; margin-top: auto; }

/* ------------------------------------------------------------ view 4 */

.handoff {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 22px;
}
.handoff-step { display: flex; align-items: center; gap: 10px; flex: none; }
.handoff-step b { display: block; font-size: 13px; }
.handoff-step small { display: block; font-size: 12px; color: var(--muted); }
.hs-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px #C9D2DC; background: #fff; position: relative; }
.handoff-step.done .hs-dot { background: var(--blue); box-shadow: none; }
.handoff-step.done .hs-dot::after { content: ""; position: absolute; left: 7px; top: 5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.handoff-step.lab .hs-dot { box-shadow: inset 0 0 0 2px var(--spruce); }
.handoff-step.lab.active .hs-dot { background: var(--spruce); box-shadow: 0 0 0 5px rgba(23, 109, 44, .15); }
.handoff-step.lab.active .hs-dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.handoff-line { flex: 1; height: 2px; min-width: 16px; background: repeating-linear-gradient(90deg, #C9D2DC 0 6px, transparent 6px 11px); }
.handoff-line.done { background: var(--blue); }
.handoff-line.active { background: var(--spruce); }

.short-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.short-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.short-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-rank { font-size: 12px; font-weight: 700; color: var(--teal-ink); letter-spacing: .06em; text-transform: uppercase; }
.sc-name { font-size: 21px; font-weight: 700; color: var(--blue); line-height: 1.15; }
.sc-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sc-score { display: flex; align-items: baseline; gap: 6px; }
.sc-score b { font-size: 34px; font-weight: 750; color: var(--blue); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.sc-score span { font-size: 12.5px; color: var(--muted); }
.sc-bar { height: 8px; border-radius: 4px; background: var(--bar-track); overflow: hidden; margin-top: -6px; }
.sc-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #138A85, var(--blue)); }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.sc-stats .sl { font-size: 11.5px; color: var(--muted); }
.sc-stats .sv { font-size: 15px; font-weight: 650; margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-stats .sv small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.sc-seq .seq { max-width: 100%; font-size: 12.5px; }
.sc-seq .sl { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }

/* ------------------------------------------------------------ fatal */

.fatal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--mist); padding: 16px; }
.fatal-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; max-width: 420px; text-align: center; }
.fatal-card .brand-mark { margin: 0 auto 16px; background: var(--blue); }
.fatal-card h1 { font-size: 20px; }
.fatal-card p { color: var(--ink-2); margin-top: 8px; }

/* ------------------------------------------------------------ medium widths */

@media (max-width: 1180px) {
  .rank-table .col-models, .rank-table td.col-models { display: none; }
}

/* ------------------------------------------------------------ phones and tablets */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .sidebar { padding: 14px 16px 0; gap: 12px; position: sticky; top: 0; z-index: 10; }
  .brand { padding: 0; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark i { top: 7px; width: 15px; height: 15px; }
  .brand-mark i:first-child { left: 4px; }
  .brand-mark i:last-child { left: 11px; }
  .nav { flex-direction: row; gap: 2px; margin: 0 -8px; }
  .nav-item { flex: 1; flex-direction: column; gap: 4px; padding: 8px 2px 10px; border-radius: 10px 10px 0 0; font-size: 12px; }
  .nav-item[aria-current="page"]::before { left: 18%; right: 18%; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .nav-step { display: none; }
  .run-card { display: none; }
  .main { height: auto; }
  .topbar { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 6px 12px; }
  .crumb-sep, .crumb-view { display: none; }
  .views { overflow: visible; }
  .view { padding: 18px 16px 28px; }
  .view-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .view-head .btn { width: 100%; }
  .head-actions { flex-direction: column-reverse; }
  h1 { font-size: 23px; }

  .grid-candidates, .grid-structure { grid-template-columns: minmax(0, 1fr); }
  .target-card { padding: 20px; }
  .tc-art { height: 90px; }

  .cand-table thead { display: none; }
  .cand-table, .cand-table tbody, .cand-table tr, .cand-table td { display: block; width: 100%; }
  .cand-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .cand-table td { padding: 0 !important; border: 0; }
  .cand-table td.col-num { grid-row: span 3; width: auto; }
  .cand-table td.col-seq { grid-column: 2 / 4; }
  .cand-table td.td-type { grid-column: 2; }
  .cand-table td.num { grid-column: 3; grid-row: 1; }
  .seq, .seq-track { max-width: 100%; }
  .flow { grid-template-columns: 1fr 1fr; padding: 14px 16px 16px; }

  .picker { padding: 10px; min-width: 0; }
  .picker .panel-label { display: none; }
  .picker-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .pick { flex: none; width: auto; gap: 10px; }
  .pick-sub { display: none; }
  .stage { min-height: 340px; height: 340px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }

  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .kv { font-size: 22px; }
  .rank-table thead { display: none; }
  .rank-table, .rank-table tbody, .rank-table tr, .rank-table td { display: block; width: 100%; }
  .rank-table tr { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .rank-table td { padding: 0 !important; border: 0; text-align: left; }
  .rank-table td.td-rank { grid-row: span 3; }
  .rank-table td.td-name { grid-column: 2; }
  .rank-table td.td-status { grid-column: 3; grid-row: 1; }
  .rank-table td.td-bar { grid-column: 2 / 4; }
  .rank-table td.td-metric { display: none; }
  .rank-table td.td-mobile { display: block; grid-column: 2 / 4; font-size: 12.5px; color: var(--muted); }

  .handoff { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .handoff-line { width: 2px; height: 14px; min-width: 0; flex: none; margin-left: 10px; background: repeating-linear-gradient(180deg, #C9D2DC 0 4px, transparent 4px 7px); }
  .handoff-line.done { background: var(--blue); }
  .handoff-line.active { background: var(--spruce); }
  .short-grid { grid-template-columns: 1fr; }
}

.td-mobile { display: none; }

/* ranking table spacing, keeps all eight columns inside 1280 px */
.rank-table th, .rank-table td { padding-left: 11px; padding-right: 11px; }
.rank-table th:first-child, .rank-table td:first-child { padding-left: 20px; }
.rank-table th:last-child, .rank-table td:last-child { padding-right: 20px; }

/* values line up even when a label wraps to two lines */
.stat, .sc-stats > div { display: flex; flex-direction: column; justify-content: space-between; }

a { color: var(--teal-ink); font-weight: 600; text-underline-offset: 2px; }
a:hover { color: var(--blue); }
