/* WalkRecap web — design system.
 *
 * Grounded in the locked Field kit (brand/README.md). Nothing here invents a
 * colour: every token below is one of David's, and the rules that come with
 * them are enforced by comment and by usage.
 *
 *   Leaf   is CAPTURE ONLY — camera and evidence affordances, nowhere else.
 *   Danger is ERROR TEXT ONLY — never a background, never a hero.
 *   Amber  is flags, exceptions and "needs attention".
 *   Moss   is the primary action colour.
 *
 * The ground is warm ivory drafting paper: David's approved
 * blueprint-paper-texture-v1, with faint pencil linework in the corners and a
 * broad quiet centre, over a CSS grid so faint it reads as tooth rather than
 * pattern. Content sits in the quiet middle; nothing important crosses the
 * drawing.
 *
 * PAPER IS THE DEFAULT IN EVERY THEME. The OS's dark preference is deliberately
 * NOT honoured: an auto-dark WalkRecap reads as a generic SaaS dashboard, which
 * is the one thing this product must not look like. Dark is still available,
 * but only when someone explicitly asks for it in Profile.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  /* Field kit, verbatim */
  --forest: #223c25;
  --forest-ground: #1c3a2b;
  --bone: #ebe4d4;
  --paper: #fbfaf8;
  --straw: #efe8d6;
  --leaf: #3d8b57;
  --moss: #386b4c;
  --mist: #e6ede8;
  --ink: #1a1f1c;
  --muted: #616b66;
  --line: #c7d1c9;
  --danger: #a8382e;
  --warning: #c9893a;
  /* Recording hero only. Danger stays error-text-only: a red hero that is on
     for ten minutes makes a red error mean nothing. Locked 16 Aug 2026. */
  --record: #be3a2b;
  --record-deep: #8e2a20;

  /* Semantic surface roles (paper). No pure white anywhere: a white card on
     ivory paper is the tell that gives away a generic dashboard. */
  --bg: var(--paper);
  --surface: #fdfbf6;
  --surface-sunk: var(--straw);
  --surface-raised: #fffefb;
  --text: var(--ink);
  --text-dim: var(--muted);
  --rule: var(--line);
  --head: var(--forest);
  --accent: var(--moss);
  --on-accent: #ffffff;

  /* The drafting grid, under the texture. Half its former strength — the
     texture now carries the architectural feeling and two patterns fight. */
  --grid-fine: rgba(34, 60, 37, 0.022);
  --grid-major: rgba(34, 60, 37, 0.038);

  /* How much of the approved texture shows through. Low on purpose: it should
     read as paper stock, not as wallpaper. */
  --texture-strength: 0.55;

  --shadow-card: 0 1px 2px rgba(26, 31, 28, 0.05), 0 8px 24px -18px rgba(26, 31, 28, 0.45);
  --shadow-lift: 0 2px 6px rgba(26, 31, 28, 0.08), 0 18px 40px -24px rgba(26, 31, 28, 0.5);

  /* Type — the product's own stacks. On an iPhone these are the real faces. */
  --display: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* One spacing scale. Everything lays out with gap, not stacked margins. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Field controls are sized for a thumb in a glove, not a mouse. */
  --tap: 56px;
  --tap-sm: 48px;

  --shell-max: 1240px;
}

/* Dark is opt-in only — see the note at the top of this file. It is also warmer
   than it was: forest-toned, never near-black. */
:root[data-theme="dark"] {
  --bg: #16201a;
  --surface: #1d2a21;
  --surface-sunk: #24332a;
  --surface-raised: #223026;
  --text: var(--bone);
  --text-dim: #a3b4a8;
  --rule: #35462f;
  --head: #d8e5d9;
  --accent: #4e8c66;
  --on-accent: #0f150f;
  --grid-fine: rgba(235, 228, 212, 0.03);
  --grid-major: rgba(235, 228, 212, 0.05);
  --texture-strength: 0.14;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -18px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 18px 40px -24px rgba(0, 0, 0, 0.85);
}

