/* ================================================================
   Animal Neuro Platform — application stylesheet
   Visual language consumed from the Noldus Figma design system
   (tokens). This layer turns the tokens into real, functional
   web-app controls (the Figma frames are static specimens).
   ================================================================ */
@import "../dist/fig-tokens.css";
/* Fonts are loaded via <link> in the document head (faster + lets us gate
   the React mount on the icon font, avoiding ligature-before-load races). */

/* ---- semantic app variables (mapped from DS tokens) ---------- */
:root {
  --pri:        var(--schemes-primary-primary-default);   /* forest green */
  --pri-hover:  var(--schemes-primary-primary-hover);
  --pri-press:  var(--schemes-primary-primary-pressed);
  --on-pri:     var(--schemes-primary-on-primary-default);
  --pri-cont:   var(--schemes-containers-primary-container);
  --on-pri-cont:var(--schemes-containers-on-primary-container);
  --sec-cont:   var(--schemes-containers-secondary-container);
  --lime:       var(--color-lime);
  --ink:        var(--schemes-on-surface);
  --muted:      var(--schemes-on-surface-variant);
  --err:        var(--schemes-error-error);
  --err-cont:   var(--schemes-error-error-container);
  --warn:       var(--orange-orange600);
  --warn-cont:  var(--orange-orange100);
  --info:       var(--blue-blue600);
  --info-cont:  var(--blue-blue100);
  --ok:         var(--green-green600);
  --ok-cont:    var(--green-green100);

  --canvas:     #eef1f0;
  --surface:    #ffffff;
  --surface-2:  #f6f8f7;
  --surface-3:  #eef2f1;
  --line:       rgba(31,31,31,.10);
  --line-2:     rgba(31,31,31,.16);
  --shadow-1:   0 1px 2px rgba(16,42,38,.06), 0 1px 3px rgba(16,42,38,.10);
  --shadow-2:   0 2px 6px rgba(16,42,38,.08), 0 10px 28px rgba(16,42,38,.10);
  --shadow-3:   0 8px 24px rgba(16,42,38,.16), 0 24px 60px rgba(16,42,38,.18);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;
  --topbar-h: 60px;
  --rail-w: 84px;
  --stage-w: 248px;
}
:root[data-theme="dark"] {
  --canvas:    #0e1413;
  --surface:   #161c1b;
  --surface-2: #1c2322;
  --surface-3: #232b2a;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.18);
  --ink:       #e7ecea;
  --muted:     #aab4b1;
  --shadow-1:  0 1px 2px rgba(0,0,0,.4);
  --shadow-2:  0 2px 8px rgba(0,0,0,.45), 0 12px 30px rgba(0,0,0,.45);
  --shadow-3:  0 12px 40px rgba(0,0,0,.6);
}

* , *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--pri-cont); }

/* ---- material symbols icon -------------------------------------- */
.msym {
  font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap;
  direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; user-select: none; font-size: 20px; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center;
}
.msym.fill { font-variation-settings: "FILL" 1; }
.msym.s18 { font-size: 18px; } .msym.s20 { font-size: 20px; } .msym.s24 { font-size: 24px; }
.msym.s32 { font-size: 32px; } .msym.s40 { font-size: 40px; } .msym.s48 { font-size: 48px; }

