/* Kontoseiten /konten/<nr>-<slug>.html (seit 02.12.2026).
   Erzeugt von scripts/kontoseiten/bauen.js. Alles Allgemeine (Papier,
   Raster, Überschriften, Hinweise, Fußbereich) kommt aus knowledge-hb.css;
   hier stehen nur die Bausteine der Kontoseite:

   1. Steckbrief (Klasse, Kontoart, Zugang, Bilanz/GuV)
   2. T-Konto mit dem, was im Soll und im Haben steht
   3. Buchungsraster Seite | Konto | Betrag
   4. Kurz-Check Soll oder Haben (js/kontoseite.js)
   5. Vergleich, Weiterlernen, Klassenliste, Blättern

   Farbe als Code: Soll = Saldo-Rot (--kh-terra), Klassenfarbe nur am
   Klassen-Chip und als Markierung der Zeile mit diesem Konto. Richtig/Falsch
   ausschließlich über --feedback-*.

   Klassenfarben: dieselben Töne wie kontenklassen.css (--kk-N), eigene Namen
   (--ks-kN), weil check-kontenfarben.js jede Datei mit --kp-N/.class-N einer
   Farbfamilie zuordnet. Ändert sich die Leitfarbe in kontenplan-hb.css, hier
   und in kontenklassen.css nachziehen. */

.ks-body {
    --ks-k0: #564d43;
    --ks-k1: #185fa5;
    --ks-k2: #2f7650;
    --ks-k3: #a85f20;
    --ks-k4: #775097;
    --ks-k5: #4a453b;
    --ks-k6: #376f66;
    --ks-k7: #a43f34;
    --ks-k8: #564d43;
    --ks-k9: #67458c;
    --ks-soll: var(--kh-terra, #b0492c);
}

/* Bildschirmleser-Text (Tabellenbeschriftung) */
.ks-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* knowledge-hb.css setzt die Meta-Zeile auf 0.62rem (10px) — zu klein. */
.ks-body .editorial-meta,
.ks-body .seo-hero .seo-kicker {
    font-size: 0.75rem;
}

/* ------------------------------------------------------- Brotkrümel */

.ks-pfad {
    padding: 18px clamp(34px, 5vw, 62px) 0;
}

.ks-pfad ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--kh-mono);
    font-size: 0.78rem;
    color: var(--kh-ink-muted);
}

.ks-pfad li + li::before {
    content: "/";
    margin-right: 10px;
    color: var(--kh-border);
}

.ks-pfad a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--kh-ink-mid);
    text-underline-offset: 3px;
}

.ks-pfad li[aria-current] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* ------------------------------------------------------- Kopf */

