/* Ruleslip
   Palette: ink navy, counter grey, receipt white, shelf-ticket yellow,
   deposit green, till red, crate blue.
   Type: Archivo (one family, width does the work) and Plex Mono for the receipt. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #101B3A;
  --ink-soft: #46506B;
  --counter: #EEF1F4;
  --counter-deep: #DDE2E8;
  --paper: #FFFFFF;
  --ticket: #FFD21F;
  --ticket-deep: #F2BF00;
  --green: #0B6B40;
  --red: #B42A18;
  --blue: #2447C6;
  --line: #B9C0CE;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--counter);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-stretch: 100%;
}
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.08; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ticket); color: var(--ink); padding: 0.6rem 1rem; z-index: 50; font-weight: 700;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- header ---------- */
.top { background: var(--ink); color: #fff; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.mark { text-decoration: none; display: inline-block; margin: 0; }
.mark-ticket {
  display: inline-block;
  background: var(--ticket);
  color: var(--ink);
  font-weight: 800;
  font-stretch: 70%;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.32em 0.55em 0.3em;
  /* shelf-edge ticket: one clipped corner */
  clip-path: polygon(0 0, calc(100% - 0.5em) 0, 100% 0.5em, 100% 100%, 0 100%);
}
.top-nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.top-nav a { color: #fff; text-decoration: none; padding: 0.6rem 0; border-bottom: 2px solid transparent; }
.top-nav a:hover { border-bottom-color: var(--ticket); color: #fff; }
.top .mark:focus-visible, .top-nav a:focus-visible { outline-color: var(--ticket); }

/* ---------- hero ---------- */
.hero { padding-top: 0; padding-bottom: 3.5rem; }

/* The intro runs on from the navy header like a shop counter, full width,
   and the receipt hangs over its edge. */
.intro {
  position: relative;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 100vmax var(--ink);
  clip-path: inset(0 -100vmax);
  padding: 2.6rem 0 2.8rem;
}
.intro .deck { color: #C9D0E0; }
.intro h1 { color: #fff; }
.how-title { font-weight: 700; font-stretch: 88%; font-size: 1.2rem; margin: 2rem 0 0.8rem; color: #fff; }
.tickets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; max-width: 46rem; }
.how-note { color: #C9D0E0; font-size: 0.98rem; max-width: 58ch; margin: 1rem 0 0; }
.ticket {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0; padding: 0.35rem 1.1rem 0.35rem 0.75rem;
  background: var(--ticket); color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0 100%);
}
.ticket b {
  font-weight: 800; font-stretch: 68%; font-size: 2.1rem; line-height: 1;
  font-variant-numeric: tabular-nums; flex: none; min-width: 5.3rem; white-space: nowrap;
}
.ticket span { font-size: 0.86rem; font-weight: 600; line-height: 1.2; }

h1 {
  font-weight: 800;
  font-stretch: 72%;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  letter-spacing: -0.005em;
  max-width: 21ch;
  text-wrap: balance;
}
.deck { max-width: 58ch; margin: 1.1rem 0 0; font-size: 1.125rem; color: var(--ink-soft); }

.bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.lead-col { min-width: 0; }

/* ---------- questions ---------- */
.ask { min-width: 0; margin-top: 2.4rem; counter-reset: q; }
.ask > .q { counter-increment: q; }
.ask > .q > legend::before, .ask > .q > .q-label::before {
  content: counter(q);
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; margin-right: 0.6rem; vertical-align: 0.12em;
  background: var(--ink); color: var(--ticket);
  font-size: 0.95rem; font-weight: 800; font-stretch: 80%; border-radius: 4px;
}
.q {
  border: 0; margin: 0; padding: 1.5rem 0;
  border-top: 2px solid var(--ink);
  min-width: 0;
}
.q:first-child { padding-top: 1.25rem; border-top: 0; }
/* float the legend so the fieldset's top rule runs full width above it */
.q legend { float: left; width: 100%; }
.q legend + * { clear: both; }
.q legend, .q-label {
  display: block; padding: 0;
  font-weight: 700; font-stretch: 88%;
  font-size: 1.3rem; line-height: 1.2;
  margin-bottom: 0.45rem;
}
.hint { color: var(--ink-soft); font-size: 0.98rem; max-width: 60ch; margin: 0 0 0.85rem; }
.echo { color: var(--ink-soft); font-size: 0.95rem; margin: 0.5rem 0 0; min-height: 1.4em; }

.choices { display: grid; gap: 0.5rem; }
.choices-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-stack { grid-template-columns: minmax(0, 1fr); }

.choice { position: relative; display: flex; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; flex: 1 1 auto; min-height: 52px;
  padding: 0.65rem 0.9rem 0.65rem 2.7rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 500; line-height: 1.25;
  position: relative;
}
.choice span::before {
  content: ""; position: absolute; left: 0.8rem; top: 50%;
  width: 1.25rem; height: 1.25rem; margin-top: -0.625rem;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper);
}
.choice input:checked + span { background: var(--ticket); font-weight: 700; }
.choice input:checked + span::before { box-shadow: inset 0 0 0 4px var(--paper); background: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.choice:hover span { border-color: var(--blue); }

.field-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.num {
  font: inherit; font-weight: 700; font-size: 1.5rem; font-stretch: 85%;
  font-variant-numeric: tabular-nums;
  width: 9.5rem; min-height: 56px; padding: 0.4rem 0.75rem;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 6px;
}
.num-sm { font-size: 1.15rem; width: 7rem; min-height: 46px; }
.num:invalid { border-color: var(--red); }
.suffix, .prefix { color: var(--ink-soft); font-weight: 500; }
.prefix { font-size: 1.15rem; font-weight: 700; color: var(--ink); }

.unit { display: inline-flex; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--paper); }
.unit-opt { position: relative; cursor: pointer; }
.unit-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.unit-opt span { display: flex; align-items: center; min-height: 52px; padding: 0 1rem; font-weight: 600; }
.unit-opt + .unit-opt span { border-left: 2px solid var(--ink); }
.unit-opt input:checked + span { background: var(--ink); color: #fff; }
.unit-opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: -3px; }

.quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.chip {
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums;
  background: transparent; color: var(--ink);
  border: 2px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.9rem; min-height: 44px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.slider-row { display: grid; gap: 0.6rem; max-width: 34rem; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 10px; background: var(--ink); border-radius: 5px; }
input[type="range"]::-moz-range-track { height: 10px; background: var(--ink); border-radius: 5px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 32px; height: 32px; margin-top: -11px; border-radius: 50%;
  background: var(--ticket); border: 3px solid var(--ink);
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ticket); border: 3px solid var(--ink);
}
.slider-out { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.costs { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 0; }
.costs summary {
  cursor: pointer; list-style: none;
  font-weight: 700; font-stretch: 88%; font-size: 1.15rem;
  padding: 1.1rem 2rem 1.1rem 0; position: relative;
}
.costs summary::-webkit-details-marker { display: none; }
.costs summary::after {
  content: ""; position: absolute; right: 0.35rem; top: 50%;
  width: 0.7rem; height: 0.7rem; margin-top: -0.55rem;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.costs[open] summary::after { transform: rotate(-135deg); margin-top: -0.15rem; }
.costs[open] { padding-bottom: 1.4rem; }
.costs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem 1.5rem; margin: 0.4rem 0 1.2rem; }
.mini label { display: block; font-weight: 600; font-size: 0.98rem; margin-bottom: 0.35rem; line-height: 1.3; }
/* every box starts at the left edge and sits on the same line as its neighbour,
   however many lines the label takes; the pound sign sits inside the box */
.mini { display: flex; flex-direction: column; }
.mini .field-row { margin-top: auto; position: relative; flex-wrap: nowrap; }
.mini .num-sm { width: 8rem; }
.mini .prefix { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.mini .prefix + .num { padding-left: 1.75rem; }
.tick { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 500; cursor: pointer; max-width: 46ch; }
.tick input { width: 1.5rem; height: 1.5rem; margin: 0.1rem 0 0; accent-color: var(--ink); flex: none; }
.link-btn {
  font: inherit; background: none; border: 0; padding: 0.6rem 0; margin-top: 0.6rem;
  color: var(--blue); text-decoration: underline; cursor: pointer;
}

/* ---------- till and receipt ---------- */
.till { min-width: 0; }
.slot {
  height: 14px; border-radius: 7px;
  background: #050A1C;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.14), 0 0 0 3px #26315A;
  position: relative; z-index: 2;
  margin: 0 -0.4rem;
}
/* the shadow sits on .paper because a mask on the receipt would clip its own shadow */
.paper {
  position: relative; z-index: 1;
  margin: -6px 0.5rem 0;
  filter: drop-shadow(0 12px 12px rgba(16, 27, 58, 0.18));
}
.receipt {
  padding: 1.7rem 1.15rem 2.2rem;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  color: #14181F;
  /* torn bottom edge: one upward wedge per 14px column */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.receipt.printing { animation: feed 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes feed {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-18px); }
  to { clip-path: inset(0 0 0 0); transform: translateY(0); }
}

.r-head { text-align: center; padding-bottom: 0.9rem; }
.r-brand { font-family: var(--sans); font-weight: 800; font-stretch: 70%; font-size: 1.6rem; line-height: 1; }
.r-sub { display: block; margin-top: 0.3rem; }
.r-sec { border-top: 1px dashed #6B7280; padding: 0.9rem 0; }
.r-sec:last-child { padding-bottom: 0; }
.r-title { font-family: var(--mono); font-weight: 600; font-size: 0.86rem; margin: 0 0 0.45rem; line-height: 1.4; }
.r-verdict {
  font-family: var(--sans); font-weight: 800; font-stretch: 80%;
  font-size: 1.32rem; line-height: 1.15; margin: 0 0 0.5rem; color: var(--ink);
}
.r-text { font-family: var(--sans); font-size: 0.95rem; line-height: 1.45; margin: 0 0 0.6rem; color: var(--ink); }
.r-text:last-child { margin-bottom: 0; }
.r-row { display: flex; align-items: baseline; gap: 0.5rem; }
.r-row .r-what { flex: 0 1 auto; min-width: 0; }
.r-row .r-dots { flex: 1 1 1rem; border-bottom: 1px dotted #9AA1AE; transform: translateY(-0.28em); min-width: 0.75rem; }
.r-row .r-amt { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-small { color: #4B5361; }
.r-neg { color: var(--red); }
.r-total { margin-top: 0.45rem; padding: 0.3rem 0.4rem; margin-left: -0.4rem; margin-right: -0.4rem; font-weight: 600; font-size: 0.98rem; }
.r-best .r-total { background: var(--ticket); }
.r-flag {
  display: inline-block; font-family: var(--sans); font-weight: 800; font-stretch: 80%; font-size: 0.8rem;
  background: var(--ink); color: #fff; padding: 0.1rem 0.45rem; margin-left: 0.4rem; vertical-align: 0.1em;
}
.r-note { font-size: 0.78rem; line-height: 1.45; color: #4B5361; margin: 0.5rem 0 0; }
.r-foot { text-align: center; font-size: 0.76rem; color: #4B5361; }
.r-foot p { margin: 0; text-wrap: balance; }
.r-link { color: var(--blue); }

.till-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.6rem 0.5rem 0; }
.till-status { margin: 0.6rem 0.5rem 0; min-height: 1.5em; font-size: 0.95rem; color: var(--green); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.55rem 1.1rem;
  font: inherit; font-weight: 700; font-stretch: 90%; line-height: 1.2; text-decoration: none; text-align: center;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 6px; cursor: pointer;
}
.btn:hover { background: var(--counter-deep); color: var(--ink); }
.btn-primary { background: var(--ticket); }
.btn-primary:hover { background: var(--ticket-deep); }
.btn-big { min-height: 58px; font-size: 1.15rem; padding: 0.7rem 1.5rem; width: 100%; }
.till-actions .btn-primary { flex: 1 1 100%; min-height: 56px; font-size: 1.1rem; }
.till-actions .btn { flex: 1 1 auto; }

/* ---------- lower bands ---------- */
.band { padding: 4rem 0 4.25rem; background: var(--paper); }
.band-alerts { padding: 3rem 0; }
.band-quotes { background: var(--ink); color: #fff; }
.band-quotes a { color: var(--ticket); }
.band-quotes a:hover { color: #fff; }
.band-alerts { background: var(--counter); border-top: 2px solid var(--ink); }
.prose h2 {
  font-weight: 800; font-stretch: 75%;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-bottom: 1.1rem; max-width: 24ch; text-wrap: balance;
}
.prose h3 { font-weight: 700; font-stretch: 88%; font-size: 1.25rem; margin: 2.2rem 0 0.8rem; }
.prose p, .prose li { max-width: 66ch; }
.small { font-size: 0.92rem; color: var(--ink-soft); }
.band-quotes .small { color: #C9D0E0; }
.paid { border-left: 4px solid var(--ticket); padding-left: 0.9rem; }

.dates { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.dates li:last-child { padding-bottom: 0; }
.dates li {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem 1.5rem;
  padding: 0 0 1.6rem 2.2rem;
}
/* the rail and stops of a timeline: the dates are a real sequence */
.dates li::before {
  content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: -0.5rem;
  width: 3px; background: var(--ink);
}
.dates li:last-child::before { display: none; }
.dates li::after {
  content: ""; position: absolute; left: 0; top: 0.2rem;
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--ink);
}
.dates li:first-child::after { background: var(--ticket); }
.dates li:last-child::after { background: var(--ink); }
.dates li:first-child .date {
  justify-self: start; align-self: start; background: var(--ticket); padding: 0 0.4rem; margin-left: -0.4rem;
}
.dates li p:last-child { margin-bottom: 0; }
.date { font-weight: 800; font-stretch: 78%; font-size: 1.3rem; line-height: 1.2; }

.quotes-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.form-shell { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 1.4rem; min-width: 0; }
.band-quotes .form-shell { border-color: var(--ticket); }
.band-quotes .form-shell a { color: var(--blue); }
.band-quotes .form-shell a:hover { color: var(--ink); }
.form-shell .small { color: var(--ink-soft); margin: 0.7rem 0 0; }
.form-summary { font-weight: 600; margin-bottom: 1rem; }
.form-frame iframe { width: 100%; border: 0; min-height: 420px; display: block; }
.form-fallback { margin: 0.8rem 0 0; font-size: 0.95rem; }

.dates-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.first-job {
  background: var(--counter); border-left: 6px solid var(--ticket);
  padding: 1.3rem 1.4rem 1.1rem;
}
.prose .first-job h3 { margin: 0 0 0.6rem; }
.first-job .btn { margin: 0.2rem 0 0.4rem; }
.first-job .small { margin-bottom: 0; }

.workings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 3.5rem; margin-top: 0.5rem; }
.facts { margin: 0; }
.facts > div { padding: 0.8rem 0 0.85rem; border-top: 1px solid var(--line); }
/* solid rule: fixed by the scheme. dashed rule: our estimate, yours to change */
.facts > div:first-child { border-top: 3px solid var(--ink); }
.facts-assumed > div { border-top-style: dashed; }
.facts-assumed > div:first-child { border-top: 3px dashed var(--ink); }
.facts dt { font-weight: 700; margin-bottom: 0.15rem; }
.facts dd { margin: 0; color: var(--ink-soft); max-width: 60ch; }
.set .small { margin-top: 0.9rem; }

.slip {
  margin: 0; padding: 1.4rem 1.3rem 1.5rem; background: var(--paper);
  font-family: var(--mono); font-size: 0.88rem; line-height: 1.5; color: #14181F;
  display: grid; gap: 0.35rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  padding-bottom: 2rem;
}
.slip dd { margin: 0; }
.slip .r-what { flex: 1 1 auto; display: flex; align-items: baseline; gap: 0.5rem; }
.slip .r-what::after { content: ""; flex: 1 1 1rem; min-width: 0.75rem; border-bottom: 1px dotted #9AA1AE; transform: translateY(-0.28em); }
.slip .r-amt { font-weight: 600; }
.slip-wide { display: block; margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px dashed #6B7280; }
.slip-wide .r-what::after { display: none; }
.slip-wide .r-amt { white-space: normal; display: block; }
#about { background: var(--counter-deep); }
#about .paper { margin: 0; }

.sources, .plain { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.sources li, .plain li { margin-bottom: 0.45rem; break-inside: avoid; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #D8DDEA; padding: 2.5rem 0 5.5rem; font-size: 0.95rem; }
.foot a { color: #fff; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.foot-nav a { padding: 0.6rem 0; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.foot-text p { max-width: 60ch; }

/* ---------- mobile dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff;
  border-top: 3px solid var(--ticket);
}
.dock[hidden] { display: none; }
.dock-text { margin: 0; flex: 1 1 auto; font-weight: 600; line-height: 1.25; font-size: 0.98rem; }
.dock-btn { flex: none; min-height: 44px; }

/* ---------- plain pages ---------- */
.page { padding: 2.5rem 0 4rem; background: var(--paper); }
.page h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1.2rem; max-width: none; }
.page h2 { font-weight: 700; font-stretch: 88%; font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.page p, .page li { max-width: 66ch; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .choices-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tickets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ticket { flex-direction: column; align-items: flex-start; gap: 0.35rem; padding-top: 0.7rem; padding-bottom: 0.8rem; }
  .ticket b { min-width: 0; }
  .costs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dates li { grid-template-columns: 10rem minmax(0, 1fr); }
  .receipt { font-size: 0.9rem; padding-left: 1.5rem; padding-right: 1.5rem; }
  .foot-grid { grid-template-columns: 16rem minmax(0, 1fr); }
}
@media (min-width: 980px) {
  .bench { grid-template-columns: minmax(0, 1fr) 27rem; gap: 3.5rem; }
  /* --till-top is set by the page so a receipt taller than the window sticks by its bottom edge */
  .till { position: sticky; top: var(--till-top, 1.25rem); padding: 0 0.6rem; margin-top: 2.6rem; }
  .quotes-grid { grid-template-columns: minmax(0, 1fr) 26rem; gap: 4rem; }
  .dates-grid { grid-template-columns: minmax(0, 1fr) 22rem; gap: 4rem; }
  .first-job { margin-top: 4.3rem; }
  .workings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sources { columns: 2; column-gap: 3.5rem; }
  .dock { display: none; }
  .foot { padding-bottom: 2.5rem; }
}
@media (max-width: 420px) {
  .top-nav a:nth-child(3) { display: none; }
  .top-nav { gap: 1rem; }
  .choices-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .receipt.printing { animation: none; }
}

/* ---------- print: just the receipt ---------- */
@media print {
  body { background: #fff; }
  .top, .intro, .ask, .band, .foot, .dock, .till-actions, .till-status, .slot, .skip, h1 { display: none !important; }
  .hero { padding: 0; }
  .bench { display: block; margin: 0; }
  .till { position: static; max-height: none; overflow: visible; }
  .paper { filter: none; margin: 0; }
  .receipt { -webkit-mask: none; mask: none; max-width: 90mm; font-size: 9.5pt; padding: 0; }
  .r-best .r-total { background: none; border: 1.5pt solid #000; }
}

/* ---------- First-visit choice: shop or supplier ---------- */
.door {
  border: 0; padding: 2rem 1.5rem 1.75rem; width: min(44rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  background: var(--ink); color: #fff; border-radius: 6px; overflow: auto;
}
.door::backdrop { background: rgba(16, 27, 58, 0.92); }
.door h2 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 1.2rem 0 1.4rem; max-width: 22ch; }
.door-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
.door-choice {
  display: block; text-align: left; font: inherit; cursor: pointer; text-decoration: none;
  background: var(--paper); color: var(--ink); border: 3px solid var(--paper); border-radius: 6px;
  padding: 1.1rem 1.2rem 1.2rem;
}
.door-choice strong { display: block; font-size: 1.3rem; font-stretch: 85%; font-weight: 800; margin-bottom: 0.3rem; }
.door-choice span { display: block; color: var(--ink-soft); font-size: 1rem; line-height: 1.4; }
#door-shop { background: var(--ticket); border-color: var(--ticket); }
#door-shop span { color: var(--ink); }
.door-choice:hover { border-color: #fff; }
.door-choice:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (min-width: 640px) {
  .door { padding: 2.5rem 2.5rem 2.25rem; }
  .door-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .door { display: none; } }
.top-nav a { white-space: nowrap; }
@media (max-width: 479px) { .top-nav a[href="#dates"] { display: none; } }
