/* Extracted verbatim from templates/base.html.
   ~70 KB of identical CSS used to be inlined into EVERY page — re-sent,
   re-parsed and re-gzipped on every navigation, and impossible for a
   browser to cache. As a hashed static file it is fetched once and then
   served from cache (and from the service worker) for good.

   ORDER IS THE CONTRACT: these were four consecutive <style> blocks that
   sat AFTER tailwind.app.css, style.css and orderly-select.css and BEFORE
   any page's own head block. The link that replaces them is in that same
   position, so the cascade is unchanged. Keep it there. */


    /* ── Dark — the primary theme ──────────────────────────────────────────
       A counter tablet is usually the brightest object on a dark bar. Pure
       #000 is avoided for large fields: on OLED it smears during scroll and
       it flattens the elevation ladder, because nothing can sit *below* it. */
    :root, [data-theme="dark"] {
      color-scheme: dark;

      --bg-page:      #06080C;   /* the room                                */
      --surface-1:    #0C111A;   /* cards, tiles — the navy-black of a tile */
      --surface-2:    #141B27;   /* raised: hover, selected, input wells    */
      --surface-3:    #1B2431;   /* overlays: modals, popovers, menus       */
      --surface-4:    #2C3646;   /* control tracks — an unchecked switch    */

      --border-1:     rgba(255,255,255,.11);   /* hairline between siblings  */
      --border-2:     rgba(255,255,255,.22);   /* a real edge: inputs, chips */
      --border-3:     rgba(255,255,255,.30);   /* emphasis / focus companion */
      /* The edge of a CONTROL, not of a panel. WCAG 1.4.11 asks 3:1 for the
         boundary that tells you a thing is a button or a tick box, and every
         tier above is below that by design — they are decorative seams. Any
         control whose shape is carried by its border uses this one. Measured
         3.56:1 on a card, 3.48:1 on the page. */
      --border-control: rgba(255,255,255,.38);

      --text-1:       #F5F8FC;   /* 17.8:1 — headings, values, item names   */
      --text-2:       #B4C0D0;   /* 10.3:1 — descriptions, body             */
      --text-3:       #8A97A8;   /*  6.4:1 — labels, meta                   */
      --text-4:       #7A8593;   /*  4.6:1 on an input well — small text OK */
      --text-5:       #606A7A;   /*  3.2:1 — decorative rules, watermarks   */

      --accent:       #186FF2;   /* brand — fills; white label clears 4.57:1 */
      --accent-ink:   #6BA9FF;   /*  7.9:1 — the brand as readable text     */
      --accent-soft:  rgba(24,111,242,.16);

      --money:        #F5B942;   /* 10.7:1 — prices carry their own colour  */
      --success:      #22C55E;
      --success-ink:  #4ADE80;
      --warn:         #F59E0B;
      --warn-ink:     #FBBF24;
      --danger:       #EF4444;
      --danger-ink:   #FF8080;
      --violet-ink:   #C4B5FD;

      --scrim:        rgba(3,5,9,.72);         /* modal backdrop            */
      --shadow-1:     0 1px 2px rgba(0,0,0,.5);
      --shadow-2:     0 8px 24px -6px rgba(0,0,0,.7);
      --shadow-3:     0 24px 48px -12px rgba(0,0,0,.8);
    }

    /* ── Light — for daylight service and front-of-house tablets ───────────
       Not an inversion. Translucent surfaces that read as "subtle" on black
       turn into muddy grey on white, so light mode uses solid surfaces and
       earns its hierarchy from shadow instead of opacity. */
    [data-theme="light"] {
      color-scheme: light;

      --bg-page:      #F2F5F9;
      --surface-1:    #FFFFFF;
      --surface-2:    #EAEFF6;
      --surface-3:    #FFFFFF;
      --surface-4:    #CBD5E1;   /* must read against a white card          */

      --border-1:     rgba(15,23,42,.16);
      --border-2:     rgba(15,23,42,.26);
      --border-3:     rgba(15,23,42,.42);
      /* 3.21:1 on a white card — see the note in the dark block. A light page
         has further to fall than a dark one: at .16 an input's edge measured
         1.4:1, which is a smudge, not an edge. */
      --border-control: rgba(15,23,42,.48);

      --text-1:       #0A0F1A;   /* 17.5:1 */
      --text-2:       #3F4A5C;   /*  8.2:1 */
      --text-3:       #5C6779;   /*  5.2:1 */
      --text-4:       #636D7B;   /*  4.5:1 on an input well — matching dark */
      --text-5:       #7F8998;   /*  3.2:1 — decorative only */

      --accent:       #186FF2;
      --accent-ink:   #0F52B3;   /*  6.7:1 — the blue, darkened          */
      --accent-soft:  rgba(24,111,242,.10);

      --money:        #8A5A06;   /*  5.4:1 — amber is unreadable on white */
      /* These two are now edges as well as fills — a coloured border resolves
         to the solid hue — and at their previous values that edge measured
         3.01:1 and 2.91:1 against the page: right on, and just under, the 3:1
         a control's boundary has to clear. Darkened until both clear it with a
         margin. They are still the same hue; light mode simply cannot carry a
         mid-tone amber or green as an edge on a near-white field. */
      --success:      #12913F;   /* 3.7:1 as an edge on the page */
      --success-ink:  #0F5F2C;   /* 5.4:1 — 4.4:1 measured on the deposit
                                    panel's green-on-teal blend, which is the
                                    tightest one in the app */
      --warn:         #C56A05;   /* 3.5:1 as an edge on the page */
      --warn-ink:     #875600;   /* 4.6:1 — see note below         */
      --danger:       #DC2626;
      --danger-ink:   #9C2C2C;   /* 4.7:1                          */
      --violet-ink:   #603E9C;   /* 5.0:1                          */

      --scrim:        rgba(15,23,42,.45);
      --shadow-1:     0 1px 2px rgba(15,23,42,.07);
      --shadow-2:     0 8px 24px -6px rgba(15,23,42,.13);
      --shadow-3:     0 24px 48px -12px rgba(15,23,42,.20);
    }

    /* Legacy aliases — a handful of templates reference the original variable
       names. They now resolve to the token ladder rather than their own hexes,
       so those screens theme correctly instead of drifting. */
    :root, [data-theme="dark"], [data-theme="light"] {
      --bg-surface: var(--surface-1);  --bg-card: var(--surface-1);
      --bg-card-hover: var(--surface-2); --bg-input: var(--surface-2);
      --bg-overlay: var(--surface-3);  --bg-overlay-2: var(--surface-1);
      --border-subtle: var(--border-1); --border-medium: var(--border-2);
      --text-primary: var(--text-1);   --text-secondary: var(--text-2);
      --text-muted: var(--text-3);     --text-faint: var(--text-5);
      --shadow-card: var(--shadow-1);
    }

    body {
      background-color: var(--bg-page);
      color: var(--text-1);
    }

    /* Height of the sticky chrome pinned above every page — the Training and
       Live Demo banners. Zero in normal service. A screen that pins its own
       header, or sizes a panel to the viewport, must subtract this or it lands
       underneath the banner / hangs off the bottom edge by exactly its height.
       Written by the measuring script below; declared here so `var(--chrome-h)`
       is always resolvable. */
    :root { --chrome-h: 0px; }

    /* The iOS status-bar strip, as a variable rather than a bare env().
       ──────────────────────────────────────────────────────────────────────
       Two reasons it is a token and not env() written out at each use site.

       1. FIXED ELEMENTS DO NOT GET THE BODY'S PADDING. The standalone block
          below pads the BODY by the inset, which moves normal content clear
          of the clock and the battery. Anything `position: fixed` is laid out
          against the viewport instead, so it stays exactly where it was —
          underneath the strip. The theme toggle and the language switcher on
          role select are both fixed, and both vanished under it.

       2. env() CANNOT BE SIMULATED. It is 0 in every browser that is not iOS
          in standalone, so the bug was invisible to the whole test suite and
          reachable only on a phone with the app on its home screen. Driving
          the strip AND the things that must clear it from one variable means
          a test can set --safe-top and reproduce it on a laptop. */
    :root { --safe-top: 0px; }

    /* A screen's own top bar pins below that chrome, not underneath it. Scoped
       to a DIRECT child of the page root so it hits the page-level bars and
       leaves alone the sticky headers inside panels and scroll containers,
       which are pinned to their own scrollport and are already right.
       --chrome-h is 0px in normal service, so live screens are untouched. */
    body > .min-h-screen > .sticky.top-0 { top: var(--chrome-h, 0px); }

    /* ── Full-height page roots ────────────────────────────────────────────
       `body` is a flex column: page chrome (the Training banner, the footer)
       sits above and below whatever the template renders. Nearly every screen
       wraps itself in `min-h-screen`, which demands the WHOLE viewport for the
       content alone — so the footer was pushed past the fold and EVERY page
       in the app scrolled by exactly the height of that chrome. That is the
       thin scrollbar that appeared on screens with nothing to scroll, and why
       the last row of a grid sat just under the bottom edge on load.

       Fill what is left instead. A page with real content still grows and
       scrolls normally; a page without one now fits exactly. min-height:0 is
       needed alongside flex so the demand is actually dropped — Tailwind's
       min-h-screen would otherwise still win the height calculation. */
    body > .min-h-screen {
      min-height: 0;
      flex: 1 1 auto;
    }

    /* ══════════════════════════════════════════════════════════════════════
       COMPATIBILITY LAYER

       The app already carries ~3,600 Tailwind utilities written against a
       white-on-black assumption (`text-white/60`, `bg-white/5`, …). Rather
       than rewrite every template — and risk the money and menu screens on a
       cosmetic change — each utility is redirected once, here, onto the token
       ladder above.

       This replaces roughly a hundred hand-tuned `[data-theme="light"]` rules
       with one rule per semantic level. The win is not brevity: it is that
       the two themes can no longer drift apart, because there is only one
       place a level is defined and both themes read it from the same rule.
       ══════════════════════════════════════════════════════════════════════ */

    /* Text — eleven opacity steps collapse onto five designed levels. */
    /* Every opacity step, not a hand-picked subset.

       The first version of this listed the steps it happened to notice —
       /10 /20 /25 /30 /40 /50 /60 /70 /80 /90 — and the app also uses
       /35 /45 /55 /65 /75 /85. Those six fell through to raw Tailwind, i.e.
       white at 35% painted on a white page. That is why the kiosk's item
       descriptions and category chips were invisible in light mode while the
       item names beside them were fine: `text-white/35` had no rule and
       `text-white` did.

       The list below is generated across the whole 0-100 range rather than
       written by hand, so a shade someone reaches for tomorrow is covered. */
    .text-white.text-white { color: var(--text-1); }
    .text-white\/85.text-white\/85, .text-white\/90.text-white\/90,
    .text-white\/95.text-white\/95, .text-white\/100.text-white\/100 { color: var(--text-1); }
    .text-white\/65.text-white\/65, .text-white\/70.text-white\/70,
    .text-white\/75.text-white\/75, .text-white\/80.text-white\/80 { color: var(--text-2); }
    .text-white\/45.text-white\/45, .text-white\/50.text-white\/50,
    .text-white\/55.text-white\/55, .text-white\/60.text-white\/60 { color: var(--text-3); }
    .text-white\/25.text-white\/25, .text-white\/30.text-white\/30,
    .text-white\/35.text-white\/35, .text-white\/40.text-white\/40 { color: var(--text-4); }
    /* /15 and /20 are the tier the app reaches for when a label is meant to
       recede — a footer line, a "Next 14 days" caption, an empty-state note.
       They are still words someone has to read, and --text-5 is the tier this
       file reserves for rules and watermarks: at 2.4:1 they were the faintest
       ink on the page in both themes. Only /0-/14, which is genuinely
       invisible by intent, stays on the decorative tier. */
    .text-white\/15.text-white\/15, .text-white\/20.text-white\/20 { color: var(--text-4); }
    .text-white\/0.text-white\/0, .text-white\/3.text-white\/3,
    .text-white\/5.text-white\/5, .text-white\/8.text-white\/8,
    .text-white\/10.text-white\/10, .text-white\/14.text-white\/14 { color: var(--text-5); }

    .text-gray-300.text-gray-300,
    .text-gray-400.text-gray-400          { color: var(--text-3); }
    .text-gray-500.text-gray-500,
    .text-gray-600.text-gray-600          { color: var(--text-2); }

    /* Backgrounds — the page/surface ladder. */
    /* The two families are offset by one step on purpose.

       `bg-gray-9xx` is what the app uses for a *panel* — the kiosk order rail,
       a modal body. `bg-white/N` is what it uses for the things sitting inside
       one — a button, an input well, a line item. They are written as siblings
       in the markup but they are never siblings on screen, so mapping both to
       the same surface makes every control inside a panel disappear into it.

       Panels take the lower step, contents take the higher one. A `bg-white/5`
       card sitting directly on the page reads one step brighter than strictly
       necessary, which is the harmless direction to be wrong in.

       These are written as a doubled class — `.bg-black.bg-black` — rather than
       with `!important`. The doubling costs nothing visually and raises
       specificity to (0,2,0), which beats Tailwind's own (0,1,0) rule no matter
       which stylesheet the CDN injects last, while still LOSING to state
       variants like `peer-checked:bg-royal` at (0,3,0).

       That distinction is the whole point. With `!important` these rules also
       beat the state variants, and every toggle in the app silently lost its
       "on" colour: the track carries `bg-white/20 … peer-checked:bg-royal`, so
       forcing the resting background meant the switch never turned blue. */
    .bg-black.bg-black,
    .bg-gray-950.bg-gray-950              { background-color: var(--bg-page); }
    .bg-gray-900.bg-gray-900              { background-color: var(--surface-1); }
    .bg-gray-800.bg-gray-800              { background-color: var(--surface-2); }
    .bg-white\/0.bg-white\/0, .bg-white\/3.bg-white\/3,
    .bg-white\/5.bg-white\/5, .bg-white\/8.bg-white\/8 { background-color: var(--surface-2); }
    /* Deliberately left on surface-3, even though surface-3 IS #FFFFFF in
       light mode and these are the app's secondary buttons sitting on
       `bg-gray-900` cards that are also #FFFFFF — the Bill button under every
       table on the waiter grid measured a 1.00:1 fill against its own card.

       Moving them down to surface-2 fixes that number and costs dark mode the
       step it already had: there surface-3 is a visible 1.22:1 lift off the
       card and surface-2 is 1.09:1, so the same edit that rescues the light
       button flattens the dark one. There is no shared fill that works, which
       is the point — on a white page the answer was never a fill. The light
       edge rule below rings these at 3.2:1, and a white button with a real
       outline on a white card is a secondary button, not a missing one. */
    .bg-white\/10.bg-white\/10, .bg-white\/14.bg-white\/14,
    .bg-white\/15.bg-white\/15 { background-color: var(--surface-3); }
    .bg-white\/20.bg-white\/20, .bg-white\/25.bg-white\/25,
    /* `bg-white/20` and up is, in practice, the unchecked switch track. Pointed
       at surface-3 it became #FFFFFF in light mode — a white track on a white
       card, so the switch vanished when off. surface-4 exists to stay visible
       against whatever surface a control sits on. */
    .bg-white\/30.bg-white\/30 { background-color: var(--surface-4); }
    /* Arbitrary values — `bg-white/[.04]` — are a different class from
       `bg-white/5` and match none of the rules above, so 71 of them across the
       app fell through to raw Tailwind and painted 4% white on a white page.
       Matched on the raw attribute value rather than the escaped class name,
       so any alpha someone writes tomorrow is covered. Doubled to (0,2,0) to
       beat Tailwind's own rule, exactly like the named steps. */
    [class*="bg-white/[."][class*="bg-white/[."],
    [class*="bg-white/[0."][class*="bg-white/[0."] { background-color: var(--surface-2); }

    .bg-gray-900\/90.bg-gray-900\/90,
    .bg-black\/80.bg-black\/80,
    /* /90 and /95 are the sticky-header/footer scrims (waiter table-order
       header, onboarding finish bar) — unmapped they rendered as near-black
       patches on light pages, the same escape as the bg-gray-950/95 trap. */
    .bg-black\/90.bg-black\/90,
    .bg-black\/95.bg-black\/95            { background-color: var(--scrim); }
    /* /30 and /40 are a well INSIDE a card (paired-reader rows, tax rate
       fields, the staff-activity filters) — the input-well tier, same as
       bg-white/5.

       /40 sat with the scrims above on the assumption that a 40% black wash is
       a backdrop. It is not: all 32 of them in this app are form fields, none
       is `fixed inset-0`, and pointed at --scrim they rendered as a mid-grey
       #93979F panel with the app's dark ink on it — 1.78:1 for the staff
       filter labels, which is the worst pairing measured anywhere. */
    .bg-black\/30.bg-black\/30,
    .bg-black\/40.bg-black\/40            { background-color: var(--surface-2); }
    /* Gradient stops escape background-color mapping entirely — override the
       Tailwind stop variables instead (menu-import hero, onboarding footer). */
    .from-gray-900.from-gray-900,
    .from-gray-950.from-gray-950 {
      --tw-gradient-from: var(--surface-1);
      --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
    }
    .to-black.to-black { --tw-gradient-to: var(--bg-page); }

    /* Hover is doubled once more, to (0,3,0), so it still beats the resting
       rule above rather than tying with it and depending on source order. */
    .hover\:bg-white\/10.hover\:bg-white\/10:hover { background-color: var(--surface-4); }
    .hover\:bg-white\/20.hover\:bg-white\/20:hover { background-color: var(--surface-4);
                                                    border-color: var(--border-3); }

    /* Borders. */
    .border-white\/0.border-white\/0, .border-white\/3.border-white\/3,
    .border-white\/5.border-white\/5, .border-white\/8.border-white\/8,
    .border-white\/10.border-white\/10 { border-color: var(--border-1); }
    .border-white\/14.border-white\/14, .border-white\/15.border-white\/15,
    .border-white\/20.border-white\/20, .border-white\/25.border-white\/25 { border-color: var(--border-2); }
    .border-white\/30.border-white\/30, .border-white\/35.border-white\/35,
    .border-white\/40.border-white\/40, .border-white\/45.border-white\/45,
    .border-white\/50.border-white\/50 { border-color: var(--border-3); }
    .border-gray-300.border-gray-300      { border-color: var(--border-2); }

    /* The edge of a control, wherever the template asked for one.

       `border-white/10` is written on panels and on buttons alike, and both
       resolved to --border-1: a seam. On a panel that is right. On the day
       chips of the host diary, the theme swatches on the QR page and the cover
       search box it left a 1.31:1 outline as the only thing saying those were
       controls at all — measured across the app, 24 of them.

       Both themes: the ladder is symmetric, so a 1px .11 white line on a dark
       card is the same 1.4:1 smudge as the light one, and dark mode is simply
       where nobody looked.

       The leading-space form is what keeps `hover:border-white/20` out of it —
       see the note on the status-text rules below for why a bare substring
       match destroys the hover state. */
    :is(button, a[href], summary, [role="button"], input, select, textarea,
        label[for], [onclick]):is([class^="border-white/"], [class*=" border-white/"]) {
      border-color: var(--border-control);
    }

    /* Coloured borders had no rule of any kind, in either theme.

       `border-amber-500/25` on a warning panel, `border-royal/50` on the
       selected category chip, `border-green-500/40` on the kiosk's "Sending to
       kitchen" badge — all of them a 25-50% wash of a mid-tone hue, which on a
       near-white page composites to 1.2-2.0:1. The author of each of those
       lines asked for a coloured edge specifically because the edge was
       carrying the meaning; the alpha is a dark-mode habit, where a wash on
       near-black still reads.

       Resolved to the solid hue, which is 3.1-4.5:1 on white and, being the
       same token the panel's tint is mixed from, cannot drift from it. The
       leading-space form keeps `hover:border-royal/40` out, as everywhere
       else in this file. */
    [class^="border-royal"][class^="border-royal"],
    [class*=" border-royal"][class*=" border-royal"],
    [class^="border-blue-"][class^="border-blue-"],
    [class*=" border-blue-"][class*=" border-blue-"],
    [class^="border-sky-"][class^="border-sky-"],
    [class*=" border-sky-"][class*=" border-sky-"],
    [class^="border-indigo-"][class^="border-indigo-"],
    [class*=" border-indigo-"][class*=" border-indigo-"] { border-color: var(--accent); }

    [class^="border-green-"][class^="border-green-"],
    [class*=" border-green-"][class*=" border-green-"],
    [class^="border-emerald-"][class^="border-emerald-"],
    [class*=" border-emerald-"][class*=" border-emerald-"] { border-color: var(--success); }

    [class^="border-amber-"][class^="border-amber-"],
    [class*=" border-amber-"][class*=" border-amber-"],
    [class^="border-yellow-"][class^="border-yellow-"],
    [class*=" border-yellow-"][class*=" border-yellow-"],
    [class^="border-orange-"][class^="border-orange-"],
    [class*=" border-orange-"][class*=" border-orange-"] { border-color: var(--warn); }

    [class^="border-red-"][class^="border-red-"],
    [class*=" border-red-"][class*=" border-red-"],
    [class^="border-rose-"][class^="border-rose-"],
    [class*=" border-rose-"][class*=" border-rose-"] { border-color: var(--danger); }

    [class^="border-violet-"][class^="border-violet-"],
    [class*=" border-violet-"][class*=" border-violet-"],
    [class^="border-purple-"][class^="border-purple-"],
    [class*=" border-purple-"][class*=" border-purple-"] { border-color: var(--violet-ink); }

    /* ── Light mode: a raised thing needs an EDGE, not a darker fill ───────
       The token block above says light mode "earns its hierarchy from shadow
       instead of opacity", and the ladder was never given the shadow. What it
       had instead was four surfaces within 1.2:1 of each other, which is not a
       tuning problem — it is arithmetic. #FFFFFF, #F2F5F9 and #EAEFF6 are the
       three lightest colours there are; no redistribution of them produces the
       3:1 that WCAG 1.4.11 asks for at the boundary of a control. Measured
       across twenty screens, 264 controls sat on a fill within 1.25:1 of what
       was behind them and carried no edge at all — 152 of them the app's
       `bg-white/10` secondary button, at exactly 1.00:1.

       So the edge is drawn here rather than the fill deepened. `box-shadow:
       inset` rather than `border`, because 400-odd elements are laid out on
       the assumption that they have no border box and a 1px border would move
       every one of them by a pixel.

       Dark mode is exempt: there the same fills are 1.4-2.0:1 apart against a
       near-black page, which is a visible step. */
    /* An interactive control: 3:1, because its edge is the only thing saying
       it is a control. */
    /* `[data-theme]` is repeated to reach (0,5,1). `:is()` takes the
       specificity of its most specific argument, so this rule scored (0,4,1)
       against the panel rule below it at (0,5,0) — three `:not()`s beat one
       `a[href]` — and every secondary button on the waiter grid was quietly
       being rung at the panel's 1.4:1 instead of the control's 3.2:1. It looks
       like an edge either way in a screenshot, which is exactly why the ring's
       colour is measured rather than its presence. */
    [data-theme="light"][data-theme="light"]
    :is(button, a[href], summary, [role="button"], [onclick], label[for]):is(
        .bg-white\/0, .bg-white\/3, .bg-white\/5, .bg-white\/8,
        .bg-white\/10, .bg-white\/14, .bg-white\/15, .bg-gray-800,
        .bg-black\/30, .bg-black\/40):not([class*="shadow-"]) {
      box-shadow: inset 0 0 0 1px var(--border-control);
    }

    /* A well, a tinted panel, a line item — not a control, so a seam is
       enough, but it must be a seam and not nothing. Skipped where the
       template already draws its own border or shadow. */
    /* Note the absence of a descendant form. Written once as
       `:is(<fills>) :not([class*="border"])` — with a space — it rang every
       child of every well instead of the well itself, and the waiter grid came
       back with a box drawn around each cover's NAME inside the row that
       already had one. The compound form is the whole rule. */
    [data-theme="light"] :is(.bg-white\/0, .bg-white\/3, .bg-white\/5,
        .bg-white\/8, .bg-white\/10, .bg-white\/14, .bg-white\/15,
        .bg-gray-800, .bg-black\/30):not([class*="border"]):not([class*="shadow-"]):not([class*="divide"]) {
      box-shadow: inset 0 0 0 1px var(--border-1);
    }

    /* Dark gets the control ring too, and only the control ring.

       Its fills are genuinely further apart than light's — `bg-white/10` on a
       card is 1.21:1 there against 1.00:1 here — so dark panels and cards need
       nothing. But 1.21:1 is still not the 3:1 that says "this is a button",
       and 31 of them measured that way: the secondary buttons on the waiter
       grid, "Test print", the provider chips. The panels below stay light-only
       deliberately; ringing every well on a dark page would turn a quiet
       screen into a wireframe for no measured gain. */
    [data-theme="dark"][data-theme="dark"]
    :is(button, a[href], summary, [role="button"], [onclick], label[for]):is(
        .bg-white\/0, .bg-white\/3, .bg-white\/5, .bg-white\/8,
        .bg-white\/10, .bg-white\/14, .bg-white\/15, .bg-gray-800,
        .bg-black\/30, .bg-black\/40):not([class*="border"]):not([class*="shadow-"]) {
      box-shadow: inset 0 0 0 1px var(--border-control);
    }
    [data-theme="dark"][data-theme="dark"]
    :is(button, a[href], summary, [role="button"], [onclick], label[for]):is(
        [class^="bg-amber-"], [class*=" bg-amber-"],
        [class^="bg-red-"], [class*=" bg-red-"],
        [class^="bg-green-"], [class*=" bg-green-"],
        [class^="bg-royal/"], [class*=" bg-royal/"],
        [class^="bg-blue-"], [class*=" bg-blue-"],
        [class^="bg-violet-"], [class*=" bg-violet-"],
        [class^="bg-purple-"], [class*=" bg-purple-"]):not([class*="border"]):not([class*="shadow-"]) {
      box-shadow: inset 0 0 0 1px currentColor;
    }

    /* A control on a TINTED fill — the amber "Prep" chips on the waiter grid,
       a `bg-red-500/10` danger button. The tint is 1.14:1 against the row it
       sits in, so it needs an edge like any other control, but a neutral grey
       ring would fight the colour that is carrying the meaning. `currentColor`
       is the hue's own ink, which the status-text rules above have already
       tuned to 4.6:1 on exactly this tint — so the ring clears 3:1 by
       construction, in whichever hue the chip happens to be. */
    [data-theme="light"][data-theme="light"]
    :is(button, a[href], summary, [role="button"], [onclick], label[for]):is(
        [class^="bg-amber-"], [class*=" bg-amber-"],
        [class^="bg-red-"], [class*=" bg-red-"],
        [class^="bg-green-"], [class*=" bg-green-"],
        [class^="bg-royal/"], [class*=" bg-royal/"],
        [class^="bg-blue-"], [class*=" bg-blue-"],
        [class^="bg-violet-"], [class*=" bg-violet-"],
        [class^="bg-purple-"], [class*=" bg-purple-"]):not([class*="border"]):not([class*="shadow-"]) {
      box-shadow: inset 0 0 0 1px currentColor;
    }

    /* A card is white on a near-white page — 1.09:1. Rounded is the tell: a
       full-page `bg-gray-900` wrapper is square and must not get a ring. */
    [data-theme="light"] .bg-white[class*="rounded"]:not([class*="border"]):not([class*="shadow"]) {
      box-shadow: inset 0 0 0 1px var(--border-1);
    }
    [data-theme="light"] .bg-gray-900[class*="rounded"]:not([class*="shadow"]) {
      box-shadow: var(--shadow-1);
    }
    [data-theme="light"] .bg-gray-900[class*="rounded"]:not([class*="border"]):not([class*="shadow"]) {
      box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border-1);
    }

    /* Tinted status panels — `bg-royal/10`, `bg-amber-500/10` and friends —
       are a 10% wash over white, i.e. 1.1:1. The tint carries the meaning; the
       edge is what makes it a panel. */
    [data-theme="light"] [class*="bg-royal/"]:not([class*="border"]):not([class*="shadow"]),
    [data-theme="light"] [class*="bg-amber-500/"]:not([class*="border"]):not([class*="shadow"]),
    [data-theme="light"] [class*="bg-red-500/"]:not([class*="border"]):not([class*="shadow"]),
    [data-theme="light"] [class*="bg-green-500/"]:not([class*="border"]):not([class*="shadow"]) {
      box-shadow: inset 0 0 0 1px var(--border-1);
    }

    /* A tinted panel is darker than the well the text tiers were measured
       against — `bg-royal/15` composites to #D1E1F8 — so the recessive tier
       lands at 3.95:1 on it: the selected day in the host diary, the chip
       labels on the kiosk. On a tint, the recessive tier steps up one. */
    :is([class*="bg-royal/"], [class*="bg-amber-500/"],
        [class*="bg-red-500/"], [class*="bg-green-500/"], [class*="bg-violet-500/"])
      :is([class*="text-white/25"], [class*="text-white/30"],
          [class*="text-white/35"], [class*="text-white/40"],
          [class*="text-white/45"], [class*="text-white/50"],
          [class*="text-white/55"], [class*="text-white/60"]),
    :is([class*="bg-royal/"], [class*="bg-amber-500/"],
        [class*="bg-red-500/"], [class*="bg-green-500/"], [class*="bg-violet-500/"]):is(
          [class*="text-white/25"], [class*="text-white/30"],
          [class*="text-white/35"], [class*="text-white/40"],
          [class*="text-white/45"], [class*="text-white/50"],
          [class*="text-white/55"], [class*="text-white/60"]) { color: var(--text-2); }

    /* ── Dimming is not symmetric between the themes ───────────────────────
       `opacity-40` is the app's "not available yet" treatment: the Download
       and Print buttons on the QR page before the allergy notice is
       acknowledged, the kiosk's Pay button with an empty basket. At 40% on a
       near-black page a white label is still perfectly readable. At 40% on a
       white page the same label composites to 2.6:1 — so a manager looking at
       a greyed-out pair of buttons could not read what the buttons he was
       being asked to unlock actually were.

       Floored at 68%, which puts a disabled label at about 3.3:1: still
       unmistakably inactive, still a word. /0 to /25 are left alone — those
       are genuinely meant to be invisible (the tick on an unselected theme
       swatch fades between 0 and 1 and must reach 0).

       Applied to both themes in the end. Dark was measured after the light fix
       and its disabled CTAs sat at 1.9-2.6:1 — the kiosk's "Pay now" with an
       empty basket is black on green at 40%, which is a smear in either theme.
       Fixing one and leaving the other reads as a bug, not a decision.

       The `:disabled:disabled` form reaches (0,3,0) so it outranks Tailwind's
       own `.disabled\:opacity-40:disabled`. */
    .opacity-30.opacity-30,
    .opacity-40.opacity-40,
    .opacity-50.opacity-50 { opacity: .72; }
    [class*="disabled:opacity-"]:disabled:disabled { opacity: .72; }

    /* The floor alone was not enough, because the failure is a PRODUCT, not a
       level. A dimmed block full of `text-white/30` help text recedes twice —
       once because the ink is the recessive tier and again because the block
       is at 72% — and 4.5:1 times 0.72 is 2.8:1 however the floor is tuned.
       Thirty-seven of the booking and printer settings labels failed exactly
       that way, and they are the words a manager reads to decide whether to
       switch the section ON.

       So inside a dimmed block the ladder collapses to its top tier. The block
       is already saying "inactive" with the dimming; the ink does not need to
       say it a second time, and paying for it twice is what put the sentence
       under the floor. Measured after: --text-1 at 72% is 6.4:1 on a white
       card, still visibly lighter than the live section beside it. */
    :is(.opacity-30, .opacity-40, .opacity-50)
      :is([class*="text-white/"], [class*="text-gray-"]) { color: var(--text-1); }

    /* ── Tick boxes and radios ─────────────────────────────────────────────
       These were the platform's own, styled with nothing but `accent-color`.
       Three separate failures came out of that:

         · Unchecked, the UA draws a 1px grey box. On a white card that is the
           faintest edge on the screen, and at `w-4 h-4` it is a 16px target —
           under the 24px minimum, on a tablet, held by someone carrying
           plates.
         · Checked with `accent-amber-500`, the UA fills the box amber and
           draws the tick in WHITE, always: #FFFFFF on #F59E0B is 2.1:1. The
           allergy ticks on the order screen and the covers on a split bill are
           all amber, so the one state that has to be unmistakable was the one
           that could not be seen. That is not tunable through accent-color —
           the tick colour is not exposed.
         · `accent-current` inherited the body ink, so on a light page the box
           went near-black.

       `appearance: none` takes all three back. The tick is a background image
       rather than a `::before`, because a pseudo-element on a checkbox is only
       generated once `appearance` is gone and that is exactly the state being
       relied upon — a background image needs no such bargain.

       `.peer` and `.sr-only` are excluded: every toggle switch in the app is a
       visually-hidden checkbox with a styled `div` beside it, and giving that
       input a 20px box would put a stray tick box next to every switch. */
    /* One guard, spelled the same everywhere. The resting rule below carries
       four `:not()`s and scores (0,5,1); the first version of the `:checked`
       rules carried two and scored (0,4,1), so the RESTING background won and
       no tick box in the app ever filled. It still looked plausible — the tick
       glyph is a background-image and had no competition, so a ticked box drew
       its tick on an unfilled square — which is how it survived a screenshot
       and why the checked state is now measured, not looked at. Every rule in
       this block repeats the same guard so the only thing separating them is
       the state. */
    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]),
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]) {
      -webkit-appearance: none;
      appearance: none;
      flex: none;
      width: 20px;
      height: 20px;
      margin: 0;
      padding: 0;
      border: 2px solid var(--border-control);
      background-color: var(--surface-1);
      background-repeat: no-repeat;
      background-position: center;
      background-size: 100% 100%;
      cursor: pointer;
      vertical-align: middle;
      transition: background-color .12s, border-color .12s, box-shadow .12s;
      --tick-fill: var(--accent);
    }
    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]) { border-radius: 5px; }
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden])    { border-radius: 50%; }

    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):hover:not(:disabled),
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):hover:not(:disabled) {
      border-color: var(--accent);
    }
    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):focus-visible,
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    /* Checked: the fill carries the colour, and the tick is drawn in the ink
       that clears 4.5:1 on THAT fill — white on royal, near-black on amber. */
    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked,
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked {
      background-color: var(--tick-fill);
      border-color: var(--tick-fill);
    }
    input[type="checkbox"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M3.4 8.3l3 3 6.2-6.9'/%3E%3C/svg%3E");
    }
    input[type="radio"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked {
      background-image: radial-gradient(circle at center, #FFFFFF 0 33%, transparent 35%);
    }

    /* ── A field must never zoom the page ──────────────────────────────────
       iOS Safari magnifies the whole page when a field it focuses renders
       text below 16px, and it does NOT undo that on blur. A waiter who taps
       Guest name is left on a zoomed screen for the rest of the service, with
       nothing on screen saying how to get back — the reported fault, and it
       happens on every field the app sets to `text-sm`.

       The fix is the font size, not the viewport. `user-scalable=no` /
       `maximum-scale=1` would stop it too, but by taking pinch-zoom away from
       everybody — including anyone who needs it to read at all — and iOS has
       ignored those on this behaviour since iOS 10 in any case.

       `any-pointer: coarse` rather than `pointer: coarse`: an iPad driven
       from a Magic Keyboard trackpad reports its PRIMARY pointer as fine
       while the touchscreen — and the zoom — are still there. A mouse-only
       desktop keeps the compact 14px fields.

       Measured before writing this: the app uses exactly two field sizes,
       14px and 16px, and nothing larger. So this raises the small ones and
       clamps nothing. The larger utilities are excluded anyway, so a field
       that is deliberately bigger stays bigger. Guarded by
       test_fields_never_zoom_the_page.py. */
    @media (any-pointer: coarse) {
      input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.text-base):not(.text-lg):not(.text-xl):not(.text-2xl),
      select:not(.text-base):not(.text-lg):not(.text-xl):not(.text-2xl),
      textarea:not(.text-base):not(.text-lg):not(.text-xl):not(.text-2xl) {
        font-size: 16px;
      }
    }

    /* Amber means allergy, or a cover on a split bill. It keeps its colour and
       gets a dark tick: #1A1204 on #F59E0B is 9.4:1, on the light-mode #C56A05
       6.5:1 — against 2.1:1 for the white tick the platform insisted on. */
    input[type="checkbox"][class*="accent-amber"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]),
    input[type="radio"][class*="accent-amber"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]) {
      --tick-fill: var(--warn);
    }
    input[type="checkbox"][class*="accent-amber"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231A1204' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round' d='M3.4 8.3l3 3 6.2-6.9'/%3E%3C/svg%3E");
    }
    input[type="radio"][class*="accent-amber"]:not(.peer):not(.sr-only):not(.hidden):not([hidden]):checked {
      background-image: radial-gradient(circle at center, #1A1204 0 33%, transparent 35%);
    }
    input[type="checkbox"]:disabled, input[type="radio"]:disabled {
      opacity: .72; cursor: not-allowed;
    }

    /* ── Toggle switches ───────────────────────────────────────────────────
       The track is `bg-white/20` — surface-4, #CBD5E1 in light mode — and the
       knob is `after:bg-white`. A white knob on #CBD5E1 is 1.5:1, so an OFF
       switch read as a flat grey pill with nothing in it. The knob gets a
       shadow to lift it off the track, and the track an edge so the pill
       itself has a boundary against the white card. */
    [data-theme="light"] .peer-checked\:bg-royal {
      box-shadow: inset 0 0 0 1px var(--border-control);
    }
    [data-theme="light"] .peer-checked\:bg-royal::after {
      box-shadow: 0 1px 3px rgba(15,23,42,.4);
    }

    /* ── Interaction states ────────────────────────────────────────────────
       The resting rules above are (0,2,0). These repeat the pseudo-class to
       reach (0,3,0) so a hover or focus colour actually wins.

       Without this the app had no hover or focus colour at all: 44 of the
       `hover:text-*` classes and 130-odd `hover:/focus:border-*` classes were
       being overridden by the resting rule, including `focus:border-royal` on
       every input — so a focused field looked identical to an idle one. */
    [class*="hover\:text-red-"]:hover:hover     { color: var(--danger-ink); }
    [class*="hover\:text-amber-"]:hover:hover   { color: var(--warn-ink); }
    [class*="hover\:text-green-"]:hover:hover   { color: var(--success-ink); }
    [class*="hover\:text-royal"]:hover:hover,
    [class*="hover\:text-blue-"]:hover:hover    { color: var(--accent-ink); }
    [class*="hover\:text-white"]:hover:hover    { color: var(--text-1); }

    [class*="hover\:border-royal"]:hover:hover  { border-color: var(--accent); }
    [class*="focus\:border-royal"]:focus:focus  { border-color: var(--accent); }
    [class*="hover\:border-white"]:hover:hover  { border-color: var(--border-3); }
    [class*="hover\:border-red-"]:hover:hover   { border-color: var(--danger); }
    [class*="hover\:border-amber-"]:hover:hover { border-color: var(--warn); }

    /* ── White text on a solid brand surface ───────────────────────────────
       The rules above turn `text-white` into near-black in light mode, which
       is right on a page and wrong on a blue button: a primary CTA's label is
       white because the surface under it is royal blue, not because the theme
       is dark. Measured before this rule, `text-white` on `bg-royal` in light
       mode computed to rgb(10,15,26) — near-black on blue.

       The token match is `[class~="bg-royal"]`, the whitespace-separated form,
       so it catches the solid `bg-royal` and deliberately NOT `bg-royal/20`:
       a 20% tint is a pale surface in light mode and its text should stay dark.

       Doubled to (0,3,0) so it outranks the (0,2,0) text ladder. */
    [class~="bg-royal"][class~="bg-royal"][class*="text-white"],
    [class~="bg-royal-dark"][class~="bg-royal-dark"][class*="text-white"],
    [class~="bg-green-300"][class~="bg-green-300"][class*="text-white"],
    [class~="bg-green-400"][class~="bg-green-400"][class*="text-white"],
    [class~="bg-green-500"][class~="bg-green-500"][class*="text-white"],
    [class~="bg-green-600"][class~="bg-green-600"][class*="text-white"],
    [class~="bg-amber-400"][class~="bg-amber-400"][class*="text-white"],
    [class~="bg-amber-500"][class~="bg-amber-500"][class*="text-white"],
    [class~="bg-amber-900"][class~="bg-amber-900"][class*="text-white"],
    [class~="bg-red-500"][class~="bg-red-500"][class*="text-white"],
    [class~="bg-red-600"][class~="bg-red-600"][class*="text-white"],
    [class~="bg-blue-400"][class~="bg-blue-400"][class*="text-white"],
    [class~="bg-blue-500"][class~="bg-blue-500"][class*="text-white"],
    [class~="bg-blue-600"][class~="bg-blue-600"][class*="text-white"],
    [class~="bg-violet-500"][class~="bg-violet-500"][class*="text-white"],
    [class~="bg-purple-500"][class~="bg-purple-500"][class*="text-white"],
    [class~="bg-royal"][class~="bg-royal"] [class*="text-white"],
    [class~="bg-royal-dark"][class~="bg-royal-dark"] [class*="text-white"],
    [class~="bg-green-300"][class~="bg-green-300"] [class*="text-white"],
    [class~="bg-green-400"][class~="bg-green-400"] [class*="text-white"],
    [class~="bg-green-500"][class~="bg-green-500"] [class*="text-white"],
    [class~="bg-green-600"][class~="bg-green-600"] [class*="text-white"],
    [class~="bg-amber-400"][class~="bg-amber-400"] [class*="text-white"],
    [class~="bg-amber-500"][class~="bg-amber-500"] [class*="text-white"],
    [class~="bg-amber-900"][class~="bg-amber-900"] [class*="text-white"],
    [class~="bg-red-500"][class~="bg-red-500"] [class*="text-white"],
    [class~="bg-red-600"][class~="bg-red-600"] [class*="text-white"],
    [class~="bg-blue-400"][class~="bg-blue-400"] [class*="text-white"],
    [class~="bg-blue-500"][class~="bg-blue-500"] [class*="text-white"],
    [class~="bg-blue-600"][class~="bg-blue-600"] [class*="text-white"],
    [class~="bg-violet-500"][class~="bg-violet-500"] [class*="text-white"],
    [class~="bg-purple-500"][class~="bg-purple-500"] [class*="text-white"] { color: #FFFFFF; }

    /* Secondary text on the same surface keeps its hierarchy rather than
       flattening to pure white. */
    [class~="bg-royal"][class~="bg-royal"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-royal-dark"][class~="bg-royal-dark"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-300"][class~="bg-green-300"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-400"][class~="bg-green-400"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-500"][class~="bg-green-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-600"][class~="bg-green-600"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-400"][class~="bg-amber-400"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-500"][class~="bg-amber-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-900"][class~="bg-amber-900"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-red-500"][class~="bg-red-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-red-600"][class~="bg-red-600"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-400"][class~="bg-blue-400"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-500"][class~="bg-blue-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-600"][class~="bg-blue-600"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-violet-500"][class~="bg-violet-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-purple-500"][class~="bg-purple-500"]:is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-royal"][class~="bg-royal"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-royal-dark"][class~="bg-royal-dark"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-300"][class~="bg-green-300"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-400"][class~="bg-green-400"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-500"][class~="bg-green-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-green-600"][class~="bg-green-600"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-400"][class~="bg-amber-400"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-500"][class~="bg-amber-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-amber-900"][class~="bg-amber-900"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-red-500"][class~="bg-red-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-red-600"][class~="bg-red-600"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-400"][class~="bg-blue-400"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-500"][class~="bg-blue-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-blue-600"][class~="bg-blue-600"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-violet-500"][class~="bg-violet-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]),
    [class~="bg-purple-500"][class~="bg-purple-500"] :is([class*="text-white/5"],[class*="text-white/6"],[class*="text-white/7"]) { color: rgba(255,255,255,.85); }

    /* ── Status text ───────────────────────────────────────────────────────
       Every shade and opacity variant of a hue collapses to one ink that is
       readable in both themes.

       Listing the shades individually — `.text-amber-300, .text-amber-400` —
       was not enough. The app also uses `text-amber-200`, `text-red-500`,
       `text-purple-300` and about seventy opacity variants like
       `text-amber-400/70`, none of which matched, so they fell through to raw
       Tailwind: amber-200 (#FDE68A) on a pale amber warning panel is roughly
       1.2:1 in light mode, which is why those panels were unreadable.

       The prefix/space pair matches the class as a whole token. A bare
       `[class*="text-amber-"]` would also catch `hover:text-amber-400` and
       paint the element amber at rest, destroying the hover state — the
       leading space in the second selector is what prevents that, because the
       substring in `hover:text-amber-400` is preceded by a colon, not a
       space. */
    [class^="text-royal"][class^="text-royal"],
    [class*=" text-royal"][class*=" text-royal"],
    [class^="text-blue-"][class^="text-blue-"],
    [class*=" text-blue-"][class*=" text-blue-"],
    [class^="text-sky-"][class^="text-sky-"],
    [class*=" text-sky-"][class*=" text-sky-"],
    [class^="text-indigo-"][class^="text-indigo-"],
    [class*=" text-indigo-"][class*=" text-indigo-"] { color: var(--accent-ink); }

    [class^="text-green-"][class^="text-green-"],
    [class*=" text-green-"][class*=" text-green-"],
    [class^="text-emerald-"][class^="text-emerald-"],
    [class*=" text-emerald-"][class*=" text-emerald-"],
    [class^="text-lime-"][class^="text-lime-"],
    [class*=" text-lime-"][class*=" text-lime-"] { color: var(--success-ink); }

    [class^="text-amber-"][class^="text-amber-"],
    [class*=" text-amber-"][class*=" text-amber-"],
    [class^="text-yellow-"][class^="text-yellow-"],
    [class*=" text-yellow-"][class*=" text-yellow-"],
    [class^="text-orange-"][class^="text-orange-"],
    [class*=" text-orange-"][class*=" text-orange-"] { color: var(--warn-ink); }

    [class^="text-red-"][class^="text-red-"],
    [class*=" text-red-"][class*=" text-red-"],
    [class^="text-rose-"][class^="text-rose-"],
    [class*=" text-rose-"][class*=" text-rose-"] { color: var(--danger-ink); }

    [class^="text-violet-"][class^="text-violet-"],
    [class*=" text-violet-"][class*=" text-violet-"],
    [class^="text-purple-"][class^="text-purple-"],
    [class*=" text-purple-"][class*=" text-purple-"],
    [class^="text-fuchsia-"][class^="text-fuchsia-"],
    [class*=" text-fuchsia-"][class*=" text-fuchsia-"] { color: var(--violet-ink); }

    /* Partner brand marks — the Stripe purple and the SumUp blue on the
       Payments page — are written as arbitrary hexes, `text-[#635BFF]`, so
       none of the hue rules above see them. On a dark card those are the
       correct brand colours; on a white well they measure 2.5-4.1:1, and the
       "Set up →" link a manager has to find is one of them. Darkened for light
       mode only, so the brand stays itself where it can. */
    [data-theme="light"] [class*="text-[#635BFF]"][class*="text-[#635BFF]"] { color: #332B93; }
    [data-theme="light"] [class*="text-[#1A72E8]"][class*="text-[#1A72E8]"] { color: #0C3866; }
    /* Dark needed the same treatment in the other direction: the brand hexes
       are mid-tones, so they are as short on near-black as on near-white —
       3.7:1 and 3.8:1 for the "Set up →" links. Both sets are chosen to clear
       4.5:1 while the partner row is DIMMED, which is the state a venue that
       has not connected anything is looking at. */
    [data-theme="dark"] [class*="text-[#635BFF]"][class*="text-[#635BFF]"] { color: #A8A3FF; }
    [data-theme="dark"] [class*="text-[#1A72E8]"][class*="text-[#1A72E8]"] { color: #79B4F8; }

    /* A coloured word sitting ON its own tinted panel — amber text on an
       amber-tinted warning box — is the tightest pairing in the app, so the
       light-mode inks are tuned against that blend rather than against the
       page. Measured at the worst case (a `/30` panel) they land at 4.6-5.0:1;
       against the page or a white card they are 6.2-7.9:1.

       This is why light-mode amber reads as a dark ochre rather than a bright
       yellow. Yellow cannot be both yellow and legible on a pale yellow field:
       at the lightness where it still looks vivid it measures about 2:1. The
       dark tokens keep the bright values, because there the panel is dark. */

    /* Inputs inherit the well surface in both themes. */
    input, textarea, select {
      background-color: var(--surface-2);
      color: var(--text-1);
      /* A field's edge is a control's edge — 3:1, not the panel hairline it
         used to share with cards. The printer forms measured 1.4:1. */
      border-color: var(--border-control);
    }

    /* A field with no fill and no border is not discoverable as a field: the
       printer-name inputs are `bg-transparent` inline edits and read as a
       heading someone had typed. An underline gives them back the affordance
       without turning an inline edit into a boxed one. */
    input.bg-transparent:not([type="checkbox"]):not([type="radio"]),
    textarea.bg-transparent {
      box-shadow: inset 0 -1px 0 var(--border-control);
    }
    input.bg-transparent:focus, textarea.bg-transparent:focus {
      box-shadow: inset 0 -2px 0 var(--accent);
    }

    /* Placeholders are set with `placeholder-white/20` in 42 places. Left
       alone, Tailwind's own rule out-specifies the element selector above and
       paints them 20%-opacity white — invisible on a light field, and under
       3:1 even on a dark one. `--text-4` is the floor a placeholder may sit
       at: dim enough to read as a prompt rather than a value, contrasty
       enough to actually read. */
    input::placeholder, textarea::placeholder,
    .placeholder-white\/20::placeholder,
    .placeholder-white\/25::placeholder,
    .placeholder-white\/30::placeholder { color: var(--text-4) !important; }

    /* ── Kitchen & bar: permanently dark, in both themes ───────────────────
       These screens hang on a wall in a hot, bright, steamy room and are read
       from across it. Light mode would wash them out, so they pin themselves
       to the dark tokens regardless of the app theme. */
    .kitchen-view, .bar-view {
      --bg-page:   #06080C;  --surface-1: #0C111A;  --surface-2: #141B27;
      --surface-3: #1B2431;  --surface-4: #2C3646;
      --text-1: #F5F8FC; --text-2: #B4C0D0; --text-3: #8A97A8;
      --text-4: #6B7788; --text-5: #4C5666;
      --border-1: rgba(255,255,255,.09);
      --border-2: rgba(255,255,255,.16);
      --border-3: rgba(255,255,255,.26);
      --accent-ink: #6BA9FF; --success-ink: #4ADE80;
      --warn-ink: #FBBF24;   --danger-ink: #FF8080;
      --violet-ink: #C4B5FD;
      background-color: var(--bg-page);
      color: var(--text-1);
    }
    .kitchen-card, .bar-card { box-shadow: var(--shadow-1); }

    /* Print area always white regardless of theme */
    #print-area { background: #fff !important; color: #000 !important; }

    /* The print area must NEVER be visible on screen — it only exists for
       window.print(). Without this, any page that ships a populated
       #print-area (e.g. the bill page's AirPrint receipt) renders a stray
       white receipt block at the bottom of the screen. The @media print
       rule below re-shows it with display:block !important. */
    @media screen {
      #print-area { display: none !important; }
    }
  

    /* ── Type ──────────────────────────────────────────────────────────────
       DM Sans, tightened. Negative tracking on large text only: it sharpens
       headings, and applied to body copy it would cost legibility on a screen
       being read at arm's length across a counter. */
    h1, h2, h3, .u-display { letter-spacing: -0.018em; line-height: 1.15; }
    h4, h5, h6            { letter-spacing: -0.011em; line-height: 1.25; }

    /* Money, quantities, table numbers, timers, covers.

       Proportional digits are the single most common reason a price column
       looks amateur: a `1` is narrower than a `7`, so £11.00 and £77.00 do not
       line up and the decimal point wanders down the column. Tabular figures
       fix every total on every receipt, bill and tile in one rule.

       Applied to the elements that hold figures rather than left as an opt-in
       class, because opting in is the step that gets missed. */
    .money, [id*="total"], [id*="Total"], [class*="price"], [class*="amount"],
    .tabular, td[align="right"] {
      font-variant-numeric: tabular-nums;
      font-feature-settings: "tnum" 1;
    }
    .money { color: var(--money); font-weight: 700; }

    /* ── Focus ─────────────────────────────────────────────────────────────
       The app sets `outline-none` on inputs in ~40 places, which leaves a
       keyboard user with no idea where they are. `:focus-visible` restores a
       ring for keyboard and assistive-tech users only — a pointer tap still
       gets no ring, which is why it was removed in the first place. */
    :where(a, button, input, textarea, select, [tabindex]):focus-visible {
      outline: 2px solid var(--accent-ink);
      outline-offset: 2px;
      border-radius: 6px;
    }
    /* The ring must survive `outline-none` written on the element itself. */
    .outline-none:focus-visible {
      outline: 2px solid var(--accent-ink) !important;
      outline-offset: 2px;
    }

    /* ── Touch ─────────────────────────────────────────────────────────────
       A waiter taps this with a thumb, mid-service, one-handed, holding
       plates. Anything smaller than 44px is a mis-tap, and on a till a
       mis-tap is a wrong item on someone's bill. */
    button, [role="button"], a.btn, .btn, input[type="submit"] {
      min-height: 44px;
      touch-action: manipulation;   /* kills the 300ms double-tap delay */
    }

    /* …except where a height was set deliberately.

       `min-height` beats `height` in CSS, so the blanket rule above silently
       overrode every explicitly-sized control: the bill's `w-6 h-6` remove
       button became 24px wide by 44px tall. That stretched the row's right-hand
       group, and because the row is `items-start`, the price ended up centred in
       44px while the item name stayed at the top — the two no longer lined up.

       `[class~="h-6"]` matches the class as a whitespace-separated token, so it
       catches `h-6` without also matching `max-h-32` or a component class that
       merely contains the letters. */
    button[class~="h-4"],  button[class~="h-5"],  button[class~="h-6"],
    button[class~="h-7"],  button[class~="h-8"],  button[class~="h-9"],
    button[class~="h-10"], button[class~="h-11"], button[class~="h-12"],
    button[class~="h-14"], button[class~="h-16"],
    button[class~="h-full"], button[class~="h-auto"] {
      min-height: 0;
    }

    /* Links dressed as buttons have to be centred explicitly.

       A native <button> centres its own content, so raising it to 44px is
       invisible. An <a> does not: it is a block with padding, and its text
       stays at the top. That only became visible once buttons grew — in a
       `flex` action row the anchor stretches to match its 44px sibling and the
       label ends up floating above centre, which is what made the waiter
       grid's "Bill" sit high in its pill next to the print button.

       Matching on the utilities that mean "this anchor is a button" (a rounded
       corner plus centred text) rather than on a class the markup would have
       to opt into, since these anchors are spread across a dozen screens. */
    a[class*="rounded"][class*="text-center"],
    a[class*="rounded"][class*="justify-center"] {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    /* Genuinely small chrome — badge dismissers, inline steppers — opts out
       explicitly, so the exception is a decision rather than an oversight. */
    .btn-compact { min-height: 32px; }

    /* ── Buttons ───────────────────────────────────────────────────────────
       Four ranks, matching how a till is actually used: one obvious way to
       take the money, one to do the ordinary thing, one to do the quiet
       thing, one to do the dangerous thing. */
    .btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: .5rem; padding: .75rem 1.25rem; border-radius: .75rem;
      font-weight: 700; font-size: .875rem; line-height: 1.2;
      border: 1px solid transparent; cursor: pointer;
      transition: background-color .15s ease, border-color .15s ease,
                  color .15s ease, transform .1s ease;
    }
    .btn:active     { transform: scale(.97); }   /* scale only — never a size
                                                    change, which would nudge
                                                    the neighbouring buttons */
    .btn:disabled,
    .btn[disabled]  { opacity: .38; cursor: not-allowed; transform: none; }

    .btn-pay     { background: var(--success); color: #04140A; font-weight: 900; }
    .btn-pay:hover:not(:disabled)     { background: var(--success-ink); }

    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover:not(:disabled) { background: #0F5FD4; }

    .btn-quiet   { background: var(--surface-1); color: var(--text-1);
                   border-color: var(--border-2); }
    .btn-quiet:hover:not(:disabled)   { background: var(--surface-2);
                                        border-color: var(--border-3); }

    .btn-danger  { background: transparent; color: var(--danger-ink);
                   border-color: var(--danger); }
    .btn-danger:hover:not(:disabled)  { background: var(--danger); color: #fff; }

    /* ── Surfaces ──────────────────────────────────────────────────────────
       In dark mode a card is a lighter surface on a dark room. In light mode
       the same card is white and separates by shadow instead — which is why
       elevation is a token and not a Tailwind class written per screen. */
    .card {
      background: var(--surface-1);
      border: 1px solid var(--border-1);
      border-radius: 1rem;
      box-shadow: var(--shadow-1);
    }
    .card-interactive { cursor: pointer; transition: border-color .15s ease,
                                                     background-color .15s ease; }
    .card-interactive:hover    { background: var(--surface-2);
                                 border-color: var(--border-2); }
    .card-interactive:active   { transform: scale(.99); }
    .card-selected  { border-color: var(--accent); background: var(--accent-soft); }

    /* ── Segmented control ─────────────────────────────────────────────────
       Drinks / Food / Popular. One tap, always visible, never a dropdown. */
    .seg {
      padding: .625rem 1.125rem; border-radius: .75rem;
      font-weight: 700; font-size: .875rem; min-height: 44px;
      color: var(--text-3); transition: background-color .12s, color .12s;
    }
    .seg:hover        { color: var(--text-1); background: var(--surface-2); }
    .seg[aria-selected="true"], .seg-on {
      background: var(--accent); color: #fff;
    }

    /* ── Fields ────────────────────────────────────────────────────────────
       16px minimum is set globally further down to stop iOS zooming on focus;
       here it is only appearance. */
    .field {
      width: 100%; background: var(--surface-2); color: var(--text-1);
      border: 1px solid var(--border-2); border-radius: .75rem;
      padding: .75rem 1rem; min-height: 44px;
      transition: border-color .15s ease;
    }
    .field:focus { border-color: var(--accent); }

    /* ── Select ────────────────────────────────────────────────────────────
       The closed box only. `appearance: none` cannot reach the list that drops
       out of a select — that panel is drawn by the operating system — so the
       actual dropdown is rebuilt in orderly-select.js, which hides the select
       and draws its own menu.

       This rule still earns its place: it is what the guest sees in the moment
       before that script runs, and what they get if it fails to load. Without
       it the fallback is the macOS stepper on a dark till screen. The 33
       selects in the app all carry the same Tailwind field classes as the
       inputs beside them, which assume a plain box — so this is one rule, not
       33 edits.

       Specificity is the whole trick. `select:not([multiple]):not([size])`
       scores 0,2,1, which clears the single Tailwind utility class (0,1,0)
       written on the element, so the padding that makes room for the chevron
       survives a `px-4` on the tag without needing !important. Multi-selects
       and sized list boxes are excluded on purpose: they render as lists, not
       dropdowns, and have no control to replace.

       The chevron is a data-URI so it costs no request. Its colour cannot be
       a var() from inside the URI, so the two themes and the light QR themes
       each re-state it below — the same reason the icon set ships one file
       per ink rather than one tinted at runtime. */
    select:not([multiple]):not([size]) {
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      cursor: pointer;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.25 1.5 6 6.25 10.75 1.5' stroke='%238A97A8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right .875rem center;
      background-size: 12px 8px;
      padding-right: 2.375rem;
      text-overflow: ellipsis;
    }
    [data-theme="light"] select:not([multiple]):not([size]) {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.25 1.5 6 6.25 10.75 1.5' stroke='%235C6779' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
    select:not([multiple]):not([size]):disabled { cursor: not-allowed; opacity: .55; }

    /* The open list is drawn by the OS, which on Windows and Linux paints it
       with the element's own background — and most of these selects carry a
       translucent `bg-white/5`, which composites against white there and
       leaves white-on-white options. Naming a solid surface fixes it, and is
       ignored on macOS and iOS where the picker is native. */
    select option, select optgroup {
      background-color: var(--surface-3);
      color: var(--text-1);
    }

    /* ── Icons ────────────────────────────────────────────────────────────
       Sizes are tokens so glyphs keep a rhythm instead of drifting to 18px on
       one screen and 22px on the next. `flex-shrink:0` because an icon beside
       a translated label — German runs ~2.7× English here — otherwise gets
       squeezed into an ellipse by the text next to it.

       `vertical-align` and the em-based default size make an inline icon sit
       on the text baseline at the size of the text it interrupts, which is the
       one thing emoji did correctly and hand-rolled SVGs usually get wrong. */
    .oi {
      display: inline-block; flex-shrink: 0; vertical-align: -0.125em;
      width: 1.25em; height: 1.25em;
    }
    .icon-xs { width: 14px; height: 14px; }
    .icon-sm { width: 16px; height: 16px; }
    .icon-md { width: 20px; height: 20px; }
    .icon-lg { width: 24px; height: 24px; }
    .icon-xl { width: 32px; height: 32px; }

    /* Small caps label — the "OPEN TABS" / "TOTAL" rail label. */
    .label-micro {
      font-size: .625rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: .12em; color: var(--text-3);
    }
    /* Legacy: `.hint` is used across the kiosk and booking templates. */
    .hint { font-size: .75rem; line-height: 1.45; color: var(--text-3); }

    /* ── Status pills ──────────────────────────────────────────────────────
       Colour is never the only signal — each pill carries its own word, so it
       still reads for a colour-blind operator and in a print-out. */
    .pill {
      display: inline-flex; align-items: center; gap: .375rem;
      padding: .25rem .625rem; border-radius: 999px;
      font-size: .6875rem; font-weight: 700; white-space: nowrap;
    }
    .pill-success { background: rgba(34,197,94,.15);  color: var(--success-ink); }
    .pill-warn    { background: rgba(245,158,11,.15); color: var(--warn-ink); }
    .pill-danger  { background: rgba(239,68,68,.15);  color: var(--danger-ink); }
    .pill-info    { background: var(--accent-soft);   color: var(--accent-ink); }

    /* ── Safe areas ────────────────────────────────────────────────────────
       Installed to the home screen, a fixed bar sits under the notch or the
       gesture bar unless it is told not to. The tab strip along the bottom of
       the kiosk is exactly the element this protects. */
    @supports (padding: env(safe-area-inset-bottom)) {
      .safe-bottom { padding-bottom: max(env(safe-area-inset-bottom), .5rem); }
      .safe-top    { padding-top:    max(env(safe-area-inset-top), .5rem); }
    }

    /* ── iOS status bar ────────────────────────────────────────────────────
       Installed to the home screen, this app asks iOS for a translucent status
       bar, so the web view starts at y=0 and the clock, signal bars and
       battery are painted OVER the page. Every page header in the app sat
       underneath them — the reported mess.

       Three rules, and all three are needed together:

         body inset   pushes page content clear of the status bar. This alone
                      is not enough: it scrolls away, and a sticky bar pins to
                      the VIEWPORT top regardless of it, so the bar ends up
                      back under the clock the moment you scroll. That is why
                      the old body-padding-only rule in style.css never worked
                      even where env() did resolve.
         the strip    a fixed, opaque band exactly the height of the inset,
                      so nothing can ever scroll into the status bar. Above
                      modals (z-90) deliberately: a dialog that reaches the
                      top of the screen must not put its own content under the
                      clock either, and a backdrop dimming the area behind
                      black status-bar text is the light-mode half of the same
                      complaint.
         chrome top   sticky bars pin to the bottom edge of the strip rather
                      than to the viewport, so they meet it with no seam and
                      no gap showing page content through.

       Nothing here applies in a browser tab: iOS lays those out inside the
       safe area already and reports the inset as 0, which collapses all three
       rules to nothing. */
    @media (display-mode: standalone) {
      :root { --safe-top: env(safe-area-inset-top); }

      body { padding-top: var(--safe-top); }

      body::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0;
        height: var(--safe-top);
        background: var(--bg-page);
        z-index: 90;
        pointer-events: none;
      }

      [data-app-chrome] { top: var(--safe-top); }
    }

    /* Anything FIXED to the top edge clears the strip and the chrome stack.
       Both offsets, in one place, so a new fixed control cannot be added with
       only half of it — which is how the theme toggle and the language
       switcher came to be painted underneath the status bar. */
    .od-fixed-top {
      position: fixed;
      top: calc(var(--safe-top, 0px) + var(--chrome-h, 0px) + 0.75rem);
    }

    /* ── Scrollbar-hide ────────────────────────────────────────────────────
       Three templates (the waiter menu tabs, the kiosk category strip, the
       menu editor) have always carried this class on a horizontally-scrolling
       strip, and it has never been defined anywhere — it is a Tailwind plugin
       class and the CDN build ships without plugins. So every one of those
       strips has been drawing a scrollbar across the bottom of a 28px-tall row
       of chips on any device with visible scrollbars (Windows tablets, and
       macOS with "always show scroll bars"), stealing ~15px of a control the
       waiter is trying to hit.

       Defined here rather than per-page because it is the same fix in all
       three, and the next strip someone writes will reach for the same name. */
    .scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
    .scrollbar-hide::-webkit-scrollbar { display: none; width: 0; height: 0; }

    /* ── Reduced motion ────────────────────────────────────────────────────
       Honour the OS setting. Transitions collapse rather than disappear, so
       state changes are still perceivable — an interface that changes with no
       transition at all is harder to follow, not easier. */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
      }
      .btn:active, .card-interactive:active { transform: none; }
    }
  

    @media print {
      /* Remove browser URL, date, page number header/footer */
      @page {
        margin: 0;
        size: 80mm auto;  /* 80mm thermal receipt width, auto height */
      }

      /* Hide everything on the page except the print area. The .ticket
         exemption keeps the receipt-preview page (order_summary.html)
         printable — its visible receipt IS the print content. */
      body > *:not(#print-area):not(.ticket) { display: none !important; }
      .ticket { display: block !important; }

      #print-area {
        display: block !important;
        width: 76mm;        /* Slightly less than 80mm for printer margins */
        margin: 0 auto;
        padding: 3mm 2mm;
        font-family: 'Courier New', Courier, monospace;
        font-size: 11px;
        line-height: 1.5;
        color: #000;
        background: #fff;
      }

      /* Dashed divider lines — like a real receipt */
      .print-divider {
        border-top: 1px dashed #000;
        margin: 5px 0;
      }

      .print-center { text-align: center; }
      .print-bold { font-weight: bold; }
      .print-large { font-size: 14px; }

      /* Flex rows for item + price alignment */
      .print-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
      }

      /* Remove any link styling */
      a { text-decoration: none; color: #000; }
    }
  

    /* ── iOS zoom prevention ──────────────────────────────────────────────────
       iOS Safari zooms in when focusing any input < 16px. Setting font-size
       to 16px on all inputs/textareas prevents this globally. The visual size
       is controlled by padding and Tailwind classes — this only affects the
       threshold Safari uses to decide whether to zoom.                       */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea {
      font-size: 16px !important;
    }
  
    /* ── The back button ───────────────────────────────────────────────────
       Colour comes from the Tailwind classes on the element, which the theme
       layer above already maps. This rule carries only what those cannot:
       what the button does when it is PRESSED.

       A tap starts a navigation that takes a few hundred milliseconds. Nothing
       on screen changed in that gap, so people tapped again and the second tap
       landed on the next page. `:active` alone does not fix it — it ends the
       moment the finger lifts, which is exactly when the wait begins. So the
       handler in base.html adds `.is-busy` on pointerdown and leaves it there
       until the page changes: the button stays lit for the whole wait. */
    .od-back {
      -webkit-tap-highlight-color: transparent;
      transition: background-color .15s ease, transform .08s ease;
    }
    .od-back:active { transform: scale(.92); }
    .od-back.is-busy {
      background-color: var(--accent);
      color: #fff;
      transform: scale(.92);
    }
    /* Held pressed for the whole navigation, so it must not also pulse. */
    .od-back.is-busy:hover { background-color: var(--accent); }

    @media (prefers-reduced-motion: reduce) {
      .od-back, .od-back:active, .od-back.is-busy { transform: none; }
    }

    /* The guest-facing variant. Customer screens run on the venue's chosen QR
       theme, which is a separate variable contract from the staff palette —
       so the button borrows the theme's own surface and ink rather than the
       staff `bg-white/8`, which would be raw white over an unknown colour and
       invisible on the light themes. */
    .od-back--qr {
      background-color: var(--qr-surface-2, rgba(255,255,255,.08));
      color: var(--qr-text, #fff);
      /* An EDGE, not just a fill. --qr-surface-2 sits 1.01:1 from the page on
         the paper themes and only reaches 1.22:1 on the darkest — under the
         1.25:1 at which a fill alone reads as a control, so on fourteen of the
         eighteen themes this button had nothing to say it was one. Measured
         across every theme by tests/test_qr_theme_contrast.py.

         An inset ring rather than a border: the button is w-9 h-9 in a header
         built borderless, and a real border would grow it by 2px and shunt the
         row. Same trick the rest of the app uses, and the contrast sweep reads
         an inset ring exactly as it reads a border. */
      box-shadow: inset 0 0 0 1px var(--qr-border-control, rgba(255,255,255,.5));
    }
    .od-back--qr:hover { background-color: var(--qr-surface-hover, rgba(255,255,255,.14)); }
    .od-back--qr.is-busy {
      background-color: var(--qr-accent, var(--accent));
      color: var(--qr-accent-ink, #fff);
    }

    /* ── Date and time inputs ──────────────────────────────────────────────
       iOS Safari gives input[type=date] an intrinsic minimum width from its
       native control and will NOT shrink below it. `w-full` is then ignored:
       the field renders wider than the column it sits in, and because a grid
       or flex track defaults to `min-width:auto` the whole row grows with it
       and pushes the page sideways. On Bill History the To field ran off the
       right edge of the phone; the same shape appears wherever a From/To pair
       sits in a two-column grid.

       This was already diagnosed and fixed once, locally, for the booking
       widget (`input[type=date].bk-field`). One local fix per screen is how
       the next screen ships broken, so it lives here now and covers every one
       — including the fields booking_settings builds in JavaScript.

       -webkit-appearance drops the native sizing, min-width:0 lets it shrink
       inside its container, and max-width is the belt to that brace. Nothing
       here touches how the field LOOKS: no colour, border, padding or font. */
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"] {
      -webkit-appearance: none;
      appearance: none;
      min-width: 0;
      max-width: 100%;
    }
    /* The other half of the same bug. A grid or flex CHILD also defaults to
       `min-width:auto`, so even a well-behaved input cannot shrink the track
       it sits in. Applied to the wrapper of any date field rather than to
       every grid child in the app, which would be a far wider change than
       this warrants. */
    .date-field, .date-field > * { min-width: 0; }

    /* ── Bookable hours, on a narrow phone ─────────────────────────────────
       A day row is "Monday | 09:00 – 17:00" as an 86px label beside two time
       fields. At 320px the card has about 248px of content width, the label
       and its gap take 98 of it, and two time inputs will not go below ~88
       each — so the row ran 14px off the screen and took the page with it.

       Below 360px the label moves onto its own line and the times get the
       full width. Above it, nothing changes. */
    .hours-row { grid-template-columns: 1fr; }
    @media (min-width: 360px) {
      .hours-row { grid-template-columns: 86px 1fr; }
    }

    /* ══════════════════════════════════════════════════════════════════════
       Design system — depth, materials and touch feedback.

       Every rule here is a token, never a hex, so it holds in both themes
       and on nothing the contrast sweep cannot measure. The `od-` prefix
       marks the handful of composed components (a tile, a grouped list row,
       a switch, a segmented control); everything else is a global lift that
       existing screens inherit without an edit.
       ══════════════════════════════════════════════════════════════════════ */

    /* ── Top bars are a material, not a slab ───────────────────────────────
       Every screen's header is `sticky top-0 bg-black` (mapped to the page
       colour above). Over content scrolling underneath it becomes a blurred
       translucent bar. `@supports` keeps the solid page colour where the
       browser cannot blur, so nothing bleeds through as unreadable text. */
    @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
      .sticky.top-0.bg-black,
      .sticky.top-0.bg-gray-950 {
        background-color: color-mix(in srgb, var(--bg-page) 82%, transparent);
        -webkit-backdrop-filter: saturate(160%) blur(20px);
        backdrop-filter: saturate(160%) blur(20px);
      }
    }

    /* ── Panels get elevation ──────────────────────────────────────────────
       A `bg-gray-900 rounded-2xl` box is what this app calls a card. It had a
       fill one step off the page and a 1px seam, which on a dark screen reads
       as a drawn box rather than a raised one. The shadow is the missing
       step: in dark mode it deepens the room behind the card, in light mode
       it is what separates white from off-white. */
    .rounded-2xl.bg-gray-900,
    .od-card,
    .od-group { box-shadow: var(--shadow-2); }

    /* Hover-lift is a mouse idea. On a touchscreen a tile that jumps a pixel
       under a finger is a glitch, not an affordance. */
    @media (hover: none) {
      .hover\:-translate-y-1:hover { transform: none; }
    }

    /* ── Press feedback ────────────────────────────────────────────────────
       `hover:` does nothing on a tablet, and `:active` alone is too brief to
       register through a moving finger. The handler in base.html adds
       `.is-pressed` on pointerdown to any link, button or card and holds it
       for at least 90ms after release. Going IN is instant — a transition on
       the way down reads as lag — and the release eases back. */
    a, button, [role="button"], .card-interactive, [data-press] {
      -webkit-tap-highlight-color: transparent;
    }
    .is-pressed {
      opacity: .82;
      transition-duration: 0s !important;
    }
    /* Anything positioned with a translate (a centred toast, a floating pill)
       keeps its transform — scaling it would also move it. */
    .is-pressed:not([class*="translate"]):not(.od-back):not(.od-row):not(.od-app):not(.od-row-link):not(.od-note):not(.od-ring) {
      transform: scale(.97);
    }
    /* A surface answers a press by stepping down, not by fading. */
    .od-tile.is-pressed, .od-row.is-pressed, .card-interactive.is-pressed {
      opacity: 1;
      background-color: var(--surface-2);
    }
    .od-row.is-pressed { transform: none; }

    /* Opt-in latch for controls that NAVIGATE: `data-busy` keeps the pressed
       state until the page changes, exactly as the back button does, so a
       slow link cannot be tapped twice. Never on a button that opens a modal
       or runs a fetch — nothing would ever release it. */
    [data-busy].is-busy {
      opacity: .72;
      pointer-events: none;
      transform: scale(.97);
    }

    /* ── Tile: the role picker's unit ──────────────────────────────────────
       Fill comes from the Tailwind class on the element (`bg-white/10`, one
       step brighter than a card, which is what lets it stand on the page
       without a border). The icon sits in a soft brand-tinted squircle so
       each tile has one focal point instead of a floating line drawing. */
    .od-tile {
      display: flex; flex-direction: column; align-items: center;
      justify-content: center; gap: 4px;
      border-radius: 22px; padding: 22px 16px 20px;
      transition: background-color .15s ease, transform .15s ease;
    }
    .od-tile-ico {
      width: 64px; height: 64px; border-radius: 20px;
      background: var(--accent-soft);
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 10px; flex-shrink: 0;
      box-shadow: var(--shadow-1);
    }
    .od-tile-ico .role-icon { width: 42px; height: 42px; margin: 0; }
    .od-ico-warn { background: rgba(245,158,11,.14); }

    /* ── Ring: the table number inside its booking window ─────────────────
       The arc is a 100-unit path (pathLength) so the offset is simply the
       percentage used; the tick in waiter.html moves it once a second and
       the transition smooths the step. Colour is the button's text colour,
       so the state classes (royal / amber / red) recolour arc and track at
       once while the number itself stays white. */
    .od-ring-arc { transition: stroke-dashoffset .6s linear, stroke .3s ease; }
    .od-ring.is-pressed { opacity: 1; transform: scale(.94); }

    /* ── App: the launcher unit ────────────────────────────────────────────
       No card — the icon squircle is the whole tile, as on a home screen.
       Fill comes from the Tailwind class on the squircle (`bg-white/10`); an
       inset highlight along the top edge is what makes it read as a solid
       object rather than a flat swatch. The press shrinks the whole app,
       icon and label together. */
    .od-app { transition: transform .15s ease, opacity .15s ease; }
    .od-app-ico {
      width: 84px; height: 84px; border-radius: 26px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow-2);
      transition: background-color .15s ease;
    }
    .od-app-ico .role-icon { width: 50px; height: 50px; margin: 0; }
    .od-app.is-pressed { opacity: 1; transform: scale(.94); }
    .od-app.is-pressed .od-app-ico { background-color: var(--surface-2); }
    @media (min-width: 768px) {
      .od-app-ico { width: 92px; height: 92px; border-radius: 28px; }
      .od-app-ico .role-icon { width: 56px; height: 56px; }
    }

    /* ── Grouped list: the settings unit ───────────────────────────────────
       One raised panel per group, rows inside separated by an inset hairline
       that starts after the icon column — a list, not a stack of boxes. */
    .od-group {
      background: var(--surface-1);
      border: 1px solid var(--border-1);
      border-radius: 18px;
      overflow: hidden;
    }
    .od-row {
      display: flex; align-items: center; gap: 14px;
      min-height: 64px; padding: 10px 14px;
      position: relative;
      transition: background-color .15s ease;
    }
    .od-row + .od-row::before {
      content: ''; position: absolute; left: 66px; right: 0; top: 0;
      height: 1px; background: var(--border-1);
    }
    .od-ico {
      width: 38px; height: 38px; border-radius: 11px;
      background: var(--surface-2);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; box-shadow: var(--shadow-1);
    }
    .od-ico svg { width: 24px; height: 24px; margin: 0; }
    /* A row with a note has two targets: the ⓘ, and everything else. The
       link is stretched over the whole row (valid HTML, one tap target, no
       button nested in an anchor) and the ⓘ sits above it. The press
       highlight is a wash on the stretched link, so the row's own content
       stays visible through it. */
    .od-row-link { position: absolute; inset: 0; z-index: 1; border-radius: 0; }
    .od-row-link.is-pressed { opacity: 1; transform: none; background: rgba(255,255,255,.06); }
    [data-theme="light"] .od-row-link.is-pressed { background: rgba(15,23,42,.06); }
    .od-note {
      position: relative; z-index: 2; flex-shrink: 0;
      width: 40px; height: 40px; margin: -4px -6px -4px -6px; border-radius: 20px;
      display: flex; align-items: center; justify-content: center;
      color: var(--text-3); background: transparent;
      transition: background-color .15s ease, color .15s ease;
    }
    .od-note.is-pressed { opacity: 1; transform: none; background: var(--surface-2); color: var(--text-1); }
    /* Inline in a line of small text: still a 32px target, but it does not
       push the line's height around. */
    .od-note-sm { width: 32px; height: 32px; margin: -8px -4px -8px -2px; border-radius: 16px; }
    .od-note-sm svg { width: 18px; height: 18px; }

    /* ── Switch ────────────────────────────────────────────────────────────
       51×31 with a 27px knob — the size a thumb expects. Sits after an
       `sr-only peer` checkbox, the same markup the old toggles used, so the
       change handlers are untouched. The knob widens while held and slides
       on release. */
    .od-switch {
      position: relative; display: inline-block; flex-shrink: 0;
      width: 51px; height: 31px; border-radius: 16px;
      background: var(--surface-4);
      transition: background-color .2s ease;
    }
    .od-switch::after {
      content: ''; position: absolute; top: 2px; left: 2px;
      width: 27px; height: 27px; border-radius: 14px; background: #fff;
      box-shadow: 0 3px 8px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.2);
      transition: transform .2s cubic-bezier(.2,.8,.2,1), width .12s ease;
    }
    .peer:checked ~ .od-switch { background: var(--accent); }
    .peer:checked ~ .od-switch::after { transform: translateX(20px); }
    .od-switch:active::after { width: 32px; }
    .peer:checked ~ .od-switch:active::after { transform: translateX(15px); }
    .peer:focus-visible ~ .od-switch { outline: 2px solid var(--accent); outline-offset: 2px; }

    /* ── Segmented control ─────────────────────────────────────────────────
       One track, the chosen segment filled. The unchosen segments have no
       fill of their own, so they read as labels on the track. */
    .od-seg {
      display: flex; gap: 2px; padding: 3px; border-radius: 12px;
      background: var(--surface-2);
      box-shadow: inset 0 0 0 1px var(--border-2);
    }
    .od-seg > button {
      flex: 1 1 0; min-height: 40px; border-radius: 9px;
      font-size: 13px; font-weight: 600; color: var(--text-3);
      background: transparent;
      transition: background-color .18s ease, color .18s ease;
    }
    .od-seg > button.od-seg-on {
      background: var(--accent); color: #fff; box-shadow: var(--shadow-1);
    }

    @media (prefers-reduced-motion: reduce) {
      .is-pressed, [data-busy].is-busy, .od-tile.is-pressed, .od-app.is-pressed { transform: none; }
    }
