/* ============================================================================
   CrutionResto Design System v3 "Jade & Saffron" — dependency-free CSS
   ----------------------------------------------------------------------------
   Theming: every visual constant lives in a token on :root (light) with a
   [data-theme="dark"] override set. A tiny inline script in each layout stamps
   data-theme on <html> before first paint (localStorage → system preference),
   so there is never a flash of the wrong theme. Pages must never hardcode hex.

   v3 design language: jade primary + saffron accent on warm stone neutrals,
   pill-shaped controls, tonal (soft-tint) secondary variants, glassy shell
   surfaces, and soft diffuse elevation instead of hard material shadows.
   Solid buttons read their text colour from --c-on-primary so dark mode can
   run a bright jade fill with dark ink, the way current design systems do.

   Layered: 1) tokens  2) base  3) theme toggle  4) app shell  5) primitives
   (buttons, forms, cards, tables, badges, tabs, chips)  6) states & feedback
   7) overlays (modal, toast)  8) auth  9) error screens  10) POS / KDS /
   charts  11) marketing site  12) public layout  13) guest QR menu
   14) misc + responsive + accessibility.
   ========================================================================== */

/* ------------------------------------------------------------- 1. tokens --- */
:root {
  color-scheme: light;

  /* brand — jade primary, saffron accent */
  --c-primary: #0f766e;            /* links, icons, accents on surfaces */
  --c-primary-strong: #0b5d56;     /* hovered accent text */
  --c-accent: #f59e0b;             /* saffron — gradients, highlights */
  --c-blue: #2563eb;
  --c-on-primary: #ffffff;         /* text on a solid primary fill */

  /* brand gradients (jade core, jade→saffron spectrum) */
  --grad-brand: linear-gradient(135deg, #0d9488 0%, #0f766e 60%, #0b5d56 100%);
  --grad-spectrum: linear-gradient(120deg, #0d9488, #2dd4bf 45%, #f59e0b);

  /* semantic */
  --c-success: #059669;
  --c-warning: #d97706;
  --c-danger: #e11d48;
  --c-info: #2563eb;

  /* neutrals — warm stone, never pure gray */
  --c-ink: #1c1917;
  --c-muted: #57534e;
  --c-faint: #a29e97;
  --c-line: #eae7e2;
  --c-line-strong: #d9d4cd;
  --c-bg: #f6f4f0;
  --c-card: #ffffff;
  --c-field: #faf9f6;
  --c-inset: #f0eee9;              /* wells: tab tracks, code, bar tracks */
  --c-hover: #f3f1ec;

  /* sidebar */
  --sb-bg: rgba(255, 255, 255, 0.86);
  --sb-line: #eae7e2;
  --sb-ink: #57534e;
  --sb-ink-strong: #1c1917;
  --sb-hover: #f3f1ec;
  --sb-section: #a29e97;

  /* elevation — soft key + ambient pairs, no hard material edges */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05), 0 2px 10px -2px rgba(28, 25, 23, 0.07);
  --shadow: 0 2px 4px rgba(28, 25, 23, 0.05), 0 14px 32px -14px rgba(28, 25, 23, 0.16);
  --shadow-lg: 0 4px 10px rgba(28, 25, 23, 0.06), 0 28px 56px -18px rgba(28, 25, 23, 0.24);
  --glow-primary: 0 10px 26px -10px color-mix(in srgb, var(--c-primary) 55%, transparent);

  /* geometry — rounder than v2; interactive controls are pills */
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --radius-pill: 999px;

  /* type & spacing */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --fs-xs: 11.5px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 22px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 28px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 0.15s;
  --t-med: 0.3s;

  --sidebar-w: 256px;
  --topbar-h: 62px;

  /* one control height per row — every field, select and button in a row
     container resolves to these, so nothing sits 6px shorter than its neighbour */
  --control-h: 42px;
  --control-h-sm: 34px;

  /* widths for narrow, single-purpose panes */
  --pane-narrow: 640px;
  --pane-tight: 420px;

  /* ambient background strength — high enough to see in the gutters, low
     enough that it never competes with a card or its text */
  --fx-1: 13%;
  --fx-2: 9%;
  --fx-3: 11%;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* brand — bright jade fill carries dark ink in dark mode */
  --c-primary: #2dd4bf;
  --c-primary-strong: #5eead4;
  --c-accent: #fbbf24;
  --c-blue: #60a5fa;
  --c-on-primary: #062622;

  --grad-brand: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  --grad-spectrum: linear-gradient(120deg, #14b8a6, #2dd4bf 45%, #fbbf24);

  --c-success: #34d399;
  --c-warning: #fbbf24;
  --c-danger: #fb7185;
  --c-info: #60a5fa;

  /* neutrals — warm charcoal, never pure black */
  --c-ink: #f5f4f1;
  --c-muted: #b8b3ab;
  --c-faint: #7d786f;
  --c-line: #2a2723;
  --c-line-strong: #3a352f;
  --c-bg: #12100e;
  --c-card: #1b1917;
  --c-field: #201d1a;
  --c-inset: #262220;
  --c-hover: #262220;

  /* sidebar — warm glass */
  --sb-bg: rgba(20, 18, 16, 0.86);
  --sb-line: rgba(58, 53, 47, 0.6);
  --sb-ink: #b8b3ab;
  --sb-ink-strong: #f5f4f1;
  --sb-hover: rgba(38, 34, 32, 0.9);
  --sb-section: #7d786f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px -2px rgba(0, 0, 0, 0.40);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.40), 0 14px 32px -14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.45), 0 28px 56px -18px rgba(0, 0, 0, 0.65);
  --glow-primary: 0 10px 26px -10px color-mix(in srgb, var(--c-primary) 45%, transparent);

  --fx-1: 16%;
  --fx-2: 11%;
  --fx-3: 13%;
}

/* --------------------------------------------------------------- 2. base --- */
* { box-sizing: border-box; }

/* Ambient aurora — two fixed, blur-free gradient layers drifting very slowly in
   opposite directions behind every page. Cards are opaque, so this only ever
   colours the gutters: text contrast and hit targets are untouched. Motion is
   transform-only on a composited layer (no repaint), the cycles are ~1 minute so
   nothing pulls the eye during service, prefers-reduced-motion freezes it (global
   rule below) and print never sees it. */
.bg-fx {
  position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 44% at 14% 16%, color-mix(in srgb, var(--c-primary) var(--fx-1), transparent), transparent 68%),
    radial-gradient(34% 40% at 88% 10%, color-mix(in srgb, var(--c-accent) var(--fx-2), transparent), transparent 64%),
    radial-gradient(46% 52% at 62% 94%, color-mix(in srgb, var(--c-blue) var(--fx-3), transparent), transparent 66%);
  animation: bg-drift 56s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-fx::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(30% 36% at 74% 44%, color-mix(in srgb, var(--c-primary) var(--fx-2), transparent), transparent 62%),
    radial-gradient(28% 32% at 22% 72%, color-mix(in srgb, var(--c-accent) var(--fx-3), transparent), transparent 60%);
  animation: bg-drift-alt 74s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes bg-drift {
  from { transform: translate3d(-3%, -2%, 0) rotate(-2deg) scale(1); }
  to   { transform: translate3d(3%, 3%, 0) rotate(3deg) scale(1.14); }
}
@keyframes bg-drift-alt {
  from { transform: translate3d(3%, 2%, 0) rotate(2deg) scale(1.1); }
  to   { transform: translate3d(-4%, -3%, 0) rotate(-3deg) scale(1); }
}
@media print { .bg-fx { display: none !important; } }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  font-size: var(--fs-md);
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
h1, h2, h3, label { font-weight: 600; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
code {
  background: var(--c-inset); padding: 1px 6px; border-radius: 5px; font-size: 0.85em;
}
a { color: var(--c-primary); }
::selection { background: color-mix(in srgb, var(--c-primary) 24%, transparent); }
:is(button, input, select, textarea):focus-visible,
a:focus-visible, label:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--c-faint) 55%, transparent) transparent;
}

/* ------------------------------------- 3. icon buttons & theme toggle ----- */
.theme-toggle, .icon-btn {
  width: 36px; height: 36px; flex: none;
  display: inline-grid; place-items: center;
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-pill);
  background: transparent; color: var(--c-muted); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover, .icon-btn:hover {
  background: color-mix(in srgb, var(--c-primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--c-primary) 30%, transparent);
  color: var(--c-primary-strong);
}
.theme-toggle:active, .icon-btn:active { transform: scale(0.94); }
.theme-toggle svg, .icon-btn svg { width: 18px; height: 18px; }
/* show the CURRENT theme icon */
:root[data-theme="light"] .tt-moon { display: none; }
:root[data-theme="dark"] .tt-sun { display: none; }
html:not([data-theme]) .theme-toggle { display: none; } /* no JS → no toggle */
.theme-toggle-float { position: fixed; top: 18px; right: 18px; z-index: 50; background: var(--c-card); }

/* ---------------------------------------------------------- 4. app shell --- */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.app-shell { display: flex; min-height: 100vh; }

.nav-open-box { display: none; }
.scrim { display: none; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-line);
  color: var(--sb-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  transition: transform var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 18px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px; letter-spacing: -0.4px;
  color: var(--sb-ink-strong);
  border-bottom: 1px solid var(--sb-line);
}
.brand-mark {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  background: var(--grad-spectrum);
  color: #fff; font-size: 15px; font-weight: 800;
  display: inline-grid; place-items: center;
  box-shadow: var(--glow-primary);
}
.sidebar-brand .brand-c { color: var(--sb-ink-strong); }
.sidebar-brand .brand-r,
.brand-r {
  background: var(--grad-spectrum);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-scroll {
  overflow-y: auto;
  flex: 1;
  padding-bottom: var(--sp-3);
}
.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--sb-section); padding: 16px 20px 6px; font-weight: 700; margin-top: 2px;
}
.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px 6px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-pill);
  color: var(--sb-ink); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-ico {
  width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center;
  color: var(--c-faint); transition: color var(--t-fast);
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--sb-hover); color: var(--sb-ink-strong); }
.nav-item:hover .nav-ico { color: var(--sb-ink-strong); }
/* the active page is a filled pill, not a tinted row with an edge bar */
.nav-item.active {
  background: color-mix(in srgb, var(--c-primary) 14%, transparent);
  color: var(--c-primary-strong);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary) 22%, transparent);
}
.nav-item.active .nav-ico { color: var(--c-primary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--grad-brand);
  color: #fff; font-weight: 700; font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.topbar {
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--c-card) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6); position: sticky; top: 0; z-index: 5; gap: var(--sp-3);
}
.topbar h1 {
  font-size: var(--fs-lg); margin: 0; font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.topbar-actions .btn { white-space: nowrap; }
.menu-toggle { display: none; cursor: pointer; font-size: 20px; }

/* account dropdown (details/summary — works without JS; JS adds outside-click close) */
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 5px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--c-line-strong); background: transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.user-chip:hover, .user-menu[open] .user-chip { background: var(--c-hover); }

/* outlet picker — same pill language as the account chip, so the two read as
   one row of shell controls rather than a form dropped into the header */
.outlet-picker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 10px; border-radius: 999px;
  border: 1px solid var(--c-line-strong); background: transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.outlet-picker:hover, .outlet-picker:focus-within { background: var(--c-hover); }
.outlet-picker-icon { width: 15px; height: 15px; color: var(--c-faint); flex: none; }
.outlet-picker select {
  border: 0; background: transparent; color: var(--c-ink);
  font-weight: 600; font-size: var(--fs-sm); font-family: inherit;
  padding: 3px 2px; cursor: pointer; max-width: 170px;
}
.outlet-picker select:focus { outline: none; }
.outlet-picker:focus-within { border-color: var(--c-primary); }
/* The native menu paints with the OS palette, so force the surface in dark. */
.outlet-picker select option { background: var(--c-card); color: var(--c-ink); }

/* share-of-group bar in the Outlets report — ranking is a comparison, and a
   length is comparable at a glance in a way a column of percentages is not */
.share-bar {
  display: inline-block; vertical-align: middle; width: 54px; height: 6px;
  margin-right: 6px; border-radius: 999px; background: var(--c-line); overflow: hidden;
}
.share-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--c-primary); transition: width var(--t-med);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.user-chip .avatar { width: 27px; height: 27px; font-size: 11px; }
.user-chip-name {
  font-weight: 600; font-size: var(--fs-sm); color: var(--c-ink);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip-caret { width: 14px; height: 14px; color: var(--c-faint); transition: transform var(--t-fast); }
.user-menu[open] .user-chip-caret { transform: rotate(180deg); }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 236px; z-index: 45;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: modal-in 0.18s var(--ease);
}
.user-pop-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 12px; border-bottom: 1px solid var(--c-line); margin-bottom: 6px;
}
.user-pop-head .avatar { width: 34px; height: 34px; }
.user-pop-head .who { min-width: 0; }
.user-pop-head b {
  display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-pop-head span { font-size: var(--fs-xs); color: var(--c-muted); }
.user-pop form { margin: 0; }
.user-pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  border: none; background: none; text-decoration: none; text-align: left;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink);
  transition: background var(--t-fast);
}
.user-pop-item svg { width: 16px; height: 16px; flex: none; color: var(--c-faint); }
.user-pop-item:hover { background: var(--c-hover); }
.user-pop-item.danger { color: var(--c-danger); }
.user-pop-item.danger svg { color: inherit; }
.user-pop-sep { height: 1px; background: var(--c-line); margin: 6px 4px; }
@media (max-width: 560px) { .user-chip-name, .user-chip-caret { display: none; } }

