:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #1c2420;
  --muted: #59645e;
  --line: #d9ded8;
  --brand: #1f6f5c;
  --brand-ink: #ffffff;
  --brand-soft: #e2f0eb;
  --accent: #b9572b;
  --warn-bg: #fff6e0;
  --warn-line: #e6b94a;
  --good: #1f7a3f;
  --bad: #a3322a;
  --focus: #f2b630;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714;
    --surface: #1a211d;
    --surface-2: #222b26;
    --text: #e6ece8;
    --muted: #9eaaa3;
    --line: #2f3a34;
    --brand: #4fb79b;
    --brand-ink: #0d1411;
    --brand-soft: #1d332c;
    --accent: #e08a5f;
    --warn-bg: #2e2716;
    --warn-line: #8a6d23;
    --good: #5cc47f;
    --bad: #ef7d73;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #121714;
  --surface: #1a211d;
  --surface-2: #222b26;
  --text: #e6ece8;
  --muted: #9eaaa3;
  --line: #2f3a34;
  --brand: #4fb79b;
  --brand-ink: #0d1411;
  --brand-soft: #1d332c;
  --accent: #e08a5f;
  --warn-bg: #2e2716;
  --warn-line: #8a6d23;
  --good: #5cc47f;
  --bad: #ef7d73;
  --shadow: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand);
  color: var(--brand-ink); display: grid; place-items: center; font-size: .95rem;
}
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { font-weight: 600; }

.notice {
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }

main { padding: 28px 0 56px; }

h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 28px 0 10px; }
h3 { font-size: 1.08rem; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.hero { display: grid; gap: 24px; grid-template-columns: 1.4fr 1fr; align-items: start; margin-bottom: 8px; }
.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.hero-card ul { margin: 0; padding-left: 20px; }
.hero-card li { margin: 4px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid transparent;
  padding: 11px 18px; cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; border: 0; color: var(--brand); padding: 6px 0; min-height: 0; text-decoration: underline; font-weight: 500; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

.app { display: grid; grid-template-columns: 220px 1fr 260px; gap: 22px; align-items: start; margin-top: 18px; }
.steps { list-style: none; padding: 0; margin: 0; position: sticky; top: 16px; }
.steps button {
  width: 100%; text-align: left; background: none; border: 0; font: inherit; color: var(--muted);
  padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center;
}
.steps button:hover { background: var(--surface-2); color: var(--text); }
.steps button[aria-current="step"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); border: 1px solid var(--line); }
.steps .n {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor;
  display: grid; place-items: center; font-size: .8rem; flex: none;
}
.steps button.done .n { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps button[disabled] { opacity: .45; cursor: default; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); min-width: 0;
}
.panel > h2:first-child { margin-top: 0; }

.live {
  position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.live h3 { margin: 0 0 8px; font-size: .95rem; color: var(--muted); font-weight: 600; }
.live .big { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.live dl { margin: 12px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .9rem; }
.live dt { color: var(--muted); }
.live dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.field { margin: 0 0 18px; }
.field > label, .field > .label, fieldset > legend { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%; max-width: 360px; min-height: 44px;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.money { position: relative; max-width: 260px; }
.money::before { content: "£"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 24px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; background: var(--surface);
}
.choice:hover { border-color: var(--brand); }
.choice input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.choice span small { display: block; color: var(--muted); font-size: .88rem; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 2px; margin-bottom: 14px; background: var(--surface-2); }
.subcard h3 { margin-top: 0; display: flex; justify-content: space-between; align-items: center; }
details.more { margin: 6px 0 18px; }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.more[open] summary { margin-bottom: 12px; }

.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 12px 14px; border-radius: 0 8px 8px 0; margin: 12px 0 16px; }
.callout.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { margin: 4px 0 0; padding-left: 20px; }

.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.scard { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.scard .k { color: var(--muted); font-size: .88rem; }
.scard .v { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.scard.hl { background: var(--brand-soft); border-color: var(--brand); }
.pos { color: var(--bad); }
.neg { color: var(--good); }

table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
.boxno { font-weight: 700; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.copy {
  font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; margin-left: 6px;
}
.copy:hover { color: var(--text); border-color: var(--brand); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.tick { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 2px 9px; margin-bottom: 6px; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline li.past::before { background: var(--line); border-color: var(--line); }
.timeline li.past { color: var(--muted); }
.timeline .date { font-weight: 700; }
.countdown { font-size: .85rem; color: var(--accent); font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 32px; font-size: .9rem; color: var(--muted); }
.site-footer p { max-width: 75ch; }

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .steps { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .steps li { flex: none; }
  .steps button { white-space: nowrap; }
  .live { position: static; order: -1; }
  .live dl { display: none; }
}

@media (max-width: 720px) {
  .hero, .grid-2, .cards { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: 1fr; }
  .panel { padding: 18px 16px; }
  input[type="text"], input[type="number"], select { max-width: none; }
  .money { max-width: none; }
}

@media print {
  .site-header, .notice, .steps, .live, .btn-row, .copy, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .app { display: block; }
  .panel { border: 0; box-shadow: none; padding: 0; }
}
