/* OnlyPhila guest menu — the same tokens as the app (onlyphila-mobile/src/theme/
   tokens.ts) and the console (onlyphila-admin/src/theme.css): near-black, warm
   off-white, one signature red. Nothing here is a second design language; if a
   colour changes there it changes here. */
:root {
  --black-0: #000000;
  --black-1: #0b0b0c;
  --black-2: #131315;
  --black-3: #1c1c1f;
  --black-4: #29292d;
  --black-5: #3a3a40;
  --white-0: #ffffff;
  --white-1: #f5f3f0;
  --white-2: #cfccc6;
  --white-3: #8f8c88;
  --red-1: #ed2027;
  /* Red for TEXT on near-black: the brand red reads at ~4:1 and is too dark for
     small type, this tint sits at ~7:1. Same value and same reason as the
     console's --red-3. */
  --red-3: #ff6b6f;
  --red-wash: rgba(237, 32, 39, 0.12);
  --open: #3fc26b;
  --amber: #e0a43b;
  --font-display: "Shippori Mincho", Georgia, serif;
  --font-body: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;
  --radius: 14px;
  --pill: 999px;
  --page: 1160px;
  /* The photo sits in a pool of light rather than on a flat grey square. Same
     geometry as the app's plate glow (chrome.tsx) and the console's preview:
     50%/35%, 75% radius, black-3 → black-1 at 80%. */
  --plate: radial-gradient(ellipse 75% 75% at 50% 35%, var(--black-3), var(--black-1) 80%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--black-1);
  color: var(--white-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body.locked { overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--red-1); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ── Header ────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 11, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--black-4);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-inner {
  max-width: var(--page); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 10px;
}
.brand { display: flex; align-items: center; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 21px;
  letter-spacing: var(--tracking-wide);
}
.top-right { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--pill); padding: 4px 11px;
  border: 1px solid var(--black-4); background: var(--black-2); color: var(--white-2);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.is-open { color: var(--open); border-color: rgba(63, 194, 107, 0.35); }
.pill.is-paused { color: var(--amber); border-color: rgba(224, 164, 59, 0.35); }
.pill.is-closed { color: var(--white-3); }

.lang select {
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--white-1); background: var(--black-3);
  border: 1px solid var(--black-4); border-radius: var(--pill);
  padding: 6px 10px; cursor: pointer; appearance: none; text-align: center;
}
.lang select:focus-visible { outline: 2px solid var(--red-1); outline-offset: 2px; }

/* Category chips. They scroll sideways on a phone, so the row must not stretch
   the page: `min-width: 0` on the flex parent is what stops it. */
.cats {
  max-width: var(--page); margin: 0 auto; min-width: 0;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 0 16px 10px;
}
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex-shrink: 0; text-decoration: none; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; color: var(--white-2);
  border: 1px solid var(--black-4); border-radius: var(--pill); padding: 7px 14px;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.cats a:hover { color: var(--white-1); border-color: var(--black-5); }
.cats a.on { color: var(--red-3); border-color: var(--red-1); background: var(--red-wash); }

/* ── Sections ──────────────────────────────────────────────────── */
main { max-width: var(--page); margin: 0 auto; padding: 8px 16px 40px; }
.state { color: var(--white-3); text-align: center; padding: 60px 0; }
.state.err { color: var(--red-3); }

/* The header measures itself into --head-h (menu.js); the fallback is only for
   the first paint. A fixed number here meant the section title parked under the
   header on any phone whose header was taller than the desktop's. */
.section { padding-top: 26px; scroll-margin-top: calc(var(--head-h, 118px) + 8px); }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0;
  letter-spacing: var(--tracking-wide);
}
.section-head .count { font-size: 12px; color: var(--white-3); }
.section-head .rule { flex: 1; height: 1px; background: var(--black-4); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  display: flex; flex-direction: column; text-align: left;
  background: var(--black-2); border: 1px solid var(--black-4); border-radius: var(--radius);
  overflow: hidden; padding: 0; color: inherit; font: inherit; cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}
.card:hover { border-color: var(--black-5); }
.card:active { transform: scale(0.995); }
.card:focus-visible { outline: 2px solid var(--red-1); outline-offset: 2px; }

