/* 月老請查收 — design tokens 與全站樣式
   暖米白 × 朱紅 × 奶茶 × 淡金。克制：預設用 1px 邊線，不堆陰影與漸層；
   紅線（步驟進度）是唯一的 signature。間距走 4 的倍數。 */
:root {
  --bg: #FFF8EF;
  --paper: #FFFDF9;
  --red: #B63C38;
  --red-deep: #8E2B28;
  --tea: #E7D3BC;
  --gold: #C9A465;
  --ink: #3C2F2B;
  --ink-2: #6B5A52;
  --pink: #FBE7E2;
  --edge: #9A8266;
  --line: #E7D3BC;
  --warn-bg: #FFF1CF;
  --warn-ink: #6B4300;
  --ok: #2F6B45;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-full: 999px;
  --wrap: 720px;
  --pray-size: 24px;

  --sans: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "STSong", serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
  word-break: normal;
}
body { overflow-x: hidden; }

h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
h1 { font-family: var(--serif); font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
p { margin: 0 0 var(--s3); }
a { color: var(--red); }
ul, ol { margin: 0; padding-left: 1.4em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.sr-only, .sr-copy {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}
.sr-copy { left: -9999px; }
.muted { color: var(--ink-2); }
.fine { font-size: 14px; }
.pre { white-space: pre-line; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.skip {
  position: absolute; left: var(--s4); top: -64px; background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s4); border-radius: var(--r-sm); z-index: 50;
}
.skip:focus { top: var(--s2); }

/* ── 頁首頁尾 ── */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  max-width: var(--wrap); margin: 0 auto; padding: var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top));
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 20px; min-height: 44px; }
.brand svg { width: 32px; height: 32px; }
.site-head nav a { color: var(--ink-2); text-decoration: none; padding: var(--s3) var(--s2); display: inline-block; min-height: 44px; }
.site-head nav a:hover { color: var(--red); }

body:has(.review-grid) .site-head { max-width: 1040px; }
main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4) var(--s7); }
.view { padding-bottom: var(--s5); }
.view.has-bar, .view:has(.bar) { padding-bottom: 168px; }

.site-foot {
  max-width: var(--wrap); margin: 0 auto; padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-bottom: var(--s2); }
.site-foot a { color: var(--ink-2); padding: var(--s2) 0; display: inline-block; min-height: 40px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 520px); background: var(--ink); color: var(--paper); padding: var(--s3) var(--s4);
  border-radius: var(--r-md); font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60;
}
.toast.is-on { opacity: 1; }

/* ── 按鈕 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: var(--s3) var(--s5); border-radius: var(--r-full);
  border: 1.5px solid var(--red); background: var(--paper); color: var(--red);
  font-weight: 600; text-decoration: none; line-height: 1.3; text-align: center;
}
.btn.primary { background: var(--red); color: #FFFFFF; }
.btn.primary:hover { background: var(--red-deep); }
.btn.ghost { border-color: var(--edge); color: var(--ink); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); }
.btn.danger { background: #8E1F1B; border-color: #8E1F1B; color: #FFFFFF; }
.btn.danger-ghost { border-color: var(--edge); color: #8E1F1B; }
.btn.small { min-height: 44px; padding: var(--s2) var(--s4); font-size: 15px; }
.btn.big { min-height: 56px; font-size: 18px; padding: var(--s3) var(--s6); }
.btn[disabled], .chip[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
.btn-row.tight { margin-top: var(--s2); gap: var(--s1) var(--s4); }
.link-btn { background: none; border: 0; padding: var(--s2) 0; min-height: 44px; color: var(--red); text-decoration: underline; font-size: 15px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px;
  background: none; border: 1px solid transparent; border-radius: var(--r-md); color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--edge); color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }

/* ── 分段、開關 ── */
.seg { display: inline-flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s1); background: var(--tea); border-radius: var(--r-full); }
.seg-btn {
  min-height: 44px; padding: var(--s2) var(--s4); border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: var(--s1);
}
.seg-btn.is-on { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red-deep); }
.tabs { margin: var(--s4) 0; }

