/* Design „Livehub“ – wie die Android-App: Space Grotesk, Grün als Akzent, runde Karten, Abfahrten als Karten in
   Linienfarbe mit großem Countdown. Gilt nur mit <html data-design="livehub">; hell/dunkel über data-theme bzw. das
   System. Baut auf app.css auf (Aufbau und Bausteine), hier stehen nur Farben, Schrift und Formen. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk.woff2") format("woff2");
}

/* ---------- Farben (wie LivehubPalette in der App) ---------- */

:root[data-design="livehub"] {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #eceef1;
  --line: #e2e4e9;
  --text: #15161a;
  --muted: #6b6e78;
  --accent: #138a4b;
  --accent-text: #ffffff;
  --accent-soft: #d7f2e2;
  --on-accent-soft: #0b3d22;
  --ok: #1e7a3c;
  --ok-bg: #e3f3e8;
  --warn: #8a5a00;
  --warn-bg: #fff2d6;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --info-bg: #d7f2e2;
  --focus: #138a4b;
  --cancel: #e5484d;
  --radius: 18px;
  --radius-s: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-design="livehub"]:not([data-theme="light"]) {
    --bg: #101114;
    --surface: #1e2027;
    --surface-2: #26282f;
    --line: #2e3038;
    --text: #f2f3f5;
    --muted: #a9abb3;
    --accent: #3ddc84;
    --accent-text: #052e16;
    --accent-soft: #134e2c;
    --on-accent-soft: #c9f5da;
    --ok: #6fd08f;
    --ok-bg: #16301f;
    --warn: #f3c262;
    --warn-bg: #352a12;
    --bad: #ff8a80;
    --bad-bg: #3a1a18;
    --info-bg: #134e2c;
    --focus: #3ddc84;
    color-scheme: dark;
  }
}
:root[data-design="livehub"][data-theme="dark"] {
  --bg: #101114;
  --surface: #1e2027;
  --surface-2: #26282f;
  --line: #2e3038;
  --text: #f2f3f5;
  --muted: #a9abb3;
  --accent: #3ddc84;
  --accent-text: #052e16;
  --accent-soft: #134e2c;
  --on-accent-soft: #c9f5da;
  --ok: #6fd08f;
  --ok-bg: #16301f;
  --warn: #f3c262;
  --warn-bg: #352a12;
  --bad: #ff8a80;
  --bad-bg: #3a1a18;
  --info-bg: #134e2c;
  --focus: #3ddc84;
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */

[data-design="livehub"] body { font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[data-design="livehub"] { accent-color: var(--accent); }
[data-design="livehub"] h1, [data-design="livehub"] h2 { font-weight: 700; letter-spacing: -0.01em; }
[data-design="livehub"] .hint, [data-design="livehub"] .muted { color: var(--muted); }

/* Kopf: ruhige Leiste, aktive Gruppe als grüne Kapsel */
[data-design="livehub"] .top { background: var(--surface); border-bottom: 1px solid var(--line); }
[data-design="livehub"] .brand strong { font-weight: 700; }
[data-design="livehub"] .nav-head { border-radius: 999px; }
[data-design="livehub"] .nav-group.current > .nav-head { background: var(--accent-soft); color: var(--on-accent-soft); }
[data-design="livehub"] .nav-menu { border-radius: var(--radius-s); }
[data-design="livehub"] .nav-item { border-radius: 8px; }
[data-design="livehub"] .nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--on-accent-soft); }

/* Flächen */
[data-design="livehub"] .panel { border-radius: var(--radius); border-color: var(--line); }
[data-design="livehub"] .journey, [data-design="livehub"] .alert { border-radius: var(--radius-s); }
[data-design="livehub"] .alert { border: 1px solid var(--line); border-left-width: 5px; }

/* Bedienelemente: Knöpfe als Kapseln, Eingaben rund */
[data-design="livehub"] .btn { border-radius: 999px; font-weight: 500; }
[data-design="livehub"] .btn.primary { font-weight: 700; }
[data-design="livehub"] .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--on-accent-soft); }
[data-design="livehub"] input[type="text"], [data-design="livehub"] input[type="search"],
[data-design="livehub"] input[type="password"], [data-design="livehub"] input[type="email"],
[data-design="livehub"] input[type="number"], [data-design="livehub"] input[type="datetime-local"],
[data-design="livehub"] select { border-radius: var(--radius-s); }
[data-design="livehub"] .chip { border-radius: 10px; }
[data-design="livehub"] .line { border-radius: 8px; font-size: 0.88rem; }

/* ---------- Abfahrten als Karten in Linienfarbe ---------- */

