/* ---------------------------------------------------------------------------
   The Conductor - passenger pages follow the phone's own light or dark
   setting (Paul, 29 October 2026).

   10 November 2026: visitors can now choose (Paul). assets/look.js, loaded
   straight after this file, draws a "Page colours" switch - Light | Dark |
   Match this device - and sets <html data-look="light|dark|device"> from a
   bas_look cookie before the page is drawn. "device" (the default) still
   follows the phone exactly as before; with JavaScript off, it is all a
   visitor ever gets.

   Each passenger page carries <html data-look="device">, links this file and
   then /assets/look.js. :root[data-look="..."] outranks each page's own
   :root block, wherever this file sits in <head>.

   The dark colours are written out twice below - once for a visitor who
   chose Dark, once for "Match this device" on a dark phone. Keep the two
   blocks identical.

   The colours are the same as the operator pages' Dark (assets/theme.js);
   keep the two in step. Colours the pages used to hard-code are written
   var(--x-..., <old colour>); the --x- tokens exist only here, in dark, so
   the light look does not change by a single pixel.

   NOT on: the driver's boarding list (phone-first, read in daylight at the
   coach door), the poster (printed), and the trips widget (it sits inside the
   operator's own website, which decides its own look).
--------------------------------------------------------------------------- */
:root[data-look="dark"] {
  color-scheme: dark;
  --ink:#e8eef3; --ink-soft:#b4c1cc;
  --line:#46545f; --line-soft:#2b3740;
  --paper:#0f1519; --card:#182128;
  --accent:#6fd1ad; --accent-soft:#143329;
  --amber:#f0bf6a; --amber-soft:#33270f;
  --red:#f4a39a; --red-soft:#3a1c19;
  --blue:#9cc3ea; --blue-soft:#172a3d;
  --muted:#b4c1cc;
  /* Text on a filled button (accent, red, amber or ink fill). */
  --on-fill:#0b1219;
  /* Dark-only stand-ins for colours the pages used to hard-code. */
  --x-ink:#e8eef3; --x-ink-soft:#b4c1cc; --x-faint:#8d9aa6;
  --x-accent:#6fd1ad; --x-amber:#f0bf6a; --x-red:#f4a39a; --x-blue:#9cc3ea; --x-violet:#c9b8f5;
  --x-card:#182128; --x-wash:#1f2a32; --x-wash-strong:#2a3640;
  --x-accent-wash:#143329; --x-amber-wash:#33270f; --x-red-wash:#3a1c19;
  --x-blue-wash:#172a3d; --x-violet-wash:#2a2142;
  --x-accent-strong:#9be6ca; --x-red-strong:#f8bdb6;
  --x-line:#46545f; --x-line-strong:#5d6c78;
  --x-accent-line:#3f8a70; --x-amber-line:#7a5f2a; --x-red-line:#8a4740;
  --x-blue-line:#3d5f80; --x-violet-line:#5a4a8a;
  --x-edge:rgba(232,238,243,.24); --x-edge-soft:rgba(232,238,243,.12);
}
:root[data-look="dark"] body { background:var(--paper); color:var(--ink); }

@media (prefers-color-scheme: dark) {
  :root[data-look="device"] {
    color-scheme: dark;
    --ink:#e8eef3; --ink-soft:#b4c1cc;
    --line:#46545f; --line-soft:#2b3740;
    --paper:#0f1519; --card:#182128;
    --accent:#6fd1ad; --accent-soft:#143329;
    --amber:#f0bf6a; --amber-soft:#33270f;
    --red:#f4a39a; --red-soft:#3a1c19;
    --blue:#9cc3ea; --blue-soft:#172a3d;
    --muted:#b4c1cc;
    /* Text on a filled button (accent, red, amber or ink fill). */
    --on-fill:#0b1219;
    /* Dark-only stand-ins for colours the pages used to hard-code. */
    --x-ink:#e8eef3; --x-ink-soft:#b4c1cc; --x-faint:#8d9aa6;
    --x-accent:#6fd1ad; --x-amber:#f0bf6a; --x-red:#f4a39a; --x-blue:#9cc3ea; --x-violet:#c9b8f5;
    --x-card:#182128; --x-wash:#1f2a32; --x-wash-strong:#2a3640;
    --x-accent-wash:#143329; --x-amber-wash:#33270f; --x-red-wash:#3a1c19;
    --x-blue-wash:#172a3d; --x-violet-wash:#2a2142;
    --x-accent-strong:#9be6ca; --x-red-strong:#f8bdb6;
    --x-line:#46545f; --x-line-strong:#5d6c78;
    --x-accent-line:#3f8a70; --x-amber-line:#7a5f2a; --x-red-line:#8a4740;
    --x-blue-line:#3d5f80; --x-violet-line:#5a4a8a;
    --x-edge:rgba(232,238,243,.24); --x-edge-soft:rgba(232,238,243,.12);
  }
  /* Photos and logos stay as they are; only the page around them changes. */
  :root[data-look="device"] body { background:var(--paper); color:var(--ink); }
}

/* ---- The "Page colours" switch (drawn by look.js) ----------------------
   Words and a tick carry the choice; the filled button is a second cue.
   Uses the page's own tokens, with fallbacks for pages that lack one. */
.look-row{display:flex; justify-content:flex-end; margin:0 0 10px}
.look-switch{display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px;
  font-size:13px; line-height:1.2; font-weight:500; color:var(--x-ink-soft,var(--ink-soft,#3d4c58))}
.look-switch .look-label{margin-right:4px; font-weight:600}
.look-switch button{font:inherit; font-weight:600; min-height:34px; padding:6px 11px; cursor:pointer;
  border-radius:999px; border:1px solid var(--x-line,var(--line,#c9d3da));
  background:var(--x-card,var(--card,#fff)); color:var(--x-ink,var(--ink,#16222c))}
.look-switch button .look-tick{display:none; margin-right:4px}
.look-switch button[aria-pressed="true"]{background:var(--x-ink,var(--ink,#16222c)); color:var(--x-card,var(--card,#fff));
  border-color:var(--x-ink,var(--ink,#16222c)); font-weight:700}
.look-switch button[aria-pressed="true"] .look-tick{display:inline}
.look-switch button:focus-visible{outline:3px solid var(--x-accent,var(--accent,#08483a)); outline-offset:2px}
.look-switch .look-short{display:none}
@media (max-width:480px){
  .look-switch{gap:3px}
  .look-switch button{padding:6px 9px}
  .look-switch .look-long{display:none}
  .look-switch .look-short{display:inline}
}
@media print{.look-row,.look-switch{display:none}}
