/*
 * ReadyKit Edge operator console.
 *
 * Visual language: DESIGN.md at the repo root - Linear's system, vendored from
 * VoltAgent/awesome-design-md, plus the verdict semantics defined in the
 * ReadyKit extension section.
 *
 * Token names below map one-to-one onto that document.
 */

/* `hidden` must win over any class that sets display. Without this, a
 * `.airgap { display: inline-flex }` pill marked hidden still renders - which
 * is how a scripted console would show a "live camera" badge it does not have. */
[hidden] { display: none !important; }

:root {
  /* Surface ladder - canvas through surface-4, carrying hierarchy with no shadow */
  --canvas: #010102;
  --surface-1: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --surface-4: #191a1b;

  --hairline: #23252a;
  --hairline-strong: #34343a;
  --hairline-tertiary: #3e3e44;

  --ink: #f7f8f8;
  --ink-muted: #d0d6e0;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;

  --primary: #5e6ad2;
  --primary-hover: #828fff;

  /* ReadyKit extension: one colour per Verdict, used nowhere else */
  --verdict-pass: #27a644;
  --verdict-fail: #e5484d;
  --verdict-hold: #e2a336;
  --verdict-stale: #8a8f98;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo,
    monospace;

  color-scheme: dark;
}

/* The console is a fixed-purpose instrument on a dark canvas. It does not
 * follow the viewer's theme - a light-mode wall display would wash out the
 * verdict colours that the whole screen exists to communicate. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.05px;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

/* ------------------------------------------------------------------ header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-lg);
}

.brand { display: flex; align-items: center; gap: var(--space-sm); }

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}

.brand__mark svg { width: 15px; height: 15px; display: block; }

.brand__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand__manifest {
  font-size: 13px;
  color: var(--ink-subtle);
  font-weight: 400;
}

.masthead__right { display: flex; align-items: center; gap: var(--space-sm); }

/* Eyebrow: positive tracking, per the design language - it marks taxonomy
 * against the negative-tracked display type. */
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--ink-subtle);
  text-transform: uppercase;
}

/* ------------------------------------------------------------- air-gap pill */

.airgap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  font-size: 12px;
  color: var(--ink-subtle);
  font-family: var(--mono);
  white-space: nowrap;
}

.airgap::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdict-pass);
  flex: none;
}

.airgap[data-ok="false"] {
  color: var(--verdict-fail);
  border-color: color-mix(in srgb, var(--verdict-fail) 45%, transparent);
}

.airgap[data-ok="false"]::before { background: var(--verdict-fail); }

/* ----------------------------------------------------------------- verdict */

.verdict {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.verdict[data-verdict="pass"] {
  border-color: color-mix(in srgb, var(--verdict-pass) 30%, transparent);
  background: color-mix(in srgb, var(--verdict-pass) 7%, var(--surface-1));
}
.verdict[data-verdict="fail"] {
  border-color: color-mix(in srgb, var(--verdict-fail) 30%, transparent);
  background: color-mix(in srgb, var(--verdict-fail) 7%, var(--surface-1));
}
.verdict[data-verdict="indeterminate"] {
  border-color: color-mix(in srgb, var(--verdict-hold) 30%, transparent);
  background: color-mix(in srgb, var(--verdict-hold) 7%, var(--surface-1));
}

.verdict__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* display-md: 40px / 600 / -1.0px tracking */
.verdict__word {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 0;
  color: var(--ink-subtle);
}

.verdict[data-verdict="pass"] .verdict__word { color: var(--verdict-pass); }
.verdict[data-verdict="fail"] .verdict__word { color: var(--verdict-fail); }
.verdict[data-verdict="indeterminate"] .verdict__word { color: var(--verdict-hold); }

.verdict__latch {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-subtle);
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  white-space: nowrap;
}

.verdict__latch[data-latch="released"] {
  color: var(--verdict-pass);
  border-color: color-mix(in srgb, var(--verdict-pass) 40%, transparent);
}

.verdict__reason {
  margin: var(--space-sm) 0 0;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.1px;
  color: var(--ink-muted);
}

.verdict__meta {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-tertiary);
}

.verdict__meta b { color: var(--ink-subtle); font-weight: 400; }

.warn {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--verdict-fail) 40%, transparent);
  background: color-mix(in srgb, var(--verdict-fail) 10%, transparent);
  color: var(--ink);
  font-size: 14px;
}

