:root {
  color-scheme: light;
  --bg: #f3ecdf;
  --raise: #fffaf3;
  --ink: #1c1712;
  --muted: #5c5348;
  --line: #e0d3c2;
  --edge: #7d6d5a;
  --copper: #8a3f22;
  --red: #a63a14;
  --green: #0b6e55;
  --blue: #1f5fa6;
  --shadow: 0 18px 50px rgba(48, 32, 16, 0.12);
  --sans: "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --raise: #221c17;
  --ink: #f6efe4;
  --muted: #d2c3b0;
  --line: #3c332b;
  --edge: #9a8b79;
  --copper: #f0b394;
  --red: #ff9a70;
  --green: #58d1ab;
  --blue: #7db4f0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(138, 63, 34, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 5;
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
}

.skip:not(:focus) {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

a { color: inherit; }

a:hover { color: var(--copper); }

:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav { margin-left: auto; }

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.5rem;
}

.home-grid {
  display: grid;
  gap: 0.8rem;
}

.home-card {
  margin: 0;
  padding: 1.05rem 1.15rem 1.15rem;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.home-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
}

.home-card p { margin: 0; }

.home-note { margin-top: 1.1rem; max-width: 40rem; }

.facts {
  margin: 0 0 1.6rem;
  max-width: 40rem;
}

.facts h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.45rem, 3vw, 1.8rem);
}

.facts p { margin: 0 0 0.8rem; }

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.fact-row li {
  min-width: 8.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raise);
}

.fact-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.fact-row span { color: var(--muted); }

.tool-block { margin: 0 0 2.2rem; }

.tool-block h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }

.pair-form, .boost-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
  margin: 0.8rem 0;
}

.color-field { display: grid; gap: 0.35rem; font-weight: 650; }

input[type="color"] {
  width: 4.5rem;
  height: 3rem;
  padding: 0.2rem;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--raise);
}

.boost-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
}

.boost-form label { font-weight: 650; }

.pair-result { display: grid; gap: 0.7rem; }

.pair-row p { margin: 0 0 0.3rem; }

.pair-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}

.pair-head .verdict {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.05rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
}

.pair-row.is-same .verdict {
  background: var(--ink);
  color: var(--bg);
}

.pair-light { margin: 0.2rem 0 0.4rem; }

.color-spoken {
  color: var(--muted);
  font-weight: 650;
}

.pair-swatches { display: flex; gap: 0.45rem; }

.pair-swatches span,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.pair-swatches span { width: 5.5rem; }



.collide {
  display: grid;
  gap: 0.8rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.collide li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.collide li span:last-child { flex: 1 1 14rem; }

.boost-views {
  display: grid;
  gap: 0.8rem;
}

.boost-views figure { margin: 0; }

.boost-views figcaption { font-weight: 700; margin-bottom: 0.3rem; }

.boost-views canvas {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #111;
}

@media (min-width: 800px) {
  .boost-views { grid-template-columns: 1fr 1fr; }
}

.resource-list { padding-left: 1.1rem; }

.resource-list li { margin: 0 0 0.65rem; }

.resource-list a { font-weight: 700; }

.site-header nav a {
  display: inline-block;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

main {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  flex: 1 0 auto;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin: 0 0 0.6rem; }

.lede { font-size: 1.12rem; max-width: 38rem; margin: 0 0 1.25rem; }

.note { color: var(--muted); margin: 0.4rem 0 0; }

.stage {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1.25rem;
}

.progress {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.plate-wrap {
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
}

canvas#plate {
  width: min(100%, 34rem);
  height: auto;
  background: transparent;
}

.answer {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.readout {
  margin: 0;
  min-height: 3.2rem;
  min-width: 8rem;
  padding: 0.35rem 1.2rem;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: center;
}

.readout.is-empty {
  font-family: var(--sans);
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--muted);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(4.5rem, 1fr));
  gap: 0.5rem;
  width: min(100%, 22rem);
}

.key {
  min-height: 58px;
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--edge);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

button.key[type="submit"] {
  background: var(--ink);
  color: var(--bg);
  border-color: transparent;
}

label { font-weight: 650; }

.actions, .result-actions, .cam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

button, .btn, .key, .pill {
  touch-action: manipulation;
}

button, .btn {
  min-height: 48px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.secondary, a.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--edge);
}

