/* ════════════════════════════════════════════════════════════════════════════
   DineWaves public menu — base.css
   Reset, layout primitives for every layout variant, and the whole ordering
   UI. Loaded before exactly one theme file (/menu-themes/<id>.css).

   ─────────────────────────────────────────────────────────────────────────
   THEME CONTRACT  (read this before writing a theme)
   ─────────────────────────────────────────────────────────────────────────
   Files
     utils/menuThemes.js              registry: add your theme object there
     views/menu/renderMenuPage.js     the ONLY place markup is produced
     public/menu-themes/base.css      this file — do not put theme looks here
     public/menu-themes/menu.js       all behaviour (no inline script, ever)
     public/menu-themes/<id>.css      your theme: tokens + rules, ALL scoped
                                      under `.theme-<id>`

   Registering a theme
     1. Add { id, name, tagline, mode, layout, fonts, swatches, css, tools }
        (+ optional sound) to THEMES in utils/menuThemes.js (field docs are
        in that file).
     2. Create public/menu-themes/<id>.css.
     3. `npm test` (test/unit_menu_themes.test.js checks every registry theme).
     Preview any theme on any menu:  /menu/<slug>?preview=1&theme=<id>

   <body> classes and attributes
     .dwm                      always
     .theme-<id>               data-theme="<id>"
     .layout-<layout>          data-layout="<layout>"; one of
                               list | cards | magazine | ticket | book |
                               carousel | poster
     .mode-light | .mode-dark  from the registry `mode`
     .tools-<variant>          from the registry `tools`: tools-bar |
                               tools-masthead | tools-inline-nav | tools-dock |
                               tools-below  (see "Tools" below)
     .sound-<place>            from the registry `sound`: sound-tools |
                               sound-masthead | sound-footer
     .has-photos | .no-photos  whether ANY item on this menu has a photo
     .has-ordering | .no-ordering   table ordering UI present or not
     .is-closed                restaurant closed (kept in sync by menu.js)
     .has-cart                 (JS) the cart bar is showing
     .is-filtering             (JS) a search or filter is active and the menu
                               is reduced to the matches (in the book layout:
                               a filter is on, the book is "flat")
     .is-finding               (JS, book only) a search is active and the book
                               stays bound: matches are highlighted
                               (li.dwm-item.is-match) and the book turns to
                               the first page that has one
     .has-query                (JS) the search field has text
     .is-searching             (JS, tools-inline-nav) the tools panel is open
     .view-compact             the guest's "List" view: compact rows (server
                               default for menus over 15 dishes, then menu.js;
                               list | cards | magazine | ticket | poster only).
                               base.css owns it entirely, see "Compact view".
     .has-bill                 (JS) the table-bill bar is showing
     style="--brand:…;--brand-ink:…;--brand-on-light:…;--brand-on-dark:…"
   <html> classes (JS)
     .dwm-js                   menu.js is running
     .dwm-motion               menu.js is running AND the user allows motion;
                               only then may .dwm-reveal start hidden.
     .dwm-locked               a dialog is open (page scroll is locked)

   Page skeleton (every layout, in DOM order)
     a.dwm-skip
     header.dwm-masthead > .dwm-masthead__inner            (not in `book`)
         span.dwm-masthead__ornament--top   (empty hook, aria-hidden)
         img.dwm-logo                       (only if the restaurant has one)
         h1.dwm-masthead__name
         p.dwm-masthead__tagline            (only if set)
         p.dwm-masthead__hours              (only if set)
         div.dwm-tools                      (tools-masthead only, see "Tools")
         span.dwm-masthead__ornament--bottom (empty hook)
       button.dwm-sound                     (sound-masthead only; a direct
                                            child of header.dwm-masthead)
     div.dwm-tools#dwm-tools                (tools-bar, tools-dock: here)
     nav.dwm-nav#dwm-nav  (sticky) > ul.dwm-nav__list > li.dwm-nav__item >
         a.dwm-nav__link[href="#cat-<id>"][data-cat]   ([aria-current=true] = active)
             span.dwm-nav__label + span.dwm-nav__count
         tools-inline-nav only: nav.dwm-nav >
             div.dwm-nav__bar > ul.dwm-nav__list + button.dwm-search-toggle
             div.dwm-tools                  (the panel under the nav row)
     div.dwm-closed#dwm-closed[hidden?] > strong.dwm-closed__title + span.dwm-closed__detail
     div.dwm-pagebar#dwm-pagebar[hidden] > p.dwm-tablechip ("Table 4", a page
         opened from a table's link), button.dwm-callbtn (ordering only),
         div.dwm-viewtoggle > button.dwm-viewtoggle__btn[aria-pressed] ×2
         (Photos / List; not in book or carousel). menu.js un-hides the parts.
     main.dwm-menu#dwm-menu
         div.dwm-empty#dwm-empty[hidden]     search/filter empty state
         …layout body (below)…
     div.dwm-tools#dwm-tools                (tools-below: here, after </main>)
     footer.dwm-footer > p.dwm-footer__name, address.dwm-contact
         (span.dwm-contact__address, a.dwm-contact__phone), img.dwm-footer__qr,
         button.dwm-sound (sound-footer only), p.dwm-footer__taxnote (when the
         owner set a tax note), p.dwm-footer__credit
     dialog.dwm-dialog.dwm-sheet#dwm-sheet      dish details (bottom sheet)
     div.dwm-cartbar#dwm-cartbar                (ordering only)
     dialog.dwm-dialog.dwm-drawer#dwm-cart      (ordering only)
     dialog.dwm-dialog.dwm-tracker#dwm-tracker  (ordering only)
     div.dwm-billbar#dwm-billbar[hidden] > button.dwm-billbar__btn >
         span.dwm-billbar__text + span.dwm-billbar__cta   (ordering only: the
         table's running bill; menu.js shows it, sets body.has-bill and
         measures --billbar-h. It sits above the cart bar; the dock is lifted
         above both.)
     dialog.dwm-dialog.dwm-tracker.dwm-bill#dwm-bill   (ordering only) the
         bill: ol.dwm-bill__rounds > li.dwm-bill__round(.is-cancelled) >
         div.dwm-bill__head (h3.dwm-bill__title > span.dwm-bill__time,
         span.dwm-status) + ul.dwm-tracker__lines + div.dwm-bill__foot
         (span.dwm-bill__amount, span.dwm-status | span.dwm-bill__void,
         button.dwm-btn.dwm-bill__pay); then dl.dwm-summary,
         ul.dwm-bill__payments, div.dwm-split (h3.dwm-split__title,
         div.dwm-split__row > div.dwm-stepper + p.dwm-split__each,
         p.dwm-split__hint), p.dwm-bill__note, div.dwm-bill__actions
         (button#dwm-bill-payall, p.dwm-bill__requested). It carries
         .dwm-tracker too, so a theme's tracker styling applies to it.
     div.dwm-toasts#dwm-toasts > div.dwm-toast

   Tools — search, filters, sound  (registry field `tools`, REQUIRED)
     The controls are the same in every variant (menu.js finds them by id and
     data-action); the variant decides WHERE div.dwm-tools is rendered:
       div.dwm-tools#dwm-tools
         label.dwm-search > svg.dwm-icon + span.dwm-sr + input.dwm-search__input#dwm-search
         div.dwm-filters[role=group] >
             button.dwm-filter[data-filter=veg|popular][aria-pressed]
         button.dwm-sound#dwm-sound[aria-pressed]  (svg.dwm-sound__on / __off;
             here only with sound-tools, the default)
         p.dwm-tools__status#dwm-tools-status[role=status]   "3 dishes match";
             empty (and display:none) when nothing is being searched
     Variants (body.tools-<variant>):
       bar          a full-width row between the masthead and the nav.
       masthead     div.dwm-tools is INSIDE .dwm-masthead__inner, after the
                    name / tagline / hours: compose it into the hero. base
                    only removes the row's own max-width and padding.
       inline-nav   no row. The nav row (div.dwm-nav__bar) ends in
                    button.dwm-search-toggle#dwm-search-toggle
                      [data-action=search-toggle][aria-expanded][aria-controls=dwm-tools]
                      > svg.dwm-icon + span.dwm-search-toggle__label "Search"
                        (base hides the label; a text-only theme hides the icon)
                    and div.dwm-tools is a panel inside the sticky nav. menu.js
                    keeps the panel [hidden] until the toggle is pressed, then
                    sets body.is-searching and aria-expanded="true" and moves
                    focus to the input; Esc or the toggle closes it and returns
                    focus to the toggle. It opens by itself when the search
                    has text on load. While a search/filter is active the
                    toggle carries a dot (.is-filtering / .is-finding
                    .dwm-search-toggle::after). Without JS the panel is simply
                    open and the nav is not sticky.
       dock         div.dwm-tools.dwm-tools--dock: fixed to the bottom of the
                    viewport, centred, max 30rem. base lifts it above the cart
                    bar (body.has-cart; --cartbar-h is measured by menu.js),
                    respects the safe-area insets and pads the page bottom
                    (--dock-h) so nothing is covered. The search field is a
                    short pill (placeholder "Search"; icon-only under 360px)
                    that takes the whole dock row while it has focus or text
                    (body.has-query); the filters then wrap to a row above it.
                    Use sound: 'masthead' | 'footer' — the dock is small.
       below        div.dwm-tools comes AFTER main. REQUIRED for the book
                    layout (the renderer forces it): the tools sit under the
                    book and its page-turn controls — style them as part of
                    the book's stand / desk. In the book a text search does
                    not flatten the book: body.is-finding, matching rows get
                    .is-match + mark.dwm-mark, the book turns to the first
                    matching page and Enter goes to the next one. A filter
                    (Veg only / Popular) still shows the flat, filtered book.
     Sound toggle (registry field `sound`, optional): sound-tools (default,
       inside div.dwm-tools) | sound-masthead (absolute, top-right corner of
       the masthead; 'tools' in the book layout) | sound-footer (in the footer).
     RULE: a theme must set `tools` and must restyle the tools so they belong
       to that theme — do not ship the default look. Shape, placement and
       character, not just colour: the field, both filters (resting AND
       [aria-pressed="true"]), the sound toggle, the status line and — for
       inline-nav — the toggle (resting AND [aria-expanded="true"]).
       Keep every control >= 40px, the input font-size >= 16px, and a visible
       focus style.

   Section (all scrolling layouts)
     section.dwm-section#cat-<id>[data-cat]
       header.dwm-section__head.dwm-reveal
         span.dwm-section__num[data-roman="IV"]   text is "04" (aria-hidden).
               Roman numerals: font-size:0 on it + ::before{content:attr(data-roman)}
         h2.dwm-section__title > span.dwm-section__name
         span.dwm-section__count                  "12 items"
         span.dwm-section__rule                   empty hook (aria-hidden)
       ul.dwm-items > li.dwm-item …               (or p.dwm-section__empty)

   Item — the same part classes in every layout
     li.dwm-item.dwm-reveal[data-key][data-diet][data-veg=0|1][data-popular=0|1]
        state classes: .has-photo  .is-popular  .is-hero (magazine)
                       .is-soldout ([data-soldout="1"], see "Sold out")
                       .in-cart (JS)  .is-in (JS, revealed)
       div.dwm-item__media > img.dwm-item__img          real photo only
       div.dwm-item__media.is-empty > span.dwm-item__mono   typographic plate
                                         (cards/carousel only, never a photo)
       div.dwm-item__media.has-badge     cards/carousel: the media (photo or
                                         plate) holds a span.dwm-badge
       div.dwm-item__body
         div.dwm-item__head
           span.dwm-item__code          ticket only: running "001"
           span.dwm-diet.dwm-diet--veg|vegan|egg|non_veg   (omitted if unknown)
           h3.dwm-item__name > button.dwm-item__open     opens the detail sheet
           span.dwm-item__leader        rows only (list/ticket/book/magazine)
           span.dwm-item__price > span.dwm-cur + span.dwm-amt
         p.dwm-item__desc               (omitted if empty)
         div.dwm-item__foot
           span.dwm-badge               (omitted if none)
           div.dwm-add[data-add] > button.dwm-add__btn (span.dwm-add__plus,
               span.dwm-add__label) + div.dwm-stepper[hidden] >
               button.dwm-step ×2 + output.dwm-step__qty     (ordering only)
           span.dwm-soldout "Sold out"  replaces div.dwm-add on a sold-out
                                        dish (with or without ordering)
     mark.dwm-mark                      search highlight inside name / desc

   What differs per layout
     list      rows. head = diet, name, leader, price. Optional thumb media.
     ticket    rows + span.dwm-item__code. main.dwm-menu is the paper and also
               holds span.dwm-ticket__edge--top / --bottom (empty hooks) and
               div.dwm-ticket__stub > span.dwm-ticket__barcode + span.dwm-ticket__thanks.
               >=1024px the paper is two CSS columns.
     magazine  rows; the first li is .is-hero (first dish with a photo, else
               the first dish). Section number is meant to be big.
     cards     li = media on top (photo, or .is-empty plate) with the badge
               inside the media; price sits in .dwm-item__foot.
               body.no-photos: base.css drops the empty plates, EXCEPT a
               plate with .has-badge, which collapses to a chip row holding
               just the badge (the initial is hidden) so a badge is never
               lost. A theme that keeps its own plate on photo-less menus
               must set `display`, `padding` and `background` on
               `.theme-x .dwm-item__media.is-empty`, set `display` on
               `.theme-x .dwm-item__mono` (base hides the initial inside a
               collapsed badge plate), and keep the badge visible itself.
     carousel  cards, inside div.dwm-rail-wrap > button.dwm-rail__btn--prev[hidden]
               + ul.dwm-items.dwm-rail + button.dwm-rail__btn--next[hidden]
               (JS un-hides the buttons on wide, hover-capable screens).
     poster    tiles: optional media, span.dwm-item__price.dwm-item__stamp
               directly under li, then body (no price in head/foot).
     book      no masthead: a booklet of menu cards with a real page turn.
               div.dwm-book#dwm-book[data-pages] (JS adds .is-bound,
               .is-spread >=900px, .is-turning)
                 div.dwm-book__stage > span.dwm-book__spine,
                   section.dwm-page[data-page=N] …,
                   button.dwm-book__edge--prev/--next  (the corner peels)
                 div.dwm-book__controls >
                   button.dwm-book__btn.dwm-book__btn--prev (svg + span.dwm-book__btn-label),
                   div.dwm-book__where > p.dwm-book__status + button.dwm-book__contents,
                   button.dwm-book__btn.dwm-book__btn--next
               Pages: .dwm-page--cover (h1.dwm-cover__title, .dwm-cover__tagline,
                 .dwm-cover__rule, .dwm-cover__label, .dwm-cover__hours,
                 .dwm-cover__hint, .dwm-cover__ornament)
               .dwm-page--toc (h2.dwm-toc__title, ol.dwm-toc > li.dwm-toc__row >
                 a.dwm-toc__link > .dwm-toc__name, .dwm-toc__leader, .dwm-toc__page)
               .dwm-page.dwm-section.dwm-page--chapter | --continued (rows)
               .dwm-page--blank, .dwm-page--colophon (.dwm-colophon__thanks, __name)
               every page: span.dwm-page__shade (base.css owns it: the shadow
                 of a turn), div.dwm-page__inner, div.dwm-page__running,
                 span.dwm-page__ornament (empty hook, hidden by default),
                 footer.dwm-page__folio > span.dwm-page__num, span.dwm-page__fleuron
               Stacking: in a bound book EVERY page sits in the same grid cell
                 of the stage (left pages in column 1 and right pages in
                 column 2 of a spread), so the stage is as tall as the tallest
                 page and the page never jumps. Do not position pages yourself;
                 pad the stage (cover boards) or the page instead.
               JS state: .dwm-page.is-left | .is-right (fixed), .is-current
                 (on show); during a turn the pages themselves are the leaves:
                 .is-leaf.is-lifting (leaving), .is-leaf.is-landing (arriving),
                 .is-under (being uncovered), .is-covered (being covered).
                 base.css animates them; a theme only tints the shadow
                 (--leaf-shade) and sets the timing tokens.
               Page shape tokens (set on .theme-<id>): --page-w (one card's
                 max width), --page-arch / --page-corner (top / bottom corner
                 radius: an arched card), --page-pad (padding of
                 .dwm-page__inner), --page-min (min-height of a bound page),
                 --book-persp (perspective), --leaf-shade.
               Without JS, or while .is-filtering, the book is "flat": every
               page stacked in a column.
               The page-turn duration is the CSS custom property --turn-ms on
               .dwm-book; menu.js reads it and plays the flip sound for exactly
               that long, started by the same call that starts the animation.
               Timing functions: --turn-ease (a spread: the whole 180° turn),
               --turn-lift / --turn-land (one card: the leaf leaving /
               arriving through 90°).

   Sold out
     Unavailable dishes are left out of the page unless the restaurant document
     has show_sold_out === true. Then they render as li.dwm-item.is-soldout
     [data-soldout="1"] with span.dwm-soldout in the foot instead of the Add
     control; menu.js keeps them out of the cart and hides the sheet's Add.
     base.css styles the state from three tokens (--soldout-ink, --soldout-line,
     --soldout-fade); restyle with `.theme-x .dwm-item.is-soldout …` and
     `.theme-x .dwm-soldout`.

   Motion
     menu.js adds .is-in to each .dwm-reveal when it scrolls into view and sets
     --i (0,1,2… within the batch) for staggering. base.css animates nothing:
     a theme opts in, e.g.
        @media (prefers-reduced-motion: no-preference) {
          .dwm-motion .theme-x .dwm-reveal { opacity: 0 }
          .dwm-motion .theme-x .dwm-reveal.is-in { animation: … both; animation-delay: calc(var(--i, 0) * 40ms) }
        }
     Never hide .dwm-reveal without the .dwm-motion ancestor.

   Sound
     Off by default. button.dwm-sound toggles it ([aria-pressed]); sounds are
     synthesised in menu.js (page flip, add tick, order chime). Themes do not
     ship audio files.

   Design tokens (set them on `.theme-<id>`; every one has a default below)
     Colour     --bg  --surface  --surface-2 (dialogs, raised)  --ink  --muted
                --line  --line-strong  --accent  --accent-ink (text ON accent)
                --accent-text (accent used AS text on --bg/--surface)
                --focus  --scrim  --mark-bg  --mark-ink
                --warn-bg  --warn-ink  --warn-line   (closed banner, errors)
                --ok  --diet-veg  --diet-nonveg  --diet-egg
                --soldout-ink (text of a sold-out dish; keep >= 4.5:1)
                --soldout-line  --soldout-fade (opacity of its photo/badge)
     Brand      --brand  --brand-ink  --brand-on-light  --brand-on-dark
                (set per restaurant on <body>; default --accent is --brand)
     Type       --font-display  --font-body  --font-mono  --fs-base  --lh-base
                --fs-name (item name)  --fs-title (section title)
     Shape      --radius  --radius-sm  --radius-lg  --shadow  --shadow-lg
     Layout     --page-max  --gutter  --section-gap  --row-gap  --thumb
                --card-min  --rail-card  --media-ratio  --book-max
                --page-w  --page-arch  --page-corner  --page-pad  --page-min (book)
                --toolbar-h (JS: height of the sticky nav)
                --cartbar-h (JS: height of the cart bar)  --dock-h (resting
                height of the tools dock; set it if your dock is taller)
     Controls   --ctl-h (min touch target, >= 40px)  --btn-radius
     Motion     --ease  --turn-ms (book page turn, e.g. 720ms)
                --turn-ease  --turn-lift  --turn-land (book page turn timing
                functions, see "book" above)
     A theme may add private tokens of its own (e.g. --neon-cyan); prefix-free
     names are fine because they only exist under `.theme-<id>`.

   Brand colour
     --brand is the restaurant's own colour and is arbitrary. base.css defaults
     --accent to it (with --brand-ink computed server-side so text on it is
     always >= 4.5:1). A theme with an authored palette may set its own
     --accent / --accent-ink and use --brand for a small non-text detail, or
     not at all. Never put text on --brand without --brand-ink.

   State rules a theme usually has to restate
     base.css styles these states with ONE class + the state selector, the same
     weight as `.theme-x .thing`. If you restyle the resting state, restyle the
     active one too:
       .dwm-nav__link[aria-current="true"]   .dwm-filter[aria-pressed="true"]
       .dwm-sound[aria-pressed="true"]       .dwm-item.in-cart
       .dwm-search-toggle[aria-expanded="true"]
     The tools variants are styled with ONE class too (`:where(.tools-dock)
     .dwm-search` …), so `.theme-x .dwm-search { flex: … }` overrides the
     dock / panel layout as well: scope such rules to what you mean.
     The dish sheet's Add button is primary: `.theme-x .dwm-sheet .dwm-add__btn`.
     Three base rules are deliberately one class STRONGER than `.theme-x .thing`
     so a theme cannot break them by accident (override with the selector shown):
       the sheet's Add button            `.theme-x .dwm-sheet .dwm-add__btn`
       Add / Sold-out trails the foot    `.theme-x .dwm-item__foot > .dwm-add`
       cancelled order tracker           `.theme-x .dwm-steps.is-cancelled .dwm-steps__step`
     Layout primitives a theme should NOT restate: the masthead column
     (.dwm-masthead__inner max-width already matches the section column) and
     the poster section title size (it reads --fs-title; set the token).

   Rules
     - Contrast >= 4.5:1 for text (3:1 for >= 24px / bold >= 19px), in every
       state. Brand colour as text: var(--brand-on-light|dark), never --brand.
     - Must look finished with zero photos; never add stock or placeholder
       photography. Decoration = CSS gradients / inline SVG data: URIs.
     - All animation inside @media (prefers-reduced-motion: no-preference).
     - No horizontal page scroll at 320px; touch targets >= 40px;
       >= 1024px must be a real multi-column layout.
     - Respect env(safe-area-inset-*) if you move fixed elements.
     - No @import, no external url(), no scripts, no inline handlers.
     - Scope every selector under `.theme-<id>`; base.css keeps its own
       specificity at ONE class (via :where) so `.theme-x .thing` always wins.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
.dwm {
  --brand: #c8411a;
  --brand-ink: #ffffff;
  --brand-on-light: #b93a16;
  --brand-on-dark: #f08a64;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --ink: #1b1a18;
  --muted: #5f5b55;
  --line: rgba(0, 0, 0, .12);
  --line-strong: rgba(0, 0, 0, .32);
  --accent: var(--brand);
  --accent-ink: var(--brand-ink);
  --accent-text: var(--brand-on-light);
  --focus: var(--accent-text);
  --scrim: rgba(12, 10, 8, .55);
  --mark-bg: #ffe58a;
  --mark-ink: #1b1a18;
  --warn-bg: #fdecea;
  --warn-ink: #8c1d18;
  --warn-line: #f2b8b5;
  --ok: #1b7a43;
  --soldout-ink: var(--muted);
  --soldout-line: var(--line-strong);
  --soldout-fade: .5;
  --diet-veg: #1b7a43;
  --diet-nonveg: #b3261e;
  --diet-egg: #9a6700;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-base: 1rem;
  --lh-base: 1.5;
  --fs-name: 1.0625rem;
  --fs-title: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);

  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --btn-radius: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .08);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .28);

  --page-max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-gap: clamp(2rem, 5vw, 3.5rem);
  --row-gap: 1.25rem;
  --thumb: 4.5rem;
  --card-min: 16rem;
  --rail-card: min(76vw, 17rem);
  --media-ratio: 4 / 3;
  --book-max: 70rem;
  --toolbar-h: 3.25rem;
  --cartbar-h: 3.5rem;
  --billbar-h: 2.75rem; /* JS: height of the table-bill bar */
  --dock-h: 3.75rem;
  --ctl-h: 2.75rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --turn-ms: 700ms;
}

