/* CellPilot page styles. System fonts, colour tokens on :root, light and dark. */

:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --text: #1b1b1a;
  --muted: #5d5d58;
  --border: #e1e0da;
  --primary: #1d4ed8;  --primary-tint: #e7eefd;  --on-primary: #ffffff;
  /* verdicts: automate green, needs fixture amber, keep human pink */
  --auto: #047857;     --auto-tint: #e3f5ee;
  --fix: #b45309;      --fix-tint: #fdf3e2;
  --hum: #be185d;      --hum-tint: #fce8f1;
  --problem: #c2410c;  --problem-tint: #fdeee6;
  --video: #23272f;    --video-text: #c9ced6;
  --radius: 14px;
  --lane-h: 34px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111112;
    --surface: #1b1b1d;
    --surface-2: #232326;
    --text: #ececea;
    --muted: #a3a39d;
    --border: #303034;
    --primary: #84a9ff;  --primary-tint: #17213a;  --on-primary: #0b1020;
    --auto: #4ade9f;     --auto-tint: #102a20;
    --fix: #f5b754;      --fix-tint: #2c2312;
    --hum: #f472b6;      --hum-tint: #2e1424;
    --problem: #fb923c;  --problem-tint: #2e1c12;
    --video: #0b0d10;    --video-text: #a9afb8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  overflow-wrap: anywhere;
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15.5px; margin: 0; }
p { margin: 0 0 8px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 56px; }
main:focus { outline: none; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 750; font-size: 19px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.tagline { color: var(--muted); font-size: 14px; }

.page-title { font-size: clamp(24px, 4vw, 32px); margin: 6px 0 6px; letter-spacing: -0.01em; }
.lead { max-width: 720px; font-size: 16.5px; }
.back { font-size: 14px; text-decoration: none; }
.back:hover { text-decoration: underline; }

/* cards, badges, buttons */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted);
  white-space: nowrap; vertical-align: 1px;
}
.badge.warn { background: var(--problem-tint); color: var(--problem); }
.badge.ok { background: var(--auto-tint); color: var(--auto); }
.badge.bad { background: var(--hum-tint); color: var(--hum); }
.badge.pre-badge { background: var(--fix-tint); color: var(--fix); }

.vb { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: .03em; white-space: nowrap; }
.vb.v-automate, .seg.v-automate { --c: var(--auto); --t: var(--auto-tint); }
.vb.v-needs_fixture, .seg.v-needs_fixture { --c: var(--fix); --t: var(--fix-tint); }
.vb.v-keep_human, .seg.v-keep_human { --c: var(--hum); --t: var(--hum-tint); }
.vb { color: var(--c, var(--muted)); background: var(--t, var(--surface-2)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 36px; padding: 6px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 650; }
.btn.ok { color: var(--auto); border-color: var(--auto); }
.btn.flag { color: var(--hum); border-color: var(--hum); }
.btn.ok[aria-pressed="true"] { background: var(--auto); color: var(--surface); }
.btn.flag[aria-pressed="true"] { background: var(--hum); color: var(--surface); }
.btn[aria-pressed="true"]:not(.ok):not(.flag) { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); font-weight: 650; }