.dep-cards { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.dep-card {
  display: grid; grid-template-columns: minmax(2.4em, max-content) minmax(0, 1fr) auto auto;
  grid-template-areas: "line dir chip count" "line meta chip count" "notes notes notes notes";
  align-items: center; column-gap: 0.75rem;
  padding: 0.6rem 0.95rem; border-radius: var(--radius);
  background: var(--lc, var(--surface-2)); color: var(--lt, var(--text));
}
.dep-card .dc-line { grid-area: line; font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.dep-card .dc-dir { grid-area: dir; min-width: 0; font-size: 1.02rem; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-card .dc-meta { grid-area: meta; font-size: 0.85rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.dep-card .dc-meta .changed { color: inherit; opacity: 1; font-weight: 700; }
.dep-card .dc-chip {
  grid-area: chip; justify-self: end; padding: 0.05rem 0.5rem; border-radius: 10px; font-size: 0.8rem; font-weight: 700;
  background: var(--cb); color: var(--cf); white-space: nowrap;
}
.dep-card .dc-count { grid-area: count; justify-self: end; white-space: nowrap; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.dep-card .dc-count b { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.dep-card .dc-count.word { font-size: 1.1rem; font-weight: 700; }
.dep-card .dc-notes { grid-area: notes; display: grid; gap: 0.1rem; margin-top: 0.25rem; }
.dep-card .dc-notes .sub, .dep-card .dc-notes .alert-ref { color: inherit; opacity: 0.88; margin: 0.15rem 0 0; }
.dep-card .dep-notes { margin: 0; }
.dep-card .dep-notes > summary { color: inherit; opacity: 0.88; }
/* Ausfall: Kartenfläche, rot umrandet */
.dep-card.cancelled { background: var(--surface); color: var(--cancel, #e5484d); box-shadow: inset 0 0 0 1.5px var(--cancel, #e5484d); }
.dep-card.cancelled .dc-dir { text-decoration: line-through; }
.dep-card.cancelled .dc-count { font-size: 1.05rem; font-weight: 700; }
.dep-card.gone { opacity: 0.55; }
@media (max-width: 480px) {
  .dep-card { column-gap: 0.55rem; padding: 0.55rem 0.8rem; }
  .dep-card .dc-line { font-size: 1.05rem; }
}

/* ---------- Termine von heute: Karte in Linienfarbe mit Countdown und Band ---------- */

[data-design="livehub"] .slots { display: grid; gap: 0.75rem; }
.slot-l { list-style: none; display: grid; gap: 0.45rem; }
.slot-card {
  border-radius: var(--radius); overflow: hidden;
  background: var(--lc, var(--surface-2)); color: var(--lt, var(--text));
}
/* Rand nur ohne Linienfarbe – als Schatten, damit das Band unten bis an die Kante reicht */
.slot-card:not(.painted) { box-shadow: inset 0 0 0 1px var(--line); }
.slot-card.done { opacity: 0.6; }
.slot-card > .sc-head, .slot-card > .sc-main, .slot-card > .sc-meta, .slot-card > .sc-note, .slot-card > .chips { padding: 0 1rem; }
.sc-head { display: flex; justify-content: space-between; gap: 0.8rem; padding-top: 0.75rem !important; font-size: 0.88rem; opacity: 0.88; }
.sc-head a { color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-head a:hover { text-decoration: underline; }
.sc-head span { white-space: nowrap; font-weight: 700; }
.sc-main { display: flex; align-items: baseline; gap: 0.7rem; margin-top: 0.2rem; }
.sc-line { font-size: 1.35rem; font-weight: 700; white-space: nowrap; }
.sc-dir { flex: 1; min-width: 0; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-dir.gone { text-decoration: line-through; }
.sc-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-count b { font-size: 2.3rem; font-weight: 700; line-height: 1; }
.sc-count.word { font-size: 1.5rem; font-weight: 700; }
.sc-meta { font-size: 0.85rem; opacity: 0.85; padding-bottom: 0.7rem !important; }
.sc-note { font-size: 0.85rem; margin-top: -0.4rem; padding-bottom: 0.6rem !important; }
.slot-card > .chips { padding-bottom: 0.7rem !important; margin-top: 0.3rem; }
.slot-card > .sc-veh { padding: 0 1rem 0.6rem; margin-top: -0.4rem; }
.slot-card .sc-veh::before { box-shadow: 0 0 0 2px var(--lc, var(--surface-2)), 0 0 0 3.5px currentColor; }
/* Linien auf einer Karte gleicher Farbe: mit Rand in der Schrift der Karte, sonst verschwinden sie */
.slot-card.painted .line { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--lt) 70%, transparent); }
.sc-band { padding: 0.35rem 1rem; font-size: 0.9rem; font-weight: 700; background: var(--bb); color: var(--bf); }
.sc-band.plain { background: color-mix(in srgb, currentColor 15%, transparent); }

/* ---------- Verbindung als Netzplan ---------- */

.start-box {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 0.7rem 0 0.4rem;
  padding: 0.7rem 1rem; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent);
}
.start-label { color: var(--accent); font-size: 0.78rem; font-weight: 700; }
.start-count b { font-size: 2.4rem; line-height: 1; font-weight: 700; }
.start-meta { text-align: right; color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.start-box { flex-wrap: wrap; row-gap: 0.2rem; }
.start-box > .depart { flex-basis: 100%; margin-top: 0; }

.netz { --y: 0.72rem; margin: 0.4rem 0 0.6rem; }
.nl-row { display: grid; grid-template-columns: 3.6rem 2rem minmax(0, 1fr); column-gap: 0.35rem; }
.nl-time { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nl-time small { display: block; color: var(--muted); font-size: 0.75rem; }
.nl-time .delay { display: block; font-size: 0.8rem; }
.nl-body { min-width: 0; padding-bottom: 0.55rem; }
.nl-row.ride .nl-body, .nl-row.walk .nl-body { padding: 0.2rem 0 0.75rem; }
.nl-row .stopname { font-weight: 700; }
.nl-row .via { color: var(--muted); font-size: 0.85rem; }
.nl-rail { position: relative; }
.nl-rail > .up, .nl-rail > .down, .nl-rail > .full {
  position: absolute; left: 50%; width: 6px; transform: translateX(-50%); background: var(--c);
}
.nl-rail > .up { top: 0; height: var(--y); }
.nl-rail > .down { top: var(--y); bottom: 0; }
.nl-rail > .full { top: 0; bottom: 0; }
.nl-rail > .dotted {
  width: 4px; background: radial-gradient(circle, var(--c) 1.8px, transparent 2.2px) center top / 4px 9px repeat-y;
}
.nl-dot {
  position: absolute; left: 50%; top: var(--y); width: 15px; height: 15px; transform: translate(-50%, -50%);
  border-radius: 50%; border: 3px solid var(--c); background: var(--surface); box-sizing: border-box;
}
.nl-dot.big { width: 19px; height: 19px; }
.nl-stops { margin-top: 0.3rem; font-size: 0.86rem; }
.nl-stops summary { cursor: pointer; color: var(--accent); }
.nl-stops ol { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; gap: 0.2rem; }
.nl-stops li { position: relative; }
/* kleiner Ring auf der Linie: von der Textspalte zurück in die Mitte der Linienspalte */
.nl-stops li::before {
  content: ""; position: absolute; left: calc(-0.35rem - 1rem); top: 0.7em; width: 9px; height: 9px;
  transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--c); background: var(--surface); box-sizing: border-box;
}
.nl-stops li .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.nl-stops li.cancelled { color: var(--bad); text-decoration: line-through; }
/* Fahrzeug (ungefähr, nach den Zeiten an den Halten): gefüllter Punkt mit Abstand zur Linie; ein Ring in Linienfarbe
   pulsiert nach außen und verblasst, damit der Punkt auffällt (auch auf der Karte, map.js) */
.nl-vehicle {
  position: absolute; left: 50%; top: 0; width: 13px; height: 13px; transform: translate(-50%, -50%); z-index: 1;
  border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c);
  animation: nl-puls 1.8s ease-out infinite;
}
.nl-vehicle[hidden] { display: none; }
@keyframes nl-puls {
  from { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c), 0 0 0 5px color-mix(in srgb, var(--c) 55%, transparent); }
  to { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c), 0 0 0 14px color-mix(in srgb, var(--c) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .nl-vehicle { animation: none; } }
/* auf der Karte: Marker ohne eigene Größe, der Punkt sitzt genau auf der Stelle */
.map-vehicle { width: 0; height: 0; }

/* ---------- Verlauf einer Fahrt (trip.js) ---------- */
.trip-netz { position: relative; }
.trip-netz .stopname { font-weight: 500; }
.trip-netz .board .stopname { font-weight: 700; }
.trip-netz .nl-row.past .nl-time, .trip-netz .nl-row.past .nl-body { opacity: 0.55; }
.trip-netz .nl-row.dropped .stopname { color: var(--bad); text-decoration: line-through; }
.trip-netz .nl-row .nl-body { padding-bottom: 0.45rem; }
.trip-head .nl-veh { margin-top: 0.3rem; }
