/* Direction B of the design canvas, built with FlairOS's tokens (packages/ui/tokens.css,
   light): violet brand, zinc-ish neutrals, 12px card radii, real shadows. Space Grotesk
   for numbers and headings, Geist for text, Geist Mono for eyebrow labels. */
:root {
  --s0: oklch(0.99 0.002 285); --s1: oklch(0.975 0.004 285); --s2: oklch(0.955 0.005 285);
  --border: oklch(0.895 0.008 285); --border-sub: oklch(0.94 0.006 285);
  --t1: oklch(0.18 0.015 285); --t2: oklch(0.48 0.016 285); --tm: oklch(0.55 0.015 285);
  --brand: oklch(0.5 0.24 285); --brand-bright: oklch(0.52 0.22 280);
  --ok: oklch(0.52 0.1 162); --ok-acc: oklch(0.62 0.12 162); --warn: oklch(0.55 0.1 72); --bad: oklch(0.55 0.16 25);
  --sh-sm: 0 1px 2px oklch(0.18 0.015 285 / 0.06); --sh-md: 0 4px 12px oklch(0.18 0.015 285 / 0.08);
  --display: "Space Grotesk", system-ui, sans-serif; --body: "Geist", "Inter", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  --pixel: "Departure Mono", "Geist Mono", ui-monospace, monospace;  /* the brand's pixel accent: labels, chips, stats */
  --ok-wash: oklch(0.62 0.12 162 / 0.10); --bad-wash: oklch(0.55 0.16 25 / 0.10); --warn-wash: oklch(0.55 0.1 72 / 0.10);
}
@font-face { font-family: "Departure Mono"; src: url("/static/fonts/DepartureMono-Regular.woff2") format("woff2"); font-display: swap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--t1); font: 14px/1.4 var(--body); -webkit-font-smoothing: antialiased; }
body { background:
  linear-gradient(oklch(0.18 0.015 285 / 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(90deg, oklch(0.18 0.015 285 / 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
  var(--s0); }
.frame { max-width: 1440px; margin: 0 auto; padding: 18px 24px 16px; display: flex; flex-direction: column; gap: 14px; min-height: 100vh; }
.eyebrow { font-family: var(--pixel); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tm); }
.fine { font-size: 12px; color: var(--tm); }
.dim { color: var(--tm); font-weight: 400; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
hr { border: 0; border-top: 1px solid var(--border-sub); margin: 0; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ident { display: flex; align-items: center; gap: 14px; }
.mark { width: 40px; height: 40px; border-radius: 10px; background: var(--t1); color: #fff; display: grid; place-items: center; font: 700 14px var(--display); letter-spacing: .04em; }
.title { font: 700 20px/1.2 var(--display); }
.sub { font-size: 13px; color: var(--tm); }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font: 12px var(--pixel); color: var(--t2); white-space: nowrap; box-shadow: var(--sh-sm); }
.chip .dot { width: 7px; height: 7px; border-radius: 1px; background: var(--tm); display: inline-block; }  /* a pixel, not a dot */
.chip.good .dot { box-shadow: 0 0 0 3px oklch(0.62 0.12 162 / 0.18); }
.chip.good { color: var(--ok); } .chip.good .dot { background: var(--ok-acc); }
.chip.bad { color: var(--bad); } .chip.bad .dot { background: var(--bad); }
.chip.warn { color: var(--warn); } .chip.warn .dot { background: var(--warn); }
.chip.lang { cursor: pointer; font-weight: 500; color: var(--t1); }
.chip.lang:hover { border-color: oklch(0.8 0.01 285); }
.chip.brand { color: var(--brand-bright); border-color: oklch(0.86 0.06 285); background: oklch(0.985 0.008 285); }

/* signal ribbon */
.ribbon { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.signal { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.signal:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
.signal svg.spark { position: absolute; right: 8px; bottom: 6px; width: 34%; height: 26px; opacity: .55; pointer-events: none; }
.signal svg.spark path { fill: none; stroke: var(--brand-bright); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.signal svg.spark path.area { fill: oklch(0.52 0.22 280 / 0.08); stroke: none; }
.signal.hot svg.spark path { stroke: var(--bad); }
:root { --ease: cubic-bezier(0.16, 1, 0.3, 1); }
.num { display: flex; align-items: baseline; gap: 5px; }
.num .v { font: 700 26px/1.05 var(--display); font-variant-numeric: tabular-nums; color: var(--t1); transition: color .25s; }
.num .u { font-size: 12px; color: var(--tm); }
.signal.hot .v { color: var(--bad); }

/* main grid */
.main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; flex-grow: 1; }
.col { display: flex; flex-direction: column; gap: 14px; }
.card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--sh-md); display: flex; flex-direction: column; gap: 14px; }
/* the pixel-corner detail (design doc: pixel accents, ≈5% of a view): a 2px-unit mark top-right */
.card.marked::after { content: ""; position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; pointer-events: none;
  background: conic-gradient(from 90deg at 50% 50%, var(--brand) 25%, transparent 0) 0 0 / 5px 5px; opacity: .6; }
.verdict-card { flex-grow: 1; transition: background .5s; }
.verdict-card.ok { background: linear-gradient(160deg, var(--ok-wash), #fff 55%); border-color: oklch(0.8 0.08 162); }
.verdict-card.worn { background: linear-gradient(160deg, var(--bad-wash), #fff 55%); border-color: oklch(0.8 0.1 25); }
.verdict-card.wait { background: linear-gradient(160deg, var(--warn-wash), #fff 55%); }
.verdict { display: flex; align-items: baseline; gap: 18px; min-height: 104px; }
.big { font: 700 104px/0.95 var(--display); letter-spacing: -.02em; color: var(--tm); transition: color .3s; }
.big.settle { animation: settle .55s var(--ease); }
@keyframes settle { 0% { transform: translateY(6px) scale(.96); opacity: 0; filter: blur(2px); } 100% { transform: none; opacity: 1; filter: none; } }
.verdict.ok .big { text-shadow: 0 8px 28px oklch(0.62 0.12 162 / 0.35); } .verdict.worn .big { text-shadow: 0 8px 28px oklch(0.55 0.16 25 / 0.35); }
.verdict.ok .big { color: var(--ok); } .verdict.worn .big { color: var(--bad); } .verdict.wait .big { color: var(--warn); font-size: 56px; }
.verdict-text { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.lead { font-size: 17px; font-weight: 500; }
.life { display: flex; flex-direction: column; gap: 8px; }
.bar { position: relative; height: 14px; border-radius: 7px; background: var(--s2); overflow: hidden;
  background-image: repeating-linear-gradient(90deg, oklch(0.18 0.015 285 / 0.10) 0 1px, transparent 1px 10%); }
.bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; left: var(--life, 0%); background: var(--t1); transition: left .4s; }
.fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: linear-gradient(90deg, var(--ok-acc), oklch(0.75 0.13 95), oklch(0.65 0.16 40)); transition: width .4s; }
.payload { margin: 0; padding: 10px 12px; background: var(--s1); border: 1px solid var(--border-sub); border-radius: 8px; font: 12px/1.5 var(--mono); color: var(--t2); white-space: pre-wrap; }
.inspect { gap: 10px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 8px; font: 500 15px var(--body); color: var(--t1); background: #fff; border: 1px solid var(--border); box-shadow: var(--sh-sm); cursor: pointer; transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.btn:hover { background: var(--s1); border-color: oklch(0.8 0.01 285); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-sm); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: oklch(0.99 0 0); box-shadow: 0 6px 18px oklch(0.5 0.24 285 / 0.28); }
.btn.primary:hover { background: var(--brand-bright); }
.btn.danger { color: var(--bad); border-color: oklch(0.85 0.06 25); }
.btn.danger:hover { background: oklch(0.98 0.01 25); }
.btn.grow { flex-grow: 1; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }

/* the embedded FlairOS card */
.flair { background:
  radial-gradient(420px 160px at 0% 0%, oklch(0.55 0.24 285 / 0.10), transparent 70%),
  repeating-linear-gradient(135deg, oklch(0.5 0.24 285 / 0.035) 0 2px, transparent 2px 14px),
  linear-gradient(180deg, oklch(0.985 0.008 285), #fff); border-color: oklch(0.86 0.06 285); box-shadow: var(--sh-md); }
.kv-big { transition: color .3s; }
.kv-big.training { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.flair-title { display: flex; align-items: center; gap: 8px; font: 700 15px var(--display); }
.flair-title svg rect { fill: var(--brand); }
.kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kv-big { font: 700 28px/1.1 var(--display); margin: 3px 0 2px; }
.kv-big.brand { color: var(--brand); }
.kv-big.training { color: var(--warn); } .kv-big.new { color: var(--ok); }
.kv-mid { font: 700 18px/1.1 var(--display); margin: 3px 0 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--s1); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.switch-row > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.switch-label { font-size: 15px; font-weight: 500; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .knob { position: absolute; inset: 0; border-radius: 13px; background: oklch(0.8 0.01 285); transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: transform .2s; box-shadow: var(--sh-sm); }
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(18px); }

/* activity */
.activity { flex-grow: 1; }
.activity ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.activity li { display: grid; grid-template-columns: 62px 74px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-sub); font-size: 13px; }
.activity .t { font: 12px var(--mono); color: var(--tm); }
.activity .k { font: 10px var(--pixel); text-transform: uppercase; letter-spacing: .04em; color: var(--t2); padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--s1); align-self: start; white-space: nowrap; }
.activity li:first-child { animation: rowin .4s var(--ease); }
@keyframes rowin { from { background: oklch(0.55 0.24 285 / 0.08); } to { background: transparent; } }
.activity li.flairos .k, .activity li.model .k { color: var(--brand-bright); border-color: oklch(0.86 0.06 285); background: oklch(0.985 0.008 285); }
.activity li.error .k { color: var(--bad); border-color: oklch(0.85 0.06 25); }

/* demo strip */
.demo { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed oklch(0.8 0.01 285); border-radius: 10px; background: oklch(0.975 0.004 285 / 0.7); flex-wrap: wrap; }
.demo .right { margin-left: auto; }
.demo input[type=number] { width: 3.6em; font: inherit; color: var(--t2); background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }
.demo label { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1000px) { .ribbon { grid-template-columns: repeat(3, minmax(0, 1fr)); } .main { grid-template-columns: 1fr; } .big { font-size: 72px; } }

/* the inspection tray: one row per cut awaiting a label, label it on its own */
.tray { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border-sub); padding-top: 10px; }
.tray-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tray-table th { text-align: left; font: 10px var(--pixel); text-transform: uppercase; letter-spacing: .04em; color: var(--tm); padding: 2px 6px 6px; }
.tray-table td { padding: 4px 6px; border-top: 1px solid var(--border-sub); font-family: var(--mono); color: var(--t2); }
.tray-table td.n { color: var(--t1); font-weight: 500; }
.tray-table td.act { display: flex; gap: 6px; justify-content: flex-end; }
.tray-table .btn.tiny { min-height: 30px; padding: 0 10px; font-size: 12px; gap: 5px; }
.tray-table .btn.tiny.good:hover { color: var(--ok); border-color: oklch(0.8 0.08 162); }
.tray-table .btn.tiny.bad:hover { color: var(--bad); border-color: oklch(0.85 0.06 25); }
.tray-scroll { max-height: 190px; overflow: auto; }
