:root {
  --bg: #EDEBE6;
  --ink: #1E1E1D;
  --ink-soft: #63666A;
  --accent: #4F6373;
  --line: #DADCDD;
  --surface: #FFFFFF;
  --heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  /* fixed "machine voice" palette for the Machine Reading panel -- deliberately not
     theme-dependent, so it reads as a distinct register from the rest of the app */
  --machine-bg: #12161C;
  --machine-panel-surface: #191E26;
  --machine-ink: #D9EBEF;
  --machine-ink-soft: #7C8A93;
  --machine-accent: #7FD8E8;
  --machine-warn: #F2A93C;
  --machine-line: #29323C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
/* Avoids "runts" -- a lone word stranded on a paragraph's last line -- by letting the
   browser rebalance the last couple of lines instead of naive greedy wrapping. Pure
   progressive enhancement: browsers without support just wrap normally. */
p, li { text-wrap: pretty; }
html {
  /* Kept in sync with body's background (see showScreen() in app.js) -- some mobile
     browsers paint the html element's background, not body's, in the pull-to-refresh/
     rubber-band area beyond a scrolled screen's edge. */
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow: hidden;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.btn {
  font: inherit;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--primary:hover { opacity: 0.85; }
.btn--ghost {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.15);
  font-size: 0.82rem;
  padding: 9px 16px;
}
.btn--corner {
  position: fixed;
  bottom: 76px;
  right: 76px;
  z-index: 10;
}

/* ---- screen management ---- */
.screen {
  display: none;
  width: 100vw;
  height: 100vh; /* fallback for browsers without dvh support */
  height: 100dvh; /* tracks the actual visible viewport on mobile Safari as the address bar shows/hides */
}
.screen.active { display: flex; }

/* ---- upload (home page) ----
   Deliberately its own palette (pale blue, bold sans, no darkening) previewing the DIVE
   process page's own hero -- scoped here via CSS variable overrides the same way
   #machine-panel gets its own fixed dark identity, so the shared component classes
   (.eyebrow, links, etc.) automatically pick up the new colors without duplicating them. */
#upload-screen {
  --bg: #DCEEF2;
  --ink: #13242B;
  --accent: #3C6C7E;
  --line: rgba(19, 36, 43, 0.15);
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 24px;
}
.upload-scroll {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) 0 56px;
}

.essay-intro { margin-bottom: 48px; }
.essay-intro a { color: var(--accent); font-weight: 600; }
.essay-title {
  font-family: var(--heading);
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 24px;
}
.essay-intro .essay-lede {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 40px;
  line-height: 1.6;
  max-width: 62ch;
}
.essay-intro h2 {
  font-family: var(--heading);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 10px;
}
.essay-intro p {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}
.essay-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
@media (max-width: 640px) {
  .essay-compare { grid-template-columns: 1fr; gap: 20px; }
}
.essay-intro > h2 { margin-top: 8px; }
.essay-intro > p + p { margin-top: 14px; }
#gap-more { margin-top: 14px; }
#gap-more p + p { margin-top: 14px; }

