:root {
  --bg: #f7f9fc; --text: #14202e; --muted: #5d6877;
  --accent: #1d5fa8; --accent-strong: #154a86; --accent-soft: #e6effa; --on-accent: #ffffff;
  --card-bg: #ffffff; --border: #e1e6ee;
  --green: #2f7d5b; --green-bg: #eaf5ef; --amber: #a86b00; --amber-bg: #fff4dc;
  --hero-1: #dbe9fb; --hero-2: #eef4fc; --hero-glow: rgba(29, 95, 168, 0.18);
  --shadow: 0 1px 2px rgba(20, 32, 46, 0.06), 0 8px 24px rgba(20, 32, 46, 0.08);
  --shadow-lg: 0 2px 4px rgba(20, 32, 46, 0.06), 0 18px 48px rgba(20, 32, 46, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218; --text: #e6eaf0; --muted: #9aa4b2;
    --accent: #7db3ea; --accent-strong: #a3cbf3; --accent-soft: #17283c; --on-accent: #0b1a2a;
    --card-bg: #161c25; --border: #2a3340;
    --green: #5cc492; --green-bg: #15251d; --amber: #f0c060; --amber-bg: #2d2412;
    --hero-1: #13253b; --hero-2: #111a26; --hero-glow: rgba(125, 179, 234, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
main { max-width: 680px; margin: 0 auto; padding: 56px 24px 40px; }
main.wide { background: radial-gradient(900px 260px at 50% -80px, var(--hero-glow), transparent 70%); }
main.wide { max-width: 860px; }
a { color: var(--accent); }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 48px 0 16px; }
h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
p, li { font-size: 0.95rem; margin-bottom: 12px; }
ul, ol { padding-left: 20px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.center { text-align: center; }

/* Navigation */
.nav { max-width: 860px; margin: 0 auto; padding: 16px 24px 0; display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; font-size: 0.85rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav .brand { color: var(--text); font-weight: 650; margin-right: auto; display: inline-flex; align-items: center; gap: 8px; }
.nav .brand img { border-radius: 5px; }

/* Home */
.hero { text-align: center; margin-bottom: 40px; }
.logo { width: 80px; height: 80px; border-radius: 18px; margin-bottom: 24px; }
.tagline { font-size: 1.1rem; color: var(--muted); margin-bottom: 16px; }
.pricing-badge { font-size: 0.9rem; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.beliefs p { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.card p { font-size: 0.85rem; color: var(--muted); line-height: 1.45; margin-bottom: 0; }
.card .price { font-size: 0.9rem; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
.stack > * + * { margin-top: 12px; }
.plain-list { list-style: none; padding-left: 0; }
.plain-list li { font-size: 0.9rem; color: var(--muted); padding-left: 20px; text-indent: -20px; margin-bottom: 8px; }
.plain-list li::before { content: "\2014\00a0\00a0"; }

/* Privacy promise */
.promise { background: var(--green-bg); border: 1px solid var(--green); border-radius: 12px; padding: 16px 20px; margin: 20px 0 28px; }
.promise strong { color: var(--green); }
.promise p { font-size: 0.9rem; margin-bottom: 6px; }
.promise p:last-child { margin-bottom: 0; }
details { margin-top: 8px; }
summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); }
details p, details li { font-size: 0.85rem; color: var(--muted); }
details > *:not(summary) { margin-top: 8px; }

/* Forms */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px 8px; margin-bottom: 16px; background: var(--card-bg); min-width: 0; box-shadow: var(--shadow); }
legend { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0 6px; }
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 12px; }
label .hint { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="number"], input[type="date"], input[type="email"], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font-size: 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
textarea { min-height: 64px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button { cursor: pointer; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); font-size: 0.9rem; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.link { border: none; background: none; padding: 4px 0; color: var(--muted); font-size: 0.8rem; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }

/* Results */
.result { position: sticky; top: 16px; }
.headline { background: linear-gradient(160deg, var(--accent-soft), var(--card-bg)); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.headline .figure { color: var(--accent); }
.headline .label { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.headline .figure { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.headline .note { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 7px 0; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; vertical-align: top; }
td.amount, th.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
tr.total th, tr.total td { font-weight: 600; border-bottom: none; }
tr.past td, tr.past th { color: var(--muted); text-decoration: line-through; }
caption { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.table-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px; margin-bottom: 16px; overflow-x: auto; }

/* Invoice */
.items th { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.items td { padding: 4px 6px 4px 0; border-bottom: none; }
.items input { margin-top: 0; padding: 7px 8px; font-size: 0.9rem; }
.items { table-layout: fixed; }
.items th:nth-child(2) { width: 58px; } .items th:nth-child(3) { width: 84px; } .items th:nth-child(4) { width: 52px; }
.items input { width: 100%; min-width: 0; }
.items button { padding: 6px 10px; }
.tool > * { min-width: 0; }
.sheet { background: #fff; color: #1a1a1a; border: 1px solid var(--border); border-radius: 4px; padding: 36px; font-size: 0.85rem; min-height: 520px; }
.sheet h2 { margin: 0 0 4px; font-size: 1.6rem; letter-spacing: 0.04em; }
.sheet .top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sheet .top .right { text-align: right; }
.sheet img { max-width: 140px; max-height: 70px; display: block; margin-bottom: 8px; }
.sheet .parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.sheet .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b6b6b; margin-bottom: 2px; }
.sheet .pre { white-space: pre-line; }
.sheet table { font-size: 0.85rem; }
.sheet th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b6b6b; border-bottom: 2px solid #1a1a1a; }
.sheet td, .sheet th { border-color: #e5e5e5; }
.sheet .totals { margin-left: auto; width: 55%; margin-top: 12px; }
.sheet .notes { margin-top: 28px; }
.sheet .made { margin-top: 36px; font-size: 0.65rem; color: #9a9a9a; text-align: center; }

footer { max-width: 680px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--border); text-align: center; font-size: 0.75rem; color: var(--muted); }
footer p { font-size: 0.75rem; margin-bottom: 4px; }
footer a { color: var(--muted); text-decoration: none; margin: 0 10px; }
footer a:hover { color: var(--text); }
.notfound { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; }

/* ── Home page ─────────────────────────────────────────── */
body.home .nav { max-width: 1080px; }
body.home { background: linear-gradient(180deg, var(--hero-1) 0, var(--hero-2) 520px, var(--bg) 1000px) no-repeat, var(--bg); }
.hero-band {
  background:
    radial-gradient(700px 360px at 85% 0%, var(--hero-glow), transparent 70%),
    radial-gradient(600px 300px at 5% 30%, var(--hero-glow), transparent 70%);
}
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 48px 24px 40px; text-align: center; }
.eyebrow { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin-bottom: 14px; letter-spacing: 0.01em; }
.pill { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 2px 10px; margin-right: 6px; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-inner h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.08; max-width: 760px; margin: 0 auto 14px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0 auto 32px; }
.tools { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; text-align: left; align-items: stretch; }
.tool-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
a.tool-card { text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.tool-card:hover { transform: translateY(-3px); }
.tool-head { display: flex; align-items: center; gap: 12px; }
.tool-head h2 { margin: 0; font-size: 1.15rem; }
.tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.tool-sub { color: var(--muted); font-size: 0.95rem; margin: 0; }
.quick-form label { margin-bottom: 14px; }
.money-input { display: flex; align-items: center; margin-top: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.money-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.money-input span { font-size: 1.4rem; font-weight: 600; color: var(--muted); }
.money-input input[type="text"] { border: none; background: transparent; font-size: 1.6rem; font-weight: 650; padding: 10px 8px; margin: 0; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.money-input input[type="text"]:focus-visible { outline: none; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); box-shadow: none; margin: 0; }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { margin: 0; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; color: var(--muted); }
.segmented input:checked + label { background: var(--card-bg); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.quick-result { background: linear-gradient(150deg, var(--accent-soft), transparent); border-radius: 14px; padding: 16px 18px; }
.quick-result .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0; text-transform: uppercase; letter-spacing: 0.06em; }
.quick-result .figure { margin: 2px 0 6px; font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
.quick-result .per { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.quick-result .note, .quick-result .next { font-size: 0.85rem; color: var(--muted); margin: 0 0 4px; }
.quick-result .next { color: var(--amber); font-weight: 600; }
.fine { font-size: 0.75rem; color: var(--muted); margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; align-self: flex-start; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--accent); color: var(--accent); background: transparent; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover, a.tool-card:hover .button { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.invoice .button { margin-top: auto; }
.mini-invoice { background: #fff; color: #1a1a1a; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 10px 30px rgba(20,32,46,0.12); transform: rotate(-1.5deg); margin: 4px 6px 10px; font-size: 0.8rem; }
.mi-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.mi-title { font-weight: 800; letter-spacing: 0.08em; font-size: 1rem; }
.mi-num { color: #6b6b6b; font-size: 0.75rem; }
.mi-parties { display: flex; gap: 16px; margin-bottom: 14px; }
.mi-parties span { flex: 1; height: 26px; border-radius: 4px; background: repeating-linear-gradient(180deg, #e9edf2 0 6px, transparent 6px 10px); }
.mi-line, .mi-total { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #eceff3; font-variant-numeric: tabular-nums; }
.mi-total { border-bottom: none; border-top: 2px solid #1a1a1a; margin-top: 4px; font-weight: 700; }
.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.trust li { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; margin: 0; }
.trust svg { color: var(--green); flex: none; }

.home-main { max-width: 1080px; padding-top: 24px; }
.home-main > section { margin-top: 72px; }
.home-main > section:first-child { margin-top: 24px; }
.home-main h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 20px; }
.home-main .card h2 { font-size: 1.15rem; margin-bottom: 10px; }
.app-section { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.app-copy .eyebrow, .app-copy .lede { text-align: left; margin-left: 0; }
.app-copy .lede { margin-bottom: 20px; font-size: 1.02rem; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--muted); }
.checks li strong { color: var(--text); }
.checks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-bg); border: 1px solid var(--green); }
.checks li::after { content: ""; position: absolute; left: 7px; top: 7px; width: 5px; height: 9px; border: solid var(--green); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.phones { position: relative; height: 560px; }
.phone { position: absolute; width: 250px; height: auto; border-radius: 36px; border: 8px solid #1b1f26; background: #1b1f26; box-shadow: var(--shadow-lg); }
.phone.front { left: 4%; top: 0; z-index: 2; }
.phone.back { right: 4%; top: 48px; transform: rotate(5deg); opacity: 0.97; }

.deal { background: var(--card-bg); border: 1px solid var(--border); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.deal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.deal-item { position: relative; padding-left: 48px; }
.deal-item.wide { grid-column: 1 / -1; }
.deal-item h3 { font-size: 1rem; margin-bottom: 2px; }
.deal-item p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.num { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.tier { background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); position: relative; }
.tier h3 { font-size: 1rem; }
.tier .price { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.02em; margin: 4px 0 0; }
.tier .price span { font-size: 0.9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier .alt { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }
.tier p:last-child { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }
.tier .alt + p { margin-top: 0; }
.tier.featured { border: 2px solid var(--accent); box-shadow: var(--shadow-lg); }
.tier .tag { position: absolute; top: -12px; left: 20px; background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.home footer { max-width: 1080px; }

@media (max-width: 860px) {
  .tools, .app-section, .two-col, .tiers, .deal-grid { grid-template-columns: 1fr; }
  .phones { height: 470px; max-width: 420px; margin: 0 auto; width: 100%; }
  .phone { width: 210px; border-radius: 30px; border-width: 7px; }
  .deal { padding: 24px 20px; }
  .tier .tag { left: 16px; }
}
@media (max-width: 480px) {
  .nav .brand { flex-basis: 100%; margin-bottom: 2px; }
}
@media (max-width: 420px) {
  .hero-inner { padding: 32px 16px 28px; }
  .tool-card { padding: 18px; }
  .phones { height: 400px; }
  .phone { width: 170px; border-radius: 26px; border-width: 6px; }
  .phone.back { top: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  a.tool-card { transition: none; }
  a.tool-card:hover { transform: none; }
}

@media (max-width: 760px) {
  .tool, .grid { grid-template-columns: 1fr; }
  .result { position: static; }
  main { padding: 40px 16px 32px; }
  .sheet { padding: 20px; }
  .sheet .totals { width: 100%; }
}
@media print {
  .nav, footer, .no-print { display: none !important; }
  body { background: #fff; }
  main, main.wide { max-width: none; padding: 0; }
  .tool { display: block; }
  .result { position: static; }
  .sheet { border: none; padding: 0; min-height: 0; }
}

/* Field invoice page */
.field-banner { background: linear-gradient(150deg, var(--accent-soft), var(--card-bg)); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 12px 0 24px; box-shadow: var(--shadow); }
.field-banner .who { font-size: 1.05rem; margin: 0 0 2px; }
.field-banner .who strong { color: var(--accent); }
.field-banner p:last-child { margin: 0; }
.field-status { background: var(--green-bg); border: 1px solid var(--green); border-radius: 10px; padding: 10px 12px; }
input[readonly], textarea[readonly] { color: var(--muted); background: var(--card-bg); }
.field-privacy { margin-top: 32px; }

[hidden] { display: none !important; }
.card .plain-list { margin: 12px 0 0; }
code { font-size: 0.85em; }
