/* Palmyra Takeaway brand (BRAND-UI-001). Fonts are self-hosted under /assets/brand
   (SIL Open Font License, licence texts alongside); no third-party requests. */
@font-face {
  font-family: "Baloo Bhaijaan 2";
  src: url("/assets/brand/BalooBhaijaan2-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Baloo Bhaijaan 2";
  src: url("/assets/brand/BalooBhaijaan2-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("/assets/brand/Lalezar-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Brand palette (FRONTEND-SPEC). */
  --tomato: #e8452c;
  --pistachio: #a5cf4c;
  --blush: #ffd9c9;
  --coffee: #2a1712;
  --white: #ffffff;
  /* Light theme. Body text is coffee on white or blush; tomato only for large
     text, buttons and accents; --link is the text-safe tomato for small text. */
  --bg: #ffffff;
  --ink: #2a1712;
  --muted: #6e4a3e;
  --card: #ffffff;
  --surface: #ffd9c9;
  --neutral-bg: #f7ece6;
  --line: #f1c9b8;
  --input-line: #a07a6c;
  --primary: #e8452c;
  --primary-hover: #c93a22;
  --on-primary: #ffffff;
  --heading: #e8452c;
  --link: #b8331c;
  --accent: #a5cf4c;
  --on-accent: #2a1712;
  --ok-bg: #e6f3cc;
  --ok-ink: #2a1712;
  --warn-bg: #ffd9c9;
  --warn-ink: #2a1712;
  --info-bg: #e4ecf3;
  --info-ink: #1f3f5c;
  --danger: #b8331c;
  --on-danger: #ffffff;
  --danger-text: #a12d19;
  --banner-bg: #ffd9c9;
  --banner-ink: #2a1712;
  --hero-bg: #2a1712;
  --hero-ink: #ffffff;
  --focus: #e8452c;
  --shadow: #2a171214;
  /* Older names still read by some page styles. */
  --green: var(--link);
  --dark: var(--ink);
  --paper: var(--bg);
  --spice: var(--surface);
  --rust: var(--danger-text);
  font-family: "Baloo Bhaijaan 2", system-ui, "Geeza Pro", Tahoma, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
}

/* Dark theme on screens only; printed sheets stay light. It follows the
   device unless the person picked a theme with the top-bar toggle
   (UX-STAFF-004: <html data-theme="light|dark">, staff pages). */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #2a1712;
    --ink: #ffffff;
    --muted: #f2cfc0;
    --card: #3a231c;
    --surface: #4a2c23;
    --neutral-bg: #4a2c23;
    --line: #5c3a2f;
    --input-line: #a98275;
    --primary: #e8452c;
    --primary-hover: #c93a22;
    --on-primary: #ffffff;
    --heading: #e8452c;
    --link: #ff8a6e;
    --accent: #a5cf4c;
    --on-accent: #2a1712;
    --ok-bg: #34451a;
    --ok-ink: #dff0b8;
    --warn-bg: #5a2a1e;
    --warn-ink: #ffd9c9;
    --info-bg: #20364a;
    --info-ink: #dbe8f5;
    --danger: #b8331c;
    --on-danger: #ffffff;
    --danger-text: #ff9b85;
    --banner-bg: #4a2c23;
    --banner-ink: #ffd9c9;
    --hero-bg: #3a231c;
    --hero-ink: #ffffff;
    --focus: #e8452c;
    --shadow: #00000040;
  }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #2a1712;
    --ink: #ffffff;
    --muted: #f2cfc0;
    --card: #3a231c;
    --surface: #4a2c23;
    --neutral-bg: #4a2c23;
    --line: #5c3a2f;
    --input-line: #a98275;
    --primary: #e8452c;
    --primary-hover: #c93a22;
    --on-primary: #ffffff;
    --heading: #e8452c;
    --link: #ff8a6e;
    --accent: #a5cf4c;
    --on-accent: #2a1712;
    --ok-bg: #34451a;
    --ok-ink: #dff0b8;
    --warn-bg: #5a2a1e;
    --warn-ink: #ffd9c9;
    --info-bg: #20364a;
    --info-ink: #dbe8f5;
    --danger: #b8331c;
    --on-danger: #ffffff;
    --danger-text: #ff9b85;
    --banner-bg: #4a2c23;
    --banner-ink: #ffd9c9;
    --hero-bg: #3a231c;
    --hero-ink: #ffffff;
    --focus: #e8452c;
    --shadow: #00000040;
  }
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3, strong, legend { font-weight: 800; }
h1 { color: var(--heading); line-height: 1.2; }
h1:focus { outline: none; }
a { color: var(--link); }
bdi { unicode-bidi: isolate; }

