/*
 * etf-sparplan.eu – Das Sparbuch, das nie ausgehändigt wurde.
 * Ochsenblut-Einband trägt die Fläche, Seiten aus Sicherheitspapier,
 * Nadeldrucker-Ziffern nur für Buchungen, Stempelviolett nur für den eigenen Saldo.
 */

@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-vf.woff2") format("woff2-variations"), url("../fonts/archivo-vf.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Doto";
    src: url("../fonts/doto-vf.woff2") format("woff2-variations"), url("../fonts/doto-vf.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --cover: #6e1f24;
    --cover-deep: #521519;
    --cover-rim: #3d0f12;
    --cover-ink: #ecdcd6;
    --cover-ink-muted: #d3b7b0;
    --paper: #e3e8ec;
    --paper-deep: #d6dde3;
    --paper-line: #b9c3cc;
    --ink: #23262b;
    --ink-muted: #4a525c;
    --stamp: #5b3f8f;
    --stamp-soft: rgba(91, 63, 143, 0.08);
    --error: #9b1c24;
    --slip: #f3f5f4;

    --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --font-print: "Doto", "Courier New", monospace;

    --container: 1240px;
    --page-pad: clamp(1.4rem, 3.2vw, 3.25rem);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--cover-ink-muted) var(--cover-deep);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--cover);
    background-image: url("../img/grain.svg");
    caret-color: var(--stamp);
    font-variant-numeric: tabular-nums;
}

::selection {
    background: var(--stamp);
    color: var(--paper);
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--cover-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--cover-ink-muted);
    border: 3px solid var(--cover-deep);
    border-radius: 6px;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

:focus-visible {
    outline: 3px solid var(--stamp);
    outline-offset: 3px;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.3rem, 3.9vw, 3.9rem);
    font-stretch: 112%;
    font-weight: 820;
    line-height: 1.02;
    letter-spacing: -0.025em;
}

h2 {
    font-size: clamp(1.5rem, 2.2vw, 2.1rem);
    font-stretch: 110%;
    font-weight: 760;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

h3 {
    font-size: 1.075rem;
    font-weight: 680;
    line-height: 1.3;
}

p {
    margin: 0;
}

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

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 50;
    padding: 0.6rem 1rem;
    background: var(--paper);
    color: var(--ink);
    font-weight: 650;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin-inline: auto;
}

/* ---------- Kopfzeile auf dem Einband ---------- */

.site-header {
    color: var(--cover-ink);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: 1.35rem;
}

.brand {
    font-size: 1.05rem;
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    color: var(--cover-ink);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.6rem;
}

.site-nav a {
    font-size: 0.97rem;
    font-weight: 520;
    text-decoration: none;
    color: var(--cover-ink);
    padding-block: 0.3rem;
}

.site-nav a:hover {
    text-decoration: underline;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-weight: 600;
    color: var(--cover-ink);
    background: transparent;
    border: 1px solid var(--cover-ink-muted);
    border-radius: 4px;
    cursor: pointer;
}

/* ---------- Das Buch ---------- */

.spread {
    padding-block: 0.5rem 3.5rem;
}

.spread + .spread {
    padding-top: 1rem;
}

.book {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(calc(100% - 2rem), var(--container));
    margin-inline: auto;
    padding: 10px;
    background: var(--cover-rim);
    border-radius: 10px;
    box-shadow: 0 2px 3px rgba(20, 4, 6, 0.35), 0 34px 60px -24px rgba(20, 4, 6, 0.75);
}

/* Fadenheftung im Falz */
.book::before {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 34px;
    left: 50%;
    z-index: 1;
    width: 0;
    border-left: 2px dashed rgba(110, 31, 36, 0.55);
    transform: translateX(-1px);
    pointer-events: none;
}

/* Falz zwischen den Seiten */
.book::after {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    width: 44px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(35, 38, 43, 0.13) 45%, rgba(35, 38, 43, 0.2) 50%, rgba(35, 38, 43, 0.13) 55%, transparent);
    pointer-events: none;
}

.page {
    position: relative;
    padding: var(--page-pad);
    background-color: var(--paper);
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
}

.page-left {
    border-radius: 4px 0 0 4px;
    background-image: url("../img/guilloche.svg");
    background-size: 240px 36px;
}