.hint {
  min-height: 1.4em;
  margin: 0.7rem 0 0;
  color: var(--copper);
}

.result { display: grid; gap: 0.9rem; }

.cones { display: grid; gap: 0.85rem; margin: 0.3rem 0 0.2rem; }

.cone-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.cone strong { font-variant-numeric: tabular-nums; font-size: 1.35rem; }

.track {
  height: 0.7rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.track span {
  display: block;
  height: 100%;
  width: var(--p);
  background: var(--bar);
}

.cone-red { --bar: var(--red); }
.cone-green { --bar: var(--green); }
.cone-blue { --bar: var(--blue); }

.site-footer {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.cam {
  width: min(1100px, calc(100% - 1.2rem));
}

.cam-layout {
  display: grid;
  gap: 0.8rem;
}

.viewports {
  display: grid;
  grid-template-rows: minmax(180px, 34dvh) minmax(180px, 34dvh);
  gap: 0.55rem;
}

.pane {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #12100e;
  min-height: 180px;
}

.pane canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tag {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  margin: 0;
  max-width: calc(100% - 1.4rem);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.78);
  color: #f6efe4;
  font-size: 0.92rem;
}

.empty {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  margin: 0;
  color: #f6efe4;
}

.controls {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 22px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend { font-weight: 650; margin-bottom: 0.45rem; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
}

.pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.pill:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.sliders { display: grid; gap: 0.75rem; }

.slider label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.slider output { font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  margin-top: 0.35rem;
  accent-color: var(--copper);
  height: 2.75rem;
}

.file-btn { position: relative; overflow: hidden; }

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.status { margin: 0; color: var(--muted); }
.status:empty { display: none; }

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; row-gap: 0.1rem; padding: 0.35rem 0.7rem 0.3rem; }
  .site-header .brand { order: 1; font-size: 1.25rem; }
  .site-header .theme-switch { order: 2; margin-left: auto; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; }
  .site-header nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
    gap: 0.1rem;
    -webkit-overflow-scrolling: touch;
    padding-inline-end: 2px; /* DR follow-up: Tools pill was 1px past nav edge at 390 */
  }
  .site-header nav ul::-webkit-scrollbar { display: none; }
  .site-header nav a { padding: 0.4rem 0.55rem; font-size: 0.92rem; white-space: nowrap; }
  .viewports { grid-template-rows: minmax(150px, 28dvh) minmax(150px, 28dvh); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.test-app {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.test-app .site-header { padding-top: 0.35rem; padding-bottom: 0.3rem; }

body.test-app .brand { font-size: 1.05rem; }

body.test-app main {
  flex: 1;
  min-height: 0;
  width: min(980px, 100%);
  padding: 0.45rem 0.7rem 0.55rem;
  display: flex;
  flex-direction: column;
}

body.test-app .stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem 0.65rem;
  overflow: hidden;
}

body.test-app .progress { margin: 0; }

.progress-block { display: grid; gap: 0.35rem; }

.plate-meter {
  height: 8px;
  border: 1px solid var(--edge);
  margin: 0;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.plate-meter span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--copper);
}

body.test-app .actions { width: min(100%, 22rem); }

body.test-app .wide { width: 100%; }

.key:active { transform: scale(0.97); }

.vision-plain {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

#red-cones { accent-color: var(--red); }
#green-cones { accent-color: var(--green); }
#blue-cones { accent-color: var(--blue); }

body:has(.cam) .brand { font-size: 1.15rem; }

.cam h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-top: 0.15rem;
  margin-bottom: 0.3rem;
}

.cam .lede { margin-bottom: 0.45rem; }

.cam .controls { gap: 0.65rem; padding: 0.85rem; }

body:has(.cam) .site-footer { margin-bottom: 5.5rem; }

