/* 天津夠不理包子 Restaurant OS design system.
   Terracotta on slate. One accent, one radius system:
   controls 10px, panels 14px, badges and pills fully round. */
:root {
  --bg: #eef0ef;
  --surface: #fbfbfa;
  --surface-2: #e6e9e8;
  --surface-3: #dadfdd;
  --ink: #1b2226;
  --ink-2: #414b51;
  --muted: #667077;
  --line: #d3d8da;
  --accent: #b3402a;
  --accent-hover: #9d3522;
  --accent-ink: #fff7f4;
  --accent-soft: #f4e1db;
  --ok: #2f6b53;
  --ok-soft: #dcebe4;
  --warn: #a8700f;
  --warn-soft: #f5e8cc;
  --info: #3b6078;
  --info-soft: #dce7ee;
  --danger: #a3302a;
  --shadow: 0 1px 2px rgb(27 34 38 / 6%), 0 6px 20px rgb(27 34 38 / 7%);
  --r-ctl: 10px;
  --r-panel: 14px;
  --font: "Geist", "Noto Sans TC", system-ui, -apple-system, "PingFang TC", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111416; --surface: #181c1f; --surface-2: #20262a; --surface-3: #2a3136;
    --ink: #e7ebed; --ink-2: #b6bfc4; --muted: #8b959b; --line: #2c3338;
    --accent: #de6a4f; --accent-hover: #e87e65; --accent-ink: #1b0e0a; --accent-soft: #3a2119;
    --ok: #6fbf9b; --ok-soft: #1c3129; --warn: #e0ae52; --warn-soft: #3a2e16; --info: #86b1cc; --info-soft: #1d2d38; --danger: #f08a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111416; --surface: #181c1f; --surface-2: #20262a; --surface-3: #2a3136;
  --ink: #e7ebed; --ink-2: #b6bfc4; --muted: #8b959b; --line: #2c3338;
  --accent: #de6a4f; --accent-hover: #e87e65; --accent-ink: #1b0e0a; --accent-soft: #3a2119;
  --ok: #6fbf9b; --ok-soft: #1c3129; --warn: #e0ae52; --warn-soft: #3a2e16; --info: #86b1cc; --info-soft: #1d2d38; --danger: #f08a80;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[x-cloak] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Brand mark: the character 包 set in a square seal. Type, not artwork. */
.seal {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  background: var(--accent); color: var(--accent-ink); border-radius: 8px;
  font-weight: 800; font-size: 20px; line-height: 1; font-family: "Noto Sans TC", var(--font);
}
.seal.lg { width: 56px; height: 56px; font-size: 32px; border-radius: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { min-height: 56px; padding: 0 22px; font-size: 17px; }
.btn.block { width: 100%; }
.btn i { font-size: 1.15em; }
.icon-btn { width: 44px; padding: 0; }
.btn:focus-visible, .chip:focus-visible, .tile:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.input::placeholder { color: var(--muted); }
textarea.input { min-height: 80px; resize: vertical; }
.help { font-size: 12px; color: var(--muted); }
.error { font-size: 13px; color: var(--danger); }

/* Chips and badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.solid { background: var(--accent); color: var(--accent-ink); }
.tier { font-weight: 700; }
.tier-member { background: var(--surface-2); color: var(--ink-2); }
.tier-platinum { background: #e2e6ea; color: #3f4a53; }
.tier-diamond { background: var(--info-soft); color: var(--info); }
.tier-crown { background: var(--warn-soft); color: var(--warn); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.seg button { white-space: nowrap; border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: 999px; font-weight: 650; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.pad { padding: 16px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Sheet: modal dialog that rises from the bottom on phones, centres on larger screens. */
.scrim { position: fixed; inset: 0; background: rgb(17 20 22 / 45%); z-index: 40; display: grid; place-items: center; padding: 16px; }
.sheet {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.sheet > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet > header h3 { flex: 1; font-size: 18px; }
.sheet > .body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.sheet > footer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
@media (max-width: 640px) {
  .scrim.phone { align-items: end; padding: 0; }
  .scrim.phone .sheet { width: 100%; border-radius: var(--r-panel) var(--r-panel) 0 0; max-height: 92dvh; }
}

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: rise .25s cubic-bezier(.16,1,.3,1); }
.toast.bad { background: var(--danger); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Menu tile: typeset placeholder under an optional photo. */
.food {
  position: relative; overflow: hidden; display: grid; place-items: center;
  background: hsl(var(--h, 20) 38% 86%); color: hsl(var(--h, 20) 45% 26%);
  font-family: "Noto Sans TC", var(--font); font-weight: 800; letter-spacing: 0.02em;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .food { background: hsl(var(--h, 20) 22% 22%); color: hsl(var(--h, 30) 45% 78%); } }
:root[data-theme="dark"] .food { background: hsl(var(--h, 20) 22% 22%); color: hsl(var(--h, 30) 45% 78%); }
.food > span { font-size: var(--fs, 28px); line-height: 1.1; text-align: center; padding: 0 8%; }
.food > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Tables (data) */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
