/* InvoiceCraft — shared styles */
:root {
  --ink: #0d1b2a;
  --ink-soft: #3d4f63;
  --muted: #6b7c8f;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --accent: #0f7b5f;
  --accent-dark: #0a5d47;
  --accent-soft: #e6f4ef;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 27, 42, .06), 0 8px 24px rgba(13, 27, 42, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--ink); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c7d0da; background: var(--bg-soft); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -1px;
  margin: 0 0 16px;
  font-weight: 800;
}
.lead {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 30em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* Preview card */
.preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
  font-size: 13px;
}
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.preview-title { font-weight: 700; font-size: 15px; }
.preview-meta { color: var(--muted); font-size: 12px; }
.preview-rows { border-top: 1px solid var(--line); margin-top: 4px; }
.preview-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border-bottom: 0; }
.preview-total { display: flex; justify-content: space-between; padding-top: 12px; font-weight: 700; font-size: 15px; }

/* Sections */
section.block { padding: 56px 0; }
section.block.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.6px; margin: 0 0 12px; font-weight: 800; }
h3 { font-size: 18px; margin: 0 0 8px; font-weight: 700; }
.section-lead { color: var(--ink-soft); max-width: 44em; margin: 0 0 32px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card .num {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 14px;
}
a.card { color: inherit; display: block; transition: border-color .15s ease, box-shadow .15s ease; }
a.card:hover { text-decoration: none; border-color: #c9d3dd; box-shadow: var(--shadow); }
.card-tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.price-amount { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 6px 0 2px; }
.price-amount span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-list { list-style: none; padding: 0; margin: 20px 0 24px; }
.plan-list li { padding: 7px 0 7px 26px; position: relative; color: var(--ink-soft); font-size: 15px; }
.plan-list li::before {
  content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}
.plan-list li.off { color: var(--muted); }
.plan-list li.off::before { content: "—"; color: #c2ccd6; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--ink-soft); margin: 10px 0 0; font-size: 15px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin: 0 0 10px; }
.footer-col a { display: block; color: var(--muted); margin-bottom: 7px; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }

/* Prose pages */
.prose { padding: 48px 0 64px; }
.prose h1 { font-size: clamp(28px, 3.4vw, 38px); }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 22px; }
.prose .updated { color: var(--muted); font-size: 14px; margin-top: -6px; }

/* Forms / tool */
.tool-wrap { padding: 32px 0 64px; }
.tool-head { margin-bottom: 24px; }
.tool-head h1 { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 8px; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.panel-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 123, 95, .12);
}
.field textarea { resize: vertical; min-height: 72px; }

.items-head, .item-row {
  display: grid;
  grid-template-columns: 1fr 80px 110px 110px 36px;
  gap: 10px;
  align-items: center;
}
.items-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.item-row { margin-bottom: 10px; }
.item-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 14px; }
.item-row input:focus { outline: none; border-color: var(--accent); }
.item-amount { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 14px; padding-right: 4px; }
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.icon-btn:hover { color: #b91c1c; border-color: #f3c9c9; background: #fef4f4; }

.totals { margin-top: 18px; margin-left: auto; max-width: 320px; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; color: var(--ink-soft); }
.totals-row.grand { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 19px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.toolbar .spacer { flex: 1; }
.hint { font-size: 13px; color: var(--muted); }

/* The invoice preview sheet */
.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 44px 44px 36px;
  box-shadow: var(--shadow);
}
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 36px; }
.sheet-logo { max-height: 56px; max-width: 180px; object-fit: contain; }
.sheet-bizname { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.sheet-small { font-size: 13px; color: var(--muted); white-space: pre-line; }
.sheet h2.inv { font-size: 30px; letter-spacing: -.5px; margin: 0 0 4px; text-align: right; }
.sheet-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 0 0 8px;
}
.sheet th.r, .sheet td.r { text-align: right; }
.sheet td { padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet .sheet-totals { margin-left: auto; max-width: 300px; margin-top: 18px; }
.sheet .note-block { margin-top: 36px; font-size: 13px; color: var(--ink-soft); white-space: pre-line; }
.sheet .watermark {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid #cbe7dd;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: #14532d;
  margin-bottom: 20px;
}
.callout a { color: var(--accent-dark); font-weight: 600; }

.tool-note { font-size: 13px; color: var(--muted); margin-top: 18px; }

/* Responsive */
@media (max-width: 860px) {
  .hero { padding: 40px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .cards, .price-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .nav a.hide-sm { display: none; }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; grid-template-areas: "desc desc" "qty rate" "amt del"; }
  .item-row .i-desc { grid-area: desc; }
  .item-row .i-qty { grid-area: qty; }
  .item-row .i-rate { grid-area: rate; }
  .item-row .i-amt { grid-area: amt; text-align: left; }
  .item-row .i-del { grid-area: del; justify-self: end; }
  .sheet { padding: 24px 20px; }
  .sheet h2.inv { font-size: 22px; }
  .sheet-parties { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================
   Invoice template system
   ============================================================ */
#sheet {
  --sheet-accent: #0f7b5f;
  --sheet-font: var(--font);
  font-family: var(--sheet-font);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Rules shared by every template */
#sheet table th { border-bottom-color: var(--sheet-accent); }
#sheet .totals-row.grand { color: var(--sheet-accent); }
#sheet .watermark { border-top-color: #eef1f5; }

/* ---------- Minimal ---------- */
.tpl-minimal { border-top: 5px solid var(--sheet-accent); }
.tpl-minimal h2.inv { font-weight: 300; letter-spacing: 5px; font-size: 26px; color: var(--ink); }
.tpl-minimal .label { color: var(--muted); }

/* ---------- Bold ---------- */
.tpl-bold .sheet-top {
  background: var(--sheet-accent);
  color: #fff;
  margin: -44px -44px 32px;
  padding: 34px 44px 30px;
  border-radius: 10px 10px 0 0;
}
.tpl-bold .sheet-top .sheet-bizname { color: #fff; font-size: 25px; letter-spacing: -.4px; }
.tpl-bold .sheet-top .sheet-small { color: rgba(255, 255, 255, .82); }
.tpl-bold .sheet-top h2.inv { color: #fff; font-size: 26px; letter-spacing: 3px; font-weight: 600; }
.tpl-bold .sheet-logo { background: #fff; padding: 6px 8px; border-radius: 6px; }
.tpl-bold .sheet-parties { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.tpl-bold #sheetAmountDue { font-size: 28px; }

/* ---------- Classic ---------- */
.tpl-classic .sheet-top { border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.tpl-classic .sheet-bizname { font-size: 21px; }
.tpl-classic h2.inv { font-size: 32px; letter-spacing: 4px; font-weight: 400; color: var(--ink); }
.tpl-classic .label { letter-spacing: .16em; }
.tpl-classic table th { text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Modern ---------- */
.tpl-modern { border-left: 6px solid var(--sheet-accent); }
.tpl-modern h2.inv { font-size: 22px; letter-spacing: 5px; color: var(--sheet-accent); font-weight: 700; }
.tpl-modern .sheet-bizname { font-size: 22px; }
.tpl-modern .sheet-parties { background: var(--bg-soft); padding: 16px 18px; border-radius: 8px; }
.tpl-modern .sheet-parties .label { color: var(--ink-soft); }
.tpl-modern #sheetAmountDue { font-size: 26px; }

/* ---------- Elegant ---------- */
.tpl-elegant { padding-top: 54px; }
.tpl-elegant .sheet-bizname { font-size: 17px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tpl-elegant h2.inv { font-size: 12px; letter-spacing: .55em; font-weight: 600; color: var(--muted); }
.tpl-elegant #sheetAmountDue { font-weight: 400 !important; font-size: 30px; letter-spacing: -1px; }
.tpl-elegant .sheet td { border-bottom-color: #f0f3f7; }
.tpl-elegant .totals-row.grand { border-top-color: var(--sheet-accent); }

/* ============================================================
   Design panel controls
   ============================================================ */
.tpl-grid {
  --thumb-a: #0f7b5f;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.tpl-opt {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tpl-opt:hover { border-color: #c7d0da; }
.tpl-opt.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 123, 95, .13); }
.tpl-opt .thumb {
  display: block;
  height: 52px;
  border-radius: 5px;
  border: 1px solid #eef1f5;
  margin-bottom: 7px;
}
.tpl-opt .tname { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.tpl-opt.is-active .tname { color: var(--accent-dark); }

/* thumbnails */
.th-min { background: linear-gradient(var(--thumb-a) 0 5px, #fff 5px); }
.th-bold { background: linear-gradient(var(--thumb-a) 0 22px, #fff 22px); }
.th-classic { background: linear-gradient(#fff 0 15px, #0d1b2a 15px 17px, #fff 17px); }
.th-modern { background: linear-gradient(90deg, var(--thumb-a) 0 5px, #fff 5px); }
.th-elegant {
  background:
    linear-gradient(#fff 0 12px, #d8dee6 12px 13px, #fff 13px),
    #fff;
}
.th-elegant::after {
  content: "";
  display: block;
  height: 3px;
  margin: 26px 22px 0;
  background: var(--thumb-a);
  border-radius: 2px;
}

.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}
.sw.is-active { box-shadow: 0 0 0 2px var(--ink); }
input[type="color"]#accentPicker {
  width: 46px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 860px) {
  .tpl-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Print: only the invoice sheet */
@media print {
  .site-header, .site-footer, .no-print, .tool-head, .callout, .tool-note { display: none !important; }
  body { background: #fff; }
  .tool-wrap { padding: 0; }
  .workspace { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .sheet {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    aspect-ratio: auto;
    width: auto !important;
    margin: 0;
  }
  .sheet td, .sheet th { border-color: #ddd; }
  .tpl-bold .sheet-top { margin: 0 0 26px; padding: 22px 24px 20px; border-radius: 0; }
  .tpl-elegant { padding-top: 8px; }
  .tpl-minimal { border-top: 4px solid var(--sheet-accent); border-left: 0; border-right: 0; border-bottom: 0; }
  .tpl-modern { border-left: 5px solid var(--sheet-accent); border-top: 0; border-right: 0; border-bottom: 0; }
  @page { margin: 16mm; }
}

/* ============================================================
   Template gallery page
   ============================================================ */
.tpl-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.tpl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.tpl-card h3 { margin: 16px 0 6px; }
.tpl-card p { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; }

.mini {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  height: 170px;
  overflow: hidden;
}
.mini-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  margin-bottom: 12px;
}
.mini-top i { font-style: normal; letter-spacing: .12em; font-weight: 700; }
.mini-row { height: 7px; background: #eef1f5; border-radius: 3px; margin: 9px 0; }
.mini-total {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.mini[data-tpl="minimal"] { border-top: 4px solid #0f7b5f; }
.mini[data-tpl="minimal"] .mini-top i { font-weight: 300; letter-spacing: .3em; }

.mini[data-tpl="bold"] .mini-top {
  background: #0f7b5f;
  color: #fff;
  margin: -14px -14px 14px;
  padding: 14px;
  border-radius: 7px 7px 0 0;
}
.mini[data-tpl="bold"] .mini-total { border-top: 2px solid #0f7b5f; color: #0f7b5f; font-weight: 700; }

.mini[data-tpl="classic"] .mini-top {
  font-family: Georgia, "Times New Roman", serif;
  border-bottom: 2px solid #0d1b2a;
  padding-bottom: 7px;
}
.mini[data-tpl="classic"] .mini-top i { font-weight: 400; letter-spacing: .3em; font-family: Georgia, "Times New Roman", serif; }

.mini[data-tpl="modern"] { border-left: 5px solid #0f7b5f; }
.mini[data-tpl="modern"] .mini-top i { color: #0f7b5f; letter-spacing: .25em; }
.mini[data-tpl="modern"] .mini-row { background: #e8edf3; }

.mini[data-tpl="elegant"] { padding-top: 26px; }
.mini[data-tpl="elegant"] .mini-top { font-size: 8px; letter-spacing: .14em; text-transform: uppercase; }
.mini[data-tpl="elegant"] .mini-top i { color: #6b7c8f; font-weight: 600; }
.mini[data-tpl="elegant"] .mini-total { font-weight: 400; font-size: 12px; border-top-color: #0f7b5f; }

@media (max-width: 860px) {
  .tpl-gallery { grid-template-columns: 1fr; }
}

/* ============================================================
   v2 — design layer
   ============================================================ */
:root {
  --ink: #0a1220;
  --ink-soft: #3f5168;
  --muted: #71809a;
  --line: #e6ebf2;
  --bg-soft: #f6f8fb;
  --accent: #0e7c5a;
  --accent-dark: #0a5d44;
  --accent-soft: #e7f4ef;
  --shadow-sm: 0 1px 2px rgba(10, 18, 32, .05);
  --shadow-md: 0 4px 16px rgba(10, 18, 32, .06), 0 1px 3px rgba(10, 18, 32, .04);
  --shadow-lg: 0 28px 64px -24px rgba(10, 18, 32, .22);
}

body { letter-spacing: -.011em; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { letter-spacing: -.028em; }

/* header */
.site-header { background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }
.site-header .wrap { min-height: 68px; }
.brand { font-size: 19px; letter-spacing: -.035em; }
.brand-mark { border-radius: 8px; box-shadow: 0 3px 8px rgba(14, 124, 90, .32); }
.nav a { font-size: 14.5px; }
.nav a.btn { box-shadow: var(--shadow-sm); }

/* hero */
.hero { padding: 76px 0 64px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -15% auto;
  height: 620px;
  background:
    radial-gradient(55% 55% at 18% 0%, #e9f6f1 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(45% 50% at 88% 8%, #eef1ff 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.04; letter-spacing: -.042em; font-weight: 800; }
.lead { font-size: 18.5px; line-height: 1.55; max-width: 32em; }
.eyebrow { background: #fff; border: 1px solid #d8ece4; box-shadow: var(--shadow-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  box-shadow: var(--shadow-sm);
}
.chip svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

/* hero artwork */
.hero-art { position: relative; }
.art-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
}
.art-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.art-brand { display: flex; align-items: center; gap: 10px; }
.art-logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, #0e7c5a, #12a074); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.art-name { font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.art-sub { font-size: 11.5px; color: var(--muted); }
.art-tag { font-size: 11px; letter-spacing: .16em; font-weight: 700; color: var(--ink); border: 1px solid var(--ink); padding: 4px 8px; border-radius: 5px; }
.art-parties { display: flex; justify-content: space-between; gap: 20px; margin-top: 22px; font-size: 12px; color: var(--ink-soft); }
.art-label { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.art-list { margin-top: 18px; }
.art-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eef2f7; font-size: 13px; color: var(--ink-soft); }
.art-line:last-child { border-bottom: 0; }
.art-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 14px; border-top: 2px solid var(--ink); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.art-float {
  position: absolute;
  right: 24px;
  top: -15px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 10px;
  box-shadow: 0 14px 30px -10px rgba(14, 124, 90, .55);
}
.art-float2 {
  position: absolute;
  left: -20px;
  bottom: -24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
}
.art-float2 svg { width: 15px; height: 15px; color: var(--accent); }

/* generic sections */
.section { padding: 86px 0; }
.section.tight { padding: 56px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); margin: 0; font-size: 16.5px; }

/* feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #d9e2ec; }
.feature .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; margin-bottom: 16px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font-size: 17px; margin-bottom: 7px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.step { position: relative; padding-left: 54px; }
.step .n {
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* template strip */
.tpl-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.tpl-strip a { display: block; color: inherit; }
.tpl-strip a:hover { text-decoration: none; }
.tpl-strip .mini { height: 148px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.tpl-strip a:hover .mini { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.tpl-strip .cap { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-align: center; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, #0a1220 0%, #0d3a2e 58%, #0e7c5a 130%);
  border-radius: 22px;
  padding: 60px 40px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 12px; }
.cta-band p { color: rgba(255, 255, 255, .74); margin: 0 auto 28px; max-width: 34em; }
.cta-band .btn-primary { background: #fff; color: #0a1220; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); }
.cta-band .btn-primary:hover { background: #f2f6f4; }
.cta-band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }

/* buttons */
.btn { border-radius: 10px; padding: 12px 22px; }
.btn-primary { box-shadow: 0 8px 20px -8px rgba(14, 124, 90, .55); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(14, 124, 90, .6); }
.btn-ghost { box-shadow: var(--shadow-sm); }

/* footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 56px 0 40px; }
.footer-grid { gap: 40px; }
.footer-col h4 { color: var(--ink); font-size: 11.5px; letter-spacing: .1em; }
.footer-col a { font-size: 14px; }
.footer-col .brand { display: inline-flex; font-size: 17px; }

/* panels + fields */
.panel { border-radius: 16px; padding: 26px; box-shadow: var(--shadow-sm); }
.panel-title { color: var(--accent-dark); font-size: 11.5px; letter-spacing: .09em; }
.field label { font-size: 12.5px; }
.field input, .field select, .field textarea { border-radius: 10px; border-color: #dfe6ef; padding: 11px 13px; }
.field select { text-overflow: ellipsis; }
.field input[type="file"] { font-size: 12.5px; padding: 8px 10px; color: var(--muted); }
.field input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.item-row input { border-radius: 9px; border-color: #dfe6ef; }

/* generator workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.workspace .preview-col { position: sticky; top: 88px; }
.toolbar { position: sticky; top: 68px; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); padding: 12px 0; border-bottom: 1px solid var(--line); }

/* sheet */
.sheet {
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  aspect-ratio: var(--paper-w, 215.9) / var(--paper-h, 279.4);
  margin: 0 auto;
}

/* page size controls */
.size-row { display: flex; gap: 8px; align-items: center; }
.size-row input { flex: 1; }
.size-row select { width: 72px; flex: none; }
.paper-note { font-size: 12.5px; color: var(--muted); margin: 0 auto 10px; text-align: center; }
.paper-note b { color: var(--ink-soft); font-weight: 600; }

/* country note */
.geo-note {
  display: flex;
  align-items: center;
  min-height: 43px;
  font-size: 13px;
  line-height: 1.35;
  color: #14532d;
  background: var(--accent-soft);
  border: 1px solid #cbe7dd;
  border-radius: 10px;
  padding: 10px 12px;
}

/* print help */
.print-help {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 4px 18px;
  box-shadow: var(--shadow-sm);
}
.print-help summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 0;
  list-style: none;
  color: var(--ink);
}
.print-help summary::-webkit-details-marker { display: none; }
.print-help summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.print-help[open] summary::after { content: "−"; }
.print-help p { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; line-height: 1.6; }
.print-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace .preview-col { position: static; }
  .feature-grid, .steps, .tpl-strip { grid-template-columns: 1fr; }
  .tpl-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  /* the Bold header band pulls out to the sheet edge; keep it inside the mobile padding */
  .tpl-bold .sheet-top { margin: -24px -20px 24px; padding: 24px 20px 22px; }
}

@media (max-width: 560px) {
  .nav { gap: 11px; }
  .nav a { font-size: 13.5px; white-space: nowrap; }
  .nav a[href="/templates"] { display: none; }
  .brand { font-size: 17px; }
  .nav .btn-sm { padding: 8px 12px; }
}
@media (max-width: 640px) {
  .hero { padding: 44px 0 36px; }
  .section { padding: 56px 0; }
  .cta-band { padding: 40px 22px; border-radius: 16px; }
  .tpl-strip { grid-template-columns: 1fr; }
  .art-card { transform: none; }
  .art-float { right: 6px; top: 12px; }
  .art-float2 { left: 6px; bottom: -14px; }
}

/* two-column feature grid inside guide pages */
.feature-grid.two-col { grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) {
  .feature-grid.two-col { grid-template-columns: 1fr; }
}
