/* =========================================================================
   Modules — Guided Capture · SPIKE demo (sibling of motor-fraud-engine)
   Brand: teal #0E7C7B / amber #E08A00 / navy #0B1B2B / violet #6D4AFF
   Fonts: Hanken Grotesk (display) · IBM Plex Sans (UI) · IBM Plex Mono (data)
   Same token system as ../motor-fraud-engine/styles.css, light+dark variants.
   ========================================================================= */

:root {
  --teal: #0e7c7b;
  --teal-bright: #2dd4bf;
  --amber: #e08a00;
  --amber-bright: #fbbf24;
  --navy: #0b1b2b;
  --navy-deep: #0a0f1a;
  --violet: #6d4aff;

  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e3e8ec;
  --line-2: #edf1f3;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --surface-3: #eef2f4;

  --red: #c2410c;
  --red-soft: #fdede6;
  --amber-soft: #fbf2e2;
  --teal-soft: #e3f3f2;
  --violet-soft: #ece8ff;
  --green: #0a7a4d;
  --green-soft: #e3f5ec;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 27, 43, 0.06), 0 1px 3px rgba(11, 27, 43, 0.04);
  --shadow: 0 6px 24px rgba(11, 27, 43, 0.08), 0 2px 6px rgba(11, 27, 43, 0.05);
  --shadow-lg: 0 24px 60px rgba(11, 27, 43, 0.22);

  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'Hanken Grotesk', system-ui, sans-serif;

  font-feature-settings: 'tnum' 1;
}

/* Dark mode: default to prefers-color-scheme, override-able via [data-theme]. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e6edf4;
    --ink-2: #b7c5d4;
    --ink-3: #8294a6;
    --line: #22303e;
    --line-2: #1a2531;
    --surface: #101a26;
    --surface-2: #0b1420;
    --surface-3: #16212e;

    --red-soft: rgba(194, 65, 12, 0.16);
    --amber-soft: rgba(224, 138, 0, 0.14);
    --teal-soft: rgba(14, 124, 123, 0.18);
    --violet-soft: rgba(109, 74, 255, 0.18);
    --green-soft: rgba(10, 122, 77, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  }
}
[data-theme='dark'] {
  --ink: #e6edf4;
  --ink-2: #b7c5d4;
  --ink-3: #8294a6;
  --line: #22303e;
  --line-2: #1a2531;
  --surface: #101a26;
  --surface-2: #0b1420;
  --surface-3: #16212e;

  --red-soft: rgba(194, 65, 12, 0.16);
  --amber-soft: rgba(224, 138, 0, 0.14);
  --teal-soft: rgba(14, 124, 123, 0.18);
  --violet-soft: rgba(109, 74, 255, 0.18);
  --green-soft: rgba(10, 122, 77, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.15s, color 0.15s;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
button {
  font-family: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--teal-bright);
  outline-offset: 2px;
}
svg {
  display: block;
}

/* ============================= SHELL ============================= */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ascend {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}
.ascend path {
  fill: none;
  stroke-width: 6.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.asc-teal {
  stroke: var(--teal);
}
.asc-amber {
  stroke: var(--amber);
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.wordmark .sub {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 1px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spike-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a5b00;
  background: var(--amber-soft);
  border: 1px solid #efd9a8;
  padding: 5px 10px;
  border-radius: 999px;
}
[data-theme='dark'] .spike-pill,
@media (prefers-color-scheme: dark) {
  .spike-pill {
    color: var(--amber-bright);
  }
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.theme-toggle:hover {
  border-color: var(--teal);
  color: var(--ink);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 24px 60px;
}
.page {
  width: min(980px, 100%);
}

/* ============================= ABOUT BANNER ============================= */
.about-banner {
  display: flex;
  gap: 14px;
  background: linear-gradient(90deg, rgba(224, 138, 0, 0.08), rgba(109, 74, 255, 0.05));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.about-banner .ai {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--amber-soft);
  display: grid;
  place-items: center;
}
.about-banner .ai svg {
  width: 19px;
  height: 19px;
  stroke: var(--amber);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.about-banner h2 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.about-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.about-banner code {
  font-family: var(--mono);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.08s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: #0c6a69;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-amber {
  background: var(--amber);
  color: #fff;
}
.btn-amber:hover {
  background: #c87a00;
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}
.btn-wrap {
  white-space: normal;
  text-align: center;
}

/* ============================= STEPPER ============================= */
.stepper-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 22px;
}
.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.step-pill .sn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
}
.step-pill.done {
  border-color: #bfe3e1;
  background: var(--teal-soft);
  color: #0a5f5e;
}
.step-pill.done .sn {
  background: var(--teal);
  color: #fff;
}
.step-pill.cur {
  border-color: var(--teal);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.12);
}
.step-pill.cur .sn {
  background: var(--amber);
  color: #fff;
}
.step-sep {
  width: 14px;
  height: 1px;
  background: var(--line);
  flex: 0 0 auto;
}

.track-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.track-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.track-chip.vehicle {
  background: var(--teal-soft);
  color: #0a5f5e;
}
.track-chip.document {
  background: var(--violet-soft);
  color: var(--violet);
}

/* ============================= CAPTURE STAGE ============================= */
.capture-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.capture-main h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  margin: 2px 0 4px;
  letter-spacing: -0.01em;
}
.capture-hint {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0 0 16px;
}

