/* Immer dunkel */
:root {
  color-scheme: dark;
  --bg: #121418; --panel: #1b1e24; --panel2: #22262d; --ink: #e8e9ec; --muted: #9aa0aa; --line: #2e333b;
  --accent: #3fae8f; --accent-ink: #0d1512; --chip: #262b32;
  --card: #262a31; --card-line: #3a3f48;
  --ok: #3fae8f; --warn: #e0a83a; --bad: #e0574a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.4 system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
body { display: flex; }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Seitenleiste ---------- */
#side { width: 384px; flex: none; height: 100%; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); background: var(--bg); scrollbar-width: thin; scrollbar-color: #3a3f48 transparent; }
body.side-off #side { display: none; }
#map { flex: 1; height: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0; }
h1 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.iconbtn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; color: var(--muted); }
.iconbtn:hover { color: var(--ink); border-color: #444a54; }
.floatbtn { position: fixed; left: 12px; top: 84px; z-index: 900; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.floatbtn:hover { border-color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card-h { display: flex; align-items: center; gap: 8px; }
.card-h b { font-size: 15px; }
.card-h .link, .card-h .sel { margin-left: auto; }
.pill-n { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; border-radius: 9px; padding: 1px 7px; }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: 12px; }
.link:hover { text-decoration: underline; }
.tiny { font-size: 11.5px; color: var(--muted); }
.tiny:empty { display: none; }

/* Miete | Kauf */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px; border-radius: 8px; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.sel, .inp, .ortpick input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font: inherit; outline: none; }
.sel:focus, .inp:focus, .ortpick input:focus { border-color: var(--accent); }
.sel.small { width: auto; padding: 4px 8px; font-size: 12px; }

/* Aktualität */
.fresh { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.fresh .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent); }
.fresh.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.fresh.old .dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); }
.fresh.err .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
.fresh.busy .dot { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .6; } }
.fresh-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fresh-txt b { font-size: 13px; }
.fresh-txt small { color: var(--muted); font-size: 11.5px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--accent); }
.ghost:disabled { opacity: .45; cursor: default; }

/* Ladeanzeige mit Zeit */
#loadbox { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.lb-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.lb-row.sub { font-size: 11.5px; color: var(--muted); }
#lbTime { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar2 { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.bar2 div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #6fd3b3); border-radius: 3px; transition: width .5s ease; }
.bar2.wait div { width: 30%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.chg { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chg span { padding: 2px 8px; border-radius: 10px; background: var(--chip); color: var(--ink); font-size: 12px; }
.chg .n { background: #1f4d3f; } .chg .d { background: #4d2a22; } .chg .c { background: #4a3d1c; }
#changes { font-size: 12px; color: var(--muted); }
#changes:empty { display: none; }
details.gone summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
details.gone ul { margin: 4px 0 0; padding-left: 16px; max-height: 160px; overflow-y: auto; }

/* ---------- Filter-Abschnitte (einklappbar) ---------- */
.sec { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; user-select: none; font-weight: 600; font-size: 13.5px; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-left: 6px; flex: none; }
.sec[open] > summary::after { transform: rotate(45deg); }
.sec > summary em { margin-left: auto; font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.sec-b { padding: 2px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* Auswahl-Chips als Umschalter */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips:empty { display: none; }
.toggles label { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; cursor: pointer; user-select: none; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); transition: background .12s, color .12s, border-color .12s; }
.toggles label:has(input:checked) { background: color-mix(in srgb, var(--accent) 18%, var(--panel2)); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--ink); }
.toggles label:hover { border-color: #4a515c; }
.toggles input { position: absolute; opacity: 0; pointer-events: none; }
.toggles small { opacity: .65; font-size: 11px; }
.mini { font-size: 12px; color: var(--muted); }
#orte .ort { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 11px; border-radius: 999px; font-size: 12.5px; background: color-mix(in srgb, var(--accent) 25%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); }
#orte .ort button { background: none; border: 0; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 5px; }
#orte .ort button:hover { color: var(--ink); }

/* Zwei-Griff-Schieberegler */
.rng { display: flex; flex-direction: column; gap: 4px; }
.rng-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.rng-top span:first-child { color: var(--muted); }
.rng-top .rng-val { font-weight: 600; }
.rng-track { position: relative; height: 22px; }
.rng-track::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--chip); }
.rng-fill { position: absolute; top: 9px; height: 4px; border-radius: 2px; background: var(--accent); }
.rng-track input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px; }
.rng-track input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; }
.rng-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #f2f4f6; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.6); cursor: grab; }
.rng-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #f2f4f6; border: 3px solid var(--accent); cursor: grab; }
.rng-track input[type=range]::-moz-range-track { background: none; }
.rng-nums { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.rng-nums input { width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); color: var(--ink); font: inherit; font-size: 12.5px; outline: none; }
.rng-nums input:focus { border-color: var(--accent); }
.rng-nums span { color: var(--muted); }