.switch {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3);
  border: 1.5px solid var(--edge); border-radius: var(--r-full); background: var(--paper);
}
.switch-knob { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--edge); background: var(--paper); }
.switch[aria-checked="true"] { border-color: var(--red); color: var(--red-deep); }
.switch[aria-checked="true"] .switch-knob { background: var(--red); border-color: var(--red); }

/* ── 卡片 ── */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s5); margin: var(--s4) 0;
}
.card h2 { margin-bottom: var(--s3); }

/* ── 首頁 ── */
.hero { display: grid; gap: var(--s5); padding: var(--s5) 0 var(--s4); align-items: center; }
.hero h1 { font-size: 44px; color: var(--ink); }
.hero .sub { font-size: 20px; color: var(--red); font-weight: 600; margin: var(--s2) 0 var(--s4); }
.eyebrow { font-size: 14px; letter-spacing: .1em; color: var(--ink-2); margin-bottom: var(--s2); }
.hero-art { max-width: 220px; justify-self: center; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (min-width: 640px) {
  .hero { grid-template-columns: 1fr 240px; }
  .hero-art { justify-self: end; }
}
.steps ol { list-style: none; padding: 0; display: grid; gap: var(--s3); counter-reset: s; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: var(--s3); align-items: start; counter-increment: s; }
.steps li::before {
  content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.steps li strong { display: block; }
section.block { margin: var(--s7) 0 0; }
section.block > h2 { margin-bottom: var(--s4); }
.out-grid { display: grid; gap: var(--s3); }
@media (min-width: 640px) { .out-grid { grid-template-columns: repeat(3, 1fr); } }
.out-grid .card { margin: 0; padding: var(--s4); }
.out-grid h3 { margin-bottom: var(--s2); }
.returning { border-color: var(--red); background: var(--pink); }
.returning .btn.ghost { background: var(--paper); }
.sample-card { position: relative; }
.sample-label { display: inline-block; font-size: 13px; color: var(--ink-2); border: 1px solid var(--edge); border-radius: var(--r-full); padding: 0 var(--s3); margin-bottom: var(--s3); }

/* ── 紅線步驟 ── */
.thread { list-style: none; display: flex; padding: 0; margin: 0 0 var(--s5); position: relative; }
.thread-step { flex: 1; position: relative; text-align: center; }
.thread-step::before {
  content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 3px; background: var(--red); opacity: .35;
}
.thread-step:first-child::before { display: none; }
.thread-step.is-done::before, .thread-step.is-now::before { opacity: 1; }
.thread-step a { display: inline-flex; flex-direction: column; align-items: center; gap: var(--s1); text-decoration: none; color: var(--ink-2); position: relative; min-height: 44px; }
.knot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--red); background: var(--paper); color: var(--red); font-weight: 700; font-size: 14px; position: relative; z-index: 1;
}
.is-now .knot { background: var(--red); color: #fff; }
.is-done .knot { background: var(--paper); border-color: var(--gold); color: var(--ink); }
.is-now .thread-text { color: var(--red-deep); font-weight: 700; }
.thread-text { font-size: 14px; }

.build-head { padding-top: var(--s2); }
.build-head h1 { margin-bottom: var(--s2); }
.lead { color: var(--ink-2); margin-bottom: var(--s3); }
.back { margin-bottom: var(--s3); }
.save-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; font-size: 14px; color: var(--ink-2); margin-top: var(--s2); }
.save-status { font-weight: 700; color: var(--ok); }
.save-status[data-state="error"] { color: #8E1F1B; }
.save-status[data-state="memory"] { color: var(--warn-ink); }
.save-status[data-state="pending"], .save-status[data-state="idle"] { color: var(--ink-2); }
.mode-note { color: var(--ink-2); margin: var(--s2) 0 var(--s4); }

/* ── 欄位與選項 ── */
.field {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s4) var(--s4) var(--s3); margin: 0 0 var(--s3); scroll-margin-top: 16px;
}
.field.field-sub { border: 0; border-top: 1px dashed var(--line); border-radius: 0; background: none; padding: var(--s4) 0 var(--s2); margin: 0; }
.field.field-sub:first-of-type { border-top: 0; }
.field.flash { box-shadow: 0 0 0 3px var(--gold); }
.field-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s3); margin-bottom: var(--s2); }
.field-head.sep { margin-top: var(--s5); }
.tag { font-size: 13px; color: var(--ink-2); border: 1px solid var(--edge); border-radius: var(--r-full); padding: 0 var(--s3); white-space: nowrap; }
.help { font-size: 14px; color: var(--ink-2); margin-bottom: var(--s3); }
.qgroup { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); margin-bottom: var(--s3); }
.qgroup-title { font-size: 20px; margin-bottom: var(--s1); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips-extra { margin-top: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 48px; padding: var(--s2) var(--s4);
  border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  text-align: left; line-height: 1.4;
}
.chip-mark { width: 18px; min-width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--edge); display: inline-grid; place-items: center; background: var(--paper); }
.chip-mark svg { color: #fff; }
.chip.is-on { background: var(--pink); border-color: var(--red); color: var(--red-deep); font-weight: 600; box-shadow: inset 0 0 0 1px var(--red); }
.chip.is-on .chip-mark { background: var(--red); border-color: var(--red); }
.chip-none { border-style: dashed; }
.chip-text small { color: var(--ink-2); font-weight: 400; }
.group { margin-top: var(--s3); }
.group:first-child { margin-top: 0; }
.group-title { color: var(--ink-2); margin: var(--s4) 0 var(--s2); font-weight: 600; }
.more { margin-top: var(--s3); }
.more > summary, .opt-help > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; color: var(--red); font-weight: 600;
}
.more > summary::-webkit-details-marker, .opt-help > summary::-webkit-details-marker, .cat > summary::-webkit-details-marker { display: none; }
.more[open] > summary svg { transform: rotate(180deg); }
.opt-help { margin-top: var(--s2); font-size: 14px; }
.opt-help dl { margin: var(--s2) 0 0; }
.opt-help dt { font-weight: 700; }
.opt-help dd { margin: 0 0 var(--s2); color: var(--ink-2); }
.search-row { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); color: var(--ink-2); }