.viewfinder {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #233242, #16202c),
    linear-gradient(180deg, #1c2a39, #10171f);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.viewfinder video,
.viewfinder canvas,
.viewfinder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.viewfinder .vf-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
.vf-badge.good {
  background: rgba(10, 122, 77, 0.85);
  color: #fff;
}
.vf-badge.bad {
  background: rgba(194, 65, 12, 0.9);
  color: #fff;
}
.vf-badge.idle {
  background: rgba(255, 255, 255, 0.12);
  color: #e6edf4;
}
.viewfinder .vf-metric {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 11px;
  color: #cbd7e2;
  background: rgba(10, 15, 26, 0.6);
  padding: 4px 9px;
  border-radius: 7px;
}
.viewfinder.sharp {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.5) inset;
}
.viewfinder.blurry {
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.6) inset;
}
.vf-empty {
  color: #8294a6;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  z-index: 2;
}
.vf-empty svg {
  width: 32px;
  height: 32px;
  stroke: #596e82;
  fill: none;
  stroke-width: 1.6;
  margin: 0 auto 10px;
}
.vf-empty-cta {
  margin-top: 6px;
  font-size: 12px;
  color: #aebbc9;
}
.vf-empty-cta strong {
  color: #e6edf4;
}

.sim-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin-bottom: 14px;
}
.sim-hint svg {
  width: 15px;
  height: 15px;
  stroke: var(--amber);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.sim-hint b {
  color: var(--ink);
}

.capture-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.file-fallback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.file-fallback input[type='file'] {
  font-size: 12.5px;
  max-width: 220px;
  color: var(--ink-2);
}

.capture-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side-steps {
  display: grid;
  gap: 2px;
}
.side-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.side-step .cn {
  font-family: var(--mono);
  font-size: 10.5px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.side-step.done {
  color: var(--ink-2);
}
.side-step.done .cn {
  background: var(--teal-soft);
  color: #0a5f5e;
}
.side-step.cur {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}
.side-step.cur .cn {
  background: var(--amber);
  color: #fff;
}
.side-step.optional .ot {
  font-size: 10px;
  color: var(--ink-3);
  margin-left: auto;
  font-style: italic;
}

.thumb-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.thumb {
  width: 48px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.thumb.done {
  border-color: var(--teal);
}
.thumb.done::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  background: rgba(14, 124, 123, 0.12);
}

/* ============================= MODE PICKER (consent-like) ============================= */
.consent-card {
  padding: 32px;
  max-width: 560px;
  margin: 0 auto;
}
.consent-card .cicon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--teal-soft);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.consent-card .cicon svg {
  width: 28px;
  height: 28px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.consent-card h2 {
  font-family: var(--display);
  font-size: 21px;
  margin: 0 0 8px;
}
.consent-card p {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 18px;
}
.consent-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 11px;
}
.consent-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.consent-list svg {
  width: 17px;
  height: 17px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ============================= INTRO / SUBMITTED ============================= */
.cicon.good {
  background: var(--green-soft);
}
.cicon.good svg {
  stroke: var(--green);
}
.claim-chip {
  display: inline-flex;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.submitted-note {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}
.submitted-note p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.submitted-note svg {
  width: 15px;
  height: 15px;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.8;
  flex: 0 0 auto;
  margin-top: 1px;
}
.submitted-note code {
  font-family: var(--mono);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ============================= REVIEW & SUBMIT ============================= */
.review-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.review-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.review-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.review-thumb.done {
  border-color: var(--teal);
}
.review-thumb.gap svg {
  width: 20px;
  height: 20px;
  stroke: var(--amber);
  fill: none;
  stroke-width: 1.8;
}
.rt-label {
  font-size: 11.5px;
  color: var(--ink-2);
}
.ack-low {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 8px;
}

/* ============================= MODE TOGGLE ============================= */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.mode-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.mode-option:hover {
  border-color: var(--teal);
}
.mode-option.on {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.12);
}
.mode-option .mo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal-soft);
  display: grid;
  place-items: center;
}
.mode-option .mo-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-option h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.mode-option p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
}

