/* Detailblatt: gemeinsam für Swiper (/app, vor app.css geladen) und Feed (/feed). Inhalt aus public/detail.js (window.Detail).
   Fotos nie abschneiden (Paul 02.11.): jedes Foto ganz (contain) in einem festen 4:3-Rahmen auf ruhiger Fläche (03.11.). */
.blatt-zu { position: sticky; top: 12px; float: right; margin: 12px 12px -56px 0; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); box-shadow: var(--sh-1); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.blatt-zu svg { width: 18px; height: 18px; }
/* Galerie: ein Foto nach dem anderen (Wischen, Pfeile, Maus-Ziehen, Tasten; Bedienung in karte.js „Foto-Spur“), Rahmen fest 4:3 */
.galerie-box { padding: 12px 12px 4px; display: grid; gap: 10px; }
.galerie-rahmen { position: relative; border-radius: var(--r-m); overflow: hidden; background: var(--grund); }
.galerie { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.galerie::-webkit-scrollbar { display: none; }
.galerie.zieht { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.galerie:not(.ein-foto) { cursor: grab; }
.galerie:focus { outline: none; }
.galerie:focus-visible { outline: 3px solid var(--blau); outline-offset: -3px; }
.galerie figure { position: relative; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; aspect-ratio: 4 / 3; max-height: min(62dvh, 640px); background: #eceef1; }
.galerie img { width: 100%; height: 100%; -webkit-user-drag: none; }
.d-zaehler { position: absolute; right: 10px; bottom: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; pointer-events: none; z-index: 2; }
.d-pfeil { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); display: none; place-items: center; cursor: pointer; box-shadow: 0 1px 8px rgba(0, 0, 0, .3); transition: opacity .2s, background .2s; }
.d-pfeil svg { width: 22px; height: 22px; }
.d-pfeil:hover { background: #fff; }
.d-pfeil.links { left: 8px; } .d-pfeil.rechts { right: 8px; }
.d-pfeil.aus { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .d-pfeil { display: grid; } } /* am PC immer sichtbar, am Handy wischt man */
.d-punkte { display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.d-punkte i { width: 7px; height: 7px; border-radius: 50%; background: var(--linie); transition: background .2s, transform .2s; }
.d-punkte i.an { background: var(--ink); transform: scale(1.25); }
/* Kein Anbieter-Foto: ehrlicher Hinweis statt so tun als ob */
.d-ohnefoto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; border-radius: var(--r-m); background: var(--blau-hell); color: var(--ink); }
.d-ohnefoto p { margin: 0; flex: 1 1 200px; font-size: 14.5px; line-height: 1.4; }
.d-ohnefoto .knopf { flex: none; min-height: 44px; }
.galerie-box.ohne-foto figure:not(:first-child), .galerie-box.ohne-foto .d-pfeil, .galerie-box.ohne-foto .d-punkte, .galerie-box.ohne-foto .d-zaehler { display: none; }
.galerie figcaption { position: absolute; left: 10px; bottom: 10px; z-index: 1; max-width: calc(100% - 90px); font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .92); padding: 4px 9px; border-radius: 999px; }
.blatt-inhalt { padding: var(--s3) var(--s5) var(--s5); display: grid; gap: var(--s5); }
.d-kopf { display: grid; gap: 6px; }
.d-preis { font-size: 38px; font-weight: 800; letter-spacing: -.05em; line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-preis small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--grau); }
.d-kopf h2 { font-size: 27px; letter-spacing: -.035em; }
.d-zeile { color: var(--ink-2); }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.d-hervor { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--blau-hell); color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.d-block { display: grid; gap: var(--s3); }
.d-block h3 { font-size: var(--t-l); letter-spacing: -.03em; }
.d-weg-haupt { display: flex; align-items: center; gap: var(--s4); background: var(--grund); border-radius: var(--r-m); padding: var(--s4); }
.d-weg-haupt .min { white-space: nowrap; font-size: 38px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.d-weg-haupt .min small { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.d-weg-haupt .wie { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.d-weg-haupt .linien { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--ink); font-weight: 700; }
.d-weg-andere { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 14px; }
.d-weg-andere div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--linie); padding-bottom: 6px; }
.d-weg-andere b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle { display: grid; gap: 6px; font-size: 15px; font-variant-numeric: tabular-nums; }
.tabelle div { display: flex; justify-content: space-between; gap: var(--s3); color: var(--ink-2); }
.tabelle .summe { color: var(--ink); font-weight: 800; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 2px; font-size: 17px; }
.tabelle-titel { font-weight: 700; margin-top: var(--s2); }
.fair { border-radius: var(--r-m); padding: var(--s4); display: grid; gap: var(--s3); }
.fair.zu-viel { background: var(--schlecht-hell); }
.fair.fair-passt { background: var(--gut-hell); }
.fair b.urteil { font-size: 19px; letter-spacing: -.02em; }
.fair.zu-viel b.urteil { color: var(--schlecht); }
.fair.fair-passt b.urteil { color: var(--gut); }
.fair .rechnung { display: grid; gap: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.fair .rechnung div { display: flex; justify-content: space-between; gap: var(--s3); }
.fair .klein { font-size: 12.5px; color: var(--ink-2); }
.erklaer { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.erklaer li { display: grid; gap: 2px; padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--grund); font-size: 14px; color: var(--ink-2); }
.erklaer li b { color: var(--ink); font-size: 15px; }
.stopp { background: var(--nacht); color: #fff; border-radius: var(--r-m); padding: var(--s5); display: grid; gap: var(--s3); }
.stopp b { font-size: 32px; letter-spacing: -.04em; color: var(--fake); line-height: 1; }
.stopp ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.stopp p { color: #cfcfcf; font-size: 14px; }
.zitat { background: var(--grund); border-radius: var(--r-m); padding: var(--s4); color: var(--ink-2); font-size: 15px; }
.zitat span { display: block; font-size: var(--t-xs); color: var(--grau); margin-top: 6px; }
.d-aktionen { position: sticky; bottom: 0; display: flex; gap: var(--s2); padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--linie); }
.d-aktionen .knopf { flex: 1 1 0; min-width: 0; padding-inline: 12px; white-space: nowrap; }
.d-aktionen .rund { flex: none; }
.d-aktionen .rund { width: 48px; height: 48px; box-shadow: inset 0 0 0 1.5px var(--linie); }

/* Schreiben */
.schreiben-in { padding: var(--s5); display: grid; gap: var(--s4); }
.schreiben-in h2 { font-size: 27px; letter-spacing: -.04em; padding-right: 48px; }
.schreiben-in textarea { width: 100%; min-height: 260px; resize: vertical; border: 0; border-radius: var(--r-m); background: var(--grund); padding: var(--s4); font: inherit; font-size: 15px; line-height: 1.55; color: var(--ink); }
.schreiben-in textarea:focus { outline: 2px solid var(--blau); }
.schreiben-in .knoepfe { display: flex; flex-wrap: wrap; gap: var(--s2); }
.schreiben-in .hinweis { font-size: var(--t-xs); color: var(--grau); }
.ki-zeile { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.ki-zeile i { font-style: normal; background: var(--blau); color: #fff; border-radius: 5px; padding: 2px 6px; font-size: 11px; }

/* Galerie: Foto komplett auf ruhiger, fester Fläche (Paul 03.11.: kein „wavy“ Durchswipen mehr, keine mitlaufende Unschärfe) */
.galerie { overscroll-behavior: contain; }
.galerie img.dt-bild { position: relative; width: 100%; height: 100%; object-fit: contain; }

/* Feed: Detailblatt als eigenes Fenster (Handy von unten, PC mittig) */
.dt-grund { position: fixed; inset: 0; z-index: 60; background: rgba(17, 17, 18, .5); animation: dt-ein .2s ease-out; }
.dt-blatt { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 94dvh; display: flex; flex-direction: column; background: var(--weiss, #fff); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .3); animation: dt-hoch .28s var(--sanft, ease-out); }
.dt-blatt[hidden], .dt-grund[hidden] { display: none; }
.dt-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; }
.dt-blatt .d-aktionen { position: static; flex: none; align-items: center; }
.dt-blatt .d-aktionen .dt-herz { flex: none; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--linie); display: grid; place-items: center; cursor: pointer; }
.dt-blatt .d-aktionen .dt-herz svg { width: 24px; height: 24px; }
.dt-blatt .d-aktionen .dt-herz[aria-pressed="true"] { color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--blau); }
.dt-blatt .d-aktionen .dt-herz[aria-pressed="true"] svg { fill: currentColor; }
.dt-blatt .schreiben-in textarea { min-height: 220px; }
@keyframes dt-hoch { from { transform: translateY(70px); opacity: .4; } }
@keyframes dt-ein { from { opacity: 0; } }
@media (min-width: 760px) {
  .dt-blatt { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); border-radius: 24px; animation: dt-auf .22s ease-out; }
  @keyframes dt-auf { from { opacity: 0; transform: translate(-50%, -47%); } }
}
@media (max-width: 420px) { .dt-blatt .d-aktionen { padding-inline: 12px; gap: 6px; } .dt-blatt .d-aktionen .knopf { font-size: 14px; padding-inline: 8px; } }
@media (prefers-reduced-motion: reduce) { .dt-blatt, .dt-grund { animation: none; } }
body.dt-offen { overflow: hidden; }
/* m² groß neben dem Preis, Wünsche-Zeile, kleine Hinweise (03.11.) */
.d-flaeche { font-size: .6em; letter-spacing: -.02em; white-space: nowrap; }
.d-preis small { flex-basis: 100%; }
.d-wunsch { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--blau-tief); }
.d-klein { font-size: 13px; color: var(--grau); }
.d-mietcheck p { color: var(--ink-2); font-size: 15px; }
.d-mietcheck .knopf { justify-self: start; }
/* Paul 03.11.: am PC waren die unteren Ecken des Feed-Detailblatts eckig und der Fuß klebte unten. Rundung schneidet jetzt alles mit,
   der Fuß hat Luft und sitzt innerhalb der Rundung. Am Handy bleibt das Blatt unten bündig (safe-area über .d-aktionen). */
.dt-blatt { overflow: hidden; }
@media (min-width: 760px) { .dt-blatt .d-aktionen { padding: 14px 24px 18px; border-radius: 0 0 24px 24px; background: #fff; } }
/* „Kurz zusammengefasst“ (Paul 03.11.) */
.d-kurz { margin-top: 12px; }
.d-kurz-knopf { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: #e8f0fe; color: var(--blau-tief); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.d-kurz-knopf svg { width: 18px; height: 18px; flex: none; }
.d-kurz-knopf:disabled { opacity: .7; cursor: progress; }
.d-kurz-ergebnis { padding: 14px 16px; border-radius: var(--r-m); background: #f1f5fd; box-shadow: inset 0 0 0 1px #dbe6fb; }
.d-kurz-ergebnis b { font-size: 15px; }
.d-kurz-ergebnis ul { margin: 8px 0 6px; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; line-height: 1.4; }
.d-kurz-ergebnis small { font-size: 12.5px; color: var(--ink-2); }

/* Karte „Wo es liegt“ (ganz unten im Detailblatt): Platzhalter mit einem Tipp zum Laden, danach die OpenStreetMap-Karte */
.d-karte-ort { margin: 0; font-weight: 600; }
.d-karte-platz { position: relative; display: grid; border-radius: var(--r-m); overflow: hidden; background: linear-gradient(135deg, #e8edf3, #dfe6ee); aspect-ratio: 16 / 10; }
.d-karte-knopf { align-self: center; justify-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--sh-1); }
.d-karte-knopf svg { width: 20px; height: 20px; color: var(--blau); }
.d-karte-knopf:disabled { opacity: .7; cursor: progress; }
.d-karte-rahmen { width: 100%; height: 100%; border: 0; display: block; }
.d-karte-hinweis a { color: var(--blau-tief); font-weight: 700; }
@media (min-width: 700px) { .d-karte-platz { aspect-ratio: 16 / 9; } }
.d-karte-aus { border: 0; background: none; padding: 12px 0; margin: -12px 0; font: inherit; font-size: inherit; color: var(--grau); text-decoration: underline; cursor: pointer; }
.d-karte-aus:hover { color: var(--ink); }

/* Standort oben (Paul 04.11.): eine Zeile mit Pin, tippen springt zur Karte */
.d-ort { display: flex; align-items: flex-start; gap: 6px; width: 100%; min-height: 44px; margin: 2px 0 0; padding: 10px 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.d-ort svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--blau); }
.d-ort span { text-decoration: underline; text-decoration-color: var(--linie, #dcdcdc); text-underline-offset: 3px; }
.d-ort + .d-zeile { margin-top: -6px; }
/* Ohne automatische Karte: kein großer leerer Kasten, nur ein flacher Knopf */
.d-karte-platz:has(.d-karte-knopf:not(:disabled)) { aspect-ratio: auto; min-height: 64px; }
