/* TableSide OS — design tokens + components */
:root, [data-theme="light"] {
  --color-primary: #D94E28;
  --color-primary-hover: #BF431F;
  --color-on-primary: #FFFFFF;
  --surface-base: #FAF9F6;
  --surface-card: #FFFFFF;
  --surface-sunken: #F1EFE9;
  --text-strong: #1B1A17;
  --text-muted: #6B665C;
  --border: #E4E0D6;
  --status-available: #16A34A;
  --status-low: #D97706;
  --status-soldout: #DC2626;
  --badge-green-bg: #DCFCE7;       --badge-green-fg: #14532D;
  --badge-amber-bg: #FEF3C7;          --badge-amber-fg: #78350F;
  --badge-red-bg: #FEE2E2;       --badge-red-fg: #7F1D1D;
  --badge-blue-bg: #E0E7FF;     --badge-blue-fg: #312E81;
  --shadow-card: 0 1px 2px rgba(27,26,23,.06), 0 4px 14px rgba(27,26,23,.06);
  --shadow-sheet: 0 -10px 40px rgba(0,0,0,.25);
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px; --radius-pill: 999px;
  --font-serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --touch: 44px;
}
[data-theme="dark"] {
  --color-primary: #E8643F;
  --color-primary-hover: #F07A57;
  --surface-base: #121212;
  --surface-card: #1E1E1E;
  --surface-sunken: #181818;
  --text-strong: #F4F1EA;
  --text-muted: #A8A296;
  --border: #2E2E2E;
  --status-available: #4ADE80;
  --status-low: #FBBF24;
  --status-soldout: #F87171;
  --badge-green-bg: #14301F;       --badge-green-fg: #86EFAC;
  --badge-amber-bg: #3A2A0B;          --badge-amber-fg: #FCD34D;
  --badge-red-bg: #3F1414;       --badge-red-fg: #FCA5A5;
  --badge-blue-bg: #1E2150;     --badge-blue-fg: #A5B4FC;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-base); color: var(--text-strong);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1,h2,h3,h4 { margin: 0; }
img { display: block; max-width: 100%; }
[x-cloak] { display: none !important; }
.num, .price { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-serif); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* ---------- Workspace toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface-card); border-bottom: 1px solid var(--border);
}
.toolbar .btn { white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Logo: keeps the shape of the uploaded image (square, wide, tall, round, transparent PNG…).
   A light chip behind it keeps any logo legible on dark photos and in evening mode. */
.logo {
  display: block; flex: none; box-sizing: border-box; height: var(--logo-h, 36px); width: auto; max-width: var(--logo-max, 150px);
  padding: 4px; background: #fff; object-fit: contain; border-radius: 10px;
}
.logo[data-shape="rounded"] { width: var(--logo-h, 36px); object-fit: cover; border-radius: 24%; }
.logo[data-shape="circle"] { width: var(--logo-h, 36px); object-fit: cover; border-radius: 50%; }
.venue-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.venue { min-width: 0; }
.venue small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.brand { font-family: var(--font-serif); font-weight: 700; font-size: 18px; margin-right: auto; white-space: nowrap; }
.brand b { color: var(--color-primary); }
.seg { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.seg a, .seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 600; font-size: 13px; text-decoration: none; min-height: 36px;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg .on { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-card); }
.icon-btn {
  width: var(--touch); height: var(--touch); display: inline-grid; place-items: center;
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-card);
}
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons / inputs ---------- */
.btn {
  min-height: var(--touch); padding: 0 20px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface-card); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
a.btn { text-decoration: none; }
a.btn:not(.btn-primary) { color: var(--text-strong); }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); border-color: transparent; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-danger { color: var(--status-soldout); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.input {
  width: 100%; min-height: var(--touch); padding: 10px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface-card);
}
textarea.input { min-height: 84px; resize: vertical; }

/* ---------- Badges ---------- */
.badge { display:inline-flex; align-items:center; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.badge-green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.status { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; }
.status::before { content:''; width:8px; height:8px; border-radius:50%; background: currentColor; }
.status-available { color: var(--status-available); }
.status-low { color: var(--status-low); }
.status-soldout { color: var(--status-soldout); }

/* ---------- Menu cards (shared by diner, admin preview, design docs) ---------- */
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface-card);
  border-radius: 24px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; text-align: left;
  box-shadow: 0 2px 4px rgba(27,26,23,.06), 0 14px 32px -12px rgba(120,45,15,.28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:active { transform: scale(.985); }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(27,26,23,.08), 0 22px 40px -12px rgba(217,78,40,.4); } }
