/* Bautagebuch. Hell und ruhig für Sonne und Handschuhe.
   Farben: Hellgrau, Rahmen, Blaugrau als Akzent. Rot und Grün nur als Signal. */
:root {
  --bg: #f6f8fa;
  --flaeche: #ffffff;
  --rand: #e4e8ee;
  --rand-stark: #c3ccd6;
  --akzent: #4a6b87;
  --akzent-dunkel: #36516a;
  --akzent-hell: #e6edf4;
  --text: #1c2833;
  --leise: #53616f;
  --rot: #b32a1e;
  --rot-hell: #fbecea;
  --gruen: #25704a;
  --gruen-hell: #e7f3ec;
  --tipp: 52px;
  --radius: 12px;
  --nav-hoehe: 64px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --sicher-oben: env(safe-area-inset-top, 0px);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow-x: clip;
  width: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--schrift);
  font-variant-numeric: tabular-nums;
  padding-top: var(--sicher-oben);
}

::selection { background: #c7d8e8; color: var(--text); }
input, textarea { caret-color: var(--akzent); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--rand-stark) transparent; }

h1, h2, p, ol, dl, dd { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; text-wrap: balance; }
h2 { font-size: 1.1rem; line-height: 1.3; font-weight: 700; }
b { font-weight: 650; }
.klein { font-size: 0.875rem; line-height: 1.4; color: var(--leise); overflow-wrap: anywhere; }
.versteckt { display: none; }
[hidden] { display: none !important; }
.sym { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Gerüst */
.status {
  position: sticky; top: 0; z-index: 30;
  padding: 10px 16px; font-size: 0.9375rem; font-weight: 600;
  background: var(--akzent-hell); color: var(--akzent-dunkel); border-bottom: 1px solid var(--rand-stark);
}
.ansicht {
  display: block;
  max-width: 640px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-hoehe) + var(--sicher-unten) + 28px);
  outline: none;
}
.ansicht > * + * { margin-top: 16px; }
.spalte > * + * { margin-top: 12px; }
.schmal { max-width: 460px; margin: 0 auto; }
.schmal > * + * { margin-top: 16px; }
.text-spalte { max-width: 68ch; }
.text-spalte p { margin-top: 10px; }

/* Navigation: unten am Handy, links ab 900 px */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--flaeche); border-top: 1px solid var(--rand-stark);
  padding-bottom: var(--sicher-unten);
}
.nav-marke { display: none; }
.nav-punkt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-hoehe); padding: 6px 2px;
  color: var(--leise); text-decoration: none; font-size: 0.9375rem; font-weight: 650;
  border-top: 3px solid transparent; margin-top: -1px;
}
.nav-punkt.aktiv { color: var(--akzent-dunkel); border-top-color: var(--akzent); background: var(--akzent-hell); }
.nav-symbol { position: relative; display: inline-flex; }
.abzeichen {
  position: absolute; top: -6px; right: -12px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--akzent); color: #fff; font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
body.ohne-nav .nav { display: none; }
body.ohne-nav .ansicht { padding-bottom: 32px; }

