/* ==========================================================================
   Design system. Light first, editorial, 4px spacing scale.
   ========================================================================== */

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand: Ink Blue, Oat Ivory, Amber Orange */
  --ink: #152638;
  --ink-deep: #0E1B29;
  --ink-2: #22364B;
  --oat: #E9E5D8;
  --oat-soft: #F3F0E8;
  --paper: #FBFAF6;
  --amber: #F18D46;          /* decorative only: fills, dots, rules */
  --amber-deep: #A9541A;     /* amber for text on light backgrounds (5:1) */
  --amber-soft: #FCEBDD;

  --text: var(--ink);
  --primary: var(--ink);
  --primary-hover: var(--ink-deep);
  --primary-soft: var(--amber-soft);
  --white: #FFFFFF;
  --bg: var(--paper);
  --bg-2: var(--oat-soft);
  --muted: #5B6573;
  --border: #E4DFD2;
  --border-strong: #CFC8B8;
  --success: #15803D;
  --success-soft: #ECFDF3;
  --error: #B42318;
  --error-soft: #FEF3F2;
  --warn: #B54708;
  --warn-soft: #FFFAEB;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(21, 38, 56, .06);
  --shadow: 0 1px 3px rgba(21, 38, 56, .10), 0 1px 2px rgba(21, 38, 56, .05);
  --focus: 0 0 0 3px rgba(241, 141, 70, .55);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --container: 1120px;
  --touch: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--amber-deep); }
h1 em, h2 em, h3 em, .serif-em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--amber-deep); }
::selection { background: var(--amber-soft); color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--s4); letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); letter-spacing: -0.03em; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 var(--s4); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s4); top: -100px; background: var(--text); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: var(--s4); color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s5); }
.container-narrow { max-width: 760px; }
.container-tight { max-width: 600px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--amber-deep); letter-spacing: .02em; margin-bottom: var(--s4); }
.lead { font-size: 1.125rem; color: #3A4756; max-width: 60ch; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(251, 250, 246, .92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 1.0625rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { color: var(--text); }
.logo img { height: 30px; width: auto; display: block; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--text); color: #fff; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; }
.nav { display: flex; align-items: center; gap: var(--s6); }
.nav a { color: #3A4756; text-decoration: none; font-size: .9375rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; width: var(--touch); height: var(--touch); margin-right: calc(-1 * var(--s3)); color: var(--text); cursor: pointer; border-radius: var(--radius); }
.nav-toggle .icon { width: 24px; height: 24px; margin: auto; }
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer[data-open="true"] { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 32, .4); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: #fff; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); box-shadow: var(--shadow); }
.drawer-panel a:not(.btn) { display: flex; align-items: center; min-height: var(--touch); color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border); }
.drawer-close { align-self: flex-end; background: none; border: 0; width: var(--touch); height: var(--touch); cursor: pointer; color: var(--text); border-radius: var(--radius); }
@media (max-width: 860px) { .nav { display: none; } .nav-toggle { display: grid; } }

/* Journey header */
.journey-header .container { height: 60px; }
.progress { display: flex; align-items: center; gap: var(--s2); font-size: .8125rem; color: var(--muted); }
.progress-bar { width: 120px; height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--amber); border-radius: 99px; }
@media (max-width: 480px) { .progress-bar { width: 64px; } .progress-label { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 0 var(--s6); border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-2); color: var(--text); }
.btn-ghost { background: transparent; color: #3A4756; }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-danger { background: #fff; color: var(--error); border-color: #FDA29B; }
.btn-danger:hover { background: var(--error-soft); color: var(--error); }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: .875rem; }
.btn-lg { min-height: 56px; padding: 0 var(--s6); font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 0; }

/* ---------- Sections ---------- */
.section { padding: var(--s20) 0; }
.section-sm { padding: var(--s12) 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: var(--s10); }
.section-head.center { margin-left: auto; margin-right: auto; }
@media (max-width: 640px) { .section { padding: var(--s12) 0; } }

/* Hero */
.hero { padding: var(--s16) 0 var(--s20); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s12); align-items: center; }
.hero h1 { max-width: 14ch; }
.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin: var(--s8) 0 var(--s4); }
.hero-note { font-size: .875rem; color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: var(--s10) 0 var(--s12); } }
@media (max-width: 480px) { .hero-actions .btn { width: 100%; } }