.essay-box {
  border-radius: 10px;
  padding: 26px 24px;
}
.essay-box-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.essay-box h2 { margin: 0 0 10px; }
.essay-box p { margin: 0; }
.essay-box--human {
  background: #EDEBE6;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.essay-box--human .essay-box-tag { color: var(--accent); }
/* Machine box reuses the exact fixed dark/mono identity used everywhere else the
   machine reads something -- Machine Reading, the Compare screen -- so this is a real
   preview of what's coming, not just a differently-colored box. */
.essay-box--machine {
  --ink: var(--machine-ink);
  --accent: var(--machine-accent);
  background: var(--machine-bg);
  color: var(--machine-ink);
  font-family: var(--mono);
}
.essay-box--machine h2 { color: var(--machine-ink); font-family: var(--heading); }
.essay-box--machine p { font-size: 0.85rem; }
.essay-box--machine .essay-box-tag { color: var(--machine-accent); }

.essay-about {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.essay-about h2 { font-size: 1.2rem; margin-bottom: 12px; }
.essay-about p { margin-bottom: 24px; }
.essay-cta {
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  background: #E8623D;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer;
}
.essay-cta:hover { background: #d1552f; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- consent ---- */
#consent-screen {
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.consent-box {
  max-width: 56ch;
  text-align: left;
}
.consent-box h1 {
  font-family: var(--heading);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 18px;
}
.consent-copy {
  font-size: 1.02rem;
  color: var(--ink);
  margin: 0 0 16px;
}
.consent-copy--small {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.consent-error {
  color: #A23B2E;
  font-size: 0.88rem;
  margin-top: 14px;
}

/* ---- calibration intro ---- */
#calibration-intro-screen {
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.calibration-copy {
  max-width: 56ch;
  text-align: center;
}
.calibration-copy h2 {
  font-family: var(--heading);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  margin: 0 0 12px;
}
.calibration-copy p { margin: 0 0 8px; color: var(--ink-soft); }
.calibration-copy .btn { margin-top: 14px; }

/* ---- calibration dots ---- */
#calibration-screen {
  position: relative;
  padding: 0;
}
.calibration-reminder {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 46ch;
  text-align: center;
  background: var(--surface);
  border-radius: 8px;
  padding: 28px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 6;
}
.calibration-reminder p { margin: 0 0 8px; color: var(--ink-soft); }
.calibration-reminder .btn { margin-top: 10px; }
#calibration-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* WebGazer injects its own video/overlay elements straight into <body>;
   shrink + fade them into a corner so they read as a quiet aside, not the point. */
#webgazerVideoContainer {
  width: 200px !important;
  height: 150px !important;
  top: 16px !important;
  left: auto !important;
  right: 16px !important;
  bottom: auto !important;
  opacity: 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 5;
}
#webgazerVideoFeed, #webgazerFaceOverlay, #webgazerFaceFeedbackBox {
  width: 200px !important;
  height: 150px !important;
}

/* Calibration Intro and "Ready to look?" reparent the live #webgazerVideoContainer into
   one of these in-flow slots (see moveVideoPreviewInto() in app.js) instead of leaving it
   pinned to the corner -- twice the default size, centered below the instructions, capped
   so it can never exceed the viewport regardless of screen size. The higher specificity
   here (class + ID) reliably overrides the corner-pinned rule above. */
.webgazer-preview-slot {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.webgazer-preview-slot:empty { display: none; }
.webgazer-preview-slot #webgazerVideoContainer {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(400px, 90vw, calc(70vh * 4 / 3)) !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
}
.webgazer-preview-slot #webgazerVideoFeed,
.webgazer-preview-slot #webgazerFaceOverlay,
.webgazer-preview-slot #webgazerFaceFeedbackBox {
  width: 100% !important;
  height: 100% !important;
}
#face-position-overlay {
  position: absolute;
  border: 2px solid #e0483e;
  border-radius: 4px;
  box-sizing: border-box;
  pointer-events: none;
}
.cal-dot {
  --dwell-pct: 0;
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(79,99,115,0.08);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.cal-dot:hover { transform: translate(-50%, -50%) scale(1.08); }
.cal-dot.dwelling {
  transition: transform 0.1s ease; /* no background transition -- the conic fill updates every frame */
  background: conic-gradient(var(--accent) calc(var(--dwell-pct) * 360deg), rgba(79,99,115,0.08) 0deg);
}
.cal-dot.done {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---- deep looking ---- */
#looking-screen {
  background: #000;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow-y: auto;
}
.looking-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.looking-frame[hidden] { display: none; }
.looking-ready-box {
  max-width: 56ch;
  padding: 32px;
  text-align: left;
  color: #fff;
}
.looking-ready-box .eyebrow { color: var(--accent); }
.looking-ready-box h1 {
  font-family: var(--heading);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 18px;
  color: #fff;
}
.looking-ready-box p {
  font-size: 1.02rem;
  color: rgba(255,255,255,0.85);
  margin: 0 0 16px;
}
.looking-ready-box .looking-ready-note {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
}
.looking-ready-box .btn {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-top: 8px;
}
.looking-ready-box .looking-ready-recalibrate {
  margin: 32px 0 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}
#looking-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- feedback ---- */
#feedback-screen {
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.feedback-wrap {
  max-width: 720px;
  width: 100%;
  text-align: left;
}
.feedback-time {
  font-size: 1.1rem;
  margin: 0 0 4px;
}
.feedback-time strong { font-family: var(--heading); font-size: 1.3rem; }
.feedback-time--away {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.feedback-time--away strong { font-size: 1.05rem; }
.feedback-reflection {
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 20px;
  line-height: 1.5;
}
.feedback-heatmap-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}
.feedback-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.feedback-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
}
#heatmap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.feedback-caveat {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 20px 0 24px;
  line-height: 1.55;
}
.feedback-replay-btn {
  display: block;
  margin: 14px 0 0;
  font-size: 0.85rem;
}
#feedback-screen .btn--primary {
  display: block;
  width: fit-content;
  margin-left: auto;
}