[data-theme="dark"] .card { box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 14px 32px -12px rgba(0,0,0,.7); }

/* Photo: taller crop, warm vignette at the base so the price badge always reads. */
.card-media { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, #3a1a10, #7a2e14); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; filter: saturate(1.12) contrast(1.04); }
@media (hover: hover) { .card:hover .card-media img { transform: scale(1.06); } }
.card-media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; pointer-events: none; background: linear-gradient(to top, rgba(20,8,4,.78), rgba(20,8,4,0)); }
.card-price {
  position: absolute; left: 14px; bottom: 12px; z-index: 2; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .01em;
  padding: 6px 14px; border-radius: var(--radius-pill); background: rgba(217,78,40,.92); box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

.card-body { padding: 16px 18px 18px; display: grid; gap: 8px; }
.card-title { font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.005em; }
.card-desc { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.card-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.card-meta .icon { width: 16px; height: 16px; }
.price { font-weight: 800; font-size: 17px; }

/* Add button: an inviting pill rather than a lone "+" */
.add-btn {
  min-width: var(--touch); height: var(--touch); padding: 0 20px 0 14px; border-radius: var(--radius-pill); border: 0;
  background: linear-gradient(135deg, #E8643F, #D94E28); color: #fff; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; box-shadow: 0 6px 16px -4px rgba(217,78,40,.6);
  transition: transform .12s ease, box-shadow .12s ease;
}
.add-btn .icon { width: 18px; height: 18px; stroke-width: 2.6; }
.add-btn:hover { box-shadow: 0 8px 20px -4px rgba(217,78,40,.75); }
.add-btn:active { transform: scale(.95); }
.add-btn[disabled] { background: var(--border); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }

/* Favourites heart: floats on the photo, or sits beside "Add" on text rows. Filled when saved. */
.fav-btn {
  width: var(--touch); height: var(--touch); border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: rgba(20,8,4,.55); color: #fff; backdrop-filter: blur(6px); transition: transform .12s ease, color .12s ease;
}
.fav-btn .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.fav-btn.on { color: #FF6B4A; }
.fav-btn.on .icon { fill: currentColor; animation: heart-pop .28s ease; }
.fav-btn:active { transform: scale(.88); }
.card-media .fav-btn { position: absolute; right: 12px; bottom: 10px; z-index: 2; }
.card-row .fav-btn, .fav-inline { background: var(--surface-sunken); color: var(--text-muted); backdrop-filter: none; }
.card-row .fav-btn.on, .fav-inline.on { color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 14%, transparent); }
.card-actions { display: flex; align-items: center; gap: 8px; }
@keyframes heart-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .fav-btn.on .icon { animation: none; } }
.pill-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--color-primary); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.pill .icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.pill.on .pill-count { background: #fff; color: var(--color-primary); }

.card-row { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 18px; gap: 14px; border-radius: 20px; }
.card-row .card-body { padding: 0; flex: 1; min-width: 0; }
.card-row .card-title { font-size: 19px; }
.card-row .card-aside { display: grid; justify-items: end; gap: 8px; }
.card-row .price { color: var(--color-primary); font-size: 18px; }
.card.soldout { opacity: .62; filter: grayscale(.7); }
.card.soldout .card-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.pill-soldout {
  position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--status-soldout); color: #fff; font-weight: 800;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 11px; border-radius: var(--radius-pill);
}
.pill-low {
  position: absolute; top: 14px; right: 14px; z-index: 2; background: #FBBF24; color: #3a1d00; font-weight: 800;
  font-size: 11px; letter-spacing: .03em; padding: 5px 11px; border-radius: var(--radius-pill); box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.card-row .pill-soldout, .card-row .pill-low { position: static; display: inline-block; box-shadow: none; }
.card.soldout .card-media::before {
  content: ''; position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(220,38,38,.14) 14px 16px);
}

/* ---------- Diner shell ---------- */
body.diner-body { background: var(--surface-sunken); }
.stage { display: grid; place-items: start center; padding: 0; }
/* .phone is a non-scrolling shell (also the containing block for sheets); .phone-scroll scrolls. */
.phone {
  width: 100%; max-width: 430px; height: 100dvh; background: var(--surface-base); position: relative;
  overflow: hidden; transform: translateZ(0);
}
.phone-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
/* Phones get the menu edge-to-edge; larger screens see it centred in a phone-sized column. */
@media (min-width: 560px) {
  .stage { padding: 24px 0; }
  .phone { height: min(900px, calc(100dvh - 48px)); border-radius: 36px; border: 1px solid var(--border); box-shadow: 0 24px 70px rgba(0,0,0,.25); }
}
/* Spicy hero: dried-chilli photo, darkened for legible white text, fading into the page. */
.hero {
  position: relative; min-height: 210px; display: flex; align-items: flex-start; color: #fff; isolation: isolate;
  background:
    linear-gradient(180deg, rgba(20,8,4,.42) 0%, rgba(20,8,4,.30) 45%, rgba(20,8,4,.70) 80%, var(--surface-base) 100%),
    linear-gradient(120deg, rgba(217,78,40,.28), transparent 65%),
    url('../images/spicy-bg.webp') center 35% / cover no-repeat;
  background-color: #2a0f08;
}
/* Centred header: logo on top, name beneath, address under that; call/theme buttons tucked in the corner. */
.hero { min-height: 250px; }
.hero .diner-top { width: 100%; padding: calc(26px + env(safe-area-inset-top)) 56px 44px; justify-content: center; }
.hero .venue-wrap { flex-direction: column; align-items: center; gap: 12px; text-align: center; width: 100%; }
.hero .venue { font-size: 30px; line-height: 1.1; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero .venue small { display: block; color: rgba(255,255,255,.88); margin: 6px auto 0; font-size: 13px; text-shadow: 0 1px 6px rgba(0,0,0,.65); white-space: normal; }
.hero .logo { --logo-h: 68px; --logo-max: 200px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.hero-actions { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; display: flex; gap: 8px; z-index: 2; }
.hero .icon-btn { background: rgba(20,8,4,.45); border-color: rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(6px); text-decoration: none; }
.hero .icon-btn:hover { background: rgba(217,78,40,.8); }
/* On wider screens the same photo, heavily darkened, sits behind the phone column. */
body.diner-body {
  background: linear-gradient(rgba(14,7,4,.84), rgba(14,7,4,.92)), url('../images/spicy-bg.webp') center / cover fixed;
  background-color: #140a06;
}
.diner-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface-base) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.diner-top { display:flex; align-items:center; justify-content:space-between; padding: 14px 16px 6px; }
.venue { font-family: var(--font-serif); font-size: 24px; font-weight: 700; }
.venue small { display:block; font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.search { padding: 6px 16px; position: relative; }
.search .icon { position:absolute; left: 30px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search input { padding-left: 42px; border-radius: var(--radius-pill); }
.pills { display:flex; gap: 8px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; min-height: var(--touch); padding: 0 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-card); font-weight: 700; font-size: 14px;
}
.pill.on { background: var(--text-strong); color: var(--surface-base); border-color: transparent; }
.pill.diet.on { background: var(--color-primary); color: #fff; }
.menu-list { padding: 8px 16px 140px; display: grid; gap: 14px; }
.sec-title { font-family: var(--font-serif); font-size: 22px; margin: 14px 0 0; }
.empty { text-align:center; color: var(--text-muted); padding: 50px 0; }

/* order bar */
.order-bar-wrap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 25; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); pointer-events: none; }
.order-bar {
  pointer-events: auto; width: 100%; min-height: 56px; border: 0; border-radius: var(--radius-pill);
  background: var(--color-primary); color: #fff; display:flex; align-items:center; justify-content:space-between;
  padding: 0 22px; font-weight: 800; box-shadow: 0 10px 30px rgba(217,78,40,.45);
}
.order-bar .count { background: rgba(255,255,255,.22); border-radius: var(--radius-pill); padding: 2px 11px; margin-right: 10px; }

/* sheets */
.scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.5); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92%; display: flex; flex-direction: column;
  background: var(--surface-base); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-sheet);
}
.sheet.fixed { position: fixed; }
.sheet-grab { width: 44px; height: 5px; background: var(--border); border-radius: 3px; margin: 10px auto 0; }
.sheet-scroll { overflow-y: auto; padding: 8px 18px 18px; }
.sheet-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display:flex; gap: 12px; align-items:center; background: var(--surface-card); }
.sheet-img { aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; margin: 10px 0 14px; background: var(--surface-sunken); }
.sheet-img img { width:100%; height:100%; object-fit: cover; }
.group { margin: 16px 0; }
.group h4 { font-size: 14px; font-weight: 800; display:flex; justify-content: space-between; align-items:center; }
.req { font-size: 11px; color: var(--color-primary); font-weight: 800; text-transform: uppercase; }
.sheet-foot .btn-primary { white-space: nowrap; padding: 0 14px; }
.opt {
  display:flex; align-items:center; gap: 12px; min-height: var(--touch); padding: 6px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.opt input { width: 22px; height: 22px; accent-color: var(--color-primary); flex: none; }
.opt span:first-of-type { flex: 1; }
.stepper { display:inline-flex; align-items:center; gap: 4px; background: var(--surface-sunken); border-radius: var(--radius-pill); }
.stepper button { width: var(--touch); height: var(--touch); border: 0; background: transparent; font-size: 20px; font-weight: 700; border-radius: 50%; }
.stepper b { min-width: 22px; text-align:center; }
.cart-line { padding: 14px 0; border-bottom: 1px solid var(--border); display:grid; gap: 6px; }
.cart-line .row { display:flex; justify-content: space-between; gap: 12px; align-items:center; }
.muted { color: var(--text-muted); font-size: 13px; }
.sent { text-align:center; padding: 30px 10px; display:grid; gap: 10px; justify-items:center; }
.sent .check { width: 72px; height: 72px; border-radius: 50%; background: var(--status-available); color: #fff; display:grid; place-items:center; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--text-strong); color: var(--surface-base);
  padding: 12px 20px; border-radius: var(--radius-pill); font-weight: 700; box-shadow: var(--shadow-sheet); max-width: 90vw;
}

/* ---------- Admin ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.split { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } .sticky { position: sticky; top: 76px; } }
.panel { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.panel h2 { font-family: var(--font-serif); font-size: 22px; margin-bottom: 14px; }
.row2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display:flex; flex-wrap: wrap; gap: 8px; }
.chip { display:inline-flex; align-items:center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-base); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.chip input { accent-color: var(--color-primary); }
.thumbs { display:flex; gap: 8px; overflow-x: auto; }
.thumbs button { flex: none; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-sunken); }
.thumbs button.on { border-color: var(--color-primary); }
.thumbs img { width:100%; height:100%; object-fit: cover; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl th { text-align:left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 10px; }
.tbl td { padding: 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl .th-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-sunken); }
.tri { display:inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.tri button { border: 0; background: transparent; padding: 0 12px; min-height: 36px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.tri button.on[data-v="available"] { background: var(--status-available); color: #fff; }
.tri button.on[data-v="low"] { background: var(--status-low); color: #111; }
.tri button.on[data-v="soldout"] { background: var(--status-soldout); color: #fff; }
.mini { border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 14px; margin-top: 10px; }
.err { color: var(--status-soldout); font-size: 13px; margin: 4px 0; }

/* ---------- Responsive toolbar ---------- */
@media (max-width: 640px) {
  .toolbar { gap: 6px; padding: 8px 12px; }
  .toolbar .brand { font-size: 15px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .toolbar .icon-btn { width: 42px; height: 42px; flex: none; }
  .toolbar .btn { padding: 0 11px !important; min-height: 42px !important; flex: none; }
  .hide-sm { display: none; }
}

/* ---------- Admin shell: top tabs on desktop, thumb-reach bottom bar on phones ---------- */
.anav { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.anav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-card); font-weight: 700; font-size: 14px; color: var(--text-muted); text-decoration: none;
}
.anav a.on { background: var(--text-strong); color: var(--surface-base); border-color: transparent; }
@media (max-width: 759px) {
  .page { padding-bottom: 96px; }
  .anav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0; gap: 0; flex-wrap: nowrap;
    background: var(--surface-card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .anav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; border: 0; border-radius: 0; background: none; font-size: 11px; min-height: 58px; padding: 0 4px; }
  .anav a.on { background: none; color: var(--color-primary); }
  .toast { bottom: 80px; }
}
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-family: var(--font-serif); font-size: 28px; }
.toolrow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolrow .input { flex: 1; min-width: 160px; }

