/* Gestaltung: Straßenkarte. Tinte (dunkles Petrol) trägt, Strecke (Firmenfarbe) führt, Signalgelb heißt "jetzt / fällig". */
@font-face { font-family: Overpass; src: url(/lib/fonts/overpass-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Overpass; src: url(/lib/fonts/overpass-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Overpass; src: url(/lib/fonts/overpass-latin-800-normal.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --tinte: #12343B; --tinte-hell: #1E4C56; --strecke: #0B6E79; --signal: #FFC83D; --signal-tief: #6B4E00;
  --rot: #BF3528; --rot-hell: #FBE9E6; --gruen: #2B7A4B;
  --text: #15262B; --text-2: #536469; --linie: #D5DDDD; --flaeche: #FFFFFF; --grund: #EDF1F0; --grund-2: #E2E8E7;
  --r1: 6px; --r2: 12px; --leiste: 232px; --unten: 0px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.45 Overpass, system-ui, sans-serif; color: var(--text); background: var(--grund); overscroll-behavior-y: contain; font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: 19px; line-height: 1.2; font-weight: 800; }
h3 { font-size: 16px; font-weight: 600; }
a { color: var(--strecke); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.leise { color: var(--text-2); }
.klein { font-size: 14px; }
.lade { padding: 48px 20px; text-align: center; color: var(--text-2); }
[hidden] { display: none !important; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Rahmen: Leiste links (PC), Leiste unten (Handy) ---------- */
.rahmen { min-height: 100dvh; }
.leiste { position: fixed; inset: 0 auto 0 0; width: var(--leiste); background: var(--tinte); color: #fff; display: flex; flex-direction: column; padding: 18px 12px 12px; z-index: 5; }
.leiste .marke { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.leiste .marke img { width: 30px; height: 30px; border-radius: 7px; }
.leiste .firma { padding: 0 10px 14px; font-size: 14px; color: #B9CDD1; border-bottom: 1px solid #ffffff22; margin-bottom: 10px; overflow-wrap: anywhere; }
.leiste nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.leiste a, .leiste button.nav { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: var(--r1); color: #DCE8EA; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.leiste a:hover, .leiste button.nav:hover { background: #ffffff14; color: #fff; }
.leiste a[aria-current="page"] { background: #fff; color: var(--tinte); font-weight: 600; }
.leiste .fuss { border-top: 1px solid #ffffff22; padding-top: 8px; }
.inhalt { margin-left: var(--leiste); padding: 28px 32px 56px; max-width: 1360px; }
.kopfzeile, .tableiste { display: none; }

@media (max-width: 899px) {
  :root { --unten: calc(62px + env(safe-area-inset-bottom)); }
  .leiste { display: none; }
  .inhalt { margin-left: 0; padding: 14px 14px calc(var(--unten) + 24px); }
  .kopfzeile { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 4; background: var(--tinte); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; min-height: 52px; }
  .kopfzeile .titel { font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kopfzeile button { background: none; border: 0; color: #fff; min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: var(--r1); }
  .tableiste { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); }
  .tableiste a, .tableiste button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; font-size: 12px; color: var(--text-2); text-decoration: none; background: none; border: 0; }
  .tableiste a[aria-current="page"] { color: var(--tinte); font-weight: 600; box-shadow: inset 0 3px 0 var(--strecke); }
  h1 { font-size: 24px; }
}

/* ---------- Bausteine ---------- */
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.kopf .neben { display: flex; gap: 8px; flex-wrap: wrap; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r1); border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf:hover { border-color: var(--text-2); }
.knopf.haupt { background: var(--strecke); border-color: var(--strecke); color: #fff; }
.knopf.haupt:hover { filter: brightness(0.92); }
.knopf.still { border-color: transparent; background: none; color: var(--strecke); padding: 0 10px; }
.knopf.gefahr { color: var(--rot); }
.knopf.rund { padding: 0; width: 44px; }
.knopf[disabled] { opacity: 0.5; cursor: default; }
.knopf.schmal { min-height: 36px; padding: 0 10px; font-size: 14px; }
@media (max-width: 899px) { .knopf.schmal { min-height: 44px; } }

label.feld { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); }
label.feld > input, label.feld > select, label.feld > textarea, .eingabe { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 9px 12px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; color: var(--text); font-weight: 400; font-size: 16px; }
label.feld > textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.eingabe { margin-top: 0; }
.felder { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.felder .breit { grid-column: 1 / -1; }
@media (max-width: 599px) { .felder { grid-template-columns: 1fr; } }
.wahl { display: flex; gap: 6px; flex-wrap: wrap; }
.wahl label { position: relative; }
.wahl input { position: absolute; opacity: 0; inset: 0; }
.wahl span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid #B5C1C2; border-radius: 22px; background: #fff; cursor: pointer; }
.wahl input:checked + span { background: var(--tinte); border-color: var(--tinte); color: #fff; font-weight: 600; }
.wahl input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }

.tafel { background: var(--flaeche); border-radius: var(--r2); padding: 20px; }
.tafel > h2 { margin-bottom: 12px; }
.raster { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1099px) { .raster { grid-template-columns: 1fr; } }

.zeilen { list-style: none; margin: 0; padding: 0; }
.zeilen > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linie); min-height: 52px; }
.zeilen > li:first-child { border-top: 0; }
.zeilen .haupt { flex: 1; min-width: 0; }
.zeilen .haupt > a, .zeilen .haupt > button, .zeilen .haupt > strong { display: block; font-weight: 600; color: var(--text); text-decoration: none; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: 100%; overflow-wrap: anywhere; }
.zeilen .haupt > a:hover, .zeilen .haupt > button:hover { color: var(--strecke); }
.zeilen .haupt > span { display: block; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.leer { padding: 22px 0; color: var(--text-2); }

.marke-f { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--grund); color: var(--text-2); }
.marke-f.ueber { background: var(--rot-hell); color: var(--rot); }
.marke-f.bald, .marke-f.nie { background: #FFF1C9; color: var(--signal-tief); }
.punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.haken { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; flex: none; margin: -6px 0 -6px -10px; }
.haken i { width: 22px; height: 22px; border: 2px solid #8A9B9E; border-radius: 6px; display: grid; place-items: center; }
.haken[aria-checked="true"] i { background: var(--gruen); border-color: var(--gruen); }
.haken[aria-checked="true"] i::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.erledigt strong, .erledigt .haupt > button { text-decoration: line-through; color: var(--text-2); }

/* ---------- Streckenband: der Tag als Linie mit Haltepunkten ---------- */
.band { position: relative; display: flex; gap: 0; overflow-x: auto; padding: 6px 2px 4px; scrollbar-width: thin; }
.band .halt { position: relative; flex: 1 0 150px; max-width: 240px; padding: 34px 14px 0 0; }
.band .halt::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; background: var(--strecke); }
.band .halt:first-child::before { border-radius: 2px 0 0 2px; }
.band .halt:last-child::before { right: 30%; border-radius: 0 2px 2px 0; }
.band .halt::after { content: ""; position: absolute; left: 0; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--strecke); }
.band .halt.vorbei::before { background: #9FB3B6; }
.band .halt.vorbei::after { border-color: #9FB3B6; }
.band .halt.jetzt::after { background: var(--signal); border-color: var(--tinte); }
.band .halt time { display: block; font-weight: 800; font-size: 17px; }
.band .halt b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.band .halt span { display: block; font-size: 14px; color: var(--text-2); }
.band a { color: inherit; text-decoration: none; }
.band a:hover b { color: var(--strecke); }
.heute { background: var(--flaeche); border-radius: var(--r2); padding: 20px 20px 16px; margin-bottom: 16px; }
.heute .zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
@media (max-width: 899px) {
  .band { flex-direction: column; overflow: visible; padding-left: 2px; }
  .band .halt { flex: none; max-width: none; padding: 0 0 18px 36px; min-height: 52px; }
  .band .halt::before { left: 8px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; }
  .band .halt:last-child::before { right: auto; bottom: 60%; }
  .band .halt::after { top: 0; }
}

/* ---------- Kunden ---------- */
.suchzeile { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; margin-bottom: 12px; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter select { min-height: 44px; padding: 0 34px 0 12px; border: 1px solid #B5C1C2; border-radius: 22px; background: #fff; max-width: 100%; }
.treffer { background: var(--flaeche); border-radius: var(--r2); padding: 4px 20px; }
.treffer .zeilen > li { padding: 12px 0; }
.kat { width: 6px; align-self: stretch; border-radius: 3px; flex: none; background: var(--linie); }
.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .zweispaltig { grid-template-columns: 1fr; } }
.karte { height: 560px; border-radius: var(--r2); overflow: hidden; background: var(--grund-2); isolation: isolate; }
.karte.klein-k { height: 300px; }
@media (max-width: 899px) { .karte { height: 62dvh; } .karte.klein-k { height: 260px; } }
.stift { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0006; display: grid; place-items: center; color: #fff; font: 800 11px/1 Overpass, sans-serif; }
.stift.faellig { box-shadow: 0 0 0 3px var(--signal), 0 0 0 4px #0006; }
.stift.stopp { width: 28px; height: 28px; font-size: 13px; background: var(--tinte); }
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 12px 14px; font-size: 15px; line-height: 1.4; }
.leaflet-popup-content .knopf { margin-top: 8px; }
.tagwahl { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }

.akte { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .akte { grid-template-columns: 1fr; } }
.akte dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 15px; }
.akte dt { color: var(--text-2); }
.akte dd { margin: 0; overflow-wrap: anywhere; }
.tun { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; font-weight: 600; margin-bottom: 4px; }

/* ---------- Journal ---------- */
.eintrag { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--linie); }
.eintrag:first-child { border-top: 0; }
.eintrag .art { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grund); color: var(--tinte); }
.eintrag.besuch .art { background: var(--tinte); color: #fff; }
.eintrag header { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: baseline; }
.eintrag header a { font-weight: 600; color: var(--text); text-decoration: none; }
.eintrag header a:hover { color: var(--strecke); }
.eintrag p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; max-width: 76ch; }
.tagkopf { font-size: 14px; font-weight: 600; color: var(--text-2); padding: 18px 0 2px; }

/* ---------- Kalender ---------- */
.woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--linie); border-radius: var(--r2); overflow: hidden; }
.woche .tag { background: var(--flaeche); min-height: 360px; padding: 10px 8px 12px; }
.woche .tag.heute-t { background: #FFFBEA; }
.woche .tag > header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; color: var(--text-2); }
.woche .tag > header b { font-size: 20px; font-weight: 800; color: var(--text); }
.woche .tag.heute-t > header b { background: var(--signal); border-radius: 6px; padding: 0 6px; }
.termin { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--strecke); background: var(--grund); border-radius: 0 var(--r1) var(--r1) 0; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; font-size: 14px; min-height: 44px; }
.termin:hover { background: var(--grund-2); }
.termin time { display: block; font-weight: 800; }
.termin.tour { border-left-color: var(--tinte); border-left-style: double; border-left-width: 6px; }
.tagleiste { display: none; }
@media (max-width: 899px) {
  .woche { display: block; background: none; border-radius: 0; overflow: visible; }
  .woche .tag { display: none; border-radius: var(--r2); min-height: 200px; padding: 14px; }
  .woche .tag.gewaehlt { display: block; }
  .tagleiste { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
  .tagleiste button { min-height: 52px; border: 0; background: var(--flaeche); border-radius: var(--r1); font-size: 12px; color: var(--text-2); }
  .tagleiste button b { display: block; font-size: 17px; color: var(--text); }
  .tagleiste button[aria-pressed="true"] { background: var(--tinte); color: #CFE0E3; }
  .tagleiste button[aria-pressed="true"] b { color: #fff; }
  .tagleiste button.heute-t b { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; text-underline-offset: 4px; }
}
.wochenwahl { display: flex; align-items: center; gap: 6px; }
.wochenwahl strong { min-width: 150px; text-align: center; }

/* ---------- Tour ---------- */
.tourplan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1199px) { .tourplan { grid-template-columns: 1fr; } }
.tourtag { background: var(--flaeche); border-radius: var(--r2); padding: 14px 16px 12px; margin-bottom: 12px; border: 2px solid transparent; }
.tourtag.aktiv { border-color: var(--tinte); }
.tourtag > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tourtag > header h3 { flex: 1; font-size: 17px; font-weight: 800; cursor: pointer; }
.tourtag > header .summe { font-size: 14px; color: var(--text-2); }
.tourtag input[type="time"] { min-height: 40px; border: 1px solid #B5C1C2; border-radius: var(--r1); padding: 0 8px; background: #fff; }
.strecke { list-style: none; margin: 10px 0 0; padding: 0; }
.strecke li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0 6px 34px; min-height: 48px; }
.strecke li::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 4px; background: var(--tag, var(--strecke)); }
.strecke li:first-child::before { top: 50%; }
.strecke li:last-child::before { bottom: 50%; }
.strecke li:only-child::before { display: none; }
.strecke li::after { content: attr(data-n); position: absolute; left: 0; top: 24px; translate: 0 -50%; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--tag, var(--strecke)); font: 800 11px/16px Overpass, sans-serif; text-align: center; color: var(--tinte); }
.strecke li.ort::after { background: var(--tag, var(--strecke)); }
.strecke li.zieh { opacity: 0.4; }
.strecke li.ziel-oben { box-shadow: inset 0 3px 0 var(--signal); }
.strecke .haupt { flex: 1 1 260px; min-width: 0; }
.strecke .bedien { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px; margin-left: auto; }
.strecke .haupt b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.strecke .haupt span { display: block; font-size: 13px; color: var(--text-2); }
.strecke .zeit { font-weight: 800; min-width: 46px; }
.strecke .mini { width: 36px; height: 36px; border: 0; background: none; border-radius: var(--r1); cursor: pointer; display: grid; place-items: center; color: var(--text-2); flex: none; }
.strecke .mini:hover { background: var(--grund); color: var(--text); }
@media (max-width: 899px) { .strecke .mini { width: 44px; height: 44px; } .strecke .haupt { flex-basis: 150px; } }
.strecke select.dauer { min-height: 36px; border: 1px solid var(--linie); border-radius: var(--r1); background: #fff; font-size: 14px; padding: 0 4px; }
.strecke .bedien.voll { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
.strecke select.ende { width: 100%; max-width: 360px; min-width: 0; text-overflow: ellipsis; }
.strecke li.fest .zeit { background: #FFF1C2; border-radius: 4px; padding: 1px 5px; margin-left: -5px; }
.strecke li.fest.spaet .zeit { background: var(--rot-hell); color: var(--rot); }
.strecke .haupt span.um { color: var(--signal-tief); font-weight: 600; }
.strecke .haupt span.um.warn, .tourtag > header .summe .warn { color: var(--rot); font-weight: 600; }
.strecke .mini.an, .strecke .mini.an:hover { color: var(--tinte); background: #FFF1C2; }
.speicherstand { font-size: 14px; color: var(--text-2); }
.speicherstand.warn { color: var(--rot); font-weight: 600; }
.hinweis { background: #FFF6D6; border-left: 4px solid var(--signal); padding: 10px 14px; border-radius: 0 var(--r1) var(--r1) 0; font-size: 15px; margin-bottom: 14px; }
.hinweis.rot { background: var(--rot-hell); border-left-color: var(--rot); }
.hinweis.gruen { background: #E4F3EA; border-left-color: var(--gruen); }

/* ---------- Vorschlagsliste am Suchfeld ---------- */
.vorschlag { position: relative; }
.vorschlag ul { list-style: none; margin: 4px 0 0; padding: 4px; background: #fff; border: 1px solid #B5C1C2; border-radius: var(--r1); max-height: 264px; overflow-y: auto; }
.vorschlag li button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; min-height: 44px; border-radius: 4px; cursor: pointer; }
.vorschlag li button:hover, .vorschlag li button:focus { background: var(--grund); }
.vorschlag li span { color: var(--text-2); font-size: 14px; }
.gewaehlt-k { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-height: 44px; padding: 4px 4px 4px 12px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: var(--grund); font-weight: 600; color: var(--text); font-size: 16px; }
.gewaehlt-k span { flex: 1; overflow-wrap: anywhere; }

/* ---------- Fenster ---------- */
#schicht:empty { display: none; }
.fenster-bg { position: fixed; inset: 0; z-index: 20; background: #0B1F2499; display: grid; place-items: center; padding: 20px; overscroll-behavior: contain; }
.fenster { background: var(--flaeche); border-radius: var(--r2); width: min(620px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.fenster.breit { width: min(900px, 100%); }
.fenster > header { display: flex; align-items: center; gap: 12px; padding: 14px 10px 10px 22px; }
.fenster > header h2 { flex: 1; }
.fenster .rumpf { padding: 6px 22px 18px; overflow-y: auto; overscroll-behavior: contain; }
.fenster > footer { display: flex; gap: 8px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); }
.fenster > footer .platz { flex: 1; }
.fenster .fehler { color: var(--rot); font-weight: 600; margin-top: 12px; }
@media (max-width: 599px) {
  .fenster-bg { padding: 0; place-items: end stretch; }
  .fenster, .fenster.breit { width: 100%; max-height: 94dvh; border-radius: var(--r2) var(--r2) 0 0; }
}
#meldung { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--unten) + 18px); z-index: 30; display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 28px); }
#meldung div { background: var(--tinte); color: #fff; padding: 11px 16px; border-radius: var(--r1); font-weight: 600; }
#meldung div.rot { background: var(--rot); }

/* ---------- Anmeldung ---------- */
.tor { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--flaeche); }
.tor .bild { background: var(--tinte); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.tor .bild h1 { font-size: clamp(34px, 4.2vw, 58px); max-width: 12ch; position: relative; }
.tor .bild p { color: #B9CDD1; max-width: 40ch; position: relative; }
.tor .bild svg.weg { position: absolute; inset: 0 0 auto 0; width: 100%; height: 52%; }
.tor .form { padding: 48px; display: grid; align-content: center; justify-items: start; }
.tor form { width: min(400px, 100%); display: grid; gap: 14px; }
.tor .marke { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; position: relative; }
.tor .marke img { width: 34px; height: 34px; border-radius: 8px; }
@media (max-width: 899px) {
  .tor { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .tor .bild { padding: 22px 20px 26px; gap: 22px; }
  .tor .bild p, .tor .bild svg.weg { display: none; }
  .tor .form { padding: 26px 20px 40px; align-content: start; }
}

table.liste { width: 100%; border-collapse: collapse; font-size: 15px; }
table.liste th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 14px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--linie); }
table.liste td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--linie); vertical-align: middle; overflow-wrap: anywhere; }
.rollbar { overflow-x: auto; }
.reiter { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--linie); overflow-x: auto; }
.reiter button { min-height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.reiter button[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--strecke); }
.katzeile { display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.katzeile input[type="color"] { width: 44px; height: 44px; padding: 2px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; }
.linkfeld { display: flex; gap: 8px; margin-top: 8px; }
.linkfeld input { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .fenster { animation: auf 0.16s ease-out; }
  @keyframes auf { from { opacity: 0; translate: 0 10px; } }
}

/* ---------- Schmale Bildschirme: Nachträge, die spätere Regeln brauchen ---------- */
@media (max-width: 899px) {
  .strecke select.dauer, .tourtag input[type="time"] { min-height: 44px; }
}
@media (max-width: 599px) {
  .katzeile { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .katzeile input[type="number"] { grid-column: 2; grid-row: 2; }
  .tagleiste { gap: 2px; }
  .tourtag { padding: 12px 12px 10px; }
}

/* ---------- Einrichtungs-Assistent: steht für sich, der Fortschritt ist eine Strecke mit sechs Haltepunkten ---------- */
.rahmen.fokus .leiste, .rahmen.fokus .kopfzeile, .rahmen.fokus .tableiste { display: none; }
.rahmen.fokus .inhalt { margin: 0 auto; max-width: 900px; padding: 22px 24px 60px; }
@media (max-width: 899px) { .rahmen.fokus .inhalt { padding: calc(12px + env(safe-area-inset-top)) 14px 40px; } }
.a-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.a-kopf .marke { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.a-kopf .marke img { width: 30px; height: 30px; border-radius: 7px; }
@media (max-width: 379px) { .a-kopf .marke span { display: none; } }
.etappen { list-style: none; display: flex; margin: 0 0 14px; padding: 0; }
.etappen li { flex: 1 1 0; position: relative; min-width: 44px; }
.etappen li:last-child { flex: 0 0 auto; }
.etappen li::before { content: ""; position: absolute; left: 13px; right: -13px; top: 11px; height: 4px; background: #C3CFD0; }
.etappen li.vorbei::before { background: var(--strecke); }
.etappen li:last-child::before { display: none; }
.etappen button { position: relative; display: grid; justify-items: start; align-content: start; gap: 6px; width: 100%; min-height: 48px; padding: 0; background: none; border: 0; cursor: pointer; font-size: 14px; color: var(--text-2); text-align: left; }
.etappen button[disabled] { cursor: default; }
.etappen i { width: 26px; height: 26px; border-radius: 50%; background: var(--grund); border: 4px solid #C3CFD0; display: grid; place-items: center; }
.etappen li.vorbei i { background: var(--strecke); border-color: var(--strecke); }
.etappen li.vorbei i::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.etappen li.jetzt i { background: var(--signal); border-color: var(--tinte); }
.etappen li.jetzt span { color: var(--text); font-weight: 800; }
.etappe-text { display: none; font-weight: 600; margin-bottom: 10px; }
@media (max-width: 699px) { .etappen { margin-bottom: 4px; } .etappen span { display: none; } .etappen button { min-height: 44px; } .etappe-text { display: block; } }
.a-schritt { padding: 26px 28px 22px; }
.a-schritt h1 { font-size: 28px; }
.a-einl { margin: 8px 0 20px; max-width: 64ch; }
.a-fuss { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--linie); }
.a-fuss .platz { flex: 1; }
.a-fehler { margin: 16px 0 0; }
@media (max-width: 599px) { .a-schritt { padding: 20px 16px 16px; } .a-schritt h1 { font-size: 23px; } }
span.feld { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); }
.farben { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.farben button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #B5C1C2; cursor: pointer; }
.farben button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--tinte); }
.eigene-farbe { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-left: 6px; }
.eigene-farbe input { width: 44px; height: 44px; padding: 2px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; }
.neu-person { border: 1px solid var(--linie); border-radius: var(--r2); padding: 16px; }
.oder { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--text-2); }
.plzzeile { display: grid; grid-template-columns: 200px 180px; gap: 12px; }
.plzzeile.sprung { grid-template-columns: minmax(0, 170px) minmax(0, 150px) auto; align-items: end; }
@media (max-width: 599px) { .plzzeile, .plzzeile.sprung { grid-template-columns: 1fr 1fr; } .plzzeile.sprung .knopf { grid-column: 1 / -1; } }
.heim { min-height: 28px; margin: 14px 0; }
.heim span { display: inline-flex; gap: 8px; align-items: center; }
.heim .gut { color: var(--gruen); }
.heim .gut strong { color: var(--text); }
.heim .warn { color: var(--rot); }

/* ---------- Liste einlesen ---------- */
.ablage { border: 2px dashed #9FB3B6; border-radius: var(--r2); padding: 26px 18px 22px; display: grid; gap: 10px; justify-items: center; text-align: center; background: var(--grund); }
.ablage.drueber { border-color: var(--strecke); background: var(--grund-2); }
.ablage > svg.ic { width: 34px; height: 34px; color: var(--tinte); }
@media (hover: none), (max-width: 899px) { .nur-pc { display: none; } }
.vorlage { display: flex; gap: 12px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: var(--r2); }
.vorlage > div { flex: 1 1 260px; display: grid; gap: 2px; }
.dateizeile { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; background: var(--grund); border-radius: var(--r1); overflow-wrap: anywhere; }
.zu { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1.1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.zu label { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zu select { min-height: 44px; width: 100%; padding: 0 10px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; font-size: 16px; }
.zu .muster { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 599px) { .zu { grid-template-columns: 1fr; gap: 2px; } .zu label { margin-top: 10px; } .zu .muster:empty { display: none; } }
.mehr-felder { margin-top: 12px; }
.mehr-felder summary { min-height: 44px; display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--strecke); font-weight: 600; list-style: none; }
.mehr-felder summary::-webkit-details-marker { display: none; }
.mehr-felder summary::before { content: "+"; font-weight: 800; width: 14px; }
.mehr-felder[open] summary::before { content: "–"; }
.mehr-felder[open] summary { margin-bottom: 6px; }
.pruef { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 7px; }
.pruef li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.pruef li.gut svg.ic { color: var(--gruen); }
.pruef li.warn svg.ic { color: #9A6B00; }
.pruef.gross { gap: 12px; font-size: 17px; }
table.vorschau td, table.vorschau th { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.laeuft { display: grid; gap: 10px; padding: 16px 0; }
progress { width: 100%; height: 12px; accent-color: var(--strecke); }
.hinweis.einrichtung { display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.einladungen { margin-bottom: 16px; border-left: 4px solid var(--signal); border-radius: 0 var(--r2) var(--r2) 0; }
.einladungen .zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 4px; }
.einladungen .zeilen { margin-top: 8px; }
.einladungen .zeilen > li { flex-wrap: wrap; }
.einladungen .zeilen .haupt { flex: 1 1 200px; }
.raster.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 899px) { .raster.zwei { grid-template-columns: 1fr; } }
.knopfzeile { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tourenplanung: Tage als Spalten nebeneinander, Karte rechts ---------- */
.tr-leiste { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 14px; }
.tr-leiste .platz { flex: 1; }
.tr-leiste .wochenwahl strong { min-width: 196px; text-align: center; }
.tr-leiste .wochenwahl .knopf.rund { flex: none; min-width: 44px; }
.tr-haken { display: flex; align-items: center; gap: 8px; font-size: 15px; min-height: 40px; }
.tr-haken input { width: 20px; height: 20px; accent-color: var(--strecke); }
.tr-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 28%); gap: 14px; align-items: start; }
.tr-raster > div { min-width: 0; }
.tr-tage { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tr-kartenseite { position: sticky; top: 12px; isolation: isolate; z-index: 0; }
.tr-karte { height: calc(100vh - 272px); min-height: 400px; }
.tr-tag { background: var(--flaeche); border-radius: var(--r2); border-top: 5px solid var(--tag); display: flex; flex-direction: column; min-width: 0; }
.tr-tag > header { padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 6px; }
.tr-tag h3 { font-size: 16px; font-weight: 800; display: flex; justify-content: space-between; gap: 6px; }
.tr-tag h3 small { font-weight: 400; color: var(--text-2); font-size: 14px; }
.tr-sz { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 4px 6px; align-items: center; font-size: 13px; }
.tr-sz span { color: var(--text-2); }
.tr-sz select, .tr-sz input { font-size: 14px; min-height: 36px; padding: 4px 6px; border: 1px solid #B5C1C2; border-radius: var(--r1); min-width: 0; width: 100%; background: #fff; }
.tr-stopps { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px; min-height: 64px; flex: 1; }
.tr-stopps.ueber { background: #FFF6D6; }
.tr-s { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 5px; align-items: start; border: 1px solid var(--linie); border-radius: var(--r1); padding: 6px 6px 6px 7px; background: #fff; font-size: 13.5px; }
.tr-s.davor { box-shadow: 0 -3px 0 var(--signal); }
.tr-s.fest { border-color: #E3C257; }
.griff { cursor: grab; color: var(--text-2); touch-action: none; user-select: none; -webkit-user-select: none; line-height: 1.2; padding-top: 2px; }
.tr-s .nr { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--tag); color: #fff; font-size: 12px; font-weight: 800; margin-right: 5px; vertical-align: 1px; }
.tr-s .name { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; hyphens: auto; }
.tr-s .mt { color: var(--text-2); font-size: 13px; margin-top: 1px; }
.tr-s .mt .zeit { font-weight: 600; color: var(--text); }
.tr-s .mt.warn, .tr-tag footer .warn { color: var(--rot); font-weight: 600; }
.tr-s .mt.fix { color: var(--signal-tief); font-weight: 600; }
.tr-s .mt.lila { color: #5B4BA8; font-weight: 600; }
.tr-s .mt.blau { color: var(--strecke); font-weight: 600; }
.tr-s select { font-size: 13px; border: 1px solid var(--linie); border-radius: 5px; padding: 0 2px; height: 26px; background: #fff; max-width: 100%; }
.tr-s .rechts { display: flex; flex-direction: column; gap: 2px; margin: -2px -2px 0 0; }
.tr-s .rechts .mini { width: 26px; height: 26px; }
.tr-s .mt.dz { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tr-s .titel .name { display: inline; }
.tr-s .mini { width: 30px; height: 30px; border: 0; background: none; border-radius: var(--r1); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.tr-s .mini:hover { background: var(--grund); color: var(--text); }
.tr-s .mini.an { color: var(--tinte); background: #FFF1C2; }
.tr-s .mini svg { width: 18px; height: 18px; }
.tr-fahrt { font-size: 12.5px; color: var(--text-2); padding: 0 4px 0 22px; }
.tr-leer { color: var(--text-2); padding: 14px 4px; text-align: center; font-size: 14px; }
.tr-leer.links { text-align: left; padding-left: 0; }
.tr-weg { font-size: 12.5px; padding: 4px 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tr-tag > footer { padding: 8px 10px 10px; font-size: 13px; border-top: 1px solid var(--linie); display: flex; flex-direction: column; gap: 6px; }
.tr-tag > footer b { font-size: 14px; }
.tr-hinweis { color: var(--text-2); }
.tr-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-tag .tr-knoepfe .knopf { min-height: 34px; font-size: 13px; padding: 4px 10px; }
.tr-vorschlag { margin-top: 16px; }
.tr-vorschlag h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.tr-vorschlag h3 small { font-weight: 400; color: var(--text-2); font-size: 13px; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); border-radius: 99px; padding: 4px 8px 4px 10px; background: #fff; font-size: 13px; max-width: 100%; }
.tr-chip i, .tr-kat i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tr-chip button { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 0 2px; color: var(--text); text-align: left; overflow-wrap: anywhere; }
.tr-chip small { color: var(--text-2); font-size: 12.5px; }
.tr-woche { margin-top: 16px; }
.tr-kz { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tr-kz div { border: 1px solid var(--linie); border-radius: var(--r1); padding: 8px 10px; }
.tr-kz small { display: block; font-size: 12px; color: var(--text-2); }
.tr-kz b { font-size: 18px; }
.tr-ende { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--linie); }
.tr-ende .platz { flex: 1; }
.tr-ende .knopf { min-height: 46px; padding: 0 22px; }
.tr-suche { position: relative; margin: 0 0 10px; }
.tr-suchzeile { display: flex; gap: 8px; }
.tr-suchzeile input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; font-size: 16px; }
.tr-suchzeile .knopf { flex: none; }
.tr-treffer { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 12; background: #fff; border: 1px solid var(--linie); border-radius: var(--r1); box-shadow: 0 10px 28px rgba(18, 52, 59, .18); max-height: 360px; overflow: auto; }
.tr-tr { padding: 8px 10px; border-top: 1px solid var(--linie); }
.tr-tr:first-child { border-top: 0; }
.tr-tr b { display: block; font-size: 15px; }
.tr-tr .in { font-weight: 400; color: var(--text-2); font-size: 13px; }
.tr-tr small { color: var(--text-2); font-size: 13px; }
.tr-tr .reihe, .tr-pop .reihe { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tr-tr .reihe button, .tr-pop .reihe button { border: 0; border-radius: 6px; padding: 5px 9px; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 32px; }
.tr-tr .reihe button:disabled, .tr-pop .reihe button:disabled { opacity: .45; cursor: default; }
.tr-tr .reihe button.hell { background: none; color: var(--text); border: 1px solid var(--linie); }
.tr-pop .name { font-weight: 700; color: var(--text); }
.tr-legende { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--text-2); padding: 8px 2px; }
.tr-kat { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); border-radius: 99px; padding: 3px 10px; min-height: 32px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.tr-kat small { font-weight: 400; opacity: .65; font-size: 12.5px; }
.tr-kat[aria-pressed="false"] { opacity: .5; text-decoration: line-through; }
.tr-notiz { flex-basis: 100%; font-size: 12px; }
.tr-zahl { display: grid; place-items: center; min-width: 30px; height: 18px; padding: 0 4px; border-radius: 9px; color: #fff; font: 800 12px/1 Overpass, sans-serif; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.tr-pin { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 800 12px/1 Overpass, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.tr-geist { position: fixed; z-index: 60; pointer-events: none; background: var(--tinte); color: #fff; border-radius: var(--r1); padding: 6px 10px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); max-width: 240px; }
.tr-gespeichert { max-width: 760px; }
.tr-kwknopf { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 18px; width: 100%; text-align: left; background: var(--flaeche); color: var(--text); border: 0; border-left: 6px solid var(--strecke); border-radius: var(--r2); padding: 18px 20px; cursor: pointer; font: inherit; }
.tr-kwknopf:hover { box-shadow: 0 8px 24px rgba(18, 52, 59, .12); }
.tr-kwknopf .t { grid-row: 1 / 3; font-size: 28px; font-weight: 800; }
.tr-kwknopf .d { font-weight: 600; }
.tr-kwknopf .s { grid-column: 2; font-size: 14px; color: var(--text-2); }
.tr-kwknopf .o { grid-row: 1 / 3; grid-column: 3; font-weight: 600; color: var(--strecke); white-space: nowrap; }
.tr-gliste { margin: 16px 2px 0; display: grid; gap: 10px; font-size: 15px; }
.tr-gtag { display: flex; gap: 10px; align-items: flex-start; }
.tr-gtag > b { flex: none; width: 92px; }
.tr-gtag > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.tr-gs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-gs .n { min-width: 0; overflow-wrap: anywhere; }
.tr-ok { color: var(--gruen); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tr-mapswahl { display: grid; gap: 8px; }
.tr-mapswahl .knopf { display: block; text-align: left; padding: 10px 14px; height: auto; }
.tr-mapswahl small { display: block; color: var(--text-2); font-weight: 400; }
.tr-stkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; justify-content: space-between; }
.segment { display: inline-flex; border: 1px solid #B5C1C2; border-radius: var(--r1); overflow: hidden; }
.segment button { border: 0; border-left: 1px solid #B5C1C2; background: #fff; font: inherit; font-size: 15px; font-weight: 600; padding: 8px 14px; cursor: pointer; color: var(--text); min-height: 40px; }
.segment button:first-child { border-left: 0; }
.segment button[aria-pressed="true"] { background: var(--tinte); color: #fff; }
.tr-st td, .tr-st th { text-align: right; white-space: nowrap; }
.tr-st td:first-child, .tr-st th:first-child { text-align: left; }
.tr-st tr.null td { color: var(--text-2); }
@media (max-width: 1279px) {
  .tr-raster { grid-template-columns: 1fr; }
  .tr-kartenseite { position: relative; top: 0; order: -1; }
  .tr-karte { height: 46vh; min-height: 300px; }
}
@media (max-width: 1023px) {
  .tr-tage { grid-template-columns: repeat(var(--n, 5), minmax(250px, 86vw)); scroll-snap-type: x mandatory; }
  .tr-tag { scroll-snap-align: start; }
  .tr-leiste .wochenwahl strong { min-width: 0; font-size: 15px; }
  .tr-leiste .platz { display: none; }
  .tr-s .rechts { margin: 0; }
  .tr-s .mini, .tr-s .rechts .mini { width: 44px; height: 44px; }
  .tr-s .titel { display: flex; gap: 8px; align-items: center; }
  .tr-s .titel .nr { flex: none; margin-right: 0; }
  .tr-s .titel .name { display: block; }
  .tr-s .name { padding: 10px 0; min-width: 44px; }
  .tr-ende .knopf { padding: 0 14px; }
  .tr-s { font-size: 15px; }
  .tr-s select { height: 40px; font-size: 15px; }
  .tr-sz select, .tr-sz input { min-height: 44px; font-size: 16px; }
  .tr-tag .tr-knoepfe .knopf { min-height: 44px; font-size: 15px; }
  .tr-chip { padding: 8px 10px 8px 12px; font-size: 15px; }
  .tr-chip button { min-height: 28px; }
  .tr-kat { min-height: 40px; }
  .griff { padding: 8px 4px; font-size: 18px; }
  .tr-s { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .tr-tr .reihe button, .tr-pop .reihe button { min-height: 40px; padding: 5px 12px; font-size: 15px; }
  .tr-suchzeile { flex-wrap: wrap; }
  .tr-kwknopf { grid-template-columns: 1fr; padding: 16px; }
  .tr-kwknopf .t, .tr-kwknopf .o { grid-row: auto; grid-column: auto; }
  .tr-kwknopf .s { grid-column: auto; }
  .tr-gtag > b { width: 70px; }
}

/* ---------- Tourenplanung: Stundenplan (Besuche als Blöcke in echter Länge, Fahrten grau dazwischen) ---------- */
.tr-stopps.sp { position: relative; display: block; padding: 0; margin: 4px 6px 6px; min-height: 0; flex: none; border-top: 1px solid var(--linie);
  background-image: linear-gradient(to bottom, #E4EAEA 1px, transparent 1px); background-size: 100% var(--sph); background-position: 0 var(--spo); }
.tr-stopps.sp.ueber, .tr-stopps.sp.zielt { background-color: #FFF8E0; }
.sp-h { position: absolute; left: 2px; font-size: 12px; color: var(--text-2); transform: translateY(-50%); pointer-events: none; background: var(--flaeche); padding: 0 2px; line-height: 1; }
.tr-stopps.sp .tr-s { position: absolute; left: 30px; right: 2px; margin: 0; padding: 3px 5px; overflow: hidden; border: 0; border-radius: 8px; background: var(--tag); color: #fff; font-size: 12.5px;
  display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 4px; z-index: 2; cursor: pointer; container-type: inline-size; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tr-stopps.sp .tr-s:hover { z-index: 6; box-shadow: 0 0 0 2px rgba(18, 52, 59, .55), 0 4px 12px rgba(0, 0, 0, .18); }
.tr-stopps.sp .tr-s.fest { box-shadow: inset 0 0 0 2px var(--signal); }
.tr-stopps.sp .tr-s.fest:hover { box-shadow: inset 0 0 0 2px var(--signal), 0 4px 12px rgba(0, 0, 0, .25); }
.tr-stopps.sp .tr-s.davor { box-shadow: 0 -3px 0 var(--signal); }
.tr-stopps.sp .tr-s .in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 0 4px; min-width: 0; }
.tr-stopps.sp .tr-s .nr { background: #fff; color: var(--tag); width: 17px; height: 17px; font-size: 12px; margin: 0; flex: none; }
.tr-stopps.sp .tr-s .achtung { color: #FFE9A8; font-size: 12px; flex: none; line-height: 1; }
.tr-stopps.sp .tr-s .name { color: #fff; font-weight: 600; text-decoration: none; flex: 1 1 0; min-width: 0; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; line-height: 1.4; }
.tr-stopps.sp .tr-s .kurzzeit { display: none; font-weight: 600; flex: none; }
.tr-stopps.sp .tr-s.kurz .kurzzeit { display: inline; }
.tr-stopps.sp .tr-s.kurz .mt { display: none; }
.tr-stopps.sp .tr-s.kurz .name { font-weight: 400; }
.tr-stopps.sp .tr-s:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; z-index: 6; }
.tr-stopps.sp .tr-s .mt { flex-basis: 100%; color: #fff; font-size: 12px; margin: 0; display: flex; align-items: center; gap: 5px; min-width: 0; }
.tr-stopps.sp .tr-s .mt .zeit { color: #fff; font-weight: 600; white-space: nowrap; }
.tr-stopps.sp .tr-s .mt.gelb { color: #FFE9A8; display: block; font-weight: 600; }
.tr-stopps.sp .tr-s .griff { color: rgba(255, 255, 255, .9); font-size: 12px; letter-spacing: -2px; overflow: hidden; padding: 1px 0 0; }
.tr-stopps.sp .tr-s .mini { position: absolute; top: 0; right: 0; width: 24px; height: 24px; color: #fff; background: var(--tag); border-radius: 6px; display: none; z-index: 4; }
.tr-stopps.sp .tr-s .mini:hover { background: var(--tinte); color: #fff; }
.tr-stopps.sp .tr-s:hover .mini, .tr-stopps.sp .tr-s:focus-within .mini { display: grid; }
@media (hover: none) { .tr-stopps.sp .tr-s .mini { display: grid; } }
.tr-stopps.sp .tr-s.zieht { opacity: .35; }
.tr-stopps.sp .tr-fahrt { display: none; }
.tr-stopps.sp .tr-leer { position: absolute; left: 30px; right: 4px; top: 36%; padding: 8px 4px; }
.sp-fest { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; }
.sp-fest span { background: rgba(255, 255, 255, .26); color: #fff; border-radius: 5px; font-size: 12px; font-weight: 700; padding: 0 5px; line-height: 1.5; white-space: nowrap; }
.sp-fest:hover span { background: rgba(255, 255, 255, .45); }
/* schmaler Block mit Stecknadel: nur die Ankunft zeigen, damit „fest ✕“ Platz hat (das Ende zeigt die Blocklänge) */
@container (max-width: 165px) { .tr-s.fest .zeit .bis { display: none; } }
.sp-fahrt, .sp-puffer { position: absolute; left: 30px; right: 2px; border-radius: 7px; font-size: 12px; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 1; pointer-events: none; line-height: 1.25; }
.sp-fahrt { border: 1px dashed #B4C0C1; background: repeating-linear-gradient(135deg, #F3F6F6 0 6px, #E8EDED 6px 12px); color: var(--text-2); }
.sp-puffer { border: 1.5px dashed #8FC3A2; background: rgba(43, 122, 75, .07); color: #1F6A3D; font-weight: 600; display: flex; align-items: center; }
.sp-puffer span { overflow: hidden; text-overflow: ellipsis; }
.sp-los, .sp-nacht, .sp-vorlos { position: absolute; left: 30px; right: 2px; height: 0; pointer-events: none; }
.sp-los { border-top: 2px solid var(--tinte); z-index: 1; }
.sp-los span { position: absolute; left: 0; top: -15px; font-size: 12px; font-weight: 700; color: var(--tinte); background: var(--flaeche); padding: 0 3px; line-height: 1.1; }
.sp-nacht { border-top: 2px dashed var(--rot); z-index: 3; }
.sp-nacht span { position: absolute; right: 0; top: 2px; font-size: 12px; font-weight: 700; color: var(--rot); background: var(--flaeche); padding: 0 3px; line-height: 1.1; }
.sp-vorlos { border-top: 2px dashed var(--rot); z-index: 7; }
.sp-vorlos span { position: absolute; right: 0; top: 3px; font-size: 12px; font-weight: 700; color: #fff; background: var(--rot); border-radius: 4px; padding: 0 4px; }
.sp-ueber { position: absolute; left: 30px; right: 2px; font-size: 12px; color: var(--text-2); pointer-events: none; }
body.tr-zieht { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.sp-geist { position: fixed; z-index: 99; pointer-events: none; border-radius: 8px; color: #fff; font-size: 12.5px; font-weight: 600; padding: 3px 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .3), 0 0 0 2px #fff inset; line-height: 1.3; }
/* die neue Uhrzeit steht im gezogenen Block selbst – so bleibt die Linie „Los …“ darüber lesbar */
.sp-geist { overflow: hidden; min-height: 24px; }
.sp-geist b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-geist span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 400; }
.sp-geist.frei { opacity: .85; }
.sp-kante { position: absolute; left: 0; right: 0; height: 9px; z-index: 3; cursor: ns-resize; touch-action: none; }
.sp-kante.oben { top: -3px; }
.sp-kante.unten { bottom: -3px; }
.sp-kante::after { content: ""; position: absolute; left: 50%; width: 22px; margin-left: -11px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .8); opacity: 0; transition: opacity .15s; }
.sp-kante.oben::after { top: 4px; }
.sp-kante.unten::after { bottom: 4px; }
.tr-s:hover .sp-kante::after, .tr-s.kante-an .sp-kante::after { opacity: 1; }
@media (pointer: coarse) { .sp-kante { height: 14px; } .sp-kante::after { opacity: .8; } }
.tr-stopps.sp .tr-s.kante-an { outline: 2px solid var(--tinte); outline-offset: 1px; z-index: 6; }
.sp-tipp { position: fixed; z-index: 9999; pointer-events: none; background: var(--tinte); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 12.5px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); white-space: nowrap; }
@media (pointer: coarse) {
  .tr-stopps.sp .tr-s { grid-template-columns: 18px minmax(0, 1fr); font-size: 14px; padding: 4px 6px; }
  .tr-stopps.sp .tr-s .griff { font-size: 16px; letter-spacing: -3px; }
  .tr-stopps.sp .tr-s .name { font-size: 14px; }
  .tr-stopps.sp .tr-s .in { padding-right: 34px; }
  .tr-stopps.sp .tr-s .mt { font-size: 13px; }
  .tr-stopps.sp .tr-s .mini { width: 40px; height: 40px; background: none; place-items: start end; padding: 3px; }
  .tr-stopps.sp .tr-s .mini svg { background: var(--tag); border-radius: 5px; }
  .sp-fest { min-height: 40px; min-width: 44px; margin: -11px 0; position: relative; z-index: 4; }
  .sp-fest span { font-size: 13px; padding: 1px 7px; }
  .sp-h, .sp-fahrt, .sp-puffer { font-size: 13px; }
}
.tr-kal > li { flex-wrap: wrap; gap: 6px 12px; }
.tr-kal .haupt small { display: block; color: var(--text-2); font-size: 13.5px; }
.tr-kal .knopf { flex: none; }
.tr-kal .knopf svg { width: 16px; height: 16px; vertical-align: -3px; }
.tr-vb h3 { font-size: 15px; font-weight: 800; margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--linie); }
.tr-vbe b { font-size: 14px; }
.tr-vbe p, .tr-vba p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.tr-vba { margin: 0; padding-left: 18px; }
.tr-vba li { margin-bottom: 6px; }
.tr-vba small { color: var(--text-2); }
.tr-vb .tr-leer { padding: 2px 0; }
.tr-wer { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.tr-wer select { min-height: 40px; padding: 4px 8px; border: 1px solid #B5C1C2; border-radius: var(--r1); background: #fff; font-size: 15px; max-width: 220px; }
.tr-nur { background: var(--signal); color: var(--tinte); font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.nur-ansehen .tr-sz select, .nur-ansehen .tr-sz input, .nur-ansehen [data-dauer] { pointer-events: none; background: var(--grund); color: var(--text-2); }
.nur-ansehen .griff, .nur-ansehen .sp-kante, .nur-ansehen .tr-s .mini, .nur-ansehen .sp-fest, .nur-ansehen .tr-suche, .nur-ansehen [data-fertig], .nur-ansehen [data-opt], .nur-ansehen .tr-weg { display: none; }
.nur-ansehen .tr-stopps.sp .tr-s, .nur-ansehen .tr-s { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1023px) { .tr-wer select { min-height: 44px; font-size: 16px; } }
.tr-faellig { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13.5px; }
.tr-faellig span { color: var(--text-2); margin-right: 2px; }
.tr-faellig button { border: 1px solid var(--linie); background: #fff; color: var(--text); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 32px; }
.tr-faellig button[aria-pressed="true"] { background: var(--tinte); color: #fff; border-color: var(--tinte); }
.tr-kartenbox { position: relative; margin-bottom: 6px; }
.tr-gr { position: absolute; z-index: 1001; touch-action: none; user-select: none; -webkit-user-select: none; }
.tr-gr.links { left: -13px; top: 0; bottom: 0; width: 12px; cursor: col-resize; }
.tr-gr.unten { left: 0; right: 0; bottom: -12px; height: 14px; cursor: row-resize; }
.tr-gr::after { content: ""; position: absolute; background: #8A979A; border-radius: 3px; opacity: .55; transition: opacity .15s, background .15s; }
.tr-gr.links::after { left: 4px; top: 50%; width: 4px; height: 44px; margin-top: -22px; }
.tr-gr.unten::after { top: 5px; left: 50%; height: 4px; width: 44px; margin-left: -22px; }
.tr-gr:hover::after, .tr-gr.an::after { opacity: 1; background: var(--strecke); }
@media (max-width: 1279px) { .tr-gr.links { display: none; } }
@media (pointer: coarse) { .tr-gr.unten { bottom: -18px; height: 24px; } .tr-gr.unten::after { top: 9px; width: 56px; margin-left: -28px; height: 5px; opacity: .8; } .tr-faellig button { min-height: 40px; padding: 4px 14px; font-size: 15px; } }
@media (max-width: 1023px) { .tr-faellig button { min-height: 40px; min-width: 44px; font-size: 15px; } }
.tr-av { position: relative; }
.tr-avl { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: #fff; border: 1px solid var(--linie); border-radius: var(--r1); box-shadow: 0 10px 28px rgba(18, 52, 59, .18); max-height: 260px; overflow: auto; padding: 4px; }
.tr-avl button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 5px; font: inherit; font-size: 15px; font-weight: 400; color: var(--text); cursor: pointer; line-height: 1.3; min-height: 40px; }
.tr-avl button small { display: block; color: var(--text-2); font-size: 13px; }
.tr-avl button:hover, .tr-avl button.an { background: var(--grund); }
.tr-avl p { padding: 8px 10px; color: var(--text-2); font-size: 14px; }