/* ---- describe ---- */
#describe-screen {
  align-items: stretch;
  overflow: hidden;
}
.describe-layout {
  display: flex;
  width: 100%;
  height: 100%;
}
@media (max-width: 860px) {
  .describe-layout { flex-direction: column; overflow-y: auto; }
  .describe-photo-pane { flex: 0 0 auto; max-height: 45vh; overflow: hidden; }
}

.describe-photo-pane {
  flex: 1 1 55%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.describe-image-wrap {
  position: relative;
  max-width: 100%;
  max-height: calc(100% - 60px);
  line-height: 0;
}
#describe-image, #interpret-image, #verify-image, #evaluate-image, #machine-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#describe-canvas, #machine-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#describe-canvas.interactive, #machine-canvas.interactive { cursor: crosshair; touch-action: none; }

.machine-label-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.machine-label-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.machine-score {
  font-family: var(--mono);
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}
/* The five section headers on Machine Reading -- Labels, Content Flags, Face Analysis,
   Machine Interpretation, Machine Evaluation -- share this class specifically so they can
   all be sized and separated identically, distinct from the smaller plain
   .describe-step-count eyebrow used elsewhere (e.g. the "MACHINE READING" label at the
   top of the panel, which should stay small).
   Compound selector is deliberate, not decorative: every usage carries both
   .describe-step-count and .machine-subheading, and a bare .machine-subheading (0,1,0)
   silently lost the font-size fight to .describe-step-count's own font-size (also 0,1,0,
   but declared later in this file) -- same class of specificity/source-order bug already
   hit more than once elsewhere in this project. Chaining both classes here (0,2,0) wins
   unconditionally, regardless of where either rule sits in the file. */
.describe-step-count.machine-subheading {
  font-size: 1.05rem;
  margin: 32px 0 10px;
  padding-top: 20px;
  border-top: 2px solid var(--machine-line);
}

.machine-readout-heading {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 22px 0 6px;
}
.machine-readout-heading.measured { color: var(--machine-accent); }

.machine-face-label {
  font-family: var(--heading);
  font-size: 1rem;
  margin: 26px 0 4px;
}

.machine-crop-btn {
  font: inherit;
  font-size: 0.8rem;
  background: var(--machine-accent);
  color: var(--machine-bg);
  border: none;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
  margin: 6px 8px 6px 0;
}
.machine-crop-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.machine-crop-confirm {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 10px 0;
}

/* No border/padding here -- the section's own .machine-subheading now supplies the
   divider, and having both would double it up. */
.machine-llm-section {
  margin-top: 8px;
}

.machine-llm-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.machine-llm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
}

.machine-llm-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.machine-llm-score {
  font-family: var(--heading);
  font-size: 1.6rem;
  color: var(--accent);
  margin: 0 0 6px;
}

.machine-llm-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

