/*
 * Gestaltung des Task Panes. Bewusst schlank und ohne Framework: das Pane
 * ist standardmaessig rund 350 px breit, jedes zusaetzliche Layoutsystem
 * kostet dort mehr Platz als es bringt.
 *
 * Alle Farben, Schriften und Masse kommen aus `design-tokens.css`
 * (Design-System, Richtung „Ledger Blue", uebernommen am 01.08.2026).
 * **In dieser Datei steht kein Farbwert mehr**, bis auf zwei bewusste
 * Ausnahmen: reines Weiss auf dunklem Grund und die abgedunkelte Fassung
 * der Primaerfarbe fuer den Mauszeiger-Zustand.
 *
 * Die vorherigen Variablen (`--rand`, `--betont`, …) sind entfallen,
 * nachdem der letzte Bereich umgestellt war. Sie standen bewusst bis
 * dahin - ein halb migrierter Bereich, dessen Variable es nicht mehr gibt,
 * faellt auf die Vorgabefarbe des Browsers und sieht aus wie ein Fehler.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 12px;
  font-family: var(--ds-schrift);
  font-size: 14px;
  color: var(--ds-text-koerper);
  background: var(--ds-grund);
}

h1 {
  margin: 0;
  font-size: 17px;
}

/* --- Kopfzeile ------------------------------------------------------------
 *
 * Die Leiste laeuft ueber die volle Breite, der Rumpf hat aber 12 px
 * Innenabstand. Statt den Abstand fuer alle Bereiche umzubauen - was jeden
 * noch nicht umgestellten Bereich mit betraefe - zieht die Leiste ihn hier
 * mit negativen Aussenabstaenden wieder heraus. Ein enger, umkehrbarer
 * Eingriff; beim Umstellen des letzten Bereichs faellt er weg.
 */

.kopfleiste {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -12px -12px 10px;
  padding: 12px 14px;
  background: var(--ds-primaer);
}

.kopfleiste h1 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* Die Verbindungsampel schiebt sich an den rechten Rand der Leiste -
   `margin-left: auto` statt `justify-content: space-between` am Flex-
   Container: sonst rueckte die Wortmarke von der Leiste weg in die Mitte.
   Der Text ist weiss auf dunkel (die einzige Farbe, die diese Datei
   selbst nennen darf); die drei Punktfarben kommen als Tokens. */
.verbindungsampel {
  margin-left: auto;
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
  color: #fff;
}

.verbindungsampel .ampelpunkt {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  /* Vorgabe = „ruht" (grau): Vouchly prueft noch nichts. Die anderen drei
     Lagen setzen ihre Farbe per Klasse. */
  background: var(--ds-ampel-ruht);
  /* Heller Ring: hebt den Punkt vom dunklen Blau ab, auch wenn die
     Punktfarbe selbst darauf zulaeuft (dasselbe Mittel wie die helle
     Traegerflaeche der Menueband-Symbole). */
  box-shadow: 0 0 0 1px rgb(255 255 255 / 45%);
}

.verbindungsampel.pruefe .ampelpunkt {
  background: var(--ds-ampel-pruefe);
}

.verbindungsampel.gut .ampelpunkt {
  background: var(--ds-ampel-gut);
}

.verbindungsampel.fehler .ampelpunkt {
  background: var(--ds-ampel-fehler);
}

.datenschutz {
  margin: 0 0 12px;
}

/* Die Bereichsueberschrift des Entwurfs: klein, gesperrt, zart. Sie gilt
   fuer alle Bereiche - eine Ueberschrift, die je nach Bereich anders
   aussieht, waere der auffaelligste Bruch einer halben Umstellung. */
h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-text-zart);
}

header {
  margin-bottom: 12px;
}

.fussnote {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ds-text-gedaempft);
}

.hinweiskasten {
  padding: 16px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
}

/* --- Reiterleiste (01.09.2026) ------------------------------------------
 *
 * Drei Reiter aus dem Design-Entwurf: Belege / Pruefungen / Mappe. Der
 * aktive traegt die Primaerfarbe und eine Unterstreichung, die inaktiven
 * `--ds-text-zart` (im Design-System ausdruecklich „inaktive Reiter").
 * Kein Rahmen um die Felder - die Trennung macht allein die Leiste.
 */
.reiterleiste {
  display: flex;
  gap: 2px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--ds-rand-kraeftig);
}

.reiterleiste button {
  flex: 1;
  padding: 8px 4px 9px;
  border: none;
  /* Der Strich liegt genau auf der Leiste (negativer Aussenabstand), sonst
     entstuende beim Wechsel ein 1-px-Versatz. Immer 2 px, nur die Farbe
     wechselt - kein Ruckeln. */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-text-zart);
  cursor: pointer;
}

.reiterleiste button[aria-selected="true"] {
  font-weight: 600;
  color: var(--ds-primaer);
  border-bottom-color: var(--ds-primaer);
}

.reiterleiste button:hover:not([aria-selected="true"]) {
  color: var(--ds-text-koerper);
}

.reiterleiste button:focus-visible {
  outline: 2px solid var(--ds-akzent);
  outline-offset: -2px;
}

/* --- Bereiche mit einer Handlung -------------------------------------------
 *
 * Summenpruefung, Kreuzverweis und Audit-Trail sind im Entwurf abgesetzte
 * Bloecke, keine losen Absaetze. Der Rahmen macht sichtbar, was
 * zusammengehoert: Ueberschrift, Erklaerung, Schaltflaeche und Befund.
 */

.pruefung {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
}

.pruefung h2 {
  margin-bottom: 8px;
}

.pruefung .fussnote {
  margin: 0 0 10px;
}

.pruefung .fussnote:empty {
  display: none;
}

/* --- Verwaiste Verknuepfungen ------------------------------------------- */

.verwaisteliste {
  margin-top: 10px;
}

.verwaisteliste:empty {
  display: none;
}

.verwaisteliste h3 {
  margin: 12px 0 4px;
  font-size: 12px;
}

.verwaisteliste h3:first-child {
  margin-top: 0;
}

.verwaisteliste ul {
  margin: 0;
  padding-left: 18px;
}

.verwaisteliste li {
  margin-bottom: 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ds-text-koerper);
}

#audit input[type="text"] {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 8px;
  font: inherit;
  color: var(--ds-text);
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-feld, 4px);
  background: var(--ds-flaeche-eingabe, #fff);
}

/* --- PDF-Arbeitspapier: Zielordner waehlen (Roadmap F) ---------------- */

/* Beschriftung ueber dem Feld - ein <label>, von Haus aus inline. */
.feldbeschriftung {
  display: block;
  margin: 0 0 4px;
  font-size: 11.5px;
  color: var(--ds-text-gedaempft);
}

/* Der Ordner-Dialog-Knopf steht UNTER dem Feld, nicht daneben. Die fruehere
   Flex-Zeile drueckte das Feld auf null zusammen: `.pruefung button` gibt
   jedem Knopf 100% Breite, `button.flach` verbot ihm mit `flex:none` das
   Schrumpfen - also blieb fuer das Feld nichts uebrig (Jonas 01.09.2026).
   Ein Nebenknopf: schmal, umrandet, nicht der grosse Primaerknopf. */
#audit .ordnerknopf {
  width: auto;
  margin: 0 0 10px;
  padding: 5px 12px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-feld, 4px);
  background: var(--ds-flaeche-eingabe, #fff);
  color: var(--ds-text-koerper);
  font-weight: 400;
  cursor: pointer;
}

/* ⚠ `:not([hidden])` - ein `display:flex` ohne das schlaege das
   hidden-Attribut, und die Knoepfe stuenden schon vor dem ersten PDF da. */
.arbeitspapier-oeffnen:not([hidden]) {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#audit .arbeitspapier-oeffnen .ordnerknopf {
  margin: 0;
}

#audit .ordnerknopf:hover {
  background: var(--ds-grund);
  border-color: var(--ds-rand);
}

/* --- Doppelte Belege (Roadmap C) ------------------------------------- */

.dubletten {
  margin-top: 16px;
}

.dublettenliste {
  margin-top: 10px;
}

.dublettenliste:empty {
  display: none;
}

.dublettengruppe {
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ds-text-koerper);
}

/* Der Verdachtsgrad traegt zusaetzlich `.warnung` - dann getoente Box statt
   Fliesstext. Ohne die Box: nur ein Absatz mit Abstand. */
.dublettengruppe:not(.warnung) {
  padding-left: 2px;
}

.dublettengruppe .dublettennr {
  font-weight: 600;
}

/* Der Knopf steht NACH Kopfzeile und Liste. Luft nach oben, damit er sich
   vom Ergebnis absetzt – dieselbe Anordnung wie „#stapel-uebernehmen". */
#dubletten-suchen {
  margin-top: 10px;
}

/* --- Stapel-Abgleich -------------------------------------------------- */

.stapelliste {
  margin-top: 10px;
}

.stapelliste:empty {
  display: none;
}

.stapelliste h3 {
  margin: 12px 0 4px;
  font-size: 12px;
}

.stapelliste h3:first-child {
  margin-top: 0;
}

.stapelliste ul {
  margin: 0;
  padding-left: 18px;
}