.page-right {
    border-radius: 0 4px 4px 0;
}

.page > h2 + p,
.page > h2 + table,
.page > h2 + ol,
.page > h2 + .faq {
    margin-top: -0.2rem;
}

.page > p {
    max-width: 62ch;
}

.page > p + h2 {
    margin-top: 1.25rem;
}

.lead {
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--ink-muted);
    max-width: 46ch;
}

/* ---------- Kontodaten ---------- */

.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-top: 0.6rem;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

legend {
    padding: 0;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
    font-weight: 680;
    color: var(--ink);
}

.account-fields {
    padding-top: 1rem;
    border-top: 2px solid var(--ink);
}

.account-fields legend {
    float: left;
    width: 100%;
}

.account-grid {
    clear: both;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 1.6rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.field label {
    font-size: 0.88rem;
    font-weight: 560;
    color: var(--ink-muted);
}

.field-input {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    border-bottom: 2px dotted var(--ink);
    transition: border-color 160ms ease;
}

.field-input:focus-within {
    border-bottom-style: solid;
    border-bottom-color: var(--stamp);
}

.field input {
    width: 100%;
    min-width: 0;
    padding: 0.15rem 0 0.25rem;
    font: inherit;
    font-size: 1.6rem;
    font-weight: 680;
    font-stretch: 105%;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    appearance: textfield;
    -moz-appearance: textfield;
}

.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.field input:focus-visible {
    outline: none;
}

.field-input:has(input:focus-visible) {
    outline: 3px solid var(--stamp);
    outline-offset: 4px;
}

.field-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.field-small input {
    font-size: 1.15rem;
}

.field input[aria-invalid="true"] {
    color: var(--error);
}

.field-input:has(input[aria-invalid="true"]) {
    border-bottom-color: var(--error);
    border-bottom-style: solid;
}

.field-error {
    font-size: 0.85rem;
    font-weight: 560;
    color: var(--error);
}

/* Beitragssatz als Stempel */
.stamps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.stamps legend {
    grid-column: 1 / -1;
}

.stamp-option {
    position: relative;
    cursor: pointer;
}

.stamp-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.stamp-face {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    height: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--ink-muted);
    border: 1.5px dashed var(--paper-line);
    border-radius: 3px;
    transition: transform 220ms var(--ease-out), border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.stamp-face strong {
    font-size: 1.45rem;
    font-stretch: 112%;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ink-muted);
}

.stamp-option:hover .stamp-face {
    border-color: var(--ink-muted);
}

.stamp-face {
    position: relative;
}

/* Stempelrand mit Farbauftrag; die Schrift bleibt voll gedeckt */
.stamp-face::before {
    content: "";
    position: absolute;
    inset: -1.5px;
    border: 3px double var(--stamp);
    border-radius: 3px;
    opacity: 0;
    filter: url(#stamp-ink);
    -webkit-mask-image: url("../img/ink-mask.svg");
    mask-image: url("../img/ink-mask.svg");
    pointer-events: none;
}

.stamp-option input:checked + .stamp-face {
    color: var(--stamp);
    background-color: var(--stamp-soft);
    border-color: transparent;
    transform: rotate(-1.5deg);
}

.stamp-option input:checked + .stamp-face::before {
    opacity: 1;
}

.stamp-option input:checked + .stamp-face strong {
    color: var(--stamp);
}

.stamp-option input:focus-visible + .stamp-face {
    outline: 3px solid var(--stamp);
    outline-offset: 3px;
}

/* Konditionen */
.conditions {
    border-top: 1px solid var(--paper-line);
    padding-top: 0.9rem;
}

.conditions summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.conditions summary::-webkit-details-marker {
    display: none;
}

.conditions summary .icon {
    transition: transform 200ms var(--ease-out);
}

.conditions[open] summary .icon {
    transform: rotate(90deg);
}

.conditions summary:hover {
    text-decoration: underline;
}

.conditions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.4rem;
    margin-top: 0.8rem;
}

.conditions-note {
    margin-top: 1rem;
    font-size: 0.86rem;
    color: var(--ink-muted);
    max-width: 60ch;
}