/* ----------------------------------------------------------------- reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* A faint drafting grid only. The paper texture itself is a separate fixed
     layer below, so it can carry its own opacity without tinting the content. */
  background-image:
    repeating-linear-gradient(0deg, transparent 0 127px, var(--grid-major) 127px 128px),
    repeating-linear-gradient(90deg, transparent 0 127px, var(--grid-major) 127px 128px),
    repeating-linear-gradient(0deg, transparent 0 31px, var(--grid-fine) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, var(--grid-fine) 31px 32px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
/* The approved drafting paper. A fixed layer rather than a body background so
   its opacity is independent of the grid, and so a screen that wants a quieter
   ground (the walk) can turn it down without touching anything else.
   The small derivative is served to phones: 3.4KB against 19KB, and first paint
   on a phone is the one that has to be quick. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../assets/blueprint-paper-texture-v1-sm.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--texture-strength);
}
@media (min-width: 760px) {
  body::before { background-image: url("../assets/blueprint-paper-texture-v1.webp"); }
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------ typography */
h1, h2, h3 { font-family: var(--display); color: var(--head); margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.1; letter-spacing: -0.012em; }
h2 { font-size: clamp(1.25rem, 4vw, 1.6rem); line-height: 1.2; }
h3 { font-size: 1.05rem; line-height: 1.25; }
p { margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.dim { color: var(--text-dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.err { color: var(--danger); font-size: 0.9rem; }  /* Danger: error text only. */

/* ------------------------------------------------------------- utilities */
.stack { display: flex; flex-direction: column; }
.stack-1 { gap: var(--s1); } .stack-2 { gap: var(--s2); } .stack-3 { gap: var(--s3); }
.stack-4 { gap: var(--s4); } .stack-5 { gap: var(--s5); } .stack-6 { gap: var(--s6); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.inline { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.grow { flex: 1; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hide { display: none !important; }

/* -------------------------------------------------------------- controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap-sm);
  padding: 0 var(--s5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-block { width: 100%; }
.btn-field { min-height: var(--tap); font-size: 1.05rem; border-radius: var(--r-md); }
.btn-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}
.btn-quiet:hover { background: var(--surface-sunk); filter: none; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: transparent; padding: 0 var(--s3); }
.btn-ghost:hover { color: var(--text); filter: none; }
.btn-sm { min-height: 38px; padding: 0 var(--s3); font-size: 0.88rem; }

/* Leaf lives here and nowhere else: capture affordances. */
.btn-capture {
  background: var(--leaf);
  color: #ffffff;
  border-color: var(--leaf);
}

.field { display: flex; flex-direction: column; gap: var(--s2); }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.input {
  min-height: var(--tap);
  padding: 0 var(--s4);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  width: 100%;
}
.input:focus { border-color: var(--accent); }

/* ---------------------------------------------------------------- pieces */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.card-flat { box-shadow: none; }
.panel {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.panel-head {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--rule);
  background: var(--straw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

/* A tappable row where the WHOLE ROW is the target, not a control inside it. */
.rowbtn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--s3) var(--s4);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  text-align: left;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.rowbtn:hover { border-color: var(--accent); }
.rowbtn[aria-pressed="true"] {
  border-color: var(--forest);
  border-width: 2px;
  background: var(--surface-sunk);
  font-weight: 600;
}
.rowbtn .tick { color: var(--moss); margin-left: auto; display: none; }
.rowbtn[aria-pressed="true"] .tick { display: block; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  color: var(--text-dim);
  background: var(--surface);
  white-space: nowrap;
}
.chip-ok { border-color: var(--moss); color: var(--moss); }
.chip-warn { border-color: var(--warning); color: var(--warning); }
.chip-capture { border-color: var(--leaf); color: var(--leaf); }
.chip-sample {
  border-style: dashed;
  border-color: var(--warning);
  color: var(--warning);
}

.meter { height: 6px; border-radius: 3px; background: var(--surface-sunk); overflow: hidden; border: 1px solid var(--rule); }
.meter > i { display: block; height: 100%; background: var(--moss); transition: width 0.4s ease; }

.ring { --pct: 0; width: 40px; height: 40px; flex: none; position: relative; }
.ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--moss) calc(var(--pct) * 1%), var(--surface-sunk) 0);
  -webkit-mask: radial-gradient(closest-side, transparent 66%, #000 67%);
  mask: radial-gradient(closest-side, transparent 66%, #000 67%);
}
.ring > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  letter-spacing: -0.02em;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px dashed var(--warning);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  font-size: 0.88rem;
}
.banner b { color: var(--head); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  text-align: center;
  padding: var(--s7) var(--s4);
  color: var(--text-dim);
}
.empty h2 { color: var(--head); }

/* ------------------------------------------------------------- app shell */
#app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .lockup { height: 20px; width: auto; }
.wordmark { font-family: var(--display); font-size: 1.05rem; color: var(--head); letter-spacing: 0.01em; }

.view { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s5) var(--s4) 104px; display: flex; flex-direction: column; gap: var(--s5); }
.view-auth { max-width: 440px; justify-content: center; gap: var(--s6); padding-top: var(--s7); }

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}
.tabbar a[aria-current="page"] { color: var(--head); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }

/* Desktop rail is hidden until there is room for it. */
.rail { display: none; }

/* ------------------------------------------------------------ field mode */
/* The walk runs on the same drafting paper as the rest of the app. Forest is a
   restrained header and action colour here, not a ground — a dark full-screen
   flow reads as a dashboard, and this is a paper field tool.
   What buys outdoor readability is contrast and size, and ink on ivory beats
   bone on forest for both: it is what a printed field form has always used. */
.fieldmode {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Quieter paper here: the walk is work, and the drawing should not compete
     with the question. */
  --texture-strength: 0.3;
}
.fieldmode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg) url("../assets/blueprint-paper-texture-v1-sm.webp") center / cover no-repeat;
  opacity: var(--texture-strength);
}

/* The one forest surface in the walk: the header. It says "you are in the
   field" and then gets out of the way. */
.fieldmode .fm-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--forest);
  color: var(--bone);
  border-bottom: 1px solid rgba(26, 31, 28, 0.18);
  padding: var(--s3) var(--s4) var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  box-shadow: 0 1px 12px -6px rgba(26, 31, 28, 0.55);
}
.fieldmode .fm-head .dim { color: #b9cabe; }
.fieldmode .fm-head .btn-ghost { color: var(--bone); }
.fieldmode .fm-head .chip { background: transparent; border-color: rgba(235, 228, 212, 0.38); color: #cfdcd3; }
.fieldmode .fm-head .chip-sample { border-color: #e6bb84; color: #e6bb84; }
.fieldmode .fm-head .meter { background: rgba(0, 0, 0, 0.28); border-color: rgba(235, 228, 212, 0.2); }
.fieldmode .fm-head .meter > i { background: var(--bone); }
.fieldmode .fm-head :focus-visible { outline-color: var(--bone); }

/* Breathing room. One decision on screen at a time, with air around it. */
.fieldmode .fm-body {
  padding: var(--s6) var(--s5) 148px;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.fieldmode .fm-body > h2 {
  font-size: clamp(1.5rem, 6.2vw, 2rem);
  line-height: 1.16;
  margin-bottom: var(--s1);
}

/* Answer rows: taller, quieter, and unmistakable once chosen. */
.fieldmode .rowbtn {
  min-height: 72px;
  padding: var(--s4) var(--s5);
  font-size: 1.08rem;
  background: var(--surface-raised);
  border-color: var(--rule);
  box-shadow: var(--shadow-card);
}
.fieldmode .rowbtn:hover { border-color: var(--moss); }
.fieldmode .rowbtn[aria-pressed="true"] {
  background: var(--straw);
  border-color: var(--forest);
  border-width: 2px;
  padding: calc(var(--s4) - 1px) calc(var(--s5) - 1px);
}
.fieldmode .rowbtn .tick { color: var(--forest); }
.fieldmode .stack-2 { gap: var(--s3); }

.fm-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: var(--bg);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -10px 20px -18px rgba(26, 31, 28, 0.5);
  padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: var(--s3);
  max-width: 600px;
  width: 100%;
  margin-inline: auto;
}
.fm-actions .btn { flex: 1; min-height: 60px; }

/* Evidence. Leaf lives here and only here. */
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s3); }
.evidence-tile {
  aspect-ratio: 1;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  text-align: center;
  padding: var(--s2);
  transition: border-color 0.12s ease, color 0.12s ease;
}
button.evidence-tile:hover { border-color: var(--leaf); color: var(--leaf); }
.evidence-tile.filled {
  border-style: solid;
  border-color: var(--rule);
  background: var(--straw);
  color: var(--muted);
}
/* A captured photo fills its tile; the × sits in the corner so removing one is
   possible without a second screen. */
.evidence-tile.has-photo { position: relative; overflow: hidden; padding: 0; }
.evidence-tile.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.evidence-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(26, 31, 28, 0.66);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

/* --------------------------------------------------------- loading state */
.loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s5);
  padding: var(--s6) var(--s5) var(--s7);
  overflow: hidden;
}
.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/blueprint-paper-texture-v1-sm.webp") center / cover no-repeat;
  opacity: 0.9;
}
@media (min-width: 760px) {
  .loading::before { background-image: url("../assets/blueprint-paper-texture-v1.webp"); }
}

