/* SNOBS: plain CSS3, no build step. Brand guidance: spec/brand.md.
   Exact brand swatches are for brand areas and decoration. Text and controls use the
   semantic tokens below, which meet WCAG AA on the light surfaces. */

@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/DMSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/DMSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/DMSerifDisplay-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/DMSerifDisplay-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Brand palette (brand book p. 32). */
  --brand-green: #009B4A;
  --brand-orange: #FE4D00;
  --brand-yellow: #FFDD4F;
  --brand-purple: #7E73E9;
  --brand-pink: #FFB7F3;
  --brand-white: #FAFAFA;
  --brand-gray: #505050;
  --brand-light-green: #F0F3BA;

  /* Semantic tokens. Contrast on --surface (#fff): ink 8.0:1, action 6.2:1 (white text on
     action too), error 5.8:1, ok 6.2:1, wait 8.6:1. */
  --bg: var(--brand-white);
  --surface: #FFFFFF;
  --surface-soft: var(--brand-light-green);
  --ink: var(--brand-gray);
  --ink-strong: #2F2F2F;
  --muted: #666666;
  --line: #DCDFC2;
  --action: #00703A;
  --action-hover: #005C30;
  --error: #B83800;
  --error-bg: #FFF1EA;
  --ok-ink: #00703A;
  --ok-bg: #E3F4E9;
  --wait-ink: #5C4A00;
  --wait-bg: #FFF4C2;
  --off-ink: #555555;
  --off-bg: #ECECEC;

  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --space: 1rem;
  --tap: 44px;          /* minimum touch target */
  --logo-clear: 0.75rem; /* ≥ 1× the logo's curve height at the header size (brand book p. 29) */

  color-scheme: light;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-size: 1rem; line-height: 1.55;
}
main { max-width: 46rem; margin: 0 auto; padding: calc(var(--space) * 1.5) var(--space) calc(var(--space) * 3); }

h1, h2, h3 { color: var(--ink-strong); line-height: 1.15; margin: 0 0 0.5em; }
h1, h2 { font-family: var(--font-display); font-weight: 400; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.75rem); }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.25em; }
p { margin: 0 0 0.75em; }
a { color: var(--action); text-underline-offset: 0.15em; }
a:hover { color: var(--action-hover); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.empty { color: var(--muted); font-style: italic; }

/* Focus: a dark ring with a yellow halo stays visible on white, light green and brand green. */
:focus-visible { outline: 3px solid var(--ink-strong); outline-offset: 2px; box-shadow: 0 0 0 6px var(--brand-yellow); }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: var(--space); top: var(--space); z-index: 10; background: var(--surface); padding: 0.5rem 1rem; }

/* Header: a short brand bar. On phones the navigation lives at the bottom, under the thumb
   (mobile first, AGENTS.md rule 10); on wide screens the same tabs sit under the header. */
.site-header {
  background: var(--brand-green); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space);
  padding: calc(0.25rem + env(safe-area-inset-top)) var(--space) 0.25rem;
}
.brand { display: inline-flex; padding: var(--logo-clear); border-radius: 8px; }
.logo { display: block; width: clamp(96px, 28vw, 140px); height: auto; aspect-ratio: 500 / 150; }
body.is-guest .site-header { justify-content: center; padding-block: calc(var(--space) * 2.5); }
body.is-guest .logo { width: min(260px, 70vw); }
@media (max-width: 30rem) {
  :root { --logo-clear: 0.5rem; }
}
.header-action { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 999px; color: #fff; }
.header-action:hover, .header-action[aria-current="page"] { color: #fff; background: rgb(0 0 0 / 0.15); }
.header-action .badge { position: absolute; top: 0; right: -2px; box-shadow: 0 0 0 2px var(--brand-green); }

.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button .icon { width: 1.25rem; height: 1.25rem; }

/* Tab bar: fixed at the bottom on phones, icons with short labels, the current one in a pill. */
.tab-bar {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(0 0 0 / 0.06);
  padding: 0.25rem 0.25rem env(safe-area-inset-bottom);
}
.tab-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  min-height: 58px; font-size: 0.75rem; font-weight: 700; text-decoration: none; color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.tab-bar .icon { box-sizing: content-box; padding: 0.15rem 1rem; border-radius: 999px; }
.tab-bar a:hover { color: var(--ink-strong); }
.tab-bar a[aria-current="page"] { color: var(--action); }
.tab-bar a[aria-current="page"] .icon { background: var(--ok-bg); }
body:not(.is-guest) main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
@media (min-width: 48rem) {
  body:not(.is-guest) { display: flex; flex-direction: column; }
  .tab-bar { position: static; order: 2; width: calc(100% - 2 * var(--space)); max-width: 46rem; margin: var(--space) auto 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; overflow: hidden; }
  .tab-bar a { flex-direction: row; gap: 0.4rem; min-height: 48px; font-size: 0.95rem; }
  .tab-bar .icon { padding: 0; width: 1.25rem; height: 1.25rem; }
  .tab-bar a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brand-green); }
  .tab-bar a[aria-current="page"] .icon { background: none; }
  body:not(.is-guest) main { order: 3; width: 100%; padding-bottom: calc(var(--space) * 3); }
}