/* Die Schaltfläche „Alle N automatisch verknüpfen" steht NACH der Liste der
   Gruppe (nicht zwischen Hinweis und Liste). Etwas Luft nach oben, damit sie
   sich von der Aufzählung absetzt; nach unten, falls die zweite Gruppe folgt. */
#stapel-uebernehmen {
  margin: 10px 0 6px;
}

.stapelliste li {
  margin-bottom: 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ds-text-koerper);
}

/* --- Felder aus diesem Beleg (Roadmap A) ----------------------------- */

.felder {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
}

.felder > summary {
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.felder .fussnote {
  margin: 6px 0 8px;
}

#felder-lesen {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-primaer);
  color: #fff;
  cursor: pointer;
}

#felder-lesen:disabled {
  opacity: 0.6;
  cursor: default;
}

.felderliste {
  margin-top: 8px;
}

.felderliste:empty {
  display: none;
}

.feldzeile {
  display: grid;
  grid-template-columns: minmax(7.5em, auto) 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--ds-rand-zart);
  font-size: 11.5px;
}

.feldzeile:last-child {
  border-bottom: none;
}

.feldtitel {
  color: var(--ds-text-gedaempft);
}

.feldwert {
  color: var(--ds-text-koerper);
  overflow-wrap: anywhere;
}

.feldwert.zart {
  color: var(--ds-text-gedaempft);
  font-style: italic;
}

.feldhinweis {
  color: var(--ds-text-gedaempft);
  font-size: 11px;
  text-align: right;
}

/* --- Zeile aus diesem Beleg fuellen (06.10.2026) ---------------------- */

.zeilenfuellung {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ds-rand-zart);
}

.zeilenfuellung .fussnote {
  margin: 0 0 8px;
}

#zeile-fuellen {
  width: 100%;
  padding: 6px 10px;
}

/* Die Vorschau: je Tabellenspalte eine Zeile - Ueberschrift | Feld + Wert |
   was passiert. Dieselbe Bauform wie `.feldzeile`, damit beide Listen im
   selben Abschnitt gleich lesen. */
.zeilenvorschau {
  margin-top: 8px;
}

.zeilenvorschau:empty {
  display: none;
}

.vorschauzeile {
  display: grid;
  grid-template-columns: minmax(6.5em, auto) 1fr auto;
  gap: 2px 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--ds-rand-zart);
  font-size: 11.5px;
}

.vorschauzeile:last-child {
  border-bottom: none;
}

.vorschauzeile .ueberschrift {
  color: var(--ds-text-gedaempft);
  overflow-wrap: anywhere;
}

.vorschauzeile .feldwert {
  overflow-wrap: anywhere;
}

/* Spalten, die nicht geschrieben werden, treten zurueck - wie `.feldwert.zart`. */
.vorschauzeile.zart .feldwert,
.vorschauzeile.zart .ueberschrift {
  color: var(--ds-text-gedaempft);
  font-style: italic;
}

.vorschauzeile .aktion {
  color: var(--ds-text-gedaempft);
  font-size: 11px;
  text-align: right;
}

.vorschauzeile.schreibt .aktion {
  color: var(--ds-aktiv-text);
  font-weight: 600;
}

/* Der Schreibknopf: dieselbe Gestalt wie „Felder lesen" - er ist der zweite
   Schritt desselben Abschnitts. */
#zeile-schreiben {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-primaer);
  color: #fff;
  cursor: pointer;
}

#zeile-schreiben:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Verknuepfung loesen (zweistufig) --------------------------------- */

#loesen-rueckfrage .fussnote {
  margin: 0 0 8px;
}

#loesen-rueckfrage button + button {
  margin-left: 6px;
}

/* --- Schaltflaechen -------------------------------------------------------
 *
 * Vorher hatte **keine** der Aktionsschaltflaechen eine Gestaltung - sie
 * waren die Vorgabe des eingebetteten Browsers. Der Entwurf kennt genau
 * zwei Arten, und mehr braucht dieses Task Pane auch nicht:
 *
 *   primaer   dunkle Flaeche, weisser Text - die eine Handlung des Bereichs
 *   sekundaer weisse Flaeche mit Rahmen - alles Danebenliegende
 *
 * Zugeordnet wird ueber die Lage, nicht ueber Klassen im HTML: Die
 * Schaltflaeche eines Bereichs *ist* dessen Handlung. Das erspart es, jedem
 * Knopf im Markup eine Klasse anzuhaengen, und eine neue Schaltflaeche in
 * einem Bereich sieht von selbst richtig aus.
 */

/* Belege hinzufuegen. Das Label gehoert zu einem versteckten
   <input type="file"> - deshalb sieht es aus wie eine Schaltflaeche und
   ist doch keine. Dieselbe Gestaltung wie die Aktionsschaltflaechen, damit
   der Unterschied nirgends auffaellt ausser im Markup. */
.belegzufuhr {
  margin-bottom: 10px;
}

/* Unsichtbar, aber vorhanden: Das Feld bleibt fokussierbar und mit der
   Tastatur bedienbar. `display: none` oder `hidden` naehmen ihm beides -
   und damit dem Knopf, denn das Label allein nimmt keinen Fokus an. */
.nur-versteckt {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* „Archiv: Mustermann GmbH" - die erste Zeile im Bereich. Deutlicher als
   der Ordnerpfad darunter: Wer nicht sieht, in wessen Belegen er arbeitet,
   verknuepft irgendwann den Beleg des falschen Mandanten. */
.archiv {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--ds-text);
}

/* Das Suchfeld ueber der Belegliste. Volle Breite: Der Bereich ist schmal,
   und ein halbbreites Feld liesse einen Dateinamen nach zwei Woertern
   abschneiden. */
.belegsuche {
  margin: 8px 0 4px;
}

.belegsuche input {
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  color: var(--ds-text);
  background: var(--ds-flaeche);
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
}

.belegzufuhr .knopf {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-primaer);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.belegzufuhr .knopf:hover {
  background: #16283f;
  border-color: #16283f;
}

/* Ein Label bekommt vom Browser keinen Fokusrahmen - hier ist es aber das
   bedienbare Element, und mit der Tastatur muss sichtbar sein, wo man
   steht. Der Rahmen haengt deshalb am versteckten Feld und wird auf das
   Label gezeichnet. */
.belegzufuhr input:focus-visible + .knopf,
.belegzufuhr .knopf:focus-visible {
  outline: 2px solid var(--ds-akzent);
  outline-offset: 2px;
}

.pruefung button {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-primaer);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.pruefung button:hover {
  background: #16283f;
  border-color: #16283f;
}

.pruefung button:disabled {
  background: var(--ds-verwaist);
  border-color: var(--ds-verwaist);
  cursor: default;
}

/* --- Verbindungsanzeige --------------------------------------------------- */

.verbindung {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
  font-size: 12px;
}

/* Auch hier das Icon: Die Verbindungsanzeige ist ein Zustandskasten wie
   die anderen, und "ueberall gleich" gilt sonst nur fast. */
.verbindung.gut,
.verbindung.fehler {
  padding-left: 32px;
  background-repeat: no-repeat;
  background-position: 9px 50%;
  background-size: 16px 16px;
}

.verbindung.gut {
  border-color: var(--ds-aktiv);
  background-color: var(--ds-aktiv-flaeche);
  background-image: url("/assets/state-safe.svg");
  color: var(--ds-aktiv-text);
}

.verbindung.fehler {
  border-color: var(--ds-abweichung);
  background-color: var(--ds-abweichung-flaeche);
  background-image: url("/assets/state-error.svg");
  color: var(--ds-abweichung-text);
}

/* Sekundaer: Sie steht neben einer Meldung, nicht fuer sich. */
.verbindung button {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-flaeche);
  color: var(--ds-primaer);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.verbindung button:hover {
  background: var(--ds-primaer);
  color: #fff;
}

.verbindung.gut button {
  display: none;
}

.snipzahl {
  margin: -6px 0 14px;
  font-family: var(--ds-schrift-zahlen);
  font-size: 11px;
  color: var(--ds-text-zart);
}

.snipzahl:empty {
  display: none;
}

/* --- Belegliste -----------------------------------------------------------
 *
 * Umgestellt auf das Design-System (01.08.2026). Aus den einzeln gerahmten
 * Karten ist eine **flache Liste** mit Trennlinien geworden, wie im
 * Entwurf: Bei 300-350 px Breite kostet jeder Rahmen Platz, den der
 * Dateiname braucht.
 *
 * ⚠ **Der farbige Statuspunkt aus dem Entwurf fehlt hier bewusst.** Dort
 * traegt er je Beleg einen Zustand (gruen/rot/grau). Diesen Zustand gibt es
 * im Werkzeug nicht - die Punkte im Entwurf sind Beispieldaten. Ihn zu
 * zeichnen hiesse, eine Bedeutung zu erfinden, die nichts belegt; und ein
 * Punkt, der immer dieselbe Farbe hat, ist schlimmer als keiner. Sobald es
 * einen Belegzustand gibt, gehoert er hierher.
 */

.belegliste {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ds-rand-zart);
}

/* Zeile aus zwei Knoepfen: den Beleg waehlen, und ihn umbenennen. Der
   Umbenennen-Knopf steht bewusst *in* der Zeile und nicht in einem Menue -
   bei einer Liste, die man ohnehin durchsieht, ist ein zweiter Klickweg
   billiger als ein aufklappbares Etwas. Ein Knopf im Knopf ginge nicht
   (verschachtelte Buttons sind ungueltiges HTML), daher der Flex-Kasten. */