/* ---- type helpers ----------------------------------------------- */
.t-display { font-size: 28px; font-weight: 600; line-height: 1.12; letter-spacing: -.01em; }
.t-h1 { font-size: 21px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.t-h2 { font-size: 18px; font-weight: 600; line-height: 1.25; }
.t-h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.t-title { font-size: 16px; font-weight: 600; }
.t-body { font-size: 14px; font-weight: 400; }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t-mono { font-family: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- buttons ---------------------------------------------------- */
.btn {
  --bg: var(--pri); --fg: var(--on-pri); --bd: transparent;
  appearance: none; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; font-size: 14px;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; white-space: nowrap; transition: filter .12s, background .12s, border-color .12s, box-shadow .12s, transform .04s;
  text-decoration: none; user-select: none;
}
.btn:hover { background: var(--pri-hover); }
.btn:active { background: var(--pri-press); transform: translateY(.5px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--info) 55%, transparent); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn .msym { font-size: 18px; margin: 0 -2px; }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.tonal { --bg: var(--sec-cont); --fg: var(--on-pri-cont); }
.btn.tonal:hover { filter: brightness(.97); background: var(--sec-cont); }
.btn.tonal:active { filter: brightness(.94); background: var(--sec-cont); }
.btn.outline { --bg: transparent; --fg: var(--pri); --bd: var(--line-2); }
.btn.outline:hover { background: color-mix(in srgb, var(--pri) 7%, transparent); }
.btn.outline:active { background: color-mix(in srgb, var(--pri) 12%, transparent); }
.btn.ghost { --bg: transparent; --fg: var(--ink); --bd: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn.danger { --bg: var(--err); --fg: #fff; }
.btn.danger:hover { background: var(--err); filter: brightness(1.08); }
.btn.text { --bg: transparent; --fg: var(--pri); --bd: transparent; padding: 0 8px; }
.btn.text:hover { background: color-mix(in srgb, var(--pri) 8%, transparent); }

.iconbtn {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink);
  width: 40px; height: 40px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.iconbtn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.iconbtn:active { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.iconbtn:focus-visible { outline: 3px solid color-mix(in srgb, var(--info) 55%, transparent); outline-offset: 1px; }
.iconbtn.sm { width: 32px; height: 32px; }
.iconbtn.tonal { background: var(--sec-cont); color: var(--on-pri-cont); }
.iconbtn.solid { background: var(--pri); color: var(--on-pri); }
.iconbtn.solid:hover { background: var(--pri-hover); }
.iconbtn[disabled] { opacity: .35; pointer-events: none; }

/* ---- fields ----------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err-text { font-size: 12px; color: var(--err); display: flex; align-items: center; gap: 4px; }
.input, .select, .textarea {
  appearance: none; width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  height: 40px; padding: 0 12px; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 22%, transparent); }
.field.invalid .input, .field.invalid .select { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 18%, transparent); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .msym.lead { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.input-wrap .input.has-lead { padding-left: 38px; }
.input-wrap .trail { position: absolute; right: 6px; }
.select { background-image: none; cursor: pointer; padding-right: 34px; }
.select-wrap { position: relative; }
.select-wrap .msym.chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox .box { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background .12s, border-color .12s; flex: none; }
.checkbox input:checked + .box { background: var(--pri); border-color: var(--pri); }
.checkbox input:checked + .box::after { content: "check"; font-family: "Material Symbols Outlined"; font-size: 15px; }
.checkbox input:focus-visible + .box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 50%, transparent); }
.checkbox.disabled { opacity: .45; pointer-events: none; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px; background: var(--surface-2); gap: 2px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--pri); color: var(--on-pri); }
.seg button:not(.on):hover { color: var(--ink); }

/* switch */
.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--muted); transition: .15s; }
.switch .thumb { position: absolute; top: 5px; left: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + .track { background: var(--pri); border-color: var(--pri); }
.switch input:checked + .track + .thumb { left: 23px; background: #fff; width: 18px; height: 18px; top: 4px; }

/* ---- status pills ----------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--muted); border: 1px solid transparent;
}
.pill .msym { font-size: 14px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.draft   { background: var(--surface-3); color: var(--muted); }
.pill.active, .pill.info  { background: var(--info-cont); color: var(--info); }
.pill.running { background: var(--pri-cont); color: var(--on-pri-cont); }
.pill.running .dot { animation: pulse 1.1s ease-in-out infinite; }
.pill.done, .pill.ok    { background: var(--ok-cont); color: var(--ok); }
.pill.locked  { background: var(--surface-3); color: var(--ink); }
.pill.error   { background: var(--err-cont); color: var(--err); }
.pill.warn    { background: var(--warn-cont); color: var(--warn); }
.pill.excluded{ background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

/* ---- cards & surfaces ------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 20px; }
.card.hover { transition: box-shadow .14s, border-color .14s, transform .14s; cursor: pointer; }
.card.hover:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-1px); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
hr.div { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---- tables ----------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }

/* ---- progress --------------------------------------------------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--pri); border-radius: 999px; transition: width .25s ease; }
.bar.thin { height: 5px; }
.bar.indet > i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--pri) 25%, transparent); border-top-color: var(--pri); animation: spin .7s linear infinite; }
.spinner.lg { width: 34px; height: 34px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* circular progress */
.circ { transform: rotate(-90deg); }
.circ .track { stroke: var(--surface-3); }
.circ .fill { stroke: var(--pri); stroke-linecap: round; transition: stroke-dashoffset .3s; }

/* ---- skeleton --------------------------------------------------- */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, color-mix(in srgb, var(--surface-3) 50%, var(--surface)) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- empty state ------------------------------------------------ */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 24px; gap: 14px; color: var(--muted); }
.empty .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; }
.empty .ic .msym { font-size: 34px; }
.empty h3 { margin: 0; color: var(--ink); font-size: 17px; }
.empty p { margin: 0; max-width: 42ch; }

/* ---- toasts ----------------------------------------------------- */
.toast-host { position: fixed; top: 70px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-3); border: 1px solid var(--line); animation: toastin .25s cubic-bezier(.2,.8,.2,1); }
.toast .msym { flex: none; }
.toast.ok .msym { color: var(--ok); } .toast.error .msym { color: var(--err); } .toast.info .msym { color: var(--info); }
.toast .body { flex: 1; min-width: 0; }
.toast .ttl { font-weight: 600; font-size: 13.5px; }
.toast .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@keyframes toastin { from { opacity: 0; transform: translateX(20px); } }

/* ---- modal ------------------------------------------------------ */
.scrim { position: fixed; inset: 0; background: rgba(8,18,16,.5); backdrop-filter: blur(2px); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: 88vh; overflow: auto; animation: pop .2s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(880px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal .mhead { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal .mbody { padding: 16px 22px; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 22px 20px; }

/* ---- generic layout utils --------------------------------------- */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.gap4{gap:4px;}.gap8{gap:8px;}.gap12{gap:12px;}.gap16{gap:16px;}.gap20{gap:20px;}.gap24{gap:24px;}
.scroll-y { overflow-y: auto; }
.chip-tab { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:var(--r-pill); font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; border:1px solid transparent; }
.chip-tab.on { background: var(--pri-cont); color: var(--on-pri-cont); }
.chip-tab:not(.on):hover { background: var(--surface-3); color: var(--ink); }
.divider-v { width:1px; align-self:stretch; background:var(--line); }

/* ================================================================
   App shell — guided journey
   ================================================================ */
.shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.mvt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 28%, transparent); flex: none; }

/* top app bar */
.appbar { height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); z-index: 30; }
.appbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.appbar-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* app menu */
.appmenu { position: relative; flex: none; }
.appmenu-btn { appearance: none; border: 1px solid transparent; background: transparent; cursor: pointer; height: 44px; padding: 0 6px 0 8px; border-radius: var(--r-md); display: flex; align-items: center; gap: 2px; }
.appmenu-btn:hover { background: var(--surface-3); }
.appmenu-pop { position: absolute; top: calc(100% + 6px); left: 0; width: 300px; z-index: 80; box-shadow: var(--shadow-3); overflow: hidden; padding: 8px; }
.appmenu-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; }
.appmenu-item { appearance: none; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); }
.appmenu-item:hover { background: var(--surface-3); }
.ami-ic { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.ami-l { display: block; font-weight: 600; font-size: 14px; } .ami-d { display: block; font-size: 12px; color: var(--muted); }

/* journey stepper */
.journey { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.journey-home { appearance: none; border: 1px solid transparent; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: var(--r-pill); color: var(--ink); max-width: 210px; }
.journey-home:hover { background: var(--surface-3); }
.journey-home.on { background: var(--pri-cont); color: var(--on-pri-cont); }
.jh-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey-sep { color: var(--muted); opacity: .5; flex: none; }
.journey-stages { display: flex; align-items: center; gap: 2px; min-width: 0; }
.journey-step { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border-radius: var(--r-pill); color: var(--muted); transition: background .12s, color .12s; }
.journey-step:hover { background: var(--surface-3); color: var(--ink); }
.journey-step.on { background: var(--pri); color: var(--on-pri); }
.journey-step.on .js-blurb { color: color-mix(in srgb, var(--on-pri) 78%, transparent); }
.js-num { width: 20px; height: 20px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.journey-step:hover .js-num { background: var(--line-2); }
.journey-step.on .js-num { background: color-mix(in srgb, #fff 26%, transparent); color: #fff; }
.journey-step.done .js-num { background: var(--ok-cont); color: var(--ok); }
.journey-step.on.done .js-num { background: color-mix(in srgb, #fff 26%, transparent); color: #fff; }
.js-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.js-text { display: flex; flex-direction: column; line-height: 1.05; }
.js-label { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.js-blurb { font-size: 10px; color: var(--muted); white-space: nowrap; }
.journey-line { width: 18px; height: 2px; background: var(--line-2); flex: none; border-radius: 2px; }
.journey-line.lit { background: var(--ok); }
.global-title { display: flex; align-items: center; padding-left: 4px; }
.gt-label { font-size: 16px; font-weight: 600; }

/* stage sub-step row */
.substep-row { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 5px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.substeps { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.substep { appearance: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .1s, color .1s; }
.substep:hover { background: var(--surface-3); color: var(--ink); }
.substep.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.substep .msym { color: var(--muted); }
.substep.on .msym { color: var(--pri); }
.continue { flex: none; }

/* work area */
.workarea { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.content { flex: 1; overflow-y: auto; }
.exp-status { flex: none; }
.presence { display: flex; }
.ava { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; border: 2px solid var(--surface); }
.ava.a { background: var(--pri); } .ava.b { background: var(--blue-blue600); margin-left: -8px; }
.account { appearance: none; border: 1px solid var(--line); background: var(--surface); cursor: pointer; height: 38px; padding: 0 6px 0 4px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 2px; color: var(--muted); }
.account:hover { border-color: var(--line-2); }

/* notification bell */
.bell { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; border: 2px solid var(--surface); }
.bell-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; z-index: 80; box-shadow: var(--shadow-3); overflow: hidden; }
.bell-head { padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.bell-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.bell-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-item.unread { background: color-mix(in srgb, var(--info) 7%, transparent); }
.bell-item .ni { font-size: 20px; } .ni.ok { color: var(--ok); } .ni.error { color: var(--err); } .ni.info { color: var(--info); }
.ni-t { font-size: 13px; font-weight: 600; } .ni-b { font-size: 12.5px; color: var(--muted); margin-top: 1px; } .ni-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* page wrapper */
.page { max-width: 1280px; margin: 0 auto; padding: 18px 28px 40px; }
.page.full { max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-head h1 { margin: 0 0 4px; }
.page-head .sub { color: var(--muted); }

/* ---- overview / context screens ---- */
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tpl-card { appearance: none; cursor: pointer; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, background .12s; }
.tpl-card:hover { border-color: var(--line-2); }
.tpl-card.on { border-color: var(--pri); background: color-mix(in srgb, var(--pri) 6%, transparent); }
.tpl-sketch { background: var(--surface-2); border-radius: var(--r-sm); height: 64px; display: flex; align-items: center; justify-content: center; }
.tpl-name { font-weight: 600; font-size: 13.5px; } .tpl-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

.stage-strip { display: flex; align-items: center; }
.strip-node { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 8px; }
.strip-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: flex; align-items: center; justify-content: center; border: 2px solid transparent; transition: .15s; }
.strip-node.cur .strip-ic { background: var(--pri); color: var(--on-pri); }
.strip-node.cur { color: var(--ink); }
.strip-node.done .strip-ic { background: var(--ok-cont); color: var(--ok); }
.strip-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); margin: 0 4px; }
.strip-bar.done { background: var(--ok); }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.readiness .rd-ok { color: var(--ok); } .readiness .rd-no { color: var(--muted); opacity: .5; }
.activity { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.activity:first-of-type { border-top: 0; }
.act-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }

/* ---- stub shell ---- */
.stub-banner { display: flex; align-items: center; gap: 10px; background: var(--info-cont); color: var(--info); border-radius: var(--r-md); padding: 12px 16px; font-size: 13px; margin-bottom: 20px; }
.stub-banner .msym { flex: none; }
.stub-banner b { color: var(--info); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lib-card { display: flex; align-items: center; gap: 14px; }
.lib-ic { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.lib-ic.sm { width: 36px; height: 36px; }
.split-mock { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.advisor { display: flex; gap: 10px; background: var(--pri-cont); color: var(--on-pri-cont); border-radius: var(--r-sm); padding: 12px; }
.advisor .msym { color: var(--pri); flex: none; }
.sel-var { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 13px; }
.board-mock { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile-canvas { height: 160px; background: var(--surface-2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; margin-top: 10px; }
.cam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cam { position: relative; aspect-ratio: 16/10; background: #11201c; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam-tag { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.cam-rec { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 5px; color: #fff; font-size: 11px; font-weight: 700; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--err); animation: pulse 1.1s infinite; }
.metric-tile { font-weight: 600; font-size: 14px; }
.score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.score-track { position: relative; flex: 1; height: 22px; background: var(--surface-2); border-radius: 6px; }
.score-blk { position: absolute; top: 4px; height: 14px; border-radius: 3px; }
.export-row { cursor: pointer; }

/* ================================================================
   MVT screens
   ================================================================ */
/* upload */
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface); padding: 48px 24px; text-align: center; cursor: pointer; transition: border-color .14s, background .14s; }
.dropzone:hover { border-color: var(--muted); }
.dropzone.drag { border-color: var(--pri); background: color-mix(in srgb, var(--pri) 6%, var(--surface)); }
.dropzone.busy { cursor: default; }
.dz-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--sec-cont); color: var(--on-pri-cont); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.dz-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.dz-link { color: var(--pri); font-weight: 600; text-decoration: underline; }
.dz-busy { padding: 8px; }
.inline-err { display: flex; align-items: center; gap: 10px; margin-top: 14px; background: var(--err-cont); color: var(--err); padding: 12px 16px; border-radius: var(--r-md); font-size: 13.5px; }
.vrow { display: flex; align-items: center; gap: 16px; padding: 12px; }
.vthumb { width: 96px; height: 60px; border-radius: var(--r-sm); background: var(--surface-3) center/cover no-repeat; display: flex; align-items: center; justify-content: center; flex: none; }
.vmeta { min-width: 0; }

/* arena editor */
.arena-wrap { display: flex; flex-direction: column; height: 100%; }
.arena-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.arena-name { width: 220px; height: 36px; font-weight: 600; }
.arena-body { flex: 1; display: grid; grid-template-columns: 92px 1fr 320px; min-height: 0; }
.arena-tools { border-right: 1px solid var(--line); background: var(--surface); padding: 14px 8px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.tool { appearance: none; border: 1px solid transparent; background: transparent; cursor: pointer; border-radius: var(--r-sm); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); font-size: 10.5px; font-weight: 600; position: relative; }
.tool:hover { background: var(--surface-3); }
.tool.on { background: var(--pri-cont); color: var(--on-pri-cont); }
.tool.soon { color: var(--muted); opacity: .65; cursor: not-allowed; }
.soon-badge { font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); color: var(--muted); padding: 1px 5px; border-radius: 5px; }
.tool .soon-badge { position: absolute; top: 4px; right: 4px; }
.arena-stage { position: relative; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface-3) 0% 50%) 50% / 22px 22px; display: flex; flex-direction: column; min-width: 0; overflow: auto; }
.stage-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 360px; padding: 40px; }
.arena-setup { margin: auto; padding: 40px; max-width: 560px; }
.refframe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-1); }
.stage-empty p { color: var(--muted); margin: 0 0 8px; }
.stage-inner { margin: auto; padding: 24px; transform-origin: center; }
.stage-img-wrap { position: relative; box-shadow: var(--shadow-2); line-height: 0; border-radius: 4px; overflow: hidden; }
.stage-img { display: block; max-width: min(900px, 64vw); width: 100%; height: auto; user-select: none; }
.stage-svg { position: absolute; inset: 0; }
.shp { fill: none; }
.shp.boundary { stroke: var(--pri); stroke-width: 2.5; fill: color-mix(in srgb, var(--pri) 8%, transparent); }
.shp.boundary.sel { stroke-dasharray: none; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--pri) 60%, transparent)); }
.shp.boundary.bad { stroke: var(--err); fill: color-mix(in srgb, var(--err) 8%, transparent); }
.shp.zone { stroke: var(--blue-blue600); stroke-width: 2; stroke-dasharray: 6 4; fill: color-mix(in srgb, var(--blue-blue600) 10%, transparent); }
.shp.cal { stroke: var(--orange-orange600); stroke-width: 3; }
.shp.drawing { stroke: var(--pri); stroke-width: 2; stroke-dasharray: 5 4; fill: color-mix(in srgb, var(--pri) 6%, transparent); }
.cal-end { fill: var(--orange-orange600); stroke: #fff; stroke-width: 1.5; }
.shp-lbl { font: 600 11px Inter, sans-serif; fill: var(--pri); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.shp-lbl.zone { fill: var(--blue-blue600); } .shp-lbl.cal { fill: var(--orange-orange600); text-anchor: middle; }
.stage-cta { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r-pill); box-shadow: var(--shadow-2); white-space: nowrap; }
.arena-bottom { position: sticky; bottom: 0; flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.arena-props { border-left: 1px solid var(--line); background: var(--surface); padding: 16px; overflow-y: auto; }
.state-banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }
.state-banner.info { background: var(--info-cont); color: var(--info); }
.state-banner.warn { background: var(--warn-cont); color: var(--warn); }
.state-banner.ok { background: var(--ok-cont); color: var(--ok); }
.state-banner.error { background: var(--err-cont); color: var(--err); }
.prop-card { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden; }
.prop-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); font-weight: 600; font-size: 13px; cursor: default; }
.prop-head .ok-ic { color: var(--ok); }
.prop-body { padding: 12px; }
.dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.soon-card { opacity: .9; }

/* tracking queue */
.job { padding: 16px; }
.job-main { display: flex; align-items: center; gap: 14px; }
.job-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--surface-3); color: var(--muted); }
.job-ic.running { background: var(--pri-cont); color: var(--on-pri-cont); } .job-ic.running .msym { animation: spin 1.4s linear infinite; }
.job-ic.done { background: var(--ok-cont); color: var(--ok); } .job-ic.error { background: var(--err-cont); color: var(--err); }
.job-prog { margin-top: 14px; }
.job-err { margin-top: 12px; display: flex; align-items: center; gap: 8px; background: var(--err-cont); color: var(--err); padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; }
.job-done { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; }
.job-done b { font-weight: 700; }