.content-body {
  padding: var(--sp-6); width: 100%; max-width: none; margin: 0;
}
/* Deliberately NOT animated. This is a server-rendered app: selecting a tab,
   a page or a filter is a full page load, so fading the whole content area in
   from opacity 0 made every click flicker — most visibly on Reports and
   Expenses, where the tab strip invites repeated clicks. view-in is kept for
   things that genuinely appear (flash messages, field errors, error cards). */
/* a lead paragraph is a block like any other: the browser's 1em margin left a
   14px gap where every other block sits 16px apart */
.content-body > p { margin: 0 0 var(--sp-4); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ---------------------------------------------------------- page header --- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: var(--sp-5); gap: var(--sp-4); flex-wrap: wrap;
}
.page-head h2 { margin: 0 0 4px; font-size: var(--fs-xl); font-weight: 700; }
.page-head p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.page-head-actions { display: flex; gap: var(--sp-2); }

/* ------------------------------------------------------- 5a. buttons ------ */
/* Pill buttons. One solid primary per view; everything else is tonal —
   a soft tint of its own colour — or quiet. Focus is a visible offset ring. */
.btn {
  font-family: inherit; font-weight: 600; font-size: var(--fs-md); cursor: pointer;
  border: none; border-radius: var(--radius-pill); padding: 10px 18px;
  background: var(--grad-brand); color: var(--c-on-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  /* Align on the box middle, not a text baseline: an <a class="btn"> and a
     <button class="btn"> derive their baselines differently, which left the
     link 2px above the button wherever they share a row (Menu items). */
  vertical-align: middle;
  box-shadow: var(--glow-primary);
  min-height: var(--control-h);
  transition: filter var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.btn:hover { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; filter: none; box-shadow: none; }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 30%, transparent), var(--glow-primary);
}
/* tonal outline — quiet until hovered, then a soft jade tint */
.btn-ghost {
  background: transparent; color: var(--c-primary-strong);
  border: 1px solid var(--c-line-strong); box-shadow: none;
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--c-primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--c-primary) 40%, transparent);
  filter: none;
}
/* tonal danger — tinted at rest, solid only under the pointer, so a page of
   Delete buttons does not shout */
.btn-danger {
  background: color-mix(in srgb, var(--c-danger) 10%, transparent);
  color: var(--c-danger);
  border: 1px solid transparent; box-shadow: none;
}
.btn-danger:hover { background: var(--c-danger); color: #fff; filter: none; }
.btn-subtle { background: transparent; color: var(--c-muted); border: none; box-shadow: none; }
.btn-subtle:hover { background: var(--c-hover); color: var(--c-ink); filter: none; transform: none; }
.btn-inverse { background: #fff; color: var(--c-primary-strong); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.btn-inverse:hover { filter: brightness(0.97); }
.btn-sm { padding: 6px 14px; font-size: var(--fs-sm); min-height: var(--control-h-sm); }

.spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------- 5b. forms ------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--c-muted); }
.field-hint { font-size: var(--fs-xs); color: var(--c-faint); }
.field-error { font-size: var(--fs-xs); color: var(--c-danger); }

.input,
.form-row input,
.form-row select,
.form-row textarea {
  font-family: inherit; font-size: var(--fs-md); padding: 10px 14px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: var(--c-field); width: 100%; color: var(--c-ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input:hover, .form-row :is(input, select, textarea):hover { border-color: var(--c-line-strong); }
.input:focus,
.form-row :is(input, select, textarea):focus {
  outline: none; border-color: var(--c-primary); background: var(--c-card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 16%, transparent);
}
.input::placeholder { color: var(--c-faint); }

/* Bare text-like controls get the same skin as .input so no page ever shows a
   native browser widget. :where() keeps specificity at zero, so .input, .cell
   and page-level rules still override freely. */
:where(select, textarea,
  input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color],
            [type=submit], [type=button], [type=reset], [type=hidden], [type=image])) {
  font-family: inherit; font-size: var(--fs-md); padding: 9px 14px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: var(--c-field); color: var(--c-ink);
  min-height: var(--control-h);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
:where(select, textarea,
  input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color],
            [type=submit], [type=button], [type=reset], [type=hidden], [type=image])):focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 16%, transparent);
}
:where(textarea) { resize: vertical; min-height: 76px; }
:where(input[type=file]) {
  font-family: inherit; font-size: var(--fs-sm); padding: 7px 10px;
  min-height: var(--control-h); max-width: 100%;
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
  background: var(--c-field); color: var(--c-ink);
}
:where(input)::placeholder, :where(textarea)::placeholder { color: var(--c-faint); }

.form-row {
  display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.form-row > * { flex: 1 1 150px; min-width: 0; }
.form-row > .btn { flex: 0 0 auto; }
.form-row .field { flex: 1 1 150px; }

/* --- a form row lines up on three lines: label · control · note ----------
   Bottom-aligning the boxes (align-items: flex-end above) meant any field
   carrying a hint pushed its OWN input up by the height of that hint, leaving
   it out of line with the field beside it — measured at 19px on My account
   ("Min 6 characters") and on Onboarding's owner password.

   Subgrid fixes it at the root: the row owns the three lines and every field
   borrows them, so labels share a line, controls share a line and hints share
   a line no matter which fields have one. Buttons are placed on the control
   line so a neighbour's hint can never drag them down either.

   Kept behind @supports so an engine without subgrid simply keeps the flex
   behaviour above rather than losing the layout altogether. */
@supports (grid-template-rows: subgrid) {
  .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    grid-template-rows: auto auto auto;
    column-gap: var(--sp-3);
    row-gap: 6px;
    align-items: end;
  }
  .form-row > .field {
    grid-row: span 3;
    display: grid;
    grid-template-rows: subgrid;
    /* A subgrid overrides the inherited gutter if it declares its own, and
       .field carries gap: 6px. Left alone the field's three tracks then have to
       stretch to fill the row's gapped span, which silently added the row-gap
       to the control track and made inputs 6px taller than the buttons beside
       them. Inheriting keeps the child's lines exactly on the parent's. */
    row-gap: inherit;
  }
  /* A bare control with no label of its own belongs on the control line. */
  .form-row > :is(input, select, textarea) { grid-row: 2; }
  /* Actions span the band and sit at its foot, exactly where they always have.
     Deliberately NOT pinned to the control line: once a row has more items than
     it has columns it wraps onto implicit rows, and a pinned button would be
     dragged back up onto the first field's input — which stretched buttons to
     54px on fourteen pages at 390px. */
  .form-row > :is(button, .btn) { grid-row: span 3; align-self: end; justify-self: start; }
}

/* File and colour inputs carry native chrome, so the generous text-input
   padding pushed them past the shared control height — the upload button on
   Menu appearance measured 44px against its neighbour's 40px. */
.form-row input[type="file"] { padding: 7px 10px; font-size: var(--fs-sm); }
.form-row input[type="color"] { padding: 4px 6px; }
:where(.form-row, .row-form, .toolbar) input[type="file"] { min-height: var(--control-h); }

/* A select renders a pixel taller than a text input from its own line box.
   Pin both to the shared height so a row never sits 1px out. */
.form-row select:not([multiple]) { height: var(--control-h); }
.row-form select.cell:not([multiple]), .toolbar select:not([multiple]) { height: var(--control-h-sm); }

.toolbar { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--sp-4); }

/* One row, one control height — beats the compact .row-form sizing above. */
:is(.toolbar, .form-row) :is(.btn, .cell, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) {
  min-height: var(--control-h);
}
.topbar-actions :is(.btn, .icon-btn, .theme-toggle) { min-height: 36px; }
.pager .btn { min-height: var(--control-h-sm); }

/* --------------------------------------------------- 5c. cards & tables --- */
.card {
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: var(--sp-5);
  transition: background-color var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.card + .card { margin-top: var(--sp-4); }
/* ...but only when cards genuinely stack in normal flow. Inside a grid the
   container's gap already spaces them, and this margin was dropping the
   second column 16px below the first on every two-pane screen. */
:is(.two-pane, .dash-row, .dash, .stat-grid, .live-grid, .kds-grid, .plan-grid,
    .mkt-features, .mk2-grid, .pos-workspace, .docs-elements, .docs-body) > .card + .card {
  margin-top: 0;
}
.card h3 { margin: 0 0 12px; font-size: 15.5px; }

/* ------------------------------------------------------- in-app docs ------ */
.docs-shell { display: grid; grid-template-columns: 216px 1fr; gap: var(--sp-5); align-items: start; }

.docs-toc { position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); display: flex; flex-direction: column; gap: 10px; }
.docs-search { width: 100%; }
.docs-toc nav { display: flex; flex-direction: column; gap: 1px; max-height: 60vh; overflow-y: auto; }
.docs-toc-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--c-faint); font-weight: 700; padding: 14px 8px 4px;
}
.docs-toc-link {
  padding: 6px 10px; border-radius: 8px; text-decoration: none;
  color: var(--c-muted); font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.docs-toc-link:hover { background: var(--c-hover); color: var(--c-ink); }

.docs-body { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.docs-group-head {
  margin: var(--sp-3) 0 0; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-faint);
}
.docs-section { scroll-margin-top: calc(var(--topbar-h) + var(--sp-4)); }
.docs-hint { margin: 0; }

.docs-card-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding-bottom: var(--sp-4); margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-line);
}
.docs-ico {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: inline-grid; place-items: center; color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-primary) 22%, transparent);
}
.docs-ico svg { width: 19px; height: 19px; }
.docs-card-title { flex: 1; min-width: 0; }
.docs-card-title h3 { margin: 0 0 3px; font-size: 16px; }
.docs-card-title p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); line-height: 1.55; }
.docs-card-actions { flex: none; }

/* A cross-system walkthrough sits full width beneath the two columns: the
   order of operations is the content, and half the steps happen on somebody
   else's screen, so it must not be squeezed into a narrow column. */
.docs-howto {
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--c-line);
}
.docs-howto > p { margin: 0 0 var(--sp-3); max-width: 78ch; }
.docs-howto .docs-steps { max-width: 82ch; }

.docs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.docs-h4 {
  margin: 0 0 8px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-faint);
}
.docs-h4 + * { margin-top: 0; }
.docs-cols > div > .docs-h4:not(:first-child) { margin-top: var(--sp-5); }

.docs-steps { margin: 0; padding: 0; list-style: none; counter-reset: docstep; }
.docs-steps li {
  position: relative; counter-increment: docstep;
  padding: 0 0 12px 30px; font-size: var(--fs-sm); line-height: 1.6; color: var(--c-ink);
}
.docs-steps li::before {
  content: counter(docstep);
  position: absolute; left: 0; top: -1px;
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c-primary) 13%, transparent);
  color: var(--c-primary-strong); font-size: 11px; font-weight: 700;
}
.docs-steps li:last-child { padding-bottom: 0; }

.docs-defs { margin: 0; }
.docs-defs dt { font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink); margin-top: 10px; }
.docs-defs dt:first-child { margin-top: 0; }
.docs-defs dd { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--c-muted); line-height: 1.55; }

.docs-notes { margin: 0; padding-left: 18px; }
.docs-notes li { font-size: var(--fs-sm); color: var(--c-muted); line-height: 1.6; margin-bottom: 7px; }
.docs-notes li:last-child { margin-bottom: 0; }

.docs-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
.docs-start-item { display: flex; gap: 12px; align-items: flex-start; }
.docs-start-item b { font-size: var(--fs-md); }
.docs-start-item p { margin: 3px 0 8px; font-size: var(--fs-sm); color: var(--c-muted); line-height: 1.55; }
.docs-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-brand); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.docs-links { display: flex; flex-wrap: wrap; gap: 6px; }

.docs-elements { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
.docs-element {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-card) 45%, var(--c-bg));
}
/* Align the demo wells and captions across a row so the gallery reads as a
   grid, not a ragged stack. Browsers without subgrid keep the flex fallback. */
@supports (grid-template-rows: subgrid) {
  .docs-element { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 12px; }
}
/* the demo well: real components on a card surface so insets read correctly */
.docs-element-demo {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-height: 62px; padding: 12px; min-width: 0; overflow-x: auto;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius-xs);
}
.docs-element-demo > * { max-width: 100%; }
.docs-element-demo .table { margin: 0; }
.docs-element-demo .pager { flex-wrap: wrap; }
.docs-element-demo .toolbar { margin: 0; flex-wrap: wrap; }
.docs-element-demo .field { min-width: 0; }
.docs-element-text b { font-size: var(--fs-sm); }
.docs-element-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--c-muted); line-height: 1.55; }