/* ---- machine panel: fixed dark/mono identity, independent of the site's own theme ---- */
#machine-panel {
  --ink: var(--machine-ink);
  --ink-soft: var(--machine-ink-soft);
  --accent: var(--machine-accent);
  --line: var(--machine-line);
  --surface: var(--machine-panel-surface);
  background: var(--machine-bg);
  color: var(--machine-ink);
  font-family: var(--mono);
}
#machine-panel h2,
#machine-panel .dsb-value {
  font-family: var(--mono);
}
#machine-panel .consent-error {
  color: #FF6B5B;
}
/* .btn--primary normally puts light text (var(--bg)) on a dark ink-colored background,
   but #machine-panel redefines --ink to a *light* color for its own dark theme without
   touching --bg -- left alone, "See the comparison" rendered as near-invisible light
   text on a near-white background. */
#machine-panel .btn--primary {
  background: var(--machine-accent);
  color: var(--machine-bg);
  border-color: var(--machine-accent);
}

.depicted-subject-badge {
  margin-top: 18px;
  background: rgba(255,255,255,0.92);
  border-radius: 4px;
  padding: 10px 16px;
  max-width: 90%;
}
.dsb-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.dsb-value {
  font-family: var(--heading);
  font-size: 1.05rem;
  color: var(--ink);
}
.conceptual-subject-badge {
  margin: 10px 0 20px;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 10px 16px;
}

.describe-panel {
  flex: 1 1 45%;
  max-width: 560px;
  padding: clamp(24px, 4vw, 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.describe-step-count {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.describe-panel h2 {
  font-family: var(--heading);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin: 0 0 12px;
}
.describe-prompt {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 0.98rem;
  line-height: 1.5;
}
/* Used throughout Machine Reading for secondary/explanatory notes (confidence-score
   caveats, no-face/no-flags messages, the manual-crop hint, etc.) -- had no rule at all
   until now, so it was silently inheriting #machine-panel's full-brightness --ink instead
   of reading as muted secondary text like everything else in this style. */
.describe-hint {
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
/* Specifically the "nothing to report" messages (no labels/flags/face/expression found) --
   italic sets them apart from the general captions above, which use plain .describe-hint. */
.describe-hint--empty {
  font-style: italic;
}
.describe-intro {
  color: var(--ink-soft);
  margin: 0 0 4px;
  font-size: 0.98rem;
  line-height: 1.5;
}
.describe-section {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.try-another-line {
  margin-top: 14px;
  text-align: center;
}
.verify-methods {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}
.verify-methods li { margin-bottom: 6px; }
.describe-field {
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  margin-bottom: 12px;
}
.describe-field:focus { outline: none; border-color: var(--accent); }
textarea.describe-field { resize: vertical; min-height: 90px; }

.describe-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: -8px 0 16px;
  font-style: italic;
}

.explain-toggle {
  font: inherit;
  font-size: 0.78rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  margin: 0 0 10px;
  display: inline-block;
}
.explain-text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--surface);
  border-left: 2px solid var(--accent);
  padding: 8px 12px;
  margin: -4px 0 14px;
  line-height: 1.5;
}
.explain-text[hidden] { display: none; }

/* spectrum slider (Framing) */
.spectrum-wrap { margin: 8px 0 20px; }
.eval-mode-label { margin-top: 24px; }
.eval-why-field { margin-top: -12px; min-height: 44px; font-size: 0.92rem; }
textarea.eval-why-field { min-height: 44px; }
/* .describe-panel is a column flex container, so a textarea's `rows` attribute alone
   doesn't drive its flex-basis height the way it would in normal flow -- min-height is
   what actually determines the rendered height here, so the "bigger box" for studium
   needs an explicit min-height, not just a bigger `rows` value. */
#evaluate-studium-why { min-height: 112px; }
.eval-mode-value {
  font-family: var(--mono);
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: normal;
  margin-left: 6px;
}
.spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.spectrum-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  outline: none;
}
.spectrum-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.spectrum-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* chip choices (single or multi select) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chip {
  font: inherit;
  font-size: 0.86rem;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.selected {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.describe-nav {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.describe-back {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px 0;
}
.describe-next:disabled, .describe-continue:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- photo attribution ---- */
.photo-credit-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 4px 9px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--sans);
  line-height: 1.4;
  text-align: left;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
}
.photo-credit-overlay em { font-style: italic; }

.photo-credit-static {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: -8px 0 20px;
}
.photo-credit-static em { font-style: italic; }

/* ---- compare (stage 8) ----
   Scoped to the same pale-blue palette as the home page (#upload-screen) and the D.I.V.E.
   page (#dive-screen), so the exercise ends in the same visual register it began in. */
#compare-screen {
  --bg: #DCEEF2;
  --ink: #13242B;
  --accent: #3C6C7E;
  --line: rgba(19, 36, 43, 0.15);
  background: var(--bg);
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
  overflow-y: auto;
}
.compare-wrap {
  max-width: 900px;
  width: 100%;
}
.compare-wrap h1 {
  font-family: var(--heading);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  line-height: 1.2;
}
.compare-lede {
  font-style: italic;
  max-width: 62ch;
}
.compare-photo-wrap {
  position: relative;
  max-width: 440px;
  margin: 28px auto 8px;
  line-height: 0;
}
.compare-photo-wrap img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}
.compare-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 28px;
}
.compare-section h2 {
  font-family: var(--heading);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  margin: 0 0 8px;
}
.compare-columns {
  display: flex;
  gap: 30px;
  margin-top: 16px;
}
.compare-col {
  flex: 1 1 50%;
  min-width: 0;
  border-radius: 10px;
  padding: 26px 24px;
}
/* Same box treatment as the home page's human/machine preview boxes (.essay-box) --
   this screen is where that same comparison finally has real, filled-in content. */
