/* Bentonville, Taking Shape: a Bentonville.ai project.
   Drafting sheet in the parent palette. Pencil = draft, ink = review,
   paper = approved, material + copper flag = published. Model materials are never recoloured. */

@font-face { font-family: "Besley"; src: url("fonts/besley-latin-variable.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Shared Bentonville.ai palette */
  --paper-brand: #f8f6f0;
  --forest: #1f3d32;
  --charcoal: #2d2d2d;
  --stone: #e7dfd2;
  --mist: #b7c7c9;
  --copper: #b46f3d;        /* decorative only */
  --copper-text: #8e502b;   /* copper where it carries or sits under text */
  /* Roles used throughout the sheet */
  --film: var(--paper-brand);
  --film-deep: #dfe5e3;     /* mist, lightened, for practice streets */
  --grid: rgba(31, 61, 50, 0.05);
  --graphite: var(--charcoal);
  --graphite-soft: #5b5852;
  --ink: var(--forest);
  --paper: #ffffff;
  --flag: var(--copper);
  --alarm: #a3222f;
  --caution: #7a5300;
  --display: "Besley", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --rule: 1.5px solid var(--ink);
  --hair: 1px solid rgba(31, 61, 50, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--graphite);
  font: 400 1rem/1.55 var(--sans);
  background-color: var(--film);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.skip {
  position: absolute; left: 0.75rem; top: -3rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.8rem; font-family: var(--sans);
}
.skip:focus { top: 0.75rem; }

:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }

button, select, input { font: inherit; }
button {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: var(--rule);
  border-radius: 2px;
  padding: 0.42rem 0.8rem;
  min-height: 2.5rem;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #fff; }
button:disabled { opacity: 0.4; cursor: default; }
/* Filled buttons keep their ink fill on hover so paper-colored text stays readable. */
button.primary, button.primary:hover:not(:disabled),
.tabs [role="tab"][aria-selected="true"], .tabs [role="tab"][aria-selected="true"]:hover {
  background: var(--ink); color: var(--paper);
}
button.primary:hover:not(:disabled), .tabs [role="tab"][aria-selected="true"]:hover { background: #173026; }

/* ---------- layout ---------- */

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "mast" "sheet" "title" "book";
  min-height: 100dvh;
}

.masthead {
  grid-area: mast;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem) 0;
}
/* Parent identity, then this experience's title. The logo is the approved
   full-colour primary SVG at the parent's ~220px width, never redrawn or recoloured. */
.brandline { display: flex; align-items: center; gap: 0.6rem 1.1rem; flex-wrap: wrap; min-width: 0; }
.parent-logo { display: block; flex: none; line-height: 0; border-radius: 2px; }
.parent-logo img { display: block; width: 220px; height: auto; }
.experience { min-width: 0; padding-left: 1.1rem; border-left: 1px solid var(--stone); }
.experience-title {
  margin: 0;
  font: 600 clamp(1.35rem, 2vw, 1.7rem)/1.1 var(--display);
  color: var(--ink);
  letter-spacing: -0.005em;
}
.experience-desc { margin: 0.2rem 0 0; font: 400 0.8rem/1.35 var(--sans); color: var(--graphite-soft); max-width: 50ch; }

.tabs { display: flex; }
.tabs [role="tab"] { border-radius: 0; margin-left: -1.5px; min-width: 5.5rem; }
.tabs [role="tab"]:first-child { border-radius: 2px 0 0 2px; margin-left: 0; }
.tabs [role="tab"]:last-child { border-radius: 0 2px 2px 0; }
.tabs [aria-selected="true"] { position: relative; }

.sheet {
  grid-area: sheet;
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 0 clamp(1rem, 3vw, 2rem) 1rem;
}

.intro { padding-top: clamp(1rem, 3vw, 2rem); max-width: 46rem; }
/* The dynamic progress headline: clear, but subordinate to the experience title. */
#headline {
  margin: 0;
  font: 600 clamp(1.6rem, 3.2vw, 2.6rem)/1.08 var(--display);
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 17ch;
  text-wrap: balance;
}
.lede { margin: 0.8rem 0 0; max-width: 62ch; font-size: 1.02rem; line-height: 1.6; }