/* playback */
.pb-page { padding-bottom: 40px; }
.pb-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; padding: 0 28px; }
.pb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pb-stage { overflow: hidden; min-height: 360px; display: flex; }
.video-wrap { position: relative; width: 100%; background: #0a0f0e; line-height: 0; }
.pb-video { width: 100%; max-height: 52vh; display: block; object-fit: contain; background: #0a0f0e; cursor: pointer; }
.pb-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.overlay-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 12px; background: rgba(0,0,0,.5); padding: 6px 10px; border-radius: 8px; }
.overlay-legend span { display: flex; align-items: center; gap: 5px; color: #fff; font-size: 11px; line-height: 1; }
.overlay-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pb-error { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px; color: var(--err); }
.pb-error p { color: var(--muted); max-width: 40ch; }
.transport { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.scrub { flex: 1; -webkit-appearance: none; height: 6px; border-radius: 999px; background: var(--surface-3); cursor: pointer; }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--pri); border: 2px solid var(--surface); box-shadow: var(--shadow-1); }
.scrub::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--pri); border: 2px solid var(--surface); }
.meta-list { display: flex; flex-direction: column; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.meta-row:first-child { border-top: 0; }
.metric-big .big-num { font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; margin: 4px 0; color: var(--pri); }
.metric-big .big-num .unit { font-size: 16px; font-weight: 600; color: var(--muted); }
.warn-note { display: flex; align-items: flex-start; gap: 6px; background: var(--warn-cont); color: var(--warn); padding: 8px 10px; border-radius: var(--r-sm); font-size: 12px; line-height: 1.35; }
.score-strip { position: relative; }
.score-row { position: relative; }
.marker-line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--lime); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---- overview launchpad ---- */
.resume-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(110deg, var(--pri), color-mix(in srgb, var(--pri) 78%, var(--blue-blue600))); color: var(--on-pri); border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow-2); }
.resume-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: color-mix(in srgb, #fff 20%, transparent); display: flex; align-items: center; justify-content: center; flex: none; }
.resume-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; }
.resume-sub { font-size: 13px; color: color-mix(in srgb, var(--on-pri) 82%, transparent); margin-top: 2px; max-width: 60ch; }
.resume-cta { flex: none; background: #fff; color: var(--pri); }
.resume-cta:hover { background: #fff; filter: brightness(.95); }
.launch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.launch-card { appearance: none; cursor: pointer; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-1); transition: box-shadow .14s, border-color .14s, transform .14s; min-height: 138px; }
.launch-card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-2px); }
.launch-card.cur { border-color: var(--pri); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pri) 30%, transparent), var(--shadow-1); }
.lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-step { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lc-ic { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.launch-card.done .lc-ic { background: var(--ok-cont); color: var(--ok); }
.lc-label { font-size: 15px; font-weight: 600; margin-top: 3px; }
.lc-detail { font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.lc-go { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--pri); }

@media (max-width: 1280px) {
  .js-blurb { display: none; }
  .journey-step { height: 40px; }
}
@media (max-width: 1080px) {
  .js-label { display: none; }
  .journey-step { padding: 0 10px; }
  .jh-name { max-width: 140px; }
  .launch-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .resume-hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 1100px) {
  .ov-grid, .pb-grid { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr 1fr; } .cards-2, .split-mock, .board-mock, .cam-grid { grid-template-columns: 1fr; }
}
/* Arena: narrow the props column rather than dropping it entirely (the
   calibration & zone controls live there — hiding it broke setup). */
@media (max-width: 1180px) { .arena-body { grid-template-columns: 84px 1fr 280px; } }
@media (max-width: 1000px) { .arena-body { grid-template-columns: 76px 1fr 252px; } }

/* ================================================================
   Short-viewport hardening — keep the whole platform usable on
   laptop heights (≈768) without clipping action bars or panels.
   The shell is height-locked (100vh), so on short screens we reclaim
   vertical space from the fixed chrome instead of letting content
   overflow off-screen.
   ================================================================ */
.appbar-left { overflow: hidden; }
.journey-stages { flex-shrink: 1; min-width: 0; }
.arena-props { min-height: 0; }

@media (max-height: 860px) {
  .appbar { height: 54px; }
  .journey-home, .journey-step { height: 38px; }
  .substep-row { padding: 5px 18px; }
  .substep { height: 30px; }
  .page { padding-top: 20px; padding-bottom: 40px; }
  .arena-top { padding: 8px 20px; }
  .pb-video { max-height: 50vh; }         /* keep play/scrub transport on-screen */
}
@media (max-height: 760px) {
  .appbar { height: 48px; }
  .js-blurb { display: none; }            /* drop the secondary journey line */
  .journey-home, .journey-step { height: 34px; }
  .substep-row { padding: 4px 16px; }
  .pb-video { max-height: 44vh; }         /* keep transport + metrics reachable */
  .page-head { margin-bottom: 16px; }
  .page { padding-top: 16px; }
  .arena-tools { padding: 10px 6px; }
}

/* ================================================================
   Watch-it-track + live tracking views (Acquire stage)
   ================================================================ */
.watch-grid { display: grid; grid-template-columns: minmax(0,1fr) 312px; gap: 16px; align-items: start; }
.watch-stage { overflow: hidden; display: flex; flex-direction: column; }
.watch-stage .video-wrap { width: 100%; }
.watch-stage .pb-video { width: 100%; max-height: 56vh; display: block; object-fit: contain; background: #0a0f0e; }
.watch-bar { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.track-badge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); backdrop-filter: blur(2px); }

/* live data panel */
.track-data { display: flex; flex-direction: column; }
.td-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.live-dot.on { background: var(--err); animation: pulse 1.1s infinite; }
.td-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-metric { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.td-metric.accent { background: var(--pri-cont); border-color: transparent; }
.tdm-val { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; color: var(--ink); }
.td-metric.accent .tdm-val { color: var(--on-pri-cont); }
.tdm-unit { font-size: 12px; font-weight: 600; color: var(--muted); }
.td-metric.accent .tdm-unit { color: color-mix(in srgb, var(--on-pri-cont) 70%, transparent); }
.tdm-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.td-metric.accent .tdm-label { color: color-mix(in srgb, var(--on-pri-cont) 78%, transparent); }
.td-spark { margin-top: 14px; }
.spark { display: block; width: 100%; }
.spark-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; background: var(--surface-2); border-radius: var(--r-sm); }

/* compact queue rows */
.queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.queue-row .job-ic { width: 32px; height: 32px; }

/* live camera idle cover */
.live-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink); background: linear-gradient(160deg, var(--surface-2), var(--surface-3)); }
.live-cover-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--pri-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; }