:where(.dwm.mode-dark) {
  --bg: #121212;
  --surface: #1b1b1b;
  --surface-2: #222222;
  --ink: #f2f0ec;
  --muted: #b3aea6;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .38);
  --accent-text: var(--brand-on-dark);
  --scrim: rgba(0, 0, 0, .68);
  --mark-bg: #ffd95a;
  --mark-ink: #1b1a18;
  --warn-bg: #3a1614;
  --warn-ink: #ffd9d4;
  --warn-line: #7a2f29;
  --ok: #5fd08d;
  --diet-veg: #5fd08d;
  --diet-nonveg: #ff8a80;
  --diet-egg: #f2c14e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
}

/* ── Reset (scoped) ─────────────────────────────────────────────────────── */
html:has(> .dwm) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html:has(> .dwm) { scroll-behavior: smooth; }
}
html.dwm-locked { overflow: hidden; }

.dwm,
.dwm *,
.dwm *::before,
.dwm *::after { box-sizing: border-box; }

.dwm {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  overflow-x: hidden;
  overflow-x: clip;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.dwm.has-cart { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

:where(.dwm) :where(h1, h2, h3, p, ul, ol, dl, dd, figure, address) { margin: 0; padding: 0; }
:where(.dwm) :where(ul, ol) { list-style: none; }
:where(.dwm) address { font-style: normal; }
:where(.dwm) img { display: block; max-width: 100%; }
:where(.dwm) :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.dwm) button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:where(.dwm) a { color: inherit; }
.dwm [hidden] { display: none !important; }
.dwm :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dwm :focus:not(:focus-visible) { outline: none; }

.dwm-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.dwm-skip {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  padding: .625rem 1rem; background: var(--ink); color: var(--bg); border-radius: var(--radius-sm);
}
.dwm-skip:focus { top: .75rem; }
.dwm-icon { flex: none; }
.dwm-mark { background: var(--mark-bg); color: var(--mark-ink); border-radius: 2px; padding: 0 .1em; }

/* ── Masthead ───────────────────────────────────────────────────────────── */
:where(.dwm) .dwm-masthead {
  padding: calc(clamp(2rem, 8vw, 4.5rem) + env(safe-area-inset-top, 0px)) var(--gutter) clamp(1.5rem, 5vw, 3rem);
}
/* The masthead pads itself by --gutter, so its inner column is the page
   column MINUS the gutters: it then lines up with .dwm-section content at
   every width. Themes must not restate this max-width. */
:where(.dwm) .dwm-masthead__inner {
  max-width: calc(var(--page-max) - 2 * var(--gutter)); margin-inline: auto;
  display: flex; flex-direction: column; gap: .5rem;
}
:where(.dwm) .dwm-logo {
  width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
}
:where(.dwm) .dwm-masthead__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 5.5vw, 4.25rem);
  line-height: 1.05; font-weight: 700; text-wrap: balance;
}
:where(.dwm) .dwm-masthead__tagline { color: var(--muted); max-width: 46ch; text-wrap: pretty; }
:where(.dwm) .dwm-masthead__hours { color: var(--muted); font-size: .875rem; }
:where(.dwm) .dwm-masthead__ornament { display: none; }

