@font-face { font-family: "Noto Serif SC"; src: url("/assets/fonts/NotoSerifSC-VF.ttf") format("truetype-variations"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans SC"; src: url("/assets/fonts/NotoSansSC-VF.ttf") format("truetype-variations"); font-style: normal; font-weight: 100 900; font-display: swap; }

:root {
  --wine: #742337;
  --wine-dark: #4b1422;
  --red: #a51f39;
  --gold: #b88b37;
  --gold-light: #e2c77c;
  --ink: #2b2522;
  --muted: #746d67;
  --line: #e8e0d6;
  --paper: #fffdf8;
  --canvas: #f4efe8;
  --success: #486b58;
  font-family: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .24; z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 32px 22px 24px;
  background: var(--wine-dark); color: #f8ece5; display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar::before {
  content: ""; position: absolute; width: 240px; height: 240px; border: 1px solid rgba(226,199,124,.16);
  border-radius: 50%; left: -126px; bottom: 80px; box-shadow: 0 0 0 34px rgba(226,199,124,.04), 0 0 0 70px rgba(226,199,124,.025);
}
.brand { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 58px; }
.brand-seal, .seal-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--gold-light);
  color: var(--gold-light); font-family: "Kaiti SC", cursive; font-size: 22px; transform: rotate(-4deg);
}
.brand strong { display: block; font-size: 17px; letter-spacing: .14em; font-weight: 600; }
.brand small { display: block; margin-top: 5px; color: rgba(248,236,229,.48); font: 8px/1.2 Georgia, serif; letter-spacing: .18em; }
nav { position: relative; display: grid; gap: 8px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 13px 14px; color: rgba(255,255,255,.64); text-decoration: none; border-radius: 2px; transition: .2s ease; }
.nav-item b { order: -1; color: rgba(226,199,124,.46); font: 10px Georgia, serif; letter-spacing: .08em; }
.nav-item span { font-size: 14px; letter-spacing: .12em; }
.nav-item em { margin-left: auto; padding: 2px 5px; border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.35); font-size: 9px; font-style: normal; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active::after { content: ""; position: absolute; right: 0; top: 12px; bottom: 12px; width: 2px; background: var(--gold-light); }
.nav-item.disabled { cursor: default; }
.sidebar-note { position: relative; margin-top: auto; padding: 17px 14px; border: 1px solid rgba(226,199,124,.18); background: rgba(0,0,0,.08); }
.sidebar-note span { color: var(--gold-light); font-size: 11px; letter-spacing: .14em; }
.sidebar-note p { margin: 8px 0 0; color: rgba(248,236,229,.5); font-size: 11px; line-height: 1.8; }
.signed-in-user { position: relative; display: grid; gap: 3px; margin-top: 14px; padding: 10px 12px; border-left: 1px solid rgba(226,199,124,.3); }
.signed-in-user strong { color: #f4e8df; font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.signed-in-user span { color: rgba(255,255,255,.43); font-size: 8px; letter-spacing: .12em; }
.logout-button { position: relative; margin-top: 16px; padding: 10px; border: 0; background: transparent; color: rgba(255,255,255,.45); font-size: 11px; letter-spacing: .12em; }

main { padding: 38px clamp(28px, 4vw, 64px) 80px; max-width: 1480px; width: 100%; margin: 0 auto; }
.topbar, .panel-heading, .records-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font: 10px/1 Georgia, serif; letter-spacing: .24em; }
.topbar h1, .panel-heading h2, .records-heading h2 { margin: 0; font-weight: 500; letter-spacing: .08em; }
.topbar h1 { font-size: clamp(25px, 3vw, 36px); }
.new-button, .primary-button {
  border: 0; background: var(--wine); color: #fff; padding: 13px 20px; box-shadow: 0 7px 20px rgba(75,20,34,.14);
  letter-spacing: .08em; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.new-button:hover, .primary-button:hover { transform: translateY(-1px); background: #651d2e; box-shadow: 0 10px 24px rgba(75,20,34,.2); }
.new-button span { color: var(--gold-light); font-size: 18px; margin-right: 7px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 34px 0 28px; background: var(--line); border: 1px solid var(--line); }
.stats article { position: relative; padding: 22px 24px; background: rgba(255,253,248,.78); overflow: hidden; }
.stats article::after { content: ""; position: absolute; width: 54px; height: 54px; right: -22px; bottom: -22px; border: 1px solid rgba(184,139,55,.18); border-radius: 50%; }
.stats span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .11em; }
.stats strong { display: inline-block; margin: 7px 9px 0 0; font: 31px/1 Georgia, serif; font-weight: normal; }
.stats small { color: #a0978f; font-size: 10px; }
.stats .published strong { color: var(--success); }

.workspace-grid { display: grid; grid-template-columns: minmax(480px, 1.35fr) minmax(270px, .65fr); gap: 24px; align-items: stretch; }
.paper-panel { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 18px 54px rgba(56,43,31,.06); }
.form-panel { padding: clamp(24px, 3vw, 40px); }
.panel-heading { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .records-heading h2 { font-size: 21px; }
.step-chip { padding: 5px 9px; border: 1px solid #d8c5a3; color: #90703b; font-size: 10px; letter-spacing: .08em; }
#agreementForm { padding-top: 28px; }
.draft-required-note { display: flex; align-items: center; gap: 7px; margin: -8px 0 24px; color: #8c7d73; font-size: 9px; line-height: 1.6; }
.draft-required-note i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(165,31,57,.09); }
.template-fieldset { min-width: 0; margin: 0 0 28px; padding: 0 0 27px; border: 0; border-bottom: 1px solid var(--line); }
.template-fieldset legend { display: flex; align-items: end; justify-content: space-between; width: 100%; margin-bottom: 13px; color: #665d57; font-size: 12px; letter-spacing: .08em; }
.template-fieldset legend small { color: #aaa19a; font-size: 9px; font-weight: normal; letter-spacing: .03em; }
.template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.template-card { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 70px; padding: 9px; border: 1px solid #e2dad2; background: #fffefa; cursor: pointer; transition: .2s ease; }
.template-card:hover { border-color: #c8ab72; transform: translateY(-1px); }
.template-card > input { position: absolute; opacity: 0; pointer-events: none; }
.template-card:has(input:checked) { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 7px 18px rgba(75,20,34,.07); }
.template-card:has(input:checked)::after { content: "✓"; position: absolute; right: 7px; top: 5px; color: var(--wine); font: 10px Georgia, serif; }
.template-card.locked { opacity: .38; cursor: not-allowed; }
.template-visual { position: relative; display: grid; place-items: center; width: 46px; height: 52px; overflow: hidden; border: 1px solid #c9bcae; background: #f7efe4; }
.template-visual i { position: absolute; left: 4px; top: 3px; color: rgba(50,45,41,.5); font: 5px Georgia, serif; }
.template-visual b { display: block; width: 27px; height: 1px; margin: 2px; background: currentColor; opacity: .65; }
.template-visual b:nth-of-type(2) { width: 20px; }
.template-card[data-tone="night"] .template-visual { color: #d3b66e; background: #152035; }
.template-card[data-tone="sage"] .template-visual { color: #627b6b; background: #edf0e7; border-radius: 23px 23px 0 0; }
.template-card[data-tone="museum"] .template-visual { color: #1f2220; background: linear-gradient(90deg, #1f2220 0 11px, #ece7da 11px); }
.template-card[data-tone="ceremony"] .template-visual { color: #8d2428; border: 2px double #9b3436; background: #fff6e7; }
.template-card[data-tone="classic"] .template-visual { color: #b58b37; border: 2px solid #b58b37; background: #fffdf8; }
.template-card[data-tone="silver"] .template-visual { color: #e8ecef; background: repeating-linear-gradient(165deg, #111518 0 5px, #242a2e 6px 7px); }
.template-card[data-tone="map"] .template-visual { color: #506f80; background-color: #f1eee5; background-image: linear-gradient(#cdd5d5 1px, transparent 1px), linear-gradient(90deg, #cdd5d5 1px, transparent 1px); background-size: 10px 10px; }
.template-card[data-tone="editorial"] .template-visual { color: #292321; background: linear-gradient(90deg, #963b39 0 5px, #f7f3e9 5px); }
.template-copy { min-width: 0; }
.template-copy strong, .template-copy small, .template-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-copy strong { padding-right: 12px; color: #4d4540; font-size: 11px; font-weight: 600; }
.template-copy small { margin-top: 4px; color: #9a8f86; font-size: 8px; letter-spacing: .03em; }
.template-copy em { margin-top: 4px; color: #b2a69d; font-size: 7px; font-style: normal; letter-spacing: 0; }
.couple-fields { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: end; gap: 12px; }
label { display: grid; gap: 9px; color: #665d57; font-size: 12px; letter-spacing: .08em; }
label > span { display: flex; justify-content: space-between; }
label small { color: #aaa19a; font-weight: normal; letter-spacing: 0; }
label small b { color: var(--wine); }
.field-label-copy, .photo-drop-title { display: flex; align-items: center; gap: 7px; }
.draft-required-badge { display: inline-flex; align-items: center; min-height: 16px; padding: 1px 5px 0; border: 1px solid rgba(165,31,57,.28); color: #98253d; background: rgba(165,31,57,.045); font-size: 7px; line-height: 1; letter-spacing: .05em; white-space: nowrap; }
input, textarea, select { width: 100%; border: 1px solid #ded5cc; border-radius: 0; background: #fffefa; color: var(--ink); outline: none; transition: border .2s, box-shadow .2s; }
input, select { height: 43px; padding: 0 13px; }
textarea { resize: vertical; min-height: 102px; padding: 13px; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,139,55,.1); }
input::placeholder, textarea::placeholder { color: #bbb2aa; }
.draft-field-error > input,
.draft-field-error > textarea,
.draft-field-error > select { border-color: var(--red); background: #fff9f8; box-shadow: 0 0 0 3px rgba(165,31,57,.08); animation: required-nudge .28s ease-out; }
.draft-field-error > span:first-child { color: var(--red); }
.heart-link { margin-bottom: 13px; color: var(--red); text-align: center; font-size: 12px; }
.wide-field { margin-top: 23px; }
.text-style-fieldset { min-width: 0; margin: 24px 0 0; padding: 18px; border: 1px solid #ded2c4; background: #faf5ec; }
.text-style-fieldset legend { width: 100%; padding: 0 4px; display: flex; align-items: baseline; justify-content: space-between; color: #665d57; font-size: 12px; letter-spacing: .08em; }
.text-style-fieldset legend small { color: #9d9187; font-size: 9px; font-weight: 400; letter-spacing: 0; }
.text-style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.text-style-card { min-width: 0; padding: 13px; border: 1px solid #e5dbcf; background: #fffdf9; }
.text-style-card h3 { margin: 0 0 13px; color: #574d47; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.text-style-card label { gap: 5px; margin-top: 10px; font-size: 9px; letter-spacing: .03em; }
.text-style-card label > span { align-items: center; }
.text-style-card select { height: 34px; padding: 0 8px; font-size: 9px; }
.text-style-card input[type="range"] { height: 22px; padding: 0; accent-color: var(--wine); }
.text-style-card output { color: var(--wine); font: 10px Georgia, serif; }
.font-license-note { margin: 12px 0 0; color: #8d8177; font-size: 8px; line-height: 1.65; }
.detail-fields, .location-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 21px; }
.detail-fields { align-items: start; }
.detail-fields .order-field { grid-column: 1; grid-row: 3; }
.detail-fields .phone-field { grid-column: 1; grid-row: 4; }
.detail-fields .id-card-field { grid-column: 2; grid-row: 4; }
.id-card-field > small { color: var(--muted); font-size: 11px; }
.detail-fields .sku-field { grid-column: 2; grid-row: 3; }
.voice-notice { display: flex; align-items: center; gap: 18px; margin-top: 21px; padding: 16px 18px; border: 1px solid rgba(110,121,129,.42); color: #dfe4e7; background: #171c20; }
.voice-notice b { display: block; font-size: 11px; font-weight: 400; letter-spacing: .08em; }
.voice-notice p { margin: 5px 0 0; color: #879198; font-size: 9px; line-height: 1.6; }
.voice-mini-wave { display: flex; align-items: center; gap: 2px; width: 58px; height: 34px; flex: 0 0 auto; }
.voice-mini-wave i { width: 2px; height: 20%; background: #dfe4e7; }
.voice-mini-wave i:nth-child(2), .voice-mini-wave i:nth-child(6) { height: 50%; }
.voice-mini-wave i:nth-child(3), .voice-mini-wave i:nth-child(5) { height: 85%; }
.voice-mini-wave i:nth-child(4) { height: 100%; }
.photo-upload-panel { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 14px; margin-top: 21px; padding: 14px; border: 1px solid #d5c4ad; background: #f6eddf; }
.photo-upload-panel.draft-field-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(165,31,57,.08); animation: required-nudge .28s ease-out; }
.photo-drop { position: relative; min-height: 92px; display: grid; place-items: center; padding: 16px; border: 1px dashed #b7956f; color: #59483f; background: rgba(255,253,248,.62); cursor: pointer; text-align: center; transition: border-color .18s, background .18s; }
.photo-drop:hover { border-color: var(--wine); background: #fffaf1; }
.photo-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-drop b, .photo-drop small { display: block; }
.photo-drop-title { justify-content: center; }
.photo-drop b { font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.photo-drop small { max-width: 330px; margin-top: 7px; color: #8a7768; font-size: 9px; line-height: 1.65; }
.photo-drop:focus-within { outline: 2px solid var(--wine); outline-offset: 2px; }
.photo-upload-preview { min-height: 92px; display: grid; place-items: center; overflow: hidden; color: #8d7d70; background: #e8ddce; font-size: 8px; line-height: 1.6; text-align: center; }
.photo-upload-preview img { width: 100%; height: 100%; max-height: 118px; object-fit: cover; }
.photo-upload-preview span { padding: 12px; }
.draft-validation-summary { margin: 20px 0 -8px; padding: 11px 13px; border-left: 2px solid var(--red); color: #882039; background: #fbefef; font-size: 10px; line-height: 1.7; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-actions p { margin: 0; color: #8a8179; font-size: 10px; line-height: 1.7; }
.form-actions i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--gold); }
.form-actions > div { display: flex; gap: 8px; flex: 0 0 auto; }
.cancel-button { padding: 12px 15px; border: 1px solid #d7cec5; color: #766c64; background: transparent; }

.certificate-preview { padding: 24px; background: #d9cbb9; background-image: linear-gradient(135deg, rgba(255,255,255,.35), transparent 60%); display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; }
.certificate-preview > p { margin: 13px 0 0; color: #756858; font-size: 9px; letter-spacing: .1em; }
.preview-paper { width: min(100%, 288px); aspect-ratio: 334 / 472; padding: 12px; background: #fffefa; box-shadow: 0 18px 40px rgba(52,36,18,.16); transform: rotate(.6deg); transition: transform .3s ease; }
.preview-paper:hover { transform: rotate(0) scale(1.012); }
.preview-border { height: 100%; padding: 30px 17px 15px; border: 2px solid var(--gold); text-align: center; display: flex; flex-direction: column; }
.preview-index { margin: -18px 0 5px; color: #aa9f95; font: 8px Georgia, serif; text-align: left; }
.preview-title { margin: 0 0 15px; color: var(--gold); font-size: 15px; font-weight: 600; letter-spacing: .28em; }
.vow-copy { margin: 0 0 12px; color: #a94c58; font-size: clamp(6px, .64vw, 8px); line-height: 1.9; letter-spacing: .02em; text-align: center; }
.vow-line { display: block; white-space: nowrap; }
.vow-lobes { display: flex; justify-content: center; gap: 2em; }
.preview-names { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: auto; align-items: center; font-size: 8px; }
.preview-names span { padding-bottom: 3px; border-bottom: 1px solid #e6ddd3; }
.preview-names i { color: var(--red); font-style: normal; font-size: 7px; }
.preview-border blockquote { margin: 15px 0 10px; min-height: 28px; padding: 8px 5px; border-top: 1px solid #eee7df; border-bottom: 1px solid #eee7df; color: #4b423d; font-size: 7px; line-height: 1.6; }
.preview-wave { height: 55px; margin: 3px 0 8px; background: #131a20; }
.preview-footer { display: flex; align-items: end; justify-content: space-between; color: #9f948b; font: 5px Georgia, serif; letter-spacing: .1em; }
.mini-seal { display: grid; place-items: center; width: 43px; height: 43px; margin-left: auto; margin-right: 12px; border: 2px double #c99f3f; border-radius: 50%; color: #b68c31; font-size: 6px; line-height: 1.5; }
.qr-placeholder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 34px; height: 34px; padding: 3px; background: repeating-linear-gradient(45deg, #231f1d 0 2px, #fff 2px 4px); }
.qr-placeholder b { align-self: start; aspect-ratio: 1; border: 3px solid #231f1d; background: #fff; }
.preview-paper[data-template="chosen_stars"] { color: #d8bb72; background: #121b2d; }
.preview-paper[data-template="chosen_stars"] .preview-border { border-color: #60708c; }
.preview-paper[data-template="chosen_stars"] .preview-title, .preview-paper[data-template="chosen_stars"] .vow-copy { color: #d8bb72; }
.preview-paper[data-template="chosen_stars"] .preview-names, .preview-paper[data-template="chosen_stars"] blockquote { color: #f5eee2; }
.preview-paper[data-template="growing_together"] { background: #eef0e7; }
.preview-paper[data-template="growing_together"] .preview-border { border-color: #738675; border-radius: 110px 110px 0 0; }
.preview-paper[data-template="growing_together"] .preview-title { color: #33473b; }
.preview-paper[data-template="growing_together"] .vow-copy { color: #33473b; }
.preview-paper[data-template="time_archive"] { background: #ede8dc; }
.preview-paper[data-template="time_archive"] .preview-border { border-color: #9a7f4a; text-align: left; }
.preview-paper[data-template="time_archive"] .vow-copy { color: #1f2220; }
.preview-paper[data-template="mutual_ritual"] .preview-border { border: 4px double #8d2428; }
.preview-paper[data-template="mutual_ritual"] .preview-title { color: #8d2428; }
.preview-paper[data-template="mutual_ritual"] .vow-copy { color: #8d2428; }
.preview-paper[data-template="classic_agreement"] .vow-copy { color: #77706b; }
.preview-paper[data-template="silver_soundwave"] { color: #edf1f3; background: repeating-linear-gradient(165deg, #111518 0 8px, #1e2428 9px 10px); }
.preview-paper[data-template="silver_soundwave"] .preview-border { border-color: #6f7981; text-align: left; }
.preview-paper[data-template="silver_soundwave"] .preview-title, .preview-paper[data-template="silver_soundwave"] .preview-names, .preview-paper[data-template="silver_soundwave"] blockquote { color: #edf1f3; }
.preview-paper[data-template="silver_soundwave"] .vow-copy, .preview-paper[data-template="silver_soundwave"] .preview-index { color: #aeb6be; }
.preview-paper[data-template="silver_soundwave"] blockquote { border-color: #4b545a; }
.preview-paper[data-template="silver_soundwave"] .mini-seal { border-radius: 0; border-color: #8d979e; color: #c8d0d5; }
.preview-paper[data-template="love_coordinates"] { background-color: #f2efe7; background-image: linear-gradient(#d7dddc 1px, transparent 1px), linear-gradient(90deg, #d7dddc 1px, transparent 1px); background-size: 16px 16px; }
.preview-paper[data-template="love_coordinates"] .preview-border { border-color: #5f7b8a; }
.preview-paper[data-template="love_coordinates"] .preview-title { color: #334d5c; }
.preview-paper[data-template="love_coordinates"] .vow-copy { color: #b45c54; background: #f2efe7; }
.preview-paper[data-template="our_chapter"] { background: linear-gradient(90deg, #9a3938 0 10px, #f7f4ed 10px); }
.preview-paper[data-template="our_chapter"] .preview-border { border: 0; border-left: 1px solid #b7aca3; text-align: left; }
.preview-paper[data-template="our_chapter"] .preview-title { color: #312a28; }
.preview-paper[data-template="our_chapter"] .vow-copy { color: #9a3938; }

.records-section { margin-top: 26px; padding: clamp(24px, 3vw, 38px); background: rgba(255,253,248,.72); border: 1px solid var(--line); }
.demo-gallery { margin-bottom: 32px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.demo-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.demo-heading h3 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.demo-heading > p { max-width: 260px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.demo-card { display: flex; align-items: center; gap: 15px; padding: 14px; color: inherit; text-decoration: none; background: #fffdf8; border: 1px solid #e4dcd2; transition: border-color .18s, box-shadow .18s; }
.demo-card:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(77,53,31,.07); }
.demo-card:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.demo-thumbnail { flex: 0 0 70px; width: 70px; height: auto; aspect-ratio: 334 / 472; object-fit: contain; box-shadow: 0 3px 7px rgba(52,36,18,.12); }
.demo-copy { min-width: 0; }
.demo-meta { display: block; color: #958675; font-size: 9px; letter-spacing: .04em; }
.demo-copy strong { display: block; margin: 6px 0; color: #44352f; font-size: 14px; font-weight: 500; }
.demo-story { display: block; color: #8f8277; font-size: 10px; line-height: 1.6; }
.demo-action { display: inline-block; margin-top: 10px; padding: 6px 10px; color: #fffdf8; background: var(--wine); font-size: 12px; line-height: 1.4; }
.records-heading { margin-bottom: 24px; }
.record-heading-tools { display: grid; justify-items: end; gap: 9px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.filters input { width: 170px; }
.filters #searchInput { width: 310px; }
.filters select { width: 130px; }
.batch-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; color: #877970; font-size: 9px; }
.batch-toolbar label { display: flex; grid-template-columns: none; align-items: center; gap: 6px; }
.batch-toolbar input[type="checkbox"], .record-select input { width: 15px; height: 15px; margin: 0; accent-color: var(--wine); }
.batch-toolbar select { width: 112px; height: 32px; padding: 0 25px 0 8px; font-size: 9px; }
.batch-toolbar #pdfBatchMode { width: 180px; }
.batch-hint { margin: 0; color: #877970; font-size: 10px; line-height: 1.7; }
.batch-toolbar button { height: 32px; padding: 0 13px; border: 1px solid var(--wine); color: #fff; background: var(--wine); font-size: 9px; }
.batch-toolbar button:disabled { cursor: not-allowed; opacity: .38; }
.record-list { display: grid; gap: 10px; }
.record-card { display: grid; grid-template-columns: 22px minmax(185px, 1.1fr) minmax(180px, 1fr) 105px 58px minmax(145px, auto); align-items: center; gap: 15px; padding: 17px 18px; background: #fffefa; border: 1px solid #e8e0d7; transition: border .2s, transform .2s, box-shadow .2s; animation: rise .36s ease both; }
.record-card.silver-record { border-left: 3px solid #727d84; background: linear-gradient(90deg, #f2f3f3, #fffefa 16%); }
.record-card:hover { transform: translateY(-1px); border-color: #d3b987; box-shadow: 0 8px 22px rgba(51,35,24,.06); }
.record-card.is-selected { border-color: #b88b37; box-shadow: inset 3px 0 #b88b37; }
.record-select { display: grid; place-items: center; }
.record-select span { display: block; width: 15px; height: 15px; border: 1px solid #e2dad1; background: #f5f0e9; }
.couple-name { display: flex; align-items: center; gap: 9px; }
.couple-name strong { font-size: 15px; font-weight: 600; }
.couple-name i { color: var(--red); font-size: 9px; font-style: normal; }
.record-identity-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.record-code { color: #a29a93; font: 9px Georgia, serif; letter-spacing: .08em; }
.template-chip { padding: 3px 5px; color: #806f62; background: #f3ece2; font-size: 8px; }
.order-chip { padding: 3px 5px; color: #59666c; background: #edf0f1; font-size: 8px; }
.phone-chip, .id-card-chip { padding: 3px 5px; color: #655d70; background: #f0edf3; font-size: 8px; }
.record-middle { min-width: 0; }
.record-message { color: #6c635d; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-note { margin-top: 8px; color: #805f35; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-note.empty { color: #aaa098; }
.page-size-field { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 11px; }
.page-size-field select { width: 90px; height: 33px; }
.published-edit-notice { margin: 18px 0 0; padding: 12px 14px; color: #805f35; background: #fbf5e9; border: 1px solid #ddc9aa; font-size: 12px; line-height: 1.7; }
.shipping-status { padding: 3px 6px; border: 1px solid #ddc9aa; color: #927037; background: #fbf5e9; font-size: 9px; white-space: nowrap; }
.shipping-status.shipped { color: var(--success); border-color: #b7cbbb; background: #f5faf6; }
.record-date { margin-top: 5px; color: #9b9189; font-size: 8px; }
.voice-state { display: inline-block; margin-top: 6px; padding: 3px 6px; border: 1px solid #aab2b6; color: #69747a; font-size: 8px; }
.voice-state.uploaded { color: #9a6b33; border-color: #c9a875; }
.voice-state.approved { color: var(--success); border-color: #94b29f; }
.voice-state.rejected { color: var(--red); border-color: #c69ca5; }
.photo-state { display: inline-block; margin-top: 6px; padding: 3px 6px; color: #795846; border: 1px solid #c6aa8d; background: #fbf2e7; font-size: 8px; }
.record-signals b, .record-signals small, .record-signals em { display: block; }
.record-signals b { color: var(--ink); font: 18px Georgia, serif; font-weight: normal; }
.record-signals small { margin-top: 2px; color: #827970; font-size: 7px; }
.record-signals em { margin-top: 5px; color: #aaa098; font-size: 7px; font-style: normal; }
.record-status { justify-self: start; padding: 5px 8px; font-size: 9px; letter-spacing: .08em; border: 1px solid #d9cfc5; color: #80766e; }
.record-status.published { color: var(--success); border-color: #b7cbbb; background: #f5faf6; }
.record-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: end; }
.record-actions button, .record-actions a { min-width: 64px; padding: 8px 10px; border: 1px solid #d8cec4; background: transparent; color: #635952; font-size: 10px; text-align: center; text-decoration: none; transition: .18s; }
.record-actions button:hover, .record-actions a:hover { border-color: var(--wine); color: var(--wine); }
.record-actions .generate { background: var(--wine); border-color: var(--wine); color: #fff; }
.record-actions .generate:hover { background: #5f1b2b; color: #fff; }
.record-actions .voice-link, .record-actions .voice-review { border-color: #89949a; color: #59666c; }
.record-actions .delete { border-color: #d8b9bf; color: #9a3348; }
.record-actions .fulfillment-edit { border-color: #c8b084; color: #805f35; }
.record-actions .delete:hover { border-color: #9a3348; color: #fff; background: #9a3348; }
.record-actions button:disabled { cursor: wait; opacity: .55; }
.empty-state { padding: 60px 20px; text-align: center; color: #948a82; }
.empty-state div { color: #caa4ad; font-size: 32px; }
.empty-state h3 { margin: 12px 0 6px; color: #5f5650; font-size: 16px; font-weight: normal; }
.empty-state p { margin: 0; font-size: 11px; }
.record-pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #e6ddd4; }
.record-pagination p { margin: 0; color: #998e85; font: 9px/1.5 Georgia, "Songti SC", serif; letter-spacing: .06em; }
.record-pagination nav { display: flex; align-items: center; gap: 5px; }
.record-pagination button { display: grid; place-items: center; min-width: 34px; height: 32px; padding: 0 9px; border: 1px solid #d9cec3; color: #695f58; background: #fffefa; font-size: 9px; transition: border-color .18s, color .18s, background .18s, transform .18s; }
.record-pagination button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--wine); color: var(--wine); }
.record-pagination .page-direction { min-width: 58px; }
.record-pagination .page-number[aria-current="page"] { color: #fff; border-color: var(--wine); background: var(--wine); }
.record-pagination button:disabled:not([aria-current="page"]) { cursor: not-allowed; opacity: .38; }
.page-ellipsis { width: 24px; color: #afa49b; text-align: center; font: 10px Georgia, serif; }

.settings-section { margin-top: 26px; padding: clamp(24px, 3vw, 38px); border: 1px solid #d9cdbf; background: #eee5d9; background-image: linear-gradient(135deg, rgba(255,255,255,.58), transparent 58%); }
.settings-section .records-heading { align-items: end; }
.settings-intro { max-width: 430px; margin: 0; color: #83786f; font-size: 9px; line-height: 1.8; text-align: right; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.template-content-card { margin-bottom: 15px; }
.print-layout-card { margin-bottom: 15px; background: linear-gradient(118deg, rgba(255,253,248,.96), rgba(245,235,221,.92)); }
.print-layout-form { display: grid; grid-template-columns: minmax(230px, 1.45fr) repeat(5, minmax(92px, .72fr)); gap: 12px; align-items: end; }
.print-layout-form label { gap: 6px; color: #766b63; font-size: 9px; }
.print-layout-form select, .print-layout-form input { height: 38px; font-size: 10px; }
.print-layout-form input[readonly] { color: #85796f; background: #f3eee7; cursor: default; }
.print-layout-actions { display: flex; grid-column: 1 / -1; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.print-layout-actions p { margin: 0 auto 0 0; color: #8c8178; font-size: 8px; line-height: 1.65; }
.print-layout-actions button { min-height: 38px; padding: 0 15px; border: 1px solid #cdbdae; color: #715f52; background: transparent; font-size: 9px; }
.print-layout-actions button[type="submit"] { border-color: var(--wine); color: #fff; background: var(--wine); }
.print-layout-actions button:disabled { cursor: not-allowed; opacity: .45; }
.classic-name-offset-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.classic-name-offset-copy h4 { margin: 0 0 10px; font-size: 15px; color: var(--wine); }
.classic-name-offset-form p { margin: 7px 0; color: #766b63; font-size: 12px; line-height: 1.7; }
.classic-name-offset-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0 10px; }
.classic-name-offset-controls label { width: 180px; font-size: 12px; gap: 6px; }
.classic-name-offset-controls input { height: 40px; font-size: 14px; }
.classic-name-offset-controls button { min-height: 40px; padding: 0 20px; border: 1px solid var(--wine); background: var(--wine); color: #fff; font-size: 12px; }
.classic-name-offset-controls button:disabled { opacity: .45; cursor: not-allowed; }
.classic-name-offset-form #classicNameOffsetStatus { color: #715f52; font-weight: 600; }
.template-content-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .75fr); gap: 22px; align-items: stretch; }
.template-content-form { display: grid; gap: 13px; }
.template-content-form label { gap: 6px; color: #766b63; font-size: 9px; }
.template-content-template select { height: 38px; }
.common-content-block { min-width: 0; margin: 0; padding: 14px; border: 1px solid #e4dacd; background: #fffefa; }
.common-content-block legend { padding: 0 7px; color: var(--wine); font-size: 10px; letter-spacing: .08em; }
.common-copy-field input, .common-copy-field textarea { font-size: 11px; }
.common-copy-field textarea { min-height: 118px; resize: vertical; line-height: 1.8; }
.common-style-row { display: grid; grid-template-columns: 1fr 1.25fr .7fr; gap: 10px; margin-top: 12px; }
.common-style-row select { height: 34px; }
.common-style-row input[type="range"] { height: 34px; padding: 0; box-shadow: none; accent-color: var(--wine); }
.common-style-row output { color: var(--wine); font: 9px Georgia, serif; }
.template-content-actions { display: flex; justify-content: flex-end; gap: 8px; }
.template-content-actions button { min-height: 38px; padding: 0 15px; border: 1px solid #cdbdae; color: #715f52; background: transparent; font-size: 9px; }
.template-content-actions button[type="submit"] { border-color: var(--wine); color: #fff; background: var(--wine); }
.template-content-actions button:disabled { cursor: wait; opacity: .55; }
.template-common-preview { display: flex; min-height: 330px; padding: 28px 22px; flex-direction: column; justify-content: center; text-align: center; border: 1px solid #d8c8b8; background: #fbf2e7; box-shadow: inset 0 0 0 6px #f4e8d9; overflow: hidden; }
.template-common-preview > span { margin-bottom: 32px; color: #9d8262; font: 8px Georgia, serif; letter-spacing: .12em; }
.template-common-preview strong { display: block; color: #713047; font-size: 18px; font-weight: 400; letter-spacing: .13em; overflow-wrap: anywhere; }
.template-common-preview > div { display: grid; gap: 7px; margin: 30px 0; color: #776158; font-size: 10px; line-height: 1.55; }
.template-common-preview > div span { overflow-wrap: anywhere; }
.template-common-preview p { margin: auto 0 0; color: #9a8c81; font-size: 8px; line-height: 1.6; }
.settings-grid .option-card:last-child { grid-column: 1 / -1; }
.option-card { min-width: 0; padding: 22px; border: 1px solid #ded3c7; background: rgba(255,253,248,.88); box-shadow: 0 10px 28px rgba(63,45,31,.04); }
.option-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; padding-bottom: 14px; border-bottom: 1px solid #ebe2d8; }
.option-card header > div { display: flex; align-items: baseline; gap: 10px; }
.option-card header span { color: #b79455; font: 10px Georgia, serif; letter-spacing: .08em; }
.option-card h3 { margin: 0; color: #514843; font-size: 15px; font-weight: 500; letter-spacing: .1em; }
.option-card header small { color: #aaa097; font-size: 8px; letter-spacing: .12em; }
.option-list { display: grid; gap: 6px; min-height: 56px; }
.option-row { display: grid; grid-template-columns: minmax(100px, 1fr) 86px 54px; align-items: center; gap: 10px; min-height: 40px; padding: 7px 8px 7px 13px; border: 1px solid #ece4db; background: #fffefa; transition: border-color .18s, background .18s; }
.option-row.is-default { border-color: #d4bd8e; background: #fffaf0; }
.option-row strong { overflow: hidden; color: #5d544e; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.default-choice { display: flex; grid-template-columns: none; align-items: center; justify-content: flex-start; gap: 6px; cursor: pointer; color: #8f8175; font-size: 8px; letter-spacing: .04em; }
.default-choice > span { display: inline; white-space: nowrap; }
.default-choice input { width: 13px; height: 13px; margin: 0; accent-color: var(--wine); box-shadow: none; }
.option-row.is-default .default-choice { color: var(--wine); }
.remove-option { height: 26px; padding: 0 7px; border: 1px solid #dfc8cc; color: #9a4a5a; background: transparent; font-size: 8px; transition: .18s; }
.remove-option:hover:not(:disabled) { border-color: #9a3348; color: #fff; background: #9a3348; }
.remove-option:disabled { cursor: not-allowed; color: #b9aea5; border-color: #e7dfd7; }
.option-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid #ebe2d8; }
.option-add-form label { gap: 6px; font-size: 9px; }
.option-add-form input { height: 36px; font-size: 10px; }
.option-add-form button { height: 36px; padding: 0 13px; border: 1px solid var(--wine); color: #fff; background: var(--wine); font-size: 9px; letter-spacing: .05em; }
.option-add-form button:disabled { cursor: wait; opacity: .55; }
.settings-note { margin: 17px 0 0; color: #8c8178; font-size: 8px; line-height: 1.7; }
.settings-note i { display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--gold); }

.insights-section { margin-top: 26px; padding: clamp(24px, 3vw, 38px); background: #2a2522; color: #f6eee5; border: 1px solid #3e3732; }
.insights-section .records-heading h2 { color: #fff; }
.insights-section .filters select, .insights-section .filters input { width: auto; min-width: 105px; color: #e8ddd2; border-color: #554b45; background: #352f2b; }
.insight-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 26px 0 18px; background: #4a413b; border: 1px solid #4a413b; }
.insight-summary article { padding: 18px 15px; background: #312b27; }
.insight-summary span { display: block; color: #a99b8f; font-size: 8px; letter-spacing: .1em; }
.insight-summary strong { display: inline-block; margin-top: 8px; color: #f3e8da; font: 23px Georgia, serif; font-weight: normal; }
.insight-summary small { margin-left: 4px; color: #8f837a; font-size: 7px; }
.metrics-table-wrap { overflow-x: auto; border: 1px solid #443c37; }
.metrics-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 9px; }
.metrics-table th, .metrics-table td { padding: 12px 13px; border-bottom: 1px solid #443c37; text-align: left; white-space: nowrap; }
.metrics-table th { color: #a99b8f; background: #312b27; font-weight: normal; letter-spacing: .08em; }
.metrics-table td { color: #d8cbc0; }
.metrics-table td:first-child b, .metrics-table td:first-child small { display: block; }
.metrics-table td:first-child b { color: #f1e7dc; font-size: 10px; font-weight: normal; }
.metrics-table td:first-child small { margin-top: 3px; color: #776d66; font-size: 7px; }
.metrics-table td.exploring { color: #c5a971; }
.metrics-table td.ready { color: #91b09b; }
.insight-footnote { margin: 15px 0 0; color: #81766e; font-size: 8px; line-height: 1.7; }

.management-section { margin-top: 26px; padding: clamp(24px, 3vw, 38px); border: 1px solid #d9cdbf; background: rgba(255,253,248,.78); }
.management-grid { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(420px, 1.25fr); gap: 18px; align-items: start; }
.operator-form { display: grid; gap: 12px; padding: 20px; border: 1px solid #e1d7cc; background: #f5eee4; }
.operator-form label { gap: 6px; color: #766b63; font-size: 9px; }
.operator-form input { height: 38px; font-size: 10px; }
.operator-form button { height: 40px; border: 1px solid var(--wine); color: #fff; background: var(--wine); font-size: 10px; }
.operator-list { display: grid; gap: 8px; }
.operator-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(100px, .8fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e5dcd3; background: #fffefa; }
.operator-row strong, .operator-row span, .operator-row small { display: block; }
.operator-row strong { font-size: 12px; font-weight: 500; }
.operator-row span { margin-top: 4px; color: #9a8d82; font: 9px Georgia, serif; }
.operator-row small { color: #958a82; font-size: 8px; }
.operator-row button { min-width: 66px; height: 32px; border: 1px solid #cbbeb2; color: #6d6159; background: transparent; font-size: 9px; }
.operator-row.inactive { opacity: .62; }
.operator-row.inactive button { color: var(--success); border-color: #a9c0af; }
.operator-empty { margin: 0; padding: 34px 20px; color: #9a8f86; text-align: center; border: 1px dashed #ded4ca; font-size: 10px; }
.log-section .metrics-table-wrap { border-color: #ddd2c7; }
.log-section .metrics-table { min-width: 900px; }
.log-section .metrics-table th { color: #81756c; background: #eee5da; }
.log-section .metrics-table td { color: #615852; border-color: #e7ddd3; }
.log-section .metrics-table td:first-child { color: #92877f; }
.log-detail { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.log-result-success { color: var(--success) !important; }
.log-result-failure { color: var(--red) !important; }
.log-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; color: #91867e; font-size: 9px; }
.log-pagination p { margin: 0; }
.log-pagination div { display: flex; gap: 7px; }
.log-pagination button { height: 32px; padding: 0 12px; border: 1px solid #d8cdc2; color: #6d625a; background: #fffefa; font-size: 9px; }
.log-pagination button:disabled { opacity: .4; cursor: not-allowed; }

.fulfillment-dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--paper); box-shadow: 0 25px 80px #24150f33; }
.fulfillment-dialog::backdrop { background: #2b252277; backdrop-filter: blur(4px); }
.fulfillment-dialog form { position: relative; padding: 28px 24px; }
.fulfillment-dialog h2 { margin: 0; font-size: 23px; font-weight: normal; }
.fulfillment-record { margin: 12px 0 24px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.fulfillment-dialog label { margin-top: 18px; }
.fulfillment-dialog textarea { min-height: 120px; }
.fulfillment-hint { color: var(--muted); font-size: 11px; line-height: 1.6; }
.fulfillment-error { padding: 10px; color: var(--red); background: #fff1f2; font-size: 12px; line-height: 1.6; }
.fulfillment-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.fulfillment-actions button { min-width: 82px; padding: 10px 18px; border: 1px solid #d8cec4; background: transparent; color: #635952; }
.fulfillment-actions .primary-button { color: #fff; border-color: var(--wine); background: var(--wine); }
.fulfillment-dialog button:disabled { opacity: .5; cursor: wait; }

.voice-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; color: #edf1f3; background: transparent; }
.voice-dialog::backdrop { background: rgba(8,10,12,.82); backdrop-filter: blur(8px); }
.voice-review-card { position: relative; padding: 34px; border: 1px solid #667078; background: linear-gradient(145deg, #232a2f, #111518); box-shadow: 0 35px 100px rgba(0,0,0,.5); }
.voice-review-card h2 { margin: 0; font-size: 23px; font-weight: normal; letter-spacing: .12em; }
.dialog-close { position: absolute; right: 16px; top: 13px; border: 0; color: #9da7ad; background: transparent; font: 25px Georgia, serif; }
.voice-review-names { color: #98a2a8; font-size: 10px; letter-spacing: .1em; }
.review-wave { height: 128px; margin: 24px 0 18px; padding: 12px; border: 1px solid #3f484d; background: #131a20; }
.voice-review-card audio { width: 100%; height: 38px; filter: grayscale(1) invert(.86); }
.voice-review-meta { color: #7f898f; font-size: 8px; }
.voice-review-card label { margin-top: 20px; color: #adb5ba; }
.voice-review-card textarea { color: #e3e7e9; border-color: #485158; background: #161b1e; }
.voice-review-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.reject-button { padding: 12px 17px; border: 1px solid #81565c; color: #d3a5aa; background: transparent; }

.login-dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 0; background: transparent; color: var(--ink); }
.login-dialog::backdrop { background: rgba(42,14,23,.82); backdrop-filter: blur(9px); }
.login-card { padding: 40px 42px 42px; background: var(--paper); border: 1px solid rgba(184,139,55,.5); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.login-card .seal-mark { margin-bottom: 24px; border-color: var(--wine); color: var(--wine); }
.login-card h1 { margin: 0; font-size: 27px; font-weight: 500; letter-spacing: .14em; }
.login-intro { margin: 10px 0 28px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-card label { margin-top: 16px; }
.login-card .primary-button { width: 100%; margin-top: 16px; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 11px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 13px 18px; background: #352d29; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 12px; transition: .24s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red); }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes required-nudge { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(-3px); } 70% { transform: translateX(2px); } }

@media (prefers-reduced-motion: reduce) {
  .draft-field-error > input, .draft-field-error > textarea, .draft-field-error > select, .photo-upload-panel.draft-field-error { animation: none; }
}

@media (max-width: 1050px) {
  .print-layout-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .print-layout-scope { grid-column: span 2; }
  .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .certificate-preview { display: none; }
  .record-card { grid-template-columns: 22px minmax(190px, 1.3fr) minmax(160px, 1fr) 90px auto; }
  .record-signals { display: none; }
  .management-grid { grid-template-columns: 1fr; }
  .insight-summary { grid-template-columns: repeat(4, minmax(100px, 1fr)); overflow-x: auto; }
}

@media (max-width: 760px) {
  .demo-heading { flex-direction: column; align-items: start; gap: 10px; }
  .demo-heading > p { max-width: none; }
  .demo-card { padding: 12px; gap: 12px; }
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 18px 20px; flex-direction: row; align-items: center; gap: 16px; }
  .brand { margin: 0; }
  .brand-seal { width: 34px; height: 34px; font-size: 17px; }
  .brand small, .sidebar nav, .sidebar-note, .signed-in-user { display: none; }
  .logout-button { margin: 0 0 0 auto; }
  main { padding: 24px 16px 60px; }
  .topbar { align-items: end; }
  .topbar h1 { font-size: 25px; }
  .new-button { padding: 10px 12px; font-size: 11px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats article { padding: 16px 12px; }
  .stats strong { font-size: 24px; }
  .stats small { display: none; }
  .form-panel, .records-section, .settings-section { padding: 22px 18px; }
  .template-picker { grid-template-columns: 1fr 1fr; }
  .template-fieldset legend { align-items: start; flex-direction: column; gap: 5px; }
  .couple-fields { grid-template-columns: 1fr; }
  .heart-link { display: none; }
  .detail-fields, .location-fields { grid-template-columns: 1fr; gap: 13px; }
  .text-style-grid { grid-template-columns: 1fr; }
  .detail-fields .order-field, .detail-fields .phone-field, .detail-fields .id-card-field, .detail-fields .sku-field { grid-column: auto; grid-row: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions > div { justify-content: flex-end; }
  .records-heading { align-items: stretch; flex-direction: column; }
  .record-heading-tools { justify-items: stretch; }
  .batch-toolbar { justify-content: flex-start; }
  .filters input, .filters #searchInput, .filters select { width: 100%; }
  .record-card { grid-template-columns: 22px 1fr auto; gap: 12px; }
  .record-middle { grid-column: 2; }
  .record-signals { display: none; }
  .record-status { grid-column: 2; }
  .record-actions { grid-column: 3; grid-row: 1 / span 3; flex-direction: column; flex-wrap: nowrap; }
  .record-select { grid-column: 1; grid-row: 1 / span 3; }
  .record-pagination { align-items: stretch; flex-direction: column; }
  .record-pagination nav { justify-content: space-between; overflow-x: auto; padding-bottom: 2px; }
  .record-pagination button { flex: 0 0 auto; }
  .settings-section .records-heading { align-items: stretch; }
  .settings-intro { text-align: left; }
  .settings-grid { grid-template-columns: 1fr; }
  .print-layout-form { grid-template-columns: 1fr 1fr; }
  .print-layout-scope { grid-column: 1 / -1; }
  .print-layout-actions { align-items: stretch; flex-direction: column; }
  .print-layout-actions p { margin: 0 0 4px; }
  .template-content-layout { grid-template-columns: 1fr; }
  .common-style-row { grid-template-columns: 1fr; }
  .template-common-preview { min-height: 260px; }
  .insights-section { padding: 22px 18px; }
  .management-section { padding: 22px 18px; }
  .insights-section .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .insights-section .filters select:first-child { grid-column: 1 / -1; }
  .insights-section .filters select, .insights-section .filters input { width: 100%; }
  .insight-summary { grid-template-columns: repeat(4, 105px); }
  .voice-review-card { padding: 28px 22px; }
  .login-card { padding: 32px 26px; }
}

@media (max-width: 430px) {
  .demo-grid { grid-template-columns: 1fr; }
  .template-picker { grid-template-columns: 1fr; }
  .template-card { min-height: 62px; }
  .voice-notice { align-items: start; }
  .photo-upload-panel { grid-template-columns: 1fr; }
  .photo-upload-preview { max-height: 180px; }
  .option-card { padding: 18px 14px; }
  .template-content-actions { align-items: stretch; flex-direction: column-reverse; }
  .option-row { grid-template-columns: minmax(90px, 1fr) 77px 48px; gap: 6px; }
}

.certificate-preview { margin: 16px 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: #f7efe4; }
.certificate-preview > span { display: block; font-size: 10px; color: #8c7763; }
.certificate-preview strong { display: block; margin-top: 6px; font: 16px Georgia, serif; color: var(--wine); overflow-wrap: anywhere; }
.certificate-preview p, .channel-code-help { margin: 7px 0 0; color: #88796e; font-size: 10px; line-height: 1.7; }
.channel-code-help { margin: 0 0 16px; }
.code-prefix-editor { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-top: 7px; border-top: 1px solid #ece4db; }
.code-prefix-editor label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 10px; color: #88796e; }
.code-prefix-editor label span { flex-shrink: 0; }
.code-prefix-editor input { height: 30px; max-width: 150px; font: 13px monospace; }
.code-prefix-editor button { height: 30px; padding: 0 12px; border: 1px solid #bca99b; background: #fffaf3; color: var(--wine); font-size: 10px; }
.code-prefix-editor button:disabled { opacity: .5; cursor: default; }
.option-add-form:is([data-option-type="sales_channel"], [data-option-type="brand"]) { grid-template-columns: minmax(0, 1fr) minmax(70px, .5fr) auto; }
@media (max-width: 430px) { .option-add-form:is([data-option-type="sales_channel"], [data-option-type="brand"]) { grid-template-columns: 1fr 1fr; } .option-add-form:is([data-option-type="sales_channel"], [data-option-type="brand"]) button { grid-column: 1 / -1; } }

/* A recipient-first catalog keeps the growing collection easy to browse. */
.recipient-picker { display: grid; grid-template-columns: minmax(190px, .8fr) 1fr; gap: 18px; align-items: end; padding: 15px; margin: 0 0 15px; background: #f3ece1; border: 1px solid #e4d7c4; }
.recipient-picker label { font-size: 11px; }
.recipient-picker select { height: 38px; }
.recipient-picker p { margin: 0 0 3px; color: #8b7968; font-size: 11px; line-height: 1.8; }
.template-visual img { width: 100%; height: 100%; object-fit: cover; }
.template-card:has(input:focus-visible) { outline: 2px solid var(--wine); outline-offset: 2px; }
.demo-group-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 12px; }
.demo-group-button { padding: 10px 15px; border: 1px solid #dfd1c0; color: #746457; background: #fbf7ee; font-size: 12px; }
.demo-group-button[aria-pressed="true"] { border-color: var(--wine); background: var(--wine); color: #fff9ed; }
.demo-group-intro { margin: 0 0 17px; color: #8b7766; font-size: 11px; line-height: 1.8; }
.demo-item { min-width: 0; display: flex; flex-direction: column; }
.demo-item .demo-card { flex: 1; }
.demo-use-button { width: 100%; padding: 9px 12px; border: 1px solid #e3d8ca; border-top: 0; background: #f4ede2; color: #836345; font-size: 10px; }
.demo-use-button:hover { background: #e9dac2; }
.selected-demo-link { display: block; margin-top: 12px; color: var(--wine); text-align: center; font-size: 11px; text-underline-offset: 4px; }
.preview-gift-art { position: relative; flex: 0 0 70px; overflow: hidden; margin: -8px -7px 6px; }
.preview-gift-art img { position: absolute; width: 100%; height: auto; left: 0; top: -25%; transform: translateY(-12%); }
.gift-preview { background: var(--gift-paper); color: var(--gift-ink); }
.gift-preview .preview-border { border-color: var(--gift-secondary); padding-top: 25px; }
.gift-preview .preview-title { color: var(--gift-ink); font-size: 13px; letter-spacing: .03em; margin-bottom: 10px; }
.gift-preview .vow-copy, .gift-preview .preview-names, .gift-preview blockquote { color: var(--gift-ink); }
.gift-preview .preview-names { margin-top: 3px; font-size: 7px; }
.gift-preview blockquote { margin: 8px 0; padding: 6px 3px; min-height: 0; }
.gift-preview .mini-seal { display: none; }
.gift-preview .preview-footer { margin-top: auto; color: var(--gift-secondary); }
.gift-preview .qr-placeholder { width: 25px; height: 25px; }
@media (max-width: 700px) {
  .recipient-picker { grid-template-columns: 1fr; gap: 10px; }
  .demo-group-button { flex: 1 0 calc(25% - 8px); padding: 9px 5px; font-size: 11px; }
}

.template-card > .template-copy { display: block; }
.template-copy strong { white-space: normal; line-height: 1.4; }
.gift-composition { display: block; width: 100%; height: auto; }
.gift-preview .vow-copy { margin: 2px -7px 9px; }
.gift-preview .preview-names i { color: var(--gift-accent); }
.demo-motif { display: block; margin-top: 7px; color: #755f46; font-size: 10px; line-height: 1.6; }
.record-group-tabs { margin: -6px 0 20px; }
.demo-tools { display: flex; flex-direction: column; }
.demo-factory-link { display: block; padding: 10px; border: 1px solid #e3d8ca; border-top: 0; text-align: center; color: #735b42; background: #fffbf5; font-size: 10px; text-decoration: none; }
.demo-factory-link:hover { background: #f2e7d6; }
.print-guide { display: grid; gap: 6px; padding: 13px 16px; margin: 0 0 20px; border-left: 2px solid var(--gold); background: #f5eee3; color: #7b6854; font-size: 10px; line-height: 1.8; }
.print-guide b { color: #664b35; font-size: 11px; font-weight: 500; }
.print-version { font: 9px Georgia, serif; color: #92734b; }
.record-actions .print-download { border-color: #c7b49a; color: #715b41; }
.overprint-dark .preview-names, .overprint-dark blockquote { padding: 7px 5px; background: #fffcf4; color: #202428; border-radius: 2px; }

/* 工作台按功能切页；列表与表单各自滚动，导航和主要操作始终可达。 */
html { scroll-behavior: auto; }
body { height: 100vh; height: 100dvh; overflow: hidden; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: 190px minmax(0, 1fr); }
.sidebar { height: 100%; padding: 26px 16px 18px; overflow-y: auto; }
.brand { gap: 9px; margin-bottom: 34px; }
.brand strong { font-size: 15px; }
.brand small { font-size: 7px; letter-spacing: .08em; }
.brand-seal { width: 35px; height: 35px; }
.nav-item { padding: 12px 10px; }
.nav-item span { font-size: 13px; letter-spacing: .04em; }
.nav-item:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sidebar-note { padding: 12px; }
.sidebar-note p { font-size: 10px; line-height: 1.6; }
#workspaceMain { display: flex; flex-direction: column; gap: 18px; min-width: 0; min-height: 0; max-width: none; padding: 22px 26px; overflow: hidden; }
.topbar { flex: 0 0 auto; min-height: 56px; gap: 16px; }
.topbar .eyebrow { font-size: 9px; }
.topbar h1 { font-size: 25px; letter-spacing: .03em; }
.workspace-description { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
#workspaceTitle:focus { outline: none; }
.new-button { padding: 11px 16px; font-size: 12px; box-shadow: none; }
[data-workspace-view] { flex: 1; min-height: 0; min-width: 0; margin: 0; overflow: auto; overscroll-behavior: contain; }
.records-section, .settings-section, .insights-section, .management-section, #designs { padding: 20px; }
#agreements { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.stats { flex: 0 0 auto; margin: 0; border: 0; background: transparent; gap: 20px; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
.stats article { padding: 0; background: none; display: flex; align-items: baseline; gap: 10px; }
.stats article::after { display: none; }
.stats span { font-size: 11px; letter-spacing: 0; }
.stats strong { margin: 0; font-size: 25px; }
.stats small { font-size: 9px; }
#agreements > .records-heading { display: block; flex: 0 0 auto; margin-bottom: 0; }
#agreements > .records-heading > div:first-child { display: none; }
.record-heading-tools { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; justify-items: stretch; gap: 10px; }
.record-heading-tools > .filters { display: grid; grid-template-columns: minmax(190px, 1fr) 135px; }
.record-heading-tools > .filters input, .record-heading-tools > .filters select, .record-heading-tools #searchInput { width: 100%; height: 37px; font-size: 12px; }
.archive-extra-filters { position: relative; z-index: 3; }
.archive-extra-filters > summary { list-style: none; padding: 10px 12px; border: 1px solid #d8cec3; cursor: pointer; color: #6e5f52; font-size: 12px; white-space: nowrap; }
.archive-extra-filters > summary::-webkit-details-marker { display: none; }
.archive-extra-filters > summary::after { content: '＋'; margin-left: 10px; color: var(--wine); }
.archive-extra-filters[open] > summary::after { content: '−'; }
#activeFilterCount { margin-left: 8px; color: #9b8270; font-size: 10px; }
.fulfillment-filters { position: absolute; top: calc(100% + 8px); right: 0; width: 420px; padding: 16px; background: var(--paper); border: 1px solid #d7c7b6; box-shadow: 0 12px 28px #3627191f; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fulfillment-filters input, .fulfillment-filters select { width: 100%; min-width: 0; height: 38px; font-size: 12px; }
.clear-filters { padding: 10px 0 10px 8px; border: 0; background: transparent; color: var(--wine); font-size: 11px; }
.batch-toolbar { grid-column: 1 / -1; justify-content: flex-start; gap: 10px; }
.batch-toolbar label, .batch-toolbar select, .batch-toolbar button { font-size: 11px; }
.batch-toolbar select { width: 125px; }
.batch-toolbar #pdfBatchMode { width: 188px; }
.batch-toolbar button { margin-left: auto; }
.batch-toolbar .batch-ship-button { margin-left: 0; border: 1px solid #779a83; background: #edf4ef; color: #3e6850; }
.batch-hint { grid-column: 1 / -1; font-size: 10px; line-height: 1.3; }
.batch-hint.selection-warning { display: block; color: var(--wine); }
.record-group-tabs { flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 0; padding-bottom: 3px; }
.record-group-tabs button { flex: 0 0 auto; padding: 8px 13px; font-size: 11px; }
.archive-results { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 5px; }
.record-list { gap: 8px; }
.record-card { grid-template-columns: 18px minmax(190px, 1.15fr) minmax(140px, .9fr) 62px 60px minmax(240px, 1fr); gap: 12px; padding: 14px; animation: none; }
.record-card:hover { transform: none; box-shadow: none; }
.couple-name strong { font-size: 14px; }
.record-actions { gap: 5px; }
.record-actions a, .record-actions button { padding: 7px 9px; font-size: 10px; }
.record-pagination { flex: 0 0 auto; gap: 14px; margin: 0; padding-top: 12px; }
.record-pagination p { font-size: 11px; }
.page-size-field { margin-left: auto; }
.record-pagination button { font-size: 11px; }
#editor { overflow: hidden; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.form-panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; padding: 20px; box-shadow: none; }
.form-panel .panel-heading { flex: 0 0 auto; padding-bottom: 13px; }
.form-panel .panel-heading h2 { font-size: 20px; }
.form-panel .panel-heading .eyebrow { display: none; }
#agreementForm { flex: 1; min-height: 0; padding-top: 14px; display: flex; flex-direction: column; }
.editor-fields { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 9px; padding-bottom: 14px; }
.draft-required-note { margin: 0 0 14px; font-size: 10px; }
.template-fieldset { margin-bottom: 14px; padding-bottom: 12px; }
.template-fieldset legend { margin-bottom: 10px; }
.template-fieldset legend small { display: none; }
.recipient-picker { margin: 0; padding: 12px; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; }
.recipient-picker label { font-size: 11px; gap: 5px; }
.recipient-picker select { height: 36px; }
.current-template { min-width: 0; }
.current-template small { display: block; color: #8b7d72; font-size: 10px; margin-bottom: 5px; }
.current-template strong { color: var(--wine); font-size: 15px; font-weight: 600; }
.current-template #recipientGroupHint { display: none; }
.compact-disclosure { border: 1px solid var(--line); background: #fffdf8; }
.compact-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; font-size: 12px; color: #6e5f52; cursor: pointer; list-style: none; }
.compact-disclosure > summary::-webkit-details-marker { display: none; }
.compact-disclosure > summary::after { content: '＋'; color: var(--wine); }
.compact-disclosure[open] > summary::after { content: '−'; }
.compact-disclosure > summary span { margin-left: auto; color: #9c8f83; font-size: 10px; }
#templateChoices { margin-top: 8px; }
#templateChoices .template-picker { padding: 0 10px 10px; }
.style-disclosure { margin-top: 14px; }
.text-style-fieldset { margin: 0; padding: 12px; border: 0; }
.text-style-fieldset > legend, .font-license-note { display: none; }
.text-style-card { padding: 10px; }
.text-style-card h3 { margin-bottom: 8px; }
#agreementForm label { gap: 6px; font-size: 12px; }
#agreementForm input:not([type="range"]):not([type="file"]), #agreementForm select { height: 36px; padding: 0 10px; font-size: 12px; }
#agreementForm textarea { min-height: 75px; height: 75px; padding: 10px; font-size: 12px; }
.wide-field { margin-top: 14px; }
.detail-fields, .location-fields { gap: 12px; margin-top: 14px; }
.id-card-field > small { font-size: 10px; }
#agreementForm > .editor-fields > .certificate-preview { display: block; margin-top: 14px; padding: 10px 12px; background: #f5ede1; }
#agreementForm .certificate-preview > span { font-size: 10px; }
#agreementForm .certificate-preview > strong { display: inline; margin-left: 10px; font-size: 14px; }
#agreementForm .certificate-preview > p { margin-top: 5px; font-size: 9px; }
.form-actions { flex: 0 0 auto; gap: 10px; margin: 0; padding-top: 12px; }
.form-actions p { font-size: 9px; max-width: 210px; }
.form-actions button { padding: 11px 12px; font-size: 12px; }
.published-edit-notice { padding: 10px 12px; font-size: 11px; margin-top: 14px; }
.editor-preview { position: relative; display: flex; padding: 24px 18px; justify-content: center; min-height: 0; }
.preview-caption { align-self: flex-start; margin-bottom: 22px; }
.preview-caption span { display: block; color: #8b7764; font: 9px Georgia, serif; letter-spacing: .18em; }
.preview-caption strong { display: block; margin-top: 5px; font-size: 17px; font-weight: 400; }
.editor-preview .preview-paper { max-width: min(268px, calc((100dvh - 290px) * .707)); }
#designs { background: var(--paper); border: 1px solid var(--line); }
#designs .demo-heading { margin-bottom: 18px; }
#designs .demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#settings { display: flex; flex-direction: column; overflow: hidden; background: var(--paper); }
#settings > .records-heading { flex: 0 0 auto; margin-bottom: 18px; }
.settings-tabs { display: flex; flex: 0 0 auto; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-tabs button { padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #86796d; font-size: 13px; }
.settings-tabs [aria-selected="true"] { border-color: var(--wine); color: var(--wine); font-weight: 600; }
.settings-panels { flex: 1; min-height: 0; overflow: auto; padding-right: 5px; }
.settings-panels .option-card { margin-bottom: 0; }
#insights, #logs { display: flex; flex-direction: column; overflow: hidden; }
#insights > *, #logs > * { flex-shrink: 0; }
#insights .metrics-table-wrap, #logs .metrics-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.metrics-table th { position: sticky; top: 0; background: #37302b; z-index: 1; }
.log-table th { background: #f0e8dd; }
@media (min-width: 1360px) {
  .detail-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-fields .order-field { grid-column: 1 / 3; grid-row: 2; }
  .detail-fields .sku-field { grid-column: 3 / 5; grid-row: 2; }
  .detail-fields .phone-field { grid-column: 1 / 3; grid-row: 3; }
  .detail-fields .id-card-field { grid-column: 3 / 5; grid-row: 3; }
}
@media (max-height: 800px) {
  .sidebar-note { display: none; }
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 170px minmax(0, 1fr); }
  #workspaceMain { padding: 18px; }
  .record-signals { display: none; }
  .record-card { grid-template-columns: 18px minmax(145px, 1fr) minmax(120px, .85fr) 56px minmax(185px, .9fr); }
  #editor { grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
  .form-panel { padding: 16px; }
  .form-actions p { display: none; }
  .form-actions > div { margin-left: auto; }
  .editor-preview { padding: 16px; }
  .record-heading-tools { grid-template-columns: minmax(0, 1fr) auto; }
  .clear-filters { position: absolute; right: 0; top: 43px; }
  .batch-toolbar { padding-top: 3px; padding-right: 72px; }
  .batch-toolbar button { margin-left: 0; }
  #activeFilterCount { display: none; }
  #archiveFilters[data-active="true"] #activeFilterCount { display: inline; }
  #designs .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  #editor { grid-template-columns: 1fr; }
  .editor-preview { display: none; }
  .record-card { grid-template-columns: 18px minmax(0, 1fr) 56px; }
  .record-middle { grid-column: 2; }
  .record-status { grid-column: 3; grid-row: 1; }
  .record-select { grid-column: 1; grid-row: 1 / span 3; }
  .record-actions { grid-column: 2 / -1; grid-row: 3; justify-content: flex-start; flex-direction: row; flex-wrap: wrap; }
  .stats small { display: none; }
  .stats article { gap: 8px; }
}
@media (max-width: 760px) {
  .app-shell { display: flex; flex-direction: column; }
  .sidebar { flex: 0 0 auto; height: auto; padding: 12px 14px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .sidebar nav { display: flex; min-width: 0; grid-column: 1 / -1; grid-row: 2; overflow-x: auto; gap: 4px; padding-bottom: 8px; scrollbar-width: none; }
  .sidebar .brand { margin: 0; }
  .brand-seal { width: 27px; height: 27px; font-size: 16px; }
  .brand strong { font-size: 14px; }
  .sidebar-note, .signed-in-user { display: none; }
  .nav-item { flex: 0 0 auto; white-space: nowrap; padding: 9px 11px; }
  .nav-item span { font-size: 12px; }
  .nav-item b { display: none; }
  .nav-item.active::after { right: 8px; left: 8px; top: auto; bottom: 0; height: 2px; width: auto; }
  .logout-button { grid-column: 2; grid-row: 1; padding: 6px; margin: 0; font-size: 11px; }
  #workspaceMain { flex: 1; min-height: 0; padding: 14px 10px 10px; gap: 12px; }
  .topbar { align-items: center; min-height: 44px; }
  .topbar h1 { font-size: 21px; }
  .topbar .eyebrow, .workspace-description { display: none; }
  .new-button { padding: 10px; font-size: 11px; }
  .new-button span { font-size: 13px; margin-right: 3px; }
  .records-section, .settings-section, .insights-section, .management-section, #designs { padding: 12px; }
  #agreements { gap: 10px; }
  .stats { gap: 8px; padding-bottom: 10px; }
  .stats article { gap: 5px; }
  .stats span { font-size: 9px; white-space: nowrap; }
  .stats strong { font-size: 20px; }
  .record-heading-tools { gap: 8px; grid-template-columns: 1fr auto; }
  .record-heading-tools > .filters { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 100px; }
  .record-heading-tools > .filters input, .record-heading-tools > .filters select { padding: 0 9px; font-size: 11px; }
  .archive-extra-filters { position: static; }
  .archive-extra-filters > summary { width: max-content; font-size: 11px; padding: 7px 9px; }
  #activeFilterCount { display: inline; font-size: 9px; }
  .fulfillment-filters { left: 0; right: 0; top: 78px; width: 100%; padding: 12px; }
  .clear-filters { position: static; padding: 8px 0; text-align: right; }
  .batch-toolbar { padding: 0; gap: 8px; }
  .batch-toolbar label, .batch-toolbar select, .batch-toolbar button, #selectedRecordCount { font-size: 10px; }
  .batch-toolbar select { width: 102px; }
  .batch-toolbar #pdfBatchMode { width: 171px; }
  .batch-toolbar #pdfBatchModeField { font-size: 0; gap: 0; }
  .batch-toolbar button { padding: 0 9px; height: 31px; }
  .batch-hint { display: none; }
  .record-group-tabs button { padding: 7px 10px; font-size: 10px; }
  .record-card { padding: 10px; gap: 8px; }
  .couple-name strong { font-size: 13px; }
  .record-message { font-size: 11px; }
  .record-actions a, .record-actions button { min-width: 0; padding: 7px 8px; }
  .record-pagination { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-top: 10px; }
  .record-pagination p { font-size: 10px; }
  .page-size-field { margin: 0; font-size: 10px; gap: 5px; }
  .page-size-field select { height: 29px; width: 72px; font-size: 11px; padding-left: 8px; }
  .record-pagination nav { grid-column: 1 / -1; padding: 0; gap: 4px; }
  .record-pagination button { min-width: 28px; height: 29px; padding: 0 6px; font-size: 10px; }
  .record-pagination .page-direction { min-width: 50px; }
  .form-panel { padding: 14px; }
  .form-panel .panel-heading { gap: 8px; padding-bottom: 10px; }
  .form-panel .panel-heading h2 { font-size: 18px; }
  .form-panel .panel-heading .eyebrow { font-size: 8px; }
  .editor-fields { padding-right: 3px; }
  .recipient-picker { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .current-template strong { font-size: 13px; }
  .couple-fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  .couple-fields .heart-link { display: none; }
  .draft-required-badge { padding: 1px 3px; font-size: 7px; }
  .detail-fields, .location-fields { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: row; padding-top: 10px; }
  .form-actions > div { width: 100%; gap: 7px; justify-content: flex-end; }
  .form-actions button { padding: 10px; font-size: 11px; }
  #backToRecordsButton { margin-right: auto; }
  #designs .demo-grid { grid-template-columns: 1fr; }
  .settings-tabs { margin-bottom: 12px; gap: 0; }
  .settings-tabs button { flex: 1; padding: 10px 8px; font-size: 12px; }
  #settings > .records-heading { gap: 7px; margin-bottom: 12px; }
  #settings .records-heading .eyebrow { display: none; }
  #settings .records-heading h2 { font-size: 18px; }
  .settings-intro { font-size: 10px; }
  .toast { right: 12px; bottom: 12px; max-width: calc(100vw - 24px); }
}
@media (max-width: 760px) and (max-height: 700px) {
  /* 小屏优先留出档案阅读空间，总数量仍可在分页栏查看。 */
  #agreements .stats { display: none; }
  #workspaceMain { padding-top: 8px; gap: 8px; }
  #agreements { gap: 8px; }
  .record-heading-tools { gap: 6px; }
  .batch-toolbar { gap: 4px 8px; }
  .record-group-tabs button { padding: 6px 9px; }
}