.belegzeile {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--ds-rand-zart);
}

.belegliste li button {
  display: block;
  padding: 9px 6px;
  border: none;
  /* Der linke Streifen zeigt den gewaehlten Beleg an. Er ist immer da,
     nur durchsichtig - sonst ruckte die Zeile beim Auswaehlen um seine
     Breite zur Seite. */
  border-left: 3px solid transparent;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.belegwahl {
  /* `min-width: 0` ist noetig, damit ein langer Belegname den
     Umbenennen-Knopf nicht aus der Zeile draengt: Ein Flex-Element
     schrumpft sonst nicht unter seine Inhaltsbreite. */
  flex: 1;
  min-width: 0;
}

.belegliste li button:hover {
  background: var(--ds-flaeche);
}

.belegliste li button[aria-current="true"] {
  border-left-color: var(--ds-primaer);
  background: var(--ds-flaeche);
}

.belegumbenennen {
  flex: none;
  width: 30px;
  color: var(--ds-text-zart);
  font-size: 13px;
  text-align: center;
}

.belegumbenennen:hover {
  color: var(--ds-primaer);
}

.belegloeschen:hover {
  /* Nicht die Primärfarbe: Der Knopf löscht endgültig, und das darf sich
     beim Überfahren nicht so anfühlen wie jeder andere. */
  color: var(--ds-abweichung);
}

/* Die Rückfrage vor dem Löschen. Sie klappt unter der Zeile auf, statt in
   einem Dialog zu erscheinen – ob ein `window.confirm()` im WebView2 eines
   Task Panes überhaupt kommt, ist nicht gemessen. */
.loeschfrage {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--ds-rand-zart);
  border-left: 3px solid var(--ds-abweichung);
  background: var(--ds-flaeche);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ds-text-koerper);
}

.loeschfrage p {
  margin: 0 0 6px;
}

.loeschknoepfe {
  display: flex;
  gap: 6px;
}

.loeschknoepfe .knopf {
  padding: 4px 10px;
  font-size: 11.5px;
}

.knopf.gefahr {
  border-color: var(--ds-abweichung);
  background: var(--ds-abweichung);
  color: #fff;
}

.knopf.gefahr:disabled {
  /* Gesperrt, bis die Rückfrage vollständig dasteht: Niemand soll
     bestätigen können, bevor er lesen konnte, worauf er sich einlässt. */
  opacity: 0.5;
  cursor: default;
}

/* Der Bearbeitungszustand derselben Zeile. */
.belegzeile.benennt {
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 9px;
}

.belegfeld {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--ds-rand);
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
  color: var(--ds-text-koerper);
}

.belegfeld:focus {
  outline: 2px solid var(--ds-primaer);
  outline-offset: -1px;
}

.belegname {
  display: block;
  font-size: 12px;
  color: var(--ds-text-koerper);
  overflow-wrap: anywhere;
}

.belegliste li button[aria-current="true"] .belegname {
  font-weight: 600;
  color: var(--ds-primaer);
}

.belegdaten {
  display: block;
  margin-top: 2px;
  /* Seitenzahl und Masse sind Zahlen - im Entwurf traegt die Mono-Schrift
     alles, was gezaehlt oder gemessen wird. */
  font-family: var(--ds-schrift-zahlen);
  font-size: 10.5px;
  color: var(--ds-text-zart);
}

/* Gehoert zur Belegliste: der Zustand "nichts da". Mit umgestellt, sonst
   saehe die leere Liste anders aus als die gefuellte. */
.leer {
  padding: 10px;
  border: 1px dashed var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
  color: var(--ds-text-gedaempft);
  font-size: 12px;
}

/* --- Volltextsuche (25.08.2026) --------------------------------------------
 *
 * Steht direkt unter der (dann leeren) Belegliste. Der Knopf ist sekundaer
 * wie in .verbindung - er steht neben einer Meldung ("kein Namenstreffer"),
 * nicht fuer sich, und ist nicht die Haupthandlung des Bereichs. Die
 * Trefferliste selbst nutzt dieselbe Zeilengestaltung wie .belegliste.
 */

.volltextsuche {
  margin-top: 8px;
}

.volltextsuche button {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--ds-primaer);
  border-radius: var(--ds-radius);
  background: var(--ds-flaeche);
  color: var(--ds-primaer);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.volltextsuche button:hover {
  background: var(--ds-primaer);
  color: #fff;
}

.volltextsuche .fussnote {
  margin: 6px 0 0;
}

.volltextsuche .belegliste:empty {
  border-top: none;
}

/* Der Ausschnitt um die Fundstelle - dieselbe Zelle wie .belegdaten
   (Seitenzahl/Masse), aber Fliesstext statt Zahlen: eine Textprobe aus dem
   Beleg ist keine Messgroesse. */
.volltextsuche .belegdaten {
  font-family: inherit;
  overflow-wrap: anywhere;
}

/* --- Belegansicht --------------------------------------------------------- */

.belegkopf {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

.belegtitel {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-text);
  overflow-wrap: anywhere;
}

/* Die Dokument-ID im Belegkopf - eine Zahl, also Mono, leise. */
.belegkennung {
  font-family: var(--ds-schrift-zahlen);
  font-size: 10.5px;
  color: var(--ds-verwaist);
  white-space: nowrap;
}

button.flach {
  flex: none;
  padding: 2px 6px;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--ds-akzent);
  cursor: pointer;
}

button.flach:hover {
  /* ⚠ `.pruefung button:hover` weiter oben faerbt den Grund dunkelblau –
     bei einem flachen Knopf (transparent, blaue Schrift) verschwindet die
     Schrift darin. Deshalb hier den Grund ausdruecklich zuruecksetzen, nicht
     nur die Schriftfarbe. Von Jonas am 31.08.2026 am „Vermerk zuruecknehmen"
     gemeldet; betrifft jeden `.flach`-Knopf in einem `.pruefung`-Abschnitt
     (auch „Abbrechen" beim Loesen). */
  background: none;
  border-color: transparent;
  color: var(--ds-primaer);
  text-decoration: underline;
}

.leiste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--ds-text-gedaempft);
}

.leiste label {
  display: flex;
  gap: 4px;
  align-items: center;
}

.leiste input[type="range"] {
  width: 90px;
}

/* Die drei Waehlknoepfe „Rechteck ergibt". Sie stehen zusammen in einem
   Kasten, damit sie als *eine* Entscheidung lesbar sind und nicht als drei
   Schalter, die man auch einzeln bedienen koennte. */
.modus {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
}

.modus label {
  display: flex;
  gap: 4px;
  align-items: center;
  cursor: pointer;
}

.modus-titel {
  color: var(--ds-text-gedaempft);
}

/* Spaltenzahl fuer die Tabellenuebernahme - steht unter dem Umschalter und
   nur, wenn „Tabelle" gewaehlt ist. */
.spaltenwahl {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.spaltenwahl label {
  color: var(--ds-text-gedaempft);
}

.spaltenwahl input {
  width: 5em;
  padding: 3px 6px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-feld, 4px);
  background: var(--ds-flaeche);
  color: var(--ds-text-koerper);
}

/* „mehr/weniger Spalten" nach einer Uebernahme. */
.tabellenkorrektur {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  color: var(--ds-text-gedaempft);
}

.knopf-zart {
  padding: 3px 10px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-feld, 4px);
  background: var(--ds-flaeche);
  color: var(--ds-text-koerper);
  cursor: pointer;
}

.knopf-zart:hover {
  background: var(--ds-grund);
}

.knopf-zart:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Die Buehne rollt in beide Richtungen: ein Beleg ist bei brauchbarer
   Vergroesserung breiter als das Task Pane, und das ist in Ordnung -
   verkleinern bis alles hineinpasst macht die Texterkennung ungenauer. */
.buehne {
  position: relative;
  /* 55vh liess im Task Pane kaum ein Drittel einer Seite sehen. Die Bühne
     ist der Arbeitsplatz dieses Werkzeugs - sie bekommt den Platz, den das
     Fenster hergibt. Nach Augenschein gesetzt, nicht gemessen. */
  max-height: 78vh;
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
  /* Die Bildlaufleisten sind der Weg zum Verschieben, den niemand lernen
     muss - Mittelklick und Leertaste kommen dazu, ersetzen sie aber nicht. */
  scrollbar-width: auto;
}

.buehne canvas {
  display: block;
  cursor: crosshair;
  /* Ohne das fängt der Browser das Ziehen als Wischgeste ab, und es käme
     kein Rechteck zustande. Das Rollen der Bühne bleibt davon unberührt -
     `none` gilt der Leinwand, nicht ihrem Kasten. */
  touch-action: none;
}

/* Der Markierungsrahmen im Belegbetrachter - im Entwurf die eine Stelle,
   an der die Akzentfarbe auftritt. Sie ist damit im ganzen Task Pane das
   Zeichen fuer "hier wird gerade etwas aus dem Beleg geholt". */
.markierung {
  position: absolute;
  border: 2px solid var(--ds-akzent);
  background: rgba(58, 124, 165, 0.08);
  pointer-events: none;
}

