@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/dm-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --violet: #6D5DF6;
  --violet-600: #5B4BE0;
  --violet-50: #F0EDFE;
  --violet-100: #E2DCFD;
  --teal: #14B8A6;
  --teal-ink: #0D7C6E;
  --teal-50: #E6FAF6;
  --coral: #FF7D6B;
  --gold: #C79A3A;
  --maroon: #7A2E2E;
  --bg: #FAFAFC;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #334155;
  --ink-3: #64748B;
  --ink-4: #64748B;
  --line: #E5E7EB;
  --line-2: #EEF0F4;
  --radius: 20px;
  --shadow-md: 0 8px 24px rgb(15 23 42 / 6%);
  --shadow-lg: 0 15px 40px rgb(15 23 42 / 10%);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a:focus-visible, button:focus-visible, summary:focus-visible, .preview-canvas:focus-visible { outline: 3px solid var(--violet-600); outline-offset: 4px; border-radius: 6px; }
::selection { background: var(--violet-100); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; background: var(--ink); color: white; padding: 16px; border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 13px 22px; border-radius: 14px; font-size: 16px; font-weight: 700; }
.button-primary { background: var(--violet); color: white; box-shadow: 0 5px 15px -8px var(--violet); }
.button-primary:hover { background: var(--violet-600); }
.button .icon { width: 20px; height: 20px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--violet-600); font-size: 15px; font-weight: 700; }
.text-link:hover, .back-link:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-button { border: 0; background: transparent; color: var(--violet-600); font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-header { border-bottom: 1px solid var(--line); }
.nav { min-height: 94px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 24px; font-weight: 700; letter-spacing: -.9px; flex-shrink: 0; }
.brand img { width: 38px; height: 38px; border-radius: 12px; }
.brand-accent { color: var(--violet); }
.brand-period { color: var(--coral); }
.back-link { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; font-size: 16px; color: var(--ink-2); }

/* A compact introduction leaves the actual tool within reach. */
.page-head { padding-block: 52px 30px; display: flex; justify-content: space-between; gap: 36px; align-items: center; }
.eyebrow { font-size: 12px; letter-spacing: 1.5px; font-weight: 700; color: var(--violet-600); line-height: 1.6; }
.page-head .eyebrow { display: flex; align-items: center; gap: 9px; }
.page-head .eyebrow > span { width: 7px; height: 7px; flex-shrink: 0; background: var(--coral); border-radius: 50%; }
h1 { margin-top: 14px; font-size: clamp(32px, 3.3vw, 44px); line-height: 1.15; letter-spacing: -1.7px; font-weight: 600; }
h1 > span { color: var(--violet); }
.intro { max-width: 690px; margin-top: 16px; font-size: 17px; line-height: 1.7; color: var(--ink-3); }
.free-note { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 18px 0 18px 28px; border-left: 1px solid var(--line); }
.free-note > .icon { width: 30px; height: 30px; color: var(--teal-ink); }
.free-note strong { display: block; font-size: 16px; }
.free-note small { display: block; margin-top: 5px; font-size: 14px; color: var(--ink-3); }
.workflow { display: flex; align-items: center; gap: 20px; padding-block: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.workflow > span { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.workflow b { font-size: 12px; color: var(--violet-600); background: var(--violet-50); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; }
.workflow > i { width: 45px; height: 1px; background: #D9D4EE; }
.no-script { padding: 20px; margin-bottom: 24px; border: 1px solid var(--coral); background: #FFEEEA; }

/* Native sections keep a long optional form approachable and keyboard-accessible. */
.workspace { display: grid; grid-template-columns: 1fr 1.08fr; gap: 36px; align-items: start; }
.editor, .preview-wrap { min-width: 0; }
.card, .form-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.design-card { padding: 26px; }
h2 { font-size: 22px; letter-spacing: -.6px; font-weight: 600; line-height: 1.3; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--violet-600); background: var(--violet-50); padding: 5px 10px; border-radius: 20px; font-weight: 600; }
.helper { font-size: 15px; color: var(--ink-3); line-height: 1.65; margin-top: 7px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.template-card { padding: 12px; border: 1.5px solid var(--line); border-radius: 13px; background: #FCFCFE; color: var(--ink-2); text-align: left; min-width: 0; }
.template-card:hover { border-color: #B7AEEE; }
.template-card[aria-pressed="true"] { border-color: var(--violet); background: var(--violet-50); box-shadow: 0 0 0 1px var(--violet); }
.template-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 14px; font-weight: 700; margin-top: 12px; }
.template-card > small { display: block; font-size: 12px; line-height: 1.5; margin-top: 4px; color: var(--ink-3); }
.selected-check { width: 15px; height: 15px; color: var(--violet-600); visibility: hidden; }
[aria-pressed="true"] .selected-check { visibility: visible; }
.mini-sheet { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 146px; width: 100%; max-width: 108px; margin-inline: auto; padding: 12px 14px; background: white; border: 1px solid #ECEAF1; box-shadow: 0 4px 8px rgb(15 23 42 / 5%); pointer-events: none; }
.mini-emblem { font-size: 14px; color: var(--gold); line-height: 1; }
.mini-name { width: 65%; height: 4px; background: #A7886E; border-radius: 3px; }
.mini-lines { width: 100%; height: 16px; display: block; border-top: 2px solid #DAD1C2; background: repeating-linear-gradient(transparent 0 6px, #EEE9E1 6px 7px); }
.mini-traditional { border: 3px double #CBA658; }
.mini-modern { padding-top: 12px; background: linear-gradient(120deg, var(--violet), #B99FE3) top / 100% 43px no-repeat, white; }
.mini-modern .mini-emblem { color: white; }
.mini-modern .mini-name { background: white; margin-bottom: 9px; }
.mini-modern .mini-lines { border-top-color: #CCBFF0; }
.mini-minimal { padding-top: 22px; }
.mini-minimal .mini-emblem { display: none; }
.mini-minimal .mini-name { background: #576071; margin-bottom: 9px; }
.mini-minimal .mini-lines { border-top-color: #CED0D4; background: repeating-linear-gradient(transparent 0 6px, #F1F1F1 6px 7px); }
.privacy-note { display: flex; gap: 12px; padding: 19px 21px; border-radius: 15px; background: var(--teal-50); margin-top: 20px; color: var(--teal-ink); }
.privacy-note .icon { width: 20px; height: 20px; margin-top: 3px; }
.privacy-note p { font-size: 14px; line-height: 1.65; }
.privacy-note strong { font-weight: 700; }
.editor-heading { margin-block: 32px 18px; display: flex; align-items: flex-start; gap: 15px; }
.editor-heading > div { flex: 1; }
.preview-jump { display: none; flex-shrink: 0; }
.form-section { margin-top: 12px; overflow: clip; }
.form-section summary { display: flex; align-items: center; gap: 14px; padding: 23px; cursor: pointer; list-style: none; }
.form-section summary::-webkit-details-marker { display: none; }
.form-section summary:hover { background: #FCFBFF; }
.form-section summary:focus-visible { outline-offset: -4px; }
.section-number { display: grid; place-items: center; width: 35px; height: 35px; flex-shrink: 0; background: var(--violet-50); border-radius: 11px; color: var(--violet-600); font-size: 13px; font-weight: 700; }
.section-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.section-title small { display: block; margin-top: 5px; font-size: 13px; line-height: 1.5; font-weight: 400; color: var(--ink-3); }
.chevron { width: 18px; height: 18px; color: var(--ink-3); }
.form-section[open] .chevron { transform: rotate(180deg); }
.section-fields { padding: 0 24px 10px; }
.field { min-width: 0; margin-bottom: 18px; }
.field label { display: block; font-size: 15px; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px 13px; background: #FCFCFE; border: 1px solid #DDE0E8; border-radius: 11px; font-size: 16px; color: var(--ink); line-height: 1.5; }
.field textarea { resize: vertical; min-height: 100px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.section-note { color: var(--ink-3); font-size: 14px; line-height: 1.7; margin-bottom: 20px; }
.photo-area { margin-bottom: 22px; }
.photo-picker { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px dashed #BFB5EE; border-radius: 13px; background: #FAF8FF; cursor: pointer; }
.photo-picker:hover { border-color: var(--violet); }
.photo-picker:focus-within { outline: 3px solid var(--violet-600); outline-offset: 3px; }
.photo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--violet-600); background: var(--violet-50); flex-shrink: 0; }
.photo-picker strong { font-size: 15px; color: var(--violet-600); }
.photo-picker small { display: block; margin-top: 5px; font-size: 13px; color: var(--ink-3); }
.photo-preview { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-3); padding-top: 14px; }
.photo-preview img { width: 48px; height: 56px; border-radius: 8px; object-fit: cover; }
.photo-preview .text-button { margin-left: auto; }
.field-status { font-size: 14px; line-height: 1.6; color: #A13D30; }
.field-status:empty { display: none; }
.field-status:not(:empty) { margin-top: 12px; }
.editor-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.reset-button { color: var(--ink-3); }

/* The paper has a natural document size; JS reserves its scaled height. */
.preview-wrap { position: sticky; top: 24px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.live-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--teal-ink); }
.live-label > span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.preview-canvas { position: relative; padding: 26px; border: 1px solid #E8E5EF; border-radius: 20px 20px 0 0; background: #F0EEF5; max-height: max(320px, calc(100svh - 330px)); overflow: auto; }
.sheet-stage { position: relative; width: 100%; aspect-ratio: 794 / 1123; overflow: clip; }
.preview-empty { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); left: 12%; right: 12%; padding: 20px; background: rgb(255 255 255 / 96%); border: 1px solid var(--line-2); border-radius: 16px; text-align: center; box-shadow: var(--shadow-md); }
.preview-empty > .icon { color: var(--violet); width: 30px; height: 30px; margin-bottom: 12px; }
.preview-empty h3 { font-size: 19px; font-weight: 600; line-height: 1.4; }
.preview-empty p { font-size: 14px; color: var(--ink-3); line-height: 1.65; margin-top: 8px; }
.preview-empty .text-link { margin-top: 8px; }
.download-card { padding: 20px 24px; border: 1px solid var(--line); border-top: none; border-radius: 0 0 20px 20px; background: white; }
.document-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 15px; }
.download-button { width: 100%; min-height: 52px; }
.print-hint { font-size: 13px; line-height: 1.7; color: var(--ink-3); text-align: center; margin-top: 12px; }
.edit-jump { display: none; }

.app-banner { display: flex; align-items: center; gap: 24px; padding: 34px; border: 1px solid #E4DCF7; border-radius: 24px; background: linear-gradient(110deg, #F2EEFF, #FAF7FF 70%, #FFF0EC); margin-block: 64px 40px; }
.app-banner > img { width: 64px; height: 64px; border-radius: 19px; flex-shrink: 0; }
.app-copy { flex: 1; }
.app-copy .eyebrow { font-size: 11px; }
.app-copy h2 { margin-top: 8px; font-size: 26px; }
.app-copy > p:last-child { margin-top: 10px; color: var(--ink-3); font-size: 16px; line-height: 1.6; }
.app-download { text-align: center; flex-shrink: 0; }
.app-download a { display: block; width: 190px; }
.app-download span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; border-top: 1px solid var(--line); padding-block: 24px 32px; color: var(--ink-3); font-size: 14px; }
.site-footer p > a { color: var(--ink-2); font-weight: 700; }
.site-footer p > a > span { color: var(--coral); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 901px) and (max-height: 650px) {
  .preview-wrap { position: static; }
}
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 48px); }
  .workspace { gap: 24px; grid-template-columns: 1fr 1fr; }
  .free-note { display: none; }
  .design-card { padding: 22px; }
  .template-grid { gap: 9px; }
  .template-card { padding: 9px; }
  .template-label { flex-wrap: wrap; }
  .preview-canvas { padding: 20px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
  .preview-wrap { position: static; margin-top: 12px; }
  .preview-canvas { max-height: none; }
  .preview-jump, .edit-jump { display: inline-flex; }
  .edit-jump { margin-top: 12px; }
  .template-grid { gap: 16px; }
  .template-card { padding: 14px; }
  .mini-sheet { height: 155px; }
  .app-banner { flex-wrap: wrap; gap: 20px; }
  .app-copy { min-width: 240px; }
  .app-download { margin-left: 84px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 36px); }
  .nav { min-height: 80px; gap: 12px; flex-wrap: wrap; padding-block: 16px; }
  .brand { font-size: 22px; gap: 8px; }
  .brand img { width: 34px; height: 34px; border-radius: 11px; }
  .back-link { display: none; }
  .nav-download { margin-left: auto; font-size: 14px; padding: 12px 15px; min-height: 44px; gap: 8px; }
  .nav-download .icon { width: 17px; height: 17px; }
  .page-head { padding-block: 34px 24px; }
  .page-head .eyebrow { font-size: 10px; letter-spacing: 1px; }
  h1 { font-size: clamp(32px, 8vw, 42px); letter-spacing: -1.2px; line-height: 1.18; }
  .intro { font-size: 16px; }
  .workflow { gap: 12px; flex-wrap: wrap; padding-block: 16px; margin-bottom: 24px; }
  .workflow > span { font-size: 13px; gap: 7px; }
  .workflow b { width: 23px; height: 23px; font-size: 11px; }
  .workflow > i { display: none; }
  .design-card { padding: 20px 16px; }
  h2 { font-size: 21px; }
  .tag { font-size: 11px; }
  .template-grid { gap: 9px; margin-top: 18px; }
  .template-card { padding: 10px 8px; }
  .mini-sheet { height: 122px; padding: 10px; gap: 7px; }
  .mini-lines { height: 13px; }
  .mini-modern .mini-name { margin-bottom: 10px; }
  .template-label { font-size: 13px; }
  .template-card > small { font-size: 12px; }
  .privacy-note { padding: 17px; gap: 10px; }
  .editor-heading { flex-wrap: wrap; gap: 4px; }
  .editor-heading > div { flex-basis: 100%; }
  .form-section summary { padding: 20px 16px; gap: 11px; }
  .section-title { font-size: 16px; }
  .section-title small { font-size: 13px; }
  .section-fields { padding: 0 17px 7px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .photo-picker { padding: 14px; gap: 11px; }
  .photo-picker small { font-size: 12px; }
  .preview-canvas { padding: 16px; }
  .preview-empty { left: 10%; right: 10%; padding: 18px; }
  .preview-empty h3 { font-size: 18px; }
  .download-card { padding: 18px; }
  .app-banner { margin-top: 40px; padding: 24px; }
  .app-banner > img { width: 50px; height: 50px; border-radius: 15px; }
  .app-copy { min-width: 0; flex-basis: 100%; }
  .app-copy h2 { font-size: 25px; }
  .app-download { margin-left: -8px; }
  .site-footer { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