.banner {
  margin: 0.9rem 0 0;
  max-width: 62ch;
  padding: 0.55rem 0.8rem;
  font: 400 0.95rem/1.45 var(--sans);
  border-left: 4px solid currentColor;
  background: rgba(248, 246, 240, 0.85);
}
.banner-error { color: var(--alarm); }
.banner-stale { color: var(--caution); }
.banner-loading { color: var(--graphite-soft); border-left-style: dotted; }

[hidden] { display: none !important; }

/* ---------- actual-model stage ---------- */

/* Everything on the sheet takes its natural height and flows in order; the sheet scrolls. */
.sheet > * { flex-shrink: 0; }
.stage { display: flex; flex-direction: column; flex: 0 0 auto; margin-top: 0.6rem; }
.stage-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1rem;
  padding-bottom: 0.45rem;
}
.model-pick, .view-pick { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.stage-bar button { min-height: 2.25rem; padding: 0.3rem 0.65rem; font-size: 0.88rem; }
.stage-bar button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.stage-bar button[aria-pressed="true"]:hover:not(:disabled) { background: var(--ink); }
.view-pick #btn-zoom-in, .view-pick #btn-zoom-out { min-width: 2.25rem; font-size: 1.05rem; }

.stage-view {
  position: relative;
  overflow: hidden;
  min-height: 18rem;
  height: min(68vh, 44rem);
  border: var(--rule);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--film);
  touch-action: none;
}
.stage-view:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.stage-view.is-blank .stage-canvas { visibility: hidden; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.stage-canvas:active { cursor: grabbing; }

.stage-stamp { top: 0.6rem; right: 0.6rem; z-index: 2; }

.stage-status {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  transform: translate(-50%, -50%);
  width: min(28rem, calc(100% - 2rem));
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: var(--rule);
  font: 400 0.95rem/1.45 var(--sans);
  color: var(--ink);
}
.stage-status p { margin: 0 0 0.55rem; }
.stage-status p:last-child { margin-bottom: 0; }
.stage-status progress { width: 100%; height: 0.5rem; accent-color: var(--ink); margin: 0 0 0.55rem; }
.stage-status.is-error { color: var(--alarm); border-color: var(--alarm); }
.stage-status button { margin-top: 0.2rem; }

.tags { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0;
  margin: -1.9rem 0 0 -0.95rem;
  min-width: 1.9rem; min-height: 1.5rem; padding: 0.05rem 0.3rem;
  font: 700 0.75rem/1.3 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  pointer-events: auto;
}
.tag::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 1.5px; height: 0.4rem; background: var(--ink);
}
.tag.is-selected { background: var(--copper-text); border-color: var(--copper-text); color: #fff; }
.tag.is-selected::after { background: var(--copper-text); }

.sheet-frame {
  position: absolute; inset: 1.2rem;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: clamp(1rem, 4vw, 3rem);
  border: 1px dashed rgba(31, 61, 50, 0.45);
  color: var(--graphite);
}
.sheet-frame p { margin: 0.3rem 0; max-width: 46ch; }
.sheet-frame .empty-title { font: 600 clamp(1.2rem, 2.4vw, 1.7rem)/1.15 var(--display); color: var(--ink); }

.stage-caption { font: 400 0.76rem/1.5 var(--mono); color: var(--graphite-soft); max-width: 86ch; overflow-wrap: anywhere; }
.stage-caption p { margin: 0.45rem 0 0; }

.placements {
  list-style: none; margin: 0.7rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.25rem;
}
.placements button {
  width: 100%; min-height: 2.3rem; display: flex; gap: 0.5rem; align-items: baseline; text-align: left;
  padding: 0.3rem 0.5rem; border: var(--hair); font-size: 0.85rem;
}
.placements .pl-num { font-weight: 700; min-width: 1.6rem; }
.placements .pl-name { overflow-wrap: anywhere; }
.placements button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- folds, source line, drawing label ---------- */

/* Technical detail lives in folds: collapsed by default, one line of summary each. */
.fold { margin-top: 0.7rem; max-width: 78ch; }
.fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: baseline; gap: 0.45rem;
  min-height: 2rem; padding: 0.3rem 0;
  font: 400 0.88rem/1.3 var(--sans);
  color: var(--ink);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "+"; display: inline-block; width: 0.9rem; font-weight: 700; text-align: center; }