@media (max-width: 1100px) { .watch-grid { grid-template-columns: 1fr; } }

/* ================================================================
   Intent-first flow — launcher, mode bar, Run loop, study board,
   monitor hub. (Added in the flow overhaul.)
   ================================================================ */

/* mode bar in the app bar (replaces the linear journey stepper) */
.modebar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mb-home { appearance: none; border: 1px solid transparent; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-md); max-width: 230px; color: var(--ink); }
.mb-home:hover { background: var(--surface-3); }
.mb-home.on { background: var(--pri-cont); color: var(--on-pri-cont); }
.mb-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-sep { width: 1px; height: 24px; background: var(--line); flex: none; }
.mode-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; }
.mode-tab { position: relative; appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: var(--r-md); font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.mode-tab:hover { color: var(--ink); background: var(--surface-3); }
.mode-tab.on { color: var(--pri); background: var(--pri-cont); }
.mt-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* launcher / home */
.launch-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.lh-ctx { min-width: 300px; max-width: 360px; }
.lh-exp { font-size: 15px; font-weight: 700; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 14px; }
.mode-card { text-align: left; appearance: none; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 210px; transition: box-shadow .14s, transform .14s, border-color .14s; }
.mode-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-2); }
.mode-card.primary { background: linear-gradient(160deg, color-mix(in srgb, var(--pri) 10%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--pri) 30%, var(--line)); }
.mc-ic { width: 50px; height: 50px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; }
.mode-card.primary .mc-ic { background: var(--pri); color: var(--on-pri); }
.mc-body { flex: 1; }
.mc-label { font-size: 18px; font-weight: 700; }
.mc-blurb { font-size: 13px; color: var(--ink); margin-top: 1px; }
.mc-tag { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.mc-foot .msym { color: var(--pri); }
.recent-row { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line); width: 100%; }
.recent-row:first-child { border-top: 0; }
.recent-row:hover { background: var(--surface-2); }
.rr-ic { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.advisor-card { background: var(--pri-cont); border-color: transparent; }
.advisor-ic { color: var(--pri); }
.launch-grid.modes { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Run — fast loop */
.divider-h { height: 1px; background: var(--line); margin: 16px 0; }
.run-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.run-go { display: flex; flex-direction: column; }
.preflight { display: flex; flex-direction: column; }
.pf-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.pf-row .msym { flex: none; }
.pf-row.ok .msym { color: var(--ok); }
.pf-row.warn .msym { color: var(--warn); }
.pf-row.block .msym { color: var(--err); }
.run-next { text-align: center; padding-top: 4px; }
.rn-subject { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.go-btn { margin: 16px auto 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 156px; height: 156px; border-radius: 50%; border: 0; background: var(--pri); color: var(--on-pri); font-size: 30px; font-weight: 800; letter-spacing: .06em; cursor: pointer; box-shadow: var(--shadow-2); transition: transform .08s, background .12s; }
.go-btn:hover { background: var(--pri-hover); }
.go-btn:active { transform: scale(.97); }
.go-btn[disabled] { opacity: .45; pointer-events: none; }
.go-btn.busy { font-size: 15px; gap: 10px; }
.go-btn .msym { font-size: 42px; }
.run-summary { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; }
.run-summary .msym { color: var(--ok); }
.run-trial { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.run-trial:first-child { border-top: 0; }

/* Continue — study board */
.board-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; font-size: 12.5px; }
.bl-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.bl-item.done { color: var(--ok); } .bl-item.next { color: var(--pri); } .bl-item.flagged { color: var(--warn); } .bl-item.pending { color: var(--muted); }
.board-tbl { width: 100%; border-collapse: collapse; }
.board-tbl th { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 8px; border-bottom: 1px solid var(--line); }
.board-tbl th:first-child { text-align: left; }
.board-tbl td { padding: 8px; text-align: center; border-bottom: 1px solid var(--line); }
.board-tbl td:first-child { text-align: left; }
.board-cell { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: default; display: inline-flex; align-items: center; justify-content: center; }
.board-cell.done { background: var(--ok-cont); color: var(--ok); border-color: transparent; }
.board-cell.next { background: var(--pri); color: var(--on-pri); border-color: transparent; cursor: pointer; }
.board-cell.next:hover { filter: brightness(1.08); }
.board-cell.flagged { background: var(--warn-cont); color: var(--warn); border-color: transparent; }
.board-cell.pending { opacity: .55; }

/* Monitor hub */
.monitor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.monitor-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; cursor: pointer; text-decoration: none; color: inherit; transition: box-shadow .14s, transform .14s; }
.monitor-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.monitor-card.feature { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--pri) 25%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--pri) 7%, var(--surface)), var(--surface)); }
.mon-ic { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--pri); color: var(--on-pri); display: flex; align-items: center; justify-content: center; flex: none; }
.mon-ic.alt { width: 46px; height: 46px; background: var(--sec-cont); color: var(--on-pri-cont); }
.mon-stat { font-size: 13px; color: var(--muted); } .mon-stat b { color: var(--ink); font-size: 15px; }
.mon-stat.warn-txt { color: var(--warn); display: inline-flex; align-items: center; gap: 4px; } .mon-stat.warn-txt b { color: var(--warn); }