.text-in, .num-in, .sel {
  width: 100%; min-height: 48px; padding: var(--s2) var(--s3); border: 1.5px solid var(--edge);
  border-radius: var(--r-md); background: var(--paper); font-size: 16px;
}
.num-in { width: 7.5em; text-align: center; }
.sel { width: auto; min-width: 7em; }
.note-in { min-height: 112px; resize: vertical; line-height: 1.6; }
.text-in:focus, .num-in:focus, .sel:focus { border-color: var(--red); outline: 2px solid var(--red); outline-offset: 0; }
.custom-row { margin-top: var(--s3); }
.count { display: block; font-size: 13px; color: var(--ink-2); margin-top: var(--s1); }
.note-foot { text-align: right; }

.range-box { margin-top: var(--s3); padding: var(--s3); border: 1px dashed var(--edge); border-radius: var(--r-md); }
.range-row { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); margin-top: var(--s3); }
.num-wrap { display: flex; flex-direction: column; gap: var(--s1); font-size: 14px; color: var(--ink-2); }
.range-to, .unit { padding-bottom: var(--s3); color: var(--ink-2); }
.range-msg { min-height: 1.2em; margin: var(--s2) 0 0; font-size: 14px; }
.range-msg.is-error { color: #8E1F1B; font-weight: 600; }
.range-msg.is-hint { color: var(--ink-2); }

.note {
  display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4);
  border-radius: var(--r-md); margin: var(--s3) 0 0; font-size: 15px;
}
.note p { margin: 0 0 var(--s1); }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.hint { background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.soft-note { margin-top: var(--s3); font-size: 14px; color: var(--ink-2); }

.cat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s3); }
.cat > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); min-height: 64px;
}
.cat-title { flex: 1; display: flex; flex-direction: column; }
.cat-blurb { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.cat-count { background: var(--red); color: #fff; border-radius: var(--r-full); font-size: 13px; padding: 0 var(--s3); white-space: nowrap; }
.cat[open] > summary .cat-chev { transform: rotate(180deg); }
.cat-body { padding: 0 var(--s4) var(--s2); }
.cat-body .field { border: 0; border-top: 1px dashed var(--line); border-radius: 0; background: none; padding: var(--s4) 0 var(--s3); margin: 0; }
.cat-body .field:first-child { border-top: 0; }

.cc-list { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.cc-row { display: flex; gap: var(--s2); align-items: center; }
.cc-row .text-in { flex: 1; min-width: 0; }

/* ── 底部固定列 ── */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--paper); border-top: 1px solid var(--edge);
  padding: var(--s2) var(--s4) calc(var(--s2) + env(safe-area-inset-bottom));
}
.bar > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.bar-count {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; border: 0;
  padding: var(--s1) 0; text-align: left; min-height: 44px;
}
.bar-main b { color: var(--red); font-size: 20px; }
.bar-preview { font-size: 13px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-actions { display: flex; gap: var(--s2); }
.bar-actions .btn { flex: 1; padding-left: var(--s3); padding-right: var(--s3); }
.bar-actions .btn.primary { flex: 1.4; }
.build.kb .bar, .kb .bar { display: none; }
.bar-simple { padding-top: var(--s3); }
[data-warn="1"]::after { content: ""; }

/* ── 重點整理 ── */
.review-grid { display: grid; gap: var(--s5); }
@media (min-width: 980px) {
  main:has(.review-grid) { max-width: 1040px; }
  .review-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .review-preview { position: sticky; top: var(--s4); }
}
.rel-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--s4); }
.level { margin: 0 0 var(--s5); }
.level-head h2 { display: flex; align-items: center; gap: var(--s2); }
.lv-count { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.lv-mark { width: 18px; height: 18px; border: 3px solid var(--red); display: inline-block; }
.lv-must .lv-mark { background: var(--red); border-radius: 4px; }
.lv-want .lv-mark { border-radius: 50%; }
.lv-bonus .lv-mark { border-style: dashed; border-color: var(--gold); border-radius: 50%; }
.level-empty { color: var(--ink-2); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.rows { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s2); }
.row { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); }
.row.is-drag { box-shadow: 0 0 0 2px var(--red); background: var(--pink); }
.row-main { display: flex; align-items: center; gap: var(--s2); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-label { font-size: 13px; color: var(--ink-2); }
.row-value { font-weight: 600; }
.drag { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.row-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s1); }
.row-move { display: flex; }
.level-seg { background: var(--bg); }
.level-seg .seg-btn { padding: var(--s1) var(--s3); font-size: 14px; min-height: 40px; }
.prayer-card {
  background: var(--paper); border: 1px solid var(--gold); border-radius: var(--r-lg);
  padding: var(--s5) var(--s4); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 5px var(--tea);
}
.prayer-card p { margin: 0 0 var(--s4); }
.prayer-card p:last-child { margin-bottom: 0; }

