:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b2330;
  --muted: #6b7686;
  --line: #e6e9ee;
  --accent: #2f4b7c;
  --accent-soft: #eef2f8;
  --ok: #1f9d63;
  --ok-soft: #e7f5ee;
  --warn: #b9791b;
  --warn-soft: #fbf1de;
  --red: #c1422f;
  --red-soft: #fbe9e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,30,50,.06), 0 2px 8px rgba(20,30,50,.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 58px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; letter-spacing: .2px; }
.brand-tag { font-size: 11px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

/* Zahnrad-Menü (Einstellungen) */
.nav-gear { position: relative; display: inline-flex; }
.gear-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line); background: var(--card);
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
  border-radius: 10px; transition: background .12s, color .12s, border-color .12s; }
.gear-btn:hover, .gear-btn.open { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.gear-menu { position: absolute; right: 0; top: 112%; min-width: 180px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(20,30,50,.16);
  padding: 6px; z-index: 50; }
.gear-menu a { display: block; padding: 8px 12px; border-radius: 7px; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: 13.5px; }
.gear-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.gear-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Kostenarten (Werbungskosten) */
.ka-block { margin-bottom: 22px; }
.ka-title { font-size: 16px; margin: 2px 0 14px; color: var(--ink); }
.ka-grid-head, .ka-row {
  display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 1fr) auto;
  gap: 10px; align-items: center;
}
.ka-grid-head { padding: 0 2px 6px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.ka-row { padding: 6px 2px; border-bottom: 1px solid var(--line); margin: 0; }
.ka-input { width: 100%; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: 13.5px; background: var(--card); color: var(--ink); }
.ka-input:focus { outline: none; border-color: var(--accent); }
.ka-hinweis { color: var(--muted); }
.ka-act { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.ka-add { margin-top: 12px; border-bottom: none; }
.btn.small.danger { color: var(--red); border-color: var(--red-soft); }
.btn.small.danger:hover { background: var(--red-soft); }

/* Einkunftsart-Tabs auf der Werbungskosten-Seite */
.ek-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ek-tab { padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px;
  text-decoration: none; color: var(--muted); font-size: 13px; background: var(--card); }
.ek-tab:hover { border-color: var(--accent); color: var(--accent); }
.ek-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Einkunftsarten-Haken im Betrieb */
.bs-ek { margin: 14px 0 2px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px 12px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.bs-ek legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 0 6px; }

/* Layout */
.container { max-width: 1080px; margin: 0 auto; padding: 26px 28px 80px; }
/* Breitere Variante für dichte Tabellen (Kontierungs-Detailseite). */
.container.wide { max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
.betrieb-switch { font: inherit; font-size: 20px; font-weight: 650; color: var(--accent);
  border: none; background: transparent; padding: 0 2px; cursor: pointer; }
.betrieb-switch:focus { outline: none; }
.subtitle { color: var(--muted); margin: 4px 0 0; }

/* Stats */
.stats { display: flex; gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 16px; text-align: center; min-width: 78px;
}
.stat .num { display: block; font-size: 20px; font-weight: 700; }
.stat .lbl { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.stat.ok .num { color: var(--ok); }
.stat.warn .num { color: var(--warn); }
.stat.bad .num { color: var(--red); }

/* Intro / Hilfe */
.intro { padding: 16px 18px; margin-bottom: 16px; }
.intro-lead { margin: 0 0 8px; font-size: 14px; }
.intro-steps { margin: 0 0 14px; padding-left: 20px; color: var(--ink); }
.intro-steps li { margin: 3px 0; }
.legend { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.bar-key { display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: var(--warn); flex: none; }
.table-help { margin: 14px 0 0; padding: 8px 10px; background: var(--accent-soft); border-radius: 8px;
  color: var(--muted); font-size: 12px; }
.table-help b { color: var(--ink); }

/* Footer */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 36px; }
.foot .sep { margin: 0 6px; }

/* Toolbar (Sortierung & Filter) */
.toolbar {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tool { display: flex; flex-direction: column; gap: 4px; }
.tool label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.tool select { min-width: 140px; }
.tool-result { margin-left: auto; align-self: center; color: var(--muted); font-size: 12.5px; }
.tool-result .reset { margin-left: 10px; color: var(--accent); text-decoration: none; }
.tool-result .reset:hover { text-decoration: underline; }
.center { text-align: center; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.orders { display: flex; flex-direction: column; gap: 12px; }
.order { padding: 14px 16px; transition: border-color .15s; }
.order.is-open { border-left: 3px solid var(--warn); }

.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.order-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-meta .date { font-weight: 600; }
.order-meta .oid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 12.5px; }
.order-meta .total { font-weight: 600; }
.order-docs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc {
  font-size: 12.5px; text-decoration: none; color: var(--accent);
  border: 1px solid var(--line); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 7px;
}
.doc:hover { border-color: var(--accent); }

/* Artikel-Liste in der Bestellkarte (Bild + Titel, Amazon-ähnlich) */
.item-list { list-style: none; margin: 12px 0 0; padding: 0; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.item-row:first-child { border-top: none; }
.item-list .item-thumb { width: 50px; height: 50px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px; flex: none; }
.item-thumb.empty { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 6px, #eceef1 6px, #eceef1 12px); }
.item-title-link { color: var(--ink); text-decoration: none; font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-title-link[href]:hover { color: var(--accent); text-decoration: underline; }

/* Fußzeile der Bestellkarte (Betrieb-Zuordnung) */
.order-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.foot-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Hilfe-Button mit Tooltip */
.help {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); border: 1px solid #d8e0ec;
  font-size: 11px; font-weight: 700; cursor: help; position: relative; flex: none;
}
.help::after {
  content: attr(data-tip);
  position: absolute; bottom: 138%; left: 0; width: 280px;
  background: #1b2330; color: #fff; padding: 9px 11px; border-radius: 8px;
  font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .12s, transform .12s; z-index: 30;
  box-shadow: 0 6px 20px rgba(20, 30, 50, .18);
}
.help:hover::after, .help:focus::after { opacity: 1; visibility: visible; transform: translateY(0); }
.split-note { color: var(--muted); font-size: 12.5px; font-style: italic; }

/* Badges */
.badge { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.badge.gray { background: #eef0f3; color: #5b6573; }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--red-soft); color: var(--red); }

/* Buttons */
.btn {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
form.inline { display: inline; }

/* Inputs / selects */
select, input[type="text"], input:not([type]) {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px;
  transition: border-color .12s, box-shadow .12s;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel-purpose { min-width: 150px; }

/* Saved flash */
.js-save.saved { animation: savedFlash 1s ease; }
.js-save.error { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-soft); }
@keyframes savedFlash {
  0% { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
  100% { border-color: var(--line); box-shadow: none; }
}

/* Items table */
table.items { width: 100%; border-collapse: collapse; margin-top: 14px; border-top: 1px solid var(--line); }
table.items th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 600; padding: 10px 8px 6px; border-bottom: 1px solid var(--line);
}
table.items td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.items tr:last-child td { border-bottom: none; }
.item-cell { display: flex; align-items: center; gap: 10px; }
.item-thumb { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; flex: none; }
.item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--ink); text-decoration: none; }
a.item-title:hover { color: var(--accent); text-decoration: underline; }
.col-art { width: 38%; }
.col-menge { text-align: center; white-space: nowrap; }
table.kontierung td.col-menge { font-weight: 600; color: var(--ink); }
.inp-konto { width: 92px; }
.inp-amount { width: 84px; text-align: right; }
.inp-text { width: 100%; min-width: 130px; }
.sel-bu { min-width: 78px; }

/* Artikel-Zeile: Titel füllt, Betrieb-Auswahl rechts (Zuordnung bei Aufteilung) */
.item-row .item-title-link { flex: 1; }
.item-assign { margin-left: auto; flex: none; }
.item-assign .sel-purpose { min-width: 160px; }

/* Kontierungs-Tabelle */
.badge.soft { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nowrap, table.kontierung .col-date { white-space: nowrap; }
table.kontierung td, table.kontierung th { font-size: 12.5px; }
table.kontierung tr.is-open td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.kontierung tr.is-done td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.col-change { white-space: nowrap; }

/* Gegenkonto-Feld mit Marker, Namensanzeige und Suchliste */
.konto-field { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.konto-field .inp-konto { order: 2; }
.konto-field .js-confirm-konto { order: 3; padding: 4px 8px; line-height: 1; }
.konto-name { order: 4; flex-basis: 100%; margin-top: 1px; font-size: 11px; line-height: 1.2; color: var(--muted);
  max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ampel-Marker neben dem Gegenkonto */
.konto-marker { order: 1; display: inline-grid; place-items: center; flex: none;
  width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 800;
  cursor: help; user-select: none; }
.konto-marker.mk-gruen { background: var(--ok-soft); color: var(--ok); }
.konto-marker.mk-gelb { background: var(--warn-soft); color: var(--warn); }
.konto-marker.mk-rot { background: var(--red-soft); color: var(--red); }
.konto-marker.mk-retour { background: #e7eaf0; color: #5b6573; }
.konto-marker.mk-gebucht { background: var(--accent-soft); color: var(--accent); }
/* Leerer Kontoname soll keine zweite Zeile erzeugen → Felder bleiben auf gleicher Höhe */
.konto-name:empty { display: none; }
.items.kontierung td { vertical-align: middle; }

/* Statt eines Marker-Icons (das das Feld verschob) wird das Feld farbig umrahmt:
   rosa = Pflichtfeld auszufüllen, grün = bestätigt. Gelb (Vorschlag) siehe .is-vorschlag. */
.konto-field.marker-rot .inp-konto { border-color: var(--red); background: var(--red-soft); }
.konto-field.marker-gruen .inp-konto { border-color: var(--ok); }

/* Legenden-Muster: kleines umrahmtes Kästchen statt Icon-Badge. */
.konto-swatch { display: inline-block; width: 22px; height: 15px; border-radius: 5px;
  border: 2px solid var(--line); background: #fff; flex: none; }
.konto-swatch.sw-rot { border-color: var(--red); background: var(--red-soft); }
.konto-swatch.sw-gelb { border-color: #e8c98b; background: #fffaf0; }
.konto-swatch.sw-gruen { border-color: var(--ok); }

/* Werbungskosten: Kostenart als Pulldown */
.sel-kostenart { width: 100%; max-width: 240px; padding: 6px 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.sel-kostenart:focus { outline: none; border-color: var(--accent); }
.sel-kostenart.marker-rot { border-color: var(--red); background: var(--red-soft); }
.sel-kostenart.marker-gruen { border-color: var(--ok); }

/* Retoure / bereits gebucht */
.stat.retour .num { color: #5b6573; }
.stat.gebucht .num { color: var(--accent); }
table.kontierung tr.is-retour, table.kontierung tr.is-gebucht { opacity: .72; }
table.kontierung tr.is-retour td:first-child { box-shadow: inset 3px 0 0 #9aa3b2; }
table.kontierung tr.is-gebucht td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.js-flag.active { background: #e7eaf0; color: #3a414d; border-color: #c4cbd6; font-weight: 600; }
.kc-retour { font-size: 12px; color: #5b6573; }

/* Noch nicht bestätigter Vorschlag im Feld: dezent gelb, kursiv */
.inp-konto.is-vorschlag { background: #fffaf0; border-color: #e8c98b; color: var(--warn); font-style: italic; }
.inp-konto.is-vorschlag:focus { color: var(--ink); font-style: normal; }

/* BU-Feld bei Automatikkonten (AV/AM): "auto"-Badge statt Steuerschlüssel */
.bu-auto { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 5px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  border: 1px solid #d8e0ec; cursor: help; letter-spacing: .3px; }

/* Marker-Legende unter der Überschrift */
.marker-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0; }
.marker-legend li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.marker-legend .konto-marker { cursor: default; }
.konto-suggest { position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 40;
  min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(20, 30, 50, .16); overflow: hidden; }
.ks-item { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; cursor: pointer; font-size: 12.5px; }
.ks-item.active, .ks-item:hover { background: var(--accent-soft); }
.ks-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); min-width: 40px; flex: none; }
.ks-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.kontierung .item-cell { min-width: 200px; }
table.kontierung .item-title { font-size: 12.5px; }
.col-doc { white-space: nowrap; }
.col-doc .doc { padding: 2px 7px; font-size: 11.5px; margin-right: 2px; }
/* Fehlende Rechnung: Anfordern-Button bzw. Hinweis statt falscher 0 */
.col-doc .btn.request { padding: 4px 9px; font-size: 11.5px; white-space: nowrap;
  background: var(--warn-soft); color: var(--warn); border-color: #e8c98b; }
.col-doc .btn.request:hover { filter: brightness(.98); }
.col-doc .no-invoice { font-size: 11.5px; color: var(--muted); font-style: italic; }
.empty-row { text-align: center; color: var(--muted); padding: 26px; }

/* Gruppen-Kopfzeile (Ansicht nach Rechnung/Bestellung) */
table.kontierung tr.group-head td { background: var(--accent-soft); padding: 9px 12px;
  border-top: 2px solid #d8e0ec; }
.gh-date { font-weight: 600; color: var(--muted); margin-right: 10px; }
.gh-title { font-weight: 650; color: var(--ink); }
table.kontierung tr.group-head .doc { margin-left: 10px; }
.gh-sum { float: right; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Kontierung-Übersicht (Kacheln je Betrieb) */
.kont-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.kont-card { display: block; padding: 16px; text-decoration: none; color: var(--ink);
  border-left: 3px solid var(--line); transition: box-shadow .12s, transform .12s; }
.kont-card:hover { box-shadow: 0 4px 16px rgba(20, 30, 50, .10); transform: translateY(-1px); }
.kont-card.status-fertig { border-left-color: var(--ok); }
.kont-card.status-offen { border-left-color: var(--warn); }
.kont-card.status-differenzen { border-left-color: var(--red); }
.kont-card.status-leer { border-left-color: var(--line); }
.kc-pill.differenzen { background: var(--red-soft); color: var(--red); }
.kont-card.status-differenzen .kc-bar span { background: var(--red); }
.kc-diff { color: var(--red); font-weight: 600; }
.kc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kc-name { font-weight: 650; font-size: 15px; }
.kc-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.kc-pill.fertig { background: var(--ok-soft); color: var(--ok); }
.kc-pill.offen { background: var(--warn-soft); color: var(--warn); }
.kc-pill.leer { background: #eef0f3; color: #5b6573; }
.kc-bar { height: 7px; background: var(--line); border-radius: 5px; overflow: hidden; }
.kc-bar span { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.kont-card.status-offen .kc-bar span { background: var(--warn); }
.kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.kc-count { font-size: 12.5px; color: var(--muted); }
.kc-go { font-size: 12.5px; color: var(--accent); font-weight: 600; }

.crumb { margin: 0 0 4px; }
.crumb a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.crumb a:hover { color: var(--accent); }
.hidden { display: none !important; }

/* Fehlende Rechnungen */
.stat.bad .num { color: var(--red); }
.miss-list { display: flex; flex-direction: column; gap: 12px; }
.miss-card { padding: 16px; }
.miss-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.miss-head .date { font-weight: 600; }
.miss-head .oid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 12px; margin-left: auto; }
.miss-items { list-style: none; margin: 10px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.miss-items li { display: flex; align-items: center; gap: 10px; }
.miss-items .item-thumb { width: 30px; height: 30px; }
.miss-items .item-title { font-size: 13px; -webkit-line-clamp: 1; }
.miss-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end;
  border-top: 1px solid var(--line); padding-top: 12px; }
.miss-step label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.gmail-row, .upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gmail-q { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--accent-soft); color: var(--ink); padding: 6px 9px; border-radius: 7px;
  max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.miss-upload input[type="file"] { font: inherit; font-size: 12px; max-width: 220px; }
.miss-step .btn.request { background: var(--warn-soft); color: var(--warn); border-color: #e8c98b; }

/* Rechnung-Prüfen (Plausibilität) */
.pruef-card { padding: 20px; max-width: 620px; }
.pruef-verdict { font-size: 15px; font-weight: 600; padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; }
.pruef-verdict.verdict-ok { background: var(--ok-soft); color: var(--ok); }
.pruef-verdict.verdict-abweichung { background: var(--red-soft); color: var(--red); }
.pruef-verdict.verdict-unbekannt { background: var(--warn-soft); color: var(--warn); }
.pruef-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.pruef-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.pruef-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pruef-table td.num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pruef-item { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.pruef-hint { background: var(--red-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin: 0 0 16px; }
.pruef-actions { display: flex; gap: 10px; }
.pruef-actions form { display: inline; }

/* Dashboard / Start */
.dash-metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 18px; min-width: 120px; }
.metric .num { display: block; font-size: 24px; font-weight: 700; color: var(--accent); }
.metric .lbl { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.dash-h2 { font-size: 15px; margin: 26px 0 12px; }
.dash-steps { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.dash-step { display: flex; gap: 12px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.dash-step.todo { opacity: .65; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.step-body { min-width: 0; }
.step-title { font-weight: 650; font-size: 14px; color: var(--ink); text-decoration: none; }
a.step-title:hover { color: var(--accent); text-decoration: underline; }
.step-info { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
table.items td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.items td.oid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.dash-download { padding: 16px 18px; }
.dash-download code { background: var(--accent-soft); padding: 2px 6px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.dash-download ol { margin: 10px 0; padding-left: 20px; }
.dash-download li { margin: 6px 0; }

/* Betriebe (gestaffelt) */
.betriebe-list { display: flex; flex-direction: column; gap: 12px; }
.betrieb-sektion { padding: 16px 18px; }
.bs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bs-name { font-size: 16px; font-weight: 650; min-width: 220px; padding: 8px 10px; }
.bs-head-actions { display: flex; gap: 8px; flex: none; }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px; }
.bs-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; }
.bs-grid label input, .bs-grid label select { font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; }
.bs-grid label.bs-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink);
  font-weight: 500; font-size: 13px; text-transform: none; letter-spacing: 0; align-self: end; }

/* Purposes page */
table.purposes { width: 100%; border-collapse: collapse; }
table.purposes th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 12px 12px 8px; }
table.purposes td { padding: 8px 12px; border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.add-card { margin-top: 16px; padding: 18px; }
.add-card h2 { font-size: 15px; margin: 0 0 12px; }
.add-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-form input { min-width: 180px; }

/* ---- Benutzerkonten: Anmelden / Registrieren / Konto ---- */
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-wrap { max-width: 640px; margin: 24px auto; }
.auth-card { padding: 26px 28px; }
.auth-card h1 { margin: 0 0 6px; }
.auth-card.auth-wide { max-width: 640px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.auth-form > label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px;
  color: var(--muted); font-weight: 600; }
.auth-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--card); }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form input:disabled { background: #f3f5f8; color: var(--muted); }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.auth-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px;
  color: var(--muted); font-weight: 600; }
.auth-col2 { grid-column: 1 / -1; }
.auth-check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--ink); font-weight: 500; }
.auth-check input { margin-top: 2px; }
.auth-inline { flex-direction: row !important; align-items: center; gap: 8px !important; }
.auth-inline input { max-width: 200px; }
.auth-error { background: var(--red-soft); color: var(--red); border: 1px solid #f3c6bf;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 6px 0; }
.auth-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe6cf;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 6px 0; }
.auth-alt { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Status-Tags in Admin-Tabellen */
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px;
  font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-off { background: #e7eaf0; color: #5b6573; }
tr.is-inactive { opacity: .55; }
.tc-code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); padding: 2px 7px; border-radius: 6px; }

/* Rechtsseiten */
.legal h2 { font-size: 15px; margin: 18px 0 6px; }
.legal p { line-height: 1.55; color: var(--ink); }
.legal-todo { background: var(--warn-soft); color: var(--warn); border: 1px solid #ecd6a8;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }

/* ---- Rechtstexte: Anzeige + Editor ---- */
.legal-content { white-space: pre-wrap; line-height: 1.62; color: var(--ink); font-size: 14px; }
.legal-edit { margin-bottom: 18px; }
.legal-edit form { display: flex; flex-direction: column; gap: 10px; }
.le-titel, .le-inhalt { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.le-titel input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 15px; font-weight: 600; text-transform: none; color: var(--ink); }
.le-inhalt textarea { padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13.5px; line-height: 1.55; color: var(--ink); text-transform: none;
  font-weight: 400; resize: vertical; }
.le-inhalt textarea:focus, .le-titel input:focus { outline: none; border-color: var(--accent); }
.le-foot { display: flex; align-items: center; justify-content: space-between; }

/* ---- Admin: Preismodelle ---- */
.pm-head, .pm-row { display: grid; gap: 10px; align-items: center;
  grid-template-columns: 1.2fr .7fr .7fr 1.6fr auto auto; }
.pm-head { padding: 0 2px 6px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.pm-row { padding: 6px 2px; border-bottom: 1px solid var(--line); margin: 0; }
.pm-row input[type=text], .pm-row input:not([type]) { width: 100%; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.pm-row input:focus { outline: none; border-color: var(--accent); }
.pm-check { display: flex; justify-content: center; }
.pm-add { margin-top: 12px; border-bottom: none; }

/* ---- Mein Konto: Tarifauswahl ---- */
.pm-select { display: block; }
.pm-cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.pm-card { display: flex; flex-direction: column; gap: 3px; min-width: 150px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; position: relative; }
.pm-card:hover { border-color: var(--accent); }
.pm-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.pm-card input { position: absolute; opacity: 0; }
.pm-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.pm-preis { font-size: 13px; color: var(--accent); font-weight: 600; }
.pm-desc { font-size: 12px; color: var(--muted); }

/* ============ Werbe-Startseite (Landing) ============ */
.container.landing { max-width: 1120px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center;
  padding: 28px 0 36px; }
.hero-text { animation: fadeUp .7s ease both; }
.hero-eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 20px; }
.hero-title { font-size: 40px; line-height: 1.12; margin: 16px 0 0; font-weight: 750; letter-spacing: -.5px; }
.hero-accent { color: var(--accent); }
.hero-sub { font-size: 16.5px; line-height: 1.55; color: var(--muted); margin: 16px 0 24px; max-width: 30em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.hero-art { animation: fadeUp .7s .12s ease both; }
.hero-art svg { width: 100%; height: auto; }

/* Animationen im Hero-Bild */
.float-a { animation: floaty 4.5s ease-in-out infinite; }
.float-b { animation: floaty 5.2s ease-in-out .6s infinite; transform-box: fill-box; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.pulse { animation: pulse 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.ring { animation: ring 3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { 0% { transform: scale(.85); opacity: .5; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }
.row { transform-box: fill-box; transform-origin: left center; animation: grow 3s ease-in-out infinite; }
.row.r2 { animation-delay: .25s; } .row.r3 { animation-delay: .5s; }
@keyframes grow { 0%,100% { transform: scaleX(.4); opacity: .6; } 50% { transform: scaleX(1); opacity: 1; } }
.svg-check { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw 3s ease-in-out infinite; }
@keyframes draw { 0%,40% { stroke-dashoffset: 22; } 60%,100% { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Vorteile */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 6px 0 40px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px;
  box-shadow: var(--shadow); animation: fadeUp .6s ease both; }
.features .feat:nth-child(2) { animation-delay: .08s; }
.features .feat:nth-child(3) { animation-delay: .16s; }
.feat-ic { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px;
  background: var(--accent-soft); border-radius: 11px; margin-bottom: 12px; }
.feat h3 { margin: 0 0 6px; font-size: 16px; }
.feat p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* Abschluss-Band */
.cta-band { text-align: center; background: linear-gradient(135deg, #3a5a92, #2f4b7c);
  color: #fff; border-radius: 18px; padding: 34px 24px; margin: 0 0 30px; }
.cta-band h2 { margin: 0 0 18px; font-size: 23px; font-weight: 700; }
.cta-band .btn.primary { background: #fff; color: var(--accent); border-color: #fff; }
.cta-band .btn.primary:hover { filter: brightness(.96); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 360px; }
  .hero-title { font-size: 32px; }
  .features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .float-a,.float-b,.pulse,.ring,.row,.check,.hero-text,.hero-art,.feat { animation: none !important; }
}

/* Home-Symbol in der Navigation */
.nav-home { display: inline-flex; align-items: center; padding: 6px 12px; }
.nav-home svg { display: block; }
.cta-trust { margin: 14px 0 0; font-size: 12.5px; color: rgba(255,255,255,.85); }

/* Rechtsseiten – Feinschliff */
.legal-intro { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 6px; }
.legal-stand { margin-top: 18px; font-size: 12px; color: var(--muted); font-style: italic; }
.legal ul { line-height: 1.6; }
.legal-cookie-table { margin: 12px 0; }
.legal-cookie-table th, .legal-cookie-table td { font-size: 13px; }

/* Cookie-Hinweis-Banner */
.cookie-note { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20,30,50,.18); padding: 12px 16px; font-size: 13px; color: var(--ink); }
.cookie-note a { color: var(--accent); }
.cookie-note .btn { white-space: nowrap; }
/* hidden-Attribut muss die display:flex-Regel überstimmen können */
.cookie-note[hidden] { display: none; }
.cookie-actions { display: flex; gap: 8px; white-space: nowrap; }

/* Konto löschen */
.danger-zone { margin-top: 20px; padding: 20px 22px; border-color: #f1c9c2; }
.danger-zone h2 { margin: 0 0 8px; font-size: 16px; color: var(--red); }
.danger-zone p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 12px; }
.danger-zone .auth-check { margin-bottom: 12px; }

/* Kontenrahmen & BU-Schlüssel */
.bu-head, .bu-row { display: grid; grid-template-columns: 110px 110px 1fr auto; gap: 10px; align-items: center; }
.bu-head { padding: 0 2px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.bu-row { padding: 6px 2px; border-bottom: 1px solid var(--line); }
.bu-row input { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; }
.bu-row input:focus { outline: none; border-color: var(--accent); }
.bu-row input:disabled { background: #f3f5f8; color: var(--ink); border-color: transparent; }
.bu-add { margin-top: 12px; border-bottom: none; }
.kr-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.kr-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.kr-scroll table { margin: 0; }
.kr-scroll thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.kr-no { white-space: nowrap; font-variant-numeric: tabular-nums; width: 90px; }