@media (max-width: 1080px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-toc { position: static; max-height: none; }
  .docs-toc nav { flex-direction: row; flex-wrap: wrap; gap: 6px; max-height: none; }
  .docs-toc-group { display: none; }
  .docs-toc-link { border: 1px solid var(--c-line); }
}
@media (max-width: 760px) {
  .docs-cols { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* rendered markdown (in-app Docs page) */
.prose { max-width: 880px; line-height: 1.65; }
.prose h1 { font-size: 25px; margin: 0 0 14px; letter-spacing: -0.6px; }
.prose h2 {
  font-size: 19px; margin: 30px 0 10px; padding-top: 22px;
  border-top: 1px solid var(--c-line);
}
.prose h3 { font-size: 15.5px; margin: 22px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li p { margin: 0; }
.prose hr { border: none; border-top: 1px solid var(--c-line); margin: 26px 0; }
.prose a { color: var(--c-primary); font-weight: 500; }
.prose blockquote {
  margin: 0 0 14px; padding: 8px 14px; color: var(--c-muted);
  border-left: 3px solid color-mix(in srgb, var(--c-primary) 45%, transparent);
  background: var(--c-hover); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.prose pre {
  background: var(--c-inset); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px;
}
.prose pre code { background: none; padding: 0; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
/* A table with many columns cannot always shrink to a phone: let the card
   scroll it horizontally rather than dragging the whole content area sideways.
   Cells still wrap, so narrow tables need no scrolling at all. */
.card:has(.table) { overflow-x: auto; }
.table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--c-muted); font-weight: 600;
  padding: 0 12px 10px; border-bottom: 1px solid var(--c-line);
}
.table td { padding: 14px 12px; border-bottom: 1px solid color-mix(in srgb, var(--c-line) 80%, transparent); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover td { background: var(--c-hover); }
.table .right, th.right, td.right { text-align: right; }

/* selected row highlight (replaces old inline background hexes) */
.table tr.row-selected td,
.table tr[data-selected] td,
.list-row.row-selected,
.list-row[data-selected] {
  background: color-mix(in srgb, var(--c-primary) 8%, transparent);
}
.table tr.row-selected td:first-child,
.table tr[data-selected] td:first-child,
.list-row.row-selected,
.list-row[data-selected] {
  box-shadow: inset 2px 0 0 var(--c-primary);
}

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 9px 0; border-bottom: 1px solid var(--c-line); font-size: var(--fs-md);
}
.list-row:last-child { border-bottom: none; }
/* The label wraps; the action never shrinks into its own text. On a narrow
   phone a long row was squeezing "Inventory" to 74px inside a 79px button. */
.list-row > :first-child { min-width: 0; }
.list-row > .btn { flex: none; }

/* ---------------------------------------------------------- 5d. badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
  color: var(--c-primary-strong);
  text-transform: capitalize; white-space: nowrap;
}
/* every badge carries a status dot in its own colour — scannable in a table
   column without reading a word */
.badge::before {
  content: ''; width: 6px; height: 6px; flex: none;
  border-radius: 50%; background: currentColor; opacity: 0.85;
}
.badge-neutral { background: color-mix(in srgb, var(--c-muted) 14%, transparent); color: var(--c-muted); }
.badge-success { background: color-mix(in srgb, var(--c-success) 14%, transparent); color: var(--c-success); }
.badge-info { background: color-mix(in srgb, var(--c-info) 14%, transparent); color: var(--c-info); }
.badge-warning { background: color-mix(in srgb, var(--c-warning) 15%, transparent); color: var(--c-warning); }
.badge-danger { background: color-mix(in srgb, var(--c-danger) 13%, transparent); color: var(--c-danger); }
.badge-violet { background: color-mix(in srgb, var(--c-accent) 14%, transparent); color: var(--c-accent); }

/* ------------------------------------------------------------ 5e. tabs ---- */
.tabs {
  display: inline-flex; gap: 4px; background: var(--c-inset);
  border-radius: var(--radius-pill);
  padding: 4px; margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.tab {
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600;
  border: none; background: transparent; color: var(--c-muted);
  padding: 7px 16px; border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.tab:hover { color: var(--c-ink); }
.tab.active {
  background: var(--c-card); color: var(--c-primary-strong);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px color-mix(in srgb, var(--c-primary) 18%, transparent);
}

/* ------------------------------------------------------------ 5f. chips --- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--c-line-strong);
  background: var(--c-card); color: var(--c-muted); font-size: var(--fs-sm);
  font-family: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { color: var(--c-ink); border-color: var(--c-faint); }
.chip.active {
  background: color-mix(in srgb, var(--c-primary) 14%, transparent);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary) 35%, transparent);
  color: var(--c-primary-strong); font-weight: 600;
}

/* ------------------------------------------------- 6. states & feedback --- */
.muted { color: var(--c-muted); }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }

.empty { text-align: center; color: var(--c-muted); padding: 40px 0; font-size: var(--fs-md); }
.empty-icon {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--c-inset); color: var(--c-faint);
  display: flex; align-items: center; justify-content: center;
}
.empty p { margin: 0 0 2px; font-weight: 500; }

.error { color: var(--c-danger); font-size: var(--fs-sm); margin: 6px 0; }
.error-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  background: color-mix(in srgb, var(--c-danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-danger) 30%, transparent);
  color: var(--c-danger);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: var(--fs-sm);
  margin-bottom: var(--sp-4); animation: view-in var(--t-med) var(--ease);
}

.skeleton-stack { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.skeleton-row {
  height: 38px; border-radius: var(--radius-xs);
  background: linear-gradient(90deg,
    var(--c-inset) 25%,
    color-mix(in srgb, var(--c-inset) 40%, var(--c-card)) 50%,
    var(--c-inset) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.progress { height: 10px; background: var(--c-inset); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--grad-brand);
  transition: width 0.5s var(--ease);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.stat { padding: var(--sp-4) var(--sp-5); }
.stat .stat-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); font-weight: 600; }
.stat .stat-value {
  font-family: var(--font-display);
  font-size: 27px; font-weight: 700; letter-spacing: -0.5px; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.two-pane { display: grid; grid-template-columns: var(--two-pane-ratio, 1fr 1.4fr); gap: var(--sp-4); align-items: start; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: var(--sp-4); }

/* flash messages (static toasts) */
.flash-stack { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 11px 16px; border-radius: var(--radius-sm); font-size: var(--fs-md);
  font-weight: 500; box-shadow: var(--shadow-sm);
  border-left: 3px solid currentColor;
  animation: view-in var(--t-med) var(--ease);
}
.flash-success {
  background: color-mix(in srgb, var(--c-success) 10%, var(--c-card));
  color: var(--c-success);
  border-top: 1px solid color-mix(in srgb, var(--c-success) 25%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--c-success) 25%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--c-success) 25%, transparent);
}
.flash-error {
  background: color-mix(in srgb, var(--c-danger) 9%, var(--c-card));
  color: var(--c-danger);
  border-top: 1px solid color-mix(in srgb, var(--c-danger) 24%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--c-danger) 24%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--c-danger) 24%, transparent);
}

/* ------------------------------------------------------- 7a. modal -------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(8, 11, 20, 0.55); padding: var(--sp-4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade-in var(--t-fast) ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal-panel {
  width: 100%; background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modal-in var(--t-med) var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0;
}
.modal-head h3 { margin: 0; font-size: var(--fs-lg); }
.modal-x {
  border: none; background: transparent; color: var(--c-faint); cursor: pointer;
  font-size: 14px; padding: 6px 8px; border-radius: var(--radius-xs);
}
.modal-x:hover { background: var(--c-hover); color: var(--c-ink); }
.modal-body { padding: 14px 20px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  padding: 0 20px 20px;
}
.confirm-message { margin: 4px 0 0; color: var(--c-muted); line-height: 1.55; }

/* ------------------------------------------------------- 7b. toasts ------- */
.toast-stack {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 9px;
  background: color-mix(in srgb, var(--c-ink) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--c-bg); font-size: var(--fs-sm); font-weight: 500;
  padding: 10px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
  animation: toast-in var(--t-med) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }
.toast-ico {
  width: 18px; height: 18px; border-radius: 50%; flex: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.toast-success .toast-ico { background: var(--c-success); }
.toast-error .toast-ico { background: var(--c-danger); }

/* ------------------------------------------------------ 7c. guided tour --- */
/* Spotlight = a fixed box whose giant box-shadow dims everything around it.
   Driven by public/js/tour.js; steps are built from the live DOM.           */
.tour-spot {
  position: fixed; z-index: 90; pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgba(8, 11, 20, 0.55);
  outline: 2px solid color-mix(in srgb, var(--c-primary) 75%, transparent);
  outline-offset: 2px;
  transition: top var(--t-med) var(--ease), left var(--t-med) var(--ease),
    width var(--t-med) var(--ease), height var(--t-med) var(--ease);
}
.tour-card {
  position: fixed; z-index: 95;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 16px 18px 14px;
  transition: top var(--t-med) var(--ease), left var(--t-med) var(--ease);
  animation: modal-in var(--t-med) var(--ease);
}
.tour-card h3 { margin: 10px 0 6px; font-size: 15.5px; }
.tour-card p { margin: 0 0 14px; color: var(--c-muted); font-size: var(--fs-sm); line-height: 1.55; }
.tour-progress {
  height: 4px; border-radius: 999px; background: var(--c-inset); overflow: hidden;
}
.tour-progress span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--grad-brand); transition: width var(--t-med) var(--ease);
}
.tour-count { margin-top: 8px; font-size: var(--fs-xs); color: var(--c-faint); font-weight: 600; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-spacer { flex: 1; }

/* ================================================================ 8. auth == */
/* Sign-in — split layout: dark brand showcase panel + frosted form panel.
   The hero keeps its deep-space look in both themes; the form side follows
   the active theme. Below 880px the hero collapses away.                    */
.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 48px 40px;
  background:
    radial-gradient(640px 520px at 12% -6%, rgba(17, 168, 154, 0.28), transparent 62%),
    radial-gradient(560px 480px at 96% 18%, rgba(124, 92, 252, 0.22), transparent 60%),
    radial-gradient(720px 560px at 55% 115%, rgba(29, 132, 207, 0.24), transparent 62%),
    #0a0e17;
}
.auth-hero::after {
  content: ''; position: absolute; inset: -25%; pointer-events: none;
  background:
    radial-gradient(30% 34% at 30% 30%, rgba(17, 168, 154, 0.20), transparent 62%),
    radial-gradient(26% 32% at 72% 62%, rgba(124, 92, 252, 0.16), transparent 60%);
  animation: bg-drift 34s ease-in-out infinite alternate;
  will-change: transform;
}
.auth-hero-inner { position: relative; z-index: 1; }
.auth-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5; z-index: 1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 44px 100%;
  -webkit-mask-image: radial-gradient(78% 64% at 50% 40%, #000, transparent);
  mask-image: radial-gradient(78% 64% at 50% 40%, #000, transparent);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 440px; animation: auth-in 0.6s var(--ease) both; }
.auth-hero-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #fff;
}
.auth-hero-brand .brand-c { color: #fff; }
.auth-hero h2 { color: #fff; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin: 30px 0 10px; letter-spacing: -0.8px; }
.auth-hero > .auth-hero-inner p { color: #9aa8bf; font-size: 14.5px; line-height: 1.6; margin: 0 0 26px; }
.auth-hero-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.auth-hero-list li { display: flex; align-items: center; gap: 12px; color: #cfd8e6; font-size: 14px; font-weight: 500; }
.auth-hero-ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: inline-grid; place-items: center; color: #3fd6c4;
  background: rgba(17, 168, 154, 0.13); border: 1px solid rgba(17, 168, 154, 0.28);
}
.auth-hero-ico svg { width: 17px; height: 17px; }
.auth-hero-foot {
  margin-top: 34px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #5c6a82; font-weight: 600;
}

.auth-panel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px 24px;
  background: var(--c-bg);
}
.auth-panel::before {
  content: ''; position: absolute; inset: -30%; pointer-events: none;
  background:
    radial-gradient(30% 34% at 72% 18%, color-mix(in srgb, var(--c-primary) 12%, transparent), transparent 64%),
    radial-gradient(26% 30% at 20% 82%, color-mix(in srgb, var(--c-accent) 9%, transparent), transparent 60%);
  animation: bg-drift 40s ease-in-out infinite alternate;
  will-change: transform;
}
.auth-panel > * { position: relative; z-index: 1; }
.auth-card {
  position: relative; width: 100%; max-width: 404px;
  background: color-mix(in srgb, var(--c-card) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--c-ink) 10%, transparent);
  border-radius: var(--radius-lg); padding: 32px 30px;
  box-shadow: var(--shadow-lg);
  animation: auth-in 0.55s var(--ease) both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; } }
.auth-card.has-error { animation: auth-shake 0.45s var(--ease); }
@keyframes auth-shake {
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .muted { margin-top: 0; }
.auth-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 18px;
}
.auth-card .field { margin-bottom: 14px; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--c-ink);
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-field) 80%, transparent);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth-card input:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 22%, transparent);
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border: none; background: transparent; color: var(--c-faint);
  border-radius: 8px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.pw-toggle:hover { color: var(--c-ink); background: var(--c-hover); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle svg[hidden] { display: none; } /* [hidden] alone doesn't hide inline SVG */
.caps-hint { color: var(--c-warning); font-weight: 600; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 16px; font-size: var(--fs-sm); }
.auth-remember { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.auth-submit { width: 100%; padding: 12px; }
.auth-submit.loading { opacity: 0.85; pointer-events: none; }
.dev-hint {
  margin-top: 16px; padding: 10px 12px;
  border: 1px dashed var(--c-line-strong); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--c-muted);
  display: flex; flex-direction: column; gap: 3px;
}
.dev-hint code { align-self: flex-start; }
.auth-foot { margin: 0; font-size: 12px; color: var(--c-faint); }

@media (max-width: 880px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ======================================================== 9. error pages == */
.error-screen {
  position: relative; overflow-x: hidden;
  display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 24px;
  background: var(--c-bg);
}
/* :not(.bg-fx) — the ambient layer must stay position:fixed or it collapses */
.error-screen > *:not(.bg-fx) { position: relative; z-index: 1; }
.error-card {
  --ea: var(--c-info); /* accent, overridden per page */
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  max-width: 500px; width: 100%; text-align: center;
  box-shadow: var(--shadow);
  animation: view-in var(--t-med) var(--ease);
}
.error-card.accent-info { --ea: var(--c-info); }
.error-card.accent-warning { --ea: var(--c-warning); }
.error-card.accent-danger { --ea: var(--c-danger); }
.error-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: color-mix(in srgb, var(--ea) 12%, transparent);
  color: var(--ea);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 22px;
}
.error-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--ea) 13%, transparent); color: var(--ea);
  font-size: 12px; font-weight: 600; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.error-code { font-size: 14px; font-weight: 600; color: var(--ea); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.error-heading {
  font-family: var(--font-display);
  font-size: 44px; font-weight: 700; color: var(--c-ink); margin: 0 0 10px; letter-spacing: -1px;
}
.error-message { color: var(--c-muted); font-size: 14px; line-height: 1.6; margin: 0 0 30px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.error-actions .btn { flex: 1; min-width: 150px; }

/* ==================================================== 9b. print sheets ==== */
/* Receipt + kitchen order ticket — thermal-style 80mm sheets, always light. */
.print-body {
  background: var(--c-bg); min-height: 100vh; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.print-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.print-sheet {
  width: 302px; background: #fff; color: #14181f; padding: 18px 16px;
  font: 12.5px/1.5 'Inter', system-ui, sans-serif;
  border-radius: 8px; box-shadow: var(--shadow);
}
.print-head { text-align: center; display: flex; flex-direction: column; gap: 2px; color: #444; }
.print-brand { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #14181f; }
.print-kot-id { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: #14181f; }
.print-rule { border-top: 1px dashed #9aa; margin: 10px 0; }
.print-line { display: flex; justify-content: space-between; gap: 10px; padding: 1.5px 0; }
/* Keep the money column on one line, but let a long dish name wrap — a KOT
   line is a single span, and forcing it nowrap pushed it off the sheet. */
.print-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.print-line > span:last-child:not(:only-child) {
  font-variant-numeric: tabular-nums; white-space: nowrap; flex: none;
}
.print-total { font-weight: 800; font-size: 15px; padding-top: 4px; }
.print-kot-line { font-size: 16px; padding: 3px 0; }
.print-note { font-weight: 600; }
.print-foot { text-align: center; font-size: 11.5px; color: #555; }
@media print {
  .print-actions, .theme-toggle { display: none !important; }
  .print-body { padding: 0; background: #fff; display: block; }
  .print-sheet { box-shadow: none; border-radius: 0; width: 100%; max-width: 80mm; padding: 0; margin: 0 auto; }
}

/* ================================================== 10. POS / KDS / charts = */
.pos-shell { display: flex; flex-direction: column; gap: var(--sp-4); }
.pos-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 980px) {
  .pos-workspace { grid-template-columns: 1fr; }
}

.pos-menu-pane { min-height: 420px; }
.pos-menu-tools {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
}
.pos-search {
  flex: 1; min-width: 0;
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; background: var(--c-inset, var(--c-card));
}
.pos-cats { margin-bottom: 14px; }

.pos-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.pos-product-form { display: flex; margin: 0; }
.pos-product {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 14px 12px 12px; text-align: center;
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
  background: var(--c-card); color: var(--c-ink); cursor: pointer; font: inherit;
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
}
.pos-product:hover:not(:disabled):not(.is-soldout) {
  border-color: color-mix(in srgb, var(--c-primary) 50%, transparent);
  background: color-mix(in srgb, var(--c-primary) 6%, var(--c-card));
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.pos-product:disabled, .pos-product.is-soldout {
  opacity: 0.55; cursor: not-allowed; filter: grayscale(0.35);
}
.pos-product-img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--c-inset, #f3f3f3); flex: none;
}
.pos-product-ph {
  width: 72px; height: 72px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c-primary) 12%, var(--c-card));
  color: var(--c-primary); font-weight: 700; font-size: 22px;
}
.pos-product-body { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.pos-product-body b {
  display: block; font-size: var(--fs-sm); line-height: 1.25;
  min-height: 2.5em;
}
.pos-product-body .price { color: var(--c-primary); font-weight: 700; }

.pos-ticket-pane {
  position: sticky; top: 12px;
  display: flex; flex-direction: column; gap: 0;
  max-height: calc(100vh - 100px); overflow: hidden;
}
.pos-ticket-head { padding-bottom: 12px; border-bottom: 1px solid var(--c-line); }
.pos-ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.pos-ticket-lines {
  flex: 1; overflow: auto; padding: 8px 0;
  min-height: 120px; max-height: 38vh;
}
.pos-ticket-empty { margin: 18px 0; text-align: center; }
.pos-line {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-line);
}
.pos-line-main { min-width: 0; flex: 1; }
.pos-line-main b { display: block; font-size: var(--fs-sm); }
.pos-line-math { font-size: 12px; margin-top: 2px; }
.pos-line-remove { color: var(--c-danger) !important; }
.pos-ticket-summary { padding-top: 8px; border-top: 1px solid var(--c-line); }
.pos-ticket-total {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px; padding: 10px 0 4px;
}
.pos-discount {
  display: flex; gap: 8px; margin-top: 10px;
}
.pos-discount input { flex: 1; min-width: 0; }
.pos-ticket-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c-line);
}
.pos-pay-form { display: flex; flex-direction: column; gap: 8px; }
.pos-pay-row { display: flex; gap: 8px; }
.pos-pay-row input, .pos-pay-row select { flex: 1; min-width: 0; }
.pos-btn-pay, .pos-btn-block { width: 100%; justify-content: center; }
.pos-btn-pay { font-weight: 700; padding: 12px 16px; }
.pos-print-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-print-row .btn { justify-content: center; text-align: center; }

.ticket-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--c-line); }
.ticket-row:last-child { border-bottom: none; }
.ticket-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; padding-top: 12px; }

.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.live-dot { display: inline-flex; align-items: center; gap: 7px; }
.live-dot::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--c-success);
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-success) 45%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}
.kds-ticket { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--c-line); }
.kds-ticket:last-child { border-bottom: none; }

