/* ==========================================================================
   Dashboard wie ein Homescreen: Raster mit festen Zeilen, Widgets in vier
   Größen, Bearbeiten mit Wackeln, Ecke zum Vergrößern, Galerie und Editor.
   Raster: 4 Spalten am Rechner, 2 am Handy (wie iPhone).
   S 1×1 · M 2×1 · L 2×2 · XL 4×2 (am Handy wie L)
   ========================================================================== */

/* ---------- Kopf: Dashboards wechseln, Filter, Anpassen ---------- */
.dash-werkzeuge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.dash-filter { cursor: pointer; }
.dash-filter[aria-pressed="true"] { background: var(--raised); color: var(--ink); border-color: var(--ink-3); }

/* ---------- Raster ---------- */
.dash2 { --zeile: 168px; --dgap: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: var(--zeile); gap: var(--dgap); grid-auto-flow: row dense; position: relative; }
.dash2 > .s-S { grid-column: span 1; grid-row: span 1; }
.dash2 > .s-M { grid-column: span 2; grid-row: span 1; }
.dash2 > .s-L { grid-column: span 2; grid-row: span 2; }
.dash2 > .s-XL { grid-column: span 4; grid-row: span 2; }
@media (max-width: 760px) {
  .dash2 { grid-template-columns: repeat(2, minmax(0, 1fr)); --zeile: 160px; --dgap: 12px; }
  .dash2 > .s-XL { grid-column: span 2; }
}
.dash2:not(.ruhig) { animation: dash-rein var(--dauer-3) var(--ease-out); }
.dash2.weg { opacity: 0; transform: translateY(6px); transition: opacity var(--dauer-1), transform var(--dauer-1); }
@keyframes dash-rein { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Widget-Karte ---------- */
.widget.dw { padding: 14px 16px; border-radius: var(--r-gross); overflow: hidden; display: flex; flex-direction: column; background: var(--card); box-shadow: var(--shadow); position: relative; min-width: 0; container-type: inline-size; }
.dw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dw-vorschau { pointer-events: none; }
.dw-vorschau-box { position: relative; flex: none; }
.dw-vorschau-box > .dw-vorschau { position: absolute; left: 0; top: 0; }
.dash2 > .widget.geht { opacity: 0; transform: scale(.9); transition: opacity var(--dauer-2), transform var(--dauer-2); }

/* Kopfzeile */
.wk-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-size: 12.5px; flex: none; }
.wk-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink-2); font-weight: 620; }
.wk-titel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-ic { width: 22px; height: 22px; border-radius: var(--r-klein); background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.wk-ic .ic { width: 13px; height: 13px; }
.wk-zeit { color: var(--ink-3); font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wk-link { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; text-decoration: none; white-space: nowrap; min-width: 0; border-radius: var(--r-klein); padding: 2px 2px 2px 4px; }
.wk-link span { overflow: hidden; text-overflow: ellipsis; }
.wk-link:hover { color: var(--ink); background: var(--hover); }

/* Zahl */
.wk-wert { font-family: var(--font-display); font-weight: 650; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 30px; }
.wk-wert.neg { color: var(--neg); } .wk-wert.warn { color: var(--warn); } .wk-wert.crit { color: var(--crit-text); }
.wk-wert.klein { font-size: 26px; }
.wk-von { font-size: .5em; color: var(--ink-3); font-weight: 560; letter-spacing: 0; }
.wk-fehlt { font-size: 16px; color: var(--ink-3); letter-spacing: 0; font-weight: 520; }
.s-S .wk-wert { font-size: clamp(22px, 13cqw, 30px); }
.s-M .wk-wert { font-size: clamp(26px, 7cqw, 34px); }
.s-L .wk-wert { font-size: clamp(32px, 8cqw, 42px); }
.s-XL .wk-wert { font-size: clamp(34px, 4.4cqw, 46px); }
.wk-zeile { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.wk-zeile .wk-zeit { flex: 1; }
.wk-mitte { margin-top: auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-S .wk-mitte { margin-top: auto; margin-bottom: auto; padding-top: 6px; }
.wk-mini { height: 34px; margin-top: 8px; flex: none; }
.wk-mini .spark { width: 100%; height: 100%; display: block; overflow: visible; }
.wk-mini.gross { height: auto; flex: 1; min-height: 60px; margin-top: 0; }
.wk-lang { margin: 6px 0 0; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-vgl { font-size: 12px; color: var(--ink-3); min-width: 0; }
.wk-vgl .delta { font-size: 12px; padding: 0; background: none; white-space: normal; }
.wk-achse { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.wk-2zeilen { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; margin-top: 10px; }
.wk-erkl { justify-content: center; }
.wk-erkl p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* Mittel: links Zahl, rechts Verlauf */
.wk-m { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; flex: 1; min-height: 0; }
.wk-m-links { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.wk-m-links .wk-kopf { margin-bottom: 2px; }
.wk-m-links.wk-mitte { margin-top: 0; justify-content: center; }
.wk-m-rechts { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 0; }
.wk-m-rechts.wk-liste { justify-content: flex-start; margin-top: 0; }

/* Groß und Extragroß */
.wk-zahlblock { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 2px; min-width: 0; flex: none; }
.wk-zahlblock .wk-zeile { flex-wrap: wrap; row-gap: 4px; }
.wk-chart { flex: 1; min-height: 0; margin-top: 8px; position: relative; }
.wk-xl { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 26px; flex: 1; min-height: 0; }
.wk-xl-links { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; overflow: hidden; }
.wk-xl-rechts { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wk-xl-rechts .wk-chart { margin-top: 0; }

/* Aufteilung je Immobilie oder Kategorie */
.wk-teile { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; min-width: 0; }
.wk-teile.dicht { gap: 9px; margin-top: 12px; }
.wk-teil { display: grid; grid-template-columns: minmax(64px, 1fr) minmax(40px, 1.2fr) auto; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink); text-decoration: none; min-width: 0; }
a.wk-teil:hover .wk-teil-name { color: var(--accent-text); }
.wk-teil-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.wk-teil-bar { height: 6px; border-radius: var(--r-klein); background: var(--track); overflow: hidden; }
.wk-teil-bar i { display: block; height: 100%; border-radius: var(--r-klein); background: var(--chart-farbe, var(--reihe-1)); }
.wk-teil b { font-weight: 620; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.wk-teil b.neg { color: var(--neg); }

/* Paare von Zahlen und Anteilsbalken */
.wk-paar { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 10px; flex: none; }
.wk-paar > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wk-paar .label { font-size: 11.5px; display: inline-flex; align-items: center; }
.wk-paar b { font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-paar.klein b { font-size: 17px; }
.wk-paar b.pos { color: var(--pos); } .wk-paar b.neg { color: var(--neg); } .wk-paar b.acc { color: var(--accent-text); }
.wk-punkt { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-rund); margin-right: 5px; }
.wk-anteil { height: 8px; border-radius: var(--r-klein); background: var(--neutral-bar-2); overflow: hidden; margin-top: 12px; }
.wk-anteil i { display: block; height: 100%; background: var(--pos-bar); border-radius: var(--r-klein) 0 0 var(--r-klein); }
.wk-anteil.zt { background: var(--pos-bar); }
.wk-anteil.zt i { background: var(--neg-bar); }
.wk-anteil-txt { margin-top: 6px; font-size: 12px; }
.wk-unten { margin-top: auto; }

/* Ring, Listen, Fristen, Zinsbindungen */
.wk-ringzeile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wk-ring { flex: none; }
.wk-liste { display: flex; flex-direction: column; min-height: 0; overflow: hidden; margin-top: 6px; }
.wk-liste.list .list-item { padding: 8px 2px; }
.wk-reihe { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); text-decoration: none; min-width: 0; }
.wk-reihe:last-child { border-bottom: 0; }
.wk-reihe-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wk-reihe .chip { flex: none; }
a.wk-reihe:hover .wk-reihe-name { color: var(--accent-text); }
.wk-zb { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.wk-zb:last-child { border-bottom: 0; }
.wk-zb-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.wk-zb-kopf b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-zb-kopf span { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wk-zb-bar { height: 5px; border-radius: var(--r-klein); background: var(--track); margin: 6px 0 4px; overflow: hidden; }
.wk-zb-bar i { display: block; height: 100%; background: var(--chart-farbe, var(--reihe-1)); border-radius: var(--r-klein); }
.wk-zb .label { font-size: 11.5px; }
.warn-text { color: var(--warn) !important; font-weight: 600; }
.wk-frist { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink); text-decoration: none; min-width: 0; }
.wk-frist .grow { display: flex; flex-direction: column; min-width: 0; }
.wk-frist .grow b { font-weight: 580; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-frist .label { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-datum { width: 38px; height: 40px; border-radius: var(--r-mittel); background: var(--inset); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1.05; }
.wk-datum b { font-size: 15px; font-weight: 650; }
.wk-datum span { font-size: 10px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.wk-datum.warn { background: var(--warn-soft); } .wk-datum.crit { background: var(--crit-soft); }
.wk-satz { margin: 0 0 10px; font-size: 15px; line-height: 1.45; max-width: 52ch; }

/* Cashflow groß */
.dw-body.wk-cf { display: flex; flex-direction: column; align-items: stretch; margin: 0; gap: 0; }
.wk-cf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; flex: none; }
.wk-cf-text { min-width: 0; }
.wk-cf .hero-satz { font-size: 16px; margin: 0 0 4px; }
.wk-cf .eyebrow { margin-bottom: 8px; font-size: 10.5px; }
.wk-cf .hero-num { font-size: clamp(34px, 5.4cqw, 58px); }
.wk-cf .hero-sub { margin-top: 8px; font-size: 13px; }
.wk-cf .hero-sub .delta { font-size: 13px; }
.wk-cf .hero-ctrls { margin: 0; justify-content: flex-end; max-width: 560px; }
.wk-cf .hero-chart { flex: 1; min-height: 0; margin-top: 10px; }
.s-M .wk-cf .hero-satz { font-size: 13px; }
.s-M .wk-cf .eyebrow { display: none; }
.s-M .wk-cf .hero-num { font-size: clamp(26px, 7cqw, 34px); }
.s-M .wk-cf-top { flex-wrap: nowrap; height: 100%; align-items: stretch; }
.wk-cf-mini { flex: 1; min-width: 0; display: flex; align-items: flex-end; }
.wk-cf-mini .spark { width: 100%; height: 80px; display: block; overflow: visible; }
.s-L .wk-cf .hero-num { font-size: clamp(30px, 8cqw, 44px); }
/* Handy: dieselben Steuerungen wie im Web, als wischbare Zeile statt ausgeblendet */
@media (max-width: 760px) { .wk-cf .hero-ctrls { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding-bottom: 2px; } .wk-cf .hero-ctrls::-webkit-scrollbar { display: none; } .wk-cf .hero-ctrls > * { flex: none; } .wk-cf .hero-satz { font-size: 14px; } .wk-cf .hero-sub { flex-wrap: wrap; } }

/* ---------- Bearbeiten: Wackeln, Minus, Ecke ---------- */
@keyframes dw-wackeln { from { rotate: -.4deg; } to { rotate: .4deg; } }
.dash2.ruhig.bearbeiten > .widget { animation: none; }
@media (prefers-reduced-motion: reduce) { .dash2.bearbeiten > .widget { animation: none; } .dash2:not(.ruhig) { animation: none; } }
.dash2 > .widget.groesse-aendern { box-shadow: 0 0 0 2px var(--accent), var(--shadow-pop) !important; z-index: 5; }
.dash2 > .widget.groesse-aendern .dw-body { opacity: .35; transition: opacity var(--dauer-1); }
.drag-ghost.dw { animation: none !important; rotate: 1.2deg; border-radius: var(--r-gross); box-shadow: var(--shadow-pop); }
.drag-ghost.dw .wk-kopf { padding-left: 0; }

/* Plus-Kachel */

/* Schwebende Leiste */
@media (min-width: 1024px) { .dash-leiste { left: calc(50% + var(--side-w, 0px) / 2); } }
@media (max-width: 1023.98px) { .dash-leiste { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } }

/* Leeres Dashboard */
.dash-leer { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 0; }
.dash-leer .h3 { margin: 8px 0 0; }
.dash-leer .label { max-width: 46ch; margin: 0 0 8px; }
.dash-leer-bild { display: grid; grid-template-columns: repeat(2, 26px); grid-auto-rows: 26px; gap: 6px; }
.dash-leer-bild i { border-radius: var(--r-klein); background: var(--track); }
.dash-leer-bild i.g { background: var(--inset); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.dash-fuss { margin-top: 26px; text-align: center; }

/* Vorlagen-Minis */
.tpl-mini i.k { background: var(--card); }
.tpl-mini i.leer { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); border: 0; }
.tpl-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); background: var(--sel-bg); }

/* ---------- Galerie ---------- */
.gal { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gal-suche { width: 100%; }
.gal-haupt { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 18px; min-height: 0; }
.gal-nav { display: flex; flex-direction: column; gap: 2px; }
.gal-nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--r-mittel); background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 520; cursor: pointer; text-align: left; white-space: nowrap; }
.gal-nav button:hover { background: var(--hover); color: var(--ink); }
.gal-nav button[aria-selected="true"] { background: var(--sel-bg); color: var(--ink); font-weight: 620; }
.gal-zahl { font-size: 11.5px; color: var(--ink-3); font-weight: 520; }
/* feste Höhe: das Fenster springt beim Wechsel der Gruppe nicht, auch wenn eine Gruppe nur wenige Widgets hat */
.gal-inhalt { min-width: 0; height: min(62vh, 640px); overflow-y: auto; padding: 2px; align-content: start; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; grid-auto-flow: row dense; }
.gal-karte.breit { grid-column: span 2; }
.gal-karte { display: flex; flex-direction: column; gap: 5px; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-gross); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; transition: box-shadow var(--dauer-1), border-color var(--dauer-1), transform var(--dauer-1); }
.gal-karte:hover { box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.gal-karte:active { transform: scale(.98); }
.gal-pv { display: flex; align-items: center; justify-content: center; min-height: 138px; padding: 10px; border-radius: var(--r-mittel); background: var(--inset); overflow: hidden; margin-bottom: 4px; }
.gal-name { font-weight: 620; font-size: 14px; }
.gal-desc { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gal-groessen { display: flex; gap: 4px; margin-top: 4px; }
.gal-groessen i { font-style: normal; font-size: 10.5px; font-weight: 620; color: var(--ink-3); background: var(--inset); border-radius: var(--r-klein); padding: 1px 5px; }
.gal-detail-titel .h3 { margin: 2px 0 2px; font-size: 18px; }
.gal-detail-titel .label { margin: 0; }
.gal-buehne, .ed-buehne { display: flex; align-items: center; justify-content: center; min-height: 210px; padding: 22px; border-radius: var(--r-mittel); background: var(--inset); overflow: hidden; }
.gal-extras { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.gal-fuss { justify-content: flex-end; margin-top: 2px; }
@media (max-width: 760px) {
  .gal-haupt { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gal-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
  .gal-nav::-webkit-scrollbar { display: none; }
  .gal-nav button { flex: none; background: var(--inset); border-radius: var(--r-mittel); padding: 6px 12px; }
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gal-inhalt { height: auto; min-height: 62dvh; }
  .gal-pv { min-height: 110px; padding: 6px; }
  .gal-buehne, .ed-buehne { padding: 12px; min-height: 160px; }
}

/* Größenwahl */
.gr-wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.gr-wahl button { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border: 1px solid var(--line); border-radius: var(--r-mittel); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--dauer-1), background var(--dauer-1); }
.gr-wahl button:hover { border-color: var(--line-2); }
.gr-wahl button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--sel-bg); }
.gr-wahl svg rect { fill: var(--track); }
.gr-wahl svg rect.an { fill: var(--ink-3); }
.gr-wahl button[aria-checked="true"] svg rect.an { fill: var(--accent); }
.gr-wahl button > span { display: flex; flex-direction: column; line-height: 1.2; }
.gr-wahl b { font-size: 13px; font-weight: 620; }
.gr-wahl .label { font-size: 11.5px; }

/* ---------- Widget einstellen ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.ed-links { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ed-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ed-feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ed-feld .select { width: 100%; }
.ed-feld > .chip, .ed-feld > .check { align-self: flex-start; }
.ed-feld > .chip { cursor: pointer; }
.ed-feld .seg { align-self: flex-start; max-width: 100%; overflow-x: auto; }
@media (max-width: 760px) { .ed { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

@media (max-width: 760px) {
  .dash-werkzeuge { margin-left: 0; flex-wrap: nowrap; gap: 6px; }
  .dash-werkzeuge .seg { flex: 1; min-width: 0; }
  .dash-werkzeuge .seg button { flex: 1; padding: 0 6px; }
  /* Filter-Etikett darf schrumpfen (mit „…“), sonst ragt „Anpassen“ am Handy über den Rand */
  .dash-werkzeuge { min-width: 0; max-width: 100%; }
  .dash-werkzeuge .seg { flex: none; }
  .dash-werkzeuge .dash-filter { flex: 0 1 auto; min-width: 0; }
  .dash-werkzeuge .dash-filter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-filter { min-width: 0; max-width: 42%; flex: none; }
  .dash-filter span { overflow: hidden; text-overflow: ellipsis; }
  .widget.dw { padding: 12px 13px; border-radius: var(--r-gross); }
  .wk-m { gap: 12px; }
  .wk-xl { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .wk-xl-links .wk-teile, .wk-xl-links .wk-sub { display: none; }
  .wk-paar b { font-size: 18px; }
  .wk-paar.klein b { font-size: 15px; }
}

/* Lang drücken: kein Textmarkieren und kein Systemmenü */
.dash2 > .widget, .dash2 > .widget * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Einmaliger Hinweis auf das Anpassen */
.dash-tipp { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; margin: 0 0 14px; border-radius: var(--r-gross); background: var(--card); box-shadow: var(--shadow); }
.dash-tipp-bild { display: grid; grid-template-columns: repeat(2, 14px); grid-auto-rows: 14px; gap: 3px; padding: 7px; border-radius: var(--r-mittel); background: var(--accent-soft); flex: none; }
.dash-tipp-bild i { border-radius: var(--r-mittel); background: var(--ink-3); opacity: .35; }
.dash-tipp-bild i:nth-child(2) { grid-row: span 2; opacity: .9; }
.dash-tipp-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.dash-tipp-text b { display: block; font-weight: 650; }
.dash-tipp-text span { color: var(--ink-2); }
.dash-tipp .btn { flex: none; }
@media (max-width: 760px) { .dash-tipp { flex-wrap: wrap; } .dash-tipp-text { flex-basis: calc(100% - 60px); } .dash-tipp .btn.primary { margin-left: 50px; } }

/* ---------- Dashboard-Leiste: schmal (44 px), eine Zeile, klebt unter der Kopfleiste ---------- */
.dash-kopf {
  position: sticky; top: calc(var(--kopf-unten, 84px) + 8px); z-index: 15;
  height: 44px; margin: 0 0 12px; padding: 0 6px; gap: 8px; flex-wrap: nowrap;
  background: var(--card); border-radius: var(--r-gross); box-shadow: var(--shadow);
  transition: box-shadow var(--dauer-2), background-color var(--dauer-2);
}
@media (prefers-reduced-transparency: reduce) { .dash-kopf.klebt { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.dash-zr-menue { display: none; }
.dash-filter-punkt { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: var(--r-rund); background: var(--accent); display: none; }
.linkbtn { border: 0; padding: 0; background: none; color: var(--blue-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* Handy: links Wechsler, rechts nur Symbole (Filter mit Punkt, Zeitraum als Menü, Anpassen) */
@media (max-width: 760px) {
}

/* ---------- Kennzahlen-Verlauf (js/verlauf.js): Widget „verlauf“ und Vergleich in Analysen ---------- */
.wk-verlauf { gap: 8px; }
.wk-m.ohne-grafik { grid-template-columns: minmax(0, 1fr); }
.vl { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.vl-vergleich { min-height: 380px; }
.vl-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.vl-wahl { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; cursor: pointer; }
.vl-vergleichen { margin-left: auto; }
.vl-legende { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-height: 22px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vl-datum { font-weight: 600; color: var(--ink); }
.vl-eintrag { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.vl-eintrag b { color: var(--ink); font-weight: 600; }
.vl-eintrag em { font-style: normal; color: var(--ink-3); font-size: 11.5px; }
.vl-farbe { width: 14px; height: 3px; border-radius: var(--r-rund); background: var(--f); flex: none; }
.vl-farbe.gestrichelt { background: repeating-linear-gradient(90deg, var(--f) 0 4px, transparent 4px 7px); }
.vl-farbe.balken { width: 8px; height: 10px; border-radius: calc(var(--r-klein) / 4); }
.vl-plot { position: relative; flex: 1; min-height: 150px; touch-action: pan-y; cursor: grab; outline: none; border-radius: var(--r-mittel); }
.vl-plot:active { cursor: grabbing; }
.vl-plot:focus-visible { box-shadow: var(--ring); }
.vl-plot svg { display: block; user-select: none; -webkit-user-select: none; }
.vl-plot .gridline { stroke: var(--grid, var(--line)); }
.vl-plot .gridline.zero { stroke: var(--zero, var(--line-2)); }
.vl-plot .ytick, .vl-plot .xtick { fill: var(--ink-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.vl-linie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vl-flaeche { opacity: var(--flaeche, .12); stroke: none; }
.vl-kreuz { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.vl-leer { fill: var(--ink-3); font-size: 13px; }
.vl-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 11.5px; color: var(--ink-3); }
.vl-hilfe { opacity: .8; }
.vl-fuss { align-items: center; }
.vl-zurueck { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
/* gesperrte Ansichten (Stände: keine Säulen, keine 3 Monate) und der Satz, der sagt warum */
.vl-leiste .seg button:disabled { opacity: .4; cursor: not-allowed; }
.vl-notiz { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--ink-3); }
/* Aufschlüsselung beim Darüberfahren (Säulen): schlichte schwebende Liste */
.vl-tip { position: absolute; top: 4px; z-index: 3; width: 240px; max-height: calc(100% - 8px); overflow: auto; padding: 10px 12px; border-radius: var(--r-mittel); background: var(--card); box-shadow: var(--shadow-pop); font-size: 12.5px; pointer-events: none; }
.vl-tip > b { display: block; margin-bottom: 6px; font-weight: 600; }
.vl-tip-reihe + .vl-tip-reihe { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.vl-tip-kopf { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.vl-tip-kopf span { margin-left: auto; font-variant-numeric: tabular-nums; }
.vl-tip ul { list-style: none; margin: 4px 0 0; padding: 0; }
.vl-tip li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vl-tip li.rest { color: var(--ink-3); }
.vl-tip p { margin: 4px 0 0; color: var(--ink-3); }
.vl-menue { width: min(300px, calc(100vw - 40px)); }
.vl-menue .pop-item[disabled] { opacity: .45; cursor: not-allowed; }
.vl-haken { width: 16px; display: inline-grid; place-items: center; color: var(--ink); flex: none; }
.vl-art { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.vl-eigen { display: grid; gap: 10px; width: 240px; padding: 4px; }
@media (max-width: 760px) {
  .vl-hilfe { display: none; }
  /* am Handy eine Zeile mehr, damit neben den Steuerelementen genug Diagramm bleibt */
  .dash2 > .widget.s-XL:has(> .dw-body.wk-verlauf), .dash2 > .widget.s-L:has(> .dw-body.wk-verlauf) { grid-row: span 3; }
  .vl-vergleichen { margin-left: 0; }
  .vl-wahl { max-width: 160px; }
}

/* ==========================================================================
   Auswahl Projekte → Immobilien (wie Google Flights): Fenster und Chip-Zeile im Kopf
   ========================================================================== */
.dash-wahl { width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.dash-wahl-suche { position: relative; }
.dash-wahl-suche .input { padding-left: 36px; }
.dash-wahl-suche .ml-lupe { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; }
.dash-wahl-chips, .dash-auswahl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dash-wahl-chip { gap: 6px; padding-right: 4px; max-width: 100%; }
.dash-wahl-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-wahl-x { width: 20px; height: 20px; flex: none; border: 0; border-radius: var(--r-rund); background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.dash-wahl-x:hover { background: var(--hover); color: var(--ink); }
.dash-wahl-x:focus-visible { outline: none; box-shadow: var(--ring); }
.dash-wahl-liste { max-height: min(46vh, 380px); overflow: auto; margin: 0 -4px; padding: 0 4px; border-top: 1px solid var(--line); }
.dash-wahl-zeile { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: var(--r-klein); cursor: pointer; }
.dash-wahl-zeile:hover { background: var(--hover); }
.dash-wahl-zeile input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.dash-wahl-zeile.projekt { margin-top: 6px; }
.dash-wahl-zeile.immobilie { padding-left: 32px; }
.dash-wahl-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.dash-wahl-name > b, .dash-wahl-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-wahl-name > b { font-weight: 600; }
.dash-wahl-name .label { margin-left: auto; flex: none; }
.dash-wahl-name svg { flex: none; color: var(--ink-3); }
.dash-wahl-leer { margin: 12px 6px; }
.dash-wahl-fuss { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
/* eigene Zeile unter Dashboards und Werkzeugen */
.pop:has(> .dash-wahl) { max-width: min(400px, calc(100vw - 24px)); }
.dash-auswahl-weg { height: 28px; }
/* Handy: im Blatt über die ganze Breite */
.modal .dash-wahl { width: 100%; padding: 0; }
.modal .dash-wahl-liste { max-height: none; }

/* Widgets führen per Klick zum passenden Bereich (nicht beim Anpassen) */
.dash2:not(.bearbeiten) > .widget.dw-klick { cursor: pointer; }
.dash2:not(.bearbeiten) > .widget.dw-klick:hover { box-shadow: var(--shadow-hover); }
.dash2:not(.bearbeiten) > .widget.dw-klick:focus-visible { outline: none; box-shadow: var(--ring); }

/* Kennzahlen-Verlauf im Vollbild */
.vl-vollbild { width: 32px; height: 32px; flex: none; }
.vl-leiste:not(:has(.vl-vergleichen)) .vl-vollbild { margin-left: auto; }
.modal.vl-voll { width: min(1400px, 100%); height: min(92vh, 960px); max-height: none; }
.modal.vl-voll .modal-body { display: flex; flex: 1; min-height: 0; overflow: hidden; padding-bottom: 24px; }
.vl-voll-inhalt { display: flex; flex: 1; min-width: 0; min-height: 0; }
.vl-voll-inhalt .vl-plot { min-height: 280px; }
.vl-plot.zieht { cursor: grabbing; }
@media (max-width: 640px) {
  .modal.vl-voll { height: 92vh; }
}

/* Kreisdiagramm (App.charts.kreis): Widgets „Grafiken“ und Immobilien-Übersicht */
.kreis { display: block; width: 100%; height: 100%; overflow: visible; }
.kreis-stueck { transition: stroke-width var(--dauer-2) ease; }
.kreis-stueck:hover { stroke-width: 15; }
.kreis-mitte { font-size: 11.5px; font-weight: 650; fill: var(--ink); font-variant-numeric: tabular-nums; }
.kreis-mitte-klein { font-size: 6.5px; fill: var(--ink-3); }
.kreis-legende { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 12.5px; }
.kreis-legende.dicht { gap: 5px; }
.kreis-legende li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; gap: 8px; align-items: center; min-width: 0; }
.kreis-legende i { width: 10px; height: 10px; border-radius: var(--r-rund); }
.kreis-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.kreis-pct { color: var(--ink-3); text-align: right; }
.wk-kreis-inhalt { display: flex; align-items: center; gap: 18px; flex: 1; min-height: 0; margin-top: 8px; }
.wk-kreis-bild { flex: none; width: min(46%, 150px); aspect-ratio: 1; }
.wk-kreis-M .wk-kreis-bild { width: min(38%, 104px); }
.wk-kreis-inhalt .kreis-legende { flex: 1; }
@media (max-width: 760px) { .wk-kreis-M .kreis-legende b { display: none; } .wk-kreis-M .kreis-legende li { grid-template-columns: 10px minmax(0, 1fr) 36px; } }
.immo-anteile { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 16px; }
.immo-anteile .kreis-wrap { width: 168px; aspect-ratio: 1; }
.immo-anteile h3 { margin: 0 0 2px; }
.immo-anteile .sub { margin: 0 0 12px; }
.immo-anteile .kreis-legende { max-width: 520px; font-size: 13.5px; }
/* Immobilien-Seite: kleine, dezente Verteilung in einer Zeile (Ring 48 px, Legende nebeneinander, nur Anteile) */
.immo-anteile.klein { grid-template-columns: 48px auto minmax(0, 1fr); gap: 18px; padding: 12px 18px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.immo-anteile.klein .kreis-wrap { width: 48px; }
.immo-anteile.klein h3 { font-size: 13.5px; font-weight: var(--w-mittel); color: var(--ink-2); }
.immo-anteile.klein .sub { margin: 0; font-size: 12.5px; }
.immo-anteile.klein .kreis-legende { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; max-width: none; font-size: 12.5px; color: var(--ink-2); }
.immo-anteile.klein .kreis-legende li { display: inline-flex; gap: 6px; }
.immo-anteile.klein .kreis-legende b { display: none; }
@media (max-width: 760px) { .immo-anteile.klein { grid-template-columns: 40px minmax(0, 1fr); } .immo-anteile.klein .kreis-wrap { width: 40px; } .immo-anteile.klein .kreis-legende { grid-column: 1 / -1; } }
@media (max-width: 640px) { .immo-anteile { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; } .immo-anteile .kreis-wrap { width: 112px; } .immo-anteile .kreis-legende b { display: none; } .immo-anteile .kreis-legende li { grid-template-columns: 10px minmax(0, 1fr) 36px; } }
.dw-body .dw-raus { display: none !important; }

/* Kennzahlen-Verlauf in schmalen Widgets (L, Handy): Auswahlknöpfe statt Segmente, kein Hilfetext */
.vl { container-type: inline-size; container-name: vl; }
.vl-schmal { display: none; }
@container vl (max-width: 640px) {
  .vl-leiste .vl-breit { display: none; }
  .vl-leiste .vl-schmal { display: inline-flex; align-items: center; }
  .vl-leiste .vl-wahl { max-width: 170px; }
  .vl-legende { font-size: 12px; gap: 2px 12px; }
  .vl-legende em { display: none; }
  .vl-leiste .vl-notiz { display: none; }
  .vl-vergleichen { margin-left: auto; width: 32px; padding: 0; justify-content: center; flex: none; }
  .vl-vergleichen span { display: none; }
  .vl-hilfe { display: none; }
}

/* ---------- Kennzahlen-Vergleich (W.kzvergleich): Wert groß, Veränderung zum Vormonat klein daneben ---------- */
.dw-body.wk-kzv, .wk-kzv { display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
.kzv-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px 18px; align-content: start; }
.kzv-kachel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kzv-kachel .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kzv-wert { font-size: var(--t-wert); font-weight: var(--w-mittel); letter-spacing: -.02em; line-height: 1.1; }
.kzv-chip { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; align-self: flex-start; font-size: 12px; font-weight: var(--w-mittel); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kzv-chip.gut { color: var(--pos); }
.kzv-chip.schlecht { color: var(--neg); }
.kzv-liste { display: flex; flex-direction: column; }
.kzv-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.kzv-zeile:first-child { border-top: 0; }
.kzv-zeile .kzv-chip { justify-self: end; }
.kzv-balken { display: flex; flex-direction: column; gap: 10px; }
.kzv-b-zeile { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.kzv-b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Spur mit Nulllinie in der Mitte: Plus nach rechts, Minus nach links */
.kzv-b-spur { position: relative; height: 8px; border-radius: var(--r-rund); background: var(--track); }
.kzv-b-spur::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--zero); }
.kzv-b-spur i { position: absolute; top: 0; bottom: 0; border-radius: var(--r-rund); background: var(--reihe-1); }
.kzv-b-spur i.plus { left: 50%; }
.kzv-b-spur i.minus { right: 50%; background: var(--neutral-bar); }
.hervor-balken .kzv-b-spur i { background: var(--accent); box-shadow: var(--glow-akzent); }
.kzv-b-zeile .kzv-chip { justify-self: end; }
@container (max-width: 260px) { .kzv-kacheln { grid-template-columns: 1fr 1fr; gap: 10px; } .kzv-wert { font-size: 20px; } }

/* Optionen: Kennzahlen wählen (2 bis 6) */
.ed-kz-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; max-height: 280px; overflow: auto; padding: 4px 2px; }
.ed-kz-gruppe { grid-column: 1 / -1; margin: 8px 0 2px; }
.ed-kz-wahl .check input:disabled + span { color: var(--ink-3); }