.status {
  margin: 6px 0 10px;
  font-size: 11.5px;
  color: var(--ds-text-gedaempft);
}

/* --- Ergebnis ------------------------------------------------------------- */

/* Der uebernommene Wert. Im Entwurf traegt ihn die Mono-Schrift in der
   kraeftigsten Textfarbe - er ist das Ergebnis des ganzen Vorgangs und
   soll als Erstes ins Auge fallen. */
.ausgabe {
  padding: 9px 10px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius-karte);
  background: var(--ds-flaeche);
  font-family: var(--ds-schrift-zahlen);
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Der Platzhaltertext vor dem ersten Snip ist kein Ergebnis - er darf
   nicht aussehen wie einer. */
.ausgabe.leer {
  font-family: var(--ds-schrift);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ds-text-platzhalter);
}

/* Ein Zellraster darf nicht umbrechen - sonst stehen die Spalten nicht
   mehr untereinander und die Tabelle ist nicht mehr zu lesen. Es rollt
   stattdessen waagerecht, wie die Buehne. */
.ausgabe.raster {
  white-space: pre;
  overflow-x: auto;
  tab-size: 12;
}

/* --- Zustandskaesten ------------------------------------------------------
 *
 * Die drei Zustaende, die dieses Werkzeug kennt - bestaetigt, unsicher,
 * abweichend - sehen jetzt ueberall gleich aus: voller Rahmen, getoente
 * Flaeche, Icon links. Vorher trugen sie einen farbigen Streifen links und
 * unterschieden sich je nach Ort.
 *
 * ⚠ **Die Icons kommen ueber `background-image` mit serverabsolutem Pfad**,
 * nicht als `<img>` im Markup. Zwei Gruende: Die Texte dieser Kaesten
 * werden im TypeScript ueber `textContent` gesetzt - ein Bildelement darin
 * wuerde bei jeder Meldung mit ueberschrieben. Und `url(...)` in diesem
 * Stylesheet wird von keinem Loader umgeschrieben (siehe design-tokens.css),
 * ein relativer Pfad zeigte also ins Leere.
 */

.zellinfo {
  margin-top: 8px;
  font-size: 11.5px;
  /* Lange, ungebrochene Zeichenketten (z. B. der volle Pfad einer
     geschriebenen Datei) dürfen den Kasten nicht sprengen. */
  overflow-wrap: anywhere;
}

.zellinfo:empty {
  display: none;
}

.zellinfo.gut,
.zellinfo.warnung,
.zellinfo.fehler,
.warnung {
  padding: 9px 10px 9px 32px;
  border: 1px solid;
  border-radius: var(--ds-radius);
  background-repeat: no-repeat;
  background-position: 9px 9px;
  background-size: 16px 16px;
  font-size: 11.5px;
  line-height: 1.45;
}

.zellinfo.gut {
  border-color: var(--ds-aktiv);
  background-color: var(--ds-aktiv-flaeche);
  background-image: url("/assets/state-safe.svg");
  color: var(--ds-aktiv-text);
}

.zellinfo.warnung,
.warnung {
  border-color: var(--ds-unsicher);
  background-color: var(--ds-unsicher-flaeche);
  background-image: url("/assets/state-warning.svg");
  color: var(--ds-unsicher-text);
}

.warnung {
  margin-top: 8px;
}

.zellinfo.fehler {
  border-color: var(--ds-abweichung);
  background-color: var(--ds-abweichung-flaeche);
  background-image: url("/assets/state-error.svg");
  color: var(--ds-abweichung-text);
}

.woerter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.woerter.leer:empty {
  display: none;
}

.wort {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 2px 6px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius);
  background: var(--ds-flaeche);
  font-size: 11.5px;
  color: var(--ds-text-koerper);
}

.wort.unsicher {
  border-color: var(--ds-unsicher);
  background: var(--ds-unsicher-flaeche);
  color: var(--ds-unsicher-text);
}

/* Die Konfidenz ist eine Zahl - und Zahlen setzt der Entwurf in Mono. */
.wort .konfidenz {
  font-family: var(--ds-schrift-zahlen);
  font-size: 10px;
  color: var(--ds-text-zart);
}

.wort.unsicher .konfidenz {
  color: var(--ds-unsicher-text);
}

/* Seite drehen - zwei schmale Knoepfe in der Leiste (05.10.2026).
   ⚠ `:not([hidden])` - "alle Seiten" ist bei einseitigen Belegen verborgen,
   und ein `display` ohne das schluege das `hidden` still (07.10.2026). */
.leiste .drehen:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.leiste .drehen-titel {
  font-size: 0.85em;
  color: var(--ds-text-gedaempft);
}
.leiste .drehen button {
  min-width: 2em;
  padding: 2px 6px;
  font-size: 1.1em;
  line-height: 1.2;
}

/* --- Belegsammlungen (07.10.2026) --------------------------------------- */

.sammlungen {
  margin-top: 16px;
}

.sammlungswahl,
.sammlung-namensfeld,
.sammlungsknoepfe {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}

.sammlungswahl select,
.sammlung-namensfeld input {
  flex: 1;
  min-width: 0;
}

/* Das Häkchen vor einem Beleg: eigene Spalte links, senkrecht mittig. */
.sammlungshaken {
  flex: none;
  align-self: center;
  margin: 0 4px 0 2px;
  accent-color: var(--ds-akzent);
}

/* --- Servermodus: Mandantenwahl (08.10.2026) -------------------------------
   Die Liste nutzt die Gestaltung der Belegliste (Klasse `belegliste`), nur
   kuerzer - bei ueber 200 Mandanten ist das Suchfeld der eigentliche Weg. */
.mandantwahl {
  margin-bottom: 16px;
}

.mandantenliste {
  max-height: 14em;
  overflow-y: auto;
}

.mandant-gewaehlt {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  font-weight: 600;
}

#mandant-neu input {
  width: 100%;
  box-sizing: border-box;
  margin: 0.4em 0;
}

#anmeldezeile.warnung {
  font-weight: 600;
}

/* Compact controls. Preserve hidden even when a component defines display:flex. */
[hidden] {
  display: none !important;
}
.verbindungsampel {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  cursor: pointer;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-size: 11px;
}
.pagination button {
  padding: 3px 9px;
}
#belegumfang {
  width: 100%;
  margin: 6px 0;
}
.modus {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}
.modus label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px;
  border: 1px solid var(--ds-rand);
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
}
.modus label:has(input:checked) {
  background: #e6f2ef;
  border-color: #18735b;
  color: #145c49;
}
.modus input {
  position: absolute;
  opacity: 0;
}
.modus label:focus-within {
  outline: 2px solid #18735b;
}
.modus-symbol {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.leiste {
  gap: 8px;
  padding: 6px 0;
}
#mappen-ausschnitte {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.snip-sprung {
  font-size: 10px;
  padding: 4px 6px;
}
.pdf-seite {
  position: relative;
  margin-bottom: 12px;
  background: white;
}
.fundstelle {
  position: absolute;
  background: rgba(24, 115, 91, 0.12);
  border: 1px solid #18735b;
  color: #145c49;
  min-width: 8px;
  min-height: 8px;
  padding: 0;
  z-index: 2;
  cursor: pointer;
}
.fundstelle:hover {
  background: rgba(24, 115, 91, 0.3);
}

.kopfleiste .verbindungsampel {
  color: #dbe7f3;
}