/* CV illustration (pure HTML/CSS) */
.cv-art { position: relative; max-width: 440px; margin-left: auto; width: 100%; }
.cv-paper { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px -12px rgba(16,24,40,.18); padding: 28px 28px 32px; aspect-ratio: 210 / 270; }
.cv-paper .n { height: 14px; width: 55%; background: var(--text); border-radius: 3px; margin-bottom: 10px; }
.cv-paper .h { height: 7px; width: 38%; background: #98A2B3; border-radius: 3px; margin-bottom: 22px; }
.cv-paper .sh { height: 7px; width: 30%; background: var(--amber); border-radius: 3px; margin: 18px 0 10px; }
.cv-paper .l { height: 6px; background: var(--bg-2); border-radius: 3px; margin-bottom: 7px; }
.cv-paper .l.w9 { width: 92%; } .cv-paper .l.w8 { width: 82%; } .cv-paper .l.w7 { width: 70%; } .cv-paper .l.w5 { width: 52%; }
.cv-paper .rule { height: 1px; background: var(--border); margin: 4px 0 12px; }
.cv-note { position: absolute; left: -28px; bottom: 44px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s3) var(--s4); font-size: .8125rem; max-width: 230px; }
.cv-note strong { display: flex; align-items: center; gap: 6px; font-size: .8125rem; margin-bottom: 2px; color: var(--success); }
.cv-note .icon { width: 16px; height: 16px; }
@media (max-width: 900px) { .cv-art { margin: 0 auto; max-width: 360px; } .cv-note { left: -8px; } }

/* Cards and grids */
.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s6); }
.card-flat { background: transparent; border: 0; padding: 0; }
.card h3 { margin-bottom: var(--s2); }
.card p:last-child { margin-bottom: 0; }
.feature-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--amber-soft); color: var(--amber-deep); display: grid; place-items: center; margin-bottom: var(--s4); }
.step-num-sm { width: 32px; height: 32px; border-radius: 99px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: .875rem; font-weight: 600; margin-bottom: var(--s4); background: #fff; }

.audience { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 1000px) { .audience { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .audience { grid-template-columns: 1fr; } }

/* Before / after */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare .card { position: relative; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--bg-2); color: #344054; margin-bottom: var(--s3); }
.tag-blue { background: var(--amber-soft); color: var(--amber-deep); }
.tag-green { background: var(--success-soft); color: var(--success); }
.tag-amber { background: var(--warn-soft); color: var(--warn); }
.tag-red { background: var(--error-soft); color: var(--error); }
.quote-text { font-size: 1.0625rem; margin: 0; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); align-items: stretch; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; } }
.price-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s8) var(--s6); }
.price-card.is-recommended { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.price-card h3 { font-size: 1.125rem; margin-bottom: var(--s1); }
.price { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; margin: var(--s3) 0 0; line-height: 1; }
.price-note { font-size: .8125rem; color: var(--muted); margin: var(--s2) 0 var(--s6); }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s6); display: grid; gap: var(--s2); font-size: .9375rem; }
.checklist li { display: flex; gap: var(--s2); align-items: flex-start; }
.checklist .icon { width: 18px; height: 18px; color: var(--amber-deep); margin-top: 3px; }
.price-card .btn { margin-top: auto; }
.prefix { font-size: .875rem; font-weight: 600; margin-bottom: var(--s2); }

/* FAQ accordion */
.accordion { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); text-align: left; background: none; border: 0; padding: var(--s5) 0; font: inherit; font-weight: 600; font-size: 1rem; color: var(--text); cursor: pointer; min-height: var(--touch); }
.accordion-trigger .icon { transition: transform .2s; color: var(--muted); }
.accordion-trigger[aria-expanded="true"] .icon { transform: rotate(45deg); }
.accordion-panel { padding: 0 0 var(--s5); color: #344054; max-width: 68ch; }
.accordion-panel[hidden] { display: none; }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: var(--s16) var(--s8); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #D5D9DE; }
@media (max-width: 640px) { .cta-band { padding: var(--s10) var(--s5); } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: var(--s12) 0 var(--s8); font-size: .875rem; color: var(--muted); background: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s8); margin-bottom: var(--s8); }
.footer-grid h4 { font-size: .8125rem; color: var(--text); margin-bottom: var(--s3); letter-spacing: 0; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.field label, .label { font-weight: 600; font-size: .9375rem; }
.field .hint { font-size: .8125rem; color: var(--muted); margin: 0; }
.input, .textarea, .select {
  width: 100%; min-height: var(--touch); padding: var(--s3) var(--s4); font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--amber); box-shadow: var(--focus); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: .8125rem; margin: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4); border: 1px solid var(--border-strong); border-radius: 99px; background: #fff; font: inherit; font-size: .875rem; cursor: pointer; color: var(--text); }
