/* EQOS Edikte – ruhiges, dichtes Arbeitslayout. Farben als Tokens, Hell/Dunkel nach Systemeinstellung. */
:root {
  --bg: #f5f6f8;
  --flaeche: #ffffff;
  --flaeche-2: #f0f2f5;
  --text: #1c2430;
  --text-2: #5b6573;
  --rand: #e1e5ea;
  --akzent: #1d4ed8;
  --akzent-hell: #e8eefc;
  --gut: #15803d;
  --gut-hell: #e6f4ea;
  --warn: #a15c07;
  --warn-hell: #fdf3e1;
  --schlecht: #b42318;
  --schlecht-hell: #fdeceb;
  --kopf: #14213d;
  --kopf-text: #e9edf5;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --flaeche: #171e27;
    --flaeche-2: #1e2732;
    --text: #e6eaf0;
    --text-2: #9aa6b5;
    --rand: #2a3442;
    --akzent: #7aa2ff;
    --akzent-hell: #1c2a4a;
    --gut: #4ade80;
    --gut-hell: #12301f;
    --warn: #fbbf24;
    --warn-hell: #3a2c0c;
    --schlecht: #f87171;
    --schlecht-hell: #3b1616;
    --kopf: #0b1018;
    --kopf-text: #e6eaf0;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
small, .klein { font-size: .85em; }
.gedaempft { color: var(--text-2); }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rechts { text-align: right; }

/* Kopfleiste */
.kopf { background: var(--kopf); color: var(--kopf-text); position: sticky; top: 0; z-index: 1000; }
.kopf-innen { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; padding: 0 16px; min-height: 52px; }
.marke { font-weight: 700; letter-spacing: .02em; color: var(--kopf-text); white-space: nowrap; }
.marke span { opacity: .6; font-weight: 500; }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--kopf-text); opacity: .78; padding: .45rem .7rem; border-radius: 8px; white-space: nowrap; }
.nav a:hover { opacity: 1; text-decoration: none; background: rgba(255, 255, 255, .08); }
.nav a.aktiv { opacity: 1; background: rgba(255, 255, 255, .14); }
.zaehler { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .3em; border-radius: 999px; background: #f59e0b; color: #1c1200; font-size: .75rem; font-weight: 700; text-align: center; }
.benutzer { display: flex; gap: .75rem; align-items: center; white-space: nowrap; font-size: .9rem; }
.benutzer a, .benutzer button { color: var(--kopf-text); opacity: .8; }
.benutzer form { margin: 0; }
.benutzer button { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }

.seite { max-width: 1320px; margin: 0 auto; padding: 20px 16px 48px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }

/* Karten, Kennzahlen */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; min-width: 0; }
.raster { display: grid; gap: 16px; }
.raster-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.raster-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); margin-bottom: 16px; }
.kpi { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schatten); }
.kpi .wert { font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .titel { color: var(--text-2); font-size: .85rem; }
.kpi .unter { color: var(--text-2); font-size: .8rem; margin-top: .25rem; }
a.kpi:hover { text-decoration: none; border-color: var(--akzent); }

/* Hinweise, Meldungen */
.hinweis { border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; background: var(--akzent-hell); border: 1px solid transparent; }
.hinweis.warn { background: var(--warn-hell); color: var(--text); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.hinweis.gut { background: var(--gut-hell); }
.hinweis.schlecht { background: var(--schlecht-hell); }
.meldungen { list-style: none; padding: 0; margin: 0 0 12px; }

/* Abzeichen */
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .1em .55em; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--flaeche-2); color: var(--text-2); white-space: nowrap; }
.badge.gut { background: var(--gut-hell); color: var(--gut); }
.badge.warn { background: var(--warn-hell); color: var(--warn); }
.badge.schlecht { background: var(--schlecht-hell); color: var(--schlecht); }
.badge.akzent { background: var(--akzent-hell); color: var(--akzent); }
.punkt { width: .65em; height: .65em; border-radius: 50%; display: inline-block; flex: none; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); box-shadow: var(--schatten); }
table.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: top; }
.tabelle .rechts { text-align: right; }   /* sonst überschreibt die Zeile darüber .rechts (Zahlen standen linksbündig) */
.tabelle th.umbruch { white-space: normal; }
.tabelle th { position: sticky; top: 0; background: var(--flaeche-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tabelle tbody tr:hover { background: var(--flaeche-2); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle td.foto { width: 84px; padding: 6px; }
.foto img, .foto .leer { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; display: block; background: var(--flaeche-2); }
.foto .leer { display: grid; place-items: center; color: var(--text-2); font-size: .7rem; }
.adresse { font-weight: 600; }
.liste-kompakt { list-style: none; margin: 0; padding: 0; }
.liste-kompakt li { padding: 8px 0; border-bottom: 1px solid var(--rand); display: flex; gap: .75rem; align-items: baseline; }
.liste-kompakt li:last-child { border-bottom: 0; }
.liste-kompakt .wann { flex: none; width: 8.5em; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: .88rem; }

/* Filter */
.filterbox { margin-bottom: 12px; }
.filterbox > summary { list-style: none; padding: 10px 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); color: var(--text); }
.filterbox > summary::-webkit-details-marker { display: none; }
.filterbox > summary::before { content: "▸ "; color: var(--akzent); }
.filterbox[open] > summary::before { content: "▾ "; }
.filterbox[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.filterbox[open] > .filter { border-top-left-radius: 0; border-top-right-radius: 0; }
.filter { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); align-items: end; margin-bottom: 12px; }
.filter label { display: block; font-size: .78rem; color: var(--text-2); margin-bottom: 2px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; padding: .45rem .6rem; width: 100%; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--akzent) 45%, transparent); border-color: var(--akzent); }
input[type=checkbox], input[type=radio] { width: auto; }
.knopf, button { font: inherit; cursor: pointer; border-radius: 8px; padding: .45rem .9rem; border: 1px solid var(--akzent); background: var(--akzent); color: #fff; font-weight: 600; white-space: nowrap; }
.knopf.zweit, button.zweit { background: var(--flaeche); color: var(--akzent); }
.knopf:hover { text-decoration: none; filter: brightness(1.05); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.umschalter { display: inline-flex; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; }
.umschalter a { padding: .4rem .8rem; color: var(--text-2); }
.umschalter a.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.umschalter a:hover { text-decoration: none; }

/* Karte */
.karte-gross { height: min(72vh, 760px); border-radius: var(--radius); border: 1px solid var(--rand); }
.karte-klein { height: 340px; border-radius: 8px; border: 1px solid var(--rand); }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--text-2); margin: 8px 0 0; }
.legende span { display: inline-flex; align-items: center; gap: .35em; }
.leaflet-popup-content { font: 14px/1.4 system-ui, sans-serif; }