.shot { position: relative; aspect-ratio: 4 / 3; background: var(--plate); overflow: hidden; }
.shot .row { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.shot img {
  width: 78%; height: 78%; object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.6));
}
/* Two finishes of one dish share a card, side by side: each photo gets its own
   half, so neither is shrunk to the width of a single centred one. */
.shot .row.multi img { width: 100%; height: 92%; }
.shot .row.multi > span { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.card.off .shot { opacity: 0.35; }

.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 20px); }
.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide);
  border-radius: var(--pill); padding: 3px 8px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--black-5); color: var(--white-2);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.off-tag {
  position: absolute; left: 10px; bottom: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wide);
  background: rgba(0, 0, 0, 0.65); border: 1px solid var(--black-5); color: var(--white-2);
  border-radius: var(--pill); padding: 4px 10px;
}

.body > .meta-row:first-child { margin: 0 0 6px; }
.body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.title { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.price { font-size: 15px; font-weight: 700; white-space: nowrap; }
.price .from { font-size: 11px; font-weight: 500; color: var(--white-3); margin-right: 3px; }
.sub { font-size: 12.5px; color: var(--white-3); }
.ing { font-size: 12.5px; color: var(--white-2); margin-top: 2px; }
.ing .some { color: var(--white-3); }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.code {
  font-size: 10.5px; font-weight: 700; letter-spacing: var(--tracking-wide);
  color: var(--white-2); background: var(--black-3); border: 1px solid var(--black-4);
  border-radius: 5px; padding: 2px 6px;
}
.code.age { color: var(--amber); border-color: rgba(224, 164, 59, 0.35); }
.finishes { font-size: 12px; color: var(--red-3); }

/* ── Dish sheet ────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--black-2); border: 1px solid var(--black-4);
  border-radius: var(--radius) var(--radius) 0 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: var(--radius); max-height: 88vh; padding-bottom: 24px; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }
.sheet-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--black-4);
  background: rgba(0, 0, 0, 0.55); color: var(--white-2); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.sheet-body .shot { aspect-ratio: 16 / 11; border-radius: var(--radius) var(--radius) 0 0; }
@media (min-width: 640px) { .sheet-body .shot { border-radius: var(--radius) var(--radius) 0 0; } }
.sheet-text { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.sheet-text h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; }
.sheet-text .desc { color: var(--white-2); font-size: 14px; }
.block-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-wider); color: var(--white-3); margin-bottom: 7px;
}
.switch { display: flex; flex-wrap: wrap; gap: 8px; }
.switch button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--white-2); background: transparent;
  border: 1px solid var(--black-4); border-radius: var(--pill); padding: 7px 14px;
}
.switch button.on { color: var(--red-3); border-color: var(--red-1); background: var(--red-wash); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--white-2);
  background: var(--black-3); border: 1px solid var(--black-4);
  border-radius: var(--pill); padding: 5px 11px 5px 6px;
}
.chip.plain { padding-left: 11px; }
.chip img { width: 20px; height: 20px; object-fit: contain; border-radius: 50%; }
.notice {
  font-size: 13px; color: var(--amber); background: rgba(224, 164, 59, 0.1);
  border: 1px solid rgba(224, 164, 59, 0.3); border-radius: 10px; padding: 9px 12px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.foot {
  max-width: var(--page); margin: 0 auto;
  padding: 26px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
  border-top: 1px solid var(--black-4);
  display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.foot-block h4 {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-wider); color: var(--white-3); margin: 0 0 10px;
}
.hours-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; }
.hours-row.today { color: var(--white-1); font-weight: 700; }
.hours-row:not(.today) { color: var(--white-2); }
.hours-row .shut { color: var(--white-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.foot a { color: var(--white-1); }
.foot p { margin: 0 0 6px; font-size: 13px; color: var(--white-2); }
.foot-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--white-3); margin: 0; }

/* ── Print: the same menu on paper, without the furniture ──────── */
@media print {
  :root { --plate: none; }
  body { background: #fff; color: #000; }
  .top, .cats, .foot-note, .skip, .sheet { display: none !important; }
  main { max-width: none; padding: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card { break-inside: avoid; border-color: #ccc; background: #fff; }
  .shot { display: none; }
  .title, .price, .section-head h2 { color: #000; }
  .sub, .ing, .code { color: #444; }
}
