/* Ladestopp — eine Spalte, für das Telefon am Armaturenbrett. Große Tippflächen. */

:root {
  --bg: #f3f5f8;
  --karte: #ffffff;
  --karte-2: #eaeef3;
  --text: #121820;
  --text-2: #5f6b7a;
  --linie: rgba(18, 24, 32, .1);
  --akzent: #0a6cf0;
  --akzent-text: #ffffff;
  --akzent-weich: rgba(10, 108, 240, .12);
  --gruen: #13854a;
  --gruen-weich: rgba(19, 133, 74, .13);
  --gelb: #9a6200;
  --gelb-weich: rgba(214, 145, 0, .16);
  --rot: #c62f26;
  --rot-weich: rgba(198, 47, 38, .12);
  --radius: 16px;
  --tipp: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1117;
    --karte: #161d26;
    --karte-2: #1f2833;
    --text: #eef2f6;
    --text-2: #93a0b0;
    --linie: rgba(238, 242, 246, .1);
    --akzent: #3d8dff;
    --akzent-text: #06101f;
    --akzent-weich: rgba(61, 141, 255, .18);
    --gruen: #3ccf7c;
    --gruen-weich: rgba(60, 207, 124, .15);
    --gelb: #ffb536;
    --gelb-weich: rgba(255, 181, 54, .15);
    --rot: #ff6b61;
    --rot-weich: rgba(255, 107, 97, .15);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c1117;
  --karte: #161d26;
  --karte-2: #1f2833;
  --text: #eef2f6;
  --text-2: #93a0b0;
  --linie: rgba(238, 242, 246, .1);
  --akzent: #3d8dff;
  --akzent-text: #06101f;
  --akzent-weich: rgba(61, 141, 255, .18);
  --gruen: #3ccf7c;
  --gruen-weich: rgba(60, 207, 124, .15);
  --gelb: #ffb536;
  --gelb-weich: rgba(255, 181, 54, .15);
  --rot: #ff6b61;
  --rot-weich: rgba(255, 107, 97, .15);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* ---------- Kopf ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--linie);
}
.kopf-innen {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kopf h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.icon-btn {
  width: var(--tipp); height: var(--tipp);
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2);
  cursor: pointer;
}

/* ---------- Seite ---------- */

.seite {
  max-width: 640px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 16px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.karte {
  background: var(--karte);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--linie);
}

.feld-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ---------- Suche ---------- */

.suche { display: flex; flex-direction: column; gap: 12px; }
.suche .feld-label { margin-bottom: -4px; }

.reichweite { display: flex; align-items: baseline; gap: 8px; }
.reichweite input {
  width: 100%;
  min-width: 0;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  border: 0;
  border-bottom: 2px solid var(--linie);
  background: transparent;
  padding: 4px 0;
}
.reichweite input:focus { outline: none; border-bottom-color: var(--akzent); }
.reichweite input.ungueltig { border-bottom-color: var(--rot); }
.reichweite .einheit { font-size: 24px; font-weight: 600; color: var(--text-2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid var(--linie);
  background: var(--karte-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--karte-2);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; }
.segment span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.segment input:checked + span { background: var(--karte); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segment input:focus-visible + span { outline: 3px solid var(--akzent); }

.ort summary { color: var(--akzent); font-weight: 600; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.ort input, .dialog input[type="text"], .dialog input[type="password"], .dialog select, .mit-einheit input {
  width: 100%;
  min-height: var(--tipp);
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: var(--karte-2);
}
.ort input { margin-top: 8px; }

.primaer, .sekundaer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tipp);
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primaer { background: var(--akzent); color: var(--akzent-text); }
.primaer:disabled { opacity: .6; cursor: progress; }
.sekundaer { background: var(--akzent-weich); color: var(--akzent); }
.suche .primaer { min-height: 56px; font-size: 18px; margin-top: 4px; }

/* ---------- Status ---------- */

.schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.schritte li { position: relative; padding-left: 26px; font-size: 15px; color: var(--text-2); }
.schritte li::before {
  content: "";
  position: absolute; left: 4px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-2);
}
.schritte li.laeuft::before { background: var(--akzent); animation: puls 1s ease-in-out infinite; }
.schritte li.ok::before { background: var(--gruen); }
.schritte li.warn { color: var(--gelb); }
.schritte li.warn::before { background: var(--gelb); }
.schritte li.fehler { color: var(--rot); font-weight: 600; }
.schritte li.fehler::before { background: var(--rot); }
@keyframes puls { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .schritte li.laeuft::before { animation: none; } }

/* ---------- Treffer ---------- */

.ergebnisse { display: flex; flex-direction: column; gap: 12px; }
.treffer { display: flex; flex-direction: column; gap: 12px; border-left-width: 5px; }
.treffer[data-ampel="gruen"] { border-left-color: var(--gruen); }
.treffer[data-ampel="gelb"] { border-left-color: var(--gelb); }
.treffer[data-ampel="rot"] { border-left-color: var(--rot); opacity: .85; }

.empfehlung {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gruen);
  color: var(--karte);
}