.fold[open] > summary::before { content: "\2212"; }
.fold > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.notes-box .notes { margin-top: 0.2rem; }
.stage-checks .stage-caption p:first-child { margin-top: 0.1rem; }
.detail .fold dl { margin-top: 0.3rem; }

.source-line { margin: 0.35rem 0 0; font: 400 0.82rem/1.4 var(--sans); color: var(--graphite-soft); max-width: 92ch; }

/* The drawing's title label, lower left of the model, like a sheet's view title. */
.stage-label {
  position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 2;
  max-width: min(30rem, calc(100% - 1.2rem));
  padding: 0.35rem 0.6rem;
  background: rgba(248, 246, 240, 0.9);
  border-left: 3px solid var(--ink);
  font: 400 0.8rem/1.35 var(--sans);
  color: var(--graphite);
  pointer-events: none;
}
.stage-label p { margin: 0; }
.stage-label .stage-label-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); }

/* ---------- plat (practice only) ---------- */

.plat {
  position: relative;
  margin: 0.5rem 0 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column;
}
#plat {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.55;
  max-height: 72vh;
  touch-action: manipulation;
}

.street { fill: var(--film-deep); }
.square { fill: #c9d7c5; stroke: rgba(52, 56, 60, 0.35); stroke-width: 0.3; }
.path { stroke: rgba(248, 246, 240, 0.9); stroke-width: 1.6; fill: none; }
.fountain { fill: #b9ccd3; stroke: var(--ink); stroke-width: 0.3; }
.trunk { stroke: #5c6157; stroke-width: 0.6; }
.crown { fill: #9db497; stroke: #657e61; stroke-width: 0.3; }
.north line { stroke: var(--ink); stroke-width: 0.5; }
.north circle { fill: var(--ink); }
.north text { font: 700 5px var(--sans); fill: var(--ink); }
.hatch-line { stroke: var(--graphite); stroke-width: 0.32; opacity: 0.55; }

.lot { cursor: pointer; outline: none; }
.lot .ground {
  fill: rgba(248, 246, 240, 0.72);
  stroke: var(--graphite);
  stroke-width: 0.32;
  stroke-dasharray: 0.9 1.1;
}
.lot polygon, .lot polyline { stroke-linejoin: round; }
.lot .floor { fill: none; stroke-width: 0.22; }

.state-draft .f-e, .state-draft .f-s { fill: rgba(248, 246, 240, 0.35); }
.state-draft .f-top { fill: url(#hatch); }
.state-draft :is(.f-e, .f-s, .f-top) { stroke: var(--graphite); stroke-width: 0.38; stroke-dasharray: 1.5 0.8; }
.state-draft .floor { stroke: var(--graphite); stroke-dasharray: 0.6 0.9; }
.is-illustrative :is(.f-e, .f-s, .f-top) { stroke-dasharray: 0.9 1.2; }

.state-review .f-e { fill: rgba(31, 61, 50, 0.09); }
.state-review .f-s { fill: rgba(31, 61, 50, 0.15); }
.state-review .f-top { fill: rgba(31, 61, 50, 0.05); }
.state-review :is(.f-e, .f-s, .f-top) { stroke: var(--ink); stroke-width: 0.5; }
.state-review .floor { stroke: var(--ink); opacity: 0.6; }

.state-approved .f-top { fill: #ffffff; }
.state-approved .f-e { fill: #eef1ed; }
.state-approved .f-s { fill: #dfe4de; }
.state-approved :is(.f-e, .f-s, .f-top) { stroke: var(--ink); stroke-width: 0.45; }
.state-approved .floor { stroke: var(--ink); opacity: 0.45; }
.state-approved .win { fill: none; stroke: var(--ink); stroke-width: 0.22; }

.state-published .ground { stroke-dasharray: none; stroke-width: 0.25; }
.state-published .shadow { fill: rgba(31, 61, 50, 0.17); }
.state-published .f-top { fill: #efe8d8; }
.state-published .f-e { fill: #cfbd9f; }
.state-published .f-s { fill: #94634f; }
.state-published :is(.f-e, .f-s, .f-top) { stroke: #2b2e33; stroke-width: 0.28; }
.state-published .floor { stroke: #2b2e33; opacity: 0.35; }
.state-published .win { fill: #26304d; opacity: 0.82; }
.pole { stroke: #2b2e33; stroke-width: 0.45; }
.flag { fill: var(--flag); transform-box: fill-box; transform-origin: left center; animation: flag-up 0.5s ease-out both; }
@keyframes flag-up { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.lot:hover .ground { fill: #fff; }
.lot.is-selected .ground, .lot:focus-visible .ground {
  stroke: var(--ink); stroke-width: 1.1; stroke-dasharray: none; fill: #fff;
}
.lot.is-selected :is(.f-top), .lot:focus-visible .f-top { stroke: var(--ink); stroke-width: 0.9; }

.stamp {
  position: absolute; top: 0.4rem; right: 0.2rem;
  margin: 0;
  padding: 0.35rem 0.7rem;
  max-width: 15rem;
  font: 700 0.92rem/1.2 var(--sans);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  outline: 1px solid var(--ink); outline-offset: 2px;
  transform: rotate(-3deg);
  opacity: 0.82;
  background: rgba(248, 246, 240, 0.55);
  pointer-events: none;
}

.legend ul {
  list-style: none; margin: 0.3rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem;
  font: 400 0.85rem/1.3 var(--sans); color: var(--graphite);
}
.legend li { display: flex; align-items: center; gap: 0.35rem; }
.legend svg { width: 1.5rem; height: 1.2rem; }
.lg-empty { fill: var(--paper); stroke: var(--graphite); stroke-dasharray: 1.5 1.5; stroke-width: 1; }
.lg-draft { fill: url(#hatch); stroke: var(--graphite); stroke-dasharray: 2.5 1.2; stroke-width: 1; }
.lg-review { fill: rgba(31, 61, 50, 0.14); stroke: var(--ink); stroke-width: 1.2; }
.lg-approved { fill: #fff; stroke: var(--ink); stroke-width: 1.2; }
.lg-published { fill: #94634f; stroke: #2b2e33; stroke-width: 1; }
.lg-flag { fill: var(--flag); }

/* Revision block: real source metadata, drawn as a drawing's revision table. */
.revisions {
  margin-top: 0.9rem;
  max-width: 46rem;
  border: var(--rule);
  background: var(--paper);
}
.revisions > summary { padding: 0.45rem 0.7rem; }
.revisions[open] > summary { border-bottom: var(--hair); }
.revisions h2 {
  margin: 0; padding: 0.45rem 0.7rem;
  font: 700 1rem/1.2 var(--sans); color: var(--paper); background: var(--ink);
}
.rev-flag { margin: 0; padding: 0.5rem 0.7rem; font-size: 0.88rem; border-bottom: var(--hair); }
.revisions dl { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; margin: 0; }
.revisions dt, .revisions dd { margin: 0; padding: 0.3rem 0.7rem; border-bottom: var(--hair); font-size: 0.86rem; line-height: 1.4; }
.revisions dt { font-family: var(--sans); color: var(--graphite-soft); border-right: var(--hair); }
.revisions dd { font-family: var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.revisions dl > :nth-last-child(-n + 2) { border-bottom: none; }

.notes {
  margin: 0.8rem 0 0; padding-left: 1.3rem; max-width: 70ch;
  font-size: 0.86rem; line-height: 1.5; color: var(--graphite-soft);
}
.notes:empty { display: none; }
.unplaced { margin: 0.4rem 0 0; font-size: 0.86rem; color: var(--graphite-soft); max-width: 70ch; }

/* ---------- replay ---------- */

.replay {
  display: grid; gap: 0.6rem 1rem;
  grid-template-columns: 1fr;
  margin-top: 0.7rem; padding: 0.7rem 0.8rem;
  border: var(--rule); background: rgba(248, 246, 240, 0.85);
}
.replay[hidden] { display: none; }
.replay label { display: flex; flex-direction: column; gap: 0.2rem; font: 400 0.85rem/1.2 var(--sans); color: var(--graphite-soft); }
.replay select { min-height: 2.5rem; border: var(--hair); background: var(--paper); color: var(--ink); padding: 0 0.4rem; font-family: var(--sans); }
.replay-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: end; }
.replay input[type="range"] { width: 100%; accent-color: var(--ink); min-height: 2rem; }

/* ---------- field book ---------- */

.fieldbook {
  grid-area: book;
  background: rgba(248, 246, 240, 0.92);
  border-top: var(--rule);
  padding: 1rem clamp(1rem, 3vw, 1.4rem) 2rem;
  min-width: 0;
}
.fieldbook:focus { outline: none; }
.fieldbook h2 { margin: 0 0 0.3rem; font: 600 1.2rem/1.2 var(--display); color: var(--ink); }
.detail { padding-bottom: 1rem; border-bottom: var(--hair); }
.detail p { margin: 0.3rem 0; font-size: 0.95rem; }
.detail-state { font-family: var(--sans); }
.tone-published::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; background: var(--flag); margin-right: 0.4rem; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0.7rem 0 0; font-size: 0.88rem; }
.detail dt { font-family: var(--sans); color: var(--graphite-soft); }
.detail dd { margin: 0; overflow-wrap: anywhere; }

.progress { list-style: none; display: flex; margin: 0.7rem 0 0; padding: 0; counter-reset: s; font: 400 0.8rem/1.2 var(--sans); }
.progress li { flex: 1; padding: 0.35rem 0.3rem; border: var(--hair); margin-left: -1px; color: var(--graphite-soft); counter-increment: s; }
.progress li::before { content: counter(s) " "; }
.progress .done { color: var(--ink); background: rgba(31, 61, 50, 0.06); }
.progress .now { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.log { padding-top: 1rem; }
.log-hint { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--graphite-soft); }
.log ol { list-style: none; margin: 0; padding: 0; }
.log li { padding: 0.45rem 0 0.45rem 0.7rem; border-left: 3px solid var(--hair-color, rgba(31, 61, 50, 0.25)); margin-bottom: 0.35rem; }
.log li p { margin: 0; font-size: 0.86rem; line-height: 1.4; }
.log .log-head { font-family: var(--sans); font-size: 0.9rem; overflow-wrap: anywhere; }
.log .log-meta { color: var(--graphite-soft); font: 400 0.74rem/1.4 var(--mono); overflow-wrap: anywhere; }
.verdict-applied { --hair-color: var(--ink); }
.verdict-applied strong { color: var(--ink); }
.verdict-duplicate, .verdict-superseded { --hair-color: #9aa2a8; }
.verdict-duplicate strong, .verdict-superseded strong { color: var(--graphite-soft); }
.verdict-rejected { --hair-color: var(--alarm); }
.verdict-rejected strong { color: var(--alarm); }
.log li.is-fresh { background: rgba(180, 111, 61, 0.12); }

/* ---------- title block ---------- */

.titleblock {
  grid-area: title;
  margin: 0 clamp(1rem, 3vw, 2rem) 1rem;
  border: var(--rule);
  background: var(--paper);
}
.titleblock dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.titleblock dl > div { padding: 0.35rem 0.6rem; border-bottom: var(--hair); border-right: var(--hair); min-width: 0; }
.titleblock dl > div:nth-child(2n) { border-right: none; }
.titleblock dt { font: 400 0.72rem/1.2 var(--sans); color: var(--graphite-soft); }
.titleblock dd { margin: 0.1rem 0 0; font: 400 0.9rem/1.3 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.titleblock .check { width: 100%; border: none; border-radius: 0; }
.titleblock .check[hidden] { display: none; }

/* ---------- desktop ---------- */

@media (min-width: 980px) {
  .app {
    grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 400px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "mast book" "sheet book" "sheet title";
    height: 100dvh;
    min-height: 32rem;
  }
  .sheet { overflow: auto; }
  #plat { aspect-ratio: auto; flex: 1 1 0; height: auto; min-height: 18rem; max-height: none; }
  .plat { min-height: 20rem; }
  /* Keep the model above the fold: compact intro, view sized to the viewport. */
  .stage-view { height: clamp(24rem, calc(100dvh - 18.5rem), 52rem); }
  body:is([data-sheet="drafts"], [data-sheet="world"]) .intro { padding-top: 0.9rem; max-width: 64rem; }
  body:is([data-sheet="drafts"], [data-sheet="world"]) #headline { font-size: clamp(1.5rem, 2.3vw, 2.2rem); max-width: none; }
  body:is([data-sheet="drafts"], [data-sheet="world"]) .lede { margin-top: 0.35rem; max-width: 92ch; font-size: 0.94rem; line-height: 1.5; }
  body:is([data-sheet="drafts"], [data-sheet="world"]) .banner { margin-top: 0.5rem; }
  .fieldbook { border-top: none; border-left: var(--rule); overflow: auto; padding-top: 1.2rem; }
  .titleblock { margin: 0; border-width: 1.5px 0 0 1.5px; }
  .replay { grid-template-columns: minmax(10rem, 16rem) auto minmax(8rem, 1fr); align-items: end; }
}

/* When the title wraps under the logo, drop the divider rule. */
@media (max-width: 760px) {
  .brandline { gap: 0.45rem; }
  .experience { padding-left: 0; border-left: none; flex-basis: 100%; }
}

@media (max-width: 520px) {
  .tabs { width: 100%; }
  .tabs [role="tab"] { flex: 1; min-width: 0; }
  .stamp { position: static; align-self: flex-start; margin: 0.2rem 0 0.4rem; transform: rotate(-1.5deg); }
  .plat { display: flex; flex-direction: column; }
  .plat .stamp { order: -1; }
  .stage-view { height: 62vh; min-height: 16rem; }
  .stage-stamp { position: absolute; top: 0.4rem; left: 0.4rem; right: auto; margin: 0; max-width: 12rem; font-size: 0.8rem; }
  .view-pick { width: 100%; }
  .view-pick button { flex: 1 1 auto; }
  .titleblock dl { grid-template-columns: 1fr; }
  .titleblock dl > div { border-right: none; }
  /* Phones: brand, title, one progress sentence, then the model on the first screen. */
  .masthead { padding-top: 0.6rem; gap: 0.5rem; }
  .experience-title { font-size: 1.2rem; }
  .experience-desc { font-size: 0.72rem; margin-top: 0.1rem; }
  .desc-more { display: none; }
  .tabs [role="tab"] { min-height: 2.25rem; padding: 0.3rem 0.35rem; font-size: 0.82rem; line-height: 1.15; }
  .intro { padding-top: 0.55rem; }
  #headline { font-size: 1.22rem; line-height: 1.2; max-width: none; }
  .lede { margin-top: 0.25rem; font-size: 0.88rem; line-height: 1.4; }
  .source-line { margin-top: 0.2rem; font-size: 0.74rem; }
  .banner { margin-top: 0.4rem; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
  .stage { margin-top: 0.45rem; }
  .stage-bar { padding-bottom: 0.3rem; gap: 0.3rem; }
  .stage-bar button { min-height: 2.1rem; padding: 0.2rem 0.45rem; font-size: 0.8rem; }
}

/* The title block's details are folded; the summary reads like its first row. */
.tb-fold { margin: 0; max-width: none; }
.tb-fold > summary { padding: 0.35rem 0.6rem; }
.tb-fold[open] > summary { border-bottom: var(--hair); }

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

@media (forced-colors: active) {
  .lot .ground { stroke: CanvasText; }
  .flag { fill: Highlight; }
}
