/* =====================================================================
   V-Rēķini — public site (landing). Same tokens and face as app.css,
   composed as a split stage: the invoice stays pinned, the page reads.
   ===================================================================== */

:root {
    --ground: #f2f4f7;
    --ground-2: #e6e9ee;
    --surface: #ffffff;
    --text: #0a0a0a;
    --muted: #55585c;
    --faint: #66696d;
    --primary: #141414;
    --on-primary: #ffffff;
    --data: #1d5fbf;
    --data-tint: rgba(29, 95, 191, .12);
    --positive: #2e7d32;
    --negative: #c4242a;
    --pill-neg-bg: #fbe9e9; --pill-neg-ink: #a51d22;
    --pill-pos-bg: #e6f2e7; --pill-pos-ink: #24632a;
    --pill-bg: #eceef1; --pill-ink: #3c3f43;
    --ink-field: #0d0e10;
    --on-ink: #f4f5f7;
    --on-ink-muted: #a9adb3;
    --on-ink-faint: #8a8f96;
    --ink-btn: #f4f5f7;
    --ink-btn-ink: #0a0a0a;
    --rule: #e3e6ea;
    --rule-strong: #c9ccd1;
    --float-shadow: 0 18px 48px rgba(15, 20, 30, .16), 0 2px 6px rgba(15, 20, 30, .06);

    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Five sizes do all the visible work */
    --s1: 14px;
    --s2: 17px;
    --s3: clamp(22px, 2.1vw, 30px);
    --s4: clamp(36px, 3.7vw, 56px);
    --s5: clamp(56px, 7.4vw, 112px);

    --m: 16px;                /* the one pair of outer margins */
    --r: 8px;                 /* the one radius */
    --gap: clamp(120px, 14vw, 200px);
    --ease: cubic-bezier(.32, .72, 0, 1);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--s2);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px;
    border: 0; border-radius: var(--r);
    background: var(--primary); color: var(--on-primary);
    font: 500 var(--s2)/1 var(--font); letter-spacing: -0.01em;
    text-decoration: none; cursor: pointer;
    transition: transform .22s var(--ease), background-color .22s var(--ease);
}
.btn:hover { background: color-mix(in srgb, var(--primary) 86%, var(--ground)); }
.btn:active { transform: scale(.97); }
.btn-light { background: var(--ink-btn); color: var(--ink-btn-ink); }
.btn-light:hover { background: color-mix(in srgb, var(--ink-btn) 88%, var(--ink-field)); }
.link {
    color: var(--text); text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    transition: text-decoration-color .2s var(--ease);
}
.link:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------ the stage */
.stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: var(--m) var(--m) 0;
}
.read { min-width: 0; }
.pin {
    position: sticky; top: var(--m);
    height: calc(100svh - 2 * var(--m));
    border-radius: var(--r);
    background: var(--ground-2);
    overflow: hidden;
    display: grid; place-items: center;
}