/* Lalezar: Arabic headlines, prices and dish names only (never paragraphs). */
:lang(ar) h1, :lang(ar) h2, :lang(ar) .price, :lang(ar) .dish h3, :lang(ar) .section-title {
  font-family: "Lalezar", "Baloo Bhaijaan 2", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.wrap { width: min(100% - 32px, 940px); margin-inline: auto; }
.test-banner {
  color: var(--banner-ink);
  background: var(--banner-bg);
  text-align: center;
  padding: 4px 10px;
  font-size: .8rem;
  font-weight: 800;
}
.topbar, .brand, .top-actions, .row, .step-nav { display: flex; align-items: center; }
.topbar { justify-content: space-between; min-height: 72px; gap: 10px; }
.brand { gap: 9px; font-size: 1.45rem; font-weight: 800; white-space: nowrap; flex: 0 0 auto; }
.brand picture { display: block; line-height: 0; }
.brand-logo { display: block; height: 48px; width: auto; max-width: 100%; }
.brand-mark-img { display: block; width: 28px; height: 28px; flex: 0 0 auto; }
.staff-home { gap: 8px; white-space: nowrap; }
.top-actions { gap: 6px; }
.nav-button, .lang-button, .back {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  padding: 9px 10px;
  border-radius: 12px;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}
a.nav-button { display: inline-flex; align-items: center; }
.nav-button[aria-current] { background: var(--surface); }
.lang-button { border-color: var(--line); background: var(--card); white-space: nowrap; }
.back { align-self: flex-start; padding-inline: 0; }
.nav-button:hover, .lang-button:hover, .back:hover { color: var(--link); }

/* Staff panel navigation (PANEL-NAV-001, reworked by UX-STAFF-002).
   Every link looks like something to press: a border, a fill, a chevron in the
   reading direction, clear hover and focus states. The overview shows four
   numbers for today, then the other pages as compact buttons in small groups;
   nothing stretches edge to edge. */
.staff-paths {
  display: grid;
  gap: 14px;
  margin-block: 6px 10px;
}
.staff-paths a {
  flex: 0 1 auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--input-line);
  border-radius: 12px;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.staff-paths a > span { display: grid; gap: 0; min-width: 0; }
.staff-paths strong { font-size: .95rem; line-height: 1.3; }
.staff-paths small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.staff-paths a::after {
  content: "›";
  content: "›" / "";
  flex: 0 0 auto;
  color: var(--link);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}
[dir="rtl"] .staff-paths a::after {
  content: "‹";
  content: "‹" / "";
}
.staff-paths a:hover {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--ink);
}
.staff-paths a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.staff-paths .staff-path-start { justify-self: start; border: 2px solid var(--primary); background: var(--surface); }
/* Today in six numbers: soft tiles that open their section. */
.path-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.staff-paths a.staff-stat {
  display: grid;
  align-content: center;
  gap: 0;
  min-height: 72px;
  padding: 10px 14px;
  border-color: transparent;
  background: var(--neutral-bg);
  border-radius: 14px;
}
.staff-paths a.staff-stat::after { content: none; }
.staff-paths a.staff-stat strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.staff-paths a.staff-stat small { font-size: .85rem; font-weight: 800; }
.staff-paths a.staff-stat:hover { border-color: var(--primary); background: var(--surface); }
/* The other pages: a quiet label, then buttons that size to their text. */
.path-group { display: grid; gap: 6px; }
.path-label { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .02em; }
.path-links { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 480px) {
  .path-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-paths a { padding-inline: 12px; }
}
.staff-panel a.nav-button:not(.primary) {
  border-color: var(--input-line);
  background: var(--card);
  color: var(--ink);
  padding-inline: 14px;
}
.staff-panel a.nav-button:not(.primary):hover { border-color: var(--primary); background: var(--surface); }
.staff-panel h2[tabindex]:focus { outline: 3px solid var(--focus); outline-offset: 3px; }

