/* =============================================================================
   iOS UI-kit styles — v2: 5-tab bar, fixed bottom, grid cards, modal flip.
   Layered on top of components.css.
   ============================================================================= */

.ios-app-root {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The phone's scroll area. Inside IOSDevice, children render in
   `overflow: auto`, so we make our root flex-column and let one inner
   div be the scroller. */
.ios-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 92px;        /* clear the tab bar — fixed height */
}

/* Screen-change transition — a restrained fade + small settle when switching
   tabs or opening a sub-screen, so navigation feels composed rather than a hard
   cut. GPU-only (opacity + translate); under 250ms; honours reduced motion via
   the global block. */
@keyframes ios-screen-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ios-screen-enter {
  animation: ios-screen-enter 220ms var(--ease-out) both;
}

.ios-screen__header {
  padding: 60px 16px 14px;
}
/* A Back affordance inside a screen header sits on its own line — without
   this it flows inline and collides with the eyebrow (seen on the desktop
   "What can I make?" header). */
.ios-screen__header .ios-login__back { display: flex; margin-bottom: 10px; }
.ios-screen__eyebrow { display: block; }
.ios-screen__eyebrow {
  font: 700 0.66rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-action);
}
.ios-screen__title {
  margin: 6px 0 4px;
  font: 800 2rem/1.05 var(--font-display);
  letter-spacing: -0.04em;
  color: var(--fg-strong);
}
.ios-screen__sub { color: var(--fg-muted); font-size: 0.92rem; line-height: 1.5; }

/* Sub-screen back row */
.ios-back-row {
  padding: 60px 16px 6px;
  display: flex; align-items: center; gap: 6px;
}
.ios-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0;
  font: 600 1rem/1 var(--font-display);
  color: var(--accent-action);
  cursor: pointer;
  padding: 6px 4px;
}

.ios-section {
  margin: 22px 0 0;
  padding: 0 16px;
}
.ios-section__title {
  font: 700 0.95rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  margin: 0 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ios-section__title a {
  font: 600 0.78rem/1 var(--font-display);
  color: var(--accent-action);
}

/* Cocktail-finder ingredient chooser — grouped, labelled sections of chips
   (Spirits / Liqueurs / Juices / Syrups & Sweeteners / Mixers & Sodas /
   Bitters & Other). One scroll container holds every section so the picker
   never grows unbounded; each section gets a small caption header. */
.cf-chooser { display: flex; flex-direction: column; gap: 12px; }
.cf-cat { display: flex; flex-direction: column; gap: 6px; }
.cf-cat-head {
  margin: 2px 2px 0;
  font: 700 0.7rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-subtle);
}
.cf-cat-head__note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--fg-muted);
}

/* Sticky category quick-pick — a single horizontally-scrollable row of chips
   pinned to the top of the chooser so bitters/mixers are one tap away instead
   of a long scroll. Sits inside the scroll container, so it stays put as the
   ingredient list moves under it. */
.cf-quickpick {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 0 4px;
  /* overflow-x:auto forces vertical overflow to clip too, so without room the
     chip text was cut off top and bottom. Pad generously; the 2px sides keep
     the first/last chip off the scroll edges. */
  padding: 8px 2px 12px;
  /* Opaque backing matches the screen surface so chips scroll cleanly under it.
     The chooser renders on the themed page background, not a card. */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.cf-quickpick::-webkit-scrollbar { display: none; }
.cf-quickpick .bk-chip { flex: 0 0 auto; }
/* Desktop / web shell: there's width to spare, so wrap the categories onto as
   many rows as needed instead of a clipped horizontal scroll. Every chip stays
   visible and fully readable. */
.bk-web .cf-quickpick { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }

/* iOS settings-style list */
.ios-list {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.ios-list__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left;
  cursor: pointer;
  font: inherit; color: inherit;
  transition: background var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.ios-list__row:last-child { border-bottom: 0; }
.ios-list__row:active { background: var(--accent-action-soft); transform: scale(0.99); }
.ios-list__row-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent-action-soft);
  color: var(--accent-action);
  border-radius: var(--radius-sm);
  flex: 0 0 36px;
}
.ios-list__row-icon--green { background: rgba(16, 185, 129, 0.14); color: #10b981; }
.ios-list__row-icon--amber { background: rgba(245, 158, 11, 0.14); color: #f59e0b; }
.ios-list__row-icon--violet{ background: rgba(124, 58, 237, 0.14); color: #7c3aed; }
.ios-list__row-icon--cyan  { background: rgba(8, 145, 178, 0.14); color: #0891b2; }
.ios-list__row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ios-list__row-title { font: 600 0.95rem/1.2 var(--font-display); color: var(--fg-strong); }
.ios-list__row-sub   { font-size: 0.8rem; color: var(--fg); opacity: 0.7; }
.ios-list__row-chev  { color: var(--fg-subtle); flex: 0 0 auto; }

/* Stat tiles, mobile-sized */
.ios-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.ios-stats .bk-stat-tile { padding: 14px; border-radius: 16px; }
.ios-stats .bk-stat-tile__value { font-size: 1.5rem; }

/* 2-COLUMN flash card grid */
.ios-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 16px 0;
}
/* Gentle entry stagger for the flash-card grid. Fade + lift, capped at 10
   so a long list never delays the last card noticeably. Neutralised by the
   global prefers-reduced-motion block. */
@keyframes ios-card-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ios-card-grid > .ios-grid-card {
  animation: ios-card-enter 300ms var(--ease-out) both;
}
.ios-card-grid > .ios-grid-card:nth-child(1)  { animation-delay: 0ms; }
.ios-card-grid > .ios-grid-card:nth-child(2)  { animation-delay: 40ms; }
.ios-card-grid > .ios-grid-card:nth-child(3)  { animation-delay: 80ms; }
.ios-card-grid > .ios-grid-card:nth-child(4)  { animation-delay: 120ms; }
.ios-card-grid > .ios-grid-card:nth-child(5)  { animation-delay: 160ms; }
.ios-card-grid > .ios-grid-card:nth-child(6)  { animation-delay: 200ms; }
.ios-card-grid > .ios-grid-card:nth-child(7)  { animation-delay: 240ms; }
.ios-card-grid > .ios-grid-card:nth-child(8)  { animation-delay: 280ms; }
.ios-card-grid > .ios-grid-card:nth-child(9)  { animation-delay: 320ms; }
.ios-card-grid > .ios-grid-card:nth-child(n+10) { animation-delay: 360ms; }

/* Shared gentle entrance stagger for the other primary lists (updates feed,
   bottles/glassware photo grids, leaderboard rows, More/profile/colour rows).
   Same fade + lift as the card grid; capped at 8 steps so long lists never
   delay the tail noticeably. Each lives inside the keyed .ios-screen-enter
   wrapper, so the stagger replays on navigation but not on in-screen state
   changes (rows keep their React identity). Neutralised by the global
   prefers-reduced-motion block. */
.ios-list > .ios-list__row,
.ios-photo-grid > .ios-photo-card,
.ios-updates-feed > .ios-update {
  animation: ios-card-enter 280ms var(--ease-out) both;
}
.ios-list > .ios-list__row:nth-child(1),
.ios-photo-grid > .ios-photo-card:nth-child(1),
.ios-updates-feed > .ios-update:nth-child(1) { animation-delay: 0ms; }
.ios-list > .ios-list__row:nth-child(2),
.ios-photo-grid > .ios-photo-card:nth-child(2),
.ios-updates-feed > .ios-update:nth-child(2) { animation-delay: 35ms; }
.ios-list > .ios-list__row:nth-child(3),
.ios-photo-grid > .ios-photo-card:nth-child(3),
.ios-updates-feed > .ios-update:nth-child(3) { animation-delay: 70ms; }
.ios-list > .ios-list__row:nth-child(4),
.ios-photo-grid > .ios-photo-card:nth-child(4),
.ios-updates-feed > .ios-update:nth-child(4) { animation-delay: 105ms; }
.ios-list > .ios-list__row:nth-child(5),
.ios-photo-grid > .ios-photo-card:nth-child(5),
.ios-updates-feed > .ios-update:nth-child(5) { animation-delay: 140ms; }
.ios-list > .ios-list__row:nth-child(6),
.ios-photo-grid > .ios-photo-card:nth-child(6),
.ios-updates-feed > .ios-update:nth-child(6) { animation-delay: 175ms; }
.ios-list > .ios-list__row:nth-child(7),
.ios-photo-grid > .ios-photo-card:nth-child(7),
.ios-updates-feed > .ios-update:nth-child(7) { animation-delay: 210ms; }
.ios-list > .ios-list__row:nth-child(n+8),
.ios-photo-grid > .ios-photo-card:nth-child(n+8),
.ios-updates-feed > .ios-update:nth-child(n+8) { animation-delay: 245ms; }

/* Grid card (small, in-grid). Centred composition; no swatches on front. */
.ios-grid-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 18px 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 160px;
  overflow: hidden;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out);
}
.ios-grid-card:active { transform: scale(0.97); }
.ios-grid-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.ios-grid-card--full  { background: var(--spec-full-bg);  border-color: var(--spec-full-border); }
.ios-grid-card--full::before { background: var(--spec-full-stripe); }
.ios-grid-card--batch { background: var(--spec-batch-bg); border-color: var(--spec-batch-border); }
.ios-grid-card--batch::before { background: var(--spec-batch-stripe); }
.ios-grid-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.ios-grid-card__title  {
  margin: 0;
  font: 700 0.98rem/1.15 var(--font-display);
  color: var(--fg-strong);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.ios-grid-card__cat {
  font: 600 0.68rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}
.ios-grid-card__star {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.5);
  color: var(--fg-subtle);
  cursor: pointer;
}
[data-theme="dark"] .ios-grid-card__star { background: rgba(255, 255, 255, 0.08); }
.ios-grid-card__star.is-active { color: var(--status-warning); background: rgba(245, 158, 11, 0.16); }
.ios-grid-card__star.is-active svg { fill: currentColor; }

/* iOS segmented (Full / Batch / Both) */
.ios-segmented {
  margin: 6px 16px 4px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: calc(100% - 32px);
  padding: 3px;
  background: var(--surface-sunken);
  border-radius: 12px;
}
.ios-segmented label { position: relative; cursor: pointer; }
.ios-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ios-segmented span {
  display: flex; align-items: center; justify-content: center;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  font: 600 0.85rem/1 var(--font-display);
  color: var(--fg-muted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ios-segmented label.is-active span {
  background: var(--surface-strong);
  color: var(--fg-strong);
  box-shadow: var(--shadow-xs);
}

/* iOS search bar */
.ios-search {
  margin: 6px 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--surface-sunken);
  border-radius: 12px;
  color: var(--fg-muted);
}
.ios-search svg { flex: 0 0 18px; color: var(--fg-subtle); }
.ios-search input {
  border: 0; outline: none; background: transparent;
  font: var(--type-body); color: var(--fg);
  flex: 1; min-width: 0;
}

/* Chip rail */
.ios-chip-rail {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 6px;
  scrollbar-width: none;
}
.ios-chip-rail::-webkit-scrollbar { display: none; }
.ios-chip-rail .bk-chip { flex: 0 0 auto; }

/* TAB BAR — FLOATING liquid-glass pill, detached from the phone's edges.
   Side + bottom margins, a large pill radius, centred with a max-width so it
   reads as a hovering control rather than a docked strip. A single highlight
   pill glides sideways behind the active tab (transform-driven). */
.ios-tabbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  /* Detach: float clear of the bezel with side + bottom inset. */
  margin: 0 14px calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: 460px;
  align-self: center;
  width: calc(100% - 28px);
  box-sizing: border-box;
  padding: 6px 6px;
  /* Unified Liquid Glass material (see .bk-glass in components.css). */
  border-radius: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-spec),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 40px -12px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  z-index: 40;
  /* Fluid contract/expand on scroll (see .is-compact). Only padding + the
     glass radius animate on the bar itself; labels/icons handle their own. */
  transition: padding var(--dur-med) var(--ease-out),
              border-radius var(--dur-med) var(--ease-out),
              margin-bottom var(--dur-med) var(--ease-out);
}
/* Solid-background fallback where backdrop-filter is unavailable: an opaque
   tint so the bar stays fully legible without the blur. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-tabbar { background: var(--glass-bg-solid); }
}

/* Sliding highlight pill. Width = one tab slot; it GLIDES horizontally by
   translating its own width per active-tab index (set via --tab-index on the
   nav), giving the "slide sideways" effect on every tab change. */
