/* =========================================================
   Aether: "aurora" identity
   Night-sky surfaces, a glowing horizon line under a glass
   header, soft light that follows the admin's two colours.
   Every colour below comes from the editable palette
   (/theme.css overrides the :root values).
   ========================================================= */

:root {
  --bg: #f3f2fb;
  --surface: #ffffff;
  --surface-2: #eceaf8;
  --ink: #16142b;
  --muted: #5c5a7a;
  --line: #dcd9ef;
  --basil: #5b47e0;
  --basil-2: #6d5cf0;
  --on-basil: #ffffff;
  --mustard: #14b8a6;
  --mustard-soft: #d3f4ef;
  --ketchup: #d1374f;
  --on-accent: #062521;
  --stripe: #ffffff;
  --logo-h: 36px;
  --hero-img: none;
  --hero-veil: 55%;
  --page-img: none;
  --ok: #138a5a;
  --ok-soft: #d4f3e4;
  --work-soft: #e2e4fb;
  --work: #4338ca;

  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.9rem, 7.4vw, 5.8rem);

  --r-sm: 9px;
  --r-md: 18px;
  --gutter: 16px;
  --max: 1200px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* derived from the palette, so they follow the admin's colours */
  --glow: color-mix(in srgb, var(--basil) 40%, transparent);
  --glow-accent: color-mix(in srgb, var(--mustard) 30%, transparent);
  --glass: color-mix(in srgb, var(--bg) 70%, transparent);
  --hairline: color-mix(in srgb, var(--line) 85%, transparent);
  --shadow-ticket: 0 1px 0 var(--line), 0 18px 40px -28px color-mix(in srgb, var(--ink) 55%, transparent);
  --shadow-lift: 0 24px 50px -30px color-mix(in srgb, var(--basil) 70%, transparent);
  --aurora-strength: 22%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0c0d1d;
    --surface: #15162b;
    --surface-2: #1c1d36;
    --ink: #eeedfb;
    --muted: #a3a1c4;
    --line: #2a2b4a;
    --basil: #6d5cf0;
    --basil-2: #8b7dff;
    --mustard: #5eead4;
    --mustard-soft: #163a3c;
    --ketchup: #ff6b81;
    --on-accent: #062521;
    --ok: #4ade9b;
    --ok-soft: #12332a;
    --work-soft: #1f2150;
    --work: #a5b4fc;
    --shadow-ticket: 0 1px 0 var(--line), 0 20px 44px -26px rgb(0 0 0 / 0.9);
    --aurora-strength: 30%;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0c0d1d;
  --surface: #15162b;
  --surface-2: #1c1d36;
  --ink: #eeedfb;
  --muted: #a3a1c4;
  --line: #2a2b4a;
  --basil: #6d5cf0;
  --basil-2: #8b7dff;
  --mustard: #5eead4;
  --mustard-soft: #163a3c;
  --ketchup: #ff6b81;
  --on-accent: #062521;
  --ok: #4ade9b;
  --ok-soft: #12332a;
  --work-soft: #1f2150;
  --work: #a5b4fc;
  --shadow-ticket: 0 1px 0 var(--line), 0 20px 44px -26px rgb(0 0 0 / 0.9);
  --aurora-strength: 30%;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-img) center / cover fixed, var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--font-body);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
::selection { background: color-mix(in srgb, var(--basil) 35%, transparent); }

/* ambient light: two slow blobs tinted with the palette */
body::before {
  content: ''; position: fixed; inset: -20vh -10vw auto; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 18% 30%, color-mix(in srgb, var(--basil) var(--aurora-strength), transparent), transparent 70%),
    radial-gradient(35% 45% at 82% 20%, color-mix(in srgb, var(--mustard) calc(var(--aurora-strength) * 0.7), transparent), transparent 70%);
  filter: blur(40px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  to { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; text-transform: var(--heading-case, none); }
h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
a { color: var(--basil-2); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--mustard); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--mustard); color: var(--on-accent); padding: 8px 12px; z-index: 100; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.loading { padding: 64px 0; color: var(--muted); }

