/* Shared styles for guest, staff and admin screens. Each brand sets its own colours via data-theme. */
:root, [data-theme="mote"] {
  --bg: #f6f1ea; --card: #fffdf9; --ink: #2b2420; --muted: #7b6f66; --line: #e4dacd;
  --accent: #8a5a3c; --accent-ink: #fff; --soft: #efe4d6; --ok: #2f7d4f; --warn: #b3541e;
}
[data-theme="hearth"] { --bg: #f4efe6; --card: #fffdf8; --ink: #26302a; --muted: #6d7469; --line: #dfd8c8; --accent: #3f5a47; --accent-ink: #fff; --soft: #e6e8d9; }
[data-theme="mias"] { --bg: #f3f4ec; --card: #fefefb; --ink: #2d2c27; --muted: #72746a; --line: #dcdfd0; --accent: #6b7d4f; --accent-ink: #fff; --soft: #e6ead9; }
[data-theme="wetstone"] { --bg: #eff0f0; --card: #fdfdfd; --ink: #23272a; --muted: #6b7378; --line: #d9dddf; --accent: #47545c; --accent-ink: #fff; --soft: #e2e6e8; }
[data-theme="cocktail"] { --bg: #14171f; --card: #1e222d; --ink: #f3ecdd; --muted: #a39d90; --line: #333848; --accent: #d2a955; --accent-ink: #191a1f; --soft: #2a2f3d; --ok: #6fcf97; --warn: #f0935a; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 1.9rem; line-height: 1.15; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 120px; }
.wide { max-width: 1180px; }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrapx { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn.danger { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: block; }
.field > span { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.error { color: var(--warn); font-size: .9rem; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--soft); font-size: .82rem; font-weight: 600; }
.pill.accent { background: var(--accent); color: var(--accent-ink); }
.pill.warn { background: transparent; border: 1px solid var(--warn); color: var(--warn); }

/* ---------- guest ---------- */
.hero { padding: 36px 4px 20px; }
.hero h1 { margin: 8px 0 6px; }
.allow { position: sticky; top: 0; z-index: 5; margin: 0 -16px 16px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--accent); }
.dots i.off { background: transparent; opacity: .5; }
.cat { margin: 22px 0 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.item .plus { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 1.3rem; line-height: 1; }
.item.out { opacity: .5; }
.item b { display: block; font-weight: 600; }
.ticket { border: 2px solid var(--accent); }
.ticket.ready { background: var(--accent); color: var(--accent-ink); animation: pulse 1.4s ease-in-out infinite; }
.ticket.ready .muted, .ticket.ready .eyebrow { color: inherit; opacity: .85; }
.ticket.past { border: 1px solid var(--line); opacity: .7; }
.ticket .num { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 2.6rem; line-height: 1; font-weight: 700; }
.steps { display: flex; gap: 4px; margin-top: 12px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--soft); }
.steps span.on { background: var(--accent); }
.ticket.ready .steps span { background: var(--accent-ink); }
@keyframes pulse { 50% { transform: scale(1.015); } }
@media (prefers-reduced-motion: reduce) { .ticket.ready { animation: none; } }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.cartbar .inner { max-width: 488px; margin: 0 auto; }
.cartline { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .95rem; }
.cartline button { border: 0; background: none; color: var(--muted); font-size: 1.2rem; padding: 4px 8px; }

.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .86rem; font-weight: 600; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.choice.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice b { font-weight: 600; }
.qty { display: inline-flex; align-items: center; gap: 14px; }
.qty button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.2rem; }

/* ---------- staff ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 8px 14px; border-radius: 999px; border: 0; background: transparent; font-weight: 600; color: var(--muted); }
.tab.on { background: var(--soft); color: var(--ink); }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 820px) { .board { grid-template-columns: 1fr; } }
.col h2 { margin: 4px 2px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.order { margin-bottom: 10px; }
.order .who { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 1.55rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.order .no { font-weight: 700; color: var(--muted); }
.order ul { margin: 8px 0 12px; padding: 0; list-style: none; }
.order li { padding: 5px 0; border-top: 1px dashed var(--line); }
.order li b { font-weight: 600; }
.order .recipe { display: block; font-size: .84rem; color: var(--muted); }
.order.is-ready { border: 2px solid var(--ok); }
.order.late .age { color: var(--warn); font-weight: 700; }
.empty { padding: 22px 10px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; font-size: .9rem; }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.switch { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- admin ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.barcard { display: block; text-decoration: none; color: var(--ink); }
.stat { text-align: center; }
.stat b { display: block; font-size: 1.6rem; font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.qrbox { background: #fff; color: #222; border-radius: 16px; padding: 18px; text-align: center; border: 1px solid var(--line); }
.qrbox svg { width: 100%; max-width: 260px; height: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px 16px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.optgroup { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }

#poster { display: none; }
@media print {
  body > *:not(#poster) { display: none !important; }
  #poster { display: block; text-align: center; padding: 40px 20px; color: #000; background: #fff; }
  #poster svg { width: 11cm; height: 11cm; }
  #poster h1 { font-size: 34pt; margin: 10pt 0; }
  #poster p { font-size: 15pt; margin: 6pt 0; }
}
.item .small { display: block; }

/* ---------- whitelabel ---------- */
[data-theme="plain"] { --bg: #f7f7f7; --card: #ffffff; --ink: #1f1f1f; --muted: #6f6f6f; --line: #e2e2e2; --accent: #222222; --accent-ink: #ffffff; --soft: #ececec; }
[data-theme="plaindark"] { --bg: #121212; --card: #1c1c1c; --ink: #f2f2f2; --muted: #9b9b9b; --line: #333333; --accent: #f2f2f2; --accent-ink: #121212; --soft: #2a2a2a; --ok: #6fcf97; --warn: #f0935a; }
.brandlogo { display: block; max-width: 220px; max-height: 90px; width: auto; height: auto; margin: 0 0 14px; object-fit: contain; }
.hero.centered { text-align: center; }
.hero.centered .brandlogo { margin-left: auto; margin-right: auto; }
.logoprev { max-width: 160px; max-height: 70px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