main { padding-block-end: 24px; }
.hero {
  min-height: 262px;
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  border-radius: 24px;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
}
.hero-copy {
  padding: 32px;
  align-content: center;
  display: grid;
  gap: 9px;
  position: relative;
  z-index: 1;
}
.hero h1 { max-width: 15ch; font-size: clamp(2.15rem, 6.2vw, 3.95rem); line-height: 1.15; color: var(--tomato); }
.hero-copy p { color: var(--hero-ink); font-size: 1rem; line-height: 1.65; max-width: 32ch; }
.hero-photo { position: relative; min-width: 0; overflow: hidden; }
.hero-photo img { display: block; width: 100%; height: 100%; max-height: 310px; object-fit: cover; object-position: 50% 57%; }
.hero-photo figcaption {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 10px;
  padding: 4px 8px;
  font-size: .75rem;
  color: #ffffff;
  background: #2a1712e6;
  border-radius: 20px;
}

.section-head { margin-block: 23px 10px; display: flex; justify-content: space-between; gap: 12px; align-items: end; }
.section-head h2, .section-title { font-size: 1.45rem; }
.section-head p, .meta, .hint { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.dishes { display: grid; gap: 9px; }
.dish, .panel, .history-entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.dish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
  gap: 10px 14px;
  align-items: center;
}
.dish h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
.dish > .field { max-width: 11rem; }
.dish-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dish-main > div { min-width: 0; }
.dish-thumb { flex: none; width: 76px; height: 76px; border-radius: 14px; object-fit: cover; background: var(--neutral-bg); }
.dish-main .hint { margin-block-start: 2px; font-size: .8rem; }
.dish .meta { margin-block-start: 3px; }
.dish-actions { display: grid; justify-items: end; gap: 5px; }
.price { color: var(--link); font-size: 1.1rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; gap: 5px; min-width: max-content; }
.qty output { min-width: 1.4em; text-align: center; font-size: 1rem; font-weight: 800; }
.qty-btn, .secondary, .primary {
  border-radius: 12px;
  font-weight: 800;
  min-height: 44px;
}
.qty-btn {
  width: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
}
.qty-btn:disabled { opacity: .48; }
.primary, .secondary { padding: 9px 18px; border: 1px solid var(--primary); }
.primary { background: var(--primary); color: var(--on-primary); font-size: 1.1875rem; font-weight: 800; min-height: 48px; }
.nav-button.primary { color: var(--on-primary); background: var(--primary); border-color: var(--primary); font-size: 1.1875rem; justify-content: center; }
.primary:hover:not(:disabled), .nav-button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.primary:disabled { background: var(--neutral-bg); border-color: var(--neutral-bg); color: var(--muted); }
.secondary { background: transparent; color: var(--link); border-color: var(--link); font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 15px; }
.actions > button { flex: 1 1 140px; }
.sold { color: var(--danger-text); font-weight: 800; font-size: .88rem; }

.basket-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--bg);
  padding-block: 9px 13px;
  margin-block-start: 12px;
}
.basket-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 6px 24px var(--shadow);
}
.basket-inner > div { align-self: center; display: grid; gap: 1px; }
.basket-inner .primary { max-width: 65%; }
.scenarios {
  margin-block-start: 14px;
  border: 1px dashed var(--input-line);
  border-radius: 12px;
  padding: 10px 12px;
}
.scenarios summary { cursor: pointer; font-size: .9rem; font-weight: 800; }
.scenario-content { display: grid; gap: 6px; padding-block-start: 10px; }
.field-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--input-line);
}