.compare-col--human {
  background: #EDEBE6;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.compare-col-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.compare-col--human .compare-col-label { color: var(--accent); }
.compare-value {
  font-family: var(--heading);
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
}
.compare-value-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.compare-value-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

/* Machine columns get the same fixed dark/mono identity used on the Machine Reading
   screen -- keeps the human/machine visual distinction consistent everywhere it appears. */
.compare-col--machine {
  --ink: var(--machine-ink);
  --ink-soft: var(--machine-ink-soft);
  --accent: var(--machine-accent);
  --line: var(--machine-line);
  --surface: var(--machine-panel-surface);
  background: var(--machine-bg);
  color: var(--machine-ink);
  font-family: var(--mono);
}
.compare-col--machine .compare-value,
.compare-col--machine .machine-llm-text {
  font-family: var(--mono);
}
.compare-col--machine .consent-error { color: #FF6B5B; }
.compare-reveal-btn { margin-top: 4px; }

.compare-thumb {
  position: relative;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
}
.compare-thumb img { width: 100%; height: auto; display: block; }
.compare-thumb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.compare-boxes-empty-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
}
.compare-attention-stats {
  margin: -4px 0 12px;
  font-size: 0.9rem;
}

.compare-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .compare-columns { flex-direction: column; gap: 20px; }
}

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

/* ---- DIVE (Process) screen ----
   Deliberately single-theme (see design-drafts/dive-infographic.html) -- the light-to-dark
   descent IS the content, a light/dark toggle would break the metaphor. Everything here is
   scoped under #dive-screen so it can't leak into (or be affected by) the rest of the app's
   shared theme, the same way #machine-panel keeps its own fixed dark identity. */
#dive-screen {
  --ember: #E8623D;
  --ember-soft: #F0906F;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  background: #DCEEF2;
  color: #13242B;
  font-family: var(--sans);
}

#dive-screen .rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  pointer-events: none;
}
@media (max-width: 640px) { #dive-screen .rail { width: 30px; } }
#dive-screen .rail-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: rgba(19,36,43,0.18);
}
#dive-screen .rail-tick {
  position: relative;
  width: 100%;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  color: rgba(19,36,43,0.45);
  background: #DCEEF2;
  padding: 2px 0;
  transition: color 0.4s ease, opacity 0.4s ease;
}
#dive-screen .rail-tick.dark { color: rgba(243,239,232,0.55); background: transparent; }
#dive-screen .rail-tick.active { color: var(--ember); font-weight: 700; }

