:root {
  --bg: #f9f6f4;
  --card: rgba(255, 253, 250, .95);
  --ink: #5d4a40;
  --muted: #8e7b70;
  --accent: #b99b81;
  --accent-dark: #8f715d;
  --line: #e7dbd2;
  --danger: #a95e5e;
  --shadow: 0 14px 36px rgba(96, 71, 54, .09);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(231, 219, 210, .55), transparent 32%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100%, 600px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom));
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(116, 88, 67, .12);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .14em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
h2 { margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
h3 { margin-bottom: 8px; font-size: 15px; }

.progress-wrap { margin: 10px 2px 20px; }
.progress-bar { height: 3px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-bar span { display: block; width: 16.66%; height: 100%; background: var(--accent); transition: width .25s ease; }
.progress-wrap p { margin: 7px 0 0; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-align: right; }

.panel {
  border: 1px solid rgba(231, 219, 210, .9);
  border-radius: 24px;
  padding: 22px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.lead { color: var(--muted); font-size: 14px; }
.flow-list { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.flow-list li { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: baseline; }
.flow-list strong { color: var(--accent-dark); font-family: Georgia, "Times New Roman", serif; font-size: 11px; letter-spacing: .08em; }
.flow-list span { font-size: 13px; }

.form-grid { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
  background: #fffdfb;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 155, 129, .12);
}

.choice-grid { display: grid; gap: 11px; }
.choice-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: #fffdfb;
}
.choice-card.active { border-color: var(--accent); background: #fbf4ee; box-shadow: 0 0 0 2px rgba(185, 155, 129, .12); }
.choice-card strong, .choice-card span { display: block; }
.choice-card span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.item-card, .summary-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px;
  background: #fffdfb;
}

.item-head, .summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.item-meta { color: var(--muted); font-size: 12px; }
.price { color: var(--accent-dark); font-weight: 800; white-space: nowrap; }
.text-btn { border: 0; padding: 2px; color: var(--danger); background: transparent; font-size: 12px; }

.inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hidden { display: none !important; }
.empty { padding: 24px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.error-box { border: 1px solid #e7c9c9; border-radius: 14px; padding: 12px; color: var(--danger); background: #fff8f8; font-size: 12px; }
.notice { border-radius: 14px; padding: 12px; color: var(--muted); background: #f5efea; font-size: 12px; }

.totals { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary-row.total { font-size: 17px; font-weight: 800; }

.action-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(90px, .45fr) 1fr;
  gap: 10px;
  width: min(100%, 600px);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(231, 219, 210, .85);
  background: rgba(249, 246, 244, .94);
  backdrop-filter: blur(14px);
}

.primary-btn, .secondary-btn {
  min-height: 48px;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 750;
}
.primary-btn { border: 1px solid var(--accent-dark); color: white; background: var(--accent-dark); }
.secondary-btn { border: 1px solid var(--line); color: var(--ink); background: #fffdfb; }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }

.complete { text-align: center; }
.complete-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; color: white; background: var(--accent); font-size: 26px; }
.order-number { margin: 18px 0; border-radius: 16px; padding: 14px; background: #f5efea; font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: .04em; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100% - 36px);
  transform: translate(-50%, 14px);
  border-radius: 999px;
  padding: 10px 15px;
  opacity: 0;
  color: white;
  background: rgba(83, 65, 55, .92);
  pointer-events: none;
  transition: .2s ease;
  font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .inline-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 15px; }
}
