/* ==========================================================================
   MesaAI design system
   Hand-authored, no build step. Tokens first, then components.

   Dark-first by design: #FE752F on near-black, C0C2B8 for muted text,
   white for emphasis. A full light theme ships alongside it, chosen
   explicitly with [data-theme] or followed from the OS preference.

   Tenants override --brand / --brand-text per restaurant on their own
   public pages; see tenant_theme_css() in app/view.php.
   ========================================================================== */

/* ── Self-hosted Poppins (no CDN, no external request) ─────────── */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}

:root {
  /* Surfaces — warm near-black, layered rather than bordered */
  --bg:              #0e0e0c;
  --surface:         #171714;
  --surface-raised:  #1f1f1b;
  --surface-sunken:  #121210;

  /* Lines */
  --border:          #26261f;
  --border-strong:   #3a3a30;

  /* Type */
  --text:            #ffffff;
  --text-muted:      #c0c2b8;
  --text-subtle:     #7e8076;

  /* Brand — this orange carries every primary action.
     Three tokens, because one colour cannot do all three jobs:
       --brand      the fill (buttons, active nav, bars)
       --brand-text brand-coloured *text* on the page background
       --on-brand   text sitting on top of a brand fill
     #FE752F against white is only 2.7:1, so light mode darkens
     --brand-text rather than shipping unreadable links. */
  --brand:           #fe752f;
  --brand-text:      #fe752f;
  --brand-hover:     #ff8b4f;
  --brand-soft:      rgba(254, 117, 47, 0.14);
  --brand-border:    rgba(254, 117, 47, 0.4);
  --on-brand:        #1a0c03;   /* 6.9:1 on the brand fill */

  /* State — monochrome on purpose.
     Green/amber/red state colours put four more hues next to the brand
     orange and make the dashboard read like a status console. Emphasis
     here comes from value and weight instead: a critical thing is the
     brightest and carries a solid rule, a positive one is quiet. The only
     hue in the product is the brand. */
  --positive:        #d9dbd1;
  --positive-soft:   rgba(255, 255, 255, 0.06);
  --warning:         #ffffff;
  --warning-soft:    rgba(255, 255, 255, 0.09);
  --critical:        #ffffff;
  --critical-soft:   rgba(255, 255, 255, 0.13);
  --info:            #c0c2b8;
  --info-soft:       rgba(255, 255, 255, 0.05);

  /* The rule down the left of a banner, by weight of the message. */
  --rule-quiet:      var(--border-strong);
  --rule-loud:       var(--text);

  /* Radii — generous, matching the design system's soft cards */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Shadows — on dark, depth comes from lift plus a brand glow */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.75);
  --glow:      0 0 0 3px rgba(254, 117, 47, 0.22);

  /* Spacing — 4px scale */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;  --s-12: 48px;

  /* Type */
  --font-sans: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  --t-xs: 11px;  --t-sm: 12px;  --t-md: 13px;
  --t-base: 14px; --t-lg: 16px; --t-xl: 20px;  --t-2xl: 26px;

  --nav-width: 236px;
  --header-height: 60px;
}

/* ── Light theme ─────────────────────────────────────────────
   Defined once and applied from two places: an explicit
   [data-theme="light"] choice, and prefers-color-scheme for people who
   have never touched the toggle. The dark palette above stays the
   default so an unset preference gets the brand's own look. */

:root[data-theme='light'] {
  --bg:              #f6f6f4;
  --surface:         #ffffff;
  --surface-raised:  #ffffff;
  --surface-sunken:  #fafaf8;

  --border:          #e6e5e0;
  --border-strong:   #cdccc4;

  --text:            #16150f;
  --text-muted:      #5d5c54;
  --text-subtle:     #8b8a80;

  --brand:           #fe752f;
  --brand-text:      #c2490f;   /* 4.8:1 on white — the fill is not */
  --brand-hover:     #ef6317;
  --brand-soft:      rgba(254, 117, 47, 0.12);
  --brand-border:    rgba(254, 117, 47, 0.45);
  --on-brand:        #1a0c03;

  --rule-quiet:      var(--border-strong);
  --rule-loud:       var(--text);

  --positive:        #45443c;
  --positive-soft:   rgba(22, 21, 15, 0.045);
  --warning:         #16150f;
  --warning-soft:    rgba(22, 21, 15, 0.07);
  --critical:        #16150f;
  --critical-soft:   rgba(22, 21, 15, 0.1);
  --info:            #5d5c54;
  --info-soft:       rgba(22, 21, 15, 0.04);

  --shadow-xs: 0 1px 2px rgba(22, 21, 15, 0.05);
  --shadow-sm: 0 1px 3px rgba(22, 21, 15, 0.08);
  --shadow-md: 0 4px 14px rgba(22, 21, 15, 0.1);
  --shadow-lg: 0 18px 40px -12px rgba(22, 21, 15, 0.22);
  --glow:      0 0 0 3px rgba(254, 117, 47, 0.25);
}