#dive-screen .hero {
  position: relative;
  padding: 88px 24px 64px 84px;
  max-width: 900px;
}
@media (max-width: 640px) { #dive-screen .hero { padding: 72px 20px 48px 56px; } }
#dive-screen .kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3C6C7E;
  margin: 0 0 18px;
}
#dive-screen h1.title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  font-weight: 800;
  text-wrap: balance;
}
#dive-screen .hero .lede {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 0 40px;
  max-width: 58ch;
  color: #13242B;
  font-style: italic;
}

#dive-screen .versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  #dive-screen .versus { grid-template-columns: 1fr; }
  #dive-screen .versus .vs-mark { display: none; }
}
#dive-screen .habit-card {
  border-radius: 10px;
  padding: 26px 24px;
}
#dive-screen .habit-card .tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
  opacity: 0.75;
}
#dive-screen .habit-card .big {
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  line-height: 1.15;
}
#dive-screen .habit-card .big .arrow { opacity: 0.55; font-weight: 500; padding: 0 4px; }
#dive-screen .habit-card p.desc { margin: 0; font-size: 0.94rem; line-height: 1.5; }

#dive-screen .habit-card--shallow {
  background: rgba(255,255,255,0.55);
  border: 1.5px dashed rgba(19,36,43,0.3);
  color: #13242B;
}
#dive-screen .habit-card--shallow .big { text-decoration: line-through; text-decoration-color: rgba(19,36,43,0.35); text-decoration-thickness: 2px; }

#dive-screen .habit-card--deep {
  background: linear-gradient(135deg, #3C6C7E 0%, #17323E 100%);
  color: #F3EFE8;
  box-shadow: 0 12px 32px -12px rgba(23,50,62,0.55);
}
#dive-screen .habit-card--deep .tag { color: var(--ember-soft); opacity: 1; }

#dive-screen .vs-mark {
  align-self: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(19,36,43,0.45);
}

#dive-screen .scroll-cue {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #3C6C7E;
  display: flex;
  align-items: center;
  gap: 12px;
}
#dive-screen .down {
  display: inline-block;
  font-size: 2rem;
  line-height: 1;
  color: var(--ember);
  animation: dive-bob 1.6s ease-in-out infinite;
}
#dive-screen .step-desc .down {
  font-size: 1.3rem;
  margin-left: 6px;
  vertical-align: -0.3em;
}
@keyframes dive-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

#dive-screen .zone {
  position: relative;
  padding: 76px 24px 76px 84px;
  display: flex;
  align-items: center;
  min-height: 62vh;
}
@media (max-width: 640px) { #dive-screen .zone { padding: 56px 20px 56px 56px; min-height: auto; } }

#dive-screen .zone-inner {
  max-width: 640px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#dive-screen .zone-inner.in-view { opacity: 1; transform: translateY(0); }

#dive-screen .zone--look    { background: linear-gradient(180deg, #DCEEF2 0%, #A9CDD6 100%); color: #13242B; }
#dive-screen .zone--describe { background: linear-gradient(180deg, #A9CDD6 0%, #5E93A3 100%); color: #0F2129; }
#dive-screen .zone--interpret { background: linear-gradient(180deg, #5E93A3 0%, #3C6C7E 100%); color: #F3EFE8; }
#dive-screen .zone--verify  { background: linear-gradient(180deg, #3C6C7E 0%, #274C5C 100%); color: #F3EFE8; }
#dive-screen .zone--evaluate { background: linear-gradient(180deg, #274C5C 0%, #17323E 100%); color: #F3EFE8; }

#dive-screen .step-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 6px;
}
#dive-screen .step-letter {
  font-size: clamp(3.4rem, 9vw, 5.2rem);
  font-weight: 800;
  line-height: 0.8;
  color: var(--ember);
  letter-spacing: -0.02em;
}
#dive-screen .step-name {
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
#dive-screen .step-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 18px;
}
#dive-screen .step-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
  max-width: 52ch;
}
#dive-screen .step-desc strong { font-weight: 700; }