.chip:hover { background: var(--bg-2); }
.chip[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); color: var(--ink); }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.radio-card { display: flex; align-items: center; gap: var(--s3); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--s4); cursor: pointer; background: #fff; min-height: 56px; }
.radio-card:has(input:checked) { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.radio-card input { accent-color: var(--primary); width: 18px; height: 18px; }

/* Alerts */
.alert { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--radius); border: 1px solid var(--border); background: #fff; font-size: .9375rem; margin-bottom: var(--s5); }
.alert .icon { margin-top: 2px; }
.alert p:last-child { margin: 0; }
.alert-error { background: var(--error-soft); border-color: #FECDCA; color: #7A271A; }
.alert-success { background: var(--success-soft); border-color: #ABEFC6; color: #074D31; }
.alert-info { background: var(--oat-soft); border-color: var(--oat); color: var(--ink); }
.alert-warn { background: var(--warn-soft); border-color: #FEDF89; color: #7A2E0E; }

/* Upload */
.dropzone { display: block; position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: #fff; padding: var(--s10) var(--s6); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--amber); background: var(--amber-soft); }
.dropzone .feature-icon { margin: 0 auto var(--s4); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pill { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-top: var(--s4); font-size: .9375rem; }
.bar { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-top: var(--s3); }
.bar span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }
.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 760px) { .option-cards { grid-template-columns: 1fr; } }

/* Spinner and loading */
.spinner { width: 28px; height: 28px; border: 3px solid var(--oat); border-top-color: var(--amber); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-panel { text-align: center; padding: var(--s16) var(--s5); }
.loading-panel .spinner { margin-bottom: var(--s5); }
.steps-list { list-style: none; padding: 0; margin: var(--s6) auto 0; max-width: 320px; text-align: left; display: grid; gap: var(--s3); font-size: .9375rem; color: var(--muted); }
.steps-list li { display: flex; gap: var(--s3); align-items: center; }
.steps-list li.is-done { color: var(--text); }
.steps-list .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--border-strong); flex: none; }
.steps-list li.is-done .dot { background: var(--success); }

/* ---------- Journey pages ---------- */
.page-head { padding: var(--s12) 0 var(--s8); }
.page-head h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.page-head p { color: #344054; font-size: 1.0625rem; max-width: 60ch; }

/* Review */
.review-summary { font-size: 1.0625rem; }
.finding { padding: var(--s5) 0; border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.finding h3 { font-size: 1rem; margin-bottom: var(--s1); }
.finding p { margin: 0; color: #344054; }
.rating-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.rating-row:last-child { border-bottom: 0; }
.rating-row p { margin: var(--s1) 0 0; font-size: .9375rem; color: #344054; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, rgba(250,250,249,0)); padding: var(--s5) 0; margin-top: var(--s6); }

/* Conversation */
.convo { display: flex; flex-direction: column; gap: var(--s4); padding-bottom: var(--s6); }
.msg { max-width: 85%; padding: var(--s3) var(--s4); border-radius: var(--radius-lg); font-size: 1rem; line-height: 1.5; }
.msg-assistant { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-top-left-radius: var(--s1); }
.msg-customer { background: var(--ink); color: #fff; align-self: flex-end; border-top-right-radius: var(--s1); }
.msg-customer.is-skipped { background: var(--bg-2); color: var(--muted); font-style: italic; }
.msg-meta { font-size: .75rem; color: var(--muted); margin-bottom: var(--s1); }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: var(--s3) 0 var(--s4); border-top: 1px solid var(--border); }
.composer-row { display: flex; gap: var(--s2); align-items: flex-end; }
.composer textarea { min-height: var(--touch); max-height: 160px; resize: none; }
.composer-actions { display: flex; justify-content: space-between; margin-top: var(--s2); gap: var(--s2); flex-wrap: wrap; }

/* Confirm details */
.fact-group { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s5); margin-bottom: var(--s5); }
.fact-group > h2 { font-size: 1.125rem; letter-spacing: -0.01em; margin-bottom: var(--s4); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.fact-item { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s3); background: var(--bg); }
.fact-item.from-answer, .line.from-answer .input { border-left: 3px solid var(--amber); }
.line { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.line .input { min-height: 44px; padding: var(--s2) var(--s3); }
.line-bullet { align-items: flex-start; }
.line-tools { display: flex; flex-direction: column; gap: 2px; }
.line-tools .row { flex-wrap: nowrap; }
@media (max-width: 560px) {
  .line-bullet { flex-wrap: wrap; gap: 4px; margin-bottom: var(--s3); }
  .line-bullet > textarea { flex: 1 1 100%; }
  .line-tools { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
}
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--error); background: var(--error-soft); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--s2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--bg-2); border: 1px solid var(--border-strong); }
.legend i.blue { background: var(--amber); border-color: var(--amber); }

/* Order summary */
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.summary-list li:last-child { border-bottom: 0; }
.summary-list .total { font-weight: 700; font-size: 1.0625rem; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; height: calc(100vh - 60px); }
.editor-pane { overflow-y: auto; background: #fff; border-right: 1px solid var(--border); }
.editor-pane-inner { padding: var(--s5); }
.preview-pane { overflow: auto; background: var(--oat); display: flex; flex-direction: column; }
.preview-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s4); background: #fff; border-bottom: 1px solid var(--border); font-size: .875rem; }
.preview-frame-wrap { flex: 1; overflow: auto; padding: 0; }
.preview-frame { border: 0; width: 100%; min-height: 1200px; display: block; }
.editor-tabs { display: none; }
.editor-toolbar { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--border); padding: var(--s3) var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.save-status { font-size: .8125rem; color: var(--muted); display: inline-flex; align-items: center; gap: var(--s2); }
.save-status.is-error { color: var(--error); }
.ed-section { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--s4); background: #fff; }
.ed-section > header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-bottom: 1px solid var(--border); }
.ed-section > header h2 { font-size: .9375rem; margin: 0; letter-spacing: -0.01em; }
.ed-section .ed-body { padding: var(--s4); }
.ed-item { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s3); background: var(--bg); }
.ed-item .field { margin-bottom: var(--s3); }
.ed-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); gap: var(--s2); }
.ai-menu { position: relative; }
.ai-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 210px; padding: var(--s1); }
.ai-menu-list[hidden] { display: none; }
.ai-menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: var(--s3); font: inherit; font-size: .875rem; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; color: var(--text); }
.ai-menu-list button:hover { background: var(--bg-2); }
.flags { margin-bottom: var(--s4); }
.flags li { margin-bottom: var(--s1); }
.template-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.template-option { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--s3); background: #fff; text-align: center; font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; min-height: 44px; }
.template-option[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); color: var(--ink); }
@media (max-width: 960px) {
  .editor { display: block; height: auto; }
  .editor-tabs { display: flex; position: sticky; top: 60px; z-index: 5; background: #fff; border-bottom: 1px solid var(--border); }
  .editor-tabs button { flex: 1; min-height: var(--touch); background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
  .editor-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
  .editor-pane { border-right: 0; }
  .editor[data-view="preview"] .editor-pane, .editor[data-view="edit"] .preview-pane { display: none; }
  .preview-pane { min-height: calc(100vh - 108px); }
}

/* Template gallery */
.template-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.template-card .thumb { height: 380px; overflow: hidden; background: var(--oat); position: relative; }
.template-card iframe { border: 0; width: 210mm; height: 297mm; transform-origin: top left; pointer-events: none; position: absolute; left: 50%; top: 12px; }
.template-card .body { padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }

/* Downloads */
.doc-card { display: flex; gap: var(--s4); align-items: flex-start; }
.doc-card .feature-icon { margin: 0; }
.doc-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }

/* Prose (legal pages) */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.375rem; margin-top: var(--s10); }
.prose h3 { margin-top: var(--s6); }
.prose ul { padding-left: var(--s5); }
.prose li { margin-bottom: var(--s2); }
.placeholder { background: var(--warn-soft); color: var(--warn); padding: 0 6px; border-radius: 4px; font-weight: 600; font-size: .9em; }
.review-flag { border: 1px solid #FEDF89; background: var(--warn-soft); padding: var(--s4); border-radius: var(--radius); font-size: .9375rem; color: #7A2E0E; margin-bottom: var(--s8); }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav { background: var(--ink); color: #fff; padding: var(--s5); }
.admin-nav a { display: block; color: #D0D5DD; text-decoration: none; padding: var(--s2) var(--s3); border-radius: var(--radius-sm); font-size: .9375rem; margin-bottom: 2px; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { padding: var(--s8); overflow-x: auto; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } .admin-main { padding: var(--s4); } }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); }
.stat .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .k { font-size: .8125rem; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .875rem; }
.table th, .table td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--bg-2); font-weight: 600; font-size: .8125rem; color: #344054; }
.table tr:last-child td { border-bottom: 0; }
.pagination { display: flex; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }
.pagination a, .pagination span { padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .875rem; background: #fff; text-decoration: none; }

/* ---------- Cookie consent ---------- */
.consent { position: fixed; left: var(--s4); right: var(--s4); bottom: var(--s4); z-index: 80; max-width: 560px; margin-left: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 40px -12px rgba(21,38,56,.25); padding: var(--s5); font-size: .9375rem; }
.consent p { margin: 0 0 var(--s4); }
.consent-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }

.template-option small { display: block; font-size: .6875rem; font-weight: 700; color: var(--amber-deep); margin-top: 2px; }