.ios-tabbar__bubble {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / var(--tab-count, 5));
  border-radius: 22px;
  background: var(--accent-action-soft);
  border: 1px solid var(--accent-action);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translateX(calc(var(--tab-index, 0) * 100%));
  transition: transform var(--dur-pop) var(--ease-out), opacity var(--dur-fast) var(--ease-out),
              top var(--dur-med) var(--ease-out), bottom var(--dur-med) var(--ease-out),
              left var(--dur-med) var(--ease-out), border-radius var(--dur-med) var(--ease-out);
  z-index: 0;
}
/* Keep the gliding pill hugging the bar edges as it contracts. */
.ios-tabbar.is-compact .ios-tabbar__bubble {
  top: 3px; bottom: 3px; left: 6px;
  border-radius: 20px;
}
/* No tab active (a sub-screen is open) → fade the pill out in place. */
.ios-tabbar[data-bubble="off"] .ios-tabbar__bubble { opacity: 0; }
.ios-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  /* Keep a >=44px touch target even when compact (padding shrinks, min-height
     holds the tap area). */
  padding: 6px 4px;
  min-height: 44px;
  justify-content: center;
  background: transparent; border: 0; cursor: pointer;
  color: var(--fg-subtle);
  font: 600 0.62rem/1 var(--font-display);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out),
              padding var(--dur-med) var(--ease-out);
}
.ios-tab svg { width: 22px; height: 22px; transition: transform var(--dur-med) var(--ease-out); }
.ios-tab:active { transform: scale(0.92); }
.ios-tab.is-active { color: var(--accent-action); }
/* The label is the part that collapses: fade out and squeeze its line box to
   zero so the bar can shrink without the text clipping awkwardly. */
.ios-tab > span {
  display: block;
  max-height: 1.2em;
  overflow: hidden;
  transition: max-height var(--dur-med) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              margin-top var(--dur-med) var(--ease-out);
}

/* ── Compact (scrolled-down) state — a tighter glass bubble ───────────────── */
.ios-tabbar.is-compact {
  padding: 3px 6px;
  border-radius: 24px;
  margin-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.ios-tabbar.is-compact .ios-tab { padding: 4px 4px; }
.ios-tabbar.is-compact .ios-tab svg { transform: scale(0.92); }
.ios-tabbar.is-compact .ios-tab > span {
  max-height: 0;
  opacity: 0;
  margin-top: -2px;     /* take up the gap the icon leaves so it centres */
}

/* HERO on Home */
.ios-hero {
  margin: 0 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
}
.ios-hero__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.18);
  display: grid; place-items: center; color: #fff;
}
.ios-hero__copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ios-hero__title { font: 700 1rem/1.2 var(--font-display); }
.ios-hero__sub   { font-size: 0.78rem; opacity: 0.85; }

/* Manager-only missing-ingredient notice on Home */
.ios-missing-notice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 18px;
  color: var(--fg-strong);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.ios-missing-notice:hover { background: rgba(245, 158, 11, 0.18); }
[data-theme="dark"] .ios-missing-notice {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--fg-strong);
}
.ios-missing-notice__icon {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(245, 158, 11, 0.20);
  color: #b45309;
  border-radius: 12px;
  flex: 0 0 44px;
}
[data-theme="dark"] .ios-missing-notice__icon { color: #fbbf24; background: rgba(245, 158, 11, 0.25); }
.ios-missing-notice__count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: var(--status-warning);
  color: #fff;
  border-radius: var(--radius-pill);
  font: 800 0.72rem/22px var(--font-display);
  text-align: center;
  border: 2px solid var(--bg);
  font-variant-numeric: tabular-nums;
}
/* First-run onboarding card — warm, primary-accented invitation to the first
   test, shown in place of the wall-of-zeros stat band before any history. */
.ios-onboard-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border-radius: var(--radius-lg, 18px);
  border: 1px solid color-mix(in srgb, var(--accent-action) 30%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-action) 10%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .ios-onboard-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
}
.ios-onboard-card:active { transform: scale(0.98); }
.ios-onboard-card__icon {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--radius-md, 14px);
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand-blue, #2563eb), var(--brand-indigo, #4f46e5));
  box-shadow: var(--shadow-sm);
}
.ios-onboard-card__copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ios-onboard-card__title { font: 700 1rem/1.15 var(--font-display); color: var(--fg-strong); letter-spacing: -0.01em; }
.ios-onboard-card__sub { font-size: 0.78rem; color: var(--fg-muted); line-height: 1.4; }