.alist { display: grid; gap: 10px; }
.arow {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 8px 14px; align-items: center; padding: 12px;
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.arow .th-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-sunken); }
.arow .meta { min-width: 0; }
.arow .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 759px) {
  .arow { grid-template-columns: 56px 1fr; }
  .arow .ctrl { grid-column: 1 / -1; justify-content: space-between; }
}
.price-edit { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-base); padding-left: 12px; }
.price-edit input { width: 100px; border: 0; background: transparent; min-height: 40px; font-weight: 700; padding: 0 12px 0 4px; font-variant-numeric: tabular-nums; }
.price-edit input:focus { outline: none; }
.price-edit:focus-within { border-color: var(--color-primary); }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; font-weight: 600; }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--border); border-radius: 13px; position: relative; transition: background .15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--color-primary); }
.switch input:checked::after { transform: translateX(20px); }
.ticket { padding: 14px 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }

/* ---------- Customer notice modal ---------- */
.notice-scrim { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.6); }
.notice-card {
  width: 100%; max-width: 360px; max-height: 100%; background: var(--surface-card); border-radius: var(--radius-lg); padding: 24px 20px 18px;
  box-shadow: var(--shadow-sheet); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; align-items: center; min-height: 0;
}
.notice-venue { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--color-primary); text-align: center; margin-top: -2px; }
.notice-card h3 { font-family: var(--font-serif); font-size: 24px; line-height: 1.15; text-align: center; }
.notice-card .btn { width: 100%; flex: none; margin-top: 4px; }
/* Long rules scroll inside the card; the button stays visible. */
.notice-body { overflow-y: auto; width: 100%; min-height: 0; color: var(--text-muted); text-align: left; overscroll-behavior: contain; }
.notice-body > :first-child { margin-top: 0; } .notice-body > :last-child { margin-bottom: 0; }
.notice-body p { margin: 0 0 .75em; }
.notice-body h3, .notice-body h4 { font-family: var(--font-serif); color: var(--text-strong); margin: 1em 0 .4em; font-size: 17px; text-align: left; }
.notice-body ul, .notice-body ol { margin: 0 0 .75em; padding-left: 2em; }
.notice-body li { margin-bottom: .35em; }
.notice-body strong, .notice-body b { color: var(--text-strong); }
.notice-body blockquote { margin: 0 0 .75em; padding: 2px 0 2px 12px; border-left: 3px solid var(--color-primary); }
.notice-body a { color: var(--color-primary); text-decoration: underline; }