/* --- kitchen display -----------------------------------------------------
   A KDS is read across a room, by someone holding a pan. So: one tile per
   ticket instead of a table row, the wait time as the loudest thing on the
   card, and colour carrying the urgency so a late ticket is visible without
   reading anything. Tap targets are sized for a tablet, not a mouse. */
.kds-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5);
  padding: 12px var(--sp-4); margin-bottom: var(--sp-4);
  border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-card) 60%, var(--c-bg));
}
.kds-sum-main { font-size: var(--fs-md); }
.kds-sum-main b { font-family: var(--font-display); font-size: 20px; margin-right: 4px; }
.kds-sum-split { display: flex; gap: 8px; flex-wrap: wrap; }
.kds-pill {
  font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--c-inset); color: var(--c-muted);
}
.kds-pill b { font-size: var(--fs-sm); margin-right: 3px; }
.kds-pill.tone-new { background: color-mix(in srgb, var(--c-info) 14%, transparent); color: var(--c-info); }
.kds-pill.tone-preparing { background: color-mix(in srgb, var(--c-warning) 15%, transparent); color: var(--c-warning); }
.kds-pill.tone-ready { background: color-mix(in srgb, var(--c-success) 14%, transparent); color: var(--c-success); }
.kds-oldest { margin-left: auto; font-size: var(--fs-sm); color: var(--c-muted); white-space: nowrap; }
.kds-oldest b { font-variant-numeric: tabular-nums; }
.kds-oldest.is-soon b { color: var(--c-warning); }
.kds-oldest.is-warn b { color: var(--c-warning); }
.kds-oldest.is-late b { color: var(--c-danger); }

.kds-lane { display: flex; flex-direction: column; gap: 10px; }
.kds-lane-head { display: flex; align-items: center; gap: 10px; }
.kds-lane-head h3 { margin: 0; }
.kds-lane-count {
  margin-left: auto; min-width: 26px; text-align: center;
  font-size: var(--fs-sm); font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--c-primary) 14%, transparent); color: var(--c-primary-strong);
}
.kds-lane-count.is-clear { background: var(--c-inset); color: var(--c-faint); }
.kds-lane-clear { margin: 0; font-size: var(--fs-sm); }

/* one ticket */
.kt {
  --kt-tone: var(--c-line-strong);
  border: 1px solid var(--c-line); border-left: 4px solid var(--kt-tone);
  border-radius: var(--radius-sm); padding: 10px 12px;
  background: color-mix(in srgb, var(--kt-tone) 5%, var(--c-card));
  display: flex; flex-direction: column; gap: 7px;
}
.kt-soon { --kt-tone: var(--c-info); }
.kt-warn { --kt-tone: var(--c-warning); }
.kt-late { --kt-tone: var(--c-danger); }

.kt-top { display: flex; align-items: baseline; gap: 8px; }
.kt-where {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md);
  padding: 1px 8px; border-radius: var(--radius-xs);
  background: var(--c-inset); color: var(--c-ink); white-space: nowrap;
}
.kt-order { font-size: var(--fs-xs); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-age {
  margin-left: auto; font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-lg); color: var(--kt-tone); font-variant-numeric: tabular-nums;
}
.kt-calm .kt-age { color: var(--c-muted); }

.kt-what { font-size: var(--fs-md); line-height: 1.35; }
.kt-what b { font-family: var(--font-display); font-size: var(--fs-lg); margin-right: 4px; }
.kt-note {
  margin: 0; font-size: var(--fs-sm); padding: 5px 9px; border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--c-warning) 12%, transparent); color: var(--c-warning);
}

.kt-foot { display: flex; align-items: center; gap: 10px; margin-top: 1px; }
.kt-steps { display: inline-flex; align-items: center; gap: 4px; }
.kt-steps i { width: 16px; height: 4px; border-radius: 2px; background: var(--c-inset); }
.kt-steps i.on { background: var(--kt-tone); }
.kt-status { font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); margin-left: 4px; text-transform: capitalize; }
/* a gloved thumb on a tablet, not a mouse */
.kt-go { margin-left: auto; min-height: 38px; padding: 8px 18px; font-size: var(--fs-md); }

@media (max-width: 560px) {
  .kds-oldest { margin-left: 0; }
}

/* CSS bar charts (Engagement) */
.bar-row { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; margin-bottom: 7px; font-size: var(--fs-sm); }
.bar-track { background: var(--c-inset); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--grad-brand); border-radius: 999px; }

/* ====================================================== 11. marketing ===== */
.mkt-nav { display: flex; align-items: center; gap: 18px; max-width: 1040px; margin: 0 auto; padding: 18px 20px; }
.mkt-nav .spacer { flex: 1; }
.mkt-nav a { text-decoration: none; color: var(--c-ink); font-weight: 500; }
.mkt-hero { max-width: 1040px; margin: 0 auto; padding: 76px 20px 44px; text-align: center; }
.mkt-hero h1 {
  font-size: clamp(34px, 5vw, 52px); margin: 14px 0; letter-spacing: -1.4px; line-height: 1.1;
}
.mkt-eyebrow {
  display: inline-block;
  color: var(--c-primary-strong); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 12px;
  background: color-mix(in srgb, var(--c-primary) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-primary) 25%, transparent);
  padding: 5px 14px; border-radius: 999px;
}
.mkt-stats { display: flex; gap: 40px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.mkt-stats b {
  font-family: var(--font-display);
  background: var(--grad-spectrum);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mkt-features { max-width: 1040px; margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
.mkt-features .card { transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); }
.mkt-features .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mkt-cta {
  background: var(--grad-spectrum); color: #fff; text-align: center;
  padding: 56px 20px; margin: 40px 0;
}
.mkt-cta h2 { margin: 0 0 8px; color: #fff; }
.mkt-cta p { color: rgba(255, 255, 255, 0.85); }
.mkt-section { max-width: 720px; margin: 0 auto; padding: 30px 20px 70px; }
.mkt-footer { border-top: 1px solid var(--c-line); padding: 26px 20px; text-align: center; color: var(--c-muted); font-size: var(--fs-sm); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); max-width: 1040px; margin: 0 auto; padding: 10px 20px 60px; }
.plan-card {
  position: relative; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 24px; background: var(--c-card);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card.popular {
  border-color: color-mix(in srgb, var(--c-primary) 55%, transparent);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--c-primary) 16%, transparent);
}
.plan-price { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 8px 0; }
.plan-card ul { list-style: none; padding: 0; margin: 14px 0; }
.plan-card li { padding: 4px 0; font-size: var(--fs-md); }

/* ------------------------------------------------------ 11b. landing v2 --- */
/* Home page rebuild: consistent rhythm, uniform cards, animated hero. */
.mk2-hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 88px 24px 56px;
}
.mk2-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background:
    linear-gradient(color-mix(in srgb, var(--c-ink) 5%, transparent) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 5%, transparent) 1px, transparent 1px) 0 0 / 46px 100%;
  -webkit-mask-image: radial-gradient(72% 62% at 50% 34%, #000, transparent);
  mask-image: radial-gradient(72% 62% at 50% 34%, #000, transparent);
}
.mk2-hero::after {
  content: ''; position: absolute; inset: -20%; pointer-events: none;
  background:
    radial-gradient(26% 30% at 32% 24%, color-mix(in srgb, var(--c-primary) 13%, transparent), transparent 62%),
    radial-gradient(24% 28% at 70% 18%, color-mix(in srgb, var(--c-accent) 10%, transparent), transparent 60%);
  animation: bg-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}
.mk2-hero-inner { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }
.mk2-hero h1 {
  font-size: clamp(32px, 3.9vw, 48px); font-weight: 700;
  letter-spacing: -1.4px; line-height: 1.08; margin: 18px 0 16px;
}
.mk2-hero h1 em {
  font-style: normal;
  background: var(--grad-spectrum);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mk2-hero-sub {
  font-size: 17px; color: var(--c-muted); line-height: 1.65;
  max-width: 580px; margin: 0 auto;
}
.mk2-cta-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.mk2-btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 12px; }
.mk2-hero-note { margin: 16px 0 0; font-size: 13px; color: var(--c-faint); }

.mk2-stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, minmax(150px, 210px));
  justify-content: center; gap: 14px; margin: 48px auto 0;
}
.mk2-stat {
  background: color-mix(in srgb, var(--c-card) 65%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--c-line); border-radius: 14px;
  padding: 16px 18px; text-align: center;
}
.mk2-stat b {
  display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--grad-spectrum);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mk2-stat span { font-size: 12.5px; color: var(--c-muted); }