/* -------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

.panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  padding: var(--space-lg);
  min-width: 0;
}

.panel__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin: 0 0 var(--space-md);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.panel__count { font-family: var(--mono); font-size: 12px; color: var(--ink-tertiary); }

/* --------------------------------------------------------------- checklist */

.checklist { list-style: none; margin: 0; padding: 0; }

.item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.item + .item { margin-top: 2px; }

.item[data-blamed="true"] {
  border-color: color-mix(in srgb, var(--verdict-fail) 35%, transparent);
  background: color-mix(in srgb, var(--verdict-fail) 9%, transparent);
}

.item[data-unresolved="true"] {
  border-color: color-mix(in srgb, var(--verdict-hold) 30%, transparent);
  background: color-mix(in srgb, var(--verdict-hold) 7%, transparent);
}

/* The glyph is not decorative. Colour is never the only signal for a state -
 * an operator with a colour vision deficiency reads this column and the
 * presence label instead. */
.item__glyph {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--ink-tertiary);
}

.item[data-presence="found"] .item__glyph { color: var(--verdict-pass); }
.item[data-presence="absent"] .item__glyph { color: var(--verdict-fail); }
.item[data-presence="damaged"] .item__glyph { color: var(--verdict-fail); }
.item[data-presence="unreadable"] .item__glyph,
.item[data-presence="unreported"] .item__glyph { color: var(--verdict-hold); }

/* Expiry overrides the presence colour. The item IS present - that is the
 * whole point - so a green glyph beside an expired date would be a lie. */
.item[data-expired="true"] .item__glyph,
.item[data-short="true"] .item__glyph { color: var(--verdict-fail); }

/* Counted-against-required. Red when short, amber when the count could not be
   taken - the same three-state language the verdict itself uses. */
.item__label small[data-state="short"] { color: var(--verdict-fail); font-weight: 500; }
.item__label small[data-state="unknown"] { color: var(--verdict-hold); }

.item__expiry {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 78px;
  text-align: right;
  color: var(--ink-tertiary);
}

.item__expiry[data-state="expired"] { color: var(--verdict-fail); font-weight: 700; }
.item__expiry[data-state="soon"] { color: var(--verdict-hold); }
.item__expiry[data-state="unreadable"] { color: var(--verdict-hold); }
.item__expiry[data-state="none"] { min-width: 0; }

.item__label {
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item__label small {
  color: var(--ink-tertiary);
  font-size: 12px;
  margin-left: 6px;
}

.item__presence {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-subtle);
  text-align: right;
}

/* Tabular numerals: confidences are read down a column and compared. */
.item__confidence {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-subtle);
  min-width: 62px;
  text-align: right;
}

.item__confidence[data-below-floor="true"] { color: var(--verdict-hold); }
.item__confidence[data-none="true"] { color: var(--ink-tertiary); }

/* --------------------------------------------------------------- telemetry */

.telemetry { display: grid; gap: var(--space-xs); }

.reading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 9px var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.reading__name {
  font-size: 13px;
  color: var(--ink-subtle);
}

.reading__value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading__value[data-tone="pass"] { color: var(--verdict-pass); }
.reading__value[data-tone="fail"] { color: var(--verdict-fail); }
.reading__value[data-tone="hold"] { color: var(--verdict-hold); }
.reading__value[data-tone="stale"] { color: var(--verdict-stale); }

.events {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  display: grid;
  gap: 3px;
  max-height: 132px;
  overflow-y: auto;
}

/* One line per event, truncated. Wrapped log lines clipped mid-word at the
 * scroll boundary read as a rendering fault rather than as a full buffer. */
.events > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- controls */

.controls {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn:hover:not(:disabled) { background: var(--surface-3); }

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* The single chromatic accent, on the one action that matters. */
.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.select {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  max-width: 260px;
}

.select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ------------------------------------------------------------------ ledger */

.ledger { margin-top: var(--space-lg); }

.tally {
  display: flex;
  gap: var(--space-lg);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-md);
}

.tally b { font-weight: 400; }
.tally .t-pass b { color: var(--verdict-pass); }
.tally .t-fail b { color: var(--verdict-fail); }
.tally .t-hold b { color: var(--verdict-hold); }