#dive-screen .depth-tag {
  position: absolute;
  top: 28px;
  right: 28px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  opacity: 0.55;
}
@media (max-width: 640px) { #dive-screen .depth-tag { display: none; } }

#dive-screen .zone--look .step-name { font-size: clamp(2.4rem, 6vw, 3.6rem); }

#dive-screen .floor {
  position: relative;
  background: #0A1A21;
  color: #F3EFE8;
  padding: 90px 24px 110px 84px;
  text-align: left;
}
@media (max-width: 640px) { #dive-screen .floor { padding: 64px 20px 84px 56px; } }
#dive-screen .floor-inner { max-width: 640px; }
#dive-screen .floor .kicker { color: var(--ember-soft); }
#dive-screen .floor h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 18px;
  text-wrap: balance;
}
#dive-screen .floor p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(243,239,232,0.85);
  max-width: 54ch;
}
#dive-screen .floor-cta {
  display: inline-block;
  margin-top: 32px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  background: var(--ember);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer;
}
#dive-screen .floor-cta:hover { background: #d1552f; }
#dive-screen .floor .credit {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(243,239,232,0.4);
}

#dive-screen .bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(243,239,232,0.12);
  pointer-events: none;
  animation: dive-rise linear infinite;
}
@keyframes dive-rise {
  from { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  to { transform: translateY(-140px); opacity: 0; }
}

/* ---- choose photo (stage -0.25) ----
   Same pale-blue palette as the home page, D.I.V.E., and Compare screens -- this is the
   screen that finally collects the photo those earlier screens were all leading up to.
   Top-anchored (align-items: flex-start) rather than centered, same as #consent-screen --
   centered flex content that overflows can be unreachable at the top on short viewports. */
#choose-photo-screen {
  --bg: #DCEEF2;
  --ink: #13242B;
  --accent: #3C6C7E;
  --line: rgba(19, 36, 43, 0.15);
  background: var(--bg);
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.choose-photo-box {
  max-width: 480px;
  width: 100%;
  margin: 48px auto;
  text-align: left;
}
.choose-photo-box .eyebrow { color: var(--accent); }
.choose-photo-title {
  font-family: var(--heading);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 16px;
}
.choose-photo-lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 36px;
}

.upload-box + .upload-box { margin-top: 0; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  padding: 48px 24px;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag {
  background: rgba(255,255,255,0.85);
  border-color: var(--ink);
  outline: none;
}
.dropzone strong { font-size: 1.05rem; color: var(--ink); }
.dropzone span { font-size: 0.85rem; color: var(--ink); opacity: 0.65; }

.upload-sample-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink);
}
.upload-sample-link a { color: var(--accent); font-weight: 600; }

.upload-error {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: #A23B2E;
}

.upload-preview-wrap {
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  max-height: 420px;
  background: #000;
}
.upload-preview-wrap img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
/* .photo-credit-static normally sits flush under a photo with no letterboxing behind it;
   this preview's black background needs the credit line pushed clear of it instead. */
#choose-photo-screen .photo-credit-static {
  margin-top: 10px;
}

.upload-preview-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
/* Same ember accent as .essay-cta/.floor-cta elsewhere in the app -- solid for the
   forward action, outline for the secondary one, so both read as "orange" without
   competing for the same visual weight. */
.photo-cta {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 6px;
  cursor: pointer;
}
.photo-cta--solid {
  background: #E8623D;
  color: #fff;
  border: none;
}
.photo-cta--solid:hover { background: #d1552f; }
.photo-cta--outline {
  background: transparent;
  border: 1.5px solid #E8623D;
  color: #E8623D;
}
.photo-cta--outline:hover { background: rgba(232, 98, 61, 0.08); }

.upload-process-note {
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--ink);
  opacity: 0.75;
  text-align: left;
}
.upload-process-note a { color: var(--accent); font-weight: 600; }
