:root {
  /* PonyCon Holland: orange disc with red, white and blue letters */
  --plum: #15225C;          /* navy: header, destination signs */
  --plum-2: #24357E;
  --amber: #FFA15E;         /* logo orange: sign times, highlights */
  --amber-dim: #F07F2E;
  --pink: #2456E8;          /* logo blue (deepened for contrast): main actions */
  --pink-ink: #FFFFFF;
  --nl-red: #FF2929;
  --nl-blue: #3366FF;
  --paper: #F4F6FC;
  --surface: #FFFFFF;
  --ink: #141C3D;
  --muted: #5D6585;
  --line: #DCE1F0;
  --go: #138A5E;
  --go-bg: #DCF4EA;
  --wait: #9A4A06;
  --wait-bg: #FFE9D6;
  --stop: #D11F2A;
  --stop-bg: #FFE3E3;
  --focus: #2456E8;
  --rainbow: linear-gradient(90deg, #FF2929 0 25%, #FFFFFF 0 50%, #3366FF 0 75%, #FFA15E 0);
  --card-shadow: 0 1px 0 rgba(21, 34, 92, .05), 0 10px 26px -14px rgba(21, 34, 92, .35);
  --radius-sign: 16px;
  --radius-ui: 12px;
  --font-display: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0C1230;
    --surface: #18214A;
    --ink: #EEF1FF;
    --muted: #A8B0D4;
    --line: #2B3664;
    --plum: #101A4A;
    --plum-2: #2A3B88;
    --pink: #3B6CF6;
    --pink-ink: #FFFFFF;
    --go: #4CD3A0; --go-bg: #0F3A2C;
    --wait: #FFB980; --wait-bg: #3A2412;
    --stop: #FF7076; --stop-bg: #3D1418;
    --focus: #7EA0FF;
    --card-shadow: 0 10px 26px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--focus); }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--plum); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.brand-mark { width: 26px; height: 26px; background: url(/icons/pch-96.png) center/contain no-repeat; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.lang, .icon-btn {
  background: var(--plum-2); border: 0; color: #fff; border-radius: 999px;
  min-width: 40px; height: 36px; padding: 0 12px; cursor: pointer; font-weight: 700; font-size: .85rem;
}
.icon-btn svg { width: 18px; height: 18px; vertical-align: -3px; }
.icon-btn.on { background: var(--amber); color: var(--plum); }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 84px; outline: none; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; max-width: 160px; text-align: center; padding: 10px 4px 12px;
  color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { color: var(--focus); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-ui); padding: 12px 18px; min-height: 46px;
  font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--plum); color: #fff;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.amber { background: var(--amber); color: var(--plum); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--stop-bg); color: var(--stop); }
.btn.go { background: var(--go); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
@media (prefers-color-scheme: dark) { .btn { background: var(--plum-2); } }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 12px; border-radius: var(--radius-ui);
  border: 2px solid var(--line); background: var(--surface); min-height: 46px;
}
textarea { min-height: 140px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }

/* ---------- welcome / verify ---------- */
.welcome-sign {
  background: var(--plum); color: var(--amber); border-radius: var(--radius-sign);
  padding: 22px 20px; margin: 8px 0 22px;
  box-shadow: inset 0 0 0 3px #1c0f2c, inset 0 0 0 5px var(--plum-2);
}
.welcome-sign h1 { font-size: 2rem; letter-spacing: .01em; }
.welcome-sign p { color: #E8DDF7; margin-top: 8px; max-width: 34ch; }
.methods { display: grid; gap: 10px; margin-bottom: 18px; }
.method {
  display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-ui);
  padding: 14px; cursor: pointer; width: 100%;
}
.method[aria-pressed="true"] { border-color: var(--focus); }
.method svg { width: 28px; height: 28px; flex: none; color: var(--focus); }
.method strong { display: block; }
.method span { color: var(--muted); font-size: .9rem; }
.panel { background: var(--surface); border-radius: var(--radius-ui); padding: 16px; border: 1px solid var(--line); }
.camera { position: relative; border-radius: var(--radius-ui); overflow: hidden; background: #000; aspect-ratio: 1; margin-bottom: 12px; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera::after { content: ''; position: absolute; inset: 18%; border: 3px solid var(--amber); border-radius: 12px; }
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: var(--radius-ui); padding: 28px 16px; cursor: pointer;
}
.dropzone.drag { border-color: var(--focus); }
.small-link { display: block; text-align: center; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.error { color: var(--stop); font-weight: 700; margin-top: 10px; }

/* ---------- route picker ---------- */
.route {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  background: var(--surface); border-radius: var(--radius-ui); padding: 10px; border: 1px solid var(--line);
  margin-bottom: 14px;
}
.route-stops { display: grid; gap: 6px; }
.route-stop { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; }
.route-stop select { border: 0; background: var(--paper); min-height: 42px; padding: 8px 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--focus); justify-self: center; }
.dot.end { border-radius: 3px; background: var(--focus); }
.swap { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; }
.swap svg { width: 20px; height: 20px; }