.checkout { width: min(100%, 590px); margin-inline: auto; display: grid; gap: 12px; }
.step-nav { gap: 5px; align-items: stretch; list-style: none; padding: 0; margin: 0; }
.step-nav li { flex: 1; font-size: .8rem; text-align: center; border-block-end: 3px solid var(--line); padding: 8px 2px; color: var(--muted); }
.step-nav [aria-current] { color: var(--ink); border-color: var(--primary); font-weight: 800; }
.checkout h1 { font-size: clamp(1.8rem, 6vw, 2.75rem); }
.panel, .history-entry { padding: 15px; }
.field { display: grid; gap: 5px; margin-block-start: 13px; }
.field label, .scenarios label { font-size: .95rem; font-weight: 800; }
.field:first-child { margin-block-start: 0; }
.field-msg { color: var(--danger-text); font-size: .88rem; }
.field-input[aria-invalid="true"] { border-color: var(--danger-text); }
.notice {
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-inline-start: 4px solid var(--primary);
  font-size: .95rem;
  line-height: 1.55;
}
.test-note { padding: 11px 13px; border-radius: 10px; color: var(--ink); background: var(--neutral-bg); line-height: 1.6; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { margin-block-end: 9px; }
.slot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-block-end: 7px;
  cursor: pointer;
}
.slot:has(input:checked) { border-color: var(--accent); background: var(--ok-bg); color: var(--ok-ink); }
.slot input { accent-color: var(--primary); height: 17px; width: 17px; }
.row { gap: 12px; justify-content: space-between; }
.cart-lines { display: grid; gap: 8px; }
.total-row { border-top: 1px solid var(--line); padding-block-start: 13px; margin-block-start: 13px; }
.discounted-line { display: grid; gap: 2px; margin-block: 6px; }
.discounted-line s { color: var(--muted); }
.discount-row { color: var(--link); font-weight: 800; }
.row > span { min-width: 0; overflow-wrap: anywhere; }
.history { display: grid; gap: 9px; }
.history-entry { display: grid; gap: 8px; }
.status {
  width: fit-content;
  border-radius: 24px;
  padding: 5px 10px;
  font-size: .85rem;
  font-weight: 800;
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.status.pending { background: var(--warn-bg); color: var(--warn-ink); }
.empty { display: grid; gap: 7px; padding: 20px 15px; }

/* Booking, receipt, cancellation and feedback pages (formerly inline in each page). */
.booking-section { margin-block-start: 12px; }
.booking-qty { width: 4.6rem; text-align: center; }
.booking-lines p { margin-block: 8px; }
.booking-choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.booking-choice {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 52px;
  gap: 7px;
  padding: 9px;
  overflow-wrap: anywhere;
  cursor: pointer;
  background: var(--card);
}
.booking-choice:has(input:checked) { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.booking-choice:has(input:checked) small { color: var(--ok-ink); }
.booking-choice:has(input:disabled) { background: var(--neutral-bg); color: var(--muted); cursor: default; }
.booking-choice:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.booking-choice small { display: block; color: var(--muted); font-size: .8rem; }
.booking-choice input { accent-color: var(--primary); }
.booking-reference { font-family: ui-monospace, monospace; font-weight: 800; direction: ltr; }
.status.payment_paid { background: var(--ok-bg); color: var(--ok-ink); }
.status.sold-out { background: var(--neutral-bg); color: var(--danger-text); }
.dish-sold-out { opacity: .85; }
.status.payment_declined, .status.payment_expired { background: var(--warn-bg); color: var(--warn-ink); }
.status.booking_cancelled { background: var(--neutral-bg); color: var(--ink); }
.cancel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cancel-actions .nav-button, .cancel-link { min-height: 44px; }
.cancel-actions .cancel-confirm { color: var(--on-danger); background: var(--danger); border-color: var(--danger); }
.no-refund { border-inline-start: 4px solid var(--danger-text); }
.no-refund h2 { margin: 0 0 4px; font-size: 1rem; color: var(--danger-text); }
.no-refund p { margin: 0; }
.reorder-dates { display: grid; gap: 8px; }
.reorder-dates form { margin: 0; }
.reorder-dates button { width: 100%; min-height: 44px; text-align: start; border-color: var(--line); background: var(--card); color: var(--ink); }
.reorder-dates [aria-current] { font-weight: 800; border-color: var(--primary); }
.telegram-code { width: 100%; resize: none; overflow-wrap: anywhere; word-break: break-all; }
.booking-reference-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.feedback-form fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; padding: 10px; min-width: 0; }
.feedback-form legend { padding-inline: 4px; }
.feedback-form textarea { width: 100%; min-height: 6rem; font: inherit; background: var(--card); border: 1px solid var(--input-line); border-radius: 10px; }
.feedback-dish { margin-block: 8px 4px; font-weight: 800; overflow-wrap: anywhere; }
.feedback-consent { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; }
.feedback-consent input { margin-block-start: 4px; accent-color: var(--primary); }
.feedback-prompt { border-inline-start: 4px solid var(--accent); }
.feedback-prompt .nav-button, .feedback-preference button { min-height: 44px; }

@media (max-width: 650px) {
  .topbar { min-height: 64px; }
  .topbar.has-signout { flex-wrap: wrap; row-gap: 4px; padding-block: 8px; }
  .topbar.has-signout .top-actions { flex-wrap: wrap; }
  .brand-logo { height: 42px; }
  .hero { min-height: 211px; grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .hero-copy, .hero-photo { grid-area: 1 / 1; }
  .hero-copy { align-content: end; padding: 17px 16px; padding-block-end: 24px; }
  .hero h1 { max-width: 13ch; font-size: clamp(1.95rem, 8vw, 3rem); color: var(--hero-ink); }
  .hero-copy p { max-width: 26ch; font-size: .9rem; line-height: 1.5; }
  .hero-photo img { position: absolute; inset: 0; max-height: none; object-position: 49% 56%; }
  .hero-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #2a171208 8%, #2a171230 28%, #2a1712eb 80%);
  }
  .hero-photo figcaption { inset-block: 9px auto; z-index: 1; }
}
@media (max-width: 380px) {
  .wrap { width: calc(100% - 24px); }
  .top-actions { gap: 2px; }
  .nav-button, .lang-button { padding-inline: 7px; font-size: .82rem; }
  .brand-logo { height: 38px; }
  .dish { padding-inline: 10px; }
  .qty { gap: 2px; }
}
@media (max-width: 340px) {
  .brand-logo { height: 36px; width: 36px; }
}

/* Unclassed form controls follow the theme too (staff forms, voucher codes). */
:where(input:not([type=radio], [type=checkbox], [type=hidden], [type=submit]), select, textarea) {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--input-line);
  border-radius: 10px;
  min-height: 44px;
  padding: 6px 10px;
  max-width: 100%;
}