.ks-kopf h1 .ks-h1-nr {
    font-family: var(--kh-mono);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.ks-steckbrief {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 28px 0 0;
    border-top: 2px solid var(--kh-ink);
    border-bottom: 1px solid var(--kh-ink);
}

.ks-steckbrief > div {
    padding: 12px 14px 14px 0;
}

.ks-steckbrief > div + div {
    padding-left: 14px;
    border-left: 1px solid var(--kh-border);
}

.ks-steckbrief dt {
    margin: 0 0 6px;
    color: var(--kh-ink-muted);
    font-family: var(--kh-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ks-steckbrief dd {
    /* Lange Kontoarten wie „Verrechnungskonto“ am Handy trennen (04.12.2026). */
    hyphens: auto;
    overflow-wrap: break-word;
    min-width: 0;
    margin: 0;
    color: var(--kh-ink);
    font-family: var(--kh-serif);
    font-size: 1rem;
    line-height: 1.4;
}

.ks-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7em;
    height: 1.7em;
    margin-right: 4px;
    border: 1px solid var(--kh-ink);
    background: var(--ks-klasse, var(--ks-k0));
    color: var(--text-on-dark, #fff8e9);
    font-family: var(--kh-mono);
    font-size: 0.85rem;
    vertical-align: 0.05em;
}

.ks-seite--soll {
    color: var(--ks-soll) !important;
}

.ks-seite--haben {
    color: var(--kh-ink) !important;
}

/* Zugang in Tinte, nicht in Soll-Rot: Das Rot steht wenige Zentimeter weiter
   unten für „falsch“ im Kurz-Check (--feedback-wrong-accent ist fast derselbe
   Ton). Rot bleibt dem Soll-Etikett im T-Konto und im Buchungsraster. */
.ks-steckbrief dd.ks-zugang {
    font-family: var(--kh-mono);
    font-weight: 500;
}

/* ------------------------------------------------------- T-Konto */

.ks-tkonto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 820px;
    margin: 26px 0 12px;
}

.ks-tkonto-kopf {
    grid-column: 1 / -1;
    padding: 0 0 8px;
    border-bottom: 2px solid var(--kh-ink);
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.ks-tkonto-seite {
    padding: 12px 18px 16px 0;
}

.ks-tkonto-seite + .ks-tkonto-seite {
    padding: 12px 0 16px 18px;
    border-left: 2px solid var(--kh-ink);
}

.ks-body .seo-body .ks-tkonto-label {
    margin: 0 0 8px;
    font-family: var(--kh-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ks-body .seo-body .ks-tkonto ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ks-body .seo-body .ks-tkonto li {
    padding: 6px 0;
    border-bottom: 1px solid var(--kh-border);
    color: var(--kh-ink);
    font-size: 0.98rem;
    line-height: 1.45;
}

.ks-body .seo-body .ks-tkonto li:last-child {
    border-bottom: 0;
}

.ks-body .seo-body .ks-saldo {
    max-width: 75ch;
    margin: 0 0 8px;
    padding-top: 8px;
    border-top: 3px double var(--kh-ink);
    color: var(--kh-ink);
    font-size: 0.98rem;
}

/* ------------------------------------------------------- Buchungsraster */

.ks-beispiel {
    max-width: 820px;
    margin: 30px 0 0;
}

.ks-beispiel h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.ks-beispiel > p {
    margin: 0 0 12px;
}

.ks-raster {
    width: 100%;
    border: 1px solid var(--kh-ink);
    border-collapse: collapse;
    background: var(--kh-card);
}

.ks-raster th {
    padding: 8px 12px;
    border-bottom: 1px solid var(--kh-ink);
    background: var(--kh-off-white);
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.ks-raster th:last-child,
.ks-raster td.ks-betrag {
    text-align: right;
}

.ks-raster td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--kh-border);
    color: var(--kh-ink);
    font-family: var(--kh-serif);
    font-size: 1rem;
    vertical-align: top;
}

.ks-raster tr:last-child td {
    border-bottom: 0;
}

.ks-raster td.ks-seite {
    width: 5.5em;
    font-family: var(--kh-mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.ks-raster td.ks-konto {
    font-family: var(--kh-mono);
    font-size: 0.9rem;
}

.ks-r-nr {
    white-space: nowrap;
}

.ks-raster td.ks-betrag {
    width: 8em;
    font-family: var(--kh-mono);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Die Zeile mit dem Konto dieser Seite: Klassenfarbe als Randstrich. */
.ks-raster tr.ks-zeile-dieses td {
    background: rgba(168, 116, 77, 0.09);
}

.ks-raster tr.ks-zeile-dieses td:first-child {
    border-left: 4px solid var(--ks-klasse, var(--kh-ink));
}

.ks-body .seo-body .ks-erklaerung {
    margin: 10px 0 0;
    font-size: 0.98rem;
}

/* ------------------------------------------------------- Kurz-Check */

/* Selektor so spezifisch wie .seo-body ol in seo-landing.css, sonst gewinnt
   dessen margin-left: 22px. */
.ks-body .seo-body .ks-check {
    max-width: 820px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--kh-ink);
}

.ks-frage {
    padding: 18px 0;
    border-bottom: 1px solid var(--kh-border);
}

.ks-body .seo-body .ks-frage-text {
    display: flex;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--kh-ink);
}

.ks-frage-nr {
    flex: 0 0 auto;
    color: var(--kh-terra);
    font-family: var(--kh-mono);
    font-weight: 500;
}

.ks-wahl {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ks-wahl button {
    min-width: 120px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid var(--kh-ink);
    border-radius: 0;
    background: var(--kh-paper-light);
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
}

.ks-wahl button:hover:not(:disabled) {
    background: var(--kh-off-white);
}

.ks-wahl button:focus-visible {
    outline: 2px solid var(--kh-ink);
    outline-offset: 2px;
}

.ks-wahl button:disabled {
    cursor: default;
}

.ks-wahl button.ist-richtig {
    border: 2px solid var(--feedback-correct-accent);
    background: var(--feedback-correct-bg);
    color: var(--feedback-correct-text);
}

.ks-wahl button.ist-falsch {
    border: 2px solid var(--feedback-wrong-accent);
    background: var(--feedback-wrong-bg);
    color: var(--feedback-wrong-text);
}

.ks-body .seo-body .ks-rueckmeldung {
    max-width: 70ch;
    margin: 12px 0 0;
    padding: 10px 0 0 14px;
    border-left: 3px solid var(--feedback-correct-accent);
    color: var(--feedback-correct-text);
    font-size: 0.98rem;
}

.ks-body .seo-body .ks-rueckmeldung.ist-falsch {
    border-left-color: var(--feedback-wrong-accent);
    color: var(--feedback-wrong-text);
}

.ks-rueckmeldung strong {
    font-family: var(--kh-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ks-body .seo-body .ks-check-stand {
    margin: 14px 0 0;
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.85rem;
}

.ks-body .seo-body .ks-check-stand:empty {
    display: none;
}

.ks-check-stand button {
    min-height: 44px;
    margin-left: 12px;
    padding: 0 14px;
    border: 1px solid var(--kh-ink);
    border-radius: 0;
    background: transparent;
    color: var(--kh-ink);
    font: inherit;
    cursor: pointer;
}

/* ------------------------------------------------------- Vergleich */

.ks-vergleich {
    max-width: 820px;
    border-top: 1px solid var(--kh-ink);
}

.ks-vergleich-zeile {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--kh-border);
}

.ks-body .seo-body .ks-vergleich-zeile p {
    margin: 0;
}

.ks-body .seo-body .ks-vergleich-konto {
    font-family: var(--kh-mono);
    font-size: 0.92rem;
}

/* ------------------------------------------------------- Weiterlernen */

.ks-weiter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
    max-width: 820px;
}

.ks-body .seo-body .ks-weiter-kopf {
    margin: 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--kh-ink);
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ks-body .seo-body .ks-weiter ul {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.ks-body .seo-body .ks-weiter li {
    border-bottom: 1px solid var(--kh-border);
}

.ks-weiter li a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 6px 0;
}

.ks-ueben {
    margin: 10px 0 0;
}

.ks-body .seo-body a.ks-knopf {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid var(--kh-ink);
    background: var(--kh-terra);
    color: var(--text-on-dark, #fff8e9);
    font-family: var(--kh-mono);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-decoration: none;
}

.ks-body .seo-body a.ks-knopf:hover {
    background: color-mix(in srgb, var(--kh-terra) 82%, var(--kh-ink));
}

/* ------------------------------------------------------- Klassenliste */

.ks-klasse {
    max-width: 820px;
    margin: 40px 0 0;
    border-top: 1px solid var(--kh-ink);
    border-bottom: 1px solid var(--kh-ink);
}

.ks-klasse summary {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 0;
    color: var(--kh-ink);
    font-family: var(--kh-mono);
    font-size: 0.88rem;
    cursor: pointer;
}

.ks-klasse summary {
    justify-content: space-between;
    gap: 16px;
    list-style: none;
}

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

.ks-klasse summary::after {
    content: "+";
    flex: 0 0 auto;
    width: 1.6em;
    color: var(--kh-terra);
    font-size: 1.3rem;
    line-height: 1;
    text-align: center;
}

.ks-klasse[open] summary::after {
    content: "−";
}

.ks-klasse summary:focus-visible {
    outline: 2px solid var(--kh-ink);
    outline-offset: 2px;
}

.ks-body .seo-body .ks-klasse-liste {
    columns: 2 22rem;
    column-gap: 40px;
    margin: 0;
    padding: 0 0 16px;
    list-style: none;
}

.ks-body .seo-body .ks-klasse-liste li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    break-inside: avoid;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

/* Ziel 44px hoch über das Polster; als Block, damit die Kontonummer daneben
   an der ersten Textzeile steht und nicht mittig neben langen Namen. */
.ks-klasse-liste li a {
    display: block;
    flex: 1 1 auto;
    min-height: 44px;
    padding: 11px 0;
    line-height: 1.45;
}

.ks-body .seo-body .ks-klasse-liste li[aria-current] {
    padding: 11px 0;
    color: var(--kh-ink);
    font-weight: 600;
}

.ks-nr {
    flex: 0 0 3.2em;
    color: var(--kh-ink-muted);
    font-family: var(--kh-mono);
    font-size: 0.85rem;
}

.ks-klasse-liste li[aria-current] .ks-nr {
    color: var(--kh-ink);
}

/* ------------------------------------------------------- Blättern */

.ks-blaettern {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 820px;
    margin: 0 0 20px;
    font-family: var(--kh-mono);
    font-size: 0.85rem;
}

.ks-blaettern a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 6px 0;
}

.ks-blaettern-nach {
    text-align: right;
}

.ks-body .seo-body .ks-quelle {
    max-width: 75ch;
    margin-top: 28px;
    color: var(--kh-ink-muted);
    font-size: 0.92rem;
}

/* ------------------------------------------------------- Handy */

@media (max-width: 760px) {
    .ks-steckbrief {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ks-steckbrief > div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .ks-steckbrief > div:nth-child(n + 3) {
        border-top: 1px solid var(--kh-border);
    }

    .ks-vergleich-zeile {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ks-weiter {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ks-pfad {
        padding: 12px 20px 0;
    }

    /* T-Konto bleibt zweispaltig — das T ist die Aussage. Nur enger, und
       die Etiketten nur „Soll“/„Haben“, damit beide Seiten auf einer Höhe
       beginnen. Zugang/Abgang steht im Steckbrief. */
    .ks-tkonto-seite {
        padding-right: 8px;
    }

    .ks-tkonto-seite + .ks-tkonto-seite {
        padding-left: 8px;
    }

    .ks-tk-zusatz {
        display: none;
    }

    .ks-body .seo-body .ks-tkonto li {
        font-size: 0.92rem;
        hyphens: auto;
    }

    /* Konto-Spalte: Nummer in eigener Zeile, darunter der Name in voller
       Spaltenbreite — so muss kein Kontoname mitten im Wort getrennt werden. */
    .ks-raster th,
    .ks-raster td {
        padding: 8px 6px;
    }

    .ks-raster td.ks-seite {
        width: 4.2em;
        font-size: 0.78rem;
    }

    /* Festes Tabellenlayout: Lange Einzelwörter („Verbindlichkeiten“) dürfen
       die Tabelle nicht über den Kartenrand drücken. Seite und Betrag haben
       feste Breiten, der Name bricht notfalls mit Trennstrich (lang="de"). */
    .ks-raster {
        table-layout: fixed;
    }

    .ks-raster th:first-child {
        width: 4.2em;
    }

    .ks-raster th:last-child {
        width: 7.4em; /* fünfstellige Beträge (42.000,00) mit Luft, 04.12.2026 */
    }

    .ks-raster td.ks-konto {
        font-size: 0.85rem;
    }

    .ks-r-name {
        hyphens: auto;
        overflow-wrap: break-word;
    }

    .ks-r-nr {
        display: block;
    }

    .ks-raster td.ks-betrag {
        width: auto;
        font-size: 0.85rem;
    }

    .ks-wahl button {
        flex: 1 1 0;
        min-width: 0;
    }

    .ks-blaettern {
        flex-direction: column;
        gap: 0;
    }

    .ks-blaettern-vor,
    .ks-blaettern-nach {
        display: flex;
    }

    .ks-blaettern-nach {
        text-align: left;
    }
}

/* Volle Breite (seit 02.12.2026): Text und Bausteine nutzen die ganze
   Breite des Seitenrahmens bzw. des Hero, statt auf 72ch/75ch/820px
   begrenzt zu sein. Steht am Ende, damit es die Begrenzungen oben und aus
   knowledge-hb.css / seo-landing.css überschreibt. */
.ks-body .seo-hero .seo-lead,
.ks-body .seo-hero h1,
.ks-body .seo-body h2,
.ks-body .seo-body > p,
.ks-body .seo-body > ul,
.ks-body .seo-body > ol,
.ks-body .seo-body .article-definition,
.ks-body .seo-body .ks-saldo,
.ks-body .seo-body .ks-erklaerung,
.ks-body .seo-body .ks-rueckmeldung,
.ks-body .seo-body .ks-quelle,
.ks-body .ks-tkonto,
.ks-body .ks-beispiel,
.ks-body .seo-body .ks-check,
.ks-body .ks-vergleich,
.ks-body .ks-weiter,
.ks-body .ks-klasse,
.ks-body .ks-blaettern {
    max-width: none;
}