.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.days button {
  flex: none; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: .9rem;
}
.days button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }

/* ---------- the ride sign (signature element) ---------- */
.ride { margin-bottom: 14px; }
.sign {
  display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: center;
  background: var(--plum); color: var(--amber);
  border-radius: var(--radius-sign) var(--radius-sign) 0 0;
  padding: 14px 16px;
  box-shadow: inset 0 0 0 3px #1c0f2c, inset 0 0 0 5px var(--plum-2);
  background-image: radial-gradient(rgba(255,194,61,.07) 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.sign-time { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sign-dest { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.sign-from { color: #CDBDE6; font-size: .88rem; }
.sign.cancelled { filter: grayscale(.9); opacity: .75; }
.sign.cancelled .sign-time { text-decoration: line-through; }
.ride-body {
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-ui) var(--radius-ui); padding: 12px 16px 14px;
  display: grid; gap: 10px;
}
.ride-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .9rem; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .82rem; }
.pill.confirmed, .pill.rush { background: var(--go-bg); color: var(--go); }
.pill.open { background: var(--wait-bg); color: var(--wait); }
.pill.cancelled { background: var(--stop-bg); color: var(--stop); }
.pill.departed { background: var(--line); color: var(--muted); }
.pill.mine { background: var(--plum); color: var(--amber); }
.needed { display: grid; gap: 5px; }
.needed-text { font-size: .9rem; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--amber-dim); }
.bar i.full { background: var(--go); }
.ride-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ride-actions .btn { flex: 1 1 auto; }
.ride-note { font-size: .9rem; }
.seat-step { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: var(--radius-ui); }
.seat-step button { width: 38px; height: 40px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 1.1rem; }
.seat-step output { min-width: 26px; text-align: center; font-weight: 700; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; gap: 10px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.fab {
  position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 15;
  box-shadow: 0 6px 20px rgba(42, 23, 64, .35); border-radius: 999px; padding: 14px 20px;
}
@media (min-width: 700px) { .fab { right: calc(50% - 304px); } }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(23, 12, 36, .5); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 640px; margin: 0 auto; max-height: 90dvh; overflow: auto;
  background: var(--paper); border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .22s ease-out;
}
.sheet h2 { margin-bottom: 14px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--radius-ui);
  font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--stop); color: #fff; }

/* ---------- notice ---------- */
.notice {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  background: var(--wait-bg); color: var(--ink); border-radius: var(--radius-ui); padding: 12px 14px; margin-bottom: 14px; font-size: .92rem;
}

/* ---------- admin ---------- */
.admin-ride .pax { display: grid; gap: 4px; }
.pax-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.pax-row input { width: 22px; height: 22px; accent-color: var(--go); }
.pax-row small { color: var(--muted); }
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-ui); padding: 10px 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .85rem; }
details.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-ui); margin-bottom: 10px; }
details.card summary { cursor: pointer; padding: 14px 16px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; }
details.card summary::after { content: '+'; color: var(--muted); }
details.card[open] summary::after { content: '–'; }
details.card .inner { padding: 0 16px 16px; display: grid; gap: 12px; }
.list-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 .field { margin-bottom: 0; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-weight: 700; font-size: .85rem; }
.filter-row button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
code { font-size: .85em; background: var(--line); padding: 1px 5px; border-radius: 4px; }
.highlight { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--amber); border-radius: var(--radius-sign); } }
.grid-2 .field { align-content: end; }
.link-note { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .85rem; }
.link-note svg { flex: none; }
.ride-meta svg { vertical-align: -3px; }

