/* Landys Inspect: mobile-first, no external fonts. Tokens from /brand/tokens.json. */
:root {
  --primary: #064e3b;
  --secondary: #0a8f6a;
  --accent: #d8c48f;
  --paper: #fff8eb;

  --bg: var(--paper);
  --surface: #ffffff;
  --text: #13201b;
  --muted: #4b5a54;
  --line: #e4dccb;
  --link: var(--primary);
  --btn-primary-bg: var(--primary);
  --btn-primary-fg: #ffffff;
  --flag: #b42318;
  --flag-bg: #fde8e6;
  --review: #8a5a00;
  --review-bg: #fdf1d6;
  --ignore: #4b5563;
  --ignore-bg: #eceff2;
  --ok: #067647;
  --focus: #0a8f6a;
  /* The brand secondary (#0a8f6a) is 3.86:1 on paper, under WCAG AA for small text; text and
     white-on-green use this darker shade of it (5.05:1 on paper, 5.33:1 under white).
     Every ratio in this file is computed by test/contrast.test.js. */
  --secondary-text: #067a5a;

  --gutter: 16px;
  --touch: 44px;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1714;
    --surface: #13221d;
    --text: #eef3ef;
    --muted: #a8b8b0;
    --line: #26392f;
    --link: #7fd8b8;
    --btn-primary-bg: #067a5a; /* the darker brand secondary: 5.33:1 under white text */
    --btn-primary-fg: #ffffff;
    --flag: #ff8a80;
    --flag-bg: #3a1714;
    --review: #f3c565;
    --review-bg: #332710;
    --ignore: #b7c0c9;
    --ignore-bg: #232b31;
    --ok: #6fdba6;
    --secondary-text: #7fd8b8;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  overflow-x: hidden;
}
img,
video,
canvas,
iframe {
  max-width: 100%;
  display: block;
}
a {
  color: var(--link);
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0.2em 0 0.5em;
  overflow-wrap: anywhere; /* a long unbroken property or station name never scrolls sideways */
}
h1 {
  font-size: 1.6rem;
}
h1:focus {
  outline: none;
}
h2 {
  font-size: 1.15rem;
  margin-top: 1.2em;
}
h3 {
  font-size: 1.05rem;
  margin: 0;
}
p {
  margin: 0.4em 0 0.8em;
}
:focus-visible,
.focus-ring {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* On the dark green top bar the usual ring is 2.38:1; the brand accent is 5.65:1 (WCAG 1.4.11 wants 3:1). */
.topbar :focus-visible {
  outline-color: var(--accent);
}

[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  padding: 8px;
}

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px var(--gutter);
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--primary);
  color: #fff;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch);
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
}
.brand b {
  color: var(--accent);
}
.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}
.mock-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary);
}

/* --- layout --- */
main {
  max-width: 640px;
  margin: 0 auto;
  overflow-wrap: anywhere; /* free text (a long note, a URL) wraps instead of widening the page */
  padding: var(--gutter);
  padding-bottom: calc(var(--gutter) * 3 + env(safe-area-inset-bottom));
}
main[aria-busy="true"] {
  opacity: 0.7;
}
.screen > * + * {
  margin-top: 12px;
}
.eyebrow {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--secondary-text);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lede {
  color: var(--muted);
  font-size: 1.05rem;
}
.small {
  color: var(--muted);
  font-size: 0.9rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.back {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  text-decoration: none;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px var(--gutter);
}
.notice {
  background: var(--surface);
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
  padding: 10px 12px;
}
.notice.warn {
  border-left-color: var(--flag);
}

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 18px;
  border-radius: 12px;
  border: 2px solid transparent;
  font: 600 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn.big {
  width: 100%;
  min-height: 56px;
  font-size: 1.08rem;
}
.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}
.btn.secondary {
  background: transparent;
  color: var(--link);
  border-color: currentColor;
}
.btn.ghost-btn {
  background: transparent;
  color: var(--link);
}
.btn[disabled] {
  opacity: 0.65;
  cursor: progress;
}
.icon-btn {
  min-width: var(--touch);
  min-height: var(--touch);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  vertical-align: -3px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
}

/* --- forms --- */
.field {
  display: grid;
  gap: 4px;
  font-weight: 600;
}
input[type="text"],
textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 1rem var(--font);
}
input[type="range"] {
  width: 100%;
  min-height: var(--touch);
  accent-color: var(--secondary);
}
fieldset {
  margin: 0;
  min-width: 0;
}

