/* 恆璞遺囑中心原型 — 視覺沿用「恆璞自書遺囑產生器」的設計語言 */
:root {
  --ink: #183b50;
  --navy: #204b65;
  --navy-dark: #163a52;
  --muted: #586d79;
  --line: #d7e1e4;
  --bg: #f4f6f5;
  --green: #317362;
  --gold: #9b7946;
  --error: #a32f30;
  --paper: #fffef9;
  --serif: Georgia, "Noto Serif TC", PMingLiU, serif;
  --sans: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--navy); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus, select:focus, textarea:focus { outline: 3px solid #b18e42; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 36px; font-weight: 650; line-height: 1.5; letter-spacing: -.5px; }
h2 { font-size: 22px; line-height: 1.5; }
h3 { font-size: 18px; }
p { color: var(--muted); }

/* ---------- header / footer ---------- */
.site-header { min-height: 96px; padding: 16px max(28px, calc(50vw - 580px)); display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--navy); }
.brand img { height: 76px; width: auto; margin: -18px -26px -18px -24px; }
.brand > span { border-left: 1px solid var(--line); padding-left: 18px; font-family: var(--serif); font-size: 20px; letter-spacing: 6px; white-space: nowrap; }
.brand-caption { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 3px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.proto-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.proto-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.site-footer { text-align: center; padding: 26px 24px 32px; border-top: 1px solid var(--line); background: #eef2f1; font-size: 13px; }
.site-footer p + p { margin-top: 6px; }
.legal-small { font-size: 11px; color: #6f8088; }

/* ---------- buttons ---------- */
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 48px; padding: 11px 22px; font-weight: 600; font-size: 16px; line-height: 1.6; border: 1px solid transparent; border-radius: 8px; text-decoration: none; transition: background .15s, border-color .15s; }
.button.primary { background: var(--navy); color: #fff; box-shadow: 0 3px 7px rgba(20, 52, 74, .086); }
.button.primary:hover { background: var(--navy-dark); color: #fff; }
.button.secondary { background: #fff; color: var(--navy); border-color: #c5d3db; }
.button.secondary:hover { background: #edf3f5; border-color: var(--navy); }
.button.text, button.text { border: 0; background: none; color: var(--navy); text-decoration: underline; text-underline-offset: 5px; padding: 10px 8px; min-height: 44px; font-size: 15px; font-weight: 500; }
.button.add { width: 100%; margin: 8px 0 16px; border: 1px dashed #9bb5c2; background: #f7fafb; color: var(--navy); }
.button.chip { min-height: 40px; padding: 6px 13px; font-size: 14px; font-weight: 500; background: #edf3f5; border-color: #d8e3e7; color: var(--navy); }
.button.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.button.wide { width: 100%; }
.danger { color: var(--error) !important; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- page shells ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 42px 28px 64px; min-height: calc(100vh - 270px); }
.page:focus { outline: none; }
.form-page { max-width: 800px; }
.eyebrow { display: block; font-size: 12px; font-weight: 650; letter-spacing: 2px; color: var(--gold); margin-bottom: 16px; text-transform: uppercase; }
.lead { font-size: 17px; line-height: 1.95; margin-top: 20px; }
.page-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-top .back { padding-left: 0; text-decoration: none; }
.step-count { font-size: 14px; color: var(--muted); }
.progress-track { height: 4px; background: #dfe7e7; border-radius: 5px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--green); }
.page-title { margin: 36px 0 28px; }
.page-title .eyebrow { font-size: 11px; margin-bottom: 9px; }
.page-title p { margin-top: 10px; font-size: 16px; }
.form-content { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 36px; }
.form-content + .form-content { margin-top: 16px; }
.form-footer { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.form-footer p { font-size: 13px; margin-top: 10px; }
.form-footer .primary { min-width: 245px; }
.section-block { margin: 30px 0 20px; }
.section-block > p { margin-top: 4px; font-size: 14px; }
.soft-note { font-size: 13px; color: var(--muted); margin-top: 20px; line-height: 1.7; }
.required-note { font-size: 13px; margin-bottom: 22px; }

/* ---------- welcome (login / family invite) ---------- */
.welcome { display: grid; grid-template-columns: 1.2fr 1fr; gap: 68px; align-items: center; max-width: 1200px; min-height: 640px; padding-top: 56px; padding-bottom: 64px; }
.welcome h1 { font-family: var(--serif); font-size: 43px; line-height: 1.55; letter-spacing: 1px; max-width: 560px; }
.welcome-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 30px; }
.welcome-actions .button { min-width: 220px; padding: 13px 24px; font-size: 17px; }
.promise { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0 32px; font-size: 13px; color: var(--green); }
.consent-line { margin-top: 6px; }
.journey { border-top: 1px solid var(--line); padding-top: 24px; display: flex; gap: 20px; }
.journey > div { display: flex; gap: 10px; flex: 1; }
.journey b { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: #e2ecec; color: var(--navy); font-size: 13px; }
.journey span { font-size: 14px; font-weight: 600; }
.journey small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.quiet { font-size: 14px; line-height: 1.8; margin-top: 22px; }
.welcome-art { position: relative; padding: 24px 22px; background: #e6ece9; border-radius: 190px 190px 16px 16px; }
.paper-sample { background: var(--paper); padding: 33px 32px 24px; border: 1px solid #e2e5df; box-shadow: 0 12px 36px rgba(35, 61, 77, .098); transform: rotate(2deg); }
.paper-brand { font: 12px var(--serif); letter-spacing: 3px; text-align: center; color: #7d8d90; margin-bottom: 15px; }
.draft-badge { display: table; margin: auto; padding: 3px 9px; border: 1px solid #d5ded7; font-size: 10px; color: #50746a; letter-spacing: 1px; }
.paper-sample h2 { font: 25px var(--serif); letter-spacing: 8px; text-align: center; margin: 24px 0; }
.paper-sample p { font: 14px/1.9 var(--serif); color: #617078; margin: 14px 0; }
.sample-clause { margin: 16px 0; }
.sample-clause b { font: 14px var(--serif); color: #687980; }
.ink-line { height: 1px; background: #d7deda; margin: 13px 0; }
.ink-line.short { width: 70%; }
.sample-sign { font-size: 11px !important; margin-top: 28px !important; }
.floating-note { position: absolute; bottom: 6px; right: -15px; display: flex; gap: 14px; padding: 15px 22px; background: var(--navy); color: #fff; border-radius: 10px; box-shadow: 0 8px 20px rgba(32, 75, 101, .125); font-size: 14px; line-height: 1.7; }
.floating-note > span { font-size: 32px; color: #d6b87f; line-height: 1.2; }
.art-logo { display: block; width: 210px; margin: -20px auto -28px; }

/* ---------- choice / mode cards ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.choice-card { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 22px; background: #fff; border: 1px solid #bacbd3; border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 230px; transition: background .15s, border-color .15s, box-shadow .15s; }
.choice-card:hover { background: #f1f6f7; border-color: var(--navy); box-shadow: 0 8px 22px rgba(32, 75, 101, .08); }
.choice-card .mode-number { font: italic 28px var(--serif); color: #99acb5; }
.choice-card h2 { font-family: var(--serif); font-size: 21px; line-height: 1.45; }
.choice-card p { font-size: 14px; flex: 1; }
.choice-card .go { font-size: 15px; font-weight: 600; color: var(--navy); }
.mode-options { display: flex; flex-direction: column; gap: 14px; }
.mode-card { display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left; padding: 22px 20px; min-height: 110px; background: #fff; border: 1px solid #bacbd3; border-radius: 10px; color: var(--ink); transition: background .15s, border-color .15s; }
.mode-card:hover { background: #f1f6f7; }
.mode-card.selected { background: #eaf2f5; border: 2px solid var(--navy); padding: 21px 19px; }
.mode-card { cursor: pointer; margin: 0; position: relative; }
.mode-card input { accent-color: var(--navy); width: 21px; height: 21px; margin-top: 4px; flex-shrink: 0; }
.mode-options { border: 0; padding: 0; margin: 0 0 6px; }
.mode-copy { flex: 1; }
.mode-copy b { font-size: 18px; }
.mode-copy small { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 440px; }
.mode-number { font: italic 24px var(--serif); color: #99acb5; }

/* ---------- form fields ---------- */
.field { margin-bottom: 24px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.optional { font-size: 13px; font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select { display: block; width: 100%; min-height: 50px; padding: 11px 13px; border: 1px solid #a7b8c2; border-radius: 6px; background: #fff; color: var(--ink); font-size: 17px; line-height: 1.5; transition: border-color .15s; }
input[type=file] { display: block; width: 100%; padding: 14px; border: 1px dashed #9bb5c2; border-radius: 8px; background: #f7fafb; font-size: 15px; color: var(--muted); }
textarea { min-height: 105px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #788893; font-size: 15px; }
.hint { font-size: 14px; margin: 7px 0 0; line-height: 1.7; color: var(--muted); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.check { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; padding: 3px 0; min-height: 38px; font-size: 15px; line-height: 1.75; cursor: pointer; }
.check input { width: 21px; height: 21px; flex-shrink: 0; margin: 3px 0 0; accent-color: var(--navy); }
.consent-box { margin-top: 26px; padding: 22px; background: #f1f5f4; border: 1px solid #d7e3df; border-radius: 10px; }
.consent-box h2 { font-size: 18px; margin-bottom: 9px; }
.consent-box p { font-size: 14px; }
.consent-box .check { font-weight: 600; }
/* 2026-11-18：勾選框或圓點在欄位裡時，「.field > label」（給欄位標題用）會蓋掉上面的 .check，
   變成 display:block，框和文字貼在一起、選項也變粗體。這裡把選項列還原成並排、有間距、一般粗細 */
.field > label.check { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0; font-weight: 400; font-size: 15px; }
.consent-box .field > label.check { font-weight: 600; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pick { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; background: #fff; border: 1px solid #c5d3db; border-radius: 8px; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s; }
.pick:hover { background: #f1f6f7; }
.pick:has(input:checked) { background: #eaf2f5; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.pick input { width: 19px; height: 19px; margin: 0; flex-shrink: 0; accent-color: var(--navy); }
.error-box { margin: 0 0 24px; padding: 18px 22px; border: 2px solid var(--error); border-radius: 8px; background: #fff9f8; }
.error-box h2 { font-size: 17px; color: var(--error); }
.error-box p { margin-top: 6px; color: var(--ink); font-size: 15px; }
.ok-line { margin-top: 8px; font-size: 14px; color: var(--green); }
.req { color: var(--error); font-weight: 700; }
.inline-error { margin-top: 7px; font-size: 14px; color: var(--error); }
[aria-invalid="true"] { border-color: var(--error) !important; background: #fffafa !important; }
.pick-grid.invalid .pick { border-color: var(--error); }

/* ---------- generator specifics ---------- */
.item-card { margin: 16px 0; padding: 23px; background: #fcfdfd; border: 1px solid #cddbe0; border-radius: 10px; }
.item-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.item-heading h3 { flex: 1; font-size: 17px; }
.item-heading .text { padding: 0 7px; min-height: 40px; }
.number-dot { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e5eef1; color: var(--navy); font-size: 14px; font-weight: 650; flex-shrink: 0; }
.selected-direction { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; padding: 16px 20px; background: #edf4f5; border-radius: 8px; }
.selected-direction .eyebrow { font-size: 11px; letter-spacing: 1px; margin-bottom: 4px; }
.selected-direction b { font-size: 17px; }
.allocation-labels, .allocation-row { display: grid; grid-template-columns: 1fr 125px 40px; gap: 10px; }
.allocation-labels { margin: 22px 0 9px; font-size: 13px; color: var(--muted); }
.allocation-row { align-items: start; margin-bottom: 12px; }
.percent { position: relative; }
.percent input { padding-right: 32px !important; }
.percent span { position: absolute; right: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.icon-button { min-height: 50px; min-width: 40px; border: 0; background: transparent; color: #7e4448; font-size: 24px; line-height: 1; }
.allocation-tools { display: flex; justify-content: space-between; gap: 10px; margin: 5px 0 13px; }
.allocation-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 13px 16px; border-radius: 7px; background: #f8f0e5; color: #765021; font-size: 14px; }
.allocation-total.complete { background: #eaf4ef; color: #26614e; }
.fold { margin: 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.fold summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 62px; padding: 18px; font-weight: 600; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary .optional { white-space: nowrap; }
.fold summary .optional i { display: inline-block; font-style: normal; transition: transform .15s; }
.fold[open] > summary { border-bottom: 1px solid var(--line); background: #f8faf9; }
.fold[open] > summary .optional i { transform: rotate(45deg); }
.fold-body { padding: 22px 20px; }
.placement { margin-top: 14px; padding-left: 10px; border-left: 2px solid #9cbcad; font-size: 13px; color: var(--green); }
.legal-explanation { padding: 22px 12px; text-align: center; }
.large-check { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #e5f0e9; color: var(--green); font-size: 24px; flex-shrink: 0; }
.legal-explanation h2 { margin: 15px 0 10px; font-size: 21px; }
/* 完成頁的標題是 h1（每頁都有主標題，2026-11-18），外觀維持原本 h2 的樣子 */
.legal-explanation h1.thanks-title { margin: 15px 0 10px; font-size: 21px; font-weight: bold; line-height: 1.5; letter-spacing: normal; }
.legal-explanation p { max-width: 480px; margin: auto; font-size: 15px; }

/* ---------- 範例與修改模式 ---------- */
.choice-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.choice-card .go { border: 0; background: none; padding: 0; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); text-decoration: none; cursor: pointer; }
.choice-card .go:hover { text-decoration: underline; }
.small-link { font-size: 14px !important; padding: 6px 0 !important; }
.example-hint { display: flex; align-items: center; gap: 12px; margin: -8px 0 24px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.example-hint > span { font-size: 20px; color: #c9a86a; }
.example-hint p { flex: 1; font-size: 14px; }
.example-hint .button.text { padding: 4px 0; min-height: 40px; }
.example-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 20px; background: #fbf6ec; border: 1px solid #e6d6b8; border-radius: 10px; }
.example-banner b { color: var(--ink); }
.example-banner p { font-size: 13px; margin-top: 2px; }
.edit-note { margin: -8px 0 20px; padding: 12px 18px; background: #e5edf3; border-radius: 6px; font-size: 14px; color: var(--ink); }
.fold.review { margin: 0 0 20px; }
.fold.review .fold-body { padding: 4px 20px; }

.appendix-fold { margin-top: 20px; }
.appendix-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; color: var(--muted); }
.asset-adds { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.subheading { margin: 25px 0 0; font-size: 17px; }
.share-row { display: flex; gap: 8px; }
.share-row .button { flex: 1; margin-bottom: 0 !important; }
.download-card .button.text { width: auto; margin: 0 auto 4px; display: flex; }

/* ---------- result / summary layouts ---------- */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.result-actions { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; }
.success-note { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; padding: 18px 20px; background: #e6f0ea; border-radius: 10px; }
.success-note > span { font-size: 23px; color: var(--green); }
.success-note b { display: block; }
.success-note p { font-size: 13px; margin-top: 3px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 24px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0 6px; }
.panel-head h2 { font-size: 19px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row > div { min-width: 0; }
.summary-row span.k { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.summary-row b { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.summary-row .button { flex-shrink: 0; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e5eef1; color: var(--navy); font-size: 12px; font-weight: 650; white-space: nowrap; }
.tag.wait { background: #f8f0e5; color: #765021; }
.tag.good { background: #eaf4ef; color: #26614e; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.manuscript { background: #fffefb; padding: 36px 42px; border: 1px solid #d9ddd6; box-shadow: 0 7px 20px rgba(36, 61, 75, .027); overflow-wrap: anywhere; }
.document-meta { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid #dfe3dc; color: #687c7b; font-size: 10px; letter-spacing: 1px; }
.document-meta span:last-child { background: #f4eddf; color: #80643b; padding: 3px 7px; white-space: nowrap; }
.manuscript h2 { font: 28px var(--serif); letter-spacing: 7px; text-align: center; margin: 33px 0; }
.document-body { white-space: pre-wrap; font-family: var(--serif); font-size: 18px; line-height: 2.05; color: #283f49; }
.document-footer { margin-top: 30px; padding-top: 18px; border-top: 1px solid #e1e5df; font-size: 12px; line-height: 1.9; color: #687c7b; }
.appendix { margin-top: 20px; }
.appendix pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.85 var(--sans); color: var(--muted); margin: 8px 0 0; }
.download-card { background: #fff; border: 1px solid #c5d6dd; border-radius: 12px; padding: 24px; }
.download-card .eyebrow { font-size: 11px; letter-spacing: 1px; margin-bottom: 7px; }
.download-card h2 { font-size: 20px; }
.download-card > p { font-size: 14px; margin: 10px 0 18px; }
.download-card .button { width: 100%; margin-bottom: 10px; }
.save-divider { height: 1px; background: var(--line); margin: 14px 0 18px; }
.next-service { padding: 24px 8px; }
.next-service .eyebrow { font-size: 10px; letter-spacing: 1px; margin-bottom: 6px; }
.next-service h3 { font-size: 17px; }
.next-service ol { padding-left: 22px; margin: 10px 0 16px; color: var(--muted); font-size: 14px; line-height: 2; }
.next-service .button { width: 100%; font-size: 14px; }
.next-service .hint { font-size: 12px; margin-top: 10px; }
.share-preview { margin-top: 24px; padding: 22px; background: #f1f5f4; border: 1px solid #d7e3df; border-radius: 10px; }
.share-preview h3 { font-size: 16px; margin-bottom: 6px; }
.share-preview .summary-row { padding: 10px 0; border-color: #dbe5e1; }
.qr { width: 172px; height: 172px; margin: 6px auto 12px; border: 12px solid #fff; outline: 1px solid var(--line); background: conic-gradient(var(--ink) 25%, #fff 0 50%, var(--ink) 0 75%, #fff 0) 0 0 / 20px 20px; }
.empty-state { text-align: center; padding: 36px 16px; }
.slots { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.slot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid #edf1f0; font-size: 15px; }
.slot-row:last-child { border-bottom: 0; }
.slot-row .pick { min-height: 42px; padding: 6px 12px; font-size: 14px; }

/* ---------- back office ---------- */
.tabs { display: flex; gap: 6px; margin: 0 0 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--green); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.stat-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.stat-num { margin: 6px 0 4px; font-family: var(--serif); font-size: 46px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-num small { margin-left: 6px; font-family: var(--sans); font-size: 15px; color: var(--muted); }
.stat p:last-child { font-size: 13px; }
.stat > p:not(.stat-num):not(.stat-label) { font-size: 13px; }
.stat-split { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.split-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #b9c9d1; }
.split-bar span { display: block; height: 100%; background: var(--navy); border-right: 2px solid #fff; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: var(--ink); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.line { background: var(--navy); }
.dot.google { background: #b9c9d1; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.client-row .who b { font-size: 16px; font-weight: 600; }
.client-row .who span.k { margin: 2px 0 0; }
.row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.row-actions .text { min-height: 40px; padding: 6px 8px; font-size: 14px; }
.guide-note { margin-bottom: 28px; padding: 18px 22px; background: #fbf6ec; border: 1px solid #e6d6b8; border-radius: 10px; }
.guide-note b { display: block; color: var(--ink); }
.guide-note p { font-size: 14px; margin-top: 4px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); z-index: 100; max-width: min(90vw, 580px); padding: 14px 24px; background: var(--ink); color: #fff; border-radius: 9px; box-shadow: 0 4px 20px rgba(0, 0, 0, .133); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .site-header { padding: 16px 28px; }
  .welcome { gap: 38px; padding-top: 40px; }
  .welcome h1 { font-size: 36px; }
  .journey { flex-direction: column; gap: 12px; }
  .welcome-art { padding: 16px; }
  .paper-sample { padding: 25px; }
  .result-grid { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
  .manuscript { padding: 30px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 0; }
  .proto-state { display: none; }
}
@media (max-width: 740px) {
  h1 { font-size: 28px; }
  .site-header { min-height: 76px; padding: 12px 16px; gap: 10px; }
  .brand { gap: 10px; }
  .brand img { height: 60px; margin: -14px -20px -14px -18px; }
  .brand > span { font-size: 16px; letter-spacing: 3px; padding-left: 10px; }
  .brand-caption { display: none; }
  .header-actions .text { font-size: 13px; padding: 6px; white-space: nowrap; }
  .row-actions { flex-wrap: wrap; }
  .page { padding: 24px 20px 42px; }
  .welcome { display: block; min-height: auto; padding: 32px 20px 40px; }
  .welcome h1 { font-size: 32px; }
  .welcome-art { max-width: 360px; margin: 38px auto 0; }
  .welcome-actions .button { width: 100%; min-width: 0; }
  .lead { font-size: 16px; }
  .promise { gap: 10px; font-size: 12px; }
  .floating-note { right: -8px; }
  .page-title { margin: 26px 0 22px; }
  .page-title p { font-size: 15px; }
  .form-content { padding: 24px 20px; border-radius: 10px; }
  .form-footer { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 22px; }
  .form-footer .button { width: 100%; min-width: 0; }
  .form-footer .footer-main { order: -1; }
  .two-fields { grid-template-columns: 1fr; }
  .mode-card { padding: 18px 15px; gap: 12px; }
  .mode-card.selected { padding: 17px 14px; }
  .mode-number { display: none; }
  .choice-card .mode-number { display: block; font-size: 22px; }
  .item-card { padding: 19px 15px; }
  .fold summary { padding: 16px; font-size: 15px; }
  .fold-body { padding: 20px 16px; }
  .consent-box, .share-preview { padding: 20px 17px; }
  .example-banner { flex-direction: column; align-items: stretch; }
  .example-hint { flex-wrap: wrap; }
  .allocation-labels, .allocation-row { grid-template-columns: minmax(0, 1fr) 90px 34px; gap: 8px; }
  .allocation-total { font-size: 13px; padding: 12px; }
  .pick-grid, .pick-grid.four { grid-template-columns: 1fr 1fr; }
  .result-grid { display: flex; flex-direction: column; }
  .result-actions { position: static; width: 100%; }
  .manuscript { padding: 25px 22px; }
  .document-body { font-size: 17px; line-height: 1.95; }
  .manuscript h2 { font-size: 25px; }
  .panel { padding: 4px 18px; }
  .summary-row { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr; }
  .stat-num { font-size: 40px; }
  .site-footer { padding: 24px 20px; font-size: 12px; }
}
@media print {
  .site-header, .site-footer, .no-print, #toast { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .result-grid { display: block; }
  .manuscript { border: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- 產生器專用（比照恆璞自書遺囑產生器） ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.date-fields { border: 0; padding: 0; margin: 0 0 28px; }
.date-fields legend, .choice-list legend { display: block; font-weight: 600; font-size: 16px; margin-bottom: 8px; padding: 0; }
.date-row { display: flex; gap: 15px; max-width: 385px; }
.date-row > .field { flex: 1; margin: 0; }
.date-row > .field:first-child { flex: 1.3; }
.date-row label { font-size: 14px !important; font-weight: 400 !important; }
.choice-list { border: 0; margin: 20px 0; padding: 0; }
.choice-list legend { font-size: 15px; }
.quiet { font-size: 14px; line-height: 1.8; margin-top: 22px; }
.optional-intro { display: flex; gap: 16px; padding: 0 0 16px; }
.optional-intro p { font-size: 14px; margin-top: 6px; }
.skip-optional { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0 22px; }
.skip-optional .hint { margin: 0; }
.reuse-people { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.reuse-people > .hint { width: 100%; margin: 0; }
.error-box ul { padding-left: 22px; margin: 12px 0 0; }
.error-box li { margin: 8px 0; color: var(--ink); }
.fold summary > span:first-child { flex: 1; }
.fold .fold { margin-bottom: 0; }
.allocation-labels { grid-template-columns: 1fr 125px 40px; }
.form-footer > div p { margin-top: 10px; }
.review-summary .summary-row .button.text { padding: 6px 4px; }
@media (max-width: 740px) {
  .date-row { gap: 10px; }
  .optional-intro { gap: 12px; }
  .form-footer > div { width: 100%; }
  .form-footer > div > .button { width: 100%; }
  .form-footer > div > p { text-align: center; }
  .form-footer > .button { font-size: 14px; }
}

/* 諮詢預約：自行填寫日期時間 */
.custom-slot { margin-top: 12px; }
.custom-slot > .pick { width: 100%; }
.custom-fields { margin-top: 16px; padding: 18px 18px 0; background: #f7fafb; border: 1px solid var(--line); border-radius: 10px; }
.custom-fields .field { margin-bottom: 18px; }

/* 選擇頁：一開始先問是否保留資料 */
.keep-box { margin: -8px 0 26px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.keep-box.invalid { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.keep-q { margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.keep-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.keep-opt { min-height: 0; padding: 14px 16px; }
.keep-opt:has(input:checked) { background: #eaf2f5; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.keep-opt b { display: block; font-size: 16px; }
.keep-opt small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.keep-box .hint, .keep-box .inline-error { margin: 10px 0 0; }
.keep-done { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 18px; }
.keep-done p { flex: 1; margin: 0; font-size: 15px; color: var(--ink); }
.keep-done .k { display: inline-block; margin-right: 10px; font-size: 13px; color: var(--muted); }
.keep-ok { color: var(--green); font-weight: 700; }
@media (max-width: 740px) { .keep-opts { grid-template-columns: 1fr; } .keep-done .k { display: block; margin: 0; } }

/* 產生器必填標示 */
.field-legend { display: block; font-weight: 600; font-size: 16px; margin-bottom: 10px; padding: 0; color: var(--ink); }
.consent-box.invalid, .remainder-check.invalid .check { border-color: var(--error); }
.consent-box.invalid { box-shadow: inset 0 0 0 1px var(--error); }
.date-fields.invalid input { border-color: var(--error); }
.mode-options.invalid .mode-card { border-color: var(--error); }
.remainder-check .inline-error { margin: -6px 0 6px 33px; }

/* 我的文件：正式遺囑／草稿／保存設定 */
.panel-head h2 .tag { margin-left: 10px; vertical-align: 3px; font-family: var(--sans, inherit); }
.history { padding: 14px 0 4px; border-top: 1px dashed var(--line); margin-top: 6px; }
.history .k { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--ink); padding: 4px 0; }
.draft-panel .draft-warn { margin: 12px 0 14px; }
.draft-panel .button-row { flex-wrap: wrap; }
.keep-panel .keep-box { margin: 4px 0 0; border: 0; padding: 0; }
.keep-panel .keep-box.keep-done { padding: 4px 0; }
.client-row .who .k + .k { display: block; margin-top: 2px; color: var(--green); }
.edit-note .button.text { margin-left: 8px; }
.version-tag { margin: 4px 0 14px; padding: 8px 12px; background: var(--bg); border-radius: 8px; font-size: 14px; color: var(--ink); word-break: break-all; }
.version-tag .k { display: block; font-size: 12px; color: var(--muted); }

/* ---------- 2026-11-10 回饋：遺囑中心介紹、多順位備位執行人 ---------- */
.about-center { margin-top: 36px; padding: 30px 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.about-center .eyebrow { font-size: 11px; display: block; margin-bottom: 9px; }
.about-center h2 { font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--ink); }
.about-center p { margin-top: 12px; font-size: 15px; line-height: 1.8; }
.about-center h3 { margin-top: 22px; font-size: 16px; color: var(--ink); }
.about-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.about-list li { padding: 16px 18px; background: #f4f8f8; border-radius: 10px; border-left: 3px solid var(--green); }
.about-list b { display: block; color: var(--ink); margin-bottom: 6px; }
.about-list span { font-size: 14px; line-height: 1.7; color: var(--muted); }
.backup-row { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.backup-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.backup-head b { color: var(--ink); }
@media (max-width: 760px) {
  .about-center { padding: 22px 18px; }
  .about-list { grid-template-columns: 1fr; }
}
.welcome .about-center { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 760px) { .welcome .about-center { margin-top: 40px; } }

/* ---------- 2026-11-13 新增：提示框、邀請連結與 QR code、對話框 ---------- */
.notice-box { margin: 0 0 20px; padding: 14px 18px; border: 2px solid var(--error); border-radius: 8px; background: #fff9f8; color: var(--ink); font-size: 15px; }
.invite-box { margin: 8px 0 20px; text-align: center; }
.invite-box .qr { background: #fff; display: flex; align-items: center; justify-content: center; }
.invite-box .qr img, .invite-box .qr canvas { width: 148px; height: 148px; }
.invite-box .field { text-align: left; }
.invite-box input[readonly] { font-size: 13px; }
.client-name { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .35); }
.modal { width: min(100%, 460px); padding: 24px; border-radius: 10px; background: #fff; box-shadow: 0 8px 32px rgba(0, 0, 0, .2); }
.modal h2 { font-size: 19px; margin-bottom: 8px; }
.modal .button-row { margin-top: 16px; }

/* hidden 屬性一律隱藏（.button 的 display 會蓋掉瀏覽器預設） */
[hidden] { display: none !important; }

/* 客戶名單每列按鈕多時自動換行，不互相遮住 */
.client-row { flex-wrap: wrap; }
.row-actions { flex-wrap: wrap; flex-shrink: 1; justify-content: flex-end; }

/* 列印自書遺囑草稿：只印草稿本身（不印範例提示、「全文草稿已產生」、核對與修改、附錄摺疊、側欄） */
@media print {
  .result-main > *:not(.manuscript) { display: none !important; }
  .result-main .manuscript { margin: 0; padding: 0; }
}
@media print {
  @page { size: A4; margin: 14mm 16mm; }
  .result-main .manuscript { font-size: 11pt; line-height: 1.6; }
  .result-main .manuscript h2 { font-size: 18pt; margin: 6px 0 10px; letter-spacing: .3em; }
  .result-main .manuscript .document-meta { font-size: 8pt; padding-bottom: 4px; }
  .result-main .manuscript .document-body { white-space: pre-wrap; }
  .result-main .manuscript .document-footer { font-size: 8.5pt; margin-top: 10px; }
}

/* 隱私權政策頁：一、短版告知　二、完整政策（2026-11-17） */
.privacy-notice { margin-top: 10px; font-size: 15px; line-height: 1.8; }
.privacy-notice h2, .policy > h2 { font-size: 20px; margin-bottom: 8px; }
.policy > h2 { margin-top: 36px; }
.privacy-notice dt { font-weight: 700; margin-top: 6px; }
.privacy-notice dd { margin: 0; }
.consent-line a { color: inherit; text-decoration: underline; }
.policy section { margin-top: 26px; }
.policy h3 { font-size: 17px; margin-bottom: 8px; }
.policy p, .policy li { font-size: 15px; line-height: 1.8; }
.policy ul { padding-left: 1.3em; }
.policy .table-wrap { overflow-x: auto; }
.policy table { width: 100%; border-collapse: collapse; font-size: 14px; }
.policy th, .policy td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy thead th { background: #eef2f1; }
.policy-date { margin-top: 26px; color: #6f8088; }

/* 讀取動畫（2026-11-17）：淡淡的 Logo 底圖上，深藍 Logo 從正上方順時針畫滿一圈 */
#loading { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(247, 249, 248, .82); }
#loading[hidden] { display: none; }
#loading p { font-size: 14px; letter-spacing: .12em; color: var(--ink); }
.loading-mark { position: relative; width: 72px; height: 72px; }
.loading-mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.loading-ghost { opacity: .14; }
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.loading-sweep {
  -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0);
  mask: conic-gradient(#000 var(--sweep), transparent 0);
  animation: loading-clockwise 1.4s cubic-bezier(.45, .05, .35, 1) infinite;
}
@keyframes loading-clockwise {
  0% { --sweep: 0deg; opacity: 1; }
  80% { --sweep: 360deg; opacity: 1; }
  100% { --sweep: 360deg; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-sweep { animation: none; -webkit-mask: none; mask: none; }
}

/* 邀請親友新流程（2026-11-17）：QR code 放在名單中那個人的那一列 */
.invite-form { padding-bottom: 6px; }
.invite-form .field > .field-label { margin-top: 18px; display: block; }
.invite-member.open { border: 1px solid #d7e3df; border-radius: 10px; background: #f6f9f8; padding: 0 14px; margin: 8px 0; }
.invite-panel { padding: 4px 0 14px; text-align: center; }
.invite-panel h3 { font-size: 16px; margin: 6px 0 4px; }
.notice-inline { font-size: 13px; color: #8a5a12; background: #fdf3e2; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.share-sum { display: block; margin-top: 2px; }
.share-sum .button.small { padding: 0 4px; min-height: 0; font-size: 12px; }

/* 親友剛接受、待邀請人確認「是本人」的提示（我的文件、邀請親友頁） */
.family-confirm { background: #fdf3e2; border: 1px solid #f0d9ae; border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; color: #5c3d0b; }
.family-confirm p { margin: 0 0 6px; }
.family-confirm .button-row { margin: 0; gap: 8px; }
.invite-member .family-confirm { margin: 0 0 10px; padding: 8px 12px; font-size: 14px; }
.accepted-by { display: block; }
