/* Arbeitswegrechner – schlicht, hell/dunkel nach Systemeinstellung, mobil zuerst. */
:root {
  color-scheme: light;
  --bg: #f4f4f1; --surface: #fcfcfb; --surface-2: #efefeb; --line: #dcdbd5;
  --text: #0b0b0b; --text-2: #52514e; --muted: #7a7974;
  --accent: #1f5fae; --accent-ink: #fff; --accent-soft: #dbe8f8;
  --car: #2a78d6; --scooter: #eb6834; --ticket: #1baf7a; --train: #6250d6; --wait: #a3a29b;
  --good: #0b7a3e; --warn: #9a6200; --bad: #c0392b; --m1: #f59f00; --m2: #d9480f; --soon: #f5c800; --gone: #e60000; --bad-soft: #fbe5e2; --warn-soft: #fdf0d5;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --tab-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #242422; --line: #34342f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
    --accent: #5b9cf0; --accent-ink: #0b0b0b; --accent-soft: #1d3150;
    --car: #3987e5; --scooter: #d95926; --ticket: #199e70; --train: #9085e9; --wait: #6c6b65;
    --good: #4cc27f; --warn: #e3a73a; --bad: #ff7b6e; --m1: #f0a020; --m2: #e8590c; --soon: #e6b800; --gone: #ff1a1a; --bad-soft: #3a1f1c; --warn-soft: #3a2e14;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  -webkit-text-size-adjust: 100%; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
h2 { font-size: 1.08rem; margin: 0 0 .6rem; }
h3 { font-size: .98rem; margin: 0 0 .4rem; }
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .86em; }
.hidden, [hidden] { display: none !important; }

/* Kopf + Navigation */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--text-2); text-decoration: none; min-width: 0;
}
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--accent); font-weight: 600; }
#adminbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
#adminbtn + #logout, #adminbtn[hidden] + #logout { margin-left: 6px; }
#adminbtn[hidden] + #logout:not([hidden]) { margin-left: auto; }
#adminbtn .lk { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: static; height: auto; border: 0; background: none; justify-content: flex-start; gap: 4px; padding: 0; }
  .nav a { flex: none; flex-direction: row; font-size: 14px; padding: 7px 12px; border-radius: 8px; gap: 6px; }
  .nav a svg { width: 18px; height: 18px; }
  .nav a.on { background: var(--accent-soft); }
}

.view { max-width: 1180px; margin: 0 auto; padding: 14px 12px 28px; outline: none; }
@media (min-width: 900px) { .view { padding: 22px 24px 40px; } }

/* Karten & Raster */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr; } .g3 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* Knöpfe & Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; border-radius: 10px;
  padding: 9px 14px; cursor: pointer; text-decoration: none; min-height: 40px;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .9em; }