.cam-dock {
  position: fixed;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.7rem 1rem max(0.7rem, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

#open-camera { min-height: 52px; }

@media (max-width: 520px) {
  .cam-dock { grid-template-columns: 1fr; }
}

.result-actions .btn { flex: 1 1 14rem; }

body.cam-live .viewports .pane:last-child .tag {
  top: 0.55rem;
  max-width: calc(100% - 1.4rem);
}

body.test-app .plate-wrap {
  container-type: size;
  min-height: 0;
  height: 100%;
  margin: 0;
}

body.test-app canvas#plate {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  max-width: none;
  max-height: none;
}

body.test-app .answer { gap: 0.4rem; }

body.test-app .readout {
  min-height: 0;
  padding: 0.1rem 0.9rem;
  font-size: 1.7rem;
}

body.test-app .readout.is-empty {
  font-size: 1rem;
  padding: 0.35rem 0.9rem;
}

body.test-app .keypad { gap: 0.35rem; }

body.test-app .key {
  min-height: 44px;
  border-radius: 12px;
  font-size: 1.2rem;
}

body.test-app .hint {
  min-height: 0;
  margin: 0.15rem 0 0;
  text-align: center;
}

body.test-app .actions { justify-content: center; }

@media (min-width: 900px) {
  body.test-app .stage {
    grid-template-columns: minmax(0, 1fr) 22rem;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  body.test-app .progress-block { grid-column: 1 / -1; }

  body.test-app .plate-wrap { grid-column: 1; grid-row: 2; }

  body.test-app .answer-col { grid-column: 2; grid-row: 2; }
}

body.test-result {
  height: auto;
  overflow: auto;
}

body.test-result main { display: block; height: auto; }

body.test-result .stage {
  display: block;
  overflow: visible;
}

.live[hidden] { display: none; }

body.cam-live { overflow: hidden; }

body.cam-live .site-header,
body.cam-live .site-footer,
body.cam-live main { display: none; }

.live {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

body.cam-live { touch-action: none; }

body.cam-live .viewports {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  height: 100%;
  min-height: 0;
}

body.cam-live .pane {
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

body.cam-live .viewports .pane:first-child .tag {
  top: auto;
  bottom: 0.65rem;
}

.live-bar {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.45rem, env(safe-area-inset-top)) 0.6rem 0.7rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.live-bar button {
  background: rgba(20, 16, 12, 0.72);
  color: #f6efe4;
  border-color: transparent;
}

body.cam-live.can-pan .pane canvas { cursor: grab; }

body.cam-live.is-panning .pane canvas { cursor: grabbing; }

.save-note {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 4.4rem;
  transform: translateX(-50%);
  width: min(28rem, calc(100% - 1.5rem));
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 14px;
  background: rgba(20, 16, 12, 0.88);
  color: #f6efe4;
  text-align: center;
}

.save-note:empty { display: none; }

.id-stage[hidden] { display: none; }

.id-stage {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background: #000;
}

.id-zoom {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  touch-action: none;
}

.id-stage video,
.id-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  touch-action: none;
}

.id-stage.is-photo video { display: none; }

.id-stage.is-photo canvas { object-fit: contain; }

.reticle,
.pin {
  position: absolute;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.reticle {
  left: 50%;
  top: 46%;
}

.pin { margin: -28px 0 0 -28px; width: 56px; height: 56px; }

.id-card {
  position: absolute;
  z-index: 5;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 22px;
  background: #141210;
  color: #f6efe4;
}

.id-kicker {
  margin: 0;
  color: #d2c3b0;
  font-size: 0.92rem;
}

.id-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.swatch {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid #f6efe4;
}

.id-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  line-height: 1.05;
}

.id-detail { margin: 0; }

.id-card button {
  justify-self: start;
  margin-top: 0.45rem;
  background: transparent;
  color: #f6efe4;
  border-color: rgba(246, 239, 228, 0.35);
}

.id-stage { touch-action: none; }

/* ---------- Cone Check polish (2026-10-02) ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Light | Dark switch. Two buttons, no automatic mode. */
.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--raise);
}

.theme-switch button {
  min-height: 42px;
  min-width: 44px;
  padding: 0.2rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
}

html[data-theme="light"] .theme-switch [data-theme-set="light"],
html[data-theme="dark"] .theme-switch [data-theme-set="dark"] {
  background: var(--ink);
  color: var(--bg);
}

html[data-theme="light"] .theme-switch [data-theme-set="light"]::before,
html[data-theme="dark"] .theme-switch [data-theme-set="dark"]::before { content: "\2713\00a0"; }

/* Never hue alone: marks and weight carry state too. */
/* Vision chips: unselected centred; checked pad for absolute ✓ */
.pill {
  padding-inline: 0.85rem;
}
.pill:has(input:checked) {
  padding-left: 1.55rem;
  padding-right: 0.85rem;
}
.pill::before {
  content: "\2713";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}
.pill:has(input:checked)::before { opacity: 1; }
.pill:has(input:focus-visible),
.file-btn:has(input:focus-visible) {
  outline: 3px solid var(--copper);
  outline-offset: 3px;
}

a { text-underline-offset: 0.18em; }

.btn.large, button.large {
  min-height: 56px;
  padding: 0.8rem 1.6rem;
  font-size: 1.2rem;
}

/* Home */
.home-start { display: grid; gap: 0.7rem; margin: 0 0 1rem; max-width: 40rem; }
.home-start .btn.large { width: 100%; }
.home-start .fine { margin: 0; color: var(--muted); font-size: 0.95rem; }
.home-actions { align-items: center; margin: 0 0 1.8rem; }
.home-actions .also { margin: 0; color: var(--muted); font-size: 0.95rem; }
.home-card .card-link { margin-top: 0.6rem; }
.home-card .card-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}
.home-card h2 { font-size: clamp(1.25rem, 3vw, 1.45rem); }
@media (min-width: 800px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
}

