body {
  padding: 2rem 1.5rem 4rem;
  line-height: 1.6;
}
/* The Punchcutter's Case (#228), page members: the shell's h1/.topnav/footer
   display and .tagline flourish bindings live in BaseLayout (#263). */
.caption, .subtitle {
  font-family: var(--font-flourish, 'Iowan Old Style', 'Palatino', Georgia, serif);
}
main { max-width: 1000px; }
header { margin-bottom: 1.2rem; }
.intro { max-width: 640px; margin: 1.4rem auto; text-align: center; }

/* The counter: a single quiet row of controls, like the survey office's order desk. */
.counter { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.55rem 0.85rem; margin: 1.4rem auto; }
.counter label { font-size: 0.85rem; letter-spacing: 0.05em; color: var(--ink-brown); }
input[type="number"], select, button {
  font-family: inherit; font-size: 0.95rem; color: var(--ink-dark);
  background: #f8f1e0; border: 1.5px solid var(--ink-dark); border-radius: 4px;
  padding: 0.4rem 0.6rem;
}
input[type="number"] { width: 8.5rem; }
button { cursor: pointer; }
button:hover { background: var(--parchment-bright); }
button.primary { background: var(--ink-dark); color: #f2e8cf; letter-spacing: 0.08em; }
button.primary:hover { background: #5d4831; }

/* The inline-fallback notice: a pinned-slip aside, not an alarm. */
.warning { max-width: 640px; margin: 0 auto 0.4rem; text-align: center;
  font-size: 0.85rem; font-style: italic; color: #7a5c2e;
  background: var(--parchment-panel); border: 1px solid var(--line-faint); border-radius: 4px;
  padding: 0.6rem 0.9rem; }
.warning[hidden] { display: none; }

.status { text-align: center; font-style: italic; color: var(--ink-faded);
  min-height: 1.4em; margin-bottom: 0.8rem; }

/* The proof: the pulled chart, centered under the counter. Mirrors the Explorer's
   #map svg frame (border + drop shadow) so a proof reads as the same sheet. */
.preview { max-width: 1000px; margin-inline: auto; position: relative; }
.preview svg { width: 100%; height: auto; display: block;
  border: 1px solid var(--line-tan); box-shadow: 0 12px 34px rgb(61 47 31 / 0.2); }
/* #127 The Drafting Moment, reused: a freshly pulled proof settles onto the desk
   while its coastline draws itself in ink (app.js sets --draw-len + the dasharray on
   the coast path via startArrival, and clears them on animationend). DOM-only styling
   of the injected SVG; the pristine string a future Download blobs is never touched.
   Collapses to instant under the shared reduced-motion rule in /motion.css. */
.preview svg.arriving { animation: paperSettle var(--paper-settle) var(--ease-paper) both; }
.preview svg.arriving #layer-land path {
  animation: inkDraw var(--ink-draw) var(--ease-paper) both,
             washDry var(--ink-dry) var(--ease-paper) 400ms both;
}
.preview svg.arriving #layer-waterlines {
  animation: dryingInk var(--ink-dry) var(--ease-paper) 300ms both;
}

.caption { text-align: center; font-style: italic; color: var(--ink-brown); padding-top: 0.6rem; }

/* The order desk (#136 redesign): two side-by-side offerings above the proof, one for a
   single poster plate, one for the whole bound atlas. Everything below the desk is output
   (the proof, then the atlas once bound). The offerings stack on a narrow screen. */
.order-desk { max-width: 860px; margin: 2rem auto 0; }
.desk-head { text-align: center; font-size: 0.82rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-brown); margin: 0 0 1.2rem; font-weight: 700; }
.offerings { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: stretch; }
.offering { border: 1px solid var(--line-faint); border-radius: 6px; background: var(--parchment-panel);
  padding: 1.2rem 1.1rem; display: flex; flex-direction: column; text-align: center; }