/* Knöpfe und Felder: alles mindestens 52 px */
.knopf, .gross-knopf, .zeile-link, .schalter, .auswahl, .eingabe, .textfeld, .bildknopf {
  font: inherit; color: inherit;
}
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tipp); min-width: var(--tipp); padding: 12px 20px;
  border: 1.5px solid var(--akzent); border-radius: var(--radius);
  background: var(--flaeche); color: var(--akzent-dunkel);
  font-size: 1.0625rem; font-weight: 650; text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color .15s ease-out, transform .15s ease-out;
}
.knopf:active { transform: scale(0.98); background: var(--akzent-hell); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf.primaer { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.knopf.primaer:active { background: var(--akzent-dunkel); }
.knopf.text { border-color: transparent; background: transparent; justify-content: flex-start; padding-left: 4px; }
.knopf.icon { padding: 0; width: var(--tipp); flex: none; }
.knopf.gross { width: 100%; min-height: 60px; }
.knopf.gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.warn { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.knopfreihe > * { flex: 1 1 140px; }

.eingabe, .auswahl, .textfeld {
  width: 100%; min-width: 0; min-height: var(--tipp); padding: 12px 14px;
  border: 1.5px solid var(--rand-stark); border-radius: var(--radius); background: var(--flaeche);
  font-size: 1.0625rem;
}
.eingabe::placeholder, .textfeld::placeholder { color: #66737f; }
.eingabe:focus, .auswahl:focus, .textfeld:focus { border-color: var(--akzent); outline: 3px solid var(--akzent-hell); outline-offset: 0; }
.textfeld { min-height: 128px; line-height: 1.5; resize: vertical; display: block; }
.auswahl { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feldname { font-size: 0.9375rem; font-weight: 650; }
.mehr-felder { display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
input[type="date"].eingabe { appearance: none; text-align: left; }

/* Bautafel: Baustelle, Ort, Bautag */
.tafel {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px;
  background: var(--akzent); color: #fff; border-radius: 16px;
  outline: 1px solid rgba(255,255,255,.32); outline-offset: -7px;
}
.tafel h1 { font-size: 1.5rem; overflow-wrap: anywhere; }
.tafel-ort { font-size: 1rem; color: #e8eff5; overflow-wrap: anywhere; }
.tafel-tag { font-size: 0.9375rem; font-weight: 650; color: #fff; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.35); }

/* Erfassen */
.erfassen-raster { display: flex; flex-direction: column; gap: 16px; }
.aktionen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gross-knopf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 108px; padding: 12px 6px; border: 1.5px solid var(--akzent); border-radius: 16px;
  background: var(--flaeche); color: var(--akzent-dunkel); font-size: 1.0625rem; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease-out, transform .15s ease-out;
}
.gross-knopf .sym { width: 34px; height: 34px; }
.gross-knopf:first-child { background: var(--akzent); color: #fff; }
.gross-knopf:active { transform: scale(0.97); }
.gross-knopf.aktiv { background: var(--rot); border-color: var(--rot); color: #fff; }
.gross-knopf:disabled { opacity: .5; }
.speicherleiste {
  position: sticky; bottom: calc(var(--nav-hoehe) + var(--sicher-unten) + 8px); z-index: 10;
  padding: 10px 0 6px; background: linear-gradient(to top, var(--bg) 78%, rgba(246,248,250,0));
}
body.ohne-nav .speicherleiste { bottom: 8px; }
body.ohne-nav .melde { bottom: calc(var(--sicher-unten) + 96px); }
.gross-speichern { width: 100%; min-height: 60px; font-size: 1.1875rem; box-shadow: 0 6px 16px -6px rgba(54,81,106,.55); }
.gross-speichern.leer { background: #7c93a8; border-color: #7c93a8; box-shadow: none; }

.anhaenge { display: flex; flex-direction: column; gap: 8px; }
.anhaenge:empty { display: none; }
.anhang { display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.anhang-bild { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex: none; background: var(--rand); }
.anhang-info { flex: 1; min-width: 0; }
.anhang-name { font-size: 0.9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio { width: 100%; height: var(--tipp); min-width: 0; }
.anhang .audio { flex: 1; }
.sprachpanel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; background: var(--rot-hell); border: 1.5px solid var(--rot); border-radius: var(--radius); color: var(--rot); font-weight: 650; }
.sprachpanel .zeit { font-size: 1.25rem; font-weight: 700; }
.sprachpanel .knopf { flex: 1 1 100%; }
.punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--rot); animation: puls 1.2s ease-out infinite; }
@keyframes puls { 0% { opacity: 1; } 60% { opacity: .25; } 100% { opacity: 1; } }

/* Warteschlange */
.queue { padding: 14px; background: var(--flaeche); border: 1.5px solid var(--akzent); border-radius: var(--radius); }
.queue-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-kopf h2 { flex: 1 1 140px; }
.queue-kopf .sym { color: var(--akzent); }
.qzeile { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--rand); }
.qinfo { flex: 1; min-width: 0; }
.qbearbeiten { flex-basis: 100%; }
.qbearbeiten:empty { display: none; }
.qtitel { font-weight: 650; overflow-wrap: anywhere; }
.qstand { font-size: 0.9375rem; color: var(--leise); overflow-wrap: anywhere; }
.qzeile.fehler .qstand { color: var(--rot); font-weight: 600; }
.balken { height: 6px; background: var(--rand); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.balken i { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .2s ease-out; }

/* Hinweise, Leerstand, Laden */
.hinweis { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--rand-stark); }
.hinweis.netz { background: var(--akzent-hell); border-color: var(--rand-stark); flex-direction: row; align-items: flex-start; gap: 10px; color: var(--akzent-dunkel); }
.hinweis.fehler { background: var(--rot-hell); border-color: #e6b7b2; color: #7d1b13; }
.hinweis.gut { background: var(--gruen-hell); border-color: #b5d9c4; color: var(--gruen); font-weight: 650; }
.hinweis-text { overflow-wrap: anywhere; }
.laden, .leer { color: var(--leise); text-align: center; padding: 28px 12px; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border-radius: 14px; background: var(--akzent-hell); color: var(--akzent-dunkel); font-size: 0.9375rem; font-weight: 700; }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.gruen { background: var(--gruen-hell); color: var(--gruen); }

/* Listen und Karten */
.abschnitt > * + * { margin-top: 12px; }
.abschnitt > h2 { margin-top: 24px; }
.liste { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.zeile-link {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px; width: 100%;
  background: var(--flaeche); border: 0; border-bottom: 1px solid var(--rand); text-decoration: none; text-align: left; cursor: pointer;
}
.liste > .zeile-link:last-child { border-bottom: 0; }
.zeile-link:active { background: var(--akzent-hell); }
.zeile-link .sym:last-child { color: var(--leise); }
.zeile-link .sym:first-child:not(:last-child) { color: var(--akzent); }
.zl-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zl-text { overflow-wrap: anywhere; }
.treffer .zeile-link { border: 1px solid var(--rand); border-radius: var(--radius); margin-top: 8px; }
.datum-zelle { display: flex; flex-direction: column; align-items: center; min-width: 52px; line-height: 1.2; }
.datum-zelle .wt { font-size: 0.8125rem; color: var(--leise); font-weight: 650; }
.datum-zelle b { font-size: 1.0625rem; }
.suche { display: flex; gap: 8px; }
.suche .eingabe { flex: 1; }
.kurzstand { font-weight: 650; }
.seitentitel { margin-top: 4px; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tipp); color: var(--akzent-dunkel); font-weight: 650; text-decoration: none; }

.karte { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.karte.mangel { border-color: #e6b7b2; }
.karte.abnahme { border-color: #b5d9c4; }
.karte-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.karte-kopf .klein { margin-left: auto; }
.karte-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.karte.ersetzt .karte-text { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--leise); }
.richtig-hinweis { font-size: 0.9375rem; font-weight: 650; color: var(--akzent-dunkel); }
.durch { font-size: 0.9375rem; font-weight: 650; color: var(--rot); }
.herkunft { font-size: 0.9375rem; color: var(--leise); line-height: 1.45; overflow-wrap: anywhere; border-top: 1px solid var(--rand); padding-top: 8px; }
.karte.ueberfaellig { border-color: var(--rot); border-width: 2px; }
.bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.bildknopf { padding: 0; border: 0; background: var(--rand); border-radius: 10px; overflow: hidden; min-height: var(--tipp); cursor: zoom-in; }
.vorschau { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gross-deckel { position: fixed; inset: 0; z-index: 50; background: rgba(20,28,36,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
.gross-deckel img { max-width: 100%; flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; }
.zu-knopf { position: absolute; top: calc(12px + var(--sicher-oben)); right: 12px; }
.verlauf { margin: 0; padding-left: 20px; font-size: 0.9375rem; }
.verlauf li + li { margin-top: 6px; }
.auf-zu .sym { margin-left: auto; }
.auf-zu[aria-expanded="true"] .sym { transform: rotate(90deg); }
.inline-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--bg); border: 1px solid var(--rand); border-radius: var(--radius); }

.offen-tag { padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: var(--radius); }
.offen-tag + .offen-tag { margin-top: 10px; }
.offen-kopf { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.offen-tag .inline-form { margin-top: 12px; }

.wetter { padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.wetter-zeile { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wetter .zahlen { color: var(--leise); }
.wetter .frost { color: var(--rot); font-weight: 700; margin-top: 4px; }
.wetter .klein { margin-top: 4px; }

/* Mehr, Papiere, Einladung */
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tipp); padding: 10px 14px; background: var(--flaeche); border: 1.5px solid var(--rand-stark); border-radius: var(--radius); text-align: left; cursor: pointer; width: 100%; }
.schalter .sym { opacity: 0; }
.schalter[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent-hell); font-weight: 650; }
.schalter[aria-pressed="true"] .sym { opacity: 1; color: var(--akzent-dunkel); }
.link-text { font-size: 0.875rem; overflow-wrap: anywhere; padding: 10px; background: var(--bg); border-radius: 8px; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--rand); border-radius: 8px; }
.einladung-box { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; align-items: flex-start; }
.geraet-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.baum { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 4px 14px; font-size: 0.9375rem; }
.baum dt { color: var(--leise); text-transform: none; }
.baum dd { overflow-wrap: anywhere; }
.baum dd .baum { margin-top: 2px; }
.seiten { display: flex; flex-direction: column; gap: 12px; }
.seite { width: 100%; height: auto; background: #fff; border: 1px solid var(--rand-stark); border-radius: 4px; box-shadow: 0 3px 10px -4px rgba(28,40,51,.3); }
.code-box { text-align: center; padding: 20px; background: var(--flaeche); border: 1.5px solid var(--akzent); border-radius: 16px; }
.code { font-size: 2.75rem; font-weight: 700; letter-spacing: .12em; color: var(--akzent-dunkel); line-height: 1.3; }
.code-eingabe { font-size: 1.75rem; text-align: center; letter-spacing: .15em; min-height: 64px; }
.schritte { padding-left: 24px; }
.schritte li + li { margin-top: 8px; }
.version { text-align: center; padding-top: 8px; }

/* Meldung am unteren Rand, über der Speicherleiste */
.melde {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-hoehe) + var(--sicher-unten) + 96px); z-index: 60;
  max-width: 560px; margin: 0 auto; padding: 14px 18px; border-radius: var(--radius);
  background: var(--text); color: #fff; font-size: 1rem; line-height: 1.4;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(12px); pointer-events: none; cursor: pointer;
  transition: opacity .22s cubic-bezier(.16,1,.3,1), transform .22s cubic-bezier(.16,1,.3,1);
}
.melde.an { opacity: 1; transform: none; pointer-events: auto; }
.melde.fehler { background: var(--rot); }
/* Editor offen: Meldung oben unter dem Kopf, damit sie Foto und Werkzeuge nicht verdeckt */
body.mk-offen .melde { top: calc(env(safe-area-inset-top) + 56px); bottom: auto; pointer-events: none; }

/* Breit: Leiste links, zwei Spalten */
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .status { grid-column: 2; grid-row: 1; }
  .nav {
    position: sticky; top: 0; grid-column: 1; grid-row: 1 / span 2; height: 100vh; height: 100dvh; align-self: start;
    display: flex; flex-direction: column; gap: 4px; padding: 24px 12px; background: var(--akzent); border-top: 0;
  }
  .nav-marke { display: block; color: #fff; font-size: 1.25rem; font-weight: 700; padding: 0 12px 20px; }
  .nav-punkt {
    flex-direction: row; justify-content: flex-start; gap: 14px; min-height: var(--tipp); padding: 8px 14px;
    color: #eaf0f6; font-size: 1.0625rem; border-top: 0; border-radius: var(--radius); margin: 0;
  }
  .nav-punkt:hover { background: rgba(255,255,255,.1); }
  .nav-punkt.aktiv { background: rgba(255,255,255,.2); color: #fff; }
  .abzeichen { background: #fff; color: var(--akzent-dunkel); }
  .ansicht { grid-column: 2; grid-row: 2; max-width: 1100px; width: 100%; padding: 28px 32px 48px; margin: 0; }
  body.ohne-nav { display: block; }
  body.ohne-nav .ansicht { margin: 0 auto; }
  .erfassen-raster { max-width: 640px; }
  .erfassen-raster:has(> .queue:not([hidden])) { display: grid; max-width: none; grid-template-columns: minmax(0, 640px) 380px; gap: 16px 28px; align-items: start; }
  .erfassen-raster:has(> .queue:not([hidden])) > * { grid-column: 1; }
  .erfassen-raster > .queue:not([hidden]) { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: 24px; }
  .speicherleiste { bottom: 0; }
  .melde { left: 280px; bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.liste-karten { display: flex; flex-direction: column; gap: 12px; }
.beleg summary { min-height: var(--tipp); display: flex; align-items: center; cursor: pointer; font-size: 0.9375rem; font-weight: 650; color: var(--akzent-dunkel); }
.q-knoepfe { flex: none; width: 150px; }
.pruef-zeile { padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.pruef-zeile.schaden { border-color: var(--rot); background: var(--rot-hell); }
.pruef-name { font-size: 0.9375rem; color: var(--leise); }
.pruef-urteil { font-weight: 650; }
.pruef-detail { margin: 8px 0 0; padding-left: 18px; font-size: 0.875rem; overflow-wrap: anywhere; }
.zusatz { padding: 10px 12px; background: var(--bg); border: 1px dashed var(--rand-stark); border-radius: 8px; }
.zusatz-kopf { font-size: 0.8125rem; font-weight: 700; color: var(--akzent-dunkel); margin-bottom: 4px; }
.liste-zeile { display: flex; flex-direction: column; }

/* ---- Foto markieren (web/js/markieren.js, web/js/markierung.js) ---- */
body.mk-offen { overflow: hidden; }
.mk-deckel {
  position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column;
  background: #141c24; color: #fff; overscroll-behavior: contain;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mk-kopf { padding: 10px 16px 6px; }
.mk-kopf h2 { margin: 0; font-size: 1.125rem; }
.mk-kopf p { margin: 2px 0 0; font-size: 0.875rem; opacity: .8; }
.mk-flaeche { flex: 1; min-height: 0; padding: 0 20px; display: flex; align-items: center; justify-content: center; touch-action: none; }
.mk-buehne { position: relative; touch-action: none; }
.mk-buehne canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.mk-leiste { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.mk-werkzeuge { display: flex; gap: 8px; }
.mk-werkzeug {
  flex: 1; min-height: 60px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 1.0625rem; font-weight: 650; color: #fff; background: #26323e;
  border: 2px solid #3b4a58; border-radius: var(--radius); cursor: pointer;
}
.mk-werkzeug[aria-checked="true"] { border-color: #fff; background: #3b4a58; }
.mk-werkzeug:disabled { opacity: .45; cursor: default; }
.mk-zeile { margin: 0; min-height: 1.4em; font-size: 0.9375rem; text-align: center; opacity: .9; }
.mk-unten { display: flex; gap: 8px; }
.mk-unten .mk-knopf { flex: 1; min-height: 60px; }
.mk-unten .knopf.zweit { background: #26323e; color: #fff; border-color: #3b4a58; }
.mk-unten .knopf.zweit.warn { border-color: #fff; }
.mk-unten .knopf[aria-disabled="true"] { opacity: .55; }
@media (orientation: landscape) and (max-height: 500px) {
  .mk-deckel { display: grid; grid-template-columns: 1fr 260px; grid-template-rows: auto 1fr; }
  .mk-kopf { grid-column: 2; grid-row: 1; }
  .mk-flaeche { grid-column: 1; grid-row: 1 / span 2; }
  .mk-leiste { grid-column: 2; grid-row: 2; justify-content: safe flex-end; overflow-y: auto; padding-bottom: 8px; }
  .mk-leiste > * { flex-shrink: 0; }
  .mk-kopf p { display: none; }
  .mk-werkzeuge { flex-wrap: nowrap; }
  .mk-werkzeug { min-height: 52px; padding: 0 6px; font-size: 1rem; }
  .mk-unten .mk-knopf { min-height: 52px; }
  .mk-unten { flex-direction: column; }
  .mk-flaeche { padding: 0 8px; }
}
.foto-kachel { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bildknopf { position: relative; }
/* Original und Markierung: beide eingepasst (nicht beschnitten), das Etikett als Zeile unter dem Bild,
   damit es keine Bildecke mit dem Pfeil verdeckt. */
.bildknopf.mit-marke { display: flex; flex-direction: column; text-align: left; }
.bild-marke { display: block; padding: 4px 8px; background: var(--text); color: #fff; font-size: 0.8125rem; font-weight: 700; }
.vorschau.paarbild,
.vorschau.markierung, .anhang.markierung .anhang-bild { object-fit: contain; background: #f6f8fa; }
.knopf.eng { min-height: var(--tipp); padding: 8px 12px; font-size: 1rem; width: 100%; }
.anhang-info .knopf.eng { width: auto; margin-top: 6px; }
.gross-text { flex: none; width: 100%; box-sizing: border-box; border-radius: 12px; padding: 14px 16px; background: rgba(20,28,36,.92); color: #fff; display: flex; flex-direction: column; gap: 10px; }
.gross-text p { margin: 0; }

/* ---- Einladungsseite (web/js/ansichten/einladung.js) ---- */
.einl-code {
  display: block; text-align: center; padding: 20px 12px;
  background: var(--flaeche); border: 1.5px solid var(--akzent); border-radius: 16px;
}
.einl-code p { margin: 0; }
.einl-ziffern {
  margin-top: 8px !important; font-size: 3rem; font-weight: 700; letter-spacing: .14em; line-height: 1.2; color: var(--akzent-dunkel);
  user-select: all; -webkit-user-select: all;
}
.einl-ziffern span + span { margin-left: .4em; }
.einl-kopieren { width: 100%; min-height: 60px; font-size: 1.1875rem; }
.einl-schritte { list-style: none; margin: 0; padding: 0; counter-reset: schritt; display: flex; flex-direction: column; gap: 12px; }
.einl-schritte li {
  counter-increment: schritt; position: relative; min-height: 40px; padding-left: 48px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
}
.einl-schritte li::before {
  content: counter(schritt); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--akzent); color: #fff; font-weight: 700;
}
.einl-teilen {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 1.5px solid var(--rand-stark); border-radius: 8px; background: var(--flaeche); color: var(--akzent-dunkel);
}
.einl-teilen svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.einl-klein {
  display: flex; align-items: center; justify-content: center; min-height: var(--tipp); margin-top: 16px; padding: 8px 12px;
  background: none; border: 0; font: inherit; font-size: 0.9375rem; color: var(--leise); text-decoration: underline; text-align: center; cursor: pointer;
}

/* ---- Erfassen: Statuszeile, Warteschlange, Arten, Text, Bautag-Frage ---- */
.tafel-status {
  display: flex; align-items: center; gap: 10px; min-height: var(--tipp); padding: 8px 12px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius);
  color: #fff; font: inherit; font-size: 1rem; font-weight: 650; text-align: left; cursor: pointer;
}
.tafel-status:active { background: rgba(255,255,255,.28); }
.queue-liste { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.queue-liste > .knopf { width: 100%; }
.queue .hinweis { margin-top: 10px; }
.art-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.art-chip {
  min-height: var(--tipp); padding: 8px 16px; border: 1.5px solid var(--rand-stark); border-radius: 26px;
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 1rem; font-weight: 650; cursor: pointer;
}
.art-chip[aria-checked="true"] { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.art-chip[aria-expanded] { border-style: dashed; color: var(--leise); }
.art-mehr { margin-top: 8px; }
.textfeld.kompakt { min-height: var(--tipp); height: var(--tipp); resize: none; overflow: hidden; }
.link-galerie { align-self: center; justify-content: center; padding-left: 12px; padding-right: 12px; color: var(--akzent-dunkel); text-decoration: underline; }
.tagfrage { padding: 14px; background: var(--flaeche); border: 1.5px solid var(--akzent); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.tagfrage-text { font-weight: 650; }
.sprechblase {
  position: relative; align-self: flex-start; max-width: 80%; padding: 10px 14px;
  background: var(--text); color: #fff; border-radius: var(--radius); font-weight: 650; font-size: 1rem;
}
.sprechblase::after {
  content: ""; position: absolute; left: 36px; bottom: -8px; width: 16px; height: 16px;
  background: var(--text); transform: rotate(45deg); border-radius: 0 0 3px 0;
}
@media (min-width: 900px) {
  .tafel-status { display: none; }
}

/* ---- Erster Start (web/js/ansichten/willkommen.js) ---- */
.willkommen { display: flex; flex-direction: column; gap: 16px; }
.willkommen > * + * { margin-top: 0; }
.wk-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wk-punkte { display: flex; gap: 8px; }
.wk-punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--rand-stark); }
.wk-punkt.an { background: var(--akzent); }
.wk-bild { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; }
.wk-knopf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 88px;
  border: 1.5px solid var(--akzent); border-radius: 14px; color: var(--akzent-dunkel); font-weight: 700;
}
.wk-abbild { text-align: center; opacity: .6; pointer-events: none; user-select: none; -webkit-user-select: none; }
.wk-abbild .klein { margin: 0 0 6px; }
.wk-abbild .wk-bild { background: transparent; border: 0; padding: 0; gap: 8px; }
.wk-abbild .wk-knopf { min-height: 56px; border: 0; border-radius: 10px; background: var(--rand); color: var(--leise); font-weight: 600; font-size: .8125rem; }
.wk-abbild .wk-knopf svg, .wk-abbild .wk-knopf .sym { width: 20px; height: 20px; }
.wk-bild.wolke { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 88px; color: var(--akzent-dunkel); font-weight: 700; }
.wk-bild.wolke .sym { width: 34px; height: 34px; }
.wk-link { justify-content: center; padding-left: 12px; text-decoration: underline; color: var(--leise); }

/* Firmen und Mängelanzeige */
.hinweis-kasten { padding: 12px 14px; border-radius: var(--radius); background: var(--akzent-hell); border: 1px solid var(--rand-stark); color: var(--akzent-dunkel); font-size: 0.9375rem; }
.versand-box { background: var(--gruen-hell); border-color: #b5d9c4; color: var(--text); }
.versand-box .knopfreihe { margin-top: 0; }
.firma-name { font-weight: 700; overflow-wrap: anywhere; }
.karte.firma.ausgeblendet { opacity: .75; }
.zustaendig { font-weight: 650; overflow-wrap: anywhere; }
.karte .qstand { color: var(--rot); font-weight: 600; }
.chip.wartet { background: var(--bg); border: 1px solid var(--rand-stark); color: var(--leise); height: auto; white-space: normal; }
.knoepfe-spalte { display: flex; flex-direction: column; gap: 10px; }
.filterzeile { margin-bottom: 4px; }
.anzeige-text { min-height: 320px; font-size: 1rem; }
.wortlaut { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9375rem; padding: 10px; background: var(--bg); border-radius: 8px; }
.foto-wahl-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.foto-wahl { position: relative; padding: 0; border: 3px solid var(--rand-stark); border-radius: 12px; background: var(--rand); overflow: hidden; min-width: var(--tipp); min-height: var(--tipp); cursor: pointer; }
.foto-wahl[aria-pressed="true"] { border-color: var(--akzent); }
.foto-wahl .haken { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--akzent); color: #fff; display: none; align-items: center; justify-content: center; }
.foto-wahl[aria-pressed="true"] .haken { display: inline-flex; }
.foto-wahl .haken .sym { width: 18px; height: 18px; }
.foto-wahl.grau .vorschau { filter: grayscale(1); opacity: .45; }
a.knopf { text-decoration: none; }

/* ---- Gemeinsam mit dem Firmenstamm: Auswahlzeilen, Ja/Nein, Bildpaar ---- */
.wahl-liste { display: flex; flex-direction: column; gap: 8px; }
.wahl-zeile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tipp); padding: 10px 14px; background: var(--flaeche); border: 2px solid var(--rand); border-radius: var(--radius); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.wahl-zeile[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent-hell); }
.wahl-zeile .wz-haupt { flex: 1; min-width: 0; }
.wahl-zeile .wz-haupt b { display: block; overflow-wrap: anywhere; }
.wahl-zeile .wz-haupt .klein { display: block; }
.ja-nein { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ja-nein .knopf[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.bildpaar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bildpaar figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.bildpaar figcaption { font-size: 0.8125rem; color: var(--leise); line-height: 1.35; }
.bildpaar .bild-leer { min-height: 104px; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1px dashed var(--rand-stark); border-radius: 10px; font-size: 0.8125rem; color: var(--leise); text-align: center; }
.stamm-baustellen { display: flex; flex-wrap: wrap; gap: 6px; }
.gleich-hinweis { padding: 10px 12px; border: 1px dashed var(--akzent); border-radius: 8px; background: var(--bg); font-size: 0.9375rem; }
.foto-pflicht { display: flex; flex-direction: column; gap: 8px; }

/* ---- Firmen heute (Tageskopf) ---- */
.tageskopf { gap: 12px; }
.tk-kopf { display: flex; flex-direction: column; gap: 10px; }
.tk-kopf > .knopf { align-self: stretch; }
.tk-stand { font-weight: 650; overflow-wrap: anywhere; }
.tk-editor { display: flex; flex-direction: column; gap: 12px; }
.tk-titel { font-size: 1.0625rem; margin: 12px 0 0; }
.tk-zeile { display: flex; flex-direction: column; gap: 8px; }
.tk-steuer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding-left: 4px; }
.zaehler { display: flex; align-items: center; gap: 8px; }
.zaehler .knopf.icon { width: 52px; min-height: 52px; font-size: 1.5rem; line-height: 1; }
.zaehler output { min-width: 3ch; text-align: center; font-weight: 700; font-size: 1.25rem; }
.zaehler output.ohne { font-size: 0.9375rem; font-weight: 650; color: var(--leise); min-width: 7ch; }
.tk-fehlt { min-height: 52px; }
.tk-fehlt[aria-pressed="true"] { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
.vorschlag-hinweis { background: var(--akzent-hell); border-color: var(--rand-stark); color: var(--akzent-dunkel); font-size: 0.9375rem; }
.tk-geraete { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-geraete:empty { display: none; }
.tk-chip { min-height: 52px; min-width: 52px; padding: 8px 16px; border: 1.5px solid var(--rand-stark); border-radius: 26px; background: var(--flaeche); color: var(--text); font: inherit; font-size: 1rem; font-weight: 650; cursor: pointer; }
.tk-chip[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: #fff; }

/* Tagesansicht: Firmen und Abnahme */
.firmen-tag { gap: 8px; }
.tk-tag-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tk-tag-zeile { overflow-wrap: anywhere; }
.abnahme-block { padding: 10px 12px; background: var(--gruen-hell); border: 1px solid #b5d9c4; border-radius: 8px; }

/* Tagesansicht: Nachweis (zugeklappt) ohne große Lücke zum nächsten Element.
   Beide Tippflächen bleiben 52 px hoch. Ihre Schrift sitzt aber zur gemeinsamen Kante hin (Nachweis unten,
   „Richtigstellen“ oben), sonst stehen zwischen den Zeilen rund 32 px Leerraum. */
.karte > .beleg.nachweis { margin-bottom: -6px; }
.karte > .beleg.nachweis:not([open]) summary { align-items: flex-end; padding-bottom: 4px; box-sizing: border-box; }
.karte > .beleg.nachweis:not([open]) + .knopf.text { align-items: flex-start; padding-top: 4px; }
.karte > .beleg.nachweis[open] { margin-bottom: 0; }
.tk-fuer { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.frueher-stand { padding-bottom: 8px; }

/* ---- Überblick (web/js/ansichten/uebersicht.js): Laptop-Ansicht, am Handy einspaltig ---- */
.nav-punkt.nur-breit { display: none; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .nav-punkt.nur-breit { display: flex; } }
.uv-nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-ansicht="uebersicht"] { display: flex; flex-direction: column; gap: 18px; }
[data-ansicht="uebersicht"] > * + * { margin-top: 0; }
@media (min-width: 900px) {
  .ansicht[data-ansicht="uebersicht"] { max-width: 1600px; padding-top: 20px; }
}

/* Kopf: Titel mit Datum, Fortschritt, „Alles gesehen“ */
.uv-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.uv-kopf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 0 1 auto; }
.uv-kopf .seitentitel { margin-top: 0; }
.uv-unterzeile { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 1rem; }
.uv-datum { font-weight: 650; color: var(--text); }
.uv-seit { color: var(--leise); font-weight: 600; min-height: 1.5em; }
.uv-fortschritt { flex: 1 1 260px; max-width: 460px; display: flex; flex-direction: column; gap: 6px; margin-left: auto; }
.uv-fort-text { font-weight: 700; font-size: 1.0625rem; }
.uv-fortschritt.fertig .uv-fort-text { color: var(--gruen); }
.uv-kopf .knopf { min-height: 44px; padding: 8px 18px; }
.uv-hinweis:empty { display: none; }
.uv-inhalt { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.uv-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.uv-block > h2, .uv-spaltenkopf h2, .uv-spaltenkopf h3 { font-size: 1.0625rem; }
.uv-leer { padding: 16px; border: 1px dashed var(--rand-stark); border-radius: var(--radius); color: var(--leise); background: transparent; }
.uv-liste, .uv-kacheln, .uv-rang { list-style: none; margin: 0; padding: 0; }
.uv-nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Balken (Fortschritt, Qualitätswert): Spur grau, Füllung hat vorn und hinten runde Enden */
.uv-spur { display: inline-block; flex: none; width: 56px; height: 8px; border-radius: 4px; background: var(--rand); overflow: hidden; }
.uv-spur.gross { display: block; width: 100%; height: 10px; border-radius: 5px; }
.uv-fuell { display: block; height: 100%; border-radius: inherit; background: var(--akzent); }
.uv-fortschritt.fertig .uv-fuell, .uv-fuell.stufe-gut { background: var(--gruen); }
.uv-fuell.stufe-mittel { background: var(--akzent); }
.uv-fuell.stufe-schwach { background: var(--rot); }
.uv-pfeil { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.uv-trend { display: inline-flex; white-space: nowrap; align-items: center; gap: 4px; font-weight: 650; font-size: 0.8125rem; color: var(--leise); }
.uv-trend.gut { color: var(--gruen); }
.uv-trend.schlecht { color: var(--rot); }
.uv-wert-anzeige { display: inline-flex; align-items: center; gap: 8px; }
.uv-wert-zahl { min-width: 2ch; text-align: right; font-size: 1.0625rem; }
.uv-stufe { font-size: 0.8125rem; font-weight: 650; color: var(--leise); }
.uv-stufe.stufe-gut { color: var(--gruen); }
.uv-stufe.stufe-schwach { color: var(--rot); }
.uv-wenig { font-size: 0.875rem; color: var(--leise); white-space: normal; display: inline-block; line-height: 1.2; }

/* Kennzahlen */
.uv-kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uv-kachel {
  display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 76px; padding: 10px 12px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  color: inherit; text-decoration: none; transition: border-color .15s ease-out, background-color .15s ease-out;
}
.uv-kachel:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.uv-zahl { font-size: 1.75rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.uv-name { font-size: 0.875rem; line-height: 1.25; color: var(--leise); font-weight: 600; }
.uv-kachel .uv-trend { margin-top: 2px; font-weight: 600; font-size: 0.75rem; line-height: 1.3; white-space: normal; align-items: flex-start; }
.uv-kachel .uv-trend .uv-pfeil { margin-top: 2px; }
.uv-trend-text { display: flex; flex-direction: column; }
.uv-kachel.warn { border-color: var(--rot); background: var(--rot-hell); }
.uv-kachel.warn .uv-zahl { color: var(--rot); }
.uv-kachel.warn .uv-name { color: var(--text); }
.uv-kacheln > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Drei Spalten */
.uv-spalten { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.uv-spalte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 16px 10px; min-width: 0; gap: 8px; }
.uv-spaltenkopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.uv-zaehler { font-size: 0.8125rem; font-weight: 650; color: var(--leise); }
.uv-spalte > * { flex-shrink: 0; }
.uv-spalte .uv-liste { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.uv-spalte .uv-leer { border: 0; padding: 8px 0 12px; }
.uv-rechts { display: flex; flex-direction: column; gap: 16px; }
.uv-rechts > section + section { padding-top: 14px; border-top: 1px solid var(--rand); }
.uv-liste > li + li, .uv-rang > li + li { border-top: 1px solid var(--rand); }
.uv-neu, .uv-zeile, .uv-punkt { display: flex; gap: 12px; padding: 10px 6px; min-height: 44px; color: inherit; text-decoration: none; border-radius: 8px; transition: background-color .15s ease-out; }
.uv-neu:hover, .uv-zeile:hover, .uv-punkt:hover { background: var(--akzent-hell); }
.uv-zeile > .sym, .uv-punkt > .sym { align-self: center; color: var(--leise); width: 20px; height: 20px; }
.uv-zeile-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.uv-zeile-haupt b { overflow-wrap: anywhere; font-size: 0.9375rem; line-height: 1.35; }
.uv-zeile-haupt .klein { font-size: 0.8125rem; }

/* Heute abhaken */
.uv-fertig { display: flex; align-items: center; gap: 8px; margin: 2px 0; padding: 10px 12px; border-radius: 10px; background: var(--gruen-hell); color: var(--gruen); font-weight: 700; }
.uv-fertig .sym { width: 20px; height: 20px; stroke-width: 3; }
.uv-haken { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--rand-stark); background: var(--flaeche); }
.uv-haken .sym { width: 16px; height: 16px; stroke-width: 3.2; color: #fff; }
.uv-punkt.erledigt .uv-haken { background: var(--gruen); border-color: var(--gruen); }
.uv-punkt.erledigt .uv-zeile-haupt b { color: var(--leise); font-weight: 500; }
.uv-punkt .uv-zeile-haupt { align-self: center; }
.uv-punkt .uv-haken { align-self: center; margin-top: 0; }

/* Baustellen-Tabelle */
.uv-tabellenrahmen { overflow-x: auto; }
.uv-tabelle { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.uv-tabelle th, .uv-tabelle td { padding: 9px 5px; text-align: left; vertical-align: middle; border-top: 1px solid var(--rand); font-weight: 400; }
.uv-tabelle thead th { border-top: 0; padding: 0; }
.uv-tabelle thead th:not(.uv-t-name) .uv-sortknopf { padding-left: 4px; }
.uv-sortknopf { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 8px 4px 0; font: inherit; font-size: 0.75rem; font-weight: 700; color: var(--leise); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.uv-sortknopf:hover { color: var(--text); }
th[aria-sort="ascending"] .uv-sortknopf, th[aria-sort="descending"] .uv-sortknopf { color: var(--text); }
.uv-t-zahl { text-align: right !important; white-space: nowrap; width: 3rem; }
.uv-tabelle th.uv-t-zahl:nth-child(4), .uv-tabelle td.uv-t-zahl:nth-child(4) { width: 4.2rem; }
.uv-t-zahl b { display: block; font-size: 1.0625rem; line-height: 1.25; }
.uv-t-zahl .klein { display: block; font-size: 0.75rem; }
.uv-t-zahl.warn b { color: var(--rot); }
thead .uv-t-zahl .uv-sortknopf { padding: 4px 0 4px 8px; }
.uv-t-wert { white-space: nowrap; width: 4.6rem; padding-left: 10px; }
.uv-tabelle thead .uv-t-wert { padding-left: 10px; }
.uv-t-wert .uv-wert-anzeige { gap: 6px; }
.uv-t-wert .uv-spur { width: 34px; }
.uv-t-trend { white-space: nowrap; width: 3.2rem; text-align: right !important; }
.uv-tabelle tbody tr { position: relative; transition: background-color .15s ease-out; }
.uv-tabelle tbody tr:hover { background: var(--akzent-hell); }
.uv-t-name { min-width: 5.5rem; }
.uv-t-name .klein { display: block; font-size: 0.8125rem; }
.uv-t-name .chip { min-height: 22px; font-size: 0.75rem; padding: 0 8px; }
.uv-zeilenlink { color: var(--text); text-decoration: none; font-weight: 650; overflow-wrap: anywhere; }
.uv-zeilenlink::after { content: ""; position: absolute; inset: 0; }
.uv-zeilenlink:focus-visible { outline: none; }
tr:has(.uv-zeilenlink:focus-visible) { outline: 3px solid var(--akzent); outline-offset: -3px; border-radius: 8px; }
.uv-notiz { color: var(--akzent-dunkel); }
.uv-fussnote { margin-top: auto; padding-top: 10px; }
.klein-tabelle { font-size: 0.875rem; }
.klein-tabelle td b { display: block; }

/* Kompaktes Wochendiagramm unter der Tabelle (Baustellen-Spalte) */
.uv-mini { position: relative; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--rand); min-width: 0; }
.uv-mini h3 { font-size: 1rem; margin: 0; }
.uv-mini .uv-wochen { margin-top: 2px; }
.uv-mini-summe { margin: 0; }

/* Neu seit … */
.uv-uhr { flex: none; width: 52px; display: flex; flex-direction: column; line-height: 1.25; font-size: 0.9375rem; }
.uv-uhr .klein { font-size: 0.75rem; }
.uv-neu-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.uv-neu-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 0.9375rem; }
.uv-neu-kopf .klein { font-size: 0.8125rem; }
.uv-neu-text { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9375rem; line-height: 1.4; }
.uv-art { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--akzent-hell); color: var(--akzent-dunkel); font-size: 0.75rem; font-weight: 700; }
.uv-art-mangel { background: var(--rot-hell); color: var(--rot); }
.uv-art-abnahme { background: var(--gruen-hell); color: var(--gruen); }
.uv-bilder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.uv-vorschau { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--rand); display: block; }
.uv-frist-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.uv-frist { font-size: 0.8125rem; font-weight: 700; color: var(--akzent-dunkel); }
.uv-frist-titel { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uv-zeile.ueberfaellig { box-shadow: inset 3px 0 0 var(--rot); padding-left: 12px; }
.uv-zeile.ueberfaellig .uv-frist { color: var(--rot); }
.uv-spalte .knopf { min-height: 44px; width: 100%; font-size: 0.9375rem; }

/* Auswertung */
.uv-auswertung { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; padding-top: 22px; border-top: 1px solid var(--rand-stark); min-width: 0; }
.uv-auswertung-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; }
.uv-auswertung-kopf h2 { font-size: 1.25rem; }
.uv-auswertung-inhalt { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.uv-panel { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 14px 16px 6px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.uv-legende { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 0.8125rem; }
.uv-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.uv-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.uv-sw.balken { background: var(--akzent); }
.uv-sw.linie { width: 16px; height: 3px; border-radius: 2px; background: var(--text); }
.uv-vielfache { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 32px; }
.uv-figur { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 580px; }
.uv-figur figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.uv-wochen { display: block; width: 100%; height: auto; overflow: visible; }
.uv-raster { stroke: var(--rand); stroke-width: 1; }
.uv-achse { stroke: var(--rand-stark); stroke-width: 1; }
.uv-ytext, .uv-xtext { font: 600 10px var(--schrift); fill: var(--leise); }
.uv-balken { fill: var(--akzent); }
.uv-balken.laufend { opacity: .6; }
.uv-linie { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.uv-punkt-marke { fill: var(--text); stroke: var(--flaeche); stroke-width: 2; }
.uv-treffer { fill: transparent; }
.uv-treffer:hover { fill: var(--akzent-hell); opacity: .55; }
.uv-tipp { position: absolute; z-index: 5; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--text); color: #fff; font-size: 0.8125rem; white-space: nowrap; }
.uv-wie { border-top: 1px solid var(--rand); margin: 0 -2px; }
.uv-wie summary { display: flex; align-items: center; min-height: 44px; padding: 0 2px; cursor: pointer; font-weight: 650; color: var(--akzent-dunkel); }
.uv-wie-inhalt { display: flex; flex-direction: column; gap: 10px; padding: 0 2px 14px; }
.uv-formel { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: 0.9375rem; line-height: 1.4; }
.uv-ranglisten { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.uv-rang { display: flex; flex-direction: column; }
.uv-rang-zeile { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 64px; align-items: center; gap: 4px 12px; padding: 10px 0; }
.uv-platz { font-size: 1.125rem; font-weight: 700; color: var(--leise); }
.uv-rang-name { display: flex; flex-direction: column; min-width: 0; }
.uv-rang-name b { overflow-wrap: anywhere; }
.uv-rang-name .klein { font-size: 0.8125rem; }
.uv-rang-wert .uv-spur { width: 96px; }
.uv-rang-trend { justify-self: end; }

@media (min-width: 560px) {
  .uv-kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .uv-kacheln > li:last-child:nth-child(odd) { grid-column: auto; }
}
@media (min-width: 900px) {
  .uv-ranglisten { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .uv-ranglisten.einzeln { grid-template-columns: minmax(0, 760px); }
}
@media (min-width: 1180px) {
  .uv-kacheln { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  /* Zwei Spalten: Baustellen-Tabelle über die volle Breite, darunter Abhaken und Fristen; die Seite scrollt. */
  .uv-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .uv-spalten > [data-spalte-id="baustellen"] { grid-column: 1 / -1; order: -1; }
}
@media (min-width: 1260px) {
  .uv-spalten > [data-spalte-id="baustellen"] { grid-column: auto; order: 0; }
  .uv-spalten { display: grid; grid-template-columns: minmax(230px, 0.95fr) minmax(0, 2fr) minmax(250px, 1.05fr); gap: 16px; align-items: stretch; height: calc(100dvh - 266px); min-height: 440px; }
  .uv-spalte { overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 899px) {
  .uv-fortschritt { max-width: none; margin-left: 0; flex-basis: 100%; }
  .uv-tabelle-karten thead { display: none; }
  .uv-tabelle-karten tbody tr { display: block; padding: 8px 0; border-top: 1px solid var(--rand); }
  .uv-tabelle-karten tbody tr:first-child { border-top: 0; }
  .uv-tabelle-karten th, .uv-tabelle-karten td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; text-align: left; }
  .uv-tabelle-karten td::before { content: attr(data-label); color: var(--leise); font-size: 0.875rem; font-weight: 600; }
  .uv-tabelle-karten th[scope="row"] { display: block; padding-bottom: 6px; }
  .uv-tabelle-karten td b, .uv-tabelle-karten td .klein { display: inline; }
  .uv-tabelle-karten .uv-t-zahl { text-align: left !important; }
  .uv-tabelle-karten .uv-t-zahl b { display: inline; }
  .uv-tabelle-karten .uv-t-zahl .klein { display: none; }
  .uv-tabelle-karten .uv-t-wert, .uv-tabelle-karten .uv-t-trend { white-space: normal; }
  .uv-tabelle tbody tr:hover { background: transparent; }
  .uv-tabelle-karten.klein-tabelle td { flex-direction: column; align-items: flex-start; gap: 0; }
  .uv-tabelle-karten.klein-tabelle td b { display: block; }
  .uv-rang-zeile { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .uv-rang-wert { grid-column: 2; grid-row: 2; }
  .uv-rang-trend { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 899px) {
  .uv-ytext, .uv-xtext { font-size: 13px; }
}