/* Test: intro, progress row, back */
body.test-app.test-intro {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  display: block;
}
body.test-app.test-intro main { display: block; padding-bottom: 2.5rem; }
.intro #begin { width: 100%; margin: 0.4rem 0 1rem; }

.intro {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.4rem;
}
.intro h1 { margin: 0 0 0.5rem; font-size: clamp(1.8rem, 5vw, 2.5rem); }
.intro ul { margin: 0.6rem 0 1.1rem; padding-left: 1.2rem; }
.intro li { margin: 0 0 0.4rem; }
.intro .btn { width: 100%; }
.intro .note { margin-top: 0.9rem; }

.progress { align-items: center; }
.progress-label { margin: 0; display: flex; flex-wrap: wrap; gap: 0 0.7rem; align-items: baseline; }
#step { font-weight: 700; color: var(--ink); }
.link-btn {
  min-height: 40px;
  padding: 0.2rem 0.7rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--edge);
  font-size: 0.9rem;
  font-weight: 600;
}
body.test-app .key { min-height: 46px; }
@media (max-width: 899px) {
  body.test-app .key { min-height: 48px; }
}
.readout { min-width: 6rem; }

/* Result */
.result h2 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.3rem); }
.result h3 { margin: 0.4rem 0 0.2rem; font-size: 1.15rem; font-family: var(--serif); font-weight: 600; }
.result p, .result ul { margin: 0; }
.result ul { padding-left: 1.2rem; }
.result li { margin: 0 0 0.35rem; }
.result-lead { font-size: 1.12rem; }
.verdict {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  align-self: start;
  justify-self: start;
}
.cone-state { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 0; }
.cone-top span { font-weight: 650; }
.track { height: 0.9rem; }
.cone-red .track span {
  background: repeating-linear-gradient(135deg, var(--bar) 0 6px, var(--raise) 6px 9px);
}
.cone-green .track span {
  background:
    radial-gradient(circle at 4px 4px, var(--raise) 1.6px, transparent 2px) 0 0 / 8px 8px,
    var(--bar);
}
.cone-blue .track span { background: var(--bar); }
.result-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  display: grid;
  gap: 0.3rem;
}
.result-actions { align-items: stretch; }
.result-actions .btn, .result-actions button { flex: 1 1 12rem; }
.print-only { display: none; }
.copy-box {
  width: 100%;
  min-height: 7rem;
  padding: 0.6rem;
  background: var(--raise);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 12px;
  font: inherit;
}