/* "Más": big rows, one per section. */
.nav-list { list-style: none; margin: 0 0 var(--space); padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.nav-list a { display: flex; align-items: center; gap: 0.85rem; min-height: 64px; padding: 0.6rem var(--space); color: var(--ink-strong); text-decoration: none; border-bottom: 1px solid var(--line); }
.nav-list li:last-child a { border-bottom: 0; }
.nav-list a:hover { background: var(--ok-bg); color: var(--ink-strong); }
.nav-list .icon { color: var(--action); }
.nav-list .icon:last-child { margin-left: auto; color: var(--muted); width: 1.25rem; }
.nav-list strong { display: block; }
.nav-list small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }

/* Cards and lists. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(var(--space) * 1.25); margin-bottom: var(--space); }
.list { list-style: none; margin: 0 0 var(--space); padding: 0; }
.list-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem var(--space); padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row-stack { flex-direction: column; align-items: stretch; }
.list-row p { margin: 0.15rem 0 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* Status tags: always words, never colour alone. */
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 0.05rem 0.6rem; background: var(--surface-soft); color: var(--ink-strong); vertical-align: middle; }
.tag-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag-wait { background: var(--wait-bg); color: var(--wait-ink); }
.tag-off { background: var(--off-bg); color: var(--off-ink); }