/* --- start --- */
.hero {
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  color: var(--primary);
  margin-top: 8px;
}
@media (prefers-color-scheme: dark) {
  .hero {
    color: var(--accent);
  }
}
.cta {
  display: grid;
  gap: 12px;
  margin: 20px 0 8px;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.step p {
  margin: 2px 0 0;
  color: var(--muted);
}
.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  font-weight: 800;
}
.privacy {
  margin-top: 20px;
  border-radius: var(--radius);
  padding: 4px var(--gutter) 8px;
  background: var(--surface); /* before color-mix(): Safari 16.2, Chrome 111, Firefox 113 */
  background: color-mix(in srgb, var(--secondary) 10%, var(--surface));
}
.privacy h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.privacy ul {
  margin: 0;
  padding-left: 20px;
}

/* --- setup --- */
.rooms {
  display: grid;
  gap: 12px;
}
.room-head {
  display: flex;
  gap: 8px;
  align-items: end;
}
.room-head .field {
  flex: 1;
}
.stations {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 6px;
}
.station-row {
  display: flex;
  gap: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: var(--touch);
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 500 0.95rem var(--font);
  cursor: pointer;
}

/* --- hub & lists --- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.subnav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}
.subnav a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--secondary);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.list-body {
  flex: 1;
  display: grid;
  gap: 2px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.count {
  font-size: 0.85rem;
  color: var(--muted);
}
.chev {
  font-size: 1.6rem;
  color: var(--muted);
}
.status.compared {
  color: var(--ok);
}
.status.not_comparable {
  color: var(--review);
}

/* --- badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 6px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid currentColor;
}
.badge.flag {
  color: var(--flag);
  background: var(--flag-bg);
}
.badge.review {
  color: var(--review);
  background: var(--review-bg);
  border-style: dashed;
}
.badge.ignore {
  color: var(--ignore);
  background: var(--ignore-bg);
  border-style: dotted;
}

/* --- camera --- */
.camera {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* large text never widens the camera past the screen */
  gap: 10px;
}
.viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1210;
}
.viewport video,
.viewport .ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.viewport .ghost {
  pointer-events: none;
  mix-blend-mode: normal;
}
.viewport-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  background: #0c1714; /* shown only when there is no live picture; opaque so it reads (14.02:1) */
  color: #d9e4de;
  font-weight: 600;
}
.viewport-msg.caption {
  inset: 0 0 auto 0; /* a strip along the top: the reference photo below stays visible */
  padding: 8px 12px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.slider-row span {
  flex: none;
  white-space: nowrap; /* "Ghost" never breaks mid-word under main's overflow-wrap */
}
.camera-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.camera-actions .btn {
  max-width: 100%;
  text-align: center;
}
.viewport .shutter {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 1;
}
.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid var(--accent);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.shutter[disabled] {
  opacity: 0.45;
}
.review-shot img {
  border-radius: var(--radius);
  width: 100%;
}
.review-shot.dim img {
  opacity: 0.6;
}
.review-shot figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}
figure {
  margin: 0;
}
.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* --- guidance --- */
.guide {
  background: var(--surface);
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 12px var(--gutter);
}
.guide[data-hint="ok"] {
  border-color: var(--ok);
}
.guide[data-hint="not_comparable"] {
  border-color: var(--review);
}
.guide-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--accent);
}
.instruction {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}
.instruction-small {
  font-size: 1.15rem;
  font-weight: 700;
}
.meter {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: var(--flag);
  transition: width 0.3s;
}
.meter-fill[data-level="fair"] {
  background: var(--review);
}
.meter-fill[data-level="good"] {
  background: var(--ok);
}
details summary {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
/* display: flex drops the native marker: draw a chevron that turns when open. */
details summary::after {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.6em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
details[open] > summary::after {
  transform: translateY(0.15em) rotate(225deg);
}
.details-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 0;
  font-size: 0.92rem;
}
.details-grid dd {
  margin: 0;
  font-family: var(--mono);
}
.attempt {
  margin: 4px 0 0;
}
.honest {
  border-left: 5px solid var(--review);
}

/* --- before/after --- */
.ba-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1210;
}
.ba-canvas {
  width: 100%;
}
.ba-tag {
  position: absolute;
  top: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #13201b; /* opaque, so the tag reads (16.8:1) over any photo */
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.ba-tag.left {
  left: 8px;
}
.ba-tag.right {
  right: 8px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}
.swatch {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.swatch.hatch {
  background: repeating-linear-gradient(135deg, #6b7a74 0 2px, transparent 2px 6px);
}

/* --- regions --- */
.region {
  display: grid;
  gap: 6px;
  cursor: pointer;
}
.region-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.region-head h3 {
  flex: 1;
  min-width: 8ch;
}
.region-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.reason {
  margin: 0;
}
.crops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.crops.three {
  grid-template-columns: 1fr 1fr 1fr;
}
.crops img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}
.crops figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.closeup-ask {
  border: 2px solid var(--accent);
  background: var(--surface); /* before color-mix(): Safari 16.2, Chrome 111, Firefox 113 */
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}
.footer-actions {
  margin-top: 20px;
}

/* --- review --- */
.decide h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.3em;
}
.share-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.share-role {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}
.link {
  font-family: var(--mono);
  font-size: 0.85rem !important;
}
.copied {
  color: var(--ok);
  font-weight: 600;
}
.respond {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 700 1rem var(--font);
  cursor: pointer;
}
.choice.agree[aria-pressed="true"] {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--surface); /* before color-mix(): Safari 16.2, Chrome 111, Firefox 113 */
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}
.choice.dispute[aria-pressed="true"] {
  border-color: var(--flag);
  color: var(--flag);
  background: var(--flag-bg);
}
.response {
  margin: 0;
  font-size: 0.95rem;
}
.response.none {
  color: var(--muted);
}
.response.agree strong {
  color: var(--ok);
}
.response.dispute strong {
  color: var(--flag);
}

