:root {
  --bg: #0D0D0D;
  --surface: #1A1A1A;
  --surface-elevated: #242424;
  --border: #2A2A2A;
  --border-light: #333333;
  --text-primary: #F5F5F5;
  --text-secondary: #888888;
  --text-tertiary: #555555;
  --warn: #E24B4A;
  --warn-bg: rgba(226, 75, 74, 0.12);
  --warn-border: rgba(226, 75, 74, 0.30);
  --match-bg: rgba(99, 153, 34, 0.12);
  --match-border: rgba(99, 153, 34, 0.30);
  --match: #8FBF4E;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(48px + env(safe-area-inset-bottom));
  padding-top: calc(16px + env(safe-area-inset-top));
}

/* ── Kopf ───────────────────────────────────────────── */
.header { margin: 4px 0 14px; }
.title { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; }
.subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.stand {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  min-height: 14px;
}
.stand.error { color: var(--warn); }

/* ── Aktuelle Meldungen ─────────────────────────────── */
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(226,75,74,0.6);
  animation: puls 1.8s infinite;
}
@keyframes puls {
  0%   { box-shadow: 0 0 0 0 rgba(226,75,74,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(226,75,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,75,74,0); }
}

.aktuell-section { margin-bottom: 18px; }
.aktuell-liste { display: flex; flex-direction: column; gap: 8px; }
.aktuell-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--warn-bg);
  border: 0.5px solid var(--warn-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.aktuell-item .badge { margin-top: 1px; }
.aktuell-body { flex: 1; min-width: 0; }
.aktuell-haupt { font-size: 14px; font-weight: 500; }
.aktuell-haupt .station { color: var(--text-primary); }
.aktuell-richtung { font-size: 12px; color: var(--text-secondary); }
.aktuell-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.aktuell-typ {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--warn);
}

/* ── Banner / Hinweise ──────────────────────────────── */
.disclaimer {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(186,117,23,0.08);
  border: 0.5px solid rgba(186,117,23,0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  font-size: 12px; line-height: 1.5; color: var(--text-secondary);
}
.disclaimer strong { color: var(--text-primary); font-weight: 500; }
.disclaimer-icon { color: #8a5e0f; flex-shrink: 0; }

/* ── Suche ──────────────────────────────────────────── */
.suche-wrap { position: relative; margin-bottom: 16px; }
.suche-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: 0.6;
}
.suche-input {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  padding: 13px 40px 13px 36px;
  outline: none;
}
.suche-input:focus { background: var(--surface-elevated); border-color: var(--border-light); }
.suche-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--border); color: var(--text-secondary);
  border: none; border-radius: 50%; width: 22px; height: 22px;
  font-size: 11px; cursor: pointer;
}
.suche-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--surface-elevated);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 320px; overflow-y: auto;
}
.suche-result {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; cursor: pointer;
  border-bottom: 0.5px solid var(--border);
}
.suche-result:last-child { border-bottom: none; }
.suche-result:hover, .suche-result.active { background: var(--surface); }
.suche-result .name { flex: 1; font-size: 14px; }
.suche-result .warn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* ── Tabs ───────────────────────────────────────────── */
.tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding: 6px 0;
}
.tab {
  flex: 1;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  padding: 10px 6px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative;
}
.tab.active { background: var(--surface-elevated); border-color: var(--border-light); color: var(--text-primary); }
.tab .tab-icon { font-size: 16px; line-height: 1; }
.tab .tab-count {
  position: absolute; top: 5px; right: 8px;
  background: var(--warn); color: #fff;
  font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 999px; padding: 0 4px;
}

/* ── Linien-Akkordeon ───────────────────────────────── */
.linien { display: flex; flex-direction: column; gap: 8px; }
.linie {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.linie.has-warn { border-color: var(--warn-border); }
.linie-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px; cursor: pointer;
}
.badge {
  min-width: 34px; height: 24px; line-height: 24px; text-align: center;
  border-radius: 6px; font-size: 13px; font-weight: 700; padding: 0 7px;
}
.linie-info { flex: 1; min-width: 0; }
.linie-sub { font-size: 12px; color: var(--text-secondary); }
.linie-warn-pill {
  background: var(--warn-bg); color: var(--warn);
  border: 0.5px solid var(--warn-border);
  border-radius: 999px; font-size: 11px; font-weight: 600;
  padding: 3px 9px;
}
.chevron { color: var(--text-tertiary); font-size: 12px; transition: transform .2s; }
.linie.open .chevron { transform: rotate(90deg); }

.linie-body { display: none; border-top: 0.5px solid var(--border); }
.linie.open .linie-body { display: block; }

.station-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}
.station-row:last-child { border-bottom: none; }
.station-row.warn { background: var(--warn-bg); }
.station-row.match { background: var(--match-bg); }
.station-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.station-row.warn .station-dot {
  background: var(--warn);
  animation: puls 1.8s infinite;
}
.station-name { flex: 1; font-size: 14px; min-width: 0; }
.station-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.station-pill {
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.station-pill.warn { background: var(--warn-bg); color: var(--warn); border: 0.5px solid var(--warn-border); }
.station-pill.match { background: var(--match-bg); color: var(--match); border: 0.5px solid var(--match-border); }

.linie-leer { padding: 16px 14px; font-size: 12px; color: var(--text-tertiary); }
.linie-meldungen { border-top: 0.5px solid var(--border); }

/* hervorgehobene Linie (Suchtreffer) */
.linie.flash { box-shadow: 0 0 0 1.5px var(--match-border); }

/* ── Footer ─────────────────────────────────────────── */
.footer {
  margin-top: 28px; padding: 16px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 11px; line-height: 1.6; color: var(--text-secondary);
}
.footer p { margin-bottom: 8px; }
.footer-title { text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.empty { color: var(--text-tertiary); font-size: 13px; text-align: center; padding: 24px 0; }
