/* Gestaltung wie Design Explorer und KI Lernlabor: Geist, Papier, Linien statt Flächen, ein Akzent. */
:root {
  --grund: #ffffff; --flaeche: #f2f2f2; --tinte: #171717; --leise: #75757d; --linie: #dededf; --akzent: #4649e1;
  --schrift: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grund: #171717; --flaeche: #262626; --tinte: #fff; --leise: #a3a3ab; --linie: #3a3a3e; --akzent: #9ea0f3; color-scheme: dark; }
}
:root[data-theme="dark"] { --grund: #171717; --flaeche: #262626; --tinte: #fff; --leise: #a3a3ab; --linie: #3a3a3e; --akzent: #9ea0f3; color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 400 16px/1.5 var(--schrift); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.label { font: 500 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
h1 { font-size: 22px; font-weight: 500; margin: 0; letter-spacing: -.01em; }

.kopf { position: sticky; top: 0; z-index: 20; background: var(--grund); border-bottom: 1px solid var(--linie); }
.kopf-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: 60px; padding: 8px 16px; }
.werkzeuge { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.knopf { font: 500 14px/1 var(--mono); color: var(--tinte); background: var(--grund); border: 1px solid var(--linie); border-radius: 0; min-width: 36px; height: 36px; padding: 0 10px; cursor: pointer; }
.knopf:hover { border-color: var(--akzent); }
.sprache { margin-left: 6px; white-space: nowrap; }
.sprache b { font-weight: 700; color: var(--akzent); }
.schalter { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; cursor: pointer; }
.schalter input { accent-color: var(--akzent); width: 16px; height: 16px; }

main { padding: 0 16px; }
.legende { font-size: 14px; margin: 12px 0; max-width: 70rem; }
.wand { position: relative; overflow: hidden; height: calc(100vh - 190px); min-height: 420px; border: 1px solid var(--linie); background: var(--flaeche); touch-action: none; cursor: default; }
.wand.greift { cursor: grab; }
.wand.zieht { cursor: grabbing; }
.wand-innen { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.wand-bild { position: absolute; left: 0; top: 0; display: block; background: #fff; cursor: zoom-in; user-select: none; -webkit-user-drag: none; will-change: transform; }
.wand-bild:hover, .wand-bild:focus-visible { outline: 2px solid var(--akzent); outline-offset: 0; z-index: 2; }
.info { margin: 8px 0; min-height: 16px; }
.fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 16px 16px; font-size: 13px; }

html.box-offen { overflow: hidden; }
.box { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem; background: rgba(0, 0, 0, .86); color: #fff; outline: none; }
.box figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.box .plan { width: min(84vh, 88vw); height: min(84vh, 88vw); background: #fff; }
.box .plan svg { width: 100%; height: 100%; display: block; }
.box .plan.ohne-strassen #strassen { display: none; }
.box figcaption { font-size: .95rem; text-align: center; display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: center; }
.box figcaption b { font-weight: 500; }
.box a { color: #fff; }
.box .leise { color: #c9c9ce; }
.pfeil, .zu { font: inherit; font-size: 2rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35); border-radius: 0; min-width: 2.75rem; min-height: 2.75rem; cursor: pointer; }
.pfeil:hover, .zu:hover { background: rgba(255, 255, 255, .25); }
.zu { position: absolute; right: 1rem; top: 1rem; }
@media (max-width: 40rem) { .box { flex-wrap: wrap; } .pfeil { order: 2; } .box figure { order: 1; width: 100%; } .werkzeuge { margin-left: 0; } }

/* Auswahl Anordnung/Land und Gruppen (21.11.2026) */
.wahl { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.wahl select { font: 400 13px/1.3 var(--mono); color: var(--tinte); background: var(--grund); border: 1px solid var(--linie); border-radius: 0; padding: 6px 8px; height: 36px; }
.wahl select:hover { border-color: var(--akzent); }
.wand-bild[hidden] { display: none; }
.wand-innen.gleitet .wand-bild { transition: transform .8s cubic-bezier(.3, .7, .2, 1); }
.wand-ebene { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.feld { position: absolute; border: 1px solid var(--linie); }
.feld.land { border-color: var(--leise); }
.schild { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tinte); text-align: center; }
.schild.land { font: 500 72px/1 var(--schrift); letter-spacing: -.01em; }
.schild.region { font: 500 34px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--leise); }
@media (max-width: 52rem) { .werkzeuge { flex-wrap: wrap; } }

/* Ebenen der Großansicht (ebenen.js, 23.11.2026) */
.box .ebenen-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; color: #fff; max-width: min(84vh, 88vw); }
.box .ebenen-leiste .schalter { margin-right: 0; }
.legende-nutzung { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; font-size: 13px; }
.legende-nutzung .eintrag { display: inline-flex; align-items: center; gap: 5px; }
.legende-nutzung i { width: 11px; height: 11px; display: inline-block; border: 1px solid rgba(255,255,255,.4); }
/* Legende Nutzung: Platz bleibt reserviert, damit das Bild beim Einschalten nicht springt (Reinhard 24.11.) */
.box .legende-nutzung { visibility: hidden; }
.box .ebenen-leiste:has(input[data-ebene="nutzung"]:checked) .legende-nutzung { visibility: visible; }
.plan #landnutzung, .plan #linien, .plan #nutzung, .plan #punkte, .plan #eingaenge { display: none; }
.plan.e-landnutzung #landnutzung, .plan.e-landnutzung #linien, .plan.e-nutzung #nutzung, .plan.e-punkte #punkte,
.plan.e-eingaenge #eingaenge { display: inline; }
.plan.e-nutzung #gebaeude { display: none; }
.plan .f { stroke: none; opacity: .22; }
.plan .f.wohnen { fill: #8a8a92; } .plan .f.handel { fill: #d1495b; } .plan .f.oeffentlich { fill: #2e86ab; }
.plan .f.religion { fill: #7b4fb5; } .plan .f.landwirtschaft { fill: #c9b458; } .plan .f.gewerbe { fill: #8d6e63; }
.plan .f.gruen { fill: #7fb069; } .plan .f.wald { fill: #3f7d3a; } .plan .f.wasser { fill: #5aa9e6; opacity: .35; }
.plan .f.fels { fill: #a39e93; } .plan .f.verkehr { fill: #9a9aa2; opacity: .18; } .plan .f.platz { fill: #e09f1f; } .plan .f.sonst { fill: #bbb; opacity: .15; }
.plan .l { fill: none; stroke-width: .7; } .plan .l.mauer { stroke: #8d6e63; } .plan .l.wasser { stroke: #3d8fd6; stroke-width: 1.2; }
.plan .g { stroke: none; }
.plan .g.wohnen { fill: #5b5b63; } .plan .g.handel { fill: #d1495b; } .plan .g.oeffentlich { fill: #2e86ab; }
.plan .g.religion { fill: #7b4fb5; } .plan .g.tourismus { fill: #e09f1f; } .plan .g.landwirtschaft { fill: #5f9a43; }
.plan .g.gewerbe { fill: #8d6e63; } .plan .g.leer { fill: #e0e0e0; stroke: #999; stroke-width: .3; } .plan .g.unbekannt { fill: #b5b5bb; }
.plan .g.flaeche { opacity: .5; }
.plan .p { stroke: #fff; stroke-width: .8; } .plan .p.handel { fill: #d1495b; } .plan .p.oeffentlich { fill: #2e86ab; }
.plan .p.religion { fill: #7b4fb5; } .plan .p.tourismus { fill: #e09f1f; } .plan .p.gruen { fill: #5f9a43; } .plan .p.geschichte { fill: #a0762d; } .plan .p.klein { fill: #8a8a92; stroke-width: .4; } .plan .p.unbekannt { fill: #555; }
.plan .e { fill: #000; stroke: #fff; stroke-width: .6; }

/* Einzelansicht (einzel.js, 23.11.2026) */
html.einzel-offen { overflow: hidden; }
.einzel { position: fixed; inset: 0; z-index: 60; background: var(--grund); overflow: auto; outline: none; }
.einzel-kopf { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; background: var(--grund); border-bottom: 1px solid var(--linie); }
.einzel-kopf h2 { margin: 0; font-size: 22px; font-weight: 500; }
.einzel-nav { margin-left: auto; display: flex; gap: 6px; }
.einzel-nav a.knopf { display: inline-flex; align-items: center; text-decoration: none; }
.einzel-inhalt { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; align-items: start; }
@media (max-width: 64rem) { .einzel-inhalt { grid-template-columns: 1fr; } }
.einzel-plan { background: #fff; border: 1px solid var(--linie); aspect-ratio: 1; max-height: calc(100vh - 110px); cursor: grab; touch-action: none; }
.einzel-plan svg { width: 100%; height: 100%; display: block; }
.einzel-plan:not(.e-hoehen) #hoehen, .einzel-plan:not(.e-strassen) #strassen, .einzel-plan:not(.e-gebaeude) #gebaeude { display: none; }
.einzel-plan #zent, .einzel-plan #anschluesse { display: none; }
.einzel-plan.e-graph #zent, .einzel-plan.e-zentralitaet #zent, .einzel-plan.e-graph #anschluesse { display: inline; }
.einzel-plan .seg { fill: none; stroke-width: 1.4px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.einzel-plan .seg:not(.wert) { stroke: #4a4a52; }
.einzel-plan .seg.wert { stroke-width: 3px; }
.einzel-plan .an { fill: none; stroke: #2e86ab; stroke-width: 1px; vector-effect: non-scaling-stroke; } .einzel-plan .an.vermutet { stroke-dasharray: 3 2; }
.einzel-plan .an.blockiert { stroke: #d1495b; } .einzel-plan .eg { fill: #2e86ab; } .einzel-plan .eg.blockiert { fill: #d1495b; }
.einzel-seite section { border-top: 1px solid var(--linie); padding: 10px 0 14px; }
.einzel-seite section:first-child { border-top: 0; padding-top: 0; }
.einzel-seite h3 { margin: 0 0 8px; }
.einzel-seite .schalter { display: flex; margin: 3px 0; }
.einzel-seite select { font: inherit; font-size: 14px; margin: 4px 8px 4px 0; }
.einzel-seite .klein { font-size: 13px; margin: 6px 0; }
.einzel-seite .hinweis { font-size: 13px; color: var(--akzent); }
.kenn { margin: 0; padding-left: 18px; }
.legende-nutzung.offen { display: flex; margin-top: 8px; }
.legende-nutzung.offen i { border-color: var(--linie); }
.skala { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 6px; }
.skala i { flex: 1; height: 10px; display: block; }
.heatmap-rahmen { overflow-x: auto; }
.einzel-unten { padding: 0 16px 24px; }
.einzel-unten section { border-top: 1px solid var(--linie); padding-top: 10px; }
.einzel-unten h3 { margin: 0 0 6px; }
.einzel-unten .klein { font-size: 13px; }
.einzel-unten select { font: inherit; font-size: 14px; }
.einzel-unten .hinweis { font-size: 13px; color: var(--akzent); }
.heatmap { width: 100%; min-width: 720px; max-width: 1400px; font-family: var(--mono); }
.heatmap text { font-size: 9px; fill: var(--tinte); text-anchor: middle; }
.heatmap text.zeile { text-anchor: end; font-family: var(--schrift); font-size: 10px; }
.heatmap text.kopf { font-family: var(--schrift); font-size: 10px; }
.heatmap text.r { fill: #171717; } .heatmap text.r.hell { fill: #fff; }
.heatmap .trenn { stroke: var(--linie); }
.box .einzel-knopf { margin-left: 8px; }

/* Seite Nachbau (23.11.2026) */
.zurueck { display: inline-flex; align-items: center; text-decoration: none; }
.nb { max-width: 84rem; margin: 0 auto; }
.nb-einleitung { max-width: 54rem; margin: 20px 0 8px; }
.nb-einleitung h2 { font-size: 18px; font-weight: 500; margin: 28px 0 8px; }
.nb-frage { font-size: 19px; line-height: 1.45; }
.nb-schritte li { margin-bottom: 6px; }
.nb-quellen li { margin-bottom: 4px; font-size: 14px; }
.nb-dorf { border-top: 1px solid var(--linie); padding: 20px 0 28px; }
.nb-dorf h2 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.nb-dorf h2 .leise { font-size: 15px; font-weight: 400; }
.nb-kopfzahl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 12px; }
.nb-gross { font: 500 34px/1 var(--mono); color: var(--tinte); }
.nb-paar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nb-paar figure { margin: 0; }
.nb-paar img, .nb-karte { width: 100%; height: auto; display: block; border: 1px solid var(--linie); background: #fff; aspect-ratio: 1; }
.nb-paar figcaption { margin-top: 4px; }
.nb-karte .grund { fill: #fff; }
.nb-karte .geb path { fill: #d4d4d6; }
.nb-karte .seg path { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.klein { font-size: 13px; }
.nb-auswertung { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; margin-top: 16px; }
.nb-auswertung h3 { margin: 0 0 6px; }
.nb-balken { width: 100%; height: auto; display: block; }
.nb-balken .nb-bt { font: 400 13px var(--schrift); fill: var(--tinte); text-anchor: end; }
.nb-balken .nb-bz { font: 500 12px var(--mono); fill: var(--tinte); }
.nb-balken .nb-spur { fill: var(--flaeche); }
.nb-balken .nb-wert { fill: var(--akzent); }
.nb-balken .nb-marke { stroke: var(--leise); stroke-dasharray: 3 3; }
.nb-balken .nb-mt { font: 400 11px var(--mono); fill: var(--leise); text-anchor: middle; }
.nb-liste { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.nb-liste li { margin-bottom: 6px; }
.nb-kommentar { max-width: 54rem; margin: 14px 0 6px; }
.nb-kommentar h3 { margin: 0 0 4px; }
.nb-kommentar p { margin: 0 0 8px; }
.nb-details { margin: 8px 0; }
.nb-details summary { cursor: pointer; }
.nb-tab { border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.nb-tab th, .nb-tab td { border-bottom: 1px solid var(--linie); padding: 3px 12px 3px 0; text-align: left; }
.nb-tab .z { font-family: var(--mono); text-align: right; }
@media (max-width: 52rem) { .nb-auswertung { grid-template-columns: 1fr; } }
@media (max-width: 34rem) { .nb-paar { grid-template-columns: 1fr; } }
.nb-tab td.eigen { font-weight: 700; color: var(--akzent); }

/* Lab-Leiste von entwurfsforschung.de (nav.ef-zurueck, 34 px, beim Veröffentlichen eingefügt): Überlagerungen darunter beginnen */
body:has(> .ef-zurueck) .einzel, body:has(> .ef-zurueck) .box { top: 35px; }

/* Parzellen aus dem Kataster (Reinhard 24.11.) */
.einzel-plan #parzellen { display: none; }
.einzel-plan.e-parzellen #parzellen { display: inline; }
#parzellen path { fill: none; stroke: #c07a2c; stroke-width: .5; vector-effect: non-scaling-stroke; }

/* Nachbau neben dem Original in der Einzelansicht (25.11.2026) */
.vergleich { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 200px; gap: 16px; align-items: start; margin-top: 8px; }
.vergleich figure { margin: 0; }
.vg-plan { background: #fff; border: 1px solid var(--linie); aspect-ratio: 1; cursor: grab; touch-action: none; }
.vg-plan svg { width: 100%; height: 100%; display: block; }
.vergleich:not(.v-hoehen) #hoehen, .vergleich:not(.v-strassen) #strassen, .vergleich:not(.v-gebaeude) #gebaeude, .vergleich:not(.v-parzellen) #parzellen { display: none; }
.vg-ebenen .schalter { display: flex; margin: 3px 0; }
.vg-ebenen h3 { margin: 0 0 8px; }
.vg-wert { margin: 6px 0; } .vg-gross { font-family: var(--mono); font-size: 28px; }
.vg-details { margin-top: 10px; }
@media (max-width: 52rem) { .vergleich { grid-template-columns: 1fr; } .vg-ebenen { order: -1; } }