/* ============================= VIDEO CAPTURE ============================= */
.video-stage-grid {
  display: grid;
  gap: 18px;
}
.video-drop {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #233242, #16202c), linear-gradient(180deg, #1c2a39, #10171f);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.video-drop video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.video-drop .vd-empty {
  color: #8294a6;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  z-index: 2;
}
.video-drop .vd-empty svg {
  width: 32px;
  height: 32px;
  stroke: #596e82;
  fill: none;
  stroke-width: 1.6;
  margin: 0 auto 10px;
}
.video-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  margin-bottom: 14px;
}
.scan-status .scan-count {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ink);
}
.progress-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line-2);
  overflow: hidden;
}
.progress-bar > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--teal);
  transform: scaleX(var(--pct, 0));
  transform-origin: left;
  transition: transform 0.15s;
}

.frame-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.frame-card {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}
.frame-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-card .fc-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  color: #fff;
  background: rgba(10, 15, 26, 0.72);
  padding: 3px 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.frame-card .fc-score {
  position: absolute;
  top: 5px;
  right: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 122, 77, 0.85);
  padding: 2px 6px;
  border-radius: 999px;
}

.coverage-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.coverage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.coverage-row.ok {
  color: var(--ink-2);
}
.coverage-row.gap {
  border-color: #efd9a8;
  background: var(--amber-soft);
  color: #9a5b00;
}
.coverage-row svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.coverage-row .cr-score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  opacity: 0.8;
}
.coverage-row button {
  margin-left: auto;
}

/* ============================= VERIFICATION PANELS ============================= */
.v-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-note {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: -6px 0 14px;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
}
.field-table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.field-table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  vertical-align: middle;
}
.field-table tbody tr:last-child td {
  border-bottom: 0;
}
.field-name {
  font-weight: 600;
  color: var(--ink);
}
.field-val {
  font-family: var(--mono);
  color: var(--ink-2);
}
.conf-bar {
  width: 70px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-2);
  overflow: hidden;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.conf-bar > i {
  display: block;
  height: 100%;
}
.conf-pct {
  font-family: var(--mono);
  font-size: 12px;
}
.conf-ok .conf-pct {
  color: var(--green);
}
.conf-ok > i {
  background: var(--green);
}
.conf-low .conf-pct {
  color: var(--red);
}
.conf-low > i {
  background: var(--red);
}

.match-panel {
  padding: 18px;
}
.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.match-row:last-child {
  border-bottom: 0;
}
.match-row .mk {
  font-size: 12.5px;
  color: var(--ink-3);
}
.match-row .mv {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
}
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  margin-top: 10px;
}
.match-badge svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.match-badge.ok {
  background: var(--green-soft);
  color: var(--green);
}
.match-badge.mismatch {
  background: var(--red-soft);
  color: var(--red);
}

