:root {
  --bg: #f4f6f9;
  --karte: #ffffff;
  --text: #1d2733;
  --leise: #5b6878;
  --linie: #dde3ea;
  --akzent: #1f4e78;
  --akzent-hell: #e7eff7;
  --ok: #1e7a3c;
  --ok-bg: #e5f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --fehler: #a42828;
  --fehler-bg: #fde8e8;
  --info-bg: #e8f1fb;
  --radius: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12161c; --karte: #1b2129; --text: #e4e9ef; --leise: #9aa7b6; --linie: #2e3742;
  --akzent: #6aa6dc; --akzent-hell: #1f2c3a; --ok: #6fcf8d; --ok-bg: #183324;
  --warn: #f0c060; --warn-bg: #3a2f14; --fehler: #f08a8a; --fehler-bg: #3c1d1d; --info-bg: #1b2a3a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c; --karte: #1b2129; --text: #e4e9ef; --leise: #9aa7b6; --linie: #2e3742;
    --akzent: #6aa6dc; --akzent-hell: #1f2c3a; --ok: #6fcf8d; --ok-bg: #183324;
    --warn: #f0c060; --warn-bg: #3a2f14; --fehler: #f08a8a; --fehler-bg: #3c1d1d; --info-bg: #1b2a3a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
.laden { padding: 2rem; color: var(--leise); }
/* Ladeanimation: ganzer Bildschirm beim Start, im Inhaltsbereich beim Reiterwechsel */
.lade-bildschirm { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; background: var(--bg); color: var(--leise); }
.lade-bereich { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; min-height: 50vh; color: var(--leise); }
.lade-kreis { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--linie); border-top-color: var(--akzent); animation: lade-drehen .8s linear infinite; }
@keyframes lade-drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lade-kreis { animation-duration: 2.4s; } }

header.kopf {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.2rem; background: var(--karte); border-bottom: 1px solid var(--linie);
}
header.kopf h1 { font-size: 1.15rem; margin: 0; flex: 1; }
header.kopf .wer { color: var(--leise); font-size: .9rem; }

/* ---- Benutzermenü oben rechts ---- */
.benutzer-huelle { position: relative; }
.benutzer-knopf { display: flex; align-items: center; gap: .5rem; font: inherit; color: var(--text); background: var(--karte);
  border: 1px solid var(--linie); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; cursor: pointer; }
.benutzer-knopf:hover, .benutzer-knopf[aria-expanded="true"] { border-color: var(--akzent); }
.benutzer-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.benutzer-knopf .pfeil { color: var(--leise); font-size: .75rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--akzent); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em; flex: none; }
:root[data-theme="dark"] .avatar { color: #10161d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: #10161d; } }
.avatar.gross { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }
.benutzer-menue { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 50; min-width: 15rem; padding: .35rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  display: flex; flex-direction: column; }
.benutzer-menue[hidden] { display: none; }
.menue-kopf { display: flex; flex-direction: column; gap: .1rem; padding: .45rem .6rem .55rem; border-bottom: 1px solid var(--linie); margin-bottom: .3rem; }
.menue-kopf .leise { overflow-wrap: anywhere; }
.menue-eintrag { font: inherit; text-align: left; color: var(--text); background: none; border: 0; border-radius: 6px; padding: .45rem .6rem; cursor: pointer; }
.menue-eintrag:hover, .menue-eintrag:focus-visible { background: var(--akzent-hell); outline: none; }
.menue-trenner { height: 1px; background: var(--linie); margin: .3rem 0; }
@media (max-width: 700px) { .benutzer-name, .benutzer-knopf .pfeil { display: none; } .benutzer-knopf { padding: .2rem; } }
.profil-kopf { display: flex; gap: 1.2rem; align-items: flex-start; }
.profil-kopf h2 { margin-bottom: .4rem; }
/* gleicher Abstand wie zwischen allen Karten (1rem), auch nach unten zur nächsten Karte */
/* doppelte Klasse, damit die allgemeine .raster-Regel (2 Spalten, kleinerer Abstand) nicht gewinnt */
.raster.profil-raster { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.profil-raster > .karte { margin: 0; display: flex; flex-direction: column; }
.profil-raster > .karte > .zeile:last-child { margin-top: auto; padding-top: .6rem; margin-bottom: 0; }
@media (max-width: 800px) { .raster.profil-raster { grid-template-columns: 1fr; } }

nav.reiter {
  display: flex; gap: .2rem; flex-wrap: wrap; padding: .5rem 1.2rem 0;
  border-bottom: 1px solid var(--linie); background: var(--karte);
}
nav.reiter button {
  border: 0; background: none; padding: .55rem .85rem; cursor: pointer; color: var(--leise);
  border-bottom: 3px solid transparent; font: inherit;
}
nav.reiter button.aktiv { color: var(--text); border-bottom-color: var(--akzent); font-weight: 600; }

main { padding: 1.2rem; max-width: 1500px; margin: 0 auto; }
.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.karte h2 { font-size: 1.05rem; margin: 0 0 .7rem; }
.karte h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
.leise { color: var(--leise); font-size: .88rem; }

.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.2rem; }
.raster-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 1rem; }
.raster-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem 1rem; }
@media (max-width: 800px) { .raster, .raster-3, .raster-5 { grid-template-columns: 1fr; } }