.mk2-section { max-width: 1080px; margin: 0 auto; padding: 60px 24px; position: relative; z-index: 1; }
.mk2-head { text-align: center; max-width: 600px; margin: 0 auto 36px; }
.mk2-head h2 { font-size: clamp(24px, 3vw, 30px); margin: 0 0 8px; letter-spacing: -0.7px; }
.mk2-head p { margin: 0; color: var(--c-muted); font-size: 15px; line-height: 1.6; }

.mk2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.mk2-feature {
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.mk2-feature:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--c-primary) 30%, var(--c-line));
}
.mk2-feature-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: inline-grid; place-items: center; color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-primary) 24%, transparent);
}
.mk2-feature-ico svg { width: 20px; height: 20px; }
.mk2-feature h3 { margin: 4px 0 0; font-size: 16px; }
.mk2-feature p { margin: 0; color: var(--c-muted); font-size: 14px; line-height: 1.6; }

.mk2-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
.mk2-step {
  position: relative; padding: 24px 24px 24px 24px;
  background: color-mix(in srgb, var(--c-card) 55%, var(--c-bg));
  border: 1px dashed var(--c-line-strong); border-radius: var(--radius);
}
.mk2-step-num {
  width: 32px; height: 32px; border-radius: 50%; margin-bottom: 12px;
  display: inline-grid; place-items: center;
  background: var(--grad-brand); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  box-shadow: var(--glow-primary);
}
.mk2-step h3 { margin: 0 0 6px; font-size: 15.5px; }
.mk2-step p { margin: 0; color: var(--c-muted); font-size: 13.5px; line-height: 1.6; }

.mk2-band {
  position: relative; overflow: hidden; text-align: center;
  background: var(--grad-spectrum); color: #fff;
  border-radius: var(--radius-lg); padding: 56px 32px;
}
.mk2-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.25;
  background:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 40px 100%;
  -webkit-mask-image: radial-gradient(80% 90% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(80% 90% at 50% 50%, #000, transparent);
}
.mk2-band > * { position: relative; }
.mk2-band h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; letter-spacing: -0.6px; }
.mk2-band p { color: rgba(255, 255, 255, 0.85); margin: 0 0 24px; font-size: 15px; }

.mk2-contact { max-width: 620px; margin: 0 auto; }
.mk2-contact .card { padding: 28px; }

@media (max-width: 640px) {
  .mk2-hero { padding: 56px 18px 40px; }
  .mk2-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .mk2-stat { padding: 12px 8px; }
  .mk2-stat b { font-size: 20px; }
  .mk2-section { padding: 44px 18px; }
}

/* ==================================================== 12. public layout === */
.public-nav {
  background: color-mix(in srgb, var(--c-card) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 30;
}
.public-nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-4);
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: var(--sp-4);
}
.public-nav-brand {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; letter-spacing: -0.4px;
  color: var(--c-ink); flex: 0 0 auto;
}
.public-nav-brand .brand-c { color: var(--c-ink); }
.public-nav-links { display: flex; gap: var(--sp-4); flex: 1; justify-content: center; }
.public-nav-link {
  text-decoration: none; color: var(--c-muted); font-weight: 500; font-size: var(--fs-md);
  transition: color var(--t-fast); padding: 8px 0;
}
.public-nav-link:hover { color: var(--c-ink); }
.public-nav-actions { display: flex; align-items: center; gap: var(--sp-3); flex: 0 0 auto; }

.public-content { min-height: calc(100vh - 68px - 120px); position: relative; z-index: 1; }

.public-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--c-line);
  background: color-mix(in srgb, var(--c-card) 55%, var(--c-bg));
  padding: 40px var(--sp-4); margin-top: 60px;
}
.public-footer-container {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
}
.public-footer-col { flex: 1; min-width: 200px; }
.public-footer-container p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.public-footer-links { display: flex; gap: var(--sp-3); margin-top: 12px; }
.public-footer-links a {
  text-decoration: none; color: var(--c-muted); font-size: var(--fs-sm); font-weight: 500;
  transition: color var(--t-fast);
}
.public-footer-links a:hover { color: var(--c-primary); }

.public-footer-contact { min-width: 240px; }
.public-footer-label {
  margin: 0 0 10px; color: var(--c-muted); font-size: 11.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.public-footer-details { display: flex; flex-direction: column; gap: 8px; }
.public-footer-detail-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--c-muted); font-size: var(--fs-sm);
  font-weight: 500; transition: color var(--t-fast);
  padding: 4px 0;
}
.public-footer-detail-link svg {
  width: 16px; height: 16px; flex: none; color: var(--c-primary);
}
.public-footer-detail-link:hover {
  color: var(--c-primary);
}

/* =================================================== 13. guest QR menu ==== */
/* Customer-facing, no login. Mobile-first. Per-branch accent: --pub-accent. */
.pub-wrap {
  max-width: 760px; margin: 0 auto; padding: 0 16px 140px;
  position: relative; z-index: 1;
  --pub-accent: var(--c-primary);
}
.pub-cover { width: calc(100% + 32px); margin: 0 -16px; height: 160px; object-fit: cover; display: block; }
.pub-head { display: flex; align-items: center; gap: 12px; padding: 16px 0 4px; }
.pub-head img.logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.pub-head .tbl { margin-left: auto; background: var(--pub-accent, #2f6f5e); color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.pub-tools { display: flex; gap: 10px; margin: 14px 0; }
.pub-tools input[type=search] {
  flex: 1; padding: 10px 14px; border: 1px solid var(--c-line-strong); border-radius: 999px;
  font: inherit; background: var(--c-field); color: var(--c-ink);
}
.pub-tools input[type=search]:focus {
  outline: none; border-color: var(--pub-accent, var(--c-primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pub-accent, var(--c-primary)) 20%, transparent);
}
.pub-card {
  display: flex; gap: 12px; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; background: var(--c-card); box-shadow: var(--shadow-sm);
}
.pub-card img.ph { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.pub-card .ph-empty { width: 84px; height: 84px; border-radius: 10px; background: var(--c-inset); flex: 0 0 auto; }
.pub-card h4 { margin: 0 0 3px; font-size: 15px; }
.pub-card .desc { color: var(--c-muted); font-size: 13px; margin: 0 0 6px; }
.pub-tag {
  display: inline-block; font-size: 11px; background: var(--c-inset); color: var(--c-muted);
  border-radius: 999px; padding: 2px 8px; margin-right: 4px;
}
.pub-tag.sold {
  background: color-mix(in srgb, var(--c-danger) 12%, transparent);
  color: var(--c-danger);
}
.diet-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid currentColor; margin-right: 6px; }
.pub-qty form { display: inline; }
.pub-checkout {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--c-card) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-line);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.10); padding: 12px 16px;
}
.pub-checkout .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pub-accent-btn {
  background: var(--pub-accent, #2f6f5e); color: #fff; border: none; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer;
  transition: filter var(--t-fast), transform var(--t-fast);
}
.pub-accent-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sold-out { opacity: 0.55; }

/* ------------------------------------------------------------- 14. misc --- */
a.nav-item, a.tab, a.btn, a.chip { text-decoration: none; }
a.btn { display: inline-flex; align-items: center; justify-content: center; }
.inline-form { display: inline; }
.inline-form .btn { vertical-align: middle; }

.thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--c-inset); display: inline-block; vertical-align: middle; }
/* narrow single-purpose panes — one width, so sibling pages (an item's Edit
   and Recipe screens) don't jump between 560px and 640px as you switch. */
.card-narrow { max-width: var(--pane-narrow); }
.qr-box { text-align: center; padding: 20px; max-width: var(--pane-tight); }
.qr-box img { width: 240px; height: 240px; background: #fff; border-radius: var(--radius-sm); padding: 8px; }
.perm-matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--c-primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--c-primary); }
/* Several independent forms acting on one row, laid out as one line of actions.
   Each <form> is block-level, so without this the second one drops below the
   first — Users had Delete sitting 32px under Reset. */
.row-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; flex-wrap: wrap;
}
.row-actions > form { margin: 0; }

.row-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-form :is(.btn, .cell, input, select) { min-height: var(--control-h-sm); }
td .row-form { display: flex; gap: 6px; align-items: center; }
select.cell, input.cell {
  padding: 6px 8px; border: 1px solid var(--c-line-strong); border-radius: 8px;
  font: inherit; font-size: var(--fs-sm); background: var(--c-field); color: var(--c-ink);
}

/* ============================================== 15. responsive & a11y ===== */
@media (max-width: 940px) {
  .two-pane { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%); box-shadow: var(--shadow-lg); z-index: 30;
    border-right: none;
  }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--c-line-strong);
    background: var(--c-card); color: var(--c-ink);
    border-radius: var(--radius-sm); cursor: pointer; margin-right: 10px;
  }
  .nav-open-box:checked ~ .sidebar { transform: translateX(0); }
  .nav-open-box:checked ~ .scrim {
    display: block; position: fixed; inset: 0; z-index: 29;
    background: rgba(8, 11, 20, 0.5); animation: fade-in var(--t-fast) ease;
  }
  .content-body { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); }
}
@media (max-width: 560px) {
  .page-head-actions { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .mkt-section { padding: 40px 16px; }
  .public-nav-links { display: none; }
  .error-card { padding: 40px 24px; }
  .public-footer-container { flex-direction: column; align-items: flex-start; }
  .public-footer-contact { width: 100%; margin-top: var(--sp-3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* nobody should wait out a stagger they cannot see animate */
  * { animation-delay: 0s !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  /* Entrance keyframes only. The rotating hero governs its own cards by scene
     — forcing those visible here would show all four scenes' cards at once. */
  .ph-item, .ph-bar, .auth-showcase .float-card { opacity: 1 !important; transform: none !important; }
}

/* ============================================ 16. showpiece & motion ====== */
/* Entrance motion, materials and the animated product mockup. Everything here
   is transform/opacity only and is disabled wholesale by the reduced-motion
   rule at the end of this file. Nothing below affects hit targets or contrast. */

/* --- scroll reveal (public pages) + load reveal (app) --------------------- */
[data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
html:not(.js) [data-reveal] { opacity: 1; transform: none; } /* no JS -> no hiding */

/* --- buttons get a light sweep on hover ---------------------------------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg); opacity: 0; pointer-events: none;
}
.btn:hover::after { animation: btn-sweep 0.75s var(--ease); }
@keyframes btn-sweep { from { left: -60%; opacity: 1; } to { left: 130%; opacity: 0; } }
.btn-ghost::after, .btn-subtle::after, .btn-danger::after { display: none; }

/* --- animated gradient border (login card, plan cards) ------------------- */
@property --beam-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.beam { position: relative; }
.beam::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--beam-angle),
    color-mix(in srgb, var(--c-primary) 85%, transparent),
    transparent 22%,
    color-mix(in srgb, var(--c-accent) 75%, transparent) 50%,
    transparent 78%,
    color-mix(in srgb, var(--c-primary) 85%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam-spin 7s linear infinite;
  pointer-events: none; opacity: 0.9;
}
@keyframes beam-spin { to { --beam-angle: 360deg; } }

/* --- hero: text beside an animated product mockup ------------------------ */
.hero-split {
  position: relative; z-index: 1;
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 48px; align-items: center;
}
.hero-copy { text-align: left; }
.hero-copy .mk2-cta-row { justify-content: flex-start; }
.hero-copy .mk2-hero-sub { margin-left: 0; }

.hero-stage {
  position: relative; display: grid; place-items: center; min-height: 460px;
  perspective: 1400px;      /* gives the pointer tilt real depth */
}
/* The glow takes its hue from whichever product is on screen, so the whole
   stage shifts with the story instead of sitting on one colour. */
.stage-glow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--scene-hue, var(--c-primary)) 34%, transparent), transparent 66%);
  animation: stage-pulse 7s ease-in-out infinite alternate;
  transition: background 0.6s var(--ease);
}
.hero-stage[data-scene="0"] { --scene-hue: var(--c-primary); }
.hero-stage[data-scene="1"] { --scene-hue: var(--c-warning); }
.hero-stage[data-scene="2"] { --scene-hue: var(--c-blue); }
.hero-stage[data-scene="3"] { --scene-hue: var(--c-accent); }
@keyframes stage-pulse { from { transform: scale(0.94); opacity: 0.75; } to { transform: scale(1.08); opacity: 1; } }