/* Detailseite */
.eckdaten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.eckdaten div { background: var(--flaeche-2); border-radius: 8px; padding: 10px 12px; }
.eckdaten .titel { font-size: .78rem; color: var(--text-2); }
.eckdaten .wert { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
dl.felder { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
dl.felder dt { color: var(--text-2); }
dl.felder dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.galerie { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.galerie a { display: block; border-radius: 8px; overflow: hidden; background: var(--flaeche-2); aspect-ratio: 4 / 3; }
.galerie img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zeitleiste { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--rand); }
.zeitleiste li { position: relative; padding: 0 0 12px 10px; }
.zeitleiste li::before { content: ""; position: absolute; left: -21px; top: .45em; width: 10px; height: 10px; border-radius: 50%; background: var(--flaeche); border: 2px solid var(--akzent); }
.zeitleiste .wann { color: var(--text-2); font-size: .82rem; }
.alt { text-decoration: line-through; color: var(--text-2); }
.platzhalter { border: 1px dashed var(--rand); border-radius: 8px; padding: 12px; color: var(--text-2); background: transparent; }
details > summary { cursor: pointer; color: var(--akzent); }
.abstand { margin-top: 16px; }

/* KI-Score, Teilnoten, Merken */
.score { display: inline-block; min-width: 2.6em; text-align: center; padding: .1em .45em; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score.hoch { background: var(--gut-hell); color: var(--gut); }
.score.mittel { background: var(--warn-hell); color: var(--warn); }
.score.niedrig { background: var(--flaeche-2); color: var(--text-2); }
.score.gross { font-size: 1.8rem; padding: .15em .5em; }
.noten { display: grid; gap: 10px; }
.note-zeile { display: grid; grid-template-columns: minmax(130px, 34%) 1fr 2.2em; gap: 10px; align-items: center; }
.note-balken { height: 8px; border-radius: 4px; background: var(--flaeche-2); overflow: hidden; }
.note-balken span { display: block; height: 100%; background: var(--akzent); border-radius: 4px; }
.note-text { grid-column: 1 / -1; font-size: .85rem; color: var(--text-2); margin-top: -4px; }
.stern { background: none; border: 0; padding: 0 .2em; font-size: 1.25rem; line-height: 1; color: var(--text-2); cursor: pointer; }
.stern.an { color: #f59e0b; }
.inline { display: inline; margin: 0; }
.liste-punkte { margin: 0; padding-left: 1.1em; }
.liste-punkte li { margin: 0 0 6px; }
.schwere-hoch { color: var(--schlecht); font-weight: 600; }
.notenwahl { display: flex; flex-wrap: wrap; gap: 4px; }
.notenwahl label { display: inline-flex; }
.notenwahl input { position: absolute; opacity: 0; width: 1px; }
.notenwahl span { display: inline-block; min-width: 2.2em; text-align: center; padding: .3em .4em; border: 1px solid var(--rand); border-radius: 8px; cursor: pointer; }
.notenwahl input:checked + span { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.notenwahl input:focus-visible + span { outline: 2px solid var(--akzent); }
table.kompakt td, table.kompakt th { padding: 5px 8px; }

/* Anmeldung (django-allauth) */
.eingang { max-width: 440px; margin: 6vh auto; }
.konto form p, .konto form div { margin: 0 0 12px; }
.konto label { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: 3px; }
.konto ul.errorlist { color: var(--schlecht); padding-left: 1.1em; margin: 4px 0; }
.konto button, .konto [type=submit] { margin: 4px 8px 4px 0; }
.konto .helptext, .konto .help-text { display: block; font-size: .8rem; color: var(--text-2); }
.konto img { max-width: 220px; height: auto; background: #fff; padding: 8px; border-radius: 8px; }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .kopf-innen { gap: .6rem; }
  .marke span { display: none; }
  .benutzer .name { display: none; }
  dl.felder { grid-template-columns: 1fr; }
  dl.felder dt { margin-top: 6px; }
  .tabelle .weg-mobil { display: none; }
}

.tabelle tr.summe td { font-weight: 600; border-top: 1px solid var(--rand, #ccc); }

/* Objektlisten: sortierbare Überschriften, kompakte Zeilen ohne seitliches Scrollen */
.tabelle th a { color: inherit; text-decoration: none; display: inline-block; }
.tabelle th a:hover { color: var(--akzent); }
.tabelle .nowrap { white-space: nowrap; }
.tabelle.liste td.objekt { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.tabelle.liste td.objekt > div { min-width: 0; }
.mini-foto img, .mini-foto .leer { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; display: block; background: var(--flaeche-2); }
.tabelle.liste .punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
@media (max-width: 720px) { .mini-foto { display: none; } }

/* Kalender: Monats- und Wochenansicht */
.kal-navi { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.kal-navi h2 { margin: 0 8px; font-size: 1.15rem; }
.kal-legende { margin-left: auto; font-size: .78rem; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.kal-monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; background: var(--flaeche); }
.kal-kopf { padding: 6px 8px; font-size: .75rem; text-transform: uppercase; color: var(--text-2); background: var(--flaeche-2); border-bottom: 1px solid var(--rand); font-weight: 600; }
.kal-kopf.heute { color: var(--akzent); }
.kal-tag { min-height: 112px; padding: 4px; border-right: 1px solid var(--rand); border-bottom: 1px solid var(--rand); min-width: 0; }
.kal-tag:nth-child(7n) { border-right: 0; }
.kal-tag.anders { background: var(--flaeche-2); opacity: .65; }
.kal-tag.heute { box-shadow: inset 0 0 0 2px var(--akzent); }
.kal-datum { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--text); text-decoration: none; padding: 0 4px; }
.kal-termin { display: block; font-size: .74rem; line-height: 1.35; padding: 1px 5px; margin-top: 2px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.kal-termin.versteigerung, .kal-balken.versteigerung { background: var(--gut-hell); color: var(--gut); border-left: 3px solid var(--gut); }
.kal-termin.besichtigung, .kal-balken.besichtigung { background: var(--akzent-hell); color: var(--akzent); border-left: 3px solid var(--akzent); }
.kal-termin .zeit { font-weight: 600; }
.kal-score { display: inline-block; font-size: .68rem; padding: 0 4px; border-radius: 6px; background: var(--flaeche); color: var(--text); }
.kal-mehr { display: block; font-size: .72rem; margin-top: 2px; }
.kal-woche { display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; background: var(--flaeche); }
.kal-stunden div { font-size: .7rem; color: var(--text-2); text-align: right; padding-right: 6px; border-top: 1px solid var(--rand); box-sizing: border-box; }
.kal-spalte { position: relative; border-left: 1px solid var(--rand);
  background-image: repeating-linear-gradient(to bottom, var(--rand) 0, var(--rand) 1px, transparent 1px, transparent var(--stunde)); }
.kal-spalte.heute { background-color: var(--akzent-hell); }
.kal-balken { position: absolute; box-sizing: border-box; padding: 3px 5px; border-radius: 5px; font-size: .72rem; line-height: 1.25; overflow: hidden; text-decoration: none; }
@media (max-width: 720px) {
  .kal-tag { min-height: 70px; }
  .kal-termin { font-size: .64rem; padding: 0 3px; }
  .kal-termin .kal-score, .kal-legende { display: none; }
  .kal-balken { font-size: .62rem; padding: 2px; }
}
@media (max-width: 1000px) {
  .tabelle .weg-schmal { display: none; }
  .tabelle.liste th, .tabelle.liste td { padding: 7px 6px; }
}

/* Bildbetrachter (Detailseite) */
.bildbetrachter { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(10, 14, 20, .92); color: #fff; }
.bildbetrachter[open] { display: flex; align-items: center; justify-content: center; }
.bildbetrachter::backdrop { background: rgba(10, 14, 20, .6); }
.bildbetrachter figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 140px); }
.bildbetrachter img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; background: #fff; }
.bildbetrachter figcaption { margin-top: 8px; font-size: .85rem; color: #d7dde6; text-align: center; }
.bildbetrachter figcaption a { color: #9cc0ff; }
.bildbetrachter button { background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-size: 2rem; line-height: 1; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; flex: none; }
.bildbetrachter button:hover { background: rgba(255, 255, 255, .25); }
.bildbetrachter .bb-zurueck { margin-right: 14px; }
.bildbetrachter .bb-vor { margin-left: 14px; }
.bildbetrachter .bb-schliessen { position: absolute; top: 14px; right: 14px; font-size: 1.3rem; width: 42px; height: 42px; }
@media (max-width: 720px) {
  .bildbetrachter figure { max-width: 100vw; }
  .bildbetrachter .bb-zurueck, .bildbetrachter .bb-vor { position: absolute; bottom: 14px; }
  .bildbetrachter .bb-zurueck { left: 14px; margin: 0; }
  .bildbetrachter .bb-vor { right: 14px; margin: 0; }
}

/* Diagramme (Dashboard „Markt in Zahlen“). Farben nach den Diagrammregeln, geprüft gegen die Kartenflächen
   (#ffffff hell, #171e27 dunkel): Lichtband, Sättigung, Farbsehschwäche, Kontrast. */
:root { --d-akzent: #2a78d6; --d-zweit: #eb6834; --d-grau: #b4bac3; --d-gitter: #edf0f3; --d-achse: #c9ced6; }
@media (prefers-color-scheme: dark) { :root { --d-akzent: #3987e5; --d-zweit: #d95926; --d-grau: #4b5563; --d-gitter: #222b37; --d-achse: #3a4656; } }
.abschnitt { margin: 28px 0 12px; font-size: 1.15rem; }
.unterzeile { margin: -8px 0 10px; }
.diagramm { width: 100%; min-height: 40px; }
.d-svg { display: block; overflow: visible; }
.d-marke { fill: var(--d-akzent); }
.d-marke.blass { fill-opacity: .35; }
.d-marke.aktiv { filter: brightness(1.18); }
.d-punkt { fill: var(--d-grau); stroke: var(--flaeche); stroke-width: 2; }
.d-punkt.top { fill: var(--d-akzent); }
.d-punkt.gemerkt { fill: var(--d-zweit); }
.d-punkt.aktiv { stroke: var(--text); stroke-width: 1.5; }
.d-grundlinie, .d-bezug { stroke: var(--d-achse); stroke-width: 1; }
.d-gitter { stroke: var(--d-gitter); stroke-width: 1; }
.d-ziel { fill: transparent; outline: none; }
.d-ziel:focus-visible { stroke: var(--akzent); stroke-width: 2; }
.d-wert { font-size: 12px; fill: var(--text); font-variant-numeric: tabular-nums; }
.d-label { font-size: 12.5px; fill: var(--text); }
.d-achsentext { font-size: 11.5px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.d-achsentext.stark { font-weight: 600; fill: var(--text); }
.d-tipp { position: fixed; z-index: 60; pointer-events: none; background: var(--flaeche); color: var(--text); border: 1px solid var(--rand);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(16, 24, 40, .16); padding: 7px 10px; font-size: .82rem; max-width: 320px; line-height: 1.4; }
.d-tipp .wert { font-weight: 650; font-size: .9rem; }
.d-tipp .zeile { color: var(--text-2); }
.d-legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); margin-bottom: 4px; }
.d-schluessel { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--d-grau); margin-right: 6px; vertical-align: middle; }
.d-schluessel.top { background: var(--d-akzent); }
.d-schluessel.gemerkt { background: var(--d-zweit); }
details.als-tabelle { margin-top: 8px; font-size: .85rem; }
details.als-tabelle summary { cursor: pointer; color: var(--text-2); }
details.als-tabelle .tabelle { margin-top: 6px; }

/* Kontakte nach Firma gruppiert */
.tabelle.kontakte tbody.firma tr.firma-kopf th { background: var(--flaeche-2); text-align: left; font-size: .9rem; padding-top: 8px; padding-bottom: 6px; }
.tabelle.kontakte tbody.firma tr:not(.firma-kopf) td:first-child { padding-left: 22px; }

/* Getrennte Kennzahlen (Versteigerungen | Insolvenz-Verkäufe) und Diagramm-Paare */
.kpi .geteilt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.kpi .geteilt > * { display: flex; flex-direction: column; color: inherit; }
.kpi .geteilt > a:hover { text-decoration: none; }
.kpi .geteilt > a:hover .wert { color: var(--akzent); }
.kpi .geteilt .wert { font-size: 1.45rem; }
h3.unterkopf { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 10px 0 4px; }
.karte.breit { grid-column: 1 / -1; }
.paar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .paar { grid-template-columns: 1fr; } }

/* Seite „E-Mails“ */
.mail-form h2 { margin-top: 1.4rem; }
.mail-form h3 { font-size: .85rem; color: var(--text-2); margin: .8rem 0 .3rem; }
label.haekchen { display: flex; gap: .5rem; align-items: flex-start; margin: .3rem 0; cursor: pointer; }
label.haekchen input { margin-top: .25rem; flex: none; }
label.haekchen.gross { font-weight: 600; }
.haekchen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 0 12px; }
.haekchen-raster label.haekchen { margin: .15rem 0; font-size: .9rem; }
.mail-form input[type=number] { max-width: 180px; }

/* Kalibrierung: Note + Begründung je Objekt */
.kalib-form { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 6px; min-width: 230px; }
.kalib-form select { width: auto; order: 1; }
.kalib-form button { order: 2; }
.kalib-form textarea { order: 3; grid-column: 1 / -1; width: 100%; min-height: 2.6em; resize: vertical; font: inherit; font-size: .85rem; }

/* Navigation: „Mehr“-Menü (außerhalb der scrollbaren Leiste, damit es nicht abgeschnitten wird) */
details.mehr { position: relative; }
details.mehr summary { list-style: none; cursor: pointer; color: var(--kopf-text); opacity: .78; padding: .45rem .7rem; border-radius: 8px; white-space: nowrap; }
details.mehr summary::-webkit-details-marker { display: none; }
details.mehr summary:hover, details.mehr[open] summary { opacity: 1; background: rgba(255, 255, 255, .08); }
details.mehr.aktiv summary { opacity: 1; background: rgba(255, 255, 255, .14); }
.mehr-menue { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 220px; display: flex; flex-direction: column;
  background: var(--kopf); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.mehr-menue a { color: var(--kopf-text); padding: .5rem .7rem; border-radius: 6px; white-space: nowrap; }
.mehr-menue a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.mehr-menue a.aktiv { background: rgba(255, 255, 255, .14); }
/* Miete und Bestand */
.gut-text { color: var(--gut); }
.schlecht-text { color: var(--schlecht); }

.miete-tabelle td:last-child { width: 38%; }

/* Detailseite: große Kacheln Maximales Gebot / Projektvolumen / Eigenkapital */
.projekt-kacheln { margin: 0 0 12px; }
.projekt-kacheln .kpi { border-left: 4px solid var(--akzent); }

/* Öffis auf der Karte und „Öffis in der Nähe“ */
.leaflet-tooltip.oeffi-label { font-size: 10.5px; font-weight: 500; padding: 0 4px; border-radius: 3px; box-shadow: none;
  border: 1px solid rgba(201, 206, 214, .7); background: rgba(255, 255, 255, .78); color: #3c4552; }
.leaflet-tooltip.oeffi-label .oeffi-linien { font-weight: 400; color: #5b6573; }
.leaflet-control-layers { font-size: 12px; }
ul.oeffis .wann { min-width: 9.5em; }
.oeffi-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.oeffi-punkt.typ-4 { background: #fff; border: 2px solid #1c2430; width: 10px; height: 10px; }
.oeffi-punkt.typ-1 { background: #c0392b; }
.oeffi-punkt.typ-2 { background: #1f4e9c; }
.oeffi-punkt.typ-5 { background: #0a7f9e; }
.oeffi-punkt.typ-9 { background: #1d6f42; }

/* Kontakte als Kacheln auf der Detailseite */
.kontakt-kacheln .wert a { color: inherit; }
.kontakt-kacheln .klein a { word-break: break-all; }

.kal-anzahl { font-weight: 700; font-size: .85em; }

/* Aufgaben: Unteraufgaben, Löschen */
ul.unteraufgaben { list-style: none; margin: 6px 0 2px; padding: 0; }
ul.unteraufgaben li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0; }
ul.unteraufgaben form.inline { display: inline; margin: 0; }
details.unter-neu > summary { color: var(--akzent); margin: 4px 0; }
button.gefahr { background: var(--flaeche); color: var(--schlecht); border-color: var(--schlecht); }
button.link-knopf { background: none; border: 0; padding: 0 4px; color: var(--text-2); font-weight: 400; }
button.link-knopf:hover { color: var(--schlecht); }

/* Angesehen und Prüfstand (09.10.2026) */
.ungesehen { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); margin-right: 6px; vertical-align: middle; }
tr.verworfen td { opacity: .55; }
.pruefleiste { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.pruefleiste form { margin: 0; }
button.pruef-knopf { background: var(--flaeche); color: var(--text-2); border-color: var(--rand); font-weight: 500; padding: .3rem .7rem; }
button.pruef-knopf.an.pruef-in_pruefung, .badge.pruef-in_pruefung { background: var(--akzent-hell); color: var(--akzent); border-color: var(--akzent); }
button.pruef-knopf.an.pruef-interessant, .badge.pruef-interessant { background: var(--gut-hell); color: var(--gut); border-color: var(--gut); }
button.pruef-knopf.an.pruef-passt_nicht, .badge.pruef-passt_nicht { background: var(--schlecht-hell); color: var(--schlecht); border-color: var(--schlecht); }

/* Filter: Mehrfachauswahl, von–bis, Schnellfilter (12.10.2026) */
details.mehrfach { position: relative; }
details.mehrfach > summary { list-style: none; border: 1px solid var(--rand); border-radius: 8px; padding: .45rem .6rem;
  background: var(--flaeche); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.mehrfach > summary::-webkit-details-marker { display: none; }
details.mehrfach > summary::after { content: "▾"; float: right; color: var(--text-2); margin-left: 6px; }
details.mehrfach > summary .gewaehlt { font-weight: 600; color: var(--akzent); }
.mehrfach-liste { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 320px; overflow: auto;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; box-shadow: var(--schatten); padding: 6px 8px;
  display: grid; gap: 2px 10px; }
.mehrfach-liste.spalten-4 { grid-template-columns: repeat(4, minmax(3.2em, 1fr)); }
.mehrfach-liste label { display: flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--text); margin: 0; white-space: nowrap; padding: 2px 0; cursor: pointer; }
.von-bis { display: flex; gap: 4px; align-items: center; }
.von-bis > span { color: var(--text-2); }
.von-bis input { min-width: 0; }
.schnellfilter { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.schnellfilter label { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; color: var(--text); margin: 0; }
/* Listen: lange Abzeichen umbrechen statt die Tabelle zu verbreitern */
.tabelle.liste td.objekt .badge { white-space: normal; }

/* Werte aus dem Gutachten statt aus dem Edikt (12.10.2026) */
.aus-ga { display: inline-block; margin-left: 3px; padding: 0 3px; border-radius: 4px; font-size: .62rem; font-weight: 700;
  vertical-align: super; line-height: 1.3; color: var(--akzent); background: var(--akzent-hell); cursor: help; }