/* ---------- glass top bar + horizon line ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 30px -24px rgb(0 0 0 / 0.6);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); min-height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.3rem/1 var(--font-display); letter-spacing: -0.03em; text-transform: var(--heading-case, none);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand > span {
  background: linear-gradient(100deg, var(--ink) 30%, var(--basil-2) 75%, var(--mustard));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.nav::-webkit-scrollbar { display: none; }
.nav__link {
  position: relative; color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px;
  white-space: nowrap; font-weight: 600; font-size: 0.94rem;
  transition: color 0.2s, background-color 0.2s;
}
.nav__link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav__link--on { color: var(--ink); background: color-mix(in srgb, var(--basil) 16%, transparent); }
.nav__link--on::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px;
  background: var(--mustard); box-shadow: 0 0 10px var(--mustard);
}
.account { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; line-height: 1.15;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 4px 14px 4px 5px; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.user-chip:hover { border-color: var(--basil-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--basil) 14%, transparent); }
.user-chip .head { border-radius: 50%; }
.user-chip__text { display: flex; flex-direction: column; align-items: flex-start; }
.user-chip__nick { font-weight: 700; font-size: 0.92rem; }
.user-chip__role { font-size: 0.72rem; color: var(--muted); }

/* the horizon: a thin line of light under the header */
.awning {
  position: absolute; left: 0; right: 0; top: 100%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--basil-2) 25%, var(--mustard) 60%, transparent);
  opacity: 0.85;
  filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 2px 14px var(--glow-accent));
}