.scenario-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
}
.seg button.on {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Review queue */
.queue-list {
  display: grid;
  gap: 10px;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}
.queue-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--amber-soft);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.queue-icon svg {
  width: 18px;
  height: 18px;
  stroke: #9a5b00;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.queue-body {
  flex: 1;
  min-width: 0;
}
.queue-title {
  font-weight: 600;
  font-size: 13.5px;
}
.queue-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.queue-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 30px;
  color: var(--ink-3);
  font-size: 13px;
}
.queue-empty svg {
  width: 16px;
  height: 16px;
  stroke: var(--green);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* Money shot: unguided vs guided contrast */
.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.contrast-col {
  padding: 22px;
}
.contrast-col.bad {
  background: var(--red-soft);
  border-right: 1px solid var(--line);
}
.contrast-col.good {
  background: var(--green-soft);
}
.contrast-col h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.contrast-col.bad h3 {
  color: var(--red);
}
.contrast-col.good h3 {
  color: var(--green);
}
.contrast-col h3 svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contrast-col p.lede {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.contrast-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.contrast-list li {
  display: flex;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.contrast-list svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contrast-col.bad .contrast-list svg {
  stroke: var(--red);
}
.contrast-col.good .contrast-list svg {
  stroke: var(--green);
}

/* Debug / output panel */
.code-block {
  background: var(--navy-deep);
  color: #d6e2ee;
  border-radius: var(--radius);
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: pre;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.code-head .ch-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}
.code-head .ch-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #efd9a8;
  padding: 2px 8px;
  border-radius: 6px;
}

.outcome-band {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.outcome-band svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.outcome-band.clear {
  background: var(--green-soft);
  color: var(--green);
}
.outcome-band.review {
  background: var(--amber-soft);
  color: #9a5b00;
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.disclaimer {
  display: flex;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 24px;
}
.disclaimer svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  margin-top: 1px;
}
.disclaimer p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

@media (max-width: 860px) {
  .capture-grid,
  .v-grid,
  .contrast-grid {
    grid-template-columns: 1fr;
  }
  .contrast-col.bad {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* ============================= PHONE (primary device) ============================= */
@media (max-width: 520px) {
  .topbar {
    height: 56px;
    padding: 0 14px;
    gap: 10px;
  }
  .wordmark {
    font-size: 15.5px;
  }
  .wordmark .sub {
    font-size: 10px;
  }
  .spike-pill {
    display: none; /* reclaim header space on a phone; still visible in the about-banner */
  }
  .theme-toggle span#themeLabel {
    display: none; /* icon-only toggle, saves width */
  }
  .theme-toggle {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .main {
    padding: 16px 12px 110px; /* bottom clearance for sticky footer-nav */
  }

  .about-banner {
    padding: 13px 14px;
    gap: 10px;
  }

  .mode-toggle {
    grid-template-columns: 1fr;
  }

  /* Buttons: full-width stack, 44px+ tap targets, thumb-reachable order. */
  .capture-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .capture-actions .btn,
  .video-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 14.5px;
  }
  .file-fallback input[type='file'] {
    display: none; /* native file UI chrome; the label itself is the tap target */
  }

  /* Stepper: horizontal scroll with a hint of the next pill, snap-friendly. */
  .stepper-nav {
    margin: 0 -12px 16px;
    padding: 0 12px 6px;
    scroll-snap-type: x proximity;
  }
  .step-pill {
    scroll-snap-align: start;
    min-height: 44px;
    padding: 9px 13px 9px 8px;
  }

  .capture-main h2 {
    font-size: 19px;
  }
  .viewfinder {
    margin-bottom: 12px;
  }
  .viewfinder .vf-metric {
    font-size: 10px;
    padding: 3px 7px;
  }

  /* Side panel drops below the viewfinder, not beside it (grid already reflows
     at 860px) — on phone, trim its padding and let the thumb strip wrap. */
  .capture-side .card {
    padding: 13px !important;
  }

  /* Footer nav: pin to the bottom so Back/Next are always one thumb-reach away,
     matching the sticky "primary action" pattern of native camera apps. */
  .footer-nav {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 20px -12px 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(11, 27, 43, 0.06);
    z-index: 5;
  }
  .footer-nav .btn {
    min-height: 48px;
    flex: 1;
  }
  .footer-nav .btn:first-child:not(:last-child) {
    flex: 0 0 auto;
  }

  .video-drop {
    aspect-ratio: 4 / 3; /* taller preview reads better one-handed in portrait */
  }
  .video-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .scan-status {
    flex-wrap: wrap;
  }
  .scan-status .progress-bar {
    flex-basis: 100%;
    order: 3;
  }

  .frame-strip {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }

  .v-grid {
    gap: 14px;
  }
  .field-table {
    table-layout: fixed;
  }
  .ack-low {
    display: flex;
    margin: 4px 0 0;
  }
  .field-table thead th,
  .field-table tbody td {
    padding: 9px 10px;
    overflow-wrap: break-word;
    font-size: 12px;
  }
  .conf-bar {
    width: 46px;
  }

  .contrast-col {
    padding: 16px;
  }

  .scenario-toggle .seg {
    width: 100%;
  }
  .seg button {
    flex: 1;
    min-height: 40px;
  }

  .code-block {
    font-size: 10.5px;
    padding: 14px 15px;
  }

  .intro-card,
  .submitted-card,
  .consent-card {
    padding: 20px;
  }
  .review-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .review-thumb-card .btn-sm {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }
}
