/* Salt Scanner. Kühles Asphaltgrau, Ampelschild als einziges lautes Element.
   Signalfarben angelehnt an RAL 3020 Verkehrsrot, RAL 1023 Verkehrsgelb, RAL 6024 Verkehrsgrün. */

:root {
  --bg: #e8ebee;
  --bg-2: #dfe3e7;
  --surface: #f6f7f8;
  --surface-2: #eef0f2;
  --ink: #14181c;
  --ink-2: #39414a;
  --muted: #69727c;
  --line: #cdd3d9;
  --line-2: #dce0e4;
  --focus: #1f5fa8;

  --red: #c1121c;
  --yellow: #f2b000;
  --green: #00845a;
  --on-red: #fff;
  --on-yellow: #121212;
  --on-green: #fff;

  --road-red: #c1121c;
  --road-yellow: #c98f00;
  --road-green: #3d8f68;

  --temp: #1c2329;
  --surface-line: #6f7c89;
  --rain: #2f6aa3;
  --frozen: #aab6c1;
  --frost-zone: rgba(47, 106, 163, 0.09);
  --future: rgba(20, 24, 28, 0.035);

  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 1px 2px rgba(15, 20, 25, 0.06);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --top: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1113; --bg-2: #151a1d; --surface: #181d21; --surface-2: #1e2428;
    --ink: #e6e9ec; --ink-2: #c1c8ce; --muted: #8b959e; --line: #2b3238; --line-2: #232a2f; --focus: #7fb0ea;
    --red: #cf2027; --yellow: #f2b000; --green: #13955f;
    --road-red: #ff4b4b; --road-yellow: #f2b000; --road-green: #3fb27f;
    --temp: #e6e9ec; --surface-line: #8d9aa6; --rain: #6ea3d8; --frozen: #56636e;
    --frost-zone: rgba(110, 163, 216, 0.10); --future: rgba(255, 255, 255, 0.03);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e1113; --bg-2: #151a1d; --surface: #181d21; --surface-2: #1e2428;
  --ink: #e6e9ec; --ink-2: #c1c8ce; --muted: #8b959e; --line: #2b3238; --line-2: #232a2f; --focus: #7fb0ea;
  --red: #cf2027; --yellow: #f2b000; --green: #13955f;
  --road-red: #ff4b4b; --road-yellow: #f2b000; --road-green: #3fb27f;
  --temp: #e6e9ec; --surface-line: #8d9aa6; --rain: #6ea3d8; --frozen: #56636e;
  --frost-zone: rgba(110, 163, 216, 0.10); --future: rgba(255, 255, 255, 0.03);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
svg { display: block; }

.label {
  font: 600 11.5px/1.2 var(--font-cond);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 6px;
  height: calc(var(--top) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-mark { width: 18px; height: 26px; flex: none; }
.brand-mark rect { fill: var(--ink); }
.brand-mark circle { fill: var(--bg); opacity: 0.35; }
.brand span { font: 700 19px/1 var(--font-cond); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.where { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; margin-right: 4px; min-width: 0; }
.where-place { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.where-stamp { font-size: 12px; color: var(--muted); white-space: nowrap; }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg { width: 17px; height: 17px; }
.icon-btn.is-busy svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.layout {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px calc(32px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.block + .block { margin-top: 14px; }

@media (min-width: 1000px) {
  .layout {
    max-width: 1440px;
    display: grid;
    grid-template-columns: minmax(400px, 460px) 1fr;
    column-gap: 20px;
    align-items: start;
    padding-top: 18px;
  }
  .layout > .block { grid-column: 1; margin-top: 0; margin-bottom: 14px; }
  .layout > .mapwrap {
    grid-column: 2; grid-row: 1 / span 12;
    position: sticky; top: calc(var(--top) + 18px);
    height: calc(100vh - var(--top) - 36px);
    height: calc(100dvh - var(--top) - 36px);
    margin: 0;
  }
}

/* ---------- Ampelschild ---------- */
.sign {
  display: block; width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer;
  --sbg: #59636c; --son: #fff;
  background: var(--sbg);
  color: var(--son);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 24px -12px rgba(0, 0, 0, 0.35);
  transition: background-color 0.35s ease;
}

.sign.no-anim, .sign.no-anim .lamps i { transition: none; }
.sign[data-status='red'] { --sbg: var(--red); --son: var(--on-red); }
.sign[data-status='yellow'] { --sbg: var(--yellow); --son: var(--on-yellow); }
.sign[data-status='green'] { --sbg: var(--green); --son: var(--on-green); }
.sign[data-status='loading'], .sign[data-status='error'] { --sbg: #4d565e; }
.sign-inner {
  display: flex; gap: 16px; align-items: center;
  border: 2.5px solid var(--son);
  border-radius: 10px;
  padding: 16px 18px 17px 14px;
  min-height: 132px;
}
.lamps {
  flex: none;
  display: flex; flex-direction: column; gap: 6px;
  padding: 7px 6px;
  border-radius: 9px;
  background: #111416;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.18) inset;
}
.lamps i { width: 20px; height: 20px; border-radius: 50%; background: #2a2f33; transition: background-color 0.3s, box-shadow 0.3s; }
.sign[data-status='red'] .lamp-red { background: #ff3b30; box-shadow: 0 0 10px 1px rgba(255, 59, 48, 0.75); }
.sign[data-status='yellow'] .lamp-yellow { background: #ffc61a; box-shadow: 0 0 10px 1px rgba(255, 198, 26, 0.8); }
.sign[data-status='green'] .lamp-green { background: #2fe08a; box-shadow: 0 0 10px 1px rgba(47, 224, 138, 0.7); }
.sign[data-status='loading'] .lamps i { animation: pulse 1.4s ease-in-out infinite; }
.sign[data-status='loading'] .lamp-yellow { animation-delay: 0.2s; }
.sign[data-status='loading'] .lamp-green { animation-delay: 0.4s; }
@keyframes pulse { 50% { background: #4a5257; } }
.sign-text { min-width: 0; display: flex; flex-direction: column; }
.sign:active .sign-inner { transform: scale(0.995); }
.sign-kicker { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; font: 600 12px/1.2 var(--font-cond); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.sign-title {
  display: block;
  font: 700 clamp(34px, 10.5vw, 46px)/0.98 var(--font-cond);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin: 0 0 7px;
}
.sign-kicker svg { width: 22px; height: 22px; flex: none; }
.sign-reason { margin: 0; font: 600 20px/1.2 var(--font-cond); letter-spacing: 0.01em; }

.demo-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--ink-2); background: var(--surface); }
.demo-note b { color: var(--ink); }
.demo-note svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.estimate { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.link { border: 0; background: none; padding: 0; color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line); }
.link:hover { text-decoration-color: currentColor; }

.window {
  margin-top: 12px;
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.window b { font: 600 18px/1.2 var(--font-cond); letter-spacing: 0.01em; }
.window small { color: var(--muted); font-size: 13px; }

.crowd { margin: 10px 2px 0; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.crowd b { font-weight: 600; color: var(--ink); }
.crowd-marker { display: block; width: 12px; height: 12px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.crowd-marker.is-ice { background: #3f78b0; }
.crowd-marker.is-rain { background: #7c8a96; width: 10px; height: 10px; }
.alerts:empty { display: none; }
.alerts { margin-top: 12px; display: grid; gap: 8px; }
.alert {
  padding: 10px 14px 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 6px var(--radius) var(--radius) 6px;
}
.alert.sev-moderate, .alert.sev-severe, .alert.sev-extreme { border-left-color: var(--red); }
.alert b { display: block; font: 600 15px/1.25 var(--font-cond); letter-spacing: 0.04em; text-transform: uppercase; }
.alert span { font-size: 13.5px; color: var(--ink-2); }
.alert small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.alert-more { list-style: none; margin: 8px 0 0; padding: 7px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 3px; font-size: 13.5px; font-weight: 600; }
.alert-more li { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.alert-more small { display: inline; margin: 0; font-weight: 400; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; transform: translateY(-1px); }
.sev-dot.sev-moderate, .sev-dot.sev-severe, .sev-dot.sev-extreme { background: var(--red); }

/* ---------- Straßenklassen ---------- */
.roads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.road-tile {
  display: flex; flex-direction: column; gap: 1px;
  padding: 11px 13px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.road-sub { font-size: 12px; color: var(--muted); line-height: 1.25; }
.road-val { margin-top: 7px; display: flex; align-items: center; gap: 8px; font: 600 17px/1.15 var(--font-cond); letter-spacing: 0.01em; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--muted); }
[data-status='red'] .dot { background: var(--red); }
[data-status='yellow'] .dot { background: var(--yellow); }
[data-status='green'] .dot { background: var(--green); }
.road-hint { margin-top: 3px; font-size: 12px; color: var(--ink-2); }

/* ---------- Karte ---------- */
.mapwrap {
  position: relative;
  height: min(62vh, 520px);
  min-height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  isolation: isolate;
}
.map { position: absolute; inset: 0; background: var(--bg-2); }
.leaflet-container { font: 13px/1.4 var(--font); background: var(--bg-2); }
.leaflet-control-attribution { font-size: 10.5px; background: var(--surface) !important; background: color-mix(in srgb, var(--surface) 82%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: none !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); width: 36px !important; height: 36px !important; line-height: 34px !important; }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-zoom { margin-bottom: 64px !important; }
.leaflet-tooltip.road-tip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: 12.5px; padding: 5px 8px; }
.leaflet-tooltip.road-tip span { color: var(--muted); }
.leaflet-tooltip-top.road-tip::before { border-top-color: var(--line); }
.map.is-picking, .map.is-picking .leaflet-interactive { cursor: crosshair; }
.tiles-light .leaflet-tile-pane { filter: grayscale(1) contrast(0.92) brightness(1.04); }
.tiles-dark .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(0.82) brightness(0.86); }

.leaflet-roads-pane path { stroke: var(--road-red); transition: stroke 0.3s; }
.leaflet-roads-pane[data-status='yellow'] path { stroke: var(--road-yellow); }
.leaflet-roads-pane[data-status='green'] path { stroke: var(--road-green); }

.me-marker span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #1f6fd1; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(31, 111, 209, 0.18), 0 1px 3px rgba(0,0,0,.4);
}
.obs-marker span {
  display: block; width: 22px; height: 22px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.obs-salt span { background: #f4f4f4; border-color: #1a1a1a; box-shadow: inset 0 0 0 3px #1a1a1a, 0 1px 4px rgba(0,0,0,.35); }
.obs-clear span { background: #1d2328; }
.obs-marker.is-faded { opacity: 0.45; filter: grayscale(1); }

.map-legend {
  position: absolute; left: 10px; top: 10px; z-index: 500;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px; color: var(--ink-2);
  max-width: calc(100% - 70px);
}
.map-legend summary { cursor: pointer; padding: 7px 10px; font: 600 12px/1 var(--font-cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); list-style: none; }
.map-legend summary::-webkit-details-marker { display: none; }
.map-legend summary::after { content: ''; display: inline-block; margin-left: 8px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.map-legend[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.lg-items { display: grid; gap: 6px; padding: 0 10px 9px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-road { width: 18px; height: 4px; border-radius: 2px; background: var(--road-red); }
[data-roadstatus='yellow'] .lg-road { background: var(--road-yellow); }
[data-roadstatus='green'] .lg-road { background: var(--road-green); }
.lg-obs { width: 11px; height: 11px; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); }
.lg-salt { background: #f4f4f4; box-shadow: inset 0 0 0 2.5px #1a1a1a; }
.lg-clear { background: #1d2328; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--line); }

.lg-st { display: inline-grid; place-items: center; width: 22px; height: 14px; border: 1.5px solid var(--ink-2); border-radius: 3px; font: 700 9px/1 var(--font-cond); font-style: normal; background: var(--surface); }
.lg-crowd { width: 9px; height: 9px; transform: rotate(45deg); background: #3f78b0; }
.map-actions { position: absolute; right: 10px; top: 10px; z-index: 500; display: grid; gap: 8px; }
.map-btn {
  width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
}
.map-btn svg { width: 20px; height: 20px; }
.map-btn[aria-pressed='false'] { color: var(--muted); background: var(--surface-2); }
.map-btn.is-busy svg { animation: spin 1.2s linear infinite; }

.cta {
  position: absolute; left: 50%; bottom: 14px; z-index: 600;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px 0 14px;
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: 22px;
  font: 600 15px/1 var(--font);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.45);
  white-space: nowrap;
}
.cta svg { width: 20px; height: 20px; }
.cta:active { transform: translateX(-50%) scale(0.98); }
.pick-hint {
  position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 650;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px;
  background: var(--ink); color: var(--bg);
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
}
.pick-hint span { margin-right: auto; }
.pick-hint .link { color: var(--bg); text-decoration-color: color-mix(in srgb, var(--bg) 50%, transparent); }
.pick-hint .icon-btn { color: var(--bg); }
.pick-hint .icon-btn:hover { background: rgba(127,127,127,.25); }

/* ---------- Karten (Cards) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 14px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { font: 700 17px/1.2 var(--font-cond); letter-spacing: 0.06em; text-transform: uppercase; }
.card-meta { font-size: 12px; color: var(--muted); text-align: right; }

/* ---------- Grafik ---------- */
.chart-card { position: relative; }
.chart { width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-svg { width: 100%; display: block; overflow: visible; }
.chart-svg:focus-visible { outline-offset: 4px; border-radius: 4px; }
.c-future { fill: var(--future); }
.c-dayline { stroke: var(--line-2); stroke-width: 1; }
.c-daylabel { font: 600 10.5px var(--font-cond); letter-spacing: 0.04em; fill: var(--muted); text-transform: uppercase; }
.c-grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.c-zero { stroke: var(--line); stroke-width: 1; }
.c-ticklabel { font: 500 10px var(--font); fill: var(--muted); }
.c-frostzone { fill: var(--frost-zone); }
.c-frostlabel { font: 600 10px var(--font-cond); letter-spacing: 0.05em; fill: var(--rain); text-transform: uppercase; opacity: 0.9; }
.c-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-temp { stroke: var(--temp); stroke-width: 1.7; }
.c-surface { stroke: var(--surface-line); stroke-width: 1.2; stroke-dasharray: 3 2.5; }
.c-base { stroke: var(--line); stroke-width: 1; }
.c-rain { fill: var(--rain); }
.c-salt { fill: rgba(127, 135, 143, 0.22); fill: color-mix(in srgb, var(--ink) 16%, transparent); stroke: var(--ink-2); stroke-width: 1.1; stroke-linejoin: round; }
.c-frozen { fill: var(--frozen); }
.c-strip { shape-rendering: crispEdges; }
.c-strip.s-red { fill: var(--red); }
.c-strip.s-yellow { fill: var(--yellow); }
.c-strip.s-green { fill: var(--green); }
.c-now { stroke: var(--ink); stroke-width: 1.3; }
.c-nowlabel { font: 700 10.5px var(--font-cond); letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink); }
.c-cursor line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; }
.c-cursor circle { fill: var(--surface); stroke: var(--temp); stroke-width: 2; }
.c-hit { fill: transparent; cursor: crosshair; }

.readout {
  position: absolute; left: 12px; right: 12px; top: 40px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 16px -8px rgba(0,0,0,.25);
  pointer-events: none;
  font-size: 13px;
}
.ro-time { font-weight: 600; }
.ro-time em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 12px; }
.ro-vals { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; color: var(--ink-2); }
.ro-vals b { color: var(--ink); }
.ro-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink); }
.ro-status i { width: 9px; height: 9px; border-radius: 50%; }
.ro-status.s-red i { background: var(--red); }
.ro-status.s-yellow i { background: var(--yellow); }
.ro-status.s-green i { background: var(--green); }

.chart-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; }
.lg-temp { width: 16px; height: 2px; background: var(--temp); }
.lg-surface { width: 16px; height: 0; border-top: 1.5px dashed var(--surface-line); }
.lg-rain { width: 8px; height: 10px; background: var(--rain); }
.lg-frozen { width: 8px; height: 10px; background: var(--frozen); }
.lg-salt { width: 14px; height: 9px; background: rgba(127, 135, 143, 0.22); background: color-mix(in srgb, var(--ink) 16%, transparent); border-top: 1.5px solid var(--ink-2); }
.lg-strip { width: 18px; height: 6px; background: linear-gradient(90deg, var(--red) 0 33%, var(--yellow) 33% 66%, var(--green) 66%); }

/* ---------- Messgrößen ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact {
  padding: 11px 13px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.fact-val { display: block; margin-top: 4px; font: 600 24px/1.1 var(--font-cond); letter-spacing: 0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact-val small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.fact-sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.fact .tag { margin-left: 6px; }
.bar { position: relative; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--rain); border-radius: 3px; transition: width 0.5s ease; }
.bar::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); }
.fact.wide { grid-column: 1 / -1; }
.fact-sub b { font-weight: 600; color: var(--ink); }
.bar-salt > i { background: var(--ink-2); }
.bar-salt::after { display: none; }
.bar-salt > b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--surface); }
.fact.station { border-left: 3px solid var(--ink-2); }
.card-note { margin: -2px 0 10px; font-size: 12.5px; color: var(--muted); }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.st-item:first-child { border-top: 0; }
.st-item.is-near .st-main b::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-left: 6px; vertical-align: 2px; }
.st-cond { width: 46px; height: 32px; display: grid; place-items: center; border-radius: 6px; font: 600 16px/1 var(--font-cond); background: var(--surface-2); border: 1px solid var(--line); }
.st-cond.c-damp { border-color: var(--rain); }
.st-cond.c-wet { background: var(--surface-2); background: color-mix(in srgb, var(--rain) 18%, var(--surface)); border-color: var(--rain); }
.st-cond.c-ice { background: #dfeaf5; color: #0f2a45; border-color: #7aa6d1; }
.st-main { min-width: 0; }
.st-main b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-main span { display: block; font-size: 12.5px; color: var(--muted); }
.st-fc { text-align: right; }
.st-fc b { display: block; font: 600 16px/1.1 var(--font-cond); }
.st-fc span { display: block; font-size: 11.5px; color: var(--muted); max-width: 110px; }
.station-marker { display: grid; place-items: center; width: 34px; height: 22px; border-radius: 5px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink-2); font: 700 12px/1 var(--font-cond); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.station-marker.c-ice { background: #dfeaf5; color: #0f2a45; border-color: #3f78b0; }
.station-marker.c-wet { border-color: var(--rain); }
.station-marker.is-near { outline: 2px solid var(--ink); outline-offset: 1px; }
.tag {
  display: inline-block; vertical-align: 1px;
  padding: 1px 5px 1px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 600 10px/1.3 var(--font-cond); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Beobachtungen ---------- */
.calib:empty { display: none; }
.calib { margin-bottom: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.calib b { color: var(--ink); }
.calib-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin: 8px 0 4px; }
.calib-grid div { padding: 6px 7px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; }
.calib-grid strong { display: block; font: 600 20px/1.1 var(--font-cond); color: var(--ink); }
.calib-grid span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.obs-list { list-style: none; margin: 0; padding: 0; }
.obs-empty { color: var(--muted); font-size: 14px; padding: 4px 0 2px; }
.obs-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.obs-item:first-child { border-top: 0; }
.obs-item.is-faded { opacity: 0.6; }
.obs-kind { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--font-cond); letter-spacing: 0.05em; }
.obs-kind.k-salt { background: #f2f2f2; color: #111; box-shadow: inset 0 0 0 2px #1a1a1a; }
.obs-kind.k-clear { background: #1d2328; color: #fff; }
.obs-main { min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.obs-main b { display: block; font-weight: 600; font-size: 14.5px; }
.obs-main span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.obs-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.obs-more { margin-top: 8px; }

/* ---------- Fußzeile ---------- */
.foot { padding: 6px 2px 0; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 0 0 6px; }

/* ---------- Bottom Sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 10, 12, 0.42); animation: fade 0.18s ease; }
.sheet {
  position: fixed; z-index: 2001;
  left: 0; right: 0; bottom: 0;
  max-width: 520px; margin: 0 auto;
  max-height: 92vh; overflow: auto;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--line);
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,.35);
  animation: rise 0.22s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 700px) {
  .sheet { bottom: 50%; transform: translateY(50%); border-radius: 16px; animation: fade 0.18s ease; }
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { font: 700 22px/1.1 var(--font-cond); letter-spacing: 0.04em; text-transform: uppercase; }
.sheet-where { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.choice { border: 0; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice legend { margin-bottom: 8px; padding: 0; }
.choice-opt { position: relative; display: block; cursor: pointer; }
.choice-opt input { position: absolute; opacity: 0; inset: 0; }
.choice-opt > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); }
.choice-opt b { font: 600 17px/1.15 var(--font-cond); letter-spacing: 0.02em; }
.choice-opt small { font-size: 12px; color: var(--muted); }
.choice-opt input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--surface); }
.choice-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.field input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.photo-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.sheet-model { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); min-width: 120px; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--red); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; }

/* ---------- Dialoge ---------- */
.dlg {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
}
.dlg::backdrop { background: rgba(8, 10, 12, 0.45); }
.dlg[open] { animation: fade 0.16s ease; }
.dlg-body { padding: 14px 18px 18px; margin: 0; }
.note { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2); }
.set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'lab out' 'rng tag';
  gap: 6px 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line-2);
}
.set-row label { grid-area: lab; display: grid; }
.set-row label span { font-weight: 600; }
.set-row label small { font-size: 12px; color: var(--muted); }
.set-row output { grid-area: out; font: 600 20px/1 var(--font-cond); min-width: 70px; text-align: right; }
.set-row input[type='range'] { grid-area: rng; width: 100%; accent-color: var(--ink); height: 28px; }
.set-row .tag { grid-area: tag; justify-self: end; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.switch-row span { display: grid; }
.switch-row small { color: var(--muted); font-size: 12px; }
.seg { border: 0; margin: 0; padding: 12px 0; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 0; }
.seg legend { padding: 0; margin-bottom: 8px; width: 100%; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px 6px; border: 1px solid var(--line); margin-left: -1px; background: var(--bg); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg label:first-of-type span { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg label:last-of-type span { border-radius: 0 8px 8px 0; }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.set-actions .btn { height: 38px; font-size: 13.5px; padding: 0 12px; }
.version { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

.prose { font-size: 14.5px; }
.prose h3 { font: 700 15px/1.3 var(--font-cond); letter-spacing: 0.07em; text-transform: uppercase; margin: 18px 0 6px; }
.prose p { margin: 0 0 10px; color: var(--ink-2); }
.prose ol, .prose ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); }
.prose li { margin-bottom: 5px; }
.prose li b { color: var(--ink); }
.prose .rule-red { color: var(--red); }
.prose small { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 3000;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  background: var(--ink); color: var(--bg);
  border-radius: 10px;
  font-weight: 500; font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  animation: rise 0.2s ease;
}

.toast { display: flex; align-items: center; gap: 14px; }
.toast-action { border: 0; background: none; color: var(--bg); font-weight: 700; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }
.where-stamp.is-old { color: var(--red); }
.noscript { padding: 20px; text-align: center; }

@media (max-width: 380px) {
  .brand span { font-size: 17px; }
  .sign-inner { padding: 14px 14px 15px 12px; gap: 12px; }
  .lamps i { width: 17px; height: 17px; }
  .fact-val { font-size: 21px; }
}

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

/* ---------- Symbolkacheln ---------- */
.gauges { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gauges:empty { display: none; }
.g {
  --tone: var(--ink-2);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  min-width: 0; padding: 12px 4px 10px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; cursor: pointer; text-align: center;
}
.g:hover { background: var(--surface-2); }
.g:active { transform: scale(0.97); }
.g-bad { --tone: var(--red); }
.g-warn { --tone: var(--road-yellow); }
.g-ok { --tone: var(--green); }
.g-info { --tone: var(--rain); }
.g-i { width: 30px; height: 30px; color: var(--tone); }
.g-v { font: 600 17px/1.1 var(--font-cond); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-l { font: 600 10px/1.15 var(--font-cond); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Straßenklassen mit Symbol ---------- */
.road-tile { position: relative; flex-direction: row; align-items: center; gap: 12px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.road-tile:hover { background: var(--surface-2); }
.road-i { width: 34px; height: 34px; flex: none; color: var(--ink-2); }
.road-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.road-txt .road-val { margin-top: 0; }
.road-ice { position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; color: var(--rain); }

/* ---------- Überschriften mit Symbol, Messstellen ---------- */
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.h-i { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.card-head .card-meta { display: inline-flex; align-items: center; gap: 2px; }
.st-cols { display: grid; grid-template-columns: 64px 1fr auto; font: 600 10px/1 var(--font-cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 0 4px; }
.st-cols span:last-child { text-align: right; }
.st-item { grid-template-columns: 64px 1fr auto; }
.st-cond { width: 58px; height: 32px; display: inline-flex; gap: 4px; align-items: center; justify-content: center; }
.st-cond svg { width: 16px; height: 16px; flex: none; }
.st-main span { font-size: 12px; }
.st-fc { display: inline-flex; flex-direction: column; align-items: flex-end; }
.st-fc svg { width: 15px; height: 15px; color: var(--rain); }
.st-fc.is-ice b { color: var(--rain); }

/* ---------- Detail-Dialog ---------- */
.dlg-detail .sheet-head h2 { display: flex; align-items: center; gap: 9px; }
.dlg-detail .h-i { width: 24px; height: 24px; }
.kv { list-style: none; margin: 0 0 12px; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.kv li:first-child { border-top: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 600; text-align: right; white-space: nowrap; }
.dlg-detail .alert { margin-bottom: 8px; }
.dlg-detail .bar { margin: 4px 0 12px; height: 8px; }

@media (max-width: 360px) {
  .gauges { gap: 6px; }
  .g-v { font-size: 15px; }
  .g-i { width: 26px; height: 26px; }
}