.ios-missing-notice__copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ios-missing-notice__title { font: 700 0.92rem/1.25 var(--font-display); color: var(--fg-strong); }
.ios-missing-notice__sub {
  font: 500 0.74rem/1.35 var(--font-display);
  color: var(--fg);
  opacity: 0.7;
  /* Clamp to two lines with a clean ellipsis rather than a one-line mid-word
     cut — the "+N more" suffix already summarises the overflow. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Spec test form */
.ios-form { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }

/* Theme toggle, sits at top-right of phone. Floats over the scroll area, so
   once the screen scrolls it fades out of the way (it was overlapping titles
   and list rows); it returns as soon as the user is back at the top. */
.ios-theme-toggle {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 8;
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ios-theme-toggle.is-scrolled {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* =============================================================================
   MODAL FLIP — flying card from grid to centre, with 3D flip
   ============================================================================= */

.ios-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  z-index: 80;
  transition: background var(--dur-med) var(--ease-out);
  pointer-events: none;
}
.ios-modal-backdrop.is-open {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}
[data-theme="dark"] .ios-modal-backdrop.is-open {
  background: rgba(0, 0, 0, 0.65);
}
/* No blur → lean on a denser scrim so the card reads clearly above the page. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-modal-backdrop.is-open { background: rgba(15, 23, 42, 0.6); }
  [data-theme="dark"] .ios-modal-backdrop.is-open { background: rgba(0, 0, 0, 0.8); }
}

.ios-modal-card {
  position: absolute;
  z-index: 90;
  perspective: 1400px;
  /* The card is positioned at its FINAL rect; the open/close "fly" is a pure
     GPU transform (translate + scale) interpolated from the grid slot via the
     inline --fly value. No top/left/width/height animation → no per-frame
     layout/paint, so it stays smooth alongside the photo + blurred backdrop. */
  transform-origin: top left;
  transition: transform var(--dur-flip) var(--ease-out);
}
/* Promote to its own compositor layer only while it's actually flying, then
   drop the hint so we don't pin a layer for an idle card. */
.ios-modal-card.is-flying { will-change: transform; }
.ios-modal-card__inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--dur-flip) var(--ease-out);
}
.ios-modal-card.is-flipped .ios-modal-card__inner {
  transform: rotateY(180deg);
}
.ios-modal-card__face {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 0;
  border-radius: 22px;
  box-shadow: 0 32px 72px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  /* Proper GPU flip: each face hides its own back so the turn reads cleanly.
     An opacity crossfade pivoting at the flip's midpoint is kept as a belt-and-
     braces fallback for engines that ignore backface-visibility — synced to
     --dur-flip-half so it stays correct if the duration token changes. */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 0s linear var(--dur-flip-half);
}
.ios-modal-card__face--front {
  opacity: 1;
  padding: 28px 22px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}
.ios-modal-card__face--back  {
  transform: rotateY(180deg);
  opacity: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ios-modal-card.is-flipped .ios-modal-card__face--front { opacity: 0; }
.ios-modal-card.is-flipped .ios-modal-card__face--back  { opacity: 1; }

.ios-modal-card__face::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  z-index: 2;
}
.ios-modal-card--full  .ios-modal-card__face { background: var(--surface); border: 1px solid var(--spec-full-border); }
.ios-modal-card--full  .ios-modal-card__face::before { background: var(--spec-full-stripe); }
.ios-modal-card--batch .ios-modal-card__face { background: var(--surface); border: 1px solid var(--spec-batch-border); }
.ios-modal-card--batch .ios-modal-card__face::before { background: var(--spec-batch-stripe); }

/* Front face still uses the tinted spec colour as a soft wash. */
.ios-modal-card--full  .ios-modal-card__face--front { background: linear-gradient(180deg, var(--spec-full-bg), var(--surface) 70%); }
.ios-modal-card--batch .ios-modal-card__face--front { background: linear-gradient(180deg, var(--spec-batch-bg), var(--surface) 70%); }

.ios-modal-card__title  {
  margin: 0;
  font: 800 clamp(1.4rem, 5.5vw, 1.9rem)/1.05 var(--font-display);
  letter-spacing: -0.025em;
  color: var(--fg-strong);
  text-wrap: balance;
}
.ios-modal-card__hint { color: var(--fg-strong); font-size: 0.86rem; font-weight: 500; opacity: 0.7; }
.ios-modal-card__badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.ios-modal-card__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  /* Spec rows scroll underneath this button, so it needs to read as a
     floating glass control rather than a smudge over the text. */
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: var(--shadow-xs);
  color: var(--fg);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 5;
}
[data-theme="dark"] .ios-modal-card__close {
  background: rgba(30, 34, 44, 0.66);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--fg);
}

/* Back face — photo + spec + meta */
.ios-modal-card__photo {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(180deg, var(--bg-sunken), var(--surface-sunken));
  border: 1px solid var(--line-strong);
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  margin: 4px 0 0;
}
[data-theme="dark"] .ios-modal-card__photo {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border-color: rgba(255, 255, 255, 0.10);
}
.ios-modal-card__photo img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.ios-modal-card__photo-empty {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 0.78rem;
}
.ios-modal-card__photo-empty svg { color: var(--fg-subtle); }
.ios-modal-card__photo-replace {
  position: absolute;
  bottom: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 0;
  cursor: pointer;
  font: 600 0.72rem/1 var(--font-display);
}
.ios-modal-card__photo-replace svg { width: 14px; height: 14px; }
.ios-modal-card__photo-role-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font: 600 0.62rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ios-modal-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ios-modal-card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.ios-modal-card__head .ios-modal-card__title {
  font-size: 1.15rem;
}

.ios-modal-card__spec {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  font-size: 0.95rem;
  margin: 0;
  padding: 14px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}
.ios-modal-card__spec dt {
  font-weight: 600;
  color: var(--fg-strong);
  position: relative;
  /* The "press for bottle" interactive style — applied when this dt has a
     matching bottle in the library. Tiny dotted underline tells the user
     they can hold for a preview. */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.ios-modal-card__spec dt.is-pressable {
  text-decoration: underline dotted var(--accent-action);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.ios-modal-card__spec dt.is-pressing {
  background: var(--accent-action-soft);
  border-radius: var(--radius-xs);
  margin: -2px -4px;
  padding: 2px 4px;
}
.ios-modal-card__spec dt.is-missing {
  /* Manager-only: unknown ingredient marked with a dashed underline +
     warning dot. Long-pressing opens the editor straight away. */
  text-decoration: underline dashed var(--status-warning);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.ios-modal-card__missing-dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border-radius: var(--radius-pill);
  background: var(--status-warning);
  vertical-align: middle;
}
.ios-modal-card__spec dd { margin: 0; color: var(--fg-strong); font-weight: 700; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
[data-theme="dark"] .ios-modal-card__spec {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}

/* =============================================================================
   BOTTLE POPOVER — appears on long-press of an ingredient
   ============================================================================= */
.ios-bottle-popover {
  position: absolute;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  width: 240px;
  /* Unified Liquid Glass — a floating glass chip over the card. */
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-spec),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 56px -12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  pointer-events: auto;
  animation: ios-bottle-pop 180ms var(--ease-spring) both;
  transform-origin: var(--ios-bottle-origin, 50% 100%);
}
.ios-bottle-popover__backdrop {
  position: fixed;
  inset: 0;
  z-index: 195;
  background: transparent;
  cursor: default;
}
/* Solid surface where blur is unavailable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-bottle-popover { background: var(--glass-bg-solid); }
}
@keyframes ios-bottle-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.ios-bottle-popover__img-wrap {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-sunken), var(--surface-sunken));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 8px;
}
[data-theme="dark"] .ios-bottle-popover__img-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-color: rgba(255, 255, 255, 0.10);
}
.ios-bottle-popover__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.ios-bottle-popover__name {
  font: 700 0.92rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  text-align: center;
}
.ios-bottle-popover__hint {
  font: 500 0.68rem/1.2 var(--font-display);
  color: var(--fg-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Colour-code popover variant (for ingredients without bottle photos) */
.ios-bottle-popover__colour-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
}
.ios-bottle-popover__colour-stack {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.ios-bottle-popover__colour-chip {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18),
    0 6px 12px rgba(15, 23, 42, 0.25);
}
.ios-bottle-popover__colour-labels {
  display: flex;
  gap: 14px;
  justify-content: center;
  font: 600 0.68rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
}
.ios-bottle-popover__colour-labels span {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
}

/* Edit button at the bottom of the popover (manager-only) */
.ios-bottle-popover__edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-action);
  background: var(--accent-action-soft);
  color: var(--accent-action);
  font: 600 0.78rem/1 var(--font-display);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ios-bottle-popover__edit-btn:hover {
  background: var(--accent-action);
  color: var(--fg-on-accent);
}

/* =============================================================================
   INGREDIENT EDITOR — bottom sheet
   ============================================================================= */
