/* Tankstellen-Ampel – Startseite: Hero, Suche, Ergebnisse, Karte */

/* Gemeinsame Ampel-Zuordnung */
.c-low  { --c: var(--g); --c-ink: var(--g-ink); --c-tint: var(--g-tint); }
.c-mid  { --c: var(--y); --c-ink: var(--y-ink); --c-tint: var(--y-tint); }
.c-high { --c: var(--r); --c-ink: var(--r-ink); --c-tint: var(--r-tint); }
.c-closed { --c: var(--line-2); --c-ink: var(--muted); --c-tint: transparent; }
.sym { flex: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(28px, 5vw, 60px) 0 clamp(28px, 4vw, 48px);
}
/* Mittellinie als Straßenmarkierung */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 22px, transparent 22px 40px);
  opacity: .8;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-main { min-width: 0; display: grid; gap: 0; }
.hero h1 { font-size: clamp(2.1rem, 1.1rem + 3.6vw, 3.7rem); line-height: 1.02; letter-spacing: -.025em; max-width: 15ch; }
.lead { margin-top: 16px; font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }

/* Einklappen nach der Suche */
.collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s ease, opacity .25s ease; }
.collapsible > * { overflow: hidden; min-height: 0; }
.hero.is-compact .collapsible, .has-q .hero .collapsible { grid-template-rows: 0fr; opacity: 0; visibility: hidden; }
.hero.is-compact .hero-ampel, .has-q .hero .hero-ampel { display: none; }
.hero.is-compact .hero-grid, .has-q .hero .hero-grid { grid-template-columns: minmax(0, 1fr); }
.hero.is-compact, .has-q .hero { padding: 14px 0 16px; }
.hero.is-compact .finder-wrap, .has-q .hero .finder-wrap { margin: 0; }

/* Suchformular */
.finder { display: grid; gap: 14px; margin-top: 28px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.finder-row { display: flex; gap: 10px; align-items: stretch; }
.finder-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-msg { color: var(--r-ink); font-weight: 500; font-size: .95rem; padding: 2px 4px; }
.form-msg::before { content: "Hinweis: "; font-weight: 700; }

.combo { position: relative; flex: 1 1 260px; min-width: 0; }
.combo input {
  width: 100%; height: 52px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--raised);
  padding: 0 44px 0 46px; font-size: 1.05rem;
}
.combo input::placeholder { color: var(--muted); opacity: 1; }
.combo input:hover { border-color: var(--ink-2); }
.combo input:focus-visible { outline-offset: 1px; border-radius: 12px; }
.combo-ico { position: absolute; left: 15px; top: 16px; color: var(--muted); pointer-events: none; }
.clear-btn { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 10px; }
.clear-btn:hover { background: var(--sunken); color: var(--ink); }
.suggest {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); max-height: 340px; overflow: auto;
}
.suggest li { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--sunken); }
.suggest li[aria-selected="true"] { outline: 2px solid var(--focus); outline-offset: -2px; }
.sg-main { font-weight: 600; }
.sg-sub { color: var(--muted); font-size: .92rem; }

/* Segmentierte Auswahl (Radio) */
.seg { display: inline-flex; margin: 0; padding: 3px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--raised); position: relative; min-width: 0; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label { padding: 9px 18px; border-radius: 9px; font-weight: 600; cursor: pointer; line-height: 1.2; user-select: none; }
.seg label:hover { background: var(--sunken); }
.seg input:checked + label { background: var(--btn-bg); color: var(--btn-fg); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg-sm label { padding: 7px 14px; font-size: .92rem; }

.field { display: inline-flex; align-items: center; gap: 10px; }
.field label { font-weight: 500; color: var(--ink-2); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 38px 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--raised); font-weight: 600; cursor: pointer; }
.select-wrap select:hover { border-color: var(--ink-2); }
.select-wrap svg { position: absolute; right: 12px; top: 14px; pointer-events: none; color: var(--muted); }