.text-button {
    margin-top: 0.8rem;
    padding: 0.4rem 0;
    min-height: 44px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 620;
    color: var(--stamp);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 0.22em;
    cursor: pointer;
}

.text-link {
    font-weight: 650;
    color: var(--stamp);
}

/* ---------- Buchungen ---------- */

.ledger-wrap {
    overflow-x: auto;
}

.ledger {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
}

.ledger caption {
    caption-side: bottom;
    padding-top: 0.55rem;
    font-size: 0.8rem;
    text-align: left;
    color: var(--ink-muted);
}

.ledger th {
    padding: 0 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 620;
    text-align: right;
    color: var(--ink-muted);
    border-bottom: 2px solid var(--ink);
    white-space: nowrap;
}

.ledger th:first-child,
.ledger td:first-child {
    text-align: left;
    padding-left: 0;
}

.ledger th:last-child,
.ledger td:last-child {
    padding-right: 0;
}

.ledger td {
    padding: 0.42rem 0.4rem;
    font-family: var(--font-print);
    font-weight: 780;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--paper-line);
}

.ledger tr.is-carry td {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 520;
    color: var(--ink-muted);
    background: var(--paper-deep);
}

.ledger tr.is-carry td:first-child {
    padding-left: 0.5rem;
    white-space: normal;
}

.ledger .ledger-empty {
    font-family: var(--font-sans);
    text-align: left;
    color: var(--ink-muted);
    white-space: normal;
}

.ledger.is-stale tbody,
.saldo.is-stale .saldo-value,
.saldo.is-stale .saldo-longevity strong,
.facts.is-stale dd,
.statement.is-stale dd {
    opacity: 0.4;
}

/* Druckkopf: geänderte Zeilen werden neu gedruckt */
.ledger tr.is-printing td {
    animation: print-line 340ms steps(14, end) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes print-line {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ---------- Saldo ---------- */

.saldo {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 1rem;
    align-items: start;
    padding-top: 0.9rem;
    border-top: 4px double var(--ink);
}

.saldo > :not(.stamp-mark) {
    grid-column: 1;
}

.saldo-label {
    font-size: 0.95rem;
    font-weight: 650;
}

.saldo-value {
    font-size: clamp(2.5rem, 4vw, 4.1rem);
    font-stretch: 115%;
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--stamp);
    margin-block: 0.25rem 0.45rem;
}

.saldo-value.is-stamped {
    animation: stamp-down 260ms var(--ease-out) both;
}

@keyframes stamp-down {
    from {
        transform: scale(1.045);
        opacity: 0.55;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

.saldo-explain {
    font-size: 0.98rem;
    color: var(--ink-muted);
    max-width: 34ch;
}

.saldo-longevity {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.6rem;
    max-width: 40ch;
    margin-top: 0.8rem;
    padding-top: 0.55rem;
    border-top: 1px dotted var(--paper-line);
}

.saldo-longevity-label {
    font-size: 0.95rem;
    font-weight: 650;
}

.saldo-longevity strong {
    font-size: 1.35rem;
    font-stretch: 112%;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--stamp);
}

.saldo-longevity-explain {
    flex-basis: 100%;
    margin-top: 0.2rem;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.stamp-mark {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    margin-right: 0.4rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 760;
    font-stretch: 118%;
    line-height: 1.25;
    letter-spacing: 0.06em;
    text-align: center;
    color: var(--stamp);
    border: 2.5px solid var(--stamp);
    border-radius: 4px;
    outline: 1px solid var(--stamp);
    outline-offset: 2px;
    transform: rotate(-9deg);
    opacity: 0.95;
    mix-blend-mode: multiply;
    filter: url(#stamp-ink);
    -webkit-mask-image: url("../img/ink-mask.svg");
    mask-image: url("../img/ink-mask.svg");
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem 1.1rem;
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--paper-line);
}

.facts dt {
    font-size: 0.8rem;
    font-weight: 560;
    line-height: 1.3;
    color: var(--ink-muted);
}

.facts dd {
    margin: 0.15rem 0 0;
    font-size: 1.08rem;
    font-weight: 680;
}

.fact-etf dd {
    font-weight: 560;
    color: var(--ink-muted);
}

.verdict {
    font-size: 1rem;
    line-height: 1.55;
    max-width: 60ch;
}

.verdict strong {
    font-weight: 720;
}

.footnote {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-muted);
    max-width: 68ch;
}

/* ---------- Folgeseiten ---------- */

.compare {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.97rem;
    hyphens: manual;
}

.compare th,
.compare td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--paper-line);
}

