/* Rechnungswerk – Gestaltung. Baut auf bootstrap.min.css auf und überschreibt gezielt dessen Variablen. */
:root {
  --paper: #f3f5f1;        /* Arbeitsfläche */
  --sheet: #ffffff;        /* Blätter, Tabellen, Formulare */
  --ink: #1b2a2f;          /* Text */
  --slate: #55645f;        /* Nebentext (4.9:1 auf Papier) */
  --line: #dbe1db;         /* Linien */
  --line-strong: #b9c3bb;
  --green: #0f5c4d;        /* Werkgrün: Primäraktionen, Verweise */
  --green-dark: #0a4438;
  --green-tint: #e4efe9;
  --pine: #14302a;         /* Seitenleiste */
  --red: #a8322b;
  --red-tint: #fbeceb;
  --amber: #8a5a08;
  --amber-tint: #fbf1da;
  --radius: 6px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --side: 248px;

  --bs-body-font-family: var(--sans);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-primary: var(--green);
  --bs-link-color: var(--green);
  --bs-link-color-rgb: 15, 92, 77;
  --bs-link-hover-color: var(--green-dark);
  --bs-link-hover-color-rgb: 10, 68, 56;
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius);
}

html { scroll-padding-top: 16px; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 14px; }
h3 { font-size: 15px; font-weight: 650; margin: 18px 0 6px; }
p { margin: 0 0 10px; }
a { text-underline-offset: 2px; }
code { color: var(--ink); background: var(--paper); padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 10px 0 0; max-height: 320px; overflow: auto; }
.muted { color: var(--slate); }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; font-size: 12.5px; color: var(--slate); max-width: 340px; }
.clamp { max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loading { color: var(--slate); padding: 40px 0; }

:focus-visible { outline: 3px solid #2f9c84; outline-offset: 2px; }
#content:focus { outline: none; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--sheet); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { left: 8px; }

/* ── Wortmarke ── */
.wordmark { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.01em; color: var(--green); text-decoration: none; margin: 0; }

/* ── Seitenleiste ── */
aside { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--pine); color: #e6efe9; display: flex; flex-direction: column; overflow-y: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 22px 18px; }
aside .wordmark, aside .wordmark:hover { color: #fff; }
.menu-toggle { display: none; background: none; border: 1px solid #ffffff55; color: #fff; border-radius: var(--radius); padding: 6px 12px; font-size: 14px; }
.side-nav { display: flex; flex-direction: column; flex: 1; padding: 0 12px 18px; }
.nav-label { color: #9db5aa; font-size: 12.5px; margin: 22px 10px 6px; }
aside nav a { display: block; padding: 8px 10px; margin: 1px 0; border-radius: var(--radius); color: #d5e2db; text-decoration: none; font-size: 14.5px; border-left: 3px solid transparent; }
aside nav a:hover { background: #ffffff12; color: #fff; }
aside nav a.active { background: #ffffff1c; color: #fff; border-left-color: #7fd0b7; font-weight: 600; }
.account { margin-top: auto; padding: 22px 10px 4px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.account-role { color: #9db5aa; margin-bottom: 8px; }
.btn-side { align-self: flex-start; color: #fff; border: 1px solid #ffffff55; background: none; }
.btn-side:hover { background: #ffffff1c; color: #fff; border-color: #fff; }

/* ── Arbeitsfläche ── */
.workspace { margin-left: var(--side); padding: 34px 40px 60px; max-width: calc(var(--side) + 1240px); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .muted { margin: 8px 0 0; max-width: 68ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel > .actions, form > .actions, #modal-content .actions { margin-top: 18px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line-strong); padding: 12px 0; margin-top: 0; z-index: 2; }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel > p:last-child { margin-bottom: 0; }

/* ── Meldungen ── */
#notice { position: sticky; top: 12px; z-index: 5; }
.notice.with-close { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.notice { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; background: var(--green-tint); border: 1px solid #b7d6c9; color: #0c3f35; }
.notice.error { background: var(--red-tint); border-color: #e6b8b4; color: #7c211c; }
.notice a { color: inherit; font-weight: 600; }
.notice-close { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; padding: 0 2px; }

/* ── Schaltflächen ── */
.btn { font-size: 14.5px; padding: 8px 14px; border-radius: var(--radius); font-weight: 550; }
.btn-sm { padding: 4px 10px; font-size: 13.5px; }
.btn-primary { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark); --bs-btn-active-bg: var(--green-dark); --bs-btn-active-border-color: var(--green-dark); --bs-btn-disabled-bg: var(--green); --bs-btn-disabled-border-color: var(--green); }
.btn-accent { background: var(--sheet); color: var(--green); border: 1.5px solid var(--green); }
.btn-accent:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-light { --bs-btn-bg: var(--sheet); --bs-btn-border-color: var(--line-strong); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--paper); --bs-btn-hover-border-color: var(--slate); --bs-btn-active-bg: var(--line); --bs-btn-disabled-bg: var(--sheet); --bs-btn-disabled-border-color: var(--line); }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: #8a2722; --bs-btn-hover-border-color: #8a2722; }
.btn-link { padding-left: 4px; padding-right: 4px; }
.btn-link.danger { color: var(--red); margin-left: auto; }
.btn-plain { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 2px; }

/* ── Stempel (Status) ── */
.stamp { display: inline-block; font-size: 12.5px; font-weight: 650; line-height: 1.3; padding: 2px 8px; border: 1.5px solid currentColor; border-radius: 3px; white-space: nowrap; letter-spacing: .01em; }
.stamp.ok { color: #0f6a4c; background: #e7f4ee; }
.stamp.warn { color: var(--amber); background: var(--amber-tint); }
.stamp.bad { color: var(--red); background: var(--red-tint); }
.stamp.neutral { color: var(--slate); background: var(--paper); }

/* ── Tabellen ── */
.table.ledger { --bs-table-bg: transparent; color: var(--ink); font-size: 14.5px; margin: 0; }
.ledger thead th { font-size: 13px; font-weight: 600; color: var(--slate); border-bottom: 1.5px solid var(--ink); padding: 8px 10px; white-space: nowrap; background: none; }
.ledger td { padding: 12px 10px; vertical-align: top; border-color: var(--line); }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: #f8faf7; }
.ledger.compact td { padding: 6px 10px; }
.ledger .muted { font-size: 13px; }
.row-link { font-weight: 650; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 340px; margin: 0; }
.pager { display: flex; gap: 14px; align-items: center; margin: 16px 0 0; font-size: 14px; color: var(--slate); }
.empty { text-align: center; padding: 38px 16px; color: var(--slate); }
.empty-title { font-size: 17px; font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }

/* ── Kennzahlen der Übersicht: eine Zeile wie im Kontoblatt, keine Kartenreihe ── */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 18px; }
.figures > div { padding: 18px 22px; border-left: 1px solid var(--line); }
.figures > div:first-child { border-left: 0; }
.figures dt { font-size: 13.5px; font-weight: 500; color: var(--slate); }
.figures dd { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 2px 0 2px; line-height: 1.2; }
.figures p { margin: 0; font-size: 13px; }
.figures .alert-figure dd { color: var(--red); }

.facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; }
.facts dt { font-size: 13px; font-weight: 500; color: var(--slate); }
.facts dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts + .grid3 { margin-top: 18px; }
.mail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; }
.mail-facts dd { font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
@media (max-width: 860px) { .mail-facts { grid-template-columns: 1fr; } }

/* ── Schritte ── */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 18px 44px; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--slate); display: grid; place-items: center; font-size: 13.5px; font-weight: 650; background: var(--sheet); }
.steps > li::after { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1.5px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.steps h3 { margin: 2px 0 6px; }
.steps p { margin-bottom: 6px; }
.steps.flow > li { padding-bottom: 24px; }
.steps .actions { margin-top: 8px; }
.steps details { margin-top: 8px; font-size: 14px; }
.steps summary { color: var(--green); cursor: pointer; }

.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0 8px 26px; border-bottom: 1px solid var(--line); position: relative; }
.checklist li::before { position: absolute; left: 2px; font-weight: 700; }
.checklist li.ok::before { content: "✓"; color: #0f6a4c; }
.checklist li.bad::before { content: "✕"; color: var(--red); }
.checklist li.warn::before { content: "!"; color: var(--amber); left: 6px; }
.checklist li span:last-child { color: var(--slate); text-align: right; }
.checklist li.bad span:last-child { color: var(--red); font-weight: 600; }

/* ── Formulare ── */
label { display: block; font-size: 14px; font-weight: 550; margin-bottom: 14px; color: var(--ink); }
.hint { font-weight: 400; color: var(--slate); font-size: 13px; }
.form-control, .form-select { margin-top: 5px; font-size: 15px; padding: 8px 10px; border-color: var(--line-strong); border-radius: var(--radius); color: var(--ink); background-color: var(--sheet); }
.form-control:focus, .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #0f5c4d2e; }
.form-control[readonly] { background: var(--paper); }
.form-control::placeholder { color: #84918c; }
textarea.form-control { min-height: 0; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; align-items: end; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.grid-plz { display: grid; grid-template-columns: 110px 1fr; gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 8px; }
.check input { width: 17px; height: 17px; accent-color: var(--green); flex: none; }
fieldset { border: 0; padding: 0; margin: 4px 0 12px; }
legend { font-size: 14px; font-weight: 550; margin-bottom: 8px; float: none; }
.field-invalid, .field-invalid:focus { border-color: var(--red) !important; box-shadow: 0 0 0 3px #a8322b2e !important; background-color: #fff8f7 !important; }
.field-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 4px; margin-bottom: 12px; background: #fbfcfa; }
.row-tools { display: inline-flex; gap: 6px; margin-bottom: 14px; align-self: end; }
.col-row { display: grid; grid-template-columns: minmax(140px, 220px) 190px auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.col-row label { margin: 0; }
.col-row .inline { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--slate); white-space: nowrap; }
.col-row .inline .form-control { margin: 0; width: 84px; }
.col-row .row-tools { margin: 0; }
#width-sum { margin: 10px 0 0; }
.logo-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.logo-row label { margin: 0; }
.logo-preview { max-height: 64px; max-width: 220px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: var(--sheet); }

/* ── Rechnungseditor ── */
.picked { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; background: #fbfcfa; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% - 10px); margin: 0; padding: 4px; list-style: none; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 10px 28px #1b2a2f26; max-height: 280px; overflow: auto; }
.combo-list li { padding: 8px 10px; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; }
.combo-list li span { font-size: 13px; }
.combo-list li[aria-selected="true"], .combo-list li[data-index]:hover { background: var(--green-tint); }
.combo-list .combo-none { cursor: default; color: var(--slate); }
.line { border-top: 1.5px solid var(--ink); padding: 14px 0 6px; }
.line + .line { margin-top: 6px; }
.line-grid { display: grid; grid-template-columns: minmax(200px, 3fr) 90px 130px 120px 90px 90px minmax(110px, 1fr); gap: 0 12px; align-items: end; }
.line-total { text-align: right; padding-bottom: 22px; font-variant-numeric: tabular-nums; }
.line-total span { display: block; font-size: 14px; font-weight: 550; margin-bottom: 9px; }
.line-total output { font-size: 16px; font-weight: 650; }
.line-grid input[name="quantity"], .line-grid input[name="price"], .line-grid input[name="discount"] { text-align: right; font-variant-numeric: tabular-nums; }
.line-tools { display: flex; gap: 6px; justify-content: flex-end; margin: -4px 0 10px; }
.line-add { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; flex-wrap: wrap; }
.line-add .combo { flex: 1; min-width: 220px; max-width: 420px; }
.line-add .combo .form-control { margin: 0; }
.line-add .combo-list { top: calc(100% + 4px); }
.totals { margin: 18px 0 0 auto; min-width: 340px; font-variant-numeric: tabular-nums; }
.totals th { font-weight: 400; color: var(--slate); text-align: left; padding: 4px 24px 4px 0; }
.totals td { text-align: right; padding: 4px 0; }
.totals .grand th, .totals .grand td { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); font-size: 19px; font-weight: 650; color: var(--ink); padding: 8px 0; }
.totals .grand th { padding-right: 24px; }

/* ── Ausgestellte Rechnung ── */
.split { display: grid; grid-template-columns: minmax(360px, 5fr) minmax(380px, 6fr); gap: 18px; align-items: start; }
.preview-wrap { position: sticky; top: 16px; }
.preview-frame { height: 80vh; min-height: 520px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #e7ebe6; }
.preview { display: block; border: 0; width: 794px; height: 100%; transform-origin: 0 0; }
.preview-wrap p { font-size: 13px; margin: 6px 0 0; }
.mail-list, .mail-replies { list-style: none; padding: 0; margin: 0 0 8px; }
.mail-list > li { border-bottom: 1px solid var(--line); }
.mail-replies { margin: 0 0 8px 22px; border-left: 2px solid var(--green-tint); padding-left: 12px; }
.mail > summary { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 9px 0; cursor: pointer; list-style: none; }
.mail > summary::-webkit-details-marker { display: none; }
.mail > summary::before { content: "▸"; color: var(--slate); width: 12px; flex: none; }
.mail[open] > summary::before { content: "▾"; }
.mail-subject { font-weight: 650; color: var(--green); }
.mail-dir { color: var(--slate); font-weight: 700; }
.mail.incoming > summary .mail-dir { color: #0f6a4c; }
.facts dd a { font-weight: 600; }
.mail > summary .muted { font-size: 13px; }
.mail-view { margin: 0 0 12px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfa; padding: 12px 14px; }
.mail-head { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mail-head dt { color: var(--slate); font-weight: 500; font-size: 12.5px; }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-file { display: inline-block; border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 6px; margin: 0 4px 2px 0; font-size: 12.5px; background: var(--sheet); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; max-height: 320px; overflow: auto; }
.mail-error { color: var(--red); font-size: 13px; margin: 8px 0 0; }
.mail-filter { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; margin: 14px 0 4px; padding: 14px 14px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.mail-filter label { margin-bottom: 14px; }
.mail-filter .grow { flex: 1 1 260px; }
.mail-filter .btn { margin-bottom: 14px; }
.mail-filter .form-control, .mail-filter .form-select { background-color: var(--sheet); }
#mail-count { margin: 10px 0 6px; font-size: 13.5px; }
.mail-table { --mail-cols: 14px 96px 78px minmax(0, 1fr) 150px 230px; }
.mail-cols { display: grid; grid-template-columns: var(--mail-cols); gap: 0 14px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--slate); border-bottom: 1.5px solid var(--ink); }
.mail-table .mail-list { margin: 0; }
.mail-table .mail > summary { display: grid; grid-template-columns: var(--mail-cols); gap: 0 14px; align-items: start; padding: 11px 10px; }
.mail-table .mail > summary:hover { background: #f8faf7; }
.mail-table .mail[open] > summary { background: var(--green-tint); }
.mail-table .mail > summary::before { line-height: 1.5; }
.mail-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mail-date small, .mail-main small { display: block; color: var(--slate); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.mail-way { font-size: 13px; font-weight: 650; }
.mail-way.in { color: #0f6a4c; }
.mail-way.out { color: var(--slate); }
.mail-main { min-width: 0; }
.mail-inv { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mail-state .stamp { white-space: normal; }
.mail-table .mail-view { margin: 0 10px 14px 38px; }
.mail-none { padding: 26px 10px; text-align: center; color: var(--slate); }
.mail-count { text-decoration: none; font-size: 13.5px; }
.mail-count:hover { text-decoration: underline; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.danger-zone p { margin: 2px 0 0; font-size: 13.5px; max-width: 46ch; }
.upload { display: flex; gap: 12px; align-items: flex-end; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.upload label { flex: 1; margin: 0; }
.send-box { border-top: 1.5px solid var(--ink); margin-top: 18px; padding-top: 16px; }
.send-box p { margin: 10px 0 0; font-size: 13px; }
.secret { font-size: 14px; user-select: all; }

/* ── Dialog ── */
dialog { border: 0; border-radius: 10px; padding: 28px 30px; width: min(94vw, 760px); max-height: 92vh; overflow: auto; box-shadow: 0 24px 80px #14302a55; color: var(--ink); }
dialog::backdrop { background: #14302a99; }
dialog h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0 34px 16px 0; }
.modal-close { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 24px; line-height: 1; color: var(--slate); }
.modal-close:hover { background: var(--paper); color: var(--ink); }

/* ── Anmeldung, Einrichtung, Fehlerseiten ── */
body.plain { display: grid; place-items: start center; min-height: 100vh; padding: 9vh 16px 40px; }
.sheet { width: 100%; max-width: 420px; background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); padding: 34px 36px 36px; }
.sheet-wide { max-width: 620px; }
.sheet h1 { margin: 18px 0 8px; font-size: 27px; }
.sheet h2 { margin-top: 30px; }
.sheet form { margin-top: 22px; }
.sheet .btn { margin-top: 6px; }

/* ── Schmale Bildschirme ── */
@media (max-width: 1180px) {
  .line-grid { grid-template-columns: repeat(6, 1fr); }
  .line-grid > label:first-child { grid-column: 1 / -1; }
  .line-total { grid-column: span 1; }
  .split { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  aside { position: static; width: 100%; }
  .side-head { padding: 12px 16px; }
  .menu-toggle { display: block; }
  .side-nav { display: none; padding-bottom: 14px; }
  .side-nav.open { display: flex; }
  .account { padding-top: 14px; }
  .workspace { margin: 0; padding: 22px 16px 40px; }
  h1 { font-size: 26px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .line-grid { grid-template-columns: 1fr 1fr; }
  .line-total { grid-column: 1 / -1; padding-bottom: 12px; }
  .col-row { grid-template-columns: 1fr auto; }
  .col-row .row-tools { grid-column: 1 / -1; }
  .totals { min-width: 0; width: 100%; }
  .panel { padding: 18px 16px; }
  dialog { padding: 22px 18px; }
  .upload { flex-direction: column; align-items: stretch; }
  .mail-cols { display: none; }
  .mail-table .mail > summary { grid-template-columns: 14px 1fr auto; gap: 2px 10px; }
  .mail-table .mail-main { grid-column: 2 / -1; grid-row: 2; }
  .mail-table .mail-inv { grid-column: 2; grid-row: 3; }
  .mail-table .mail-state { grid-column: 2 / -1; grid-row: 4; }
  .mail-table .mail-view { margin-left: 10px; }
  .mail-filter label { flex: 1 1 140px; }
  .sticky-actions { position: static; border-top: 0; }
  .stats-two { grid-template-columns: 1fr; }
  .figures.flat > div { padding-right: 10px; }
}
@media (max-width: 480px) {
  .figures { grid-template-columns: 1fr; }
  .figures > div { border-left: 0; border-top: 1px solid var(--line); }
  .figures > div:first-child { border-top: 0; }
  .sheet { padding: 26px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { aside, #notice, .actions, .sticky-actions { display: none !important; } .workspace { margin: 0; padding: 0; } }

.release { border-left: 3px solid var(--amber); background: var(--amber-tint); border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 14px; margin-top: 12px; }
.release p { margin-bottom: 4px; }
.release .actions { margin-top: 8px; }

.rule-list { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.rule-list li { padding: 8px 12px; margin-bottom: 6px; border-left: 3px solid var(--line-strong); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }
.rule-list.bad li { border-left-color: var(--red); background: var(--red-tint); }
.rule-list.warn li { border-left-color: var(--amber); background: var(--amber-tint); }
.rule-list code { background: none; padding: 0; font-weight: 650; }

/* ── Statistik ── */
.inline-select { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; color: var(--slate); }
.inline-select .form-select { margin: 0; width: auto; padding: 5px 34px 5px 10px; }
.figures.flat { border: 0; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 22px; }
.figures.flat > div { padding: 14px 18px 14px 0; border-left: 0; }
.figures.flat dd { font-size: 23px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; margin: 4px 0 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i, .chart-tip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-zero { stroke: var(--line-strong); stroke-width: 1; }
.chart-tick { font-size: 11px; fill: var(--slate); font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit:hover, .chart-hit:focus { fill: #1b2a2f0d; }
.chart-tip { position: absolute; top: 6px; transform: translateX(-50%); width: 210px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px #1b2a2f26; padding: 9px 11px; font-size: 13px; pointer-events: none; z-index: 3; }
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip span { display: flex; align-items: center; gap: 6px; }
.chart-tip em { margin-left: auto; font-style: normal; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-table { margin: 8px 0 4px; font-size: 14px; }
.chart-table summary { color: var(--green); cursor: pointer; }
.sumrow td { font-weight: 650; border-top: 1.5px solid var(--ink); }
.stats-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 10px; }
.rank td:first-child { width: 62%; }
.rank-bar { display: block; height: 6px; background: var(--paper); border-radius: 3px; margin-top: 5px; }
.rank-bar i { display: block; height: 100%; background: #168a6a; border-radius: 3px; min-width: 2px; }
tr.late td { color: var(--red); font-weight: 600; }

/* ── Öffentliche Startseite ── */
body.landing { background: var(--paper); }
.lp-top, .lp-hero, .lp-section, .lp-foot { max-width: 1160px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.lp-top .wordmark { font-size: 24px; }
.lp-top nav { display: flex; gap: 6px 26px; flex-wrap: wrap; }
.lp-top nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 550; padding: 4px 0; border-bottom: 2px solid transparent; }
.lp-top nav a:hover { border-bottom-color: var(--green); color: var(--green); }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; padding-top: 44px; padding-bottom: 72px; }
.lp-hero h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.06; letter-spacing: -.02em; max-width: 14ch; }
.lp-lead { font-size: 18px; line-height: 1.55; color: var(--slate); max-width: 58ch; margin: 22px 0 0; }
.lp-login { background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); padding: 28px 30px 26px; position: sticky; top: 20px; scroll-margin-top: 20px; }
.lp-login h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 18px; }
.lp-note { font-size: 13.5px; color: var(--slate); margin: 16px 0 0; }
/* Das Blatt: eine verkleinerte Rechnung als einziges Bild der Seite. */
.lp-paper { margin-top: 44px; max-width: 520px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 3px; padding: 26px 28px 22px; box-shadow: 10px 10px 0 var(--green-tint); transform: rotate(-1.2deg); font-variant-numeric: tabular-nums; }
.lp-paper-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1.5px solid var(--ink); color: var(--green); }
.lp-paper-head span { color: var(--ink); font-weight: 650; }
.lp-paper table { width: 100%; margin: 4px 0 16px; font-size: 14.5px; }
.lp-paper td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lp-paper td:nth-child(2) { color: var(--slate); text-align: right; padding-right: 24px; }
.lp-paper td:last-child { text-align: right; }
.lp-paper .sum td { border-bottom: 1.5px solid var(--ink); font-weight: 650; font-size: 16px; }
.lp-paper-stamps { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-section { padding-top: 64px; padding-bottom: 64px; }
.lp-section > h2 { font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -.01em; margin-bottom: 30px; max-width: 24ch; line-height: 1.15; }
.lp-band { max-width: none; background: var(--sheet); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-band > * { max-width: 1096px; margin-left: auto; margin-right: auto; }
.lp-band > h2 { max-width: 1096px; }
.lp-top nav a.lp-signin { color: var(--green); border-bottom-color: var(--green); }
.lp-features { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; margin: 0; border-top: 1.5px solid var(--ink); }
.lp-features > div { padding: 20px 0 22px; border-bottom: 1px solid var(--line-strong); }
.lp-features dt { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.lp-features dd { margin: 0; color: var(--slate); max-width: 56ch; }
.lp-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 26px; }
.lp-steps > li { padding: 40px 0 0; }
.lp-steps > li::before { top: 0; }
.lp-steps > li::after { left: 36px; right: -18px; top: 13.5px; bottom: auto; width: auto; height: 1.5px; }
.lp-steps h3 { font-size: 16px; }
.lp-steps p { color: var(--slate); font-size: 14.5px; margin: 0; }
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.lp-two h3 { font-size: 16px; margin: 0 0 6px; }
.lp-two .checklist li span:last-child { color: var(--ink); text-align: left; }
.lp-band .lp-lead { margin-top: -10px; margin-bottom: 26px; }
.lp-roles { margin-bottom: 26px !important; }
.lp-roles td:first-child { width: 180px; }
.lp-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 34px; font-size: 13.5px; color: var(--slate); }
.lp-foot a { margin-left: 18px; }
@media (max-width: 900px) {
  .lp-top, .lp-hero, .lp-section, .lp-foot { padding-left: 18px; padding-right: 18px; }
  .lp-hero { grid-template-columns: 1fr; gap: 34px; padding-top: 24px; padding-bottom: 48px; }
  .lp-login { position: static; grid-row: 2; }
  .lp-paper { margin-top: 30px; transform: none; box-shadow: 6px 6px 0 var(--green-tint); }
  .lp-features, .lp-two { grid-template-columns: 1fr; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-steps > li { padding: 0 0 18px 44px; }
  .lp-steps > li::after { left: 13.5px; right: auto; top: 30px; bottom: 2px; width: 1.5px; height: auto; }
  .lp-section { padding-top: 44px; padding-bottom: 44px; }
  .lp-two > div + div { margin-top: 24px; }
}

/* ── API-Dokumentation ── */
.doc-share { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.doc-share p { margin: 2px 0 6px; font-size: 13.5px; }
.doc { max-width: 1160px; margin: 0 auto; padding: 10px 32px 60px; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-toc { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.doc-toc p { font-weight: 650; margin-bottom: 6px; }
.doc-toc a { color: var(--ink); text-decoration: none; padding: 5px 10px; border-left: 2px solid var(--line); }
.doc-toc a:hover { border-left-color: var(--green); color: var(--green); }
.doc-body { min-width: 0; }
.doc-body h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 4px; }
.doc-body .lp-lead { margin: 14px 0 26px; }
.doc-body section { padding-top: 34px; scroll-margin-top: 10px; }
.doc-body h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); margin-bottom: 16px; }
.doc-body h3 { font-size: 16px; margin: 24px 0 8px; }
.doc-body p, .doc-body dd { max-width: 76ch; }
.doc-body pre { max-height: none; background: #14302a; color: #e6efe9; border: 0; padding: 16px 18px; font-size: 13px; line-height: 1.55; white-space: pre; overflow-x: auto; }
.doc-body code { font-size: 13px; }
.doc-body pre code { background: none; color: inherit; padding: 0; }
.doc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0; border-top: 1.5px solid var(--ink); }
.doc-facts > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc-facts dt, .doc-rules dt { font-size: 13px; color: var(--slate); font-weight: 500; }
.doc-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.doc-rules { margin: 0; }
.doc-rules > div { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 24px; }
.doc-rules dt { font-size: 15px; font-weight: 650; color: var(--ink); }
.doc-rules dd { margin: 0; }
.doc-call { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; }
.doc-call span { font-size: 12.5px; font-weight: 700; color: #fff; background: var(--green); border-radius: 3px; padding: 2px 8px; }
.doc-call code { background: none; font-size: 14px; overflow-wrap: anywhere; }
.doc-body .ledger td:first-child { white-space: nowrap; }
.doc-body .ledger td { font-size: 14.5px; }
.doc-body .steps { margin-top: 6px; }
@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0 18px 44px; }
  .doc-body pre { font-size: 12px; padding: 12px; }
  .doc-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 6px; }
  .doc-toc p { width: 100%; }
  .doc-toc a { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 10px; background: var(--sheet); }
  .doc-facts, .doc-rules > div { grid-template-columns: 1fr; }
  .doc-body .ledger td:first-child { white-space: normal; }
}

/* ── E-Rechnung prüfen und lesen (öffentliche Seite /pruefen und Arbeitsplatz) ── */
.insp-page { padding-top: 34px; padding-bottom: 48px; }
.insp-page h1 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 46px); font-weight: 600; letter-spacing: -.015em; line-height: 1.1; margin: 0; }
.insp-page .lp-lead { margin: 16px 0 28px; max-width: 64ch; }
.insp { max-width: 980px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 20px; background: var(--sheet); border: 2px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--green); background: var(--green-tint); }
.dropzone:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone b { font-size: 17px; }
.dropzone span { color: var(--slate); font-size: 14.5px; }
.insp-note { font-size: 13.5px; color: var(--slate); margin: 8px 2px 22px; }
.insp-busy { padding: 14px 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.insp-verdict { border-left: 5px solid var(--line-strong); scroll-margin-top: 12px; }
.insp-verdict.ok { border-left-color: #1c8a63; }
.insp-verdict.warn { border-left-color: #c58a12; }
.insp-verdict.bad { border-left-color: var(--red); }
.insp-verdict-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.insp-verdict-head .stamp { font-size: 14px; padding: 4px 10px; }
.insp-message { font-size: 16.5px; font-weight: 550; margin: 14px 0 16px; max-width: 80ch; }
.insp-verdict .facts dd { font-size: 15px; overflow-wrap: anywhere; }
.insp-small { font-size: 13px; margin: 16px 0 0; max-width: 100ch; }
.insp-findings h2 { margin-bottom: 10px; }
.insp-findings .rule-list { margin-bottom: 0; }
.insp-title { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 30px 0 12px; }
.insp-sheet { background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 30px 34px; box-shadow: 5px 5px 0 var(--green-tint); margin-bottom: 20px; }
.insp-sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1.5px solid var(--ink); }
.insp-kind { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); margin: 0 0 2px; }
.insp-sheet-head h2 { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.insp-amount { text-align: right; }
.insp-amount span { display: block; font-size: 13px; color: var(--slate); }
.insp-amount b { font-size: 26px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.insp-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px 40px; padding: 20px 0; }
.insp-party h3, .insp-block h3 { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); margin: 0 0 6px; }
.insp-party p { margin: 0 0 8px; overflow-wrap: anywhere; }
.insp-name { font-size: 17px; font-weight: 650; margin-bottom: 2px !important; }
.insp-contact { font-size: 14px; color: var(--slate); }
.insp-kv { margin: 0 0 8px; font-size: 14px; }
.insp-kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 12px; padding: 2px 0; }
.insp-kv.wide > div { grid-template-columns: 220px minmax(0, 1fr); padding: 6px 0; border-bottom: 1px solid var(--line); }
.insp-kv dt { color: var(--slate); font-weight: 500; }
.insp-kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.insp-facts { padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.insp-facts dd { font-size: 15px; }
.insp-lines { margin-bottom: 8px; }
.insp-lines td { vertical-align: top; }
.insp-lines td:nth-child(2) { min-width: 220px; }
.insp-sub { display: block; font-size: 13.5px; color: var(--slate); font-weight: 400; white-space: pre-line; overflow-wrap: anywhere; }
.insp-adjust { list-style: none; padding: 0; margin: 4px 0 10px; font-size: 14.5px; text-align: right; }
.insp-totals { margin: 10px 0 0 auto; max-width: 440px; }
.insp-totals > div { display: flex; justify-content: space-between; gap: 24px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.insp-totals dt { font-weight: 500; }
.insp-totals dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.insp-totals .total { border-bottom: 0; border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 10px; font-size: 18px; }
.insp-totals .total dt, .insp-totals .total dd { font-weight: 700; }
.insp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px 40px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.insp-cols:empty { display: none; }
.insp-block ul { padding-left: 18px; margin: 0; font-size: 14.5px; }
.insp-pre { white-space: pre-line; font-size: 14.5px; margin: 0 0 8px; overflow-wrap: anywhere; }
.insp-tech { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; font-size: 14px; }
.insp-tech summary { cursor: pointer; font-weight: 600; }
.insp-tech[open] summary { margin-bottom: 10px; }
.insp-formats { grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.insp-limit { max-width: 90ch; margin: 22px 0 0; color: var(--slate); font-size: 15px; }
.insp-limit b { color: var(--ink); }
.lp-check { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; padding-top: 20px; }
.lp-check > div { flex: 1 1 420px; }
.lp-check h2 { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 30px); font-weight: 600; margin: 0; }
.lp-check .lp-lead { margin-top: 10px; font-size: 16.5px; max-width: 70ch; }
.lp-top nav a[aria-current="page"] { border-bottom-color: var(--ink); }
@media (max-width: 900px) {
  .insp-sheet { padding: 20px 16px; box-shadow: none; }
  .insp-formats { grid-template-columns: 1fr; }
  .insp-kv > div, .insp-kv.wide > div { grid-template-columns: 1fr; }
  .insp-amount { text-align: left; }
  .insp-totals { max-width: none; }
}
@media print {
  .lp-top, .lp-foot, .lp-band, .dropzone, .insp-note, .insp-limit, .doc-rules, .page-head, .insp-verdict .btn, .insp-page > h1, .insp-page > .lp-lead, main > .lp-section:not(.insp-page) { display: none !important; }
  .insp-sheet { box-shadow: none; border: 0; padding: 0; }
  .insp-verdict, .insp-findings, .insp-tech { break-inside: avoid; }
}
.lp-band > .insp-formats { margin: 0 auto; }

/* ── Angebote, Mahnungen, Serien, Export ── */
label.needs input { border-color: var(--amber); background: var(--amber-tint); }
.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; color: var(--slate); }
.fold[open] > summary::before { content: "▾"; }
.fold > summary h2 { margin: 0; }
.fold[open] > summary { margin-bottom: 14px; }
.export-list { list-style: none; padding: 0; margin: 0 0 14px; }
.export-list li { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.export-list li:first-child { border-top: 1.5px solid var(--ink); }
.export-list p { margin: 2px 0 0; max-width: 78ch; }
.export-list .btn { white-space: nowrap; }
.btn.disabled { opacity: .5; pointer-events: none; }
.export-range .actions { margin: 12px 0; }
#export-preview { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.row-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.danger-zone .actions { margin: 0; }
@media (max-width: 700px) { .export-list li { flex-direction: column; align-items: flex-start; } }
td .row-tools { margin: 0; align-self: auto; }
.help .steps { margin: 6px 0 14px; } .help section > p { margin-bottom: 12px; } .aside a[target] { opacity: .9; }

/* ════════ Öffentliche Seiten: dunkles Werk, Limette als Signal, die Rechnung als helles Blatt ════════ */
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff") format("woff"); font-weight: 600; font-display: swap; }
body.landing {
  --paper: #0d100f; --sheet: #161b19; --ink: #edf1ea; --slate: #a3aea7; --line: #272e2b; --line-strong: #3b4541;
  --green: #c6f432; --green-dark: #d6ff52; --green-tint: #1c2610; --red: #ff8a80; --red-tint: #2c1614; --amber: #f2c35a; --amber-tint: #2a2210;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif; --on-lime: #11150c;
  --bs-body-color: var(--ink); --bs-body-bg: var(--paper); --bs-link-color: var(--green); --bs-link-color-rgb: 198, 244, 50; --bs-link-hover-color: var(--green-dark); --bs-link-hover-color-rgb: 214, 255, 82;
  --bs-border-color: var(--line); --bs-secondary-color: var(--slate); background: var(--paper); color: var(--ink);
}
body.landing :focus-visible { outline-color: var(--green); }
body.landing h1, body.landing .lp-section > h2, body.landing .doc-body h2, body.landing .lp-login h2, body.landing .insp-title, body.landing .pub-lime h2 { font-family: var(--display); font-weight: 600; letter-spacing: 0; }
body.landing .lp-hero h1 { font-size: clamp(46px, 7.2vw, 92px); line-height: .96; max-width: 11ch; text-wrap: balance; }
body.landing .insp-page h1, body.landing .doc-body h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1; }
body.landing .lp-section > h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.02; max-width: 20ch; }
body.landing .doc-body h2 { font-size: 30px; border-bottom-color: var(--line-strong); }
body.landing .lp-lead { color: var(--slate); }
.lp-top .wordmark { display: inline-flex; align-items: center; gap: 10px; }
body.landing .lp-top .wordmark { font-family: var(--display); font-size: 27px; color: var(--ink); }
body.landing .lp-top nav { align-items: center; }
body.landing .lp-top nav a { color: var(--ink); }
body.landing .lp-top nav a:hover { color: var(--green); border-bottom-color: var(--green); }
body.landing .lp-top nav a[aria-current="page"] { border-bottom-color: var(--green); }
body.landing .lp-top nav a.lp-signin { background: var(--green); color: var(--on-lime); border: 0; border-radius: 999px; padding: 7px 18px; font-weight: 650; }
body.landing .lp-top nav a.lp-signin:hover { background: var(--green-dark); color: var(--on-lime); }
body.landing .btn-primary { --bs-btn-color: var(--on-lime); --bs-btn-hover-color: var(--on-lime); --bs-btn-active-color: var(--on-lime); --bs-btn-disabled-color: var(--on-lime); --bs-btn-disabled-bg: #7d9a26; --bs-btn-disabled-border-color: #7d9a26; font-weight: 650; }
body.landing .btn-light { --bs-btn-bg: transparent; --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: #ffffff12; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--slate); --bs-btn-active-bg: #ffffff1f; --bs-btn-active-color: var(--ink); }
body.landing .form-control { background: #0f1312; color: var(--ink); border-color: var(--line-strong); }
body.landing .form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px #c6f43233; }
body.landing code { background: #ffffff12; color: var(--ink); }
body.landing .notice { background: var(--green-tint); border-color: #46591a; color: var(--ink); }
body.landing .notice.error { background: var(--red-tint); border-color: #6a2d28; color: #ffd2cd; }
body.landing .stamp.ok { color: #c6f432; background: #1c2610; }
body.landing .stamp.bad { color: #ff8a80; background: #2c1614; }
body.landing .stamp.warn { color: #f2c35a; background: #2a2210; }
body.landing .stamp.neutral { color: var(--slate); background: transparent; }
body.landing .ledger tbody tr:hover td { background: #ffffff08; }
body.landing .table.ledger { --bs-table-color: var(--ink); --bs-table-border-color: var(--line); }
body.landing .ledger thead th { border-bottom-color: var(--line-strong); }
body.landing .steps > li::before { border-color: var(--green); color: var(--green); background: var(--paper); }
body.landing .checklist li.ok::before { color: var(--green); }
body.landing .rule-list li { background: #ffffff0a; }
body.landing .rule-list.bad li { background: var(--red-tint); }
body.landing .rule-list.warn li { background: var(--amber-tint); }
body.landing .dropzone { background: var(--sheet); }
body.landing .dropzone:hover, body.landing .dropzone.over, body.landing .dropzone:focus-within { background: var(--green-tint); }
body.landing .doc-toc a { color: var(--slate); }
body.landing .doc-toc a:hover { color: var(--green); }
body.landing .doc-call span { color: var(--on-lime); }
body.landing .doc-body pre { background: #070908; border: 1px solid var(--line); }
body.landing .lp-band { background: var(--sheet); }
body.landing .lp-foot { border-top: 1px solid var(--line); max-width: none; padding-left: max(32px, calc((100% - 1096px) / 2)); padding-right: max(32px, calc((100% - 1096px) / 2)); }
body.landing .lp-foot a { color: var(--slate); }
body.landing .lp-foot a:hover { color: var(--green); }
/* Helles Blatt auf dunklem Grund: Musterrechnung der Startseite und die gelesene Rechnung behalten Papierfarben. */
body.landing .lp-paper, body.landing .insp-sheet {
  --paper: #f3f5f1; --sheet: #ffffff; --ink: #1b2a2f; --slate: #55645f; --line: #dbe1db; --line-strong: #b9c3bb; --green: #0f5c4d; --green-tint: #e4efe9; --red: #a8322b; --amber: #8a5a08;
  --bs-table-color: #1b2a2f; --bs-table-border-color: #dbe1db; background: #fff; color: #1b2a2f; border-color: #fff;
}
body.landing .lp-paper { box-shadow: 14px 14px 0 var(--lime-shadow, #c6f432); transform: rotate(-1.6deg); margin-top: 52px; }
body.landing .lp-paper .stamp.ok { color: #0f6a4c; background: #e7f4ee; }
body.landing .lp-paper .stamp.neutral { color: #55645f; background: #f3f5f1; }
body.landing .insp-sheet { box-shadow: 8px 8px 0 #c6f432; }
body.landing .insp-sheet .ledger tbody tr:hover td { background: #f8faf7; }
body.landing .insp-sheet .ledger thead th { border-bottom-color: #1b2a2f; }
body.landing .lp-hero { grid-template-columns: minmax(0, 1fr) 372px; padding-top: 36px; padding-bottom: 84px; }
body.landing .lp-login { border: 1px solid var(--line-strong); border-top: 4px solid var(--green); border-radius: 14px; }
body.landing .lp-login h2 { font-size: 30px; }
.pub-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.pub-strip { list-style: none; margin: 0; padding: 16px 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--sheet); font-family: var(--display); font-size: 21px; color: var(--ink); }
.pub-strip li + li::before { content: "+"; color: var(--green); margin: 0 22px; }
.pub-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pub-cards article { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 20px; }
.pub-cards article:hover { border-color: var(--green); }
.pub-cards h3 { font-size: 17px; font-weight: 650; margin: 0 0 8px; color: var(--ink); }
.pub-cards p { margin: 0; color: var(--slate); font-size: 14.5px; }
.pub-lime { background: #c6f432; color: #11150c; display: flex; align-items: center; justify-content: space-between; gap: 24px 56px; flex-wrap: wrap; padding: 44px max(32px, calc((100% - 1096px) / 2)); }
.pub-lime > div { flex: 1 1 460px; }
.pub-lime h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.02; margin: 0 0 10px; color: #11150c; }
.pub-lime p { margin: 0; max-width: 64ch; font-size: 16.5px; }
.pub-lime .btn-dark { background: #11150c; border-color: #11150c; color: #edf1ea; border-radius: 999px; padding: 10px 22px; font-weight: 650; }
.pub-lime .btn-dark:hover { background: #000; color: #c6f432; }
body.landing .insp-formats, body.landing .lp-features { border-top-color: var(--line-strong); }
body.landing .lp-features > div { border-bottom-color: var(--line); }
body.landing .doc-rules > div, body.landing .doc-facts > div { border-bottom-color: var(--line); }
body.landing .doc-facts { border-top-color: var(--line-strong); }
body.landing .insp-verdict.ok { border-left-color: var(--green); }
body.landing .panel { background: var(--sheet); border-color: var(--line); }
body.landing .insp-tech, body.landing .insp-busy { background: var(--sheet); border-color: var(--line); }
.legal { max-width: 820px; margin: 0 auto; padding: 20px 32px 70px; }
.legal section { padding-top: 26px; }
.legal p { max-width: 72ch; }
.legal-missing { background: #5a1f1a; color: #ffd2cd; padding: 0 5px; border-radius: 3px; }
@media (max-width: 900px) {
  body.landing .lp-hero { grid-template-columns: 1fr; }
  .pub-cards { grid-template-columns: 1fr; }
  .pub-strip { font-size: 17px; padding: 12px 18px; } .pub-strip li + li::before { margin: 0 12px; }
  .pub-lime { padding: 34px 18px; }
  body.landing .lp-paper { box-shadow: 8px 8px 0 #c6f432; transform: none; }
  .legal { padding: 10px 18px 50px; }
}
@media (min-width: 901px) and (max-width: 1100px) { .pub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { body.landing { background: #fff; color: #000; } body.landing .insp-sheet { box-shadow: none; } }
body.landing .lp-hero h1 { max-width: 13ch; }
body.landing .lp-band > h2 { max-width: 1096px; }

/* ── Betreiber-Bereich ── */
body.operator { background: var(--paper); }
.operator td form { margin: 0; }

/* ════════ Startseite 0.16: Grafiken, Symbole, behutsame Bewegung ════════ */
.landing .btn .bi { margin-right: 6px; }
.home .lp-hero { align-items: start; }
.home .lp-login label { margin: 0 0 5px; } .home .lp-login .form-control { margin: 0 0 14px; }
/* Bild der Startseite: das Rechnungsblatt, dahinter dieselbe Rechnung als XML, zwei Kennzeichen. */
.hero-art { position: relative; margin-top: 54px; max-width: 640px; min-height: 290px; }
.hero-art .lp-paper { position: relative; z-index: 2; margin: 0; max-width: 470px; }
.hero-xml { position: absolute; z-index: 1; right: 0; top: 46px; width: 300px; padding: 40px 18px 18px 74px; background: #070908; border: 1px solid var(--line-strong); border-radius: 12px; transform: rotate(3deg); }
.hero-xml code { display: block; background: none; padding: 0; font-size: 11.5px; line-height: 1.75; color: #9fb38c; white-space: nowrap; overflow: hidden; }
.hero-file { position: absolute; top: 12px; right: 14px; font-size: 12.5px; color: var(--green); font-weight: 600; }
.hero-chip { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.chip-pdf { left: 250px; top: -18px; background: var(--sheet); border: 1px solid var(--line-strong); color: var(--ink); }
.chip-ok { right: 6px; bottom: 8px; background: var(--green); color: var(--on-lime); }
/* Laufband der Formate */
.pub-marquee { display: flex; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--sheet); font-family: var(--display); font-size: 22px; padding: 15px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.pub-marquee ul { list-style: none; margin: 0; padding: 0; display: flex; flex: none; min-width: 100%; justify-content: space-around; animation: marquee 38s linear infinite; }
.pub-marquee li { white-space: nowrap; padding: 0 26px; }
.pub-marquee li::before { content: "+"; color: var(--green); margin-right: 52px; }
.pub-marquee:hover ul, .pub-marquee:focus-within ul { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }
/* E-Rechnung erklärt */
.explain { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 56px; align-items: center; }
.explain-lead { font-size: 18.5px; line-height: 1.55; max-width: 62ch; margin: 0 0 28px; }
.explain-lead strong { color: var(--green); font-weight: 650; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 22px; border-top: 2px solid var(--line-strong); }
.timeline li { position: relative; padding: 20px 0 0; }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.timeline time { font-family: var(--display); font-size: 21px; color: var(--green); display: block; }
.timeline h3 { font-size: 15.5px; margin: 4px 0 6px; }
.timeline p { font-size: 14px; color: var(--slate); margin: 0; }
.fine { font-size: 13px; color: var(--slate); margin: 22px 0 0; }
.flow { margin: 0; }
.flow svg { width: 100%; height: auto; max-width: 420px; display: block; margin: 0 auto; }
.flow-lines path { stroke: var(--line-strong); stroke-dasharray: 5 7; animation: flow-dash 2.4s linear infinite; }
.flow-node rect { fill: var(--sheet); stroke: var(--line-strong); stroke-width: 1.5; }
.flow-node text { fill: var(--ink); font: 600 16px var(--sans); }
.flow-node text.sub { fill: var(--slate); font-weight: 400; font-size: 13px; }
.flow-node.lime rect { fill: var(--green); stroke: var(--green); }
.flow-node.lime text { fill: var(--on-lime); }
@keyframes flow-dash { to { stroke-dashoffset: -24; } }
/* Funktionen */
.pub-cards article { transition: transform .18s ease, border-color .18s ease; }
.pub-cards article:hover { transform: translateY(-3px); }
.pub-cards .bi { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--green-tint); color: var(--green); font-size: 20px; margin-bottom: 14px; }
/* Ablauf */
.pub-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 22px; counter-reset: s; }
.pub-steps li { position: relative; counter-increment: s; }
.pub-steps li:not(:last-child)::after { content: ""; position: absolute; top: 27px; left: 66px; right: -12px; border-top: 2px dashed var(--line-strong); }
.pub-step-icon { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--green); color: var(--green); font-size: 23px; background: var(--paper); margin-bottom: 16px; }
.pub-step-icon::after { content: counter(s); position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: var(--on-lime); font: 700 12px/22px var(--sans); text-align: center; }
.pub-steps h3 { font-size: 16.5px; margin: 0 0 6px; }
.pub-steps p { color: var(--slate); font-size: 14.5px; margin: 0; }
/* Prüf-Band */
.lime-art { width: 150px; height: auto; flex: none; }
.pub-lime .btn-dark .bi { color: #c6f432; }
/* Fragen */
.faq { max-width: 900px; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 2px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 17.5px; font-weight: 600; margin: 0; }
.faq summary .bi { color: var(--green); font-size: 18px; transition: transform .2s ease; flex: none; }
.faq details[open] summary .bi { transform: rotate(45deg); }
.faq summary:hover h3 { color: var(--green); }
.faq p { margin: 0 2px 20px; max-width: 74ch; color: var(--slate); font-size: 15.5px; line-height: 1.6; }
/* Bewegung: ein Auftakt im Kopf der Seite, Abschnitte blenden beim Rollen ein. */
@media (prefers-reduced-motion: no-preference) {
  .home .lp-pitch h1 { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .home .lp-pitch .lp-lead { animation: rise .7s .08s cubic-bezier(.2, .7, .2, 1) both; }
  .home .pub-cta, .home .lp-login { animation: rise .7s .16s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-art .lp-paper { animation: paper-in .8s .25s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-xml { animation: xml-in .8s .4s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-chip { animation: pop .45s cubic-bezier(.3, 1.4, .5, 1) both; } .chip-pdf { animation-delay: .85s; } .chip-ok { animation-delay: 1.35s; }
  .hero-art .stamp { animation: stamp .35s cubic-bezier(.3, 1.5, .5, 1) both; }
  .hero-art .stamp:nth-child(1) { animation-delay: .95s; } .hero-art .stamp:nth-child(2) { animation-delay: 1.15s; } .hero-art .stamp:nth-child(3) { animation-delay: 1.35s; }
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes paper-in { from { opacity: 0; transform: translateY(26px) rotate(-5deg); } }
@keyframes xml-in { from { opacity: 0; transform: translateX(-40px) rotate(0deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } }
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-8deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(26px); } }
@media (prefers-reduced-motion: reduce) { .pub-marquee ul, .flow-lines path { animation: none; } .pub-marquee { flex-wrap: wrap; } .pub-marquee ul[aria-hidden] { display: none; } }
@media (max-width: 900px) {
  .hero-art { min-height: 0; margin-top: 34px; }
  .hero-xml { position: relative; top: 0; width: auto; margin: -14px 0 0 24px; padding: 34px 16px 14px; transform: rotate(1.2deg); }
  .chip-pdf { left: auto; right: 0; top: -14px; } .chip-ok { right: 4px; bottom: -14px; }
  .explain { grid-template-columns: 1fr; gap: 34px; }
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--line-strong); gap: 0; }
  .timeline li { padding: 0 0 20px 22px; } .timeline li::before { top: 8px; left: -7px; }
  .pub-steps { grid-template-columns: 1fr; gap: 22px; }
  .pub-steps li { padding-left: 76px; min-height: 58px; } .pub-step-icon { position: absolute; left: 0; top: 0; margin: 0; }
  .pub-steps li:not(:last-child)::after { top: 62px; left: 27px; right: auto; bottom: -18px; border-top: 0; border-left: 2px dashed var(--line-strong); }
  .lime-art { width: 96px; }
  .pub-marquee { font-size: 18px; }
}
.hero-art { max-width: 700px; }
.hero-xml { padding-left: 84px; }
body.landing .hero-xml code { background: none; }
.faq { max-width: 1096px; }
@media (max-width: 900px) { .hero-xml { padding-left: 16px; } }
.hero-xml { padding-left: 104px; width: 330px; }
@media (max-width: 900px) { .hero-xml { padding-left: 16px; width: auto; } }

/* ── Wortmarke als Bild (0.17) ── */
.wordmark img { display: block; height: 36px; width: auto; }
.lp-top .wordmark img, .sheet .wordmark img { height: 40px; }
.sheet .wordmark { margin-bottom: 18px; }
@media (max-width: 560px) { .lp-top .wordmark img { height: 32px; } }

/* ── Simulation durch den Betreiber ── */
.simulation { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #c6f432; color: #11150c; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; }
.simulation p { margin: 0; flex: 1 1 320px; }
.simulation .btn { background: #11150c; color: #fff; border-color: #11150c; font-weight: 600; }
.simulation .btn:hover { background: #2a3020; color: #fff; }

/* ── Tarif und Nutzung (0.18) ── */
.plan-meters { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 36px; }
.plan-meters li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.plan-meters li > span:first-child { color: var(--slate); }
.plan-meters b { font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-bar { grid-column: 1 / -1; height: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.plan-bar i { display: block; height: 100%; background: var(--green); }
.plan-bar.near i { background: var(--amber); }
.plan-bar.full i { background: var(--red); }
/* ── Passwort vergessen ── */
.pw-page { max-width: 460px; }
.pw-page form label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
.pw-page .btn { margin-top: 18px; }

/* ── Neues Passwort: Stärke, Vorschlag, Anzeige (0.19.3) ── */
.pw-tools { margin: 8px 0 2px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter i { height: 6px; border-radius: 3px; background: var(--line-strong); }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: var(--green); }
.pw-meter[data-level="4"] i { background: var(--green); }
.pw-label { margin: 6px 0 0; font-size: 13.5px; color: var(--slate); }
.pw-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pw-page .pw-buttons .btn { margin-top: 6px; }
