/* 有 display 規則的元素（如 label.package-use）會蓋掉 hidden 屬性，統一強制隱藏 */
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --bg: #f8efe4;
  --surface: #fffaf4;
  --surface-soft: #f0e3d4;
  --ink: #4a3427;
  --muted: #887160;
  --line: #e5d3bf;
  --brand: #9a6a3e;
  --brand-dark: #684328;
  --brand-soft: #ead7c0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
.booking-shell { width: min(100%, 520px); min-height: 100dvh; margin: auto; padding: max(20px, env(safe-area-inset-top)) 20px calc(36px + env(safe-area-inset-bottom)); }
header { display: flex; justify-content: space-between; align-items: center; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.test-badge { padding: 5px 9px; color: var(--brand-dark); border-radius: 99px; background: var(--brand-soft); font-size: 11px; font-weight: 800; }
.hero { padding: 42px 0 25px; }
.hero p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.hero h1 { margin: 0 0 8px; font-size: 42px; letter-spacing: -.05em; }
.hero span { color: var(--muted); font-size: 14px; }
.login-card, .card, .success-card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.login-card { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding: 16px; }
.profile-placeholder { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; overflow: hidden; color: white; border-radius: 50%; background: var(--brand); font-weight: 800; }
.profile-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.login-card strong, .login-card p { display: block; }
.login-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
form { display: grid; gap: 14px; }
.card { padding: 18px; }
.section-title { display: flex; gap: 9px; align-items: center; margin-bottom: 17px; }
.section-title > span { display: grid; place-items: center; width: 26px; height: 26px; color: white; border-radius: 50%; background: var(--brand); font-size: 12px; font-weight: 800; }
h2 { margin: 0; font-size: 19px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
label.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; padding: 0 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; outline: none; background: white; }
input, select { height: 48px; }
input[type="date"], input[type="time"] { display: block; min-width: 0; width: 100%; appearance: none; -webkit-appearance: none; }
textarea { padding-block: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.privacy-note { margin: 3px 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.submit-button, .success-card button { width: 100%; min-height: 52px; color: white; border: 0; border-radius: 15px; background: var(--brand); font-weight: 800; }
.success-card { padding: 30px 22px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; color: white; border-radius: 50%; background: var(--brand); font-size: 29px; }
.success-card p { color: var(--muted); line-height: 1.6; }
.success-card button { margin-top: 8px; color: var(--brand-dark); background: var(--brand-soft); }
@media (max-width: 430px) {
  .schedule-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
.question-list { display: grid; gap: 22px; }
.question { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.question legend { margin-bottom: 10px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.5; }
.question legend small { margin-left: 8px; padding: 3px 8px; color: var(--muted); border-radius: 99px; background: var(--brand-soft); font-size: 11px; font-weight: 750; }
.required { margin-left: 4px; color: #c0392b; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group.stacked { display: grid; }
label.choice { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: white; font-size: 14px; font-weight: 650; line-height: 1.45; cursor: pointer; }
label.choice input { flex: 0 0 18px; width: 18px; height: 18px; padding: 0; accent-color: var(--brand); }
label.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
label.question > span { color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.5; }
.question.full { grid-column: 1 / -1; }
.booking-summary { margin: 0; padding: 10px 12px; color: var(--brand-dark); border-radius: 12px; background: var(--brand-soft); font-size: 13px; font-weight: 700; line-height: 1.5; }
.booking-summary:empty { display: none; }
.addon-price { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.choice-group.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
label.choice.slot { justify-content: center; padding: 8px 4px; text-align: center; }
label.choice.slot input { position: absolute; opacity: 0; pointer-events: none; }
label.choice.slot.is-taken { color: #b9a898; background: #f1ebe3; text-decoration: line-through; cursor: not-allowed; }
.slot-hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.booking-summary.full { grid-column: 1 / -1; }
.date-box { position: relative; display: flex; align-items: center; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.date-box::after { content: "▾"; margin-left: 10px; color: var(--muted); font-size: 12px; }
.date-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.date-text { flex: 1; color: var(--ink); font-size: 16px; font-weight: 650; text-align: left; pointer-events: none; }
.date-box input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 13px; opacity: 0; box-shadow: none; }

.therapist-slot { display: grid; gap: 8px; margin-bottom: 14px; }
.therapist-slot:last-child { margin-bottom: 0; }
.slot-title { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
label.choice.is-disabled { opacity: 0.4; cursor: not-allowed; }
/* 分店選擇：名稱＋地址／開幕資訊；即將開幕的灰色不可選 */
.branch-options label.choice { align-items: flex-start; }
.branch-options .branch-text { display: grid; gap: 2px; }
.branch-options .branch-meta { color: var(--muted); font-size: 12px; font-weight: 500; }
.branch-options label.choice.is-soon { color: #b9a898; background: #f1ebe3; cursor: not-allowed; }
.branch-options label.choice.is-soon .branch-meta { color: #a08f7f; }

/* 我的包堂 */
.package-card { margin-bottom: 16px; }
.package-list { display: grid; gap: 10px; }
.package-item { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.package-item strong { color: var(--ink); font-size: 14px; }
.package-item span { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.package-item.is-expired { opacity: .6; }
.package-pending { margin: 12px 0 0; padding: 10px 12px; color: var(--brand-dark); border-radius: 12px; background: var(--brand-soft); font-size: 13px; font-weight: 750; line-height: 1.5; }
.package-note { margin: 12px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
label.package-use { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: white; font-size: 14px; font-weight: 650; line-height: 1.5; cursor: pointer; }
label.package-use input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; padding: 0; accent-color: var(--brand); }
label.package-use:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
label.package-use:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* 我的預約 */
.my-card { margin-bottom: 16px; }
.my-item { padding: 14px 0; border-top: 1px solid var(--line); }
.my-item:first-child { border-top: 0; padding-top: 0; }
.my-item strong { display: block; font-size: 16px; }
.my-item .my-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.my-tag { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.my-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.my-actions button, .my-actions a { flex: 1 1 30%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--brand-dark); font-weight: 700; font-size: 14px; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.my-actions button.danger { color: #9a3b2f; }
.my-actions button:disabled { opacity: .5; }
.my-locked { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.my-reschedule { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--brand-soft); }
.my-reschedule input[type="date"] { width: 100%; min-height: 44px; margin-bottom: 10px; }
.my-reschedule .confirm-row { display: flex; gap: 8px; margin-top: 10px; }
.my-reschedule .confirm-row button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; font-weight: 800; }
.my-reschedule .confirm-row .go { background: var(--brand); color: white; }

.my-reschedule .confirm-row button:not(.go) { background: var(--surface); color: var(--brand-dark); border: 1px solid var(--line); }

/* 頁面內提示框（public/dialog.js） */
.ui-dialog-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(74, 52, 39, .45); }
.ui-dialog { width: min(340px, 100%); padding: 22px 20px 16px; border-radius: 18px; background: #fffdf9; color: var(--ink); box-shadow: 0 12px 40px rgba(74, 52, 39, .25); }
.ui-dialog p { margin: 0 0 18px; font-size: 16px; line-height: 1.6; text-align: center; white-space: pre-line; }
.ui-dialog-actions { display: flex; gap: 10px; }
.ui-dialog-actions button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font: inherit; font-weight: 700; }
.ui-dialog-actions button.primary { border-color: var(--brand); background: var(--brand); color: white; }

/* ---- 預約頁版型（後台「店家設定」選擇；經典卡片＝原本的樣子，不加任何規則）---- */
.shop-head { display: flex; align-items: center; gap: 10px; }
.shop-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.shop-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.shop-social-title { flex-basis: 100%; margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.shop-social a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.shop-social a:hover { text-decoration: underline; }

/* 雅緻封面：上方品牌深色橫幅、襯線大標題 */
[data-layout="cover"] .booking-shell { padding-top: 0; }
[data-layout="cover"] header, [data-layout="cover"] .hero { margin: 0 -20px; padding-right: 24px; padding-left: 24px; color: #fff; background: var(--brand-dark); }
[data-layout="cover"] header { padding-top: max(20px, env(safe-area-inset-top)); }
[data-layout="cover"] .eyebrow { color: rgba(255, 255, 255, .82); }
[data-layout="cover"] .test-badge { color: #fff; background: rgba(255, 255, 255, .16); }
[data-layout="cover"] .hero { margin-bottom: 20px; padding-top: 30px; padding-bottom: 34px; border-radius: 0 0 28px 28px; }
[data-layout="cover"] .hero p, [data-layout="cover"] .hero span { color: rgba(255, 255, 255, .85); }
[data-layout="cover"] .hero h1 { font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; font-weight: 900; letter-spacing: 0; }

/* 簡潔線條：白底細線、不加圓角卡片 */
[data-layout="minimal"] body { background: #fff; }
[data-layout="minimal"] header { padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
[data-layout="minimal"] .hero { padding: 26px 0 18px; }
[data-layout="minimal"] .hero h1 { font-size: 32px; letter-spacing: -.02em; }
[data-layout="minimal"] .login-card, [data-layout="minimal"] .card, [data-layout="minimal"] .success-card { border-width: 1px 0; border-radius: 0; background: transparent; }
[data-layout="minimal"] .card { padding: 20px 0; }
[data-layout="minimal"] .login-card { padding: 16px 0; }
[data-layout="minimal"] .section-title > span { border-radius: 6px; }
[data-layout="minimal"] input, [data-layout="minimal"] select, [data-layout="minimal"] textarea { border-radius: 8px; }
[data-layout="minimal"] .submit-button { border-radius: 10px; background: var(--ink); }