.treffer-kopf { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.treffer-titel { min-width: 0; }
.treffer-titel h3 { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.betreiber { font-size: 14px; color: var(--text-2); }

.ampel {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--karte-2);
  color: var(--text-2);
}
.ampel-gruen { background: var(--gruen-weich); color: var(--gruen); }
.ampel-gelb { background: var(--gelb-weich); color: var(--gelb); }
.ampel-rot { background: var(--rot-weich); color: var(--rot); }
.ampel-laeuft { background: var(--akzent-weich); color: var(--akzent); }

.infos { display: flex; flex-wrap: wrap; gap: 6px; }
.info {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--karte-2);
  font-variant-numeric: tabular-nums;
}
.info.hervor { background: var(--akzent-weich); color: var(--akzent); }

.treffer-koerper { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.treffer-koerper > .bewertung:only-child { grid-column: 1 / -1; }
.bild-knopf { padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--karte-2); cursor: zoom-in; aspect-ratio: 1; width: 100%; max-width: 100%; }
.bild-knopf img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bewertung { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.klein { font-size: 14px; color: var(--text-2); }
.fehlertext { color: var(--rot); }
.rezension { font-style: italic; }

.knoepfe { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.knoepfe a { padding: 0 8px; font-size: 15px; white-space: nowrap; }

/* ---------- Leerzustand, Ausgeschlossen, Quellen ---------- */

.leer { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 0; color: var(--text-2); max-width: 62ch; }
.leer h2 { font-size: 17px; color: var(--text); }
.leer strong { color: var(--text); }

.ausgeschlossen { color: var(--text-2); font-size: 15px; }
.ausgeschlossen summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.ausgeschlossen ul { margin: 0; padding-left: 20px; }

.quellen { font-size: 12px; color: var(--text-2); text-align: center; }

/* ---------- Dialoge ---------- */

.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 20px;
  padding: 20px 16px;
  background: var(--karte);
  color: var(--text);
}
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog form { display: flex; flex-direction: column; gap: 10px; }
.dialog h2 { font-size: 20px; margin-bottom: 4px; }
.dialog .feld-label { margin: 6px 0 -4px; }
.hinweis { font-size: 13px; color: var(--text-2); }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.zweispaltig > div { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.zweispaltig .feld-label { margin: 6px 0 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.mit-einheit { display: flex; align-items: center; gap: 6px; }
.mit-einheit input { font-variant-numeric: tabular-nums; }
.mit-einheit span { color: var(--text-2); font-size: 14px; }
.schalter { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-top: 6px; }
.schalter input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--akzent); }
.dialog-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

.bild-dialog { padding: 12px; }
.bild-dialog img { width: 100%; border-radius: 12px; display: block; }