/* WALKRECAP —•— INSPECTION MODE */
.launch-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest);
  opacity: 0;
  animation: fade-up 0.7s ease forwards;
}
.launch-rule {
  display: block;
  width: 46px;
  height: 1px;
  background: var(--forest);
  position: relative;
  opacity: 0.55;
}
.launch-rule::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--forest);
}

.launch-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s5);
}

/* The deboss. Three stacked copies of the same masked shape: a light edge
   pushed down, a dark edge pushed up, and the paper colour on top. That is
   what reads as pressed into the sheet rather than printed on it. */
.launch-deboss {
  --mark: url("../assets/wr-mark.png");
  position: relative;
  width: clamp(150px, 44vw, 210px);
  aspect-ratio: 212 / 100;
  opacity: 0;
  animation: fade-up 0.9s ease 0.1s forwards;
}
.launch-deboss::before,
.launch-deboss::after,
.launch-deboss .launch-deboss-face {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
.launch-deboss::before {                    /* light edge, pushed down */
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(1.5px);
}
.launch-deboss::after {                     /* dark edge, pushed up */
  background: rgba(34, 60, 37, 0.28);
  transform: translateY(-1.5px);
}
.launch-deboss .launch-deboss-face {        /* the paper face, on top of both */
  background: #efeae0;
  z-index: 1;
}

.launch-name {
  font-family: var(--display);
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--forest);
  opacity: 0;
  animation: fade-up 0.9s ease 0.22s forwards;
}
.launch-tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1rem, 4.2vw, 1.2rem);
  color: var(--muted);
  opacity: 0;
  animation: fade-up 0.9s ease 0.34s forwards;
}

