/* raumwechsel Basel - Plakat im Swiss Style.
   Schwarz, Weiss, Blau. Grotesk, linksbündig, grosse Zahlen, harte Kanten.
   Jede Farbe eine Aufgabe: Blau = öffentlicher Boden und Knöpfe. Leerstand = Schwarz am Tag, Weiss in der Nacht, als Quadrat oder Haus. */
:root {
  --weiss: #ffffff;
  --schwarz: #000000;
  --oeffentlich: #2f45ff;
  --blau: #2f45ff; /* Signalfarbe der Marke und Farbe des öffentlichen Bodens */
  --grau: #8a8a8a;
  --grau-fein: #e6e6e6;
  --flaeche: #f2f2f2; /* neutrales Hellgrau für Kästen, Etiketten und Zweitknöpfe */
  --schrift: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  /* Schwerer, schmaler Schnitt nur für «Basel»: Mac hat Helvetica Neue Condensed Black, sonst Arial Black */
  --schrift-basel: "HelveticaNeue-CondensedBlack", "Helvetica Neue Condensed Black", "Arial Narrow Bold", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --spalte: 380px;
  --schatten: var(--schwarz);
  --rand: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--schrift); color: var(--schwarz); background: var(--schwarz);
  display: grid; grid-template-columns: var(--spalte) 1fr; height: 100dvh; overflow: hidden;
  font-size: 15px; line-height: 1.3; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1;
}
a { color: inherit; text-underline-offset: 3px; }
button { font-family: inherit; }
em { font-style: normal; color: var(--blau); }

/* ---------- Intro-Plakat ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50; background: var(--weiss); color: var(--schwarz);
  overflow: auto; animation: rein .5s cubic-bezier(.2, .8, .2, 1);
}
.intro[hidden] { display: none; }
.intro.weg { animation: raus .45s cubic-bezier(.6, 0, .8, .2) forwards; }
@keyframes rein { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes raus { to { clip-path: inset(100% 0 0 0); } }
.intro-raster {
  min-height: 100%; display: grid; padding: clamp(20px, 4vw, 56px);
  grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr auto auto; column-gap: 16px; row-gap: 24px;
}
.intro-ort { grid-column: 1 / -1; margin: 0; font-size: clamp(.8rem, 1.2vw, 1rem); font-weight: 700; line-height: 1.25; }
.intro-titel { grid-column: 1 / -1; align-self: end; margin: 0; color: var(--schwarz); font-weight: 700; }
.intro-titel .klein { display: block; font-size: clamp(2.2rem, 6.5vw, 6rem); line-height: .9; letter-spacing: -.045em; margin-bottom: .08em; }
.intro-titel .basel {
  display: block; font-family: var(--schrift-basel); font-weight: 900; color: var(--schwarz);
  font-size: clamp(5rem, 33vw, 27rem); line-height: .78; letter-spacing: -.035em; text-transform: uppercase; margin-left: -.04em;
}
/* Der Punkt: ein Quadrat so gross wie der untere Balken des L (0.155 em), mit etwas Abstand */
.intro-titel em { display: inline-block; width: .155em; height: .155em; margin-left: .09em; background: var(--blau); overflow: hidden; text-indent: 1em; white-space: nowrap; vertical-align: baseline; }
.intro-schritte {
  grid-column: 1 / 9; list-style: none; margin: 0; padding: 16px 0 0; border-top: 3px solid var(--schwarz);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; font-size: clamp(1rem, 1.6vw, 1.35rem); font-weight: 700;
}
.intro-schritte b { display: block; font-size: .75em; margin-bottom: 4px; color: var(--blau); }
.intro-los {
  grid-column: 9 / -1; justify-self: end; align-self: end; border: 0; cursor: pointer;
  background: var(--schwarz); color: var(--weiss); font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-weight: 700;
  padding: 18px 26px; transition: transform .15s;
}
.intro-los:hover { transform: translateX(6px); }
.intro-fuss { grid-column: 1 / -1; margin: 0; font-size: .78rem; opacity: .85; }