/* Camera + color: permission note, fallback, status */
.perm-note {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--copper);
  border-radius: 12px;
  background: var(--bg);
}
.perm-note strong { display: block; }
.status:not(:empty) {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--edge);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg);
}
.status.is-problem::before { content: "Problem: "; font-weight: 700; }
.file-btn.is-suggested {
  border-width: 3px;
  border-color: var(--ink);
  font-weight: 800;
}
.pills { min-height: 44px; }
.from-test { margin: 0; font-weight: 650; }
#vision-plain { min-height: 3em; }

/* Tools: keep the layout stable while results fill in */
.hexval { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted); }
.chip { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
.boost-views canvas { max-width: 100%; }
.pair-swatches span { border: 2px solid var(--ink); }
.pair-row p strong { margin-right: 0.35rem; }
.resource-list a, .site-footer a { display: inline-block; min-height: 24px; }

.site-footer p { margin: 0 0 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .key:active { transform: none; }
}

@media print {
  .site-header, .skip, .site-footer, .result-actions, .cam-dock, .theme-switch { display: none !important; }
  html, html[data-theme="dark"] {
    --bg: #fff; --raise: #fff; --ink: #000; --muted: #333; --line: #888; --edge: #444;
    --red: #a63a14; --green: #0b6e55; --blue: #1f5fa6; --copper: #000;
  }
  body, body.test-app { height: auto !important; overflow: visible !important; background: #fff; color: #000; display: block; }
  .stage, .result-card { box-shadow: none; border-color: #888; }
  .print-only { display: block; margin: 0 0 0.6rem; }
  .track span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Test layout: digits in a compact grid, focus mode header, landscape phones */
.progress-tools { display: inline-flex; gap: 0.4rem; flex: 0 0 auto; }
.keypad { grid-template-columns: repeat(10, minmax(0, 1fr)); width: min(100%, 26rem); }
.keypad .key { grid-column: span 2; padding-inline: 0.15rem; }
.keypad .k-delete, .keypad .k-next { grid-column: span 3; }
.keypad .k-none { grid-column: span 4; }
.keypad .k-delete, .keypad .k-none { font-size: 1.05rem; }
body.test-app .keypad .k-delete, body.test-app .keypad .k-none { font-size: 1rem; }

body.test-app:not(.test-intro):not(.test-result) .site-header nav { display: none; }
body.test-app:not(.test-intro):not(.test-result) .site-header { padding-top: 0.2rem; padding-bottom: 0.2rem; }

@media (min-width: 900px), (min-width: 600px) and (orientation: landscape) and (max-height: 560px) {
  .keypad { grid-template-columns: repeat(12, minmax(0, 1fr)); width: min(100%, 22rem); }
  .keypad .key { grid-column: span 4; }
  .keypad .k-zero, .keypad .k-delete, .keypad .k-none, .keypad .k-next { grid-column: span 3; }
}
@media (min-width: 600px) and (orientation: landscape) and (max-height: 560px) {
  body.test-app .stage {
    grid-template-columns: minmax(0, 1fr) 20rem;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }
  body.test-app .progress-block { grid-column: 1 / -1; }
  body.test-app .plate-wrap { grid-column: 1; grid-row: 2; }
  body.test-app .answer-col { grid-column: 2; grid-row: 2; }
  body.test-app .key { min-height: 40px; }
}

.keypad .key { padding-block: 0; }


/* DR batch1: form hit targets + chip contrast + cam-dock status */
.boost-form label,
.charts-toolbar label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.boost-form input[type="radio"],
.boost-form input[type="checkbox"],
.charts-toolbar input[type="radio"],
.charts-toolbar input[type="checkbox"] {
  accent-color: var(--ink);
}
.chip.ink {
  color: #1c1712;
  text-shadow: none;
}
.cam-dock .status {
  grid-column: 1 / -1;
  margin: 0;
}
.cam-dock .status:empty { display: none; }
.cam-dock .status:not(:empty) {
  margin-bottom: 0.15rem;
}

/* r8: centre nav label in 44px pill */
.site-header nav a{display:inline-flex;align-items:center}
