/* 貴賓預約總覽：獨立樣式，不引用 styles.css。色票沿用站台柔和色票（blush／rose／apricot／sage／ink），
 * 圖表色盤用 dataviz 預設色盤（顏色由 gm.js 依人與類別以 --c 指派）。 */
:root {
  --page: #FFF9F4;
  --paper: #FFFAF7;
  --card: #FFFFFF;
  --ink: #413838;
  --ink-strong: #292523;
  --muted: #766B68;
  --line: rgba(65, 56, 56, .12);
  --grid: #e1e0d9;
  --blush: #F5CEC7;
  --rose: #E79796;
  --apricot: #FFC988;
  --peach: #FFB284;
  --sage: #C6C09C;
  --sage-ink: #3F5A42;
  --cta: #99412E;
  --cta-hover: #843625;
  --warn: #fab219;
  --warn-ink: #7a4b00;
  --wash: #F9F6F2;
  --we: #F7F0EB;
  --surface: #FFFFFF;
  --sh: 0 8px 20px rgba(92, 68, 58, .07);
  --sh-hover: 0 10px 26px rgba(92, 68, 58, .14);
  --r-card: 22px;
  --r-in: 13px;
  --gut: clamp(16px, 3vw, 32px);
  --font: "Lato", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-h: "Poppins", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --ease: .18s ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.muted { color: var(--muted); }
.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; }
.ico { flex: none; vertical-align: -3px; }

