/* Cantine demo - vanilla CSS. Tokens first, then components. No inline styles (CSP). */
:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --ink: #1d2a24;
  --muted: #5d6a63;
  --line: #e2d9c6;
  --green: #1f5c46;
  --green-ink: #174536;
  --green-soft: #dcebe3;
  --tomato: #c9442a;
  --tomato-soft: #fbe3dc;
  --mustard: #8a5a00;
  --mustard-soft: #f8ecc9;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(29 42 36 / 8%), 0 6px 18px rgb(29 42 36 / 6%);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 var(--s2); }
h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 var(--s2); }
a { color: var(--green); }
:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }
.fine { color: var(--muted); font-size: .875rem; text-align: center; margin-top: var(--s5); }

.demo-banner {
  background: var(--ink); color: #fff; text-align: center; font-size: .8125rem;
  padding: var(--s2) var(--s4); padding-top: calc(var(--s2) + env(safe-area-inset-top));
}
.demo-banner strong { background: var(--tomato); padding: 1px 8px; border-radius: 999px; margin-right: 4px; letter-spacing: .06em; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
  padding: var(--s3) var(--s4); background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand small { display: block; font-family: var(--font); font-weight: 400; font-size: .75rem; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: var(--bg); font-size: 1.2rem; }
.nav { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.nav-link, .link-btn {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--s3); border-radius: 999px;
  color: var(--ink); text-decoration: none; font: inherit; font-weight: 600; font-size: .9375rem;
}
.nav-link:hover, .link-btn:hover { background: var(--green-soft); }
.nav-link.is-active { background: var(--green); color: #fff; }
.nav-out { margin: 0; }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--muted); }

.page { max-width: 1100px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.foot { text-align: center; color: var(--muted); font-size: .8125rem; padding: var(--s5) var(--s4); }

.hero { max-width: 640px; margin: var(--s5) auto var(--s5); text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--tomato); font-weight: 700; }
.lead { font-size: 1.0625rem; color: var(--muted); }
.lead.small { font-size: .9375rem; }
.role-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 900px; margin: 0 auto; }
.role-card { position: relative; display: flex; flex-direction: column; gap: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); }
.role-card p { color: var(--muted); flex: 1; }
.tag { align-self: flex-start; background: var(--tomato-soft); color: var(--tomato); font-weight: 700; font-size: .6875rem; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .9375rem; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-selected { background: var(--green-soft); color: var(--green-ink); border-color: var(--green); }
.btn-selected.is-static { cursor: default; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.is-disabled { opacity: .35; pointer-events: none; }

.weeknav { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.weeknav .btn { min-width: 44px; padding: 0; }
.weeklabel { margin: 0; text-align: center; flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.empty { text-align: center; color: var(--muted); padding: var(--s6) 0; }

.days { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.day-card, .kday, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); box-shadow: var(--shadow);
}
.day-card.is-today { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft), var(--shadow); }
.day-card.is-closed { background: #f3eee2; }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s3); }
.day-head h2 { margin: 0; }
.cutoff { margin: 2px 0 0; font-size: .8125rem; color: var(--muted); }
.chip { display: inline-block; font-size: .75rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip-ok { background: var(--green); color: #fff; }
.chip-open { background: var(--green-soft); color: var(--green-ink); }
.chip-closed { background: #e6dfcf; color: var(--muted); }
.chip-veg { background: #e3f1d6; color: #2f6a12; margin-left: var(--s1); }
.chip-allergen { background: var(--mustard-soft); color: var(--mustard); margin: 0 var(--s1) var(--s1) 0; }

.dishes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.dish { border: 1px solid var(--line); border-radius: 12px; padding: var(--s3); background: #fff; }
.dish.is-chosen { border-color: var(--green); background: #f4faf6; }
.dish form { display: grid; gap: var(--s3); }
.dish .desc { color: var(--muted); font-size: .875rem; margin-bottom: var(--s2); }
.dish .tags { margin: 0; }
.dish .tags .chip-veg { margin: 0 var(--s1) var(--s1) 0; }
.warn { margin: var(--s2) 0 0; color: var(--tomato); font-weight: 650; font-size: .875rem; }
.msg { padding: var(--s2) var(--s3); border-radius: 10px; font-size: .875rem; font-weight: 600; }
.msg-ok { background: var(--green-soft); color: var(--green-ink); }
.msg-err { background: var(--tomato-soft); color: var(--tomato); }

.kitchen { display: grid; gap: var(--s4); }
.total { background: var(--green); color: #fff; border-radius: 999px; padding: 4px 14px; white-space: nowrap; font-size: .875rem; }
.total strong { font-size: 1.1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.count { font-size: 1.25rem; font-weight: 700; }
.alert-line, .note-line { margin: var(--s3) 0 0; padding: var(--s2) var(--s3); border-radius: 10px; font-size: .875rem; }
.alert-line { background: var(--tomato-soft); color: #8c2412; }
.note-line { background: var(--mustard-soft); color: var(--mustard); margin: var(--s2) 0 0; }
.notes { margin-top: var(--s3); }
.notes summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; font-size: .875rem; color: var(--mustard); }

.panel { margin-top: var(--s5); max-width: 760px; }
.field { display: grid; gap: var(--s1); margin: 0 0 var(--s4); border: 0; padding: 0; min-width: 0; }
.field > span, legend { font-weight: 650; font-size: .875rem; padding: 0; margin-bottom: var(--s2); }
input[type=text], input[type=datetime-local] {
  width: 100%; min-height: 44px; padding: 0 var(--s3); border: 1px solid #c9bfa8; border-radius: 10px; background: #fff; font: inherit; color: inherit;
}
.check { display: flex; align-items: center; gap: var(--s3); min-height: 44px; font-size: .9375rem; }
.check input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 var(--s4); }

@media (min-width: 900px) {
  .page { padding-top: var(--s6); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