/* the phone */
.phone {
  position: relative; width: 268px; height: 430px; border-radius: 34px; padding: 9px;
  background: linear-gradient(160deg, #2a3346, #10151f);
  box-shadow: 0 30px 70px rgba(10, 14, 22, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: phone-float 8s ease-in-out infinite alternate;
  /* The idle float drives the individual `translate`/`rotate` properties rather
     than `transform`, which leaves `transform` free for the pointer tilt below.
     A keyframe on `transform` would otherwise win over it outright. */
  transform: rotateY(var(--tilt-x, 0deg)) rotateX(var(--tilt-y, 0deg));
  transition: transform 0.35s var(--ease);
  transform-style: preserve-3d;
}
@keyframes phone-float {
  from { translate: 0 -8px; rotate: -1.2deg; }
  to   { translate: 0 8px;  rotate: 1.2deg; }
}
.phone-notch {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 74px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); z-index: 2;
}
.phone-screen {
  height: 100%; border-radius: 26px; overflow: hidden; background: #fff; color: #14181f;
  display: flex; flex-direction: column; font-size: 11px;
  text-align: left; /* the hero centres its text; a menu list must not inherit that */
}
.ph-cover { height: 62px; background: var(--grad-spectrum); flex: none; }
.ph-head { display: flex; align-items: center; gap: 7px; padding: 8px 11px 6px; flex: none; }
.ph-logo {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: var(--grad-spectrum); color: #fff;
  font-family: var(--font-display); font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.ph-title { font-weight: 700; font-size: 12px; }
.ph-ctx { margin-left: auto; display: grid; }        /* all pills share one cell */
.ph-table {
  grid-area: 1 / 1; justify-self: end; white-space: nowrap;
  font-size: 9.5px; font-weight: 600; color: #0b7f75; background: #dcf4f1;
  padding: 2px 7px; border-radius: 999px;
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.ph-chips { display: flex; gap: 5px; padding: 2px 11px 8px; flex: none; }
.ph-chips span { font-size: 9px; padding: 3px 9px; border-radius: 999px; background: #eef1f6; color: #5d6878; }
.ph-chips span.on { background: #0f9a8e; color: #fff; }
.ph-list { padding: 0 11px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.ph-list-tight { gap: 5px; padding-top: 10px; }
.ph-item {
  display: flex; align-items: center; gap: 8px;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
/* `backwards` + no base opacity: the element's natural state is visible, so if
   the animation never runs (reduced motion, print, an old engine) nothing is
   left invisible — the delay simply shows the `from` frame first. */
@keyframes ph-in { from { opacity: 0; transform: translateY(10px); } }
.ph-thumb { width: 30px; height: 30px; border-radius: 8px; flex: none; background: linear-gradient(135deg, #e8edf5, #d7dfeb); }
.ph-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ph-lines b { font-size: 10.5px; }
.ph-lines i { font-style: normal; font-size: 9.5px; color: #6b7686; }
.ph-add {
  width: 20px; height: 20px; border-radius: 6px; flex: none; display: grid; place-items: center;
  background: #dcf4f1; color: #0b7f75; font-weight: 700; font-size: 12px;
}
.ph-item.added .ph-add { background: #0f9a8e; color: #fff; }
.ph-bar {
  margin: 8px; padding: 8px 10px; border-radius: 12px; flex: none;
  background: #12161f; color: #fff; display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; animation: ph-in 0.45s var(--ease) 0.42s backwards;
}
.ph-cta { background: var(--grad-brand); padding: 4px 10px; border-radius: 8px; font-weight: 700; }

/* --- the phone cycles through four screens ------------------------------- */
/* Scenes stack in one cell, so swapping one cannot move a single pixel of the
   page around it. Everything keys off one attribute on the stage — the script
   only ever writes data-scene, and with no script at all the markup's
   data-scene="0" leaves a perfectly good static hero. */
.ph-stage { position: relative; flex: 1; min-height: 0; }
.ph-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}
.hero-stage[data-scene="0"] .ph-scene[data-i="0"],
.hero-stage[data-scene="1"] .ph-scene[data-i="1"],
.hero-stage[data-scene="2"] .ph-scene[data-i="2"],
.hero-stage[data-scene="3"] .ph-scene[data-i="3"] { opacity: 1; visibility: visible; }

/* Off-screen scenes hold their entrance frame, so the stagger replays every
   time a scene comes back round instead of only on first paint. */
.ph-scene { animation-play-state: paused; }
.ph-scene :is(.ph-item, .ph-tick, .ph-row, .ph-kpi, .ph-bars, .ph-pay, .ph-bar, .ph-cap, .ph-split) { animation-play-state: paused; }
.hero-stage[data-scene="0"] .ph-scene[data-i="0"] *,
.hero-stage[data-scene="1"] .ph-scene[data-i="1"] *,
.hero-stage[data-scene="2"] .ph-scene[data-i="2"] *,
.hero-stage[data-scene="3"] .ph-scene[data-i="3"] * { animation-play-state: running; }

.hero-stage[data-scene="0"] .ph-table[data-for="0"],
.hero-stage[data-scene="1"] .ph-table[data-for="1"],
.hero-stage[data-scene="2"] .ph-table[data-for="2"],
.hero-stage[data-scene="3"] .ph-table[data-for="3"] { opacity: 1; }

/* kitchen tickets */
.ph-tick {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px;
  background: #f5f7fa; border-left: 3px solid #98a1b0;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-tick.tone-warn { border-left-color: #d98a09; background: #fdf6e9; }
.ph-tick.tone-ok   { border-left-color: #149256; background: #eaf7f0; }
.ph-tick.tone-new  { border-left-color: #1d84cf; background: #eaf3fb; }
.ph-state { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #5d6878; }

/* POS ticket rows */
.ph-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10.5px; padding: 3px 0;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-row.muted-row { color: #6b7686; }
.ph-total { border-top: 1px dashed #d7dfeb; margin-top: 3px; padding-top: 6px; font-size: 12px; font-weight: 700; }
.ph-pay {
  display: flex; gap: 5px; margin-top: 8px;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-pay span { flex: 1; text-align: center; font-size: 9px; font-weight: 600; padding: 5px 0; border-radius: 8px; background: #eef1f6; color: #5d6878; }
.ph-pay span.on { background: #0f9a8e; color: #fff; }

/* insights */
.ph-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 11px 0; }
.ph-kpi {
  padding: 7px 9px; border-radius: 9px; background: #f5f7fa;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-kpi i { display: block; font-style: normal; font-size: 8.5px; color: #6b7686; text-transform: uppercase; letter-spacing: 0.05em; }
.ph-kpi b { display: block; font-size: 14px; letter-spacing: -0.3px; }
.ph-kpi em { font-style: normal; font-size: 8.5px; font-weight: 700; color: #149256; }
.ph-bars {
  display: flex; align-items: flex-end; gap: 4px; height: 68px; padding: 12px 11px 0;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-bars span { flex: 1; height: var(--h); border-radius: 3px 3px 1px 1px; background: var(--grad-brand); opacity: 0.9; }
.ph-cap {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #98a1b0;
  padding-top: 2px;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-split {
  display: flex; gap: 2px; height: 7px; margin-top: 6px;
  animation: ph-in 0.45s var(--ease) backwards; animation-delay: var(--d);
}
.ph-split span { width: var(--w); border-radius: 999px; }
.ph-split span:nth-child(1) { background: #0f9a8e; }
.ph-split span:nth-child(2) { background: #1d84cf; }
.ph-split span:nth-child(3) { background: #7c5cfc; }
.ph-split span:nth-child(4) { background: #d9a441; }

/* scene indicator */
.ph-dots { display: flex; justify-content: center; gap: 5px; padding: 0 0 9px; flex: none; }
.ph-dot {
  width: 5px; height: 5px; border-radius: 999px; background: #d7dfeb;
  background-image: linear-gradient(#0f9a8e, #0f9a8e);
  background-repeat: no-repeat; background-size: 0% 100%;
  transition: width var(--t-med) var(--ease);
}
/* The active dot fills over the two seconds it is held, so the visitor can see
   the story is moving rather than being surprised by it. The rule stops
   matching when data-scene changes, so the fill restarts on the next dot. */
.hero-stage[data-scene="0"] .ph-dot[data-i="0"],
.hero-stage[data-scene="1"] .ph-dot[data-i="1"],
.hero-stage[data-scene="2"] .ph-dot[data-i="2"],
.hero-stage[data-scene="3"] .ph-dot[data-i="3"] {
  width: 18px;
  animation: dot-fill 2s linear forwards;
}
@keyframes dot-fill { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

/* cards that float beside the phone */
.float-card {
  position: absolute; border-radius: 14px; padding: 11px 13px; font-size: 11.5px; line-height: 1.45;
  background: color-mix(in srgb, var(--c-card) 96%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--c-line-strong); box-shadow: var(--shadow-lg); color: var(--c-ink);
  animation: fc-in 0.55s var(--ease) backwards;
}
@keyframes fc-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } }
/* Two fixed berths; whichever pair belongs to the live scene is shown, so the
   cards cross-fade in place instead of hopping around the hero. Inside the
   rotating stage the entrance keyframes are dropped — a keyframe outranks a
   declaration, so leaving them on would flash all eight cards at load. */
.fc-a { right: 2%; top: 7%; animation-delay: 0.5s; }
.fc-b { left: 0; bottom: 19%; animation-delay: 0.8s; }
.hero-stage[data-scenes] .float-card {
  animation: none; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.97);
  /* Parallax: the cards sit in front of the phone, so they move further than it
     does under the pointer. Driven through `translate` so the cross-fade keeps
     `transform` to itself. */
  translate: calc(var(--par-x, 0px) * 1.6) calc(var(--par-y, 0px) * 1.6);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
              visibility 0.45s, translate 0.35s var(--ease);
}
.hero-stage[data-scenes] .fc-b { transition-delay: 0.12s; }
.hero-stage[data-scene="0"] .float-card[data-for="0"],
.hero-stage[data-scene="1"] .float-card[data-for="1"],
.hero-stage[data-scene="2"] .float-card[data-for="2"],
.hero-stage[data-scene="3"] .float-card[data-for="3"] { opacity: 1; visibility: visible; transform: none; }
.float-card b { display: block; font-size: 12.5px; }
.float-card .muted { font-size: 10.5px; }
.fc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-success); margin-right: 5px; }

/* --- trust strip --------------------------------------------------------- */
.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  margin-top: 44px; position: relative; z-index: 1;
}
.trust-strip span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--c-muted);
}
.trust-strip svg { width: 15px; height: 15px; color: var(--c-primary); }

/* --- login: product motion in the hero panel ----------------------------- */
.auth-showcase { position: relative; margin-top: 34px; height: 128px; }
.auth-showcase .float-card { position: absolute; animation-duration: 0.8s; }
.auth-showcase .fc-1 { left: 0; top: 0; animation-delay: 0.35s; }
.auth-showcase .fc-2 { left: 92px; top: 46px; animation-delay: 0.6s; }
.auth-showcase .fc-3 { left: 18px; top: 88px; animation-delay: 0.85s; }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 940px) {
  .hero-split { grid-template-columns: 1fr; gap: 30px; }
  .hero-copy { text-align: center; }
  .hero-copy .mk2-cta-row { justify-content: center; }
  .hero-copy .mk2-hero-sub { margin-left: auto; margin-right: auto; }
  .hero-stage { min-height: 400px; }
}
@media (max-width: 560px) {
  .phone { width: 226px; height: 372px; }
  .fc-kds { left: 0; top: 6%; }
  .fc-pay { right: 0; bottom: 10%; }
  .fc-scan { display: none; }
  .auth-showcase { display: none; }
}

/* ================================================== 17. dashboard ========= */
/* One vertical rhythm for the whole dashboard, and one column seam: every
   two-column row splits at the same x and both cards share a height. */
.dash { display: flex; flex-direction: column; gap: var(--sp-4); }
.dash > * { margin: 0; }
.dash .stat-grid { margin-bottom: 0; }
.dash-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4);
  align-items: stretch;
}
.dash-row > .card { margin-top: 0; }
@media (max-width: 940px) { .dash-row { grid-template-columns: 1fr; } }

.dash-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 8px;
}
.dash-range { flex-wrap: nowrap; }
.dash-sub { margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
/* explanatory footnote under a panel — never competes with the content above it */
.dash-note { margin: var(--sp-4) 0 0; font-size: var(--fs-xs); max-width: 78ch; }
.dash-note code {
  font-size: 0.94em; padding: 1px 5px; border-radius: 5px;
  background: var(--c-inset); color: var(--c-ink);
}
.dash-sep { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--c-line-strong); }

/* six headline cards should sit on one row on a desktop rather than leaving
   a single orphan below the others */
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.dash-delta { margin-top: 6px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dash-delta .muted { font-weight: 500; }
.dash-delta.is-good { color: var(--c-success); }
.dash-delta.is-bad { color: var(--c-danger); }
.dash-delta.is-flat { color: var(--c-muted); }
.dash-arrow { font-size: 10px; }

.dash-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.dash-head h3 { margin: 0; }
.dash-head .muted { font-size: var(--fs-sm); }

/* revenue chart */
.chart { position: relative; color: var(--c-primary); }
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart-grid { stroke: var(--c-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-line {
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.chart-dot { fill: var(--c-card); stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-x { position: relative; height: 18px; margin-top: 6px; }
.chart-x span {
  position: absolute; transform: translateX(-50%); white-space: nowrap;
  font-size: var(--fs-xs); color: var(--c-faint);
}

/* hours-of-day columns */
.hours { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.hour-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.hour-bar {
  width: 100%; border-radius: 4px 4px 2px 2px; min-height: 2px;
  background: var(--grad-brand); opacity: 0.85;
  transition: opacity var(--t-fast);
}
.hour-col:hover .hour-bar { opacity: 1; }
.hour-tick { font-size: 10px; color: var(--c-faint); margin-top: 4px; }

/* ranked bars (top items, payments) */
.rank-row {
  display: grid; grid-template-columns: minmax(90px, 1.4fr) 2fr auto auto;
  align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm);
}
.rank-row:last-child { border-bottom: none; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.rank-track { height: 8px; border-radius: 999px; background: var(--c-inset); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }
.rank-fill.alt { background: linear-gradient(135deg, var(--c-blue), var(--c-accent)); }
.rank-qty { font-size: var(--fs-xs); }

/* channel split */
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--c-inset); }
.split-seg { display: block; height: 100%; }
.seg-0 { background: var(--c-primary); }
.seg-1 { background: var(--c-blue); }
.seg-2 { background: var(--c-accent); }
.seg-3 { background: var(--c-warning); }
.split-legend { display: flex; flex-direction: column; gap: 8px; margin-top: var(--sp-4); }
.split-key { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); text-transform: capitalize; }
.split-key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.split-key b { margin-left: auto; }
.split-key .muted { font-size: var(--fs-xs); min-width: 110px; text-align: right; }

/* right-now tiles */
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.live-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-card) 55%, var(--c-bg));
  text-decoration: none; color: inherit;
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.live-tile:hover {
  border-color: color-mix(in srgb, var(--c-primary) 45%, transparent);
  background: color-mix(in srgb, var(--c-primary) 7%, var(--c-card));
  transform: translateY(-1px);
}
.live-tile b { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.live-tile span { font-size: var(--fs-xs); color: var(--c-muted); }

@media (max-width: 720px) {
  .dash-controls { flex-direction: column; align-items: stretch; }
  .dash-range { flex-wrap: wrap; }
  .rank-row { grid-template-columns: minmax(80px, 1fr) 1.4fr auto; }
  .rank-qty { display: none; }
  .chart svg { height: 180px; }
}

/* ================================================== 18. audit log ========= */
/* A trail is read as a story, not a spreadsheet: one rail down the page, a
   dot per event coloured by how much it matters, and the person who did it
   named before the thing that was done. Built from the dashboard's rhythm
   (.dash / .stat-grid / .dash-controls) so it lines up with every other page. */

/* --- pulse band ---------------------------------------------------------- */
.au-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--sp-6); align-items: center; overflow: hidden;
}
.au-hero-copy h3 { margin: 6px 0 8px; }
.au-hero-copy p { margin: 0; font-size: var(--fs-sm); max-width: 52ch; }
.au-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-primary);
}
.au-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-primary) 55%, transparent);
  animation: au-ping 2.4s var(--ease) infinite;
}
@keyframes au-ping {
  70%  { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c-primary) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-primary) 0%, transparent); }
}
.au-pulse { color: var(--c-primary); min-width: 0; }
.au-pulse svg { width: 100%; height: 90px; display: block; overflow: visible; }
.au-pulse-cap { display: block; margin-top: 8px; font-size: var(--fs-xs); text-align: right; }

/* --- filter bar ---------------------------------------------------------- */
.au-filter-form {
  display: grid; gap: var(--sp-3); align-items: end;
  grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(150px, 1.2fr)) repeat(2, minmax(130px, 0.8fr)) auto;
}
.au-filter-form :is(input, select) { min-height: var(--control-h-sm); }
.au-f-actions { display: flex; gap: 8px; }
.au-filter-note { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); }

/* --- day divider --------------------------------------------------------- */
.au-day { display: flex; align-items: center; gap: 10px; margin: var(--sp-5) 0 var(--sp-3); }
.au-day:first-child { margin-top: 0; }
.au-day-pill {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  background: var(--c-inset); color: var(--c-muted);
}
.au-day-line { flex: 1; height: 1px; background: var(--c-line); }
.au-day-count { font-size: var(--fs-xs); white-space: nowrap; }

/* --- the rail ------------------------------------------------------------ */
.au-timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.au-timeline::before {
  content: ''; position: absolute; left: 20px; top: 6px; bottom: 6px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--c-primary) 42%, transparent),
    var(--c-line) 55%, transparent);
}
.au-entry {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px; align-items: start; padding: 9px 0;
}

/* dot: the tone tells you at a glance whether money left the building */
.au-dot {
  position: relative; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-card); border: 2px solid var(--au-tone, var(--c-info));
  color: var(--au-tone, var(--c-info));
  box-shadow: 0 0 0 4px var(--c-card);
}
.au-dot svg { width: 15px; height: 15px; }
.tone-success { --au-tone: var(--c-success); }
.tone-warning { --au-tone: var(--c-warning); }
.tone-danger  { --au-tone: var(--c-danger); }
.tone-info    { --au-tone: var(--c-info); }

.au-body {
  min-width: 0; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: 10px 13px; background: color-mix(in srgb, var(--c-card) 60%, var(--c-bg));
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.au-entry:hover .au-body {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--au-tone) 45%, transparent);
  background: color-mix(in srgb, var(--au-tone) 6%, var(--c-card));
}
.au-entry.is-flagged .au-body { border-left: 3px solid var(--au-tone); }

.au-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-sm); }
.au-who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.au-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; background: linear-gradient(140deg,
    hsl(var(--au-hue, 190) 62% 48%), hsl(calc(var(--au-hue, 190) + 34) 64% 40%));
}
.au-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.au-what { color: var(--c-ink); }
.au-subject {
  font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--c-inset); color: var(--c-muted); white-space: nowrap;
}
.au-flag { font-size: 10px; }
.au-when { margin-left: auto; font-size: var(--fs-xs); color: var(--c-faint); white-space: nowrap; }
.au-ago { margin-left: 5px; }