.records { width: 100%; border-collapse: collapse; font-size: 13px; }

.records th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  padding: 0 var(--space-sm) var(--space-xs);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.records td {
  padding: 9px var(--space-sm);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted);
  vertical-align: top;
}

.records tr:last-child td { border-bottom: none; }

.records .c-time,
.records .c-id { font-family: var(--mono); font-size: 12px; color: var(--ink-tertiary); white-space: nowrap; }

.records .c-reason { color: var(--ink-muted); }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tag[data-verdict="pass"] { color: var(--verdict-pass); }
.tag[data-verdict="fail"] { color: var(--verdict-fail); }
.tag[data-verdict="indeterminate"] { color: var(--verdict-hold); }

.empty {
  color: var(--ink-tertiary);
  font-size: 14px;
  padding: var(--space-lg) 0;
  text-align: center;
}

.scroll-x { overflow-x: auto; }

/* ------------------------------------------------------------------- rules */

.rule {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-tertiary);
  line-height: 1.6;
}

.rule b { color: var(--ink-subtle); font-weight: 500; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .verdict__word { font-size: 32px; letter-spacing: -0.8px; }
}

@media (max-width: 560px) {
  .shell { padding: var(--space-md) var(--space-md) var(--space-xl); }
  .verdict { padding: var(--space-md); }
  .panel { padding: var(--space-md); }
  .verdict__word { font-size: 28px; }
  .item { grid-template-columns: 20px minmax(0, 1fr) auto auto; }
  .item__presence { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------- blueprint comparison */

/* The original design's verdict on the same model reply. It sits inside the
 * verdict banner but is visibly subordinate to it - a footnote on the
 * decision, never a competing decision. Anything that read as a second live
 * verdict would be dangerous on this screen. */

.compare {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  border-left-width: 3px;
  background: var(--surface-2);
}

.compare[data-divergence="unsafe"] {
  border-color: var(--hairline);
  border-left-color: var(--verdict-fail);
  background: color-mix(in srgb, var(--verdict-fail) 8%, var(--surface-2));
}

.compare[data-divergence="spurious"] {
  border-left-color: var(--verdict-hold);
  background: color-mix(in srgb, var(--verdict-hold) 7%, var(--surface-2));
}

.compare[data-divergence="agreed"] {
  border-left-color: var(--hairline-tertiary);
}

.compare__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.compare__title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.compare__tag {
  font-size: 13px;
  color: var(--ink-tertiary);
}

.compare[data-divergence="unsafe"] .compare__tag {
  color: var(--verdict-fail);
  font-weight: 500;
}

.compare[data-divergence="spurious"] .compare__tag { color: var(--verdict-hold); }

.compare__signal {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-subtle);
  white-space: nowrap;
}

.compare[data-divergence="unsafe"] .compare__signal {
  color: var(--verdict-fail);
  border-color: color-mix(in srgb, var(--verdict-fail) 45%, transparent);
}

.compare__why {
  margin: var(--space-xs) 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* The model's verbatim words - what the two-substring match actually ran
 * against. Showing it is what keeps the comparison from looking rigged. */
.compare__quote {
  margin: var(--space-sm) 0 0;
  padding: var(--space-xs) var(--space-sm);
  border-left: 2px solid var(--hairline-strong);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-subtle);
}

@media (max-width: 560px) {
  .compare__signal { margin-left: 0; }
}

/* ------------------------------------------------------------------ camera */

.camera {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px minmax(0, 0.85fr);
  align-items: start;
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.camera__bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--hairline);
}

.camera__hint { margin: 0; font-size: 14px; color: var(--ink-muted); }

.camera__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.camera__pane { margin: 0; min-width: 0; }

.camera__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.camera__img,
.camera__empty {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
}

.camera__img { object-fit: contain; background: var(--canvas); }

/* The cloud demo has no physical camera to show. This moving illustration is
 * intentionally labelled as simulated rather than imitating a real frame. */
.demo-camera {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--hairline));
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 60% 45%, #1c2448 0, #101427 32%, #060710 74%);
}