@media (max-width: 900px) {
  .run-grid { grid-template-columns: 1fr; }
  .monitor-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   EXPERIMENT-AS-OBJECT chrome — workspace step rail, dashboard,
   workspace overview, Collect switch, and the Configure / Analyze
   step screens. (Added in the experiment-spine rebuild.)
   ================================================================ */

/* ---- workspace step rail ---- */
.workarea.has-rail { flex-direction: row; }
.rail { flex: none; width: 248px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 12px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.rail-exit { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--muted); font: inherit; font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-radius: var(--r-sm); align-self: flex-start; }
.rail-exit:hover { background: var(--surface-3); color: var(--ink); }
.rail-exp { padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rail-exp-name { font-weight: 700; font-size: 14px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rail-overview { appearance: none; border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px; }
.rail-overview:hover { background: var(--surface-3); }
.rail-overview.on { background: var(--pri-cont); color: var(--on-pri-cont); }
.rail-phase { border-radius: var(--r-md); padding: 2px; }
.rail-phase.active { background: color-mix(in srgb, var(--pri) 5%, transparent); }
.rail-phase.collapsed .rail-phase-head { padding: 9px 10px; }
.rail-phase.collapsed:hover { background: var(--surface-3); }
.rail-phase-head { appearance: none; border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 9px 10px 5px; color: var(--ink); }
.rail-phase-head:hover .rp-label { color: var(--pri); }
.rail-prog { flex: none; min-width: 30px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; }
.rail-prog.full { background: var(--ok-cont); color: var(--ok); }
.rail-phase.active .rail-prog { display: none; }
.rp-ic { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.rail-phase.active .rp-ic { background: var(--pri); color: var(--on-pri); }
.rp-label { display: block; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.rp-blurb { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.rail-steps { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px 8px; margin-left: 12px; border-left: 1px solid var(--line); }
.rail-step { appearance: none; border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink); font: inherit; font-size: 13px; position: relative; }
.rail-step:hover { background: var(--surface-3); }
.rail-step.on { background: var(--pri); color: var(--on-pri); font-weight: 600; }
.rail-step.pending { opacity: .5; }
.rail-step.pending:hover { opacity: .8; }
.rs-mark { width: 20px; height: 20px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); }
.rail-step.on .rs-mark { background: color-mix(in srgb, #fff 24%, transparent); color: #fff; }
.rail-step.done .rs-mark { background: var(--ok-cont); color: var(--ok); }
.rail-step.on.done .rs-mark { background: color-mix(in srgb, #fff 24%, transparent); color: #fff; }

/* ---- breadcrumbs (app bar, workspace) ---- */
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.crumb { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--muted); padding: 4px 6px; border-radius: 6px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--surface-3); color: var(--ink); }
.crumb.cur { color: var(--ink); font-weight: 600; }
.crumb.phase { color: var(--pri); font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ---- home / dashboard ---- */
.dash { max-width: 1240px; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-kpis { display: flex; gap: 10px; flex: none; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 12px 18px; min-width: 92px; text-align: center; }
.kpi-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--pri); }
.kpi-sub { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi-l { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.door { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 16px 18px; transition: box-shadow .14s, transform .14s, border-color .14s; }
.door:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-2); }
.door.primary { background: linear-gradient(150deg, color-mix(in srgb, var(--pri) 12%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--pri) 30%, var(--line)); }
.door-ic { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.door.primary .door-ic { background: var(--pri); color: var(--on-pri); }
.door-t { display: block; font-weight: 700; font-size: 15px; }
.door-s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.door-arr { color: var(--pri); flex: none; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.exp-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.exp-row:first-child { border-top: 0; }
.exp-main { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 4px; border-radius: var(--r-sm); }
.exp-main:hover { background: var(--surface-2); }
.exp-ic { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.exp-name { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-meta { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-side { display: flex; align-items: center; gap: 10px; flex: none; }
.exp-prog { display: flex; align-items: center; gap: 8px; }
.ep-bar { width: 60px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ep-bar i { display: block; height: 100%; background: var(--pri); border-radius: 999px; }
.exp-quick { display: flex; gap: 0; }
@media (max-width: 640px) { .exp-quick { display: none; } }

.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.collect-row { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 4px; border-top: 1px solid var(--line); }
.collect-row:first-child { border-top: 0; }
.collect-row:hover { background: var(--surface-2); }
.room-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.room-row:first-child { border-top: 0; }
.room-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.room-row.occupied .room-dot { background: var(--err); }
.room-row.reserved .room-dot { background: var(--warn); }
.room-row.free .room-dot { background: var(--ok); }
.room-state { text-align: right; flex: none; }
.ok-txt { color: var(--ok); }
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feat { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.feat.on { color: var(--ink); } .feat.on .msym { color: var(--ok); }
.feat.off { color: var(--muted); } .feat.off .msym { color: var(--muted); }

@media (max-width: 1020px) { .dash-grid { grid-template-columns: 1fr; } .doors { grid-template-columns: 1fr; } }

/* ---- workspace overview ---- */
.phase-jumps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.phase-jump { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 16px; transition: box-shadow .14s, transform .14s, border-color .14s; }
.phase-jump:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-2); }
.pj-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.phase-jump.configure .pj-ic { background: var(--pri); color: var(--on-pri); }
.phase-jump.analyze .pj-ic { background: var(--info-cont); color: var(--info); }
.pj-l { font-weight: 700; font-size: 15px; }
.pj-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.phase-jump .msym:last-child { color: var(--pri); flex: none; margin-left: auto; }
@media (max-width: 860px) { .phase-jumps { grid-template-columns: 1fr; } }

.cfg-list { display: flex; flex-direction: column; }
.cfg-item { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 6px; border-top: 1px solid var(--line); }
.cfg-item:first-child { border-top: 0; }
.cfg-item:hover { background: var(--surface-2); }
.cfg-ic { color: var(--muted); flex: none; }
.cfg-item.done .cfg-ic { color: var(--ok); }
.cfg-l { display: block; font-weight: 600; font-size: 13.5px; }
.cfg-v { display: block; font-size: 12px; color: var(--muted); }
.sess-row { appearance: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 4px; border-top: 1px solid var(--line); }
.sess-row:first-child { border-top: 0; }
.sess-row:hover { background: var(--surface-2); }

/* ---- collect switch ---- */
.collect-wrap { display: flex; flex-direction: column; height: 100%; }
.collect-switch { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }

/* ---- trial-list strip (Collect environment) ---- */
.trial-strip { flex: none; display: flex; align-items: center; gap: 20px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.trial-strip.adhoc { gap: 10px; }
.ts-prog { width: 180px; flex: none; }
.ts-next { display: flex; flex-direction: column; gap: 1px; flex: none; min-width: 160px; }
.ts-next-label { font-weight: 700; font-size: 14px; }
.ts-alldone { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); }
.ts-cells { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; align-content: center; }
.ts-cell { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; cursor: default; padding: 0; }
.ts-cell.done { background: var(--ok-cont); color: var(--ok); border-color: transparent; cursor: pointer; }
.ts-cell.next { background: var(--pri); border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--pri) 30%, transparent); }
.ts-cell.pending { background: var(--surface-3); border-color: transparent; }
@media (max-width: 1100px) { .ts-cells { display: none; } }

/* ================================================================
   Configure / Analyze step screens
   ================================================================ */
.step-page { max-width: 1080px; padding-bottom: 0; }
.step-detail { margin-top: 14px; }
.step-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px -28px 0; padding: 14px 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.count-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: var(--pri-cont); color: var(--on-pri-cont); font-size: 13px; font-weight: 700; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* picker cards (capture / tracker / paradigm) */
.pick-grid { display: grid; gap: 12px; }
.pick-grid.two { grid-template-columns: 1fr 1fr; }
.pick-grid.three { grid-template-columns: repeat(3, 1fr); }
.pick-card { appearance: none; cursor: pointer; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .14s, box-shadow .14s, transform .12s; }
.pick-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.pick-card.on { border-color: var(--pri); background: color-mix(in srgb, var(--pri) 5%, var(--surface)); box-shadow: 0 0 0 1px var(--pri), var(--shadow-1); }
.pick-card.wide { padding: 20px; }
.pick-top { display: flex; align-items: flex-start; justify-content: space-between; }
.pick-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--sec-cont); color: var(--on-pri-cont); display: flex; align-items: center; justify-content: center; flex: none; }
.pick-card.on .pick-ic { background: var(--pri); color: var(--on-pri); }
.pick-check { color: var(--pri); }
.pick-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pick-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--info); background: var(--info-cont); padding: 2px 7px; border-radius: 5px; }
.pick-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pick-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 880px) { .pick-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .pick-grid.two, .pick-grid.three { grid-template-columns: 1fr; } }

/* number stepper */
.stepper-field { display: flex; flex-direction: column; gap: 6px; }
.sf-label { font-size: 12.5px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px; background: var(--surface); }
.stepper-val { min-width: 40px; text-align: center; font-weight: 700; font-size: 16px; }

/* capability chips */
.cap-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.cap-chip { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-3); padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.cap-chip.solid { background: var(--pri-cont); color: var(--on-pri-cont); }

/* subjects */
.subj-grouphead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.subj-grouphead .muted { margin-left: auto; }
.subj-list { display: flex; flex-direction: column; }
.subj-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.subj-row:last-child { border-bottom: 0; }
.subj-row:hover { background: var(--surface-2); }
.subj-row.on { background: color-mix(in srgb, var(--pri) 5%, transparent); }
.subj-id { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* tracker abstraction map */
.abstr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.abstr-row { display: flex; align-items: center; gap: 10px; }
.abstr-pt { width: 92px; font-size: 13px; font-weight: 600; flex: none; }
.abstr-row .select-wrap { flex: 1; }
@media (max-width: 700px) { .abstr-grid { grid-template-columns: 1fr; } }

/* independent variables */
.iv-layout { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.iv-card { }
@media (max-width: 820px) { .iv-layout { grid-template-columns: 1fr; } }

/* ---- analyze: data profile ---- */
.profile-ctl { display: flex; flex-direction: column; gap: 8px; }
.profile-ctl .scrub { width: 100%; }

/* ---- analyze: measures ---- */
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.measure-cell { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; transition: border-color .12s, background .12s; }
.measure-cell:hover { border-color: var(--line-2); }
.measure-cell.on { border-color: var(--pri); background: color-mix(in srgb, var(--pri) 6%, var(--surface)); }
.measure-cell.locked { opacity: .55; cursor: not-allowed; }
.mc-box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.measure-cell.on .mc-box { background: var(--pri); border-color: var(--pri); }
.measure-cell.locked .mc-box { border-color: var(--line-2); color: var(--muted); }
.mc-name { display: block; font-weight: 600; font-size: 13px; }
.mc-unit { display: block; font-size: 11px; color: var(--muted); }
.mc-sugg { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pri); background: var(--pri-cont); padding: 2px 6px; border-radius: 5px; flex: none; }
@media (max-width: 700px) { .measure-grid { grid-template-columns: 1fr; } }

/* ---- analyze: visualize ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { text-align: left; }
.stat-val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; color: var(--pri); }
.stat-label { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
@media (max-width: 880px) { .stat-row { grid-template-columns: 1fr 1fr; } }

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bc-row { display: flex; align-items: center; gap: 10px; }
.bc-label { width: 120px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.bc-track { flex: 1; height: 14px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.bc-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), color-mix(in srgb, var(--pri) 70%, var(--blue-blue600))); border-radius: var(--r-pill); transition: width .3s; }
.bc-val { width: 64px; text-align: right; font-size: 12.5px; font-weight: 600; flex: none; }
.vis-spark { width: 100%; height: 120px; background: var(--surface-2); border-radius: var(--r-sm); }

/* ---- DeepLabCut engine (Tracker step + Collect surface) ---- */
.dlc-engine { border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--line)); }
.dlc-engine code { font-family: "Roboto Mono", ui-monospace, monospace; font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.dlc-status { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.dlc-stat { display: flex; flex-direction: column; gap: 3px; }
.dlc-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.dlc-connect { display: flex; align-items: center; gap: 16px; }

/* live mobility bar (tracking data panel) */
.td-mobility { margin-top: 12px; }
.mob-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mob-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pri), var(--lime)); transition: width .25s; }

/* DLC engine setup helper (the "how do I start it" block) */
.engine-help { }
.os-tabs { display: inline-flex; gap: 4px; margin-bottom: 8px; }
.cmd-box { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--surface); border-radius: var(--r-sm); padding: 8px 8px 8px 12px; }
.cmd-box code { font-family: "Roboto Mono", ui-monospace, monospace; font-size: 12px; white-space: nowrap; overflow-x: auto; }
.cmd-box .iconbtn { color: var(--surface); flex: none; }
.cmd-box .iconbtn:hover { background: color-mix(in srgb, #fff 18%, transparent); }