/* ── 結果頁 ── */
.ok-line { display: flex; align-items: center; gap: var(--s2); color: var(--ok); font-weight: 600; margin: 0 0 var(--s2); }
.counts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0; margin: var(--s3) 0; }
.counts li { border: 1.5px solid var(--edge); border-radius: var(--r-full); padding: 0 var(--s3); font-size: 14px; }
.counts .lv-must { border-color: var(--red); background: var(--red); color: #fff; }
.counts .lv-want { border-color: var(--red); background: var(--pink); color: var(--red-deep); }
.counts .lv-bonus { border-style: dashed; border-color: var(--gold); }
.result-panel { margin: var(--s4) 0; }
.list-sec { margin-bottom: var(--s5); }
.list-sec h2 { font-size: 18px; color: var(--red-deep); border-left: 4px solid var(--red); padding-left: var(--s3); margin-bottom: var(--s2); }
.list-sec.lv-want h2 { border-left-color: var(--gold); }
.list-sec.lv-bonus h2 { border-left: 4px dashed var(--gold); }
.list-sec.lv-relation h2, .list-sec.lv-note h2 { border-left-color: var(--tea); }
.bullets { padding-left: 1.2em; }
.bullets li { margin-bottom: var(--s2); font-size: 18px; }
.rel-line { font-size: 20px; font-weight: 600; margin: 0; }
.hint-line { color: var(--ink-2); font-size: 15px; }
.source-line { font-size: 13px; color: var(--ink-2); margin-top: var(--s3); }
.action-grid { display: grid; gap: var(--s3); margin: var(--s5) 0; grid-template-columns: 1fr 1fr; }
.action-grid .big { grid-column: 1 / -1; }
.empty-state { text-align: center; padding: var(--s6) var(--s4); border: 1px dashed var(--edge); border-radius: var(--r-lg); background: var(--paper); margin: var(--s4) 0; }
.empty-state .btn-row { justify-content: center; }
.result-warn:empty { display: none; }
.img-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: var(--s4) 0; }
.img-item { margin: 0; display: grid; gap: var(--s2); justify-items: center; }
.img-item img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.img-item figcaption { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: center; }