/* Same palette for an unset preference on a light system. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']):not([data-theme='light']) {
    --bg:              #f6f6f4;
    --surface:         #ffffff;
    --surface-raised:  #ffffff;
    --surface-sunken:  #fafaf8;
    --border:          #e6e5e0;
    --border-strong:   #cdccc4;
    --text:            #16150f;
    --text-muted:      #5d5c54;
    --text-subtle:     #8b8a80;
    --brand-text:      #c2490f;
    --brand-hover:     #ef6317;
    --brand-soft:      rgba(254, 117, 47, 0.12);
    --brand-border:    rgba(254, 117, 47, 0.45);
    --positive:        #45443c;
    --positive-soft:   rgba(22, 21, 15, 0.045);
    --warning:         #16150f;
    --warning-soft:    rgba(22, 21, 15, 0.07);
    --critical:        #16150f;
    --critical-soft:   rgba(22, 21, 15, 0.1);
    --info:            #5d5c54;
    --info-soft:       rgba(22, 21, 15, 0.04);
    --shadow-xs: 0 1px 2px rgba(22, 21, 15, 0.05);
    --shadow-sm: 0 1px 3px rgba(22, 21, 15, 0.08);
    --shadow-md: 0 4px 14px rgba(22, 21, 15, 0.1);
    --shadow-lg: 0 18px 40px -12px rgba(22, 21, 15, 0.22);
  }
}

/* Light mode needs real hairlines rather than layered darkness. */
:root[data-theme='light'] .stat,
:root[data-theme='light'] .card,
:root[data-theme='light'] .category { box-shadow: var(--shadow-xs); }

/* ── Reset ───────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* The browser's own [hidden] rule is `display: none`, but any author
   rule setting display (`.banner { display: flex }`) beats it — so an
   element with hidden stays on screen. Every `hidden` toggle in the app
   depends on this one line. */
[hidden] { display: none !important; }

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--brand); color: var(--on-brand); }

/* ── Brand mark ──────────────────────────────────────────────── */

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-lockup:hover { text-decoration: none; }

/* The dzn hawk. It is drawn with fill="currentColor", so colour is
   inherited — no separate asset per theme. */
.brand-hawk {
  width: 40px;
  height: auto;
  color: var(--brand);
  flex-shrink: 0;
}
.brand-hawk--sm { width: 30px; }
.brand-hawk--lg { width: 64px; }

