:root {
  --ink: #16202a;
  --muted: #5b6774;
  --line: #d9dee4;
  --paper: #ffffff;
  --wash: #f4f6f8;
  --brand: #e8542e;
  --brand-dark: #c4431f;
  --ok: #1b7f4c;
  --bad: #b3261e;
  --radius: 10px;
  --radius-lg: 16px; /* panels and the map; inner tiles keep --radius */
  --shadow: 0 1px 2px rgba(22, 32, 42, 0.05), 0 6px 20px rgba(22, 32, 42, 0.06);
}

* { box-sizing: border-box; }

html { color: var(--ink); background: var(--wash); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 800; letter-spacing: -0.02em; color: var(--brand); text-decoration: none; font-size: 1.15rem; }

/* The customer's four steps. The current one is ink with a brand number;
   done steps are muted with a tick; later steps are muted. */
.steps ol { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.steps li span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 0.72rem; font-weight: 700; color: var(--muted); background: var(--paper); }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.steps li[aria-current="step"] span { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.done span { border-color: var(--ok); color: var(--ok); }
.steps li + li::before { content: ""; width: 10px; height: 1px; background: var(--line); margin-right: 2px; }
@media (max-width: 480px) {
  .steps li { padding: 4px 2px; font-size: 0; gap: 0; } /* numbers only; the current step keeps its name */
  .steps li[aria-current="step"] { font-size: 0.85rem; gap: 6px; padding: 4px 6px; }
  .steps li + li::before { width: 6px; }
}

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
footer { padding: 20px 16px; color: var(--muted); font-size: 0.85rem; text-align: center; }

h1 { font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
p { margin: 0 0 14px; }
/* No lone word on a last line, at any width: short runs of text wrap into
   even lines. (Chrome balances up to six lines; longer prose is left alone.) */
h1, h2, h3, p, dt, dd, li, label, legend, small, output, button, .button { text-wrap: balance; }
a { color: var(--brand-dark); }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
button, .button {
  display: inline-block; margin-top: 16px; padding: 12px 20px; font: inherit; font-weight: 700; color: #fff; background: var(--brand);
  border: 0; border-radius: var(--radius); cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-dark); }
button.quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }

.error { color: var(--bad); background: #fdecea; border: 1px solid #f5c2bd; padding: 10px 14px; border-radius: var(--radius); }
.note { color: var(--muted); font-size: 0.9rem; }
.alt { margin-top: 18px; color: var(--muted); }
.cf-turnstile { margin-top: 14px; max-width: 100%; overflow: hidden; }
/* The widget is a fixed 300 px iframe; on the narrowest phones it is scaled to fit the card. */
@media (max-width: 340px) { .cf-turnstile { transform: scale(0.84); transform-origin: left top; margin-bottom: -22px; } }

.find { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

ul.hits { list-style: none; padding: 0; margin: 0; }
ul.hits li { margin: 0 0 10px; }
ul.hits .hit { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
ul.hits:not(:empty) { margin-top: 12px; }
ul.hits .name { font-weight: 700; }
ul.hits .addr { color: var(--muted); font-size: 0.9rem; }
ul.hits button { margin: 0 0 0 auto; padding: 8px 14px; }

.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 0; }
.layouts label { margin: 0; cursor: pointer; }
.layouts input { position: absolute; opacity: 0; }
.layouts .flyer { display: block; width: 100%; aspect-ratio: 105 / 216; border: 2px solid var(--line); border-radius: 6px; background: var(--paper); object-fit: contain; overflow: hidden; }
/* Flyer faces are inline SVG at 105 × 216 mm; they scale to their box. */
.flyer svg { display: block; width: 100%; height: auto; }
.layouts input:checked + .flyer { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 84, 46, 0.25); }
.layouts .lname { display: block; text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 480px) { .layouts { grid-template-columns: repeat(2, 1fr); } }
/* Landscape DL: the same six designs on a 216 × 105 page, two to a row. */
.size-dl-wide .flyer { aspect-ratio: 216 / 105; }
.layouts.size-dl-wide { grid-template-columns: repeat(2, 1fr); }
.sizes { display: flex; gap: 12px; margin: 10px 0 0; flex-wrap: wrap; }
.sizes label { margin: 0; cursor: pointer; display: grid; justify-items: center; gap: 4px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 6px; background: var(--paper); min-width: 120px; }
.sizes input { position: absolute; opacity: 0; }
.sizes .page { display: block; width: 22px; height: 44px; border: 2px solid var(--muted); border-radius: 2px; }
.sizes .size-dl-wide .page, .sizes label.size-dl-wide .page { width: 44px; height: 22px; margin: 11px 0; }
.sizes .sname { font-weight: 700; font-size: 0.9rem; }
.sizes .trim { font-size: 0.8rem; color: var(--muted); }
.sizes label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 84, 46, 0.25); }