.ios-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  animation: ios-sheet-fade 220ms var(--ease-out) forwards;
}
[data-theme="dark"] .ios-sheet-backdrop { background: rgba(0, 0, 0, 0.65); }
/* Without blur the scrim alone must darken the page enough to read the sheet. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-sheet-backdrop { background: rgba(15, 23, 42, 0.6); }
  [data-theme="dark"] .ios-sheet-backdrop { background: rgba(0, 0, 0, 0.78); }
}
@keyframes ios-sheet-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ios-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 310;
  /* Unified Liquid Glass surface — content behind blurs through the sheet. */
  border-radius: 22px 22px 0 0;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-spec),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 -16px 40px -8px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  display: flex;
  flex-direction: column;
  max-height: 78%;
  animation: ios-sheet-up var(--dur-sheet) var(--ease-drawer) both;
}
/* Solid surface where blur is unavailable — never a see-through panel. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-sheet { background: var(--glass-bg-solid); }
}
@keyframes ios-sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.ios-sheet__grabber {
  width: 38px; height: 5px;
  background: var(--line-strong);
  border-radius: var(--radius-pill);
  margin: 8px auto 4px;
  flex: 0 0 auto;
}

.ios-sheet__head {
  padding: 4px 16px 0;
  display: flex; flex-direction: column; gap: 8px;
  flex: 0 0 auto;
}
.ios-sheet__title {
  font: 800 1.4rem/1.1 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  margin: 0;
}

.ios-sheet__body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ios-sheet__photo-preview {
  width: 100%;
  height: 200px;
  flex: 0 0 200px;
  background: linear-gradient(180deg, var(--bg-sunken), var(--surface-sunken));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-sheet__photo-preview img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.ios-sheet__photo-empty {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  color: var(--fg-muted);
  font-size: 0.82rem;
}
.ios-sheet__photo-empty svg { color: var(--fg-subtle); }

.ios-sheet__actions-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ios-sheet__actions-row .bk-button { flex: 1; }

.ios-sheet__colour-preview {
  padding: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
}
[data-theme="dark"] .ios-sheet__colour-preview {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}

.ios-sheet__footer {
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}

/* Colour picker grid */
.ios-colour-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.ios-colour-picker__chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  font: 600 0.82rem/1 var(--font-display);
  color: var(--fg-strong);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.ios-colour-picker__chip.is-selected {
  border-color: var(--accent-action);
  background: var(--accent-action-soft);
  box-shadow: 0 0 0 1px var(--accent-action) inset;
}
.ios-colour-picker__dot {
  width: 18px; height: 18px;
  border-radius: var(--radius-pill);
  flex: 0 0 18px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
/* Empty-photo CTA state. When the drink has no photo and the user is a
   manager, the photo slot becomes a tappable add-photo affordance with a
   dotted border. */
.ios-modal-card__photo.is-empty {
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 8px,
      rgba(96, 165, 250, 0.04) 8px 16px
    ),
    var(--bg-sunken);
}
[data-theme="dark"] .ios-modal-card__photo.is-empty {
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 8px,
      rgba(96, 165, 250, 0.08) 8px 16px
    ),
    rgba(255, 255, 255, 0.04);
}
.ios-modal-card__photo.is-cta {
  border: 2px dashed var(--accent-action);
  cursor: pointer;
}
.ios-modal-card__photo.is-cta:hover,
.ios-modal-card__photo.is-cta:active {
  background: var(--accent-action-soft);
}
.ios-modal-card__photo.is-cta .ios-modal-card__photo-empty {
  color: var(--accent-action);
  font-weight: 600;
}
.ios-modal-card__photo.is-cta .ios-modal-card__photo-empty svg {
  color: var(--accent-action);
}

/* "Drinks need a photo" notice variant (sky-blue tone vs the amber
   "ingredients need a photo or colour" notice) */
.ios-missing-notice--photo {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.45);
}
.ios-missing-notice--photo:hover { background: rgba(96, 165, 250, 0.18); }
.ios-missing-notice--photo .ios-missing-notice__icon {
  background: rgba(96, 165, 250, 0.22);
  color: #2563eb;
}
[data-theme="dark"] .ios-missing-notice--photo {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
}
[data-theme="dark"] .ios-missing-notice--photo .ios-missing-notice__icon {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.22);
}
.ios-missing-notice--photo .ios-missing-notice__count {
  background: #2563eb;
}

/* =============================================================================
   ACTION SHEET — small iOS-style "Take photo / Choose from library" prompt
   ============================================================================= */
.ios-action-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 320;
}
[data-theme="dark"] .ios-action-sheet__backdrop { background: rgba(0, 0, 0, 0.65); }

.ios-action-sheet {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 330;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column;
  gap: 1px;
  overflow: hidden;
  animation: ios-sheet-up 280ms var(--ease-drawer) both;
  border: 1px solid var(--line);
}
[data-theme="dark"] .ios-action-sheet {
  background: var(--surface-elev);
  border-color: rgba(255, 255, 255, 0.12);
}
.ios-action-sheet__title {
  padding: 14px 16px 12px;
  font: 600 0.78rem/1.2 var(--font-display);
  color: var(--fg-muted);
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ios-action-sheet__btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--line);
  font: 600 1rem/1 var(--font-display);
  color: var(--accent-action);
  cursor: pointer;
  text-align: center;
}
.ios-action-sheet__btn:first-of-type { border-top: 0; }
.ios-action-sheet__btn:active { background: var(--accent-action-soft); }
.ios-action-sheet__btn--cancel {
  margin-top: 6px;
  border-top: 6px solid var(--bg);
  color: var(--fg);
  font-weight: 700;
}
[data-theme="dark"] .ios-action-sheet__btn--cancel { border-top-color: rgba(0,0,0,0.4); }

/* Tail (little triangle pointing back at the ingredient) */
.ios-bottle-popover::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: inherit;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  bottom: -8px;
  left: var(--ios-bottle-tail-x, 50%);
  transform: translateX(-50%) rotate(45deg);
}
.ios-bottle-popover.is-below::after {
  bottom: auto;
  top: -8px;
  transform: translateX(-50%) rotate(225deg);
}

.ios-modal-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}
[data-theme="dark"] .ios-modal-card__meta {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}
.ios-modal-card__meta-cell {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  text-align: center;
  min-width: 0;
}
.ios-modal-card__meta-key {
  font: 700 0.6rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}
[data-theme="dark"] .ios-modal-card__meta-key { color: #cbd5e1; }
.ios-modal-card__meta-val {
  font: 700 0.85rem/1.2 var(--font-display);
  color: var(--fg-strong);
  text-wrap: balance;
}

.ios-modal-card__swatches-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}
[data-theme="dark"] .ios-modal-card__swatches-row {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}
.ios-modal-card__swatches-row .bk-swatch { width: 20px; height: 20px; }
.ios-modal-card__swatches-row-label {
  font: 700 0.66rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}
[data-theme="dark"] .ios-modal-card__swatches-row-label { color: #cbd5e1; }

.ios-modal-card__tip {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.40);
  font-size: 0.84rem;
  color: var(--fg-strong);
  font-weight: 500;
  line-height: 1.5;
}
.ios-modal-card__tip strong {
  display: block;
  font: 800 0.66rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #b45309;
  margin-bottom: 6px;
}
[data-theme="dark"] .ios-modal-card__tip {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}
[data-theme="dark"] .ios-modal-card__tip strong { color: #fbbf24; }

.ios-modal-card__photo-label {
  font: 700 0.66rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin: 6px 0 -4px;
}
[data-theme="dark"] .ios-modal-card__photo-label { color: #cbd5e1; }

/* =============================================================================
   TABLES SCREEN
   ============================================================================= */

.ios-table-search {
  margin: 6px 16px;
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border-radius: 12px;
}
.ios-table-search input {
  border: 0; outline: none; background: transparent;
  font: 600 1.05rem/1 var(--font-display);
  flex: 1; color: var(--fg);
}
.ios-zone-rail {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}
.ios-zone-rail::-webkit-scrollbar { display: none; }
.ios-tables-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.ios-table-tile {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
}
.ios-table-tile__num { font: 800 1.4rem/1 var(--font-display); color: var(--fg-strong); letter-spacing: -0.03em; }
.ios-table-tile__zone { font-size: 0.6rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.1em; }
.ios-table-tile.is-highlight {
  background: var(--accent-action-soft);
  border-color: var(--accent-action);
}
.ios-table-tile.is-highlight .ios-table-tile__num { color: var(--accent-action); }

/* =============================================================================
   FLOOR PLAN VIEW
   ============================================================================= */

.ios-floor-plan-wrap {
  padding: 6px 16px 0;
}
.ios-floor-plan {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 8% 8%;
}
[data-theme="dark"] .ios-floor-plan {
  /* background-color, NOT the shorthand — the shorthand was resetting
     background-image and wiping the grid lines entirely in dark mode. */
  background-color: rgba(255, 255, 255, 0.03);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  border-color: rgba(255, 255, 255, 0.10);
}

.ios-fp-feature {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 0.55rem/1.1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-radius: 4px;
  /* Inert during service so taps fall through to tables — but in edit mode
     features (toilets, bar, DJ, stairs…) are draggable like tables. */
  pointer-events: none;
}
.ios-fp-feature.is-editing { pointer-events: auto; cursor: grab; }
.ios-fp-feature > span {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1px 2px;
}
/* Tall, narrow features (the Upstairs Bar strip along the right wall) run
   their label vertically instead of clipping it mid-word. Wrapping is allowed
   so "Upstairs Bar" breaks into two vertical columns in a short strip. */
.ios-fp-feature--upright > span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1.15;
  letter-spacing: 0.04em;
}
.ios-fp-feature--room {
  background: rgba(15, 23, 42, 0.08);
  border: 1px dashed var(--line-strong);
}
[data-theme="dark"] .ios-fp-feature--room {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
.ios-fp-feature--marker {
  background: rgba(124, 58, 237, 0.14);
  color: #6b21a8;
  font-size: 0.5rem;
}
[data-theme="dark"] .ios-fp-feature--marker {
  background: rgba(196, 181, 253, 0.14);
  color: #c4b5fd;
}
.ios-fp-feature--void {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(100, 116, 139, 0.16),
      rgba(100, 116, 139, 0.16) 4px,
      transparent 4px,
      transparent 8px
    );
  border: 1px dashed var(--line-strong);
}

.ios-fp-table {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--accent-action);
  color: #fff;
  font: 800 0.7rem/1 var(--font-display);
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ios-fp-table--square {
  width: 40px; height: 34px;
  border-radius: var(--radius-xs);
}
.ios-fp-table--round {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
}
.ios-fp-table--wide { width: 64px; }
.ios-fp-table--tall { height: 58px; }
.ios-fp-table--biground {
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
}

/* Corner-resize handle on features (edit mode only). */
.ios-fp-resize {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 18px; height: 18px;
  border-radius: 6px;
  background: var(--surface);
  border: 2px solid var(--accent-action);
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.18));
  cursor: nwse-resize;
  touch-action: none;
  pointer-events: auto;
  z-index: 3;
}
/* Two-line token: table number on top, seat count beneath. */
.ios-fp-table__num   { display: block; font: 800 0.72rem/1 var(--font-display); }
.ios-fp-table__seats {
  display: block; margin-top: 1px;
  font: 700 0.5rem/1 var(--font-display);
  opacity: 0.85; letter-spacing: 0.02em;
}
/* Zone colour legend — a fixed horizontal strip under the plan, no scrolling. */
.ios-fp-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  align-items: center; justify-content: center;
  padding: 10px 16px 4px;
}
.ios-fp-legend__item {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 0.72rem/1 var(--font-display);
  color: var(--fg-muted);
}
button.ios-fp-legend__item {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  cursor: pointer;
}
button.ios-fp-legend__item:hover { border-color: var(--accent-action); color: var(--fg); }
.ios-fp-legend__hint {
  flex-basis: 100%;
  text-align: center;
  font: 500 0.68rem/1.3 var(--font-text);
  color: var(--fg-muted);
}

