/* ==========================================================================
   Tourenplanung (Beta)

   Übernommen aus dem verbindlichen Klickdummy Tourenplanung_Prototyp.html.
   Zwei Anpassungen gegenüber der Vorlage:
   1. Der Prototyp war eine eigenständige Seite mit body{height:100vh}. Hier
      läuft die Planung im App-Layout, deshalb sitzt die Höhenbegrenzung auf
      .tp-root statt auf body.
   2. Die Farbvariablen sind auf den hellen App-Stil festgelegt; die
      Dunkelmodus-Umschaltung des Prototyps entfällt, weil die Web-App keinen
      Dunkelmodus hat.
   ========================================================================== */

/* Farbvariablen bewusst nicht nur auf .tp-root: Dialoge und Meldungen liegen
   im Markup NEBEN der Planungsfläche, nicht darin. Stünden die Variablen allein
   auf .tp-root, wären sie dort nicht definiert – die Fenster bekämen dann gar
   keinen Hintergrund und man sähe die Karte hindurchscheinen. */
.tp-root,
.tp-overlay,
.tp-toast {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --blau1: #0C447C;
    --blau2: #185FA5;
    --blau3: #2E86DE;
    --orange: #E67E22;
    --t-page: #f4f6f9;
    --t-card: #ffffff;
    --t-line: #e3e7ec;
    --t-txt: #10243a;
    --t-muted: #5d6b7a;
    --t-accent: var(--blau1);
    --t-input: #ffffff;
    --t-hover: #eef3f8;
    --t-btn-bd: #cfd8e0;
}

.tp-overlay * { box-sizing: border-box; }

.tp-root {
    display: flex;
    flex-direction: column;
    /* Volle Resthöhe unterhalb der App-Kopfzeile. */
    height: calc(100vh - 56px);
    min-height: 460px;
    color: var(--t-txt);
    font-family: var(--font-sans);
    background: var(--t-page);
    overflow: hidden;
}

.tp-root * { box-sizing: border-box; }

/* Layout */
.tp-main { display: flex; flex: 1; min-height: 0; }
.tp-side { width: 340px; flex: 0 0 340px; background: var(--t-card); border-right: 1px solid var(--t-line); overflow-y: auto; padding: 14px; }
.tp-splitter { flex: 0 0 6px; cursor: col-resize; background: var(--t-line); transition: background .15s; }
.tp-splitter:hover, .tp-splitter.on { background: var(--t-accent); }
.tp-main.fullmap .tp-splitter { display: none; }
.tp-main.fullmap .tp-side { display: none; }
.tp-mapwrap { flex: 1; position: relative; min-width: 0; }
.tp-map { position: absolute; inset: 0; }

.tp-root h3 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--t-muted); margin: 18px 0 8px; font-weight: 600; }
.tp-root h3:first-child { margin-top: 2px; }

