/* Referenzen-Karte – Akin Immobilien GmbH
   Standard: dunkle Bühne (wie Apple-Produktseiten). Für eine helle Variante
   am <section> zusätzlich die Klasse "ref--hell" setzen.
   Farben über die Variablen an das Website-Design anpassen. */
.ref {
  --ref-bg: #1f2f38;
  --ref-flaeche: #263a45;
  --ref-flaeche-2: #2d4350;
  --ref-text: #ffffff;
  --ref-leise: #a9b9bf;
  --ref-linie: rgba(255, 255, 255, .1);
  --ref-akzent: #00aaaf;
  --ref-akzent-hell: #8fe6e8;
  --ref-land: #2a3e48;
  --ref-raster: rgba(255, 255, 255, .05);
  --ref-wasser: #4c7d90;
  --ref-strasse: #6f8690;
  --ref-strasse-rand: #2a3e48;
  --ref-schild: #2459b0;
  --ref-stadt: #9fb3bb;
  --ref-glas: rgba(31, 47, 56, .8);
  --ref-schatten: 0 24px 60px rgba(0, 0, 0, .55);
  --ref-radius: 22px;
  --ref-schrift: inherit;

  background: var(--ref-bg);
  color: var(--ref-text);
  font-family: var(--ref-schrift);
  padding: clamp(64px, 9vw, 128px) clamp(16px, 4vw, 56px);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.ref--hell {
  --ref-bg: #f5f5f7;
  --ref-flaeche: #ffffff;
  --ref-flaeche-2: #f0f0f2;
  --ref-text: #1d1d1f;
  --ref-leise: #6e6e73;
  --ref-linie: rgba(0, 0, 0, .08);
  --ref-akzent: #a8742a;
  --ref-akzent-hell: #c99a52;
  --ref-land: #fbfbfd;
  --ref-raster: rgba(0, 0, 0, .06);
  --ref-wasser: #cfe0ec;
  --ref-strasse: #c9ccd3;
  --ref-strasse-rand: #fbfbfd;
  --ref-stadt: #6e6e73;
  --ref-glas: rgba(255, 255, 255, .8);
  --ref-schatten: 0 24px 60px rgba(0, 0, 0, .14);
}
.ref *, .ref *::before, .ref *::after { box-sizing: border-box; }
.ref button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.ref [hidden] { display: none !important; }
.ref__innen, .ref > * { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* Kopf */
.ref__intro { margin-bottom: clamp(36px, 5vw, 56px); }
.ref__eyebrow { margin: 0 0 14px; font-size: .9rem; font-weight: 600; letter-spacing: .02em; color: var(--ref-akzent); }
.ref__intro h2 {
  margin: 0 0 18px; max-width: 14ch;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 700;
  background: linear-gradient(180deg, var(--ref-text) 30%, color-mix(in srgb, var(--ref-text) 55%, var(--ref-akzent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.ref__intro p { margin: 0; max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.45; color: var(--ref-leise); }

/* Kennzahlen */
.ref__zahlen { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 24px; margin: 0 auto 40px; padding-top: 28px; border-top: 1px solid var(--ref-linie); }
.ref__zahl { display: flex; flex-direction: column-reverse; gap: 6px; }
.ref__zahl dd { margin: 0; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ref__zahl-einheit { margin-left: .12em; font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--ref-leise); }
.ref__zahl dt { font-size: .92rem; color: var(--ref-leise); }
@media (max-width: 720px) { .ref__zahlen { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; } }

/* Bühne */
.ref__buehne {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; min-height: 640px; max-height: 860px; width: 100%;
  border-radius: var(--ref-radius);
  background: var(--ref-land);
  border: 1px solid var(--ref-linie);
  isolation: isolate;
}
.ref__buehne > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; cursor: grab; touch-action: pan-y; }
.ref__buehne.ist-gezoomt > svg { touch-action: none; }
.ref__buehne.ist-ziehen > svg { cursor: grabbing; }
.ref__buehne::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 120px 20px var(--ref-land); z-index: 0; }

.ref-k__land { fill: var(--ref-land); }
.ref-k__raster { fill: var(--ref-raster); }
.ref-k__glow-a { stop-color: var(--ref-akzent); stop-opacity: .16; }
.ref-k__glow-b { stop-color: var(--ref-akzent); stop-opacity: 0; }
.ref-k__pinglow-a { stop-color: var(--ref-akzent); stop-opacity: .45; }
.ref-k__region { transition: opacity .5s ease; }
.ref-k__region.ist-aus { opacity: .25; }
.ref-k__regionname text { font-size: 10.5px; font-weight: 600; letter-spacing: .22em; fill: var(--ref-akzent); fill-opacity: .55; }
.ref-k__fluss { fill: none; stroke: var(--ref-wasser); stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ref-k__fluss--gross { stroke-width: 3.6; }
.ref-k__strasse-rand { fill: none; stroke: var(--ref-strasse-rand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ref-k__strasse { fill: none; stroke: var(--ref-strasse); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ref-k__schild rect { fill: var(--ref-schild); stroke: rgba(255,255,255,.85); stroke-width: 1; }
.ref-k__schild text { font-size: 9px; font-weight: 700; fill: #fff; letter-spacing: .02em; }
.ref-k__stadt circle { fill: var(--ref-stadt); }
.ref-k__stadt text { font-size: 11px; fill: var(--ref-stadt); paint-order: stroke; stroke: var(--ref-land); stroke-width: 3px; stroke-linejoin: round; }
.ref-k__stadt--haupt text { font-size: 12.5px; font-weight: 600; fill: var(--ref-text); fill-opacity: .82; }
.ref-k__stadt:not(.ref-k__stadt--haupt) { transition: opacity .3s ease; }
.ref__buehne:not(.ist-nah) .ref-k__stadt:not(.ref-k__stadt--haupt) { opacity: 0; }

.ref-k__pin { cursor: pointer; outline: none; }
.ref-k__pin-innen { transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .35s ease; }
.ref-k__pin.ist-neu .ref-k__pin-innen,
.ref-k__pin.ist-aus .ref-k__pin-innen,
.ref-k__pin.ist-gebuendelt .ref-k__pin-innen { transform: scale(0); opacity: 0; }
.ref-k__pin.ist-aus, .ref-k__pin.ist-gebuendelt { pointer-events: none; }

/* Bündel */
.ref-k__cluster { cursor: pointer; outline: none; }
.ref-k__cluster-innen { transform: scale(0); opacity: 0; transition: transform .25s ease; }
.ref__buehne.ist-bereit .ref-k__cluster-innen { transform: none; opacity: 1; animation: ref-pop .55s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes ref-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ref-k__cluster-ring { fill: none; stroke: var(--ref-akzent); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 2 4; }
.ref-k__cluster-kreis { fill: var(--ref-akzent); stroke: var(--ref-land); stroke-width: 3; transition: r .3s ease; }
.ref-k__cluster-zahl { font-size: 13px; font-weight: 700; fill: #15130f; font-variant-numeric: tabular-nums; pointer-events: none; }
.ref-k__cluster:focus-visible .ref-k__cluster-kreis { stroke: var(--ref-text); }
@media (hover: hover) and (pointer: fine) {
  .ref__buehne.ist-bereit .ref-k__cluster:hover .ref-k__cluster-innen { transform: scale(1.12); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
}
.ref-k__kern { fill: var(--ref-akzent); stroke: var(--ref-land); stroke-width: 2.5; }
.ref-k__mitte { fill: var(--ref-land); transition: fill .2s ease; }
.ref-k__pinglow { opacity: .8; }
.ref-k__puls { fill: none; stroke: var(--ref-akzent); stroke-width: 1.5; opacity: 0; }
.ref-k__pin.ist-aktiv .ref-k__pin-innen { transform: scale(1.35); }
.ref-k__pin.ist-aktiv .ref-k__mitte { fill: #fff; }
.ref-k__pin.ist-aktiv .ref-k__puls { animation: ref-puls 2s cubic-bezier(.2, .6, .35, 1) infinite; }
.ref-k__pin.ist-hover .ref-k__pin-innen { transform: scale(1.2); }
.ref-k__pin:focus-visible .ref-k__kern { stroke: var(--ref-text); }
@media (hover: hover) and (pointer: fine) { .ref-k__pin:hover .ref-k__pin-innen { transform: scale(1.2); } }
@keyframes ref-puls { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }

/* Tooltip */
.ref__tipp {
  position: absolute; z-index: 3; pointer-events: none;
  transform: translate(-50%, calc(-100% - 18px)) scale(.96); opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  display: flex; flex-direction: column; gap: 2px; white-space: nowrap;
  padding: 8px 12px; border-radius: 12px;
  background: var(--ref-glas); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--ref-linie); box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.ref__tipp.ist-sichtbar { opacity: 1; transform: translate(-50%, calc(-100% - 18px)); }
.ref__tipp strong { font-size: .88rem; font-weight: 600; }
.ref__tipp span { font-size: .78rem; color: var(--ref-leise); }

/* Hinweis unter der Karte */
.ref__hinweis { margin: 12px 0 0; font-size: .82rem; color: var(--ref-leise); text-align: center; }
.ref__hinweis-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .ref__hinweis-maus { display: none; } .ref__hinweis-touch { display: inline; } }

/* Zoom */
.ref__zoom { position: absolute; z-index: 2; left: 16px; bottom: 16px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--ref-glas); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--ref-linie); }
.ref__zoom button { width: 40px; height: 40px; border: 0; border-top: 1px solid var(--ref-linie); background: transparent; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.ref__zoom button:first-child { border-top: 0; }
.ref__zoom button:disabled { opacity: .3; cursor: default; }
.ref__zoom button:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .ref__zoom button:not(:disabled):hover { background: var(--ref-linie); } }

/* Detail */
.ref__detail {
  position: absolute; z-index: 4; top: 16px; right: 16px; bottom: 16px;
  width: min(380px, calc(100% - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ref-glas); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--ref-linie); border-radius: 20px; box-shadow: var(--ref-schatten);
  opacity: 0; transform: translateX(16px);
  transition: opacity .3s ease, transform .45s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: thin;
}
.ref__detail.ist-sichtbar { opacity: 1; transform: none; }
.ref__detail-bild { position: relative; flex: 1 1 260px; min-height: 160px; max-height: 360px; background: var(--ref-flaeche-2); overflow: hidden; }
.ref__detail-inhalt { flex: none !important; }
.ref__detail-bild > img, .ref__detail-bild > svg, .ref__folie img, .ref__folie svg { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Galerie */
.ref__galerie { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.ref__galerie::-webkit-scrollbar { display: none; }
.ref__galerie:focus-visible { box-shadow: inset 0 0 0 2px var(--ref-akzent); }
.ref__folie { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.ref__galerie-pfeil {
  position: absolute; z-index: 1; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.45); color: #fff !important; font-size: 1.35rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease, background-color .2s ease;
}
.ref__galerie-pfeil--zurueck { left: 10px; }
.ref__galerie-pfeil--weiter { right: 10px; }
.ref__galerie-pfeil:disabled { opacity: 0 !important; pointer-events: none; }
.ref__detail-bild:hover .ref__galerie-pfeil, .ref__galerie-pfeil:focus-visible { opacity: 1; }
.ref__galerie-pfeil:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .ref__galerie-pfeil:hover { background: rgba(0,0,0,.65); } }
@media (hover: none) { .ref__galerie-pfeil { display: none; } }
.ref__galerie-anzeige { position: absolute; z-index: 1; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.ref__galerie-anzeige span { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.5); transition: width .3s cubic-bezier(.22, 1, .36, 1), background-color .3s ease; }
.ref__galerie-anzeige span.ist-aktiv { width: 18px; background: #fff; }
.ref__galerie-anzeige.ist-zahl { padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ref__detail-bild::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to bottom, transparent, rgba(0,0,0,.25)); pointer-events: none; }
.ref__detail-inhalt { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.ref__detail-inhalt.ist-wechsel { animation: ref-wechsel .4s cubic-bezier(.22, 1, .36, 1); }
@keyframes ref-wechsel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ref__detail-ort { margin: 0 0 6px; font-size: .82rem; font-weight: 600; color: var(--ref-akzent); }
.ref__detail-titel { margin: 0 0 18px; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.ref__detail-daten { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ref__detail-daten > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px; border-radius: 14px; background: var(--ref-linie); }
.ref__detail-daten > div { flex: 1 1 0; min-width: 0; }
.ref__detail-daten > div.ist-breit { flex-basis: 100%; }
.ref__detail-daten dd { margin: 0; white-space: nowrap; font-size: 1.12rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ref__detail-daten > div.ist-breit dd { font-size: 1rem; }
.ref__detail-daten dt { font-size: .76rem; color: var(--ref-leise); }
.ref__detail-text { margin: 16px 0 0; font-size: .92rem; line-height: 1.5; color: var(--ref-leise); }
.ref__detail-nav { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; }
.ref__detail-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ref-linie); background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.ref__detail-nav button:disabled { opacity: .3; cursor: default; }
.ref__detail-nav button:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .ref__detail-nav button:not(:disabled):hover { background: var(--ref-linie); } }
.ref__detail-pos { font-size: .82rem; color: var(--ref-leise); font-variant-numeric: tabular-nums; }
/* Projektliste im Popup (bei Bündeln, die sich nicht weiter auflösen) */
.ref__detail-liste { display: none; flex-direction: column; flex: 1; min-height: 0; padding: 22px 18px 18px; }
.ref__detail.ist-liste .ref__detail-liste { display: flex; }
.ref__detail.ist-liste .ref__detail-bild, .ref__detail.ist-liste .ref__detail-inhalt { display: none; }
.ref__detail-liste.ist-wechsel { animation: ref-wechsel .4s cubic-bezier(.22, 1, .36, 1); }
.ref__liste-kopf { padding: 0 44px 14px 4px; }
.ref__liste-kopf .ref__detail-titel { margin: 0; }
.ref__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.ref__liste-eintrag { width: 100%; display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 6px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: background-color .2s ease; }
.ref__liste-eintrag:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .ref__liste-eintrag:hover { background: var(--ref-linie); } }
.ref__liste-bild { display: block; width: 72px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--ref-flaeche-2); }
.ref__liste-bild > img, .ref__liste-bild > svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.ref__liste-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ref__liste-text strong { font-size: .95rem; font-weight: 600; line-height: 1.25; }
.ref__liste-text span { font-size: .8rem; color: var(--ref-leise); }
.ref__detail-zurliste { align-self: flex-start; margin: -6px 0 10px; padding: 4px 0; border: 0; background: none; font-size: .85rem; font-weight: 600; color: var(--ref-akzent) !important; cursor: pointer; }
.ref__detail-zurliste:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 2px; border-radius: 4px; }

.ref__detail-zu {
  position: absolute; z-index: 1; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.45); color: #fff !important; font-size: 1.2rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ref__detail-zu:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 2px; }

/* Karten-Reihe */
.ref__reihe-kopf { display: flex; align-items: center; justify-content: space-between; margin-top: clamp(40px, 5vw, 64px); margin-bottom: 18px; }
.ref__reihe-kopf h3 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -.02em; font-weight: 700; }
.ref__reihe-pfeile { display: flex; gap: 10px; }
.ref__reihe-pfeile button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ref-flaeche-2); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ref__reihe-pfeile button:disabled { opacity: .35; cursor: default; }
.ref__reihe-pfeile button:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 2px; }
.ref__reihe {
  list-style: none; margin: 0 auto; padding: 4px 2px 12px;
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 2px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.ref__reihe::-webkit-scrollbar { display: none; }
.ref__karte { flex: none; width: clamp(250px, 27vw, 320px); scroll-snap-align: start; }
.ref__karte > button {
  width: 100%; height: 100%; padding: 0; text-align: left; cursor: pointer;
  display: flex; flex-direction: column;
  background: var(--ref-flaeche); border: 1px solid var(--ref-linie); border-radius: 22px; overflow: hidden;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), border-color .2s ease, box-shadow .35s ease;
}
.ref__karte > button:focus-visible { outline: 2px solid var(--ref-akzent); outline-offset: 3px; }
.ref__karte.ist-aktiv > button { border-color: var(--ref-akzent); box-shadow: 0 0 0 1px var(--ref-akzent); }
@media (hover: hover) and (pointer: fine) {
  .ref__karte > button:hover { transform: translateY(-4px); box-shadow: var(--ref-schatten); }
  .ref__karte > button:hover .ref__karte-bild > * { transform: scale(1.04); }
}
.ref__karte-bild { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ref-flaeche-2); }
.ref__karte-bild > img, .ref__karte-bild > svg { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
.ref__karte-jahr {
  position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ref__karte-text { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 20px; }
.ref__karte-ort { font-size: .8rem; font-weight: 600; color: var(--ref-akzent); }
.ref__karte-text strong { font-size: 1.08rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.ref__karte-meta { font-size: .86rem; color: var(--ref-leise); }

/* Schmale Bildschirme */
@media (max-width: 760px) {
  .ref__buehne { aspect-ratio: 4 / 5; min-height: 0; max-height: 72vh; }
  .ref__zoom { top: 12px; bottom: auto; left: 12px; }
  .ref__buehne.hat-panel { overflow: visible; aspect-ratio: auto; max-height: none; background: none; border: 0; display: flex; flex-direction: column; }
  .ref__buehne.hat-panel > svg { position: relative; aspect-ratio: 4 / 5; max-height: 72vh; height: auto; border-radius: var(--ref-radius); background: var(--ref-land); border: 1px solid var(--ref-linie); }
  .ref__buehne.hat-panel::after { display: none; }
  .ref__detail { position: relative; top: auto; right: auto; bottom: auto; width: auto; margin-top: 12px; overflow: hidden; transform: translateY(12px); background: var(--ref-flaeche); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ref__detail-titel { font-size: 1.3rem; }
  .ref__liste { max-height: 60vh; }
  .ref__detail-daten > div { padding: 10px; }
  .ref__detail-daten dd { font-size: clamp(.9rem, 4.2vw, 1.12rem); }
  .ref__detail-bild { flex: none; aspect-ratio: 16 / 10; min-height: 0; max-height: none; }
  .ref__karte { width: 78vw; }
  .ref__reihe-pfeile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ref *, .ref *::before, .ref *::after { animation: none !important; transition: none !important; }
}

/* Sehr schmale Handys: Kennzahl-Kacheln im Popup zweispaltig */
@media (max-width: 380px) {
  .ref__detail-daten > div { flex: 1 1 calc(50% - 4px); }
}

/* Einbettung Akin: Kopf kommt aus der Seite, Bühne schließt nahtlos an */
.ref { padding-top: 8px; }
.ref__intro { display: none; }
.ref { padding-left: 0; padding-right: 0; }
.ref__innen, .ref > * { max-width: var(--wrap); padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