/* Colour swatch rows (zone + feature editors). */
.ios-swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ios-swatch {
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.ios-swatch.is-active {
  border-color: var(--fg-strong);
  box-shadow: 0 0 0 2px var(--surface);
}
.ios-swatch--none {
  background: var(--surface-sunken);
  color: var(--fg-muted);
  font: 700 0.85rem/1 var(--font-display);
}
.ios-swatch--custom {
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #8b5cf6, #ec4899, #ef4444);
  color: #fff;
  font: 800 0.95rem/1 var(--font-display);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.ios-swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Table shape picker in the table sheet. */
.ios-shape-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ios-shape-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 6px;
  padding: 8px 2px;
  min-height: 58px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font: 600 0.62rem/1 var(--font-text);
  color: var(--fg);
}
.ios-shape-chip.is-active {
  border-color: var(--accent-action);
  box-shadow: 0 0 0 1px var(--accent-action);
}
.ios-shape-chip__preview { width: 24px; height: 20px; border-radius: 5px; background: var(--accent-action); opacity: 0.8; }
.ios-shape-chip__preview--round { width: 22px; height: 22px; border-radius: 999px; }
.ios-shape-chip__preview--wide { width: 34px; height: 16px; }
.ios-shape-chip__preview--tall { width: 16px; height: 28px; }
.ios-shape-chip__preview--biground { width: 28px; height: 28px; border-radius: 999px; }
.ios-fp-legend__dot {
  width: 10px; height: 10px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.ios-fp-table.is-dim {
  opacity: 0.25;
}
.ios-fp-table.is-highlight {
  z-index: 10;
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 0 3px var(--accent-action), 0 12px 24px rgba(0,0,0,0.3);
  animation: ios-fp-pulse 1s ease-in-out infinite;
}
@keyframes ios-fp-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-action), 0 12px 24px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 0 0 6px var(--accent-action-soft), 0 12px 24px rgba(0,0,0,0.3); }
}
.ios-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.ios-photo-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  align-items: center;
  text-align: center;
}
.ios-photo-card > * { width: 100%; }
.ios-photo-card__img {
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, var(--surface-sunken), var(--bg-soft));
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.ios-photo-card__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ios-photo-card__name { font: 700 0.88rem/1.2 var(--font-display); color: var(--fg-strong); }
.ios-photo-card__cat  { font-size: 0.72rem; color: var(--fg); opacity: 0.7; font-weight: 500; }

/* Glasses list */
.ios-glass-list .ios-list__row-icon {
  background: rgba(96, 165, 250, 0.12);
  color: #2563eb;
}
[data-theme="dark"] .ios-glass-list .ios-list__row-icon {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

/* Colour Codes screen */
.ios-colour-group { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.ios-colour-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.ios-colour-pill__dot {
  width: 20px; height: 20px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  flex: 0 0 20px;
}
.ios-colour-pill__name { font: 600 0.85rem/1.2 var(--font-display); color: var(--fg-strong); }
.ios-colour-pill__sub  { font-size: 0.72rem; color: var(--fg-muted); margin-left: auto; }

/* Update card on home (compact) */
.ios-update {
  position: relative;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 4px;
}
.ios-update::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 2px;
}
.ios-update--full::before  { background: var(--spec-full-stripe); }
.ios-update--batch::before { background: var(--spec-batch-stripe); }
.ios-update--warn::before  { background: var(--status-warning); }
.ios-update__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ios-update__title { font: 700 0.88rem/1.3 var(--font-display); color: var(--fg-strong); }
.ios-update__ago   { font-size: 0.7rem; color: var(--fg-subtle); white-space: nowrap; }
.ios-update__body  { font-size: 0.8rem; line-height: 1.5; color: var(--fg-muted); }

/* =============================================================================
   BATCHING CALCULATOR
   ============================================================================= */
.ios-bc-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ios-bc-preset {
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg-strong);
  font: 700 0.88rem/1 var(--font-display);
  letter-spacing: -0.01em;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.ios-bc-preset:hover { border-color: var(--accent-action); color: var(--accent-action); }
.ios-bc-preset.is-active {
  background: var(--accent-action);
  color: var(--fg-on-accent);
  border-color: var(--accent-action);
  box-shadow: 0 4px 12px var(--accent-action-soft);
}

.ios-bc-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 14px 12px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}
.ios-bc-summary__cell {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.ios-bc-summary__key {
  font: 700 0.62rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.78;
}
.ios-bc-summary__val {
  font: 800 1.15rem/1.1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ios-bc-recipe {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.ios-bc-recipe__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.ios-bc-recipe__row:last-child { border-bottom: 0; }
.ios-bc-recipe__row.is-batch {
  background: var(--accent-action-soft);
  font-weight: 700;
}
.ios-bc-recipe__name { color: var(--fg-strong); font-weight: 600; }
.ios-bc-recipe__row.is-batch .ios-bc-recipe__name { color: var(--accent-action); }
.ios-bc-recipe__measure {
  color: var(--fg-strong);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* =============================================================================
   FLOOR PLAN — rotation + zoom toolbar
   ============================================================================= */
.ios-floor-plan-toolbar {
  display: flex;
  gap: 6px;
  padding: 0 16px 8px;
}
.ios-fp-tool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg-strong);
  font: 700 0.78rem/1 var(--font-display);
  cursor: pointer;
}
.ios-fp-tool:hover { border-color: var(--accent-action); color: var(--accent-action); }

/* Wrapper that holds the rotated plan. When .is-rotated, we swap aspect by
   rotating an inner frame and setting its width/height to match. */
.ios-floor-plan-frame {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}
.ios-floor-plan-frame .ios-floor-plan {
  transition: transform var(--dur-med) var(--ease-spring);
}
/* Rotated state: keep the plan readable on-screen. We rotate the inner
   plan 90deg AND swap its inline width/height so it still fits. The plan
   is `aspect-ratio: 16/10` originally, so rotated it becomes 10/16. */
.ios-floor-plan-frame.is-rotated .ios-floor-plan {
  aspect-ratio: 10 / 16;
  width: 62.5%;     /* = 10/16 — the wrapper stays 16:10 sized */
  margin: 0 auto;
  transform-origin: center;
}

/* =============================================================================
   LOGIN
   ============================================================================= */
.ios-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 64px 22px 24px;
  box-sizing: border-box;
  position: relative;
  background:
    radial-gradient(60% 60% at 20% 5%, rgba(37, 99, 235, 0.10) 0%, transparent 60%),
    radial-gradient(70% 70% at 85% 92%, rgba(79, 70, 229, 0.10) 0%, transparent 60%),
    var(--bg);
  color: var(--fg);
}
[data-theme="dark"] .ios-login {
  background:
    radial-gradient(60% 60% at 20% 5%, rgba(96, 165, 250, 0.12) 0%, transparent 60%),
    radial-gradient(70% 70% at 85% 92%, rgba(34, 211, 238, 0.10) 0%, transparent 60%),
    var(--bg);
}
.ios-login__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: 28px;
}
.ios-login__mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #fff;
  display: grid;
  place-items: center;
  font: 800 2rem/1 var(--font-display);
  letter-spacing: -0.06em;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.32);
}
.ios-login__brand {
  font: 800 1.4rem/1.05 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--fg-strong);
}
.ios-login__tag { font-size: 0.82rem; color: var(--fg-muted); max-width: 28ch; }
.ios-login__proof { display: none; } /* desktop split-pane only */