/* Rich-text editor (Quill) themed to the design tokens */
.rte .ql-toolbar.ql-snow { border: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--surface-sunken); position: sticky; top: 60px; z-index: 5; }
.rte .ql-container.ql-snow { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--surface-card); font-family: var(--font-sans); font-size: 15px; }
.rte .ql-editor { min-height: 240px; color: var(--text-strong); line-height: 1.5; }
.rte .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
.rte .ql-snow .ql-stroke { stroke: var(--text-strong); } .rte .ql-snow .ql-fill { fill: var(--text-strong); }
.rte .ql-snow .ql-picker { color: var(--text-strong); }
.rte .ql-snow .ql-picker-options { background: var(--surface-card); border-color: var(--border); }
.rte .ql-toolbar button, .rte .ql-toolbar .ql-picker-label { min-width: 36px; height: 36px; }
.rte .ql-toolbar .ql-picker { height: 36px; }
.rte .ql-snow .ql-tooltip { background: var(--surface-card); color: var(--text-strong); border-color: var(--border); z-index: 10; }
.rte .ql-snow .ql-tooltip input { background: var(--surface-base); color: var(--text-strong); border-color: var(--border); }
.rte .ql-editor a { color: var(--color-primary); }
.notice-mark { width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--color-primary) 16%, transparent); color: var(--color-primary); display: grid; place-items: center; }