/* ---------- Spalte: am Tag weiss, nachts schwarz ---------- */
.spalte {
  --sp-grund: #ffffff; --sp-text: #000000; --sp-linie: #000000; --sp-fein: #d6d6d6; --sp-leise: #595959; --sp-akzent: var(--blau);
}
body.nacht .spalte {
  --sp-grund: #000000; --sp-text: #ffffff; --sp-linie: #ffffff; --sp-fein: #333333; --sp-leise: #a8a8a8; --sp-akzent: var(--weiss); /* kleine Schrift auf Schwarz: Weiss statt ein drittes Blau */
}
.spalte {
  background: var(--sp-grund); color: var(--sp-text); transition: background .4s, color .4s; overflow: auto; padding: var(--rand);
  display: flex; flex-direction: column; z-index: 5;
}
.titel { margin: 0 0 22px; font-weight: 700; }
.titel .klein { display: block; font-size: 2.1rem; line-height: .95; letter-spacing: -.045em; }
.titel .basel {
  display: block; font-family: var(--schrift-basel); font-weight: 900; color: var(--sp-text);
  font-size: 7.4rem; line-height: .8; letter-spacing: -.03em; text-transform: uppercase; margin: 4px 0 0 -.04em;
}
.titel em { display: inline-block; width: .155em; height: .155em; margin-left: .09em; background: var(--blau); overflow: hidden; text-indent: 1em; white-space: nowrap; vertical-align: baseline; }
.ebenen-zu { display: none; }

/* Spalte einklappen (Desktop): schmaler schwarzer Streifen mit senkrechtem BASEL? */
body { transition: grid-template-columns .5s cubic-bezier(.65, 0, .35, 1); }
/* Inhalt behält beim Ein- und Ausklappen seine Breite (kein Umbrechen), er wird nur auf- und zugedeckt und blendet weich */
.spalte { transition: width .5s cubic-bezier(.65, 0, .35, 1); }
.ebenen-inhalt { transition: opacity .3s ease .18s, visibility 0s linear 0s; }
body.eng.schwebt .ebenen-inhalt, body.eng.schwebt .spalte-kopf { min-width: calc(380px - 2 * var(--rand)); }
@media (min-width: 761px) { .spalte { width: var(--spalte); } }
.spalte-kopf { position: relative; }
.einklappen {
  position: absolute; top: calc(-1 * var(--rand)); right: calc(-1 * var(--rand)); height: 44px; padding: 0 14px;
  border: 0;
  background: var(--sp-grund); color: var(--sp-text); font: 700 .8rem/1 inherit; cursor: pointer;
}
.einklappen:hover { background: var(--blau); color: var(--weiss); }
body.eng { --spalte: 56px; }
body.eng .spalte { overflow: hidden; }
body.eng:not(.schwebt) .spalte { padding: 0; }
body.eng:not(.schwebt) .ebenen-inhalt { opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility 0s linear .18s; }
body.eng:not(.schwebt) .titel { margin: 56px 0 0; position: relative; }
body.eng:not(.schwebt) .titel .klein { display: none; }
/* Senkrecht: die waagrechte Zeile um 90 Grad gedreht (statt writing-mode), damit der Punkt in allen Browsern
   auf derselben Grundlinie sitzt wie der Fuss des L */
body.eng:not(.schwebt) .titel .basel {
  position: absolute; top: 0; left: 7px; font-size: 2.6rem; line-height: 1; white-space: nowrap; margin: 0;
  transform-origin: 0 0; transform: rotate(-90deg) translateX(-100%);
}
body.eng:not(.schwebt) .einklappen {
  top: 0; right: 0; left: 0; width: 56px; height: 56px; padding: 0; border: 0;
  font-size: 1.5rem; line-height: 1; text-align: center; white-space: nowrap; overflow: hidden;
}
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Eingeklappt und Maus drüber: Spalte klappt über der Karte auf (Karte bleibt stehen), beim Verlassen wieder zu */
body.eng .spalte { position: relative; z-index: 30; }
body.eng.schwebt .spalte { width: 380px; overflow-y: auto; }
/* Der Titel wechselt zwischen senkrecht und waagrecht: erst zeigen, wenn die Spalte ihre neue Breite hat,
   sonst steht kurz ein abgeschnittenes «BA» da */
