/* Wohnungssuche Bielefeld – schlichtes, kompaktes Layout */
:root {
  --bg: #f5f6f4;
  --flaeche: #ffffff;
  --flaeche-2: #eef0ec;
  --text: #1d2321;
  --text-2: #56605b;
  --linie: #d9ddd6;
  --akzent: #1f6f5c;
  --akzent-text: #ffffff;
  --akzent-hell: #e1f0eb;
  --warn: #9a5b00;
  --warn-hell: #fff3dc;
  --fehler: #b3261e;
  --fehler-hell: #fde8e6;
  --ok: #2e7d32;
  --ok-hell: #e5f4e6;
  --info-hell: #e7eef9;
  --info: #2a5599;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(0, 0, 0, .05);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816; --flaeche: #1c211f; --flaeche-2: #242a27; --text: #e6ebe8; --text-2: #a3ada8;
    --linie: #333b37; --akzent: #5cc0a3; --akzent-text: #0d1512; --akzent-hell: #1f3530;
    --warn: #f0b45a; --warn-hell: #3a2d16; --fehler: #ff8a80; --fehler-hell: #3d1d1b;
    --ok: #81c784; --ok-hell: #1d3320; --info-hell: #1d2a3d; --info: #9cbcf0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--schrift); }
a { color: var(--akzent); }
h1 { font-size: 1.45rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: .8rem 0 .3rem; }
small, .klein { font-size: .82rem; color: var(--text-2); }
.gedaempft { color: var(--text-2); }
.nowrap { white-space: nowrap; }

/* Kopfzeile */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { max-width: 1280px; margin: 0 auto; padding: .55rem 16px; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.marke { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { padding: .35rem .6rem; border-radius: 8px; text-decoration: none; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; }
.nav a.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.nav a:hover, .nav button:hover { background: var(--flaeche-2); }
.nav form { margin: 0; }

main { max-width: 1280px; margin: 0 auto; padding: 1rem 16px 3rem; }
.seitenkopf { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.seitenkopf .aktionen { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Karten */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--schatten); min-width: 0; }
.karte + .karte { margin-top: 1rem; }
.raster-2 > .karte + .karte { margin-top: 0; }
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.raster-detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .raster-2, .raster-detail { grid-template-columns: 1fr; } }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; line-height: 1.2; }
.knopf:hover { background: var(--flaeche-2); }
.knopf.primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf.primaer:hover { filter: brightness(1.08); }
.knopf.klein { padding: .25rem .55rem; font-size: .85rem; }
.knopf.gefahr { color: var(--fehler); }
.knopf.link { border: 0; background: none; color: var(--akzent); padding: .1rem .2rem; }
.inline-form { display: inline; margin: 0; }

/* Formulare */
input[type=text], input[type=search], input[type=email], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); color: var(--text); font: inherit; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .knopf:focus-visible, a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.feld { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .7rem; min-width: 0; }
.feld label { font-weight: 600; font-size: .88rem; }
.feld .hilfe { font-size: .78rem; color: var(--text-2); }
.feld .fehler, .fehlertext { color: var(--fehler); font-size: .82rem; }
.feld.hat-fehler input, .feld.hat-fehler select, .feld.hat-fehler textarea { border-color: var(--fehler); }
.feld-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: .5rem; }
.feld-check label { font-weight: 500; }
.feld ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.feld ul label { font-weight: 500; }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem .3rem; margin: 0 0 1rem; background: var(--flaeche); }
legend { font-weight: 700; padding: 0 .3rem; }
.felder-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 .9rem; }
.felder-raster .breit { grid-column: 1 / -1; }
.formular-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* Filter */
.filterleiste { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.filterleiste .suche { flex: 1 1 260px; }
.filterleiste select { width: auto; flex: 0 1 15rem; }
.filter-details { margin-bottom: .8rem; }
.filter-details summary { cursor: pointer; color: var(--akzent); font-weight: 600; padding: .2rem 0; }
.filter-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem .8rem; padding: .6rem 0; }
.filter-raster .feld { margin: 0; }