/* Declutter (UX-DECLUTTER-001): one small set of shared pieces.
   - Content links and buttons with .nav-button are outlined buttons; .primary
     stays the one filled action per screen; .danger marks destructive ones.
   - <details> rows look like buttons with a chevron that turns when open.
   - details.help is a round «؟» button that reveals the hint text.
   Logical properties only, so Arabic RTL and English LTR mirror correctly. */
.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;
}

/* Top bar: menu and orders are pills with a soft fill, so they read as buttons. */
.top-actions .nav-button { background: var(--neutral-bg); padding-inline: 12px; }
.top-actions .nav-button:hover { background: var(--surface); color: var(--ink); }

/* Secondary buttons in the page body. */
main .nav-button, main .secondary {
  display: inline-block;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--input-line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
main .secondary { border-color: var(--link); color: var(--link); }
main .nav-button:hover, main .secondary:hover {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--ink);
}
main .nav-button:active, main .secondary:active, .primary:active:not(:disabled) { transform: translateY(1px); }
main p.nav-button[aria-current] { cursor: default; border-color: var(--accent); background: var(--ok-bg); color: var(--ok-ink); }
main .nav-button.primary { border-color: var(--primary); }
main .nav-button.danger, main button.danger {
  border-color: var(--danger-text);
  color: var(--danger-text);
  background: var(--card);
}
main .nav-button.danger:hover, main button.danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-danger);
}
/* A link on its own line keeps its natural width. */
main p > .nav-button:only-child { margin-block: 4px; }
.back { padding-inline: 12px; }

/* A list of destinations (office choice, menu-plan windows): full-width cards
   with a chevron in the reading direction. */
.checkout > .actions > a.nav-button {
  position: relative;
  display: block;
  flex: 0 1 320px;
  min-height: 56px;
  padding-block: 14px;
  padding-inline: 16px 40px;
  text-align: start;
}
.checkout > .actions > a.nav-button::after {
  content: "›" / "";
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--link);
  line-height: 1;
}
[dir="rtl"] .checkout > .actions > a.nav-button::after { content: "‹" / ""; }
.checkout > a.nav-button, .checkout > form > .nav-button { justify-self: start; }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block-start: 8px; }
.button-row form { margin: 0; display: contents; }
.button-row .danger { margin-inline-start: auto; }