.compare thead th {
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--ink-muted);
    border-bottom: 2px solid var(--ink);
}

.compare tbody th {
    font-weight: 600;
    padding-left: 0;
    width: 42%;
}

.page-close {
    font-weight: 650;
}

.clauses {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: clause;
    display: grid;
    gap: 1.1rem;
}

.clauses li {
    position: relative;
    padding-left: 2.6rem;
    counter-increment: clause;
}

.clauses li::before {
    content: counter(clause);
    position: absolute;
    left: 0;
    top: -0.2rem;
    font-family: var(--font-print);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink-muted);
}

.clauses h3 {
    margin-bottom: 0.25rem;
}

.clauses p,
.faq p {
    max-width: 60ch;
}

.faq h3 {
    margin-top: 1.1rem;
    margin-bottom: 0.3rem;
}

.faq h3:first-child {
    margin-top: 0;
}

/* ---------- Eingelegter Kontoauszug ---------- */

.insert {
    padding-block: 1rem 4.5rem;
}

.slip {
    position: relative;
    width: min(calc(100% - 2rem), 920px);
    margin-inline: auto;
    padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(2.4rem, 5vw, 4rem);
    background-color: var(--slip);
    border-radius: 2px;
    box-shadow: 0 2px 3px rgba(20, 4, 6, 0.3), 0 26px 44px -22px rgba(20, 4, 6, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Führungslöcher des Endlospapiers */
.slip::before,
.slip::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5rem;
    background-image: radial-gradient(circle at center, var(--cover) 0 4px, transparent 4.5px);
    background-size: 1.5rem 1.5rem;
    background-position: center 0.75rem;
    border-right: 1px dashed var(--paper-line);
}

.slip::before {
    left: 0;
}

.slip::after {
    right: 0;
    border-right: 0;
    border-left: 1px dashed var(--paper-line);
}

.slip-intro {
    color: var(--ink-muted);
    max-width: 62ch;
}

.slip-body {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1.5rem 2.5rem;
    align-items: start;
    margin-top: 0.4rem;
}

.slip-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.4rem;
}

.statement {
    margin: 0;
    font-family: var(--font-print);
    font-weight: 780;
}

.statement div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--paper-line);
}

.statement dt {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 560;
    color: var(--ink-muted);
}

.statement dd {
    margin: 0;
    font-size: 1.1rem;
}

.statement .statement-total {
    border-bottom: 4px double var(--ink);
}

.statement .statement-total dd {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Merkblatt: Depot eröffnen und Altersvorsorgedepot */
#sparplan {
    padding-bottom: 2rem;
}

.slip-plain {
    padding-inline: clamp(1.5rem, 4.5vw, 3.5rem);
}

.slip-plain::before,
.slip-plain::after {
    display: none;
}

.slip-body-even {
    grid-template-columns: 1fr 1fr;
}

.criteria {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
}

.criteria li {
    position: relative;
    padding-left: 1.4rem;
    line-height: 1.5;
}

.criteria li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.62em;
    width: 0.5rem;
    height: 2px;
    background: var(--ink);
}

.criteria strong {
    font-weight: 680;
}

.brokers {
    display: flex;
    flex-direction: column;
}

.broker {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px dashed var(--paper-line);
}

.broker:first-child {
    border-top: 2px solid var(--ink);
}

.broker-banner {
    display: block;
    flex-basis: 100%;
}

.broker-banner img {
    display: block;
    max-width: 100%;
    height: auto;
}

.broker-name {
    font-size: 1.15rem;
    font-stretch: 110%;
    font-weight: 760;
}

.broker-text {
    flex-basis: 100%;
    font-size: 0.92rem;
    color: var(--ink-muted);
}

.broker-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 44px;
    font-weight: 680;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.broker-link:hover {
    color: var(--stamp);
}

.brokers .footnote {
    margin-top: 0.8rem;
}