/* --- report --- */
.report-frame {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* --- trace timeline --- */
.trace-story {
  margin: -4px 0 12px;
  padding: 8px 12px;
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}
.trace-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.88rem;
}
.trace-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trace-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  background: var(--k);
}
.kind-perception {
  --k: #067a5a;
}
.kind-instruction {
  --k: #2563eb;
}
.kind-closeup {
  --k: #8a5a00; /* 5.93:1 on white (was #b7791f, 3.64:1: under AA for the small kind label) */
}
.kind-model {
  --k: #7c3aed;
}
.kind-human {
  --k: #064e3b;
}
.kind-other {
  --k: #667085;
}
@media (prefers-color-scheme: dark) {
  .kind-human {
    --k: #c9a74e;
  }
  /* White on that gold is 2.3:1; the dark ink is 7.3:1. */
  .kind-human .tl-icon,
  .kind-human .trace-icon {
    color: #13201b;
  }
}
/* The connecting line is a background, not a ::before box: contrast checkers (axe) can't tell
   the background behind text that overlaps a pseudo-element, and so couldn't check the rows. */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  background: linear-gradient(var(--line), var(--line)) 19px 8px / 2px calc(100% - 16px) no-repeat;
}
.tl {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 6px 0;
}
.tl-icon {
  flex: none;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  background: var(--k);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-body {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--k);
  border-radius: 12px;
  padding: 8px 12px;
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.tool {
  font: 700 0.92rem var(--mono);
  overflow-wrap: anywhere;
}
.tl-kind {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--k);
}
@media (prefers-color-scheme: dark) {
  .tl-kind {
    color: var(--muted);
  }
}
.tl-ms {
  margin-left: auto;
  font: 0.8rem var(--mono);
  color: var(--muted);
}
.tl-why {
  margin: 4px 0 0;
  font: 0.88rem/1.45 var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.tl-decision {
  margin: 4px 0 0;
  font-weight: 700;
}
.tl-region {
  font: 700 0.8rem var(--mono);
  padding: 0 6px;
  border-radius: 6px;
  background: var(--ignore-bg);
  color: var(--text);
}
.tl-said {
  font-weight: 500;
  color: var(--muted);
}
.policy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.region-status {
  margin: 0;
  font-weight: 700;
  color: var(--review);
}
.no-crop {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px dashed var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.summary {
  border-left: 5px solid var(--secondary);
}
.tl-rejected {
  color: var(--flag);
}

.list-item strong,
.meta {
  overflow-wrap: anywhere;
}