/* Disclosure rows: the summary is the button. */
main details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 800;
  border-radius: 12px;
}
main details > summary::-webkit-details-marker { display: none; }
main details:not(.help) > summary::after {
  content: "";
  flex: 0 0 auto;
  margin-inline-start: auto;
  width: .55em;
  height: .55em;
  border-right: 2.5px solid var(--link);
  border-bottom: 2.5px solid var(--link);
  transform: translateY(-20%) rotate(45deg);
  transition: transform .15s ease;
}
main details[open]:not(.help) > summary::after { transform: translateY(20%) rotate(225deg); }
main details:not(.help) > summary:hover { color: var(--link); }
main details.panel { padding: 0; }
main details.panel > summary { padding: 10px 15px; }
main details.panel > summary:hover { background: var(--surface); color: var(--ink); }
main details.panel[open] > summary { border-block-end: 1px solid var(--line); border-end-start-radius: 0; border-end-end-radius: 0; }
main details.panel > :not(summary) { padding-inline: 15px; padding-block-end: 15px; }
main details.panel > .booking-section { margin-block-start: 12px; }
.disclose {
  border: 1.5px solid var(--input-line);
  border-radius: 14px;
  background: var(--card);
}
.disclose > summary { padding: 10px 15px; }
.disclose > summary:hover { background: var(--surface); }
.disclose[open] > summary { border-block-end: 1px solid var(--line); border-end-start-radius: 0; border-end-end-radius: 0; }
.disclose-body { display: grid; gap: 12px; padding: 12px 15px 15px; }
.disclose-body > .panel { border: 0; padding: 0; }
.disclose-body label { display: grid; gap: 5px; font-weight: 800; }

/* «؟» help toggle: a round button; the hint opens as a small card under it.
   The text stays in the page (folded), so nothing depends on hover. */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 4px 10px; }
.title-row > h1, .title-row > h2 { min-width: 0; }
.field-help { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 6px; }
details.help { position: relative; margin: 0; flex: 0 0 auto; }
details.help > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
}
.help-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--link);
  border-radius: 50%;
  color: var(--link);
  background: var(--card);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}
details.help > summary:hover .help-icon, details.help[open] .help-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.help-body {
  position: absolute;
  z-index: 5;
  inset-block-start: calc(100% + 2px);
  inset-inline-start: 0;
  width: max-content;
  max-width: min(340px, calc(100vw - 40px));
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px var(--shadow);
  font-weight: 500;
}
.title-row > details.help > .help-body, .field-help > details.help > .help-body {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
.help-body .hint, .help-body p { margin: 0; color: var(--ink); font-size: .92rem; line-height: 1.55; }

/* Finished booking steps, one line each. */
.booking-steps { display: grid; gap: 0; padding-block: 4px; margin-block-start: 12px; }
.step-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 8px;
}
.step-done + .step-done { border-block-start: 1px solid var(--line); }
.step-done-text { display: grid; gap: 0; min-width: 0; overflow-wrap: anywhere; }
.step-done-text small { color: var(--muted); font-size: .85rem; }
.step-done-mark { color: var(--ok-ink); background: var(--accent); border-radius: 50%; width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; font-size: .8rem; color: var(--on-accent); }
.step-done .nav-button { min-height: 40px; padding: 6px 14px; flex: 0 0 auto; }

/* Numbers that are not buttons: soft tiles without a border. */
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--neutral-bg);
  color: var(--ink);
}
.stat strong { font-size: 1.4rem; line-height: 1.2; }
.stat small { color: var(--muted); font-weight: 800; }
.filter-panel > summary small { color: var(--muted); font-weight: 500; font-size: .9rem; }
.filter-panel .panel { display: grid; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; margin-block: 10px; }
/* A disabled secondary button reads as unavailable, not as a live outline. */
main .secondary:disabled, main .nav-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  border-style: dashed;
  background: transparent;
}
/* «✓ saved» results use the success colours, not the warning ones. */
.notice.saved-notice {
  display: grid;
  gap: 8px;
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-inline-start-color: var(--accent);
  font-weight: 800;
}
.saved-notice .disclose { font-weight: 500; }

/* UX-STAFF-002: one calm frame for every staff page.
   - Every staff page uses the same content width.
   - Buttons in forms, cards and panels keep their own width (no edge-to-edge
     «Open» or «Save» bars); a phone gets full-width only where space is short.
   - UX-STAFF-003: a navigation bar of the panel's areas on every page. */