/* Reserved for the house drawing. Collapses cleanly while it is absent. */
.launch-art {
  flex: 1;
  min-height: 0;
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.launch-art img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0;
  animation: fade-up 1.2s ease 0.5s forwards;
}

.launch-progress {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  opacity: 0;
  animation: fade-up 0.9s ease 0.5s forwards;
}
.launch-progress .eyebrow { color: var(--forest); font-family: var(--sans); font-weight: 600; letter-spacing: 0.16em; }
.launch-progress .num { color: var(--forest); font-size: 0.95rem; }
.loading .meter { height: 4px; border: 0; border-radius: 2px; background: rgba(34, 60, 37, 0.14); }
.loading .meter > i { background: var(--forest); width: 0; transition: width 0.5s ease; }
.launch-caption {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
}

.launch-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s2);
  margin-top: var(--s3);
}
.launch-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  color: var(--muted);
}
/* The connecting hairline runs between the dots, not through the labels. */
.launch-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 60%;
  width: 80%;
  height: 1px;
  background: rgba(34, 60, 37, 0.2);
}
.launch-step .num { font-size: 0.7rem; letter-spacing: 0.08em; }
.launch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 60, 37, 0.35);
  background: transparent;
  z-index: 1;
}
.launch-step-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.launch-step.is-done .launch-dot { background: rgba(34, 60, 37, 0.35); border-color: transparent; }
.launch-step.is-active { color: var(--forest); }
.launch-step.is-active .launch-dot { background: var(--forest); border-color: var(--forest); }

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-sunk) 25%, var(--surface) 37%, var(--surface-sunk) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ------------------------------------------------------------ job pieces */
.joblist { display: flex; flex-direction: column; gap: var(--s3); }
.jobcard {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  text-align: left;
  padding: var(--s5) var(--s5);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  color: var(--text);
  transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}
.jobcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.jobcard .addr { font-family: var(--display); font-size: 1.12rem; color: var(--head); line-height: 1.2; }

.statusdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-draft { background: var(--muted); }
.st-walking { background: var(--leaf); }
.st-review { background: var(--warning); }
.st-done { background: var(--moss); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: 0.92rem; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; }

/* ------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); text-align: center; padding-bottom: var(--s1); }
.cal button {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 40px;
}
.cal button:hover { border-color: var(--accent); }
.cal button.has-jobs {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.cal button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--bone); }
.cal .pips { display: flex; gap: 2px; }
.cal .pips i { width: 4px; height: 4px; border-radius: 50%; background: var(--moss); }
.cal button[aria-pressed="true"] .pips i { background: var(--bone); }

/* ------------------------------------------------------ desktop, ≥ 900px */
@media (min-width: 900px) {
  .view { max-width: var(--shell-max); padding: var(--s6) var(--s6) var(--s6); }
  .tabbar { display: none; }
  .topbar { padding: var(--s3) var(--s6); }

  .shell { display: grid; grid-template-columns: 224px 1fr; gap: var(--s6); align-items: start; }
  .rail {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    position: sticky;
    top: 88px;
  }
  .rail a {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.95rem;
  }
  .rail a:hover { background: var(--surface); color: var(--text); }
  .rail a[aria-current="page"] { background: var(--forest); color: var(--bone); font-weight: 600; }
  .rail svg { width: 20px; height: 20px; }
  .rail .rail-label { padding: var(--s4) var(--s3) var(--s2); }

  .mission { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s5); align-items: start; }
  .mission-wide { grid-column: 1 / -1; }
  .evidence-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

  /* Field mode on a desktop is a preview of a phone, framed and labelled —
     it is not the desktop experience and should not pretend to be. */
  .fieldmode { position: relative; inset: auto; border-radius: var(--r-lg); max-width: 460px; margin: 0 auto; min-height: 640px; box-shadow: var(--shadow-lift); }
}


/* ==========================================================================
   TALK — real microphone capture. No AI anywhere near this.
   ========================================================================== */

/* A section he talked through, marked on the section list. */
.chip-record { border-color: var(--record); color: var(--record); gap: 4px; }
.chip-record svg { width: 13px; height: 13px; }