/* Eingaben */
.tp-field { position: relative; margin-bottom: 8px; }
.tp-field .pin { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; cursor: grab; z-index: 2; }
.tp-field .pin:active { cursor: grabbing; }
.tp-field.dragover input { border-color: var(--t-accent); border-style: dashed; background: var(--t-hover); }
.tp-field .grip { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--t-muted); opacity: .55; cursor: grab; font-size: 13px; user-select: none; z-index: 2; }
.tp-field .grip:active { cursor: grabbing; }
.tp-field:hover .grip { opacity: 1; color: var(--t-accent); }
.tp-field.via .grip { right: 32px; }
.tp-field.via input { padding-right: 52px; }
.tp-field .pin.a { background: var(--blau1); }
.tp-field .pin.b { background: #A32D2D; }
.tp-field .pin.v { background: #5d6b7a; }
.tp-field input { width: 100%; padding: 11px 12px 11px 38px; border: 1px solid var(--t-btn-bd); border-radius: 8px; background: var(--t-input); color: var(--t-txt); font-size: 14px; font-family: inherit; outline: none; }
.tp-field input:focus { border-color: var(--t-accent); }
.tp-suggest { position: absolute; top: calc(100% + 2px); left: 0; right: 0; background: var(--t-card); border: 1px solid var(--t-line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); z-index: 1100; overflow: hidden; display: none; max-height: 260px; overflow-y: auto; }
.tp-suggest div { padding: 9px 12px; font-size: 13px; cursor: pointer; }
.tp-suggest div:hover, .tp-suggest div.act { background: var(--t-hover); }
.tp-suggest div.act { box-shadow: inset 2px 0 0 var(--t-accent); }
.tp-suggest small { color: var(--t-muted); }
.tp-root .b-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--t-muted); font-size: 17px; cursor: pointer; padding: 4px; z-index: 2; }
.tp-root .b-x:hover { color: #A32D2D; }
.tp-rowbtns { display: flex; gap: 6px; margin-top: 4px; }
.tp-rowbtns button { flex: 1; padding: 8px; border: 1px dashed var(--t-btn-bd); background: transparent; color: var(--t-muted); border-radius: 8px; font-size: 12.5px; font-family: inherit; cursor: pointer; }
.tp-rowbtns button:hover { color: var(--t-accent); border-color: var(--t-accent); }

/* Auswahl und Schaltflächen */
.tp-sel { width: 100%; padding: 10px 12px; border: 1px solid var(--t-btn-bd); border-radius: 8px; background: var(--t-input); color: var(--t-txt); font-size: 14px; font-family: inherit; outline: none; cursor: pointer; }
.tp-sel:focus { border-color: var(--t-accent); }
.tp-primary { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 8px; background: var(--t-accent); color: #fff; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; }
.tp-primary:disabled { opacity: .45; cursor: default; }
.tp-save { width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--t-accent); border-radius: 8px; background: transparent; color: var(--t-accent); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; display: none; }

/* Varianten */
.tp-vcard { border: 1px solid var(--t-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: var(--t-input); }
.tp-vcard.sel { border-color: var(--t-accent); box-shadow: 0 0 0 1px var(--t-accent); }
.tp-vhead { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.tp-vdot { width: 12px; height: 12px; border-radius: 3px; }
.tp-vstats { display: flex; gap: 14px; margin: 6px 0; font-size: 13px; color: var(--t-muted); }
.tp-vstats b { color: var(--t-txt); font-variant-numeric: tabular-nums; }
.tp-surf { display: flex; height: 10px; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.tp-surf div { height: 100%; cursor: pointer; transition: opacity .15s; }
.tp-surf div.dim { opacity: .25; }
.tp-surflegend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--t-muted); }
.tp-surflegend span { cursor: pointer; padding: 2px 7px; border-radius: 999px; border: 1px solid transparent; }
.tp-surflegend span:hover { background: var(--t-hover); }
.tp-surflegend span.on { border-color: var(--t-accent); background: var(--t-hover); color: var(--t-txt); font-weight: 600; }
.tp-surflegend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: var(--c); }
.tp-surfinfo { margin-top: 7px; font-size: 12px; color: var(--t-txt); background: var(--t-hover); border-radius: 6px; padding: 6px 9px; line-height: 1.4; }

/* Legende Höhenprofil */
.tp-hplegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--t-muted); }
.tp-hplegend span { display: inline-flex; align-items: center; gap: 5px; }
.tp-hplegend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.tp-hplegend i.dash { background: repeating-linear-gradient(90deg, #c9622e 0 4px, transparent 4px 7px) !important; }
.tp-hplegend i.blk { height: 9px; width: 9px; border-radius: 2px; opacity: .45; }
.tp-hplegend i.strip { height: 6px; }

/* POI-Auswahl */
/* Reise aus einer Ortsliste planen */
.tp-orte {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--t-line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--t-txt);
    background: var(--t-card, #fff);
    resize: vertical;
}

.tp-orte-zeile { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; }
.tp-orte-titel { font-size: 12.5px; color: var(--t-muted); margin-left: 4px; }
.tp-orte-wert { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }

/* Nur die kleinen Nebenknöpfe (Mikrofon, − und +) bekommen die feste Größe.
   Ohne die Ausnahme traf die Regel auch „Reise planen": Der Knopf blieb
   28 Pixel breit, und sein Text lief über den Hinweis darunter hinweg. */
.tp-orte-zeile button:not(.tp-primary) {
    width: 28px;
    height: 28px;
    border: 1px solid var(--t-line);
    border-radius: 6px;
    background: var(--t-card, #fff);
    color: var(--t-accent, #0C447C);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.tp-orte-zeile button:not(.tp-primary):hover { background: var(--t-hover); }

/* Der Planen-Knopf wechselt während der Arbeit seine Beschriftung. Damit ein
   langer Zwischenstand die Zeile nicht sprengt, wird er notfalls gekürzt
   statt umzubrechen. */
.tp-orte-zeile .tp-primary {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Das Mikrofon blinkt, solange die Erkennung läuft – sonst weiß niemand,
   ob gerade zugehört wird. */
.tp-orte-zeile button.laeuft { color: #c0392b; animation: tp-puls 1s ease-in-out infinite; }

@keyframes tp-puls { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Eine Etappe in der Vorschau */
.tp-etappe {
    border: 1px solid var(--t-line);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--t-card, #fff);
}

.tp-etappe .kopf { display: flex; align-items: center; gap: 8px; }

.tp-etappe .ename {
    flex: 1;
    border: 0;
    border-bottom: 1px dashed transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--t-txt);
    padding: 2px 0;
    min-width: 0;
}

.tp-etappe .ename:hover, .tp-etappe .ename:focus {
    border-bottom-color: var(--t-line);
    outline: none;
}

.tp-etappe .ziel {
    font-size: 12px;
    color: var(--t-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

/* Auswahl des Etappenziels (Klick auf die Zahl auf der Karte) */
.tp-zielwahl { min-width: 210px; }

.tp-zielwahl .kopf {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--t-txt);
    margin-bottom: 6px;
}

.tp-zielwahl .leer { font-size: 12px; color: var(--t-muted); }

/* Spaltenüberschrift: nennt die beiden Etappen beim Namen, damit die Zahlen
   nicht als Entfernung zum Ziel gelesen werden. */
.tp-zielwahl .spalten {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 6px 4px;
    border-bottom: 1px solid var(--t-line);
    margin-bottom: 3px;
    font-size: 11px;
    color: var(--t-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.tp-zielwahl .spalten .n { flex: 1; }

.tp-zielwahl .fuss {
    font-size: 11px;
    color: var(--t-muted);
    padding: 5px 6px 0;
    border-top: 1px solid var(--t-line);
    margin-top: 3px;
}

/* Etappen deutlich über dem eigenen Tagespensum. */
.tp-zielwahl button .w.lang { color: #c0392b; }
.tp-zielwahl button.aktiv .w.lang { color: #ffd9d4; }

.tp-zielwahl button {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 5px 6px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--t-txt);
    cursor: pointer;
}

.tp-zielwahl button:hover { background: var(--t-hover, #eef3f8); }

.tp-zielwahl button.aktiv {
    background: var(--t-accent, #0C447C);
    color: #fff;
    font-weight: 600;
}

.tp-zielwahl button .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Die beiden Zahlen zeigen, wie lang die Etappe davor und danach würde.
   Feste Breite, damit sie unter der Spaltenüberschrift stehen bleiben. */
.tp-zielwahl button .w,
.tp-zielwahl .spalten .w {
    font-size: 11.5px;
    color: var(--t-muted);
    white-space: nowrap;
    width: 52px;
    text-align: right;
    flex: 0 0 auto;
}
.tp-zielwahl button.aktiv .w { color: rgba(255, 255, 255, .85); }

/* Tag entfernen: abgesetzt und in Warnfarbe, damit er nicht mit den
   Zielvorschlägen darüber verwechselt wird. Zwei Zeilen – die zweite nennt
   die Folge, statt hinterher eine Rückfrage zu stellen. */
.tp-zielwahl button.loeschen {
    display: block;
    margin-top: 6px;
    padding: 6px;
    border-top: 1px solid var(--t-line);
    color: #c0392b;
}

.tp-zielwahl button.loeschen:hover { background: #fdecea; }

.tp-zielwahl button.loeschen .n {
    display: block;
    font-weight: 600;
    font-size: 12px;
}

.tp-zielwahl button.loeschen .folge {
    display: block;
    font-size: 11px;
    color: var(--t-muted);
    margin-top: 1px;
}

/* Quartiere mit hinterlegter Webseite sind anklickbar. */
.tp-etappe .ziel a { color: var(--t-accent, #0C447C); text-decoration: none; }
.tp-etappe .ziel a:hover { text-decoration: underline; }
.tp-etappe .werte { font-size: 12.5px; color: var(--t-muted); margin-top: 2px; }

.tp-etappe .schieber { display: flex; gap: 5px; margin-top: 6px; }

.tp-etappe .schieber button {
    border: 1px solid var(--t-line);
    border-radius: 6px;
    background: var(--t-bg, #f6f8fa);
    color: var(--t-txt);
    font-size: 11.5px;
    padding: 3px 8px;
    cursor: pointer;
}

.tp-etappe .schieber button:hover { background: var(--t-hover); }

.warn { color: #c0392b; }

/* Hinweise zur Strecke (Steilstücke, Versorgung, Fähren, Tageslicht).
   Drei Dringlichkeiten, farblich unterschieden – „info" ist Wissenswertes,
   „warnung" will vor der Fahrt geprüft werden, „fehler" kostet sonst einen
   Reisetag. */
.tp-hinweis {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    padding: 7px 9px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    margin-bottom: 5px;
}

.tp-hinweis .sym { flex: 0 0 auto; font-size: 14px; line-height: 1.3; }

.tp-hinweis.info { background: var(--t-hover, #eef3f8); border-left-color: #7a8a9a; }
.tp-hinweis.warnung { background: #fff6e5; border-left-color: #d98b00; color: #6b4500; }
.tp-hinweis.fehler { background: #fdecec; border-left-color: #c0392b; color: #7a231a; }

/* Anpassungsassistent beim Löschen einer Reise-Etappe: je betroffener Reise
   ein Block mit Tag, Lücke und dem, was der Assistent tun kann. */
.tp-loesch-fall {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--t-hover, #eef3f8);
    border-left: 3px solid var(--t-accent, #0C447C);
    font-size: 13px;
    line-height: 1.5;
}

.tp-loesch-fall .klein { font-size: 12px; color: var(--t-muted); margin-top: 2px; }
.tp-loesch-fall .klein.warn { color: #a8620a; }
.tp-loesch-fall .klein b { color: var(--t-txt); }

/* Tagesinfo einer gespeicherten Reise (Klick auf die Nummernkugel). */
.tp-tagesinfo .zeile { font-size: 12px; color: var(--t-txt); padding: 0 2px; }
.tp-tagesinfo .zeile.werte { color: var(--t-muted); margin-bottom: 6px; }
.tp-tagesinfo button { justify-content: center; font-weight: 600; }
.tp-tagesinfo .fuss { margin-top: 6px; }

/* Hinweis im Speichern-Dialog, wenn die Route zu einer Reise gehört. */
.tp-reisewarnung {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    padding: 8px 10px;
    margin: 8px 0 2px;
    border-radius: 8px;
    border-left: 3px solid #d98b00;
    background: #fff6e5;
    color: #6b4500;
}

.tp-reisewarnung .sym { flex: 0 0 auto; font-size: 14px; line-height: 1.3; }

/* Höhenmeter-Stufen unter der Profilauswahl */
.tp-stufen { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
.tp-stufen-titel { font-size: 12.5px; color: var(--t-muted); }

.tp-stufen-wahl {
    display: flex;
    margin-left: auto;
    border: 1px solid var(--t-line);
    border-radius: 8px;
    overflow: hidden;
}

.tp-stufen-wahl button {
    border: 0;
    border-left: 1px solid var(--t-line);
    background: var(--t-card, #fff);
    color: var(--t-txt);
    font-size: 12px;
    padding: 5px 9px;
    cursor: pointer;
    white-space: nowrap;
}

.tp-stufen-wahl button:first-child { border-left: 0; }
.tp-stufen-wahl button:hover:not(.aktiv) { background: var(--t-hover); }

.tp-stufen-wahl button.aktiv {
    background: var(--t-accent, #0C447C);
    color: #fff;
    font-weight: 600;
}

/* Einstellung des Suchumkreises über den Kategorien */
.tp-umkreis {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: 1px solid var(--t-line);
    border-radius: 8px;
    background: var(--t-bg, #f6f8fa);
}

.tp-umkreis-titel { font-size: 12.5px; color: var(--t-muted); margin-right: auto; }

/* Der Wert bekommt eine feste Breite: Sonst wandern die Knöpfe bei jedem
   Schritt, weil „5 km" schmaler ist als „10 km". */
.tp-umkreis-wert {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-txt);
    min-width: 48px;
    text-align: center;
}

.tp-umkreis button {
    width: 26px;
    height: 26px;
    border: 1px solid var(--t-line);
    border-radius: 6px;
    background: var(--t-card, #fff);
    color: var(--t-accent, #0C447C);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.tp-umkreis button:hover:not(:disabled) { background: var(--t-hover); }

.tp-umkreis button:disabled { opacity: .35; cursor: default; }

.tp-poirow { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.tp-poirow label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; padding: 5px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; }
.tp-poirow label:hover { background: var(--t-hover); }
.tp-poirow input { accent-color: var(--t-accent); width: 15px; height: 15px; flex: 0 0 auto; }

/* Reise-Legende auf der Karte */
.tp-rlegende { position: absolute; left: 10px; top: 10px; z-index: 1000; background: var(--t-card); border: 1px solid var(--t-line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; max-width: 270px; max-height: 70%; overflow-y: auto; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.tp-rlegende .rlhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tp-rlegende .rlhead .b-x { position: static; transform: none; }
.tp-rlegende .rlrow { display: flex; align-items: flex-start; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.tp-rlegende .rlrow:hover { background: var(--t-hover); }
.tp-rlegende .rlchip { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 4px; margin-top: 2px; }
.tp-rlegende .rltxt { line-height: 1.35; }
.tp-rlegende small { color: var(--t-muted); }

/* Formpunkt: legt nur fest, wo die Route langführt, und ist kein Ziel.
   Deshalb bewusst klein und farblos – die nummerierten Pins der echten
   Zwischenziele sollen daneben nicht untergehen. */
.tp-formpunkt { cursor: grab; }
.tp-formpunkt span {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #5d6b7a;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.tp-formpunkt:hover span { border-color: var(--t-accent, #0C447C); }
.tp-formpunkt:active { cursor: grabbing; }

/* Fahrtrichtungspfeile auf der Route.
   pointer-events: none ist Pflicht – die Pfeile liegen genau auf dem
   unsichtbaren Griff, mit dem die Route gezogen wird, und würden ihn sonst
   ausgerechnet an den interessanten Stellen abfangen. */
.tp-richtungspfeil { pointer-events: none; }
.tp-richtungspfeil svg { display: block; }

/* Kontextmenü auf der Karte (Rechtsklick: Punkt als Start/Zwischenziel/Ziel) */
.tp-kartenmenue {
    position: absolute;
    z-index: 1200;
    background: var(--t-card, #fff);
    border: 1px solid var(--t-line, #e3e7ec);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
    padding: 5px;
    display: flex;
    flex-direction: column;
    min-width: 180px;
    font-family: var(--font-sans, sans-serif);
}

.tp-kartenmenue button {
    text-align: left;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: var(--t-txt, #10243a);
    font-size: 13.5px;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.tp-kartenmenue button:hover {
    background: var(--t-hover, #eef3f8);
    color: var(--t-accent, #0C447C);
}

/* Statusmeldung auf der Karte (z. B. während der Neuberechnung nach dem Ziehen) */
.tp-kartenstatus {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(12, 68, 124, .92);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    pointer-events: none;
    white-space: nowrap;
}

/* Karten-Schaltflächen */
.tp-mapbtns { position: absolute; top: 10px; right: 10px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.tp-mapbtns button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--t-btn-bd); background: var(--t-card); color: var(--t-txt); font-size: 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* Dialoge und Meldungen */
.tp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000; display: none; align-items: center; justify-content: center; }
.tp-overlay.offen { display: flex; }
/* Rückfallwerte hinter jeder Variablen: ein Fenster ohne Hintergrund wäre
   unbrauchbar, weil die Karte darunter durchscheint. */
.tp-modal { background: var(--t-card, #ffffff); border: 1px solid var(--t-line, #e3e7ec); border-radius: 12px; padding: 20px; width: min(92vw, 380px); font-family: var(--font-sans, sans-serif); color: var(--t-txt, #10243a); }
.tp-modal h4 { margin: 0 0 12px; font-size: 16px; }
.tp-modal input, .tp-modal select { width: 100%; padding: 11px 12px; border: 1px solid var(--t-btn-bd); border-radius: 8px; background: var(--t-input); color: var(--t-txt); font-size: 14px; font-family: inherit; outline: none; }
.tp-modal-wide { width: min(94vw, 920px); }
/* Höhenprofil als frei verschiebbares Fenster: kein Abdunkeln, Karte bleibt bedienbar */
#tpHpOverlay { background: transparent; pointer-events: none; }
#tpHpOverlay .tp-modal { pointer-events: auto; box-shadow: 0 14px 48px rgba(0,0,0,.38); }
#tpHpOverlay .tp-modal-head { cursor: move; user-select: none; }
.tp-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tp-modal-head h4 { margin: 0; font-size: 16px; }
.tp-x-modal { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--t-muted); cursor: pointer; padding: 2px 6px; }
.tp-x-modal:hover { color: var(--t-txt); }
.tp-hpstats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--t-muted); }
.tp-hpstats b { color: var(--t-txt); font-variant-numeric: tabular-nums; }
.tp-modal .row { display: flex; gap: 8px; margin-top: 14px; }
.tp-modal .row button { flex: 1; padding: 11px; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; }
.tp-cancel { background: transparent; border: 1px solid var(--t-btn-bd); color: var(--t-txt); }
.tp-ok { background: var(--t-accent); border: 0; color: #fff; }

/* Meldungen: Erfolg grün, Fehler rot. Fehler verschwinden nicht von selbst –
   eine Fehlermeldung, die man übersieht, ist keine Fehlermeldung. */
.tp-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; z-index: 2500; display: none; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: min(90vw, 560px); }
.tp-toast.ok { background: #2ea043; }
.tp-toast.fehler { background: #A32D2D; cursor: pointer; }

.tp-hint { font-size: 12px; color: var(--t-muted); margin-top: 6px; line-height: 1.5; }
.tp-fehler { font-size: 12.5px; color: #A32D2D; background: #fdeaea; border: 1px solid #f3c4c4; border-radius: 8px; padding: 8px 10px; margin-top: 8px; line-height: 1.45; display: none; }

/* Reiter */
.tp-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--t-line); }
.tp-tabs button { flex: 1; padding: 9px 2px; border: 0; background: transparent; color: var(--t-muted); font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; border-bottom: 2px solid transparent; }
.tp-tabs button.on { color: var(--t-accent); border-bottom-color: var(--t-accent); }
.tp-tabs .cnt { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--t-hover); font-size: 10.5px; margin-left: 2px; }

/* Suche */
.tp-such { width: 100%; padding: 9px 12px; border: 1px solid var(--t-btn-bd); border-radius: 8px; background: var(--t-input); color: var(--t-txt); font-size: 13px; font-family: inherit; outline: none; margin-bottom: 8px; }
.tp-such:focus { border-color: var(--t-accent); }

/* Reise-Etappen */
.tp-tagrow { padding: 7px 0; border-top: 1px solid var(--t-line); font-size: 12.5px; position: relative; }
.tp-tagrow .trow1 { display: flex; align-items: center; gap: 6px; }
.tp-tagrow input { flex: 0 0 82px; padding: 5px 7px; border: 1px solid var(--t-btn-bd); border-radius: 6px; background: var(--t-input); color: var(--t-txt); font-size: 12px; font-family: inherit; outline: none; font-weight: 600; }
.tp-tagrow input:focus { border-color: var(--t-accent); }
.tp-tagrow .tdatum { flex: 1; color: var(--t-muted); }
.tp-tagrow .twetter { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.tp-tagrow .b-x { position: static; transform: none; flex: 0 0 auto; }
.tp-tagrow .trow2 { margin-top: 4px; font-size: 12px; color: var(--t-txt); line-height: 1.4; }
.tp-tagrow .trow2 small { color: var(--t-muted); }

/* Routenlisten */
.tp-rlist .item { border: 1px solid var(--t-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--t-input); }
.tp-rlist .rname { font-size: 14px; font-weight: 600; }
.tp-rlist .rmeta { font-size: 12px; color: var(--t-muted); margin-top: 2px; }
.tp-rlist .rbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-rlist .rbtns button { flex: 1; padding: 7px 4px; border-radius: 7px; font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; border: 1px solid var(--t-btn-bd); background: transparent; color: var(--t-txt); }
.tp-rlist .rbtns .b-go { border-color: var(--t-accent); color: var(--t-accent); }
.tp-rlist .empty { font-size: 13px; color: var(--t-muted); padding: 14px 4px; text-align: center; }
.tp-pill { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .5px; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tp-pill.geplant { background: #eef3f8; color: #0C447C; }
.tp-pill.gefahren { background: #e6f4ea; color: #1e7a34; }

.tp-lade { font-size: 12.5px; color: var(--t-muted); padding: 10px 4px; text-align: center; }

@media (max-width: 760px) {
    .tp-side { width: 100%; flex: 1; position: absolute; inset: 0; z-index: 900; }
    .tp-main.mapview .tp-side { display: none; }
}