/* Hero card: the printed card beside the invoice */
.card {
    min-height: calc(100svh - 2 * var(--m));
    background: var(--surface);
    border-radius: var(--r);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.tear {
    height: 56px; flex: none;
    background: var(--text);
    -webkit-mask: conic-gradient( /* taste-skill-ignore: mask that cuts the torn edge, nothing is painted with it */from -45deg at bottom, #0000, #000 1deg 90deg, #0000 91deg) 50% / 28px 100%;
            mask: conic-gradient( /* taste-skill-ignore */from -45deg at bottom, #0000, #000 1deg 90deg, #0000 91deg) 50% / 28px 100%;
}
.card-body {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px clamp(28px, 5vw, 72px);
    gap: 28px;
}
.wordmark {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: var(--s3); font-weight: 600; letter-spacing: -0.03em;
    text-decoration: none; color: var(--text);
}
.wordmark svg { width: 40px; height: 40px; color: var(--text); }
.wordmark svg .v { stroke: var(--surface); }
.hero-h1 { font-size: var(--s4); max-width: 19ch; }
.lede { font-size: var(--s2); color: var(--muted); max-width: 40ch; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.hero-note { font-size: var(--s1); color: var(--faint); }
/* Ienākt: returning customers come here every day, so it is a real button,
   the quiet partner of the one black call to action */
.login-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 18px; border-radius: 8px;
    background: var(--surface); color: var(--text); border: 1px solid var(--rule-strong);
    font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.login-btn:hover { border-color: var(--text); }
.login-btn:active { transform: scale(.97); }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-login { min-height: 48px; height: auto; padding: 0 22px; border-radius: var(--r); font-size: var(--s2); letter-spacing: -0.01em; }
.card-links {
    display: flex; gap: 28px; flex-wrap: wrap;
    padding: 0 clamp(28px, 5vw, 72px) 28px;
    font-size: var(--s1);
}
.card-links a { color: var(--muted); text-decoration: none; transition: color .2s var(--ease); }
.card-links a:hover { color: var(--text); }

/* Try-it blocks under the card, beside the pinned invoice */
.try { padding: var(--gap) clamp(28px, 5vw, 72px) 12vh; }
.try h2 { font-size: var(--s4); max-width: 14ch; margin-bottom: 72px; }
.block { max-width: 44ch; min-height: 50vh; padding-bottom: 72px; }
.block:last-child { min-height: 0; }
.block h3 { font-size: var(--s3); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 14px; }
.block p { color: var(--muted); margin-bottom: 22px; }
.block p strong { color: var(--text); font-weight: 500; }

/* Controls (interface size) */
.field { position: relative; }
.input {
    width: 100%; height: 48px; padding: 0 14px;
    border: 1px solid var(--rule); border-radius: var(--r); /* taste-skill-ignore: a real form field */
    background: var(--surface); color: var(--text);
    font: var(--s2) var(--font);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus { outline: none; border-color: var(--text); /* taste-skill-ignore: focus ring of a form field */ box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.input::placeholder { color: var(--faint); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair label { display: block; font-size: var(--s1); color: var(--muted); margin-bottom: 6px; }
.seg {
    display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
    background: var(--ground-2); border-radius: var(--r);
}
.seg button {
    min-height: 40px; padding: 0 14px;
    border: 0; border-radius: 6px; background: transparent;
    color: var(--muted); font: 500 var(--s1) var(--font); cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button:active { transform: scale(.97); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
    background: var(--surface); border-radius: var(--r);
    box-shadow: var(--float-shadow); /* taste-skill-ignore: open suggestion list floats over the page */
    padding: 6px; margin: 0; list-style: none;
    max-height: 280px; overflow: auto;
}
.suggest li {
    padding: 10px 12px; border-radius: 6px; cursor: pointer;
    font-size: var(--s1); line-height: 1.3;
}
.suggest li small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--ground); }
.hint { font-size: var(--s1); color: var(--faint); margin-top: 8px; }

/* ------------------------------------------------------------ the invoice */
.paper-wrap { width: min(520px, calc(100% - 48px)); transition: transform .9s var(--ease); }
[data-ui].paper {
    position: relative;
    background: #ffffff; color: #0f172a;
    border-radius: 4px;
    font-family: var(--font);
    font-size: var(--s1); line-height: 1.45;
    padding: 34px 34px 30px;
    transition: opacity .6s var(--ease);
}
[data-ui].paper .p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
[data-ui].paper .p-title { font-size: var(--s3); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
[data-ui].paper .p-meta { text-align: right; color: #475569; }
[data-ui].paper .p-meta b { color: #0f172a; font-weight: 600; }
[data-ui].paper .p-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
[data-ui].paper .p-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
[data-ui].paper .p-name { font-weight: 700; color: #0f172a; }
[data-ui].paper .p-sub { color: #475569; }
[data-ui].paper .p-sub.empty { color: #64748b; }
[data-ui].paper table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
[data-ui].paper th { font-size: 13px; font-weight: 500; color: #64748b; text-align: left; padding: 7px 6px; border-bottom: 1px solid #0f172a; }
[data-ui].paper td { padding: 9px 6px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
[data-ui].paper th.r, [data-ui].paper td.r { text-align: right; }
[data-ui].paper .p-totals { margin-left: auto; width: 62%; margin-top: 14px; font-variant-numeric: tabular-nums; }
[data-ui].paper .p-totals div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 6px; color: #475569; }
[data-ui].paper .p-totals div b { color: #0f172a; font-weight: 500; }
[data-ui].paper .p-totals .grand { margin-top: 6px; padding-top: 9px; border-top: 1px solid #0f172a; color: #0f172a; font-weight: 700; font-size: var(--s2); }
[data-ui].paper .p-totals .grand b { font-weight: 700; }
[data-ui].paper .p-foot { margin-top: 28px; display: flex; justify-content: space-between; gap: 16px; color: #64748b; font-size: 13px; }
[data-ui].paper .flash { animation: flash 1.2s var(--ease); border-radius: 3px; }
@keyframes flash { 0% { background: rgba(29, 95, 191, .22); } 100% { background: transparent; } }
[data-ui].paper .hl { background: rgba(29, 95, 191, .10); box-shadow: 0 0 0 4px rgba(29, 95, 191, .10); border-radius: 3px; transition: background .5s var(--ease), box-shadow .5s var(--ease); }

/* the three real templates */
/* The three templates, as the PDFs draw them (app/pdf_generator.py), at reading size */
[data-ui].paper .p-panel { display: none; }
[data-ui].paper.t-modern .p-panel { display: grid; grid-template-columns: 46% 1fr 1fr; align-items: end; margin: -6px 0 26px; padding: 16px 18px 15px; border-radius: 6px; background: #0b0c0e; color: #fff; }
[data-ui].paper .p-panel span { display: block; font-size: 12px; color: rgba(255, 255, 255, .62); margin-bottom: 4px; }
[data-ui].paper .p-panel b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-ui].paper .p-panel .big b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
[data-ui].paper.t-modern .p-meta div:not(:first-child) { display: none; }
[data-ui].paper.t-modern thead tr { background: #f1f2f4; }
[data-ui].paper.t-modern th { border-bottom: 0; }
[data-ui].paper.t-modern th:first-child { border-radius: 4px 0 0 0; }
[data-ui].paper.t-modern th:last-child { border-radius: 0 4px 0 0; }
[data-ui].paper.t-classic .p-title { font-family: "Source Serif 4", Georgia, serif; font-weight: 400; font-size: 34px; letter-spacing: 0; }
[data-ui].paper.t-classic .p-head { position: relative; padding-bottom: 18px; border-bottom: 2px solid #0f172a; }
[data-ui].paper.t-classic .p-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; border-top: 1px solid #0f172a; }
[data-ui].paper.t-classic .p-name, [data-ui].paper.t-classic .p-totals .grand b { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; }
[data-ui].paper.t-classic .p-label, [data-ui].paper.t-minimal .p-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
[data-ui].paper.t-classic th, [data-ui].paper.t-minimal th { border-top: 1px solid #0f172a; }
[data-ui].paper.t-minimal .p-title { font-weight: 400; }
[data-ui].paper.t-minimal .p-head { position: relative; padding-top: 16px; }
[data-ui].paper.t-minimal .p-head::before { content: ""; position: absolute; left: 0; top: 0; width: 24px; height: 2px; background: #0f172a; }
[data-ui].paper.t-minimal .p-name { font-weight: 500; }
[data-ui].paper.t-minimal .p-totals .grand { font-weight: 400; }
[data-ui].paper.t-minimal .p-totals .grand b { font-weight: 400; font-size: 1.15em; }

/* e-invoice view: the same invoice as PEPPOL XML */
[data-ui] .xml {
    position: absolute; inset: 0;
    background: #0f1115; color: #d7dbe0;
    border-radius: 4px; padding: 28px 26px;
    font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* taste-skill-ignore: literal XML in a code element */
    overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .6s var(--ease), visibility 0s linear .6s;
}
[data-ui] .xml code { white-space: pre; display: block; font: inherit; }
[data-ui] .xml .t { color: #8fb4ec; }
[data-ui] .xml .v { color: #f3f4f6; }
[data-ui].paper.as-xml .xml { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .6s var(--ease), visibility 0s; }

/* ------------------------------------------------------------ the footage (full width) */
.film { padding: var(--gap) var(--m) 0; }
.film-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin-bottom: 32px; }
.film-head h2 { grid-column: 1 / 7; font-size: var(--s4); }
.film-head p { grid-column: 8 / 13; color: var(--muted); max-width: 44ch; }
.film-field { background: var(--ground-2); border-radius: var(--r); padding: clamp(16px, 3vw, 48px); }
.film-video { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 800; border-radius: 4px; background: var(--surface); }
.film-video.is-phone { aspect-ratio: 390 / 844; width: min(100%, 340px); margin: 0 auto; border-radius: 10px; }

/* ------------------------------------------------------------ who owes you (full width) */
.owes {
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 90svh;
    margin-top: 160px;
}
.owes-raw, .owes-tidy { position: relative; padding: clamp(40px, 6vw, 96px) clamp(24px, 5vw, 80px) 140px; }
.owes-raw { background: var(--ink-field); color: var(--on-ink); }
.owes-tidy { background: var(--surface); display: flex; align-items: flex-start; justify-content: center; }
.owes-raw .notes { margin: 6vh 0 0; padding: 0; list-style: none; max-width: 30ch; font-size: var(--s3); line-height: 1.5; letter-spacing: -0.01em; color: var(--on-ink-muted); }
.owes-raw .notes s { color: var(--on-ink-faint); }
.owes-raw .notes li { color: var(--on-ink); }
.owes .h-left, .owes .h-right {
    position: absolute; bottom: 40px; margin: 0;
    font-size: var(--s4); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; white-space: nowrap;
}
.owes .h-left { left: clamp(24px, 5vw, 80px); color: var(--on-ink); }
.owes .h-right { right: clamp(24px, 5vw, 80px); color: var(--text); }
.owes-copy { margin-top: 28px; max-width: 40ch; color: var(--on-ink-muted); font-size: var(--s2); }

/* the dashboard fragment */
[data-ui].dash { width: min(520px, 100%); margin-top: 6vh; font-size: var(--s1); color: var(--text); }
[data-ui].dash .d-kpi { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 16px; }
[data-ui].dash .d-kpi > div { padding: 16px 18px; }
[data-ui].dash .d-kpi > div + div { border-left: 1px solid var(--rule); }
[data-ui].dash .d-kpi small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
[data-ui].dash .d-kpi b { font-size: var(--s3); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
[data-ui].dash .d-kpi i { font-style: normal; font-size: 13px; color: var(--negative); display: block; margin-top: 4px; }
[data-ui].dash .d-list { border: 1px solid var(--rule); border-radius: var(--r); }
[data-ui].dash .d-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rule); font-weight: 600; }
[data-ui].dash .d-head span { font-weight: 400; color: var(--muted); font-size: 13px; }
[data-ui].dash .d-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
[data-ui].dash .d-row:last-child { border-bottom: 0; }
[data-ui].dash .d-row b { font-weight: 500; }
[data-ui].dash .d-row .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
[data-ui].dash .d-row .meta { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 13px; background: var(--pill-bg); color: var(--pill-ink); justify-self: end; }
.pill.neg { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.pill.pos { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }

/* ------------------------------------------------------------ the month (run-in column) */
.month { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding: var(--gap) var(--m) 0; }
.month-col { grid-column: 5 / 11; max-width: 600px; }
.month h2 { font-size: var(--s3); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 48px; }
.stage-p { color: var(--muted); font-size: var(--s2); line-height: 1.6; }
.stage-p strong { color: var(--text); font-weight: 600; }
.evidence { margin: 20px 0 72px; background: var(--surface); border-radius: var(--r); padding: 14px 16px; font-size: var(--s1); }
.evidence:last-child { margin-bottom: 0; }
.ev-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ev-row .grow { flex: 1; min-width: 0; }
.ev-row b { font-weight: 500; }
.ev-row .meta { color: var(--muted); font-size: 13px; display: block; }
.ev-row .amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.ev-btn { padding: 6px 12px; border-radius: 6px; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 500; white-space: nowrap; }
.ev-cols { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ev-cols span { padding: 4px 10px; border-radius: 4px; background: var(--ground); font-size: 13px; }
.ev-file { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ pricing (two fields) */
.price { padding-top: var(--gap); }
.price > h2 { font-size: var(--s3); letter-spacing: -0.02em; margin: 0 var(--m) 24px; }
.plans { display: grid; grid-template-columns: 5fr 7fr; min-height: 90svh; }
.plan { position: relative; padding: 40px clamp(24px, 3.4vw, 48px); display: flex; flex-direction: column; }
.plan.free { background: var(--surface); }
.plan.main { background: var(--ink-field); color: var(--on-ink); }
.plan h3 { font-size: var(--s4); }
.plan .for { font-size: var(--s3); line-height: 1.25; letter-spacing: -0.02em; max-width: 26ch; margin-top: 16px; }
.plan.free .for { color: var(--muted); }
.plan.main .for { color: var(--on-ink-muted); }
.plan .inc { max-width: 40ch; margin-top: 28px; font-size: var(--s2); }
.plan.free .inc { color: var(--muted); }
.plan.main .inc { color: var(--on-ink-muted); }
.plan .foot { margin-top: auto; padding-top: 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.plan .amount { font-size: var(--s5); font-weight: 600; letter-spacing: -0.045em; line-height: .9; font-variant-numeric: tabular-nums; }
.plan .amount small { font-size: var(--s2); font-weight: 400; letter-spacing: 0; margin-left: 8px; }
.plan.free .amount small { color: var(--muted); }
.plan.main .amount small { color: var(--on-ink-muted); }
.others { margin: 24px var(--m) 0; max-width: 72ch; color: var(--muted); font-size: var(--s2); }

/* ------------------------------------------------------------ questions */
.faq { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding: var(--gap) var(--m) 0; }
.faq h2 { grid-column: 1 / 4; font-size: var(--s3); letter-spacing: -0.02em; }
.faq-text { grid-column: 5 / 13; columns: 2; column-gap: 56px; font-size: var(--s2); line-height: 1.55; color: var(--muted); }
.faq-text p { break-inside: avoid; margin-bottom: 20px; }
.faq-text p strong { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------ first step (cta) */
.start {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
    min-height: 72svh; margin-top: 160px;
    background: var(--ink-field); color: var(--on-ink);
    padding: 40px clamp(24px, 3.4vw, 48px);
}
.start-copy { grid-column: 1 / 8; align-self: end; }
.start-copy h2 { font-size: var(--s5); line-height: .92; letter-spacing: -0.045em; }
.start-copy p { margin-top: 24px; max-width: 36ch; color: var(--on-ink-muted); }
[data-ui].dialog {
    grid-column: 8 / 13; align-self: center; justify-self: end;
    width: min(440px, 100%);
    background: var(--surface); color: var(--text);
    border-radius: 12px; padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
[data-ui].dialog h3 { font-size: var(--s3); letter-spacing: -0.02em; margin-bottom: 6px; }
[data-ui].dialog .sub { color: var(--muted); font-size: var(--s1); margin-bottom: 20px; }
[data-ui].dialog .seg { margin-bottom: 16px; display: flex; }
[data-ui].dialog .seg button { flex: 1; }
[data-ui].dialog label.lbl { display: block; font-size: var(--s1); color: var(--muted); margin-bottom: 6px; }
[data-ui].dialog .btn { width: 100%; margin-top: 20px; }
[data-ui].dialog .found { font-size: var(--s1); color: var(--muted); margin-top: 8px; min-height: 22px; }

/* ------------------------------------------------------------ footer */
.foot-line {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: baseline;
    padding: 120px var(--m) 20px; font-size: var(--s1); color: var(--muted);
}
.foot-line nav { display: flex; gap: 24px; }
.foot-line a { color: var(--text); text-decoration: none; }
.foot-line a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-line .right { text-align: right; }
.pay { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px 22px; padding: 12px var(--m) 28px; }
.pay img { width: auto; }  /* height comes from each mark's attribute */
.pay .footer-logo-text { font-size: 13px; color: var(--faint); }
.pay .footer-sep { width: 1px; height: 18px; background: var(--rule); }

/* ------------------------------------------------------------ motion */
.js [data-rise] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-rise].in { opacity: 1; transform: none; }
[data-ui].paper tbody tr { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js [data-ui].paper tbody tr.pending { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; transition-delay: 0s !important; }
    .js [data-rise] { opacity: 1; transform: none; }
    .js [data-ui].paper tbody tr.pending { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ tablet and phone */
@media (max-width: 1100px) {
    .faq h2 { grid-column: 1 / -1; margin-bottom: 32px; }
    .faq-text { grid-column: 1 / -1; }
    .month-col { grid-column: 3 / 13; }
    .start-copy h2 { font-size: clamp(56px, 6.4vw, 88px); }
}
@media (max-width: 860px) {
    /* the phone scale: 14 / 17 / 24 / 30, 44 for display lines, 88 for prices */
    :root { --gap: 104px; --s3: 24px; --s4: 30px; --s5: 88px; --s-display: 44px; }
    @media (min-width: 521px) { :root { --s4: 40px; } }
    .stage { grid-template-columns: 1fr; gap: 0; padding: 12px 12px 0; }
    /* On a phone the invoice is a short pinned strip, cropped to the part being changed */
    .pin {
        order: -1; top: 0; z-index: 3;
        height: 172px; border-radius: 0 0 var(--r) var(--r);
        margin: -12px -12px 12px;
        place-items: start center;
        padding-top: 12px;
    }
    .card { min-height: 0; }
    .tear { height: 40px; }
    .card-body { padding: 32px 22px 28px; gap: 20px; }
    .hero-h1 { font-size: var(--s4); }
    .card-links { padding: 0 22px 24px; gap: 22px; }
    .try { padding: 72px 8px 20svh; position: relative; z-index: 1; }
    .try h2 { margin-bottom: 40px; font-size: var(--s3); letter-spacing: -0.02em; line-height: 1.15; }
    .block { min-height: 0; padding-bottom: 56px; }
    .block h3 { font-size: var(--s3); }
    .paper-wrap { width: calc(100% - 24px); }
    [data-ui].paper { padding: 22px 20px; font-size: 12.5px; }
    [data-ui].paper .p-panel .big b { font-size: 21px; }
    [data-ui].paper .p-title { font-size: 22px; }

    .film { padding: var(--gap) 20px 0; }
    .film-head { display: block; margin-bottom: 24px; }
    .film-head h2 { font-size: var(--s3); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 12px; }
    .film-field { padding: 24px 12px; }
    .owes { grid-template-columns: 1fr; min-height: 0; }
    .owes-raw { min-height: 0; padding: 48px 20px 120px; }
    .owes-tidy { min-height: 0; }
    .owes-tidy { min-height: 62svh; padding: 110px 20px 48px; }
    .owes-raw .notes { margin-top: 0; font-size: var(--s2); }
    .owes .h-left { left: 20px; bottom: 28px; font-size: var(--s-display); }
    .owes .h-right { right: auto; left: 20px; top: 40px; bottom: auto; font-size: var(--s-display); }
    [data-ui].dash { margin-top: 0; }

    .month { display: block; padding: var(--gap) 20px 0; }
    .month h2 { font-size: var(--s3); }
    .evidence { margin-bottom: 56px; }
    .ev-row .grow { flex-basis: 100%; }
    .sheet .net, .sheet .vat { display: none; }

    .price > h2 { margin: 0 20px 20px; font-size: var(--s3); }
    .plans { grid-template-columns: 1fr; min-height: 0; }
    .plan { min-height: 70svh; padding: 28px 20px; }
    .plan.main { order: -1; }
    .plan h3 { font-size: var(--s-display); }
    .plan .amount { font-size: var(--s5); }
    .plan .foot .btn { width: 100%; }
    .others { margin: 20px 20px 0; }

    .faq { padding: var(--gap) 20px 0; }
    .faq h2 { font-size: var(--s3); }
    .faq-text { columns: 1; max-width: 62ch; }
    .faq-text p { margin-bottom: 18px; }

    .start { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 84svh; padding: 40px 16px 24px; }
    .start-copy { align-self: start; }
    .start-copy h2 { font-size: var(--s-display); }
    [data-ui].dialog { width: 100%; padding: 22px; }
    [data-ui].dialog .btn { min-height: 52px; }

    .foot-line { grid-template-columns: 1fr; gap: 8px; padding: 20svh 20px 16px; }
    .foot-line nav { flex-wrap: wrap; gap: 8px 20px; }
    .foot-line .right { text-align: left; }
    .pay { justify-content: flex-start; padding: 8px 20px 24px; }
}

/* the accountant's export, as the spreadsheet it is */
.sheet table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.sheet th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 8px; background: var(--ground); }
.sheet td { padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.sheet th.r, .sheet td.r { text-align: right; }
.sheet tr:last-child td { border-bottom: 0; font-weight: 600; }
.sheet .ev-file { margin-bottom: 10px; }
@media (max-width: 860px) { .sheet { overflow-x: auto; } }

/* ------------------------------------------------------------ sign-up, sign-in, setup */
body.auth { min-height: 100svh; display: flex; flex-direction: column; }
.auth-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px clamp(16px, 4vw, 40px); }
.auth-bar .wordmark { font-size: 18px; }
.auth-bar .wordmark svg { width: 28px; height: 28px; }
.auth-bar-link { font-size: var(--s1); color: var(--muted); }
.auth-bar-link a { color: var(--text); font-weight: 500; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12px 16px 56px; }
.auth-card { width: min(480px, 100%); background: var(--surface); border-radius: var(--r); overflow: hidden; }
.auth-card.wide { width: min(620px, 100%); }
.auth-card .tear { height: 28px; -webkit-mask-size: 20px 100%; mask-size: 20px 100%; }
.auth-body { padding: 32px clamp(20px, 5vw, 40px) 36px; }
.auth-body h1 { font-size: clamp(28px, 3vw, 34px); letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-body .sub { color: var(--muted); margin-bottom: 28px; }
.auth-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px clamp(16px, 4vw, 40px); font-size: var(--s1); color: var(--muted); }
.auth-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--text); }

.f { margin-bottom: 18px; }
.f > label, .f .lbl { display: block; font-size: var(--s1); font-weight: 500; margin-bottom: 6px; }
.f .hint { margin-top: 6px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-pass { position: relative; }
.f-pass .input { padding-right: 76px; }
.f-pass button { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 500 var(--s1) var(--font); cursor: pointer; }
.f-pass button:hover { color: var(--text); background: var(--ground); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.auth .seg { display: flex; margin-bottom: 22px; }
.auth .seg button, .auth .seg label { flex: 1; text-align: center; }
.auth .seg label { min-height: 40px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font: 500 var(--s1) var(--font); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.auth .seg label:has(input:checked) { background: var(--surface); color: var(--text); }
.auth .seg input { position: absolute; opacity: 0; pointer-events: none; }
.auth .seg label:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 1px; }
.auth .btn.btn-wide { width: 100%; margin-top: 8px; }
.auth .alert { padding: 12px 14px; border-radius: var(--r); margin-bottom: 20px; font-size: 15px; background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.auth .alert.ok { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }
.auth .fine { margin-top: 18px; font-size: var(--s1); color: var(--muted); }
.auth .fine a { color: var(--text); }
.found-card { margin: -6px 0 18px; padding: 12px 14px; border-radius: var(--r); background: var(--ground); font-size: var(--s1); color: var(--muted); }
.found-card b { color: var(--text); font-weight: 500; display: block; margin-bottom: 2px; }
details.more { margin: 4px 0 18px; }
details.more > summary { cursor: pointer; font-size: var(--s1); color: var(--muted); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-block; width: 14px; text-align: center; }
details.more[open] > summary::before { content: "−"; }
details.more[open] > summary { margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ground); color: var(--muted); font: 500 var(--s1) var(--font); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.chips input:checked + span { background: var(--primary); color: var(--on-primary); }
.chips input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.numbering label { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; font-size: 15px; cursor: pointer; }
.numbering label input { accent-color: var(--primary); }
.numbering code { font: 500 var(--s1)/1 var(--font); font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 520px) {
    .auth-bar { padding: 14px 16px; }
    .auth-main { padding: 4px 12px 40px; }
    .f-row { grid-template-columns: 1fr; gap: 0; }
    .auth-foot { flex-direction: column; gap: 8px; }
}
.pricing-main { width: min(1240px, 100%); margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 0; flex: 1; }
.pricing-main .foot-line { padding-top: 80px; }

/* ------------------------------------------------------------ public bar + guides */
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.auth-bar .wordmark { white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav .login-btn { color: var(--text); height: 38px; }
.site-nav .site-nav-cta { min-height: 40px; padding: 0 16px; font-size: 15px; color: var(--on-primary); }
@media (max-width: 640px) { .site-nav a:not(.site-nav-cta):not(.login-btn) { display: none; } }  /* text links need the room */
@media (max-width: 520px) {
    .site-nav { gap: 8px; }
    .site-nav .login-btn, .site-nav .site-nav-cta { height: 38px; min-height: 38px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
    .auth-bar { padding: 16px; }
    .auth-bar .wordmark { white-space: nowrap; }
}
@media (max-width: 380px) { .auth-bar:has(.site-nav-cta) .wordmark span { display: none; } }  /* the mark alone, so both buttons fit */

.article-main { width: 100%; padding: 16px 16px 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.check-note { display: block; margin: 10px 0 14px; padding: 8px 12px; border-left: 3px solid var(--negative); border-radius: 4px; background: var(--pill-neg-bg); color: var(--pill-neg-ink); font-size: var(--s1); line-height: 1.45; }
.draft-note { width: min(720px, 100%); margin: 0; padding: 10px 14px; border-radius: var(--r); background: var(--pill-neg-bg); color: var(--pill-neg-ink); font-size: var(--s1); }
.article { width: min(720px, 100%); }
.crumbs { font-size: var(--s1); color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); }
.article h1 { font-size: clamp(32px, 4.4vw, 52px); max-width: 18ch; margin-bottom: 16px; }
.article .lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--muted); max-width: 52ch; margin-bottom: 14px; }
.article-meta { font-size: var(--s1); color: var(--faint); margin-bottom: 40px; }
.article-meta a { color: var(--text); }
/* The guide's sample, first thing in the article: a look at it and a real button */
.sample-dl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 24px; margin: 0 0 40px; padding: 16px 24px 16px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.article-meta:has(+ .sample-dl) { margin-bottom: 24px; }
.sample-thumb { display: block; width: 132px; line-height: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.sample-thumb img { width: 100%; height: auto; }
.sample-text { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.sample-text b { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.sample-text span { font-size: var(--s1); color: var(--muted); }
.sample-dl .btn { white-space: nowrap; }
@media (max-width: 560px) {
    .sample-dl { grid-template-columns: 72px 1fr; padding: 12px; gap: 12px 14px; }
    .sample-thumb { width: 72px; }
    .sample-dl .btn { grid-column: 1 / -1; }
}
.article-body { font-size: 18px; line-height: 1.65; }
.article-body h2 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.02em; line-height: 1.15; margin: 48px 0 14px; }
.article-body h3 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; margin: 32px 0 10px; }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--text); text-underline-offset: 3px; }
.article-body strong { font-weight: 600; }
.article-body blockquote { margin: 0 0 18px; padding: 14px 18px; background: var(--surface); border-radius: var(--r); color: var(--text); }
.article-body table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 15px; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.article-body th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; background: var(--ground-2); }
.article-body td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: top; }
.article-body td.num, .article-body th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Contacts and terms (article layout) */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 44px; }
.contact-card { background: var(--surface); border-radius: var(--r); padding: 24px; }
.contact-card h2 { font-size: var(--s1); font-weight: 500; color: var(--muted); letter-spacing: 0; margin: 0 0 10px; }
.contact-big { display: block; font-size: clamp(21px, 2.2vw, 26px); font-weight: 600; letter-spacing: -0.02em; color: var(--text); text-decoration: none; margin-bottom: 8px; overflow-wrap: anywhere; }
.contact-big:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-card p { margin: 0; color: var(--muted); }
.facts-title { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 12px; }
.facts { margin: 0; background: var(--surface); border-radius: var(--r); }
.facts > div { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--rule); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.pay-logos { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.pay-logos .logo-box { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 6px 12px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; }
.pay-logos img { max-height: 32px; width: auto; }
.pay-logos .logo-box-text { font-size: 14px; color: #3a3d42; }
.license-key { font-variant-numeric: tabular-nums; letter-spacing: .06em; text-transform: uppercase; text-align: center; }
@media (max-width: 640px) {
    .contact-grid { grid-template-columns: 1fr; }
    .facts > div { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
}
.article-sources { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); }
.article-sources h2 { font-size: 16px; margin-bottom: 10px; }
.article-sources ul { margin: 0; padding-left: 18px; font-size: var(--s1); color: var(--muted); }
.article-sources li { margin-bottom: 6px; }
.article-sources a { color: var(--muted); word-break: break-word; }
.article-cta { width: min(720px, 100%); background: var(--ink-field); color: var(--on-ink); border-radius: var(--r); padding: 28px; }
.article-cta h2 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 10px; }
.article-cta p { color: var(--on-ink-muted); margin-bottom: 20px; max-width: 52ch; }
.article-cta .btn { background: var(--ink-btn); color: var(--ink-btn-ink); }
.article-related { width: min(720px, 100%); }
.article-related h2 { font-size: 18px; margin-bottom: 10px; }
.article-related ul, .guide-list { list-style: none; margin: 0; padding: 0; }
.article-related li a { display: block; padding: 12px 0; border-top: 1px solid var(--rule); color: var(--text); text-decoration: none; }
.article-related li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide-list li a { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; border-top: 1px solid var(--rule); color: var(--text); text-decoration: none; }
.guide-list li a b { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.guide-list .draft-tag { margin-left: 8px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 999px; font-size: 12px; font-style: normal; font-weight: 500; color: var(--muted); vertical-align: 3px; }
.guide-list li a span { color: var(--muted); }
.guide-list li a:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .article-body { font-size: 17px; } .article-body table { font-size: 14px; } .article-body th, .article-body td { padding: 8px; } }
@media (max-width: 520px) {   /* five-column line tables fit a 320 px phone */
    .article-body table { font-size: 13px; }
    .article-body th, .article-body td { padding: 8px 5px; }
    .article-body th:first-child, .article-body td:first-child { padding-left: 10px; }
    .article-body th:last-child, .article-body td:last-child { padding-right: 10px; }
}
@media (max-width: 359px) { .article-body table { display: block; overflow-x: auto; } }  /* below that, scroll the table, not the page */
[data-ui].paper .p-totals .grand span { font-weight: 500; }
[data-ui].paper.t-classic .p-totals .grand b { font-size: 1.2em; }
[data-ui].paper.t-minimal .p-totals .grand span { font-weight: 400; }