/* The document is the main workspace; tools float over its scroll area. */
#verbindungsampel,
#verbindungsampeltext {
  color: #ffffff !important;
  opacity: 1;
}
#verbindungsampel {
  background: transparent !important;
}
.pdf-arbeitsplatz {
  position: relative;
  margin-top: 8px;
}
.pdf-werkzeuge {
  position: absolute;
  z-index: 10;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, calc(100% - 36px));
  padding: 5px;
  border: 1px solid #d5dce6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 14px rgba(20, 35, 55, 0.15);
}
.pdf-werkzeuge .modus {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.pdf-werkzeuge .modus label {
  padding: 4px 1px;
  gap: 2px;
  border-color: transparent;
  font-size: 10px;
}
.pdf-werkzeuge .modus-symbol {
  width: 20px;
  height: 20px;
}
.pdf-werkzeuge .spaltenwahl {
  margin: 4px 0 0;
  padding: 2px 5px;
  font-size: 10px;
}
.pdf-arbeitsplatz .buehne {
  height: calc(100vh - 142px);
  height: calc(100dvh - 142px);
  max-height: none;
  min-height: 180px;
  padding: 12px 12px 100px;
  background: #dfe5ed;
  border-radius: 8px;
}
.buehne .pdf-seite {
  margin-inline: auto;
  margin-bottom: 24px !important;
  box-shadow: 0 2px 7px rgba(25, 40, 60, 0.15);
}
.ansichtwerkzeuge {
  margin: 4px 0;
  padding: 4px 8px;
}
.ansichtwerkzeuge summary {
  font-size: 11px;
}
#felder {
  margin-top: 8px;
}
#mappen-ausschnitte-bereich {
  padding: 4px 8px;
  margin: 4px 0;
}
#mappen-ausschnitte-bereich summary {
  font-size: 11px;
}
.fundstelle-wert,
.snip-wert {
  background: rgba(55, 130, 205, 0.15);
  border-color: #4786bb;
  color: #22547f;
}
.fundstelle-tabelle,
.snip-tabelle {
  background: rgba(145, 85, 195, 0.16);
  border-color: #9460b8;
  color: #613787;
}
.fundstelle-sichtvermerk,
.snip-sichtvermerk {
  background: rgba(45, 150, 90, 0.15);
  border-color: #459466;
  color: #22623b;
}
.fundstelle-ausnahme,
.snip-ausnahme {
  background: rgba(205, 75, 65, 0.16);
  border-color: #c75a50;
  color: #8e342c;
}
.fundstelle-wert:hover {
  background: rgba(55, 130, 205, 0.3);
}
.fundstelle-tabelle:hover {
  background: rgba(145, 85, 195, 0.3);
}
.fundstelle-sichtvermerk:hover {
  background: rgba(45, 150, 90, 0.3);
}
.fundstelle-ausnahme:hover {
  background: rgba(205, 75, 65, 0.3);
}
.modus label:has(input[value="wert"]:checked),
.modus label:has(input[value="wert"]):hover,
.modus label:has(input[value="wert"]):focus-within {
  background: #dce9f5;
  border-color: #4786bb;
  color: #22547f;
}
.modus label:has(input[value="tabelle"]:checked),
.modus label:has(input[value="tabelle"]):hover,
.modus label:has(input[value="tabelle"]):focus-within {
  background: #e9dff5;
  border-color: #9460b8;
  color: #613787;
}
.modus label:has(input[value="vermerk"]:checked),
.modus label:has(input[value="vermerk"]):hover,
.modus label:has(input[value="vermerk"]):focus-within {
  background: #dceee2;
  border-color: #459466;
  color: #22623b;
}
.modus label:has(input[value="ausnahme"]:checked),
.modus label:has(input[value="ausnahme"]):hover,
.modus label:has(input[value="ausnahme"]):focus-within {
  background: #f6ddd9;
  border-color: #c75a50;
  color: #8e342c;
}

.markierung[data-art="wert"] {
  border-color: #4786bb;
  background: rgba(55, 130, 205, 0.15);
}
.markierung[data-art="tabelle"] {
  border-color: #9460b8;
  background: rgba(145, 85, 195, 0.16);
}
.markierung[data-art="sichtvermerk"],
.markierung[data-art="vermerk"] {
  border-color: #459466;
  background: rgba(45, 150, 90, 0.15);
}
.markierung[data-art="ausnahme"] {
  border-color: #c75a50;
  background: rgba(205, 75, 65, 0.16);
}

/* Only a narrow document frame above the PDF; secondary tools follow it. */
.pdf-fokus .kopfleiste {
  padding: 7px 12px;
  margin-bottom: 0;
}
.pdf-fokus #snipzahl {
  display: none;
}
.pdf-fokus .reiterleiste {
  margin: 0 0 4px;
}
.pdf-fokus .reiterleiste button {
  padding: 5px 4px;
  font-size: 11px;
}
.pdf-fokus .belegkopf {
  align-items: center;
  margin: 0;
  gap: 6px;
  min-height: 26px;
}
.pdf-fokus .belegtitel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pdf-fokus .belegkennung {
  margin-left: auto;
  max-width: 22%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
}
.pdf-fokus .pdf-arbeitsplatz {
  margin-top: 3px;
}
.buehne canvas {
  margin-inline: auto;
}
.ansichtwerkzeuge {
  padding: 0;
  margin: 3px 0;
}
.ansichtwerkzeuge .leiste {
  margin: 0;
  padding: 2px 0;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
}
.ansichtwerkzeuge #zoom {
  width: 65px;
}
.ansichtwerkzeuge .leiste label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ansichtwerkzeuge #seitenwahl {
  width: max-content;
  max-width: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.snip-hilfe {
  margin: 4px 0;
  padding: 4px 8px;
  font-size: 11px;
}

/* Fixed frame: scrolling belongs to the document or the selected tab. */
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  padding: 0;
}
#oberflaeche {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.kopfleiste,
.pdf-fokus .kopfleiste {
  flex: none;
  margin: 0;
  padding: 6px 10px;
  gap: 8px;
}
.kopfleiste .reiterleiste,
.pdf-fokus .kopfleiste .reiterleiste {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 0;
  gap: 2px;
  justify-content: center;
}
.kopfleiste .reiterleiste button,
.pdf-fokus .kopfleiste .reiterleiste button {
  flex: 0 1 auto;
  padding: 6px;
  margin: 0;
  font-size: 11px;
  color: #d5e1ef;
  white-space: nowrap;
  border-radius: 4px;
  border: 0;
}
.kopfleiste .reiterleiste button[aria-selected="true"] {
  color: white;
  background: rgba(255, 255, 255, 0.17);
}
.kopfleiste .reiterleiste button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}
#oberflaeche > [role="tabpanel"] {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}
.pdf-fokus #tab-belege {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 4px 8px;
}
.pdf-fokus #ansicht-beleg {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pdf-fokus .pdf-arbeitsplatz {
  flex: 1;
  min-height: 0;
}
.pdf-fokus .pdf-arbeitsplatz .buehne {
  height: 100%;
  min-height: 0;
  max-height: none;
}
.beleg-aktionen {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
}
.beleg-aktionen button {
  padding: 3px 8px;
  font-size: 10px;
  border: 1px solid #d5dce6;
  border-radius: 5px;
  background: white;
  color: var(--ds-akzent);
  cursor: pointer;
}
.ansichtwerkzeuge {
  flex: none;
}
.beleg-popup {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 80px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #d5dce6;
  border-radius: 10px;
  color: var(--ds-text-koerper);
  background: white;
  box-shadow: 0 8px 35px rgba(20, 35, 55, 0.25);
}
.beleg-popup::backdrop {
  background: rgba(20, 35, 55, 0.18);
}
.popup-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.popup-kopf h2 {
  margin: 0;
  font-size: 13px;
}
.popup-kopf .popup-schliessen {
  font-size: 22px;
}
.pdf-fokus .beleg-popup #snipzahl {
  display: block;
  margin: 0 0 8px;
}
.beleg-popup #mappen-ausschnitte-bereich,
.beleg-popup #felder {
  margin: 0;
  padding: 0;
}
/* Hinweise schweben über dem Dokument; die Viewergröße bleibt stabil. */
.pdf-hinweise {
  position: absolute;
  z-index: 12;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.pdf-hinweise > p:not([hidden]) {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid #d5dce6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #52667e;
  box-shadow: 0 2px 8px rgba(30, 45, 65, 0.12);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.pdf-hinweise > #zellabweichung:not([hidden]) {
  border-color: #e5c779;
  background: rgba(255, 247, 221, 0.96);
  color: #77551b;
}
.app-kopf {
  position: relative;
  flex: none;
  z-index: 30;
}
.app-hinweise {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(280px, 40dvh);
  overflow: auto;
  pointer-events: none;
}
.app-hinweise > :not([hidden]) {
  flex: none;
  margin: 0;
  box-shadow: 0 3px 12px rgba(30, 45, 65, 0.15);
  pointer-events: auto;
}
#verbindung {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.app-hinweise > #zertifikatwarnung:not([hidden]) {
  font-size: 11px;
  line-height: 1.4;
}
@media (max-width: 400px) {
  .kopfleiste h1 {
    font-size: 11px;
  }
  .kopfleiste {
    gap: 4px;
  }
  .kopfleiste .verbindungsampel {
    font-size: 9px;
    gap: 3px;
  }
  .kopfleiste .reiterleiste button,
  .pdf-fokus .kopfleiste .reiterleiste button {
    padding: 6px 4px;
    font-size: 10px;
  }
}

/* Reserve the right corner for Excel's floating add-in info button. */
.kopfleiste,
.pdf-fokus .kopfleiste {
  padding-right: 40px;
}
.beleg-aktionen .knopf-loesen,
.beleg-popup .knopf-loesen {
  color: #a3322c;
  background: #fff0ef;
  border: 1px solid #db8c85;
  border-radius: 5px;
}
.beleg-aktionen .knopf-loesen:hover:not(:disabled),
.beleg-popup .knopf-loesen:hover:not(:disabled) {
  color: #fff;
  background: #a3322c;
}
.beleg-aktionen .knopf-loesen:disabled {
  opacity: 0.45;
  cursor: default;
}
.beleg-aktionen {
  flex-wrap: wrap;
}
.beleg-popup #verknuepfung-loesen {
  margin: 0;
  padding: 0;
  border: 0;
}
@media (max-width: 360px) {
  .kopfleiste > img {
    display: none;
  }
  .kopfleiste .verbindungsampel {
    font-size: 8px;
    padding-inline: 0;
  }
  .kopfleiste .reiterleiste button,
  .pdf-fokus .kopfleiste .reiterleiste button {
    padding-inline: 3px;
    font-size: 9px;
  }
}

