/* Tickaway: one stylesheet for every page. Warm cream, dark ink, the firm's accent colour. */
:root {
  --accent: #c4532c;
  --cream: #f6efe2;
  --paper: #fffaf1;
  --line: #e4d9c6;
  --ink: #1d1712;
  --muted: #6b5f52;
  --green: #1f7a3a;
  --red: #b9321f;
  --amber: #c98a1a;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 10px 28px -18px rgba(40, 20, 0, 0.35);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 500 16px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1100px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.stack > * + * { margin-top: 10px; }
/* For screen readers only: the one line that announces a change of status. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- buttons ---------- */
/* Buttons are the size of their words. Only .btn-main (one per screen) is a little larger; none is full width. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 0.95rem; min-height: 40px; text-decoration: none; white-space: nowrap; transition: transform 0.08s ease, opacity 0.15s ease; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-red { background: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-main { font-size: 1.05rem; font-weight: 800; min-height: 46px; padding: 10px 22px; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 0.85rem; }

/* ---------- cards and forms ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
label.field { display: block; font-weight: 700; font-size: 0.9rem; }
label.field > span { display: block; margin-bottom: 4px; }
.input, textarea.input, select.input { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; min-height: 48px; }
.input:focus { outline: none; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.error { color: var(--red); font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 0.8rem; font-weight: 800; background: #eee3d0; color: var(--ink); }
.pill-green { background: #dcefe0; color: var(--green); }
.pill-red { background: #f6d9d3; color: var(--red); }
.pill-amber { background: #f7e8c8; color: #7a5208; }
.pill-grey { background: #e6e1d8; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tabs button { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-weight: 800; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 700; opacity: 0; transform: translateY(8px); transition: all 0.25s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--red); }
.toast-success { background: var(--green); }

/* ---------- the van page (customer) ---------- */
.van-head { background: var(--paper); border-bottom: 6px solid var(--accent); }
.van-head .wrap { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.van-name { font-weight: 900; font-size: clamp(1.5rem, 6vw, 2.2rem); line-height: 1.05; letter-spacing: -0.01em; }
.van-sub { color: var(--muted); margin-top: 4px; }
.status { font-weight: 800; border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.status.open { background: #dcefe0; color: var(--green); }
.status.closed, .status.suspended { background: #e6e1d8; color: var(--muted); }
.status.paused { background: #f7e8c8; color: #7a5208; }
.status.offline { background: #f6d9d3; color: var(--red); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status.open .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.sections { position: sticky; top: 0; z-index: 5; background: var(--cream); padding: 10px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.sections a { flex: none; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 0.9rem; }
.section h2 { font-weight: 900; font-size: 1.3rem; margin: 18px 0 4px; }
.section .note { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: left; width: 100%; }
.item:disabled { opacity: 0.55; }
.item .pic { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 12px; background: #fff; overflow: hidden; }
.item .pic svg, .item .pic img { width: 70px; height: 70px; object-fit: cover; }
.item .name { font-weight: 900; font-size: 1.05rem; }
.item .desc { color: var(--muted); font-size: 0.88rem; }
.item .price { font-weight: 900; font-size: 1.1rem; }
.item .flag { font-size: 0.75rem; font-weight: 800; color: var(--amber); }
.basket-bar { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; }
.basket-bar .btn { gap: 10px; box-shadow: 0 8px 24px -8px rgba(40, 20, 0, 0.55); }
.basket-bar .btn span + span::before { content: "·"; margin-right: 10px; opacity: 0.7; }
.sheet-back { position: fixed; inset: 0; background: rgba(30, 20, 10, 0.5); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; background: var(--paper); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation: rise 0.22s ease; }
@keyframes rise { from { transform: translateY(30px); opacity: 0.6; } }
.sheet:focus { outline: none; }
.sheet h2 { font-weight: 900; font-size: 1.4rem; }
.sheet .pic { width: 120px; height: 120px; margin: 0 auto 8px; }
.sheet .pic svg, .sheet .pic img { width: 120px; height: 120px; object-fit: cover; border-radius: 16px; }
.choices { display: grid; gap: 8px; margin-top: 8px; }
.choice { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-weight: 700; }
.choice input { width: 22px; height: 22px; accent-color: var(--accent); }
.choice .extra { margin-left: auto; color: var(--muted); font-weight: 800; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 1.15rem; font-weight: 900; }
.qty span { min-width: 28px; text-align: center; font-weight: 900; font-size: 1rem; }
.allergens { background: #fff6e8; border: 1px solid #f0dcb8; border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin-top: 10px; }
.allergens strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #7a5208; }
.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.line .opts { color: var(--muted); font-size: 0.85rem; grid-column: 1 / -1; }
.total { display: flex; justify-content: space-between; font-weight: 900; font-size: 1.2rem; padding: 12px 4px; }
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px 16px 90px; }
.foot a { color: inherit; }

/* ---------- the order page (customer) ---------- */
.order-state { text-align: center; padding: 24px 16px; }
.order-state .big { font-weight: 900; font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1.1; }
.order-state .num { display: inline-block; margin-top: 10px; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 22px; font-weight: 900; font-size: 2.6rem; letter-spacing: 0.04em; }
.order-state .time { font-weight: 900; font-size: 3rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.order-state .ring { width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.order-state.ready { background: #dcefe0; border-radius: var(--radius); }
.order-state.bad { background: #f6d9d3; border-radius: var(--radius); }

/* ---------- the staff console ---------- */
body.staff { background: #15110e; color: #f7f1e6; }
.staff .top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 16px; background: #221b15; border-bottom: 1px solid #3a2f26; position: sticky; top: 0; z-index: 5; }
.staff .top h1 { font-size: 1.1rem; font-weight: 900; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: #3a2f26; }
.conn .dot { width: 10px; height: 10px; border-radius: 50%; background: #999; }
.conn.ok .dot { background: #4fcf6d; }
.conn.bad .dot { background: #ff6b57; animation: pulse 1s infinite; }
.conn.warn .dot { background: #f2b544; animation: pulse 1s infinite; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; padding: 14px 16px 120px; }
.col h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: #b9ab98; margin-bottom: 8px; display: flex; justify-content: space-between; }
.ocard { background: #26201a; border: 2px solid #3a2f26; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.ocard.new { border-color: #ff8a3d; animation: flash 1s infinite; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0); } 50% { box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.35); } }
.ocard .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ocard .num { font-weight: 900; font-size: 2rem; }
.ocard .who { font-weight: 800; }
.ocard .lines { margin: 10px 0; gap: 6px; }
.ocard .line { background: #15110e; border-color: #3a2f26; }
.ocard .line .opts { color: #b9ab98; }
.ocard .allergy { color: #ffb48a; font-weight: 800; font-size: 0.85rem; }
.ocard .meta { color: #b9ab98; font-size: 0.85rem; }
.ocard .actions { display: grid; gap: 8px; margin-top: 10px; }
.ocard .countdown { font-weight: 900; font-size: 1.6rem; color: #ff8a3d; font-variant-numeric: tabular-nums; }
.staff .btn-ghost { color: #f7f1e6; border-color: #4a3d31; }
.bigstate { padding: 16px; }
.sold { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 0 16px 100px; }
.sold button { border: 2px solid #3a2f26; background: #26201a; color: inherit; border-radius: 12px; padding: 10px; font-weight: 800; text-align: left; }
.sold button.out { background: #5a2a1e; border-color: #ff6b57; text-decoration: line-through; }
.staff .sheet { background: #26201a; color: inherit; }
.staff .choice { background: #15110e; border-color: #3a2f26; }
.staff .input { background: #15110e; border-color: #3a2f26; color: inherit; }
.staff .card { background: #221b15; border-color: #3a2f26; }

/* ---------- admin ---------- */
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 0; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 800; padding: 8px 14px; border-radius: 999px; border: 2px solid transparent; }
.nav a.active { background: var(--ink); color: #fff; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.menu-admin .item { grid-template-columns: 56px 1fr auto; cursor: pointer; }
.menu-admin .item .pic { width: 56px; height: 56px; }
.menu-admin .item .pic svg, .menu-admin .item .pic img { width: 52px; height: 52px; }
.allergen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.allergen-grid .check { font-size: 0.9rem; padding: 3px 0; }
.allergen-grid .check input { width: 18px; height: 18px; }
.drawing-preview { width: 140px; height: 140px; background: #fff; border-radius: 16px; display: grid; place-items: center; }
.drawing-preview svg { width: 130px; height: 130px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; font-weight: 700; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.qr-box { background: #fff; border-radius: 12px; padding: 10px; display: inline-block; }
.qr-box svg { width: 180px; height: 180px; display: block; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 900; letter-spacing: 0.2em; }
.hours-grid { display: grid; grid-template-columns: 60px 1fr 1fr auto; gap: 6px 10px; align-items: center; }
.hours-grid .input { min-height: 40px; padding: 6px 10px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-weight: 900; font-size: 1.6rem; }
.stat .k { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
pre.json { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 0.8rem; overflow: auto; }
.linkbox { word-break: break-all; background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; font-size: 0.9rem; }

/* ---------- landing ---------- */
.hero { padding: 64px 16px 32px; text-align: center; }
.hero h1 { font-weight: 900; font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: -0.02em; line-height: 1; }
.hero p { color: var(--muted); font-size: 1.15rem; margin-top: 14px; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 28px; text-align: left; }
.steps3 .card b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.logo { font-weight: 900; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.logo b { color: var(--accent); }

@media (min-width: 720px) {
  .van-head .wrap { padding: 24px 16px; }
}
@media print {
  .no-print { display: none !important; }
}
.ocard .actions .row { gap: 8px; }
.ocard .actions .btn-main { padding: 9px 15px; }