.au-kvs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.au-kv {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: var(--fs-xs); padding: 3px 9px; border-radius: var(--radius-xs);
  background: var(--c-inset);
}
.au-kv i { font-style: normal; color: var(--c-faint); }
.au-kv b { color: var(--c-ink); font-weight: 600; }

@media (max-width: 940px) {
  .au-hero { grid-template-columns: 1fr; gap: var(--sp-4); }
  .au-pulse-cap { text-align: left; }
  .au-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .au-f-search, .au-f-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .au-filter-form { grid-template-columns: 1fr; }
  .au-when { margin-left: 0; width: 100%; }
  .au-email { max-width: 16ch; }
}

/* Counter orders (takeaway / delivery) sit beside the table picker on the POS:
   they need no table, so they must not look like they are waiting for one. */
.pos-counter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-line);
}
.pos-counter .muted { font-size: var(--fs-xs); margin-right: 2px; }

/* POS floor map — every table as a status pill for one-tap open / resume. */
.pos-tables-card { margin-bottom: 0; }
.pos-tables-card.is-compact .pos-tables-head p { display: none; }
.pos-tables-card.is-compact .pos-table-pills {
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.pos-tables-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 14px;
}
.pos-top-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
}
.pos-status-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.pos-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--c-muted); font-weight: 600;
}
.pos-legend-item i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: var(--c-faint);
}
.pos-legend-item.tone-available i { background: var(--c-success); }
.pos-legend-item.tone-occupied i { background: var(--c-warning); }
.pos-legend-item.tone-reserved i { background: var(--c-accent); }

.pos-floor-group + .pos-floor-group { margin-top: 14px; }
.pos-tables-card.is-compact .pos-floor-group + .pos-floor-group { margin-top: 8px; }
.pos-floor-label {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-muted); margin-bottom: 8px;
}
.pos-table-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pos-table-pill-form { display: contents; }
.pos-table-pill {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 2px; min-width: 72px; padding: 10px 14px;
  border-radius: 999px; border: 1px solid var(--c-line-strong);
  background: var(--c-card); color: var(--c-ink);
  font: inherit; text-decoration: none; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.pos-table-pill b {
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.1;
}
.pos-table-pill span {
  font-size: 11px; color: var(--c-muted); font-variant-numeric: tabular-nums;
}
.pos-table-pill:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.pos-table-pill.tone-available {
  background: color-mix(in srgb, var(--c-success) 10%, var(--c-card));
  border-color: color-mix(in srgb, var(--c-success) 35%, var(--c-line-strong));
}
.pos-table-pill.tone-available span { color: var(--c-success); }
.pos-table-pill.tone-occupied {
  background: color-mix(in srgb, var(--c-warning) 12%, var(--c-card));
  border-color: color-mix(in srgb, var(--c-warning) 40%, var(--c-line-strong));
}
.pos-table-pill.tone-occupied span { color: var(--c-warning); }
.pos-table-pill.tone-reserved {
  background: color-mix(in srgb, var(--c-accent) 12%, var(--c-card));
  border-color: color-mix(in srgb, var(--c-accent) 40%, var(--c-line-strong));
}
.pos-table-pill.tone-reserved span { color: var(--c-accent); }
.pos-table-pill.is-active {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 560px) {
  .pos-table-pill { min-width: 64px; padding: 9px 12px; }
  .pos-print-row { grid-template-columns: 1fr; }
  .pos-ticket-pane { position: static; max-height: none; }
}

/* --- GST tax invoice ------------------------------------------------------
   A tax invoice has to carry an HSN/SAC summary. On an 80mm roll that means
   a compact three or four column table that still reads after a thermal print. */
.print-doc-title { font-weight: 700; letter-spacing: 0.08em; margin-top: 2px; }
.print-sub { font-weight: 700; font-size: 11px; margin: 6px 0 3px; }
.print-hsn { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.print-hsn th, .print-hsn td { padding: 2px 0; text-align: left; }
.print-hsn th { border-bottom: 1px solid #000; font-weight: 700; }
.print-hsn .r { text-align: right; }
.print-rate { font-weight: 400; }
.print-note-sm { font-size: 10px; margin-top: 4px; }

/* --- UPI collection -------------------------------------------------------
   Read across a counter by a guest holding a phone: the amount is the biggest
   thing on screen, the QR is next, and everything else is reference detail. */
.upi-pane { max-width: var(--pane-narrow); margin-inline: auto; text-align: center; }
.upi-pane .dash-head { justify-content: center; text-align: center; flex-direction: column; gap: 2px; }
.upi-amount {
  font-family: var(--font-display); font-size: 42px; font-weight: 700;
  letter-spacing: -1px; margin: var(--sp-2) 0 var(--sp-4);
}
.upi-qr {
  width: 320px; max-width: 100%; height: auto; border-radius: var(--radius-sm);
  background: #fff; padding: 10px; border: 1px solid var(--c-line-strong);
}
.upi-facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3) var(--sp-5);
  margin: var(--sp-4) 0 0;
}
.upi-facts div { display: flex; flex-direction: column; gap: 2px; }
.upi-facts dt { font-size: var(--fs-xs); color: var(--c-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.upi-facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.upi-facts code { background: var(--c-inset); padding: 2px 7px; border-radius: var(--radius-xs); }
.upi-pane .dash-note { margin-inline: auto; text-align: left; }
.upi-actions { display: flex; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }

/* --- guest feedback -------------------------------------------------------
   The distribution matters more than the average: four 5s and a 1 is a very
   different restaurant from five 4s, and only the bars show that. */
.fb-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-5); align-items: center; }
.fb-score { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 130px; }
.fb-score b { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -1.5px; }
.fb-stars { display: inline-flex; gap: 1px; color: var(--c-line-strong); font-size: 15px; }
.fb-stars i { font-style: normal; }
.fb-stars i.on { color: var(--c-warning); }
.fb-stars.small { font-size: 13px; }
.fb-bars { display: flex; flex-direction: column; gap: 4px; }
.fb-bar-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; align-items: center; gap: 8px; font-size: var(--fs-xs); }
.fb-bar-track { height: 8px; border-radius: 999px; background: var(--c-inset); overflow: hidden; }
.fb-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--c-warning); }
.fb-bar-fill.s5, .fb-bar-fill.s4 { background: var(--c-success); }
.fb-bar-fill.s2, .fb-bar-fill.s1 { background: var(--c-danger); }
.fb-bar-n { text-align: right; }
.fb-callout {
  grid-column: 1 / -1; font-size: var(--fs-sm);
  padding: 9px 13px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-danger) 9%, transparent);
  color: var(--c-danger);
}
.fb-review { padding: 11px 0; border-bottom: 1px solid var(--c-line); }
.fb-review:last-child { border-bottom: none; }
.fb-review.is-hidden { opacity: 0.62; }
.fb-review-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: var(--fs-sm); }
.fb-review-act { margin-left: auto; }
.fb-review-body { margin: 6px 0 0; font-size: var(--fs-sm); max-width: 80ch; }

@media (max-width: 720px) {
  .fb-summary { grid-template-columns: 1fr; }
  .fb-review-act { margin-left: 0; }
}

/* Guest star picker: rendered right-to-left so a CSS sibling selector can
   light up the hovered star and every one before it, with no JavaScript. */
