/* ==========================================================================
   InvoiceLocal — local-first PDF invoice generator
   Design tokens shared with the PDF Local family.
   ========================================================================== */

:root {
  --paper: #f8fafc;
  --paper-deep: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #334155;
  --muted: #475569;
  --muted-2: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-line: #fde68a;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .04);
  --shadow-md: 0 2px 6px rgba(15, 23, 42, .06), 0 18px 44px rgba(15, 23, 42, .09);
  --shadow-lg: 0 30px 80px rgba(15, 23, 42, .18);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --header-h: 72px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

[hidden] { display: none !important; }

img, svg { display: block; }
img { max-width: 100%; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
textarea { resize: vertical; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .45);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 300;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-weight: 650;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 18px;
}
.eyebrow.light { color: #bfdbfe; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .13);
  flex: none;
}

.strong-line {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-weight: 650;
}

.section-lede {
  max-width: 570px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.section { padding: 92px 0; }

.section-head {
  display: grid;
  max-width: 770px;
  margin-bottom: 44px;
}
.section-head.centered {
  max-width: 810px;
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}
.section-head.centered .eyebrow { justify-content: center; }
.section-head.centered .section-lede { margin-inline: auto; }

.section-head h2,
.how-copy h2,
.privacy-copy h2,
.faq-grid h2,
.legal-grid h2 {
  font-weight: 600;
  font-size: clamp(33px, 4.1vw, 50px);
  line-height: 1.06;
  letter-spacing: -.035em;
  margin-bottom: 18px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn-sm { min-height: 44px; padding: 0 15px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
}
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); box-shadow: 0 10px 26px rgba(15, 23, 42, .22); }
.btn-primary:disabled { background: #cbd5e1; border-color: #cbd5e1; box-shadow: none; }

.btn-outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-outline:hover { background: #fff; border-color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: rgba(15, 23, 42, .06); }

.btn-soft {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-dark);
  box-shadow: none;
}
.btn-soft:hover { background: #dbeafe; border-color: var(--accent); }

.btn-download { min-height: 54px; font-size: 16px; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
}
.text-btn:hover { color: var(--ink); background: rgba(15, 23, 42, .05); }
.text-btn .icon { width: 18px; height: 18px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(37, 99, 235, .3);
  background: transparent;
  color: var(--accent-dark);
  font-weight: 650;
}
.text-link .icon { width: 16px; height: 16px; }
.text-link:hover { border-bottom-color: var(--accent); }
.text-link.light { color: #bfdbfe; border-bottom-color: rgba(191, 219, 254, .35); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-3);
  flex: none;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--line); }
.icon-btn.is-danger:hover { background: var(--red-bg); color: var(--red); border-color: #f5c5c1; }
.icon-btn .icon { width: 19px; height: 19px; }

.danger-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(15, 23, 42, .16);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  flex: none;
}
.spinner.small { width: 18px; height: 18px; border-width: 2px; border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(248, 250, 252, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(203, 213, 225, .6);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 44px;
  color: var(--ink);
}
.brand-mark { width: 34px; height: 34px; color: var(--ink); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.035em;
}
.brand-text span { color: var(--accent-dark); }
.brand-pill {
  margin-left: 2px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
}
.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 600;
  border: 0;
  background: transparent;
}
.header-nav a:hover { background: rgba(15, 23, 42, .05); color: var(--ink); }

.header-actions { margin-left: auto; }

.plan-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.plan-chip:hover { border-color: var(--line-strong); }
.plan-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, .12);
  flex: none;
}
.plan-chip.is-licensed .plan-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(21, 128, 61, .12); }
.plan-text { display: grid; line-height: 1.2; }
.plan-text strong { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.plan-text small { font-size: 11px; color: var(--muted-2); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 82px 0 92px;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 78% 12%, rgba(37, 99, 235, .10), transparent 68%),
    radial-gradient(700px 380px at 8% 88%, rgba(14, 165, 233, .07), transparent 70%),
    var(--paper);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 54px;
  align-items: center;
}
.hero-copy { max-width: 620px; }