.staff-panel { display: grid; gap: 4px; padding-block-start: 4px; }
.staff-panel > .checkout, .staff-panel > section, .staff-nav, .staff-nav-menu {
  width: min(100%, 880px);
  margin-inline: auto;
  overflow-wrap: anywhere;
}
.staff-panel .checkout h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
.staff-who { color: var(--muted); font-size: .9rem; font-weight: 800; }
.staff-overview > .title-row { align-items: baseline; flex-wrap: wrap; }
/* Buttons keep their natural width inside grid containers. */
.staff-panel :is(.checkout, .panel, .history-entry, article, form, .booking-section, .disclose-body, .fold-body)
  > :is(a.nav-button, button, .primary, .secondary) {
  justify-self: start;
  width: auto;
}
.staff-panel .actions > button { flex: 0 0 auto; }
.window-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.window-change { display: grid; gap: 8px; padding-block: 10px; border-block-end: 1px solid var(--line); }
.window-change h3 { margin: 0; font-size: 1.05rem; }
.window-change:last-child { border-block-end: 0; }
.window-one { display: grid; gap: 6px; padding-block: 8px; }
.window-one h4 { margin: 0; font-size: .95rem; }
/* A closed disclosure is a button: only as wide as its words. It opens to the
   full width so its form has room. */
.staff-panel :is(details.panel, details.disclose):not([open]) {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}
.staff-panel .primary { min-height: 44px; padding-inline: 20px; } /* keeps the 19px bold text that white on tomato needs */
.staff-panel h2 { font-size: 1.3rem; }
/* Top bar: brand at the start, language and sign-out together at the end. */
.topbar .top-actions { margin-inline-start: auto; }
@media (max-width: 480px) {
  .staff-panel .checkout h1 { font-size: 1.7rem; }
}
.staff-panel form.panel { display: grid; gap: 10px; }
/* UX-STAFF-003: the area navigation. Desktop: one row of tabs under the top
   bar, the current one filled. Phone: a single «Sections» button that opens
   the same links as a list. */
.staff-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-block: 4px 10px;
  margin-block-end: 8px;
  border-block-end: 1px solid var(--line);
}
.staff-nav a, .staff-nav-menu nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
}
.staff-nav a:hover, .staff-nav-menu nav a:hover { background: var(--surface); }
.staff-nav a[aria-current], .staff-nav-menu nav a[aria-current] {
  background: var(--neutral-bg);
  box-shadow: inset 0 -3px 0 var(--primary);
}
.staff-nav-menu { display: none; }
main .staff-nav-menu > summary {
  padding: 8px 14px;
  border: 1.5px solid var(--input-line);
  border-radius: 12px;
  background: var(--card);
}
.staff-nav-menu > summary small { color: var(--muted); font-weight: 500; }
.staff-nav-menu nav { display: grid; gap: 2px; padding-block: 6px; }
@media (max-width: 640px) {
  .staff-nav { display: none; }
  .staff-nav-menu { display: block; margin-block-end: 10px; }
}
/* An area page section: heading with a short count, then its content. */
.staff-section { display: grid; gap: 8px; margin-block-start: 10px; }
.staff-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.staff-section-head small { color: var(--muted); font-size: .85rem; }
.staff-section h2 { scroll-margin-block-start: 16px; }
.staff-paths.staff-hub { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 4px 8px; }
/* UX-STAFF-004: the light/dark toggle shows the way out of the theme on
   screen: a moon in light, a sun in dark. */
.theme-form { margin: 0; }
.theme-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
.theme-to-light { display: none; }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-to-light { display: block; }
}
:root[data-theme="dark"] .theme-to-dark { display: none; }
:root[data-theme="dark"] .theme-to-light { display: block; }
/* LIVE-DAY-001: a delivery day's switch for customers on the one-day menu page:
   its state as a soft chip, then the one button that changes it. */
.live-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block: 6px 10px; }
.status.live-off { background: var(--neutral-bg); color: var(--ink); }
/* SHOWCASE-002: the public menu lists each delivery day with its dishes; a day
   not open for orders yet carries a soft «opens soon» chip after its date. */
.showcase-day + .showcase-day { margin-block-start: 18px; }
.showcase-day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-block-end: 10px; }
.showcase-day-head h3 { margin: 0; font-size: 1.1rem; }