/* ── Tools (search, filters, sound) ─────────────────────────────────────── */
:where(.dwm) .dwm-tools {
  max-width: var(--page-max); margin-inline: auto;
  padding: .5rem var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
:where(.dwm) .dwm-search {
  flex: 1 1 12rem; min-width: 0; height: var(--ctl-h);
  display: flex; align-items: center; gap: .5rem; padding: 0 .875rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  color: var(--muted);
}
:where(.dwm) .dwm-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; color: var(--ink); }
:where(.dwm) .dwm-search__input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink);
  font-size: 1rem; /* >= 16px: no iOS zoom on focus */
  outline: none; appearance: none; -webkit-appearance: none;
}
:where(.dwm) .dwm-search__input::placeholder { color: var(--muted); opacity: 1; }
:where(.dwm) .dwm-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
:where(.dwm) .dwm-filters { display: flex; gap: .5rem; order: 3; flex: 1 1 100%; }
@media (min-width: 36rem) {
  :where(.dwm) .dwm-filters { order: 0; flex: 0 0 auto; }
}
:where(.dwm) .dwm-filter {
  min-height: var(--ctl-h); padding: 0 1rem;
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  background: transparent; color: var(--ink); font-size: .9375rem; white-space: nowrap;
}
:where(.dwm) .dwm-filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:where(.dwm) .dwm-filter[aria-pressed="true"] .dwm-diet { --diet-c: currentColor; }
:where(.dwm) .dwm-sound {
  flex: none; width: var(--ctl-h); height: var(--ctl-h);
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); color: var(--muted);
}
:where(.dwm) .dwm-sound[aria-pressed="true"] { color: var(--accent-text); border-color: currentColor; }
:where(.dwm) .dwm-sound[aria-pressed="true"] .dwm-sound__off,
:where(.dwm) .dwm-sound[aria-pressed="false"] .dwm-sound__on { display: none; }
:where(.dwm) .dwm-tools__status { flex: 1 1 100%; order: 9; font-size: .875rem; color: var(--muted); }
:where(.dwm) .dwm-tools__status:empty { display: none; }

/* Sound toggle outside the tools (registry `sound`). */
:where(.sound-masthead) .dwm-masthead { position: relative; }
:where(.sound-masthead .dwm-masthead) > .dwm-sound {
  position: absolute; z-index: 2;
  top: calc(.75rem + env(safe-area-inset-top, 0px)); right: max(.75rem, env(safe-area-inset-right, 0px));
}
:where(.sound-footer .dwm-footer) .dwm-sound { margin-top: .5rem; }

/* tools-masthead: the tools are a block of the masthead column. */
:where(.tools-masthead) .dwm-tools { max-width: none; margin: .75rem 0 0; padding: 0; }

/* tools-below: after the menu; in the book, directly under the page controls. */
:where(.tools-below) .dwm-tools { margin-top: var(--section-gap); }
:where(.layout-book) .dwm-tools { max-width: calc(40rem + 2 * var(--gutter)); margin-top: 1rem; }

/* tools-inline-nav: a search toggle ends the nav row; the tools are a panel
   inside the sticky nav (menu.js keeps it [hidden] until the toggle is used). */
:where(.tools-inline-nav) .dwm-nav__bar {
  max-width: var(--page-max); margin-inline: auto;
  display: flex; align-items: center; padding-right: var(--gutter);
}
:where(.tools-inline-nav) .dwm-nav__list { flex: 1 1 auto; min-width: 0; max-width: none; margin-inline: 0; padding-right: .5rem; }
:where(.tools-inline-nav) .dwm-tools { border-top: 1px solid var(--line); }
:where(.dwm) .dwm-search-toggle {
  position: relative; flex: none; min-width: var(--ctl-h); height: var(--ctl-h); padding: 0 .625rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); color: var(--ink); font-size: .9375rem;
}
:where(.dwm) .dwm-search-toggle__label { display: none; }
:where(.dwm) .dwm-search-toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* A search or filter is still on while the panel is closed. */
:where(.is-filtering, .is-finding) .dwm-search-toggle::after {
  content: ""; position: absolute; top: .1875rem; right: .1875rem; width: .5rem; height: .5rem;
  border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 0 2px var(--bg);
}
/* No JS: the panel is always open, so the nav must not stick. */
:where(html:not(.dwm-js) .tools-inline-nav) .dwm-nav { position: static; }

/* tools-dock: a compact dock fixed above the cart bar. wrap-reverse keeps the
   search field on the bottom row (under the thumb) when the dock needs two. */
:where(.dwm) .dwm-tools--dock {
  position: fixed; z-index: 25;
  left: max(.75rem, env(safe-area-inset-left, 0px)); right: max(.75rem, env(safe-area-inset-right, 0px));
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  max-width: 30rem; margin-inline: auto; padding: .375rem; gap: .375rem;
  flex-wrap: wrap-reverse;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: calc(var(--ctl-h) / 2 + .375rem); box-shadow: var(--shadow-lg);
}
:where(.has-cart) .dwm-tools--dock { bottom: calc(1.25rem + var(--cartbar-h) + env(safe-area-inset-bottom, 0px)); }
:where(.dwm-tools--dock) .dwm-search { flex: 0 1 7.25rem; padding: 0 .75rem; }
:where(.dwm-tools--dock) .dwm-search:focus-within,
:where(.has-query .dwm-tools--dock) .dwm-search { flex: 1 1 100%; }
:where(.dwm-tools--dock) .dwm-filters { order: 0; flex: 1 1 auto; justify-content: flex-end; gap: .375rem; }
:where(.dwm-tools--dock) .dwm-filter { padding: 0 .75rem; font-size: .875rem; }
:where(.dwm-tools--dock) .dwm-tools__status { padding: .125rem .625rem; text-align: center; }
@media (max-width: 22.49rem) {
  :where(.dwm:not(.has-query) .dwm-tools--dock) .dwm-search:not(:focus-within) { flex: 0 0 var(--ctl-h); padding: 0; gap: 0; justify-content: center; }
  :where(.dwm:not(.has-query) .dwm-tools--dock) .dwm-search:not(:focus-within) .dwm-search__input { flex: 0 0 0; width: 0; opacity: 0; }
}
/* The page keeps clear of the dock (and of dock + cart bar). Two classes on
   purpose: these must out-weigh `.dwm.has-cart` above. */
.dwm.tools-dock { padding-bottom: calc(var(--dock-h) + 1.5rem + env(safe-area-inset-bottom, 0px)); }
.dwm.tools-dock.has-cart { padding-bottom: calc(var(--dock-h) + var(--cartbar-h) + 2rem + env(safe-area-inset-bottom, 0px)); }