.demo-camera__label,
.demo-camera__status {
  position: absolute;
  z-index: 3;
  top: 12px;
  padding: 4px 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--canvas) 72%, transparent);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .8px;
}
.demo-camera__label { left: 12px; color: #b7c0ff; }
.demo-camera__status { right: 12px; color: var(--verdict-pass); }
.demo-camera__status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: demo-camera-blink 1.2s steps(2, start) infinite;
}
.demo-camera__grid {
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(#97a6ff 1px, transparent 1px),
    linear-gradient(90deg, #97a6ff 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(280px) rotateX(55deg) scale(1.35) translateY(21%);
  transform-origin: center bottom;
}
.demo-camera__kit {
  position: absolute;
  left: 22%;
  top: 33%;
  width: 56%;
  height: 42%;
  border: 1px solid color-mix(in srgb, var(--primary-hover) 70%, transparent);
  border-radius: 12px;
  background: linear-gradient(145deg, #252c52, #10142a);
  box-shadow: 0 18px 30px rgb(0 0 0 / 38%);
  animation: demo-camera-float 3.6s ease-in-out infinite;
}
.demo-camera__item { position: absolute; display: block; }
.demo-camera__item--case {
  left: 11%; top: 25%; width: 30%; height: 48%;
  border: 2px solid #9ca9ff; border-radius: 5px;
}
.demo-camera__item--seal {
  right: 13%; top: 20%; width: 21%; height: 25%;
  border-radius: 50%; background: #5ad6e7;
  box-shadow: 0 0 18px rgb(90 214 231 / 44%);
}
.demo-camera__item--shears {
  right: 15%; bottom: 19%; width: 32%; height: 3px;
  transform: rotate(-29deg); background: #e2a336;
}
.demo-camera__item--shears::after {
  content: ""; position: absolute; left: 55%; top: -9px; width: 3px; height: 21px;
  transform: rotate(58deg); background: inherit;
}
.demo-camera__item--gauze {
  left: 45%; bottom: 15%; width: 19%; height: 25%;
  border-radius: 4px; background: #e9efff;
  transform: rotate(9deg); opacity: .9;
}
.demo-camera__sweep {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  height: 2px;
  background: #8d9aff;
  box-shadow: 0 0 18px 5px rgb(141 154 255 / 35%);
  animation: demo-camera-scan 2.8s ease-in-out infinite;
}
.demo-camera__corner {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-color: #9ca9ff;
  border-style: solid;
}
.demo-camera__corner--tl { left: 14px; top: 42px; border-width: 2px 0 0 2px; }
.demo-camera__corner--br { right: 14px; bottom: 14px; border-width: 0 2px 2px 0; }
@keyframes demo-camera-scan {
  0%, 100% { top: 20%; opacity: .3; }
  50% { top: 80%; opacity: 1; }
}
@keyframes demo-camera-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}
@keyframes demo-camera-blink { 50% { opacity: .35; } }

.camera__empty {
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--space-md);
  text-align: center;
  font-size: 14px;
  color: var(--ink-tertiary);
  border-style: dashed;
  border-color: var(--hairline-strong);
}

/* One row per required item: a dot for what the model reported, the item,
 * and the reading. Coloured by the reading, not by the verdict. */
.seen { list-style: none; margin: var(--space-sm) 0 0; padding: 0; }

.seen__row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xs);
  padding: 7px 2px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.seen__row:last-child { border-bottom: 0; }
.seen__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-tertiary); }
.seen__name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seen__state { font-family: var(--mono); font-size: 12px; color: var(--ink-subtle); }

.seen__row[data-presence="found"] .seen__dot { background: var(--verdict-pass); }
.seen__row[data-presence="absent"] .seen__dot,
.seen__row[data-presence="damaged"] .seen__dot { background: var(--verdict-fail); }
.seen__row[data-presence="unreadable"] .seen__dot,
.seen__row[data-presence="unreported"] .seen__dot { background: var(--verdict-hold); }
.seen__row[data-presence="set-aside"] .seen__dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink-tertiary);
}
.seen__row[data-presence="set-aside"] .seen__name { color: var(--ink-subtle); }

.camera__status {
  margin: var(--space-sm) 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-subtle);
}

.camera__status:empty { display: none; }

.auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-subtle);
  cursor: pointer;
}

/* The verbatim reply is evidence, not reading material: three lines until
 * someone asks for the rest. */