.brand-word {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand-word em { font-style: normal; color: var(--brand-text); }
.brand-word--lg { font-size: 30px; }

/* ── Layout ──────────────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

.nav-rail {
  width: var(--nav-width);
  flex: 0 0 var(--nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.nav-group { padding: var(--s-3) var(--s-2); }
.nav-group + .nav-group { border-top: 1px solid var(--border); }

.nav-group__label {
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 0 var(--s-2) var(--s-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px var(--s-3);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--surface-raised); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.nav-item.is-active svg { color: var(--on-brand); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-footer { margin-top: auto; padding: var(--s-3); border-top: 1px solid var(--border); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.page { padding: var(--s-6); max-width: 1200px; width: 100%; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}

.page-header__title {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-family: var(--font-display);
}

.page-header__subtitle { color: var(--text-muted); font-size: var(--t-md); margin-top: 3px; }
.page-header__actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease,
              box-shadow 0.14s ease, transform 0.08s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: var(--glow);
}

.btn--secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--secondary:hover:not(:disabled) { background: var(--surface); border-color: var(--brand-border); }

.btn--plain { background: transparent; color: var(--text-muted); }
.btn--plain:hover:not(:disabled) { background: var(--surface-raised); color: var(--text); }

/* Inverted, not red: the strongest thing on a monochrome page is a solid
   block of the text colour. */
.btn--critical { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--critical:hover:not(:disabled) { opacity: 0.88; }

.btn--sm { padding: 5px 11px; font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn--lg { padding: 12px 22px; font-size: var(--t-base); border-radius: var(--r-lg); }
.btn--block { width: 100%; }

/* ── Card ────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.card__header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.card__title { font-size: var(--t-base); font-weight: 600; }
.card__body { padding: var(--s-5); }
.card__footer {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ── Stat tiles ──────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: border-color 0.14s ease;
}
.stat:hover { border-color: var(--border-strong); }
.stat__label {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--s-2);
}
.stat__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat--accent .stat__value { color: var(--brand-text); }
.stat__delta { font-size: var(--t-sm); margin-top: var(--s-1); }
.stat__delta--up { color: var(--text); }
.stat__delta--down { color: var(--text-subtle); }

/* ── Resource list ───────────────────────────────────────────── */

.resource-list { border-radius: var(--r-xl); overflow: hidden; }

.resource-item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.resource-item:last-child { border-bottom: 0; }
.resource-item:hover { background: var(--surface-raised); }

.resource-item__main { flex: 1; min-width: 0; }
.resource-item__title { font-weight: 500; }
.resource-item__meta { font-size: var(--t-sm); color: var(--text-muted); }
.resource-item__actions { display: flex; gap: var(--s-1); }

/* ── Table ───────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.data-table th {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-raised); }
.data-table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Badge ───────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 500;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--brand    { background: var(--brand); color: var(--on-brand); border-color: transparent; font-weight: 600; }
/* With no hue to carry the meaning, the ladder is fill and weight: info is
   the plain chip, positive outlines, warning fills, and critical inverts —
   the only badge on the page that reads as a block of ink. */
.badge--positive { background: transparent; color: var(--text); border-color: var(--border-strong); }
.badge--warning  { background: var(--warning-soft); color: var(--text); border-color: var(--border-strong); font-weight: 600; }
.badge--critical { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }
.badge--info     { background: var(--info-soft); color: var(--text-muted); border-color: var(--border); }

/* ── Banner ──────────────────────────────────────────────────── */

.banner {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: var(--s-4);
  font-size: var(--t-md);
  color: var(--text-muted);
}
.banner__content { flex: 1; }
.banner__title { font-weight: 600; margin-bottom: 3px; color: var(--text); }

/* A rule down the left edge, weighted by how much the message matters.
   Colour is doing no work here, so the rule and the fill do it instead. */
.banner--success,
.banner--warning,
.banner--critical,
.banner--info { border-left-width: 3px; }

.banner--info     { background: var(--info-soft);     border-left-color: var(--rule-quiet); }
.banner--success  { background: var(--positive-soft); border-left-color: var(--rule-quiet); }
.banner--warning  { background: var(--warning-soft);  border-left-color: var(--text-subtle); }
.banner--critical { background: var(--critical-soft); border-left-color: var(--rule-loud); }
.banner--critical .banner__title { color: var(--text); }

/* ── Forms ───────────────────────────────────────────────────── */

.form-layout { display: grid; gap: var(--s-4); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-4); }

.field { display: grid; gap: 6px; align-content: start; }
/* Fields in a .form-row stretch to the tallest one; without this the grid
   distributes that extra height between label and input, so a field with a
   hint under it pushes its neighbour's input out of line. */
.field__label { font-size: var(--t-md); font-weight: 500; }
.field__hint  { font-size: var(--t-sm); color: var(--text-muted); }
.field__error { font-size: var(--t-sm); color: var(--critical); }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text);
  font-size: var(--t-base);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--glow);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.textarea { min-height: 88px; resize: vertical; }
.input[readonly] { color: var(--text-muted); }

/* Dark form controls need explicit dark UI or the browser paints light. */
.select { color-scheme: dark; }
.input[type='date'], .input[type='time'] { color-scheme: dark; }
:root[data-theme='light'] .select,
:root[data-theme='light'] .input[type='date'],
:root[data-theme='light'] .input[type='time'] { color-scheme: light; }