label.feld { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--leise); }
label.feld.unsicher > span::after { content: " ⚠️"; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--karte);
  border: 1px solid var(--linie); border-radius: 6px; padding: .4rem .55rem; width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 4rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

button.knopf {
  font: inherit; border: 1px solid var(--linie); background: var(--karte); color: var(--text);
  border-radius: 6px; padding: .45rem .9rem; cursor: pointer;
}
button.knopf:hover:not(:disabled) { border-color: var(--akzent); }
button.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
:root[data-theme="dark"] button.knopf.primaer { color: #10161d; }
button.knopf:disabled { opacity: .5; cursor: not-allowed; }
.zeile { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }

.hinweis { border-radius: 6px; padding: .55rem .8rem; margin: .4rem 0; font-size: .92rem; }
.hinweis.ok { background: var(--ok-bg); color: var(--ok); }
.hinweis.warn { background: var(--warn-bg); color: var(--warn); }
.hinweis.fehler { background: var(--fehler-bg); color: var(--fehler); }
.hinweis.info { background: var(--info-bg); }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin: .7rem 0; }
.kennzahl { background: var(--akzent-hell); border-radius: 6px; padding: .6rem .8rem; }
.kennzahl .wert { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kennzahl .name { font-size: .8rem; color: var(--leise); }

.tabelle-box { overflow-x: auto; border: 1px solid var(--linie); border-radius: 6px; max-height: 70vh; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { padding: .35rem .55rem; border-bottom: 1px solid var(--linie); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--akzent-hell); z-index: 1; font-weight: 600; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.markiert td { background: var(--warn-bg); }
td.gut { color: var(--ok); }
td.schlecht { color: var(--fehler); }
table input, table select { padding: .2rem .35rem; min-width: 7rem; }

pre.rohtext { max-height: 22rem; overflow: auto; background: var(--bg); padding: .7rem; border-radius: 6px; font-size: .8rem; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--akzent); margin: .4rem 0; }

.anmeldung { max-width: 420px; margin: 8vh auto; }
.anmeldung.breit { max-width: 640px; }
form.anmeldung > .karte + .karte { margin-top: 1rem; }
.pruefliste { list-style: none; padding: 0; margin: .2rem 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; }
.pruefliste .gut { color: var(--ok); }
.pruefliste .schlecht { color: var(--fehler); font-weight: 600; }
.anmeldung .karte { display: flex; flex-direction: column; gap: .7rem; }

.diagramm { width: 100%; height: auto; display: block; }
.diagramm text { fill: var(--leise); font-size: 11px; }
.diagramm .achse { stroke: var(--linie); }
.legende { display: flex; gap: .3rem .5rem; flex-wrap: wrap; font-size: .82rem; margin: .3rem 0 1rem; }
.legende-eintrag { font: inherit; color: var(--text); background: none; border: 1px solid transparent; border-radius: 4px; padding: .1rem .35rem; cursor: pointer; }
.legende-eintrag:hover { border-color: var(--linie); }
.legende-eintrag::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; background: var(--farbe); }
.legende-eintrag.aus { color: var(--leise); text-decoration: line-through; }
.legende-eintrag.aus::before { background: var(--linie); }
.diagramm-box { margin: .4rem 0 1rem; }
.diagramm-box figcaption { font-size: .92rem; margin-bottom: .2rem; }
.diagramm .klickbar { cursor: pointer; }
.diagramm rect.klickbar:hover, .diagramm circle.klickbar:hover { opacity: .75; }
.diagramm circle.punkt { stroke: var(--karte); stroke-width: 1.5; }
.tooltip {
  position: fixed; z-index: 1000; pointer-events: none; max-width: 22rem;
  background: var(--text); color: var(--karte); border-radius: 6px; padding: .3rem .55rem; font-size: .82rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}