@keyframes titel-auf { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
@keyframes titel-zu { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
@media (min-width: 761px) {
  body.eng.schwebt .titel { animation: titel-auf .6s ease; }
  body.eng:not(.schwebt) .titel { animation: titel-zu .6s ease; }
}
@media (prefers-reduced-motion: reduce) { body, .spalte, .ebenen-inhalt { transition: none !important; } body.eng .titel { animation: none; } }

/* Fokus sichtbar, kleine Texte lesbar */
button:focus-visible, summary:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.zahl span, .schalter small, .status { font-size: .75rem; color: var(--sp-leise); }
.spalte h2 {
  display: flex; gap: 10px; align-items: baseline; margin: 26px 0 8px; padding-top: 8px;
  border-top: 2px solid var(--sp-linie); font-size: .95rem; font-weight: 700;
}
.spalte h2 span, .quellen-box summary span { color: var(--sp-akzent); font-size: .75rem; }

.zahlen { display: grid; grid-template-columns: 1.3fr 1fr 1fr; border-top: 2px solid var(--sp-linie); }
.zahl { padding: 10px 10px 4px 0; }
.zahl + .zahl { padding-left: 10px; border-left: 1px solid var(--sp-fein); }
.zahl b { display: block; font-size: 2.6rem; line-height: 1; letter-spacing: -.04em; font-weight: 700; }
.zahl:first-child b { color: var(--blau); }
.zahl b.ohne { font-size: .85rem; letter-spacing: 0; line-height: 2.6rem; color: var(--sp-leise); }
.zahl span { display: block; margin-top: 6px; font-size: .68rem; line-height: 1.25; color: var(--sp-leise); }

.schalter { list-style: none; margin: 0; padding: 0; }
.schalter li + li { border-top: 1px solid var(--sp-fein); }
.schalter label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; padding: 7px 0; }
.schalter small { margin-left: auto; font-size: .7rem; font-weight: 700; color: var(--sp-leise); }
.schalter input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer;
  border: 2px solid var(--sp-text); background: transparent; display: grid; place-content: center;
}
.schalter input:checked { background: var(--blau); border-color: var(--blau); }
.schalter input:checked::after { content: ""; width: 6px; height: 6px; background: var(--weiss); }
.schalter input:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.farbe { width: 18px; height: 12px; flex: none; background: var(--oeffentlich); }
.farbe.grau { background: #8c8c8c; box-shadow: none; }
.legende-boden { display: flex; gap: 10px; align-items: center; margin: 4px 0 6px; font-size: .85rem; line-height: 1.3; }
.punkt { width: 13px; height: 13px; border-radius: 50%; flex: none; display: inline-block; }
.punkt-a, .punkt-c { border-radius: 0; width: 12px; height: 12px; }
.punkt-a { background: var(--sp-text); }
.punkt-c { background: transparent; border: 3px solid var(--sp-text); }
/* Vier Grauklassen wie auf der Karte */
.flaeche-lw { width: 18px; height: 12px; flex: none; display: inline-block; background: linear-gradient(90deg, #d9d9d9 25%, #a6a6a6 25% 50%, #737373 50% 75%, #404040 75%); }
body.nacht .flaeche-lw { background: linear-gradient(90deg, #2e2e2e 25%, #555 25% 50%, #8c8c8c 50% 75%, #c8c8c8 75%); }
.status { margin: 10px 0 0; font-size: .75rem; color: var(--sp-leise); }

.quellen-box { margin-top: auto; padding-top: 22px; }
.quellen-box summary {
  cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline;
  padding-top: 8px; border-top: 2px solid var(--sp-linie); font-weight: 700; font-size: .95rem;
}
.quellen-box summary::-webkit-details-marker { display: none; }
.quellen-box summary::after { content: "+"; margin-left: auto; }
.quellen-box[open] summary::after { content: "–"; }
.quellen { font-size: .76rem; color: var(--sp-leise); }
.quellen p { margin: 8px 0; }
.quellen b { color: var(--sp-text); }

/* ---------- Bühne mit Karte ---------- */
.buehne { position: relative; min-width: 0; min-height: 0; background: var(--grau-fein); }
#karte { position: absolute; inset: 0; }

.melden-gross {
  position: absolute; left: var(--rand); bottom: var(--rand); z-index: 3; border: 0; cursor: pointer;
  background: var(--blau); color: var(--weiss); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
  padding: 16px 22px 16px 18px; display: flex; align-items: center; gap: 12px;
  transition: background .15s;
}
.melden-gross span { font-size: 1.8rem; line-height: .6; font-weight: 400; }
.melden-gross:hover { background: var(--schwarz); }

/* Detail: schlichtes weisses Blatt */
.seite {
  position: absolute; top: var(--rand); right: var(--rand); width: 400px; z-index: 4;
  max-height: calc(100% - 2 * var(--rand)); overflow: auto; background: var(--weiss);
  padding: 18px 20px 20px;
  animation: blatt .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes blatt { from { transform: translateY(-14px); opacity: 0; } }
.seite[hidden], .hinweis-band[hidden] { display: none; }
.seite-zu {
  position: absolute; top: 0; right: 0; width: 44px; height: 44px; font-size: 1.7rem; line-height: 1;
  background: var(--schwarz); color: var(--weiss); border: 0; cursor: pointer;
}
.seite-zu:hover { background: var(--blau); }

.etikett {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 7px; margin-bottom: 10px; background: var(--schwarz); color: var(--weiss);
}
.etikett.leer { background: var(--schwarz); }
.etikett.hell { background: var(--flaeche); color: var(--schwarz); }
.seite h3 { font-size: 2.1rem; line-height: .95; letter-spacing: -.04em; margin: 0 48px 14px 0; font-weight: 700; }
.riesig { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; padding-top: 8px; border-top: 3px solid var(--schwarz); }
.riesig b { font-size: 4.2rem; line-height: .9; letter-spacing: -.05em; font-weight: 700; }
.riesig span { font-size: 1.1rem; font-weight: 700; }
.riesig small { margin-left: auto; font-size: .7rem; color: var(--grau); text-align: right; }
dl.werte { display: grid; grid-template-columns: 7em 1fr; margin: 0 0 14px; font-size: .88rem; }
dl.werte dt, dl.werte dd { margin: 0; padding: 6px 0; border-top: 1px solid var(--grau-fein); }
dl.werte dt { color: var(--grau); }
.seite h4 { margin: 18px 0 4px; padding-top: 8px; border-top: 3px solid var(--schwarz); font-size: .95rem; }
.gebaeude { border-top: 1px solid var(--grau-fein); padding: 8px 0; font-size: .86rem; }
.gebaeude b { font-size: 1rem; }
.leise { color: var(--grau); font-size: .8rem; }
.quelle { font-size: .72rem; color: var(--grau); margin-top: 14px; }
.fehler { color: var(--schwarz); font-weight: 700; }
.knopfreihe { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.knopf {
  font-size: .92rem; font-weight: 700; padding: 12px 18px; cursor: pointer; border: 0;
  background: var(--flaeche); color: var(--schwarz); transition: background .15s, color .15s;
}
.knopf:hover { background: var(--schwarz); color: var(--weiss); }
.knopf-haupt { background: var(--blau); color: var(--weiss); }
.knopf-haupt:hover { background: var(--schwarz); }
.knopf:disabled { opacity: .4; cursor: default; }

form.melden label { display: block; font-size: .78rem; margin: 14px 0 5px; font-weight: 700; }
form.melden select, form.melden textarea, form.melden input[type=url] {
  width: 100%; font: inherit; font-size: 16px; padding: 10px; border-radius: 0;
  border: 0; background-color: #ececec; color: var(--schwarz);
}
form.melden select:focus, form.melden textarea:focus, form.melden input:focus { outline: 2px solid var(--blau); outline-offset: 0; }
form.melden select { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
form.melden textarea { min-height: 84px; resize: vertical; }
form.melden .haken { display: flex; gap: 10px; font-weight: 400; font-size: .86rem; align-items: flex-start; }
form.melden .haken input { accent-color: var(--blau); width: 18px; height: 18px; margin: 0; flex: none; }

.hinweis-band {
  position: absolute; left: 50%; top: var(--rand); transform: translateX(-50%); z-index: 4;
  max-width: calc(100% - 2 * var(--rand)); background: var(--schwarz); color: var(--weiss);
  padding: 6px 6px 6px 16px; display: flex; gap: 14px; align-items: center; font-weight: 700;
}
.hinweis-band .knopf { background: #333; color: var(--weiss); padding: 9px 14px; }
.hinweis-band .knopf:hover { background: var(--blau); }

.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-group { border-radius: 0 !important; box-shadow: none !important; border: 0; }
.maplibregl-ctrl-group button + button { border-top: 2px solid var(--schwarz) !important; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  :root { --rand: 14px; }
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .spalte { padding: 12px 16px; overflow: visible; position: relative; }
  .spalte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .titel { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .titel .klein { display: inline; font-size: 1.15rem; }
  .titel .basel { display: inline; font-size: 2.9rem; margin: 0; }
  .ebenen-zu {
    display: block; border: 2px solid var(--sp-text); background: var(--sp-grund); color: var(--sp-text);
    font-weight: 700; font-size: .85rem; padding: 8px 12px; cursor: pointer;
  }
  .ebenen-zu[aria-expanded="true"] { background: var(--sp-text); color: var(--sp-grund); border-color: var(--sp-text); }
  .ebenen-inhalt {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--sp-grund);
    padding: 4px 16px 18px; max-height: calc(100dvh - 70px); overflow: auto; border-top: 1px solid var(--sp-fein);
  }
  .spalte.zu .ebenen-inhalt { display: none; }
  .zahl b { font-size: 2rem; }
  .melden-gross { left: 50%; transform: translateX(-50%); bottom: 26px; white-space: nowrap; }
  .melden-gross:hover { transform: translateX(-50%); }
  .melden-gross:active { transform: translateX(-50%) translateY(3px); }
  .seite {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 68%;
    border: 0;
  }
  .seite h3 { font-size: 1.75rem; }
  .riesig b { font-size: 3.2rem; }
  .intro-schritte { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 10px; }
  .intro-los { grid-column: 1 / -1; justify-self: stretch; text-align: left; }
}

/* ---------- Ansicht: Karte/Luftbild, 2D/3D ---------- */
.ansicht { position: absolute; top: var(--rand); left: var(--rand); right: 80px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
/* Jede Leiste auf eigener Zeile: so bleibt alles am selben Platz, egal wie lang die Wörter in der gewählten Sprache sind */
.ansicht > * { max-width: 100%; }
.ansicht > * { pointer-events: auto; }
.segment { display: flex; background: var(--weiss); }
.segment button {
  border: 0; background: var(--weiss); color: var(--schwarz); font-weight: 700; font-size: .85rem;
  padding: 8px 12px; cursor: pointer;
}
.segment button + button { border-left: 1px solid rgba(0, 0, 0, .12); }
.segment button[aria-pressed="true"] { background: var(--schwarz); color: var(--weiss); }
.segment button:hover:not([aria-pressed="true"]) { background: #e1e5ff; }

/* Ich suche: Wohnung, Haus, Laden, Grundstück. Steht zuerst, weil es darum geht. */
.segment.frei, .segment.tausche { order: -1; }
.segment-titel { display: flex; align-items: center; padding: 0 10px 0 12px; font-size: .85rem; color: #555; white-space: nowrap; }
.alle-aus { margin: 14px 0 0; font-size: .85rem; }
.woher { margin: 10px 0 0; font-size: .8rem; line-height: 1.4; color: var(--sp-leise); }
.woher b { color: var(--sp-text); }
.alle-aus span { color: var(--sp-leise); }
.segment.frei small { font-size: .75em; opacity: .7; margin-left: 2px; }
.segment.frei small:empty { display: none; }
.frei-hinweis { flex-basis: 100%; max-width: 420px; margin: 0; padding: 8px 12px; background: var(--weiss); color: var(--schwarz); font-size: .8rem; line-height: 1.35; }
.frei-hinweis .link-knopf { font-weight: 700; }
body.nacht .frei-hinweis { background: rgba(0, 0, 0, .8); color: var(--weiss); }

/* Wohnbezirk im Detailblatt */
.bezirk { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 10px 12px; background: var(--schwarz); color: var(--weiss); }
.bezirk b { font-size: 2.2rem; line-height: 1; letter-spacing: -.04em; }
.bezirk span { font-size: .8rem; line-height: 1.3; }

@media (max-width: 760px) {
  .ansicht { top: 10px; left: 10px; right: 56px; gap: 8px; flex-wrap: wrap; }
  .segment button { padding: 7px 10px; font-size: .8rem; min-height: 44px; } /* 44 px zum Tippen */
  .segment-titel { font-size: .8rem; padding: 0 8px 0 10px; }
  /* Längere Wörter (Französisch) nicht umbrechen: die Zeile bleibt gleich hoch und lässt sich seitlich wischen */
  .segment { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segment::-webkit-scrollbar { display: none; }
  .segment button { white-space: nowrap; flex: none; }
}



body.nacht .buehne { background: #0c0c0c; }

/* Melden-Knopf nicht über dem offenen Blatt, und über dem Home-Balken */
.buehne:has(.seite:not([hidden])) .melden-gross { display: none; }
@media (max-width: 760px) {
  .melden-gross { bottom: calc(40px + env(safe-area-inset-bottom)); } /* über der Quellenzeile */
  .einklappen { display: none; }
  body.eng { --spalte: 380px; }
}
@media (max-width: 1000px) and (min-width: 761px) { .ansicht { flex-wrap: wrap; } }

/* Privater Leerstand pro Wohnbezirk (Legende) und Kontakt-Kasten */
.flaeche-bezirk { width: 18px; height: 12px; flex: none; border: 2px dashed var(--sp-text); }
.kontakt-box { margin: 16px 0 6px; padding: 12px 14px 14px; background: var(--flaeche); }
.kontakt-box p { margin: 6px 0 12px; font-size: .88rem; line-height: 1.35; }

/* So läuft der Kontakt: drei Schritte, nebeneinander, auf dem Handy untereinander */
.drei-schritte { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: none; }
.drei-schritte li { border-top: 3px solid var(--sp-text); padding-top: 6px; font-size: .84rem; line-height: 1.3; }
.drei-schritte li:last-child { border-top-color: var(--blau); }
.drei-schritte b { display: block; font-size: 1.6rem; line-height: 1; letter-spacing: -.03em; margin-bottom: 4px; }
.drei-schritte li:last-child b { color: var(--blau); }
.angebot-schritte .leise { margin: 4px 0 0; }
@media (max-width: 760px) {
  .drei-schritte { grid-template-columns: 1fr; gap: 0; }
  .drei-schritte li { display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline; padding: 6px 0 8px; }
  .drei-schritte b { font-size: 1.3rem; margin: 0; }
}

/* Schulen und Kinderbetreuung */
.punkt-schule { background: #ffc400; box-shadow: 0 0 0 2px var(--weiss); }
.etikett.schule { background: #ffc400; color: #000; }

/* Wohnungstausch */
.tausch-zeile { display: flex; align-items: stretch; gap: 12px; border-top: 2px solid var(--sp-linie); padding-top: 10px; }
.tausch-zeile .zahl { flex: 1; border: 0; padding: 0; }
.knopf-weiss { border: 0; background: var(--sp-text); color: var(--sp-grund); font: 700 1rem/1 inherit; padding: 0 16px; cursor: pointer; }
.knopf-weiss:hover { background: var(--blau); color: var(--weiss); }
.tausch-karte { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 10px; padding: 12px 0 14px; border-top: 2px solid var(--schwarz); }
.tausch-karte.eigen { background: var(--flaeche); padding: 12px; border-top: 0; }
.tausch-karte > p, .tausch-karte > .knopfreihe, .tausch-karte > .knopf { grid-column: 1 / -1; margin: 0; }
.tausch-karte > .knopf { justify-self: start; }
.tausch-habe, .tausch-suche { font-size: .86rem; line-height: 1.35; }
.tausch-habe span, .tausch-suche span { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blau); }
.tausch-habe b, .tausch-suche b { font-size: 1.05rem; }
.tausch-pfeil { align-self: center; font-size: 1.5rem; font-weight: 700; }
.zahl-klein { background: var(--schwarz); color: var(--weiss); font-size: .75rem; padding: 1px 6px; margin-left: 6px; }
.tausch-form fieldset { border: 0; border-top: 3px solid var(--schwarz); margin: 14px 0 0; padding: 8px 0 0; }
.tausch-form legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px 0 0; }
.tausch-form .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.viertel-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: .84rem; margin-bottom: 6px; }
.viertel-wahl label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; }

/* ÖV: schwarz-weiss wie die Schweizer ÖV-Zeichen */
.punkt-oev-legende { background: #fff; box-shadow: inset 0 0 0 3px #000, 0 0 0 1.5px #fff; }
.oev-liste { list-style: none; margin: 0 0 8px; padding: 0; }
.oev-liste li { display: grid; grid-template-columns: 16px 1fr; column-gap: 8px; padding: 6px 0; border-top: 1px solid #ddd; font-size: .88rem; }
.oev-liste li span { grid-column: 2; font-size: .78rem; color: #555; }
.punkt-oev { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; border: 2.5px solid #000; background: #fff; }
.punkt-oev.bahn { border-width: 3.5px; } .punkt-oev.bus { background: #000; } .punkt-oev.schiff { border-width: 1.5px; }

.macher { margin: 18px 0 4px; font-size: .7rem; line-height: 1.4; color: var(--sp-leise); }
.macher a { color: inherit; }

.mit-text { flex: 1; margin: 0; font-size: .86rem; line-height: 1.35; }
.wahl-liste { display: grid; gap: 4px; font-size: .86rem; }
form.melden .wahl-liste label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; font-size: .86rem; }
form.melden input[type=text], form.melden input[type=number], form.melden input[type=month] { width: 100%; box-sizing: border-box; padding: 10px; border: 0; font: inherit; font-size: 16px; border-radius: 0; background: #ececec; }

body.still, body.still .spalte, body.still .ebenen-inhalt { transition: none !important; }

.titel-link { color: inherit; text-decoration: none; display: contents; }
.titel-link:hover .basel { color: var(--blau); }
.titel-link:focus-visible { outline: 3px solid var(--blau); outline-offset: 4px; }

/* Leere Geschäftsflächen: nur Summe, kein Ort */
.gewerbe-zahl { padding: 12px 0 4px; }
.gewerbe-zahl b { font-size: 1.8rem; color: var(--sp-text); }

/* Anmelden: schlichtes Fenster, nur für Aktionen */
dialog.anmelden { border: 0; padding: 22px; width: min(420px, calc(100vw - 32px)); max-width: none; background: var(--weiss); color: var(--schwarz); }
dialog.anmelden::backdrop { background: rgba(0, 0, 0, .55); }
dialog.anmelden h3 { font-size: 1.8rem; line-height: 1; margin: 0 0 10px; letter-spacing: -.03em; }
dialog.anmelden h3::after { content: "."; color: var(--blau); }
dialog.anmelden p { font-size: .9rem; line-height: 1.4; margin: 0 0 6px; }
dialog.anmelden p.leise { font-size: .75rem; color: #6e6e6e; margin-top: 14px; }
dialog.anmelden .status { color: #6e6e6e; min-height: 1.2em; margin-top: 8px; }
dialog.anmelden .knoepfe { display: flex; gap: 8px; margin-top: 10px; }
dialog.anmelden a { color: inherit; }
form.melden input[type=email], form.melden input#a-code {
  width: 100%; box-sizing: border-box; height: 44px; font: inherit; font-size: 16px; line-height: 24px; padding: 10px; border-radius: 0; border: 0; background: #ececec; color: var(--schwarz);
}
/* Code-Feld gleich gross wie das Mailfeld, damit beim Wechsel nichts springt */
form.melden input#a-code { letter-spacing: .3em; font-weight: 700; }
.link-knopf { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Detailblatt beim Laden: alter Inhalt blass statt springen, beim ersten Öffnen gleich in voller Höhe */
#seite-inhalt { transition: opacity .15s; }
#seite-inhalt.laedt { opacity: .4; pointer-events: none; }
.platzhalter { min-height: 320px; }

/* Glas: nur was über der Karte schwebt (Ansicht, Zoom, Detailblatt). Flach und eckig wie alles andere,
   nur durchscheinend, damit die Karte darunter sichtbar bleibt. Ohne backdrop-filter bleibt es deckend. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .segment, .maplibregl-ctrl-group, .seite, .frei-hinweis {
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  }
  .segment, .frei-hinweis { background: rgba(255, 255, 255, .9); } /* fast deckend: liest sich weiss, nicht grau */
  .segment button { background: transparent; }
  .segment button:hover:not([aria-pressed="true"]) { background: #e1e5ff; }
  .maplibregl-ctrl-group { background: rgba(255, 255, 255, .9) !important; }
  .maplibregl-ctrl-group button { background-color: transparent !important; }
  .seite { background: rgba(255, 255, 255, .92); }
  body.nacht .segment { background: rgba(0, 0, 0, .8); }
  body.nacht .segment button:not([aria-pressed="true"]) { color: var(--weiss); }
  body.nacht .segment button[aria-pressed="true"] { background: var(--weiss); color: var(--schwarz); }
  body.nacht .segment button + button { border-left-color: rgba(255, 255, 255, .15); }
  body.nacht .segment button:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, .14); }
}

/* Tausch: Art (Wohnung, Haus) und Form (Miete, Genossenschaft, Eigentum) als Zeilen nebeneinander */
.alarm-zeile { margin-top: 14px; }
.alarm-zeile p { flex: 1; margin: 0; font-size: .85rem; line-height: 1.35; align-self: center; }
.tausch-form .wahl-liste { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 10px; }

/* Ruhe: nach 5 Sekunden ohne Maus oder Taste blenden die Knöpfe auf der Karte aus (Präsentation). Nur mit Maus,
   damit auf dem Handy ein Tippen nicht gleichzeitig etwas auf der Karte anklickt. Die Quellenzeile bleibt. */
@media (hover: hover) {
  .melden-gross, .maplibregl-ctrl-group { transition: opacity .8s ease; }
  .ansicht > * { transition: opacity .8s ease; }
  /* Ergebnis und Legende bleiben stehen, nur die Knöpfe gehen */
  body.ruhig .ansicht > :not(.frei-hinweis):not(.karten-legende), body.ruhig .melden-gross, body.ruhig .maplibregl-ctrl-group { opacity: 0; }
  body.ruhig .ansicht > :not(.frei-hinweis):not(.karten-legende), body.ruhig .melden-gross, body.ruhig .maplibregl-ctrl-group { pointer-events: none; }
}

/* Angemeldet als ... (oben bei den Knöpfen) */
.segment[hidden] { display: none; }
.konto .segment-titel { padding-right: 0; }
.konto .konto-wer { padding-left: 6px; text-decoration: underline dotted; text-underline-offset: 3px; }
body.nacht .konto .segment-titel { color: rgba(255, 255, 255, .7); }
@media (max-width: 760px) { .konto .konto-wer { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
dialog.anmelden small { font-weight: 400; color: #6e6e6e; }

/* Mini-Legende im Ergebnis-Hinweis */
.mini-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; font-weight: 700; }
.mini-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-quadrat { width: 8px; height: 8px; background: currentColor; }
.lg-quadrat.lg-gross { width: 14px; height: 14px; margin-left: -2px; }
.lg-grau { display: inline-flex; }
.lg-grau b { width: 12px; height: 10px; }
.lg-grau b:nth-child(1) { background: #d9d9d9; } .lg-grau b:nth-child(2) { background: #a6a6a6; }
.lg-grau b:nth-child(3) { background: #737373; } .lg-grau b:nth-child(4) { background: #404040; }
body.nacht .lg-grau b:nth-child(1) { background: #2e2e2e; } body.nacht .lg-grau b:nth-child(2) { background: #555555; }
body.nacht .lg-grau b:nth-child(3) { background: #8c8c8c; } body.nacht .lg-grau b:nth-child(4) { background: #c8c8c8; }


/* Ansicht-Menü: Karte/Luftbild, 2D/3D und Tageszeit hinter einem Knopf, damit «Ich suche» und «Ich tausche» vorne stehen */
.ansicht-knopf { border: 0; background: var(--weiss); color: var(--schwarz); font: inherit; font-weight: 700; font-size: .85rem; padding: 8px 12px; cursor: pointer; }
.ansicht-knopf[aria-expanded="true"] { background: var(--schwarz); color: var(--weiss); }
.ansicht-knopf:hover:not([aria-expanded="true"]) { background: #e1e5ff; }
.ansicht-knopf span { display: inline-block; transition: transform .2s; }
.ansicht-knopf[aria-expanded="true"] span { transform: rotate(180deg); }
.ansicht-menue { display: flex; flex-wrap: wrap; gap: 10px; flex-basis: 100%; }
.ansicht-menue[hidden] { display: none; }
body.nacht .ansicht-knopf { background: rgba(0, 0, 0, .8); color: var(--weiss); }
body.nacht .ansicht-knopf[aria-expanded="true"] { background: var(--weiss); color: var(--schwarz); }
@media (max-width: 760px) { .ansicht-knopf { min-height: 44px; font-size: .8rem; padding: 7px 10px; } .ansicht-menue { gap: 8px; } }

/* Handy: das Detail ist ein Blatt von unten. Es öffnet halb hoch, damit die Karte sichtbar bleibt.
   Griff antippen oder hochziehen: gross. Runterziehen: kleiner, dann zu. */
.seite-griff { display: none; }
@media (max-width: 760px) {
  .seite {
    max-height: 46dvh; padding-top: 30px; overscroll-behavior: contain;
    animation: blatt-unten .28s cubic-bezier(.2, .8, .2, 1); transition: max-height .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .12);
  }
  .seite.voll { max-height: 88dvh; }
  .seite-griff {
    display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 96px; height: 30px;
    background: transparent; border: 0; padding: 0; cursor: grab; touch-action: none;
  }
  .seite-griff i { display: block; width: 40px; height: 4px; margin: 0 auto; background: var(--schwarz); opacity: .35; }
  body.nacht .seite-griff i { background: var(--weiss); }
}
@keyframes blatt-unten { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .seite { animation: none; transition: none; } }

/* Zeichen für Einkaufen, Laden und Sharing (gleich wie auf der Karte) */
.punkt-alltag { display: inline-block; width: 14px; height: 14px; flex: none; margin-top: 2px; border-radius: 50%; position: relative;
  background: #fff; box-shadow: inset 0 0 0 2px #000; font: 700 9px/14px var(--schrift, sans-serif); color: #000; text-align: center; font-style: normal; }
.punkt-alltag.laden { background: #000; box-shadow: 0 0 0 1.5px #fff; }
.punkt-alltag.laden::after { content: ""; position: absolute; left: 4px; top: 2px; width: 6px; height: 10px; background: #fff;
  clip-path: polygon(60% 0, 0 60%, 45% 60%, 30% 100%, 100% 40%, 55% 40%, 75% 0); }
.punkt-alltag.einkauf { border-radius: 0; }
.punkt-alltag.einkauf::after { content: ""; position: absolute; left: 3px; top: 3.5px; width: 8.5px; height: 5px; background: #000; clip-path: polygon(0 0, 100% 0, 85% 100%, 12% 100%); }
.punkt-alltag.einkauf::before { content: ""; position: absolute; left: 4.5px; top: 9.5px; width: 2px; height: 2px; border-radius: 50%; background: #000; box-shadow: 4px 0 0 #000; }
.punkt-alltag.pickebike::after { content: "P"; }
.punkt-alltag.velospot::after { content: "V"; }
.punkt-alltag.mobility { border-radius: 0; background: #000; color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.punkt-alltag.mobility::after { content: "M"; }
.oev-liste li .punkt-alltag { margin-top: 2px; }
.punkt-alltag.laden.besetzt { background: #d0d0d0; } .punkt-alltag.laden.besetzt::after { background: #7a7a7a; }
.punkt-alltag.laden.unbekannt { background: #fff; box-shadow: inset 0 0 0 2px #000; } .punkt-alltag.laden.unbekannt::after { background: #000; }

/* Name nie umbrechen */
.klein, .marke { white-space: nowrap; }
