/* Fasanenstraße: Farben und Grundformen aus Müllers Universum (privat-app/pb_public/app.css), hell und dunkel. */
:root {
  --navy: #0B1E33; --blau: #0D5DB8; --blau-text: #0D5DB8; --blau-hell: #E7EFFA; --gelb: #F5C518; --gelb-hell: #FDF3CC;
  --grund: #F3F5F9; --karte: #FFFFFF; --text: #0B1E33; --leise: #5B6675; --linie: #DCE2EA; --gut: #1D7A46; --warn: #C62828;
  --gut-hell: #DDF3E2; --warn-hell: #FDE4E2; --grau-hell: #ECEFF3;
  --plan-grund: #EEF2E8; --plan-strasse: #FFFFFF; --plan-feld: #E6DCC8; --plan-block: #C7CDD6; --plan-text: #3A4656;
  --schatten: 0 1px 2px rgba(11, 30, 51, .06), 0 8px 24px rgba(11, 30, 51, .08);
  --rund: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blau: #3575CF; --blau-text: #8DBBF5; --blau-hell: #17325A; --gelb-hell: #3B3210;
    --grund: #07121F; --karte: #112843; --text: #E3ECF8; --leise: #9AABC0; --linie: #23405F; --gut: #5FC48A; --warn: #FF8A80;
    --gut-hell: #173A24; --warn-hell: #43201F; --grau-hell: #1E2B3B;
    --plan-grund: #0E1F30; --plan-strasse: #2A3F57; --plan-feld: #2B2A22; --plan-block: #3A4B60; --plan-text: #B9C6D6;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--grund); scrollbar-gutter: stable; }
body { margin: 0; font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--grund); color: var(--text); min-height: 100dvh; overflow-x: hidden; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(110px + env(safe-area-inset-bottom)); outline: none; }
body.breit main { max-width: 1240px; }
h1 { font-size: 1.5rem; margin: 4px 0 14px; } h2 { font-size: 1.15rem; margin: 0 0 10px; } h3 { font-size: 1rem; margin: 20px 0 8px; }
p { margin: 10px 0; }
a { color: var(--blau-text); }
.ic { width: 22px; height: 22px; flex: none; }
.leise { color: var(--leise); } .mitte { text-align: center; } .klein { font-size: .88rem; }
.rot { color: var(--warn); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 20; color: #fff; padding: max(10px, env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(135deg, #0B1E33 0%, #0E2C4F 60%, #0D3F7A 100%); box-shadow: 0 6px 20px rgba(11, 30, 51, .25); }
.kopfzeile, .reiter { max-width: 1208px; margin: 0 auto; }
.kopfzeile { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.logo { width: 34px; height: 34px; border-radius: 10px; }
.marke { font-size: 1.1rem; font-weight: 750; margin-right: auto; }
.marke em, .anmeldung h1 em { font-style: normal; color: var(--gelb); }
.kopfknopf { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.kopfknopf.gelb { background: var(--gelb); color: #0B1E33; }
.reiter { display: flex; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.reiter button { flex: 1; min-height: 40px; padding: 6px 4px; border: 0; border-radius: 10px; background: transparent; color: rgba(255, 255, 255, .85); font-weight: 650; }
.reiter button[aria-selected="true"] { background: var(--gelb); color: #0B1E33; }

/* Knöpfe und Felder */
button { font: inherit; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--linie); background: var(--karte); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:active:not(:disabled) { transform: scale(.97); }
button.haupt { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 650; }
button.gelb { background: var(--gelb); border-color: var(--gelb); color: #0B1E33; font-weight: 700; }
button.leise { background: transparent; border-color: transparent; color: var(--leise); }
button.gefahr { background: transparent; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
button.klein { min-height: 40px; padding: 6px 12px; font-size: .92rem; }
button.rund { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; flex: none; }
button.breit { width: 100%; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }
label { display: block; font-size: .9rem; color: var(--leise); margin: 12px 0 5px; }
input, select, textarea { font: inherit; width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--linie); border-radius: 12px; background: var(--karte); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blau) 18%, transparent); }
textarea { min-height: 96px; resize: vertical; }
.feldfehler { color: var(--warn); font-size: .92rem; margin: 6px 0 0; }
.haken { display: flex; gap: 10px; align-items: center; margin-top: 14px; color: var(--text); font-size: 1rem; }
.haken input { width: 22px; height: 22px; min-height: 0; accent-color: var(--blau); flex: none; }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.zeile > * { flex: 1 1 140px; }
.zeile.zwischen { justify-content: space-between; } .zeile.zwischen > * { flex: 0 1 auto; }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .raster2 { grid-template-columns: 1fr; } }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.knopfreihe > * { flex: 1 1 140px; }
.knopfreihe.senkrecht { flex-direction: column; } .knopfreihe.senkrecht > * { flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { min-height: 40px; padding: 6px 14px; border-radius: 99px; font-size: .93rem; }
.chips [aria-pressed="true"] { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 650; }

/* Karten, Listen */
.karte { background: var(--karte); border: 1px solid color-mix(in srgb, var(--linie) 60%, transparent); border-radius: var(--rund); padding: 16px; margin-bottom: 12px; box-shadow: var(--schatten); }
.hinweis { background: var(--gelb-hell); border-radius: 12px; padding: 8px 12px; font-size: .92rem; }
.hinweis.warn { background: var(--warn-hell); color: var(--warn); }
.leer { text-align: center; padding: 28px 16px; color: var(--leise); }
.leer .planet { display: block; width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 22px; }
.leer b { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 4px; }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li + li { border-top: 1px solid var(--linie); }
.liste.karten li + li { border: 0; }
.liste > li.zeile { padding: 8px 0; }
.liste li > span small, .zeilenknopf small, .wohnung small { display: block; color: var(--leise); font-size: .86rem; }
.zeilenknopf { width: 100%; min-height: 54px; padding: 8px 2px; border: 0; border-radius: 0; background: transparent; justify-content: space-between; text-align: left; gap: 12px; }
.zeilenknopf > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.zeilenknopf > :last-child { white-space: nowrap; }
.wohnung { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 12px; }
.wohnung > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.marke { flex: none; padding: 3px 10px; border-radius: 99px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.marke.rot { background: var(--warn-hell); color: var(--warn); } .marke.gruen { background: var(--gut-hell); color: var(--gut); }
.marke.grau, .marke.leer { background: var(--grau-hell); color: var(--leise); }

/* Übersicht: Kacheln und Dashboard */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kachel { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; min-height: 0; padding: 14px; text-align: left;
  background: var(--karte); border: 1px solid color-mix(in srgb, var(--linie) 60%, transparent); border-radius: var(--rund); box-shadow: var(--schatten); }
.kachel span { font-size: .85rem; color: var(--leise); }
.kachel b { font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kachel small { font-size: .82rem; color: var(--leise); }
.kachel.rot b { color: var(--warn); } .kachel.gruen b { color: var(--gut); }
.kachel .balken { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--grau-hell); overflow: hidden; }
.kachel .balken i { display: block; height: 100%; background: var(--gut); }
.dashboard { display: grid; gap: 12px; }
@media (min-width: 1000px) { .dashboard { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.legende { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--leise); }
.legende i { width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.f-unser { background: var(--gelb); } .f-offen { background: var(--warn); }

/* Lageplan */
.lageplan { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--plan-grund); }
.lageplan .strasse { fill: none; stroke: var(--plan-strasse); stroke-width: 26; stroke-linecap: round; }
.lageplan .strasse.schmal { stroke-width: 16; }
.lageplan .feld { fill: var(--plan-feld); }
.lageplan .parkplatz { fill: var(--plan-strasse); opacity: .8; }
.lageplan .spiel { fill: color-mix(in srgb, var(--gut) 35%, transparent); }
.lageplan .ort { fill: var(--plan-text); font-size: 17px; }
.lageplan .ort.strname { font-size: 19px; font-style: italic; }
.lageplan .ort.klein { font-size: 13px; }
.lageplan .block { cursor: pointer; }
.lageplan .block rect { fill: var(--plan-block); stroke: color-mix(in srgb, var(--plan-text) 40%, transparent); stroke-width: 2; }
.lageplan .block line { stroke: color-mix(in srgb, var(--plan-text) 35%, transparent); stroke-width: 2; }
.lageplan .block text { fill: var(--plan-text); font-size: 20px; font-weight: 700; pointer-events: none; }
.lageplan .block.unser rect { fill: var(--gelb); stroke: #8A6D00; }
.lageplan .block.unser > text { fill: #0B1E33; }
.lageplan .block circle { fill: var(--navy); stroke: #fff; stroke-width: 2; }
.lageplan .block .zahl { fill: #fff; font-size: 15px; }
.lageplan .block.offen circle { fill: var(--warn); }
.lageplan .block:hover rect, .lageplan .block:focus-visible rect { stroke: var(--blau); stroke-width: 5; }
.lageplan .block:focus { outline: none; }

/* Wohnung im Blatt */
.fakten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0; }
.fakten dt { color: var(--leise); } .fakten dd { margin: 0; overflow-wrap: anywhere; }
.zahlraster { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (max-width: 420px) { .zahlraster { grid-template-columns: repeat(4, 1fr); } }
.monatknopf { flex-direction: column; gap: 0; min-height: 52px; padding: 4px 2px; font-size: .85rem; }
.monatknopf small { font-size: .78rem; }
.monatknopf.bezahlt { background: var(--gut-hell); border-color: transparent; color: var(--gut); font-weight: 700; }
.monatknopf.teil { background: var(--gelb-hell); border-color: transparent; }
.monatknopf.offen { background: var(--warn-hell); border-color: transparent; color: var(--warn); }
.notizen { list-style: none; padding: 0; margin: 12px 0 0; }
.notizen li { padding: 10px 12px; border-radius: 12px; background: var(--gelb-hell); margin-bottom: 8px; overflow-wrap: anywhere; }
.notizen li small { display: block; color: var(--leise); font-size: .8rem; }
.schluessel { font: 700 1.35rem/1.5 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 12px; border-radius: 12px; background: var(--grau-hell); text-align: center; overflow-wrap: anywhere; }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.anmeldung form { text-align: left; }
.logo-gross { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--schatten); }

/* Plus unten rechts, Blätter, Meldungen */
.fab { position: fixed; z-index: 15; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 62px; height: 62px; min-height: 0;
  padding: 0; border-radius: 50%; border: 0; background: var(--gelb); color: #0B1E33; box-shadow: 0 10px 26px rgba(11, 30, 51, .3); }
.fab .ic { width: 28px; height: 28px; }
dialog.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 640px; max-height: 92dvh; margin: 0 auto; padding: 0; border: 0;
  border-radius: 22px 22px 0 0; background: var(--karte); color: var(--text); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); overflow: auto; }
dialog.sheet::backdrop { background: rgba(7, 18, 31, .5); }
@media (min-width: 700px) { dialog.sheet { inset: 0; margin: auto; border-radius: 22px; height: fit-content; } }
.sheet-inhalt { padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.zu-knopf { position: sticky; float: right; top: 8px; margin: 8px 8px 0 0; width: 40px; height: 40px; min-height: 0; padding: 0; z-index: 2; }
.toastplatz { position: fixed; z-index: 50; left: 0; right: 0; bottom: max(90px, env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; }
dialog .toastplatz { position: sticky; bottom: 10px; }
.toastplatz p { margin: 0 16px; padding: 10px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--schatten); }
.toastplatz p.warn { background: var(--warn); }

/* Notfallblatt drucken: nur #druck */
#druck { display: none; }
@media print {
  body > :not(#druck) { display: none !important; }
  #druck { display: block; color: #000; background: #fff; font-size: 14pt; }
  #druck .schluessel { font-size: 20pt; border: 2px solid #000; background: #fff; }
}