/* Schalter */
.switch { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c9ced5; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }

/* ---------- Liste ---------- */
.listbox { flex: 1; min-height: 300px; }
#list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#list li { display: grid; grid-template-columns: 84px 1fr; gap: 9px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
#list li:hover, #list li.hl { border-color: var(--accent); }
#list img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--chip); }
.li-price { font-weight: 700; }
.li-sub { color: var(--muted); font-size: 12px; }
.li-title { font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#list li.more { display: block; text-align: center; color: var(--muted); font-size: 12px; padding: 8px; cursor: default; }

.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; margin-right: 4px; vertical-align: 1px; }
.badge.new { background: var(--accent); color: var(--accent-ink); }
.badge.down { background: #1a9850; color: #fff; } .badge.up { background: #d73027; color: #fff; }
.old { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 12px; }
.pin .tag { font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); }
.pin .tag.down { background: #1a9850; color: #fff; } .pin .tag.up { background: #d73027; color: #fff; }

/* Preisschild: weiße Karte mit Farbpunkt (€/m²), Preis + m², kleine Spitze nach unten */
.pin {
  position: absolute; left: 0; bottom: 7px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px;
  background: var(--card); color: var(--ink); border-radius: 999px; white-space: nowrap;
  font: 12px/1.15 system-ui, "Segoe UI", sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 1px var(--card-line);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pin::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); flex: none; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--card); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 2px 0; box-shadow: 1px 1px 0 var(--card-line), 2px 2px 4px rgba(0,0,0,.4); z-index: -1; }