.error { border: 1px solid var(--problem); background: var(--problem-tint); color: var(--problem); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.error p { margin: 0 0 6px; }
.error p:last-child { margin: 0; }
p.error { margin: 8px 0 0; }
.ok-msg { color: var(--auto); font-weight: 600; margin: 8px 0 0; }

/* S1 sessions */
.sessions { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.session { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.session-text { min-width: 0; flex: 1 1 260px; }
.session-name { font-size: 17px; margin: 0 0 4px; }
.session-name a { color: var(--text); text-decoration: none; }
.session-name a:hover { color: var(--primary); }
.session-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 14px; }

/* S2 analysis */
.session-head { margin-bottom: 14px; }
.banner { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.banner-text { flex: 1 1 420px; min-width: 0; }
.banner-main { font-size: clamp(19px, 2.8vw, 25px); font-weight: 750; letter-spacing: -0.01em; margin: 0 0 4px; }
.banner-main .n { font-variant-numeric: tabular-nums; }
.banner-main .n.v-automate { color: var(--auto); }
.banner-main .n.v-keep_human { color: var(--hum); }
.banner-main .n.v-needs_fixture { color: var(--fix); }
.banner-main.counting { opacity: .9; }
.banner-sub { font-weight: 650; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.summary { color: var(--muted); font-size: 14.5px; margin: 0; max-width: 820px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-box { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 0 1 380px; }
.run-note { margin: 0; max-width: 46ch; }

.vids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vid { margin: 0; min-width: 0; border-radius: 10px; overflow: hidden; background: var(--video); position: relative; }
.vid video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--video); cursor: pointer; }
.vid figcaption { padding: 4px 8px; font-size: 12px; color: var(--video-text); }
.vid.flash { animation: flash 1.2s ease-out; }
@keyframes flash {
  0%, 40% { box-shadow: 0 0 0 3px var(--primary); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 8px; font-size: 14px; }
.transport .play { min-width: 44px; font-size: 15px; }
.time, .cycle { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; }
.cycle { color: var(--muted); }
.nav, .speed { display: inline-flex; gap: 4px; }
.debug-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.drift { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }

.timeline { margin-bottom: 8px; }
.track {
  position: relative; height: calc(var(--lanes, 1) * var(--lane-h));
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.seg {
  position: absolute; height: calc(var(--lane-h) - 4px); margin-top: 2px;
  padding: 0 4px; border-radius: 5px; border: 1.5px solid var(--c, var(--muted));
  background: var(--t, var(--surface)); color: var(--c, var(--text));
  font-size: 11.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer; min-width: 3px;
}
.seg span { display: block; overflow: hidden; text-overflow: ellipsis; }
.seg.pre { border-style: dashed; }
.seg.active { outline: 2px solid var(--primary); outline-offset: 1px; z-index: 1; }
.seg.pending { opacity: 0; }
.seg.drop { animation: drop .35s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes drop {
  from { opacity: 0; transform: translateY(-22px); }
  to { opacity: 1; transform: none; }
}
.playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; z-index: 2; }
.scrub { display: block; width: 100%; margin: 6px 0 0; accent-color: var(--primary); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.legend-dash { border: 1.5px dashed var(--muted); border-radius: 5px; padding: 0 6px; }

.run-status { margin: 4px 0 14px; }
.run-status:empty { display: none; }
.stages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.stage { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.stage.done { color: var(--auto); }
.stage.run { color: var(--primary); font-weight: 650; background: var(--primary-tint); }
.stage.failed { color: var(--problem); background: var(--problem-tint); font-weight: 650; }
.stages .arrow { color: var(--muted); }
.elapsed { font-family: var(--mono); font-variant-numeric: tabular-nums; margin-left: 6px; }
.run-status .small { margin: 6px 0 0; }

.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 6px; }
.side { display: grid; gap: 14px; min-width: 0; }

/* S3 steps */
.engineer-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 14px; }
.engineer-field input { flex: 1 1 180px; max-width: 280px; }
input[type="text"], input[type="number"] {
  min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); min-height: 36px;
}
input[aria-invalid="true"] { border-color: var(--problem); background: var(--problem-tint); }
.steps { list-style: none; margin: 0; padding: 0; }
.steprow { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; transition: box-shadow .2s; }
.steprow.pre { border-style: dashed; border-color: var(--fix); }
.steprow.current { box-shadow: 0 0 0 2px var(--primary); }
.steprow .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.linkish { background: none; border: 0; padding: 0; font-weight: 700; text-align: left; cursor: pointer; color: var(--text); }
.linkish:hover { color: var(--primary); text-decoration: underline; }
.steprow .meta { color: var(--muted); font-size: 13px; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.reasons li { margin: 3px 0; }
.cite {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 0 6px; font-size: 12.5px; font-family: var(--mono); cursor: pointer; color: var(--primary);
}
.cite:hover { border-color: var(--primary); }
.vnote { font-size: 13.5px; margin: 6px 0 0; }
.signoff { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.so-status { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.steprow.approved .so-status { color: var(--auto); }
.steprow.flagged .so-status { color: var(--hum); }
.so-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.so-note { flex: 1 1 160px; }
.so-error { color: var(--problem); font-size: 13px; margin: 4px 0 0; }
.so-error:empty { display: none; }

/* S4 robot */
.robot-model { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.good { color: var(--auto); font-weight: 700; }
.bad { color: var(--hum); font-weight: 700; }
.why { font-size: 14px; margin: 0; }

/* S5 payback */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.field input { width: 100%; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.pay-out dd { text-align: right; }
.pay-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.payback-result {
  flex: 1 1 200px; margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--auto-tint); color: var(--auto); font-weight: 700; font-size: 17px;
}
.payback-result.none { background: var(--surface-2); color: var(--muted); font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.foot .src { font-weight: 700; }
.foot .src.live { color: var(--primary); }

@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

/* Phone width: videos stack, timeline labels hide. */
@media (max-width: 719.98px) {
  main.wrap { padding-top: 12px; }
  .vids { grid-template-columns: minmax(0, 1fr); }
  .seg { font-size: 0; padding: 0; }
  .banner { padding: 12px; }
  .card { padding: 12px; }
  .engineer-field input { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .seg.drop, .vid.flash, .ev-box { animation: none; }
  .steprow { transition: none; }
}

/* ------------------------------------------------------------ additions */

/* estimate badges, sessions intro, top-bar links */
.badge.est { background: var(--primary-tint); color: var(--primary); font-weight: 650; letter-spacing: 0; vertical-align: 2px; }
.flow { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.flow li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.flow li b { color: var(--text); display: block; margin-bottom: 2px; }
.byo { margin-top: 18px; max-width: 820px; }
.byo h2 { margin-bottom: 6px; }
.nav-links { margin-left: auto; font-size: 14px; display: flex; gap: 14px; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }

/* evidence boxes over the videos */
.vid-box { position: relative; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ev-box {
  position: absolute; border: 2px solid var(--primary); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .35);
  animation: evpop .25s ease-out;
}
.ev-box.v-automate { border-color: var(--auto); }
.ev-box.v-needs_fixture { border-color: var(--fix); }
.ev-box.v-keep_human { border-color: var(--hum); }
.ev-label {
  position: absolute; left: -2px; bottom: 100%; margin-bottom: 2px; max-width: 220px;
  padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1.3;
  background: rgba(20, 22, 26, .85); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes evpop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.cite.boxed .box-mark { font-size: 11px; opacity: .8; }

/* how to read */
.howto { font-size: 13.5px; margin: 0 0 8px; }
.howto summary { cursor: pointer; color: var(--muted); }
.howto-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; margin: 8px 0 0; align-items: start; }
.howto-list dt { padding-top: 1px; }
.howto-list dd { margin: 0; color: var(--muted); }

/* layout sketch */
.layout-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.layout-svg { display: block; width: 100%; height: auto; max-height: 420px; font-family: var(--font); }
.layout-svg .bench { fill: var(--surface); stroke: var(--text); stroke-width: 10; }
.layout-svg .lbl { fill: var(--text); font-weight: 600; }
.layout-svg .bench-lbl { fill: var(--muted); font-weight: 500; }
.layout-svg .obj rect { fill: var(--primary-tint); stroke: var(--primary); stroke-width: 6; }
.layout-svg .obj.k-tool rect { fill: var(--surface-2); stroke: var(--muted); }
.layout-svg .obj.k-fixture rect { fill: var(--fix-tint); stroke: var(--fix); }
.layout-svg .operator circle { fill: var(--hum-tint); stroke: var(--hum); stroke-width: 8; }
.layout-svg .operator .lbl { fill: var(--hum); }
.layout-svg .base rect { fill: var(--text); }
.layout-svg .reach { fill: color-mix(in srgb, var(--auto) 10%, transparent); stroke: var(--auto); stroke-width: 6; stroke-dasharray: 24 16; }
.layout-svg .needed { fill: none; stroke: var(--text); stroke-width: 5; stroke-dasharray: 8 14; opacity: .7; }
.layout-svg .anchor circle { stroke-width: 8; fill: var(--surface); }
.layout-svg .anchor.v-automate circle { stroke: var(--auto); }
.layout-svg .anchor.v-needs_fixture circle { stroke: var(--fix); }
.layout-svg .anchor.v-keep_human circle { stroke: var(--hum); }
.layout-svg .anchor.place.v-automate circle { fill: var(--auto); }
.layout-svg .anchor.place.v-needs_fixture circle { fill: var(--fix); }
.layout-svg .anchor.place.v-keep_human circle { fill: var(--hum); }
.layout-svg .arrow { stroke-width: 10; stroke-linecap: round; opacity: .85; }
.layout-svg .arrow.v-automate { stroke: var(--auto); }
.layout-svg .arrow.v-needs_fixture { stroke: var(--fix); }
.layout-svg .arrow.v-keep_human { stroke: var(--hum); }
.layout-svg .arrowhead { fill: var(--text); opacity: .7; }
.layout-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; font-size: 12.5px; color: var(--muted); }
.layout-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; border: 2px solid var(--muted); }
.layout-legend i.reach { border: 2px dashed var(--auto); background: color-mix(in srgb, var(--auto) 12%, transparent); }
.layout-legend i.needed { border: 2px dotted var(--text); }
.layout-legend i.pick { border-color: var(--auto); background: var(--surface); }
.layout-legend i.place { border-color: var(--auto); background: var(--auto); }

/* robot table, cycle card */
.sub { font-size: 14px; margin: 12px 0 6px; }
.table-wrap { overflow-x: auto; }
.alts { width: 100%; border-collapse: collapse; font-size: 13px; }
.alts th, .alts td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.alts th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.alts td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.alts .vendor { font-size: 11.5px; line-height: 1.2; }
.alts tr.chosen td { background: var(--auto-tint); }
.alts tr.nofit td { color: var(--muted); }
.alts td.note { font-size: 12px; }
.why-d { font-size: 13.5px; margin-top: 8px; }
.why-d summary { cursor: pointer; color: var(--muted); }
.cycle-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); margin: 6px 0; }
.seg-bar { display: block; height: 100%; min-width: 1px; }
.seg-bar.v-automate { background: var(--auto); }
.seg-bar.v-needs_fixture { background: var(--fix); }
.seg-bar.v-keep_human { background: var(--hum); }
.seg-bar.unassigned { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--border) 4px, var(--border) 8px); }
.seg-bar + .seg-bar { border-left: 1px solid var(--surface); }
.cycle-list { list-style: none; margin: 0 0 4px; padding: 0; font-size: 13px; }
.cycle-list li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.cycle-list .cl-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cycle-list .cl-num { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dot.v-automate { background: var(--auto); }
.dot.v-needs_fixture { background: var(--fix); }
.dot.v-keep_human { background: var(--hum); }
.dot.unassigned { background: var(--border); }
.factor-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0; }
.factor-row input { width: 80px; color: var(--text); }
.est-out dd b { font-size: 15px; }

/* guide */
.guide { display: grid; gap: 14px; max-width: 900px; margin-top: 14px; }
.guide ul { margin: 6px 0; padding-left: 20px; }
.guide li { margin: 4px 0; }
.guide-pic { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px; margin: 6px 0 10px; }
.guide-svg { display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto; font-family: var(--font); }
.guide-svg .bench { fill: var(--surface); stroke: var(--text); stroke-width: 2.5; }
.guide-svg .binr { fill: var(--primary-tint); stroke: var(--primary); stroke-width: 1.5; }
.guide-svg .lbl { fill: var(--text); font-size: 14px; font-weight: 600; }
.guide-svg .lbl.small { font-size: 11.5px; font-weight: 500; fill: var(--muted); }
.guide-svg .operator circle { fill: var(--hum-tint); stroke: var(--hum); stroke-width: 2.5; }
.guide-svg .g-cam rect { fill: var(--text); }
.guide-svg .cone { fill: color-mix(in srgb, var(--primary) 12%, transparent); stroke: var(--primary); stroke-width: 1.2; stroke-dasharray: 5 4; }
.guide-svg .dim { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.45 var(--mono); overflow-x: auto; margin: 8px 0; white-space: pre; }

/* report (printable study) */
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; max-width: 960px; margin: 0 auto; }
.report h1 { font-size: 26px; margin: 2px 0 6px; }
.report h2 { font-size: 17px; margin: 22px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.report .kicker { color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.report-banner h2 { border: 0; font-size: 21px; margin-top: 16px; padding: 0; }
.report-steps { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.report-steps th, .report-steps td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); }
.report-steps th { color: var(--muted); font-weight: 600; font-size: 12px; }
.report-steps tr.pre td:first-child { border-left: 3px dashed var(--fix); padding-left: 8px; }
.report-steps .reasons { margin: 4px 0 0; }
.report-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.report-two .layout-svg { max-height: 300px; }
.report-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
body.printing .topbar .tagline { display: none; }

@media print {
  .topbar, .no-print, .report-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  main.wrap { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .report-steps tr, .report-two > div { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* capture studio */
.note { border-color: var(--primary); background: var(--primary-tint); }
.note h2 { color: var(--primary); }
.cap-status { margin: 0 0 12px; }
.cap-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 10px; font-size: 14px; }
.cap-tools select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; min-height: 36px; }
.cap-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.cap-grid > .card { min-width: 0; max-width: 100%; }
/* min(240px, 100%) and min-width: 0 keep a 1920-wide preview image from widening the page on a phone */
.cam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.cam-card { padding: 10px; min-width: 0; }
.cam-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cam-box { position: relative; aspect-ratio: 16 / 9; background: var(--video); border-radius: 8px; overflow: hidden; min-width: 0; }
.cam-preview { display: block; width: 100%; max-width: 100%; height: 100%; object-fit: contain; }
.cam-preview:not([src]) { visibility: hidden; }
.cam-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--video-text); font-size: 13px; pointer-events: none; }
.cam-over:empty { display: none; }
.cam-meta { margin: 6px 0 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checklist input { margin-top: 4px; flex: none; }
.take-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 10px; min-width: 0; }
.take-form .field { flex: 1 1 140px; max-width: 260px; min-width: 0; }
.take-form .field.narrow { flex: 0 1 110px; }
.take-form .field input { width: 100%; min-width: 0; }
.take-form .btn { max-width: 100%; }
.take-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 8px 0; }
.take-bar span { display: block; height: 100%; background: var(--primary); width: 0; transition: width .25s linear; }
.take-lines { list-style: none; margin: 6px 0; padding: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.take-lines li::before { content: '○ '; color: var(--muted); }
.take-lines li.done::before { content: '✓ '; color: var(--auto); }
.take-lines li.run::before { content: '● '; color: var(--primary); }
.take-lines li.failed::before { content: '✗ '; color: var(--hum); }
.off-row { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 13.5px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.off-view b { font-family: var(--mono); font-weight: 700; }
.off-bar { position: relative; height: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.off-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); }
.off-frame { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .6; }
.off-num { white-space: nowrap; color: var(--muted); }
.job-log { font: 12px/1.4 var(--mono); color: var(--muted); white-space: pre-wrap; margin: 6px 0; max-height: 160px; overflow: auto; }
.cap-msg:empty { display: none; }
@media (max-width: 719.98px) {
  .off-row { grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 10px 0; }
  .off-num { white-space: normal; }
  .take-form .field, .take-form .field.narrow { max-width: none; flex: 1 1 120px; }
}

/* ------------------------------------------------------------ front door */
.hero { padding: 26px 0 8px; max-width: 860px; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); margin: 0 0 6px; }
.hero-title { font-size: clamp(30px, 5.2vw, 46px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
.hero-lead { font-size: clamp(16.5px, 2vw, 19px); line-height: 1.5; margin: 0 0 18px; max-width: 760px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn.big { min-height: 46px; padding: 10px 20px; font-size: 16px; border-radius: 11px; }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.hero-note { margin: 10px 0 0; max-width: 640px; }
.try { margin: 4px 0 24px; max-width: 860px; border-left: 4px solid var(--primary); }
.try h2 { margin-bottom: 6px; }
.try-list { margin: 0; padding-left: 20px; font-size: 14.5px; display: grid; gap: 6px; }
.list-title { font-size: 22px; margin: 8px 0 2px; }
.list-note { margin: 0 0 10px; }
.list-note + div .sessions { margin-top: 0; }
.sitefoot { border-top: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.sitefoot .wrap { padding-top: 14px; padding-bottom: 18px; }
.sitefoot p { margin: 0; }
.sitefoot a { color: inherit; }

/* headline tiles under the banner */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: -4px 0 14px; }
.tile {
  display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; min-width: 0;
}
.tile:hover { border-color: var(--primary); }
.tile-value { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.tile-value.v-automate { color: var(--auto); }
.tile-value.v-keep_human { color: var(--hum); }
.tile-label { font-size: 13px; }
.tile-detail { font-size: 12px; color: var(--muted); }
.tile-detail:empty { display: none; }
.hint { margin: 6px 0 0; }
.card:focus { outline: none; }

/* the method notes fold away; the payback shows its answer first */
.fine-d { margin-top: 10px; font-size: 12.5px; }
.fine-d summary, .assumptions summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.fine-d .fine { margin-top: 6px; }
.assumptions { margin-top: 8px; }
.assumptions .pay-foot { margin-top: 4px; }
.payback-card .payback-result { margin: 0 0 8px; }

/* two columns: steps and payback left; layout, robot and cycle right. One column, in story order, when narrow. */
.main-col { display: grid; gap: 14px; min-width: 0; }
@media (max-width: 900px) {
  .cols > .main-col, .cols > .side { display: contents; }
  .steps-panel { order: 1; }
  .layout-card { order: 2; }
  .robot { order: 3; }
  .cycle-card { order: 4; }
  .payback-card { order: 5; }
}
@media print { .sitefoot { display: none !important; } }

/* ------------------------------------------------------------ jobs to record */
.rules { margin: 4px 0 10px; padding-left: 20px; color: var(--muted); }
.scen-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); margin-top: 8px; }
.scen { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); min-width: 0; font-size: 13.5px; }
.scen h3 { font-size: 15.5px; margin: 0 0 2px; }
.scen .where { color: var(--muted); margin: 0 0 4px; font-size: 13px; }
.scen h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 2px; }
.scen ol, .scen ul { margin: 0; padding-left: 18px; }
.scen li { margin: 2px 0; }
.scen p { margin: 0; }
.scen .expect { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.badge.scen { background: var(--primary-tint); color: var(--primary); letter-spacing: 0; }
.brief { font-size: 14px; margin: 6px 0 0; max-width: 820px; }
.report .brief { color: var(--text); }
.take-form .field.wide, .field.wide { flex: 1 1 100%; max-width: none; }
.field textarea { color: var(--text); font-size: 14px; }
textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; width: 100%; min-width: 0; resize: vertical; }
select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; min-height: 36px; }

/* step filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.filters .btn { min-height: 30px; padding: 2px 10px; font-size: 13px; }
.filters .n { color: var(--muted); font-weight: 500; margin-left: 5px; font-variant-numeric: tabular-nums; }
.filters .btn[aria-pressed="true"] .n { color: inherit; }
.filter-empty { color: var(--muted); font-size: 13.5px; margin: 6px 0; }

/* the proposed cell: two lanes over one cycle */
.lanes { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 13px; margin: 4px 0 2px; }
.lane-name { color: var(--muted); }
.lane-total { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.lane { display: flex; height: 24px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.lane .seg-bar { position: relative; }
.lane .seg-bar > span { position: absolute; inset: 0; padding: 0 5px; font-size: 11px; font-weight: 650; line-height: 22px; color: var(--surface); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lane .seg-bar.unassigned > span { color: var(--text); }
.lane .seg-bar.idle { background: transparent; }
.lanes-note { margin: 6px 0 0; }

/* the engineer's notes */
.notes-card .owner { font-size: 15px; margin: 0 0 4px; }
.notes-list { margin: 0; padding-left: 20px; font-size: 14px; }
.notes-list li { margin: 3px 0; }
.rec { font-size: 13.5px; margin: 6px 0 0; }
.rec b { color: var(--primary); }
@media (max-width: 900px) { .notes-card { order: 6; } }

/* capture studio: source card, ways to try */
.source-card .mode { font-weight: 700; margin: 0 0 4px; }
.source-card .mode.live { color: var(--problem); }
.source-card .mode.emulator { color: var(--primary); }
.source-card .mode.console { color: var(--primary); }
.src-list { margin: 4px 0 8px; padding-left: 18px; font-size: 13.5px; }
.src-list li { margin: 2px 0; overflow-wrap: anywhere; }
.ways { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* the cobot twin card */
.twin-clip { width: 100%; border-radius: 10px; background: #000; display: block; margin: 6px 0 10px; }
.twin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.twin-table th, .twin-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.twin-table th { white-space: nowrap; }
.twin-table td.num { white-space: nowrap; }
.twin-table th { color: var(--muted); font-weight: 600; }
.twin-table tr.total td { font-weight: 650; border-bottom: 0; }