.hero h1 {
  font-size: clamp(41px, 5.3vw, 66px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 800;
  margin-bottom: 24px;
}
.hero-second {
  display: block;
  margin-top: 12px;
  font-size: clamp(19px, 2.15vw, 27px);
  line-height: 1.25;
  letter-spacing: -.025em;
  font-weight: 500;
  color: var(--muted);
}
.hero-second em { font-style: normal; color: var(--accent-dark); font-weight: 700; }

.hero-sub {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 20px;
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}
.trust-row .icon { width: 17px; height: 17px; color: var(--accent-dark); }

.hero-legal {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 12px;
}
.hero-legal .icon { width: 15px; height: 15px; }

/* Hero proof */
.hero-proof {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 440px;
  align-items: center;
}
.proof-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .18), transparent 65%);
  filter: blur(6px);
}
.proof-card {
  position: relative;
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
  transform: rotate(-1.4deg);
}
.proof-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 12px;
}
.proof-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.proof-file .icon { width: 15px; height: 15px; color: var(--accent-dark); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.status-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.proof-sheet {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 22px 20px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .02);
  overflow: hidden;
  min-height: 306px;
}
.sheet-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.sheet-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}
.sheet-brand-lines { display: grid; gap: 5px; flex: 1; }
.sheet-brand-lines span { height: 5px; border-radius: 3px; background: #e2e8f0; display: block; }
.w70 { width: 70%; }
.w60 { width: 60%; }
.w45 { width: 45%; }
.w40 { width: 40%; }
.w80 { width: 80%; }
.w75 { width: 75%; }
.w82 { width: 82%; }
.w90 { width: 90%; }
.sheet-title {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--ink);
}
.sheet-meta { display: flex; gap: 26px; margin-bottom: 16px; }
.sheet-meta div { display: grid; gap: 6px; }
.sheet-label { width: 38px; height: 4px; border-radius: 2px; background: #cbd5e1; }
.sheet-value { height: 5px; border-radius: 3px; background: #e2e8f0; }
.sheet-value.w60 { width: 60px; }
.sheet-value.w45 { width: 45px; }
.sheet-table { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; }
.sheet-tr {
  display: grid;
  grid-template-columns: 1fr 54px 54px;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
}
.sheet-tr span { height: 5px; border-radius: 3px; background: #e2e8f0; }
.sheet-th span { height: 4px; background: #cbd5e1; }
.sheet-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.sheet-total span { width: 54px; height: 5px; border-radius: 3px; background: #e2e8f0; }
.sheet-total strong { font-size: 17px; color: var(--ink); letter-spacing: -.02em; }
.sheet-stamp {
  position: absolute;
  right: -14px;
  bottom: 34px;
  transform: rotate(-24deg);
  border: 2px solid rgba(100, 116, 139, .3);
  color: rgba(100, 116, 139, .42);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .22em;
  padding: 4px 14px 4px 18px;
  border-radius: 4px;
  pointer-events: none;
}
.proof-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 13px 4px 3px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.proof-stat { display: grid; gap: 1px; text-align: center; }
.proof-stat strong { font-size: 16px; letter-spacing: -.02em; }
.proof-stat span { font-size: 10px; color: var(--muted-2); }

.proof-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.proof-chip .icon { width: 15px; height: 15px; color: var(--accent-dark); }
.proof-chip-a { top: 12px; left: -12px; transform: rotate(-2deg); }
.proof-chip-b { bottom: 22px; right: -14px; transform: rotate(2deg); }

/* ==========================================================================
   Template showcase
   ========================================================================== */

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.template-showcase {
  display: grid;
  gap: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.template-showcase:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.showcase-page {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.32;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 15px;
  margin-bottom: 16px;
  overflow: hidden;
}
.showcase-page span { display: block; }
.showcase-meta { display: grid; gap: 3px; margin-bottom: 12px; }
.showcase-meta strong { font-size: 17px; letter-spacing: -.02em; }
.showcase-meta small { color: var(--muted); font-size: 13px; }
.showcase-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
  min-height: 32px;
}
.showcase-cta .icon { width: 15px; height: 15px; }

.showcase-sobria .mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.showcase-sobria .mini-logo { width: 34px; height: 14px; border-radius: 3px; background: var(--ink); }
.showcase-sobria .mini-title { width: 30px; height: 6px; border-radius: 3px; background: #cbd5e1; }
.showcase-sobria .mini-rule { height: 1px; background: var(--line); margin-bottom: 14px; }
.showcase-sobria .mini-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.showcase-sobria .mini-cols span { height: 18px; border-radius: 3px; background: #f1f5f9; }
.showcase-sobria .mini-line { height: 5px; border-radius: 3px; background: #e2e8f0; margin-bottom: 7px; }
.showcase-sobria .mini-total { width: 42%; height: 10px; border-radius: 3px; background: var(--ink); margin-left: auto; margin-top: 14px; }

.showcase-moderna { padding-left: 19px; }
.showcase-moderna .mini-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.showcase-moderna .mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.showcase-moderna .mini-logo { width: 34px; height: 14px; border-radius: 3px; background: var(--accent); }
.showcase-moderna .mini-title { width: 30px; height: 6px; border-radius: 3px; background: var(--accent); }
.showcase-moderna .mini-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; padding: 10px; background: var(--accent-soft); border-radius: 4px; }
.showcase-moderna .mini-cols span { height: 12px; border-radius: 2px; background: #bfdbfe; }
.showcase-moderna .mini-table-head { height: 12px; border-radius: 3px; background: var(--accent); margin-bottom: 10px; }
.showcase-moderna .mini-line { height: 5px; border-radius: 3px; background: #e2e8f0; margin-bottom: 7px; }
.showcase-moderna .mini-total { width: 46%; height: 12px; border-radius: 3px; background: var(--accent); margin-left: auto; margin-top: 14px; }

.showcase-clasica .mini-head-center { display: flex; justify-content: center; margin-bottom: 8px; }
.showcase-clasica .mini-logo { width: 40px; height: 12px; border-radius: 2px; background: #9ca3af; }
.showcase-clasica .mini-title-center { width: 52px; height: 7px; background: var(--ink); margin: 0 auto 8px; }
.showcase-clasica .mini-double { height: 4px; border-top: 1px solid #9ca3af; border-bottom: 1px solid #d1d5db; margin-bottom: 16px; }
.showcase-clasica .mini-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.showcase-clasica .mini-cols span { height: 18px; border-radius: 2px; background: #f3f4f6; }
.showcase-clasica .mini-line { height: 4px; border-radius: 2px; background: #e5e7eb; margin-bottom: 8px; }
.showcase-clasica .mini-total { width: 42%; height: 9px; border-radius: 2px; background: var(--ink); margin-left: auto; margin-top: 16px; }

.template-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 13px;
}
.template-note .icon { width: 16px; height: 16px; color: var(--accent-dark); }

/* ==========================================================================
   How it works / privacy
   ========================================================================== */

.how-section { background: var(--surface); border-block: 1px solid var(--line); }
.how-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: start;
}
.how-copy .legal-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 390px;
}
.how-copy .legal-inline .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }

.how-steps { display: grid; gap: 4px; }
.how-steps li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.how-steps li:last-child { border-bottom: 1px solid var(--line); }
.step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 4px;
}
.how-steps h3 { font-size: 17px; letter-spacing: -.015em; margin-bottom: 5px; }
.how-steps p { color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 480px; }

.privacy-band {
  background: var(--ink);
  color: #e2e8f0;
  padding: 84px 0;
}
.privacy-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 64px;
}
.privacy-copy h2 { color: #f8fafc; }
.privacy-copy p { color: #cbd5e1; max-width: 440px; margin-bottom: 18px; }
.privacy-copy .text-link { margin-top: 4px; }
.privacy-points { display: grid; gap: 24px; }
.privacy-points li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
}
.privacy-points li:last-child { border-bottom: 0; padding-bottom: 0; }
.point-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(148, 163, 184, .25);
  color: #93c5fd;
}
.point-icon .icon { width: 20px; height: 20px; }
.privacy-points h3 { color: #f8fafc; font-size: 16px; margin-bottom: 4px; }
.privacy-points p { color: #94a3b8; font-size: 14px; line-height: 1.55; max-width: 420px; }

/* ==========================================================================
   Pricing
   ========================================================================== */

.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 20px;
  max-width: 930px;
  margin: 0 auto;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.price-card.featured {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
}
.price-flag {
  position: absolute;
  top: -12px;
  left: 28px;
  padding: 4px 10px;
  background: var(--ink);
  color: #fff;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.price-top { padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.price-top h3 { font-size: 15px; letter-spacing: -.01em; margin-bottom: 8px; }
.price-amount { font-size: 46px; font-weight: 650; letter-spacing: -.045em; line-height: 1; margin-bottom: 10px; }
.price-amount span { font-size: 15px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }
.price-sub { color: var(--muted); font-size: 13.5px; }

.check-list { display: grid; gap: 11px; margin-bottom: 26px; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.45;
}
.check-list .icon { width: 17px; height: 17px; color: var(--accent-dark); margin-top: 2px; flex: none; }
.check-list li.muted { color: var(--muted-2); }
.price-card .btn { margin-top: auto; }
.checkout-fineprint { margin-top: 10px; text-align: center; color: var(--muted-2); font-size: 11px; }
.pricing-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  max-width: 700px;
  margin: 30px auto 0;
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: left;
}
.pricing-note .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-section { background: var(--surface); border-block: 1px solid var(--line); }
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: 64px;
  align-items: start;
}
.faq-list { display: grid; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 14px 0;
  list-style: none;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent-dark); }
.faq-plus {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted-2);
  transition: transform .18s ease;
  flex: none;
}
details[open] .faq-plus { transform: rotate(45deg); }
.faq-list details p {
  padding: 0 32px 20px 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.62;
  max-width: 650px;
}

/* ==========================================================================
   Legal band
   ========================================================================== */

.legal-band { padding: 0 0 84px; }
.legal-grid {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  padding: 26px 28px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-lg);
}
.legal-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--amber-line);
  color: var(--amber);
}
.legal-icon .icon { width: 22px; height: 22px; }
.legal-grid h2 { font-size: 19px; letter-spacing: -.015em; margin-bottom: 7px; }
.legal-grid p { color: #78350f; font-size: 13.5px; line-height: 1.6; max-width: 840px; }
.legal-grid strong { color: #451a03; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .72fr)) minmax(0, 1.1fr);
  gap: 38px;
  padding-bottom: 38px;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
}
.footer-brand .brand { color: #f8fafc; }
.footer-brand .brand-text span { color: #93c5fd; }
.footer-brand p { margin-top: 14px; color: #94a3b8; font-size: 13px; line-height: 1.6; max-width: 310px; }
.footer-legal { color: #fbbf24 !important; font-size: 11.5px !important; margin-top: 10px !important; }
.footer-col { display: grid; align-content: start; gap: 2px; }
.footer-col h3 {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 13.5px;
  text-align: left;
}
.footer-link:hover { color: #f8fafc; }
.footer-note p { color: #94a3b8; font-size: 12.5px; line-height: 1.6; max-width: 270px; }
.footer-version { margin-top: 12px; font-family: var(--mono); font-size: 10.5px !important; color: #64748b !important; }
.footer-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  color: #64748b;
  font-size: 12px;
}
.footer-dot { color: #475569; }

/* ==========================================================================
   Builder
   ========================================================================== */

#viewBuilder { padding: 34px 0 90px; }

.builder-container { width: min(1280px, calc(100% - 40px)); }

.builder-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.builder-title h1 {
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.035em;
  line-height: 1.1;
}
.builder-title .eyebrow { margin-bottom: 4px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.privacy-pill .icon { width: 15px; height: 15px; }

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  gap: 26px;
  align-items: start;
}

.builder-form { display: grid; gap: 18px; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-head h2 { font-size: 17px; letter-spacing: -.02em; margin-bottom: 3px; }
.card-sub { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 9px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.card-tag .icon { width: 12px; height: 12px; }
.card-tag-soft { background: var(--green-bg); border-color: #bbf7d0; color: var(--green); }

.field-grid { display: grid; gap: 14px; }
.field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: .005em;
}
.label-optional { color: var(--muted-2); font-weight: 500; }
.field-help { color: var(--muted-2); font-size: 11.5px; line-height: 1.4; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
textarea { min-height: 84px; padding-top: 11px; line-height: 1.5; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--red);
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}
input[type="date"] { min-height: 46px; }

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

/* Form errors */
.form-errors {
  background: var(--red-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #7f1d1d;
}
.form-errors strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  margin-bottom: 6px;
}
.form-errors ul { display: grid; gap: 3px; padding-left: 18px; list-style: disc; }
.form-errors li { font-size: 12.5px; line-height: 1.45; }

/* Logo */
.logo-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.logo-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  padding: 10px;
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
}
.logo-drop:hover, .logo-drop.is-drag { background: var(--accent-soft); }
.logo-empty { display: flex; align-items: center; gap: 12px; text-align: left; }
.logo-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  flex: none;
}
.logo-empty-icon .icon { width: 20px; height: 20px; }
.logo-empty strong { display: block; font-size: 13px; }
.logo-empty small { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.logo-preview { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 62px; }
.logo-preview img { max-height: 62px; max-width: 190px; width: auto; height: auto; object-fit: contain; }
.logo-side { display: grid; gap: 8px; align-content: center; justify-items: start; }
.logo-state { color: var(--muted); font-size: 11.5px; line-height: 1.4; word-break: break-word; }

/* Items */
.items-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px 110px 44px;
  gap: 10px;
  padding: 0 0 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.items-head span:nth-child(2),
.items-head span:nth-child(3),
.items-head span:nth-child(4) { text-align: right; }
.items-list { display: grid; gap: 10px; }
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px 110px 44px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.item-field { display: grid; gap: 5px; min-width: 0; }
.item-field label { display: none; font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.item-row input { min-height: 44px; font-size: 14px; padding: 9px 10px; }
.item-qty input, .item-price input { text-align: right; }
.item-amount {
  display: grid;
  gap: 3px;
  align-content: end;
  min-height: 44px;
  padding-bottom: 11px;
  text-align: right;
  min-width: 0;
}
.item-amount span { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.item-amount strong { font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-remove { align-self: end; }

.items-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.items-tax-note { color: var(--muted-2); font-size: 11.5px; text-align: right; }

/* Template picker */
.template-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.template-card { display: block; cursor: pointer; }
.template-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.template-card-body {
  position: relative;
  display: grid;
  gap: 10px;
  height: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.template-card:hover .template-card-body { border-color: var(--line-strong); }
.template-card input:checked + .template-card-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: #fbfdff;
}
.template-card input:focus-visible + .template-card-body { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.template-card-text { display: grid; gap: 2px; }
.template-card-text strong { font-size: 13.5px; letter-spacing: -.01em; }
.template-card-text small { color: var(--muted-2); font-size: 11px; line-height: 1.35; }
.template-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  opacity: 0;
  transform: scale(.75);
  transition: opacity .15s ease, transform .15s ease;
}
.template-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.template-card input:checked + .template-card-body .template-check { opacity: 1; transform: scale(1); }

.tpl-swatch {
  position: relative;
  display: block;
  height: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  overflow: hidden;
}
.tpl-bar, .tpl-head, .tpl-rule, .tpl-lines, .tpl-total { display: block; }
.tpl-head { width: 34px; height: 10px; border-radius: 2px; background: var(--ink); margin-bottom: 8px; }
.tpl-rule { height: 1px; background: var(--line); margin-bottom: 6px; }
.tpl-lines { height: 18px; background: repeating-linear-gradient(#eef2f7 0 3px, transparent 3px 7px); margin-bottom: 8px; }
.tpl-total { width: 38%; height: 7px; border-radius: 2px; background: var(--ink); margin-left: auto; }
.tpl-sobria .tpl-bar { display: none; }
.tpl-moderna .tpl-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.tpl-moderna .tpl-head { background: var(--accent); }
.tpl-moderna .tpl-lines { background: repeating-linear-gradient(#eff6ff 0 4px, transparent 4px 8px); }
.tpl-moderna .tpl-total { background: var(--accent); }
.tpl-clasica .tpl-head { width: 44px; background: #6b7280; margin-inline: auto; }
.tpl-clasica .tpl-rule { height: 3px; border-top: 1px solid #9ca3af; border-bottom: 1px solid #d1d5db; background: transparent; }
.tpl-clasica .tpl-total { background: #111827; }

/* Numbering */
.numbering-card { padding: 0; overflow: hidden; }
.numbering-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
}
.numbering-card summary::-webkit-details-marker { display: none; }
.numbering-card summary:hover { background: var(--surface-soft); }
.numbering-card summary strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.numbering-card summary small { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.numbering-card summary .icon { width: 18px; height: 18px; color: var(--muted-2); transition: transform .15s ease; }
.numbering-card[open] summary .icon { transform: rotate(90deg); }
.numbering-card[open] summary { border-bottom: 1px solid var(--line); }
.numbering-card .field-grid { padding: 18px 22px 0; }
.numbering-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px 18px;
}
.numbering-foot .field-help strong { color: var(--ink-2); }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 4px;
}
.form-actions-note { color: var(--muted-2); font-size: 11.5px; text-align: right; }

/* ==========================================================================
   Preview panel
   ========================================================================== */

.preview-panel { min-width: 0; }
.preview-card {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.preview-title { display: flex; align-items: center; gap: 11px; }
.preview-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  flex: none;
}
.preview-icon .icon { width: 19px; height: 19px; }
.preview-title h2 { font-size: 15.5px; letter-spacing: -.015em; }
.preview-title p { color: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.live-pill span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.preview-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.watermark-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 6px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 650;
}
.watermark-badge .icon { width: 12px; height: 12px; }
.watermark-badge.is-off { background: var(--green-bg); border-color: #bbf7d0; color: var(--green); }
.preview-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 10px; }
.preview-note .icon { width: 12px; height: 12px; }

.preview-pages {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 300px;
  max-height: 58vh;
  padding: 24px;
  overflow: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}
.preview-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}
.preview-loading p { font-size: 12.5px; }
.preview-page {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #fff;
  box-shadow: var(--shadow-md);
  border-radius: 2px;
  overflow: hidden;
}
.preview-page canvas { display: block; width: 100%; height: auto; }
.preview-page-label {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
}
.preview-more {
  padding: 8px 12px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.preview-error {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 50px 22px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.preview-error .icon { width: 24px; height: 24px; color: var(--red); }

.preview-summary {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.summary-row strong { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.summary-total {
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 650;
  font-size: 13px;
}
.summary-total strong { font-size: 18px; letter-spacing: -.025em; }

.preview-card .btn-download { margin-top: 12px; }
.download-hint {
  min-height: 17px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.download-hint.is-warning { color: var(--amber); font-weight: 600; }

.preview-secondary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.preview-save {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
}
.preview-save .icon { width: 12px; height: 12px; margin-top: 1px; }
.legal-card {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}
.legal-card .icon { width: 13px; height: 13px; margin-top: 1px; flex: none; }

/* Mobile bar */
.mobile-bar { display: none; }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .75);
}
.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  animation: modalIn .18s ease;
  z-index: 1;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.modal-close:hover { background: var(--paper-deep); color: var(--ink); }
.modal-close .icon { width: 20px; height: 20px; }
.modal h2 { font-size: 25px; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 10px; }
.modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.modal-eyebrow .icon { width: 14px; height: 14px; }
.modal-lede { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 18px; }

.limit-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  color: #78350f;
  font-size: 12.5px;
  line-height: 1.5;
}
.limit-banner .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--amber); flex: none; }

.order-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  margin-bottom: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.order-box strong { display: block; font-size: 14px; }
.order-box span { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.order-price { font-size: 27px; font-weight: 700; letter-spacing: -.035em; white-space: nowrap; }
.order-price small { font-size: 11px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }

.modal .check-list { margin-bottom: 20px; }
.modal .check-list li { font-size: 13px; }
.checkout-note { margin-top: 12px; color: var(--muted-2); font-size: 10.5px; line-height: 1.5; text-align: center; }
.modal-fine { margin-top: 8px; color: var(--muted-2); font-size: 10px; text-align: center; }
.modal .legal-card { justify-content: center; text-align: center; border-top: 0; padding-top: 4px; margin-top: 12px; }

.success-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  color: var(--accent-dark);
}
.success-icon .icon { width: 26px; height: 26px; stroke-width: 2.6; }

.license-box {
  display: grid;
  gap: 4px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--ink);
  border-radius: var(--radius-md);
  color: #f8fafc;
}
.license-box .label { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; }
.license-key {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .08em;
  color: #fff;
  word-break: break-all;
}
.license-meta { color: #94a3b8; font-size: 11px; }

.license-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  color: #92400e;
}
.license-status .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--amber); flex: none; }
.license-status strong { display: block; font-size: 12.5px; }
.license-status span { display: block; color: var(--amber); font-size: 11px; }

.processing {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 16px;
  text-align: center;
}
.processing strong { font-size: 16px; }
.processing p { color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 320px; }

.modal .btn-block { margin-top: 2px; }
.modal .danger-link { margin-top: 10px; justify-content: center; width: 100%; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 250;
  transform: translateX(-50%);
  max-width: min(460px, calc(100% - 32px));
  padding: 12px 18px;
  background: var(--ink);
  color: #f8fafc;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  animation: toastIn .18s ease;
}
.toast.is-success { background: #14532d; }
.toast.is-error { background: #7f1d1d; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .builder-grid { grid-template-columns: minmax(0, 1fr) 440px; }
  .proof-chip-a { left: 0; }
  .proof-chip-b { right: 0; }
}

@media (max-width: 1080px) {
  .builder-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; }
  .preview-pages { max-height: 68vh; }
  .preview-page { max-width: 470px; }
  .preview-summary, .preview-card .btn-download, .download-hint { max-width: none; }
}

@media (max-width: 980px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); gap: 34px; }
  .proof-chip { display: none; }
  .template-grid { gap: 14px; }
  .how-grid, .privacy-grid, .faq-grid { gap: 40px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-note { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .header-nav { display: none; }
  #viewBuilder { padding-bottom: 116px; }
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    background: rgba(248, 250, 252, .95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  }
  .mobile-total { display: grid; gap: 1px; min-width: 0; }
  .mobile-total span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .mobile-total strong { font-size: 18px; letter-spacing: -.025em; white-space: nowrap; }
  .mobile-bar .btn { min-height: 48px; padding: 0 18px; flex: none; }
  .mobile-bar .btn .icon { width: 17px; height: 17px; }
  .mobile-actions { display: flex; align-items: center; gap: 8px; flex: none; }
  .mobile-preview-btn { padding: 0 12px; font-size: 13px; }
  .mobile-preview-btn .icon { width: 17px; height: 17px; }
  .toast { bottom: 92px; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 640px; }
  .hero-proof { display: none; }
  .hero-sub { font-size: 16px; }
  .pricing-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .how-grid, .privacy-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .privacy-points { margin-top: 8px; }
  .legal-grid { grid-template-columns: 46px 1fr; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 40px); }
  .section { padding: 66px 0; }
  .section-head { margin-bottom: 30px; }
  .template-grid { grid-template-columns: minmax(0, 1fr); max-width: 480px; }
  .showcase-page { aspect-ratio: 1 / .92; }
  .builder-head { grid-template-columns: 1fr; gap: 8px; margin-bottom: 18px; }
  .builder-head .privacy-pill { justify-self: start; }
  .builder-head .text-btn { justify-self: start; margin-left: -10px; }
  .builder-container { width: calc(100% - 28px); }
  .card { padding: 18px; }
  .field-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid-3 .field:last-child { grid-column: span 2; }
  .logo-row { grid-template-columns: minmax(0, 1fr); }
  .logo-side { justify-items: stretch; }
  .logo-side .btn { width: 100%; }
  .template-picker { grid-template-columns: minmax(0, 1fr); }
  .tpl-swatch { height: 64px; }
  .template-card-body { grid-template-columns: 104px 1fr; align-items: center; }
  .template-card-text { align-self: center; }
  .preview-pages { max-height: 62vh; }
  .items-actions { flex-direction: column; align-items: flex-start; gap: 6px; }
  .items-tax-note { text-align: left; }
  .form-actions { flex-direction: column; align-items: flex-start; }
  .form-actions-note { text-align: left; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-note { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .brand-pill { display: none; }
  .header-inner { gap: 10px; }
  .plan-chip { padding: 5px 10px; gap: 7px; }
  .plan-text small { display: none; }
  .field-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .field-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .field-span-2 { grid-column: span 1; }
  .field-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .field-grid-3 .field:last-child { grid-column: span 1; }

  .items-head { display: none; }
  .items-list { gap: 12px; }
  .item-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    grid-template-areas:
      "desc desc desc"
      "qty price remove"
      "amount amount amount";
    gap: 9px 10px;
    padding: 12px;
    align-items: end;
  }
  .item-desc { grid-area: desc; }
  .item-qty { grid-area: qty; }
  .item-price { grid-area: price; }
  .item-field label { display: block; }
  .item-amount {
    grid-area: amount;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    min-height: 0;
    padding: 3px 2px 0;
    border-top: 1px dashed var(--line);
    margin-top: 2px;
  }
  .item-amount strong { font-size: 14px; }
  .item-remove { grid-area: remove; justify-self: end; }

  .preview-pages { padding: 10px; max-height: 56vh; }
  .preview-card { padding: 14px; }
  .preview-head { gap: 8px; }
  .preview-title p { font-size: 10px; }
  .live-pill { display: none; }
  .preview-badges { flex-wrap: wrap; }

  .hero h1 { font-size: clamp(38px, 10.6vw, 52px); }
  .hero-actions .btn { width: 100%; }
  .trust-row { gap: 8px 14px; }
  .legal-grid { padding: 20px; }
  .faq-list details p { padding-right: 0; }
  .price-card { padding: 24px 20px; }
  .numbering-foot { flex-direction: column; align-items: flex-start; }
  .modal { padding: 26px 20px; }
  .order-box { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-bottom { font-size: 11px; }
}

@media (max-width: 430px) {
  .container { width: calc(100% - 32px); }
  .builder-container { width: calc(100% - 24px); }
  .card { padding: 16px; border-radius: 16px; }
  .logo-drop { min-height: 78px; }
  .logo-empty { gap: 9px; }
  .logo-empty-icon { width: 36px; height: 36px; }
  .brand-text { font-size: 19px; }
  .brand-mark { width: 31px; height: 31px; }
  .mobile-bar { padding-inline: 12px; gap: 8px; }
  .mobile-bar .btn { padding: 0 12px; font-size: 14px; }
  .mobile-bar .btn .icon { width: 16px; height: 16px; }
  .mobile-preview-btn { width: 46px; padding: 0; }
  .mobile-preview-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
