/* Stadt im Wandel - eigene Oberflaeche.
   Die Kopfzeile folgt dem JUPI-Standard (3.13.2): heller Modus mit dem
   gruenen Verlauf, dunkler Modus mit Anthrazit und orange. */

/* ---------- Grundlagen ---------- */
.siw_body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #10202c;
}
.siw_body .bypass {
  position: absolute;
  left: -9999px;
}
.siw_body .bypass:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 99;
  background: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}

/* ---------- Kopfzeile ---------- */
.siw_header {
  flex: none;
  background: linear-gradient(135deg, #2e7d32 0%, var(--link-color, #43a047) 55%, #66bb6a 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .14), 0 1px 0 rgba(255, 255, 255, .15) inset;
}
.siw_header .jupi_nav_back {
  background: #ffffff;
  color: var(--link-color, #43a047);
  font-weight: 800;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.siw_header .jupi_nav_back:hover { background: #f1f8e9; }
html[data-theme="dark"] .siw_header {
  background: linear-gradient(135deg, #1a1a1a 0%, #262626 55%, #4a2f0a 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .08) inset;
}
html[data-theme="dark"] .siw_header .jupi_nav_back {
  background: #1E1E1E;
  color: #FB8C00;
  border: 1px solid #FB8C00;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
html[data-theme="dark"] .siw_header .jupi_nav_back:hover { background: #2a2118; }
.siw_marke {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.siw_marke img { flex: none; }
.siw_marke h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Buehne ---------- */
.siw_haupt {
  flex: 1;
  min-height: 0;
  position: relative;
  height: calc(100vh - 62px);
  height: calc(100dvh - 62px);
  overflow: hidden;
}
.siw_buehne {
  position: absolute;
  inset: 0;
}
.siw_buehne canvas { display: block; width: 100%; height: 100%; }

/* ---------- Panels ---------- */
.siw_panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 21.5rem;
  max-width: 46vw;
  overflow-y: auto;
  padding: .7rem;
  z-index: 5;
  pointer-events: none;
}
.siw_panel > * { pointer-events: auto; }
.siw_panel_klappe { display:none; }
.siw_panel_inhalt {
  background: rgba(255, 255, 255, .93);
  border-radius: 14px;
  padding: .75rem;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
html[data-theme="dark"] .siw_panel_inhalt {
  background: rgba(26, 26, 26, .93);
  color: #eee;
}
.siw_panel_links { left: 0; }
/* Die Info sitzt rechts unter der Stadtinfo-Leiste und über dem Baumenü. */
.siw_panel_rechts {
  right: 0;
  top: 5.1rem;
  bottom: 5.4rem;
  width: 19rem;
  max-width: 42vw;
}
.siw_ueberschrift {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #5c6b73;
}
html[data-theme="dark"] .siw_ueberschrift { color: #a9b6bd; }

/* ---------- Obere Stadtinfo-Leiste ---------- */
.siw_infoleiste {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .45rem .7rem;
  background: rgba(20, 30, 26, .88);
  color: #f2f6f2;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .3);
  backdrop-filter: blur(6px);
}
html[data-theme="dark"] .siw_infoleiste { background: rgba(12, 14, 13, .92); }
.siw_infoleiste_ebene {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  flex: 1 1 16rem;
}
.siw_infoleiste_marke {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
}
.siw_infoleiste_ebene_text { min-width: 0; }
.siw_infoleiste_ebene_text strong {
  display: block;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.siw_infoleiste_ebene_text small {
  display: block;
  font-size: .74rem;
  color: #b8c7bd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.siw_infoleiste_stats {
  display: flex;
  gap: .35rem;
  flex: none;
}
.siw_infoleiste_stats .siw_stat {
  background: rgba(255, 255, 255, .12);
  min-width: 4.6rem;
}
.siw_infoleiste_stats .siw_stat span { color: #c3d2c7; }
html[data-theme="dark"] .siw_infoleiste_stats .siw_stat { background: rgba(255, 255, 255, .08); }
.siw_infoleiste_nachfrage {
  display: flex;
  gap: .5rem;
  flex: none;
}
.siw_infoleiste_nachfrage .siw_balken_zeile {
  grid-template-columns: 3.6rem 4.4rem;
  font-size: .72rem;
  color: #dfe8e0;
}
.siw_infoleiste_nachfrage .siw_balken { background: rgba(255, 255, 255, .2); }
.siw_infoleiste_aktionen {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.siw_zeit_anzeige {
  display: flex;
  gap: .55rem;
  font-size: .76rem;
  color: #e2ebe4;
  white-space: nowrap;
}
.siw_tempo_gruppe {
  display: flex;
  gap: .12rem;
  padding: .15rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .siw_tempo_gruppe { background: rgba(255, 255, 255, .08); }
.siw_tempo_knopf {
  min-width: 34px;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #e7efe8;
  font-size: .72rem;
  letter-spacing: -.02em;
  cursor: pointer;
}
.siw_tempo_knopf:hover { background: rgba(255, 255, 255, .2); }
.siw_tempo_knopf[aria-pressed="true"] {
  background: #2e7d32;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(143, 208, 143, .5) inset;
}
.siw_infoleiste_aktionen .siw_knopf_haupt {
  background: #2e7d32;
  border-color: #2e7d32;
  white-space: nowrap;
}
.siw_infoleiste_aktionen .siw_knopf_haupt:hover { background: #388e3c; }

/* ---------- Unteres Baumenü ---------- */
.siw_baumenu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: .4rem;
  padding: .45rem .6rem .6rem;
  background: linear-gradient(to top, rgba(16, 24, 20, .95) 60%, rgba(16, 24, 20, 0));
}
.siw_kat_karte {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  width: 5.6rem;
  min-height: 4.1rem;
  padding: .3rem .2rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  color: #f2f6f2;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.siw_kat_karte:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.siw_kat_karte[aria-expanded="true"] {
  background: #2e7d32;
  border-color: #8fd08f;
  box-shadow: 0 0 0 2px rgba(143, 208, 143, .45);
}
.siw_kat_symbol { font-size: 1.35rem; line-height: 1.1; }
.siw_kat_name { font-size: .74rem; font-weight: 700; }
html[data-theme="dark"] .siw_kat_karte { background: rgba(255, 255, 255, .1); }

/* Das Karten-Feld: der Inhalt der gewählten Kategorie */
.siw_kartenfeld {
  position: absolute;
  left: 50%;
  bottom: 5.4rem;
  transform: translateX(-50%);
  z-index: 7;
  width: min(54rem, calc(100vw - 22rem));
  max-height: min(28rem, calc(100dvh - 12rem));
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .96);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.siw_kartenfeld[hidden] { display: none; }
html[data-theme="dark"] .siw_kartenfeld { background: rgba(24, 28, 26, .97); color: #e7eee8; }
.siw_kartenfeld_kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .45rem .7rem;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  font-size: .95rem;
}
html[data-theme="dark"] .siw_kartenfeld_kopf { border-bottom-color: rgba(255, 255, 255, .12); }
.siw_kartenfeld_knopf {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
}
.siw_kartenfeld_knopf:hover { background: rgba(0, 0, 0, .1); }
.siw_kartenfeld_inhalt {
  padding: .7rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.siw_kat_teil { display: flex; flex-direction: column; gap: .55rem; }
.siw_kat_teil[hidden] { display: none; }

/* Sondergebäude: Reiter und Karten */
.siw_gebaeude_reiter {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.siw_gebaeude_reiter button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 36px;
  padding: .25rem .6rem;
  border: 1px solid #c7d3c9;
  border-radius: 999px;
  background: #fff;
  color: #23301f;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
html[data-theme="dark"] .siw_gebaeude_reiter button { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
.siw_gebaeude_reiter button[aria-pressed="true"] {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.siw_gebaeude_liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .4rem;
}
.siw_gebaeude_karte {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .45rem .55rem;
  border: 1px solid #c7d3c9;
  border-radius: 11px;
  background: #fff;
  color: #23301f;
  text-align: left;
  cursor: pointer;
}
html[data-theme="dark"] .siw_gebaeude_karte { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
.siw_gebaeude_karte:hover { border-color: #2e7d32; }
.siw_gebaeude_karte b { font-size: .86rem; display: flex; align-items: center; gap: .3rem; }
.siw_gebaeude_karte span { font-size: .74rem; color: #5c6b73; }
html[data-theme="dark"] .siw_gebaeude_karte span { color: #a9b6bd; }
.siw_gebaeude_karte .siw_gebaeude_bald {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #a85a0d;
  font-weight: 700;
}

/* Die Bau-Ebene: Tunnel, erhöhte Straße, normal */
.siw_bauebene_liste {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .35rem;
}
.siw_bauebene_knopf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  min-height: 52px;
  padding: .3rem .4rem;
  border: 1px solid #c7d3c9;
  border-radius: 11px;
  background: #fff;
  color: #23301f;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
html[data-theme="dark"] .siw_bauebene_knopf { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
.siw_bauebene_knopf:hover { border-color: #2e7d32; }
.siw_bauebene_knopf span:first-child { font-size: 1.2rem; line-height: 1.1; }
.siw_bauebene_knopf.siw_bauebene_aktiv {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

/* Das Gelände formen: vier Pinsel */
.siw_gelaende_liste {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .35rem;
}
.siw_gelaende_knopf {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 42px;
  padding: .35rem .6rem;
  border: 1px solid #c7d3c9;
  border-radius: 11px;
  background: #fff;
  color: #23301f;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
html[data-theme="dark"] .siw_gelaende_knopf { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
.siw_gelaende_knopf:hover { border-color: #2e7d32; }
.siw_gelaende_knopf.siw_gelaende_aktiv {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

/* Stadt-Kacheln und Auftrag */
.siw_stadt_raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .8rem;
}
.siw_stadt_block { display: flex; flex-direction: column; gap: .35rem; }
.siw_stadt_ebene { font-size: .84rem; line-height: 1.4; }
.siw_aufgabe { font-size: .84rem; line-height: 1.45; }
.siw_aufgabe ul { margin: .2rem 0; padding-left: 1.1rem; }
.siw_aufgabe li { margin: .15rem 0; }
.siw_aufgabe .siw_aufgabe_fertig { color: #2e7d32; font-weight: 700; }
html[data-theme="dark"] .siw_aufgabe .siw_aufgabe_fertig { color: #8fd08f; }
.siw_aufgabe .siw_aufgabe_offen { color: #a85a0d; font-weight: 600; }

/* ---------- Übungsebenen (Startmenü) ---------- */
.siw_start_ebenen_titel {
  margin: .6rem 0 .35rem;
  font-size: .82rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #4c6154;
}
html[data-theme="dark"] .siw_start_ebenen_titel { color: #a9b6bd; }
.siw_ebenen_liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: .45rem;
  margin-bottom: .8rem;
}
.siw_ebene_karte {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .5rem .6rem;
  border: 1px solid #c7d3c9;
  border-radius: 12px;
  background: #fff;
  color: #23301f;
  text-align: left;
  cursor: pointer;
  min-height: 5.2rem;
}
.siw_ebene_karte:hover:not(:disabled) { border-color: #2e7d32; background: #f3f8f0; }
.siw_ebene_karte:disabled { opacity: .5; cursor: default; }
html[data-theme="dark"] .siw_ebene_karte { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
html[data-theme="dark"] .siw_ebene_karte:hover:not(:disabled) { background: #2c342f; }
.siw_ebene_karte b { font-size: .88rem; display: flex; align-items: center; gap: .35rem; }
.siw_ebene_nummer {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
}
.siw_ebene_karte span { font-size: .74rem; color: #5c6b73; line-height: 1.3; }
html[data-theme="dark"] .siw_ebene_karte span { color: #a9b6bd; }
.siw_ebene_status {
  margin-top: auto;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: #2e7d32;
}
.siw_ebene_status.siw_ebene_status_gesperrt { color: #a85a0d; }

/* Werkzeug-Knoepfe */
.siw_wkz_liste { display: flex; flex-wrap: wrap; gap: .35rem; }
.siw_wkz {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 40px;
  padding: .35rem .6rem;
  border: 1px solid #c7d3c9;
  border-radius: 10px;
  background: #f4f8f2;
  color: #23301f;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
.siw_wkz svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.siw_wkz:hover { background: #e6f2df; }
.siw_wkz_aktiv {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
html[data-theme="dark"] .siw_wkz {
  background: #23282a;
  border-color: #3d4a41;
  color: #dfe7e2;
}
html[data-theme="dark"] .siw_wkz:hover { background: #2c342f; }
html[data-theme="dark"] .siw_wkz_aktiv { background: #3f9142; border-color: #3f9142; color: #fff; }

/* Strassentypen */
.siw_spuren { display:grid; gap:.3rem; font-size:.85rem; }
.siw_spuren select { width:100%; min-width:0; min-height:40px; border:1px solid #a7b5aa; border-radius:8px; padding:.3rem .6rem; background:var(--bg-color,#fff); color:inherit; }
html[data-theme="dark"] .siw_spuren select { background:#23282a; color:#eee; border-color:#66766a; }
.siw_str_liste { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.siw_str {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  min-width: 0;
  min-height: 40px;
  padding: .3rem .5rem;
  border: 1px solid #c7d3c9;
  border-radius: 9px;
  background: #fff;
  color: #23301f;
  cursor: pointer;
  text-align: left;
}
.siw_str b {
  font-size: .82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.siw_str span {
  flex: none;
  min-width: 1.5rem;
  padding: .05rem .3rem;
  border-radius: 6px;
  background: #e8efe4;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}
.siw_str:hover { border-color: #2e7d32; }
.siw_str_aktiv { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.siw_str_aktiv span { background: rgba(255, 255, 255, .25); }
html[data-theme="dark"] .siw_str { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
html[data-theme="dark"] .siw_str span { background: #313a35; }
html[data-theme="dark"] .siw_str_aktiv { background: #3f9142; border-color: #3f9142; color: #fff; }

/* Dichte-Wahl (1-4) */
.siw_dichte_liste { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.siw_dichte {
  min-height: 44px;
  border: 1px solid #c7d3c9;
  border-radius: 9px;
  background: #fff;
  color: #23301f;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.15;
  padding: .25rem .1rem;
}
.siw_dichte:hover { border-color: #2e7d32; }
.siw_dichte_aktiv { background: #2e7d32; border-color: #2e7d32; color: #fff; }
html[data-theme="dark"] .siw_dichte { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
html[data-theme="dark"] .siw_dichte_aktiv { background: #3f9142; border-color: #3f9142; color: #fff; }
#siw_dichte_text { margin: .2rem 0 0; line-height: 1.3; }

/* Einrasten-Schalter */
.siw_snap_knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  min-height: 40px;
  margin-top: .35rem;
  padding: .35rem .5rem;
  border: 1px solid #c7d3c9;
  border-radius: 10px;
  background: #f4f8f2;
  color: #23301f;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
}
.siw_snap_knopf:hover { background: #e6f2df; }
.siw_snap_knopf.siw_wkz_aktiv {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
html[data-theme="dark"] .siw_snap_knopf {
  background: #23282a;
  border-color: #3d4a41;
  color: #dfe7e2;
}
html[data-theme="dark"] .siw_snap_knopf.siw_wkz_aktiv {
  background: #3f9142;
  border-color: #3f9142;
  color: #fff;
}

/* Zonen */
.siw_zn_liste { display: flex; flex-direction: column; gap: .3rem; }
.siw_zn {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 40px;
  padding: .35rem .5rem;
  border: 1px solid #c7d3c9;
  border-radius: 9px;
  background: #fff;
  color: #23301f;
  font-size: .88rem;
  cursor: pointer;
  text-align: left;
}
.siw_zn i {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.siw_zn:hover { border-color: #2e7d32; }
.siw_zn_aktiv { border-color: #2e7d32; box-shadow: 0 0 0 2px rgba(46, 125, 50, .35); }
html[data-theme="dark"] .siw_zn { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }

/* Schalter */
.siw_schalter { display: flex; flex-wrap: wrap; gap: .3rem; }
.siw_schalter label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 34px;
  padding: .2rem .5rem;
  border: 1px solid #c7d3c9;
  border-radius: 999px;
  background: #fff;
  font-size: .82rem;
  cursor: pointer;
}
.siw_schalter input { width: 16px; height: 16px; accent-color: #2e7d32; }
.siw_schalter_gesperrt { opacity: .45; text-decoration: line-through; }
html[data-theme="dark"] .siw_schalter label { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }

/* Anzeige */
.siw_stat_zeile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
}
.siw_stat {
  background: #eef4ea;
  border-radius: 9px;
  padding: .35rem .5rem;
  display: flex;
  flex-direction: column;
}
.siw_stat span { font-size: .7rem; color: #5c6b73; text-transform: uppercase; letter-spacing: .06em; }
.siw_stat strong { font-size: 1.02rem; }
.siw_minus { color: #b3261e; }
html[data-theme="dark"] .siw_stat { background: #23282a; }
html[data-theme="dark"] .siw_stat span { color: #a9b6bd; }

.siw_balken_liste { display: flex; flex-direction: column; gap: .25rem; }
.siw_balken_zeile {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
}
.siw_balken {
  height: .55rem;
  border-radius: 999px;
  background: #dfe7dc;
  overflow: hidden;
}
.siw_balken i {
  display: block;
  height: 100%;
  background: #4d9b4e;
  transition: width .3s ease;
}
.siw_balken_blau i { background: #3f8fd0; }
.siw_balken_orange i { background: #dbc13f; }
html[data-theme="dark"] .siw_balken { background: #2c342f; }

.siw_hausinfo {position:absolute;z-index:12;right:10px;top:calc(var(--siw-hud-bottom,70px) + 12px);box-sizing:border-box;width:300px;max-width:calc(100% - 20px);max-height:calc(100% - var(--siw-hud-bottom,70px) - 155px);overflow:auto;padding:12px;border:1px solid #6e8271;border-radius:9px;background:#edf2e8;color:#23301f;box-shadow:0 4px 18px #0005;font-size:.84rem}
.siw_hausinfo[hidden] {display:none}
.siw_hausinfo_kopf {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.siw_hausinfo_kopf button {min-height:34px;border:1px solid #899d88;border-radius:5px;background:#d7e2d2;color:inherit;cursor:pointer;padding:4px 7px}
.siw_hausinfo dl {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;margin:0}
.siw_hausinfo dd {margin:0;text-align:right;font-weight:600}
.siw_hausinfo p {margin:8px 0 0}
html[data-theme=dark] .siw_hausinfo {background:#202b24;color:#edf2e8;border-color:#738b78}
html[data-theme=dark] .siw_hausinfo_kopf button {background:#354838}
@media(max-width:560px){.siw_hausinfo {top:auto;bottom:145px;max-height:calc(100% - var(--siw-hud-bottom,180px) - 165px);width:280px}}
.siw_info { font-size: .86rem; }
.siw_baumodi { display:flex;gap:.35rem; }
.siw_baumodi button { flex:1;min-height:40px; }
.siw_baumodi [aria-pressed="true"] { background:#a85a0d;color:white;border-color:#ffb347; }
html[data-theme="dark"] .siw_baumodi [aria-pressed="true"] { background:#a85a0d;color:white;border-color:#ffb347; }
.siw_bauhilfe { position:absolute;inset:0;pointer-events:none; }
.siw_info h3 { margin: 0 0 .3rem; font-size: .95rem; }
.siw_info p { margin: .2rem 0; }
.siw_liste { margin: .2rem 0; padding-left: 1.1rem; }
.siw_liste li { margin: .1rem 0; }
.siw_klein { font-size: .78rem; color: #5c6b73; }
html[data-theme="dark"] .siw_klein { color: #a9b6bd; }

.siw_aktionen { display: flex; flex-direction: column; gap: .35rem; margin-top: .2rem; }
.siw_knopf_reihe { display: flex; gap: .3rem; }
.siw_knopf_reihe .siw_knopf { flex: 1; }
.siw_knopf {
  min-height: 40px;
  padding: .35rem .6rem;
  border: 1px solid #c7d3c9;
  border-radius: 10px;
  background: #fff;
  color: #23301f;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.siw_knopf:hover { background: #eef4ea; }
.siw_knopf:disabled { opacity: .45; cursor: default; }
.siw_knopf_haupt {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.siw_knopf_haupt:hover { background: #388e3c; }
html[data-theme="dark"] .siw_knopf { background: #23282a; border-color: #3d4a41; color: #dfe7e2; }
html[data-theme="dark"] .siw_knopf_haupt { background: #3f9142; border-color: #3f9142; color: #fff; }

/* Kamera-Knoepfe: links neben der Karte, ueber dem Baumenue */
.siw_kamera {
  position: absolute;
  left: .7rem;
  bottom: 5.4rem;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 40px);
  gap: .25rem;
}
.siw_kamera button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .88);
  color: #23301f;
  font-size: 1rem;
  cursor: pointer;
}
.siw_kamera button:hover { background: #fff; }
html[data-theme="dark"] .siw_kamera button {
  background: rgba(26, 26, 26, .88);
  color: #eee;
  border-color: rgba(255, 255, 255, .16);
}

/* Ton-Schalter */
.siw_ton {
  position: absolute;
  right: .7rem;
  bottom: 5.4rem;
  z-index: 6;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  font-size: 1.05rem;
  cursor: pointer;
}
html[data-theme="dark"] .siw_ton {
  background: rgba(26, 26, 26, .9);
  border-color: rgba(255, 255, 255, .16);
}

/* Meldung: direkt unter der Stadtinfo-Leiste, damit sie nichts verdeckt. */
.siw_meldung {
  position: absolute;
  left: 50%;
  top: 4.4rem;
  transform: translate(-50%, -10px);
  z-index: 9;
  max-width: min(34rem, 70vw);
  padding: .5rem .9rem;
  border-radius: 999px;
  background: rgba(20, 28, 22, .92);
  color: #fff;
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.siw_meldung.siw_sichtbar { opacity: 1; transform: translate(-50%, 0); }
/* ---------- Startmenü ---------- */
.siw_start {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 50% 35%, #2f4a3a 0%, #16241d 55%, #0d1512 100%);
  transition: opacity .35s ease;
}
.siw_start_weg { opacity: 0; pointer-events: none; }
.siw_start_karte {
  width: min(34rem, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, .97);
  border-radius: 20px;
  padding: 1.4rem;
  text-align: center;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
}
.siw_start_karte h2 { margin: .4rem 0 .2rem; font-size: 1.6rem; color: #23402c; }
.siw_start_unter { margin: 0 0 1rem; color: #4c6154; }
.siw_start_knoepfe { display: flex; flex-direction: column; gap: .45rem; }
.siw_start_knopf {
  min-height: 46px;
  padding: .5rem .9rem;
  border: 1px solid #c7d3c9;
  border-radius: 12px;
  background: #fff;
  color: #23301f;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.siw_start_knopf:hover { background: #eef4ea; }
.siw_start_knopf:disabled { opacity: .45; cursor: default; }
.siw_start_knopf_haupt { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.siw_start_knopf_haupt:hover { background: #388e3c; }
.siw_start_lehrsatz {
  margin: 1rem 0 .3rem;
  padding: .6rem .8rem;
  border-radius: 12px;
  background: #eaf3e6;
  color: #2c4a30;
  font-size: .92rem;
  text-align: left;
}
.siw_start_hinweis { margin: 0; font-size: .82rem; color: #5c6b73; text-align: left; }

/* ---------- Modale ---------- */
.siw_modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 14, 10, .68);
}
.siw_modal_offen { display: none; }
.siw_modal_karte {
  width: min(38rem, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 1.3rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
}
.siw_modal_karte h2 { margin: 0 0 .7rem; color: #23402c; }
.siw_modal_karte p { margin: .5rem 0; line-height: 1.5; }
.siw_modal_karte .siw_start_knopf { margin-top: 1rem; width: 100%; }
html[data-theme="dark"] .siw_start_karte,
html[data-theme="dark"] .siw_modal_karte {
  background: #1e2420;
  color: #e7eee8;
}
html[data-theme="dark"] .siw_start_karte h2,
html[data-theme="dark"] .siw_modal_karte h2 { color: #b8e0b8; }
html[data-theme="dark"] .siw_start_lehrsatz { background: #26332a; color: #d7ead6; }
html[data-theme="dark"] .siw_start_unter,
html[data-theme="dark"] .siw_start_hinweis { color: #a9b6bd; }
html[data-theme="dark"] .siw_start_knopf {
  background: #262d29;
  border-color: #3d4a41;
  color: #e7eee8;
}

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 900px) {
  .siw_haupt { height: calc(100dvh - 56px); }

  /* Die Stadtinfo-Leiste wird zweizeilig: oben die Aufgabe, darunter die Werte. */
  .siw_infoleiste {
    flex-wrap: wrap;
    gap: .35rem .6rem;
    padding: .35rem .5rem;
  }
  .siw_infoleiste_ebene { flex: 1 1 100%; }
  .siw_infoleiste_stats { flex: 1 1 100%; overflow-x: auto; }
  .siw_infoleiste_stats .siw_stat { min-width: 4.2rem; }
  .siw_infoleiste_nachfrage { display: none; }
  .siw_infoleiste_aktionen { margin-left: 0; }

  /* Die Info ist eine Schublade rechts oben. */
  .siw_panel {
    position: absolute;
    width: auto;
    max-width: none;
    left: auto;
    right: 0;
    top: 4.4rem;
    bottom: auto;
    max-height: 46vh;
    padding: .5rem;
    max-width: 62vw;
  }
  .siw_panel_klappe { display:block; width:100%; min-height:42px; margin-bottom:.35rem; }
  .siw_panel .siw_panel_inhalt { display:none; }
  .siw_panel.siw_panel_geoeffnet .siw_panel_inhalt { display:flex; }
  .siw_stat_zeile { grid-template-columns: repeat(4, 1fr); flex: 1 1 100%; }

  /* Das Baumenue waechst nach rechts, das Karten-Feld liegt darueber. */
  .siw_baumenu { justify-content: flex-start; overflow-x: auto; }
  .siw_kat_karte { width: 4.7rem; min-height: 3.9rem; }
  .siw_kartenfeld {
    width: calc(100vw - 1rem);
    bottom: 5.1rem;
    max-height: 46vh;
  }
  .siw_kamera { left: .5rem; bottom: 9.6rem; grid-template-columns: repeat(4, 34px); }
  .siw_kamera button { width: 34px; height: 34px; font-size: .9rem; }
  .siw_ton { top: auto; bottom: 9.6rem; right: .5rem; }
  .siw_meldung { bottom: auto; top: 5.6rem; max-width: 88vw; }
  .siw_ebenen_liste { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .siw_marke h1 { font-size: .95rem; }
  .siw_str_liste { grid-template-columns: 1fr 1fr; }
  .siw_gebaeude_liste { grid-template-columns: 1fr 1fr; }
  .siw_infoleiste_ebene_text strong { font-size: .85rem; }
}

/* Fünf Ebenen bleiben auch am Handy als feste Schaltflächen erreichbar. */
.siw_bauebene_liste {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;}
.siw_bauebene_knopf {min-width:0;min-height:52px;padding:6px 3px;font-size:.72rem;}

/* Straßenbau: zuerst die kleine Werkzeugauswahl, Details nur bei Bedarf. */
.siw_icon {width:24px;height:24px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;}
.siw_kat_symbol .siw_icon {width:30px;height:30px;}
.siw_baukompakt {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.siw_baukompakt .siw_bauebene_liste {flex:1;min-width:220px;}
.siw_baukompakt p {margin:0;white-space:nowrap;}
.siw_bauebene_knopf {display:flex;align-items:center;justify-content:center;gap:4px;min-height:38px;}
.siw_bauebene_knopf .siw_icon {width:18px;height:18px;}
.siw_strassen_gruppen {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.siw_strassen_gruppen button {display:flex;align-items:center;justify-content:center;gap:5px;
  min-width:0;min-height:40px;border:1px solid #84948a;border-radius:8px;background:transparent;color:inherit;cursor:pointer;}
.siw_strassen_gruppen button[aria-pressed="true"] {background:#2e7d32;color:white;border-color:#2e7d32;}
.siw_str_liste {grid-template-columns:repeat(auto-fit,minmax(105px,1fr));}
.siw_str {display:flex;align-items:center;gap:8px;justify-content:flex-start;min-height:48px;}
.siw_str b {font-size:.82rem;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.2;}
.siw_baumodi {display:flex;gap:6px;}
.siw_baumodi button {display:flex;align-items:center;justify-content:center;gap:6px;flex:1;min-height:38px;}
.siw_baumodi button[aria-pressed="true"],
html[data-theme="dark"] .siw_baumodi button[aria-pressed="true"],
html[data-theme="dark"] .siw_bauebene_knopf.siw_bauebene_aktiv {background:#2e7d32;border-color:#2e7d32;color:#fff;}
.siw_optionen {border:1px solid #84948a;border-radius:8px;padding:8px 10px;}
.siw_optionen summary {cursor:pointer;font-weight:650;min-height:30px;line-height:30px;}
.siw_optionen[open] {display:flex;flex-direction:column;gap:10px;}
.siw_tram_spuren {display:flex;flex-direction:column;gap:7px;}
.siw_spurwahl {display:flex;align-items:center;gap:12px;justify-content:space-between;min-height:38px;}
.siw_spurwahl select {min-width:0;max-width:68%;min-height:38px;border-radius:6px;
  border:1px solid #84948a;background:var(--bg-card,#fff);color:inherit;padding:4px 8px;}
.siw_gleis_aktionen {display:flex;gap:6px;flex-wrap:wrap;}
.siw_gleis_aktionen button {flex:1;font-size:.8rem;}
.siw_shortcuts {margin:2px 0;font-size:.74rem;opacity:.85;}
html[data-theme="dark"] .siw_spurwahl select {background:#25302b;}
@media(max-width:560px) {
  .siw_strassen_gruppen button {flex-direction:column;font-size:.72rem;gap:2px;padding:5px 2px;}
  .siw_str_liste {grid-template-columns:repeat(2,minmax(0,1fr));}
  .siw_str {min-width:0;padding:6px;}
  .siw_baukompakt {gap:5px;}
  .siw_spurwahl {gap:5px;}
}

/* Hauptmenü mittig, Straßenvarianten in einer breiten Leiste darüber. */
.siw_baumenu {left:50%;right:auto;bottom:8px;transform:translateX(-50%);width:max-content;padding:5px;gap:4px;border-radius:12px;background:rgba(20,30,25,.94);overflow:visible}
.siw_kat_karte {width:62px;min-height:48px;height:48px;padding:3px;border-radius:8px}
.siw_kat_symbol .siw_icon {width:23px;height:23px}
.siw_kat_name {font-size:.65rem}
.siw_kartenfeld {left:50%;bottom:76px;transform:translateX(-50%);width:min(980px,calc(100vw - 32px));max-height:min(340px,calc(100dvh - 190px));border-radius:12px}
.siw_kartenfeld_kopf {padding:3px 10px;font-size:.8rem}
.siw_kartenfeld_knopf {width:30px;height:30px;min-height:30px}
.siw_kartenfeld_inhalt {padding:6px 10px;gap:5px}
.siw_kat_teil {gap:5px}
.siw_strassen_gruppen {display:flex;gap:4px;overflow-x:auto;flex-shrink:0;padding-bottom:2px}
.siw_strassen_gruppen button {flex:0 0 auto;min-height:32px;padding:4px 10px;flex-direction:row;font-size:.78rem;gap:5px}
.siw_strassen_gruppen .siw_icon {width:19px;height:19px}
.siw_str_liste {display:flex;gap:6px;overflow-x:auto;overflow-y:hidden;padding:2px 0 6px;scroll-snap-type:x proximity;flex-shrink:0}
.siw_str {display:grid;grid-template-columns:1fr;grid-template-rows:42px auto auto auto;justify-items:center;align-content:start;flex:0 0 132px;min-width:132px;min-height:98px;height:auto;padding:4px 6px;gap:2px;border-radius:7px;scroll-snap-align:start}
.siw_str .siw_icon {width:38px;height:38px}
.siw_str_vorschau {display:block;width:96px;height:42px}
.siw_str b {display:block;font-size:.74rem;line-height:1.2;white-space:normal;text-align:center;max-width:100%;overflow:visible;text-overflow:clip}
.siw_str .siw_variant_spuren {font-size:.66rem;line-height:1.2;white-space:nowrap;font-weight:600;max-width:100%;background:transparent}
.siw_str small {font-size:.66rem;line-height:1.2;opacity:.85}
.siw_strassen_auswahl {margin:0;font-size:.72rem;font-weight:700;color:#2e7d32}
html[data-theme=dark] .siw_strassen_auswahl {color:#9ada9c}
.siw_shortcuts {display:none}

/* Unabhängige kleine Bauwerkzeuge links unten. */
.siw_bauwerkzeuge {position:absolute;z-index:8;left:8px;bottom:12px;display:flex;align-items:center;gap:5px;padding:5px;border-radius:10px;background:rgba(20,30,25,.94);color:#f2f6f2}
.siw_baukompakt {display:flex;gap:0;flex-wrap:nowrap;min-width:0}
.siw_baukompakt .siw_bauebene_liste {flex:none;min-width:0}
.siw_bauebene_liste {display:flex;gap:3px}
.siw_bauebene_knopf {flex-direction:column;gap:0;width:30px;min-height:34px;height:34px;padding:1px;border:1px solid #78877c;border-radius:6px;background:transparent;color:inherit;font-size:.58rem;cursor:pointer}
.siw_bauebene_knopf .siw_icon {width:17px;height:17px}
.siw_bauebene_aktiv {background:#2e7d32;border-color:#9cdb9d}
.siw_baukompakt p {position:absolute;left:5px;bottom:48px;margin:0;font-size:.65rem;padding:2px 5px;border-radius:4px;background:rgba(20,30,25,.94);color:#f2f6f2;white-space:nowrap}
.siw_baukompakt p > span {display:none}
.siw_baumodi {gap:3px}
.siw_baumodi button {flex:none;min-height:34px;width:30px;padding:3px;border-radius:6px;background:transparent;color:inherit}
.siw_baumodi .siw_icon {width:21px;height:21px}
.siw_baumodi span,.siw_bauwerkzeuge summary > span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.siw_bauwerkzeuge .siw_optionen,.siw_bauwerkzeuge .siw_optionen[open] {display:block;border:0;padding:0;border-radius:0;background:transparent}
.siw_bauwerkzeuge summary {display:flex;align-items:center;justify-content:center;list-style:none;width:30px;height:34px;min-height:34px;padding:0;border:1px solid #78877c;border-radius:6px;cursor:pointer}
.siw_bauwerkzeuge summary::-webkit-details-marker {display:none}
.siw_bauwerkzeuge summary .siw_icon {width:21px;height:21px}
.siw_bauwerkzeuge details[open] > summary {background:#2e7d32;border-color:#9cdb9d}
.siw_bauwerkzeuge details:not([open]) > .siw_baupopover {display:none}
.siw_baupopover {position:absolute;bottom:52px;left:0;box-sizing:border-box;width:290px;max-width:calc(100vw - 16px);max-height:min(360px,calc(100dvh - 210px));overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:9px;border-radius:10px;background:rgba(255,255,255,.97);color:#23301f;box-shadow:0 6px 24px #0006}
.siw_baupopover > strong {font-size:.8rem}
.siw_baupopover [hidden] {display:none!important}
html[data-theme=dark] .siw_baupopover {background:rgba(24,28,26,.98);color:#e7eee8}
.siw_bauwerkzeuge button:focus-visible,.siw_bauwerkzeuge summary:focus-visible {outline:2px solid #b9ecb9;outline-offset:2px}

/* Maus und Tastatur steuern die Desktop-Kamera. */
.siw_kamera {display:none}
@media(pointer:coarse) {
 .siw_kamera {display:grid;left:auto;right:8px;bottom:132px;grid-template-columns:repeat(4,34px)}
 body:has(#siw_kartenfeld:not([hidden])) .siw_kamera,body:has(.siw_bauwerkzeuge details[open]) .siw_kamera {display:none}
}
@media(max-width:1100px) {
 .siw_infoleiste_nachfrage {display:none}
 .siw_bauwerkzeuge {bottom:76px}
 .siw_kartenfeld {bottom:136px;width:calc(100vw - 16px);max-height:min(340px,calc(100dvh - 270px))}
 .siw_baupopover {max-height:min(330px,calc(100dvh - 280px))}
 .siw_kat_karte {width:56px}
}
@media(max-width:560px) {
 .siw_kartenfeld_inhalt {padding:5px 7px}
 .siw_strassen_gruppen button {padding:3px 7px;font-size:.72rem}
 .siw_str {flex-basis:126px;min-width:126px}
}

/* Erste öffentliche Gebäude und Bahnen teilen sich die breite Auswahl. */
.siw_bahn_liste {display:flex;gap:7px;overflow-x:auto;padding:3px 0 6px;flex-shrink:0}
/* Viele Gebäudekategorien: auf kleinen Geräten bleibt Platz für die Karten.
   Die Reiter lassen sich seitlich wischen, statt sechs Zeilen einzunehmen. */
@media(max-width:700px){
 .siw_gebaeude_reiter {flex-wrap:nowrap;overflow-x:auto;flex-shrink:0;padding-bottom:5px}
 .siw_gebaeude_reiter button {flex:0 0 auto;white-space:nowrap}
}
.siw_bahn_liste .siw_gebaeude_karte {flex:0 0 170px;min-width:170px;min-height:104px;align-items:center;text-align:center}
.siw_versorgung_tools {display:flex;flex-wrap:wrap;gap:6px}
.siw_versorgung_tools button[aria-pressed=true] {background:#2e7d32;color:white}
.siw_versorgung_tools select {max-width:100%;color:inherit;background:inherit}
@media(max-width:700px){
 .siw_baumenu {grid-template-columns:repeat(7,minmax(0,1fr))}
 .siw_kat_karte {min-width:0}
 .siw_versorgung_tools .siw_knopf {min-height:40px}
}
.siw_gebaeude_karte[aria-pressed=true] {background:#2e7d32;color:#fff;border-color:#7ec881}
html[data-theme=dark] .siw_gebaeude_karte[aria-pressed=true] {background:#2e7d32;color:#fff}
.siw_bahn_liste .siw_icon {width:32px;height:32px}
.siw_linien_tools {display:flex;gap:6px;flex-wrap:wrap;margin:4px 0}
.siw_linien_tools button,.siw_linie_entwurf button,.siw_linien_zeile button {min-height:32px;padding:4px 9px;font:inherit;border:1px solid #718078;border-radius:6px;cursor:pointer}
.siw_linie_entwurf {position:absolute;bottom:82px;left:50%;transform:translateX(-50%);z-index:25;display:flex;align-items:center;gap:6px;flex-wrap:wrap;width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;padding:7px 9px;background:#f2f6f1;color:#18241c;border:1px solid #718078;border-radius:9px;font-size:.78rem;box-shadow:0 3px 12px #0004}
.siw_linie_entwurf[hidden] {display:none}
body:has(#siw_linie_entwurf:not([hidden])) .siw_kamera {display:none}
.siw_linie_entwurf span {flex:1;min-width:150px}
.siw_linien_liste {display:grid;gap:4px;max-height:95px;overflow-y:auto;flex-shrink:0}
.siw_linien_liste:empty {display:none}
.siw_oepnv_hilfe {font-size:.74rem;flex-shrink:0}
.siw_oepnv_hilfe summary {cursor:pointer}
.siw_oepnv_hilfe:not([open])>p {display:none}
.siw_linien_zeile {display:flex;align-items:center;gap:4px;font-size:.76rem}
.siw_linien_zeile span {flex:1;padding:3px 7px;min-width:0}
html[data-theme="dark"] .siw_linie_entwurf {background:#18241c;color:#ecf4ed}
@media(max-width:700px){.siw_linie_entwurf {bottom:143px;width:calc(100% - 20px)}.siw_linie_entwurf span {flex-basis:100%}.siw_bahn_liste .siw_gebaeude_karte {min-height:78px}}
#siw_gebaeude_drehen {align-self:flex-start;min-height:32px;font-size:.75rem}
#siw_betrieb_status {margin:0}
@media(max-width:560px){
 .siw_baumenu {width:356px;max-width:calc(100vw - 16px);box-sizing:border-box}
 .siw_kat_karte {flex:1;min-width:0;width:auto}
 .siw_kat_name {font-size:.6rem}
}

/* Zonen: dieselbe breite Kategorien-/Variantenauswahl wie beim Straßenbau. */
.siw_zonen_werkzeuge {display:flex;align-items:center;gap:5px;flex-wrap:wrap;flex-shrink:0}
.siw_zonen_werkzeuge button {display:flex;align-items:center;gap:4px;min-height:34px;padding:4px 8px;border:1px solid #86988c;border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:.74rem;cursor:pointer}
.siw_zonen_werkzeuge button[aria-pressed=true] {background:#2e7d32;color:#fff;border-color:#83bd87}
.siw_zonen_werkzeuge .siw_icon {width:20px;height:20px}
.siw_zonen_werkzeuge label {display:flex;align-items:center;gap:4px;font-size:.72rem}
.siw_zonen_werkzeuge select {min-height:34px;background:transparent;color:inherit;border:1px solid #86988c;border-radius:6px;padding:3px}
html[data-theme=dark] .siw_zonen_werkzeuge select {background:#23282a}
.siw_zonen_gruppen {flex-direction:row;overflow-x:auto;flex-shrink:0;padding:2px 0 5px;gap:4px}
.siw_zonen_gruppen .siw_zn {flex:0 0 auto;min-height:34px;padding:4px 10px;font-size:.78rem;gap:6px}
.siw_zonen_gruppen .siw_zn i {width:14px;height:14px;border-radius:3px;flex-shrink:0}
.siw_dichte_liste {display:flex;gap:6px;overflow-x:auto;overflow-y:hidden;flex-shrink:0;padding:2px 0 6px;scroll-snap-type:x proximity}
.siw_dichte_liste .siw_dichte {display:flex;flex-direction:column;align-items:center;justify-content:center;flex:0 0 132px;min-width:132px;min-height:104px;padding:6px;gap:4px;scroll-snap-align:start;border-radius:7px}
.siw_dichte_liste .siw_dichte_aktiv,.siw_dichte_liste .siw_dichte_aktiv:hover {background:var(--zone-farbe);color:#fff;border-color:var(--zone-farbe);box-shadow:inset 0 0 0 2px #fff9}
html[data-theme="dark"] .siw_dichte_liste .siw_dichte_aktiv {background:var(--zone-farbe);border-color:var(--zone-farbe);color:#fff}
.siw_dichte_liste .siw_dichte_aktiv b,.siw_dichte_liste .siw_dichte_aktiv small {background:#15221de8;color:#fff;border-radius:3px;padding:2px 5px}
.siw_zonen_muster {display:flex;align-items:flex-end;justify-content:center;gap:4px;height:37px;width:96px;background:var(--zone-farbe);border-radius:4px;padding:3px;box-sizing:border-box}
.siw_zonen_muster i {display:block;width:13px;background:#fff;border:1px solid #23352d;border-bottom:0;border-radius:2px 2px 0 0}
.siw_dichte_liste b {font-size:.78rem;line-height:1.2}
.siw_dichte_liste small {font-size:.68rem;line-height:1.2}
#siw_dichte_text {font-size:.72rem;margin:0}
/* Baumenüs nutzen freien Platz. Nur der Katalog scrollt, Auswahl und Suche
   bleiben erreichbar; das Mausrad gelangt nicht zur Stadt-Kamera. */
.siw_kartenfeld {width:min(1260px,calc(100vw - 32px));max-height:min(470px,calc(100dvh - 205px));z-index:30}
.siw_kartenfeld_kopf {flex-shrink:0}
.siw_kartenfeld_inhalt {min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.siw_kartenfeld[data-kategorie="gebaeude"] .siw_kartenfeld_inhalt {overflow:hidden;display:flex}
.siw_kat_teil[data-kat="gebaeude"] {min-height:0;overflow:hidden}
.siw_gebaeude_reiter,.siw_gebaeude_suche,#siw_bildung_kurz,#siw_gebaeude_hinweis {flex-shrink:0}
.siw_gebaeude_liste {min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));padding:2px 3px 6px 0}
.siw_gebaeude_karte {min-height:112px;line-height:1.35;overflow-wrap:anywhere}
.siw_gebaeude_karte[aria-pressed="true"] span {color:inherit}
html[data-theme] body.siw_body .siw_gebaeude_karte span {color:#d1dbd6}
html[data-theme] body.siw_body #main-content .siw_dichte:disabled {opacity:.8}
.siw_gebaeude_suche {display:flex;align-items:center;gap:12px;font-size:.8rem}
.siw_gebaeude_suche input {min-width:0;flex:1;max-width:420px;min-height:36px;border:1px solid #8b9c91;border-radius:6px;padding:5px 9px;color:inherit;background:transparent;font:inherit}
.siw_dichte:disabled {opacity:.62;cursor:not-allowed;border-style:dashed}
.siw_dichte:disabled .siw_zonen_muster {filter:grayscale(1)}
.siw_systemstatus {display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px}
.siw_systemstatus>div {border:1px solid #8b9c9170;border-radius:7px;padding:9px;font-size:.8rem}
.siw_systemstatus p {margin:5px 0 0;line-height:1.45}
.siw_netz_gruppe {flex-basis:100%;margin:4px 0;font-size:.8rem}
@media(max-width:700px){
 .siw_kartenfeld {max-height:min(440px,calc(100dvh - 280px));width:calc(100vw - 16px)}
 .siw_gebaeude_liste {grid-template-columns:repeat(2,minmax(0,1fr))}
 .siw_gebaeude_suche {gap:6px}.siw_gebaeude_suche span {max-width:90px}
 .siw_gebaeude_karte {padding:6px;min-height:120px}
 #siw_bildung_kurz,#siw_gebaeude_hinweis {font-size:.67rem;line-height:1.3;margin:0}
 .siw_systemstatus {grid-template-columns:1fr}
}
@media(max-width:560px){.siw_dichte_liste .siw_dichte{flex-basis:126px;min-width:126px}.siw_zonen_gruppen .siw_zn{padding:4px 7px;font-size:.72rem}}
/* Norden und Kartenbesitz bleiben auch bei geschlossenen Baumenüs erreichbar. */
.siw_kompass{position:fixed;right:18px;bottom:260px;z-index:21;width:56px;height:56px;border:1px solid #ffffff40;border-radius:50%;background:#0a1319dd;color:#fff;cursor:pointer}
#siw_kompass_rose{display:block;position:relative;width:100%;height:100%;transform-origin:50% 50%}
#siw_kompass_rose b{position:absolute;top:0;left:0;right:0;font-size:12px;color:#ff8c7e}
#siw_kompass_rose i{position:absolute;top:13px;left:0;right:0;color:#ff8c7e;font-style:normal;font-size:19px}
#siw_kompass_rose small{position:absolute;bottom:0;left:0;right:0;font-size:9px;color:#bec9cd}
.siw_kartenknopf{position:fixed;left:12px;top:calc(var(--siw-header-height,58px) + var(--siw-hud-bottom,72px) + 12px);z-index:21;max-width:190px;background:#0a1319e8!important}
.siw_land_dialog{width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;border:1px solid #ffffff35;border-radius:18px;padding:20px;background:#10191f;color:#f0f6f9;box-shadow:0 16px 70px #000b}
.siw_land_dialog::backdrop{background:#0008}
.siw_land_kopf{display:flex;align-items:center;justify-content:space-between;gap:12px}
.siw_land_kopf h2{margin:0;font-size:1.2rem}.siw_land_kopf button{min-width:40px}
.siw_land_dialog p{font-size:.88rem;line-height:1.5}.siw_land_nord{color:#bbc9d1;font-size:.78rem!important}
.siw_land_raster{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.siw_land_raster button{min-width:0;min-height:66px;padding:7px 3px;border-radius:8px;border:1px solid #ffffff29;background:#1a2932;color:#eef6fb;font:inherit;cursor:pointer}
.siw_land_raster button span{display:block;font-size:.68rem;margin-top:5px;overflow-wrap:anywhere}
.siw_land_raster button[data-besitz=true]{background:#244f3c;border-color:#80dfa5}
.siw_land_raster button[data-kaufbar=true]{background:#21465b;border-color:#61c4f5}
.siw_land_raster button:disabled{opacity:.65;cursor:default}
.siw_land_raster button:focus-visible{outline:3px solid #ffdd71;outline-offset:1px}
@media(max-width:600px){.siw_kartenknopf{font-size:.75rem!important;max-width:150px}.siw_kompass{right:12px;bottom:260px;width:48px;height:48px}.siw_land_dialog{padding:14px}.siw_land_raster button{min-height:60px}.siw_land_raster button span{font-size:.6rem}}
