/* Layout: one phone-width column (max 40rem); booklet-style colour blocks for sections; red "help now" strip always one tap away. */
:root {
  --bg: #ffffff;
  --fg: #1b2733;
  --muted: #56636f;
  --brand: #005a96;
  --brand-ink: #ffffff;
  --line: #dbe3ea;
  --soft: #eef4f9;
  --tip: #e3eff8;
  --warn-bg: #fdecea;
  --warn-fg: #8f1d12;
  --urgent: #d42a1c;
  --flag-bg: #fff3d6;
  --flag-fg: #6b4a00;
  --focus: #f4b400;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.4rem;
  --step-4: 3.6rem;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1620; --fg: #e5edf4; --muted: #9eb0c1; --brand: #6db6f0; --brand-ink: #06233b;
    --line: #243443; --soft: #15212c; --tip: #13283a; --warn-bg: #3a1714; --warn-fg: #ffb4ab;
    --urgent: #ff5b4d; --flag-bg: #3a2e0c; --flag-fg: #ffd77a; --focus: #ffd24d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1620; --fg: #e5edf4; --muted: #9eb0c1; --brand: #6db6f0; --brand-ink: #06233b;
  --line: #243443; --soft: #15212c; --tip: #13283a; --warn-bg: #3a1714; --warn-fg: #ffb4ab;
  --urgent: #ff5b4d; --flag-bg: #3a2e0c; --flag-fg: #ffd77a; --focus: #ffd24d; color-scheme: dark;
}
html.big { font-size: 118%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--step-0); line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: 40rem; margin: 0 auto; padding-inline: 16px; }

