/* ===========================================================================
   app.css — one stylesheet for both pages. Mobile-first: the customer arrives
   on a phone from a shared link, and the seller edits the menu on the same
   phone in a kitchen.
   =========================================================================== */
:root {
  /* ONE light palette. There is deliberately no dark-mode block: the menu is
     designed as a single look, and every colour below is the one shipped. */
  --page: #eeeae2;          /* behind the customer column, and behind the editor */
  --bg: #faf7f0;            /* the menu column; also header glass and no-photo frames */
  --surface: #fffdf8;       /* cards, modals, inputs */
  --surface-2: #faf7f0;     /* quiet fills inside a card (hidden category, ghost hover) */
  --ink: #282923;
  --ink-2: #727166;         /* secondary text */
  --ink-3: #747166;         /* muted text */
  --line: #d9e5e9;          /* rules and card borders */
  --control: #c4d4d9;       /* button and pill borders */
  --control-2: #cbd9dc;     /* input borders */
  --accent: #315f76;        /* primary */
  --accent-ink: #ffffff;
  --chip-bg: #e6eff2;
  --chip-ink: #28556b;
  --eyebrow: #42748b;
  --sky: #42748b;           /* focus ring */
  --ok: #2f6f4f;
  --warn: #8a5a12;
  --warn-bg: #fdf3dd;
  --danger: #9b2c23;
  --radius: 13px;           /* cards */
  --radius-btn: 9px;        /* buttons */
  --radius-pill: 22px;      /* pills and chips */
  --shadow: 0 3px 12px #2829230b;
  --maxw: 720px;            /* the EDITOR's width — admin.html; the customer column uses its own */
  --col: 430px;             /* the CUSTOMER column — index.html only */
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* `hidden` must mean hidden. Any rule that sets display (e.g. .pills { display:
   flex }) otherwise outranks the browser's own [hidden] rule and leaves a
   "hidden" element laid out, taking space. */
[hidden] { display: none !important; }
/* touch-action: manipulation — no double-tap-to-zoom, so tapping + quickly
   (the edit-order modal, the customer's steppers) never zooms the page on
   iOS Safari. Scrolling and pinch-to-zoom still work; the viewport meta stays
   zoomable on purpose. The splash's own `touch-action: none` (index.html)
   still wins on its element — the stricter value along the chain applies. */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 64px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);                      /* plain fallback first */
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { font-weight: 700; letter-spacing: -.01em; font-size: 17px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); letter-spacing: 0; }
.spacer { flex: 1; }

/* ── buttons ────────────────────────────────────────────────────────────── */
button { font: inherit; }
.btn {
  appearance: none; border: 1px solid var(--control); background: var(--surface);
  color: var(--ink); padding: 9px 14px; border-radius: var(--radius-btn); cursor: pointer;
  font-weight: 600; font-size: 14px; min-height: 40px;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn-icon { min-width: 36px; padding: 5px 8px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── forms ──────────────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=time], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--control-2); border-radius: var(--radius-btn);
  background: var(--surface); color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .sw:focus-visible {
  outline: 2px solid var(--sky); outline-offset: 2px;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.45; display: block; }
.field { margin-bottom: 14px; }
.field-err { color: var(--danger); font-size: 13px; margin-top: 5px; font-weight: 600; }

/* a switch that is a real checkbox underneath */
.sw { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track {
  width: 42px; height: 25px; border-radius: 999px; background: var(--line);
  position: relative; transition: background .15s; flex: none;
}
.sw-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.sw input:checked + .sw-track { background: var(--ok); }
.sw input:checked + .sw-track::after { transform: translateX(17px); }
.sw input:disabled + .sw-track { opacity: .5; }

/* ── cards / lists ──────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; margin: 28px 0 10px; }
.muted { color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-2); padding: 40px 16px; }
.banner { border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; font-size: 14px; border: 1px solid; }
.banner-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.banner-ok { background: transparent; border-color: var(--line); color: var(--ink-2); }
.banner-err { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); color: var(--danger); }
.banner ul { margin: 4px 0 0; padding-left: 20px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.tag-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-bg); }
.tag-off { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ── the dashed "no photo yet" square, used on both pages ───────────────── */
.nophoto {
  border: 1px dashed var(--control); border-radius: 10px;
  background: var(--bg);
  display: grid; place-items: center; color: var(--ink-3);
  aspect-ratio: 1 / 1;
}
.nophoto svg { width: 38%; height: 38%; opacity: .5; }

/* ── modal ──────────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(40, 41, 35, .45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 620px) { .modal-back { align-items: center; padding: 24px; } }
.modal {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: var(--radius) var(--radius) 0 0; padding: 18px;
  max-height: 92vh; overflow: auto; box-shadow: var(--shadow);
}
@media (min-width: 620px) { .modal { border-radius: var(--radius); } }
.modal h2 { margin: 0 0 16px; font-size: 22px; font-family: var(--serif); font-weight: 400; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