.input-group { display: flex; }
.input-group .input { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group__addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.input-group__addon:hover { color: var(--brand-text); }

.checkbox { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-md); cursor: pointer; }
.checkbox input[type='checkbox'], .checkbox input[type='radio'] { accent-color: var(--brand); width: 15px; height: 15px; }

/* ── Empty state ─────────────────────────────────────────────── */

.empty-state { text-align: center; padding: var(--s-12) var(--s-6); }
.empty-state__icon {
  width: 40px; height: 40px;
  margin: 0 auto var(--s-4);
  color: var(--text-subtle);
}
.empty-state__title { font-size: var(--t-lg); font-weight: 600; margin-bottom: var(--s-2); }
.empty-state__body { color: var(--text-muted); max-width: 46ch; margin: 0 auto var(--s-5); }

/* ── Auth pages ──────────────────────────────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--s-6);
  background: var(--bg);
  /* A single brand bloom behind the card. Left over from an earlier lime
     palette until the monochrome pass — it was the only green in the
     product and it sat directly under the orange wordmark. */
  background-image: radial-gradient(ellipse 70% 50% at 50% 100%, var(--brand-soft), transparent 70%);
}
.auth-card { width: 100%; max-width: 410px; }
.auth-brand { text-align: center; margin-bottom: var(--s-6); }
.auth-brand__lockup { display: inline-flex; align-items: center; gap: 12px; margin-bottom: var(--s-3); }
.auth-brand__tag { color: var(--text-muted); font-size: var(--t-md); }
.auth-footer { text-align: center; margin-top: var(--s-5); font-size: var(--t-md); color: var(--text-muted); }

/* ── Public menu (the QR destination) ────────────────────────── */

.menu-page { max-width: 700px; margin: 0 auto; padding: var(--s-5) var(--s-4) var(--s-12); }

.menu-header { text-align: center; padding: var(--s-8) 0 var(--s-6); }
.menu-header__name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.menu-header__meta { color: var(--text-muted); font-size: var(--t-md); margin-top: var(--s-2); }

.menu-section { margin-bottom: var(--s-8); }
.menu-section__name {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 600;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.menu-section__name svg { width: 18px; height: 18px; color: var(--brand-text); }
.menu-section__desc { color: var(--text-muted); font-size: var(--t-md); margin: calc(-1 * var(--s-2)) 0 var(--s-4); }

.menu-item { display: flex; gap: var(--s-4); padding: var(--s-3) 0; align-items: baseline; }
.menu-item__main { flex: 1; min-width: 0; }
.menu-item__name { font-weight: 500; }
.menu-item__desc { color: var(--text-muted); font-size: var(--t-md); margin-top: 3px; }
.menu-item__price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  color: var(--brand-text);
}
.menu-item--unavailable { opacity: 0.45; }

.allergen-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.allergen-chip {
  font-size: var(--t-xs);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Allergen / diet filter bar on the public menu. */
.filter-bar {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-4) 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.filter-chip {
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}
.filter-chip:hover { border-color: var(--brand-border); color: var(--text); }
.filter-chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* Section chips scroll horizontally on a phone rather than wrapping to
   three rows and pushing the menu off screen. */
#section-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-4);
}
#section-bar::-webkit-scrollbar { display: none; }
#section-bar .filter-chip { flex: 0 0 auto; text-decoration: none; }
#section-bar .filter-chip:hover { text-decoration: none; }

.filter-chip__count {
  display: inline-block;
  margin-left: 5px;
  font-size: var(--t-xs);
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

/* Allergen filtering is a minority need, so it sits behind a disclosure
   instead of competing with the sections for the top of the page. */
.diet-filters {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: var(--s-5);
}
.diet-filters > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--text-muted);
  list-style: none;
}
.diet-filters > summary::-webkit-details-marker { display: none; }
.diet-filters > summary:hover { color: var(--text); }
.diet-filters[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
.filter-bar--static {
  position: static;
  padding: var(--s-3) var(--s-4);
  background: transparent;
}

.menu-item[hidden] { display: none; }

/* Sticky action bar at the foot of the public menu. */
.menu-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--s-2);
  padding: var(--s-4) 0;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.menu-actions .btn { flex: 1; }

/* ==========================================================================
   Menu editor — ported from the mimenu prototype.
   ========================================================================== */

.ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  vertical-align: middle;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--t-sm);
  color: var(--text-muted);
  padding: 0 var(--s-2);
  white-space: nowrap;
}
.save-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: var(--r-pill);
  background: var(--text-subtle);
}
.save-status--ok::before      { background: var(--brand); }
.save-status--pending::before { background: var(--warning); }
.save-status--error::before   { background: var(--critical); }
.save-status--error           { color: var(--critical); }

.editor-stack { display: grid; gap: var(--s-4); }

.category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.category__header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}

.category__title { min-width: 0; flex: 1; }

.cat-name {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.25;
  cursor: text;
  overflow-wrap: anywhere;
}

.cat-count { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }

.category__actions { display: flex; align-items: center; gap: 2px; }

.cat-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--brand-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.cat-icon:hover { background: var(--brand-soft); border-color: var(--brand-border); }
.cat-icon .ic { width: 18px; height: 18px; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
.btn-icon:hover { background: var(--surface-raised); color: var(--text); }
.btn-icon--danger:hover { color: var(--text); background: var(--critical-soft); }

.cat-handle, .item-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px; height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.cat-handle:active, .item-handle:active { cursor: grabbing; }
.cat-handle:hover, .item-handle:hover { color: var(--brand-text); }

.items { display: block; }

.item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-raised); }

.item__body { flex: 1; min-width: 0; }
.item__line { display: flex; align-items: baseline; gap: var(--s-2); }

.item-name {
  font-weight: 500;
  font-size: var(--t-base);
  cursor: text;
  overflow-wrap: anywhere;
}

.dotted-line {
  flex: 1;
  min-width: var(--s-4);
  border-bottom: 1px dotted var(--border-strong);
  transform: translateY(-3px);
}

.item-price {
  font-size: var(--t-md);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: text;
  color: var(--brand-text);
  font-weight: 600;
}

.item-desc {
  font-size: var(--t-md);
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
  cursor: text;
  overflow-wrap: anywhere;
}

.item__delete { opacity: 0; }
.item:hover .item__delete,
.item__delete:focus-visible { opacity: 1; }
@media (hover: none) { .item__delete { opacity: 1; } }

.add-item-btn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-3) var(--s-5);
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.add-item-btn:hover { background: var(--brand-soft); color: var(--brand-text); }

.add-category-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  margin-top: var(--s-5);
  padding: var(--s-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.add-category-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-text);
  border-color: var(--brand-border);
}

/* contenteditable affordances */

[contenteditable][data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-subtle);
  pointer-events: none;
}
[contenteditable].cat-name:empty::before  { content: 'Category name'; color: var(--text-subtle); }
[contenteditable].item-name:empty::before { content: 'Item name';     color: var(--text-subtle); }
[contenteditable].item-price:empty::before{ content: '€0';            color: var(--text-subtle); }

[contenteditable]:focus {
  outline: none;
  background: linear-gradient(transparent 55%, var(--brand-soft) 55%);
  border-radius: 3px;
}

.category.collapsed .items-wrap { display: none; }
.category.collapsed .chev { transform: rotate(180deg); }
.chev { transition: transform 0.2s ease; }

body.reorder .cat-handle,
body.reorder .item-handle { display: inline-flex; }
body.reorder [contenteditable] { pointer-events: none; user-select: none; }
body.reorder .category { border-color: var(--brand-border); }
body.reorder .item:hover { background: transparent; }

.sortable-ghost { opacity: 0.3; }
.sortable-chosen { box-shadow: var(--shadow-lg); }
.sortable-drag { cursor: grabbing !important; }
.category.sortable-chosen { border-color: var(--brand); }

/* ── Modal ───────────────────────────────────────────────────── */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.modal.open { display: flex; animation: modal-fade 160ms ease-out; }
.modal.open .modal__panel { animation: modal-pop 200ms cubic-bezier(0.2, 0.9, 0.3, 1.2); }

.modal__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; }

.modal__search { position: relative; padding: var(--s-4) var(--s-5) var(--s-2); }
.modal__search .input { padding-left: 38px; }
.modal__search-icon {
  position: absolute;
  left: calc(var(--s-5) + 12px);
  top: calc(var(--s-4) + 12px);
  color: var(--text-subtle);
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: var(--s-4);
  overflow-y: auto;
}