/* ---------- layout ---------- */
.view { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 140px; outline: none; }
.view--enter { animation: view-in 0.45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
.page-head { margin-bottom: 28px; display: grid; gap: 8px; }
.page-head p { color: var(--muted); }
.page-head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.section-title { margin: 44px 0 16px; font-size: var(--step-1); }
.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; margin-bottom: 20px;
}
.block__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.block__head .input { max-width: 280px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; flex: 1 1 200px; }
.toolbar .input--num { flex: 0 0 90px; }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink); --b-line: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-line);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { --b-bg: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary {
  --b-bg: var(--basil); --b-fg: var(--on-basil); --b-line: transparent;
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--basil-2) 70%, transparent), transparent 60%);
  box-shadow: 0 10px 26px -12px var(--glow), inset 0 1px 0 color-mix(in srgb, white 22%, transparent);
}
.btn--primary:hover:not(:disabled) { --b-bg: var(--basil-2); box-shadow: 0 14px 34px -12px var(--glow), inset 0 1px 0 color-mix(in srgb, white 25%, transparent); transform: translateY(-1px); }
.btn--outline { --b-bg: color-mix(in srgb, var(--surface) 55%, transparent); --b-line: var(--line); }
.btn--outline:hover { --b-line: var(--basil-2); --b-bg: color-mix(in srgb, var(--basil) 10%, var(--surface)); }
.btn--success, .btn--add {
  --b-bg: var(--mustard); --b-fg: var(--on-accent); --b-line: transparent;
  box-shadow: 0 8px 22px -12px var(--mustard);
}
.btn--success:hover:not(:disabled), .btn--add:hover { --b-bg: color-mix(in srgb, var(--mustard) 85%, white); transform: translateY(-1px); }
.btn--danger { --b-bg: var(--ketchup); --b-fg: #fff; --b-line: transparent; }
.btn--danger:hover { --b-bg: color-mix(in srgb, var(--ketchup) 85%, black); }
.btn--ghost { --b-bg: transparent; --b-line: transparent; color: var(--muted); }
.btn--ghost:hover { --b-bg: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.btn--telegram { --b-bg: #2aabee; --b-fg: #fff; --b-line: transparent; box-shadow: 0 10px 24px -12px #2aabee; }
.btn--telegram:hover { --b-bg: #229ed9; }
.btn--sm { padding: 7px 13px; font-size: var(--step--1); }
.btn--lg { padding: 14px 26px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 1rem;
  transition: border-color 0.2s, transform 0.3s var(--ease), background-color 0.2s;
}
.icon-btn:hover { border-color: var(--basil-2); background: var(--surface-2); }
.icon-btn--sm { width: 30px; height: 30px; font-size: 0.9rem; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.form--grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form__full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 700; font-size: 0.9rem; }
.field__hint { font-size: var(--step--1); color: var(--muted); display: block; }
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 14px; min-height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input:hover { border-color: color-mix(in srgb, var(--basil-2) 45%, var(--line)); }
.input:focus-visible { border-color: var(--basil-2); outline: none; background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--basil) 20%, transparent); }
textarea.input { resize: vertical; }
.input--emoji { width: 64px; text-align: center; flex: 0 0 64px; }
.input--num { width: 90px; }
.switch {
  appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line);
  position: relative; cursor: pointer; flex: none; transition: background 0.25s var(--ease); margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.25s var(--ease); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35);
}
.switch:checked { background: var(--basil-2); box-shadow: 0 0 14px -2px var(--glow); }
.switch:checked::after { transform: translateX(18px); }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }
.color { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; background: var(--surface); cursor: pointer; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.pill--wait { background: var(--mustard-soft); color: var(--ink); }
.pill--work { background: var(--work-soft); color: var(--work); }
.pill--ready { background: var(--ok-soft); color: var(--ok); }
.pill--done { background: var(--surface-2); color: var(--muted); }
.pill--cancel { background: color-mix(in srgb, var(--ketchup) 15%, transparent); color: var(--ketchup); }
.pill--role { background: color-mix(in srgb, var(--role) 18%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--role) 55%, transparent); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(12px, 4vw, 48px) 0 clamp(40px, 6vw, 72px);
}
.hero__copy { display: grid; gap: 20px; justify-items: start; }
.hero__copy > * { animation: rise 0.8s var(--ease) both; }
.hero__copy > :nth-child(2) { animation-delay: 0.06s; }
.hero__copy > :nth-child(3) { animation-delay: 0.14s; }
.hero__copy > :nth-child(4) { animation-delay: 0.22s; }
.hero .stall-card { animation: rise 0.9s 0.18s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.hero__status {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line);
}
.hero__status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: beacon 2.2s ease-out infinite;
}
.hero__status.is-open { color: var(--ok); }
.hero__status.is-closed { color: var(--ketchup); }
.hero__status.is-closed::before { background: var(--ketchup); animation: none; }
@keyframes beacon { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.hero__title {
  font-size: var(--step-4); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; text-wrap: balance;
  background: linear-gradient(180deg, var(--ink) 35%, color-mix(in srgb, var(--ink) 55%, var(--basil-2)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
.hero__tagline { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 38ch; line-height: 1.5; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* the stall as a glowing pass */
.stall-card {
  position: relative; display: grid; gap: 6px; padding: 26px 26px 22px; border-radius: calc(var(--r-md) + 6px);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(140deg, var(--basil-2), color-mix(in srgb, var(--line) 60%, transparent) 40%, color-mix(in srgb, var(--line) 60%, transparent) 65%, var(--mustard)) border-box;
  box-shadow: 0 40px 80px -40px var(--glow), 0 20px 50px -40px var(--glow-accent);
}
.stall-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--mustard) 12%, transparent), transparent 55%),
              radial-gradient(100% 80% at 0% 100%, color-mix(in srgb, var(--basil) 14%, transparent), transparent 60%);
}
.stall-card > * { position: relative; }
.stall-card__label { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.stall-card__status { justify-self: start; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.stall-card__status.is-open { background: var(--ok-soft); color: var(--ok); }
.stall-card__status.is-closed { background: color-mix(in srgb, var(--ketchup) 14%, transparent); color: var(--ketchup); }
.stall-card__name { font: 800 var(--step-2)/1.1 var(--font-display); letter-spacing: -0.03em; text-transform: var(--heading-case, none); }
.stall-card__coords {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font: 700 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--mustard);
}
:root[data-theme='light'] .stall-card__coords { color: var(--basil); }
@media (prefers-color-scheme: light) { :root:not([data-theme='dark']) .stall-card__coords { color: var(--basil); } }
.stall-card__how { font-size: var(--step--1); color: var(--muted); margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.stall-card__discount { font-size: var(--step--1); margin-top: 6px; }

/* ---------- how it works ---------- */
.steps { padding: 8px 0 56px; scroll-margin-top: calc(var(--header-h) + 16px); }
.steps__title { font-size: var(--step-2); margin-bottom: 20px; }
.steps__list {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.step {
  position: relative; display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
}
.step + .step::before { /* the connecting thread between steps */
  content: ''; position: absolute; top: 38px; right: calc(100% + 1px); width: 14px; height: 2px;
  background: linear-gradient(90deg, var(--basil-2), var(--mustard));
}
.step__n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 800 0.95rem/1 var(--font-display); color: var(--on-basil);
  background: linear-gradient(135deg, var(--basil-2), var(--basil)); box-shadow: 0 6px 18px -6px var(--glow);
}
.step__title { font-size: 1.08rem; margin-top: 4px; }
.step__text { color: var(--muted); font-size: 0.93rem; }

/* ---------- menu ---------- */
.menu { scroll-margin-top: calc(var(--header-h) + 8px); }
.menu__title { font-size: var(--step-3); letter-spacing: -0.035em; margin-bottom: 8px; }
/* category bar: no box of its own; a full-bleed band (same look as the scrolled
   header) appears only while it is stuck under the header */
.catbar-wrap {
  position: sticky; top: var(--header-h); z-index: 5; margin: 0 0 8px;
  container-type: scroll-state;
}
.catbar-bg {
  position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--hairline, var(--line));
  box-shadow: 0 10px 30px -24px rgb(0 0 0 / 0.6);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
@container scroll-state(stuck: top) {
  .catbar-bg { opacity: 1; }
}
/* desktop: categories wrap onto more rows so every one stays visible */
.catbar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0;
}
.catbar::-webkit-scrollbar { display: none; }
.catbar__link {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 0.93rem;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.catbar__link:hover { border-color: var(--basil-2); background: color-mix(in srgb, var(--basil) 10%, var(--surface)); transform: translateY(-1px); }
.menu-section { margin-top: 32px; scroll-margin-top: calc(var(--header-h) + 70px); }
.menu-section__title { margin-bottom: 16px; font-size: var(--step-1); display: flex; align-items: center; gap: 10px; }
.menu-section__title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.product {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s var(--ease);
}
.product:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--basil-2) 55%, var(--line)); box-shadow: var(--shadow-lift); }
.product__img {
  aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 12px; position: relative;
  background:
    radial-gradient(60% 60% at 50% 55%, color-mix(in srgb, var(--basil) 22%, transparent), transparent 70%),
    var(--surface-2);
}
.product__img img { max-height: 70%; max-width: 70%; object-fit: contain; width: auto; transition: transform 0.5s var(--ease); filter: drop-shadow(0 12px 14px rgb(0 0 0 / 0.3)); }
.product:hover .product__img img { transform: scale(1.06) translateY(-2px); }
.product__img img.pixel { image-rendering: pixelated; width: 34%; height: auto; max-height: none; }
.product__noimg { font: 800 2.4rem/1 var(--font-display); color: var(--basil-2); opacity: 0.35; }
.product__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product__name { font-size: 1rem; }
.product__desc { font-size: 0.9rem; color: var(--muted); }
.product__foot { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.product__ctl { display: flex; justify-content: center; }
.product__price { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.product__now { font: 800 1.2rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.product__was { color: var(--muted); font-size: 0.9rem; }
.product__soldout { font-size: var(--step--1); font-weight: 700; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface-2); }
.product--off .product__img { filter: grayscale(1); opacity: 0.5; }
.product--off:hover { transform: none; box-shadow: none; }

.stepper {
  display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--surface-2); animation: pop 0.25s var(--ease);
}
.stepper button {
  background: transparent; border: 0; min-width: 34px; cursor: pointer; font-weight: 800; font-size: 1.05rem;
  transition: background-color 0.15s, color 0.15s;
}
.stepper button:hover { background: color-mix(in srgb, var(--mustard) 25%, transparent); }
.stepper__input {
  width: 44px; border: 0; text-align: center; background: transparent; font-weight: 800;
  -moz-appearance: textfield; appearance: textfield; padding: 6px 0;
}
.stepper__input::-webkit-inner-spin-button, .stepper__input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper__unit { display: grid; place-items: center; padding-right: 8px; font-size: 0.8rem; font-weight: 600; color: var(--muted); user-select: none; }
.stepper .stepper__input { width: 40px; text-align: right; padding-right: 5px; }
.stepper--sm button { min-width: 28px; font-size: 0.95rem; }
.stepper--sm span { min-width: 26px; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; }

/* ---------- cart: floating button + receipt drawer ---------- */
.cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px;
  background: var(--basil); color: var(--on-basil); border: 0; border-radius: 999px; cursor: pointer; font-weight: 700;
  background-image: linear-gradient(135deg, var(--basil-2), var(--basil));
  box-shadow: 0 16px 40px -12px var(--glow), inset 0 1px 0 color-mix(in srgb, white 25%, transparent);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
  animation: rise 0.45s var(--ease) both;
}
.cart-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -14px var(--glow); }
.cart-fab[hidden] { display: none; }
.cart-fab--bump .cart-fab__count { animation: bump 0.45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.28); } }
.cart-fab__count {
  background: var(--mustard); color: var(--on-accent); border-radius: 999px; min-width: 36px; height: 36px;
  display: grid; place-items: center; font: 800 1rem/1 var(--font-display); padding: 0 9px;
  box-shadow: 0 0 18px -4px var(--mustard);
}
.cart-fab__total { font-variant-numeric: tabular-nums; opacity: 0.92; }