/* ── Section navigation (sticky, scroll-spy) ────────────────────────────── */
:where(.dwm) .dwm-nav {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
:where(.dwm) .dwm-nav__list {
  max-width: var(--page-max); margin-inline: auto;
  display: flex; gap: .25rem;
  padding: .375rem var(--gutter);
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
:where(.dwm) .dwm-nav__list::-webkit-scrollbar { display: none; }
:where(.dwm) .dwm-nav__item { flex: none; }
:where(.dwm) .dwm-nav__link {
  display: inline-flex; align-items: center; gap: .375rem;
  min-height: 2.5rem; padding: 0 .875rem;
  border-radius: var(--btn-radius);
  color: var(--muted); text-decoration: none; white-space: nowrap; font-size: .9375rem;
}
:where(.dwm) .dwm-nav__link[aria-current="true"] { color: var(--accent-ink); background: var(--accent); }
:where(.dwm) .dwm-nav__count { font-size: max(.75rem, .75em); opacity: .8; font-variant-numeric: tabular-nums; }

/* ── Closed banner ──────────────────────────────────────────────────────── */
:where(.dwm) .dwm-closed {
  max-width: calc(var(--page-max) - 2 * var(--gutter));
  margin: 1rem auto 0; width: calc(100% - 2 * var(--gutter));
  padding: .875rem 1rem;
  display: grid; gap: .125rem;
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); border-radius: var(--radius);
  font-size: .9375rem;
}

/* ── Page bar: table chip, call staff, Photos / List ────────────────────── */
/* One quiet row above the menu, on the page background. Everything in it is
   [hidden] until menu.js knows it applies (a table in the link; a layout that
   has a compact view), and the row itself is hidden while it is empty. */
:where(.dwm) .dwm-pagebar {
  max-width: var(--page-max); margin: .75rem auto 0; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
:where(.dwm) .dwm-tablechip {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0 .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  font-size: .8125rem; font-weight: 600; color: var(--ink); white-space: nowrap;
}
:where(.dwm) .dwm-callbtn {
  display: inline-flex; align-items: center; gap: .375rem; min-height: var(--ctl-h); padding: 0 .875rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  font-size: .875rem; font-weight: 600; color: var(--ink); white-space: nowrap;
}
:where(.dwm) .dwm-callbtn:disabled { opacity: .6; cursor: default; }
:where(.dwm) .dwm-viewtoggle {
  margin-left: auto; display: inline-flex; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); overflow: hidden;
}
:where(.dwm) .dwm-viewtoggle__btn { width: var(--ctl-h); height: var(--ctl-h); min-width: 2.5rem; min-height: 2.5rem; display: inline-grid; place-items: center; color: var(--muted); }
:where(.dwm) .dwm-viewtoggle__btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ── Menu body, sections ────────────────────────────────────────────────── */
:where(.dwm) .dwm-menu { display: block; outline: none; }
:where(.dwm) .dwm-section {
  max-width: var(--page-max); margin-inline: auto;
  padding: var(--section-gap) var(--gutter) 0;
  scroll-margin-top: calc(var(--toolbar-h) + .5rem);
}
:where(.dwm) .dwm-section__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem;
  margin-bottom: 1.25rem;
}
:where(.dwm) .dwm-section__num { color: var(--muted); font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-section__title {
  font-family: var(--font-display); font-size: var(--fs-title); line-height: 1.1; font-weight: 700;
  text-wrap: balance; min-width: 0;
}
:where(.dwm) .dwm-section__cont { font-size: max(.75rem, .55em); font-weight: 400; color: var(--muted); }
:where(.dwm) .dwm-section__count { color: var(--muted); font-size: .875rem; margin-left: auto; white-space: nowrap; }
:where(.dwm) .dwm-section__rule { flex: 1 0 100%; height: 1px; background: var(--line); }
:where(.dwm) .dwm-section__empty { color: var(--muted); padding: 1rem 0; }
:where(.dwm) .dwm-menu__none { max-width: var(--page-max); margin-inline: auto; padding: 3rem var(--gutter); text-align: center; }
:where(.dwm) .dwm-empty {
  max-width: 32rem; margin: 3rem auto; padding: 0 var(--gutter);
  display: grid; justify-items: center; gap: 1rem; text-align: center; color: var(--muted);
}

/* ── Item parts ─────────────────────────────────────────────────────────── */
:where(.dwm) .dwm-item { position: relative; min-width: 0; }
:where(.dwm) .dwm-item__body { min-width: 0; display: flex; flex-direction: column; gap: .375rem; }
:where(.dwm) .dwm-item__head { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
:where(.dwm) .dwm-item__name {
  font-family: var(--font-display); font-size: var(--fs-name); line-height: 1.25; font-weight: 600;
  min-width: 0; text-wrap: balance;
}
/* The button's own box is >= 40px tall (padding), without moving the name:
   the negative margin gives the padding back to the line. */
:where(.dwm) .dwm-item__open {
  display: inline; font: inherit; color: inherit; text-align: left;
  text-transform: inherit; letter-spacing: inherit;
  border-radius: 2px;
  padding-block: .625rem; margin-block: -.625rem; min-height: 2.5rem;
}
/* The whole row/card is the hit area for "open details"; real controls sit above it. */
:where(.dwm) .dwm-item__open::after { content: ""; position: absolute; inset: 0; z-index: 0; }
:where(.dwm) .dwm-item :where(.dwm-add, a) { position: relative; z-index: 1; }
:where(.dwm) .dwm-item__leader {
  flex: 1 1 1.5rem; min-width: 1rem; align-self: flex-end;
  border-bottom: 1px dotted var(--line-strong); transform: translateY(-.45em);
}
:where(.dwm) .dwm-item__price {
  flex: none; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; font-weight: 600;
}
:where(.dwm) .dwm-cur { margin-right: .08em; }
:where(.dwm) .dwm-item__desc { color: var(--muted); font-size: .9375rem; max-width: 62ch; text-wrap: pretty; }
:where(.dwm) .dwm-item__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .125rem; }
/* Deliberately ONE class stronger than a theme's `.theme-x .dwm-add { margin: … }`,
   so the Add control (or the Sold-out label) always trails the foot. A theme
   that really wants it elsewhere uses `.theme-x .dwm-item__foot > .dwm-add`. */
.dwm .dwm-item__foot > :where(.dwm-add, .dwm-soldout) { margin-left: auto; }
:where(.dwm) .dwm-item__code { font-family: var(--font-mono); font-size: max(.75rem, .75em); color: var(--muted); }
:where(.dwm) .dwm-item__media { overflow: hidden; border-radius: var(--radius-sm); background: var(--line); position: relative; }
:where(.dwm) .dwm-item__img { width: 100%; height: 100%; object-fit: cover; }
:where(.dwm) .dwm-item__mono { font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--muted); }

:where(.dwm) .dwm-badge {
  display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 .5rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  font-size: .75rem; line-height: 1.2; color: var(--ink); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}

/* Dietary marker (Indian convention: green dot = veg, red triangle = non-veg) */
:where(.dwm) .dwm-diet {
  --diet-c: var(--diet-veg);
  position: relative; flex: none; align-self: center;
  display: inline-block; width: .9375rem; height: .9375rem;
  border: 1.5px solid var(--diet-c); border-radius: 2px;
}
:where(.dwm) .dwm-diet::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--diet-c); }
:where(.dwm) .dwm-diet--vegan::after { border-radius: 0 70% 0 70%; inset: 18%; }
:where(.dwm) .dwm-diet--egg { --diet-c: var(--diet-egg); }
:where(.dwm) .dwm-diet--non_veg { --diet-c: var(--diet-nonveg); }
:where(.dwm) .dwm-diet--non_veg::after { border-radius: 0; inset: 16%; clip-path: polygon(50% 6%, 98% 94%, 2% 94%); }

/* Spice level: 1–3 small chillies drawn here (no image, no emoji font). */
:where(.dwm) .dwm-spice { display: inline-flex; align-items: center; gap: .1875rem; flex: none; align-self: center; padding: .1875rem .125rem 0; }
:where(.dwm) .dwm-spice__mark {
  position: relative; display: block; width: .375rem; height: .75rem;
  background: var(--diet-nonveg); border-radius: 60% 40% 70% 30% / 35% 35% 65% 65%; transform: rotate(28deg);
}
:where(.dwm) .dwm-spice__mark::before {
  content: ""; position: absolute; top: -.1875rem; left: 30%; width: .125rem; height: .25rem;
  background: var(--diet-veg); border-radius: 1px;
}

/* Add / stepper */
:where(.dwm) .dwm-add { display: inline-flex; flex: none; }
:where(.dwm) .dwm-add__btn {
  min-height: var(--ctl-h); min-width: 4.5rem; padding: 0 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  border: 1px solid var(--accent-text); border-radius: var(--btn-radius);
  color: var(--accent-text); font-weight: 600; font-size: .9375rem;
}
:where(.dwm) .dwm-stepper {
  display: inline-flex; align-items: center;
  border-radius: var(--btn-radius); background: var(--accent); color: var(--accent-ink);
}
:where(.dwm) .dwm-step {
  width: var(--ctl-h); height: var(--ctl-h); min-width: 2.5rem; min-height: 2.5rem;
  display: inline-grid; place-items: center; font-size: 1.25rem; line-height: 1; color: inherit;
  border-radius: var(--btn-radius);
}
:where(.dwm) .dwm-step__qty { min-width: 1.5rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.dwm.is-closed .dwm-add__btn { opacity: .55; }

/* Sold out (only rendered when the restaurant sets show_sold_out). The dish
   stays readable but recedes; it has no Add control and cannot enter the cart. */
:where(.dwm) .dwm-soldout {
  display: inline-flex; align-items: center; flex: none; min-height: 1.75rem; padding: 0 .625rem;
  border: 1px solid var(--soldout-line); border-radius: var(--btn-radius);
  color: var(--soldout-ink); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
:where(.dwm) .dwm-item.is-soldout :where(.dwm-item__name, .dwm-item__price, .dwm-item__desc, .dwm-item__code) { color: var(--soldout-ink); }
:where(.dwm) .dwm-item.is-soldout :where(.dwm-item__media, .dwm-item__stamp, .dwm-diet, .dwm-badge) { opacity: var(--soldout-fade); filter: grayscale(1); }

/* ── Layout: list / ticket / book rows / magazine rows ──────────────────── */
:where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-items { display: grid; gap: var(--row-gap); }
:where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .875rem; align-items: start;
}
:where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item.has-photo {
  grid-template-columns: minmax(0, 1fr) var(--thumb);
}
:where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item__media {
  grid-column: 2; grid-row: 1; width: var(--thumb); aspect-ratio: 1;
}
:where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item__body { grid-column: 1; grid-row: 1; }
@supports (align-items: last baseline) {
  :where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item__head { align-items: last baseline; }
  :where(.layout-list, .layout-ticket, .layout-book, .layout-magazine) .dwm-item__leader { align-self: auto; transform: none; }
}
@media (min-width: 64rem) {
  :where(.layout-list) .dwm-items { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2.5rem, 5vw, 5rem); }
}

/* ── Layout: ticket (paper) ─────────────────────────────────────────────── */
:where(.layout-ticket) .dwm-menu {
  position: relative; width: min(100% - 2 * var(--gutter), 34rem); margin: 1.5rem auto 0;
  background: var(--surface); padding: 1.25rem clamp(1rem, 4vw, 1.75rem) 1.5rem;
}
/* margin (not padding) between sections: it collapses at a column break, so
   both columns of the wide layout start level. */
:where(.layout-ticket) .dwm-section { padding: 0; margin-top: 1.75rem; max-width: none; }
:where(.layout-ticket) .dwm-section:first-of-type { margin-top: 0; }
:where(.layout-ticket) .dwm-item__code { display: none; }
:where(.layout-ticket) .dwm-ticket__edge { display: block; position: absolute; left: 0; right: 0; height: .625rem; }
:where(.layout-ticket) .dwm-ticket__edge--top { top: -.625rem; }
:where(.layout-ticket) .dwm-ticket__edge--bottom { bottom: -.625rem; }
:where(.layout-ticket) .dwm-ticket__stub {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong);
  display: grid; justify-items: center; gap: .5rem; color: var(--muted); font-size: .875rem;
}
:where(.layout-ticket) .dwm-ticket__barcode {
  width: min(100%, 14rem); height: 2.25rem;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px, currentColor 5px 6px, transparent 6px 9px, currentColor 9px 12px, transparent 12px 14px);
  opacity: .7;
}
@media (min-width: 64rem) {
  :where(.layout-ticket) .dwm-menu { width: min(100% - 2 * var(--gutter), 66rem); columns: 2; column-gap: 3.5rem; padding: 2rem 3rem 2.5rem; }
  :where(.layout-ticket) .dwm-menu > :not(.dwm-section) { column-span: all; }
  :where(.layout-ticket) .dwm-section { break-inside: auto; }
  :where(.layout-ticket) .dwm-section__head { break-after: avoid; }
  :where(.layout-ticket) .dwm-item { break-inside: avoid; }
}