.modus {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pdf-werkzeuge {
  width: min(350px, calc(100% - 24px));
}
.modus label:has(input[value="summe"]:checked),
.modus label:has(input[value="summe"]):hover,
.modus label:has(input[value="summe"]):focus-within {
  background: #fff0bd;
  border-color: #c59b24;
  color: #755909;
}
.fundstelle-summe,
.snip-summe,
.markierung[data-art="summe"] {
  border-color: #c59b24;
  background: rgba(230, 180, 40, 0.2);
  color: #755909;
}
.fundstelle-summe:hover {
  background: rgba(230, 180, 40, 0.35);
}
.summen-snip {
  position: absolute;
  right: 12px;
  bottom: 86px;
  z-index: 9;
  width: min(220px, calc(100% - 24px));
  padding: 8px;
  background: rgba(255, 251, 235, 0.65);
  border: 1px solid #d9b750;
  border-radius: 9px;
  box-shadow: 0 3px 14px rgba(20, 35, 55, 0.12);
  color: #755909;
  font-size: 10px;
}
#summen-snip-liste {
  max-height: 130px;
  overflow: auto;
  margin-top: 4px;
}
#summen-snip-liste > div {
  display: flex;
  gap: 3px;
}
#summen-snip-liste button {
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-size: 10px;
  padding: 3px;
  cursor: pointer;
}
#summen-snip-liste button:first-child {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#summen-snip-liste button:hover {
  background: #fff0bd;
}
#summen-snip-info {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
#summen-snip-info:empty { display: none; }
.beleg-popup #summenpruefung {
  margin: 0;
  padding: 0;
  border: 0;
}

.beleg-popup #kreuzverweis {
  margin: 0;
  padding: 0;
  border: 0;
}

.buehne {
  overflow-anchor: none;
}
.seitensteuerung {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.seitensteuerung button {
  padding: 3px 7px;
  border: 1px solid #d5dce6;
  border-radius: 5px;
  color: var(--ds-akzent);
  background: white;
  font-size: 10px;
  cursor: pointer;
}
.seitensteuerung button:disabled {
  opacity: 0.35;
  cursor: default;
}
.seitensteuerung #seite-vorher,
.seitensteuerung #seite-naechste {
  font-size: 16px;
  line-height: 1;
}
.seitenliste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 5px;
}
.seitenliste button {
  padding: 9px 4px;
  border: 1px solid #d5dce6;
  border-radius: 5px;
  color: var(--ds-akzent);
  background: white;
  cursor: pointer;
}
.seitenliste button[aria-current="page"] {
  color: white;
  background: var(--ds-primaer);
  border-color: var(--ds-primaer);
}
.seitenliste button:hover:not([aria-current="page"]) {
  background: #eaf1f8;
}

#belegumfang {
  display: flex;
  gap: 6px;
}
#belegumfang button {
  flex: 1;
}
#belegumfang button[aria-pressed="true"] {
  background: var(--blau, #1e3758);
  color: white;
}
#belegdrop {
  border: 1px dashed #9aaabd;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  background: #f7f9fc;
}
#belegdrop.drag-aktiv {
  border-color: #3a7ca5;
  background: #e2eff9;
  box-shadow: inset 0 0 0 1px #3a7ca5;
}
#belegdrop[aria-busy="true"] {
  opacity: 0.65;
}
.drop-hinweis {
  display: block;
  font-size: 13px;
  color: #526276;
  margin-bottom: 8px;
}
.drop-auswahl {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
#belegdatei:focus-visible ~ .drop-auswahl label[for="belegdatei"] {
  outline: 2px solid #3a7ca5;
  outline-offset: 2px;
}

/* Table controls belong to the selected source box and follow its zoom. */
.markierung {
  z-index: 3;
}
.markierung:not([data-art="tabelle"]) .tabellenkorrektur {
  display: none;
}
.markierung .tabellenkorrektur {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  max-width: none;
  margin: 4px 0 0;
  padding: 5px;
  flex-wrap: nowrap;
  gap: 5px;
  border: 1px solid #bba0d1;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px #0002;
  pointer-events: auto;
  font-size: 10px;
  color: #613787;
  white-space: nowrap;
}
.raster-regler {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tabellenkorrektur button {
  border: 1px solid #d9c6e7;
  border-radius: 4px;
  padding: 2px 5px;
  color: #613787;
  background: #f6f0fa;
  cursor: pointer;
}
.tabellenkorrektur button:disabled {
  opacity: 0.4;
  cursor: default;
}
.beleg-listentitel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.beleg-listentitel .belegname {
  display: inline;
}
.beleg-snips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.beleg-snipzahl {
  font-size: 9px;
  border: 1px solid;
  border-radius: 4px;
  padding: 1px 4px;
  white-space: nowrap;
}

button.belegtitel {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.belegtitel:hover {
  text-decoration: underline;
}
.wechsel-liste {
  max-height: 48vh;
  overflow-y: auto;
  margin: 8px 0;
}
.wechsel-liste button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px;
  border: 0;
  border-bottom: 1px solid #dde2ea;
  background: transparent;
  color: #253b56;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wechsel-liste button[aria-current="true"] {
  background: #e5edf8;
  font-weight: 600;
}
#wechsel-suche {
  width: 100%;
  box-sizing: border-box;
}
.tabellenlinien {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: crosshair;
}
.markierung:not([data-art="tabelle"]) .tabellenlinien {
  display: none;
}
.trennlinie {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.trennlinie.horizontal {
  left: 0;
  width: 100%;
  height: 10px;
  margin-top: -5px;
}
.trennlinie.vertikal {
  top: 0;
  height: 100%;
  width: 10px;
  margin-left: -5px;
}
.trennlinie::before {
  content: "";
  position: absolute;
  background: #8751ae99;
}
.trennlinie.horizontal::before {
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
}
.trennlinie.vertikal::before {
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
}
.trennlinie.aktiv {
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
}
.trennlinie.vertikal.aktiv {
  cursor: ew-resize;
}
.trennlinie.aktiv::before {
  background: #8751ae;
}
.trennlinie .linie-loeschen {
  position: absolute;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid #bba0d1;
  border-radius: 4px;
  background: #fff;
  color: #613787;
  font-size: 12px;
  line-height: 14px;
  cursor: pointer;
}
.trennlinie.horizontal .linie-loeschen {
  right: 2px;
  top: -3px;
}
.trennlinie.vertikal .linie-loeschen {
  top: 2px;
  left: -3px;
}

/* Gemeinsame Gestaltung für Werkzeuge, Dialoge und Arbeitsmappe. */
.kopfleiste .verbindungsampel {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.kopfleiste .verbindungsampel:hover {
  background: #ffffff18;
}
.kopfleiste .verbindungsampel .ampelpunkt {
  width: 9px;
  height: 9px;
}
button.sekundaer,
.pruefung button.sekundaer,
.beleg-popup button.sekundaer {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  background: #f7f9fc;
  color: #344b67;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
button.sekundaer:hover:not(:disabled) {
  border-color: #a9bace;
  background: #edf2f8;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #578ec4;
  outline-offset: 2px;
}
.beleg-popup {
  padding: 18px;
  border-radius: 14px;
}
.beleg-popup .popup-kopf {
  margin-bottom: 14px;
}
.beleg-popup .popup-kopf h2 {
  color: #253c59;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}
.beleg-popup .popup-schliessen {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #62768e;
  background: #f0f4f9;
}
.beleg-popup .popup-schliessen:hover {
  background: #e2eaf4;
}
.beleg-popup .fussnote {
  line-height: 1.55;
  margin-bottom: 12px;
}
.popup-aktionen {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.beleg-popup .popup-aktionen button {
  width: auto;
  margin: 0;
  padding: 9px 14px;
  font-size: 12px;
  border-radius: 7px;
}
.popup-aktionen .sekundaer {
  order: -1;
}
#sammlungen,
#dubletten {
  margin: 12px 0 0;
  padding: 0 14px 14px;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px #19335405;
}
#sammlungen > summary,
#dubletten > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  color: #243d5b;
  font-size: 13px;
  font-weight: 600;
}
#sammlungen > summary::-webkit-details-marker,
#dubletten > summary::-webkit-details-marker {
  display: none;
}
#sammlungen > summary::after,
#dubletten > summary::after { content: none; }
#sammlungen > summary::marker,
#dubletten > summary::marker { content: ""; }
#sammlungen:not([open]),
#dubletten:not([open]) {
  padding-bottom: 0;
}
#sammlungen[open] > summary,
#dubletten[open] > summary {
  margin-bottom: 12px;
  border-bottom: 1px solid #e7ecf3;
}
.werkzeug-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eaf0f8;
  color: #52749c;
  font-size: 22px;
}
summary small {
  display: block;
  margin-top: 3px;
  color: #7d8da1;
  font-size: 11px;
  font-weight: 400;
}
#sammlungen .fussnote,
#dubletten .fussnote {
  line-height: 1.55;
}
#sammlungen button:not(.flach):not(.sekundaer),
#dubletten-suchen {
  padding: 8px 12px;
  border-radius: 7px;
}
.sammlungswahl,
.sammlung-namensfeld {
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.sammlungswahl select,
.sammlung-namensfeld input {
  padding: 8px 10px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  background: #f8fafc;
  font: inherit;
  font-size: 12px;
}
.sammlungsknoepfe {
  padding: 8px 0;
  border-top: 1px solid #e7ecf3;
}
.dublettengruppe {
  padding: 12px !important;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
}
.dublettengruppe.warnung {
  background: #fff9eb;
  border-color: #ead6a2;
}
#tab-mappe {
  padding: 14px 10px;
}
.mappe-kopf {
  margin-bottom: 16px;
}
.mappe-kopf h2 {
  margin: 0 0 5px;
  color: #223d5c;
  font-size: 18px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}
