:root {
  --bg: #14110f;
  --surface: #1f1a17;
  --surface-2: #2a2320;
  --line: #3a312c;
  --text: #f3ece4;
  --muted: #a9998c;
  --accent: #c8102e;
  --accent-soft: #e8b04b;
  --ok: #4caf7d;
  --radius: 12px;
  --maxw: 640px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  padding-bottom: 96px;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.app-header .wrap { display: flex; align-items: baseline; gap: 10px; height: 52px; }
.brand { font-weight: 800; letter-spacing: 2px; }
.brand-sub { color: var(--muted); font-size: 13px; letter-spacing: 1px; }

.stepbar {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px;
  max-width: var(--maxw); margin: 0 auto; scrollbar-width: none;
}
.stepbar::-webkit-scrollbar { display: none; }
.stepbar b {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap;
}
.stepbar b.active { color: var(--bg); background: var(--accent-soft); }
.stepbar b.done { color: var(--ok); }

main.wrap { padding-top: 8px; padding-bottom: 24px; }

h2.step-title { font-size: 20px; margin: 6px 0 4px; }
p.step-hint { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; }
textarea { min-height: 76px; resize: vertical; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card.selectable { cursor: pointer; }
.card.selected { border-color: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.card h3 { font-size: 16px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card .price { color: var(--accent-soft); font-weight: 700; white-space: nowrap; }
.card .desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.card ul { margin: 8px 0 0 18px; color: var(--muted); font-size: 13px; }

.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.opt.selected { border-color: var(--accent-soft); background: var(--surface-2); }
.opt input { accent-color: var(--accent-soft); width: 18px; height: 18px; flex: 0 0 auto; }
.opt .opt-label { flex: 1; }
.opt .opt-price { color: var(--accent-soft); font-size: 13px; white-space: nowrap; }
.opt-list.sub { margin: 4px 0 4px 22px; gap: 6px; }
.opt-list.sub .opt { padding: 9px 12px; background: var(--surface-2); }

.person-card { border-left: 3px solid var(--accent-soft); }
.person-card > h3 { margin-bottom: 10px; }

.group-title {
  font-size: 13px; color: var(--muted); margin: 18px 0 8px; letter-spacing: 1px;
  border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--accent-soft); }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1;
}
.stepper span { min-width: 20px; text-align: center; }

.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-row .it-name { flex: 1; }
.item-row .it-name .pop { color: var(--accent-soft); font-size: 12px; }
.item-row .it-price { color: var(--muted); font-size: 13px; white-space: nowrap; }

details.cat { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
details.cat > summary { padding: 12px 14px; font-weight: 600; cursor: pointer; list-style: none; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary .count { color: var(--accent-soft); font-size: 13px; margin-left: 6px; }
details.cat > div { padding: 0 14px 10px; }

.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.summary-line .amt { white-space: nowrap; }
.summary-line small { color: var(--muted); }
.totals { margin-top: 12px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 800; color: var(--accent-soft); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }

.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
}
.navbar .wrap { display: flex; gap: 10px; padding: 0; }
button.btn {
  flex: 1; padding: 14px; border-radius: 10px; border: 0; font: inherit; font-weight: 700;
  background: var(--accent); color: #fff;
}
button.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); flex: 0 0 96px; }
button.btn:disabled { opacity: .45; }

.err { color: #ff8a8a; font-size: 13px; margin-top: 8px; }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.done-box { text-align: center; padding: 40px 12px; }
.done-box .big { font-size: 40px; }
.done-box .oid { font-size: 15px; color: var(--muted); margin-top: 8px; }
.done-box .total { font-size: 30px; font-weight: 800; color: var(--accent-soft); margin: 14px 0; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
