/* Datum Link — styles. Vocabulary taken from the Datum 7 FS-01 instruments:
   anodized bodies with small corner radii, exposed Torx screws at the corners,
   near-black display glass in an aluminium bezel, segmented key rows with the
   caption top-left, dot-matrix numerals, Neue Haas Grotesk Display legends. */

:root {
  --sans: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #0b0c0d;
  --body: #151719;
  --body-2: #1b1e20;
  --line: #2a2d30;
  --line-2: #363a3e;
  --glass: #070808;
  --glass-teal: var(--glass); /* angle finder: same glass as the caliper and micrometer */
  --alu: #c8cbcd;
  --alu-2: #b3b7ba;
  --alu-hi: #dfe1e2;
  --key: #7f8488;
  --key-dark: #2a2d30;
  --text: #ecece8;
  --muted: #a6abaf;
  --dim: #767b7f;
  --ink: #0b0c0d;
  --lit: #f2f2ee;
  --unlit: rgba(255, 255, 255, 0.065);
  --ok: #3ccf8a;
  --ok-line: #2c6a4c;
  --out: #ff8a3d;
  --out-line: #7a4422;
  --well: #070808;
  --well-edge: inset 0 0 0 1px #000;
  --hover: #24272a;
  --key-hover: #33373a;
  --sel-bg: #c8cbcd;
  --sel-fg: #0b0c0d;
  --sel-sub: #3b3f42;
  --inv-bg: #c8cbcd;
  --inv-fg: #0b0c0d;
  --inv-sub: #2d3033;
  --fill: #f2f2ee;
  --bar: #c9ccce;
  --band: rgba(255, 255, 255, 0.045);
  --text-2: #d3d4d1;
  --mast: rgba(11, 12, 13, 0.92);
  --shell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 80px rgba(0, 0, 0, 0.45);
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --shell-screw: var(--screw);
  --draw: #c8cbcd;
  --draw-2: #8c9196;
  --draw-hid: #6b7074;
  --draw-hl: #f2f2ee;
  --draw-call: #1b1e20;
  --draw-call-text: #a6abaf;
  --chart-bar: #7c8287;
  --chart-last: #f2f2ee;
  --chart-zero: #55595d;

  /* radii, scaled from the kit: bodies ~3 mm on 56 mm, glass ~0.5 mm, carrier ~7 mm on 349 mm */
  --r-body: 10px;
  --r-carrier: 2.2%;
  --r-glass: 3px;
  --r-key: 3px;
  --r-key-end: 7px;

  --screw: radial-gradient(circle, #0b0c0d 0 1.4px, #55595d 1.9px 3.6px, #26292c 4px 4.8px, transparent 5.2px);
  --screw-alu: radial-gradient(circle, #3a3e42 0 1.4px, #9da1a4 1.9px 3.8px, #7c8084 4.2px 5px, transparent 5.4px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--text); opacity: 0.8; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0.04em; }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }
.big { font-size: 20px; margin: 8px 0 6px; }
.label { margin: 0 0 12px; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.kbd { display: inline-block; font-family: var(--sans); font-weight: 500; font-size: 0.82em; color: var(--sel-fg); background: var(--sel-bg); border-radius: var(--r-key); padding: 1px 7px 2px; letter-spacing: 0.02em; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--alu); color: var(--ink); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--focus, var(--alu-hi)); outline-offset: 2px; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--mast); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { display: inline-flex; gap: 3px; padding: 6px; border: 1.5px solid var(--text); border-radius: 5px; }
.brand__mark i { width: 4px; height: 4px; background: var(--text); border-radius: 1px; }
.brand__name { font-weight: 600; font-size: 17px; }
.brand__for { color: var(--muted); font-weight: 400; font-size: 15px; }
.masthead__nav { display: flex; gap: 6px 22px; flex-wrap: wrap; font-size: 15px; }
.masthead__nav a { text-decoration: none; color: var(--muted); padding: 8px 0; }
.masthead__nav a:hover { color: var(--text); }

/* ---------- intro ---------- */
.intro { padding-top: 72px; padding-bottom: 40px; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.intro__title { font-weight: 400; font-size: clamp(44px, 7.4vw, 104px); line-height: 0.98; letter-spacing: -0.025em; margin: 18px 0 34px; max-width: 18ch; text-wrap: balance; }
.intro__cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.intro__lede { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--text-2); max-width: 60ch; font-weight: 400; }
.intro__facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.intro__facts li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.intro__facts .mono { color: var(--dim); font-size: 12px; padding-top: 3px; }
.note { margin: 30px 0 0; font-size: 12px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- shell (the app window, an instrument body) ---------- */
.app-section { padding: 16px 0 72px; scroll-margin-top: 64px; }
.section, #app { scroll-margin-top: 64px; }
.shell {
  background: var(--body);
  border: 1px solid var(--line);
  border-radius: var(--r-body);
  padding: 28px 30px 30px;
  box-shadow: var(--shell-shadow);
  background-image: var(--shell-screw), var(--shell-screw), var(--shell-screw), var(--shell-screw);
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: 9px 9px, calc(100% - 9px) 9px, 9px calc(100% - 9px), calc(100% - 9px) calc(100% - 9px);
}
.shell__top { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 0 6px 18px; }
.shell__title { display: flex; flex-direction: column; gap: 4px; }
.shell__label { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; }
.shell__session { font-size: 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r-key-end); padding: 6px 11px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.chip--dim { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--dim); display: inline-block; }
.dot--on { background: var(--ok); border-color: var(--ok); }

/* ---------- keys: segmented rows like the instruments ---------- */
.keyrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.key {
  position: relative; text-align: left; border: 0; cursor: pointer;
  background: var(--key-dark); color: var(--text);
  border-radius: var(--r-key); min-height: 58px; padding: 8px 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  transition: background-color 0.12s, transform 0.06s;
}
.keyrow > .key:first-child { border-top-left-radius: var(--r-key-end); border-bottom-left-radius: var(--r-key-end); }
.keyrow > .key:last-child { border-top-right-radius: var(--r-key-end); border-bottom-right-radius: var(--r-key-end); }
.key:hover { background: var(--key-hover); }
.key:active { transform: translateY(1px); }
.key__cap { font-size: 17px; font-weight: 500; letter-spacing: 0.01em; }
.key__sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.key[aria-selected="true"] { background: var(--sel-bg); color: var(--sel-fg); }
.key[aria-selected="true"] .key__sub { color: var(--sel-sub); }
.keyrow--nav { margin-bottom: 24px; }

.key--dev { background: var(--key); color: var(--ink); min-height: 46px; padding: 6px 10px; }
.key--dev:hover { background: #8d9296; }
.key--dev .key__cap { font-size: 15px; }
.key--dev[disabled] { cursor: default; opacity: 0.75; }
.key--dev[disabled]:active { transform: none; }
.key--hot { background: var(--alu-hi); }
.key--hot:hover { background: #eceeef; }
.key--dev[aria-pressed="true"] { background: var(--alu-hi); }

/* ---------- views & grids ---------- */
.view[hidden] { display: none; }
.grid { display: grid; gap: 18px; }
.grid--kit { grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); }
.grid--3 { grid-template-columns: minmax(240px, 1fr) minmax(0, 1.35fr) minmax(280px, 1.05fr); }
.grid--inspect { grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); }
.grid--live { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
.grid--report { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.panel {
  background: var(--body-2); border: 1px solid var(--line); border-radius: var(--r-body);
  padding: 20px 22px; min-width: 0;
  box-shadow: var(--panel-shadow);
}
.panel--flush { padding: 14px; }
.panel--light { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.panel--light .label { color: var(--inv-sub); }
.panel--light .small { color: var(--inv-sub); }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; }
.panel__head .label { margin-bottom: 12px; }
.caption { margin: 12px 4px 2px; font-size: 14px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { border-radius: var(--r-key-end); padding: 11px 16px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; font-size: 15px; min-height: 44px; }
.btn:hover { border-color: var(--muted); }
.btn--light { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.btn--light:hover { filter: brightness(1.08); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- dot matrix ---------- */
.readout { display: flex; align-items: center; min-width: 0; }
.readout svg { display: block; height: auto; max-width: 100%; }
.readout--md svg { width: min(100%, 300px); }
.readout--xl svg { width: min(100%, 560px); }

/* display glass in an aluminium bezel */
.bezel {
  background: linear-gradient(180deg, #cdd0d2, #b7bbbe);
  border-radius: 12px; padding: 16px 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 14px 30px rgba(0, 0, 0, 0.35);
  background-image: var(--screw-alu), var(--screw-alu), var(--screw-alu), var(--screw-alu), linear-gradient(180deg, #cdd0d2, #b7bbbe);
  background-size: 12px 12px, 12px 12px, 12px 12px, 12px 12px, auto;
  background-repeat: no-repeat;
  background-position: 3px 3px, calc(100% - 3px) 3px, 3px calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), 0 0;
}
.display {
  background: var(--glass); border-radius: var(--r-glass);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 16px 16px; margin-bottom: 3px; min-height: 112px;
  box-shadow: inset 0 0 0 1px #000, inset 0 10px 24px rgba(255, 255, 255, 0.02);
}
.display--big { min-height: 200px; padding: 26px 24px; }
.legends { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #3c4044; font-weight: 500; }
.legends--r { text-align: right; }
.legends .on { color: var(--lit); }
.legends .out.on, .legends [data-lg="out"].on { color: var(--out); }
.instrument { min-width: 0; }
.instrument__head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin: 0 4px 10px; }
.instrument__head .label { margin: 0; }

.well { display: flex; align-items: flex-end; gap: 10px; background: var(--glass); border-radius: var(--r-glass); padding: 18px 16px; box-shadow: inset 0 0 0 1px #000; }
.unit { font-size: 15px; color: var(--lit); padding-bottom: 2px; }

/* gauge */
.gauge { position: relative; height: 44px; margin: 14px 0 6px; }
.gauge::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line-2); }
.gauge__band { position: absolute; left: 25%; width: 50%; top: 9px; height: 12px; background: rgba(60, 207, 138, 0.16); border-left: 2px solid var(--ok); border-right: 2px solid var(--ok); }
.gauge__zero { position: absolute; left: 50%; top: 8px; width: 1px; height: 14px; background: var(--dim); }
.gauge__needle { position: absolute; top: 2px; width: 3px; height: 26px; background: var(--fill); left: 55%; transform: translateX(-50%); transition: left 0.3s; border-radius: 1px; }
.gauge span { position: absolute; top: 28px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.gauge__l { left: 25%; } .gauge__c { left: 50%; } .gauge__r { left: 75%; }

/* ---------- kit / carrier ---------- */
.carrier { position: relative; border-radius: var(--r-carrier) / 3.5%; overflow: hidden; background: #d9dadb; }
.carrier img { width: 100%; }
.screen { position: absolute; background: var(--glass); border-radius: 2px; display: flex; align-items: center; justify-content: center; padding: 0; }
.screen svg { width: 84%; height: 66%; }
.screen--cal { left: 9.42%; top: 21.99%; width: 14.17%; height: 7.67%; }
.screen--mic { left: 31.25%; top: 48.29%; width: 11.88%; height: 10.96%; }
.screen--ang { left: 76.67%; top: 73.64%; width: 14.13%; height: 13.05%; }
.screen--teal { background: var(--glass-teal); }
.hot-layer { position: absolute; inset: 0; }
.hot {
  position: absolute; border: 0; background: transparent; cursor: pointer; border-radius: 6px;
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 0.15s, background-color 0.15s;
}
.hot:hover { background: rgba(11, 12, 13, 0.06); outline-color: rgba(11, 12, 13, 0.35); }
.hot[aria-pressed="true"] { outline-color: #0b0c0d; background: rgba(11, 12, 13, 0.05); }
.hot:focus-visible { outline-color: #0b0c0d; }
.hot__tag { position: absolute; left: 6px; top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; background: #0b0c0d; color: var(--lit); padding: 3px 6px; border-radius: 3px; opacity: 0; transition: opacity 0.15s; white-space: nowrap; pointer-events: none; }
.hot:hover .hot__tag, .hot[aria-pressed="true"] .hot__tag, .hot:focus-visible .hot__tag { opacity: 1; }

.kit-detail__name { font-size: 26px; font-weight: 400; margin: 6px 0 4px; letter-spacing: -0.01em; }
.kv { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv > div { background: var(--well); box-shadow: var(--well-edge); border-radius: var(--r-glass); padding: 10px 12px; }
.kv dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 4px 0 0; font-size: 15px; }
.battery { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.battery i { display: block; height: 100%; background: var(--fill); }

/* ---------- setup ---------- */
.file { display: flex; gap: 12px; align-items: center; background: var(--well); box-shadow: var(--well-edge); border-radius: var(--r-glass); padding: 12px 14px; margin-bottom: 18px; color: var(--muted); }
.file__name { color: var(--text); font-size: 15px; }
.featlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.feat { display: grid; grid-template-columns: 24px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 44px; border: 0; background: transparent; border-radius: var(--r-key); padding: 6px 10px; text-align: left; cursor: pointer; color: var(--text); }
.feat:hover { background: var(--hover); }
.feat[aria-current="true"] { background: var(--sel-bg); color: var(--sel-fg); }
.feat[aria-current="true"] .feat__id, .feat[aria-current="true"] .feat__inst { color: var(--sel-sub); }
.feat.is-off { color: var(--dim); }
.feat__id, .feat__inst { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.feat__box { width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; display: grid; place-items: center; }
.feat__box.on::after { content: ""; width: 8px; height: 8px; background: currentColor; border-radius: 1px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { width: 100%; min-width: 0; font: inherit; font-family: var(--mono); font-size: 15px; color: var(--text); background: var(--well); border: 1px solid var(--line-2); border-radius: var(--r-glass); padding: 10px 12px; min-height: 44px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-key-end); padding: 12px 14px; margin-top: 8px; }
.opt.is-pick { border-color: var(--text); background: var(--well); }
.opt__name { display: block; font-size: 16px; }
.opt__res { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.verdict { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.verdict--ok { color: var(--ok); }
.verdict--no { color: var(--out); }

.partwrap svg { width: 100%; height: auto; display: block; }
.partwrap--small { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 520px; }

/* ---------- inspect ---------- */
.progress { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; margin: 0 2px 18px; }
.progress__bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.progress__bar i { display: block; height: 100%; background: var(--fill); width: 66%; transition: width 0.3s; }
.tablewrap { overflow-x: auto; }
.sheet { width: 100%; min-width: 660px; border-collapse: separate; border-spacing: 0 3px; font-size: 15px; }
.sheet th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.sheet td { padding: 0 10px; height: 52px; }
.sheet td:first-child { border-radius: var(--r-key) 0 0 var(--r-key); }
.sheet td:last-child { border-radius: 0 var(--r-key) var(--r-key) 0; }
.sheet .n { font-family: var(--mono); font-size: 14px; }
.sheet .id, .sheet .sub { color: var(--muted); }
.sheet .id { font-family: var(--mono); font-size: 13px; }
.sheet .meas { font-weight: 600; }
.sheet tr.is-next td { background: var(--sel-bg); color: var(--sel-fg); }
.sheet tr.is-next .id, .sheet tr.is-next .sub { color: var(--sel-sub); }
.sheet tr.is-new td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--flash, rgba(242, 242, 238, 0.22)); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .sheet tr.is-new td { animation: none; } }
.badge { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; border-radius: var(--r-key); padding: 5px 8px; white-space: nowrap; }
.badge--ok { color: var(--ok); border: 1px solid var(--ok-line); }
.badge--out { color: var(--out); border: 1px solid var(--out-line); }
.badge--next { background: var(--sel-fg); color: var(--sel-bg); }
.badge--typed { color: var(--muted); border: 1px solid var(--line-2); }
.badge--queued { color: var(--muted); }

.log { margin-top: 18px; }
.log__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 30px; font-size: 14.5px; }
.log__list li { display: flex; gap: 12px; align-items: baseline; }
.log__list time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- live ---------- */
.bezel--big .display { min-height: 210px; }
.chart { height: 200px; position: relative; margin-top: 4px; }
.chart svg { width: 100%; height: 100%; display: block; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stats div { background: var(--well); box-shadow: var(--well-edge); border-radius: var(--r-glass); padding: 10px 12px; }
.stats span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stats strong { display: block; font-family: var(--mono); font-weight: 400; font-size: 18px; margin-top: 4px; }
.keymap { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.keymap li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.keymap .kbd { text-align: center; }

/* ---------- report ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 2px 18px; }
.report-head__title { margin: 0; font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.01em; }
.report-head__title span { color: var(--muted); }
.devchart { min-width: 620px; }
.devrow { display: grid; grid-template-columns: 36px 150px minmax(200px, 1fr) 80px 78px 70px; gap: 12px; align-items: center; min-height: 52px; border-bottom: 1px solid #25282b; font-size: 15px; }
.devrow--head { min-height: 0; padding-bottom: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; border-bottom-color: var(--line); }
.devrow .mono { font-size: 13.5px; }
.devbar { position: relative; height: 24px; margin-right: 16px; }
.devbar::before { content: ""; position: absolute; left: 25%; width: 50%; top: 0; bottom: 0; background: var(--band); border-left: 1px dashed var(--chart-zero); border-right: 1px dashed var(--chart-zero); }
.devbar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--chart-zero); }
.devbar i { position: absolute; top: 7px; height: 10px; border-radius: 2px; background: var(--bar); }
.devbar i.out { background: var(--out); }
.devscale { position: relative; display: block; height: 1.3em; margin-right: 16px; }
.devscale span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.devscale span:nth-child(1) { left: 0; transform: none; }
.devscale span:nth-child(2) { left: 25%; }
.devscale span:nth-child(4) { left: 75%; }
.devscale span:nth-child(5) { left: auto; right: 0; transform: none; }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-left: 8px; }
.sw--in { background: var(--bar); } .sw--out { background: var(--out); }
.res-ok { color: var(--ok); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.res-out { color: var(--out); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.res-pend { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.pair div { color: #121314; background: var(--pair, #f4f5f5); border-radius: var(--r-glass); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.pair strong { font-size: 22px; font-weight: 400; }
.pair .pair__dark { background: var(--ink); color: var(--lit); }
.pair .pair__dark span { color: #a6abaf; }
.panel--light .pair div:not(.pair__dark) span { color: #4b5054; }
.nocase { text-transform: none; letter-spacing: 0.02em; }
.radio { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-key-end); margin-top: 8px; cursor: pointer; font-size: 15px; }
.radio:has(input:checked) { border-color: var(--text); background: var(--well); }
.radio input { accent-color: var(--text); width: 17px; height: 17px; margin: 0; }

/* ---------- sections below ---------- */
.section { padding: 72px 24px 24px; border-top: 1px solid var(--line); }
.section__title { font-weight: 400; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; letter-spacing: -0.02em; margin: 14px 0 16px; max-width: 22ch; }
.section__lede { color: var(--text-2); font-weight: 400; font-size: 18px; max-width: 64ch; margin: 0 0 34px; }
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 26px; }
.state .bezel { padding: 12px; }
.state .display { min-height: 96px; padding: 12px 14px; margin-bottom: 0; }
.state .display.display--teal { background: var(--glass-teal); }
.state .display--teal .legends { color: #3c4044; }
.state h3 { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 16px 2px 4px; }
.state p { margin: 0 2px; font-size: 16px; }
.flow { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.flow li { background: var(--body-2); border-radius: var(--r-key); padding: 18px 18px 22px; box-shadow: var(--panel-shadow); }
.flow li:first-child { border-radius: var(--r-key-end) var(--r-key) var(--r-key) var(--r-key-end); }
.flow li:last-child { border-radius: var(--r-key) var(--r-key-end) var(--r-key-end) var(--r-key); }
.flow h3 { margin: 18px 0 10px; font-weight: 500; font-size: 22px; }
.flow p { margin: 0 0 8px; font-size: 15px; color: var(--text-2); }
.flow strong { font-weight: 600; color: var(--text); }
.flow__n { font-size: 12px; color: var(--muted); }

.footer { border-top: 1px solid var(--line); margin-top: 72px; }
.footer__row { display: flex; justify-content: space-between; gap: 12px 30px; flex-wrap: wrap; padding: 28px 24px 40px; font-size: 13.5px; color: var(--muted); }
.footer__row .mono { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid--3 > :last-child { grid-column: 1 / -1; }
  .grid--kit, .grid--inspect, .grid--live, .grid--report { grid-template-columns: minmax(0, 1fr); }
  .states { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flow li, .flow li:first-child, .flow li:last-child { border-radius: var(--r-body); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .brand__for { display: none; }
  .masthead__nav { gap: 4px 14px; font-size: 14px; }
  .masthead__nav a { padding: 4px 0; }
  .masthead__row { padding-top: 8px; padding-bottom: 8px; }
  .intro { padding-top: 44px; }
  .intro__cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .shell { padding: 18px 14px 20px; }
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .keyrow--nav { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; }
  .keyrow--nav > .key { border-radius: var(--r-key) !important; }
  .key { min-height: 52px; }
  .key__sub { display: none; }
  .states { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .progress { grid-template-columns: minmax(0, 1fr) auto; }
  .progress__bar { grid-column: 1 / -1; grid-row: 2; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields, .kv { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 56px 16px 16px; }
  .footer__row { padding: 24px 16px 32px; }
}

/* ---------- part drawing & chart (themeable) ---------- */
.pt-body { fill: none; stroke: var(--draw); stroke-width: 2; stroke-linejoin: round; }
.pt-tab { fill: none; stroke: var(--draw-2); stroke-width: 2; stroke-linejoin: round; }
.pt-hid { stroke: var(--draw-hid); stroke-width: 1.6; stroke-dasharray: 6 5; }
.pt-dim { stroke: var(--draw-2); stroke-width: 1.4; fill: none; }
.pt-dim.on { stroke: var(--draw-hl); stroke-width: 2.4; }
.pt-call circle { fill: var(--draw-call); stroke: var(--draw-2); stroke-width: 1.4; }
.pt-call text { fill: var(--draw-call-text); font-family: var(--mono); font-size: 13px; }
.pt-call.on circle { fill: var(--draw-hl); stroke: var(--draw-hl); }
.pt-call.on text { fill: var(--draw-call); }
.ch-band { fill: var(--ok); opacity: 0.08; }
.ch-lim { stroke: var(--ok-line); stroke-dasharray: 4 4; }
.ch-zero { stroke: var(--chart-zero); }
.ch-bar { fill: var(--chart-bar); }
.ch-bar.last { fill: var(--chart-last); }

/* ---------- theme switch ---------- */
.theme { display: inline-grid; grid-auto-flow: column; gap: 2px; }
.theme button { border: 0; cursor: pointer; font-size: 13px; padding: 6px 12px; min-height: 32px; background: var(--key-dark); color: var(--muted); border-radius: var(--r-key); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.theme button:first-child { border-radius: var(--r-key-end) var(--r-key) var(--r-key) var(--r-key-end); }
.theme button:last-child { border-radius: var(--r-key) var(--r-key-end) var(--r-key-end) var(--r-key); }
.theme button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-fg); }
.masthead__right { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }

/* ---------- DAY: anodized silver, like the kit itself ---------- */
:root[data-theme="day"] {
  --bg: #e4e5e5;
  --body: #cdd0d2;
  --body-2: #dadddf;
  --line: #b4b8bb;
  --line-2: #a3a8ac;
  --text: #121314;
  --text-2: #2b2e31;
  --muted: #4b5054;
  --dim: #63686c;
  --ok: #0a6239;
  --ok-line: #6fae8f;
  --out: #8f3f0a;
  --out-line: #d79a72;
  --well: #eceeef;
  --well-edge: inset 0 1px 2px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  --hover: #cfd2d4;
  --key-dark: #bcc0c3;
  --key-hover: #c7cbce;
  --sel-bg: #1a1c1e;
  --sel-fg: #f2f2ee;
  --sel-sub: #a6abaf;
  --inv-bg: #1a1c1e;
  --inv-fg: #f2f2ee;
  --inv-sub: #b9bdc0;
  --fill: #1a1c1e;
  --bar: #55595d;
  --band: rgba(0, 0, 0, 0.05);
  --mast: rgba(228, 229, 229, 0.92);
  --shell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 24px 60px rgba(0, 0, 0, 0.18);
  --panel-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  --shell-screw: var(--screw-alu);
  --draw: #2b2e31;
  --draw-2: #5d6266;
  --draw-hid: #858a8e;
  --draw-hl: #121314;
  --draw-call: #dadddf;
  --draw-call-text: #3b3f42;
  --chart-bar: #8a8f93;
  --chart-last: #121314;
  --chart-zero: #8a8f93;
  --flash: rgba(18, 19, 20, 0.12);
  --pair: #f6f7f7;
  --focus: #121314;
}
:root[data-theme="day"] .masthead { border-bottom-color: var(--line); }
:root[data-theme="day"] .key { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
:root[data-theme="day"] .chip { background: rgba(255, 255, 255, 0.25); }
:root[data-theme="day"] .bezel { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.16); }
:root[data-theme="day"] .carrier { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14); }
:root[data-theme="day"] .panel--flush { background: var(--body-2); }
:root[data-theme="day"] .theme button { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); color: var(--text-2); }
:root[data-theme="day"] .theme button[aria-pressed="true"] { color: var(--sel-fg); }
:root[data-theme="day"] .key__sub { color: #3b3f42; }
:root[data-theme="day"] .key[aria-selected="true"] .key__sub, :root[data-theme="day"] .key[aria-current="page"] .key__sub { color: var(--sel-sub); }
:root[data-theme="day"] .kbd { background: #1a1c1e; color: #f2f2ee; }
@media (max-width: 720px) { .masthead__right { gap: 8px 14px; } .theme button { padding: 5px 10px; } }

/* ---------- links to the demo ---------- */
.intro__cta { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-top: 30px; }
.intro__cta .btn { text-decoration: none; display: inline-flex; align-items: center; }
.masthead__nav a.navcta { color: var(--text); }

/* ---------- display glass: a sliver of reflection (all finishes) ---------- */
.display, .glass, .sk__glass, .well { position: relative; overflow: hidden; }
.screen { overflow: hidden; }
.display::after, .glass::after, .sk__glass::after, .well::after, .screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 0 34%, rgba(255, 255, 255, 0.055) 34.4% 41%, rgba(255, 255, 255, 0.014) 41.4% 58%, rgba(255, 255, 255, 0) 58.4%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.036) 0, rgba(255, 255, 255, 0) 28%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.display > *, .glass > * { position: relative; }

/* ---------- on-instrument states: glass only, no bezel or screws ---------- */
.state .bezel { background: none; padding: 0; box-shadow: none; border-radius: 6px; }
:root[data-theme="day"] .state .bezel { box-shadow: none; }
.state .display { border-radius: 6px; min-height: 110px; padding: 16px 18px; }
:root[data-theme="day"] .state .display { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); }

/* ---------- prototype window: fixed height so tabs don't jump ---------- */
@media (min-width: 1101px) {
  .partwrap--small { max-width: 360px; }
  .view { height: var(--view-h, 800px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 4px; }
}