/* ── Layout: magazine ───────────────────────────────────────────────────── */
:where(.layout-magazine) .dwm-section__num { font-family: var(--font-display); font-size: clamp(3rem, 12vw, 7rem); line-height: .85; color: var(--accent-text); }
:where(.layout-magazine) .dwm-section__head { align-items: flex-end; }
:where(.layout-magazine) .dwm-item.is-hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
:where(.layout-magazine) .dwm-item.is-hero .dwm-item__media { grid-column: 1; grid-row: 1; width: 100%; aspect-ratio: 16 / 10; }
:where(.layout-magazine) .dwm-item.is-hero .dwm-item__body { grid-row: auto; }
:where(.layout-magazine) .dwm-item.is-hero .dwm-item__name { font-size: clamp(1.5rem, 1rem + 2.5vw, 2.25rem); }
@media (min-width: 48rem) {
  :where(.layout-magazine) .dwm-items { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; }
  :where(.layout-magazine) .dwm-item.is-hero { grid-column: 1 / -1; }
  :where(.layout-magazine) .dwm-item.is-hero.has-photo { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: end; gap: 2rem; }
  :where(.layout-magazine) .dwm-item.is-hero.has-photo .dwm-item__body { grid-column: 2; grid-row: 1; }
}
@media (min-width: 64rem) {
  :where(.layout-magazine) .dwm-section { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, 3.2fr); gap: 0 3rem; }
  :where(.layout-magazine) .dwm-section__head { position: sticky; top: calc(var(--toolbar-h) + 1.5rem); align-self: start; flex-direction: column; align-items: flex-start; }
  :where(.layout-magazine) .dwm-section__count { margin-left: 0; }
}

