/* TableLoop design system: "Tandoor" theme
   Warm, appetising, made for food: paprika-orange brand, turmeric accent, coriander-leaf green,
   warm charcoal text on rice-paper white. Fraunces (menu-card headings) + Plus Jakarta Sans (UI). */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light dark;
  --brand: light-dark(#e85d2a, #ff7a45);        /* paprika: main buttons, active states */
  --brand-strong: light-dark(#c2441a, #ff9466);
  --brand-ink: light-dark(#b23a12, #ffab85);    /* brand-coloured text, readable */
  --brand-soft: light-dark(#fde9df, #3a2219);
  --on-brand: #fff;
  --turmeric: #f4b400;                          /* stars, highlights, badges */
  --turmeric-soft: light-dark(#fff4cc, #3a2f0e);
  --leaf: light-dark(#2e9e5b, #52c47f);         /* veg, success, switches */
  --leaf-soft: light-dark(#e3f5ea, #15301f);
  --danger: light-dark(#c62828, #ff6b6b);
  --danger-soft: light-dark(#fde4e4, #3a1717);
  --nonveg: #b3261e;
  --ink: light-dark(#2a1f1a, #f6ede6);
  --muted: light-dark(#7a6a60, #bfaea2);
  --bg: light-dark(#fff9f3, #17110e);
  --card: light-dark(#ffffff, #221a16);
  --soft: light-dark(#fbefe4, #2d231e);
  --line: light-dark(#f0e2d4, #3a2e27);
  --shadow: 0 1px 2px #2a1f1a14, 0 8px 24px -12px #2a1f1a33;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --tap: 46px;
  --f-head: Fraunces, Georgia, serif;
  --f-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--f-ui); overflow-x: clip; }
h1, h2, h3, .serif { font-family: var(--f-head); letter-spacing: -.01em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
a { color: var(--brand-ink); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border: 0; border-radius: var(--r); background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.quiet { background: var(--soft); color: var(--ink); }
.btn.quiet:hover { background: var(--line); }
.btn.ghost { background: none; color: var(--brand-ink); border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.leaf { background: var(--leaf); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--soft); display: inline-grid; place-items: center; }

/* Forms */
label.f { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.in { width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16px; }
.in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.in { min-height: 90px; resize: vertical; }
select.in { appearance: auto; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; margin-top: 1px; }
.prefix { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.prefix span { padding: 0 12px; display: grid; place-items: center; background: var(--soft); color: var(--muted); font-weight: 700; }
.prefix .in { border: 0; border-radius: 0; }
.prefix:focus-within { border-color: var(--brand); }

/* Switch */
.switch { position: relative; width: 48px; height: 28px; border: 0; border-radius: 999px; background: var(--line); flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px #0003; }
.switch[aria-checked="true"] { background: var(--leaf); }
.switch[aria-checked="true"]::after { left: 23px; }

/* Cards, chips, badges */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.pad-lg { padding: 24px; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--ink); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.turmeric { background: var(--turmeric-soft); color: light-dark(#7a5a00, #ffd75e); }
.badge.leaf { background: var(--leaf-soft); color: var(--leaf); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* Indian veg / non-veg marks */
.diet { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 2px solid var(--leaf); border-radius: 3px; flex: none; }
.diet::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); }
.diet.nonveg, .diet.egg { border-color: var(--nonveg); }
.diet.nonveg::after { background: var(--nonveg); border-radius: 0; width: 8px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.diet.egg::after { background: #e0a800; }

/* Stars */
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { width: 48px; height: 48px; border: 0; background: none; padding: 2px; }
.stars svg { width: 44px; height: 44px; fill: var(--line); transition: fill .1s, transform .1s; }
.stars button.on svg { fill: var(--turmeric); }
.stars button:active svg { transform: scale(.9); }

/* Sheets (bottom on phones, centered on desktop) */
.scrim { position: fixed; inset: 0; background: #1b120d99; z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 14px; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 24px; } .sheet .grab { display: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 80; box-shadow: var(--shadow); max-width: calc(100vw - 32px); animation: up .2s; }
.toast.bad { background: var(--danger); color: #fff; }

/* Tables */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.n, table.t th.n { text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 3px 0 3px 7.5em; position: relative; text-align: left !important; }
  table.stack td::before { content: attr(data-l); position: absolute; left: 0; width: 7em; color: var(--muted); font-size: 12.5px; }
  table.stack td:empty { display: none; }
}

/* Skeleton + empty state */
.skel { background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