/* Status & Marker */
.status { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--flaeche-2); color: var(--text-2); white-space: nowrap; }
.status-angefragt, .status-in_kontakt { background: var(--info-hell); color: var(--info); }
.status-besichtigung_geplant, .status-besichtigt { background: var(--akzent-hell); color: var(--akzent); }
.status-beworben, .status-zusage { background: var(--ok-hell); color: var(--ok); }
.status-abgelehnt, .status-zurueckgezogen { background: var(--fehler-hell); color: var(--fehler); }
.status-ausgeschlossen { background: var(--warn-hell); color: var(--warn); }
.status-vorgeschlagen { background: var(--warn-hell); color: var(--warn); }
.status-bestaetigt { background: var(--akzent-hell); color: var(--akzent); }
.status-absolviert { background: var(--ok-hell); color: var(--ok); }
.status-abgesagt { background: var(--fehler-hell); color: var(--fehler); text-decoration: line-through; }
.marker { display: inline-block; font-size: .74rem; font-weight: 700; padding: .05rem .4rem; border-radius: 6px; vertical-align: middle; }
.marker.fehlt { background: var(--flaeche-2); color: var(--text-2); border: 1px dashed var(--text-2); }
.marker.widerspruch { background: var(--fehler-hell); color: var(--fehler); }
.marker.pruefen { background: var(--warn-hell); color: var(--warn); }
.marker.ausserhalb { background: var(--warn-hell); color: var(--warn); }
.drei { display: inline-block; padding: .05rem .45rem; border-radius: 6px; font-size: .82rem; font-weight: 600; }
.drei.ja { background: var(--ok-hell); color: var(--ok); }
.drei.nein { background: var(--fehler-hell); color: var(--fehler); }
.drei.vereinbarung { background: var(--info-hell); color: var(--info); }
.drei.unbekannt { background: var(--flaeche-2); color: var(--text-2); border: 1px dashed var(--linie); }

/* Hinweise */
.hinweis { border-radius: 8px; padding: .6rem .8rem; margin-bottom: .8rem; background: var(--info-hell); color: var(--text); border-left: 4px solid var(--info); }
.hinweis.warn { background: var(--warn-hell); border-color: var(--warn); }
.hinweis.fehler { background: var(--fehler-hell); border-color: var(--fehler); }
.hinweis.ok { background: var(--ok-hell); border-color: var(--ok); }
.hinweis ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.meldungen { list-style: none; padding: 0; margin: 0 0 1rem; }
.meldungen li { padding: .55rem .8rem; border-radius: 8px; margin-bottom: .4rem; background: var(--ok-hell); }
.meldungen li.warning { background: var(--warn-hell); }
.meldungen li.error { background: var(--fehler-hell); }