:focus-visible { outline: 3px solid var(--ink-strong); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .sum-main:focus-visible, .sum-sec:focus-visible, .seg-btn:focus-visible { outline-offset: 3px; }

/* ── 頁首 ── */
.gm-head { background: var(--card); border-bottom: 1px solid var(--line); }
.gm-head-in { max-width: 1160px; margin: 0 auto; padding: 14px var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.gm-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.gm-logo { height: 30px; width: auto; flex: none; }
.gm-title { padding-left: 14px; border-left: 1px solid var(--line); min-width: 0; }
.gm-title h1 { font-family: var(--font-h); font-size: clamp(1.1rem, 2.4vw, 1.35rem); line-height: 1.25; color: var(--ink-strong); }
.gm-meta { font-size: 12.5px; color: var(--muted); min-height: 1.2em; }
.gm-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gm-howto { max-width: 1160px; margin: 0 auto; padding: 0 var(--gut) 18px; }

.gm-main { max-width: 1160px; margin: 0 auto; padding: 0 var(--gut) 64px; }
.gm-hint { margin-top: 16px; padding: 12px 16px; background: var(--apricot); border-radius: var(--r-in); font-size: 14.5px; color: var(--ink-strong); }
.state { padding-top: 20px; }
#state-dashboard { padding-top: 0; }

/* ── 按鈕 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 15px; transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease), border-color var(--ease); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--cta-hover); }
.btn-ghost { border-color: rgba(65, 56, 56, .28); background: var(--card); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--wash); }
.btn-sm { padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 32px; font-size: 17px; }
.btn-link { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--cta); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-size: 14px; }

/* ── 面板與狀態畫面 ── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh); padding: clamp(20px, 3vw, 32px); }
.panel-narrow { max-width: 560px; margin: 32px auto 0; }
.panel h2 { font-family: var(--font-h); font-size: 1.3rem; color: var(--ink-strong); margin-bottom: 10px; line-height: 1.35; }
.panel-text { color: var(--ink); margin-bottom: 18px; }
.panel-error { background: #FBE9E5; color: #8a2f1f; border-radius: var(--r-in); padding: 10px 14px; margin-bottom: 16px; font-size: 14.5px; }
.panel-action { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-in); padding: 12px 16px; margin-bottom: 18px; }
.panel-notice { max-width: 640px; margin: 32px auto 0; border-left: 6px solid var(--warn); }
.notice-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; background: #FFF1C9; color: var(--warn-ink); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }

.skel { background: linear-gradient(0deg, var(--blush), var(--blush)); opacity: .35; border-radius: var(--r-card); margin-bottom: 16px; }
.skel-sum { height: 72px; border-radius: 0; margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); margin-top: -20px; }
.skel-card { height: 220px; }

/* ── 選擇面板 ── */
.sel-block { margin-top: 26px; }
.sel-block h3 { font-size: 1.05rem; color: var(--ink-strong); }
.sel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sel-tools { display: flex; align-items: center; gap: 8px; }
.pick-count { font-size: 13.5px; color: var(--muted); margin-right: 6px; }
.pick-list { display: grid; gap: 10px; }
.pick-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.pick-row:hover { background: var(--wash); }
.pick-row:has(input:checked) { background: #FFF3EA; border-color: var(--peach); }
.pick-row input { width: 24px; height: 24px; accent-color: var(--cta); flex: none; }
.pick-main { display: grid; gap: 0; min-width: 0; flex: 1; }
.pick-sal { font-size: 1.15rem; font-weight: 700; color: var(--ink-strong); }
.pick-sub { font-size: 13px; color: var(--muted); }
.pick-note { font-size: 13px; background: var(--wash); border-radius: 999px; padding: 2px 12px; color: var(--muted); }
.extra-box { margin-top: 18px; }
.extra-box h4 { font-size: .95rem; margin-bottom: 8px; color: var(--ink); }
.extra-row { display: flex; gap: 10px; }
.field { min-height: 44px; padding: 0 14px; border: 1px solid rgba(65, 56, 56, .28); border-radius: var(--r-in); background: var(--card); font-size: 15px; }
.extra-row .field { flex: 1; min-width: 0; }
.field:disabled { background: var(--wash); color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding-left: 16px; background: var(--blush); border-radius: 999px; font-size: 14.5px; font-weight: 700; color: var(--ink-strong); }
.tag-x { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; }
.tag-x:hover { background: rgba(65, 56, 56, .1); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.seg-btn { min-height: 44px; padding: 0 20px; border: 1px solid rgba(65, 56, 56, .28); border-radius: 999px; background: var(--card); font-weight: 700; font-size: 15px; transition: background var(--ease), transform var(--ease); }
.seg-btn:active { transform: scale(.98); }
.seg-btn.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.date-row { display: flex; gap: 14px; flex-wrap: wrap; }
.date-lab { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.range-text { margin-top: 10px; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.form-msg { margin-top: 14px; min-height: 1.4em; font-size: 14.5px; color: var(--muted); }
.form-msg.is-warn { color: #8a2f1f; font-weight: 700; }
.sel-foot { margin-top: 16px; display: flex; justify-content: flex-end; }

/* ── 抓取進度 ── */
.prog-bar { height: 12px; background: var(--blush); border-radius: 999px; overflow: hidden; margin: 8px 0 22px; }
.prog-fill { height: 100%; background: var(--cta); border-radius: 999px; transform-origin: left center; transition: transform .3s ease-out; }
.prog-list { display: grid; gap: 4px; margin-bottom: 22px; }
.prog-item { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--muted); }
.prog-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(65, 56, 56, .25); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.prog-item.is-done { color: var(--sage-ink); }
.prog-item.is-done .prog-mark { background: var(--sage-ink); border-color: var(--sage-ink); color: #fff; }
.prog-item.is-now { color: var(--ink-strong); font-weight: 700; }
.prog-item.is-now .prog-mark { border-color: var(--cta); color: var(--cta); }

/* ── 釘頂摘要 ── */
.sum { position: sticky; top: 0; z-index: 30; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); background: rgba(255, 249, 244, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.sum-in { height: 71px; display: flex; align-items: center; gap: 12px; }
.sum-main { height: 56px; display: inline-flex; align-items: baseline; gap: 8px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--cta); color: #fff; transition: transform var(--ease), background var(--ease), box-shadow var(--ease); }
.sum-main { align-items: center; }
.sum-main:hover { background: var(--cta-hover); }
.sum-main:active { transform: scale(.98); }
.sum-main.is-zero { background: var(--sage-ink); }
.sum-lbl { font-size: 15px; font-weight: 700; }
.sum-num { font-family: var(--font-h); font-size: 36px; font-weight: 700; line-height: 1; min-width: .6em; text-align: center; }
.sum-unit { font-size: 15px; font-weight: 700; }
.sum-sec { min-height: 44px; display: inline-flex; align-items: baseline; gap: 6px; padding: 0 16px; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); transition: transform var(--ease), background var(--ease); }
button.sum-sec:hover { background: var(--wash); }
button.sum-sec:active { transform: scale(.98); }
.sum-static { cursor: default; }
.sum-lbl2, .sum-unit2 { font-size: 13px; color: var(--muted); }
.sum-num2 { font-size: 20px; font-weight: 700; font-family: var(--font-h); color: var(--ink-strong); }

/* ── 貴賓卡片 ── */
.guests { padding-top: 20px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh); padding: 20px 24px 22px; margin-bottom: 18px; scroll-margin-top: 92px; transition: transform var(--ease), box-shadow var(--ease); }
.card:focus-visible { outline-offset: 4px; border-radius: var(--r-card); }
.card.st-resend { border-left-color: var(--cta); }
.card.st-never { border-left-color: var(--peach); }
.card.st-sent { border-left-color: var(--sage); }
.card.st-nothing { border-left-color: var(--line); background: var(--paper); box-shadow: none; padding-top: 16px; padding-bottom: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.card-sal { font-family: var(--font-h); font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.2; color: var(--ink-strong); }
.card-small { font-size: 13px; color: var(--muted); }
.people { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.person-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); }
.badge-slot { flex: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: 999px; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.b-resend { background: var(--cta); color: #fff; box-shadow: 0 0 0 3px rgba(153, 65, 46, .18); }
.b-never { background: var(--apricot); color: var(--ink-strong); }
.b-sent { background: #E4E8D0; color: var(--sage-ink); }
.b-nothing { background: #ECE8E4; color: var(--muted); font-weight: 400; }
.badge.pop { animation: gm-fade .4s ease-out; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14.5px; margin-bottom: 8px; }
.card-meta strong { color: var(--ink-strong); }
.card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 8px 26px; }
.card-body.no-msg { grid-template-columns: minmax(0, 1fr); }
.card-info { min-width: 0; display: grid; align-content: start; gap: 12px; }
.card-msg { min-width: 0; }

/* 到館節奏小條 */
.rhythm-wrap { margin: 0 -4px; }
.rhythm { position: relative; height: 44px; border-radius: 12px; touch-action: pan-y; }
.rhythm::before { content: ""; position: absolute; left: 8px; right: 8px; top: 18px; height: 1px; background: var(--grid); }
.r-dot { position: absolute; left: calc(8px + (100% - 16px) * var(--x)); top: calc(19px + var(--dy, 0px)); width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.shp-0 { border-radius: 50%; }
.shp-1 { border-radius: 3px; }
.shp-2 { border-radius: 2px; transform: rotate(45deg) scale(.82); }
.r-dot.is-past { opacity: .35; }
.r-dot.has-change { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink-strong); }
.r-today { position: absolute; left: calc(8px + (100% - 16px) * var(--x)); top: 4px; bottom: 14px; width: 0; border-left: 1px dashed var(--muted); }
.r-today-lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.r-end { position: absolute; bottom: 0; font-size: 11px; color: var(--muted); }
.r-start { left: 2px; }
.r-stop { right: 2px; }
.shape { display: inline-block; width: 10px; height: 10px; background: var(--c); flex: none; }
.shape.shp-2 { transform: rotate(45deg) scale(.8); }

/* 異動與品質提醒 */
.changes, .flags { display: grid; gap: 6px; }
.change, .flag { position: relative; isolation: isolate; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; padding: 6px 10px; border-radius: 10px; }
.change { background: var(--paper); border: 1px solid var(--line); }
.flash::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--apricot); pointer-events: none; animation: gm-flash 1.2s ease-out .5s both; }
.chg-tag, .flag-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; line-height: 1.6; }
.k-added .chg-tag, .chg-tag.k-added { background: #DDE6D2; color: var(--sage-ink); }
.k-changed .chg-tag, .chg-tag.k-changed { background: #FFE3BD; color: #7a4b00; }
.k-removed .chg-tag { background: #F6D9D4; color: #8a2f1f; }
.chg-who { display: inline-flex; align-items: center; gap: 5px; flex: none; font-weight: 700; }
.chg-text { min-width: 0; overflow-wrap: anywhere; }
.k-removed .chg-text { text-decoration: line-through; text-decoration-color: rgba(138, 47, 31, .45); }
.f-warn { background: #FFF4D6; border: 1px solid #F3D78A; border-left: 5px solid var(--warn); }
.f-warn .flag-tag { background: var(--warn); color: var(--ink-strong); }
.f-info { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.f-info .flag-tag { background: #ECE8E4; color: var(--muted); }
.flag-text { min-width: 0; overflow-wrap: anywhere; }

/* 訊息與複製 */
.msg-box { display: grid; gap: 8px; }
.msg-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.msg { white-space: pre-wrap; background: var(--wash); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; user-select: text; }
.msg.is-clamped { max-height: calc(8 * 1.65em + 30px); overflow: hidden; }
.msg-box .btn-link { justify-self: start; min-height: 44px; margin: -4px 0 -4px -10px; }
.btn-copy { width: 100%; min-height: 52px; font-size: 17px; background: var(--cta); color: #fff; border-radius: 999px; }
.btn-copy:hover { background: var(--cta-hover); }
.btn-copy.is-done { background: var(--sage-ink); }
.copy-note { min-height: 0; font-size: 13.5px; color: var(--sage-ink); }
.copy-note.is-warn { color: #8a2f1f; font-weight: 700; margin-top: 2px; }
.copy-ta { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ── 圖表區 ── */
.viz { margin-top: 36px; }
.sec-h { font-family: var(--font-h); font-size: 1.25rem; color: var(--ink-strong); margin-bottom: 14px; }
.viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.viz-col { display: grid; gap: 18px; min-width: 0; }
.viz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px 22px; box-shadow: var(--sh); min-width: 0; }
.viz-h { font-size: 1.05rem; color: var(--ink-strong); }
.viz-count { font-size: .9rem; color: var(--muted); font-weight: 400; }
.viz-sub { font-size: 13px; color: var(--muted); margin: 2px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 12px; font-size: 13px; color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: var(--fg); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.lg-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }

/* 月曆 */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; }
.cal-wd.is-we { color: var(--rose); }
.cal-cell { position: relative; min-height: 62px; min-width: 0; padding: 5px 4px 4px; border-radius: 10px; border: 1px solid transparent; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 3px; transition: transform var(--ease), box-shadow var(--ease), background var(--ease); }
.cal-cell.is-we { background: var(--we); }
.cal-cell.is-out { background: transparent; }
.cal-cell.is-out .cal-num { opacity: .35; }
.cal-cell.is-past:not(.is-sel) { opacity: .55; }
.cal-cell.is-today { outline: 2px solid var(--ink-strong); outline-offset: -2px; }
button.cal-cell { cursor: pointer; border-color: var(--line); }
button.cal-cell:hover { background: #FFF3EA; }
button.cal-cell.is-sel { background: var(--blush); border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.cal-num { font-size: 12px; color: var(--muted); line-height: 1; }
.cal-cell.is-today .cal-num { color: var(--ink-strong); font-weight: 700; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px 5px; align-items: center; }
.cal-dot { display: inline-flex; align-items: center; gap: 1px; }
.cal-dot-c { width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: var(--fg); font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); line-height: 1; }
.cal-cnt { font-size: 10.5px; font-weight: 700; color: var(--ink); }
.cal-filter { margin-top: 10px; font-size: 13px; min-height: 0; display: flex; flex-wrap: wrap; align-items: center; }
.cal-filter .btn-link { padding: 0 8px; }

/* 課程組成 */
.cat-rows { display: grid; gap: 14px; }
.cat-row { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) 3.4em; align-items: center; gap: 10px; }
.cat-name { font-size: 14px; font-weight: 700; color: var(--ink-strong); overflow-wrap: anywhere; }
.cat-total { font-size: 13px; color: var(--muted); text-align: right; }
.stack-wrap { min-width: 0; }
.stack { height: 22px; display: flex; gap: 2px; border-radius: 0 4px 4px 0; overflow: hidden; }
.seg-fill { background: var(--c); color: var(--fg); min-width: 4px; display: grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; }
.seg-fill.is-unfilled { color: var(--ink-strong); }
.seg-fill:focus-visible { outline-offset: -3px; }
.seg-fill.is-unfilled, .lg-sw.is-unfilled { background: repeating-linear-gradient(45deg, #d9d4cf 0 4px, #bdb6b0 4px 8px); }

/* 技術人員 */
.tech-rows { display: grid; gap: 10px; }
.tech-row { display: grid; grid-template-columns: 5.4em minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tech-name { font-size: 14px; font-weight: 700; color: var(--ink-strong); display: inline-flex; align-items: center; gap: 4px; }
.tech-row.is-un .tech-name { color: var(--warn-ink); }
.tech-track { min-width: 0; height: 18px; }
.tech-fill { height: 100%; display: flex; background: #2a78d6; border-radius: 0 4px 4px 0; overflow: hidden; min-width: 6px; transform-origin: left center; }
.tech-fill.is-un { background: var(--warn); }
.tech-des { display: block; height: 100%; background: #184f95; border-right: 2px solid var(--surface); }
.tech-val { display: inline-flex; align-items: baseline; gap: 8px; min-width: 5.2em; font-size: 14px; }
.tech-d { font-size: 12px; color: var(--muted); }

/* 資料品質 */
.q-list { display: grid; gap: 8px; }
.q-row { display: grid; grid-template-columns: auto 3.2em auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.q-date { font-weight: 700; }
.q-who { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; }
.q-msg { min-width: 0; overflow-wrap: anywhere; }

/* ── 預約明細 ── */
.detail { margin-top: 40px; }
.detail-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-top .sec-h { margin-bottom: 0; }
.detail, .viz, #guest-area { scroll-margin-top: 88px; }
#detail-h { scroll-margin-top: 96px; }
.filters { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.f-lab { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.f-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14.5px; cursor: pointer; }
.f-switch input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; cursor: pointer; }
.sw-track { width: 44px; height: 26px; border-radius: 999px; background: #CFC8C3; position: relative; transition: background var(--ease); flex: none; }
.sw-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--ease); }
.f-switch input:checked + .sw-track { background: var(--sage-ink); }
.f-switch input:checked + .sw-track::after { transform: translateX(18px); }
.f-switch input:focus-visible + .sw-track { outline: 3px solid var(--ink-strong); outline-offset: 2px; }
.f-count { font-size: 13px; color: var(--muted); }
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 12px 14px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; position: relative; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-past td { color: var(--muted); }
.flash-row td::after { content: ""; position: absolute; inset: 0; background: var(--apricot); pointer-events: none; animation: gm-flash 1.2s ease-out .5s both; }
.row-change td:first-child { box-shadow: inset 4px 0 0 var(--peach); }
.who { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.des-tag { display: inline-block; margin-left: 6px; padding: 0 7px; font-size: 11.5px; font-weight: 700; line-height: 1.7; border-radius: 6px; background: #DCE6F7; color: #184f95; }
.des-tag.dine { background: #F1E8DE; color: #6b4f2a; }
.tech-un { display: inline-flex; align-items: center; gap: 4px; color: var(--warn-ink); font-weight: 700; }
.st { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.st-ok { color: var(--sage-ink); }
.st-wait { color: var(--ink); }
.empty-rows { padding: 28px 20px; text-align: center; }

.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.foot-warn { color: #8a2f1f; }

/* ── 耳語框 tooltip ── */
.whisper { position: fixed; z-index: 60; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.5; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 18px rgba(41, 37, 35, .25); }

/* ── 動畫（只動 transform 與 opacity） ── */
@keyframes gm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gm-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gm-flash { from { opacity: .85; } to { opacity: 0; } }
.enter .card { animation: gm-in .35s ease-out calc(var(--i, 0) * 40ms) backwards; }
.enter .stack, .enter .tech-fill { animation: gm-grow .5s ease-out backwards; }
.enter .cal-dots { animation: gm-fade .1s ease-out var(--d, 0ms) backwards; }

@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); }
  .card.st-nothing:hover { box-shadow: var(--sh); }
}
.btn:active:not(:disabled), button.sum-sec:active { transform: scale(.98); }

/* ── 窄螢幕：720px ── */
@media (max-width: 720px) {
  .gm-head-in { padding-top: 12px; padding-bottom: 12px; }
  .gm-logo { height: 24px; }
  .gm-title { padding-left: 10px; }
  .gm-head-actions { width: 100%; }
  .gm-head-actions .btn { flex: 1; }

  .sum-in { height: 55px; gap: 8px; }
  .sum-main { height: 44px; padding: 0 14px; gap: 5px; }
  .sum-num { font-size: 26px; }
  .sum-lbl, .sum-unit { font-size: 14px; }
  .sum-sec { padding: 0 11px; gap: 4px; }
  .sum-lbl2, .sum-unit2 { font-size: 12px; }
  .sum-num2 { font-size: 16px; }
  .card { scroll-margin-top: 72px; padding: 16px 16px 18px; }
  .card-body { grid-template-columns: minmax(0, 1fr); }
  .viz-grid { grid-template-columns: minmax(0, 1fr); }
  .viz-card { padding: 16px 14px 18px; }
  .cal-cell { min-height: 56px; padding: 4px 2px 3px; }
  .cal-dot-c { width: 18px; height: 18px; font-size: 10px; }
  .cat-row { grid-template-columns: 4.6em minmax(0, 1fr) 3em; gap: 8px; }
  .tech-row { grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 8px; }
  .q-row { grid-template-columns: auto 1fr; }
  .q-msg { grid-column: 1 / -1; }
  .filters { width: 100%; }
  .sel-foot .btn { width: 100%; }

  .tbl-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--sh); position: relative; overflow: hidden; }
  .tbl td { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; border: 0; }
  .tbl td::before { content: attr(data-label); flex: 0 0 5.4em; font-size: 12px; color: var(--muted); }
  .tbl td:first-child { font-size: 16px; }
  .tbl td.td-empty { display: none; }
  .row-change td:first-child { box-shadow: none; }
  .row-change { border-left: 5px solid var(--peach); }
  .flash-row td::after { inset: -10px -14px; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--sh); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .badge, .btn-copy, .sum-main { border: 1px solid CanvasText; }
  .r-dot, .cal-dot-c, .seg-fill { forced-color-adjust: none; }
}



/* ── 如何更新資料：圖卡導覽（7 張，一次一張） ── */
.tut { max-width: 720px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh); padding: 14px clamp(14px, 3vw, 22px) 16px; }
.tut-count { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; min-height: 1.3em; }
.tut-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.tut-fig { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; line-height: 0; }
.tut-svg { display: block; width: 100%; height: auto; }
.tut-no { font-size: 13.5px; font-weight: 700; color: var(--cta); }
.tut-h { font-family: var(--font-h); font-size: 1.2rem; line-height: 1.4; color: var(--ink-strong); margin: 2px 0 8px; }
.tut-desc { font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.tut-desc + .tut-desc { margin-top: 6px; }
.tut-desc kbd { font: 700 13px var(--font); background: #fff; border: 1px solid rgba(65, 56, 56, .28); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.tut-install { margin-top: 14px; }
.bookmarklet-link { cursor: grab; max-width: 100%; text-align: center; }
.bookmarklet-link.is-disabled { opacity: .55; cursor: not-allowed; }
.tut-note { margin-top: 8px; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.tut-note.is-nudge { color: #8a2f1f; font-weight: 700; }

.tut-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tut-dots { display: flex; gap: 0; }
.tut-dot { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.tut-dot span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(65, 56, 56, .28); background: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease); }
.tut-dot:active span { transform: scale(.94); }
.tut-dot.is-on span { background: var(--cta); border-color: var(--cta); color: #fff; }
.tut-dot:focus-visible { outline-offset: 0; border-radius: 50%; }
.tut-nav .btn { min-width: 96px; }

/* 圖卡內的 SVG 元件（沿用頁面色票） */
.s-win { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.s-tabstrip { fill: var(--blush); }
.s-tab { fill: #fff; }
.s-addr { fill: #F4EEEA; }
.s-bar { fill: #FFF3EA; }
.s-chip-g { fill: #E4DAD4; }
.s-t { font: 700 12px var(--font); fill: var(--ink); dominant-baseline: central; }
.s-t-w { fill: #fff; }
.s-t-m { fill: var(--muted); font-weight: 400; }
.s-t-g { fill: var(--sage-ink); }
.s-acc { fill: var(--cta); }
.s-acc-line { fill: none; stroke: var(--cta); stroke-width: 3; stroke-linecap: round; }
.s-ink { fill: var(--ink); }
.s-ink-fill { fill: var(--ink); }
.s-ink-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.s-rose { fill: var(--rose); }
.s-rose-line { fill: none; stroke: var(--rose); stroke-width: 3.5; stroke-linecap: round; }
.s-blush { fill: var(--blush); }
.s-sage { fill: var(--sage); }
.s-apricot { fill: var(--apricot); }
.s-sagepill { fill: #E3EBDD; }
.s-sagebub { fill: #DDE7D4; stroke: var(--sage-ink); stroke-width: 2; }
.s-bubline { fill: var(--sage-ink); opacity: .55; }
.s-pill { fill: #fff; stroke: rgba(65, 56, 56, .45); stroke-width: 1.5; }
.s-card { fill: #FFF3EA; stroke: rgba(65, 56, 56, .2); stroke-width: 1.5; }
.s-row { fill: #FFF3EA; stroke: var(--peach); stroke-width: 1.5; }
.s-box { fill: var(--cta); }
.s-tick { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.s-slot { fill: none; stroke: var(--cta); stroke-width: 2; stroke-dasharray: 5 4; }
.s-hl { fill: none; stroke: var(--rose); stroke-width: 2.5; }
.s-cursor { fill: var(--ink); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.a-ring { fill: none; stroke: var(--cta); stroke-width: 3; opacity: 0; }

/* 動畫：只動 transform 與 opacity；每張卡顯示時各播一次（卡片由 hidden 變成顯示時重新開始） */
@keyframes tut-in-next { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes tut-in-prev { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes tut-drag { from { transform: translateY(70px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes tut-ring { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes tut-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tut-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tut-card.go-next { animation: tut-in-next .22s ease-out backwards; }
.tut-card.go-prev { animation: tut-in-prev .22s ease-out backwards; }
.a-drag { animation: tut-drag 1.1s cubic-bezier(.2, .8, .2, 1) .35s backwards; }
.a-ring { transform-box: fill-box; transform-origin: center; animation: tut-ring .8s ease-out .4s 1 both; }
.a-pop { animation: tut-pop .4s ease-out .5s backwards; }
.a-pop-late { animation: tut-pop .4s ease-out .9s backwards; }
.a-bar { transform-box: fill-box; transform-origin: left center; animation: tut-grow .9s ease-out .2s backwards; }
.a-seq { animation: tut-pop .3s ease-out calc(var(--k, 0) * 140ms + 200ms) backwards; }

@media (max-width: 720px) {
  .tut-card { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tut-dots { order: -1; width: 100%; justify-content: center; }
  .tut-nav { flex-wrap: wrap; }
  .tut-nav .btn { flex: 1; }
}