/* ---------- Error pages ---------- */
.err-page { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; padding: 32px 24px; max-width: 460px; margin: 0 auto; }
.err-brand { font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--text-muted); }
.err-code { font-family: var(--font-serif); font-weight: 700; font-size: clamp(88px, 28vw, 150px); line-height: 1; color: var(--color-primary); }
.err-page h1 { font-family: var(--font-serif); font-size: 28px; line-height: 1.15; }
.err-page p { margin: 0; color: var(--text-muted); }
.err-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.err-actions .btn { text-decoration: none; }

/* ---------- Design system docs ---------- */
.swatches { display:grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-card); text-align:left; padding: 0; }
.swatch i { display:block; height: 64px; }
.swatch div { padding: 10px 12px; font-size: 12px; }
.swatch code, code.inline { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.matrix { display:grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.matrix > div { display: grid; gap: 8px; align-content: start; }
pre.code { background: #0f1115; color: #e6e6e6; padding: 16px; border-radius: var(--radius-md); overflow-x: auto; font: 12.5px/1.6 ui-monospace, Consolas, monospace; }
.k { color: #ff8b6b; } .s { color: #a5e075; } .c { color: #7d8590; } .t { color: #79c0ff; }
.tabs { margin-bottom: 14px; }
.type-sample { display:grid; gap: 6px; }
.doc-h { font-family: var(--font-serif); font-size: 26px; margin: 34px 0 14px; }