/* Kompakte Listen (Aufgaben, Termine) */
.kurzliste { list-style: none; margin: 0; padding: 0; }
.kurzliste li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-top: 1px solid var(--linie); }
.kurzliste li:first-child { border-top: 0; }
.kurzliste .inhalt { flex: 1; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.aktionszeile > * { min-width: 0; }
.aktionszeile input[type=text] { flex: 1 1 10rem; }
.aktionszeile input[type=date] { flex: 0 1 10rem; }
.kurzliste .datum { min-width: 4.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ueberfaellig { color: var(--fehler); font-weight: 600; }
.erledigt .inhalt { text-decoration: line-through; color: var(--text-2); }
.haken { width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1px solid var(--linie); background: var(--flaeche); cursor: pointer; padding: 0; line-height: 1; color: var(--ok); font-weight: 700; flex-shrink: 0; }
.fenster { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.fenster span { font-size: .8rem; padding: .15rem .5rem; border-radius: 6px; background: var(--flaeche-2); }
.fenster span.belegt { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }

/* Wohnungsliste: Tabelle auf Desktop, Karten auf dem Handy */
.liste { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste .zeile { display: grid; grid-template-columns: 2.2rem minmax(0, 2.4fr) minmax(0, 1fr) 3rem 5rem 6.2rem minmax(0, 1.5fr) 10.5rem minmax(0, 1.8fr); gap: .6rem; align-items: center; padding: .55rem .8rem; border-top: 1px solid var(--linie); }
.liste .zeile:first-child { border-top: 0; }
.liste .zeile.kopfzeile { background: var(--flaeche-2); font-size: .78rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; }
.liste .zeile[data-href] { cursor: pointer; }
.liste .zeile[data-href]:hover { background: var(--flaeche-2); }
.zelle { min-width: 0; overflow-wrap: anywhere; }
.zelle.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.zelle.titel a { font-weight: 600; text-decoration: none; color: var(--text); }
.zelle.titel a:hover { color: var(--akzent); text-decoration: underline; }
.zelle .unter { display: block; font-size: .8rem; color: var(--text-2); }
.zelle::before { content: none; }
.vergleichsleiste { position: sticky; bottom: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .5rem .8rem; margin-top: .8rem; display: flex; gap: .6rem; align-items: center; justify-content: space-between; box-shadow: 0 -2px 8px rgba(0,0,0,.06); }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .liste { background: transparent; border: 0; overflow: visible; }
  .liste .zeile.kopfzeile { display: none; }
  .liste .zeile {
    grid-template-columns: 2rem 1fr auto; grid-template-areas:
      "wahl titel status" "wahl daten daten" "wahl kosten kosten" "wahl schritt schritt";
    gap: .15rem .5rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: .55rem; padding: .65rem .75rem;
  }
  .liste .zeile:first-child { border-top: 1px solid var(--linie); }
  .zelle.wahl { grid-area: wahl; align-self: start; padding-top: .1rem; }
  .zelle.titel { grid-area: titel; }
  .zelle.status-zelle { grid-area: status; align-self: start; }
  .zelle.stadtteil, .zelle.zimmer, .zelle.flaeche { display: inline; }
  .zelle.daten-mobil { grid-area: daten; display: block; font-size: .85rem; color: var(--text-2); }
  .zelle.stadtteil, .zelle.zimmer, .zelle.flaeche-z { display: none; }
  .zelle.kalt { display: none; }
  .zelle.kosten { grid-area: kosten; text-align: left; font-size: .9rem; }
  .zelle.schritt { grid-area: schritt; font-size: .85rem; }
  .zelle.schritt:not(:empty)::before { content: "→ "; color: var(--text-2); }
  h1 { font-size: 1.25rem; }
}
@media (min-width: 761px) { .zelle.daten-mobil { display: none; } }

/* Detailansicht */
.dl { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: .3rem .8rem; margin: 0; }
.dl dt { color: var(--text-2); font-size: .88rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kostenzeile { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px solid var(--linie); font-variant-numeric: tabular-nums; }
.kostenzeile:first-child { border-top: 0; }
.kostenzeile.summe { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--text); }
.kostenzeile .wert { text-align: right; }
.zeitleiste { list-style: none; margin: 0; padding: 0; position: relative; }
.zeitleiste li { position: relative; padding: .1rem 0 .8rem 1.3rem; border-left: 2px solid var(--linie); margin-left: .35rem; }
.zeitleiste li::before { content: ""; position: absolute; left: -.42rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--flaeche); border: 2px solid var(--akzent); }
.zeitleiste li.art-entscheidung::before { background: var(--warn); border-color: var(--warn); }
.zeitleiste li.art-besichtigung::before { background: var(--akzent); }
.zeitleiste .zeit { font-size: .8rem; color: var(--text-2); }
.zeitleiste .text { white-space: pre-line; font-size: .9rem; }
.notizen { white-space: pre-line; }
.besichtigung { border: 1px solid var(--linie); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .6rem; }
.besichtigung.abgesagt { opacity: .75; }
.notizraster { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .4rem .8rem; margin-top: .4rem; }
.notizraster div { font-size: .88rem; white-space: pre-line; }
.notizraster strong { display: block; font-size: .78rem; color: var(--text-2); }
.aktionszeile { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
details.aufklapp { margin-top: .6rem; }
details.aufklapp > summary { cursor: pointer; color: var(--akzent); font-weight: 600; }
.unterkarte-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.unterkarte-kopf h2 { margin: 0; }

/* Vergleich */
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); }
table.vergleich { border-collapse: collapse; width: 100%; min-width: 560px; }
table.vergleich th, table.vergleich td { padding: .5rem .7rem; border-top: 1px solid var(--linie); text-align: left; vertical-align: top; }
table.vergleich thead th { background: var(--flaeche-2); border-top: 0; }
table.vergleich tbody th { font-weight: 600; color: var(--text-2); font-size: .88rem; width: 11rem; position: sticky; left: 0; background: var(--flaeche); }
td.fehlt { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--flaeche-2) 6px 12px); color: var(--text-2); }
td.widerspruch { background: var(--fehler-hell); }
td .quellen { margin: .3rem 0 0; padding-left: 1rem; font-size: .8rem; color: var(--text); }
.auswahlliste { list-style: none; padding: 0; margin: 0; columns: 2 260px; }
.auswahlliste li { padding: .25rem 0; break-inside: avoid; }

/* Archiv */
.archivliste { list-style: none; padding: 0; margin: 0; }
.archivliste li { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .6rem; }
.archivliste .kopfzeile { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; align-items: baseline; }

/* Anmeldung */
.anmeldung { max-width: 380px; margin: 10vh auto; }

.sr-titel { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
pre.bericht { white-space: pre-wrap; background: var(--flaeche-2); padding: .8rem; border-radius: 8px; font-size: .82rem; overflow-x: auto; }
.leer { color: var(--text-2); font-style: italic; }
