/* Kentucky AI · Model studio — design system v3.
   Light, calm, typographic. Teal = the one action. Cyan = the AI (predictions, live state).
   Graphite panels appear only where the model's output is shown (the bridge to kentucky-ai.com).
   Blueprint motifs (grid, crop marks, title strip) live only around drawings. */
:root {
  --font: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --bg: #f4f5f5; --surface: #ffffff; --sunken: #eef0f1; --hover: #eceff0; --select: #e3f4f5;
  --ink: #0c1113; --ink-2: #3a4449; --ink-3: #565f66; --ink-4: #5a646a; --line: #e3e6e8; --line-2: #d3d8db;
  --teal: #0e8f99; --teal-2: #0b7680; --on-teal: #03262a; --link: #0b7a83;
  --teal-ink: #0a6e77; --on-teal-ink: #ffffff; /* teal as TEXT (or a fill behind white text): 5.5:1+ on white, the page and the tints; --teal itself stays for lines, fills and focus rings */
  --cyan: #62d4dc; --cy-m: rgba(98, 212, 220, .16); --graphite: #0a0c0e; --graphite-2: #111518; --graphite-line: rgba(98, 212, 220, .22);
  --pos: #17784b; --warn: #8a5a00; --danger: #c2341d; --warn-bg: #fff4dc; --pos-bg: #e6f6ee; --danger-bg: #fdeceb;
  --e1: 0 1px 2px rgba(12, 20, 24, .05), 0 0 0 1px rgba(12, 20, 24, .07);
  --e2: 0 12px 32px -8px rgba(12, 20, 24, .22), 0 0 0 1px rgba(12, 20, 24, .08);
  --ring: 0 0 0 3px rgba(98, 212, 220, .35);
  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1); --t: 160ms;
  --tri: linear-gradient(90deg, #62d4dc 0 33.34%, #3b40d2 33.34% 66.67%, #4f9f6b 66.67%);
  /* the drawing canvas follows the theme: paper in light, graphite in dark */
  --paper: #fbfcfc; --paper-grid: rgba(14, 143, 153, .07); --paper-grid-2: rgba(14, 143, 153, .11);
  --plan-filter: none; --plan-blend: multiply; --plan-op: .78;
  --c-wall: #0e9aa5; --c-door: #d98a00; --c-window: #5468d4; --c-room: #2f9a5b; --c-other: #7b8589;
  --float: rgba(255, 255, 255, .94); --float-line: rgba(12, 20, 24, .12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0c0e; --surface: #101316; --sunken: #161a1e; --hover: #171b1f; --select: #12272b;
  --ink: #f2f5f6; --ink-2: #c4ccd3; --ink-3: #8a939c; --ink-4: #808991; --line: #1e2327; --line-2: #2a3037;
  --teal: #62d4dc; --teal-2: #82e0e6; --on-teal: #03262a; --link: #62d4dc; --teal-ink: #62d4dc; --on-teal-ink: #03262a;
  --pos: #4cc38a; --warn: #f0b429; --danger: #ff7b63; --warn-bg: #2a2110; --pos-bg: #102419; --danger-bg: #2c1612;
  --e1: 0 0 0 1px #1e2327; --e2: 0 0 0 .5px #000c, 0 4px 8px #0006, 0 16px 40px #000c; --ring: 0 0 0 3px rgba(98, 212, 220, .35);
  --paper: #0a0c0e; --paper-grid: rgba(98, 212, 220, .045); --paper-grid-2: rgba(98, 212, 220, .07);
  --plan-filter: invert(1); --plan-blend: screen; --plan-op: .45;
  --c-wall: #62d4dc; --c-door: #f0b24a; --c-window: #9db1ff; --c-room: #7fcf9c; --c-other: #848e8b;
  --float: rgba(20, 24, 28, .94); --float-line: rgba(255, 255, 255, .12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); } .soft { color: var(--ink-2); } .faint { color: var(--ink-3); }
.pos { color: var(--pos); } .warn { color: var(--warn); } .danger { color: var(--danger); } .cyan { color: var(--link); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* type scale */
.display { font: 600 40px/1.08 var(--font); letter-spacing: -.035em; text-wrap: balance; }
.h1 { font: 600 32px/1.15 var(--font); letter-spacing: -.02em; }
.h2 { font: 600 20px/1.3 var(--font); letter-spacing: -.01em; }
.h3 { font: 600 16px/1.35 var(--font); letter-spacing: -.005em; }
.lede { font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; margin: 8px 0 0; }
.small { font-size: 13px; } .label { font: 500 11px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.key { font: 500 11px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.big { font: 500 40px/1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kicker { font: 500 11px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--link); }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; height: 100dvh; overflow: hidden; }
.side { width: 232px; flex: 0 0 232px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--ink); text-decoration: none !important; }
.brand svg { width: 34px; height: 17px; flex: 0 0 34px; }
.brand b { font: 600 16px/1 var(--font); letter-spacing: -.01em; }
.org { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); background: var(--sunken); font: 500 13px var(--font); color: var(--ink-2); margin-bottom: 14px; white-space: nowrap; overflow: hidden; }
.org-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--teal); flex: 0 0 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); font: 500 14px/1 var(--font); text-decoration: none !important; border: 0; background: none; width: 100%; cursor: pointer; text-align: left; transition: background var(--t) var(--ease), color var(--t); }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav.on { background: var(--select); color: var(--ink); }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.nav.on svg { stroke: var(--teal); }
.nav-label { font: 500 11px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 18px 10px 6px; }
.side .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.me-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--select); color: var(--teal-ink); display: grid; place-items: center; font: 600 12px var(--font); flex: 0 0 28px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); min-width: 0; }
.top .crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumbs a { color: var(--ink-2); }
.top .spacer { flex: 1; }
.body { flex: 1; overflow-y: auto; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-direction: column; gap: 32px; animation: rise 180ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 1000px) { .side { width: 68px; flex-basis: 68px; } .side .nav span, .nav-label, .brand b, .org span:last-child, .me-mail { display: none; } }
@media (max-width: 640px) { .side { display: none; } .page { padding: 20px 16px 48px; } .top { padding: 0 16px; } }

/* page header */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pagehead .actions { display: flex; gap: 10px; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ------------------------------------------------------------------ controls */
.btn { height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background var(--t) var(--ease), border-color var(--t), transform 100ms var(--ease), box-shadow var(--t); }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .choice:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; box-shadow: var(--ring); border-color: var(--teal); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.hero .btn:focus-visible, .nexthero .btn:focus-visible, .hero-copy a:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.dpanel a:focus-visible, .dpanel button:focus-visible, .panel-dark a:focus-visible { outline-color: var(--cyan); }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--teal-ink); color: var(--on-teal-ink); font-weight: 600; font-size: 14px; transition: top var(--t); }
.skip-link:focus { top: 12px; text-decoration: none; }
#ka-body:focus, #ka-root:focus { outline: none; }
.hid-note { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); font: 500 11.5px/1.5 var(--font); white-space: nowrap; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.btn.primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.link { border: 0; background: none; color: var(--link); padding: 0; height: auto; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn kbd, .kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
kbd { font: 500 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-2); background: var(--surface); }
.arrow { transition: transform var(--t) var(--ease); } .btn:hover .arrow { transform: translateX(3px); }
input[type=text], input[type=number], input[type=email], input[type=search], select, textarea {
  height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 400 15px var(--font); width: 100%; }
textarea { height: auto; padding: 10px 12px; font: 400 13px/1.5 var(--mono); }
label.field { display: flex; flex-direction: column; gap: 8px; } label.field > span:first-child { font: 600 13px var(--font); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; font: 500 13px/1 var(--font); background: var(--sunken); color: var(--ink-2); white-space: nowrap; border: 0; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.cyan { background: var(--select); color: var(--teal-ink); } .chip.pos { background: var(--pos-bg); color: var(--pos); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.danger { color: var(--danger); }
.chip.pulse .dot { animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .25; } }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 10px; }
.tag { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 12px 14px; text-align: left; cursor: pointer; color: var(--ink-2); font: 500 14px var(--font); }
.seg button:first-child { border-left: 0; }
.seg button b { display: block; color: var(--ink); font-weight: 600; } .seg button small { color: var(--ink-3); font-size: 12.5px; }
.seg button.on { background: var(--select); box-shadow: inset 0 0 0 1.5px var(--teal); } .seg button.on b { color: var(--teal-ink); }