.options { display: grid; gap: 10px; margin-top: 10px; }
.options label { margin: 0; display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-weight: 400; cursor: pointer; }
.options .hl { font-weight: 700; display: block; }
.options .of { color: var(--muted); display: block; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 18px 0 0; background: var(--paper); }
legend { font-weight: 700; padding: 0 6px; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.row label { margin: 0; font-weight: 400; }
.row label small { display: block; } /* a block, so its wrap balances like every other note */

.preview-pair { display: flex; gap: 12px; margin-top: 12px; }
.preview-pair img, .preview-pair .flyer { display: block; width: 48%; aspect-ratio: 105 / 216; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); overflow: hidden; }

/* Screen 1 style pickers: colours as two-tone dots, lettering as "Aa"
   samples, photos as square thumbnails. The chosen one gets the brand ring. */
fieldset.pick { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.pick legend { padding: 0; margin-bottom: 4px; }
fieldset.pick label { margin: 0; position: relative; cursor: pointer; font-weight: 400; }
fieldset.pick input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset.pick input:focus-visible + * { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch, .type { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; }
.swatch .dot { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); padding: 2px; box-sizing: content-box; }
.swatch input:checked + .dot { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(232, 84, 46, 0.25); }
.sname { font-size: 0.78rem; line-height: 1.25; color: var(--muted); text-align: center; }
.type .aa { display: flex; align-items: center; justify-content: center; width: 56px; height: 44px; border: 2px solid var(--line); border-radius: 8px; font-size: 1.4rem; font-weight: 800; background: var(--paper); }
.type input:checked + .aa { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(232, 84, 46, 0.25); }
.type-modern { font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; }
.type-friendly { font-family: "Nunito", "Helvetica Neue", Arial, sans-serif; }
.type-elegant { font-family: "Playfair Display", Georgia, serif; }
.photo .thumb { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; object-fit: cover; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 0.78rem; line-height: 1.2; color: var(--muted); text-align: center; padding: 0; }
.photo .thumb.none, .photo .thumb.add { padding: 6px; }
.photo .thumb.add { border-style: dashed; color: var(--brand-dark); font-weight: 700; }
.photo input:checked + .thumb { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(232, 84, 46, 0.25); }
.photo.upload input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo.upload input[type="file"]:focus-visible + .thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
fieldset.pick label[hidden] { display: none; }
#photo-note { flex-basis: 100%; margin: 4px 0 0; }

table { border-collapse: collapse; width: 100%; background: var(--paper); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }

.timeline { list-style: none; padding: 0; margin: 10px 0 0; }
.timeline li { padding: 10px 12px 10px 28px; position: relative; border-left: 3px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.timeline li.done { border-left-color: var(--ok); }
.timeline li.done::before { background: var(--ok); }
.timeline li.now { border-left-color: var(--brand); }
.timeline li.now::before { background: var(--brand); }
.timeline li.todo { color: var(--muted); }