.notice {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1.4rem;
    padding: 1.2rem 1.4rem;
    border: 2px solid var(--ink);
    border-radius: 3px;
}

.notice p {
    max-width: 70ch;
}

/* ---------- Einzelblatt (Rechtstexte, 404) ---------- */

.sheet-section {
    padding-block: 1rem 4.5rem;
}

.sheet {
    width: min(calc(100% - 2rem), 820px);
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    background-color: var(--paper);
    border-radius: 4px;
    box-shadow: 0 2px 3px rgba(20, 4, 6, 0.3), 0 26px 44px -22px rgba(20, 4, 6, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prose h2 {
    margin-top: 1.4rem;
    font-size: 1.45rem;
}

.prose ul,
.prose ol {
    margin: 0;
    padding-left: 1.3rem;
}

.prose li + li {
    margin-top: 0.3rem;
}

.prose a {
    color: var(--stamp);
}

.prose code {
    font-size: 0.92em;
    padding: 0.05rem 0.3rem;
    background: var(--paper-deep);
    border-radius: 3px;
}

/* ---------- Fußzeile ---------- */

.site-footer {
    color: var(--cover-ink);
    border-top: 1px solid rgba(236, 220, 214, 0.18);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding-block: 2.75rem 2rem;
}

.footer-brand {
    font-stretch: 125%;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.footer-about p:not(.footer-brand) {
    color: var(--cover-ink-muted);
    max-width: 52ch;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-links a {
    color: var(--cover-ink);
    text-decoration: none;
    padding-block: 0.15rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 1.25rem 2rem;
    font-size: 0.85rem;
    color: var(--cover-ink-muted);
    border-top: 1px solid rgba(236, 220, 214, 0.18);
}

/* ---------- Saldo-Leiste (mobil) ---------- */

.saldo-bar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 30;
    display: none;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    color: var(--paper);
    background: var(--stamp);
    border-radius: 6px;
    box-shadow: 0 10px 24px -8px rgba(20, 4, 6, 0.6);
    transform: translateY(160%);
    transition: transform 280ms var(--ease-out);
}

.saldo-bar span {
    font-size: 0.9rem;
    font-weight: 600;
}

.saldo-bar strong {
    font-size: 1.35rem;
    font-stretch: 112%;
    font-weight: 800;
}

.saldo-bar.is-visible {
    transform: none;
}

/* ---------- Responsiv ---------- */

@media (max-width: 1100px) {
    .facts {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .header-row {
        flex-wrap: wrap;
        padding-block: 0.9rem;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-bottom: 0.5rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding-block: 0.7rem;
        border-top: 1px solid rgba(236, 220, 214, 0.16);
    }

    .book {
        grid-template-columns: 1fr;
        padding: 7px;
    }

    .book::after,
    .book::before {
        display: none;
    }

    .spread-account .page-left {
        padding-bottom: 5.5rem;
    }

    .page-left {
        border-radius: 4px 4px 0 0;
    }

    .page-right {
        border-radius: 0 0 4px 4px;
        border-top: 1px dashed var(--paper-line);
    }

    .slip-body,
    .slip-body-even {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .saldo-bar {
        display: flex;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 1rem;
    }

    .account-grid,
    .conditions-grid,
    .slip-form {
        grid-template-columns: 1fr;
    }

    .stamps {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .ledger {
        font-size: 0.86rem;
    }

    .ledger th,
    .ledger td {
        padding-inline: 0.25rem;
    }

    .ledger .col-contribution,
    .ledger td.col-contribution {
        display: none;
    }

    .saldo {
        grid-template-columns: 1fr;
    }

    .stamp-mark {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-top: 0.7rem;
        transform: rotate(-4deg);
    }

    .slip {
        padding-inline: 2.2rem;
    }

    .compare thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .compare tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 1rem;
        padding: 0.65rem 0;
        border-bottom: 1px solid var(--paper-line);
    }

    .compare tbody th {
        grid-column: 1 / -1;
        width: auto;
        padding: 0 0 0.3rem;
        border: 0;
    }

    .compare tbody td {
        padding: 0;
        border: 0;
    }

    .compare tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        font-weight: 560;
        color: var(--ink-muted);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