.guest-rate { text-align: center; }
.guest-rate h3 { margin-top: 0; }
.guest-rate form { display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; }
.guest-rate input[type="text"] { max-width: 420px; width: 100%; }
.guest-stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.guest-stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.guest-stars label {
  font-size: 34px; line-height: 1; cursor: pointer; color: var(--c-line-strong);
  transition: color var(--t-fast), transform var(--t-fast);
}
.guest-stars label:hover, .guest-stars label:hover ~ label,
.guest-stars input:checked, .guest-stars input:checked ~ label { color: var(--c-warning); }
.guest-stars label:hover { transform: scale(1.12); }
.guest-stars input:focus-visible + label { outline: 2px solid var(--c-primary); outline-offset: 3px; border-radius: 4px; }

/* --- POS item options -----------------------------------------------------
   A server-rendered app has no modal, so choosing a size is its own step —
   shown above the menu grid rather than replacing it, so the cashier keeps
   their place. */
.pos-options {
  border: 1px solid color-mix(in srgb, var(--c-primary) 35%, transparent);
  border-radius: var(--radius-sm); padding: var(--sp-4); margin-bottom: var(--sp-4);
  background: color-mix(in srgb, var(--c-primary) 5%, var(--c-card));
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.pos-options-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pos-opt-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pos-opt-label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--c-muted); min-width: 62px;
}
.pos-opt-group .chip { cursor: pointer; }
.pos-opt-group .chip:has(:checked) {
  background: color-mix(in srgb, var(--c-primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--c-primary) 45%, transparent);
  color: var(--c-primary-strong);
}
.pos-opt-group .chip input { margin-right: 5px; }
.ticket-mods { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
a.pos-product { text-decoration: none; }



/* ---- landing: order lifecycle ---------------------------------------------
   Uses --c-accent (the violet already in the token set) rather than the teal
   --c-primary the rest of the page runs on. That is deliberate: this section is
   a sequence, and giving it its own hue stops it reading as a second copy of
   the three-step setup block further down. Both tokens are existing brand
   colours, so no new palette enters the system. -------------------------- */
.mk2-flow {
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.mk2-flow-step {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 22px 18px 20px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.mk2-flow-step:hover {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--c-accent) 40%, var(--c-line));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--c-accent) 16%, transparent);
}
.mk2-flow-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: #fff; background: var(--c-accent);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--c-accent) 34%, transparent);
}
.mk2-flow-step h3 { margin: 4px 0 0; font-size: 16px; letter-spacing: -0.3px; }
.mk2-flow-lead { margin: 0; font-size: 13.5px; color: var(--c-accent); font-weight: 600; }
.mk2-flow-step ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; }
.mk2-flow-step ul li {
  position: relative; padding-left: 15px;
  font-size: 13px; line-height: 1.5; color: var(--c-muted);
}
.mk2-flow-step ul li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: color-mix(in srgb, var(--c-accent) 55%, transparent);
}

/* The rail joining the badges. Decorative only, and drawn just for the row
   where the cards actually sit side by side. */
@media (min-width: 1000px) {
  .mk2-flow::before {
    content: ""; position: absolute; z-index: 0;
    top: 37px; left: 10%; right: 10%; height: 2px;
    background: linear-gradient(90deg,
      transparent,
      color-mix(in srgb, var(--c-accent) 30%, transparent) 12%,
      color-mix(in srgb, var(--c-accent) 30%, transparent) 88%,
      transparent);
  }
  .mk2-flow-step { z-index: 1; }
}

/* ---- landing: how this compares -------------------------------------------
   Our column is the only one that carries the accent. Everything else stays in
   the neutral ramp, so the eye lands on the claim being made rather than on a
   table full of competing colour. The gaps block below reuses the SAME type
   sizes as the table: a smaller, greyer "limitations" note reads as a disclaimer
   somebody was made to write, which is exactly the wrong impression. -------- */
.mk2-compare-wrap {
  overflow-x: auto;                       /* wide table scrolls, page never does */
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-card);
  -webkit-overflow-scrolling: touch;
}
.mk2-compare { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.mk2-compare th, .mk2-compare td {
  text-align: left; vertical-align: top;
  padding: 14px 16px; line-height: 1.55;
  border-bottom: 1px solid var(--c-line);
}
.mk2-compare tbody tr:last-child th,
.mk2-compare tbody tr:last-child td { border-bottom: 0; }
.mk2-compare thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-muted); font-weight: 600;
  background: var(--c-inset); white-space: nowrap;
}
.mk2-compare tbody th { font-weight: 600; color: var(--c-ink); white-space: nowrap; }
.mk2-compare td { color: var(--c-muted); }

/* The one column we are selling. A left rule rather than a fill: a solid tinted
   column at this width turns into a block of colour and stops reading as text. */
.mk2-compare .is-us {
  color: var(--c-ink);
  background: color-mix(in srgb, var(--c-primary) 6%, transparent);
  border-left: 2px solid var(--c-primary);
  border-right: 1px solid var(--c-line);
}
.mk2-compare thead th.is-us { color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 11%, var(--c-inset)); }

/* Marks. Colour alone must not carry the meaning -- each glyph differs in shape
   too, and every mark ships a visually-hidden word for screen readers, so the
   table still parses without colour vision. */
.mk2-mark {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; margin-right: 7px; vertical-align: -3px;
  border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1;
}
.mk2-mark-yes   { background: color-mix(in srgb, var(--c-success) 16%, transparent); color: var(--c-success); }
.mk2-mark-addon { background: color-mix(in srgb, var(--c-warning) 18%, transparent); color: var(--c-warning); }
.mk2-mark-info  { background: var(--c-inset); color: var(--c-muted); }

.mk2-legend { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.mk2-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mk2-legend li { display: flex; align-items: center; font-size: 12.5px; color: var(--c-muted); }
.mk2-legend p  { margin: 0; font-size: 12.5px; color: var(--c-muted); flex: 1 1 260px; }


/* ==================================================== 14. responsive ======
   Measured, not guessed. Every rule below fixes something observed by
   rendering all 40 admin screens at 1440 / 834 / 390 and measuring the DOM.
   -------------------------------------------------------------------------- */

/* --- 14a. tables scroll instead of crushing ------------------------------
   `.card:has(.table)` already scrolls, but `.table { width: 100% }` with no
   floor means the browser squeezes columns to fit rather than overflowing, so
   the scroll never engages. On a 390px screen that turned "Slow-roasted lamb
   shoulder with rosemary" into five stacked words and a 120px-tall row.
   A min-width makes the table keep its shape and the card scroll, which is
   both readable and the behaviour people expect of a data grid on a phone. */
@media (max-width: 860px) {
  .card:has(.table) { -webkit-overflow-scrolling: touch; }
  .card > .table,
  .card > form > .table { min-width: 660px; }

  /* Momentum-scroll hint: a soft edge tells you there is more to the right
     without spending vertical space on a scrollbar that phones hide anyway. */
  .card:has(.table) {
    background-image: linear-gradient(to right, transparent calc(100% - 28px), color-mix(in srgb, var(--c-ink) 6%, transparent));
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: local;
  }
}

/* --- 14b. form rows stack rather than crush ------------------------------
   `.form-row` is a SUBGRID, not the flexbox it looks like, and its bare
   controls are pinned with `grid-row: 2`. Below ~560px only one explicit
   column fits, so three pinned inputs spill into implicit columns and share
   one line: "Item name" kept 170px while Price and Category were squeezed to
   65px each and rendered as "Pric" and "— ca".

   Below the breakpoint the row becomes a single column and nothing is pinned,
   so each control gets its own line. Specificity has to beat
   `.form-row > :is(input, select, textarea)`, hence the class in the :is().  */
@media (max-width: 560px) {
  @supports (grid-template-rows: subgrid) {
    .form-row {
      grid-template-columns: 1fr;
      row-gap: var(--sp-2);
    }
    .form-row > :is(input, select, textarea, button, .btn, .field) {
      grid-row: auto;
      grid-column: 1;
    }
    /* The field keeps its own label/control/hint stack once it is no longer
       borrowing the parent's lines. */
    .form-row > .field {
      grid-template-rows: auto auto auto;
      row-gap: 4px;
    }
    /* A full-width primary action is easier to hit than a 92px one. */
    .form-row > :is(button, .btn) { justify-self: stretch; }
  }
}

/* --- 14b-ii. toolbars ----------------------------------------------------
   `.toolbar` is a flex row that several pages space with `<span style="flex:1">`.
   When it wraps, that spacer keeps its line and pushes the action above the
   heading it belongs to — which is what made "Download import template" sit
   over "Menu items". Collapse the spacer and stack deliberately instead. */
@media (max-width: 700px) {
  .toolbar { align-items: stretch; }
  .toolbar > span[style*="flex"] { display: none; }
  .toolbar > h3 { flex: 1 1 100%; }
}

/* --- 14c. section headers ------------------------------------------------
   `.dash-head` is `align-items: baseline`, which on wrap left the action
   button sitting above the heading it belongs to. Stack it deliberately and
   put the action back under its title. */
@media (max-width: 560px) {
  .dash-head { align-items: stretch; flex-direction: column; gap: var(--sp-2); }
  .dash-head > .btn, .dash-head > form { align-self: flex-start; }
}

/* --- 14d. touch targets --------------------------------------------------
   Measured 178 controls under 40px on Orders at 390px. 44px is the accepted
   floor for a fingertip; 40 is the compromise that keeps dense tables usable
   while still being reliably hittable. */
@media (max-width: 560px) {
  :is(.btn, .icon-btn, .theme-toggle, .user-pop-item) { min-height: 40px; }
  /* Beats `.topbar-actions :is(.btn, .icon-btn, .theme-toggle)`, which pins the
     header controls to 36px for desktop density. */
  .topbar-actions :is(.btn, .icon-btn, .theme-toggle) { min-height: 40px; }
  .user-pop .user-pop-item { min-height: 42px; }
  .btn-sm { min-height: 40px; padding-inline: 12px; }
  .pager .btn { min-height: 40px; }
  .table :is(.btn, .btn-sm) { min-height: 36px; }   /* inside a scrolling grid */
}

/* --- 14e. action columns line up ----------------------------------------
   The Orders table reads as "misaligned" because each row carries a different
   number of buttons, so nothing forms a column. Right-aligning the group and
   refusing to wrap gives every row the same right edge, which is the edge the
   eye actually tracks down. */
.table td.right .row-actions,
.table td .row-actions { justify-content: flex-end; }
/* Inside a table the actions must NOT wrap: the grid already scrolls
   horizontally, so wrapping only buys a taller row, and a row that grows from
   44px to 120px because it has three buttons is what breaks the eye's track
   down the column. */
.table .row-actions { display: flex; flex-wrap: nowrap; gap: var(--sp-2); align-items: center; }
.table td { white-space: nowrap; }
/* Names and addresses still need to breathe — only the action cells are pinned. */
.table td:not(.right):not(:last-child) { white-space: normal; }
.table :is(.row-actions, .row-form) .btn { white-space: nowrap; }
/* Equal minimum width stops "Pay" and "Refund" from staggering the row. */
.table .row-actions > .btn, .table .row-actions form > .btn { min-width: 62px; justify-content: center; }

/* --- 14f. money must not disturb the text around it ---------------------
   Money is symbol + digits. With an RTL symbol (AED "د.إ") the two runs join
   into a single right-to-left run, because UAX#9 W2 turns digits that follow an
   Arabic letter into Arabic numbers. Isolating the run stops that run from
   re-ordering the text AROUND it — a price no longer drags the cell's
   neighbours about.

   It does NOT reorder the symbol and the digits relative to each other:
   "د.إ0.00" still renders with the amount ahead of the symbol. Fixing that
   needs a LEFT-TO-RIGHT MARK inside the string from Money::format, which is a
   change to money output that also reaches receipts, ESC/POS and exports — so
   it is deliberately left alone here rather than half-done in CSS. */
.price, .stat-value, .money,
td.right, .print-line span, .kpi-value {
  unicode-bidi: isolate;
}

/* --- 14g. never scroll the page sideways --------------------------------
   A belt-and-braces floor: no screen may introduce a horizontal document
   scrollbar, whatever a future widget does. */
body { overflow-x: hidden; }

/* Below 720px the comparison stops being a table and becomes one card per row.
   The scrolling version clipped cells mid-word with no affordance saying it
   could be scrolled, so the two columns that make the argument were simply
   invisible on a phone. Each cell now labels itself instead. */
@media (max-width: 720px) {
  .mk2-compare-wrap { overflow-x: visible; border: 0; background: none; border-radius: 0; }
  .mk2-compare { min-width: 0; display: block; }
  .mk2-compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mk2-compare tbody { display: block; }
  .mk2-compare tbody tr {
    display: block; margin-bottom: 12px; padding: 16px;
    background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  }
  .mk2-compare tbody tr:last-child { margin-bottom: 0; }
  .mk2-compare tbody th {
    display: block; padding: 0 0 10px; font-size: 15px; white-space: normal;
    border-bottom: 1px solid var(--c-line);
  }
  .mk2-compare tbody td {
    display: block; padding: 12px 0 0; border-bottom: 0; border-right: 0;
    background: none;                       /* the tint does not survive a card layout */
  }
  .mk2-compare tbody td::before {
    content: attr(data-label); display: block;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--c-muted); margin-bottom: 3px;
  }
  /* Keep our column marked — a rule and a coloured label, not a fill. */
  .mk2-compare tbody td.is-us { border-left: 2px solid var(--c-primary); padding-left: 12px; }
  .mk2-compare tbody td.is-us::before { color: var(--c-primary); }
  .mk2-compare tbody tr:last-child th { border-bottom: 1px solid var(--c-line); }
}

