/* Billyra — calm, paper-and-ink design. Restraint over decoration. */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #F8F6F0;
  --surface: #FFFFFF;
  --desk: #EFECE3;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --brand: #2563EB;
  --brand-hover: #1D4ED8;
  --brand-soft: #EFF6FF;
  --accent-orange: #FF8A00;
  --accent-cyan: #06B6D4;
  --gold: #FF8A00;
  --danger: #EF4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .10);
  --shadow-paper: 0 1px 1px rgba(15, 23, 42, .04), 0 12px 32px -6px rgba(15, 23, 42, .16), 0 40px 60px -30px rgba(15, 23, 42, .18);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15.5px/1.6 var(--sans); color: var(--ink); background: var(--bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Display type: serif for Latin scripts, sturdy sans for CJK / Devanagari */
.hero h1, .section-title, .prose h1, .pricing-head h1, .app-head h1, .cta-band p, .modal h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
:lang(ja) .hero h1, :lang(ja) .section-title, :lang(ja) .prose h1, :lang(ja) .pricing-head h1, :lang(ja) .app-head h1, :lang(ja) .cta-band p, :lang(ja) .modal h2,
:lang(hi) .hero h1, :lang(hi) .section-title, :lang(hi) .prose h1, :lang(hi) .pricing-head h1, :lang(hi) .app-head h1, :lang(hi) .cta-band p, :lang(hi) .modal h2 { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(246, 245, 241, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 22px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.03em; }
.brand .logo-mark { width: 30px; height: 30px; object-fit: contain; display: block; }
.brand .brand-i { font-style: normal; color: var(--accent-orange); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; white-space: nowrap; font-size: 14.5px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: rgba(16, 24, 40, .05); }
.nav a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.nav .nav-pro { color: var(--gold); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.lang select { font: inherit; font-size: 14px; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23667085' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--ink); appearance: none; cursor: pointer; }
@media (max-width: 760px) {
  .head-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 6px; min-height: 0; }
  .head-actions { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -20px; padding: 0 16px 4px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px; line-height: 1; padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .1s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 1px 2px rgba(16, 24, 40, .2); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-light { background: #fff; color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-social { width: 100%; background: var(--surface); border-color: var(--line-2); color: var(--ink); padding: 12px 18px; }
.btn-social:hover { background: var(--bg); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }
.link-arrow { font-weight: 600; text-decoration: none; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 38px; height: 38px; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Hero */
.hero { padding-top: 44px; padding-bottom: 20px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--brand); background: var(--brand-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 16px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 64px); margin-bottom: 10px; }
.lede { color: var(--ink-2); font-size: 17.5px; max-width: 62ch; }
.note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }

/* Workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 28px; align-items: start; padding-top: 8px; padding-bottom: 48px; }
@media (max-width: 1040px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
.editor { display: grid; gap: 14px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0; min-width: 0; box-shadow: var(--shadow-sm); }
legend { font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); padding: 0 6px; margin-left: -6px; float: left; width: 100%; margin-bottom: 12px; }
:lang(ja) legend, :lang(hi) legend { text-transform: none; letter-spacing: 0; }
legend + * { clear: both; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.editor > .grid2 { gap: 14px; }
@media (max-width: 640px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .stack-sm { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
}
.mt { margin-top: 14px; }
.fld { display: grid; gap: 5px; margin-bottom: 10px; min-width: 0; }
.fld > span, .fld-l { font-size: 12.5px; color: var(--ink-2); font-weight: 500; display: flex; justify-content: space-between; align-items: baseline; }
.fld-opt { font-size: 11px; color: var(--muted); font-weight: normal; }
.btn-clear-date { background: none; border: 0; padding: 0 4px; font-size: 11.5px; color: var(--brand); cursor: pointer; text-decoration: underline; font-weight: 500; }
.btn-clear-date:hover { color: var(--ink); }
input, textarea, select { font: inherit; font-size: 15px; color: var(--ink); background: #FCFCFA; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s, background .15s; }
input:hover, textarea:hover, select:hover { border-color: #BDB8AA; }
input:focus, textarea:focus, select:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 110, 86, .14); }
textarea { resize: vertical; min-height: 64px; }
input[type="date"] { min-height: 42px; }
.logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.items-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 116px 38px; gap: 8px; align-items: center; }
.items-head { font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.item-row { margin-bottom: 8px; }
@media (max-width: 480px) { .items-head, .item-row { grid-template-columns: minmax(0, 1fr) 54px 84px 34px; gap: 6px; } }

/* Template + colour pickers */
.tpl-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (max-width: 640px) { .tpl-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } }
.tpl { display: grid; gap: 6px; justify-items: center; padding: 8px 4px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #FCFCFA; font: inherit; font-size: 11.5px; color: var(--ink); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.tpl:hover { border-color: var(--ink-2); background: #fff; }
.tpl[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 110, 86, .14); background: #fff; }
.tpl-art { width: 44px; height: 58px; background: #fff; border: 1px solid var(--line); border-radius: 4px; display: grid; align-content: start; gap: 4px; padding: 6px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.tpl-art i { display: block; height: 3px; border-radius: 2px; background: var(--line-2); }
.tpl-art i:first-child { width: 60%; height: 5px; background: var(--c, #1E3A8A); }
.tpl-thumb-modern .tpl-art { padding-top: 0; }
.tpl-thumb-modern .tpl-art i:first-child { width: calc(100% + 12px); margin: 0 -6px 2px; height: 13px; border-radius: 3px 3px 0 0; }
.tpl-thumb-minimal .tpl-art i:first-child { background: var(--ink); width: 40%; height: 3px; }
.tpl-thumb-executive .tpl-art { padding-top: 0; }
.tpl-thumb-executive .tpl-art i:first-child { width: calc(100% + 12px); margin: 0 -6px 2px; height: 13px; background: #0E1B2C; border-radius: 3px 3px 0 0; border-bottom: 2px solid var(--c, #B8860B); }
.tpl-thumb-studio .tpl-art i:first-child { width: 55%; height: 6px; border-radius: 999px; background: var(--c, #1E3A8A); }
.tpl-thumb-fintech .tpl-art i { border-radius: 0; height: 2px; }
.tpl-thumb-fintech .tpl-art i:first-child { width: 50%; height: 3px; background: #0E1B2C; }
.tpl-thumb-bold .tpl-art { border-left: 4px solid var(--c, #1E3A8A); padding-left: 4px; }
.tpl-thumb-compact .tpl-art { gap: 2px; padding: 4px; }
.tpl-thumb-compact .tpl-art i { height: 2px; }
.tpl-thumb-elegant .tpl-art { outline: 1px solid #D5CEBE; outline-offset: -3px; }
.tpl-thumb-elegant .tpl-art i:first-child { width: 45%; height: 3px; background: var(--ink-2); }
.tpl-thumb-split .tpl-art::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 14px; height: 10px; background: #0E1B2C; border-radius: 2px; }
.badge-pro { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--gold); border: 1px solid currentColor; border-radius: 999px; padding: 1px 6px; margin-left: 2px; vertical-align: 1px; }
.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatches .fld-l { margin-right: 4px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch-custom { background: conic-gradient(#ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6, #ef4444); }
.swatch-custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; width: auto; }
.pro-msg { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-2); }

/* Preview */
.preview { position: sticky; top: 84px; min-width: 0; }
@media (max-width: 1040px) { .preview { position: static; } }
.preview-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin: 0; min-height: 1.4em; }
.desk { background: var(--desk); border-radius: 18px; padding: 28px; border: 1px solid var(--line); }
@media (max-width: 640px) { .desk { padding: 12px; border-radius: 14px; } }
.paper-scroll { overflow-x: auto; }

.paper {
  --accent: #1E3A8A;
  background: #fff; color: #1a202c; width: 100%; min-width: 540px; aspect-ratio: 210 / 297;
  padding: 44px 44px 30px; box-shadow: var(--shadow-paper); border-radius: 3px;
  font: 12px/1.5 var(--sans); display: flex; flex-direction: column;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.paper .muted { color: #a0aec0; }
.p-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.p-from { display: flex; flex-direction: column; gap: 10px; max-width: 55%; }
.p-logo { max-width: 170px; max-height: 64px; object-fit: contain; align-self: flex-start; }
.p-title { text-align: right; }
.p-title h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-family: var(--sans); }
.p-meta { margin-left: auto; border-collapse: collapse; }
.p-meta th { text-align: right; font-weight: 500; color: #718096; padding: 1px 12px 1px 0; }
.p-meta td { text-align: right; padding: 1px 0; font-variant-numeric: tabular-nums; }
.p-to { margin-bottom: 26px; }
.p-label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: #718096; margin-bottom: 4px; font-weight: 600; }
.p-items { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.p-items th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--accent); padding: 8px 10px; font-weight: 600; }
.p-items td { padding: 9px 10px; border-bottom: 1px solid #edf0f5; vertical-align: top; word-break: break-word; }
.p-items .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-totals { margin-left: auto; border-collapse: collapse; min-width: 46%; font-variant-numeric: tabular-nums; }
.p-totals th { text-align: left; font-weight: 500; color: #4a5568; padding: 5px 10px; }
.p-totals td { text-align: right; padding: 5px 10px; white-space: nowrap; }
.p-grand th, .p-grand td { font-size: 14.5px; font-weight: 700; color: #1a202c; border-top: 2px solid var(--accent); padding-top: 9px; }
.p-note { margin-top: 20px; color: #4a5568; }
.p-brand { margin-top: auto; padding-top: 24px; text-align: center; font-size: 9.5px; color: #a0aec0; letter-spacing: .02em; }
/* 2. Modern (Free) */
.tpl-modern { padding-top: 0; }
.tpl-modern .p-head { margin: 0 -44px 30px; padding: 36px 44px 26px; background: var(--accent); color: #fff; border-radius: 3px 3px 0 0; }
.tpl-modern .p-title h2, .tpl-modern .p-meta th { color: rgba(255, 255, 255, .85); }
.tpl-modern .p-items th { background: #f1f4f9; color: #4a5568; }

/* 3. Minimal (Pro) */
.tpl-minimal .p-title h2 { color: #1a202c; font-weight: 400; font-size: 26px; letter-spacing: .02em; text-transform: none; font-family: var(--serif); }
.tpl-minimal .p-items th { background: none; color: #718096; border-bottom: 1px solid #1a202c; padding-left: 0; }
.tpl-minimal .p-items td { padding-left: 0; }
.tpl-minimal .p-grand th, .tpl-minimal .p-grand td { border-top-color: #1a202c; }

/* 4. Executive (Pro) */
.tpl-executive { padding-top: 0; }
.tpl-executive .p-head { margin: 0 -44px 28px; padding: 32px 44px 24px; background: #0E1B2C; color: #fff; border-bottom: 3px double var(--accent); border-radius: 3px 3px 0 0; }
.tpl-executive .p-title h2 { color: #fff; letter-spacing: .12em; font-size: 22px; }
.tpl-executive .p-meta th { color: #94A3B8; }
.tpl-executive .p-items th { background: #0E1B2C; color: #fff; letter-spacing: .08em; font-size: 9px; }
.tpl-executive .p-items tbody tr:nth-child(even) td { background: #F8FAFC; }
.tpl-executive .p-grand th, .tpl-executive .p-grand td { border-top: 3px double var(--accent); color: #0E1B2C; }

/* 5. Studio (Pro) */
.tpl-studio .p-head { border-bottom: 2px solid var(--accent); padding-bottom: 22px; }
.tpl-studio .p-title h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; text-transform: none; color: #1a202c; margin-bottom: 8px; }
.tpl-studio .p-meta tr:first-child td { display: inline-block; padding: 2px 10px; background: var(--accent); color: #fff; border-radius: 999px; font-weight: 600; }
.tpl-studio .p-items th { background: none; color: var(--accent); border-bottom: 2px solid var(--accent); padding-left: 0; }
.tpl-studio .p-items td { padding-left: 0; }
.tpl-studio .p-totals { background: #F8FAFC; padding: 14px; border-radius: 8px; border: 1px solid #E2E8F0; }
.tpl-studio .p-grand th, .tpl-studio .p-grand td { border-top-color: var(--accent); }

/* 6. Fintech (Pro) */
.tpl-fintech { font-family: ui-monospace, SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace; }
.tpl-fintech .p-title h2 { font-family: inherit; font-size: 20px; letter-spacing: .08em; color: #0E1B2C; font-weight: 700; }
.tpl-fintech .p-meta td, .tpl-fintech .p-items td, .tpl-fintech .p-totals td { font-variant-numeric: tabular-nums; }
.tpl-fintech .p-items { border: 1px solid #E2E8F0; border-collapse: separate; border-spacing: 0; border-radius: 6px; overflow: hidden; }
.tpl-fintech .p-items th { background: #F1F5F9; color: #475569; border-bottom: 1px solid #E2E8F0; font-size: 9px; }
.tpl-fintech .p-items td { border-bottom: 1px solid #E2E8F0; }
.tpl-fintech .p-items tr:last-child td { border-bottom: 0; }
.tpl-fintech .p-grand th, .tpl-fintech .p-grand td { border-top: 2px solid #0E1B2C; }

/* 7. Bold (Pro) */
.tpl-bold { border-left: 10px solid var(--accent); padding-left: 36px; }
.tpl-bold .p-title h2 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--accent); }
.tpl-bold .p-items th { background: var(--accent); font-weight: 700; }
.tpl-bold .p-grand { background: var(--accent); color: #fff; }
.tpl-bold .p-grand th, .tpl-bold .p-grand td { color: #fff; padding: 10px 12px; border-top: 0; }

/* 8. Compact (Pro) */
.tpl-compact { padding: 30px 32px 22px; font-size: 11px; line-height: 1.4; }
.tpl-compact .p-head { margin-bottom: 16px; }
.tpl-compact .p-to { margin-bottom: 16px; }
.tpl-compact .p-title h2 { font-size: 20px; margin-bottom: 6px; }
.tpl-compact .p-items { margin-bottom: 10px; }
.tpl-compact .p-items th { padding: 5px 8px; font-size: 8.5px; }
.tpl-compact .p-items td { padding: 5px 8px; }
.tpl-compact .p-totals th, .tpl-compact .p-totals td { padding: 3px 8px; }
.tpl-compact .p-note { margin-top: 12px; }

/* 9. Elegant (Pro) */
.tpl-elegant { background: #FAF8F5; outline: 1px solid #D5CEBE; outline-offset: -16px; }
.tpl-elegant .p-title h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: .04em; color: #1a202c; text-transform: none; }
.tpl-elegant .p-items th { background: none; color: #718096; border-bottom: 1px solid #D5CEBE; border-top: 1px solid #D5CEBE; padding-left: 0; }
.tpl-elegant .p-items td { border-bottom-color: #EFECE6; padding-left: 0; }
.tpl-elegant .p-grand th, .tpl-elegant .p-grand td { border-top: 1px solid #1a202c; border-bottom: 1px solid #1a202c; }

/* 10. Split (Pro) */
.tpl-split .p-totals { background: #0E1B2C; color: #fff; padding: 16px 20px; border-radius: 10px; box-shadow: 0 4px 18px rgba(14, 27, 44, 0.14); min-width: 50%; }
.tpl-split .p-totals th, .tpl-split .p-totals td { color: #CBD5E1; }
.tpl-split .p-grand th, .tpl-split .p-grand td { color: #fff; border-top: 2px solid var(--accent); padding-top: 10px; font-size: 15.5px; }

/* Mobile sticky bar */
.mobile-bar { display: none; }
@media (max-width: 1040px) {
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
  .page-invoice .site-foot, .page-quote .site-foot, .page-receipt .site-foot { padding-bottom: 76px; }
}

/* Sections */
.section { padding-top: 56px; padding-bottom: 8px; }
.section-title { font-size: clamp(30px, 3.6vw, 42px); max-width: 22ch; margin-bottom: 14px; }
.section-sub { color: var(--ink-2); margin-top: -4px; }
.trust { padding-top: 8px; }
.trust ul { list-style: none; margin: 0; padding: 16px 0; display: flex; flex-wrap: wrap; gap: 10px 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); justify-content: center; }
.trust li { font-size: 14px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 24px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); padding: 24px; }
.feature .ico { color: var(--brand); margin-bottom: 12px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.about-doc { color: var(--ink-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 18px 0; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.ref-table th, .ref-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #FAFAF7; }
:lang(ja) .ref-table thead th, :lang(hi) .ref-table thead th { text-transform: none; letter-spacing: 0; }
.ref-table tbody th { font-weight: 600; }
.ref-table tr:last-child > * { border-bottom: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.pill-yes { background: #FDECEA; color: #9B2C1F; }
.pill-partial { background: #FDF3E1; color: #8A5A12; }
.pill-no { background: var(--brand-soft); color: var(--brand); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 15px 44px 15px 18px; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 18px; top: 12px; font-size: 20px; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: "−"; }
details p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); }
.cta-band { background: var(--ink); color: #fff; margin-top: 72px; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 48px; padding-bottom: 48px; flex-wrap: wrap; }
.cta-band p { font-size: clamp(28px, 3.6vw, 42px); margin: 0; max-width: 22ch; line-height: 1.15; }

/* Prose pages */
.prose { padding-top: 32px; padding-bottom: 64px; }
.prose h1 { font-size: clamp(36px, 5vw, 54px); margin-top: 8px; }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.byline { color: var(--muted); font-size: 14px; }
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 16px 20px; margin: 20px 0 24px; }
.answer strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.answer p { margin: 6px 0 0; font-size: 16px; }
.cta-inline { margin-top: 36px; }
.lang-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.lang-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }

/* Pricing */
.pricing { padding-top: 44px; padding-bottom: 64px; }
.pricing-head { text-align: center; }
.pricing-head h1 { font-size: clamp(40px, 5.4vw, 60px); }
.pricing-head .lede { margin: 0 auto 22px; }
.toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.toggle button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; color: var(--ink-2); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.toggle button[aria-checked="true"] { background: var(--ink); color: #fff; }
.toggle em { font-style: normal; font-size: 12px; color: var(--brand); margin-left: 4px; }
.toggle button[aria-checked="true"] em { color: #9FE0C9; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 20px; justify-content: center; margin: 32px 0 16px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.plan h2 { font-size: 18px; margin: 0 0 12px; }
.plan-pro { border-color: var(--ink); box-shadow: var(--shadow); }
.price { font-size: 44px; font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
.price small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price-sub { font-size: 13.5px; color: var(--muted); margin: 6px 0 16px; min-height: 1.4em; }
.checks { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.checks li { padding-left: 26px; position: relative; margin-bottom: 10px; font-size: 14.5px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.faq-pricing { margin: 40px auto 0; }

/* App (dashboard) */
.app { padding-top: 36px; padding-bottom: 64px; }
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.app-head h1 { font-size: clamp(34px, 4.4vw, 48px); margin: 0; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.meter { height: 6px; background: var(--desk); border-radius: 999px; overflow: hidden; width: 220px; max-width: 100%; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--brand); }
.doc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
.doc-table th, .doc-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.doc-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #FAFAF7; font-weight: 600; }
.doc-table td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .doc-table .hide-sm { display: none; } }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.banner { background: var(--brand-soft); color: var(--brand); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }

/* App Profile & Settings Card */
.app-profile { margin-bottom: 24px; padding: 24px; }
.app-profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.app-profile-head h2 { font-size: 20px; margin: 0 0 4px; }
.app-profile-head p { margin: 0; font-size: 13.5px; }
.app-profile-form { display: grid; gap: 14px; }
.app-profile-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.logo-inline-wrap { display: inline-flex; align-items: center; gap: 12px; margin-top: 4px; }
.profile-logo-preview { max-height: 38px; max-width: 120px; object-fit: contain; border-radius: 4px; border: 1px solid var(--line); padding: 2px; background: #fff; }
.profile-feedback { font-size: 13.5px; color: var(--brand); font-weight: 600; margin: 4px 0 0; }
.app-docs-section { margin-top: 28px; }
.app-docs-head { margin-bottom: 14px; }
.app-docs-head h2 { font-size: 20px; margin: 0; }
.party-legend { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 10px; }
.party-legend legend { float: left; margin: 0; }
.profile-autofill-badge { font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 2px 8px; margin-left: 8px; }
.profile-autofill-badge a { color: var(--brand); text-decoration: underline; }

/* Modals */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(16, 24, 40, .45); }
.modal::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(3px); }
.modal-close-row { display: flex; justify-content: flex-end; padding: 12px 12px 0; margin: 0; }
.modal-body { padding: 4px 28px 26px; text-align: center; }
.modal-mark { display: flex; justify-content: center; margin-bottom: 10px; }
.modal-mark svg { width: 40px; height: 40px; }
.modal h2 { font-size: 30px; margin-bottom: 6px; }
.modal .fld { text-align: left; }
.social { display: grid; gap: 8px; margin-top: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
[data-step="email"] form { margin-top: 16px; }
.or + form { margin-top: 0; }
.otp-input { text-align: center; font-size: 24px; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.modal-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13.5px; }
.form-error { color: var(--danger); font-size: 14px; margin: 12px 0 0; }
.fine { font-size: 12px; color: var(--muted); margin: 18px 0 0; }
.fine a { color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.modal-actions form { margin: 0; }
.ts-box { min-height: 65px; margin: 4px 0 10px; display: flex; justify-content: center; }

/* Ads: reserved height avoids layout shift */
.ad { min-height: 120px; margin-top: 8px; margin-bottom: 8px; }

/* Footer */
.site-foot { margin-top: 0; border-top: 1px solid var(--line); background: var(--surface); }
.cta-band + .site-foot, main:has(.cta-band) + .site-foot { border-top: 0; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; padding-top: 44px; padding-bottom: 28px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.foot-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
:lang(ja) .foot-grid h3, :lang(hi) .foot-grid h3 { text-transform: none; letter-spacing: 0; }
.foot-grid a { display: block; color: var(--ink-2); text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.foot-grid a:hover { color: var(--ink); }
.foot-brand p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 32ch; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-langs { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-langs a { color: var(--muted); text-decoration: none; }
.foot-langs a[aria-current] { color: var(--ink); font-weight: 600; }

/* Print: only the document, and only after the server approved the download */
.print-block { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(main), main > *:not(.workspace):not(.print-block), .editor, .preview-bar, .preview > .note, .mobile-bar { display: none !important; }
  .workspace { display: block; padding: 0; margin: 0; max-width: none; }
  .preview { position: static; }
  .desk { background: none; border: 0; padding: 0; border-radius: 0; }
  .paper-scroll { overflow: visible; }
  .paper { box-shadow: none; min-width: 0; width: 210mm; min-height: 297mm; aspect-ratio: auto; padding: 16mm 16mm 12mm; border-radius: 0; }
  .tpl-modern { padding-top: 0; }
  .tpl-modern .p-head { margin: 0 -16mm 28px; padding: 14mm 16mm 20px; border-radius: 0; }
  .tpl-executive { padding-top: 0; }
  .tpl-executive .p-head { margin: 0 -16mm 26px; padding: 12mm 16mm 18px; border-radius: 0; }
  .tpl-bold { border-left: 8mm solid var(--accent) !important; padding-left: 12mm !important; }
  .tpl-compact { padding: 10mm 12mm 8mm !important; font-size: 10px !important; }
  .tpl-elegant { outline: 1px solid #D5CEBE !important; outline-offset: -8mm !important; }
  html:not(.can-print) .workspace { display: none !important; }
  html:not(.can-print) .print-block { display: block !important; padding: 40mm 20mm; font: 20px/1.4 var(--sans); text-align: center; }
}

/* Layout refinements */
.editor .grid4 { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
input[type="date"] { padding-left: 9px; padding-right: 7px; }
.section.narrow { max-width: 1240px; }
.section.narrow > * { max-width: 800px; }
.foot-grid a.brand { display: inline-flex; font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 0; }

/* Contact Section & Form */
.contact-section { padding-top: 16px; padding-bottom: 64px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 48px; align-items: start; }
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-info h2 { font-size: 32px; margin-bottom: 8px; color: var(--ink); }
:lang(ja) .contact-info h2, :lang(hi) .contact-info h2 { font-family: var(--sans); }
.contact-info .lede { font-size: 16px; color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; }

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.info-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}
.info-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.info-card p { margin: 0; font-size: 14.5px; }
.contact-link { font-weight: 600; color: var(--brand); text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
.info-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: inline-block; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
@media (max-width: 600px) {
  .contact-card { padding: 22px 18px; }
}
.contact-form-head { margin-bottom: 22px; }
.contact-form-head h3 { font-size: 22px; margin-bottom: 6px; color: var(--ink); }
.contact-form-head p { margin: 0; font-size: 14px; }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form .fld { margin-bottom: 0; }
.contact-form .fld span { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; color: var(--ink-2); }
.fld-req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.fld-opt { font-weight: 400; color: var(--muted); font-size: 12px; }

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 11px 14px;
  font: 14.5px/1.5 var(--sans);
  color: var(--ink);
  background: #FCFCFA;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.contact-form input:hover,
.contact-form select:hover,
.contact-form textarea:hover {
  border-color: #BDB8AA;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  background: #FFF;
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.contact-form select {
  cursor: pointer;
}

.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 600;
  padding: 13px 24px;
  margin-top: 6px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.contact-submit-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}
.contact-submit-btn:active {
  transform: translateY(1px);
}
.contact-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.contact-disclaimer { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.5; }

.contact-success {
  text-align: center;
  padding: 36px 20px;
  animation: contactFadeIn 0.35s ease;
}
.success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #DCFCE7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-success h3 { font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.contact-success p { max-width: 44ch; margin: 0 auto 24px; font-size: 15px; color: var(--ink-2); }

@keyframes contactFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