/* ── Layout: cards / carousel cards ─────────────────────────────────────── */
:where(.layout-cards) .dwm-items {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
}
:where(.layout-cards, .layout-carousel) .dwm-item {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
:where(.layout-cards, .layout-carousel) .dwm-item__media { border-radius: 0; aspect-ratio: var(--media-ratio); flex: none; }
:where(.layout-cards, .layout-carousel) .dwm-item__media.is-empty { display: grid; place-items: center; }
/* A menu with no photos at all drops the plates; a mixed menu keeps them so cards align. */
:where(.no-photos.layout-cards, .no-photos.layout-carousel) .dwm-item__media.is-empty { display: none; }
/* …but a plate that carries a badge (.has-badge) is never dropped: it collapses
   to a chip row above the dish name, so the badge always shows. Same weight as
   the rule above, so any theme `.theme-x .dwm-item__media.is-empty` still wins. */
:where(.no-photos.layout-cards, .no-photos.layout-carousel) .dwm-item__media.has-badge:where(.is-empty) {
  display: block; aspect-ratio: auto; background: none; padding: .875rem 1rem 0;
}
:where(.no-photos.layout-cards, .no-photos.layout-carousel) :where(.dwm-item__media.is-empty.has-badge) .dwm-item__mono { display: none; }
:where(.layout-cards, .layout-carousel) .dwm-item__media .dwm-badge {
  position: absolute; left: .625rem; top: .625rem; max-width: calc(100% - 1.25rem);
  background: var(--surface); border-color: transparent;
}
:where(.no-photos.layout-cards, .no-photos.layout-carousel) .dwm-item__media.is-empty .dwm-badge { position: static; border-color: var(--line-strong); }
:where(.layout-cards, .layout-carousel) .dwm-item__body { flex: 1; padding: .875rem 1rem 1rem; }
:where(.layout-cards, .layout-carousel) .dwm-item__foot { margin-top: auto; padding-top: .5rem; justify-content: space-between; }
@media (min-width: 64rem) {
  :where(.layout-cards) .dwm-items { gap: 1.5rem; }
}

/* ── Layout: carousel (horizontal snap rails) ───────────────────────────── */
:where(.layout-carousel) .dwm-section { padding-inline: 0; max-width: none; }
:where(.layout-carousel) .dwm-section__head { padding-inline: var(--gutter); max-width: var(--page-max); margin-inline: auto; }
:where(.layout-carousel) .dwm-section__empty { padding-inline: var(--gutter); }
:where(.layout-carousel) .dwm-rail-wrap { position: relative; }
:where(.layout-carousel) .dwm-rail {
  display: flex; gap: .875rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: .5rem var(--gutter) 1.25rem;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
:where(.layout-carousel) .dwm-rail::-webkit-scrollbar { display: none; }
:where(.layout-carousel) .dwm-rail > .dwm-item { flex: 0 0 var(--rail-card); scroll-snap-align: start; }
:where(.layout-carousel.is-filtering) .dwm-rail { scroll-snap-type: none; }
:where(.layout-carousel) .dwm-rail__btn {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 50%;
  box-shadow: var(--shadow);
}
:where(.layout-carousel) .dwm-rail__btn--prev { left: .5rem; }
:where(.layout-carousel) .dwm-rail__btn--next { right: .5rem; }
:where(.layout-carousel) .dwm-rail__btn:disabled { opacity: 0; pointer-events: none; }
@media (min-width: 64rem) {
  :where(.layout-carousel) .dwm-rail { gap: 1.25rem; padding-inline: max(var(--gutter), calc((100vw - var(--page-max)) / 2 + var(--gutter))); scroll-padding-inline: max(var(--gutter), calc((100vw - var(--page-max)) / 2 + var(--gutter))); }
  :where(.layout-carousel) .dwm-rail > .dwm-item { flex-basis: clamp(16rem, 22vw, 20rem); }
}

/* ── Layout: poster (tiles with a price stamp) ──────────────────────────── */
:where(.layout-poster) .dwm-items {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
/* Poster titles are sized by the --fs-title token like every other layout (a
   poster theme sets a big one); the clamp only stops a runaway token, and long
   words wrap or hyphenate instead of breaking mid-word on a 320–360px screen. */
:where(.layout-poster) .dwm-section__title {
  font-size: clamp(1.5rem, var(--fs-title), 6rem); line-height: 1;
  overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
}
:where(.layout-poster) .dwm-item {
  display: flex; flex-direction: column; min-height: 9rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
:where(.layout-poster) .dwm-item__media { margin: -1rem -1rem .875rem; border-radius: 0; aspect-ratio: var(--media-ratio); }
:where(.layout-poster) .dwm-item__stamp {
  align-self: flex-start; margin-bottom: .625rem; padding: .25rem .625rem;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); font-size: 1.125rem;
}
:where(.layout-poster) .dwm-item__body { flex: 1; }
:where(.layout-poster) .dwm-item__name { font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem); line-height: 1.1; }
:where(.layout-poster) .dwm-item__foot { margin-top: auto; padding-top: .5rem; }
@media (min-width: 64rem) {
  :where(.layout-poster) .dwm-items { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
}

/* ── Compact view (body.view-compact): rows for long menus ──────────────── */
/* The guest's "List" choice for list / cards / magazine / ticket / poster
   (never book or carousel). Every dish becomes one short row: a 64px photo,
   name and price on the first line, two lines of description with the Add
   control beside them. It is a function, not a look, so these rules are
   deliberately stronger than a theme's (`.view-compact` twice, !important on
   the structure): a theme keeps its colours, type and card chrome and needs
   no rules of its own. The body and foot wrappers become `display: contents`
   so their parts sit directly on the row's grid. */
.dwm.view-compact.view-compact .dwm-items {
  display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: .5rem;
}
/* :not([hidden]) — a dish filtered out by search or "Veg only" must stay hidden. */
.dwm.view-compact.view-compact .dwm-item:not([hidden]) { display: grid !important; }
.dwm.view-compact.view-compact .dwm-item {
  align-items: start; column-gap: .625rem; row-gap: .125rem;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas: "head head" "desc add" "badge add" !important;
  grid-column: auto !important; min-height: 0 !important; padding: .375rem 0;
}
.dwm.view-compact.view-compact .dwm-item.has-photo {
  grid-template-columns: 4rem minmax(0, 1fr) auto !important;
  grid-template-areas: "media head head" "media desc add" "media badge add" !important;
}
/* Cards and tiles keep the price outside the head: it takes the end of line one. */
.dwm.view-compact.view-compact:where(.layout-cards, .layout-poster) .dwm-item {
  grid-template-areas: "head price" "desc add" "badge add" !important; padding: .625rem .75rem;
}
.dwm.view-compact.view-compact:where(.layout-cards, .layout-poster) .dwm-item.has-photo {
  grid-template-areas: "media head price" "media desc add" "media badge add" !important;
}
.dwm.view-compact.view-compact .dwm-item__body,
.dwm.view-compact.view-compact .dwm-item__foot { display: contents !important; }
.dwm.view-compact.view-compact .dwm-item__head { grid-area: head; min-width: 0; }
.dwm.view-compact.view-compact .dwm-item__name { font-size: 1rem; line-height: 1.3; }
.dwm.view-compact.view-compact .dwm-item__desc {
  grid-area: desc; margin: 0; max-width: none; font-size: .8125rem; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.dwm.view-compact.view-compact .dwm-item__media {
  grid-area: media !important; width: 4rem !important; height: 4rem !important; aspect-ratio: 1 !important;
  margin: 0 !important; border-radius: var(--radius-sm); align-self: start;
}
.dwm.view-compact.view-compact .dwm-item:not(.has-photo) .dwm-item__media { display: none !important; }
/* A photo-less plate that carries a badge keeps the badge, as a chip under the text. */
.dwm.view-compact.view-compact .dwm-item:not(.has-photo) .dwm-item__media.has-badge {
  display: block !important; grid-area: badge !important; width: auto !important; height: auto !important;
  aspect-ratio: auto !important; padding: 0; background: none; overflow: visible;
}
.dwm.view-compact.view-compact .dwm-item__media.is-empty .dwm-item__mono { display: none; }
.dwm.view-compact.view-compact .dwm-item__media.is-empty .dwm-badge { position: static; border-color: var(--line-strong); }
/* A 64px photo has no room for a badge chip on top of it. */
.dwm.view-compact.view-compact .dwm-item.has-photo .dwm-item__media .dwm-badge { display: none; }
.dwm.view-compact.view-compact .dwm-item__foot > .dwm-badge { grid-area: badge; justify-self: start; }
.dwm.view-compact.view-compact .dwm-item__foot > .dwm-item__price,
.dwm.view-compact.view-compact .dwm-item > .dwm-item__stamp {
  grid-area: price; align-self: start; margin: 0 !important; font-size: 1rem; line-height: 1.3;
}
.dwm.view-compact.view-compact .dwm-item > .dwm-item__stamp { padding: 0 .375rem; transform: none; position: static; }
.dwm.view-compact.view-compact .dwm-item :where(.dwm-add, .dwm-soldout) { grid-area: add; align-self: center; margin: 0 !important; }
.dwm.view-compact.view-compact .dwm-item .dwm-add__btn { min-height: var(--ctl-h); min-width: 3.5rem; padding: 0 .75rem; }
.dwm.view-compact.view-compact .dwm-item .dwm-step { width: 2.5rem; height: 2.5rem; }
@media (min-width: 48rem) {
  .dwm.view-compact.view-compact .dwm-items { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; column-gap: 2rem; }
  /* The ticket is a narrow paper (two CSS columns when wide): one row per line. */
  .dwm.view-compact.view-compact:where(.layout-ticket) .dwm-items { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ── Layout: book ───────────────────────────────────────────────────────── */
/* A booklet of menu cards. Every page is a real leaf, stacked in ONE grid cell
   (two cells in a spread), so the stage is as tall as the tallest page: no
   jump between pages, nothing clipped, and the leaf that turns is the page
   itself — it cannot be out of line with the page under it. */
:where(.dwm.layout-book) {
  --page-w: 41.25rem;            /* one card: 660px, the old booklet's width */
  --page-arch: 0px;              /* top corner radius (an arched card) */
  --page-corner: 0px;            /* bottom corner radius */
  --page-pad: clamp(1.25rem, 5vw, 2.5rem) clamp(1.125rem, 5vw, 2.75rem) clamp(1rem, 3vw, 1.5rem);
  --page-min: min(68vh, 42rem);
  --book-persp: 1600px;
  --leaf-shade: rgba(0, 0, 0, .28);
  --turn-ease: cubic-bezier(.42, .02, .24, 1);
  --turn-lift: cubic-bezier(.6, -.28, .74, .05);
  --turn-land: cubic-bezier(.2, .7, .2, 1);
}
:where(.layout-book) .dwm-book {
  max-width: var(--book-max); margin: 1rem auto 0; padding: 0 var(--gutter);
}
:where(.layout-book) .dwm-book__stage { position: relative; }
:where(.layout-book) .dwm-page {
  position: relative; background: var(--surface); color: var(--ink);
  max-width: var(--page-w); margin-inline: auto; padding: 0; scroll-margin-top: calc(var(--toolbar-h) + .5rem);
  border-radius: var(--page-arch) var(--page-arch) var(--page-corner) var(--page-corner);
}
:where(.layout-book) .dwm-page + .dwm-page { margin-top: 1rem; }
:where(.layout-book) .dwm-page__inner {
  position: relative; display: flex; flex-direction: column; flex: 1;
  padding: var(--page-pad);
}
:where(.layout-book) .dwm-page__shade,
:where(.layout-book) .dwm-page__ornament { display: none; }
:where(.layout-book) .dwm-page__running {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .8125rem; color: var(--muted); margin-bottom: 1.25rem;
}
:where(.layout-book) .dwm-page__running > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.layout-book) .dwm-page__folio { margin-top: auto; padding-top: 1.5rem; text-align: center; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
:where(.layout-book) .dwm-page--cover .dwm-page__inner,
:where(.layout-book) .dwm-page--colophon .dwm-page__inner { align-items: center; justify-content: center; text-align: center; gap: .875rem; min-height: 22rem; }
:where(.layout-book) .dwm-cover__title { font-family: var(--font-display); font-size: clamp(2rem, 1.2rem + 5vw, 3.75rem); line-height: 1.05; text-wrap: balance; }
:where(.layout-book) .dwm-cover__tagline { color: var(--muted); max-width: 34ch; }
:where(.layout-book) .dwm-cover__rule { width: 4rem; height: 1px; background: var(--line-strong); }
:where(.layout-book) .dwm-cover__hours,
:where(.layout-book) .dwm-cover__hint { color: var(--muted); font-size: .875rem; max-width: 30ch; }
:where(.layout-book) .dwm-cover__hint { display: none; }
:where(.layout-book) .dwm-toc__title { font-family: var(--font-display); font-size: var(--fs-title); margin-bottom: 1.25rem; }
:where(.layout-book) .dwm-toc { display: grid; gap: .125rem; }
:where(.layout-book) .dwm-toc__link {
  display: flex; align-items: baseline; gap: .5rem; min-height: 2.75rem; padding: .375rem 0;
  text-decoration: none; font-size: 1.0625rem;
}
:where(.layout-book) .dwm-toc__name { min-width: 0; }
:where(.layout-book) .dwm-toc__leader { flex: 1 1 1.5rem; min-width: 1rem; border-bottom: 1px dotted var(--line-strong); transform: translateY(-.3em); }
:where(.layout-book) .dwm-toc__page { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
:where(.layout-book) .dwm-book__spine,
:where(.layout-book) .dwm-book__edge { display: none; }
:where(.layout-book) .dwm-colophon__name { font-family: var(--font-display); font-size: 1.5rem; }
:where(.layout-book) .dwm-contact { display: grid; gap: .25rem; color: var(--muted); }
:where(.layout-book) .dwm-footer__name,
:where(.layout-book) .dwm-footer > .dwm-contact { display: none; }

/* Flat book (no JS, or a filter is active): hide the furniture. */
:where(.layout-book) .dwm-book:not(.is-bound) .dwm-page--blank,
:where(.layout-book.is-filtering) .dwm-page--blank,
:where(.layout-book.is-filtering) .dwm-page--cover,
:where(.layout-book.is-filtering) .dwm-page--toc,
:where(.layout-book.is-filtering) .dwm-page--colophon,
:where(.layout-book.is-filtering) .dwm-book__controls { display: none !important; }

/* Bound book (menu.js adds .is-bound): one card, or a two-page spread. All
   pages share the cell; only the ones on show (and, during a turn, the leaf
   and the pages under it) are visible. */
:where(.layout-book:not(.is-filtering)) .dwm-book.is-bound .dwm-book__stage {
  display: grid; grid-template-columns: minmax(0, 1fr);
  max-width: var(--page-w); margin-inline: auto;
  perspective: var(--book-persp); touch-action: pan-y;
}
:where(.layout-book:not(.is-filtering)) .dwm-book.is-bound .dwm-page {
  grid-area: 1 / 1; display: flex; flex-direction: column; visibility: hidden;
  margin: 0; max-width: none; min-height: var(--page-min);
}
:where(.layout-book:not(.is-filtering)) .dwm-book.is-bound .dwm-page:where(.is-current, .is-under, .is-leaf) { visibility: visible; }
:where(.layout-book:not(.is-filtering)) .dwm-book.is-bound .dwm-cover__hint { display: block; }
/* The corner of the card is the tap target (the old booklet's corner peel). */
:where(.layout-book:not(.is-filtering)) .dwm-book.is-bound .dwm-book__edge {
  display: block; position: absolute; bottom: 0; z-index: 5; width: 3rem; height: 3rem;
}
:where(.layout-book) .dwm-book__edge--prev { left: 0; }
:where(.layout-book) .dwm-book__edge--next { right: 0; }
:where(.layout-book .dwm-book.is-bound) .dwm-book__edge {
  background: linear-gradient(135deg, transparent 50%, var(--line-strong) 50%); border-radius: 0 0 var(--page-corner) 0;
}
:where(.layout-book .dwm-book.is-bound) .dwm-book__edge--prev {
  background: linear-gradient(225deg, transparent 50%, var(--line-strong) 50%); border-radius: 0 0 0 var(--page-corner);
}
:where(.layout-book) .dwm-book__edge::after {
  content: "\203A"; position: absolute; right: .5rem; bottom: .25rem;
  font-size: 1.25rem; line-height: 1; font-weight: 700; color: var(--surface);
}
:where(.layout-book) .dwm-book__edge--prev::after { content: "\2039"; right: auto; left: .5rem; }
:where(.layout-book) .dwm-book__edge:disabled,
:where(.layout-book) .dwm-book.is-turning .dwm-book__edge { visibility: hidden; }
@media (min-width: 56.25rem) {
  :where(.layout-book:not(.is-filtering)) .dwm-book.is-bound.is-spread .dwm-book__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  :where(.layout-book:not(.is-filtering)) .dwm-book.is-bound.is-spread .dwm-page.is-right { grid-column: 2; }
  :where(.layout-book:not(.is-filtering)) .dwm-book.is-bound.is-spread .dwm-page { min-height: max(var(--page-min), min(72vh, 46rem)); }
  :where(.layout-book:not(.is-filtering)) .dwm-book.is-bound.is-spread .dwm-book__spine {
    display: block; position: absolute; top: 0; bottom: 0; left: 50%; width: 3rem; transform: translateX(-50%); z-index: 3; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .14) 46%, rgba(0, 0, 0, .2) 50%, rgba(0, 0, 0, .14) 54%, transparent);
  }
}

/* Under the book: Previous | Page x of y (+ Contents) | Next. */
:where(.layout-book) .dwm-book__controls {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .5rem .75rem;
  max-width: var(--page-w); margin: 1.5rem auto 0;
}
:where(.layout-book) .dwm-book__btn {
  justify-self: start; min-height: 2.75rem; min-width: 2.75rem; padding: 0 .875rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .25rem;
  border: 1.5px solid var(--line-strong); border-radius: 8px; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: .9375rem; white-space: nowrap;
}
:where(.layout-book) .dwm-book__btn--next { justify-self: end; }
:where(.layout-book) .dwm-book__btn:disabled { opacity: .35; cursor: default; }
:where(.layout-book) .dwm-book__where { display: grid; justify-items: center; min-width: 0; }
:where(.layout-book) .dwm-book__status { min-width: 0; text-align: center; font-size: .9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
:where(.layout-book) .dwm-book__contents {
  min-height: 2.5rem; padding: 0 .75rem; font-size: .875rem; color: var(--ink);
  text-decoration: underline; text-underline-offset: .2em;
}
@media (max-width: 21.24rem) {
  :where(.layout-book) .dwm-book__btn-label { display: none; }
}

/* The turn. menu.js marks the leaf that leaves (.is-leaf.is-lifting), the one
   that arrives (.is-leaf.is-landing), the page being uncovered (.is-under) and
   the one being covered (.is-covered). One card: the leaf swings on its left
   edge until it is edge-on, as the old booklet did. A spread: the right page
   lifts over the spine and its back, the next left page, lands. */
:where(.layout-book) .dwm-book.is-bound .dwm-page.is-leaf {
  z-index: 4; pointer-events: none;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .dwm-book.is-turning .dwm-page.is-leaf {
    will-change: transform; transform-origin: left center;
    animation: dwm-leaf-out var(--turn-ms) var(--turn-lift) both;
  }
  .dwm-book.is-turning .dwm-page.is-leaf.is-landing { animation-name: dwm-leaf-in; animation-timing-function: var(--turn-land); }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf { animation-timing-function: var(--turn-ease); }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf.is-right.is-lifting { animation-name: dwm-leaf-r-out; }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf.is-right.is-landing { animation-name: dwm-leaf-r-in; }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf.is-left { transform-origin: right center; }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf.is-left.is-lifting { animation-name: dwm-leaf-l-out; }
  .dwm-book.is-turning.is-spread .dwm-page.is-leaf.is-left.is-landing { animation-name: dwm-leaf-l-in; }

  /* The shadow that moves with the turn. */
  .dwm-book.is-turning .dwm-page:where(.is-leaf, .is-under, .is-covered) > .dwm-page__shade {
    display: block; position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
    background: linear-gradient(90deg, var(--leaf-shade), rgba(0, 0, 0, 0) 70%);
    animation: dwm-shade-out var(--turn-ms) linear both;
  }
  .dwm-book.is-turning .dwm-page.is-leaf > .dwm-page__shade { background: linear-gradient(90deg, rgba(0, 0, 0, 0) 25%, var(--leaf-shade)); }
  .dwm-book.is-turning .dwm-page:where(.is-lifting, .is-covered) > .dwm-page__shade { animation-name: dwm-shade-in; }
  .dwm-book.is-turning.is-spread .dwm-page.is-left > .dwm-page__shade { transform: scaleX(-1); }

  /* The corner peel springs back in after each turn (and on load). */
  .dwm-book.is-bound:not(.is-turning) .dwm-book__edge { animation: dwm-peel .3s cubic-bezier(.34, 1.56, .64, 1) .2s backwards; }
}
@keyframes dwm-leaf-out { from { transform: rotateY(0deg); } to { transform: rotateY(-90deg); } }
@keyframes dwm-leaf-in { from { transform: rotateY(-90deg); } to { transform: rotateY(0deg); } }
@keyframes dwm-leaf-r-out { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
@keyframes dwm-leaf-r-in { from { transform: rotateY(-180deg); } to { transform: rotateY(0deg); } }
@keyframes dwm-leaf-l-out { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
@keyframes dwm-leaf-l-in { from { transform: rotateY(180deg); } to { transform: rotateY(0deg); } }
@keyframes dwm-shade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dwm-shade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dwm-peel { from { opacity: 0; scale: 0; } to { opacity: 1; scale: 1; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
:where(.dwm) .dwm-footer {
  max-width: var(--page-max); margin: var(--section-gap) auto 0;
  padding: 2rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: .5rem; text-align: center;
  color: var(--muted); font-size: .9375rem;
}
/* Social links: one row of round icon buttons, always visible (also in book layouts). */
:where(.dwm) .dwm-social { display: flex; flex-wrap: wrap; justify-content: center; gap: .625rem; list-style: none; margin: .875rem 0 0; padding: 0; }
:where(.dwm) .dwm-social__link { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink); }
:where(.dwm) .dwm-social__link:hover { background: var(--ink); color: var(--bg); }
:where(.dwm) .dwm-footer__name { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
:where(.dwm) .dwm-footer .dwm-contact { display: grid; gap: .125rem; }
/* The phone link is a tap-to-call target: >= 40px tall wherever it appears. */
:where(.dwm) a.dwm-contact__phone {
  display: inline-flex; align-items: center; justify-content: center; justify-self: center;
  min-height: 2.5rem; padding-inline: .5rem;
}
:where(.dwm) .dwm-footer__qr { width: 6.5rem; height: 6.5rem; margin-top: .75rem; padding: .375rem; background: #fff; border-radius: var(--radius-sm); }
:where(.dwm) .dwm-footer__credit { font-size: .8125rem; margin-top: .5rem; }
/* The owner's tax note, also on a view-only menu (no cart or bill to carry it). */
:where(.dwm) .dwm-footer__taxnote { margin: .75rem 0 0; font-size: .8125rem; color: var(--muted); text-align: center; }

/* ── Buttons, form fields ───────────────────────────────────────────────── */
:where(.dwm) .dwm-btn {
  min-height: 3rem; padding: 0 1.25rem; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--btn-radius); font-weight: 600; text-align: center;
}
:where(.dwm) .dwm-btn--primary { background: var(--accent); color: var(--accent-ink); }
:where(.dwm) .dwm-btn--ghost { border: 1px solid var(--line-strong); color: var(--ink); width: auto; }
:where(.dwm) .dwm-btn:disabled { opacity: .6; cursor: progress; }
:where(.dwm) .dwm-close {
  flex: none; width: var(--ctl-h); height: var(--ctl-h); display: grid; place-items: center;
  border-radius: 50%; color: var(--ink);
}
:where(.dwm) .dwm-field { display: grid; gap: .375rem; }
:where(.dwm) .dwm-field > label { font-size: .875rem; font-weight: 600; }
:where(.dwm) .dwm-field__hint { font-weight: 400; color: var(--muted); }
:where(.dwm) .dwm-field :where(input, select) {
  width: 100%; min-height: 3rem; padding: 0 .875rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 1rem;
}
:where(.dwm) .dwm-field :where(input, select)[aria-invalid="true"] { border-color: var(--warn-ink); }
:where(.dwm) .dwm-field select:disabled { opacity: 1; color: var(--ink); }
:where(.dwm) .dwm-form__error {
  padding: .625rem .75rem; background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); border-radius: var(--radius-sm); font-size: .9375rem;
}
:where(.dwm) .dwm-field__note { font-size: .8125rem; line-height: 1.35; color: var(--muted); }
/* A page opened from a table's link: the table is plain text, not a field. */
:where(.dwm) .dwm-table-fixed {
  display: flex; align-items: baseline; gap: .5rem; padding: .75rem .875rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .9375rem;
}
:where(.dwm) .dwm-table-fixed__label { color: var(--muted); }
:where(.dwm) .dwm-table-fixed__value { font-weight: 700; }
/* "Prices include taxes." / "Taxes and charges are extra." under a total. */
:where(.dwm) .dwm-taxnote { margin-top: -.5rem; font-size: .8125rem; color: var(--muted); text-align: right; }

/* ── Dialogs: sheet (dish), drawer (order), tracker ─────────────────────── */
.dwm-dialog {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.dwm-dialog:not([open]) { display: none; }
/* ::backdrop does not inherit custom properties in older browsers (Safari
   < 17.4, Chrome < 122, Firefox < 120): a solid colour first, then the token
   with the same colour as its var() fallback so an unresolved --scrim can
   never compute to a transparent scrim. */
.dwm-dialog::backdrop { background: rgba(12, 10, 8, .6); background: var(--scrim, rgba(12, 10, 8, .6)); }
/* showModal() is missing on very old browsers: the dialog draws its own scrim. */
.dwm-dialog.is-fallback { background: var(--scrim); z-index: 60; }
:where(.dwm) .dwm-dialog__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92%; max-height: min(92dvh, 100%);
  display: flex; flex-direction: column;
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
:where(.dwm) .dwm-dialog__head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem .75rem .75rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
:where(.dwm) .dwm-dialog__title { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.2; outline: none; }
:where(.dwm) .dwm-dialog__body { padding: 1rem 1.25rem 1.5rem; display: grid; gap: 1rem; }

:where(.dwm) .dwm-sheet .dwm-close { position: absolute; top: .5rem; right: .5rem; z-index: 3; background: var(--surface-2); }
:where(.dwm) .dwm-sheet__media { aspect-ratio: 16 / 10; background: var(--line); flex: none; }
:where(.dwm) .dwm-sheet__img { width: 100%; height: 100%; object-fit: cover; }
:where(.dwm) .dwm-sheet__body { padding: 1.5rem 1.25rem 1.25rem; display: grid; gap: .625rem; }
:where(.dwm) .dwm-sheet__cat { color: var(--muted); font-size: .875rem; padding-right: 3rem; }
:where(.dwm) .dwm-sheet__name { font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); line-height: 1.15; outline: none; padding-right: 2.5rem; text-wrap: balance; }
:where(.dwm) .dwm-sheet__diet { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
:where(.dwm) .dwm-sheet__desc { color: var(--muted); max-width: 60ch; }
:where(.dwm) .dwm-sheet__desc:empty { display: none; }
/* Dish details: spice, ingredients, and allergens (which must stand out). */
:where(.dwm) .dwm-sheet__facts { display: grid; gap: .625rem; }
:where(.dwm) .dwm-sheet__fact { display: grid; gap: .125rem; font-size: .9375rem; }
:where(.dwm) .dwm-sheet__fact > dt { font-size: .8125rem; font-weight: 700; color: var(--muted); }
:where(.dwm) .dwm-sheet__fact > dd { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
:where(.dwm) .dwm-sheet__fact--allergens {
  padding: .625rem .75rem; background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); border-radius: var(--radius-sm); font-weight: 600;
}
:where(.dwm) .dwm-sheet__fact--allergens > dt { color: inherit; }
:where(.dwm) .dwm-sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; }
:where(.dwm) .dwm-sheet__price { font-size: 1.375rem; }
/* The sheet's Add is a primary button. Deliberately ONE class stronger than a
   theme's `.theme-x .dwm-add__btn`, so a row-button restyle cannot leave it
   unreadable; restyle it with `.theme-x .dwm-sheet .dwm-add__btn`. */
.dwm .dwm-sheet .dwm-add__btn { background: var(--accent); color: var(--accent-ink); border-color: transparent; min-height: 3rem; padding: 0 1.25rem; }
.dwm .dwm-sheet .dwm-add__plus { color: inherit; }
/* A dish sold in sizes (Half / Full ...): one row per size, each with its own Add. */
:where(.dwm) .dwm-from { font-weight: 500; color: var(--muted); margin-right: .2em; }
:where(.dwm) .dwm-sheet__sizes { list-style: none; margin: 0; padding: 0; display: grid; }
:where(.dwm) .dwm-size { display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; padding: .375rem 0; border-top: 1px solid var(--line); }
:where(.dwm) .dwm-size__name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
:where(.dwm) .dwm-size__price { flex: none; }

:where(.dwm) .dwm-cart__empty { color: var(--muted); padding: 1rem 0; text-align: center; }
:where(.dwm) .dwm-cart__lines { display: grid; }
:where(.dwm) .dwm-line { display: grid; gap: .5rem; padding: .875rem 0; border-bottom: 1px solid var(--line); }
:where(.dwm) .dwm-line__row { display: flex; align-items: center; gap: .75rem; }
:where(.dwm) .dwm-line__info { flex: 1; min-width: 0; }
:where(.dwm) .dwm-line__name { font-weight: 600; }
:where(.dwm) .dwm-line__price { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-line__notes {
  width: 100%; min-height: 2.5rem; padding: 0 .75rem; font-size: 1rem;
  background: transparent; color: var(--ink); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
}
:where(.dwm) .dwm-line__notes::placeholder { color: var(--muted); opacity: 1; }
:where(.dwm) .dwm-cart__sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-form { display: grid; gap: .875rem; padding-top: .5rem; }
:where(.dwm) .dwm-form__title { font-family: var(--font-display); font-size: 1.125rem; }

:where(.dwm) .dwm-tracker__lede { color: var(--muted); }
:where(.dwm) .dwm-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .375rem; counter-reset: step; }
:where(.dwm) .dwm-steps__step {
  position: relative; padding-top: .75rem; font-size: .8125rem; color: var(--muted); text-align: center;
  border-top: 3px solid var(--line-strong);
}
:where(.dwm) .dwm-steps__step.is-done,
:where(.dwm) .dwm-steps__step.is-current { border-top-color: var(--ok); color: var(--ink); }
:where(.dwm) .dwm-steps__step.is-current { font-weight: 700; }
/* Cancelled beats every step state. menu.js removes .is-done / .is-current
   from the steps when it adds .is-cancelled, and this rule is one class
   stronger than a theme's `.theme-x .dwm-steps__step.is-done`. Restyle it with
   `.theme-x .dwm-steps.is-cancelled .dwm-steps__step`. */
.dwm .dwm-steps.is-cancelled .dwm-steps__step { border-top-color: var(--warn-line); color: var(--muted); font-weight: 400; }
:where(.dwm) .dwm-summary { display: grid; gap: .5rem; }
:where(.dwm) .dwm-summary > div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
:where(.dwm) .dwm-summary dt { color: var(--muted); }
:where(.dwm) .dwm-summary dd { text-align: right; font-weight: 600; min-width: 0; }
:where(.dwm) .dwm-summary__total { padding-top: .5rem; border-top: 1px solid var(--line); font-size: 1.125rem; }
:where(.dwm) .dwm-status {
  display: inline-block; padding: .125rem .625rem; border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  font-size: .8125rem;
}
:where(.dwm) .dwm-status[data-status="paid"],
:where(.dwm) .dwm-status[data-status="ready"],
:where(.dwm) .dwm-status[data-status="served"] { color: var(--ok); border-color: currentColor; }
:where(.dwm) .dwm-status[data-status="cancelled"],
:where(.dwm) .dwm-status[data-status="rejected"] { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-line); }
:where(.dwm) .dwm-tracker__lines { display: grid; gap: .375rem; color: var(--muted); font-size: .9375rem; }
:where(.dwm) .dwm-tracker__lines > li { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
/* A line of the bill someone at the table has already paid for. */
:where(.dwm) .dwm-tracker__lines > li.is-paid { opacity: .65; }
:where(.dwm) .dwm-pay { display: grid; gap: .375rem; }
:where(.dwm) .dwm-pay__note { font-size: .8125rem; color: var(--muted); text-align: center; }
/* Cancel window in the tracker: the button with its countdown, then one confirmation. */
:where(.dwm) .dwm-cancel { display: grid; gap: .5rem; }
:where(.dwm) .dwm-cancel__ask { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem; }
:where(.dwm) .dwm-cancel__ask .dwm-btn { flex: 1 1 11rem; width: auto; }
:where(.dwm) .dwm-cancel__left { flex: none; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-cancel__confirm { display: grid; gap: .5rem; padding: .75rem; border: 1px solid var(--warn-line); border-radius: var(--radius); }
:where(.dwm) .dwm-cancel__q { font-weight: 600; outline: none; }
:where(.dwm) .dwm-cancel__msg { font-size: .9375rem; font-weight: 600; text-align: center; }
:where(.dwm) .dwm-cancel__msg:empty { display: none; }
:where(.dwm) .dwm-call__choices { display: grid; gap: .5rem; }
:where(.dwm) .dwm-tracker .dwm-btn--ghost { width: 100%; }

/* Checkout on an open bill: a note stands in for the name / phone fields.
   The details wrapper is layout-neutral so the form's own gap still applies. */
:where(.dwm) .dwm-form__details { display: contents; }
:where(.dwm) .dwm-form__tab {
  display: grid; gap: .125rem; padding: .75rem .875rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: .9375rem;
}
:where(.dwm) .dwm-form__tab-text { font-weight: 600; }
:where(.dwm) .dwm-link {
  justify-self: start; min-height: 2.5rem; padding: 0 .25rem; margin-left: -.25rem;
  display: inline-flex; align-items: center;
  color: var(--accent-text); font-size: .875rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: .2em;
}

/* The table's bill (dialog.dwm-tracker.dwm-bill): one block per round. */
:where(.dwm) .dwm-bill__rounds { display: grid; gap: .75rem; }
:where(.dwm) .dwm-bill__rounds:empty { display: none; }
:where(.dwm) .dwm-bill__round {
  display: grid; gap: .5rem; padding: .875rem; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
}
:where(.dwm) .dwm-bill__head,
:where(.dwm) .dwm-bill__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .375rem .75rem;
}
:where(.dwm) .dwm-bill__title { font-family: var(--font-display); font-size: 1.0625rem; line-height: 1.25; }
:where(.dwm) .dwm-bill__time {
  margin-left: .5rem; font-family: var(--font-body); font-size: .8125rem; font-weight: 400;
  color: var(--muted); white-space: nowrap;
}
:where(.dwm) .dwm-bill .dwm-status { text-transform: none; }
:where(.dwm) .dwm-bill__amount { margin-right: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-bill__round.is-cancelled .dwm-bill__amount { font-weight: 400; color: var(--muted); text-decoration: line-through; }
:where(.dwm) .dwm-bill__void { font-size: .8125rem; color: var(--muted); }
:where(.dwm) .dwm-bill__pay { flex: 1 1 100%; min-height: 2.75rem; }
:where(.dwm) .dwm-bill__payments { font-size: .875rem; }
/* Split helper: a people stepper and the share, on one wrapping row. */
:where(.dwm) .dwm-split { display: block; border-radius: var(--radius); }
:where(.dwm) .dwm-split[open] { display: grid; gap: .5rem; padding: .875rem; border: 1px dashed var(--line-strong); }
/* Closed, it is one quiet line the guest can tap; open, it is the calculator. */
:where(.dwm) .dwm-split__title { display: flex; align-items: center; justify-content: center; gap: .375rem; min-height: 2.75rem; cursor: pointer; font-weight: 600; font-size: .9375rem; line-height: 1.25; text-decoration: underline; text-underline-offset: .2em; list-style: none; }
:where(.dwm) .dwm-split__title::-webkit-details-marker { display: none; }
:where(.dwm) .dwm-split__title::after { content: '+'; text-decoration: none; display: inline-block; font-weight: 400; }
:where(.dwm) .dwm-split[open] > .dwm-split__title { justify-content: space-between; min-height: 0; text-decoration: none; font-family: var(--font-display); font-size: 1.0625rem; }
:where(.dwm) .dwm-split[open] > .dwm-split__title::after { content: '\2212'; }
:where(.dwm) .dwm-split__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; }
:where(.dwm) .dwm-split__each { flex: 1 1 9rem; min-width: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
:where(.dwm) .dwm-split .dwm-step:disabled { opacity: .45; cursor: default; }
:where(.dwm) .dwm-split__hint { text-align: left; }
:where(.dwm) .dwm-bill__actions { display: grid; gap: .625rem; }
:where(.dwm) .dwm-bill__requested { color: var(--ok); font-size: .9375rem; font-weight: 600; text-align: center; }
:where(.dwm) .dwm-bill__requested:empty { display: none; }

@media (min-width: 45rem) {
  :where(.dwm) .dwm-sheet .dwm-dialog__panel,
  :where(.dwm) .dwm-tracker .dwm-dialog__panel {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: min(34rem, 100% - 3rem); max-height: min(88vh, 100% - 3rem);
    border-radius: var(--radius-lg); padding-bottom: 0;
  }
  :where(.dwm) .dwm-drawer .dwm-dialog__panel {
    left: auto; top: 0; bottom: 0; right: 0; width: min(27rem, 100%); max-height: none;
    border-radius: 0; padding-right: env(safe-area-inset-right, 0px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .dwm-dialog[open] .dwm-dialog__panel { animation: dwm-sheet-up .26s var(--ease) both; }
  .dwm-dialog[open]::backdrop { animation: dwm-fade .2s linear both; }
  @media (min-width: 45rem) {
    .dwm-sheet[open] .dwm-dialog__panel,
    .dwm-tracker[open] .dwm-dialog__panel { animation-name: dwm-pop; }
    .dwm-drawer[open] .dwm-dialog__panel { animation-name: dwm-drawer-in; }
  }
  .dwm-toast { animation: dwm-toast-in .2s var(--ease) both; }
}
@keyframes dwm-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes dwm-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes dwm-pop { from { opacity: 0; transform: translate(-50%, -47%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes dwm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dwm-toast-in { from { opacity: 0; transform: translateY(-.5rem); } to { opacity: 1; transform: translateY(0); } }

/* ── Cart bar ───────────────────────────────────────────────────────────── */
:where(.dwm) .dwm-cartbar {
  position: fixed; z-index: 30; left: 0; right: 0;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  padding: 0 max(.75rem, env(safe-area-inset-left, 0px)) 0 max(.75rem, env(safe-area-inset-right, 0px));
  display: flex; justify-content: center; pointer-events: none;
}
:where(.dwm) .dwm-cartbar__btn {
  pointer-events: auto; width: min(100%, 30rem); min-height: 3.5rem; padding: 0 1.25rem;
  display: flex; align-items: center; gap: .625rem;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--btn-radius); box-shadow: var(--shadow-lg);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
:where(.dwm) .dwm-cartbar__total { padding-left: .625rem; border-left: 1px solid currentColor; }
:where(.dwm) .dwm-cartbar__cta { margin-left: auto; }

/* ── Table bill: the bar ────────────────────────────────────────────────── */
/* A quiet pill directly above the cart bar (or in its place while the cart is
   empty). Styled from the same tokens as the dock, so it belongs to every
   theme without theme rules. */
:where(.dwm) .dwm-billbar {
  position: fixed; z-index: 29; left: 0; right: 0;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  padding: 0 max(.75rem, env(safe-area-inset-left, 0px)) 0 max(.75rem, env(safe-area-inset-right, 0px));
  display: flex; justify-content: center; pointer-events: none;
}
:where(.has-cart) .dwm-billbar { bottom: calc(1.25rem + var(--cartbar-h) + env(safe-area-inset-bottom, 0px)); }
:where(.dwm) .dwm-billbar__btn {
  pointer-events: auto; max-width: min(100%, 30rem); min-height: 2.75rem; padding: .375rem 1rem;
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); box-shadow: var(--shadow);
  font-size: .875rem; line-height: 1.3; font-variant-numeric: tabular-nums; text-align: left;
}
:where(.dwm) .dwm-billbar__text { min-width: 0; }
:where(.dwm) .dwm-billbar__cta {
  flex: none; font-weight: 700; color: var(--accent-text);
  text-decoration: underline; text-underline-offset: .2em; white-space: nowrap;
}
/* The dock clears the bill bar (and bill bar + cart bar). After the has-cart
   rule on purpose: same weight, so the later one wins. */
:where(.has-bill) .dwm-tools--dock { bottom: calc(1.25rem + var(--billbar-h) + env(safe-area-inset-bottom, 0px)); }
:where(.has-bill.has-cart) .dwm-tools--dock { bottom: calc(1.75rem + var(--cartbar-h) + var(--billbar-h) + env(safe-area-inset-bottom, 0px)); }
/* …and so does the end of the page. */
.dwm.has-bill { padding-bottom: calc(var(--billbar-h) + 2rem + env(safe-area-inset-bottom, 0px)); }
.dwm.has-bill.has-cart { padding-bottom: calc(var(--cartbar-h) + var(--billbar-h) + 2.5rem + env(safe-area-inset-bottom, 0px)); }
.dwm.tools-dock.has-bill { padding-bottom: calc(var(--dock-h) + var(--billbar-h) + 2rem + env(safe-area-inset-bottom, 0px)); }
.dwm.tools-dock.has-bill.has-cart { padding-bottom: calc(var(--dock-h) + var(--cartbar-h) + var(--billbar-h) + 2.5rem + env(safe-area-inset-bottom, 0px)); }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
:where(.dwm) .dwm-toasts {
  position: fixed; z-index: 80; left: 0; right: 0;
  top: calc(.75rem + env(safe-area-inset-top, 0px));
  display: grid; justify-items: center; gap: .5rem; padding: 0 1rem; pointer-events: none;
}
:where(.dwm) .dwm-toast {
  max-width: 28rem; padding: .75rem 1rem;
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .9375rem;
}

/* ── Second names, licence lines, language, tax rows, receipt, rating ──── */
/* All from the shared tokens, so every theme carries them without theme rules. */
/* A dish's / category's name in the restaurant's own language, under the main one. */
:where(.dwm) .dwm-item__local {
  display: block; margin-top: .125rem; font-family: var(--font-body); font-size: max(.75rem, .82em);
  font-weight: 400; line-height: 1.35; color: var(--muted); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere;
}
:where(.dwm) .dwm-section__local {
  display: block; margin-top: .25rem; font-family: var(--font-body); font-size: max(.8125rem, .5em);
  font-weight: 400; line-height: 1.35; color: var(--muted); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere;
}
:where(.dwm) .dwm-sheet__local { margin-top: -.25rem; font-size: 1rem; color: var(--muted); overflow-wrap: anywhere; }
/* "FSSAI Lic. No. …" / "GSTIN …" at the bottom of the menu. */
:where(.dwm) .dwm-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .125rem .875rem;
  margin: .5rem 0 0; font-size: .75rem; color: var(--muted); text-align: center; overflow-wrap: anywhere;
}
/* Interface language: a small globe + picker in the page bar. */
:where(.dwm) .dwm-lang {
  display: inline-flex; align-items: center; gap: .125rem; min-height: var(--ctl-h); padding: 0 .25rem 0 .625rem;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); color: var(--ink);
}
:where(.dwm) .dwm-lang__select {
  min-height: 2.5rem; max-width: 7.5rem; padding: 0 .25rem; border: 0; background: transparent;
  font-size: .875rem; font-weight: 600; cursor: pointer;
}
:where(.dwm) .dwm-lang__select option { color: #1b1a18; background: #ffffff; }
/* Subtotal / Tax (N%) / Total in the cart (the tracker and the bill reuse dl.dwm-summary). */
:where(.dwm) .dwm-totals { font-variant-numeric: tabular-nums; }
/* "Share receipt", then (when the phone has no share sheet) "Open in WhatsApp". */
:where(.dwm) .dwm-receipt { display: grid; gap: .5rem; }
:where(.dwm) a.dwm-btn { text-decoration: none; }
/* "How was it?": five stars and an optional comment. */
:where(.dwm) .dwm-rate { display: grid; gap: .75rem; }
:where(.dwm) .dwm-rate__q { font-family: var(--font-display); font-size: 1.125rem; text-align: center; }
:where(.dwm) .dwm-rate__stars { display: flex; justify-content: center; gap: .125rem; }
:where(.dwm) .dwm-rate__star {
  width: 3rem; height: 3rem; min-width: 2.5rem; display: grid; place-items: center;
  color: var(--muted); border-radius: 50%;
}
:where(.dwm) .dwm-rate__star.is-on { color: var(--accent-text); }
:where(.dwm) .dwm-rate__star.is-on svg { fill: currentColor; }
:where(.dwm) .dwm-rate__comment {
  width: 100%; min-height: 4.5rem; padding: .625rem .875rem; resize: vertical;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 1rem;
}
:where(.dwm) .dwm-rate__comment::placeholder { color: var(--muted); opacity: 1; }

/* ── Print: the flat menu, no chrome ────────────────────────────────────── */
@media print {
  .dwm-tools, .dwm-nav, .dwm-sound, .dwm-cartbar, .dwm-billbar, .dwm-pagebar, .dwm-toasts, .dwm-add, .dwm-book__controls, .dwm-skip { display: none !important; }
  .dwm.tools-dock { padding-bottom: 0; }
}