.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer[hidden] { display: none; }
.drawer__backdrop {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, rgb(0 0 0 / 0.5));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 100%);
  padding: 20px; overflow-y: auto; animation: drawer-in 0.4s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }

.receipt {
  background: var(--surface); padding: 24px 22px; display: grid; gap: 16px;
  border-radius: calc(var(--r-md) + 4px); position: relative; border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / 0.6), 0 0 0 1px color-mix(in srgb, var(--basil) 10%, transparent);
}
.receipt__head { display: flex; justify-content: space-between; align-items: center; }
.receipt__shop { color: var(--muted); font-size: var(--step--1); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.receipt__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.receipt__line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.receipt__name { font-weight: 600; }
.receipt__price { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.receipt__row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.receipt__row--muted { color: var(--ok); font-size: 0.92rem; }
.receipt__total {
  padding-top: 14px; border-top: 1px solid var(--line);
  font: 800 var(--step-2)/1 var(--font-display); letter-spacing: -0.02em;
}
.receipt__hint { font-size: var(--step--1); color: var(--muted); }

/* ---------- ticket (queue number) ---------- */
.ticket-list { display: grid; gap: 16px; }
.ticket {
  --notch: 10px;
  display: grid; grid-template-columns: 92px 1fr; background: var(--surface);
  border-radius: var(--r-md); box-shadow: var(--shadow-ticket); position: relative;
  -webkit-mask: radial-gradient(circle var(--notch) at 92px 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 92px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at 92px 0, transparent 98%, #000) top / 100% 51% no-repeat,
        radial-gradient(circle var(--notch) at 92px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket__stub {
  background: linear-gradient(160deg, var(--mustard), color-mix(in srgb, var(--mustard) 70%, var(--basil)));
  color: var(--on-accent); border-radius: var(--r-md) 0 0 var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 14px 6px; border-right: 2px dashed rgb(0 0 0 / 0.25); text-align: center;
}
.ticket--in_progress .ticket__stub { background: linear-gradient(160deg, #a5b4fc, #818cf8); color: #13153a; }
.ticket--ready .ticket__stub { background: linear-gradient(160deg, #86efac, #4ade80); color: #062a14; }
.ticket--completed .ticket__stub, .ticket--cancelled .ticket__stub { background: var(--surface-2); color: var(--muted); border-right-color: var(--line); }
.ticket__stub-top { font: 800 1.6rem/1 var(--font-display); }
.ticket__code {
  font: 800 1rem/1.05 var(--font-display); letter-spacing: 0.04em;
  writing-mode: vertical-rl; transform: rotate(180deg); margin: 6px 0;
}
.ticket__prefix { font-size: 0.7rem; font-weight: 700; opacity: 0.65; }
.ticket__body { padding: 16px 18px; display: grid; gap: 10px; min-width: 0; }
.ticket__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket__time, .ticket__owner { font-size: var(--step--1); color: var(--muted); }
.ticket__owner { font-weight: 700; }
.ticket__msg { font-weight: 600; }
.ticket__notes {
  font-size: 0.9rem; background: var(--mustard-soft); padding: 8px 12px; border-radius: var(--r-sm);
  border-left: 3px solid var(--mustard);
}
.ticket__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ticket__total { font: 800 1.2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ticket__total small { font: 600 0.8rem var(--font-body); color: var(--ok); }
.ticket__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket--others { opacity: 0.72; }
.ticket-list--past .ticket { opacity: 0.85; }

/* a freshly placed order "prints" */
.ticket--printed { animation: print 0.8s var(--ease) both; }
@keyframes print {
  0% { clip-path: inset(0 0 100% 0); transform: translateY(-14px); }
  100% { clip-path: inset(0 0 0 0); transform: none; }
}

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.93rem; }
.items li { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px; }
.items__qty { font-weight: 800; font-variant-numeric: tabular-nums; }
.items__price { color: var(--muted); font-variant-numeric: tabular-nums; }

.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.track__step { font-size: 0.72rem; color: var(--muted); padding-top: 10px; position: relative; }
.track__step::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--line);
}
.track__step.is-done::before { background: linear-gradient(90deg, var(--basil-2), var(--mustard)); box-shadow: 0 0 10px -2px var(--glow); }
.track__step.is-done { color: var(--ink); }
.track__step.is-now { font-weight: 800; }

/* ---------- staff board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lane {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line);
  border-radius: calc(var(--r-md) + 2px); padding: 14px; min-height: 240px;
}
.lane__head { display: flex; justify-content: space-between; align-items: center; }
.lane__head h2 { font-size: var(--step-1); }
.lane__count {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center;
  font: 800 1rem/1 var(--font-display); background: var(--surface); border: 1px solid var(--line);
}
.lane--pending .lane__count { background: var(--mustard); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 18px -4px var(--mustard); }
.lane__hint { font-size: var(--step--1); color: var(--muted); margin: 4px 0 12px; }
.lane__list { display: grid; gap: 12px; }
.lane__empty { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 28px 0; border: 1px dashed var(--line); border-radius: var(--r-md); }
.lane .ticket { grid-template-columns: 64px 1fr; --notch: 8px;
  -webkit-mask: radial-gradient(circle var(--notch) at 64px 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 64px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at 64px 0, transparent 98%, #000) top / 100% 51% no-repeat,
        radial-gradient(circle var(--notch) at 64px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.lane .ticket__body { padding: 12px 14px; gap: 8px; }
.wait { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.wait--ok { background: var(--ok-soft); color: var(--ok); }
.wait--warn { background: var(--mustard-soft); color: var(--ink); }
.wait--late { background: var(--ketchup); color: #fff; }

.customer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.customer > div { display: grid; min-width: 0; }
.customer__tg { font-size: var(--step--1); }
.head { border-radius: 6px; image-rendering: pixelated; flex: none; }
.head--fallback { display: grid; place-items: center; background: var(--basil); color: var(--on-basil); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted);
  transition: color 0.2s, background-color 0.25s var(--ease), box-shadow 0.25s;
}
.tab:hover { color: var(--ink); }
.tab--on { background: var(--basil); color: var(--on-basil); box-shadow: 0 6px 18px -8px var(--glow); }
.tab--on:hover { color: var(--on-basil); }

/* ---------- tables, stats, lists ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: var(--surface); }
.table th { text-align: left; font-weight: 700; color: var(--muted); font-size: var(--step--1); padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color 0.15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--basil) 5%, transparent); }
.table tr.is-muted td { opacity: 0.55; }
.table select.input { min-width: 150px; width: auto; }
.mono-code { font: 700 0.95rem var(--font-display); letter-spacing: 0.03em; white-space: nowrap; }
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.table td.cell-actions { display: table-cell; text-align: right; white-space: nowrap; }
.table td.cell-actions > * + * { margin-left: 6px; }
.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }

.panel { display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px; display: grid; gap: 6px;
}
.stat::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%); pointer-events: none;
}
.stat__value { font: 800 var(--step-2)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat__label { font-size: var(--step--1); color: var(--muted); }
.bar { position: relative; min-width: 90px; height: 24px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--basil-2), var(--mustard)); }
.bar span { position: relative; padding-left: 10px; line-height: 24px; font-weight: 700; font-size: 0.85rem; }

.log { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.log li { display: grid; grid-template-columns: 110px 120px 160px 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log__action { font-weight: 700; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.subhead { font-size: 1.05rem; margin-top: 12px; }

/* ---------- catalog admin ---------- */
.prod-group { margin-top: 18px; }
.prod-group h3 { font-size: 1.05rem; margin-bottom: 8px; }
.prod-list, .cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prod-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 90px 140px auto; gap: 12px; align-items: center;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color 0.2s;
}
.prod-row:hover { border-color: color-mix(in srgb, var(--basil-2) 45%, var(--line)); }
.prod-row.is-muted { background: var(--surface-2); }
.prod-row__img { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-weight: 800; color: var(--muted); }
.prod-row__img img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.prod-row__name { display: grid; min-width: 0; }
.prod-row__name .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-row__price { font: 700 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.prod-row__avail { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-row .input:not(.input--emoji):not(.input--num) { flex: 1 1 180px; width: auto; }
.cat-row--new { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

.img-drop { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.img-drop__preview {
  width: 120px; height: 120px; border-radius: var(--r-md); border: 1px dashed var(--line);
  display: grid; place-items: center; background: var(--surface-2); overflow: hidden; color: var(--muted); font-size: var(--step--1); text-align: center;
}
.img-drop__preview img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.img-drop__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.img-drop__actions .field__hint { flex-basis: 100%; }

/* ---------- roles ---------- */
.role-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.role-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: grid; gap: 10px;
  background: radial-gradient(120% 60% at 0 0, color-mix(in srgb, var(--role) 16%, transparent), transparent 60%), var(--surface);
  box-shadow: inset 0 3px 0 var(--role);
}
.role-card__top { display: flex; gap: 8px; }
.role-card__pct { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.role-card__pct .input { font: 800 1.4rem var(--font-display); text-align: center; }
.role-card__example { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.role-card .cell-actions { justify-content: flex-start; }

/* ---------- auth ---------- */
.auth { display: grid; place-items: start center; padding-top: 24px; }
.auth__card {
  width: min(460px, 100%); padding: 32px 28px; display: grid; gap: 18px; border-radius: calc(var(--r-md) + 6px);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, var(--basil-2), var(--line) 35%, var(--line) 70%, var(--mustard)) border-box;
  box-shadow: 0 40px 90px -45px var(--glow);
  animation: rise 0.6s var(--ease) both;
}
.auth__intro { color: var(--muted); }
.auth__footer { font-size: 0.92rem; color: var(--muted); text-align: center; }
.tg-step { display: grid; gap: 16px; }
.tg-step__list { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.tg-step__status { font-size: 0.92rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.tg-step__status::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--mustard); flex: none;
  animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 0 10px var(--mustard);
}
.tg-step__status.is-error { color: var(--ketchup); }
.tg-step__status.is-error::before { background: var(--ketchup); animation: none; box-shadow: none; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- empty, notices ---------- */
.empty {
  text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--r-md);
  display: grid; gap: 8px; justify-items: center; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.empty__title { font: 700 var(--step-1) var(--font-display); color: var(--ink); }
.empty .btn { margin-top: 8px; }
.notice { padding: 10px 14px; border-radius: var(--r-sm); font-size: 0.9rem; }
.notice--warn { background: var(--mustard-soft); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-wrap__backdrop {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 50%, rgb(0 0 0 / 0.55));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s ease-out;
}
.modal {
  position: relative; width: min(500px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r-md) + 4px); padding: 24px; display: grid; gap: 16px;
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.65), 0 0 60px -30px var(--glow); animation: pop 0.3s var(--ease);
}
.modal--wide { width: min(740px, 100%); }
@keyframes pop { from { transform: scale(0.95) translateY(6px); opacity: 0; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal__head h2 { font-size: var(--step-1); }
.modal__body { display: grid; gap: 12px; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast {
  background: color-mix(in srgb, var(--ink) 92%, var(--basil)); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 16px 40px -14px rgb(0 0 0 / 0.55); transition: opacity 0.3s, transform 0.3s var(--ease);
  animation: rise 0.35s var(--ease) both; text-align: center;
}
.toast--success { box-shadow: 0 16px 40px -14px rgb(0 0 0 / 0.55), inset 0 0 0 2px var(--mustard); }
.toast--error { background: var(--ketchup); color: #fff; }
.toast--out { opacity: 0; transform: translateY(8px); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .board { grid-template-columns: 1fr; }
  .lane { min-height: 0; }
  .prod-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .prod-row__avail, .prod-row .cell-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --header-h: 104px; }
  .topbar__inner { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; }
  .steps__list { grid-template-columns: 1fr; }
  .step + .step::before { top: auto; bottom: calc(100% + 1px); right: auto; left: 38px; width: 2px; height: 14px; background: linear-gradient(var(--basil-2), var(--mustard)); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product__body { padding: 12px; }
  .ticket { grid-template-columns: 64px 1fr; --notch: 8px;
    -webkit-mask: radial-gradient(circle var(--notch) at 64px 0, transparent 98%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle var(--notch) at 64px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
    mask: radial-gradient(circle var(--notch) at 64px 0, transparent 98%, #000) top / 100% 51% no-repeat,
          radial-gradient(circle var(--notch) at 64px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  }
  .ticket__body { padding: 12px 14px; }
  .view { padding-top: 32px; }
  .user-chip__role { display: none; }
  /* mobile: one swipeable row, faded at the edge to hint there is more */
  .catbar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 24px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  }
  .catbar::-webkit-scrollbar { display: none; }
  .cart-fab { right: 12px; bottom: 12px; left: 12px; justify-content: space-between; }
  .hero__cta .btn { flex: 1 1 auto; }
}

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

/* ---------- theme hooks (values come from /theme.css) ---------- */
.brand__logo { height: var(--logo-h); width: auto; max-width: 220px; object-fit: contain; }
.brand__logo.pixel { image-rendering: pixelated; }
.hero--image {
  position: relative; isolation: isolate; border-radius: calc(var(--r-md) + 6px); overflow: hidden;
  padding: clamp(24px, 5vw, 56px); margin-top: 8px; margin-bottom: 40px;
  background: var(--hero-img) center / cover no-repeat;
}
.hero--image::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, color-mix(in srgb, var(--bg) calc(var(--hero-veil) + 25%), transparent) 20%, color-mix(in srgb, var(--bg) var(--hero-veil), transparent));
}

/* ---------- appearance editor ---------- */
.appearance { display: grid; gap: 16px; padding-bottom: 24px; }
.ap-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: clamp(16px, 3vw, 24px); display: grid; gap: 14px;
}
.ap-card__title { font-size: var(--step-1); }
.ap-card__hint { color: var(--muted); font-size: var(--step--1); max-width: 70ch; margin-top: -6px; }
.ap-sub { font: 700 var(--step-0)/1.2 var(--font-body); text-transform: none; margin-top: 6px; }
.ap-note { background: var(--mustard-soft); border-radius: var(--r-sm); padding: 8px 12px; font-size: var(--step--1); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-weight: 600;
}
.preset:hover { border-color: var(--ink); }
.preset__dots { display: inline-flex; }
.preset__dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); margin-left: -6px; }
.preset__dot:first-child { margin-left: 0; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.color-field {
  display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2);
}
.color-field__picker {
  width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: none; cursor: pointer;
}
.color-field__picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-field__picker::-webkit-color-swatch { border: 0; border-radius: calc(var(--r-sm) - 1px); }
.color-field__text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.color-field__label { font-size: var(--step--1); font-weight: 600; line-height: 1.25; }
.input--hex { min-height: 32px; padding: 4px 8px; font-variant-numeric: tabular-nums; width: 9ch; }

.contrast { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.contrast li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); }
.contrast li.is-bad { background: color-mix(in srgb, var(--ketchup) 14%, transparent); color: var(--ketchup); font-weight: 600; }
.contrast__chip { display: grid; place-items: center; width: 30px; height: 24px; border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 700; border: 1px solid var(--line); }

.font-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.font-pick { display: grid; gap: 10px; align-content: start; }
.font-pick__family { display: grid; gap: 6px; }
.font-sample { padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.font-sample--display { font: 800 var(--step-2)/1.1 var(--font-display); text-transform: var(--heading-case, none); }
.font-sample--body { font-family: var(--font-body); }
.font-upload { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 10px; }
.font-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.font-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.font-list__sample { font-size: var(--step-1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.img-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.img-slot { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.img-slot__preview {
  width: 96px; height: 72px; flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--surface) 0 25%, var(--surface-2) 0 50%) 0 0 / 14px 14px;
}
.img-slot__preview img { width: 100%; height: 100%; object-fit: contain; }
.img-slot__preview--hero img, .img-slot__preview--background img { object-fit: cover; }
.img-slot__body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.img-slot__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.range { width: 100%; accent-color: var(--basil-2); }
.range-label { display: flex; justify-content: space-between; gap: 8px; }
.range-out { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.input--code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.875rem; line-height: 1.5; resize: vertical; }

.savebar {
  position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 18px; background: var(--ink); color: var(--bg);
  border-radius: var(--r-md); box-shadow: 0 16px 32px -16px rgb(0 0 0 / 0.5);
}
.savebar__status { font-weight: 600; }
.savebar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.savebar .btn--ghost { color: var(--bg); --b-line: color-mix(in srgb, var(--bg) 35%, transparent); }
.savebar .btn--ghost:hover { --b-bg: color-mix(in srgb, var(--bg) 12%, transparent); }
.savebar .btn--primary { --b-bg: var(--mustard); --b-fg: var(--on-accent); --b-line: var(--mustard); }
.ap-card > .tabs { justify-self: start; }
.hero--solo { grid-template-columns: 1fr; }
