/* Layout: a sticky brand bar, a compact hero, then an app shell with a left tab rail (stacks to a scrolling tab strip on phones). */
:root {
  --bg: #f5f4fb;
  --surface: #ffffff;
  --surface-2: #ecebf5;
  --fg: #1b1a2e;
  --muted: #5e5c7a;
  --line: #d9d7e8;
  --accent: #4a2b9c;
  --accent-ink: #ffffff;
  --accent-soft: #e9e3fb;
  --logo-bg: transparent;
  --logo-pad: 0;
  --ok: #157f4d;   --ok-soft: #dcf3e6;
  --warn: #a86200; --warn-soft: #fbecd2;
  --bad: #c0293a;  --bad-soft: #fbe0e4;
  --shadow: 0 1px 2px rgba(27,26,46,.06), 0 8px 24px -12px rgba(27,26,46,.18);
  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12121f; --surface: #1a1a2d; --surface-2: #23233a; --fg: #ecebf7; --muted: #a3a1c2; --line: #32324f;
    --accent: #a08dff; --accent-ink: #15103a; --accent-soft: #2a2456; --logo-bg: #ffffff; --logo-pad: 3px 6px;
    --ok: #5fd39a; --ok-soft: #153626; --warn: #f0b35c; --warn-soft: #3a2a10; --bad: #ff8391; --bad-soft: #3f1a21;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12121f; --surface: #1a1a2d; --surface-2: #23233a; --fg: #ecebf7; --muted: #a3a1c2; --line: #32324f;
  --accent: #a08dff; --accent-ink: #15103a; --accent-soft: #2a2456; --logo-bg: #ffffff; --logo-pad: 3px 6px;
  --ok: #5fd39a; --ok-soft: #153626; --warn: #f0b35c; --warn-soft: #3a2a10; --bad: #ff8391; --bad-soft: #3f1a21;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; text-wrap: balance; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.logo { display: inline-flex; background: var(--logo-bg); border-radius: 6px; padding: var(--logo-pad); }
.logo img { height: 26px; width: auto; display: block; }
.brand-txt { border-left: 1px solid var(--line); padding-left: 10px; font-weight: 600; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.who img { width: 28px; height: 28px; border-radius: 50%; }

/* Page wrap */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); margin-bottom: 18px; font-size: .9rem; }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.banner .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); margin-top: 7px; flex: none; }
.banner.ok .dot { background: var(--ok); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; cursor: pointer; text-decoration: none; font-size: .92rem; line-height: 1.2; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.sm { padding: 5px 10px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.raised { box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding: 28px 0 8px; }
@media (max-width: 800px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero p.lead { font-size: 1.08rem; color: var(--muted); max-width: 48ch; margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .85rem; }

/* Feature list */
.feature { display: flex; gap: 12px; }
.feature .ic { flex: none; width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }

/* Forms */
.form { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .form { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); width: 100%; min-width: 0; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: .78rem; color: var(--muted); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--bad); }
.field .error { font-size: .8rem; color: var(--bad); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 4px; }

/* App shell */
.app { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
.rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); align-self: start; }
.rail a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rail a:hover { background: var(--surface-2); color: var(--fg); }
.rail a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail .count { font-size: .75rem; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.rail a.active .count { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; gap: 6px; }
  .rail a { white-space: nowrap; }
}

/* Pills and meters */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.meter > i.warn { background: var(--warn); }
.meter > i.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.date-chip { flex: none; width: 54px; text-align: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); padding: 6px 4px; font-family: var(--font-display); line-height: 1.1; }
.date-chip b { display: block; font-size: 1.25rem; }
.date-chip span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Menu */
.menu-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.veg { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--ok); border-radius: 2px; position: relative; flex: none; }
.veg::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--ok); }
.veg.nv { border-color: var(--bad); } .veg.nv::after { background: var(--bad); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { background: var(--surface-2); border: 0; width: 30px; height: 30px; cursor: pointer; }
.qty span { width: 30px; text-align: center; font-variant-numeric: tabular-nums; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow); z-index: 50; max-width: calc(100vw - 32px); }

.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 16px; color: var(--muted); font-size: .85rem; }
.footer-in { max-width: 1120px; margin: 0 auto; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: .88rem; font-weight: 500; }
.tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.copy { font-family: var(--font-mono); font-size: .9rem; user-select: all; }
@media (prefers-reduced-motion: no-preference) { .btn, .nav a, .rail a { transition: background .15s, filter .15s; } }

/* Cafeteria additions */
.big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin: 4px 0; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }
.star { color: var(--warn); letter-spacing: .05em; }
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--line); cursor: pointer; padding: 0 2px; }
.stars button.on { color: var(--warn); }
.subcard { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .9rem; }
.seg label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); }
@media (max-width: 560px) { .sticky { position: static; } .grid.c2[style*="1.3fr"] { grid-template-columns: minmax(0, 1fr) !important; } }
.timeline { display: flex; gap: 4px; flex-wrap: wrap; }
.timeline .step { font-size: .76rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.timeline .step.done { background: var(--accent-soft); color: var(--accent); }
.timeline .step.here { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .78rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.ic.coffee, .ic.vending { flex: none; width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.1rem; }
.pill.muted { color: var(--muted); }

/* Dish photos */
.thumb { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.cover { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; margin-bottom: 10px; background: var(--surface-2); }
.menu-item { gap: 12px; align-items: center; }
@media (max-width: 560px) { .thumb { width: 64px; height: 48px; } }

/* Order from your seat and the security drill */
a.feature { text-decoration: none; color: inherit; }
a.feature:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.qr-box { display: grid; place-items: center; gap: 10px; margin-top: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: #ffffff; color: #1b1a2e; cursor: pointer; }
.qr-box svg { width: 220px; height: 220px; display: block; }
.qr-box .muted { color: #5e5c7a; }
.drill { text-align: center; padding: 28px 20px; border-radius: var(--radius); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 50%, transparent); }
.drill .mark { width: 56px; height: 56px; border-radius: 50%; background: var(--bad); color: #ffffff; display: grid; place-items: center; margin: 0 auto 14px; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.drill h2 { font-size: 1.4rem; }
.drill p { margin-top: 10px; }

/* Cafeteria photos */
.board { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin-top: 12px; background: var(--surface-2); }
.fridge-card { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.fridge-card img { width: 72px; height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; background: var(--surface-2); }

/* Pop-up dialog */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10, 8, 24, .6); backdrop-filter: blur(2px); }
.modal-card { width: min(560px, 100%); animation: pop .18s ease-out; }
.modal .drill { background: var(--surface); box-shadow: var(--shadow); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none; } }

/* Home: the two options */
.options { display: grid; gap: 12px; }
.option { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.option:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.option .ic { flex: none; width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