.compare__quote {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.compare__quote.is-open { display: block; }

/* ------------------------------------------------------ hold still to inspect */

.camera__frame { position: relative; }

.hold {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  backdrop-filter: blur(6px);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

.hold__ring { width: 28px; height: 28px; transform: rotate(-90deg); }
.hold__ring circle { fill: none; stroke: var(--hairline-strong); stroke-width: 4; }
.hold__ring .hold__arc {
  stroke: var(--primary-hover);
  stroke-linecap: round;
  stroke-dasharray: 106.8;
  stroke-dashoffset: 106.8;
  transition: stroke-dashoffset 200ms linear;
}

/* ------------------------------------------------------------- result mark */

.result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: start;
  margin-top: var(--space-sm);
}

.result .seen { margin: 0; }

.mark { width: 44px; height: 44px; display: block; }
.mark[data-state="none"] { visibility: hidden; }
.mark svg { width: 100%; height: 100%; overflow: visible; }
.mark__ring { fill: none; stroke-width: 3; stroke: var(--hairline-strong); }
.mark__glyph {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  display: none;
}

/* Judging: a running arc, until the model answers. */
.mark[data-state="judging"] .mark__ring {
  stroke: var(--primary-hover);
  stroke-dasharray: 30 77;
  transform-origin: 20px 20px;
  animation: mark-spin 900ms linear infinite;
}

/* The mark says what the verdict says - never a tick on a kit that did not
 * pass. The glyph draws itself in once the answer lands. */
.mark[data-state="pass"] .mark__ring { stroke: var(--verdict-pass); }
.mark[data-state="fail"] .mark__ring { stroke: var(--verdict-fail); }
.mark[data-state="indeterminate"] .mark__ring { stroke: var(--verdict-hold); }
.mark[data-state="pass"] .mark__pass { display: block; stroke: var(--verdict-pass); }
.mark[data-state="fail"] .mark__fail { display: block; stroke: var(--verdict-fail); }
.mark[data-state="indeterminate"] .mark__hold { display: block; stroke: var(--verdict-hold); }
.mark[data-state="pass"] .mark__glyph,
.mark[data-state="fail"] .mark__glyph,
.mark[data-state="indeterminate"] .mark__glyph { animation: mark-draw 450ms ease-out forwards; }

@keyframes mark-spin { to { transform: rotate(360deg); } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mark[data-state="judging"] .mark__ring { animation-duration: 2400ms; }
  .mark__glyph { animation: none !important; stroke-dashoffset: 0; }
}

/* ------------------------------------------- captured -> arrow -> recognised */

.flow { align-self: center; margin-top: 24px; }
.flow svg { width: 56px; height: 24px; overflow: visible; }
.flow[data-state="none"] { visibility: hidden; }
.flow path { fill: none; stroke: var(--hairline-strong); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Running while the model works: dashes travel towards the result. */
.flow[data-state="running"] path { stroke: var(--primary-hover); }
.flow[data-state="running"] .flow__line { stroke-dasharray: 6 6; animation: flow-run 600ms linear infinite; }
.flow[data-state="running"] .flow__head { animation: flow-pulse 1200ms ease-in-out infinite; }
.flow[data-state="done"] path { stroke: var(--ink-subtle); }

@keyframes flow-run { to { stroke-dashoffset: -12; } }
@keyframes flow-pulse { 50% { opacity: 0.35; } }

.result-card__body {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  /* Same height as the frames beside it; grows if the readings need more. */
  aspect-ratio: 3 / 2;
}

.result-card__head { display: flex; align-items: center; gap: var(--space-sm); }

.result-card__names {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.result-card__names[data-muted="true"] { font-size: 18px; font-weight: 500; color: var(--ink-subtle); }

.result-card .seen { margin-top: var(--space-md); }

@media (max-width: 1000px) {
  .camera { grid-template-columns: minmax(0, 1fr); }
  .flow { justify-self: center; margin: 0; transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flow[data-state="running"] path { animation: none; }
}

/* Records: the date and id never wrap; the reason and the command do, so a
 * long "observed only - the sentinel owns actuation" cannot push the id out
 * of view. */
.records .c-cmd { font-family: var(--mono); font-size: 12px; color: var(--ink-tertiary); overflow-wrap: anywhere; }
.records .c-time { white-space: nowrap; }
.records .c-clock { color: var(--ink-subtle); margin-top: 2px; }
.records .c-reason { min-width: 180px; }
