/* Kassabuch — Gestaltung siehe DESIGN.md §8. Keine Inline-Styles (CSP). */
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 400; font-display: swap; src: url('fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 600; font-display: swap; src: url('fonts/schibsted-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 700; font-display: swap; src: url('fonts/schibsted-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }

:root {
  --paper: #F3F1EA;
  --sheet: #FBFAF6;
  --tab: #E6E2D7;
  --ink: #141412;
  --mute: #5C5A54;
  --hair: #CBC6B8;
  --rule: #E4E0D4;
  --red: #C2200F;
  --stamp: #24467A;
  --sans: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.45 var(--sans); }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

.m { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.k { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.k.rule { display: block; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.muted { color: var(--mute); }
.small { font-size: 14px; }
.lead { font-size: 19px; }

/* Rahmen: Register links, Blatt rechts; auf schmalen Bildschirmen Register oben */
.app { display: flex; flex-direction: row; flex-wrap: wrap; min-height: 100vh; }
.sheet { flex: 999 1 640px; min-width: 0; background: var(--sheet); border-left: 1px solid var(--hair); padding: 24px 40px 48px; }
.reg { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; padding: 84px 0 24px; }
.reg > a, .reg > .off { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; margin-left: 16px; background: var(--tab); border: 1px solid var(--hair); border-right: 0; text-decoration: none; font-size: 17px; }
.reg b { font: 500 12px var(--mono); color: var(--mute); }
.reg > a.on { background: var(--sheet); font-weight: 700; margin-left: 0; margin-right: -1px; }
.reg > a.on b { color: var(--red); }
.reg > .off { color: var(--mute); background: transparent; border-style: dashed; flex-wrap: wrap; }
.reg > .off small { flex-basis: 100%; font-size: 13px; padding-left: 22px; }
.me { margin-top: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--mute); }
.me form { margin: 0; }

@media (max-width: 860px) {
  .reg { flex-direction: row; flex-wrap: wrap; padding: 12px 12px 0; gap: 4px; }
  .reg > a, .reg > .off { margin: 0; border-right: 1px solid var(--hair); padding: 10px 12px; font-size: 16px; }
  .reg > a.on { margin: 0; }
  .me { margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 6px; width: 100%; }
  .sheet { padding: 18px 16px 40px; border-left: 0; }
}

.mast { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font: 500 13px var(--mono); color: var(--mute); padding-bottom: 10px; border-bottom: 3px solid var(--ink); }
.ttl { display: flex; align-items: baseline; gap: 16px; margin: 26px 0 24px; flex-wrap: wrap; }
.ttl > span { font: 500 15px var(--mono); color: var(--red); }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.h2 { font-size: 28px; letter-spacing: -.01em; margin: 0; }

/* Knöpfe: Hauptaktion schwarz, Nebenaktion unterstrichen */
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 0 22px; background: var(--ink); color: var(--sheet); font: 600 18px var(--sans); border: 0; border-radius: 0; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--red); color: var(--sheet); }
.btn.wide { width: 100%; min-height: 58px; }
.ghost { background: none; border: 0; padding: 4px 0; min-height: 44px; font: 600 16px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.ghost:hover, .ghost.danger { color: var(--red); }

/* Formulare: Linie statt Kasten */
.stack { display: flex; flex-direction: column; gap: 24px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f label { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.f input, .f select, .linkbox input { font: 400 20px var(--sans); min-height: 50px; padding: 0 2px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); width: 100%; }
.f select { appearance: none; cursor: pointer; padding-right: 28px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23141412' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 4px center; }
.alert { margin: 0; padding: 12px 14px; border-left: 4px solid var(--red); color: var(--red); font-weight: 600; background: #fff; }
.ok { margin: 0 0 16px; padding: 12px 14px; border-left: 4px solid var(--stamp); color: var(--stamp); font-weight: 600; background: #fff; }
.narrow-form { max-width: 460px; }

/* Anmeldung */
.split { min-height: 100vh; display: flex; flex-wrap: wrap; }
.cover { flex: 1 1 420px; background: var(--sheet) repeating-linear-gradient(to bottom, transparent 0 47px, var(--rule) 47px 48px); border-right: 1px solid var(--hair); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.cover-kicker { font: 500 15px var(--mono); color: var(--red); margin-bottom: 12px; }
.cover-title { font-size: clamp(56px, 9vw, 92px); font-weight: 700; letter-spacing: -.04em; line-height: .95; }
.cover-rule { width: 220px; border-bottom: 4px double var(--ink); margin-top: 18px; }
.cover-form { flex: 1 1 380px; padding: 40px; display: flex; align-items: center; }
.cover-form form { width: 100%; max-width: 400px; }
.narrow { max-width: 560px; margin: 80px auto; padding: 0 16px; }

/* Übersicht */
.cols { display: flex; flex-wrap: wrap; gap: 48px; }
.col { flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; }
.col.wide { flex: 1.3 1 360px; }
.big { display: flex; align-items: baseline; gap: 12px; border-bottom: 4px double var(--ink); padding-bottom: 8px; }
.big .cur { font-size: 18px; color: var(--mute); }
.big .num.red { color: var(--red); }
.big.done .num { color: var(--mute); }
a.ln-link { color: var(--ink); text-decoration: none; grid-template-columns: minmax(0, 1fr) auto; }
a.ln-link:hover { background: var(--paper); }
a.ln-link:hover > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.ln-link .go { font-family: var(--sans); font-weight: 600; margin-left: 6px; }
.big .num { font-size: 54px; font-weight: 600; letter-spacing: -.03em; }
.ledger { margin-top: 26px; }
.ln { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.ln .m { text-align: right; }
.ln.total { border-bottom: 3px double var(--ink); font-weight: 700; }
.todo { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 18px; }
.todo .n { font: 600 26px var(--mono); color: var(--red); }
.todo-none { padding: 16px 0; color: var(--mute); }

/* Tabellen im Kassabuch-Stil */
.tbl { overflow-x: auto; }
.led { width: 100%; border-collapse: collapse; font-size: 17px; }
.led th { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); text-align: left; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
.led td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.led tr.inactive td { color: var(--mute); }
.led .actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.led .actions > a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 16px; text-underline-offset: 4px; }
.led .actions form { margin: 0; }
.stamp { display: inline-block; border: 1.5px solid var(--stamp); color: var(--stamp); font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; transform: rotate(-2deg); }

.linkbox { margin: 0 0 28px; padding: 18px 20px; background: #fff; border: 1.5px solid var(--stamp); }
.linkbox p { margin: 6px 0 10px; }
.linkbox input { font: 400 15px var(--mono); }
.invite { margin-top: 40px; max-width: 820px; display: flex; flex-direction: column; gap: 18px; }
.invite-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 20px; align-items: end; }
@media (max-width: 700px) { .invite-row { grid-template-columns: 1fr; } }

/* Kopfzeile: Jahreswahl, Meldungen */
.years { display: inline-flex; gap: 10px; align-items: baseline; }
.years a { color: var(--mute); }
.years b { color: var(--ink); }
.flash { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 16px 0 0; padding: 8px 14px; border-left: 4px solid var(--stamp); background: #fff; color: var(--stamp); font-weight: 600; }
.flash form { margin: 0; }
.flash .ghost { color: var(--ink); }
.hint { margin: 0; font-size: 15px; color: var(--mute); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.red { color: var(--red); }
.flag { display: inline-block; font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
.flag::before { content: '■ '; }
.back { margin: 22px 0 0; }
.back a { font: 500 14px var(--mono); }
.ttl-act { margin-left: auto; }
a.todo { color: var(--ink); text-decoration: none; }
a.todo:hover { background: var(--paper); }
.todo .go { font: 600 20px var(--sans); }

/* Buchungsliste */
.filter { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; border-bottom: 1.5px solid var(--ink); }
.filter a { padding: 12px 16px; text-decoration: none; font-size: 17px; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1.5px; }
.filter a.on { border-color: var(--ink); border-bottom: 1.5px solid var(--sheet); background: var(--sheet); font-weight: 700; }
.filter .m { font-size: 14px; color: var(--mute); margin-left: 4px; }
.filter .m.red { color: var(--red); }
.led th.num, .led td.num { text-align: right; white-space: nowrap; }
.bookings td:nth-child(2) { white-space: nowrap; }
.bookings td a { text-decoration: none; font-weight: 600; }
.bookings td a:hover { text-decoration: underline; }
.sub { display: block; font-size: 15px; color: var(--mute); }
.sub-inline { font-size: 15px; color: var(--mute); }
.led tr.cancelled td { color: var(--mute); text-decoration: line-through; }
.led tfoot td { border-bottom: 3px double var(--ink); border-top: 1.5px solid var(--ink); font-weight: 700; }

/* Eine Buchung */
/* Ebene 1: was passiert ist (fix) – graue Karte wie ein Beleg auf dem Blatt */
.tx-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px; margin: 14px 0 6px; padding: 18px 22px 20px; background: var(--tab); border: 1px solid var(--hair); }
.tx-head p { margin: 4px 0 0; }
.tx-title { font-size: 28px; margin-top: 6px; }
.tx-amount { font-size: 36px; font-weight: 600; letter-spacing: -.02em; border-bottom: 4px double var(--ink); }
.struck { text-decoration: line-through; color: var(--mute); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-bottom: 18px; }
.banner form { margin: 0; }
.tx-form { margin: 0; }
.row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: center; min-height: 60px; border-bottom: 1px solid var(--rule); }
.row.top { align-items: start; padding-top: 14px; padding-bottom: 10px; }
.row > label:first-child, .row .l { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.in { font: 400 19px var(--sans); min-height: 46px; padding: 0 2px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); width: 100%; }
.in.m { font-family: var(--mono); }
textarea.in { padding: 8px 2px; resize: vertical; min-height: 80px; line-height: 1.4; }
.amount-in { max-width: 220px; text-align: right; }
.pre { white-space: pre-wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; font-weight: 600; }
.seg label + label span { border-left: 1.5px solid var(--ink); }
.seg input:checked + span { background: var(--ink); color: var(--sheet); }
.seg input:focus-visible + span { outline: 3px solid var(--stamp); outline-offset: 2px; }

.tx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 28px; }
.storno { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 34px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
.hist { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.hist li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.hist .m { color: var(--mute); font-size: 13px; margin-right: 6px; }

/* Abschluss */
.report .gap { margin-top: 30px; }
.report .code { display: inline-block; width: 58px; text-align: left; color: var(--mute); font-size: 14px; }
.stack > .ghost { align-self: flex-start; }
.with-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ln.sum { border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 700; }
.ln.grp-ln { font-weight: 600; }
.ln.sub-ln { font-size: 15px; color: var(--mute); padding: 5px 0 5px 18px; }
.ln.red { color: var(--red); }
.checks { list-style: none; margin: 0 0 16px; padding: 0; }
.checks li { padding: 12px 0 12px 30px; border-bottom: 1px solid var(--rule); position: relative; }
.checks li::before { position: absolute; left: 0; font: 600 18px var(--mono); }
.checks li.pass::before { content: '✓'; color: var(--stamp); }
.checks li.fail::before { content: '■'; color: var(--red); }
.checks li.fail a { color: var(--red); font-weight: 600; }
.big-stamp { font-size: 13px; padding: 5px 10px; }
.saldo-form { margin-top: 36px; }

@media (max-width: 700px) {
  .row { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
  .ttl-act { margin-left: 0; }
  .tx-title { font-size: 26px; }
  .tx-amount { font-size: 32px; }
  .bookings th:nth-child(1), .bookings td:nth-child(1) { display: none; }
}

/* Belege */
.docs { list-style: none; margin: 0 0 10px; padding: 0; }
.docs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.docs form { margin: 0; }
.doc-link { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.doc-link:hover .doc-name { text-decoration: underline; }
.doc-pdf { flex: none; display: flex; align-items: flex-end; justify-content: center; width: 44px; height: 58px; padding-bottom: 6px; background: #fff; border: 1px solid var(--hair); box-shadow: 3px 3px 0 var(--rule); font: 600 11px var(--mono); color: var(--red); }
.doc-thumb { flex: none; width: 44px; height: 58px; object-fit: cover; border: 1px solid var(--hair); box-shadow: 3px 3px 0 var(--rule); background: #fff; }
.doc-name { min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.doc-name .m { display: block; font-size: 12px; font-weight: 400; color: var(--mute); }
.small-ghost { font-size: 14px; min-height: 36px; }
.upload { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 22px; }
.upload input[type=file] { font: 400 15px var(--sans); max-width: 100%; }
.upload input[type=file]::file-selector-button { font: 600 15px var(--sans); background: var(--sheet); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 0; padding: 10px 14px; margin-right: 10px; cursor: pointer; }
.upload .btn { align-self: flex-start; min-height: 48px; }
.clip { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stamp); border: 1px solid var(--stamp); padding: 1px 5px; white-space: nowrap; }

/* Wohnungen, Akonto-Raten, Regeln */
.block { margin-bottom: 44px; }
.block > .k.rule { margin-bottom: 8px; }
.ttl-link { margin-left: auto; font: 500 14px var(--mono); }
.ttl-link + .ttl-act { margin-left: 0; }
.matrix th.num { white-space: nowrap; }
.th-sub { display: block; font-size: 11px; letter-spacing: .02em; text-transform: none; }
.matrix td.num { white-space: nowrap; }
.matrix .stamp { margin-left: 6px; }
.matrix tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); font-weight: 600; font-size: 15px; }
.matrix tfoot tr:last-child td { border-bottom: 3px double var(--ink); }
.iban { display: block; white-space: nowrap; }
.narrow-table { max-width: 560px; }
.tranche-form { display: grid; grid-template-columns: 110px 80px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-top: 22px; max-width: 900px; }
.f textarea { font: 400 18px var(--mono); padding: 8px 2px; border: 0; border-bottom: 2px solid var(--ink); background: transparent; resize: vertical; }
.row select.in { appearance: none; cursor: pointer; padding-right: 28px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23141412' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 4px center; }
.rule-field { display: flex; flex-direction: column; gap: 4px; }
.rules-apply { margin-top: 28px; max-width: 640px; }
.rules-apply .btn { align-self: flex-start; }
@media (max-width: 860px) {
  .tranche-form { grid-template-columns: 1fr 1fr; }
  .tranche-form .btn { grid-column: 1 / -1; justify-self: start; }
}
.pdf-box { display: flex; flex-direction: column; gap: 10px; margin-top: 36px; }
.backup-box { margin-top: 48px; max-width: 820px; }
.backup-box p { margin: 10px 0; }

/* Buchung zuweisen: eine Frage, passende Konten als Liste, Felder nur bei Bedarf */
.tx-page { max-width: 880px; }
.tx-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; }
.progress { margin: 22px 0 0; font-size: 13px; color: var(--mute); }
/* Ebene 2: was zu tun ist – kräftig auf dem hellen Blatt */
.assign { border: 0; margin: 34px 0 8px; padding: 0; min-width: 0; }
.q { font-size: 26px; font-weight: 700; letter-spacing: -.01em; padding: 0; margin-bottom: 16px; }
.sugg { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; padding: 14px 16px; margin-bottom: 22px; border: 1.5px solid var(--stamp); background: #fff; cursor: pointer; }
.sugg .k { grid-row: span 2; color: var(--stamp); }
.sugg-name { font-size: 19px; font-weight: 700; }
.sugg-why { font-size: 15px; color: var(--mute); }
.kgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px 36px; }
.kgrp { display: flex; flex-direction: column; min-width: 0; }
.kgrp > .k.rule { margin-bottom: 2px; }
.acct { position: relative; display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 10px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.acct input { position: absolute; opacity: 0; pointer-events: none; }
.acct .dot { flex: none; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; }
.acct-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.acct-code { margin-left: auto; font-size: 12px; color: var(--mute); }
.acct:hover { background: var(--paper); }
.acct:has(input:checked) { background: var(--ink); color: var(--sheet); }
.acct:has(input:checked) .dot { border-color: var(--sheet); background: radial-gradient(circle, var(--sheet) 0 4px, transparent 5px); }
.acct:has(input:checked) .acct-code { color: var(--sheet); }
.acct:has(input:focus-visible) { outline: 3px solid var(--stamp); outline-offset: -3px; }
.acct-none .acct-name { font-weight: 400; color: var(--mute); }
.acct-none:has(input:checked) .acct-name { color: var(--sheet); }
/* Erfassen von Hand: nur die Gruppen zur gewählten Art */
.tx-form:has(input[name=art][value=ausgabe]:checked) .by-art .kgrp[data-art=einnahme],
.tx-form:has(input[name=art][value=einnahme]:checked) .by-art .kgrp[data-art=ausgabe] { display: none; }

details.more { margin: 14px 0 0; }
details.more > summary { display: flex; align-items: baseline; gap: 10px; min-height: 44px; padding-top: 10px; cursor: pointer; font-weight: 600; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '+'; flex: none; width: 18px; font: 600 20px/1 var(--mono); }
details.more[open] > summary::before { content: '−'; }
details.more > summary > span { text-decoration: underline; text-underline-offset: 4px; }
details.more > summary:hover > span { color: var(--red); }
details.more > .kgroups { margin-top: 8px; }
details.sect { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 4px; }
/* Ebene 3: Zusätzliches – kleiner und grau */
.rule-check { margin-top: 18px; font-size: 16px; color: var(--mute); }
.tx-form > details.more > summary, details.sect > summary { font-weight: 500; font-size: 16px; color: var(--mute); }
.tx-form > details.more > summary > span, details.sect > summary > span { text-decoration-color: var(--hair); }
.tx-form > details.more[open] > summary, details.sect[open] > summary { color: var(--ink); }
.assign details.more > summary { font-size: 16px; color: var(--mute); font-weight: 500; }

.grundgebuehr-row, .partei-row, .tranche-row, .tranche-row-hint { display: none; }
.tx-form:has(input[name=konto][data-grundgebuehr]:checked) .grundgebuehr-row,
.tx-form:has(input[name=konto][data-einnahme]:checked) .partei-row,
.tx-form:has(input[name=konto][data-tranche]:checked) .tranche-row { display: grid; }
.tx-form:has(input[name=konto][data-tranche]:checked) .tranche-row-hint { display: block; margin-top: 6px; }
.ro-list { margin-top: 20px; }
@media (max-width: 700px) { .q { font-size: 22px; } }

/* Buchungsliste «Zu erledigen»: Konto direkt zuweisen */
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--stamp); background: #fff; }
.bulk .ghost { color: var(--stamp); }
.todo-list .konto-cell { min-width: 300px; }
.inline-assign { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.inline-assign select { flex: 1 1 200px; min-width: 0; min-height: 44px; font: 400 16px var(--sans); color: var(--ink); background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23141412' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center; border: 1.5px solid var(--ink); border-radius: 0; padding: 0 30px 0 10px; appearance: none; cursor: pointer; }
.inline-assign select.has-sugg { border-color: var(--stamp); }
.ok-btn { flex: none; width: 44px; height: 44px; border: 0; background: var(--ink); color: var(--sheet); font: 700 18px var(--sans); cursor: pointer; }
.ok-btn:hover { background: var(--red); }
.sugg-hint { flex-basis: 100%; font-size: 13px; color: var(--stamp); }
.assign-link { text-decoration: none; font-size: 15px; color: var(--mute); }
.assign-link b { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }
.open-note { display: block; margin-top: 4px; font-size: 14px; color: var(--mute); text-decoration: none; }
.open-note:hover { color: var(--red); }
@media (max-width: 700px) {
  /* Buchungsliste als Karten: Datum und Betrag oben, darunter Text und Konto */
  .bookings thead { display: none; }
  .bookings, .bookings tbody, .bookings tfoot { display: block; }
  .bookings tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .bookings td { display: block; padding: 0; border: 0; }
  .bookings td:nth-child(2) { grid-row: 1; grid-column: 1; color: var(--mute); font-size: 14px; }
  .bookings td:nth-child(5) { grid-row: 1; grid-column: 2; }
  .bookings td:nth-child(3), .bookings td:nth-child(4) { grid-column: 1 / -1; }
  .bookings td:nth-child(4):not(:empty) { margin-top: 6px; }
  .todo-list .konto-cell { min-width: 0; }
  .bookings tfoot tr { border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); }
  .bookings tfoot td { border: 0; }
  .bookings tfoot td:first-child { display: block; grid-row: 1; grid-column: 1; color: var(--ink); font-size: 16px; }
  .bookings tfoot td:last-child { grid-row: 1; grid-column: 2; color: var(--ink); font-size: 17px; }
}

/* Wohnungen: Zusammenfassung, eine Zeile pro Wohnung */
.party-head { margin-bottom: 30px; }
.tr-list .ln { font-size: 16px; }
.tr-manage { margin: 10px 0 0; font-size: 15px; }
.parties th.tc, .parties td.tc { text-align: center; white-space: nowrap; }
.parties tbody tr { position: relative; }
.parties tbody tr:hover { background: var(--paper); }
.row-link { text-decoration: none; }
.row-link::after { content: ''; position: absolute; inset: 0; }
.parties tbody tr:hover .row-link b { text-decoration: underline; text-underline-offset: 3px; }
.go-cell { width: 30px; text-align: right; font-weight: 600; }
.ok-mark { color: var(--stamp); font-weight: 700; font-size: 18px; }
.flag-plain { color: var(--red); font-size: 14px; white-space: nowrap; }
.plain-list { list-style: none; margin: 6px 0 0; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.party-pay { margin-top: 26px; }

/* Akonto-Raten verwalten */
.tr-edit { margin: 10px 0 30px; border-top: 1.5px solid var(--ink); }
.tr-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 250px; gap: 10px 24px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.tr-label { font-size: 18px; font-weight: 600; padding-bottom: 14px; }
.tr-form { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 200px) auto; gap: 16px; align-items: end; margin: 0; }
.tr-remove { padding-bottom: 8px; text-align: right; }
.tr-remove form { margin: 0; }
.tf-title { grid-column: 1 / -1; }

@media (max-width: 700px) {
  /* Wohnungen als Karten: Name oben, Akonto-Raten als kleine Felder */
  .parties thead { display: none; }
  .parties, .parties tbody { display: block; }
  .parties tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .parties td { display: block; padding: 0; border: 0; }
  .parties td:first-child { flex-basis: 100%; }
  .parties td.tc::before { content: attr(data-label) ' '; font: 500 12px var(--mono); color: var(--mute); }
  .parties .go-cell { display: none; }
  .tr-row { grid-template-columns: 1fr; }
  .tr-form { grid-template-columns: 1fr 1fr; }
  .tr-form .ghost { grid-column: 1 / -1; justify-self: start; }
  .tr-remove { text-align: left; }
}
@media (max-width: 700px) {
  /* Zahlungen einer Akonto-Rate als Karten */
  .pay-list thead { display: none; }
  .pay-list, .pay-list tbody, .pay-list tfoot { display: block; }
  .pay-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .pay-list td { display: block; padding: 0; border: 0; }
  .pay-list td:nth-child(1) { grid-row: 1; grid-column: 1; color: var(--mute); font-size: 14px; }
  .pay-list td:nth-child(4) { grid-row: 1; grid-column: 2; }
  .pay-list td:nth-child(2), .pay-list td:nth-child(3) { grid-column: 1 / -1; }
  .pay-list td:nth-child(5) { grid-column: 1 / -1; }
  .pay-list td:nth-child(5) .actions { justify-content: flex-start; }
  .pay-list tfoot tr { border-top: 1.5px solid var(--ink); border-bottom: 3px double var(--ink); }
  .pay-list tfoot td { border: 0; }
  .pay-list tfoot td:first-child { grid-row: 1; grid-column: 1; font-size: 16px; }
  .pay-list tfoot td:nth-child(2) { grid-row: 1; grid-column: 2; color: var(--ink); font-size: 17px; }
  .pay-list tfoot td:last-child { display: none; }
}
.ok-mark.carried { opacity: .55; }
.verteilung { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; }
.vt .m { font-weight: 600; margin-right: 4px; }
.credit { font: 600 12px var(--mono); color: var(--stamp); white-space: nowrap; }

/* Hilfe: aufklappbar unter dem Seitentitel (details, kein JS) */
details.hilfe { margin: 4px 0 22px; background: #fff; border-left: 4px solid var(--stamp); }
details.hilfe > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; cursor: pointer; list-style: none; color: var(--stamp); font-weight: 600; font-size: 17px; }
details.hilfe > summary::-webkit-details-marker { display: none; }
details.hilfe > summary:hover .t { text-decoration: underline; text-underline-offset: 4px; }
details.hilfe .q { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1.5px solid var(--stamp); border-radius: 50%; font: 600 15px var(--mono); }
details.hilfe[open] > summary { border-bottom: 1px solid var(--rule); }
.hilfe-body { padding: 12px 18px 16px 52px; font-size: 17px; max-width: 70ch; }
.hilfe-body p { margin: 0 0 10px; }
.hilfe-body ul, .hilfe-body ol { margin: 0 0 10px; padding-left: 22px; }
.hilfe-body li { margin-bottom: 6px; }
.hilfe-body dt { font-weight: 700; margin-top: 8px; }
.hilfe-body dd { margin: 0 0 4px; }
@media (max-width: 700px) { .hilfe-body { padding-left: 18px; } }

/* Erste Schritte auf der Übersicht */
.start { margin: 0 0 28px; padding: 18px 20px; background: #fff; border: 1.5px solid var(--stamp); }
.start ol { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.start li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.start li::before { content: counter(s); font: 600 18px var(--mono); color: var(--mute); }
.start li.done::before { content: '✓'; color: var(--stamp); }
.start li.done { color: var(--mute); }
.start li.next { font-weight: 600; }
.start li.next::before { color: var(--red); }
.start .why { display: block; font-weight: 400; font-size: 15px; color: var(--mute); }
.start .go { font-weight: 600; white-space: nowrap; }

/* Ersteinrichtung: nur die Schritte, kein Register */
.solo .sheet { border-left: 0; max-width: 860px; margin: 0 auto; width: 100%; }
.solo .ttl > span:first-child { display: none; }
.setup { margin: 22px 0 8px; padding: 16px 20px; background: #fff; border: 1.5px solid var(--stamp); }
.setup ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; counter-reset: st; }
.setup li { counter-increment: st; display: flex; gap: 10px; align-items: baseline; color: var(--mute); }
.setup li::before { content: counter(st); font: 600 18px var(--mono); }
.setup li.done::before { content: '✓'; color: var(--stamp); }
.setup li.next { color: var(--ink); font-weight: 700; }
.setup li.next::before { color: var(--red); }
.setup li a { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.setup li a:hover span { text-decoration: underline; }
.setup small { font-weight: 400; font-size: 14px; color: var(--mute); }
.setup-out { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: baseline; font-size: 14px; color: var(--mute); }
.setup-next { margin: 16px 0 0; }
.edit-names input[type=text] { font: 400 18px var(--sans); min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); width: 100%; }
/* zwei Eingabespalten gleich breit */
.edit-names input.bold { font-weight: 700; }
.edit-names .go-cell a { text-decoration: none; padding: 10px; }
.edit-names-act { margin: 20px 0 0; }