/* ── 分享 ── */
.pick-head { display: flex; justify-content: space-between; align-items: center; }
.share-preview { display: grid; gap: var(--s4); justify-items: center; margin: var(--s3) 0; }
.card-canvas { width: min(100%, 420px); height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.share-actions { justify-content: center; }
.share-note { flex-basis: 100%; text-align: center; }

/* ── 對話框 ── */
.dlg {
  border: 0; border-radius: var(--r-lg); padding: 0; background: var(--paper); color: var(--ink);
  width: min(92vw, 560px); max-height: 88vh; overflow: auto;
}
.dlg::backdrop { background: rgba(60, 47, 43, .55); }
.dlg-body { padding: var(--s5) var(--s5) var(--s2); }
.dlg-body h2 { margin-bottom: var(--s3); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s5) var(--s5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4) var(--s3) var(--s5); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.sheet-body { padding: var(--s4) var(--s5) var(--s5); }
.manual-copy { width: 100%; min-height: 200px; padding: var(--s3); border: 1.5px solid var(--edge); border-radius: var(--r-md); font-size: 16px; }
.sum h3 { margin: var(--s4) 0 var(--s1); font-size: 16px; color: var(--ink-2); }
.sum-list { list-style: none; padding: 0; margin: 0; }
.sum-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); padding: var(--s1) 0; border-bottom: 1px solid var(--line); }
.sum-label { color: var(--ink-2); font-size: 14px; min-width: 7em; }
.sum-value { flex: 1; font-weight: 600; }

/* ── 拜拜模式 ── */
body.is-pray { background: #FFFDF8; }
body.is-pray .site-head, body.is-pray .site-foot { display: none; }
.pray-mode { max-width: 760px; margin: 0 auto; }
.pray-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) 0; padding-top: calc(var(--s3) + env(safe-area-inset-top)); background: #FFFDF8; border-bottom: 1px solid var(--line);
}
.pray-hint { color: #4A3C36; font-size: 15px; margin: var(--s4) 0; }
.pray-text { color: #1B1411; font-size: var(--pray-size); line-height: 1.95; padding-bottom: 40vh; }
.pray-p { padding: var(--s3) var(--s3); margin: 0 calc(var(--s3) * -1) var(--s3); border-left: 6px solid transparent; border-radius: var(--r-sm); cursor: pointer; }
.pray-p p { margin: 0; }
.pray-label { font-family: var(--sans); font-size: 15px; color: var(--red-deep); letter-spacing: .06em; margin-bottom: var(--s1); }
.pray-p.is-read { opacity: .55; }
.pray-p.is-here { border-left-color: var(--red); background: var(--pink); }
.pray-empty { padding: var(--s7) 0; text-align: center; }
.size-seg .seg-btn { min-width: 48px; min-height: 48px; justify-content: center; }

/* ── 說明與法務頁 ── */
.doc { max-width: 680px; padding-top: var(--s4); }
.doc h1 { margin-bottom: var(--s3); }
.doc h2 { margin: var(--s6) 0 var(--s3); font-size: 20px; }
.doc h3 { margin: var(--s5) 0 var(--s2); font-size: 17px; }
.doc p, .doc li { font-size: 16px; }
.doc li { margin-bottom: var(--s2); }
.doc table { border-collapse: collapse; width: 100%; margin: var(--s3) 0; font-size: 15px; }
.doc th, .doc td { border: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: left; vertical-align: top; }
.doc .meta { color: var(--ink-2); }
.doc .callout { background: var(--paper); border: 1px solid var(--gold); border-radius: var(--r-md); padding: var(--s4); margin: var(--s4) 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 420px) {
  h1 { font-size: 28px; }
  .hero h1 { font-size: 38px; }
  .action-grid { grid-template-columns: 1fr; }
  .chip { padding-left: var(--s3); padding-right: var(--s3); }
}