/* ------------------------------------------------------------------ surfaces */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--e1); padding: 24px; min-width: 0; }
.grid { display: grid; gap: 24px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .right { margin-left: auto; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-h .h2 + .faint { font-size: 13.5px; }

/* hero: next action + graphite drawing panel */
.hero { display: grid; grid-template-columns: 5fr 7fr; gap: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e1); overflow: hidden; min-height: 340px; }
.hero-copy { padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hero-copy .h1 { font-size: 30px; }
.hero-copy .actions { margin-top: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-dark { position: relative; background: radial-gradient(90% 80% at 60% 40%, #10262b 0%, var(--graphite) 70%); overflow: hidden; }
.panel-dark::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(98, 212, 220, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(98, 212, 220, .05) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.crop { position: absolute; inset: 14px; pointer-events: none; z-index: 2; }
.crop i { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--cyan); }
.crop i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; } .crop i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.crop i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; } .crop i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.titlestrip { position: absolute; right: 22px; bottom: 20px; z-index: 3; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(236, 238, 233, .7); background: rgba(15, 20, 22, .75); border: 1px solid var(--graphite-line); padding: 6px 8px; border-radius: 3px; }
.drawing { position: absolute; inset: 28px; display: grid; place-items: center; z-index: 1; }
.drawing svg { width: 100%; height: 100%; }
.drawing .sheet-img { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); opacity: .55; }
.pred { fill-opacity: .18; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 700ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scanline { position: absolute; left: 0; right: 0; height: 1px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); top: 0; z-index: 2; animation: scan 1.1s var(--ease) forwards; }
@keyframes scan { to { top: 100%; opacity: 0; } }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .panel-dark { min-height: 260px; } }

/* plan / sheet cards */
.pcard { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: var(--e1); overflow: hidden; color: inherit; text-decoration: none !important; transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease); text-align: left; font: inherit; padding: 0; border: 0; cursor: pointer; position: relative; }
.pcard:hover { box-shadow: var(--e2); transform: translateY(-2px); }
.pthumb { aspect-ratio: 16 / 10; background: #fff center / contain no-repeat; border-bottom: 1px solid var(--line); }
.pthumb.sq { aspect-ratio: 4 / 3; }
.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pbody .t { font: 600 15.5px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbody .s { color: var(--ink-3); font-size: 13px; }
.pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.corner { position: absolute; top: 10px; right: 10px; }
.pcard.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); border-radius: var(--r); align-items: center; justify-content: center; text-align: center; color: var(--ink-2); min-height: 220px; background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 16px 16px; }
.pcard.ghost:hover, .pcard.ghost.over { box-shadow: inset 0 0 0 1.5px var(--teal); background-color: var(--select); }
.pcard.ghost .t { font: 600 15px var(--font); color: var(--ink); margin-top: 8px; } .pcard.ghost .s { font-size: 13px; color: var(--ink-3); }
.pcard.ghost svg { width: 26px; height: 26px; stroke: var(--teal); fill: none; stroke-width: 1.5; }
.minibar { display: flex; gap: 3px; } .minibar i { width: 16px; height: 4px; border-radius: 2px; background: var(--line-2); } .minibar i.on { background: var(--teal); }