.mappe-kopf p {
  margin: 0;
  color: #718197;
  font-size: 12px;
  line-height: 1.5;
}
.mappe-karten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  align-items: start;
}
#tab-mappe .mappe-karte {
  margin: 0;
  padding: 18px;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  box-shadow: 0 2px 8px #19335406;
  background: #fff;
}
.mappe-karte h2 {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: #263f5c;
  margin-bottom: 8px;
}
.mappe-karte .fussnote {
  line-height: 1.6;
  margin-bottom: 12px;
}
#tab-mappe .mappe-karte button {
  width: auto;
  max-width: 100%;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
}
.mappe-export {
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid #e6ecf3;
}
.mappe-export h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #263f5c;
}
#tab-mappe input[type="text"] {
  padding: 9px 11px;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 12px;
}
#verwaiste:not([hidden]) {
  margin-top: 12px;
}
@media (max-width: 380px) {
  .popup-aktionen {
    flex-direction: column;
  }
  .beleg-popup .popup-aktionen button {
    width: 100%;
  }
  .mappe-karte,
  #tab-mappe .mappe-karte {
    padding: 14px;
  }
}

/* Beleglisten scrollen unabhängig von Suchfeld und Werkzeugen. */
#oberflaeche > #tab-belege {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#ansicht-liste {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}
#ansicht-liste > * {
  flex: none;
}
#ansicht-liste > #belegliste {
  flex: 1 1 auto;
  min-height: 70px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 0;
}
.beleglisten-werkzeuge {
  max-height: 35vh;
  overflow-y: auto;
}
.beleglisten-werkzeuge #sammlungen,
.beleglisten-werkzeuge #dubletten {
  margin-top: 8px;
}
.ordnerleiste {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}
.ordnerleiste #beleg-ordnerwahl {
  flex: 1;
  justify-content: flex-start;
}
.ordner-anlegen {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e4ebf3;
}
.ordner-anlegen input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  font: inherit;
}
#wechsel-ordner {
  margin: 8px 0;
}
.wechsel-liste button {
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.wechsel-liste button:hover,
.wechsel-liste button:focus-visible {
  background: #edf3fa;
  color: #245586;
}
.belegliste > li:hover {
  background: #edf3fa;
}
.belegliste .belegwahl:hover,
.belegliste .belegumbenennen:hover {
  background: #e4edf8;
  color: #245586;
}
button[aria-pressed]:hover {
  background: #e4edf8;
  cursor: pointer;
}

.upload-organisation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: space-between;
  font-size: 11px;
  color: #8190a2;
  margin: 6px 0;
}
.upload-organisation label {
  display: flex;
  gap: 5px;
  align-items: center;
  cursor: pointer;
}
.ordner-anlegen {
  flex-wrap: wrap;
}
.ordner-elternwahl {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #718399;
}
.ordner-elternwahl select {
  flex: 1;
  min-width: 0;
  padding: 7px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  font: inherit;
  background: white;
  color: #405d7f;
}
.beleglisten-werkzeuge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.beleglisten-werkzeuge > details {
  min-width: 0;
  margin-bottom: 0;
}
.beleglisten-werkzeuge > details:not([open]) summary {
  padding: 10px;
  gap: 8px;
  font-size: 12px;
}
.beleglisten-werkzeuge > details:not([open]) summary small {
  font-size: 10px;
  line-height: 1.35;
}
.beleglisten-werkzeuge > details:not([open]) .werkzeug-symbol {
  width: 26px;
  height: 26px;
  font-size: 17px;
  flex: none;
}
.beleglisten-werkzeuge > details[open] {
  grid-column: 1 / -1;
}
.beleglisten-werkzeuge:has(details[open]) {
  max-height: 45vh;
}
.beleglisten-werkzeuge:has(details[open]) > details:not([open]) {
  display: none;
}

/* Kompakte Belegwerkzeuge und eigene Sammlungsauswahl. */
#sammlungen,
#dubletten {
  padding: 0 10px 9px;
  border-radius: 10px;
}
#sammlungen > summary,
#dubletten > summary {
  padding: 8px 0;
  gap: 7px;
  font-size: 12px;
}
#sammlungen[open] > summary,
#dubletten[open] > summary {
  margin-bottom: 6px;
}
.beleglisten-werkzeuge .werkzeug-symbol {
  width: 25px;
  height: 25px;
  font-size: 17px;
  border-radius: 6px;
  flex: none;
}
.beleglisten-werkzeuge summary small {
  font-size: 10px;
  line-height: 1.3;
  margin-top: 2px;
}
#sammlungen .fussnote,
#dubletten .fussnote {
  font-size: 11px;
  line-height: 1.4;
  margin: 5px 0;
}
#sammlungen button,
#dubletten button {
  font-size: 11px;
  line-height: 1.25;
  min-height: 28px;
  margin-top: 0;
}
#sammlungen button:not(.flach):not(.sekundaer),
#sammlungen button.sekundaer,
#dubletten-suchen {
  padding: 6px 9px;
}
#sammlungen button.flach {
  padding: 5px 7px;
}
#sammlungen .sammlungswahl,
#sammlungen .sammlung-namensfeld {
  margin: 6px 0;
  gap: 6px;
}
#sammlung-wahl {
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f8fafc;
}
#sammlungen .sammlungsknoepfe {
  padding: 5px 0;
  gap: 4px;
  margin: 5px 0;
}
#sammlungen .zellinfo:not(:empty) {
  padding: 7px 9px;
  font-size: 11px;
  margin: 5px 0;
}
#sammlungswahl-suche {
  width: 100%;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  margin: 0 0 8px;
}
#sammlungswahl-liste button {
  font-size: 12px;
  padding: 9px 10px;
}
.beleglisten-werkzeuge > details:not([open]) summary {
  padding: 8px 0;
  gap: 7px;
}

/* Feste Belegwerkzeuge: Suche/Ordner und Umfang/Seiten teilen sich eine Zeile. */
#ansicht-liste .upload-organisation {
  gap: 3px 10px;
  margin: 4px 0;
  font-size: 10px;
  line-height: 1.3;
  align-items: center;
}
.upload-pfade {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  min-width: 0;
}
#ansicht-liste #ordner {
  margin: 0;
  font-size: 10px;
  color: #8190a2;
  overflow-wrap: anywhere;
}
.upload-organisation input {
  margin: 0;
  width: 12px;
  height: 12px;
  accent-color: #36855c;
}
.belegfilter-suche {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 0.8fr);
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
.belegfilter-suche .belegsuche,
.belegfilter-suche .ordnerleiste {
  margin: 0;
  min-width: 0;
}
.belegfilter-suche input,
.belegfilter-suche button {
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
}
#beleg-ordnerwahl {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#beleg-ordner-neu {
  flex: none;
  white-space: nowrap;
}
.belegfilter-umfang {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
}
.belegfilter-umfang #belegumfang {
  display: flex;
  flex: 1;
  gap: 3px;
  width: auto;
  margin: 0;
}
.belegfilter-umfang #belegumfang button {
  flex: 1;
  border: 1px solid #d6deea;
  border-radius: 6px;
  background: #f8fafc;
  color: #586a80;
  font-size: 11px;
  line-height: 1.2;
  min-height: 26px;
  padding: 4px 7px;
  margin: 0;
  cursor: pointer;
}
.belegfilter-umfang #belegumfang button[aria-pressed="true"] {
  background: #1f3657;
  border-color: #1f3657;
  color: white;
}
.belegfilter-umfang #belegumfang button:hover:not([aria-pressed="true"]) {
  background: #e4edf8;
}
.belegfilter-umfang .pagination {
  flex: none;
  gap: 6px;
  margin: 0;
  font-size: 10px;
}
.belegfilter-umfang .pagination button {
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 2px;
  margin: 0;
  border: 1px solid #d6deea;
  border-radius: 6px;
  background: #f8fafc;
  color: #405d7f;
  cursor: pointer;
}
.belegfilter-umfang .pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}
#belegdrop {
  padding: 8px;
}
#belegdrop .drop-hinweis {
  font-size: 11px;
  margin-bottom: 5px;
}
#belegdrop .knopf {
  padding: 5px 9px;
  font-size: 11px;
}
@media (max-width: 420px) {
  .belegfilter-suche {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .belegfilter-umfang {
    gap: 6px;
  }
  .belegfilter-umfang #belegumfang button {
    padding: 4px;
    font-size: 10px;
  }
}

/* Invisible corner hit areas reveal only the nearby grip. */
.fundstelle .snip-eckgriff {
  position: absolute;
  width: 20px;
  height: 20px;
  background: transparent;
  border: 0;
  padding: 0;
  touch-action: none;
  z-index: 5;
}
.snip-eckgriff::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.12s;
}
.snip-eckgriff:hover::after,
.snip-eckgriff.aktiv::after {
  opacity: 1;
}
.snip-eckgriff.nw {
  left: -10px;
  top: -10px;
  cursor: nwse-resize;
}
.snip-eckgriff.ne {
  right: -10px;
  top: -10px;
  cursor: nesw-resize;
}
.snip-eckgriff.sw {
  left: -10px;
  bottom: -10px;
  cursor: nesw-resize;
}
.snip-eckgriff.se {
  right: -10px;
  bottom: -10px;
  cursor: nwse-resize;
}
.fundstelle:has(.snip-eckgriff:hover),
.fundstelle.snip-groesse-aktiv {
  z-index: 6;
}