.icon-swatch {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 80ms ease;
}
.icon-swatch:hover { background: var(--surface-raised); color: var(--brand-text); }
.icon-swatch:active { transform: scale(0.94); }
.icon-swatch.active { background: var(--brand); color: var(--on-brand); }
.icon-swatch .ic { width: 19px; height: 19px; }

/* ── Import: dropzone and review ─────────────────────────────── */

.dropzone {
  display: block;
  padding: var(--s-12) var(--s-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--surface-sunken);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone__icon { width: 30px; height: 30px; margin: 0 auto var(--s-3); color: var(--brand-text); }
.dropzone__title { font-weight: 600; margin-bottom: var(--s-1); }
.dropzone__hint { font-size: var(--t-md); color: var(--text-muted); }
.dropzone__files {
  margin-top: var(--s-3);
  font-size: var(--t-sm);
  color: var(--brand-text);
  overflow-wrap: anywhere;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 900px) {
  .review-grid { grid-template-columns: 1fr; }
  .review-pages { position: static !important; }
}
.review-pages { position: sticky; top: var(--s-4); }

.review-page { display: block; margin-bottom: var(--s-3); text-decoration: none; }
.review-page img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.review-page__label {
  display: block;
  font-size: var(--t-sm);
  color: var(--text-muted);
  margin-top: 5px;
}

.review-section-name { font-weight: 600; max-width: 280px; }
.review-table td { vertical-align: top; }
.input--sub { font-size: var(--t-md); color: var(--text-muted); }

.review-row--low { background: var(--warning-soft); }
.review-row--low td:first-child { box-shadow: inset 3px 0 0 var(--text-subtle); }

/* ── QR page ─────────────────────────────────────────────────── */

.qr-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 860px) { .qr-layout { grid-template-columns: 1fr; } }

/* A QR must stay dark-on-light to scan reliably, whatever the theme. */
.qr-preview {
  display: inline-block;
  padding: var(--s-4);
  background: #ffffff;
  border-radius: var(--r-lg);
}
.qr-preview svg { width: 100%; max-width: 240px; height: auto; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}
/* max-width matters: with one day of data a bare flex:1 column stretches
   across the whole card and reads as a broken block, not a bar. */
.bar-chart__col {
  flex: 1 1 0;
  max-width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.bar-chart__bar {
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: opacity 0.12s ease;
}
.bar-chart__col:hover .bar-chart__bar { opacity: 0.7; }
/* Days with no scans stay visible as a baseline tick. */
.bar-chart__col.is-empty .bar-chart__bar { background: var(--border-strong); }
.bar-chart__label {
  font-size: 9px;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 5px;
  white-space: nowrap;
}

/* ── Booking widget ──────────────────────────────────────────── */

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--s-2);
}

.slot {
  padding: 12px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--t-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.12s ease;
}
.slot:hover { border-color: var(--brand); color: var(--brand-text); }
.slot.is-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

/* The dashed rule between arrival and departure, as in the design system. */
.trip-line {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-variant-numeric: tabular-nums;
}
.trip-line__rule {
  flex: 1;
  border-top: 1px dashed var(--border-strong);
  position: relative;
}
.trip-line__rule span {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  padding: 0 var(--s-2);
  font-size: var(--t-xs);
  color: var(--text-subtle);
}

/* ── Tabs ────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-5);
}
.tab {
  padding: var(--s-3) var(--s-4);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 600; }

/* ── Toast ───────────────────────────────────────────────────── */

.toast-stack {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  z-index: 60;
  display: grid;
  gap: var(--s-2);
  max-width: 340px;
}
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-lg);
  font-size: var(--t-md);
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Skeleton ────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--surface-raised) 25%, var(--border) 50%, var(--surface-raised) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Stepper ─────────────────────────────────────────────────── */

.stepper { display: flex; gap: var(--s-2); margin-bottom: var(--s-6); flex-wrap: wrap; }
.step {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--t-sm);
  color: var(--text-muted);
}
.step__num {
  width: 20px; height: 20px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  font-size: var(--t-xs);
  font-weight: 700;
}
.step.is-done { border-color: var(--brand-border); color: var(--text); }
.step.is-done .step__num { background: var(--brand); color: var(--on-brand); }
.step.is-current { border-color: var(--brand); color: var(--text); }
.step.is-current .step__num { background: var(--brand); color: var(--on-brand); }