/* ── Desktop split-pane auth ─────────────────────────────────────────────
   On the web (wide viewport) the login becomes a confident two-pane layout:
   a brand panel carrying the gradient on the left, the form on a clean
   surface on the right — matching the desktop dashboard that follows, not a
   phone floating in a box. Fixed to the viewport to break out of the phone
   column the kit otherwise renders into. */
.ios-login--web {
  position: fixed; inset: 0; z-index: 10;
  height: 100vh; width: 100vw;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  padding: 0; align-items: stretch;
  background: var(--bg);
}
.ios-login--web .ios-login__top {
  grid-column: 1; align-self: center; justify-self: center;
  max-width: 460px; margin: 0; padding: 48px;
  align-items: flex-start; text-align: left; gap: 20px;
  position: relative; z-index: 1; /* above the ::before gradient */
}
/* Left pane carries the brand gradient + a hairline divider. */
.ios-login--web::before {
  content: ''; position: absolute; inset: 0 50% 0 0; pointer-events: none;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 18% 12%, color-mix(in srgb, var(--brand-blue) 18%, transparent) 0%, transparent 62%),
    radial-gradient(70% 70% at 90% 96%, color-mix(in srgb, var(--brand-indigo) 16%, transparent) 0%, transparent 60%),
    color-mix(in srgb, var(--surface-sunken) 60%, var(--bg));
}
.ios-login--web .ios-login__mark { width: 72px; height: 72px; }
.ios-login--web .ios-login__brand { font-size: 2.2rem; }
.ios-login--web .ios-login__tag { font-size: 0.95rem; max-width: 34ch; }
.ios-login--web .ios-login__proof {
  display: block; font-size: 0.85rem; line-height: 1.5;
  color: var(--fg-muted); max-width: 34ch;
  padding-top: 16px; border-top: 1px solid var(--line);
}
/* Right pane: the form, vertically centred on a clean surface. */
.ios-login--web .ios-login__card {
  grid-column: 2; align-self: center; justify-self: center;
  width: 100%; max-width: 400px; margin: 0;
  box-shadow: none; border: 0; background: transparent; padding: 24px 40px;
  position: relative; z-index: 1; /* above the ::before gradient */
}
.ios-login--web .ios-theme-toggle { top: 20px; right: 24px; }
@media (max-width: 1023px) { .ios-login--web { position: relative; grid-template-columns: 1fr; } }

.ios-login__card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ios-login__hello {
  margin: 0;
  font: 800 1.4rem/1.1 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--fg-strong);
}
.ios-login__copy { color: var(--fg-muted); font-size: 0.86rem; }
.ios-login__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--status-danger);
}
.ios-login__demo {
  background: transparent;
  border: 0;
  color: var(--accent-action);
  font: 600 0.85rem/1.4 var(--font-display);
  padding: 4px;
  cursor: pointer;
}
.ios-login__footer {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--fg-subtle);
  text-align: center;
}
.ios-login__avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  color: #fff;
  font: 800 0.82rem/1 var(--font-display);
  letter-spacing: -0.02em;
  flex: 0 0 36px;
}

/* Login account-type cards (Company / Personal) */
.ios-login-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md, 16px);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .ios-login-type-card:hover { border-color: var(--accent-action); transform: translateY(-1px); }
}
.ios-login-type-card:active { transform: scale(0.98); }
/* ~95% of users are Company, so it leads: more padding, real elevation, an
   accent hairline. Personal is the quieter secondary choice. */
.ios-login-type-card--primary {
  padding: 18px 16px;
  border-color: color-mix(in srgb, var(--accent-action) 35%, var(--line-strong));
  box-shadow: var(--shadow-md);
}
.ios-login-type-card--primary:hover { box-shadow: var(--shadow-lg); }
.ios-login-type-card--secondary {
  background: var(--surface-sunken, var(--surface));
  border-color: var(--line);
}
.ios-login-type-card--secondary .ios-login-type-card__icon { width: 40px; height: 40px; flex-basis: 40px; }
.ios-login-type-card--secondary .ios-login-type-card__body strong { font-size: 0.92rem; }
.ios-login-type-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md, 14px);
  display: grid; place-items: center;
  color: #fff;
  flex: 0 0 48px;
  box-shadow: var(--shadow-sm);
}
.ios-login-type-card__body {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; flex: 1;
}
.ios-login-type-card__body strong {
  font: 700 1rem/1.1 var(--font-display);
  color: var(--fg-strong);
  letter-spacing: -0.01em;
}
.ios-login-type-card__body span {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.ios-login__back {
  background: transparent;
  border: 0;
  color: var(--accent-action);
  font: 600 0.9rem/1 var(--font-display);
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  cursor: pointer;
  margin-bottom: 4px;
  padding: 0;
}

/* Personal paywall pill */
.ios-login-paywall {
  display: flex; align-items: baseline; gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-violet), #c084fc);
  color: #fff;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.25);
}
.ios-login-paywall__price {
  font: 800 1.5rem/1 var(--font-display);
  letter-spacing: -0.03em;
}
.ios-login-paywall__per {
  font: 600 0.85rem/1 var(--font-display);
  opacity: 0.9;
}
.ios-login-paywall__tag {
  margin-left: auto;
  font: 700 0.62rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.22);
}

/* =============================================================================
   PROFILE
   ============================================================================= */
.ios-profile-hero {
  margin: 0 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
.ios-profile-hero__avatar {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: grid; place-items: center;
  color: #fff;
  font: 800 1.2rem/1 var(--font-display);
  letter-spacing: -0.04em;
  flex: 0 0 56px;
}
.ios-profile-hero__meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ios-profile-hero__name { font: 700 1.05rem/1.2 var(--font-display); color: var(--fg-strong); }
.ios-profile-hero__role { font-size: 0.85rem; color: var(--accent-action); font-weight: 600; }
.ios-profile-hero__venue { font-size: 0.78rem; color: var(--fg-muted); }

/* =============================================================================
   BATCH COLOUR TEST — visual stage
   ============================================================================= */
.ios-bc-test-stage {
  margin: 0 16px;
  padding: 32px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-md);
}
.ios-bc-test-dot {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.45),
    inset 0 -4px 8px rgba(0, 0, 0, 0.22),
    0 8px 18px rgba(15, 23, 42, 0.25);
}

/* =============================================================================
   TABLES — banner, status dots, edit mode, detail sheet
   ============================================================================= */
.ios-tables-banner {
  margin: 0 16px 8px;
  padding: 14px 12px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ios-tables-banner__cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ios-tables-banner__key {
  font: 700 0.58rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
}
.ios-tables-banner__val {
  font: 800 1.05rem/1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Status indicator dot on floor-plan tables */
.ios-fp-table { position: absolute; }
.ios-fp-table__status {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.ios-fp-table.is-editing {
  animation: ios-fp-shake 1.5s ease-in-out infinite;
}
@keyframes ios-fp-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(-1.5deg); }
  50%      { transform: translate(-50%, -50%) rotate(1.5deg); }
}
.ios-fp-table--add {
  background: var(--accent-action) !important;
  color: #fff;
  font: 800 1rem/1 var(--font-display) !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-pill) !important;
}
.ios-fp-tool.is-active {
  background: var(--accent-action);
  color: var(--fg-on-accent);
  border-color: var(--accent-action);
}

/* Inline status dot helper */
.ios-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  margin-right: 6px;
  flex: 0 0 8px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

/* Floor plan legend */
.ios-fp-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 0;
}
.ios-fp-legend__item {
  display: inline-flex;
  align-items: center;
  font: 600 0.7rem/1 var(--font-display);
  color: var(--fg-muted);
}

/* Mini tile next to list rows */
.ios-fp-table-tile-mini {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 0.85rem/1 var(--font-display);
  letter-spacing: -0.02em;
  flex: 0 0 36px;
  box-shadow: var(--shadow-xs);
}

/* Detail sheet */
.ios-table-detail__status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  font: 700 0.78rem/1 var(--font-display);
  letter-spacing: 0.02em;
  margin-top: 6px;
}
.ios-table-detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}
[data-theme="dark"] .ios-table-detail__meta {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}
.ios-table-detail__meta-cell {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ios-table-detail__meta-key {
  font: 700 0.6rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}
.ios-table-detail__meta-val {
  font: 700 0.95rem/1.1 var(--font-display);
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}
.ios-table-detail__notes-read {
  padding: 10px 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.88rem;
  color: var(--fg-strong);
}
[data-theme="dark"] .ios-table-detail__notes-read {
  background: rgba(255, 255, 255, 0.04);
}

.ios-bk-section-title-inline {
  font: 700 0.66rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin: 6px 0 2px;
}

.ios-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
}
.ios-status-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: 600 0.82rem/1 var(--font-display);
  color: var(--fg-strong);
  cursor: pointer;
}
.ios-status-btn.is-active { box-shadow: 0 0 0 1px currentColor inset; }