/* Let grips sit above the selected table's line editor. */
.fundstelle:has(.snip-eckgriff) {
  z-index: auto;
  cursor: grab;
}
.fundstelle.snip-verschieben-aktiv { cursor: grabbing; }
.fundstelle:has(.snip-eckgriff:hover),
.fundstelle.snip-groesse-aktiv {
  z-index: 6;
}

/* The active selection supplies the one visible frame; keep its saved hit target and grips. */
.fundstelle.fundstelle-aktiv {
  border-color: transparent !important;
  background: transparent !important;
}

.snip-kontextmenue {
  position: fixed;
  z-index: 1000;
  width: min(285px, calc(100vw - 16px));
  padding: 6px;
  border: 1px solid #d3ddeb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 24px #1f365733;
}
.snip-kontextmenue strong {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: #718399;
}
.snip-kontextmenue button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  margin: 0;
  padding: 8px;
  text-align: left;
  font-size: 12px;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
}
.snip-kontextmenue button:hover {
  background: #edf3fa;
}
.snip-kontextmenue button.knopf-loesen:hover {
  background: #fff0f0;
}

/* Ctrl/Cmd permits a new crop inside any saved snip, including its resize grips. */
.snip-durchzeichnen .fundstelle,
.snip-durchzeichnen .fundstelle *,
.snip-durchzeichnen .markierung,
.snip-durchzeichnen .markierung * {
  pointer-events: none !important;
}

/* Kompakte Fundstellen, je Datei gruppiert, am rechten Rand der Werkzeugleiste. */
.mappen-suche { position: relative; margin-left: auto; min-width: 150px; max-width: 100%; }
#pdf-suche { display: flex; align-items: center; border: 1px solid #d5dce6; border-radius: 7px; background: white; padding: 1px 3px; }
#pdf-suche:focus-within { border-color: #8ea8ba; box-shadow: 0 0 0 2px rgba(58,124,165,.1); }
#pdf-suche input { width: 135px; min-width: 60px; margin: 0; padding: 4px 6px; border: 0; outline: none; box-shadow: none; background: transparent; font-size: 11px; }
#pdf-suche input::-webkit-search-cancel-button { display: none; }
#pdf-suche button { border: 0; margin: 0; padding: 3px 5px; color: #73818c; background: transparent; }
.mappen-suchergebnis { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(290px, calc(100vw - 28px)); padding: 0; border: 1px solid #dce2e8; border-radius: 9px; background: #fff; box-shadow: 0 5px 20px rgba(20,35,55,.13); overflow: hidden; }
#pdf-suchstatus { padding: 8px 11px; border-bottom: 1px solid #edf0f3; font-size: 10px; color: #74808b; }
.mappen-suchtreffer { max-height: min(250px, 38vh); overflow-y: auto; overscroll-behavior: contain; padding: 3px 0; }
.suchgruppe + .suchgruppe { border-top: 1px solid #edf0f3; margin-top: 4px; }
.suchgruppe-kopf { display: flex; align-items: center; gap: 7px; padding: 8px 10px 4px; }
.suchgruppe-kopf strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; color: #334754; }
.suchgruppe-nummer { width: 15px; font-size: 10px; color: #94a0a9; }
.suchgruppe-anzahl { font-size: 10px; color: #94a0a9; }
.beleg-aktionen .mappen-suchtreffer .suchstelle { display: flex; align-items: center; gap: 9px; width: calc(100% - 12px); min-height: 27px; margin: 1px 6px; padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; color: #46535e; }
.beleg-aktionen .mappen-suchtreffer .suchstelle:hover,
.beleg-aktionen .mappen-suchtreffer .suchstelle.aktiv { background: #f0f4f7; }
.suchstelle-seite { flex: 0 0 30px; color: #929da7; font-size: 10px; }
.suchstelle-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.beleg-aktionen .mappen-suchtreffer .suchstelle { align-items: flex-start; }
.mappen-suchtreffer mark { background: #fff09a; color: inherit; padding: 0 1px; border-radius: 2px; }
.pdf-suchtreffer {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 224, 0, .42);
  mix-blend-mode: multiply;
}
.pdf-suchtreffer.aktiv { background: rgba(255, 216, 0, .58); outline: none; }

/* Werkzeugleiste und Suche bleiben auch bei knapper Breite in einer Zeile. */
.beleg-aktionen { flex-wrap: nowrap; }
.beleg-aktionen-knoepfe { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.beleg-aktionen-knoepfe::-webkit-scrollbar { display: none; }
.beleg-aktionen-knoepfe > button { flex: none; white-space: nowrap; }
.mappen-suche { flex: 0 0 clamp(125px, 24%, 175px); min-width: 0; margin-left: 5px; }
#pdf-suche input { flex: 1; min-width: 0; width: 0; }
.mappen-suchergebnis { background: rgba(255,255,255,.84); }
.suchstelle:hover, .suchstelle.aktiv { background-color: rgba(232,239,244,.65); }
.summen-snip { min-width: 0; max-width: calc(100% - 24px); box-sizing: border-box; }
#summen-snip-titel, #summen-snip-info { display: block; min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
#summen-snip-liste > div { min-width: 0; }
#summen-snip-liste button:first-child { min-width: 0; }

.snip-kontextmenue button img { flex: 0 0 20px; }

.beleg-aktionen-knoepfe > .snip-aktion-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 4px; border: 0; background: transparent;
}
.snip-aktion-icon img { display: block; }
.snip-aktion-icon:disabled { opacity: .4; }

.soforthinweis {
  position: fixed; z-index: 1100; pointer-events: none;
  padding: 6px 9px; border-radius: 5px; border: 1px solid #d3ddeb;
  background: #fff; color: #334754; font-size: 11px; line-height: 1.4;
  box-shadow: 0 3px 12px #1f365733; box-sizing: border-box;
}
/* Dokumentverarbeitung: Text bleibt auch ohne Farbwahrnehmung eindeutig. */
.beleg-verarbeitung { display: block; font-size: 12px; color: var(--text-muted, #526075); margin: 4px 0; }
.beleg-verarbeitung[data-status="fertig"] { color: #21673c; }
.beleg-verarbeitung[data-status="fehler"] { color: #a32929; }
.wechsel-liste .belegwahl { display: flex; flex-direction: column; align-items: stretch; gap: 3px; white-space: normal; }
.wechsel-liste .beleg-listentitel { flex-wrap: wrap; }
.wechsel-liste .belegdaten { font-size: 11px; overflow-wrap: anywhere; white-space: normal; }
.wechsel-liste .beleg-verarbeitung { margin: 0; white-space: normal; }


/* Upload-Meldungen schweben ueber dem Inhalt und belegen keinen Layoutplatz. */
#zufuhr-toast {
  position: fixed;
  z-index: 1100;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: var(--ds-radius);
  background: var(--ds-flaeche);
  box-shadow: 0 4px 20px rgba(25, 40, 60, 0.2);
}
#zufuhrinfo {
  margin: 0;
  min-height: 36px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--ds-rand);
  border-radius: var(--ds-radius);
  line-height: 1.45;
}
#zufuhrinfo.gut,
#zufuhrinfo.warnung,
#zufuhrinfo.fehler {
  padding-left: 32px;
}
#zufuhr-schliessen {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}
#zufuhr-schliessen:hover {
  background: rgba(25, 40, 60, 0.08);
}

/* Der Modus bleibt auch bei fehlendem Dienst erreichbar und belegt eigenen Platz. */
.belegspeicherung {
  flex: none;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ds-rand);
  background: var(--ds-flaeche);
  max-height: 35dvh;
  overflow: auto;
}
.belegspeicherung-wahl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.belegspeicherung label {
  font-size: 11px;
  font-weight: 600;
}
.belegspeicherung select {
  flex: 1;
  min-width: 0;
  padding: 4px;
  font: inherit;
  font-size: 11px;
  border: 1px solid var(--ds-rand);
  border-radius: 4px;
  background: var(--ds-flaeche);
  color: var(--ds-text);
}
.belegspeicherung details {
  margin-top: 5px;
  font-size: 11px;
}
.belegspeicherung summary {
  cursor: pointer;
  color: var(--ds-text-koerper);
}
.belegspeicherung .fussnote {
  margin: 7px 0;
}
.belegspeicherung button {
  font-size: 11px;
}

/* Noch nicht gespeicherte Uploads bleiben sichtbar, aber sind nicht auswählbar. */
.belegliste .uploadzeile .belegwahl:disabled {
  opacity: 1;
  cursor: progress;
  border-left-color: var(--ds-primaer);
}
.upload-verarbeitung {
  overflow-wrap: anywhere;
}
.uploadzeile.upload-fehler .belegwahl:disabled {
  cursor: default;
  border-left-color: #b42318;
}
.upload-fehler .upload-verarbeitung {
  color: #b42318;
}