/* ── Utilities ───────────────────────────────────────────────── */

.u-muted   { color: var(--text-muted); }
.u-subtle  { color: var(--text-subtle); }
.u-brand   { color: var(--brand-text); }
.u-sm      { font-size: var(--t-sm); }
.u-md      { font-size: var(--t-md); }
.u-lg      { font-size: var(--t-lg); }
.u-bold    { font-weight: 600; }
.u-mono    { font-family: var(--font-mono); }
.u-nowrap  { white-space: nowrap; }
.u-center  { text-align: center; }
.u-right   { text-align: right; }
.u-mt-2 { margin-top: var(--s-2); }
.u-mt-4 { margin-top: var(--s-4); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mb-2 { margin-bottom: var(--s-2); }
.u-mb-4 { margin-bottom: var(--s-4); }
.u-mb-6 { margin-bottom: var(--s-6); }
.u-flex { display: flex; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; }
.u-gap-2 { gap: var(--s-2); }
.u-gap-4 { gap: var(--s-4); }
.u-wrap { flex-wrap: wrap; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

/* ── Mobile top bar + off-canvas drawer ──────────────────────── */

/* Desktop never shows either of these. */
.mobile-bar, .nav-scrim, .nav-close { display: none; }

@media (max-width: 860px) {
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
    /* Clear of the notch on a phone held in landscape. */
    padding-left: max(var(--s-4), env(safe-area-inset-left));
    padding-right: max(var(--s-4), env(safe-area-inset-right));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-raised);
    color: var(--text);
    cursor: pointer;
  }
  .nav-toggle svg { width: 19px; height: 19px; }

  .app-shell { flex-direction: column; }

  /* The rail becomes a full-height drawer sliding in from the left. */
  .nav-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.nav-open .nav-rail { transform: translateX(0); }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
  }

  /* Bigger touch targets in the drawer than in the desktop rail. */
  .nav-item { padding: 12px var(--s-3); font-size: var(--t-base); }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-group { padding: var(--s-3); }

  .page { padding: var(--s-4); }
  .page-header { gap: var(--s-3); margin-bottom: var(--s-5); }
  .page-header__title { font-size: 22px; }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Dense tables scroll rather than squashing to unreadable columns. */
  .card__header { padding: var(--s-4); }
  .card__body   { padding: var(--s-4); }
  .data-table th, .data-table td { padding: var(--s-3); }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
  .stat { padding: var(--s-4); }
  .stat__value { font-size: 22px; }

  .form-row { grid-template-columns: 1fr; }
  .modal__panel { max-height: 88dvh; }
  .icon-grid { grid-template-columns: repeat(5, 1fr); }

  /* iOS zooms the page when a focused input is under 16px. */
  .input, .select, .textarea { font-size: 16px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-rail { transition: none; }
}

@media print {
  .nav-rail, .page-header__actions, .btn, .menu-actions, .filter-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ddd; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Branding preview (dashboard → settings) ─────────────────── */

.brand-preview {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-3);
  transition: background 0.15s ease, color 0.15s ease;
}
.brand-preview__name { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; }
.brand-preview__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: var(--t-md);
}
.brand-preview__price { font-weight: 600; font-variant-numeric: tabular-nums; }
.brand-preview__btn {
  margin-top: var(--s-2);
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--t-md);
  cursor: default;
  justify-self: start;
}

/* Settings tabs scroll horizontally on a phone rather than wrapping. */
.settings-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.settings-tabs .tab svg { width: 15px; height: 15px; }

/* ─── Website settings: photographs and template picker ───────── */