/* readiness bar pinned to bottom */
.readybar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px; min-height: 56px; background: var(--graphite); color: #eceee9; border-radius: var(--r-lg); box-shadow: 0 16px 40px -12px rgba(15, 20, 22, .45); }
.readybar .ring { width: 28px; height: 28px; flex: 0 0 28px; }
.readybar b { font-weight: 600; } .readybar span.m { color: #9fb0b5; }
.readybar .btn.primary { background: var(--cyan); border-color: var(--cyan); color: #061114; } .readybar .btn.primary:hover { background: #97e6eb; border-color: #97e6eb; }
.readybar .btn { background: transparent; color: #eceee9; border-color: rgba(236, 238, 233, .25); }

/* option cards (train) */
.narrow { max-width: 680px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 28px; }
.choice { display: flex; gap: 16px; align-items: center; padding: 16px 18px; min-height: 84px; border-radius: var(--r); background: var(--surface); box-shadow: var(--e1); cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; transition: box-shadow var(--t) var(--ease); width: 100%; }
.choice:hover { box-shadow: var(--e2); }
.choice.on { box-shadow: inset 0 0 0 2px var(--teal), var(--e1); background: var(--select); }
.choice b { display: block; font: 600 16px var(--font); } .choice span { color: var(--ink-2); font-size: 14px; }
.choice .ill { width: 64px; height: 48px; flex: 0 0 64px; border-radius: 6px; background: var(--graphite); display: grid; place-items: center; }
.choice .ill svg { width: 48px; height: 34px; }

/* big numbers */
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.stat { background: var(--surface); border-radius: var(--r); box-shadow: var(--e1); padding: 20px 22px; }
.stat .big { color: var(--ink); } .stat .of { font: 500 18px var(--mono); color: var(--ink-3); }
.stat .what { font: 500 14px var(--font); color: var(--ink-2); margin-top: 8px; }
.stat .meter { margin-top: 14px; }
@media (max-width: 860px) { .stats3 { grid-template-columns: 1fr; } }
.meter { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--teal); border-radius: 3px; transition: width 600ms var(--ease); }
.meter.warn > i { background: var(--warn); } .meter.danger > i { background: var(--danger); }

/* before / after compare */
.compare { position: relative; height: min(52vh, 520px); border-radius: var(--r-lg); overflow: hidden; background: var(--graphite); user-select: none; }
.compare .layer { position: absolute; inset: 0; }
.compare .layer svg { width: 100%; height: 100%; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); cursor: ew-resize; z-index: 4; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: var(--cyan); color: #061114; display: grid; place-items: center; font: 600 15px var(--font); }
.compare .lab { position: absolute; top: 18px; z-index: 3; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #eceee9; background: rgba(15, 20, 22, .75); border: 1px solid var(--graphite-line); padding: 7px 9px; border-radius: 4px; }
.compare .lab.l { left: 18px; } .compare .lab.r { right: 18px; color: var(--cyan); }
.compare select { position: absolute; z-index: 5; bottom: 18px; left: 18px; width: auto; height: 32px; background: rgba(15, 20, 22, .85); color: #eceee9; border-color: var(--graphite-line); font-size: 13px; }

/* list / table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.table th { text-align: left; padding: 10px 16px; font: 500 11px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tr:hover td { background: var(--hover); }
.table td.n { font-family: var(--mono); font-size: 13px; }
.tablewrap { border-radius: var(--r); box-shadow: var(--e1); overflow: hidden; background: var(--surface); }
.list { border-radius: var(--r); box-shadow: var(--e1); background: var(--surface); overflow: hidden; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; } .item .t { font-weight: 600; } .item .s { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.item.click { cursor: pointer; } .item.click:hover { background: var(--hover); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 13.5px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; overflow-wrap: anywhere; }
pre.code { background: var(--graphite); color: #cfe3e6; border-radius: var(--r); padding: 16px; overflow: auto; font: 400 12.5px/1.65 var(--mono); margin: 0; }
details.tech { border-radius: var(--r); box-shadow: var(--e1); background: var(--surface); }
details.tech > summary { padding: 14px 18px; cursor: pointer; font: 500 13px var(--font); color: var(--ink-2); list-style: none; }
details.tech > summary::before { content: "+ "; color: var(--teal-ink); font-family: var(--mono); } details.tech[open] > summary::before { content: "− "; }
details.tech > div { padding: 0 18px 18px; }

/* dark "live" panel (deploy) */
.live { position: relative; background: radial-gradient(90% 90% at 70% 30%, #10262b 0%, var(--graphite) 70%); color: #eceee9; border-radius: var(--r-lg); padding: 40px; overflow: hidden; }
.live::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(98, 212, 220, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(98, 212, 220, .05) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.live > * { position: relative; }
.live .tri { height: 2px; background: var(--tri); position: absolute; top: 0; left: 0; right: 0; }
.live .display { color: #eceee9; } .live .display .c { color: var(--cyan); }
.live .muted { color: #9fb0b5; }
.live pre.code { background: rgba(5, 8, 10, .7); border: 1px solid var(--graphite-line); }
.live .btn { background: transparent; color: #eceee9; border-color: rgba(236, 238, 233, .25); }
.live .btn.primary { background: var(--cyan); border-color: var(--cyan); color: #061114; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
.trydrop { border: 1.5px dashed rgba(98, 212, 220, .4); border-radius: var(--r); padding: 22px; text-align: center; color: #9fb0b5; cursor: pointer; }
.trydrop.over { border-color: var(--cyan); background: rgba(98, 212, 220, .06); }

/* empty / feedback */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty svg { width: 180px; height: 108px; stroke: var(--ink-3); stroke-width: 1.4; fill: none; } .empty svg .a { stroke: var(--teal); stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 900ms var(--ease) 120ms forwards; }
.empty .t { font: 600 20px/1.3 var(--font); letter-spacing: -.01em; } .empty .b { color: var(--ink-2); max-width: 46ch; }
.drop-all { border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 16px 16px; min-height: 420px; display: grid; place-items: center; text-align: center; cursor: pointer; transition: border-color var(--t), background-color var(--t); }
.drop-all.over { border-color: var(--teal); background-color: var(--select); }
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 22, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade 140ms ease-out; }
.dialog { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--e2); animation: rise 200ms var(--ease); }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 70; width: min(520px, calc(100% - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; background: var(--graphite); color: #eceee9; border-radius: var(--r); padding: 12px 14px 12px 16px; font-size: 14px; box-shadow: var(--e2); animation: rise 200ms var(--ease); }
.toast.danger { background: #3a1610; } .toast .btn { background: transparent; color: var(--cyan); border-color: rgba(98, 212, 220, .4); }
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--warn-bg); font-size: 14px; color: var(--ink); }
.notice.info { background: var(--select); } .notice.err { background: var(--danger-bg); color: var(--danger); } .notice.ok { background: var(--pos-bg); }
.skeleton { background: linear-gradient(90deg, var(--sunken), var(--hover), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.overlay-poly { fill-opacity: .25; stroke-width: 1.6; vector-effect: non-scaling-stroke; }

/* ------------------------------------------------------------------ canvas pages (label, plan structure) */
.canvas-page { display: grid; grid-template-rows: 52px 3px minmax(0, 1fr); height: 100dvh; background: var(--bg); }
.canvas-top { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.canvas-top .t { font-weight: 600; font-size: 14.5px; } .canvas-top .s { font-size: 12.5px; color: var(--ink-3); }
.sheetrail { display: flex; gap: 2px; background: var(--surface); } .sheetrail a { flex: 1; background: var(--line); } .sheetrail a.done { background: var(--teal); } .sheetrail a.on { background: var(--cyan); }
.canvas-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.canvas-stage { position: relative; min-height: 0; background-color: var(--sunken); background-image: radial-gradient(rgba(15, 20, 22, .07) 1px, transparent 1px); background-size: 14px 14px; }
.canvas-side { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; display: flex; flex-direction: column; }
.canvas-side section { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cond { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.cond:hover { background: var(--hover); } .cond.on { background: var(--select); box-shadow: inset 0 0 0 1.5px var(--teal); }
.cond .n { margin-left: auto; font: 500 12px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.icon-btn { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; text-decoration: none !important; font-size: 16px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.toggle { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--r-sm); background: var(--sunken); }
.toggle button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 10px; border-radius: 5px; font: 600 13px var(--font); cursor: pointer; }
.toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--graphite); color: #eceee9; padding: 8px 14px; border-radius: 999px; font-size: 13px; z-index: 5; white-space: nowrap; box-shadow: var(--e2); }
.queue { background: var(--graphite); color: #eceee9; border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.queue .q-h { display: flex; justify-content: space-between; align-items: baseline; } .queue .q-h b { font-size: 15px; } .queue .q-h span { font: 500 12px var(--mono); color: #9fb0b5; }
.queue .q-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.queue .q-btns button { height: 40px; border-radius: var(--r-sm); border: 1px solid rgba(236, 238, 233, .2); background: transparent; color: #eceee9; font: 600 14px var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.queue .q-btns button.keep { background: var(--cyan); color: #061114; border-color: var(--cyan); }
.queue .q-btns kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .7; }
.queue .meter { background: rgba(236, 238, 233, .12); } .queue .meter > i { background: var(--cyan); }
#engine { position: absolute; inset: 0; }
#engine .lsf-labels { display: none !important; }
#engine, #engine .lsf-editor, #engine .lsf-wrapper, #engine .lsf-main-content { height: 100%; }
#engine .lsf-main-view { background: transparent; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; align-items: center; }

/* Graph Studio (plan structure, advanced) */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100dvh - 52px); }
.studio .canvas-wrap { position: relative; background: var(--sunken); overflow: hidden; border-right: 1px solid var(--line); }
.studio svg.plan { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; } .studio svg.plan.panning { cursor: grabbing; }
.studio .panel { overflow-y: auto; background: var(--surface); display: flex; flex-direction: column; }
.studio .panel section { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.studio .toolbar { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }
.studio .legend { position: absolute; bottom: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; max-width: 60%; }
.studio .minigraph { position: absolute; right: 12px; bottom: 12px; width: 300px; height: 210px; background: var(--surface); border-radius: var(--r); box-shadow: var(--e2); z-index: 2; }
.prim { fill: none; vector-effect: non-scaling-stroke; stroke-width: 1.3; cursor: pointer; } .prim.sel { stroke-width: 3.4 !important; } .prim.dim { opacity: .22; } .prim-text { fill-opacity: .12; stroke-width: .8; }
.edge-line { stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; opacity: .75; }
.ot-btn { height: 30px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ot-btn:hover { background: var(--hover); } .ot-btn.primary { background: var(--teal); color: var(--on-teal); border-color: var(--teal); } .ot-btn.danger { color: var(--danger); } .ot-btn.ghost { border-color: transparent; background: transparent; }
.legend .chip { cursor: pointer; }
.chart { width: 100%; height: 220px; } .chart .axis { stroke: var(--line); } .chart text { fill: var(--ink-3); font: 10.5px var(--mono); }
.w100 { width: 100%; } .gap4 { gap: 4px; } .wrap { flex-wrap: wrap; }
.progress-big { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; position: relative; }
.progress-big > i { position: absolute; inset: 0 auto 0 0; background: var(--teal); border-radius: 4px; transition: width 800ms var(--ease); }

/* =====================================================================================
   v5 — research-led system (contractor flow). Light + dark. Hairlines over cards, two-tone
   headlines, mono instrument labels, cyan only for what is actionable or live.
   ===================================================================================== */
body { font-size: 14px; letter-spacing: -.01em; }
.h1 { font: 600 34px/1.06 var(--font); letter-spacing: -.035em; }
.h1 .dim, .h1 span.dim { color: var(--ink-4); }
.h2 { font: 600 20px/1.2 var(--font); letter-spacing: -.025em; }
.lbl { font: 400 10.5px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); }
.lbl.cy { color: var(--teal-ink); }
kbd { font: 600 10px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 3px 5px; display: inline-block; min-width: 18px; text-align: center; background: transparent; }

/* shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }  /* one row the height of the window: the page area scrolls (QA: tall pages could not scroll) */
.side { width: auto; flex: none; background: var(--bg); padding: 16px 12px 0; }
.brand .m { width: 30px; height: 30px; border-radius: 8px; background: #0a0c0e; display: grid; place-items: center; flex: none; }
.brand .m svg { width: 20px; height: 10px; flex: none; }
.brand b { font-size: 15px; letter-spacing: -.02em; }
.nav { font-size: 13.5px; height: 34px; border-radius: 8px; }
.nav.on { background: var(--surface); box-shadow: var(--e1); color: var(--ink); }
.nav.on svg { stroke: var(--teal); }
.nav .c { margin-left: auto; font: 10.5px var(--mono); color: var(--ink-4); }
.nav-label { font-size: 10.5px; color: var(--ink-4); }
.themeseg { display: flex; padding: 3px; border-radius: 9px; background: var(--sunken); margin: 0 0 12px; }
.themeseg button { flex: 1; height: 26px; border: 0; background: none; border-radius: 7px; font: 500 12.5px var(--font); color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.themeseg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.themeseg svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.me { margin: 0 -12px; padding: 14px 20px; }
.avatar { background: #0a0c0e; color: var(--cyan); font-family: var(--mono); font-size: 11px; }
.top { height: 56px; flex: 0 0 56px; padding: 0 28px; background: var(--bg); }
.page { max-width: 1280px; padding: 28px 28px 48px; gap: 24px; }

/* buttons */
.btn { height: 36px; border-radius: 9px; font-weight: 600; font-size: 13.5px; }
.btn.primary { background: var(--cyan); color: #03262a; border-color: rgba(14, 143, 153, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 20px rgba(98, 212, 220, .28); }
.btn.primary:hover { background: #7ddde4; }
.btn.ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.lg { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn kbd { margin-left: 2px; }
.btn.primary kbd { color: #03262a; border-color: rgba(3, 38, 42, .3); background: rgba(255, 255, 255, .2); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--pos-bg); color: var(--pos); } .pill.cy { background: var(--cy-m); color: var(--teal-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.mute { background: var(--sunken); color: var(--ink-3); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* dark drawing panel (always graphite: the bridge to kentucky-ai.com) */
.dpanel { position: relative; overflow: hidden; border-radius: 14px; color: #f2f5f6; background-color: #0a0c0e;
  background-image: linear-gradient(rgba(98, 212, 220, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(98, 212, 220, .05) 1px, transparent 1px); background-size: 20px 20px; }
.dpanel.ticks::before, .dpanel.ticks::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--cyan); opacity: .8; z-index: 3; pointer-events: none; }
.dpanel.ticks::before { left: 10px; top: 10px; border-width: 1.5px 0 0 1.5px; }
.dpanel.ticks::after { right: 10px; bottom: 10px; border-width: 0 1.5px 1.5px 0; }
.dpanel > svg.plan { position: absolute; inset: 0; width: 100%; height: 100%; }
.dpanel .lbl { color: #8b959d; }
.dpanel .lbl.cy { color: var(--cyan); }
.dpanel .dim { color: #9aa4ac; }  /* 7:1 on the dark panel (was 4:1) */
.dpanel img.planimg, .dpanel image.planimg { filter: invert(1); mix-blend-mode: screen; }
.dchip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px; border-radius: 7px; background: rgba(16, 19, 22, .9); border: 1px solid rgba(255, 255, 255, .1); font: 10.5px var(--mono); letter-spacing: .06em; color: #c4ccd3; backdrop-filter: blur(8px); text-transform: uppercase; white-space: nowrap; }
.dchip .dot { width: 7px; height: 7px; border-radius: 50%; }
polygon.k { stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dpanel polygon.k, .dpanel rect.k { stroke-width: 1.4; fill-opacity: .18; }
.k-wall { stroke: #62d4dc; fill: #62d4dc; } .k-door { stroke: #f0b24a; fill: #f0b24a; } .k-window { stroke: #9db1ff; fill: #9db1ff; }
.k-room, .k-room_tag { stroke: #7fcf9c; fill: #7fcf9c; } .k-other { stroke: #848e8b; fill: #848e8b; }
.k-found { stroke: #62d4dc; fill: #62d4dc; } .k-extra { stroke: #f0b24a; fill: #f0b24a; }
.k-miss { stroke: #ff6b6b; fill: #ff6b6b; stroke-dasharray: 5 4; }
.drawin { animation: drawin .5s var(--ease) both; }
@keyframes drawin { from { opacity: 0; } }

/* home */
.headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.nexthero { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 312px; }
.nexthero .l { padding: 30px 32px; display: flex; flex-direction: column; position: relative; z-index: 2; }
.nexthero .t { font: 600 30px/1.08 var(--font); letter-spacing: -.035em; margin-top: 14px; }
.nexthero .meta { margin-top: 12px; color: #8a939c; font-size: 14px; max-width: 46ch; }
.nexthero .r { position: relative; border-left: 1px solid rgba(255, 255, 255, .06); min-height: 260px; }
.nexthero .r > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nexthero .r .chips { position: absolute; left: 20px; top: 18px; display: flex; gap: 6px; z-index: 2; }
.glow { position: absolute; inset: 0; background: radial-gradient(500px 300px at 70% 40%, rgba(98, 212, 220, .10), transparent 70%); pointer-events: none; }
.track { height: 5px; border-radius: 3px; background: #1d2227; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 12px rgba(98, 212, 220, .6); transition: width .6s var(--ease); }
.nexthero .btn.ghostd { background: transparent; color: #c4ccd3; border-color: rgba(255, 255, 255, .16); }
.nexthero .btn.ghostd:hover { background: rgba(255, 255, 255, .05); }
.secrow { display: flex; justify-content: space-between; align-items: center; margin-bottom: -8px; }
.psgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ps { display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); color: inherit; text-decoration: none !important; transition: transform var(--t) var(--ease), box-shadow var(--t); overflow: hidden; }
.ps:hover { transform: translateY(-2px); box-shadow: var(--e2); }
.ps .th { height: 168px; margin: 6px 6px 0; border-radius: 10px; }
.ps .th .lbl { position: absolute; left: 28px; top: 8px; z-index: 3; padding: 2px 6px; border-radius: 5px; background: rgba(10, 12, 14, .85); }
.ps .b { padding: 14px 16px 16px; }
.ps .n { font-weight: 600; font-size: 15px; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps .m { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.ps .f { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 6px 8px; flex-wrap: wrap; }
.ps .f .lbl { white-space: nowrap; flex: none; margin-left: auto; }  /* "1 item" stays on one line; the status pills wrap above it instead */
.sbars { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.sbars i { width: 12px; height: 4px; border-radius: 2px; background: var(--sunken); }
.sbars i.done { background: var(--ink); } .sbars i.review { background: var(--cyan); } .sbars i.labeled { background: var(--ink-4); }
.sbars i.held { background: repeating-linear-gradient(90deg, var(--ink) 0 3px, var(--sunken) 3px 5px); } .sbars i.sent_back { background: var(--warn, #a76c00); }
.dropc { border: 1.5px dashed var(--line-2); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; color: var(--ink-3); cursor: pointer; min-height: 260px; padding: 20px; background: transparent; font: inherit; transition: border-color var(--t), background var(--t); }
.dropc:hover, .dropc.over { border-color: var(--teal); background: var(--cy-m); }
.dropc .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: var(--e1); display: grid; place-items: center; }
.dropc .ic svg { width: 20px; stroke: var(--ink-2); fill: none; stroke-width: 1.6; }
.dropc b { color: var(--ink); font-size: 15px; letter-spacing: -.02em; }
.fmt { display: flex; gap: 5px; }
.fmt span { font: 10px var(--mono); padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-3); background: var(--surface); }

/* plan set page */
.sheetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sheetgrid .ps .th { height: 150px; }
.statusbar { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--e1); }
.statusbar .grow { flex: 1; }
.statusbar b { font-size: 15px; letter-spacing: -.02em; }
.statusbar .s { color: var(--ink-3); font-size: 13px; }
.totals { display: flex; border-radius: 12px; overflow: hidden; box-shadow: var(--e1); background: var(--surface); }
.totals > div { padding: 10px 18px; border-right: 1px solid var(--line); min-width: 100px; }
.totals > div:last-child { border-right: 0; }
.totals b { display: block; font: 600 20px/1.15 var(--font); letter-spacing: -.02em; }

/* train */
.trainwrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: stretch; }
.trainwrap > * { min-width: 0; }
.trainwrap { grid-template-areas: "main side" "adv side"; grid-template-rows: auto 1fr; }
.trmain { grid-area: main; } .trainwrap > .readyp { grid-area: side; } .trvadv { grid-area: adv; align-self: start; margin-top: 8px; }
.trvadv .advh { font-weight: 600; font-size: 13.5px; margin: 16px 0 8px; } .trvadv .speedgrid { margin-bottom: 6px; }
.trvadv .plan { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: var(--ink-2); } .advplan { display: flex; flex-direction: column; align-items: flex-start; }
.readyp .sum { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: #c4ccd3; }
.readyp .est3 { grid-template-columns: repeat(2, 1fr); margin-top: 16px; } .trainwrap > .readyp { align-self: start; } .speedgrid .sp .nums { flex-wrap: wrap; gap: 6px 22px; }
.step { margin-top: 24px; }
.stepl { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stepl .n { width: 22px; height: 22px; border-radius: 6px; background: #0a0c0e; color: var(--cyan); font: 600 11px var(--mono); display: grid; place-items: center; }
.stepl b { font-size: 15px; letter-spacing: -.02em; }
.stepl .lbl { margin-left: auto; }
.clsgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cls { position: relative; padding: 8px; border-radius: 13px; background: var(--surface); box-shadow: var(--e1); text-align: left; }
.cls.on { box-shadow: 0 0 0 1px rgba(14, 143, 153, .55), 0 0 0 4px rgba(98, 212, 220, .2); }
.cls .pv { height: 110px; border-radius: 9px; }
.cls .nm { display: flex; align-items: center; justify-content: space-between; margin: 11px 6px 2px; font-weight: 600; font-size: 14.5px; }
.cls .ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 11px; color: var(--cyan); }
.cls.on .ck { background: #0a0c0e; border-color: #0a0c0e; }
.cls .ex { margin: 0 6px 4px; font-size: 12.5px; color: var(--ink-3); }
.cls.off .pv { opacity: .6; } .cls.off .ck { opacity: .6; } /* an unselected kind is dimmed in its picture only: its words keep full contrast */
.cls .bar { margin: 8px 6px 4px; height: 3px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.cls .bar i { display: block; height: 100%; background: var(--teal); }
.speedgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp { padding: 16px 18px; border-radius: 13px; background: var(--surface); box-shadow: var(--e1); text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit; transition: box-shadow var(--t); }
.sp:hover { box-shadow: var(--e2); }
.sp.on { box-shadow: 0 0 0 1px rgba(14, 143, 153, .55), 0 0 0 4px rgba(98, 212, 220, .2); }
.sp .tt { font-weight: 600; font-size: 15px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; height: 22px; }
.sp { display: flex; flex-direction: column; }
.sp .d { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; min-height: 38px; line-height: 1.4; }
.sp .nums { display: flex; gap: 22px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sp .d + .nums { margin-top: auto; } .sp .d { margin-bottom: 12px; }
.sp .nums b { display: block; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.hist { display: flex; align-items: center; gap: 22px; padding: 18px 26px; min-height: 150px; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); }
.hv { flex: none; white-space: nowrap; }
.hv b { display: block; font-size: 40px; letter-spacing: -.035em; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.hv small { color: var(--ink-3); font-size: 12px; }
.hv.next b { color: var(--teal-ink); }
.harrow { width: 26px; height: 1px; background: var(--line-2); position: relative; flex: none; }
.harrow::after { content: ""; position: absolute; right: 0; top: -3px; border: 3.5px solid transparent; border-left-color: var(--ink-4); border-right: 0; }
.hist svg { margin-left: auto; width: 240px; height: 70px; overflow: visible; flex: 0 1 240px; margin-right: 8px; }
.readyp { display: flex; flex-direction: column; padding: 26px; }
.readyp .t { font: 600 26px/1.1 var(--font); letter-spacing: -.033em; margin-top: 12px; }
.ci { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 13.5px; color: #c4ccd3; }
.ci .i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.ci .i.ok, .ci .i.n { background: rgba(76, 195, 138, .15); color: #4cc38a; } .ci .i.w { background: rgba(240, 180, 41, .15); color: #f0b429; } .ci .i.no { background: rgba(255, 107, 107, .15); color: #ff6b6b; }
.ci small { display: block; color: #6b747a; font-size: 12px; margin-top: 1px; }
.est3 { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255, 255, 255, .08); border-radius: 11px; overflow: hidden; }
.est3 > div { padding: 11px 14px; border-right: 1px solid rgba(255, 255, 255, .08); }
.est3 > div:last-child { border: 0; }
.est3 b { display: block; font-size: 19px; letter-spacing: -.02em; color: #f2f5f6; }
.readyp .go { margin-top: 14px; width: 100%; justify-content: center; }
.readyp .fine { text-align: center; margin-top: 10px; font-size: 12px; color: #6b747a; }

/* live + results */
.livetag { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--cy-m); color: var(--teal-ink); font: 600 10.5px var(--mono); letter-spacing: .1em; margin-bottom: 14px; text-transform: uppercase; }
.livetag i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.stamp { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 7px; background: #0a0c0e; color: var(--cyan); font: 10.5px var(--mono); letter-spacing: .1em; margin-bottom: 14px; text-transform: uppercase; }
.stamp i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.runwrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; min-height: 560px; }
.runwrap .dpanel { min-height: 560px; }
.runcol { display: flex; flex-direction: column; gap: 12px; }
.scanl { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cyan); box-shadow: 0 0 18px 4px rgba(98, 212, 220, .55), 0 0 60px 20px rgba(98, 212, 220, .15); z-index: 2; animation: sweep 6s linear infinite; }
.scanl::after { content: ""; position: absolute; right: 2px; top: 0; bottom: 0; width: 140px; background: linear-gradient(90deg, transparent, rgba(98, 212, 220, .1)); }
@keyframes sweep { from { left: 0; } to { left: 100%; } }
.ptop { position: absolute; left: 18px; right: 18px; top: 16px; display: flex; align-items: center; gap: 6px; z-index: 3; flex-wrap: wrap; }
.pbot { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: center; gap: 14px; z-index: 3; }
.ticksrow { flex: 1; display: flex; gap: 3px; }
.ticksrow i { flex: 1; height: 8px; border-radius: 2px; background: #1d2227; }
.ticksrow i.d { background: rgba(98, 212, 220, .55); } .ticksrow i.c { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.bigstat { padding: 18px 20px; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); display: flex; flex-direction: column; }
.bigstat .n { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-top: 10px; }
.bigstat .n span { font-size: 20px; color: var(--ink-4); letter-spacing: -.02em; }
.bigstat .s { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.bigstat svg { width: 100%; height: 64px; margin-top: auto; padding-top: 12px; overflow: visible; }
.steps { padding: 6px 20px; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); }
.st { display: flex; align-items: center; gap: 12px; height: 46px; border-bottom: 1px solid var(--line); font-size: 14px; }
.st:last-child { border: 0; }
.st .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.st .i.ok { background: var(--pos-bg); color: var(--pos); }
.st .i.on { border: 2px solid var(--teal); border-top-color: transparent; animation: spin 1s linear infinite; }
.st .i.wait { border: 1.5px solid var(--line-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.st.dim { color: var(--ink-4); }
.st .r { margin-left: auto; font: 11px var(--mono); color: var(--ink-4); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; color: var(--ink-3); font-size: 13px; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); }
.itemcard { padding: 16px 18px; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); }
.itemcard .r1 { display: flex; align-items: center; gap: 10px; }
.itemcard .sw { width: 12px; height: 12px; border-radius: 3px; }
.itemcard .nm { font-weight: 600; font-size: 15px; }
.itemcard .pc { margin-left: auto; font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.itemcard .s { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.cmp { margin-top: 12px; position: relative; height: 6px; border-radius: 3px; background: var(--sunken); }
.cmp .new { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--ink); }
.cmp .old { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--ink-4); }
.cl { display: flex; justify-content: space-between; margin-top: 8px; }
.up { color: var(--pos); font: 600 11px var(--mono); } .down { color: var(--danger); font: 600 11px var(--mono); }
.adv { flex: 1; padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; background: var(--cy-m); border-radius: 14px; border: 1px solid rgba(14, 143, 153, .22); }
.adv svg { flex: none; width: 18px; stroke: var(--teal); fill: none; stroke-width: 1.7; margin-top: 2px; }
.adv p { color: var(--ink-2); font-size: 13px; margin: 2px 0 0; }
.segd { display: flex; padding: 3px; border-radius: 9px; background: rgba(16, 19, 22, .9); border: 1px solid rgba(255, 255, 255, .08); margin-left: auto; }
.segd button { height: 24px; padding: 0 10px; border-radius: 6px; font: 500 12px var(--font); color: #8a939c; background: none; border: 0; cursor: pointer; }
.segd button.on { background: #1d2227; color: #f2f5f6; }
.itemcard .facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.itemcard .facts .guess { color: var(--warn); font-weight: 600; }
.k-fa { stroke: #ff6b6b; fill: none !important; fill-opacity: 0 !important; stroke-width: 2px; stroke-dasharray: none; }
.dchip .dot.ring { background: none; border: 2px solid #ff6b6b; box-sizing: border-box; }
details.engdet { margin-top: 4px; }
.engfoot { display: flex; align-items: center; gap: 18px; color: var(--ink-3); font-size: 12.5px; }
.engfoot details summary { cursor: pointer; }
.runcol .bigstat { flex: 1; }
:root[data-theme="dark"] .dpanel { box-shadow: 0 0 0 1px var(--line); }
:root[data-theme="dark"] .brand .m, :root[data-theme="dark"] .rv-mark { box-shadow: 0 0 0 1px var(--line-2); }
/* advanced training dialog */
.readyp .go + .go { margin-top: 8px; }
.ghostd { background: transparent !important; color: #c4ccd3 !important; border: 1px solid rgba(255, 255, 255, .16) !important; box-shadow: none !important; }
.ghostd:hover { background: rgba(255, 255, 255, .05) !important; }
.dialog.advdlg { width: min(980px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 26px 28px; gap: 6px; }
.advstep { margin-top: 18px; }
.advgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.advopt { text-align: left; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 0; box-shadow: var(--e1); cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 10px; transition: box-shadow var(--t); }
.advopt:hover { box-shadow: var(--e2); }
.advopt.on { box-shadow: 0 0 0 1px rgba(14, 143, 153, .55), 0 0 0 4px rgba(98, 212, 220, .2); }
.advopt.off { opacity: .55; cursor: default; box-shadow: var(--e1); }
.advopt b { font-size: 14.5px; letter-spacing: -.015em; display: block; }
.advopt small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.advopt small .techname { display: inline-block; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11px; letter-spacing: .02em; color: var(--ink-3); opacity: .85; margin-bottom: 2px; }
.chips2 { display: flex; gap: 5px; flex-wrap: wrap; }
.advfields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.advfields .field span { text-transform: capitalize; }
.field small.cy { color: var(--teal-ink); font-size: 11.5px; }
/* registry / experiments / deployments / developer / account pages */
.regcard { background: var(--surface); border-radius: 14px; box-shadow: var(--e1); overflow: hidden; }
.regcard.pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.regcard .h2 { font-size: 17px; }
.reghead { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sub, td .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtable th { text-align: left; font: 400 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover td { background: var(--hover); }
.rtable th:first-child, .rtable td:first-child { padding-left: 22px; } .rtable th:last-child, .rtable td:last-child { padding-right: 22px; }
.rtable.compact td { padding: 8px 0; } .rtable.compact td:first-child { padding-left: 0; } .rtable.compact td:last-child { text-align: right; padding-right: 0; }
.rtable td.acts { text-align: right; white-space: nowrap; } .rtable td.acts .btn + .btn { margin-left: 6px; }
.mtr { flex: 1; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; min-width: 60px; }
.mtr i { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.emptyc { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 20px; border: 1.5px dashed var(--line-2); border-radius: 14px; color: var(--ink-3); }
.emptyc b { color: var(--ink); font-size: 17px; letter-spacing: -.02em; } .emptyc .btn { margin-top: 8px; }
.cmpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.cmpchart svg { width: 100%; height: auto; margin-top: 8px; }
.depcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--e1); overflow: hidden; min-height: 380px; }
.depinfo { padding: 22px 24px; display: flex; flex-direction: column; }
.depinfo .h2 { font-size: 24px; letter-spacing: -.03em; }
.endpoint { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 8px 8px 12px; border-radius: 9px; background: var(--sunken); }
.endpoint code { flex: 1; font: 12px var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dstats > div { padding: 10px 14px; border-right: 1px solid var(--line); } .dstats > div:last-child { border: 0; }
.dstats b { display: block; font-size: 17px; letter-spacing: -.02em; }
.hist2 { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-3); }
.trybox { border-radius: 0; cursor: pointer; min-height: 380px; }
.trybox.over { outline: 2px dashed var(--cyan); outline-offset: -10px; }
.trycta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #8a939c; font-size: 13px; text-align: center; padding: 20px; }
.trycta b { color: #f2f5f6; font-size: 18px; letter-spacing: -.02em; }
select.sm { height: 30px; font-size: 12.5px; width: auto; padding: 0 8px; border-radius: 8px; }
.tips3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tips3 > div { padding: 16px 18px; border-radius: 12px; background: var(--sunken); }
.tips3 b { font-size: 14px; } .tips3 p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.docgrid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.dstep { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dstep .n { width: 24px; height: 24px; border-radius: 7px; background: #0a0c0e; color: var(--cyan); font: 600 11px var(--mono); display: grid; place-items: center; flex: none; }
.dstep b { font-size: 15px; } .dstep p { margin: 3px 0 10px; color: var(--ink-3); font-size: 13.5px; }
.segl { display: flex; padding: 3px; border-radius: 9px; background: var(--sunken); }
.segl button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font: 500 12.5px var(--font); color: var(--ink-3); cursor: pointer; }
.segl button.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.stat4 { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-radius: 14px; box-shadow: var(--e1); overflow: hidden; }
.stat4 > div { padding: 18px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; } .stat4 > div:last-child { border: 0; }
.stat4 b { font-size: 26px; letter-spacing: -.035em; font-weight: 600; } .stat4 small { color: var(--ink-3); font-size: 12.5px; }
.bgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.brow { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: 12px; font-size: 13.5px; padding: 6px 0; } .brow span:last-child { text-align: right; }
.bgrid2 { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.people { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); }
.person small, .datarow small { display: block; color: var(--ink-3); font-size: 12px; }
.datarow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 10px; background: var(--line-2); transition: background var(--t); }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease); }
.switch input:checked + i { background: var(--teal); } .switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }
.regcard.pad .mtr { flex: none; height: 8px; margin-top: 6px; }
.brow .mtr { flex: none; }
body[data-page="graph"] .studio { height: 100dvh; }
.studio .toolbar { align-items: center; padding: 5px; border-radius: 12px; background: var(--float); border: 1px solid var(--float-line); backdrop-filter: blur(20px); box-shadow: var(--e2); flex-wrap: nowrap; }
.studio .toolbar select { width: auto; height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 8px; }
.studio .canvas-wrap { background-color: var(--paper); background-image: linear-gradient(var(--paper-grid) 1px, transparent 1px), linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px); background-size: 24px 24px; }
.studio svg.plan image { filter: var(--plan-filter); mix-blend-mode: var(--plan-blend); }
:root[data-theme="dark"] .studio svg.plan rect[fill="#fff"], :root[data-theme="dark"] .studio svg.plan rect[fill="white"], :root[data-theme="dark"] .studio svg.plan rect[fill="#ffffff"] { fill: transparent; }
.rtable td.mono, .rtable td.faint { white-space: nowrap; }
.bgrid { align-items: start; }

.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; }
.notice.bad { border-color: color-mix(in srgb, var(--danger, #d9534f) 45%, var(--line)); }
.statusbar .spin, .notice .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--teal); animation: kaspin .9s linear infinite; flex: none; }
@keyframes kaspin { to { transform: rotate(360deg); } }

/* Labels page */
.lb-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.lb-side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.lb-search { margin-bottom: 10px; }
.lb-tab { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); font: 13.5px var(--font); text-align: left; cursor: pointer; }
.lb-tab:hover { background: var(--hover); color: var(--ink); }
.lb-tab.on { background: var(--select); color: var(--ink); font-weight: 600; }
.lb-tab .c { font: 11px var(--mono); color: var(--ink-4); }
.lb-list { min-width: 0; overflow-x: auto; }
.lb-scroll { overflow-x: auto; }
.lb-name { display: flex; align-items: center; gap: 10px; }
.lb-name small { display: block; color: var(--ink-4); font-size: 12px; }
.lb-color { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.lb-color::-webkit-color-swatch-wrapper { padding: 2px; } .lb-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
.lb-take { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.lb-shp { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.lb-acts { text-align: right; width: 300px; min-width: 0; white-space: normal; }  /* the actions wrap onto a second line inside their own column, so the table never needs a sideways scroll */
.lb-acts .btn.sm, .lb-acts .lb-more { margin: 2px 0 2px 2px; vertical-align: middle; }
.lb-scroll .rtable td, .lb-scroll .rtable th { padding-left: 10px; padding-right: 10px; }
.lb-scroll .rtable td:first-child, .lb-scroll .rtable th:first-child { padding-left: 22px; } .lb-scroll .rtable td:last-child, .lb-scroll .rtable th:last-child { padding-right: 16px; }
.lb-acts .btn.sm { padding: 0 8px; }
.lb-hidden td { opacity: .55; }
.chip.sm { font-size: 11.5px; padding: 2px 8px; margin: 0 4px 4px 0; }
.lb-form { display: grid; gap: 10px; min-width: min(464px, 80vw); }  /* fits inside the dialog's padding */
.lb-fields { display: grid; gap: 6px; margin-bottom: 6px; }
.lb-field { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px; }
@media (max-width: 860px) { .lb-wrap { grid-template-columns: 1fr; } .lb-side { position: static; } }
.lb-search { width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 13.5px var(--font); }
.lb-search:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); box-shadow: 0 0 0 3px var(--cy-m); }

.lb-child td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.lb-elbow { color: var(--ink-4); font-size: 13px; margin-right: -2px; }
.lb-own { font-size: 10px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.lb-trainas { display: block; margin-top: 5px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 12px var(--font); }

.lb-list td:first-child { min-width: 220px; }
.lb-trainas { min-width: 230px; max-width: 100%; }
.lb-more { padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 12.5px var(--font); cursor: pointer; }
.lb-more { height: 30px; min-height: 0; line-height: 1; }
.lb-tabs { display: contents; }

/* workflow spine */
.spine { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 20px; padding: 0; list-style: none; }
.spine li { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.spine .n { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink-3); }
.spine .num { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 11px var(--font); flex: none; }
.spine .s { font-size: 13px; color: var(--ink-3); }
.spine .btn { margin-top: 8px; align-self: flex-start; }
.spine li.done .num { background: var(--teal-ink); border-color: var(--teal-ink); color: var(--on-teal-ink); }
.spine li.done .n { color: var(--ink); } .spine li.done .s { color: var(--ink-2); }
.spine li.cur { border-color: var(--teal); box-shadow: 0 0 0 3px var(--cy-m); }
.spine li.cur .num { border-color: var(--teal); color: var(--teal-ink); } .spine li.cur .n { color: var(--ink); } .spine li.cur .s { color: var(--ink-2); }
@media (max-width: 900px) { .spine { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .spine { grid-template-columns: 1fr; } }
.logout { margin: 0; padding: 0 2px 6px; }

/* Deployments: Try it results (items with confidence, slider) */
.trywrap { display: flex; flex-direction: column; min-width: 0; }
.tryres { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-top: 1px solid var(--line); }
.tryres:empty { display: none; }
.tryctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.tryctl input[type=range] { flex: 1; min-width: 120px; max-width: 260px; }
.tryitems { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.tryrow { display: grid; grid-template-columns: 96px 44px 80px 1fr; align-items: center; gap: 10px; padding: 3px 4px; border-radius: 6px; }
.tryrow:hover { background: var(--sunken); }
.tryrow .dchip { background: var(--sunken); color: var(--ink-2); border-color: var(--line); backdrop-filter: none; }

/* labeling guides (guide.js): Labels page editor + labeling screen card */
.gd { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.gd-line { color: var(--ink-2); line-height: 1.4; }
.gd-more { margin-top: 6px; }
.gd-more summary { cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 12px; user-select: none; }
.gd-more summary:hover { color: var(--ink); }
.gd-body { margin-top: 6px; }
.gd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gd-col ul { margin: 4px 0 0; padding-left: 16px; } .gd-col li { margin: 2px 0; }
.gd-col.yes b { color: var(--pos, #3f9b6b); } .gd-col.no b { color: var(--warn, #c9772b); }
.gd-box { margin: 8px 0 0; }
.gd-ex, .gd-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.gd-crop { position: relative; display: inline-block; border: 1px solid var(--line); border-radius: 6px; background-color: #fff; overflow: hidden; }
.gd-crop::after { content: ''; position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh); box-shadow: 0 0 0 1.5px #f0b24a; border-radius: 1px; }
.gd-nt { margin-top: 8px; } .gd-ntcap { color: var(--ink-3); font-size: 12px; } .gd-ntcap b { color: var(--warn, #c9772b); }
.gd-crop.nt { border: 1.5px dashed var(--warn, #c9772b); }
.gd-rules { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.gd-rules ul { margin: 4px 0 0; padding-left: 16px; } .gd-rules li { margin: 2px 0; }
.gd-pick.nt.on { border-color: var(--warn, #c9772b); }
.gd-pick { padding: 2px; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.gd-pick.on { border-color: var(--teal, #2fa98f); } .gd-pick:disabled { opacity: .4; cursor: not-allowed; }
.gd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.lb-form textarea.input, .lb-form .field { box-sizing: border-box; max-width: 100%; min-width: 0; }
.gd-picker { max-height: 190px; overflow: auto; }
.gd-two textarea, .lb-form textarea.input { width: 100%; resize: vertical; font: inherit; }
.btn.has-guide { color: var(--teal, #2fa98f); }
@media (max-width: 560px) { .gd-cols, .gd-two { grid-template-columns: 1fr; } }
.lb-form.gd-form { min-width: 0; }

/* one headline per item type: Finds / Right when it marks */
.prbars { display: grid; gap: 6px; margin-top: 12px; }
.prrow { display: grid; grid-template-columns: 150px 1fr 44px 80px; align-items: center; gap: 10px; font-size: 13px; }
.prrow .k { color: var(--ink-2); } .prrow b { text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; } .prrow .c { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.prrow .meter { height: 7px; }
/* light placeholders instead of black boxes */
.cls .pv.nopic { display: grid; place-items: center; background: var(--sunken); color: var(--ink-3); font-size: 12.5px; }
.dpanel.ph { background: var(--sunken); color: var(--ink); min-height: 0 !important; align-self: start; box-shadow: inset 0 0 0 1px var(--line); }
.dpanel.ph::before, .dpanel.ph::after { display: none; }
.phbody { padding: 28px 26px; display: grid; gap: 10px; justify-items: start; max-width: 520px; }
.phbody p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.depwarn { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; }
@media (max-width: 640px) { .prrow { grid-template-columns: 1fr 44px; } .prrow .meter, .prrow .c { grid-column: 1 / -1; } }

/* sample project */
.dropwrap { display: flex; flex-direction: column; gap: 8px; }
.dropwrap .dropc { flex: 1; }
.samplelink { font-size: 13px; color: var(--ink-3); text-align: center; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-ink); cursor: pointer; text-decoration: underline; }
.linkbtn:disabled { opacity: .6; cursor: default; }
.firstrun { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 1060px; align-items: stretch; }
.samplecard { border: 1px solid var(--line-2); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: flex-start; }

/* responsive shell (QA: on a phone the 220px sidebar column stayed after the sidebar was hidden, leaving no navigation).
   Tablet: icon rail. Phone: the nav becomes a scrolling icon bar above the page. */
@media (max-width: 1000px) { .shell { grid-template-columns: 68px minmax(0, 1fr); } }
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { display: flex; flex-direction: row; align-items: center; gap: 2px; width: auto; height: auto; padding: 6px 10px; flex-wrap: wrap; overflow: visible;
    border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side > * { flex: none; }
  .side .nav { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .side .nav-label, .side .org, .side .me, .side .themebar, .side .theme { display: none !important; }
  .side .brand { margin: 0 6px 0 0; padding: 0; }
  .side nav, .side .navs, .side .grp { display: flex; flex-direction: row; gap: 2px; }
  .top { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 16px; gap: 8px; }
}
@media (max-width: 760px) { .depcard { grid-template-columns: minmax(0, 1fr); } .depcard > :last-child { min-height: 260px; } .depinfo { min-width: 0; padding: 18px 16px; } .depinfo pre, .depinfo code, .depinfo .mono { white-space: pre-wrap; overflow-wrap: anywhere; } .depinfo .row { flex-wrap: wrap; } }

/* version cards: why a class chip carries a warning, and whether the version can be trained */
.vnote { color: var(--ink-2); margin: 8px 0 0; } .vnote.bad { color: var(--danger, #b3261e); }
/* New API key: tick the deployments instead of a multi-select (works on touch) */
.keyfield { display: flex; flex-direction: column; gap: 8px; } .keyfield > span:first-child { font: 600 13px var(--font); color: var(--ink); }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.checklist .chk { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; cursor: pointer; font: 500 14px var(--font); color: var(--ink); }
.checklist .chk:hover { background: var(--sunken); }
.checklist .chk input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--teal); }
/* Deployments stats: 2 x 2 on a phone so "60/mi" is never cut off */
@media (max-width: 520px) {
  .dstats { grid-template-columns: 1fr 1fr; }
  .dstats > div { border-right: 0; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
  .dstats > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .dstats > div:nth-child(n+3) { border-bottom: 0; }
}
.gd-body, .gd-col, .gd-col ul, .gd-col li { text-align: left; }
.gd-col ul { list-style-position: outside; }

/* phone fit (QA, 390px): headline rows, chips and cards wrap or stack instead of running off the right edge */
@media (max-width: 760px) {
  /* train page: one column, the "Ready to train" panel after the steps (it used to sit on top of the left column) */
  .trainwrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "adv"; grid-template-rows: auto; } .clsgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .speedgrid { grid-template-columns: minmax(0, 1fr); } .readyp { padding: 20px 16px; } .est3 > div { padding: 10px; min-width: 0; } .sp .tt { height: auto; flex-wrap: wrap; }
  .headrow { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .headrow > *, .pagehead > * { min-width: 0; max-width: 100%; }
  .h1 { font-size: 27px; overflow-wrap: anywhere; }
  .stamp { height: auto; min-height: 26px; padding: 6px 10px; flex-wrap: wrap; max-width: 100%; line-height: 1.3; }
  .runwrap { grid-template-columns: minmax(0, 1fr); min-height: 0; } .runwrap > * { min-width: 0; } .runwrap .dpanel { min-height: 380px; }
  .pill { white-space: normal; height: auto; min-height: 22px; padding: 3px 8px; text-align: left; }
  .itemcard .r1 { flex-wrap: wrap; } .cl { flex-wrap: wrap; gap: 4px 12px; }
  .headrow > .totals { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); } .totals > div { min-width: 0; padding: 10px 14px; }
  .nexthero { grid-template-columns: minmax(0, 1fr); } .nexthero .l { padding: 22px 18px; } .nexthero .r { min-height: 200px; }
  .dropc .fmt { flex-wrap: wrap; justify-content: center; }
  .rtable, .hl-table { display: block; max-width: 100%; overflow-x: auto; }  /* a wide table scrolls inside its own box, never the page */
  .stat4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat4 > div { min-width: 0; border-bottom: 1px solid var(--line); }
  .regcard { min-width: 0; }
  .statusbar { flex-wrap: wrap; gap: 10px 12px; } .statusbar > div:not(.grow) { flex: 1 1 200px; min-width: 0; } .statusbar > .grow { display: none; } .statusbar > .btn { flex: 1 1 auto; justify-content: center; }
}

/* second check panel (dataset page) */
.sc { margin: 14px 0; gap: 12px; }
.sc-set { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sc-onoff, .sc-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.sc-rate select { height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 14px var(--font); }
.sc-why { margin: 0; max-width: 70ch; }
.sc-queue { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sc-list { display: grid; gap: 4px; }
.sc-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.sc-measures { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
.sc-big { font-size: 26px; letter-spacing: -.02em; }
.sc-common { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.sc-people, .sc-mine { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.sc-mine p { margin: 0; }
.sc-person { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(90px, auto); gap: 14px; align-items: center; font-size: 14px; }
.sc-dots { display: inline-flex; gap: 3px; }
.sc-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-4); box-sizing: border-box; }
.sc-dots i.k { background: var(--teal); border-color: var(--teal); }
@media (max-width: 720px) { .sc-row, .sc-person { grid-template-columns: 1fr; gap: 4px; } }

/* usage monitoring (Deployments page) */
.depwrap { display: flex; flex-direction: column; gap: 0; margin-bottom: 18px; }
.depwrap > .depcard { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.usepanel { background: var(--surface); border-radius: 0 0 14px 14px; box-shadow: var(--e1); padding: 16px 24px 18px; border-top: 1px solid var(--line); }
.usehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.usehead .seg { display: flex; gap: 6px; }
.usegrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.usechart svg { width: 100%; height: auto; display: block; }
.uselegend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.uselegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.usestats .dstats { margin-top: 0; grid-template-columns: repeat(4, auto); }
.usekeys { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.usekeys > div { display: flex; justify-content: space-between; gap: 12px; }
.recentcalls { margin-top: 14px; box-shadow: none; border: 1px solid var(--line); }
.recentcalls .rtable th:first-child, .recentcalls .rtable td:first-child { padding-left: 0; }
@media (max-width: 800px) { .usegrid { grid-template-columns: 1fr; } .usestats .dstats { grid-template-columns: repeat(2, 1fr); } .usepanel { padding: 14px 16px; } }
/* Settings fold inside a deployment card / the Put it online dialog: quiet, not a second card */
details.depset { box-shadow: none; background: transparent; margin-top: 12px; }
details.depset > summary { padding: 6px 0; }
details.depset > div { padding: 0; }
.dialog .grid, .dialog .grid > * { min-width: 0; max-width: 100%; }
.dialog .endpoint code { overflow-x: auto; white-space: nowrap; min-width: 0; }
.dialog pre.code { overflow: auto; }

/* phone: a wide table becomes one card per row (each cell carries its own data-label), so no column is ever cut off */
@media (max-width: 640px) {
  .rtable.cards, .rtable.cards tbody { display: block; overflow: visible; }
  .rtable.cards thead { display: none; }
  .rtable.cards tr { display: grid; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .rtable.cards tr:last-child { border-bottom: 0; }
  .rtable.cards td, .rtable.cards td:first-child, .rtable.cards td:last-child { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 0; border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .rtable.cards td[data-label]::before { content: attr(data-label); flex: 0 0 auto; font: 400 10.5px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); text-align: left; }
  .rtable.cards td.acts { justify-content: flex-start; gap: 8px; padding-top: 6px; }
  .rtable.cards tbody tr:hover td { background: none; }
}

/* team page: the role select and Remove sit on one line, vertically centred on the person; a long email wraps instead of pushing them down */
.person > div:not(.row):not(.avatar) { min-width: 0; overflow-wrap: anywhere; }
.person > .row { flex: none; flex-wrap: nowrap; align-items: center; }
.person > .row .btn.sm { white-space: nowrap; }
@media (max-width: 420px) { .person { flex-wrap: wrap; } .person > .row { margin-left: 44px !important; } }

.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.warn a, .notice.err a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }  /* a link inside a coloured notice keeps the notice's own contrast */
.notice.warn b, .notice.err b { color: inherit; }

/* deployment endpoint: the whole address stays readable (it wraps) instead of ending in "…" */
.depinfo .endpoint code { white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }

/* phone: the nav strip wraps onto a second row so every item stays reachable; Light/Dark and Log out sit at the end (icons only) */
@media (max-width: 640px) {
  .side .themeseg { display: flex !important; order: 8; margin: 0 0 0 auto; padding: 2px; flex: none; background: var(--sunken); }
  .side .themeseg button { font-size: 0; gap: 0; width: 30px; height: 30px; padding: 0; justify-content: center; }
  .side .themeseg svg { width: 16px; height: 16px; }
  .side .logout { display: block !important; order: 9; margin: 0; }
  .side .logout .nav { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .side .logout .nav span { display: none; }
  .side .grow { display: none; }
}
@media (max-width: 760px) { .bgrid, .bgrid2 { grid-template-columns: minmax(0, 1fr); } }

/* labels: merged rows, merge dialog, the "More" menu never clips its text */
.lb-merged { margin-left: 8px; font-size: 11px; padding: 1px 8px; vertical-align: 1px; background: var(--sunken); color: var(--ink-2); }
.lb-mergelist { height: auto; width: 100%; padding: 4px; }
.lb-mergelist optgroup { font-style: normal; font-weight: 600; color: var(--ink-3); }
.lb-mergelist option { padding: 3px 8px; color: var(--ink); }
.lb-more { box-sizing: border-box; width: auto; height: 30px; min-width: 76px; padding: 0 24px 0 10px; line-height: normal; }

/* ---- How it works (/ka/help/) and the small "?" / "Why?" links that lead to it */
.help-q { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font: 600 14px/1 var(--sans, inherit); color: var(--ink-2); text-decoration: none; }
.help-q:hover, .help-q[aria-current] { background: var(--select); color: var(--ink); }
.help-q:focus-visible, .why-link:focus-visible, .help-toc a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.why-link { font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; margin-left: 6px; }
.why-link:hover { color: var(--ink); }
.help { max-width: 720px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.help-toc a { font-size: 13px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.help-toc a:hover { background: var(--select); color: var(--ink); }
.help-sec { margin-top: 16px; padding: 20px 22px; scroll-margin-top: 16px; }
.help-sec:target { box-shadow: 0 0 0 2px var(--teal); }
.help-sec .h2 { margin: 0 0 8px; }
.help-sec p { margin: 0 0 10px; line-height: 1.6; color: var(--ink-2); max-width: 66ch; }
.help-sec .help-why { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-2); }
.help-sec .help-why b { color: var(--ink); }
@media (max-width: 640px) { .help-sec { padding: 16px; } .top { position: relative; padding-right: 52px; } .help-q { position: absolute; right: 12px; top: 12px; } }

/* the Why link on a dark panel (Train's Ready box) needs a light colour to be read */
.readyp .why-link { color: #c4ccd3; } .readyp .why-link:hover { color: #fff; }

/* contrast: the graphite readiness panel (dark in both themes) uses light text; links on it are cyan; the drop zone's small print is not faded */
.readyp .small, .readyp small, .ci small, .readyp .fine { color: #a9b6bb !important; } /* !important: some of these carry an inline ink colour made for the light page */
.readyp a:not(.btn):not(.why-link) { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.dropc span[style], .dropc small { opacity: 1 !important; color: var(--ink-2); }
/* links that sit inside a sentence or list are underlined, so they are not told apart by colour alone */
.hl-find li a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
/* visually hidden, still read by screen readers */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 520px) { .lb-form .seg { grid-auto-flow: row; } .lb-form .seg button { border-left: 0; border-top: 1px solid var(--line); } .lb-form .seg button:first-child { border-top: 0; } }

/* Team: every dataset row has the toggle and the Delete button in the same columns */
.datarow { display: grid; grid-template-columns: minmax(0, 1fr) 216px 76px; column-gap: 12px; }  /* the name takes the room; the toggle and Delete columns are the same width on every row */
.datarow > div:first-child { min-width: 0; overflow-wrap: anywhere; grid-column: 1; }
.datacard { grid-column: 1 / -1; }  /* the whole width: the name, the toggle and Delete each get a column */
.datarow .dcols { display: contents; }
.datarow .dtoggle { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; justify-self: end; grid-column: 2; }
.datarow .dcols > button { grid-column: 3; justify-self: end; }
@media (max-width: 520px) { .datarow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; } .datarow > div:first-child { grid-column: 1 / -1; } .datarow .dtoggle { grid-column: 1; justify-self: start; } .datarow .dcols > button { grid-column: 2; } }

/* contrast on the dark panels (QA: "Why?" in the home hero 1.96:1, the Try-it grey text 3.0:1): every small link and grey line on a dark panel is at least 4.5:1 */
.dpanel .why-link, .nexthero .why-link { color: #c4ccd3; } .dpanel .why-link:hover, .nexthero .why-link:hover { color: #fff; }
.dpanel .faint, .dpanel .small.faint, .trycta .faint, .trycta span { color: #9aa4ac; }
.dpanel.ph .faint, .dpanel.ph .small.faint { color: var(--ink-3); } .dpanel.ph .why-link { color: var(--ink-2); } .dpanel.ph .dim { color: var(--ink-3); }
.bidverdict { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--cyan, #2aa); background: var(--sunken, transparent); border-radius: 6px; font-weight: 600; max-width: 62ch; }