/* ---- Farbtabelle ---- */
.farbtabelle { max-height: 60vh; }
.farbtabelle td.wert { color: #10161d; font-variant-numeric: tabular-nums; text-align: right; }
.farbtabelle td.klickbar { cursor: pointer; }
.farbtabelle td.klickbar:hover { outline: 2px solid var(--akzent); outline-offset: -2px; }
.farbtabelle td.leer { background: var(--bg); }
.farbtabelle th.zeilenkopf { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: 500; }
.farbskala { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; }
.farbskala .verlauf { width: 10rem; height: .6rem; border-radius: 3px; background: linear-gradient(90deg, hsl(130 62% 50%), hsl(65 62% 50%), hsl(0 62% 50%)); }

/* ---- Kennzahlen mit Vergleich ---- */
.kennzahlen.gross .kennzahl .wert { font-size: 1.45rem; }
.kennzahl .delta { font-size: .8rem; margin-top: .15rem; color: var(--leise); }
.kennzahl .delta.gut { color: var(--ok); }
.kennzahl .delta.schlecht { color: var(--fehler); }

/* ---- Allgemeines ---- */
button.link { font: inherit; color: var(--akzent); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: transparent; }
button.link:hover { text-decoration-color: currentColor; }
.wachsen { flex: 1; min-width: 14rem; }
.marke { display: inline-block; border-radius: 10px; padding: 0 .45rem; font-size: .78rem; font-weight: 600; }
.marke.warn { background: var(--warn-bg); color: var(--warn); }
tr.summe td { font-weight: 600; background: var(--akzent-hell); }
header.kopf img.logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
header.kopf h1 .firma { font-weight: 400; color: var(--leise); }
.objektwahl summary { margin: .6rem 0 .2rem; }

/* ---- Start ---- */
.willkommen { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.willkommen h2 { margin-bottom: .2rem; }
.willkommen p { margin: 0; }
.aufgaben { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.aufgaben > div > .karte, .aufgaben > .karte { margin: 0; }
.aufgabe { border-top: 4px solid var(--linie); }
.aufgabe.fehler { border-top-color: var(--fehler); }
.aufgabe.warn { border-top-color: #e0a526; }
.aufgabe.erledigt { border-top-color: var(--ok); }
.aufgabe-kopf { display: flex; justify-content: space-between; align-items: center; }
.aufgabe-kopf h3 { margin: 0; }
.zaehler { min-width: 1.8rem; text-align: center; border-radius: 12px; padding: .05rem .5rem; font-weight: 700; font-size: .85rem; }
.zaehler.fehler { background: var(--fehler-bg); color: var(--fehler); }
.zaehler.warn { background: var(--warn-bg); color: var(--warn); }
.zaehler.ok { background: var(--ok-bg); color: var(--ok); }
.aufgabe-liste { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.eintrag { display: flex; flex-direction: column; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid transparent; border-radius: 6px; padding: .35rem .55rem; cursor: pointer; }
.eintrag:hover { border-color: var(--akzent); }
.eintrag .haupt { font-weight: 500; font-size: .9rem; }
.eintrag .neben { color: var(--leise); font-size: .8rem; }
.zeile.klein { margin: .4rem 0 0; font-size: .82rem; }
.zeile.klein label.feld { width: 11rem; }

/* ---- Steckbrief ---- */
.steckbrief-daten { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: .25rem 1rem; margin: .3rem 0 .6rem; font-size: .9rem; }
.steckbrief-daten dt { color: var(--leise); }
.steckbrief-daten dd { margin: 0; }
@media (max-width: 800px) { .steckbrief-daten { grid-template-columns: max-content 1fr; } }

/* ---- Zwei-Faktor / Erscheinungsbild ---- */
.schritte { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
img.qr { margin: .4rem 0; image-rendering: pixelated; border-radius: 6px; background: #fff; }
code.schluessel { font-size: .95rem; letter-spacing: .05em; }
.code-eingabe { width: 9rem; font-size: 1.2rem; letter-spacing: .2em; }
pre.reserve { font-size: 1.1rem; background: var(--bg); padding: .8rem 1rem; border-radius: 6px; columns: 2; }
.logo-vorschau { padding: .6rem; border: 1px solid var(--linie); border-radius: 6px; background: #fff; display: inline-block; margin-bottom: .4rem; }
img.logo-gross { max-height: 80px; max-width: 280px; display: block; }

/* ---- Verträge, Zähler, Anlernen, Nutzung ---- */
.ampel { display: inline-block; border-radius: 10px; padding: 0 .45rem; font-variant-numeric: tabular-nums; }
.ampel.rot { background: var(--fehler-bg); color: var(--fehler); font-weight: 600; }
.ampel.gelb { background: var(--warn-bg); color: var(--warn); }
.ampel.gruen { color: var(--ok); }
.ampel.vorbei { color: var(--leise); text-decoration: line-through; }
.karte h4, .dialog h4 { margin: .8rem 0 .3rem; font-size: .9rem; }
pre.rohtext.anlernen { max-height: 40vh; cursor: text; user-select: text; border: 1px solid var(--linie); }
pre.rohtext.anlernen::selection, pre.rohtext.anlernen *::selection { background: #ffd54a; color: #10161d; }
input.regel { font-family: Consolas, monospace; font-size: .8rem; min-width: 24rem; }
.mini-balken { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.4rem; width: 6.5rem; vertical-align: middle; }
.mini-balken i { flex: 1; background: var(--akzent); border-radius: 1px 1px 0 0; min-height: 1px; }
details > summary { font-weight: 600; }
details[open] > summary { margin-bottom: .4rem; }

/* ---- Monatsbericht ---- */
.bericht { background: #fff; color: #1d2733; border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.6rem 2rem; max-width: 1050px; margin: 0 auto; }
.bericht .leise { color: #5b6878; }
.bericht h2 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; border-bottom: 2px solid #1f4e78; padding-bottom: .2rem; color: #1f4e78; }
.bericht-kopf { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 3px solid #1f4e78; padding-bottom: .8rem; }
.bericht-kopf h1 { margin: .2rem 0; font-size: 1.5rem; }
.bericht-firma { font-weight: 600; color: #1f4e78; }
.bericht-hv { font-size: 1.05rem; }
.bericht-rechts { text-align: right; }
img.bericht-logo { max-height: 64px; max-width: 220px; display: block; margin-left: auto; margin-bottom: .3rem; }
.bericht .kennzahl { background: #e7eff7; }
.bericht .kennzahl .delta.gut { color: #1e7a3c; }
.bericht .kennzahl .delta.schlecht { color: #a42828; }
/* Im Bericht nie scrollen: Tabelle passt sich der Breite an, Text darf umbrechen, Zahlen nicht */
.bericht .tabelle-box { max-height: none; overflow: visible; border-color: #dde3ea; }
.bericht table { width: 100%; table-layout: auto; font-size: .82rem; }
.bericht th, .bericht td { white-space: normal; padding: .3rem .4rem; vertical-align: top; }
.bericht td.zahl { white-space: nowrap; }
.bericht th.zahl { white-space: normal; hyphens: auto; }
.bericht th { position: static; }
.bericht th { background: #e7eff7; color: #1d2733; }
.bericht td, .bericht th { border-color: #dde3ea; color: #1d2733; }
.bericht td.gut { color: #1e7a3c; }
.bericht td.schlecht { color: #a42828; }
.bericht tr.markiert td { background: #fff4d6; }
.bericht tr.summe td { background: #e7eff7; }
.bericht .diagramm text { fill: #5b6878; }
.bericht .diagramm .achse { stroke: #dde3ea; }
.bericht .legende-eintrag { color: #1d2733; }
.bericht-punkte { margin: .3rem 0; padding-left: 1.2rem; }
.bericht-punkte li { margin: .15rem 0; }
.bericht-fuss { margin-top: 1.5rem; border-top: 1px solid #dde3ea; padding-top: .5rem; font-size: .78rem; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --karte: #fff; --text: #1d2733; --leise: #5b6878; --linie: #dde3ea; --akzent-hell: #e7eff7; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  header.kopf, nav.reiter, .keindruck, .tooltip, dialog { display: none !important; }
  main { padding: 0; max-width: none; }
  .bericht { border: 0; padding: 0; max-width: none; }
  .bericht section, .bericht .diagramm-box, .bericht tr { break-inside: avoid; }
  .bericht .raster { grid-template-columns: 1fr 1fr; }
  .bericht .legende-eintrag { border: 0; padding: 0 .3rem 0 0; }
  .bericht table { font-size: 8pt; }
  .bericht th, .bericht td { padding: 2pt 3pt; }
  .bericht .tabelle-box { overflow: visible !important; border: 0; }
  .bericht thead { display: table-header-group; }   /* Kopfzeile auf jeder Seite wiederholen */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.auswahl-liste { display: flex; flex-wrap: wrap; gap: .3rem 1rem; max-height: 9rem; overflow: auto; font-size: .88rem; }

.raster-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1rem; }
@media (max-width: 800px) { .raster-4 { grid-template-columns: 1fr; } }

button.knopf.klein { padding: .1rem .35rem; font-size: .85rem; line-height: 1.2; }
.symbole { display: inline-flex; gap: .3rem; align-items: center; }
a.symbol { text-decoration: none; font-size: 1rem; }
table select.gespeichert { border-color: var(--ok); }
.umbruch { white-space: normal; display: inline-block; min-width: 24rem; }

.aktionen { background: var(--akzent-hell); margin-top: 1rem; }
.aktionen .trenner { width: 1px; align-self: stretch; background: var(--linie); margin: 0 .4rem; }
.aktionen select { width: auto; }

dialog.dialog {
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.2rem;
  background: var(--karte); color: var(--text); width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}
dialog.dialog::backdrop { background: rgba(10, 20, 30, .45); }
dialog.dialog h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.dialog-inhalt { display: flex; flex-direction: column; gap: .5rem; }
.dialog-knoepfe { justify-content: flex-end; position: sticky; bottom: -1rem; background: var(--karte); padding: .6rem 0 .2rem; margin-bottom: 0; }

/* ---- Ablagefeld (Drag & Drop) ---- */
.ablage-bereich { display: flex; flex-direction: column; gap: .6rem; margin: .4rem 0; }
.ablage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  min-height: 11rem; padding: 1.4rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--linie); border-radius: 12px; background: var(--bg);
  transition: border-color .15s, background-color .15s, transform .15s;
}
.ablage:hover, .ablage:focus-visible { border-color: var(--akzent); background: var(--akzent-hell); outline: none; }
.ablage.ueber { border-color: var(--akzent); border-style: solid; background: var(--akzent-hell); transform: scale(1.01); }
.ablage.hat-dateien { min-height: 7rem; }
.ablage-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ablage-symbol { font-size: 2.4rem; line-height: 1; }
.ablage.ueber .ablage-symbol { animation: hueppen .6s ease-in-out infinite alternate; }
@keyframes hueppen { to { transform: translateY(-4px); } }
.ablage-text { font-size: 1.05rem; font-weight: 600; }
.ablage-oder { color: var(--leise); }
.ablage-link { color: var(--akzent); text-decoration: underline; }
.datei-liste { display: flex; flex-direction: column; gap: .35rem; }
.datei-chip {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem;
  border: 1px solid var(--linie); border-radius: 8px; background: var(--karte);
}
.datei-symbol { font-size: 1.2rem; }
.datei-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.datei-summe { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }

/* ---- Ladeanzeige ---- */
.hinweis.lade { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lader {
  width: 1rem; height: 1rem; border-radius: 50%; flex: none;
  border: 2px solid var(--linie); border-top-color: var(--akzent); animation: drehen .8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }
.fortschritt { flex-basis: 100%; height: 4px; background: var(--linie); border-radius: 2px; overflow: hidden; }
.fortschritt > div { height: 100%; background: var(--akzent); transition: width .3s; }

/* ---- Vorschau-Popup ---- */
dialog.dialog.vorschau { width: min(1200px, calc(100vw - 32px)); height: calc(100vh - 48px); display: flex; flex-direction: column; }
dialog.dialog.vorschau:not([open]) { display: none; }
dialog.vorschau .dialog-inhalt { flex: 1; min-height: 0; }
.vorschau-rahmen { flex: 1; width: 100%; min-height: 60vh; border: 1px solid var(--linie); border-radius: 6px; background: #fff; }
.vorschau-bild { flex: 1; overflow: auto; text-align: center; background: var(--bg); border-radius: 6px; }
.vorschau-bild img { max-width: 100%; height: auto; }
dialog.vorschau .dialog-knoepfe { position: static; }
a.knopf { text-decoration: none; display: inline-block; }

/* ---- Export-Dialog ---- */
dialog.dialog.breit { width: min(1000px, calc(100vw - 32px)); }
.export-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 800px) { .export-raster { grid-template-columns: 1fr; } }
.export-raster h3 { margin: .6rem 0 .4rem; }
.export-inhalte { display: flex; flex-direction: column; gap: .35rem; }
.export-inhalt { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--linie); border-radius: 8px; cursor: pointer; }
.export-inhalt:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.export-inhalt input { margin-top: .2rem; }
.export-inhalt span { display: flex; flex-direction: column; }
.export-vorschau { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.export-vorschau .export-zeitraum { grid-column: 1 / -1; margin: 0; }

.stamm-liste { display: flex; flex-direction: column; gap: .6rem; }
.stamm-hv { border: 1px solid var(--linie); border-radius: 6px; padding: .5rem .7rem; }
.stamm-hv ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.stamm-zeile { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .1rem 0; }