.color-swatch {
  padding: 0;
  border: 0;
  width: 42px;
  height: 100%;
  min-height: 38px;
  background: none;
  cursor: pointer;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.template-option {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.template-option:hover { border-color: var(--brand-border); }
.template-option.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-option__name { display: block; font-weight: 600; }
.template-option__blurb {
  display: block;
  font-size: var(--t-sm);
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}

/* One-image slots: the photo, what it is for, and how to change it. */
.media-slot {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.media-slot:last-of-type { border-bottom: 0; }

.media-slot__preview {
  position: relative;
  flex: 0 0 132px;
  width: 132px;
  height: 88px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.media-slot__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-slot__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
}
.media-slot__body { flex: 1 1 auto; min-width: 0; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.media-tile {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-sunken);
}
.media-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.media-tile figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 6px 10px;
  color: var(--text-muted);
}

.media-tile--add {
  display: flex;
  border-style: dashed;
}
.media-tile__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 132px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}
.media-tile__drop:hover { color: var(--brand-text); background: var(--brand-soft); }

/* Repeated fieldsets — testimonials, events. */
.repeat-row {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px 14px;
  margin: 0;
  display: grid;
  gap: 10px;
}
.repeat-row legend {
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (max-width: 560px) {
  .media-slot { flex-direction: column; }
  .media-slot__preview { width: 100%; flex-basis: auto; height: 150px; }
}

/* ─── Date stepper ────────────────────────────────────────────
   Used during service, on a phone, one-handed: the steps are 40px
   targets joined to the field rather than glyphs in small buttons. */

.date-nav {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.date-nav__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.date-nav__step:hover { background: var(--surface-raised); color: var(--text); }
.date-nav__step:focus-visible { outline: none; box-shadow: var(--glow) inset; }
.date-nav__step svg { width: 16px; height: 16px; }

.date-nav__form { display: flex; }

.date-nav__input {
  border: 0;
  border-inline: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 8px 10px;
  min-height: 40px;
}
.date-nav__input:focus { outline: none; box-shadow: var(--glow) inset; }
.date-nav__input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .55;
  filter: invert(var(--calendar-invert, 1));
}
.date-nav__input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ─── Row actions and the overflow menu ─────────────────────── */

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* The extra actions, expanded inside the table. Not a floating menu:
   .table-wrap scrolls horizontally and would clip one. */
.row-more td {
  padding: 0;
  border-top: 0;
}

.row-more__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 12px;
  background: var(--surface-sunken);
}

.row-more__note {
  margin-right: auto;
  font-size: var(--t-sm);
  color: var(--text-subtle);
}

.row-more__toggle svg { width: 15px; height: 15px; }

.btn--danger-text { color: var(--text); font-weight: 600; }
.btn--danger-text:hover { background: var(--critical-soft); color: var(--text); }

/* A cancelled or missed table is still on the sheet, but reads as spent. */
.data-table tr.is-void td:not(:last-child) { opacity: .55; }

:root[data-theme='light'] { --calendar-invert: 0; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) { --calendar-invert: 0; }
}

/* ─── Legal pages (privacy, terms) ───────────────────────────── */
/* Long-form prose rather than UI: a narrow measure and generous
   leading, because these are read rather than scanned. Google's
   OAuth reviewers open the privacy policy on a phone. */

.legal { max-width: 720px; margin: 0 auto; padding: var(--s-8) var(--s-4) var(--s-12); }

.legal__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 var(--s-2);
}

.legal__updated { color: var(--text-subtle); font-size: 14px; margin: 0 0 var(--s-8); }

.legal h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: var(--s-8) 0 var(--s-3);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}

.legal h3 { font-size: 16px; font-weight: 600; margin: var(--s-5) 0 var(--s-2); }
.legal p, .legal li { color: var(--text-muted); line-height: 1.7; }
.legal p { margin: 0 0 var(--s-4); }
.legal ul { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.legal li { margin-bottom: var(--s-2); }
.legal a { color: var(--brand-text); }
.legal strong { color: var(--text); font-weight: 600; }

/* The Limited Use statement Google looks for. Boxed so a reviewer
   skimming the page cannot miss it. */
.legal__callout {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin: 0 0 var(--s-4);
}
.legal__callout p:last-child { margin-bottom: 0; }

.legal__footer {
  margin-top: var(--s-10);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-subtle);
}
.legal__footer a { color: var(--text-muted); }

/* ─── Logo ───────────────────────────────────────────────────── */
/* Constrained by height rather than width: logos vary wildly in
   aspect, and a fixed width makes a wide wordmark tiny. */

.menu-header__logo {
  display: block;
  margin: 0 auto;
  max-height: 72px;
  max-width: min(100%, 280px);
  width: auto;
  object-fit: contain;
}

/* The logo slot has no stock photograph to fall back to, unlike the
   hero and story slots. */
.media-slot__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  color: var(--text-subtle);
  background: var(--surface-sunken);
}