/* Tap or talk. Two doors, the same size, neither of them the default. */
.optbtn {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  min-height: 84px;
  padding: var(--s4) var(--s5);
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.optbtn:hover { border-color: var(--moss); }
.optbtn-title { font-size: 1.08rem; font-weight: 600; }
.optbtn-sub { font-size: 0.84rem; color: var(--text-dim); }
.optbtn-dot {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mist);
  color: var(--forest);
}
.optbtn-mic { border-color: var(--record); }
.optbtn-mic .optbtn-dot { background: var(--record); color: #fff; }

/* The recording stage. One control, unmistakable, thumb-reachable. */
.recstage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s4);
  padding: var(--s5) 0 var(--s3);
}
.rec-clock {
  font-family: var(--display);
  font-size: 2.1rem;
  font-variant-numeric: tabular-nums;
  color: var(--head);
  line-height: 1;
}
.wave { display: flex; align-items: center; gap: 3px; height: 48px; }
.wave > i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--record);
  transition: height 90ms linear;
}
.recbtn {
  width: 104px;
  height: 104px;
  border: 0;
  border-radius: 50%;
  background: var(--record);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(142, 42, 32, 0.75);
}
.recbtn:hover { background: var(--record-deep); }
.recbtn:disabled { background: var(--muted); cursor: not-allowed; box-shadow: none; }
.recbtn.live { animation: rec-pulse 2s ease-out infinite; }
@keyframes rec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(190, 58, 43, 0.42); }
  70% { box-shadow: 0 0 0 26px rgba(190, 58, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(190, 58, 43, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .recbtn.live { animation: none; outline: 3px solid var(--record); outline-offset: 4px; }
  .wave > i { transition: none; }
}

/* A saved take: play it, see it, delete it. */
.takerow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.takerow audio { display: none; }
.playbtn {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  color: var(--bone);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.playbtn:hover { background: var(--moss); }
.playtrack { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.playtrack > i { display: block; height: 100%; width: 0; background: var(--moss); }

/* Something he needs to know, in a sentence, in place. */
.notice {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  font-size: 0.85rem;
  line-height: 1.5;
}
.notice > svg { flex: none; margin-top: 2px; color: var(--text-dim); }
.notice-warn { border-color: var(--warning); }
.notice-warn > svg { color: var(--warning); }
/* Danger is error TEXT only — the border and the glyph carry it, never a fill. */
.notice-bad { border-color: var(--danger); }
.notice-bad > svg { color: var(--danger); }
.notice-bad > span { color: var(--danger); }

/* ==========================================================================
   THE CHECK SCREEN — one line, then one decision, then the rest collapsed.
   David's ruling on the mockup was "too much to read", and this layout is it.
   ========================================================================== */

/* The one line of truth. */
.tally { font-size: 0.92rem; color: var(--text-dim); margin: 0; }
.tally b { color: var(--text); font-variant-numeric: tabular-nums; }

/* The single thing that actually needs him. Amber: a flag, not an error. */
.needscard {
  border: 1px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface-raised));
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.needslbl {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8a5a17;
}
.needsask { font-family: var(--display); font-size: 1.05rem; line-height: 1.3; margin: 0; }
.needsval { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--head); }
.quote {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-dim);
  border-left: 2px solid var(--rule);
  padding-left: var(--s3);
}

/* What it got right, one line each. Reading the evidence is opt-in. */
.slim { border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--surface-raised); }
.slim > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s3);
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: var(--s3) var(--s4);
  min-height: var(--tap-sm);
  font: inherit;
  font-family: var(--sans);
  color: var(--text);
  cursor: pointer;
}
.slim > button:last-child { border-bottom: 0; }
.slim .k { font-size: 0.82rem; color: var(--text-dim); flex: none; width: 7.5rem; }
.slim .v { font-weight: 600; font-size: 0.92rem; flex: 1; min-width: 0; }
.slim .tickmark { color: var(--moss); flex: none; display: inline-flex; }
.slim .chev { color: var(--text-dim); flex: none; display: inline-flex; transition: transform 0.18s ease; }
.slim .open .chev { transform: rotate(90deg); }
.slim .drawer {
  padding: 0 var(--s4) var(--s3);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  align-items: flex-start;
}
.slim .drawer p {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-dim);
  border-left: 2px solid var(--rule);
  padding-left: var(--s3);
}

/* A gap. It follows him to the end; it never blocks him. Dashed, not red:
   an unanswered question is unfinished work, not an error. */
.openrow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  border: 1px dashed var(--rule);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  background: transparent;
}
.openrow b { font-size: 0.9rem; font-weight: 600; }
.openrow small { font-size: 0.76rem; }

/* Everything he said, folded away by default. */
.transcript { border-top: 1px solid var(--rule); padding-top: var(--s3); }
.transcript summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-dim);
  min-height: var(--tap-sm);
  display: flex;
  align-items: center;
}
.transcript p { font-size: 0.86rem; color: var(--text-dim); line-height: 1.55; margin: var(--s2) 0 0; }