/* Forms and buttons. */
.stack { display: grid; gap: 0.5rem; margin: var(--space) 0 0; }
label { font-weight: 700; color: var(--ink-strong); }
input[type="email"], input[type="text"], input[type="date"], input[type="time"], input[type="datetime-local"], input:not([type]), textarea, select {
  font: inherit; width: 100%; min-height: var(--tap); padding: 0.55rem 0.75rem;
  border: 1px solid #9A9C88; border-radius: 10px; background: var(--surface); color: var(--ink-strong);
}
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
fieldset { border: 0; padding: 0; margin: 0.25rem 0; }
legend { font-weight: 700; color: var(--ink-strong); margin-bottom: 0.25rem; }
.choice { display: flex; align-items: center; gap: 0.6rem; min-height: var(--tap); font-weight: 400; color: var(--ink); }
.choice input { width: 1.25rem; height: 1.25rem; accent-color: var(--action); margin: 0; }
.input-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.input-row input { flex: 1 1 14rem; }
.field-error { margin: 0; color: var(--error); font-weight: 700; font-size: 0.9rem; }
.alert { margin: 0 0 var(--space); padding: 0.75rem 1rem; border-radius: 10px; background: var(--error-bg); color: var(--error); border-left: 4px solid var(--brand-orange); font-weight: 700; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); padding: 0.55rem 1.1rem; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--action); border: 2px solid var(--action);
}
.button:hover { background: var(--ok-bg); color: var(--action-hover); }
.button-primary { background: var(--action); color: #fff; border-color: var(--action); }
.button-primary:hover { background: var(--action-hover); border-color: var(--action-hover); color: #fff; }
.button-quiet { border-color: transparent; background: transparent; padding-inline: 0.5rem; text-decoration: underline; }
.button-on-brand { background: #fff; color: var(--action); border-color: #fff; }
.button-block { width: 100%; }
.button:disabled { opacity: 0.6; cursor: progress; }
.link-arrow, .link-back, .row-link { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.link-arrow::after { content: " →"; white-space: pre; }
.link-back::before { content: "← "; white-space: pre; }

.notice { margin: 0 0 var(--space); padding: 0.75rem 1rem; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); border-left: 4px solid var(--brand-green); font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Customer menu. */
.lead { font-size: 1.1rem; color: var(--ink-strong); }
.plain-list { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.day-nav { margin: 0 0 var(--space); overflow-x: auto; }
.day-nav ul { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.day-nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; font-weight: 700; text-decoration: none; }
.day-nav a[aria-current="date"] { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }

/* Ordering. */
.diner-tabs ul { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 0.75rem; padding: 0; }
.diner-tabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 1rem; border-radius: 999px; border: 2px solid var(--action); font-weight: 700; text-decoration: none; }
.diner-tabs a[aria-current="page"] { background: var(--action); color: #fff; }
.ordering-for { margin-bottom: var(--space); }
.dish-info { flex: 1 1 12rem; }
.pick { display: flex; align-items: center; gap: 0.25rem; }
.pick select { width: auto; min-width: 8.5rem; }
.picked { background: var(--ok-bg); margin: 0 calc(var(--space) * -0.5); padding-inline: calc(var(--space) * 0.5); border-radius: 10px; }
.save-bar {
  position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem;
  background: var(--ink-strong); color: #fff; border-radius: var(--radius); padding: 0.75rem 1rem; font-weight: 700;
}
.save-state { color: var(--brand-yellow); }
.save-bar-link { display: inline-flex; align-items: center; min-height: var(--tap); color: #fff; }
.save-bar-link:hover { color: var(--brand-yellow); }
.save-bar-link::after { content: " →"; white-space: pre; }
.diner-block { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.save-failed { color: #FFB59A; }
@media (min-width: 48rem) { .save-bar { bottom: var(--space); } }

/* Charges. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 var(--space); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink-strong); }
.review { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.review:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
input[type="file"] { font: inherit; min-height: var(--tap); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 var(--space); }
.stats > div { background: var(--surface-soft); border-radius: 10px; padding: 0.6rem 0.75rem; }
.stats dt { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.stats dd { margin: 0; color: var(--ink-strong); }
.steps { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.steps li { margin-bottom: 0.5rem; }
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 0.4rem; } }

/* Reports. */
.report { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; table-layout: fixed; }
.report td { overflow-wrap: anywhere; }
.report th, .report td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report th { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.report .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-pick { margin-bottom: var(--space); }
.select-small { width: auto; min-width: 4.5rem; }
.pending-row td:first-child { box-shadow: inset 3px 0 0 var(--brand-yellow); padding-left: 0.6rem; }
.week-pick select { flex: 1 1 12rem; width: auto; min-width: 0; max-width: 100%; }
@media print {
  .site-header, .tab-bar, .skip-link, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; margin-bottom: 1rem; break-inside: avoid; }
  main { max-width: none; padding: 0; }
}

/* Notices. */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: 999px; background: var(--error); color: #fff; font-size: 0.75rem; font-weight: 700; }
.unread strong { color: var(--ink-strong); }
.unread { box-shadow: inset 3px 0 0 var(--brand-orange); padding-left: 0.6rem; }
.confirm-box { border: 2px solid var(--action); }

/* PWA. */
.install-steps h3 { margin-top: 1rem; }
.token { overflow-wrap: anywhere; background: var(--surface); padding: 0.5rem; border-radius: 8px; color: var(--ink-strong); font-weight: 400; }
.install-steps ol { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.install-steps li { margin-bottom: 0.25rem; }

/* Week editor. */
.checklist { margin: 0 0 var(--space); padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.25rem; }
.checklist-warn { color: var(--wait-ink); }
.batch-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.5rem; align-items: end; }
.batch-form > div { display: grid; gap: 0.25rem; }
.grid-day { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-bottom: 0.5rem; }
.grid-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.5rem; }
.grid-cells > div { display: grid; gap: 0.25rem; align-content: start; }
.grid-cells p { margin: 0; }
.grid-cells-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* read-only: breakfast, lunch, dinner side by side */
.slot-block { border-top: 1px solid var(--line); padding-top: 0.25rem; margin-bottom: var(--space); }
.slot-block h3 { margin-top: 0.75rem; }

/* Catalog forms: price sizes side by side, recipe lines as ingredient / quantity / unit. */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.75rem; }
.price-cell { display: grid; gap: 0.35rem; align-content: start; }
.money-input { display: flex; align-items: center; gap: 0.35rem; }
.money-input span { font-weight: 700; color: var(--ink-strong); }
.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem 6rem; gap: 0.5rem; margin-bottom: 0.5rem; }
.recipe-row-error { grid-column: 1 / -1; }
@media (max-width: 30rem) {
  .recipe-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .recipe-row > div:first-child { grid-column: 1 / -1; }
}

.disclosure { margin-top: var(--space); border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.disclosure summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--action); }

/* Login: a quiet dotted band (graphic system, p. 39–40) that never sits behind text. */
.login { max-width: 26rem; margin: 0 auto; }
.login-card { position: relative; }
.login-card::before {
  content: ""; display: block; height: 18px; margin: calc(var(--space) * -1.25) calc(var(--space) * -1.25) var(--space);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--brand-light-green) radial-gradient(circle, #C9CC8F 3px, transparent 3.5px) 0 0 / 18px 18px;
}

/* View transitions. htmx 4 wraps swaps in document.startViewTransition (transitions: true in
   the layout). Keep them short. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  * { scroll-behavior: auto !important; transition: none !important; }
}