/* Prototype ribbon */
.proto { background: var(--flag-bg); color: var(--flag-fg); font-size: var(--step--1); padding: 6px 16px; text-align: center; line-height: 1.35; }
.proto b { font-weight: 700; }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.brand { font-weight: 800; color: var(--brand); text-decoration: none; font-size: var(--step-1); letter-spacing: -0.01em; margin-right: auto; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--fg); font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer; text-decoration: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.sos { background: var(--urgent); border-color: var(--urgent); color: #fff; }

/* Home hero */
.hero { padding-block: 28px 20px; }
.hero h1 { font-size: var(--step-4); font-weight: 800; color: var(--brand); letter-spacing: -0.03em; line-height: 0.92; }
.hero .tag { margin-top: 12px; font-size: var(--step-1); color: var(--muted); }

.now { background: var(--urgent); color: #fff; border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.now h2 { font-size: var(--step-1); }
.now .row { display: flex; flex-wrap: wrap; gap: 8px; }
.now a { color: #fff; }
.callbtn-big { display: inline-flex; flex-direction: column; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.45); border-radius: 8px; padding: 8px 12px; text-decoration: none; min-width: 0; flex: 1 1 8.5rem; }
.callbtn-big b { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.callbtn-big span { font-size: var(--step--1); opacity: 0.95; }
.now .more { font-weight: 700; font-size: var(--step--1); }

.first { margin-top: 16px; display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); text-decoration: none; }
.first svg { width: 40px; height: 40px; flex: none; }
.first b { display: block; font-size: var(--step-1); }
.first span { font-size: var(--step--1); }

.hlabel { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 28px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 8.5rem; padding: 14px; border-radius: var(--radius); text-decoration: none; background: var(--c); color: var(--ink, #fff); }
.tile svg { width: 34px; height: 34px; }
.tile b { font-size: 1.08rem; line-height: 1.15; display: block; }
.tile span { font-size: 0.8rem; line-height: 1.3; opacity: 0.92; display: block; margin-top: 4px; }

/* Section page */
.band { background: var(--c); color: var(--ink, #fff); }
.band .wrap { padding-block: 22px 26px; display: grid; gap: 14px; }
.band svg.big { width: 46px; height: 46px; }
.band h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
.crumb { color: inherit; font-size: var(--step--1); font-weight: 600; text-decoration: none; opacity: 0.9; }
.intro { display: grid; gap: 10px; padding-block: 18px 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 12px; scrollbar-width: thin; }
.chips a { flex: none; padding: 7px 12px; border-radius: 18px; background: var(--soft); color: var(--fg); text-decoration: none; font-size: var(--step--1); font-weight: 600; border: 1px solid var(--line); }
.topic { padding-block: 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; scroll-margin-top: 70px; }
.topic h2 { font-size: var(--step-2); font-weight: 800; color: var(--brand); }
.topic ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.tip, .warn { border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.tip { background: var(--tip); }
.warn { background: var(--warn-bg); color: var(--warn-fg); }
.seealso { font-weight: 600; }

details.orig > summary { cursor: pointer; color: var(--muted); font-size: var(--step--1); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
details.orig > summary::-webkit-details-marker { display: none; }
details.orig > summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; font-size: 13px; line-height: 1; }
details.orig[open] > summary::before { content: "−"; }
details.orig .otext { font-size: var(--step--1); color: var(--muted); border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin-top: 4px; }

/* Service cards */
.svcs { display: grid; gap: 10px; }
.svc { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; background: var(--bg); }
.svc h3 { font-size: var(--step-1); font-weight: 700; }
.svc .about { color: var(--fg); }
.svc .meta { font-size: var(--step--1); color: var(--muted); display: grid; gap: 4px; }
.svc .meta div { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.svc .meta svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.calls { display: flex; flex-wrap: wrap; gap: 8px; }
.call { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 22px; background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 700; min-height: 44px; }
.call svg { width: 18px; height: 18px; }
.call small { font-weight: 500; opacity: 0.9; font-size: 0.78rem; }
.call .num { font-variant-numeric: tabular-nums; }
.call.alt { background: var(--soft); color: var(--fg); border: 1px solid var(--line); }
.area-h { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-top: 6px; }

/* Reviewer flags (hidden unless reviewer mode) */
.flag { display: none; background: var(--flag-bg); color: var(--flag-fg); border-radius: 6px; padding: 8px 10px; font-size: var(--step--1); }
.clin { display: none; }
html.review .flag, html.review .clin { display: block; }
.clin { background: var(--flag-bg); color: var(--flag-fg); border-radius: 6px; padding: 8px 10px; font-size: var(--step--1); font-weight: 600; }

/* Exit plan */
.plan { display: grid; gap: 14px; }
.plan fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
.plan legend { font-weight: 800; padding: 0 6px; color: var(--brand); }
.plan label { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.plan label:last-child { border-bottom: 0; }
.plan input[type=checkbox] { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.plan input:checked + span { text-decoration: line-through; color: var(--muted); }
.progress { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.note { font-size: var(--step--1); color: var(--muted); }

/* Appointments */
.appt-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.appt-form label { display: grid; gap: 4px; font-weight: 600; font-size: var(--step--1); }
.appt-form input { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); min-width: 0; }
.btn { font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 22px; border: 0; background: var(--brand); color: var(--brand-ink); cursor: pointer; min-height: 44px; justify-self: start; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.appts { display: grid; gap: 8px; }
.appt { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.appt div { min-width: 0; overflow-wrap: anywhere; }

/* Van timetable */
.tt { overflow-x: auto; }
.tt table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.tt th, .tt td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tt th { white-space: nowrap; color: var(--brand); }

/* First days */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 12px; align-items: start; }
.steps > li::before { content: counter(s); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: var(--step-1); }
.steps h3 { font-size: var(--step-1); font-weight: 800; }
.steps .body { display: grid; gap: 8px; }

/* Search */
.search { padding-block: 16px; display: grid; gap: 12px; }
.search input { font: inherit; font-size: var(--step-1); padding: 12px 14px; border-radius: 10px; border: 2px solid var(--brand); background: var(--bg); color: var(--fg); width: 100%; }
.results { display: grid; gap: 8px; }
.result { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--fg); }
.result b { color: var(--brand); display: block; }
.result span { font-size: var(--step--1); color: var(--muted); }

/* Footer */
footer { margin-top: 36px; background: var(--soft); border-top: 1px solid var(--line); }
footer .wrap { padding-block: 22px 40px; display: grid; gap: 12px; font-size: var(--step--1); color: var(--muted); }
footer .tagline { color: var(--brand); font-weight: 700; font-size: var(--step-0); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }

/* Quick exit */
.qexit { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: #1b2733; color: #fff; border: 2px solid #fff; border-radius: 24px; padding: 10px 16px; font: inherit; font-weight: 800; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.3); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