.ios-stepper {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  align-self: flex-start;
}
.ios-stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--accent-action-soft);
  color: var(--accent-action);
  font: 800 1.1rem/1 var(--font-display);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.ios-stepper span {
  min-width: 28px;
  text-align: center;
  font: 800 1.05rem/1 var(--font-display);
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}

.ios-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ios-flag-chip {
  padding: 6px 10px;
  background: var(--accent-action-soft);
  color: var(--accent-action);
  border: 0;
  border-radius: var(--radius-pill);
  font: 600 0.72rem/1 var(--font-display);
  cursor: pointer;
}

/* Edit-mode toolbar above the floor plan */
.ios-fp-edit-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 16px 8px;
}
.ios-fp-edit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-action);
  background: var(--accent-action-soft);
  color: var(--accent-action);
  font: 700 0.78rem/1 var(--font-display);
  cursor: pointer;
}
.ios-fp-edit-btn--danger { color: var(--status-danger); border-color: var(--status-danger); background: var(--status-danger-bg); }

/* Per-zone summary on Tables list view */
.ios-zone-summary {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 0 12px;
}
.ios-zone-summary__pill {
  font: 600 0.75rem/1 var(--font-display);
  color: var(--fg-strong);
  padding: 6px 10px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center;
}

/* Edit-table grid: number + seats side by side */
.ios-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* =============================================================================
   SPEC TEST — structured ingredient rows
   ============================================================================= */
.ios-spec-test-rows {
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ios-spec-row {
  display: grid;
  grid-template-columns: 1fr 72px 86px auto;
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 6px;
}
.ios-spec-row__name,
.ios-spec-row__qty,
.ios-spec-row__unit {
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: 0 10px;
  font: 600 0.88rem/1 var(--font-display);
  color: var(--fg-strong);
  outline: 0;
  min-width: 0;
}
[data-theme="dark"] .ios-spec-row__name,
[data-theme="dark"] .ios-spec-row__qty,
[data-theme="dark"] .ios-spec-row__unit {
  background: rgba(255, 255, 255, 0.05);
}
.ios-spec-row__qty {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ios-spec-row__name::placeholder { color: var(--fg-muted); font-weight: 500; }
.ios-spec-row__name:focus,
.ios-spec-row__qty:focus,
.ios-spec-row__unit:focus {
  background: var(--accent-action-soft);
  box-shadow: inset 0 0 0 1px var(--accent-action);
}
.ios-spec-row__del {
  width: 32px; height: 32px;
  border: 0;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: 800 1rem/1 var(--font-display);
}
[data-theme="dark"] .ios-spec-row__del { background: rgba(255, 255, 255, 0.06); }
.ios-spec-row__del:hover { background: var(--status-danger-bg); color: var(--status-danger); }
.ios-spec-row__add {
  margin: 4px 0 0;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--accent-action);
  font: 600 0.85rem/1 var(--font-display);
  cursor: pointer;
}
.ios-spec-row__add:hover { background: var(--accent-action-soft); }

/* Spec-test results review */
.ios-spec-review {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.ios-spec-review.is-pass { border-color: rgba(16, 185, 129, 0.4); }
.ios-spec-review.is-fail { border-color: rgba(239, 68, 68, 0.4); }
.ios-spec-review__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-sunken);
}
[data-theme="dark"] .ios-spec-review__head { background: rgba(255, 255, 255, 0.04); }
.ios-spec-review__num {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--accent-action);
  color: #fff;
  font: 700 0.85rem/1 var(--font-display);
}
.ios-spec-review__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.ios-spec-review__title strong {
  font: 700 0.95rem/1.2 var(--font-display);
  color: var(--fg-strong);
}
.ios-spec-review__title span {
  font-size: 0.74rem;
  color: var(--fg-muted);
}
.ios-spec-review__badge {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  color: #fff;
  font: 800 0.95rem/1 var(--font-display);
}

.ios-spec-review__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.ios-spec-review__table th {
  text-align: left;
  padding: 8px 12px;
  font: 700 0.65rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .ios-spec-review__table th { background: rgba(255, 255, 255, 0.03); }
.ios-spec-review__table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--fg-strong);
  font-weight: 600;
}
.ios-spec-review__table tr:last-child td { border-bottom: 0; }
.ios-spec-review__table tr.is-ok td { background: rgba(16, 185, 129, 0.06); }
.ios-spec-review__table tr.is-bad td { background: rgba(239, 68, 68, 0.06); }
.ios-spec-review__measure {
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  display: flex;
  gap: 4px;
}
/* A measure the user never gave — quiet, not an angry red "?" */
.ios-spec-review__measure .is-missing {
  color: var(--fg-subtle);
  font-weight: 500;
  font-style: italic;
}

/* "Sample data" note on the BK HQ screens — they run on illustrative seed
   figures until platform reporting is wired up. */
.ios-hq-sample {
  margin: 0 16px 4px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--status-warning-bg);
  border: 1px solid color-mix(in srgb, var(--status-warning) 38%, transparent);
  color: var(--fg);
  font-size: 0.8rem;
  line-height: 1.45;
}
.ios-hq-sample strong { color: var(--status-warning); }
.ios-spec-review__table .is-wrong {
  color: var(--status-danger);
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.5);
}

/* Garnish/Method/Glass review rows */
.ios-spec-review__meta {
  display: flex; flex-direction: column;
}
.ios-spec-review__meta-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.ios-spec-review__meta-row.is-ok  { background: rgba(16, 185, 129, 0.06); }
.ios-spec-review__meta-row.is-bad { background: rgba(239, 68, 68, 0.06); }
.ios-spec-review__meta-key {
  font: 700 0.62rem/1.4 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  align-self: center;
}
.ios-spec-review__meta-correct {
  font-weight: 600;
  color: var(--fg-strong);
}
.ios-spec-review__meta-row .is-wrong {
  color: var(--status-danger);
}


/* =============================================================================
   ADDITIONS — v22 follow-up
   Glassware photos, swatch picker, leaderboard podium + mini profile,
   profile sub-pages (switch + radio + range slider), empty states.
   ============================================================================= */

/* Glassware thumbnail in the list row */
.ios-glass-thumb {
  overflow: hidden;
  background: var(--bg-sunken);
}
.ios-glass-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* iOS switch (used in the profile sub-pages) */
.ios-switch {
  width: 44px; height: 26px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  position: relative;
  flex: 0 0 44px;
  transition: background 180ms;
}
.ios-switch.is-on { background: var(--status-success); }
.ios-switch__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ios-switch.is-on .ios-switch__knob { transform: translateX(18px); }
.ios-switch-row { gap: 12px; }

/* iOS radio dot */
.ios-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: 0 0 22px;
  position: relative;
  transition: border-color 180ms;
}
.ios-radio.is-on {
  border-color: var(--accent-action);
}
.ios-radio.is-on::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--accent-action);
  border-radius: 50%;
}

/* Range slider — used in spaced repetition */
.ios-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--line);
  border-radius: var(--radius-pill);
  outline: none;
}
.ios-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}
.ios-range::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}