.offering-head { font-size: 1rem; letter-spacing: 0.06em; margin: 0 0 0.4rem; color: var(--ink-dark); }
/* min-height aligns where the two cards' controls begin even when the intros wrap differently. */
.offering-intro { font-size: 0.85rem; color: var(--ink-brown); margin: 0 0 1rem; min-height: 3.4em; }
.offering-controls { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.offering-field { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faded); display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.offering-field select { min-width: 11rem; }
.atlas-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
/* Push the caveat + status to the card bottom so the two equal-height cards align. */
.offering-caveat { font-size: 0.76rem; font-style: italic; color: var(--ink-faded); margin: auto 0 0;
  padding-top: 0.9rem; }
.offering .status { margin: 0.5rem 0 0; min-height: 1.2em; }

.plate-row { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 0.5rem; }
.plate { display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  min-width: 5rem; padding: 0.55rem 0.85rem; letter-spacing: 0.06em; line-height: 1.2; }
.plate-dim { font-size: 0.72rem; font-style: italic; letter-spacing: 0.04em; color: var(--ink-faded); }
.plate:hover:not(:disabled) { background: var(--parchment-bright); }
.plate:disabled { cursor: default; opacity: 0.45; }
.plate:disabled .plate-dim { color: #a1926f; }

/* The bound sheet populates below the proof, wider than the desk. Empty until a bind; the
   shared .atlas-sheet rules (injected by bound-atlas.js) style its plates, tables, banners,
   and chronicle. On SCREEN it omits the duplicated header + hero
   (.print-only), which the proof already shows above; print + download restore them. */
#pr-atlas { max-width: 1100px; margin: 2.5rem auto 0; }
#pr-atlas:empty { margin: 0; }
#pr-atlas .atlas-head { text-align: center; margin: 0 0 1.5rem; }
#pr-atlas .atlas-head h1 { font-size: 2.2rem; letter-spacing: 0.04em; margin: 0 0 0.4rem; }
#pr-atlas .atlas-head .subtitle { font-style: italic; color: var(--ink-brown); margin: 0; }
#pr-atlas .atlas-head .chartno { letter-spacing: 0.3em; font-size: 0.8rem; color: var(--ink-faded);
  margin: 0.5rem 0 0; }
/* Drop-hero: hide the header + hero on screen; print reveals them (below) for a complete
   standalone atlas, and the download always carries them (it builds from the full atlas). */
@media screen { #pr-atlas .print-only { display: none; } }

footer { margin-top: 3rem; }

@media (max-width: 640px) {
  .offerings { grid-template-columns: 1fr; }
  .offering-intro { min-height: 0; }
}
@media (max-width: 560px) {
  .counter { gap: 0.5rem; }
  input[type="number"] { width: 7rem; }
}

/* The bound atlas printed to PDF: the browser's own Save as PDF replaces the deleted CLI
   `--pdf` (#136). Scoped to body.has-atlas (set by bound-atlas.js on a successful bind), so
   a plain Ctrl+P before binding still prints the normal page, not a blank sheet. All page
   chrome is hidden; only #pr-atlas remains, one plate per page, with the banner grid,
   chronicle, and gazetteer flowing after. This is the site's first real print stylesheet
   (the only other @media print is #127's one-line motion override on the Explorer). */
@media print {
  body.has-atlas > main > header,
  body.has-atlas .intro,
  body.has-atlas .counter,
  body.has-atlas .warning,
  body.has-atlas #pr-status,
  body.has-atlas .order-desk,
  body.has-atlas #pr-preview,
  body.has-atlas #pr-caption,
  body.has-atlas > main > footer { display: none !important; }
  body.has-atlas { padding: 0; }
  body.has-atlas main { max-width: none; }
  body.has-atlas #pr-atlas { max-width: none; margin: 0; }
  /* Reveal the header + hero that are hidden on screen, so the printed atlas is complete. */
  body.has-atlas #pr-atlas .print-only { display: block; }
  /* Block layout so each plate figure can own a page (grid + fragmentation is unreliable). */
  body.has-atlas #pr-atlas .styles,
  body.has-atlas #pr-atlas .themes { display: block; }
  /* Every PLATE figure on its own page; banner figures (.banner) keep flowing in their grid.
     opacity:1 is belt-and-suspenders (the Print Room plates never hide, unlike the Explorer's
     reveal), so no below-fold plate can ever print blank. */
  body.has-atlas #pr-atlas figure:not(.banner) { break-inside: avoid; break-after: page; opacity: 1; }
  body.has-atlas #pr-atlas figure:not(.banner) img { box-shadow: none; }
  @page { margin: 1.5cm; }
}