/* =====================================================================
   PonyCon Holland theme: logo orange + Dutch red, white and blue
   ===================================================================== */
body { background: var(--paper); }

/* Optional own background (data/background.png), faded into the page */
.bg-art {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg-url) center top / cover no-repeat;
  opacity: .22;
  -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.75) 35%, transparent 85%);
          mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.75) 35%, transparent 85%);
}
@media (prefers-color-scheme: dark) { .bg-art { opacity: .16; } }

/* header: navy with the flag + orange stripe */
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; background: var(--rainbow); }
.brand-mark.has-logo { width: 38px; height: 38px; background: none; }
.brand-mark.has-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
main { padding-top: 22px; }

/* actions */
.btn.amber { background: var(--pink); color: var(--pink-ink); box-shadow: 0 3px 0 rgba(21,34,92,.25); }
.btn.amber:active { transform: translateY(1px); box-shadow: none; }
.fab { box-shadow: 0 8px 22px rgba(36, 86, 232, .45); }
.tabs a[aria-current="page"] svg { color: var(--amber-dim); }
.tabs { border-top: 0; box-shadow: 0 -6px 20px -12px rgba(21,34,92,.4); }

/* cards lift off the page */
.ride-body, .panel, .route, .method, details.card, .stat, .days button, .filter-row button { box-shadow: var(--card-shadow); }
.ride-body, .route, .panel, details.card, .stat, .method { border-color: transparent; }
.method[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--amber-dim), var(--card-shadow); }
.method svg { color: var(--amber-dim); }
.days button[aria-pressed="true"], .filter-row button[aria-pressed="true"] { background: var(--plum); color: #fff; }
@media (prefers-color-scheme: dark) {
  .days button[aria-pressed="true"], .filter-row button[aria-pressed="true"] { background: var(--amber); color: #1A1230; }
}
.dot { border-color: var(--nl-red); }
.dot.end { background: var(--nl-blue); border-color: var(--nl-blue); }
.bar i { background: var(--amber-dim); }
.pill.mine { background: var(--amber); color: #2A1406; }

/* destination signs: navy board, orange time, white destination */
.sign, .welcome-sign {
  background-color: var(--plum);
  background-image: radial-gradient(rgba(255,161,94,.07) 1px, transparent 1.2px);
  background-size: 4px 4px;
  box-shadow: inset 0 0 0 3px #0B1338, inset 0 0 0 5px var(--plum-2);
}
.sign-time { color: var(--amber); }
.sign-dest { color: #fff; }
.sign-from { color: #B9C3EA; }
.welcome-sign { position: relative; overflow: hidden; padding: 26px 22px 24px 28px; color: #fff; }
.welcome-sign h1 { color: var(--amber); }
.welcome-sign p { color: #DCE2FA; }
.welcome-sign::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: linear-gradient(180deg, #FF2929 0 33.3%, #FFFFFF 0 66.6%, #3366FF 0); }
.welcome-logo { display: block; width: 96px; height: 96px; object-fit: contain; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.welcome-sign p + p { margin-top: 6px; }

/* "show my ticket" button in the header */
.icon-btn.ticket-btn { background: var(--amber); color: #2A1406; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn.ticket-btn svg { width: 18px; height: 18px; }
.icon-btn.on { background: var(--amber); color: #2A1406; }
@media (max-width: 380px) { .ticket-btn span { display: none; } }

/* ---------- full-screen ticket for the check at the bus ---------- */
.ticket-view {
  position: fixed; inset: 0; z-index: 70; overflow: auto;
  background: radial-gradient(circle at 50% 0, #2A3B88 0, var(--plum) 60%);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: grid; place-items: start center;
}
.ticket-card {
  width: 100%; max-width: 420px; background: #fff; color: #141C3D; border-radius: 22px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.ticket-stripe { height: 10px; background: linear-gradient(90deg, #FF2929 0 33.3%, #FFFFFF 0 66.6%, #3366FF 0); border-bottom: 1px solid #E6E9F5; }
.ticket-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket-head h2 { font-size: 1.1rem; color: #5D6585; font-weight: 600; }
.ticket-head img { width: 48px; height: 48px; object-fit: contain; }
.ticket-name { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; line-height: 1.05; padding: 0 20px; overflow-wrap: anywhere; }
.ticket-valid { margin: 12px 20px 0; display: flex; align-items: center; gap: 10px; background: #DCF4EA; color: #0F6E4B; border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.ticket-valid svg { width: 22px; height: 22px; flex: none; }
.ticket-live { position: relative; margin: 14px 20px 0; border-radius: 14px; overflow: hidden; background: #15225C; text-align: center; padding: 12px 10px; }
.ticket-live .clock { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; position: relative; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.ticket-live::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.35) 45%, transparent 70%), linear-gradient(90deg, #FF2929, #FFA15E, #3366FF, #FF2929);
  background-size: 200% 100%, 300% 100%; opacity: .5;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { from { background-position: 150% 0, 0 0; } to { background-position: -50% 0, 150% 0; } }
@media (prefers-reduced-motion: reduce) { .ticket-live::before { animation-duration: 8s; } }
.ticket-live-hint { margin: 6px 20px 0; color: #5D6585; font-size: .82rem; text-align: center; }
.ticket-qr { display: grid; place-items: center; padding: 16px 20px 6px; }
.ticket-qr svg { width: 190px; height: 190px; }
.ticket-code { text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: .08em; padding-bottom: 6px; }
.ticket-rows { margin: 8px 20px 0; border-top: 2px dashed #DCE1F0; padding: 12px 0 4px; display: grid; gap: 8px; }
.ticket-rows div { display: flex; justify-content: space-between; gap: 12px; }
.ticket-rows span { color: #5D6585; }
.ticket-rows b { text-align: right; }
.ticket-foot { padding: 16px 20px 20px; }
.ticket-foot .btn { width: 100%; background: #15225C; color: #fff; }

/* header fit */
.brand { min-width: 0; }
.brand-text { display: grid; line-height: 1.05; min-width: 0; }
.brand-text small { font-family: var(--font-body); font-weight: 700; font-size: .72rem; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 1.2rem; }
.icon-btn { white-space: nowrap; }
.top-actions { flex: none; }

.link-note { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .85rem; }
.link-note svg { flex: none; }
.ride-meta svg { vertical-align: -3px; }

/* dark mode: blue buttons keep white text */
@media (prefers-color-scheme: dark) {
  :root { --pink: #3B6CF6; --pink-ink: #FFFFFF; }
  .btn.amber { box-shadow: 0 3px 0 rgba(0,0,0,.35); }
}
.toggle-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle-row input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--pink); flex: none; }

/* ---------- driver check-in scanner ---------- */
.scan-view {
  position: fixed; inset: 0; z-index: 70; overflow: auto; background: var(--paper);
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: grid; align-content: start; gap: 12px; max-width: 640px; margin: 0 auto;
}
.scan-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scan-top > div { display: grid; }
.scan-top span { color: var(--muted); font-size: .9rem; }
.scan-cam { margin: 0; aspect-ratio: 4 / 3; }
.scan-cam::after { inset: 14% 22%; border-color: var(--amber); }
.scan-hint { color: var(--muted); font-size: .9rem; margin: 0; }
.scan-hint.error { color: var(--stop); font-weight: 700; }
.scan-type { display: flex; gap: 8px; }
.scan-type input { flex: 1; }
.scan-result {
  position: absolute; inset: 0; z-index: 2; display: grid; align-content: center; gap: 8px; padding: 18px; text-align: center;
  color: #fff; animation: pop .18s ease-out;
}
.scan-result.ok { background: rgba(19, 138, 94, .96); }
.scan-result.warn { background: rgba(214, 120, 18, .97); }
.scan-result.bad { background: rgba(209, 31, 42, .97); }
.scan-result .sr-head { display: flex; gap: 10px; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.15; }
.scan-result .sr-head svg { width: 34px; height: 34px; flex: none; }
.scan-result .sr-name { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; overflow-wrap: anywhere; }
.scan-result p { margin: 0; }
.scan-result .btn.ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.scan-result .btn.amber { background: #fff; color: #15225C; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scan-result { animation: none; } }
.scan-list { background: var(--surface); border-radius: var(--radius-ui); padding: 4px 14px; box-shadow: var(--card-shadow); }
.scan-list .pax-row:first-child { border-top: 0; }
.pax-in, .pax-out { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.pax-in { background: var(--go); color: #fff; }
.pax-in svg { width: 18px; height: 18px; }
.pax-out { box-shadow: inset 0 0 0 2px var(--line); }
/* result replaces the camera view so long messages always fit */
.scan-cam:has(.scan-result:not([hidden])) { aspect-ratio: auto; min-height: 260px; display: grid; }
.scan-cam:has(.scan-result:not([hidden])) video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .15; }
.scan-cam:has(.scan-result:not([hidden]))::after { display: none; }
.scan-cam .scan-result { position: relative; inset: auto; padding: 22px 18px; }
.scan-cam .scan-result:not([hidden]) { min-height: 260px; }
.scan-result .sr-head { flex-direction: column; gap: 6px; font-size: 1.35rem; }

/* ---------- install as app ---------- */
.install-notice { background: var(--surface); box-shadow: var(--card-shadow); grid-template-columns: 1fr; }
.install-notice > span:first-child { display: flex; gap: 10px; align-items: flex-start; }
.install-notice svg { width: 26px; height: 26px; flex: none; color: var(--amber-dim); }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.install-head img { width: 56px; height: 56px; border-radius: 14px; }
.install-head h2 { margin: 0; }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.install-steps li::marker { font-weight: 700; color: var(--amber-dim); }
.btn svg { flex: none; }

/* installed app: respect the notch / status bar */
@media (display-mode: standalone) {
  .top { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* offline bar */
.offline-bar { display: none; }
body.is-offline .offline-bar {
  display: flex; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 30;
  background: #B4231F; color: #fff; font-size: .88rem; line-height: 1.3; padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
body.is-offline .offline-bar svg { width: 24px; height: 24px; flex: none; }
body.is-offline .needs-net { opacity: .45; pointer-events: none; filter: grayscale(.6); }
@media (display-mode: standalone) { body.is-offline .top { padding-top: 12px; } }

/* ---------- ride card extras ---------- */
.ride.popular .sign { box-shadow: inset 0 0 0 3px #0B1338, inset 0 0 0 5px var(--amber); }
.ride.popular .ride-body { box-shadow: 0 0 0 2px var(--amber), var(--card-shadow); }
.going { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--amber-dim); }
.going svg { width: 20px; height: 20px; flex: none; }
.ride-update { display: flex; gap: 10px; background: var(--paper); border-left: 4px solid var(--nl-blue); border-radius: 8px; padding: 8px 12px; }
.ride-update svg { width: 20px; height: 20px; flex: none; color: var(--nl-blue); margin-top: 2px; }
.ride-update strong { font-size: .85rem; }
.ride-update p { margin: 2px 0 0; }
.extra-note { display: flex; gap: 8px; align-items: flex-start; background: var(--wait-bg); color: var(--wait); border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: .9rem; }
.extra-note.ok { background: var(--go-bg); color: var(--go); }
.extra-note svg { width: 20px; height: 20px; flex: none; }
.ride.extra .sign { background-color: #2A1A4A; }
.interest-hint { flex-basis: 100%; margin: 0; }
.day-note { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); box-shadow: var(--card-shadow); border-radius: var(--radius-ui); padding: 12px 14px; margin: 6px 0 18px; font-weight: 700; font-size: .92rem; }
.pill.departed { background: var(--line); color: var(--ink); }

/* server clock under the header */
.server-clock { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 640px; margin: 12px auto -6px; padding: 0 16px; font-size: .82rem; color: var(--muted); text-align: center; }
.server-clock svg { width: 15px; height: 15px; flex: none; }
.server-clock b { color: var(--ink); font-variant-numeric: tabular-nums; }
.clock-warn { color: var(--stop); font-weight: 700; }

/* different pickup point warning */
.loc-warn { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.loc-warn svg { width: 30px; height: 30px; color: var(--amber-dim); flex: none; }
.loc-warn h2 { margin: 0; }

/* rides with passengers: pulse to draw attention */
@keyframes pax-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--amber), var(--card-shadow); }
  50% { box-shadow: 0 0 0 4px var(--amber), 0 0 22px 4px rgba(255, 161, 94, .65), var(--card-shadow); }
}
@keyframes pax-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.ride.popular .ride-body { animation: pax-pulse 1.6s ease-in-out infinite; }
.ride.popular .going svg { animation: pax-blink 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .ride.popular .ride-body, .ride.popular .going svg { animation: none; }
}
.server-clock { display: block; }
.server-clock svg { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.server-clock > span { display: inline; }