.btn.big { padding: 14px 18px; font-size: 1.05rem; flex: 1; min-height: 56px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: .88em; color: var(--text-2); min-width: 0; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; min-height: 40px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; }
.unit { display: flex; align-items: center; gap: 6px; } .unit span { color: var(--muted); font-size: .85em; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { white-space: nowrap; border: 0; background: var(--surface); color: var(--text-2); font: inherit; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .92em; }
.chk input { width: auto; min-height: 0; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
.kpi { border-radius: 10px; background: var(--surface-2); padding: 10px 12px; min-width: 0; }
.kpi .l { font-size: .8em; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.total { background: var(--accent-soft); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.dot.car { background: var(--car); } .dot.scooter { background: var(--scooter); } .dot.ticket { background: var(--ticket); }
/* Fixkosten: Farbe des Fahrzeugs, schraffiert (wie im Diagramm) */
.dot.fix-car { background: repeating-linear-gradient(45deg, var(--car) 0 2px, color-mix(in srgb, var(--car) 35%, transparent) 2px 4px); }
.dot.fix-scooter { background: repeating-linear-gradient(45deg, var(--scooter) 0 2px, color-mix(in srgb, var(--scooter) 35%, transparent) 2px 4px); }
.dot.fix-sonst { background: var(--wait); }
.dot.train { background: var(--train); } .dot.wait { background: var(--wait); }

/* Hinweise */
.note { border-radius: 10px; padding: 10px 12px; background: var(--surface-2); font-size: .93em; }
.note.warn { background: var(--warn-soft); } .note.err { background: var(--bad-soft); color: var(--text); border-left: 4px solid var(--bad); }
.note.ok { border-left: 4px solid var(--good); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78em; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.rt { background: var(--accent-soft); color: var(--text); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; font-size: .93em; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--text-2); font-weight: 600; font-size: .85em; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tblwrap { overflow-x: auto; }

/* Ablauf (Zeitleiste) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 52px 14px 1fr; gap: 8px; align-items: stretch; }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; padding-top: 1px; font-size: .95em; }
.timeline .bar { display: flex; flex-direction: column; align-items: center; }
.timeline .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--text-2); margin-top: 5px; flex: none; }
.timeline .bar b { flex: 1; width: 4px; border-radius: 2px; margin: 2px 0; background: var(--wait); }
.timeline .k-auto .bar b { background: var(--car); } .timeline .k-scooter .bar b { background: var(--scooter); }
.timeline .k-train .bar b { background: var(--train); } .timeline .k-walk .bar b { background: var(--muted); }
.timeline .k-wait .bar b { background: repeating-linear-gradient(var(--wait) 0 4px, transparent 4px 8px); }
.timeline .c { padding-bottom: 12px; min-width: 0; }
.timeline .c .h { font-weight: 600; }
.timeline .c .s { color: var(--text-2); font-size: .88em; }
.timeline li.end .c { padding-bottom: 0; }
.timeline li.wake .t { color: var(--accent); }

/* Planer-Optionen */
.routes { display: grid; gap: 12px; }
@media (min-width: 1000px) { .routes { grid-template-columns: 1fr 1fr; } }
.opt {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; margin-top: 8px;
}
.opt:hover { border-color: var(--accent); }
.opt.on { border: 2px solid var(--accent); padding: 8px 10px; background: var(--accent-soft); }
.opt .times { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05em; }
.opt .meta { color: var(--text-2); font-size: .86em; }
.opt .times .muted { white-space: nowrap; }
@media (max-width: 600px) { .opt .cost .meta { display: none; } }
.opt .cost { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sticky-save { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; }
@media (min-width: 900px) { .sticky-save { bottom: 12px; } }

/* Diagramm */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: var(--text); fill-opacity: .05; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86em; color: var(--text-2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: .86em; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 150px;
}
.tip .r { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip .r span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tip .h { font-weight: 600; margin-bottom: 4px; }

/* Dialog */
.ov { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .ov { align-items: center; } }
.dlg { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 14px 14px 0 0; padding: 16px; }
@media (min-width: 700px) { .dlg { border-radius: 14px; } }
.dlg .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.err-text { color: var(--bad); font-size: .9em; }

/* Liste (Wege, Abschnitte) */
.list { display: grid; gap: 8px; }
.li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); flex-wrap: wrap; }
.li .main { min-width: 0; flex: 1 1 220px; }
.li .t { font-weight: 600; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .85em; color: var(--text-2); margin-top: 3px; }
.steps .st { display: inline-flex; align-items: center; gap: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 12px; border-radius: 99px; text-decoration: none; color: var(--text-2); border: 1px solid var(--line); background: var(--surface); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 70;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: 92vw; font-size: .93em; }
.toast.err { background: var(--bad); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Anmeldung */
.auth { max-width: 360px; margin: 12vh auto; }
.loading { padding: 30px; text-align: center; color: var(--muted); }

/* Planer-Kopf */
.pform { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.pform > label.f { flex: 1 1 150px; }
.pform > .segf { flex: none; display: flex; flex-direction: column; gap: 4px; font-size: .88em; color: var(--text-2); }
.pform > .btn { flex: 1 1 180px; }

/* Verbindungen als Liste, Details per Pfeil aufklappbar */
.olist { display: grid; gap: 8px; margin-top: 8px; }
.orow { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.orow.best { border-left: 4px solid var(--accent); }
.orow.best .orow-head { background: var(--accent-soft); }      /* blau nur die empfohlene */
.orow .badge.rt { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.orow.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.orow-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; width: 100%; text-align: left; font: inherit;
  color: var(--text); background: none; border: 0; padding: 9px 12px; cursor: pointer; border-radius: 9px;
}
.orow-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.orow .c { display: flex; flex-direction: column; min-width: 0; }
.orow .c small { color: var(--text-2); font-size: .78em; white-space: nowrap; }
.orow .c b { font-variant-numeric: tabular-nums; font-size: 1.05em; white-space: nowrap; }
.orow .c.wake b { color: var(--accent); }
.orow .c.sub b { font-weight: 400; color: var(--text-2); font-size: .95em; }
.orow .c.cost { text-align: right; }
.orow .c.cost b { font-size: 1.2em; }
.orow .tags { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; justify-content: center; }
.orow .rec { flex: 0 0 92px; display: flex; justify-content: center; }
.orow .chev { display: flex; color: var(--accent); }
.orow .chev svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.orow.open .chev svg { transform: rotate(180deg); }
.orow-body { padding: 4px 12px 12px; border-top: 1px dashed var(--line); }
.orow-body .tbl.costs { max-width: 420px; }
.orow-body .tbl.costs td { padding: 5px 2px; }
.orow-body .tbl.costs tr.sum td { font-weight: 700; border-bottom: 0; }
@media (max-width: 600px) {
  .orow-head { gap: 6px 14px; }
  .orow .c.cost { margin-left: 0; text-align: left; }
  .orow .tags { order: 9; flex: 0 1 auto; justify-content: flex-start; }
  .orow .rec { order: 9; flex: 0 1 auto; }
  .orow .tags:empty, .orow .rec:empty { display: none; }
  .orow .chev { order: 10; margin-left: auto; }
}

/* Ablauf als Haltestellen-Folge: Ort mit an/ab, dazwischen Verkehrsmittel */
.itin { list-style: none; margin: 0; padding: 0; }
.itin li { display: grid; grid-template-columns: 64px 18px 1fr; gap: 0 10px; }
.itin .tm { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font-variant-numeric: tabular-nums; }
.itin .tm .t { font-weight: 700; white-space: nowrap; line-height: 1.25; }
.itin .tm .t small { font-weight: 400; color: var(--muted); font-size: .75em; margin-right: 4px; }
.itin .mk { display: flex; flex-direction: column; align-items: center; }
.itin .stop .mk i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--text-2); background: var(--surface); margin: auto 0; flex: none; }
.itin .stop.first .mk i, .itin .stop.last .mk i { border-color: var(--accent); background: var(--accent); }
.itin .stop.wake .mk i { border-color: var(--line); width: 10px; height: 10px; }
.itin .stop .nm { padding: 6px 0; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.itin .stop .nm b { font-size: 1.02em; }
.itin .nm small { color: var(--text-2); font-size: .84em; }
.itin .leg .mk b { width: 5px; flex: 1; border-radius: 3px; background: var(--wait); min-height: 38px; }
.itin .leg.k-auto .mk b { background: var(--car); } .itin .leg.k-scooter .mk b { background: var(--scooter); }
.itin .leg.k-train .mk b { background: var(--train); } .itin .leg.k-walk .mk b { background: repeating-linear-gradient(var(--muted) 0 4px, transparent 4px 8px); }
.itin .leg .nm { padding: 6px 0 8px; display: flex; flex-direction: column; justify-content: center; font-size: .92em; min-width: 0; }
.itin .stop.wake .nm b { color: var(--accent); font-weight: 600; }
.orow-body .itin li { grid-template-columns: 60px 18px 1fr; }

/* Fahrtenbuch: Hin und Rück unter einem Datum */
.tbl.tripbook tbody.daygrp { cursor: pointer; }
.tbl.tripbook tbody.daygrp:hover td { background: var(--surface-2); }
.tbl.tripbook tbody.daygrp td { border-bottom: 1px solid var(--line); }
.tbl.tripbook tbody.daygrp tr:not(:last-child) td:not(.dcell) { border-bottom: 1px dashed var(--line); }
.tbl.tripbook tbody.daygrp tr:last-child td, .tbl.tripbook td.dcell { border-bottom: 2px solid var(--line); }
.tbl.tripbook td.dcell { white-space: nowrap; vertical-align: middle; }
@media (max-width: 600px) { .tbl.tripbook .kmcol { display: none; } }

/* Auswahl im Vergleich, Erledigungen */
.extras { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 10px; }
.extras .chk { background: var(--surface-2); border-radius: 99px; padding: 6px 12px; }
.tbl.cmp i.radio { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); margin-right: 8px; vertical-align: -2px; }
.tbl.cmp tr.chosen td { background: var(--accent-soft); }
.tbl.cmp tr.chosen i.radio { border-color: var(--accent); background: radial-gradient(var(--accent) 0 45%, transparent 50%); }
.orow.chosen { border-color: var(--accent); }
details.card > summary { cursor: pointer; }

/* Verkehrsmittel-Symbol links neben dem farbigen Strich */
.itin .leg .tm { align-items: flex-end; }
.itin .leg .ic { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface-2); }
.itin .leg .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.itin .leg.k-auto .ic { color: var(--car); } .itin .leg.k-scooter .ic { color: var(--scooter); }
.itin .leg.k-train .ic { color: var(--train); } .itin .leg.k-walk .ic { color: var(--muted); }
.itin .leg .nm small { font-size: .86em; }

/* Ablauf: Aufenthalt rechts neben dem Ort, Dauer der Fahrt in eigener Zeile */
.itin .stop .nm.row-nm { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 10px; }
.itin .stop .stay { font-size: .84em; color: var(--text-2); background: var(--surface-2); border-radius: 99px; padding: 1px 9px; white-space: nowrap; }
.itin .stop.wake .stay { background: none; padding: 0; }
.itin .leg .nm .dur { font-weight: 600; font-size: .92em; }

/* Wecker statt Punkt bei der Aufstehzeit */
.itin .stop.wake .mk { justify-content: center; }
.itin .stop.wake .alarm { display: inline-flex; color: var(--accent); }
.itin .stop.wake .alarm svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Wecker links neben der Aufstehzeit (Liste und Vergleich) */
.wake-t { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); white-space: nowrap; }
.wake-t .alarm-i { display: inline-flex; }
.wake-t .alarm-i svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tbl.cmp td .wake-t { font-weight: 600; }

/* Wege-Übersicht: nur Orte mit Pfeilen */
.steps .arr { color: var(--muted); margin: 0 2px; }

/* Wege-Übersicht: farbiger Pfeil je Abschnitt mit km */
.steps { row-gap: 6px; }
.steps .arrow { display: inline-flex; flex-direction: column; align-items: center; min-width: 46px; margin: 0 4px; line-height: 1; }
.steps .arrow small { font-size: .78em; color: var(--text-2); margin-bottom: 2px; white-space: nowrap; }
.steps .arrow i { position: relative; display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--wait); }
.steps .arrow i::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5.5px solid transparent; border-left: 8px solid var(--wait); border-right: 0; }
.steps .arrow.car i { background: var(--car); } .steps .arrow.car i::after { border-left-color: var(--car); }
.steps .arrow.scooter i { background: var(--scooter); } .steps .arrow.scooter i::after { border-left-color: var(--scooter); }
.steps .arrow.train i { background: var(--train); } .steps .arrow.train i::after { border-left-color: var(--train); }
.steps .arrow.car small { color: var(--car); } .steps .arrow.scooter small { color: var(--scooter); } .steps .arrow.train small { color: var(--train); }
.li .main .steps { color: var(--text); font-size: .9em; }
.steps .hop { display: inline-flex; align-items: center; white-space: nowrap; gap: 3px; margin-left: 3px; }

/* Übersicht: geplante Fahrten (Zeilen wie im Planer) und Rückweg-Vorschlag */
.orow.pl { border-left: 4px solid var(--accent); }
.orow.pl.past { border-left-color: var(--warn); }
.orow.pl.sugg { border-left: 4px dashed var(--ticket); background: var(--surface); }
.orow .pl-title { padding: 8px 12px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.suggest { margin-left: 18px; }
@media (max-width: 600px) { .suggest { margin-left: 8px; } }

/* Übersicht: Datum und Uhrzeit statt Überschrift */
.dash-now { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; color: var(--text-2); }
.dash-now b { font-size: 1.35rem; color: var(--text); }

/* Übersicht: 3 große Zahlen, „Wohin das Geld geht“, Zugticket abbezahlt */
.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.hero .big { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.hero .big .v { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.hero .big .l { font-size: .85em; color: var(--text-2); margin-top: 2px; }
.hero .big .v { white-space: nowrap; }
.hero .big .sub { font-size: .8em; color: var(--muted); margin-top: 1px; }
.hero .big.good { border-left: 4px solid var(--good); }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; }
  .hero .big { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
  .hero .big .v { font-size: 1.3rem; grid-column: 2; grid-row: 1 / span 2; }
  .hero .big .l { grid-column: 1; grid-row: 1; margin: 0; } .hero .big .sub { grid-column: 1; grid-row: 2; } }
.where-h { margin: 16px 0 6px; }
.stackbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.stackbar i { display: block; height: 100%; min-width: 3px; }
.tbl.where td { padding: 6px 4px; }
.tbl.where .dot { margin-right: 8px; vertical-align: -1px; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ticket); border-radius: 99px; }
/* Unterreiter (z. B. Einstellungen → Wege) */
.seg a { white-space: nowrap; background: var(--surface); color: var(--text-2); padding: 7px 14px; text-decoration: none; }
.seg a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.subtabs { margin-bottom: 12px; }
/* Eingeklappte Erklärungen „Wie wird gerechnet?“ */
details.how { margin: 0 0 12px; font-size: .9em; color: var(--text-2); }
details.how summary { cursor: pointer; color: var(--accent); width: fit-content; }
details.how > div { margin-top: 6px; }
.fixitem { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.fixitem .spread { align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.fixitem .hist { margin-top: 6px; }
.fixitem .hist summary { cursor: pointer; color: var(--accent); }
.fixitem .hist .tbl { max-width: 460px; margin-top: 4px; }
.fixitem .hist .tbl td { padding: 4px 6px; vertical-align: middle; }
/* Weg bearbeiten: Schritte untereinander */
.steplist { margin: 0; padding-left: 1.6em; display: grid; gap: 6px; }
.steplist li { padding-left: 2px; }
.steplist li .dot { margin-right: 6px; vertical-align: -1px; }
.steplist .sm { color: var(--text-2); font-size: .85em; display: inline-block; min-width: 68px; }
.steplist .sinfo { margin-left: 6px; white-space: nowrap; }
/* „Verbindungen suchen“ auf Höhe der Eingabefelder (Platzhalter statt Beschriftung), „Nächste Verbindung“ darunter */
.pform > .pbtns { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; }
.pform > .pbtns .sp { font-size: .88em; line-height: 1.45; }
.pform > .pbtns .btn + .btn { margin-top: 2px; }
@media (max-width: 600px) { .pform > .pbtns .sp { display: none; } }
/* Heute verpasste Verbindungen: knallrot = abgefahren; gelb = bis 5 min zu spät, orange = mehr als 5 min zu spät */
.orow.miss-gone { border-left: 5px solid var(--gone); background: color-mix(in srgb, var(--gone) 16%, var(--surface)); }
.orow.miss-knapp { border-left: 4px solid var(--m1); background: color-mix(in srgb, var(--m1) 14%, var(--surface)); }
.orow.miss-orange { border-left: 4px solid var(--m2); background: color-mix(in srgb, var(--m2) 14%, var(--surface)); }
.badge.miss-gone { background: var(--gone); color: #fff; font-weight: 700; }
.badge.miss-knapp { background: var(--m1); color: #2e1700; font-weight: 600; }
.badge.soon { background: var(--soon); color: #3a2c00; font-weight: 600; }
.badge.soon-ok { background: #1f9d55; color: #fff; font-weight: 600; }
/* „Abfahrt in“ über 15 min: nur umrandet, nicht hinterlegt (Rand und Schrift in Textfarbe: im dunklen Modus weiß) */
.badge.soon-far { background: transparent; color: var(--text); font-weight: 600; border: 1.5px solid var(--text); }
.badge.miss-orange { background: var(--m2); color: #fff; font-weight: 600; }
.tbl.cmp tr.miss-gone td:first-child { box-shadow: inset 5px 0 0 var(--gone); }
.tbl.cmp tr.miss-knapp td:first-child { box-shadow: inset 4px 0 0 var(--m1); }
.tbl.cmp tr.miss-orange td:first-child { box-shadow: inset 4px 0 0 var(--m2); }
/* Übersicht „Jetzt losfahren“: Kacheln je Weg, Details darunter über die ganze Breite */
/* Kacheln teilen sich die ganze Breite (so viele Spalten wie Wege; am Handy 2 je Zeile) */
.tiles { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile:hover { border-color: var(--accent); }
.tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.tile .tt { font-weight: 600; font-size: .92em; }
/* Zeitenreihe: kleine (Aufstehen/Feierabend, Zug ab/an) und große Zeiten (Abfahrt, Ankunft) */
.tile .trow { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 2px; }
.tile .trow span { display: flex; flex-direction: column; }
.tile .trow b { white-space: nowrap; }
.tile { container-type: inline-size; }
.tile .trow small { color: var(--text-2); font-size: .7em; line-height: 1.2; }
.tile .trow .s b { font-size: .95rem; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tile .trow .L b { font-size: 1.3rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .tc { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tiledet { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tile .nw { white-space: nowrap; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }
/* schmale Kachel (z. B. 4 nebeneinander am PC): Zeitenreihe kompakter, damit nichts zusammenstößt */
@container (max-width: 300px) {
  .tile .trow { gap: 4px; }
  .tile .trow small { font-size: .62em; }
  .tile .trow .s b { font-size: .8rem; }
  .tile .trow .L b { font-size: 1.05rem; }
}
/* Kachel: Symbol statt „Zug ab“/„Zug an“ – mittig über der Uhrzeit, Zug und Pfeil auf gleicher Höhe */
.tile .trow span:has(.tsym) { align-items: center; }
.tile .trow small .tsym { display: inline-flex; flex-direction: row; align-items: center; gap: 0; color: var(--train); height: 1.6em; }
.tile .trow small .tsym svg { display: block; width: 1.5em; height: 1.5em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tgrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tilenav { gap: 6px; }
.tilenav .btn { min-height: 30px; padding: 3px 10px; }
/* Kachel-Gruppen „Mit dem Zug“ / „Nur Auto“: eigene Zeile, kleine Überschrift mit Farbstrich, Trennlinie */
.tilegrp { margin-top: 8px; }
.tilegrp + .tilegrp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tilegrp .tgh { font-size: .78em; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px; }
.tilegrp .tgh::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--muted); }
.tilegrp.train .tgh::before { background: var(--train); } .tilegrp.car .tgh::before { background: var(--car); }
.tilegrp.train .tile { border-left: 3px solid var(--train); } .tilegrp.car .tile { border-left: 3px solid var(--car); }
/* Übersicht „Nächste Verbindung“ als Liste: je Weg eine Zeile mit der ganzen Verbindung als Kette */
.clist { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 6px; }
.tile.crow { gap: 6px; padding: 10px 14px; }
.crow .ch { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.crow .ch .tt { font-weight: 600; }
.crow .ch .cr { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.crow .ch .cr b { font-size: 1.05rem; }
.steps.conn { font-size: .9em; row-gap: 8px; margin-top: 2px; }
.steps.conn .arrow { min-width: 62px; }
.conn .cst { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.conn .cst .cn { color: var(--text); font-weight: 600; white-space: nowrap; }
.conn .cst .ct { color: var(--text-2); font-size: .88em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.conn .cst .ct b { color: var(--text); font-size: 1.05em; }
.conn .cst.end .ct b { font-size: 1.2em; }
/* Handy: Verbindung senkrecht – Ort links, Zeit rechts, dazwischen Pfeil nach unten mit Dauer */
@media (max-width: 560px) {
  .steps.conn { flex-direction: column; align-items: stretch; gap: 0; row-gap: 0; }
  .conn .cst { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 8px; }
  .conn .cst .cn { white-space: normal; }
  .steps.conn .arrow { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; margin: 2px 0 2px 6px; }
  .steps.conn .arrow small { margin: 0; }
  .steps.conn .arrow i { width: 3px; height: 18px; }
  .steps.conn .arrow i::after { right: auto; left: -4px; top: auto; bottom: -5px; border: 5.5px solid transparent; border-top: 7px solid var(--wait); border-bottom: 0; }
  .steps.conn .arrow.car i::after { border-top-color: var(--car); }
  .steps.conn .arrow.scooter i::after { border-top-color: var(--scooter); }
  .steps.conn .arrow.train i::after { border-top-color: var(--train); }
  .crow .ch .cr { margin-left: 0; width: 100%; justify-content: space-between; }
}
.steps.conn .arrow small { display: inline-flex; align-items: center; gap: 3px; }
.steps.conn .arrow .mi { display: inline-flex; }
.steps.conn .arrow .mi svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Übersicht: Details rollen in der angeklickten Zeile auf */
.cwrap { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.cwrap .tile.crow { border: 0; border-radius: 0; background: none; width: 100%; }
.tilegrp.train .cwrap { border-left: 3px solid var(--train); } .tilegrp.car .cwrap { border-left: 3px solid var(--car); }
.tilegrp .cwrap .tile { border-left: 0; }
.cwrap:hover { border-color: var(--accent); }
.cwrap.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cwrap.open .tile.crow { background: var(--accent-soft); }
.cwrap .cbody { padding: 0 14px 12px; }
.cwrap .cbody .tiledet { margin-top: 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.crow .chev { display: flex; color: var(--accent); }
.crow .chev svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.cwrap.open .crow .chev svg { transform: rotate(180deg); }
/* „Geplant“: gleiche Zeilen wie „Nächste Verbindung“, aber hervorgehoben umrandet */
#plancard .cwrap.pl { border: 2px solid var(--accent); }
#plancard .cwrap.pl.past { border-color: var(--bad); }
#plancard .cwrap.sugg { border: 2px dashed var(--ticket); }
#plancard .suggest { margin-top: 8px; }
.badge.planned { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* Übersicht-Zeilen: Aufstehen/Feierabend-Zeit blau mit Symbol wie im Planer */
.crow .ch .wk { color: var(--accent); font-weight: 600; }
.crow .ch .wk .wake-t { font-weight: 600; }
/* „Nächste Verbindung“: Pfeil neben der Überschrift zum Ein-/Ausklappen (nur wenn heute etwas geplant ist) */
.nowhead { align-items: center; } .nowhead h2 { margin: 0; } .nowctl { gap: 8px; align-items: center; }
#nowtog { min-height: 30px; padding: 2px 6px; }
#nowtog .chev { display: inline-flex; } #nowtog .chev svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
#nowtog.up .chev svg { transform: rotate(180deg); }
#carcard .tilegrp { margin-top: 4px; }
.tilegrp.train .tgrow { justify-content: flex-end; }
/* kleiner Umschalter (z. B. Hinfahrt/Rückfahrt neben der Überschrift) */
.seg.segsm button { min-height: 30px; padding: 3px 10px; font-size: .85em; }
.nowctl { gap: 6px 12px; flex-wrap: wrap; }
.nowhead { flex-wrap: wrap; gap: 6px 12px; } .nowright { gap: 8px; align-items: center; margin-left: auto; }
#nownav .tilenav { margin: 0; }
#nowcard .tilegrp.train { margin-top: 10px; }
/* Schloss an Menüpunkten, die die volle Anmeldung brauchen (Fahrtenbuch, Einstellungen) */
body.noadmin .nav a[data-lock] span::after { content: " 🔒"; font-size: .75em; }
.authdlg { max-width: 420px; }
.authdlg .f { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
/* Zugriffs-Protokoll */
.logwrap { overflow-x: auto; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.loglog { width: 100%; border-collapse: collapse; font-size: 13px; }
.loglog th, .loglog td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.loglog th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
.lg-ok { color: var(--good); } .lg-bad { color: var(--bad); } .lg-warn { color: var(--warn); } .lg-info { color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
#tab > .grid2 { margin-bottom: 12px; }