.quick { margin-top: 18px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .92rem; }
.chip:hover { background: var(--sunken); }
.chip-last { background: var(--sunken); }

.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; font-size: .94rem; color: var(--ink-2); }
.steps li { display: flex; gap: 10px; align-items: flex-start; }
.steps b { display: block; color: var(--ink); font-weight: 600; }
.steps .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); font: 800 .8rem/24px var(--font-display); text-align: center; }

/* Ampel (das eine auffällige Element) */
.ampel { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.housing { display: grid; gap: 14px; padding: 16px; border-radius: 34px; background: var(--housing); box-shadow: inset 0 0 0 1.5px #3b434b, 0 18px 40px -22px rgba(0, 0, 0, .55); }
.lamp { display: block; width: 54px; height: 54px; border-radius: 50%; animation: lamp-on .5s ease-out both; }
.lamp-r { background: #e0483a; box-shadow: 0 0 26px 2px rgba(224, 72, 58, .5); animation-delay: .25s; }
.lamp-y { background: #f0b90b; box-shadow: 0 0 26px 2px rgba(240, 185, 11, .5); animation-delay: .65s; }
.lamp-g { background: #2bc46c; box-shadow: 0 0 26px 2px rgba(43, 196, 108, .55); animation-delay: 1.05s; }
@keyframes lamp-on { from { opacity: .14; box-shadow: none; } to { opacity: 1; } }
.ampel-legend { list-style: none; margin: 0; padding: 16px 0; display: grid; gap: 14px; }
.ampel-legend li { height: 54px; display: flex; flex-direction: column; justify-content: center; }
.lg-title { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--c-ink); }
.lg-text { font-size: .92rem; color: var(--ink-2); }
.hero.is-compact .hero-ampel, .has-q .hero .hero-ampel { display: none; }

/* Kompakte Suche (nach der Suche): eine Zeile */
.hero.is-compact .finder, .has-q .hero .finder { margin-top: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
@media (min-width: 1000px) {
  .hero.is-compact .finder, .has-q .hero .finder { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 24px; }
  .hero.is-compact .form-msg, .has-q .hero .form-msg { grid-column: 1 / -1; }
}

/* ---------- Ergebnisbereich ---------- */
.app[hidden] { display: none; }
.app-grid { display: grid; grid-template-columns: 1fr; }
.list-col { padding: 16px; min-width: 0; }
.app:not(.has-results) .list-col { max-width: 760px; margin: 0 auto; width: 100%; padding-top: 28px; padding-bottom: 28px; }
.map-col { display: none; }
.list-col.is-loading { opacity: .55; pointer-events: none; transition: opacity .2s; }

@media (min-width: 900px) {
  .app.has-results .app-grid {
    grid-template-columns: minmax(400px, 480px) minmax(0, 1fr);
    height: calc(100dvh - var(--top-h, 200px)); min-height: 560px;
  }
  .app.has-results .list-col { overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 28px; border-right: 1px solid var(--line); scrollbar-gutter: stable; }
  .app.has-results .map-col { display: block; position: relative; background: var(--sunken); }
  .view-switch { display: none !important; }
}
.map { position: absolute; inset: 0; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--ink-2); }
.map-fallback[hidden] { display: none; }
.map[hidden] { display: none; }

@media (max-width: 899px) {
  .app.has-results .list-col { padding-bottom: 96px; }
  .app.view-map .list-col { display: none; }
  .app.view-map .map-col { display: block; position: relative; height: calc(100dvh - var(--top-h, 220px)); min-height: 380px; background: var(--sunken); }
  .app.has-results .view-switch { display: flex; }
}
.view-switch {
  display: none; position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 45;
  padding: 4px; gap: 2px; border-radius: 999px; background: var(--btn-bg); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5);
}
.view-switch button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: transparent; color: var(--btn-fg); font-weight: 600; opacity: .75; }
.view-switch button[aria-pressed="true"] { background: var(--raised); color: var(--ink); opacity: 1; }
:root[data-theme="dark"] .view-switch button[aria-pressed="true"] { background: #14171a; color: #eceae6; }
:root[data-theme="dark"] .view-switch { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .8), inset 0 0 0 1px var(--line-2); }

/* Status: Laden, Fehler */
.status { margin-bottom: 14px; }
.status-error { background: var(--surface); border: 1px solid var(--line-2); border-left: 5px solid var(--r); border-radius: var(--radius); padding: 20px 22px; }
.status-error h2 { font-size: 1.25rem; margin-bottom: 6px; }
.status-error p { color: var(--ink-2); }
.status-actions { margin-top: 14px; }
.sk-sum, .sk-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sk-sum { height: 168px; padding: 22px; display: grid; gap: 12px; align-content: start; margin-bottom: 14px; }
.sk-sum i { height: 18px; border-radius: 6px; background: var(--sunken); }
.sk-sum i:nth-child(1) { width: 55%; } .sk-sum i:nth-child(2) { width: 80%; height: 38px; } .sk-sum i:nth-child(3) { width: 100%; height: 14px; }
.sk-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.sk { display: grid; grid-template-columns: 5px 1fr 90px; gap: 14px; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); height: 94px; }
.sk-bar { background: var(--line-2); }
.sk-l, .sk-r { display: grid; gap: 8px; align-content: center; }
.sk i { display: block; height: 12px; border-radius: 6px; background: var(--sunken); }
.sk-l i:nth-child(1) { width: 45%; height: 15px; } .sk-l i:nth-child(2) { width: 75%; } .sk-l i:nth-child(3) { width: 35%; }
.sk-r i:nth-child(1) { height: 24px; } .sk-r i:nth-child(2) { width: 60%; justify-self: end; }
.sk-sum i, .sk i { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* Zusammenfassung */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; box-shadow: var(--shadow); }
.sum-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sum-title { font-size: 1.05rem; letter-spacing: -.005em; }
.sum-sub { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.sum-actions { display: flex; gap: 6px; flex: none; }
.sum-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.fig { display: grid; gap: 2px; align-content: start; min-width: 0; }
.fig + .fig { padding-left: 14px; border-left: 1px solid var(--line); }
.fig-label { font-size: .84rem; color: var(--muted); font-weight: 500; }
.fig-val { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1; letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: 4px; }
.fig-val sup { font-size: .55em; vertical-align: baseline; position: relative; top: -.62em; line-height: 0; margin-left: 1px; }
.fig-val small { font: 500 .8rem var(--font-text); color: var(--muted); letter-spacing: 0; }
.fig-best .fig-val { color: var(--g-ink); }
.fig-sub { font-size: .85rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-none { margin-top: 14px; color: var(--ink-2); }

.ampelbar { display: flex; gap: 3px; height: 30px; margin-top: 16px; border-radius: 9px; overflow: hidden; }
.ab-seg { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 38px; font: 800 .85rem var(--font-display); }
.ab-seg.c-low { background: var(--mk-g-bg); color: var(--mk-g-fg); }
.ab-seg.c-mid { background: var(--mk-y-bg); color: var(--mk-y-fg); }
.ab-seg.c-high { background: var(--mk-r-bg); color: var(--mk-r-fg); }
.ab-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; color: var(--ink-2); }
.ab-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ab-legend .sym { color: var(--c); }
.sum-src { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.sum-src .mtsk-l, .sum-src .mtsk-w { height: 28px; }

/* Werkzeugleiste */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 16px 2px 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; font-weight: 500; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--btn-bg); }
:root[data-theme="dark"] .switch input:checked + .switch-track { background: var(--g); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.count { font-size: .86rem; color: var(--muted); margin: 0 2px 8px; }

/* Stationsliste: ein Block, Zeilen mit Signalstreifen */
.stations { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.st { border-bottom: 1px solid var(--line); scroll-margin: 12px; }
.st:last-child { border-bottom: 0; }
.st.is-selected { background: var(--sel); }
.st-main { width: 100%; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto 20px; gap: 14px; align-items: center; text-align: left; padding: 14px 12px 14px 0; border: 0; background: transparent; border-radius: 0; }
.st-main:hover { background: var(--sel); }
.st-main:focus-visible { outline-offset: -3px; border-radius: 0; }
.st-bar { align-self: stretch; background: var(--c); border-radius: 0 4px 4px 0; transition: width .15s; }
.st.is-selected .st-bar { width: 10px; }
.st-info { display: grid; gap: 2px; min-width: 0; }
.st-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.st-addr { font-size: .88rem; color: var(--ink-2); }
.st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: .82rem; color: var(--muted); margin-top: 3px; }
.state { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.state-open i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); display: inline-block; }
.state-soon { white-space: nowrap; color: var(--ink); background: var(--sunken); padding: 1px 8px 1px 6px; border-radius: 999px; }
.state-closed { color: var(--muted); }
.age.is-old { font-style: italic; }
.st-price { display: grid; justify-items: end; gap: 5px; text-align: right; }
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.price sup { font-size: .55em; position: relative; top: -.6em; vertical-align: baseline; line-height: 0; margin-left: 1px; }
.price small { font: 500 .74rem var(--font-text); color: var(--muted); letter-spacing: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 8px; border-radius: 999px; background: var(--c-tint); color: var(--c-ink); font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.badge .sym { color: var(--c); }
.best-note { font-size: .74rem; font-weight: 600; color: var(--g-ink); }
.st-price-closed { gap: 2px; }
.closed-t { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--muted); }
.open-at { font-size: .78rem; color: var(--muted); max-width: 17ch; }
.st-chev { color: var(--muted); transition: transform .2s; }
.st.is-open .st-chev { transform: rotate(180deg); }

/* Details */
.st-det[hidden] { display: none; }
.det-body { padding: 4px 16px 18px 22px; display: grid; gap: 16px; }
.fuel-table { width: 100%; border-collapse: collapse; }
.fuel-table th, .fuel-table td { padding: 9px 8px 9px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; font-weight: 500; }
.fuel-table tr:last-child th, .fuel-table tr:last-child td { border-bottom: 0; }
.fuel-table tbody th { font-family: var(--font-display); font-weight: 700; width: 4.6em; }
.fuel-table tr.is-active th { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ft-price { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.ft-price sup { font-size: .55em; position: relative; top: -.55em; vertical-align: baseline; line-height: 0; margin-left: 1px; }
.ft-price small { font: 500 .72rem var(--font-text); color: var(--muted); margin-left: 3px; }
.ft-age { font-size: .82rem; color: var(--muted); text-align: right; }
.ft-none { color: var(--muted); font-size: .9rem; }
.det-closed { background: var(--sunken); padding: 12px 14px; border-radius: 10px; color: var(--ink-2); }
.det-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.det-cols h3 { font-family: var(--font-text); font-weight: 600; font-size: .84rem; letter-spacing: 0; color: var(--muted); margin-bottom: 3px; }
.det-cols p { font-size: .92rem; }
.hours { white-space: pre-line; }
.det-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.det-history { padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
.de-today { margin-top: 48px; }
.de-today[hidden] { display: none; }
.det-src { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.det-src .mtsk-l, .det-src .mtsk-w { height: 24px; }

.empty { padding: 28px 22px; display: grid; gap: 8px; justify-items: start; }
.empty h2 { font-size: 1.2rem; }
.empty p { color: var(--ink-2); }
.empty .btn { margin-top: 8px; }
.mtsk-note { display: flex; align-items: center; gap: 12px; margin: 16px 2px 0; font-size: .8rem; color: var(--muted); }

/* ---------- Karte: Marker + Popup ---------- */
.mk { cursor: pointer; line-height: 1; }
.mk-pill { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px 5px 7px; border-radius: 999px; background: var(--mk-bg); color: var(--mk-fg); font: 800 12.5px/1 var(--font-display); border: 2px solid var(--mk-edge); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); white-space: nowrap; margin-bottom: 7px; transition: transform .12s; transform-origin: 50% 100%; }
.mk-pill::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 9px; height: 9px; background: var(--mk-bg); border-right: 2px solid var(--mk-edge); border-bottom: 2px solid var(--mk-edge); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 3px 0; }
.mk-pill sup { font-size: .62em; position: relative; top: -.5em; vertical-align: baseline; line-height: 0; margin-left: 1px; }
.mk-pill .sym { flex: none; }
.mk--low { --mk-bg: var(--mk-g-bg); --mk-fg: var(--mk-g-fg); }
.mk--mid { --mk-bg: var(--mk-y-bg); --mk-fg: var(--mk-y-fg); }
.mk--high { --mk-bg: var(--mk-r-bg); --mk-fg: var(--mk-r-fg); }
.mk.is-best .mk-pill { box-shadow: 0 0 0 2.5px var(--ink), 0 2px 10px rgba(0, 0, 0, .4); }
.mk:hover .mk-pill { transform: scale(1.08); }
.mk.is-selected { z-index: 3000 !important; }
.mk.is-selected .mk-pill { transform: scale(1.18); box-shadow: 0 0 0 3px var(--focus), 0 4px 14px rgba(0, 0, 0, .4); }
.mk-dot { display: block; width: 13px; height: 13px; border-radius: 50%; background: #8d9196; border: 2px solid var(--mk-edge); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.mk--closed.is-selected .mk-dot { box-shadow: 0 0 0 3px var(--focus); }
.mk-center { pointer-events: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--mk-edge); box-shadow: 0 0 0 7px color-mix(in srgb, var(--ink) 18%, transparent); }

.ampel-popup .maplibregl-popup-content { background: var(--raised); color: var(--ink); border-radius: 14px; padding: 14px 16px 12px; box-shadow: var(--shadow); font-family: var(--font-text); min-width: 220px; }
.ampel-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .ampel-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .ampel-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--raised); }
.ampel-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip, .ampel-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .ampel-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--raised); }
.ampel-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--raised); }
.ampel-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--raised); }
.ampel-popup .maplibregl-popup-close-button { font-size: 20px; width: 32px; height: 32px; color: var(--muted); border-radius: 8px; }
.ampel-popup .maplibregl-popup-close-button:hover { background: var(--sunken); color: var(--ink); }
.pp { display: grid; gap: 4px; padding-right: 14px; }
.pp-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.pp-addr { font-size: .84rem; color: var(--ink-2); }
.pp-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.pp-price .price { font-size: 1.55rem; }
.pp-meta { font-size: .8rem; color: var(--muted); }
.pp-actions { display: flex; gap: 8px; margin-top: 10px; }
.pp-src { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.pp .btn-sm { height: 34px; font-size: .86rem; }

/* MapLibre-Bedienelemente im Dunkelmodus */
:root[data-theme="dark"] .maplibregl-ctrl-group { background: #22262a; }
:root[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: #444a50; }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1) brightness(1.1); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(18, 20, 22, .8); color: #c9c7c2; }
:root[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #e6e3dd; }
.maplibregl-ctrl-attrib { font-family: var(--font-text); font-size: 11px; }
.maplibregl-ctrl-attrib a:focus-visible, .maplibregl-ctrl button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---------- Erklärung + Datenquelle ---------- */
.explain { margin-top: 64px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.explain h2, .datasrc h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: 14px; }
.explain-text { display: grid; gap: 12px; color: var(--ink-2); max-width: 56ch; }
.scale { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.scale-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 22px; border-radius: 8px; overflow: hidden; }
.sb-low { background: var(--g); } .sb-mid { background: var(--y); } .sb-high { background: var(--r); }
.scale-marks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px 12px; }
.scale-marks li { display: grid; gap: 1px; font-size: .86rem; color: var(--ink-2); align-content: start; }
.scale-marks b { font-family: var(--font-display); font-size: 1rem; color: var(--c-ink); }
.scale-marks em { font-style: normal; font-weight: 600; color: var(--ink); }
.scale figcaption { margin-top: 14px; font-size: .8rem; color: var(--muted); }
.datasrc { margin-top: 56px; }
.datasrc-body { display: flex; gap: 20px; align-items: flex-start; max-width: 74ch; color: var(--ink-2); }
.datasrc-body img { margin-top: 2px; }
.seo-text { display: grid; gap: 12px; }

/* ---------- Textabschnitte (Zeit, Funktionen, Fragen) ---------- */
.seo-sec { margin-top: 56px; scroll-margin-top: calc(var(--header-h) + 12px); }
.seo-sec h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: 14px; }
.seo-sec .seo-text { max-width: 74ch; color: var(--ink-2); }
.seo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 74ch; color: var(--ink-2); }
.seo-list li { padding-left: 18px; position: relative; }
.seo-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--line-2); }
.seo-note { margin-top: 14px; max-width: 74ch; font-size: .88rem; color: var(--muted); }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px clamp(28px, 5vw, 64px); }
.faq-item { display: grid; gap: 6px; align-content: start; }
.faq-item h3 { font-size: 1.08rem; }
.faq-item p { color: var(--ink-2); }
#regel, #dsTitle, .datasrc { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- Mobil ---------- */
@media (max-width: 899px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-ampel { display: none; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .explain { grid-template-columns: 1fr; margin-top: 44px; }
  .faq { grid-template-columns: 1fr; gap: 22px; }
  .seo-sec { margin-top: 44px; }
}
@media (max-width: 640px) {
  .finder { padding: 12px; border-radius: 16px; margin-top: 22px; }
  .finder-row { flex-wrap: wrap; }
  .combo { flex-basis: 100%; }
  .finder-row .btn { flex: 1 1 0; }
  .finder-opts { justify-content: space-between; }
  .hero.is-compact .finder-row .btn, .has-q .hero .finder-row .btn { height: 44px; }
  .hero.is-compact .combo input, .has-q .hero .combo input { height: 48px; }
  .hero.is-compact .combo-ico, .has-q .hero .combo-ico { top: 14px; }
  .hero.is-compact .clear-btn, .has-q .hero .clear-btn { top: 4px; }
  .hero.is-compact .finder, .has-q .hero .finder { gap: 10px; }
  .hero.is-compact .field label, .has-q .hero .field label { display: none; }
  .hero.is-compact .select-wrap select, .has-q .hero .select-wrap select { height: 40px; }
  .hero.is-compact .select-wrap svg, .has-q .hero .select-wrap svg { top: 12px; }
  .hero.is-compact .seg label, .has-q .hero .seg label { padding: 7px 14px; }
  .fig-val { font-size: 1.65rem; }
  .price { font-size: 1.5rem; }
  .st-main { grid-template-columns: 5px minmax(0, 1fr) auto 16px; gap: 10px; }
  .det-cols { grid-template-columns: 1fr; }
  .datasrc-body { flex-direction: column; gap: 10px; }
  .list-col { padding: 12px; }
}
@media (max-width: 380px) {
  .st-main { grid-template-columns: 5px minmax(0, 1fr) auto; }
  .st-chev { display: none; }
}

/* Popup immer über den Markern */
.maplibregl-popup { z-index: 4000; }

.btn svg, .view-switch svg, .chip svg, .icon-btn svg { flex: none; }

@media (prefers-reduced-motion: reduce) {
  .lamp { animation: none; }
  .collapsible { transition: none; }
}

/* Mobil: Kartenattribution über dem Umschalter lassen */
@media (max-width: 899px) {
  .app.view-map .maplibregl-ctrl-bottom-right, .app.view-map .maplibregl-ctrl-bottom-left { margin-bottom: 78px; }
}