.pin b { font-weight: 700; letter-spacing: -.01em; }
.pin small { color: var(--muted); font-size: 11px; padding-left: 6px; border-left: 1px solid var(--card-line); }
.pinwrap:hover { z-index: 10000 !important; }
.pinwrap:hover .pin { transform: translateX(-50%) translateY(-2px) scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.3), 0 0 0 1.5px var(--c); }
.pin.approx { background: #1b1e23; box-shadow: 0 1px 4px rgba(0,0,0,.5), 0 0 0 1px #2c3038; }
.pin.approx::after { background: #1b1e23; }
.pin.approx b { color: #b9bec7; }
.leaflet-div-icon.pinwrap { background: none; border: 0; }
/* Stapel-Schild: mehrere Wohnungen an einer Stelle übereinander */
.stack {
  position: absolute; left: 0; bottom: 7px; transform: translateX(-50%);
  min-width: 112px; padding: 3px; border-radius: 10px; background: var(--card); color: var(--ink);
  font: 12px/1.15 system-ui, "Segoe UI", sans-serif; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 1px var(--card-line), 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent);
  transition: transform .12s ease;
}
/* angedeuteter Stapel dahinter, wenn es mehr gibt als angezeigt */
.stack.deep { box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 1px var(--card-line), 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent), 3px -3px 0 1px #1b1e23, 6px -6px 0 1px #15171b; }
.stack::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--card); transform: translateX(-50%) rotate(45deg); box-shadow: 1px 1px 0 var(--card-line); z-index: -1; }
.shead { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px 3px; }
.srow { display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 7px; }
.srow + .srow { border-top: 1px solid var(--card-line); border-radius: 0; }
.srow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.srow small { color: var(--muted); font-size: 11px; margin-left: auto; padding-left: 8px; }
.srow .tag { font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); }
.srow .tag.down { background: #1a9850; color: #fff; } .srow .tag.up { background: #d73027; color: #fff; }
.smore { font-size: 11px; color: var(--accent); font-weight: 600; text-align: center; padding: 3px 6px 2px; border-top: 1px solid var(--card-line); }
.pinwrap:hover .stack { transform: translateX(-50%) translateY(-2px) scale(1.04); }
.stack.approx { background: #1b1e23; }

.spop { width: min(300px, 78vw); font: 13px/1.35 system-ui, sans-serif; }
.spop-h { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.spop-h small { color: var(--muted); font-weight: 400; }
.spop-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.sitem { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 5px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink) !important; text-decoration: none; font-weight: 400 !important; }
.sitem:hover, .sitem.hl { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sitem img, .sitem .noimg { width: 64px; height: 52px; object-fit: cover; border-radius: 5px; background: var(--chip); }
.sinfo { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sp b { font-size: 14px; }
.ss { color: var(--muted); font-size: 11.5px; }
.st { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Gruppe beim Herauszoomen: Preis-Schild (Ø Preis + Spanne), Anzahl als kleines Abzeichen */
.cpill {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; padding: 4px 10px 4px 10px;
  background: var(--card); color: var(--ink); border-radius: 10px; white-space: nowrap;
  font: 12px/1.15 system-ui, "Segoe UI", sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 1px var(--card-line), inset 0 -3px 0 var(--c);
  transition: transform .12s ease; padding-bottom: 6px;
}
.cpill b { font-size: 13px; font-weight: 700; }
.cpill small { font-size: 10px; color: var(--muted); }
.cpill .cn { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c); color: #111; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.grp-wrap:hover .cpill { transform: translate(-50%, -50%) scale(1.06); }
.grp-wrap { background: none; border: 0; }
.grp {
  width: 100%; height: 100%; border-radius: 50%; background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px var(--c), 0 0 0 7px color-mix(in srgb, var(--c) 25%, transparent), 0 3px 10px rgba(0,0,0,.6);
  font: 12px/1 system-ui, "Segoe UI", sans-serif; transition: transform .12s ease;
}
.grp b { font-weight: 700; }
.grp small { font-size: 8.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.grp-wrap:hover .grp { transform: scale(1.08); }
.pop { width: 240px; font: 13px/1.4 system-ui, sans-serif; }
.pop img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.pop .pp { font-size: 17px; font-weight: 700; margin: 4px 0 2px; }
.pop table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.pop td { padding: 1px 0; } .pop td:first-child { color: var(--muted); }
.pop .note { color: #f0b45a; font-size: 11px; }
.pop a { color: var(--accent); font-weight: 600; }

/* Helle Karte umgekehrt: dunkler Grund, Farbtöne bleiben (Wasser blau, Wald grün), etwas gedämpft */
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.45); }

/* Ortsnamen heller und mit dunklem Schein → auf dunklem Grund gut lesbar */
.bright-labels { filter: brightness(1.55) contrast(1.15) drop-shadow(0 0 1.5px rgba(0,0,0,.9)); }
.dim-sat { filter: brightness(.72) saturate(.85); }

/* Kartenstil-Auswahl */
.leaflet-control-layers { background: var(--panel) !important; color: var(--ink); border: 1px solid var(--line) !important; border-radius: 8px !important; box-shadow: 0 2px 8px rgba(0,0,0,.5) !important; }
.leaflet-control-layers-toggle { filter: invert(1) brightness(.9); }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 8px; }
.leaflet-control-layers label { margin: 3px 0; cursor: pointer; }

/* Leaflet-Bedienteile dunkel */
.leaflet-container { background: #0e1013; font-family: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); box-shadow: 0 4px 18px rgba(0,0,0,.6); border: 1px solid var(--line); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar { border-color: var(--line) !important; box-shadow: 0 2px 8px rgba(0,0,0,.5) !important; }
.leaflet-control-attribution { background: rgba(21,23,27,.8) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent); }
.marker-cluster-spider-leg, .leaflet-cluster-spider-leg { stroke: #9aa0aa; }
#legend { position: fixed; right: 12px; bottom: 22px; z-index: 500; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.bar { height: 8px; width: 170px; border-radius: 4px; background: linear-gradient(90deg, #1a9850, #91cf60, #fee08b, #fc8d59, #d73027); margin: 3px 0; }
.bar-l { display: flex; justify-content: space-between; color: var(--muted); }

@media (max-width: 760px) {
  body { flex-direction: column-reverse; }
  #side { width: 100%; height: 55%; border-right: 0; border-top: 1px solid var(--line); }
  #map { height: 45%; flex: none; }
  #legend { bottom: auto; top: 10px; }
}

/* Standort-Knopf */
.locbtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #2c313a; background: #1b1e24; color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 2px 8px #0008; }
.locbtn:hover { background: #262a32; }
.locbtn.busy { animation: pulse 1s infinite; }

/* Quellen */
.srcline { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: baseline; line-height: 1.4; }
.srcline .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #7a7f88; display: inline-block; transform: translateY(-1px); }
.srcline .dot.ok { background: var(--ok); } .srcline .dot.err { background: var(--bad); } .srcline .dot.busy { background: #60a5fa; animation: pulse 1.2s infinite; }
.srcb { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 0 4px; border-radius: 3px; margin-right: 3px; vertical-align: 1px; background: #2d6a3a; color: #d7ffe0; }
.srcb.is24 { background: #6b5a12; color: #fff2b8; }
.pop a.also { display: block; margin-top: 4px; font-size: 12px; opacity: .85; }

/* Anfrage-Text-Schreiber */
.mailbtn { display: block; width: 100%; margin: 8px 0 4px; padding: 7px; border: 0; border-radius: 7px; background: #2f7d4f; color: #fff; font-weight: 600; cursor: pointer; }
.mailbtn:hover { background: #379660; }
.mailmini { flex: none; align-self: center; margin-left: auto; order: 9; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: #2f7d4f; color: #fff; cursor: pointer; font-size: 13px; }
.modal-back { position: fixed; inset: 0; background: #000a; z-index: 3000; display: grid; place-items: center; padding: 16px; }
.modal-back[hidden] { display: none; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; background: var(--panel, #181b21); color: var(--text, #e8eaed); border: 1px solid #2c313a; border-radius: 14px; padding: 14px 16px 16px; box-shadow: 0 20px 60px #000c; }
.modal header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 16px; }
.mail-for { display: flex; gap: 10px; align-items: center; background: #ffffff08; border-radius: 9px; padding: 8px; margin-bottom: 10px; font-size: 13px; }
.mail-for img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.mail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.mail-grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.mail-grid .inp, .modal #meWhenText, .modal #meAbout { width: 100%; box-sizing: border-box; }
.modal #meWhenText { margin-top: 6px; }
.mail-opts { display: flex; gap: 10px; align-items: center; margin: 12px 0 8px; }
.seg.small button { padding: 4px 14px; }
#mailText { width: 100%; box-sizing: border-box; background: #0f1115; color: inherit; border: 1px solid #2c313a; border-radius: 9px; padding: 10px; font: 13.5px/1.5 system-ui, sans-serif; resize: vertical; }
.mail-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.mail-actions .tiny { margin-right: auto; color: var(--ok); }
button.primary { border: 0; border-radius: 8px; padding: 8px 14px; background: #2f7d4f; color: #fff; font-weight: 600; cursor: pointer; }
button.primary:hover { background: #379660; }
@media (max-width: 560px) { .mail-grid { grid-template-columns: 1fr; } }

/* Seitenleiste: Kästen nie zusammendrücken (sonst ragt die Liste heraus) */
#side > * { flex-shrink: 0; }
.listbox { flex: 1 0 auto; }

/* Aussortiert */
.jrow { font-size: 12.5px; }
.jrow small { color: var(--muted); margin-left: 4px; }
.jman { font-size: 12px; color: var(--muted); margin-top: 6px; }
.jlist { margin-top: 8px; font-size: 12px; }
.jlist summary { cursor: pointer; color: var(--accent, #7fb3ff); }
.jlist ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.jlist li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 5px 6px; border-radius: 7px; background: #ffffff07; }
.jlist li a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jlist li small { grid-column: 1; color: var(--muted); }
.jlist li button { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.hidebtn { display: block; width: 100%; margin: 0 0 6px; padding: 5px; border: 1px solid #3a3f48; border-radius: 7px; background: transparent; color: #c9ccd2; font-size: 11.5px; cursor: pointer; }
.hidebtn:hover { border-color: #d75a5a; color: #ffb4b4; }

/* Eigener Standort – immer ganz oben, gut sichtbar */
.me { position: absolute; left: 0; top: 0; pointer-events: none; }
.me-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 2px #0008, 0 2px 10px #000c; }
.me-ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: #3b82f655; border: 2px solid #3b82f6; animation: mering 1.8s ease-out infinite; }
.me-tag { position: absolute; left: 50%; top: -38px; transform: translateX(-50%); background: #3b82f6; color: #fff; font: 700 11px/1 system-ui, sans-serif; padding: 4px 7px; border-radius: 6px; box-shadow: 0 2px 8px #000a; white-space: nowrap; }
@keyframes mering { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

/* Reserviert, Gesamtbelastung, Kosten */
.tag.res { background: #b45309; color: #fff; }
.badge.res { background: #b45309; color: #fff; }
.pin.res, .srow.res { opacity: .62; }
.pin.res b, .srow.res b { text-decoration: line-through 1px #ffffff99; }
.ges { font-style: normal; font-size: 9px; font-weight: 700; margin-left: 2px; color: #ffd27a; }
.resbar { background: #7c2d12; color: #ffedd5; border-radius: 7px; padding: 6px 8px; font-size: 12px; margin: 6px 0; }
.gesbar { background: #4a3a10; color: #ffe7a8; border-radius: 7px; padding: 5px 8px; font-size: 12.5px; margin: 4px 0 6px; }
.gesbar small { color: #e7cf8f; }
.gesinline { color: #ffd27a; font-size: .85em; font-weight: 600; }
.pop tr.cost td:last-child { color: #ffe7a8; }
.pop td.muted { color: var(--muted); font-style: italic; }

/* weitere Quellen */
#is24line { display: block; }
.srcrow { display: flex; gap: 6px; align-items: baseline; }
.srcrow + .srcrow { margin-top: 3px; }
.srcb.derstandard { background: #7a2430; color: #ffdfe4; }
.srcb.wohnnet { background: #1f4f7a; color: #d8ecff; }
