/* KalkPilot – Oberfläche. Eine Akzentfarbe (Blau); Grün/Gelb/Rot sind der Ampel vorbehalten.
   Aufbau: 1 Farben und Grundlagen · 2 Rahmen (Kopfleiste, Navigation) · 3 Bausteine · 4 Dialoge und Meldungen
           5 Anmeldung · 6 Projektliste · 7 Prüfen · 8 übrige Ansichten · 9 schmale Bildschirme */

/* ---------- 1 Farben und Grundlagen ---------- */
:root {
  --grund: #f4f5f7;
  --flaeche: #ffffff;
  --flaeche-2: #f8f9fb;
  --linie: #e2e5ea;
  --linie-2: #c9ced6;
  --fs-1: 12px; --fs-2: 14px; --fs-3: 16px; --fs-4: 20px; --fs-5: 26px;      /* UX-036: Schriftgrößen-Skala */
  --text: #18202b;
  --text-2: #4b5665;
  --text-3: #5f6977;
  --akzent: #2f5fd0;
  --akzent-kraeftig: #2349a8;
  --akzent-zart: #e8eefc;
  --akzent-text: #ffffff;
  --gruen: #24894f;
  --gruen-zart: #e3f3ea;
  --gelb: #b97f00;
  --gelb-punkt: #e0a100;
  --gelb-zart: #fbf1d6;
  --rot: #c53d33;
  --rot-zart: #fae5e2;
  --hand: #5a48b5;
  --hand-zart: #ece9fa;
  --schatten: 0 1px 2px rgba(20, 30, 45, .06), 0 6px 20px rgba(20, 30, 45, .08);
  --rund: 8px;
  --kopf-hoehe: 52px;
  --touch-min: 44px;
  --breite-text: 760px;      /* Formulare, Hilfe, Erfassung */
  --breite-app: 1280px;      /* Listen, Tabellen */
  /* Breakpoints (in @media nicht als Variable nutzbar, hier nur benannt): Handy ≤ 700px · Tablet ≤ 1024px · Desktop ≥ 1280px */
  --fuss-hoehe: 58px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --schrift-fest: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

/* UX-054: Hell/Dunkel folgt dem System – oder der Wahl im Konto-Menü (data-farbe am <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-farbe="hell"]) {
    --grund: #10151c;
    --flaeche: #171e27;
    --flaeche-2: #1c242f;
    --linie: #2a3441;
    --linie-2: #3a4655;
    --text: #e7ebf0;
    --text-2: #aeb8c4;
    --text-3: #8491a0;
    --akzent: #7ea2f5;
    --akzent-kraeftig: #a3bcf8;
    --akzent-zart: #1d2a45;
    --akzent-text: #0e1522;
    --gruen: #52c088;
    --gruen-zart: #153526;
    --gelb: #ebb53c;
    --gelb-punkt: #ebb53c;
    --gelb-zart: #3a2e10;
    --rot: #f07c70;
    --rot-zart: #40201c;
    --hand: #a99bf0;
    --hand-zart: #29244a;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-farbe="dunkel"] {
  --grund: #10151c;
  --flaeche: #171e27;
  --flaeche-2: #1c242f;
  --linie: #2a3441;
  --linie-2: #3a4655;
  --text: #e7ebf0;
  --text-2: #aeb8c4;
  --text-3: #8491a0;
  --akzent: #7ea2f5;
  --akzent-kraeftig: #a3bcf8;
  --akzent-zart: #1d2a45;
  --akzent-text: #0e1522;
  --gruen: #52c088;
  --gruen-zart: #153526;
  --gelb: #ebb53c;
  --gelb-punkt: #ebb53c;
  --gelb-zart: #3a2e10;
  --rot: #f07c70;
  --rot-zart: #40201c;
  --hand: #a99bf0;
  --hand-zart: #29244a;
  --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 14px/1.5 var(--schrift);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 13px; line-height: 1.3; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
a { color: var(--akzent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }
.zahl { font-variant-numeric: tabular-nums; }
.leise { color: var(--text-3); }
.klein { font-size: 12.5px; }
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprung { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--flaeche); padding: 8px 12px; border-radius: var(--rund); }
.sprung:focus { top: 8px; }
.startet { padding: 40px; color: var(--text-3); }
mark { background: var(--gelb-zart); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--gelb-punkt); }

/* ---------- 2 Rahmen ---------- */
#app { height: 100%; }
.rahmen { display: flex; flex-direction: column; height: 100%; }
.kopfleiste {
  flex: none; height: var(--kopf-hoehe);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.marke svg { width: 26px; height: 26px; flex: none; }
/* Hauptnavigation: was nicht in die Leiste passt, legt app.js (navOrdnen) ins Menü „Mehr“ – nie waagrecht scrollen */
.hauptnav { display: flex; gap: 2px; flex: 1; min-width: 0; align-items: center; }
.hauptnav > a, .nav-mehr > summary {
  padding: 6px 11px; border-radius: 6px; white-space: nowrap; flex: none;
  color: var(--text-2); text-decoration: none; font-weight: 550;
}
.hauptnav > a:hover, .nav-mehr > summary:hover { background: var(--flaeche-2); color: var(--text); }
.hauptnav a[aria-current="page"], .nav-mehr > summary.aktiv { background: var(--akzent-zart); color: var(--akzent-kraeftig); }
.nav-mehr { position: relative; flex: none; }
.nav-mehr > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.nav-mehr > summary::-webkit-details-marker { display: none; }
.nav-mehr > summary svg { width: 14px; height: 14px; }
.nav-mehr .menue { right: auto; left: 0; }
.hilfe-menue { position: relative; flex: none; }
.hilfe-menue > summary { list-style: none; cursor: pointer; }
.hilfe-menue > summary::-webkit-details-marker { display: none; }
.hilfe-menue > summary svg { width: 18px; height: 18px; }
.konto { position: relative; flex: none; }
/* Leiste unten am Handy (≤ 700 px, siehe Abschnitt 9) */
.fussnav { display: none; }
.mehr-liste { display: flex; flex-direction: column; }
.mehr-liste a { display: flex; align-items: center; gap: 8px; min-height: var(--touch-min); padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 550; font-size: 16px; }
.mehr-liste a + a { border-top: 1px solid var(--linie); border-radius: 0; }
.mehr-liste a[aria-current="page"] { color: var(--akzent-kraeftig); }
.konto > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: 6px; max-width: 320px;
}
.konto > summary::-webkit-details-marker { display: none; }
.konto > summary:hover { background: var(--flaeche-2); }
.konto .wer { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; text-align: right; }
.konto .wer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.konto .wer .firma { font-size: 11.5px; color: var(--text-3); }
.konto svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.menue {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten);
  padding: 6px; display: flex; flex-direction: column;
}
.menue .info { padding: 6px 10px 8px; border-bottom: 1px solid var(--linie); margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.menue button, .menue a {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center;
}
.menue button:hover, .menue a:hover { background: var(--flaeche-2); }
.menue button:focus-visible, .menue a:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.menue svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.menue .rot-text, .menue .rot-text svg { color: var(--rot); }
.menue .trenner { height: 1px; background: var(--linie); margin: 6px 0; }

.inhalt { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; position: relative; }   /* relative: absolut gesetzte Helfer (.nur-vorleser) in breiten Tabellen verbreitern sonst die ganze Seite */
.inhalt:focus { outline: none; }
.seite { width: 100%; max-width: var(--breite-app); margin: 0 auto; padding: 26px 24px 60px; display: flex; flex-direction: column; gap: 20px; }
.seite > * { min-width: 0; }
.seite.schmal { max-width: var(--breite-text); }
.seitenkopf { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.seitenkopf > div:first-child { flex: 1; min-width: 240px; }
.seitenkopf p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.aktionen { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 3 Bausteine ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px; border-radius: 7px; border: 1px solid var(--linie-2);
  background: var(--flaeche); color: var(--text); font-weight: 600; font-size: 13.5px; line-height: 1.3;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.knopf:hover { border-color: var(--text-3); }
.knopf svg { width: 15px; height: 15px; flex: none; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.haupt:hover { background: var(--akzent-kraeftig); border-color: var(--akzent-kraeftig); }
.knopf.gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-farbe="hell"]) .knopf.gefahr { color: #1b0c0a; } }
:root[data-farbe="dunkel"] .knopf.gefahr { color: #1b0c0a; }
.knopf.still { border-color: transparent; background: transparent; color: var(--text-2); }
.knopf.still:hover { background: var(--flaeche-2); color: var(--text); }
.knopf.klein { padding: 4px 9px; font-size: 12.5px; }
.knopf.nur-symbol { padding: 6px; }
.knopf:disabled, .knopf[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.knopf.rot-text { color: var(--rot); }

.karte { min-width: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.karten-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.karten-kopf h2 { flex: 1; }
.karten-kopf > p { flex: 1; min-width: 260px; }
.karte.ohne-rand { padding: 0; overflow: hidden; }
.karte.ohne-rand > .karten-kopf { padding: 14px 20px 0; }
.karte.startpaket { margin: 12px 0 20px; }
.hinweis { border-left: 3px solid var(--akzent); background: var(--akzent-zart); padding: 10px 14px; border-radius: 0 var(--rund) var(--rund) 0; color: var(--text); }
.wortschatz { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--linie); }
.hinweis.warnung { border-color: var(--gelb-punkt); background: var(--gelb-zart); }
.hinweis.fehler { border-color: var(--rot); background: var(--rot-zart); }
.hinweis.zeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hinweis.zeile > span { flex: 1; min-width: 200px; }

.feld { display: flex; flex-direction: column; gap: 4px; }
.feld > label, .feld > .beschriftung { font-weight: 600; font-size: 13px; }
.feld .hilfe { font-size: 12.5px; color: var(--text-3); }
.eingabe, select.eingabe, textarea.eingabe {
  width: 100%; padding: 7px 10px; border: 1px solid var(--linie-2); border-radius: 7px; background: var(--flaeche); color: var(--text);
}
textarea.eingabe { resize: vertical; min-height: 64px; }
.eingabe:focus { border-color: var(--akzent); outline: 2px solid var(--akzent); outline-offset: 0; }
.eingabe[aria-invalid="true"] { border-color: var(--rot); }
.eingabe.kurz { width: 110px; }
.formular { display: flex; flex-direction: column; gap: 14px; }
.reihe { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.reihe > .feld { flex: 1; min-width: 150px; }
.reihe > .feld.fest { flex: none; }
.gruppe { border: 1px solid var(--linie); border-radius: var(--rund); padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.gruppe.zweier { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: start; }
.gruppe.zweier > .ganz { grid-column: 1 / -1; }
.gruppe > legend { font-weight: 650; padding: 0 6px; }
.auswahl { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.auswahl label, label.haken { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.wahl { display: flex; flex-direction: column; gap: 8px; }
.wahl label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--rund); cursor: pointer; }
.wahl label:has(input:checked) { border-color: var(--akzent); background: var(--akzent-zart); }
.wahl label:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.wahl input { margin-top: 3px; }
.formfehler { color: var(--rot); font-weight: 600; }
.formfehler:empty { display: none; }

.zustand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 36px 20px; color: var(--text-2); }
.zustand h2 { color: var(--text); }
.zustand p { max-width: 56ch; }
.zustand.fehler h2 { color: var(--rot); }
.zustand.klein { padding: 14px 10px; align-items: flex-start; text-align: left; gap: 6px; }
.dreher { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--linie-2); border-top-color: var(--akzent); animation: drehen .8s linear infinite; }
/* UX-063: Lade-Gerippe für Listen */
.gerippe { display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: var(--rund); overflow: hidden; }
.gerippe-zeile { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--linie); }
.gerippe-zeile:first-of-type { border-top: 0; }
.gb { height: 12px; border-radius: 6px; background: var(--linie-2); animation: gerippe 1.4s ease-in-out infinite; }
.gb.b0 { flex: 0 1 46%; } .gb.b1 { flex: 0 1 32%; } .gb.b2 { flex: 0 1 58%; }
.gb.kurz { flex: 0 0 64px; margin-left: auto; } .gb.kurz + .gb.kurz { margin-left: 0; }
@keyframes gerippe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gb { animation: none; opacity: .7; } }
.dreher.klein { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dreher { animation-duration: 3s; } }

table.liste { width: 100%; border-collapse: collapse; }
table.liste th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.liste td { padding: 9px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste .r { text-align: right; font-variant-numeric: tabular-nums; }
table.liste td.aktionen-zelle { text-align: right; white-space: nowrap; }
table.liste td.aktionen-zelle .knopf { margin-left: 4px; }
table.liste tbody tr:hover { background: var(--flaeche-2); }
.tabellen-rollen { overflow-x: auto; position: relative; }

.marke-text { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--flaeche-2); border: 1px solid var(--linie); color: var(--text-2); white-space: nowrap; }
.marke-text.gruen { background: var(--gruen-zart); border-color: transparent; color: var(--gruen); }
.marke-text.gelb { background: var(--gelb-zart); border-color: transparent; color: var(--gelb); }
.marke-text.richtwert { background: transparent; border: 1px dashed var(--gelb-punkt); color: var(--gelb); }
.marke-text.rot { background: var(--rot-zart); border-color: transparent; color: var(--rot); }
.marke-text.blau { background: var(--akzent-zart); border-color: transparent; color: var(--akzent-kraeftig); }
.marke-text.hand { background: var(--hand-zart); border-color: transparent; color: var(--hand); }

.punkt { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--text-3); }
.punkt.gruen { background: var(--gruen); }
.punkt.gelb { background: var(--gelb-punkt); }
.punkt.richtwert { background: transparent; box-shadow: inset 0 0 0 2.5px var(--gelb-punkt); }      /* hohler gelber Punkt: Vorschlag, aber schwach */
.punkt.rot { background: var(--rot); }
.punkt.hand { background: var(--hand); border-radius: 2px; }

.balken { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--linie); min-width: 80px; }
.balken > span { display: block; height: 100%; }
.balken .gruen { background: var(--gruen); }
.balken .gelb { background: var(--gelb-punkt); }
.balken .richtwert { background: repeating-linear-gradient(135deg, var(--gelb-punkt) 0 2px, transparent 2px 4px); }
.balken .rot { background: var(--rot); }
.balken .hand { background: var(--hand); }
.balken .akzent { background: var(--akzent); }
.fortschritt { height: 8px; border-radius: 999px; background: var(--linie); overflow: hidden; }
.fortschritt > span { display: block; height: 100%; background: var(--akzent); width: 0; transition: width .2s; }
.fortschritt.unbestimmt > span { width: 35%; animation: wandern 1.2s ease-in-out infinite; }
@keyframes wandern { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kennzahl .titel { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kennzahl .wert { font-size: 26px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kennzahl .dazu { font-size: 12.5px; color: var(--text-3); }

/* Reiter-Leisten scrollen in sich (nie die ganze Seite); rechts blendet eine Kante aus, solange noch etwas folgt */
.reiter, .unternav {
  display: flex; gap: 2px; border-bottom: 1px solid var(--linie); min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.reiter::-webkit-scrollbar, .unternav::-webkit-scrollbar { display: none; }
.reiter::after, .unternav::after {
  content: ''; position: sticky; right: 0; flex: none; width: 32px; margin-left: -6px; pointer-events: none;
  background: linear-gradient(to right, transparent, var(--reiter-grund, var(--flaeche)) 80%);
}
.reiter > *, .unternav > * { flex: none; white-space: nowrap; scroll-snap-align: start; }
.unternav { --reiter-grund: var(--grund); }
[role="tabpanel"] { min-width: 0; overflow-x: auto; }      /* breite Tabellen scrollen im Reiter, nicht die Seite */
.reiter button { all: unset; box-sizing: border-box; flex: none; white-space: nowrap; scroll-snap-align: start; cursor: pointer; padding: 8px 14px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.reiter button[aria-selected="true"] { color: var(--akzent-kraeftig); border-bottom-color: var(--akzent); }
.reiter button:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }

dl.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.angaben dt { color: var(--text-3); }
dl.angaben dd { margin: 0; }
ul.schlicht { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
ol.schritte { margin: 0; padding: 0; list-style: none; counter-reset: schritt; display: flex; flex-direction: column; gap: 12px; text-align: left; }
ol.schritte li { counter-increment: schritt; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
ol.schritte li::before { content: counter(schritt); width: 28px; height: 28px; border-radius: 50%; background: var(--akzent-zart); color: var(--akzent-kraeftig); font-weight: 700; display: grid; place-items: center; }
ol.schritte b { display: block; }
kbd { font: 12px var(--schrift-fest); background: var(--flaeche-2); border: 1px solid var(--linie-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }

/* ---------- 4 Dialoge und Meldungen ---------- */
dialog.dialog {
  border: 1px solid var(--linie); border-radius: 12px; padding: 0; background: var(--flaeche); color: var(--text);
  box-shadow: var(--schatten); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
dialog.dialog[open] { display: flex; flex-direction: column; }
dialog.dialog.breit { width: min(820px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(15, 22, 32, .5); }
.dialog-kopf { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.dialog-kopf h2 { flex: 1; font-size: 17px; }
.dialog-rumpf { padding: 14px 20px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-fuss { padding: 12px 20px; border-top: 1px solid var(--linie); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--flaeche-2); border-radius: 0 0 12px 12px; }

.meldungen {
  position: fixed; inset: auto 20px 20px auto; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 60; max-width: min(460px, calc(100vw - 40px));
}
.meldungen > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.meldung {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px 10px 14px; border-radius: var(--rund);
  background: var(--text); color: var(--grund); box-shadow: var(--schatten); font-weight: 550;
}
.meldung.fehler { background: var(--rot); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-farbe="hell"]) .meldung.fehler { color: #1b0c0a; } }
:root[data-farbe="dunkel"] .meldung.fehler { color: #1b0c0a; }
.meldung button { all: unset; cursor: pointer; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.meldung button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---------- 5 Anmeldung ---------- */
.anmeldung { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.anmeldung .karte { width: min(400px, 100%); padding: 28px; gap: 18px; box-shadow: var(--schatten); }
.anmeldung .marke { font-size: 20px; }
.anmeldung .marke svg { width: 34px; height: 34px; }
.anmeldung .unterzeile { color: var(--text-2); margin-top: -8px; }

/* ---------- 6 Projektliste ---------- */
.suchfeld { position: relative; }
.suchfeld svg { position: absolute; left: 9px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.suchfeld input { padding-left: 30px; width: 260px; max-width: 100%; }
table.liste.projekte td { vertical-align: middle; }
table.liste.projekte a.name { font-weight: 650; color: var(--text); text-decoration: none; }
table.liste.projekte a.name:hover { color: var(--akzent); text-decoration: underline; }
.ampel-legende { display: flex; gap: 10px; font-size: 12px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ampel-legende span { display: inline-flex; gap: 4px; align-items: center; }
.anteil { display: flex; align-items: center; gap: 8px; }
.anteil .balken { flex: 1; min-width: 60px; }

/* ---------- 7 Prüfen ---------- */
.pruefen { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.projektkopf { flex: none; background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 12px 20px; display: flex; flex-direction: column; gap: 10px; }
.projektkopf .zeile1 { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.projektkopf .titel { flex: 1; min-width: 220px; }
.projektkopf .titel h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projektkopf .titel .unter { color: var(--text-3); font-size: 12.5px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.projektkopf .zurueck { color: var(--text-3); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.projektkopf .zurueck svg { width: 13px; height: 13px; }
.projektkopf .zurueck:hover { color: var(--akzent); }
.bauart { display: flex; gap: 6px; align-items: center; }
.bauart select, .bauart input { padding: 5px 8px; border: 1px solid var(--linie-2); border-radius: 7px; background: var(--flaeche); }
.bauart input { width: 64px; text-align: right; }
.aufklapp { position: relative; }
.aufklapp > summary { list-style: none; }
.aufklapp > summary::-webkit-details-marker { display: none; }

.summen { display: flex; gap: 10px 30px; align-items: flex-start; flex-wrap: wrap; }
.summe { display: flex; flex-direction: column; line-height: 1.25; }
.summe .titel { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summe .wert { font-size: 17px; font-weight: 680; font-variant-numeric: tabular-nums; }
.summe .wert small { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.summe.verteilung { min-width: 220px; flex: 0 1 280px; }
.summe.verteilung .balken { margin: 6px 0 1px; }
.summe select { align-self: flex-start; padding: 2px 4px; border: 1px solid var(--linie-2); border-radius: 6px; background: var(--flaeche); font-weight: 650; }

.filterleiste { flex: none; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 20px; background: var(--flaeche-2); border-bottom: 1px solid var(--linie); }
.filter { display: flex; gap: 4px; flex-wrap: wrap; }
.filter button {
  all: unset; cursor: pointer; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--linie-2); background: var(--flaeche);
  font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center;
}
.filter button .anzahl { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 500; }
.filter button[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.filter button[aria-pressed="true"] .anzahl { color: inherit; opacity: .85; }
.filter button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.filterleiste .suchfeld input { width: 240px; padding-top: 5px; padding-bottom: 5px; }
.filterleiste .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.treffer { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.arbeitsflaeche { flex: 1; min-height: 0; display: flex; }
.tabellenrahmen { flex: 1; min-width: 0; overflow: auto; background: var(--flaeche); }
.tabellenrahmen:focus { outline: none; }
.detailspalte { flex: none; width: 384px; border-left: 1px solid var(--linie); background: var(--flaeche); overflow: auto; display: none; }
/* UX-028: Tablet quer (ab 1024 px) zeigt Liste und Detail nebeneinander, das Detail etwas schmaler */
@media (min-width: 1024px) { .detailspalte { display: block; } }
@media (min-width: 1024px) and (max-width: 1279.98px) { .detailspalte { width: 330px; } }
/* UX-070: darunter überlagert der Detailbereich die Tabelle – rechts eingeschoben (Tablet), von unten (Handy) */
@media (max-width: 1023.98px) {
  .detailspalte.offen {
    display: block; position: fixed; z-index: 20; top: var(--kopf-hoehe); right: 0; bottom: 0; width: min(420px, 100vw);
    border-left: 1px solid var(--linie); box-shadow: var(--schatten); overscroll-behavior: contain;
  }
  .detail .kopf { position: sticky; top: -16px; z-index: 1; background: var(--flaeche); margin: -16px -18px 0; padding: 12px 18px 10px; border-bottom: 1px solid var(--linie); }
}
@media (max-width: 700px) {
  .detailspalte.offen {
    top: auto; left: 0; width: 100%; max-height: 72vh; bottom: calc(var(--fuss-hoehe, 0px) + env(safe-area-inset-bottom, 0px));
    border-left: 0; border-top: 1px solid var(--linie); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 28px rgba(20, 30, 45, .22);
  }
}
.detail-bedienung { margin-left: auto; display: inline-flex; gap: 2px; align-items: center; }
.detail-bedienung .knopf { min-width: 36px; min-height: 36px; font-size: 18px; line-height: 1; }
@media (min-width: 1500px) { .detailspalte { width: 460px; } }

table.positionen { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
table.positionen col.c-oz { width: 92px; }
table.positionen col.c-menge { width: 92px; }
table.positionen col.c-zeit { width: 88px; }
table.positionen col.c-h { width: 76px; }
table.positionen col.c-ampel { width: 122px; }
table.positionen col.c-herkunft { width: 162px; }
table.positionen col.c-ok { width: 66px; }
table.positionen thead th {
  position: sticky; top: 0; z-index: 3; background: var(--flaeche); text-align: left;
  font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  padding: 0 10px; height: 34px; border-bottom: 1px solid var(--linie-2); white-space: nowrap;
}
table.positionen th.r, table.positionen td.r { text-align: right; }
table.positionen th.m, table.positionen td.m { text-align: center; }
table.positionen td { padding: 3px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; height: 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.positionen tr.titelzeile th {
  position: sticky; top: 34px; z-index: 2; text-align: left; background: var(--flaeche-2); padding: 0; border-bottom: 1px solid var(--linie); font-weight: 600;
}
.titelknopf { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 10px; }
.titelknopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.titelknopf svg { width: 14px; height: 14px; flex: none; color: var(--text-3); transition: rotate .12s; }
.titelknopf[aria-expanded="false"] svg { rotate: -90deg; }
.titelknopf .nr { color: var(--text-3); font-variant-numeric: tabular-nums; }
.titelknopf .bez { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.titelknopf .dazu { margin-left: auto; display: flex; gap: 14px; color: var(--text-3); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.positionen tr.pos { cursor: default; scroll-margin: 76px 0 10px; }
table.positionen tr.pos :is(input, button) { scroll-margin: 80px 0 14px; }
table.positionen tr.pos:hover td { background: var(--flaeche-2); }
table.positionen tr.pos.cursor td { background: var(--akzent-zart); }
table.positionen tr.pos.cursor td:first-child { box-shadow: inset 3px 0 0 var(--akzent); }
table.positionen tr.pos:focus { outline: none; }
table.positionen tr.pos:focus-visible td { box-shadow: inset 0 1.5px 0 var(--akzent), inset 0 -1.5px 0 var(--akzent); }
table.positionen tr.pos:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--akzent), inset 0 1.5px 0 var(--akzent), inset 0 -1.5px 0 var(--akzent); }
table.positionen tr.pos.erledigt td.kurztext .kurzknopf { color: var(--text-2); }
table.positionen td.oz { color: var(--text-2); font-variant-numeric: tabular-nums; }
table.positionen td.kurztext { padding-top: 0; padding-bottom: 0; }
.kurzknopf { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 7px; width: 100%; height: 33px; min-width: 0; }
.kurzknopf .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kurzknopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; border-radius: 4px; }
.kurzknopf .marke-text { font-size: 11px; padding: 0 6px; flex: none; }
table.positionen tr.textzeile td { color: var(--text-3); font-style: italic; height: 30px; background: var(--flaeche); }
table.positionen td.menge .e { color: var(--text-3); margin-left: 4px; }
.zeitfeld {
  width: 68px; padding: 2px 7px; border: 1px solid var(--linie-2); border-radius: 6px; background: var(--flaeche); color: var(--text);
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 550;
  transition: box-shadow .25s, border-color .25s, background-color .25s;
}
.zeitfeld:focus { border-color: var(--akzent); outline: 2px solid var(--akzent); outline-offset: 0; }
.zeitfeld.hand { border-color: var(--hand); color: var(--hand); font-weight: 700; }
.zeitfeld.gespeichert { border-color: var(--gruen); background: var(--gruen-zart); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gruen) 35%, transparent); }
.zeitfeld.fehler { border-color: var(--rot); background: var(--rot-zart); }
.zeitfeld:read-only { background: transparent; border-color: transparent; }
table.positionen td.zeit { overflow: visible; position: relative; }
.zeitfehler { position: absolute; right: 10px; top: 100%; margin-top: -4px; z-index: 4; background: var(--rot); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 5px; white-space: nowrap; box-shadow: var(--schatten); }
@media (prefers-color-scheme: dark) { :root:not([data-farbe="hell"]) .zeitfehler { color: #1b0c0a; } }
:root[data-farbe="dunkel"] .zeitfehler { color: #1b0c0a; }
.ampel { display: inline-flex; align-items: center; gap: 6px; }
table.positionen td.herkunft { color: var(--text-2); }
table.positionen td.herkunft .art { color: var(--text-3); }
table.positionen td.ok input { width: 17px; height: 17px; accent-color: var(--akzent); cursor: pointer; vertical-align: middle; }
table.positionen tr.detailzeile td { white-space: normal; padding: 0; background: var(--flaeche-2); height: auto; overflow: visible; }
table.positionen tbody.zu tr.pos, table.positionen tbody.zu tr.textzeile, table.positionen tbody.zu tr.detailzeile { display: none; }
.keine-treffer { padding: 30px 20px; }

.detail { padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 16px; white-space: normal; }
.detail .kopf { display: flex; flex-direction: column; gap: 4px; }
.detail .kopf .oz { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; display: flex; gap: 10px; align-items: center; }
.detail .kopf h2 { font-size: 15px; overflow-wrap: anywhere; }
.detail .kopf .zahlen { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.detail section { display: flex; flex-direction: column; gap: 7px; }
.herkunftskasten { border-radius: var(--rund); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--linie); background: var(--flaeche-2); }
.herkunftskasten .art { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.herkunftskasten .art svg { width: 17px; height: 17px; flex: none; }
.herkunftskasten.bibliothek { background: var(--akzent-zart); border-color: transparent; }
.herkunftskasten.bibliothek .art { color: var(--akzent-kraeftig); }
.herkunftskasten.eigen { background: var(--gruen-zart); border-color: transparent; }
.herkunftskasten.eigen .art { color: var(--gruen); }
.herkunftskasten.gemischt { background: var(--gelb-zart); border-color: transparent; }
.herkunftskasten.gemischt .art { color: var(--gelb); }
.herkunftskasten.standard, .herkunftskasten.hand { background: var(--hand-zart); border-color: transparent; }
.herkunftskasten.standard .art, .herkunftskasten.hand .art { color: var(--hand); }
.vergleich { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; }
.vergleich dt { color: var(--text-3); }
.vergleich dd { margin: 0; overflow-wrap: anywhere; }
.langtext { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); max-height: 220px; overflow: auto; border: 1px solid var(--linie); border-radius: var(--rund); padding: 8px 10px; background: var(--flaeche-2); font-size: 13px; }
.detail details > summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.detail details[open] > summary { margin-bottom: 6px; }
.kandidat { border: 1px solid var(--linie); border-radius: var(--rund); padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.kandidat .text { overflow-wrap: anywhere; }
.kandidat .angaben { display: flex; gap: 4px 12px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; align-items: center; }
.kandidat .knopf { align-self: flex-start; white-space: normal; text-align: left; }
.notizstatus { font-size: 12.5px; color: var(--text-3); min-height: 1.2em; }

/* ---------- 8 übrige Ansichten ---------- */
.vorschau { border: 1px solid var(--akzent); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--flaeche); }
.dateiwahl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dateiwahl input[type="file"] { max-width: 100%; min-width: 0; flex: 1 1 200px; }
.dateiwahl { min-width: 0; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vorher-nachher td.neu { font-weight: 700; }
.status-zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.protokoll-angaben { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.tasten { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; align-items: baseline; }
.tasten dd { margin: 0; }
.ampel-erklaerung { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; align-items: baseline; }
.ampel-erklaerung dd { margin: 0; }

/* ---------- 9 schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .gruppe.zweier { grid-template-columns: 1fr; }
  .kopfleiste { gap: 10px; padding: 0 12px; }
  .konto .wer { display: none; }
  .seite { padding: 18px 14px 50px; }
  .zweispaltig { grid-template-columns: 1fr; }
  table.positionen col.c-herkunft { width: 120px; }
  .projektkopf, .filterleiste { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 700px) {
  table.positionen { table-layout: auto; min-width: 760px; }
  .filterleiste .rechts { margin-left: 0; }
  /* Navigation wandert nach unten: oben bleiben Marke, Hilfe und Konto */
  .kopfleiste .hauptnav { display: none; }
  .kopfleiste .hilfe-menue { margin-left: auto; }
  .fussnav {
    flex: none; display: flex; align-items: stretch; justify-content: space-around;
    min-height: var(--fuss-hoehe); padding: 0 4px env(safe-area-inset-bottom, 0);
    background: var(--flaeche); border-top: 1px solid var(--linie);
  }
  .fussnav a, .fussnav button {
    all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 0; min-width: 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--text-2); text-align: center;
  }
  .fussnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fussnav svg { width: 22px; height: 22px; flex: none; }
  .fussnav a[aria-current="page"], .fussnav button.aktiv { color: var(--akzent-kraeftig); }
  .fussnav a[aria-current="page"]::before, .fussnav button.aktiv::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--akzent); }
  .fussnav a:focus-visible, .fussnav button:focus-visible { outline: 2px solid var(--akzent); outline-offset: -3px; border-radius: 8px; }
  .fussnav .nav-zahl { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  dialog.blatt { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom, 0); }
}
@media print {
  .kopfleiste, .filterleiste, .detailspalte, .meldungen { display: none; }
  .inhalt, .tabellenrahmen, .pruefen, .rahmen, #app, html, body { height: auto; overflow: visible; }
}

/* ---------- 10 Angebote & Nachträge ---------- */
.seite.breit { max-width: 1480px; }
.filterzeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filterzeile .eingabe { width: auto; }
.zurueck-link { color: var(--text-3); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.zurueck-link svg { width: 13px; height: 13px; }
.zurueck-link:hover { color: var(--akzent); }
.vorgangskopf { display: flex; flex-direction: column; gap: 10px; }
.vorgangskopf .zeile1 { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.vorgangskopf .zeile1 > .titel { flex: 1; min-width: 260px; }
.vorgangskopf h1 .nummer { color: var(--text-3); font-weight: 600; }
.vorgangskopf .unter { color: var(--text-3); font-size: 12.5px; display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 4px; }
.eingabe.kompakt { padding: 4px 8px; width: auto; }
.reiterflaeche { padding-top: 6px; display: flex; flex-direction: column; gap: 14px; }
.reiterflaeche:focus { outline: none; }
.zwei-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.zwei-spalten > section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
table.ap-positionen { font-size: 13px; }
table.ap-positionen td { padding: 5px 8px; vertical-align: middle; }
table.ap-positionen th { padding: 8px; }
table.ap-positionen td.oz { color: var(--text-2); white-space: nowrap; }
table.ap-positionen td.kurztext { max-width: 420px; }
table.ap-positionen .kurzknopf { height: auto; min-height: 30px; }
table.ap-positionen .kurzknopf svg { width: 13px; height: 13px; flex: none; color: var(--text-3); transition: rotate .12s; }
table.ap-positionen .kurzknopf[aria-expanded="false"] svg { rotate: -90deg; }
table.ap-positionen td.zeit { overflow: visible; }
table.ap-positionen .zeitfeld { width: 74px; }
table.ap-positionen td.b { font-weight: 650; }
table.ap-positionen td.m, table.ap-positionen th.m { text-align: center; }
table.ap-positionen td .e { color: var(--text-3); }
table.ap-positionen tr.entfall td { color: var(--rot); }
table.ap-positionen tr.textzeile td { color: var(--text-3); font-style: italic; }
table.ap-positionen tr.detailzeile td { background: var(--flaeche-2); padding: 0; }
table.ap-positionen .herkunft svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.ap-detail { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ap-detail .langtext, .textentwurf { white-space: pre-wrap; margin: 0; font: inherit; }
.ap-detail h3 { margin-top: 4px; }
table.liste.kompakt td { padding: 3px 6px; }
table.liste.kompakt .eingabe { padding: 4px 6px; }
.eingabe.mittel { width: 140px; }
.stueckliste, .nebenzeiten { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stueckliste .tabellen-rollen { align-self: stretch; }
.neue-position { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.neue-position .eingabe:not(.kurz) { flex: 1; min-width: 240px; }
.neue-position select.eingabe { flex: none; min-width: 0; width: auto; }
.dateiwahl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.marke-text.ki { background: var(--hand-zart); border-color: transparent; color: var(--hand); }
.ki-vorschlag { border: 1px dashed var(--hand); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--hand-zart) 35%, var(--flaeche)); }
.ki-vorschlag + .ki-vorschlag { margin-top: 14px; }
.ki-hinweis p { margin: 6px 0; }
.ki-tabelle tr.erledigt td { opacity: .6; }
.ki-tabelle td { font-size: 13px; }
.langtext-kurz { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.auswahl.senkrecht { flex-direction: column; }
textarea.eingabe.brief { font-family: var(--schrift); min-height: 260px; }
label.haken.gross { font-weight: 650; font-size: 15px; }
.balken.breit { height: 10px; }
.logo-vorschau { max-width: 320px; max-height: 110px; border: 1px solid var(--linie); border-radius: 6px; padding: 6px; background: #fff; }
.flaeche-nachtragsliste { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .zwei-spalten { grid-template-columns: 1fr; } }

/* ---------- 10 Regieberichte (Erfassung am Handy: große Knöpfe, ein Bericht je Bildschirm) ---------- */
.knopf.gross { padding: 12px 16px; font-size: 15px; border-radius: 9px; min-height: 46px; }
.knopf.gross svg { width: 18px; height: 18px; }
.knopf.haupt-zart { background: var(--akzent-zart); border-color: var(--akzent); color: var(--akzent-kraeftig); }
.knopf.laeuft { background: var(--rot); border-color: var(--rot); color: #fff; }
textarea.eingabe.gross, .eingabe.gross { font-size: 16px; }
.regie-handy .karte { gap: 14px; }
.regie-handy h2 { font-size: 17px; }
.regie-handy .eingabe { font-size: 16px; }                     /* 16 px: das Handy zoomt beim Tippen nicht hinein */
.regie-karten { display: flex; flex-direction: column; gap: 10px; }
.regie-karte { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: 10px; background: var(--flaeche); color: var(--text); text-decoration: none; }
.regie-karte:hover { border-color: var(--akzent); }
.regie-karte .zeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.regie-rohtext { white-space: pre-wrap; background: var(--flaeche-2); padding: 8px 10px; border-radius: var(--rund); }
.regie-fotos { display: flex; gap: 10px; flex-wrap: wrap; }
.regie-fotos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.regie-fotos img { width: 112px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); background: var(--flaeche-2); }
.regie-eintraege, .regie-material { display: flex; flex-direction: column; gap: 10px; }
.regie-eintrag { border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--flaeche-2); }
.regie-eintrag.offen, .regie-materialzeile.offen { border-color: var(--gelb-punkt); }
.regie-eintrag .zeile, .regie-materialzeile { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.regie-eintrag .zeile > .eingabe:first-child, .regie-materialzeile > .eingabe:first-child { flex: 1 1 160px; min-width: 0; }
.regie-eintrag .zeile > select.eingabe { width: auto; flex: 0 1 150px; }
.regie-materialzeile { border-bottom: 1px solid var(--linie); padding-bottom: 8px; }
.regie-materialzeile select.eingabe { width: auto; }
label.mini { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-2); }
label.mini .eingabe { width: 112px; }
label.mini input[type="number"].eingabe { width: 84px; }
.regie-std { font-weight: 700; padding: 9px 0; display: inline-block; min-width: 70px; }
.regie-summe { font-weight: 700; }
.regie-fuss { position: sticky; bottom: 0; background: color-mix(in srgb, var(--grund) 92%, transparent); padding: 10px 0; z-index: 5; display: flex; flex-direction: column; gap: 6px; }
.regie-fuss .aktionen { flex-wrap: wrap; }
.regie-fuss:empty, .regie-fuss[hidden] { display: none; }
.regie-weitere { justify-content: flex-start; }
.regie-unterschrift { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.regie-unterschrift img { max-width: 320px; width: 100%; background: #fff; border: 1px solid var(--linie); border-radius: 8px; }
canvas.unterschrift-flaeche { width: 100%; height: 200px; background: #fff; border: 1px dashed var(--linie-2); border-radius: 8px; touch-action: none; display: block; }
.ki-markiert { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.regie-tag { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--linie); padding-top: 10px; }
.regie-tag-bericht { display: flex; flex-direction: column; gap: 6px; }
table.liste tfoot td { font-weight: 700; border-top: 1px solid var(--linie-2); }
.rahmen.monteur .kopfleiste .hauptnav a { font-size: 15px; }
@media (max-width: 700px) {
  .regie-handy { padding: 14px 12px 40px; }
  .regie-handy .reihe { flex-direction: column; align-items: stretch; }
  .regie-handy .aktionen .knopf.gross { flex: 1 1 100%; }
  .regie-handy .regie-fuss .aktionen .knopf { flex: 1 1 40%; padding-left: 8px; padding-right: 8px; white-space: normal; }
  label.mini .eingabe { width: 100px; }
}

/* ---------- 10 Rechtliches (Impressum, Datenschutz, Nutzungsbedingungen, AV-Vertrag: statische Seiten unter recht/) ---------- */
.anmeldung { grid-template-rows: 1fr auto; }
.anmeldung > .karte { align-self: center; }
.recht-verweise { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12.5px; }
.recht-verweise a { color: var(--text-3); }
.menue .recht-verweise { justify-content: flex-start; gap: 0; border-top: 1px solid var(--linie); margin-top: 6px; padding-top: 4px; }
.menue .recht-verweise a { font-size: 12.5px; color: var(--text-3); }
body.recht { background: var(--grund); }
.recht-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 12px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.recht-kopf nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.recht-kopf nav a { color: var(--text-2); text-decoration: none; }
.recht-kopf nav a[aria-current="page"] { color: var(--akzent); font-weight: 600; }
.recht-text { max-width: 760px; margin: 0 auto; padding: 28px 20px 40px; line-height: 1.6; }
.recht-text h1 { font-size: 26px; margin: 0 0 8px; }
.recht-text h2 { font-size: 18px; margin: 28px 0 6px; }
.recht-text h3 { font-size: 15px; margin: 18px 0 4px; }
.recht-text p, .recht-text ul { margin: 0 0 10px; }
.recht-text a { color: var(--akzent); }
.recht-text mark.offen { background: var(--gelb-zart); color: var(--gelb); border-radius: 4px; padding: 0 4px; font-family: var(--schrift-fest); font-size: .9em; }
.recht-tabelle { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.recht-tabelle th, .recht-tabelle td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--linie); }
.recht-fuss { text-align: center; padding: 0 20px 32px; font-size: 13px; }
.recht-fuss a { color: var(--text-3); }
@media print {
  .recht-kopf nav, .recht-fuss { display: none; }
  .recht-text mark.offen { background: none; color: inherit; }
}

.entw-filter { width: auto; max-width: 100%; }

/* ---------- Feedback ---------- */
.feedback-arten { flex-wrap: wrap; gap: 6px; }
.feedback-themen { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.feedback-thema h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: normal; color: var(--text); }
.feedback-thema p { margin: 0; }

/* ---------- Einkauf ---------- */
.ek-ampel { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ek-ampel .marke-text { padding: 0 7px; min-width: 22px; justify-content: center; }
.ek-hinweise { background: var(--gelb-zart); border-radius: 10px; padding: 10px 14px; }
.ek-hinweise ul { margin: 4px 0 0 18px; }
.ek-hinweise + .hinweis, .hinweis + .hinweis { margin-top: 8px; }
.ek-angaben { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.ek-angaben dt { color: var(--text-3); font-size: 12.5px; padding-top: 2px; }
.ek-angaben dd { margin: 0; overflow-wrap: anywhere; }
.ek-zuordnen { background: var(--flaeche-2); border-radius: 10px; padding: 10px 12px; }
.ek-zuordnen label { display: inline-flex; gap: 6px; align-items: center; }
.ek-positionen tr.ek-offen td { background: var(--rot-zart); }
.ek-zuo { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ek-stamm .eingabe { min-width: 120px; }

/* ---------- Sicherheit: Zwei-Faktor-Anmeldung, Geräte ---------- */
.anmeldung .karte.breit { width: min(520px, 100%); }
.qr { margin: 10px 0; }
.qr svg { width: 200px; height: 200px; max-width: 100%; display: block; background: #fff; border-radius: 6px; }
.schluessel { display: inline-block; font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: .05em; padding: 6px 8px; background: var(--flaeche-2, rgba(0,0,0,.05)); border-radius: 6px; user-select: all; word-break: break-all; }
.code-eingabe { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .2em; max-width: 14em; }
.ersatzcodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; list-style: none; padding: 0; font-family: ui-monospace, monospace; font-size: 16px; }
.geraete { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.geraete li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.geraete li > .leise { grid-column: 1; }
.geraete li > button { grid-column: 2; grid-row: 1 / span 2; }
.geraete .marke-text { margin-left: 8px; }
.abschnitt { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

/* Kontaktformular (recht/kontakt.html) */
.kontakt-formular { margin-top: 18px; }
.kontakt-falle { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
label.haken.kontakt-einwilligung { align-items: flex-start; font-size: 14px; }
.kontakt-einwilligung input { margin-top: 4px; flex: none; }

/* Betreiber-Konsole */
.betr-sperre { max-width: 460px; padding: 20px; }
.betr-kopf { flex: 1; min-width: 260px; }
.betr-kopf h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.betr-abschnitt { margin: 22px 0 8px; }
.betr-status { margin-bottom: 12px; }
.betr-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.betr-stamm { max-width: 980px; }
.betr-module { display: flex; flex-direction: column; gap: 8px; }
.betr-schalter { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.betr-ende { flex-wrap: wrap; }
.betr-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px; }
.betr-kachel { border: 1px solid var(--linie); border-radius: 8px; padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.betr-wert { font-size: 1.15rem; font-weight: 600; margin: 4px 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.betr-filter { flex-wrap: wrap; margin: 8px 0 12px; }
.betr-filter .eingabe { width: auto; min-width: 180px; }
.betr-spur { max-height: 320px; overflow: auto; font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.betr-fehler td:last-child { min-width: 320px; }
/* ---------- Rechnungen ---------- */
.re-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.re-raster h2 { font-size: 15px; margin: 0 0 4px; }
.re-summen { margin-left: auto; min-width: 300px; border-collapse: collapse; }
.re-summen td { padding: 4px 8px; }
.re-summen td.r { text-align: right; }
.re-summen tr.gesamt td { border-top: 2px solid var(--text); font-weight: 700; }
.re-positionen td { vertical-align: top; }
.re-positionen .eingabe { width: 100%; min-width: 0; padding: 5px 7px; }
.re-positionen textarea.eingabe { min-height: 30px; margin-top: 4px; font-size: 12.5px; }
.re-positionen .re-oz { width: 70px; }
.re-positionen .re-zahl { width: 90px; text-align: right; }
.re-positionen .re-einheit { width: 60px; }
.re-positionen .re-mwst { width: 56px; text-align: right; }
.re-positionen .re-knoepfe { white-space: nowrap; }
.re-positionen tr.re-textzeile td { background: var(--flaeche-2); }
.fehlertext { color: var(--rot); font-weight: 600; }

/* ---------- Posteingang ---------- */
.unternav { margin: 0 0 14px; }
.unternav a { padding: 8px 12px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.unternav a[aria-current="page"] { color: var(--akzent-kraeftig); border-bottom-color: var(--akzent); }
.adresszeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.adresszeile code { font-family: var(--schrift-fest); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; }
.adresszeile code.gross { font-size: 16px; }
.zeile-zwischen { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.zeile-zwischen h3 { margin: 0; }
.voicemail { margin-bottom: 12px; }
.voicemail.erledigt { opacity: .75; }
.voicemail-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; margin: 10px 0; }
.voicemail audio { width: 100%; max-width: 420px; margin: 4px 0 8px; }
ul.knapp { list-style: none; margin: 0; padding: 0; }
ul.knapp li + li { margin-top: 4px; }
.leise-knopf { color: var(--text-3); }
.nav-zahl { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--rot); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* ---------- Startseite mit Kacheln ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.kachel { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 18px;
  border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); color: inherit; text-decoration: none; min-height: 120px; }
.kachel:hover, .kachel:focus-visible { border-color: var(--akzent); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.kachel-symbol { grid-row: 1 / 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--akzent-zart); }
.kachel-symbol svg { width: 20px; height: 20px; color: var(--akzent); }
.kachel-zahl { font-size: 30px; font-weight: 700; line-height: 1; }
.kachel-titel { grid-column: 1 / -1; margin-top: 12px; font-weight: 600; }
.kachel-text { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; }
.kachel.dringend .kachel-zahl { color: var(--rot); }

/* ---------- Sprachdialog im Regiebericht ---------- */
.gespraech-verlauf { max-height: 45vh; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; margin: 10px 0;
  border: 1px solid var(--linie); border-radius: var(--rund); background: var(--flaeche-2); }
.gespraech-zeile { padding: 8px 12px; border-radius: 12px; max-width: 85%; line-height: 1.4; }
.gespraech-zeile.ki { align-self: flex-start; background: var(--akzent-zart); }
.gespraech-zeile.sie { align-self: flex-end; background: var(--flaeche); border: 1px solid var(--linie); }
.sprechtaste-zeile { justify-content: center; }
.sprechtaste { min-height: 64px; padding-inline: 28px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sprechtaste.laeuft { background: var(--rot); border-color: var(--rot); }
.schema-vorschau { margin: -6px 0 4px; font-variant-numeric: tabular-nums; }
.schema-vorschau.warn { color: var(--rot); }

/* ---------- Touch-Geräte (UX-020, UX-021): Zielgrößen ab 44 px, Eingaben in 16 px (iOS zoomt sonst beim Antippen) ---------- */
@media (pointer: coarse) {
  .knopf, .eingabe, select.eingabe, input.zeitfeld, .reiter button, .unternav a, .hauptnav > a, .nav-mehr > summary, .menue button, .menue a, .filter button { min-height: var(--touch-min); }
  .knopf.klein { min-height: 40px; padding-inline: 14px; }
  .knopf.nur-symbol { min-width: var(--touch-min); }
  .konto > summary, .hilfe-menue > summary { min-height: var(--touch-min); min-width: var(--touch-min); justify-content: center; }
  .zurueck-link { display: inline-flex; align-items: center; min-height: var(--touch-min); }
  input, select, textarea, .eingabe, input.zeitfeld { font-size: 16px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  .auswahl label, label.haken { min-height: var(--touch-min); }
  .aktionen, .reihe, .filter, .filterzeile { gap: 8px; }
  textarea.eingabe { min-height: 88px; }
}

/* ---------- Stammdaten (UX-080/081): Projektauswahl mit Suche, Projektliste mit LVs ---------- */
.suchwahl { position: relative; flex: 1 1 260px; min-width: 0; max-width: 460px; }
.feld > .suchwahl { max-width: none; flex: none; }
.suchwahl > .eingabe { width: 100%; }
.suchwahl-liste {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten); padding: 4px;
}
.suchwahl-liste .wahl { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.suchwahl-liste .wahl:hover, .suchwahl-liste .wahl[aria-selected="true"] { background: var(--flaeche-2); }
.suchwahl-liste .wahl[aria-selected="true"] { outline: 2px solid var(--akzent); outline-offset: -2px; }
.suchwahl-liste .wahl.neu { border-top: 1px solid var(--linie); border-radius: 0 0 6px 6px; margin-top: 4px; color: var(--akzent-kraeftig); font-weight: 600; }
.suchwahl-liste .wahl-hinweis { padding: 7px 10px; }
.link-knopf { all: unset; cursor: pointer; color: var(--akzent-kraeftig); font-weight: 600; }
.link-knopf:hover { text-decoration: underline; }
.link-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 3px; }
table.liste.stamm tr.stammkopf > * { background: var(--flaeche-2); border-top: 1px solid var(--linie); text-align: left; font-weight: 400; }
table.liste.stamm tr.stammkopf > td.r { text-align: right; }
table.liste.stamm tr.stammkopf .name { font-weight: 650; }
table.liste.stamm tr.stammkopf.inaktiv .name { color: var(--text-2); }
table.liste.stamm tr.lv > td:first-child { padding-left: 22px; }
.zeilenaktionen { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (pointer: coarse) { .suchwahl-liste .wahl { min-height: var(--touch-min); justify-content: center; } }
.stamm-vorschlaege { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.vorschlaege section + section { margin-top: 18px; }
.vorschlaege h3 { margin: 0 0 2px; font-size: 14.5px; }
.vorschlag-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.vorschlag-liste li { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--linie); }
.vorschlag-liste li > div:first-child { min-width: 0; flex: 1 1 220px; }

/* ---------- UX-023: Kopfbereiche – eine Hauptaktion, Seltenes im Menü „⋯“ ---------- */
.seitenkopf .aufklapp > summary.knopf { display: inline-flex; }
.seitenkopf .aufklapp > summary.knopf.haupt svg:last-child { width: 14px; height: 14px; margin-left: 2px; }
@media (max-width: 700px) {
  .seitenkopf > .aktionen { width: 100%; }
  .seitenkopf > .aktionen > .knopf.haupt, .seitenkopf > .aktionen > .aufklapp:has(> summary.haupt) { flex: 1; }
  .seitenkopf > .aktionen > .aufklapp > summary.haupt { width: 100%; justify-content: center; box-sizing: border-box; }
  .seitenkopf > .aktionen .aufklapp:first-child .menue { right: auto; left: 0; }
}

/* ---------- UX-024: Listen am Handy als Karten (Überschrift je Zelle aus data-titel, gesetzt in app.js) ---------- */
@media (max-width: 700px) {
  table.liste.karten, table.liste.karten tbody, table.liste.karten tfoot { display: block; min-width: 0 !important; width: 100%; }
  table.liste.karten thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.liste.karten tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--linie); }
  table.liste.karten tr:last-child { border-bottom: 0; }
  table.liste.karten td { display: flex; gap: 14px; justify-content: space-between; align-items: baseline; padding: 2px 0 !important; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  table.liste.karten td::before { content: attr(data-titel); flex: none; max-width: 45%; text-align: left; font-size: 12px; color: var(--text-3); }
  table.liste.karten td[data-titel=""]::before { content: none; }
  table.liste.karten td:empty { display: none; }
  table.liste.karten td:first-child { display: block; text-align: left; font-weight: 600; font-size: 15px; padding-bottom: 4px !important; }
  table.liste.karten td:first-child::before { content: none; }
  table.liste.karten td > div, table.liste.karten td > span { min-width: 0; }
  table.liste.karten td .balken { min-width: 90px; }
  table.liste.karten tr.stammkopf { background: var(--flaeche-2); }
  table.liste.karten tr.stammkopf > td { background: none; border: 0; display: block; text-align: left; }
  table.liste.karten tr.stammkopf > td::before { content: none; }
  table.liste.karten tr.stammkopf .zeilenaktionen { margin-top: 6px; justify-content: flex-start; }
  table.liste.karten tr.lv > td:first-child { padding-left: 0; }
  table.liste.karten td.aktionen-zelle, table.liste.karten td.r:last-child:has(.knopf) { justify-content: flex-end; }
}

/* ---------- UX-025: Kennzahlen am Handy kompakt, zwei je Zeile ---------- */
@media (max-width: 700px) {
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kennzahl { padding: 9px 12px; min-width: 0; }
  .kennzahl .titel { font-size: 12px; }
  .kennzahl .wert { font-size: 19px; overflow-wrap: anywhere; }
  .kennzahl .dazu { font-size: 12px; }
  .kennzahlen > .kennzahl:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- UX-026: Aktionsleiste im Regiebericht – deckend, mit Linie und Schatten; ab Tablet quer nicht mehr schwebend ---------- */
.regie-fuss {
  background: var(--flaeche); border-top: 1px solid var(--linie); box-shadow: 0 -6px 16px rgba(20, 30, 45, .08);
  margin: 14px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  .regie-fuss { position: static; background: none; border-top: 1px solid var(--linie); box-shadow: none; margin: 14px 0 0; padding: 12px 0 0; }
}

/* ---------- UX-027: Safe Areas (Notch, Home-Indikator) und Hinweis ohne Netz ---------- */
.kopfleiste {
  height: calc(var(--kopf-hoehe) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
@media (max-width: 700px) {
  .kopfleiste { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .fussnav { padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); }
}
.netz-hinweis { flex: none; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 6px 14px; background: var(--gelb-zart); color: var(--text); font-size: 13px; border-bottom: 1px solid var(--linie); }
.netz-hinweis svg { width: 16px; height: 16px; flex: none; }
@media (min-width: 701px) and (max-width: 1023.98px) { .detailspalte.offen { top: calc(var(--kopf-hoehe) + env(safe-area-inset-top, 0px)); } }

/* ---------- UX-085: Prüfansicht – Kurztext bekommt den Platz, „Wichtig“ als linker Rand, Herkunft schmaler ---------- */
table.positionen col.c-oz { width: 100px; }
table.positionen col.c-menge { width: 84px; }
table.positionen col.c-zeit { width: 84px; }
table.positionen col.c-h { width: 68px; }
table.positionen col.c-ampel { width: 112px; }
table.positionen col.c-herkunft { width: 128px; }
table.positionen col.c-ok { width: 62px; }
table.positionen tr.pos.wichtig td:first-child { box-shadow: inset 4px 0 0 var(--akzent-kraeftig); font-weight: 650; color: var(--text); }
table.positionen tr.pos.wichtig.cursor td:first-child { box-shadow: inset 4px 0 0 var(--akzent-kraeftig); }
table.positionen td.herkunft .art { color: var(--text-3); }
/* unter 1280 px steht die Herkunft nur noch im Detailbereich – die Spalte fällt weg, der Kurztext gewinnt */
@media (max-width: 1279.98px) {
  table.positionen col.c-herkunft { width: 0; }
  table.positionen td.herkunft, table.positionen thead th:nth-child(7) { padding: 0; font-size: 0; border-left: 0; }
  table.positionen col.c-ampel { width: 104px; }
}

/* ---------- UX-086: Kopf der Prüfansicht verdichtet – Bauart im Aufklapper, Kennzahlen in einer Zeile, schmal beim Blättern ---------- */
.lv-einstellungen > summary { display: inline-flex; gap: 6px; }
.lv-einstellungen > summary svg { width: 14px; height: 14px; }
.lv-einstellungen > summary .marke-text { font-size: 11px; padding: 0 6px; }
.lv-einstellungen .menue { min-width: 280px; padding: 14px; gap: 12px; right: auto; left: 0; }
.lv-einstellungen .menue select, .lv-einstellungen .menue input { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--linie-2); border-radius: 7px; background: var(--flaeche); text-align: left; }
.lv-einstellungen .menue .knopf { all: revert; }
.lv-einstellungen .menue button.knopf { font: inherit; cursor: pointer; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--linie-2); background: var(--flaeche); color: var(--text); font-weight: 600; }
.lv-einstellungen .menue button.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.projektkopf { transition: padding .15s; }
.projektkopf .summen { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.projektkopf .summen > * { flex: none; }
.projektkopf .summe.verteilung { flex: 0 1 240px; min-width: 150px; }
.projektkopf.schmal { padding-top: 6px; padding-bottom: 6px; gap: 4px; }
.projektkopf.schmal .zurueck, .projektkopf.schmal .unter, .projektkopf.schmal .hinweis, .projektkopf.schmal .summe:nth-child(n+4), .projektkopf.schmal .ampel-legende { display: none; }
.projektkopf.schmal .titel h1 { font-size: 15px; }
.projektkopf.schmal .summe { flex-direction: row; gap: 6px; align-items: baseline; }
.projektkopf.schmal .summe .wert { font-size: 14px; }
.projektkopf.schmal .summe.verteilung .balken { margin: 0; width: 120px; align-self: center; }
@media (max-width: 700px) {
  .projektkopf { gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .projektkopf .zeile1 { gap: 6px 8px; }
  .projektkopf .titel { min-width: 0; flex: 1 1 100%; }
  .projektkopf .unter span:nth-child(n+3) { display: none; }
  .projektkopf .aktionen { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .projektkopf .aktionen > * { flex: none; }
  .projektkopf .aktionen .aufklapp { position: static; }
  .projektkopf .aktionen .menue { left: 12px; right: 12px; top: auto; }
  .projektkopf .summe:nth-child(n+4) { display: none; }
  .projektkopf.schmal .zeile1 .aktionen { display: none; }
}

/* UX-082: Prüfhinweise als Sprungmarken – das Ziel blitzt kurz auf */
.link-knopf.sprung { font-weight: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.link-knopf.sprung:hover { text-decoration: underline; color: var(--akzent-kraeftig); }
@keyframes aufblitzen { 0%, 60% { box-shadow: 0 0 0 3px var(--akzent); background-color: var(--akzent-zart); } 100% { box-shadow: 0 0 0 0 transparent; } }
.aufblitzen { animation: aufblitzen 2.2s ease-out; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .aufblitzen { animation: none; outline: 3px solid var(--akzent); } }
/* UX-083: Statusverlauf am Ende des Statusmenüs */
.menue .info.unten { border-bottom: 0; border-top: 1px solid var(--linie); margin: 6px 0 0; }

/* UX-084: Regiebericht – lesbare Beschriftungen, Schnellwahl der Zeiten, Text zum gelben Rahmen */
label.mini { font-size: 13.5px; font-weight: 600; }
.regie-schnell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.regie-schnell .sg { display: inline-flex; align-items: center; gap: 5px; }
.regie-schnell .sg > .leise { min-width: 2.6em; }
.schnellknopf { all: unset; box-sizing: border-box; cursor: pointer; min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.schnellknopf:hover { border-color: var(--akzent); }
.schnellknopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.regie-fehlt { margin: 0; font-size: 13px; color: var(--text); background: var(--gelb-zart, #fff4d1); border-radius: 6px; padding: 5px 8px; }
@media (pointer: coarse) { .schnellknopf { min-height: 40px; padding: 0 13px; } }

/* UX-089: Einkauf – weiter zur nächsten offenen Rechnung */
.ek-weiter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.ek-weiter:empty { display: none; }
.ek-weiter .knopf svg { width: 16px; height: 16px; }

/* UX-088: Rechnungsentwurf – feste Aktionsleiste unten mit Speicherstand, Griff und Menü je Position */
.re-fuss { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; padding: 10px 14px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px 12px 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, .08); }
.re-fuss .aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.re-stand { font-size: 13px; color: var(--text-2); }
.re-stand::before { content: '✓ '; color: var(--gruen); }
.re-stand.offen::before { content: '● '; color: var(--gelb-punkt); }
.re-stand.fehler { color: var(--rot); }
.re-stand.fehler::before { content: '✕ '; color: var(--rot); }
.re-positionen .re-knoepfe { display: flex; align-items: center; gap: 2px; }
.re-griff { cursor: grab; padding: 6px 4px; color: var(--text-3); font-size: 16px; line-height: 1; user-select: none; }
.re-griff:active { cursor: grabbing; }
.re-positionen tr.zieht { opacity: .45; }
.re-positionen tr.ziel td { box-shadow: inset 0 3px 0 var(--akzent); }
.re-positionen .re-knoepfe .aufklapp > summary { min-width: 36px; min-height: 36px; }
@media (pointer: coarse) { .re-griff { display: none; } .re-positionen .re-knoepfe .aufklapp > summary { min-width: 44px; min-height: 44px; } }
@media (max-width: 700px) {
  .re-fuss { padding: 8px 10px; }
  .re-fuss .aktionen { width: 100%; }
  .re-fuss .aktionen .knopf { flex: 1 1 auto; justify-content: center; }
}
.tabellen-rollen:has(.re-positionen .aufklapp[open]) { overflow: visible; }

/* UX-090: Übersicht – Kacheln als erkennbare Links, erledigt gedimmt, „Zuletzt bearbeitet“ */
.kachel { grid-template-columns: auto 1fr auto; position: relative; }
.kachel-pfeil { font-size: 22px; line-height: 1; color: var(--text-3); align-self: start; transition: transform .12s; }
.kachel:hover .kachel-pfeil, .kachel:focus-visible .kachel-pfeil { color: var(--akzent); transform: translateX(3px); }
.kachel.offen .kachel-zahl { color: var(--akzent-kraeftig); }
.kachel.erledigt .kachel-zahl, .kachel.erledigt .kachel-titel { color: var(--text-3); }
.kachel.erledigt .kachel-symbol { background: var(--flaeche-2); }
.kachel.erledigt .kachel-symbol svg { color: var(--text-3); }
.kachel.erledigt .kachel-text { color: var(--gruen); }
.start-zuletzt { margin-top: 26px; }
.start-zuletzt h2 { font-size: 16px; margin: 0 0 8px; }
.start-zuletzt ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); overflow: hidden; }
.start-zuletzt li + li { border-top: 1px solid var(--linie); }
.start-zuletzt a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: inherit; text-decoration: none; min-height: 44px; }
.start-zuletzt a:hover, .start-zuletzt a:focus-visible { background: var(--flaeche-2); }
.start-zuletzt .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-zuletzt .wann { margin-left: auto; white-space: nowrap; }
@media (max-width: 700px) {
  .kacheln { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kachel { padding: 12px; min-height: 0; column-gap: 8px; }
  .kachel-symbol { width: 28px; height: 28px; border-radius: 8px; }
  .kachel-symbol svg { width: 16px; height: 16px; }
  .kachel-zahl { font-size: 24px; }
  .kachel-titel { margin-top: 8px; font-size: 13.5px; line-height: 1.25; }
  .kachel-text { font-size: 12px; }
  .start-zuletzt a { flex-wrap: wrap; gap: 4px 8px; }
}

/* UX-087: Positionseditor als Seitenpanel, Menge und EK Stoff direkt in der Zeile */
.ap-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
table.ap-positionen .mengenfeld { width: 64px; }
table.ap-positionen .ekfeld { width: 74px; }
table.ap-positionen tr.gewaehlt td { background: var(--akzent-zart); }
table.ap-positionen tr.gewaehlt td:first-child { box-shadow: inset 3px 0 0 var(--akzent); }
.ap-seite { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; min-width: 0; }
.ap-seite[hidden] { display: none; }
.ap-seite-kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--flaeche); border-bottom: 1px solid var(--linie); border-radius: 12px 12px 0 0; }
.ap-seite-kopf .titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-seite-kopf .knopf.klein { min-width: 34px; justify-content: center; font-size: 17px; line-height: 1; }
.ap-seite .ap-detail .reihe { flex-wrap: wrap; }
.ap-gruppe { border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche-2); }
.ap-gruppe > summary { cursor: pointer; padding: 9px 12px; display: flex; gap: 10px; align-items: baseline; min-height: 24px; }
.ap-gruppe > summary .gt { font-weight: 650; white-space: nowrap; }
.ap-gruppe > summary .leise { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ap-gruppe[open] > summary { border-bottom: 1px solid var(--linie); }
.ap-gruppe-inhalt { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
/* N9: neben der Tabelle steht der Editor erst ab 1500 px; darunter überlagert er sie, damit keine Spalte entfällt oder umbricht */
@media (min-width: 1500px) {
  .ap-layout.mit-seite { grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); }
  .ap-layout .ap-seite { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
  .ap-layout.mit-seite table.ap-positionen th:nth-child(5), .ap-layout.mit-seite table.ap-positionen td.herkunft,
  .ap-layout.mit-seite table.ap-positionen th:nth-child(7), .ap-layout.mit-seite table.ap-positionen td:nth-child(7) { display: none; }
}
@media (max-width: 1499.98px) {
  .ap-layout .ap-seite { position: fixed; inset: 0 0 0 auto; width: min(560px, 100%); z-index: 60; border-radius: 0; border-width: 0 0 0 1px; overflow-y: auto; box-shadow: -12px 0 32px rgba(0, 0, 0, .18);
    padding-bottom: env(safe-area-inset-bottom); }
  .ap-seite-kopf { border-radius: 0; padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* UX-034: KI-Budget – Währungsumschalter und neutraler Zustand ohne Budget */
.umschalter { display: inline-flex; gap: 0; }
.umschalter .knopf { border-radius: 0; margin-left: -1px; }
.umschalter .knopf:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.umschalter .knopf:last-child { border-radius: 0 8px 8px 0; }
.ki-kopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ki-ohne-budget { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ki-ohne-budget p { margin: 0; }

/* UX-014: ein Stil für „zurück“ – Pfeilsymbol und Text, auch als Knopf */
.zurueck-link { font-size: 13.5px; font-weight: 550; padding: 4px 6px 4px 0; border: 0; background: none; cursor: pointer; font-family: inherit; }
.zurueck-link svg { width: 15px; height: 15px; }
.zurueck-link:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

/* UX-035: Tabellenköpfe etwas größer (Sekundärtext ist jetzt dunkler: --text-3) */
table.liste th { font-size: 12.5px; }

/* UX-036: Fließtext 15 px am großen Bildschirm, 16 px auf Touch-Geräten; Seitenbeschreibungen bekommen Platz neben den Knöpfen */
@media (min-width: 1280px) and (pointer: fine) { body { font-size: 15px; } }
@media (pointer: coarse) { body { font-size: var(--fs-3); } }
h1 { font-size: var(--fs-4); }
@media (min-width: 1280px) { h1 { font-size: 24px; } }
.seitenkopf > div:first-child { flex: 1 1 380px; }

/* UX-039: Ampel nie nur über Farbe – jeder Punkt trägt ein Zeichen (✓ ! ✕ ✎) */
.punkt { width: 14px; height: 14px; display: inline-grid; place-items: center; color: #fff; font-size: 9.5px; font-weight: 800; line-height: 1; font-style: normal; }
.punkt.gruen::after { content: '✓'; }
.punkt.gelb::after { content: '!'; color: #3a2a00; font-size: 11px; }
.punkt.rot::after { content: '✕'; }
.punkt.hand::after { content: '✎'; font-weight: 400; font-size: 10px; }
.punkt.hand { border-radius: 3px; }

/* UX-042: Konto-Menü – Unternehmen oben, Betreiber-Konsole abgesetzt */
.menue .info .firma-name { font-weight: 700; font-size: 14px; color: var(--text); }
.menue .abgesetzt { border-top: 1px solid var(--linie); margin-top: 6px; padding-top: 10px; display: flex; align-items: center; gap: 8px; border-radius: 0 0 8px 8px; }

/* UX-032: Formularraster mit Einheit im Feld */
.feldraster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.feldraster .feld { min-width: 0; }
.mit-einheit { position: relative; display: block; }
.mit-einheit > .eingabe { width: 100%; padding-right: 46px; text-align: right; }
.mit-einheit > .einheit { position: absolute; right: 10px; top: 50%; translate: 0 -50%; color: var(--text-3); font-size: 13px; pointer-events: none; }
@media (max-width: 420px) { .feldraster { grid-template-columns: 1fr; } }

/* UX-033: Änderungsprotokoll nach Tagen */
.protokoll-tag + .protokoll-tag { margin-top: 18px; }
.protokoll-tag > h3 { margin: 0 0 6px; }
.protokoll-angaben a { font-weight: 600; }
.protokoll-tag table.liste { table-layout: fixed; }
.protokoll-tag th:nth-child(1) { width: 90px; }
.protokoll-tag th:nth-child(2) { width: 190px; }
.protokoll-tag th:nth-child(3) { width: 250px; }
.protokoll-tag td { overflow-wrap: anywhere; }

/* UX-031: Ablagefläche für Dateien */
.ablage { border: 2px dashed var(--linie-2); border-radius: 12px; padding: 18px 16px; text-align: center; background: var(--flaeche-2); display: flex; flex-direction: column; gap: 6px; align-items: center; transition: border-color .12s, background-color .12s; }
.ablage.ziel { border-color: var(--akzent); background: var(--akzent-zart); }
.ablage.gesperrt { opacity: .6; }
.ablage-text { margin: 0; font-weight: 550; }
.ablage .link-knopf { text-decoration: underline; }
.ablage.laeuft .ablage-text { display: none; }
.ablage-lauf { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.ablage-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ablage-seite { outline: 3px dashed var(--akzent); outline-offset: 6px; border-radius: 12px; }
@media (pointer: coarse) {
  .ablage { border-style: solid; border-width: 1px; }
  .ablage .zieh-text { display: none; }
  .ablage .link-knopf { all: unset; box-sizing: border-box; cursor: pointer; min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 10px; background: var(--akzent); color: var(--akzent-text); font-weight: 650; text-transform: capitalize; }
}

/* UX-050, UX-064: Suche über alles */
dialog.such-dialog { width: min(640px, calc(100vw - 24px)); margin-top: 10vh; }
.such-dialog .dialog-rumpf, .such-dialog .rumpf { gap: 8px; }
.such-liste { max-height: min(52vh, 460px); overflow-y: auto; margin-top: 8px; }
.such-gruppe { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 8px 4px; }
.such-liste .wahl { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.such-liste .wahl .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.such-liste .wahl .leise { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }
.such-liste .wahl[aria-selected="true"], .such-liste .wahl:hover { background: var(--akzent-zart); }
.such-leer { padding: 14px 8px; }
.such-fuss { margin: 8px 0 0; }
@media (max-width: 700px) { .such-fuss { display: none; } dialog.such-dialog { margin-top: 12px; } }

/* UX-055: Dichte „Kompakt“ für Tabellen (Wahl im Konto-Menü, data-dichte am <html>) */
:root[data-dichte="kompakt"] table.liste td { padding-top: 4px; padding-bottom: 4px; }
:root[data-dichte="kompakt"] table.liste th { padding-top: 6px; padding-bottom: 6px; }
:root[data-dichte="kompakt"] table.liste { font-size: 13px; }
:root[data-dichte="kompakt"] table.positionen td { height: 30px; }
:root[data-dichte="kompakt"] .kennzahl { padding-top: 8px; padding-bottom: 8px; }
.menue .wahlzeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 13px; color: var(--text-2); }
.menue .wahlzeile .umschalter .knopf { min-height: 32px; padding: 3px 9px; font-size: 12.5px; }
.menue .wahlzeile .umschalter .knopf { display: inline-flex; width: auto; text-align: center; border: 1px solid var(--linie-2); background: var(--flaeche); color: var(--text); font-weight: 600; white-space: nowrap; }
.menue .wahlzeile .umschalter .knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }

/* UX-056: gespeicherte Filter */
.filter-merker > summary.knopf { display: inline-flex; }
.filter-merker > summary svg:last-child { width: 14px; height: 14px; }
.filter-merker .menue { right: auto; left: 0; min-width: 260px; max-width: min(340px, 90vw); }
.filter-merker .menue .info { border-bottom: 0; margin-bottom: 0; }
.filter-eintrag { display: flex; align-items: center; gap: 2px; }
.filter-eintrag .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.filter-eintrag .weg { flex: none; color: var(--text-3); }
@media (max-width: 700px) { .filter-merker .menue { left: auto; right: 0; } }

/* UX-057: Mehrfachauswahl mit Aktionsleiste */
.wahlspalte { width: 34px; padding-right: 0 !important; }
.wahlspalte input { width: 17px; height: 17px; margin: 0; vertical-align: middle; cursor: pointer; }
table.liste tr.gewaehlt > td { background: color-mix(in srgb, var(--akzent) 9%, transparent); }
.auswahl-leiste[hidden] { display: none; }
.auswahl-leiste { border-color: var(--akzent); }
.regie-eintrag.fehler { border-color: var(--rot); }
.regie-eintrag.fehler .regie-fehlt { color: var(--rot); }

/* ---------- N1 / KP-07: Prüfansicht am Handy – je Position eine Karte, Zeitfeld und Haken ohne Wischen, Kopf und Filter brechen um ---------- */
@media (max-width: 700px) {
  table.positionen { display: block; min-width: 0; width: 100%; font-size: 14px; }
  table.positionen colgroup, table.positionen thead { display: none; }
  table.positionen tbody, table.positionen tr.titelzeile, table.positionen tr.textzeile, table.positionen tr.detailzeile { display: block; }
  table.positionen tr.titelzeile th, table.positionen tr.textzeile td, table.positionen tr.detailzeile td { display: block; width: auto; box-sizing: border-box; }
  table.positionen tr.textzeile td:first-child { display: none; }
  table.positionen tr.textzeile td { height: auto; white-space: normal; padding: 6px 12px; }
  table.positionen tbody.zu tr.pos { display: none; }
  table.positionen tr.pos {
    display: grid; grid-template-columns: minmax(64px, auto) auto auto minmax(0, 1fr) auto; grid-template-areas: "oz kurz kurz kurz kurz" "menge zeit std ampel ok";
    align-items: center; gap: 2px 10px; padding: 8px 12px; border-bottom: 1px solid var(--linie);
  }
  table.positionen tr.pos[hidden] { display: none; }
  table.positionen tr.pos td { display: block; height: auto; padding: 0; border: 0; overflow: visible; background: none !important; box-shadow: none !important; }
  table.positionen tr.pos td.oz { grid-area: oz; font-size: 12.5px; }
  table.positionen tr.pos td.kurztext { grid-area: kurz; min-width: 0; }
  table.positionen tr.pos td.menge { grid-area: menge; text-align: left; color: var(--text-2); white-space: nowrap; }
  table.positionen tr.pos td.zeit { grid-area: zeit; }
  table.positionen tr.pos td:nth-child(5) { grid-area: std; text-align: left; white-space: nowrap; }
  table.positionen tr.pos td:nth-child(5):not(:empty)::after { content: ' h'; color: var(--text-3); }
  table.positionen tr.pos td:nth-child(6) { grid-area: ampel; min-width: 0; overflow: hidden !important; white-space: nowrap; text-overflow: ellipsis; }
  table.positionen tr.pos td:nth-child(6) .ampel { max-width: 100%; }
  table.positionen tr.pos td.herkunft { display: none; }
  table.positionen tr.pos td.ok { grid-area: ok; }
  table.positionen tr.pos td.ok input { width: 26px; height: 26px; margin: 7px 2px; }
  table.positionen tr.pos .kurzknopf { height: auto; min-height: 30px; font-weight: 600; }
  table.positionen tr.pos .kurzknopf .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  table.positionen tr.pos .zeitfeld { width: 84px; height: 40px; font-size: 16px; box-sizing: border-box; }
  table.positionen tr.pos.cursor { background: var(--akzent-zart); }
  table.positionen tr.pos.wichtig { box-shadow: inset 4px 0 0 var(--akzent-kraeftig); }
  table.positionen tr.pos:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
  .zeitfehler { right: auto; left: 0; }
  /* Kopf: Aktionen brechen um, Kennzahlen als 2×2-Raster */
  .projektkopf .aktionen { flex-wrap: wrap; overflow: visible; gap: 6px; }
  .projektkopf .aktionen > * { flex: 0 1 auto; }
  .projektkopf .summen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; overflow: visible; }
  .projektkopf .summen > * { min-width: 0; }
  .projektkopf .summe.verteilung { min-width: 0; }
  .projektkopf .summe:nth-child(4) { display: flex; }
  .projektkopf.schmal .summen { display: flex; overflow: hidden; gap: 6px 16px; }
  .projektkopf.schmal .summe:nth-child(4), .projektkopf.schmal .summe.verteilung { display: none; }
  .projektkopf.schmal .summe .titel { white-space: nowrap; }
  .projektkopf.schmal .summe .wert { white-space: nowrap; }
  /* Filterzeile: Suche über die ganze Breite, Aktionen brechen um */
  .filterleiste { gap: 8px; }
  .filterleiste .suchfeld { flex: 1 1 100%; }
  .filterleiste .suchfeld input { width: 100%; box-sizing: border-box; }
  .filterleiste .rechts { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
  .filterleiste .rechts .knopf { white-space: normal; text-align: left; flex: 0 1 auto; min-width: 0; }
}
.start-ziele { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
.start-ziele li + li { border-top: 1px solid var(--linie); }
.start-ziele a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: inherit; text-decoration: none; min-height: 44px; }
.start-ziele a:hover { background: var(--flaeche-2); }
.start-ziele .name { font-weight: 600; }

/* N2: Benutzerverwaltung – Menü „⋯“ je Zeile */
.tabellen-rollen:has(td.aktionen-zelle .aufklapp[open]), [role="tabpanel"]:has(td.aktionen-zelle .aufklapp[open]) { overflow: visible; }
table.liste td.aktionen-zelle .aufklapp { display: inline-block; margin-left: 4px; text-align: left; vertical-align: middle; }
table.liste td.aktionen-zelle .aufklapp > summary.knopf { display: inline-flex; margin-left: 0; }
table.liste td.aktionen-zelle .menue { white-space: normal; }

/* N4: Meldungen stehen über einer festen Aktionsleiste, nicht auf ihren Knöpfen */
body:has(.re-fuss:not([hidden])) .meldungen { bottom: 92px; }
@media (max-width: 700px) { body:has(.re-fuss:not([hidden])) .meldungen { bottom: 190px; } }

/* N9: Kleinigkeiten – Beschriftungen einer Reihe auf gleicher Höhe, Dialog „Vorschläge“ springt nicht mehr */
.reihe.oben { align-items: flex-start; }
dialog.dialog.oben { margin-top: 8vh; }

/* ---------- Kontext-Hilfe: ⓘ neben Fachbegriffen (UX-059) ---------- */
.mit-info { display: inline-flex; align-items: center; gap: 5px; }
.info-knopf { position: relative; display: inline-block; text-transform: none; letter-spacing: 0; font-weight: 400; }
.info-knopf > summary {
  list-style: none; cursor: pointer; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
  border: 1px solid var(--text-3); color: var(--text-3); font: italic 600 11px/14px Georgia, serif; text-align: center; user-select: none;
}
.info-knopf > summary::-webkit-details-marker { display: none; }
.info-knopf > summary:hover, .info-knopf[open] > summary { border-color: var(--akzent); color: var(--akzent); }
.info-knopf > summary::after { content: ''; position: absolute; inset: -8px; }   /* größere Trefferfläche */
.info-blase {
  position: fixed; z-index: 60; width: 280px;
  padding: 10px 12px; background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: var(--rund);
  box-shadow: var(--schatten); font-size: 13px; line-height: 1.45; text-align: left; white-space: normal;
}
.info-blase b { display: block; margin-bottom: 3px; }
.info-blase p { margin: 0 0 6px; }
.info-blase a { font-size: 12.5px; }
@media print { .info-knopf { display: none; } }

/* ---------- Start-Checkliste für neue Mandanten (UX-060) ---------- */
.einstieg-platz:empty { display: none; }
.einstieg { padding: 16px 18px; margin-bottom: 18px; }
.einstieg-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.einstieg-kopf h2 { font-size: 16px; margin: 0 0 2px; }
.einstieg-kopf p { margin: 0; }
.einstieg ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 18px; }
.einstieg li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; }
.einstieg-haken { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--linie-2); font-size: 12px; line-height: 18px; text-align: center; box-sizing: border-box; }
.einstieg li.erledigt .einstieg-haken { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.einstieg li.erledigt .name { color: var(--text-3); text-decoration: line-through; }
.einstieg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.einstieg-text .name { font-weight: 600; }
a.einstieg-text:hover .name { color: var(--akzent); }
.einstieg-pfeil { color: var(--text-3); font-size: 18px; }

/* ---------- Unterschrift im Vollbild (UX-062) ---------- */
.druckbuchstaben { text-transform: uppercase; letter-spacing: .04em; }
.druckbuchstaben::placeholder { letter-spacing: 0; }
.unterschrift-rahmen { position: relative; flex: 1 1 auto; min-height: 160px; display: flex; }
.unterschrift-rahmen canvas.unterschrift-flaeche { flex: 1; height: auto; min-height: 160px; }
.unterschrift-rahmen::after { content: '✕'; position: absolute; left: 14px; right: 14px; bottom: 22%; border-bottom: 1px solid #b9bfc8; color: #8a929e; font-size: 13px; line-height: 1.6; pointer-events: none; }
.unterschrift-drehtipp { display: none; margin: 0; }
.unterschrift-dialog .unterschrift-anlass { margin: 0; }
@media (max-width: 900px), (max-height: 600px) {
  dialog.dialog.unterschrift-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .unterschrift-dialog .dialog-rumpf { flex: 1; min-height: 0; gap: 8px; padding: 8px 14px 10px; }
  .unterschrift-dialog .dialog-kopf { padding: 10px 14px 0; }
  .unterschrift-dialog .dialog-fuss { border-radius: 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
  .unterschrift-dialog .dialog-fuss .knopf { min-height: 44px; flex: 1; }
}
@media (max-width: 900px) and (orientation: portrait) { .unterschrift-drehtipp { display: block; } }
@media (max-height: 500px) and (orientation: landscape) {                /* quer am Handy: die Fläche bekommt fast alles */
  .unterschrift-dialog .dialog-kopf, .unterschrift-dialog .unterschrift-anlass { display: none; }
  .unterschrift-dialog .dialog-rumpf { display: grid; grid-template-columns: 1fr 220px; grid-template-rows: 1fr auto; column-gap: 12px; }
  .unterschrift-dialog .unterschrift-rahmen { grid-row: 1 / span 2; min-height: 0; }
  .unterschrift-dialog .unterschrift-rahmen canvas.unterschrift-flaeche { min-height: 0; }
  .unterschrift-dialog .formfehler { grid-column: 2; margin: 0; }
}

/* ---------- Einkauf: Beleg fotografieren, QR-Code der Eingangsadresse (UX-061) ---------- */
.nur-handy { display: none; }
@media (max-width: 900px), (pointer: coarse) { .knopf.nur-handy { display: inline-flex; } }
.adress-qr { margin: 10px 0; }
.adress-qr > summary { cursor: pointer; color: var(--akzent); }
.adress-qr .qr img { width: 200px; height: 200px; display: block; background: #fff; border-radius: 6px; }
.foto-hinweis p { margin: 0 0 10px; }

/* ---------- Benachrichtigungs-Center: Glocke in der Kopfleiste (UX-052) ---------- */
.glocke { position: relative; flex: none; }
.glocke > summary { list-style: none; cursor: pointer; position: relative; }
.glocke > summary::-webkit-details-marker { display: none; }
.glocke > summary svg { width: 18px; height: 18px; }
.glocke .glocke-zahl { position: absolute; top: 0; right: -2px; margin: 0; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.glocke .menue { width: 340px; max-width: calc(100vw - 16px); padding: 0; }
.glocke-kopf { padding: 10px 14px; border-bottom: 1px solid var(--linie); font-size: 13.5px; }
.glocke-liste { max-height: min(60vh, 440px); overflow: auto; padding: 4px; }
.menue a.glocke-eintrag { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; white-space: normal; }
.glocke-eintrag.neu { background: color-mix(in srgb, var(--akzent) 8%, transparent); }
.glocke-symbol { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--flaeche-2); display: grid; place-items: center; }
.glocke-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; font-size: 13px; }
.glocke-text > span { overflow: hidden; text-overflow: ellipsis; }
.glocke-leer { padding: 16px 12px; margin: 0; text-align: center; }
@media (max-width: 700px) {
  .kopfleiste .glocke { margin-left: auto; }
  .kopfleiste .glocke + .hilfe-menue { margin-left: 0; }
  .glocke .menue { position: fixed; top: 52px; left: 8px; right: 8px; width: auto; }
}

/* ---------- Startseite der Monteure: große Kacheln und Sync-Status (UX-053) ---------- */
.mkacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mkachel { display: flex; flex-direction: column; gap: 6px; min-height: 124px; padding: 16px; border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche);
  color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(20, 30, 45, .05); }
.mkachel:active { transform: scale(.985); }
.mkachel.haupt { grid-column: 1 / -1; background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); min-height: 110px; }
.mkachel-symbol { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--flaeche-2); }
.mkachel.haupt .mkachel-symbol { background: rgba(255, 255, 255, .18); }
.mkachel-symbol svg { width: 22px; height: 22px; }
.mkachel-titel { font-size: 17px; font-weight: 700; line-height: 1.25; }
.mkachel-text { font-size: 13px; color: var(--text-3); }
.mkachel.haupt .mkachel-text { color: inherit; opacity: .85; }
.sync-stand { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.sync-kopf { display: flex; gap: 12px; align-items: flex-start; }
.sync-punkt { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--gruen); }
.sync-kopf.wartet .sync-punkt { background: var(--gelb-punkt); }
.sync-kopf.offline .sync-punkt { background: var(--text-3); }
.sync-liste { list-style: none; margin: 0; padding: 0; }
.sync-liste li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--linie); }
.mkachel:last-child:nth-child(even) { grid-column: 1 / -1; min-height: 96px; }

/* ---------- Spaltenauswahl je Liste (UX-056): nur in der Tabellenansicht, Karten am Handy bleiben vollständig ---------- */
@media (min-width: 701px) { table.liste .spalte-aus { display: none; } }
@media (max-width: 700px) { .spalten-wahl { display: none; } }
.spalten-wahl .menue .spalten-eintrag { padding: 7px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap; }
@media print { table.liste .spalte-aus { display: none; } }
[role="tabpanel"]:has(.spalten-wahl[open]) { overflow: visible; }

/* ---------- Materialpreise im LV (preise.js) ---------- */
.preise .preisprofil .reihe { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.preise .eingabe.kurz { width: 90px; }
.preise .kennzahlen { margin: 12px 0; }
.gh-angebote { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.gh-angebot { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); }
.preise .filterleiste { padding: 9px 0; background: none; border: 0; }
.preise-rahmen { max-height: calc(100vh - 220px); border: 1px solid var(--linie); border-radius: var(--rund); }
table.preistabelle { table-layout: auto; }
table.preistabelle td.kurztext { max-width: 380px; }
table.preistabelle td.oz { width: 92px; }
table.preistabelle .zeitfeld.ek { width: 92px; text-align: right; }
table.preistabelle tr.titelzeile th { text-align: left; }
table.preistabelle .preiswahl { font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 6px; border: 1px solid transparent; }
table.preistabelle .guenstig { font-weight: 700; }
table.preistabelle .gewaehlt { border-color: var(--akzent); background: var(--akzent-zart); }
table.preistabelle .warnzeichen { color: var(--gelb); }
.preise .preisprofil .reihe > * { flex: none; }

/* ---------- Regie: „Abrechnung klären“ und Belegkette ---------- */
.klaerliste { display: block; margin-bottom: 12px; }
.klaerliste > summary { cursor: pointer; }
.klaerliste[open] > summary { margin-bottom: 10px; }
.klaerliste table.liste { background: var(--flaeche); border-radius: 8px; }
.klaerliste > p { margin: 8px 0 0; }
.re-herkunft { margin: 0 0 12px; }

/* Aufmaß (Reiter auf der Projektseite) */
.aufmass-kopf { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.aufmass-kopf .eingabe { width: auto; max-width: 100%; }
.aufmass-kopf input[type="text"] { flex: 1 1 180px; min-width: 140px; }
.aufmass-summen { margin: 10px 0; }
table.aufmass tr.aufmass-gruppe th { text-align: left; background: var(--flaeche-2, rgba(127, 127, 127, 0.08)); font-weight: 650; }
table.aufmass .eingabe.kurz { width: 86px; text-align: right; }
table.aufmass .eingabe.fehler { border-color: var(--rot); }
table.re-positionen tbody.nur-lesen .re-knoepfe > * { display: none; }