/* Spaced-repetition card wrapper */
.ios-srs-card {
  margin: 0 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
.ios-srs-card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.ios-srs-card__label {
  font: 600 0.85rem/1 var(--font-display);
  color: var(--fg);
}
.ios-srs-card__value {
  font: 800 1.7rem/1 var(--font-display);
  color: var(--fg-strong);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.ios-srs-card__value small {
  font: 600 0.7rem/1 var(--font-display);
  color: var(--fg-muted);
  margin-left: 4px;
}
/* Tick labels under a range slider. Each label is positioned at the exact
   fraction of the track its value lives at (--tick, set inline), corrected
   for the 26px thumb: the thumb centre only travels (width − thumb), inset
   by half a thumb each end. A plain space-between row drifted off the stops. */
.ios-srs-card__ticks {
  position: relative;
  height: 12px;
  margin-top: 6px;
  font: 600 0.7rem/1 var(--font-mono);
  color: var(--fg-subtle);
}
.ios-srs-card__ticks span {
  position: absolute;
  top: 0;
  left: calc(13px + (100% - 26px) * var(--tick, 0));
  transform: translateX(-50%);
}

/* Time range row */
.ios-time-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 16px 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.ios-time-range label {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
.ios-time-range label span {
  font: 600 0.7rem/1 var(--font-display);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ios-time-range input {
  font: var(--type-body);
  border: 0; background: transparent;
  color: var(--fg-strong);
  font-weight: 700;
  padding: 0;
}
.ios-time-range__sep {
  font-weight: 700;
  color: var(--fg-muted);
  align-self: flex-end;
  padding-bottom: 4px;
}

/* Active-venue card */
.ios-venue-card {
  display: flex; align-items: flex-start; gap: 12px;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  font: inherit; color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.ios-venue-card:active { transform: scale(0.98); }
.ios-venue-card.is-active {
  border-color: var(--accent-action);
  box-shadow: 0 0 0 1px var(--accent-action) inset, var(--shadow-xs);
}
.ios-venue-card__mark {
  flex: 0 0 28px; padding-top: 2px;
}
.ios-venue-card__dot {
  display: block;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}
.ios-venue-card.is-active .ios-venue-card__dot { display: none; }
.ios-venue-card__check {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-action);
  color: #fff;
  font: 700 0.8rem/1 var(--font-display);
}
.ios-venue-card__body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.ios-venue-card__group {
  font: 600 0.7rem/1 var(--font-display);
  color: var(--accent-action);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ios-venue-card__name {
  font: 700 1rem/1.2 var(--font-display);
  color: var(--fg-strong);
}
.ios-venue-card__meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--fg-muted);
}

/* FAQ row */
.ios-faq-row { padding-top: 14px !important; padding-bottom: 14px !important; }
.ios-faq-row__answer {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-sunken);
  border-radius: 12px;
  color: var(--fg);
  line-height: 1.5;
  font-size: 0.88rem;
  text-align: left;
  white-space: normal;
}

/* System-status card on the Help screen */
.ios-status-card {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  cursor: pointer;
}
.ios-status-card__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  flex: 0 0 12px;
}
.ios-status-card__text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.ios-status-card__title {
  font: 600 0.95rem/1.2 var(--font-display);
  color: var(--fg-strong);
}
.ios-status-card__sub {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* =============================================================================
   LEADERBOARD — podium + my-row highlight + mini-profile sheet
   ============================================================================= */
.ios-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 6px;
  padding: 8px 16px 0;
  margin-top: 4px;
}
.ios-podium__col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit; color: inherit;
}
.ios-podium__avatar {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  font: 700 1rem/1 var(--font-display);
  color: #fff;
  letter-spacing: -0.02em;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.ios-podium__col--1 .ios-podium__avatar { width: 60px; height: 60px; font-size: 1.15rem; }
.ios-podium__crown {
  position: absolute;
  top: -10px;
  right: -6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.5);
}
.ios-podium__name {
  font: 600 0.78rem/1.1 var(--font-display);
  color: var(--fg-strong);
  text-align: center;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}
.ios-podium__score {
  font: 700 0.85rem/1 var(--font-display);
  color: var(--accent-action);
  font-variant-numeric: tabular-nums;
}
.ios-podium__plinth {
  margin-top: 4px;
  width: 100%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-md) 14px 0 0;
  color: var(--fg-muted);
  font: 800 1.4rem/1 var(--font-display);
  letter-spacing: -0.04em;
}
.ios-podium__col--1 .ios-podium__plinth { height: 56px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.15), var(--surface)); color: #d97706; }
.ios-podium__col--2 .ios-podium__plinth { height: 38px; }
.ios-podium__col--3 .ios-podium__plinth { height: 28px; }
.ios-podium__rank {
  font-size: 1.2rem;
  padding-top: 6px;
}

.ios-list__row.is-me {
  background: var(--accent-action-soft);
}
.ios-list__row.is-me .ios-list__row-title::after {
  content: 'You';
  margin-left: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-action);
  background: var(--surface);
  border: 1px solid var(--accent-action);
  border-radius: var(--radius-pill);
  padding: 2px 6px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Mini-profile sheet (leaderboard tap) */
.ios-leader-mini {
  display: flex; align-items: center; gap: 12px;
}
.ios-leader-mini__avatar {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: grid; place-items: center;
  font: 700 1.1rem/1 var(--font-display);
  color: #fff;
  flex: 0 0 56px;
}
.ios-leader-mini__meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.ios-leader-mini__name { font: 700 1.05rem/1.2 var(--font-display); color: var(--fg-strong); }
.ios-leader-mini__role { font-size: 0.78rem; color: var(--fg-muted); }
.ios-leader-mini__rank {
  font: 800 1.5rem/1 var(--font-display);
  color: var(--accent-action);
  font-variant-numeric: tabular-nums;
}

.ios-recent-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
  height: 120px;
  margin: 6px 0;
  padding: 12px;
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
}
.ios-recent-bars__col {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.ios-recent-bars__fill {
  width: 100%;
  border-radius: var(--radius-xs) 6px 2px 2px;
  min-height: 4px;
}
.ios-recent-bars__label {
  font: 700 0.7rem/1 var(--font-mono);
  color: var(--fg-muted);
}

/* =============================================================================
   COLOUR-CODE EDITOR — swatch picker
   ============================================================================= */
.ios-swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.ios-swatch {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out);
}
.ios-swatch:active { transform: scale(0.9); }
.ios-swatch.is-on {
  box-shadow: 0 0 0 3px var(--accent-action);
  transform: scale(1.08);
}
.ios-swatch-custom {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
.ios-swatch-custom__preview {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  flex: 0 0 36px;
}

/* =============================================================================
   EMPTY STATE — small inset card used across screens
   ============================================================================= */
.ios-empty {
  margin: 0 16px;
  padding: 22px 16px;
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.ios-empty__title {
  font: 700 0.95rem/1.2 var(--font-display);
  color: var(--fg-strong);
}
.ios-empty__sub {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* Pull-to-refresh hint — pure visual overscroll ribbon on the scroll container.
   Bleeds the scroll area's top edge so when the user drags down, a soft ring
   peeks in.  No JS — relies on the platform's overscroll bounce. */
.ios-scroll {
  overscroll-behavior: contain;
}
.ios-scroll::before {
  content: '';
  display: block;
  height: 0;
  margin-top: -1px;
  background: radial-gradient(40% 100% at 50% 100%, rgba(99, 102, 241, 0.18), transparent 70%);
  transition: height 200ms;
  pointer-events: none;
}

/* ---------- Food menu (restaurant-style list) ---------- */
.bk-menu { padding: 4px 16px 24px; }
.bk-menu__section { margin-top: 18px; break-inside: avoid; }
.bk-menu__head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--fg-strong);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.bk-menu__title {
  margin: 0;
  font: 800 1.05rem/1.1 var(--font-display);
  color: var(--fg-strong);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bk-menu__count { font: 600 0.68rem/1 var(--font-text); color: var(--fg-muted); }
.bk-menu-row { padding: 10px 0 2px; }
.bk-menu-row__top { display: flex; align-items: baseline; gap: 8px; }
.bk-menu-row__name {
  font: 700 0.92rem/1.25 var(--font-display);
  color: var(--fg-strong);
}
.bk-menu-row__lead {
  flex: 1 1 auto;
  min-width: 16px;
  border-bottom: 2px dotted var(--line);
  transform: translateY(-3px);
}
.bk-menu-row__price {
  font: 700 0.92rem/1 var(--font-display);
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bk-menu-row__desc {
  margin: 3px 0 0;
  font: 400 0.8rem/1.45 var(--font-text);
  color: var(--fg-muted);
  max-width: 56ch;
}
.bk-menu-tag {
  display: inline-block;
  font: 800 0.58rem/1 var(--font-display);
  font-style: normal;
  letter-spacing: 0.02em;
  border-radius: 5px;
  padding: 3px 5px;
  margin-left: 6px;
  vertical-align: 2px;
}
.bk-menu__key {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font: 500 0.72rem/1.4 var(--font-text);
  color: var(--fg-muted);
}
.bk-menu__key .bk-menu-tag { margin-left: 0; margin-right: 4px; }

/* Quiet-hours time inputs + weekly recap card (Reminders / Home). */
.ios-quiet-times { display: inline-flex; align-items: center; gap: 6px; }
.ios-time-input { width: 86px; padding: 8px 8px; font-variant-numeric: tabular-nums; text-align: center; }
.ios-recap-card {
  display: flex; flex-direction: column; gap: 3px;
  margin: 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 14px);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(168, 85, 247, 0.10));
  border: 1px solid var(--line);
}
.ios-recap-card__eyebrow {
  font: 700 0.62rem/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-action);
}
.ios-recap-card__line { font: 600 0.85rem/1.3 var(--font-display); color: var(--fg-strong); }

/* Glassware photo-grid cards are buttons; table resize handle is smaller. */
button.ios-photo-card--btn {
  font: inherit; cursor: pointer; color: inherit;
  /* Match the press feedback of grid cards / list rows for consistency. */
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out);
}
button.ios-photo-card--btn:active { transform: scale(0.97); }
.ios-fp-resize--table { width: 14px; height: 14px; right: -7px; bottom: -7px; border-radius: 5px; }

/* Venue switcher: grouped, searchable list (brand sections) */
.ios-venue-group { display: flex; flex-direction: column; gap: 8px; }
.ios-section__count {
  display: inline-block; margin-left: 4px;
  font: 600 0.78rem/1 var(--font-display);
  color: var(--fg-muted);
}

