/* Zentrale Gestaltung – alle CSS-Anpassungen erfolgen hier. */

:root {
    --bg:          #0f1419;
    --panel:       #1a2129;
    --panel-2:     #232c36;
    --border:      #33404d;
    --text:        #e6edf3;
    --muted:       #8b98a5;
    --accent:      #008d4f;   /* S-Bahn-Grün (Signet): Flächen, Rahmen, Knöpfe */
    --accent-dark: #00703e;   /* Knopf beim Überfahren */
    --accent-text: #3fbf7f;   /* S-Bahn-Grün aufgehellt: Links und Schrift auf dunklem Grund */
    --danger:      #ef4444;
    --warning:     #facc15;
    --success:     #22c55e;

    --radius:      8px;
    --space:       1rem;
    --touch:       44px;      /* Mindestgröße für Touch-Elemente */
    --font:        system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
}

/* --- Kopfzeile & Navigation --- */
.topbar {
    display: flex;
    align-items: center;
    gap: var(--space);
    padding: 0.5rem var(--space);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--accent-text); }
.nav { display: flex; gap: 0.25rem; flex: 1; align-items: center; }
.brand { text-decoration: none; }
.nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 0.9rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
}
.nav a:hover, .nav a:focus-visible { background: var(--panel-2); }
.logout-form { margin: 0 0 0 auto; }

/* --- Layout --- */
.container { max-width: 1100px; margin: 0 auto; padding: var(--space); }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: var(--space);
}
.card-narrow { max-width: 420px; margin: 2rem auto; }
h1 { margin-top: 0; font-size: 1.5rem; }
.muted { color: var(--muted); }

/* --- Formulare --- */
label { display: block; margin: 1rem 0 0.35rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="email"], input[type="datetime-local"], textarea, select {
    width: 100%;
    min-height: var(--touch);
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, .nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch);
    padding: 0 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; margin-top: 1.5rem; width: 100%; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }

/* --- Meldungen --- */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: var(--space);
    border-radius: var(--radius);
    border: 1px solid;
}
.alert-error   { color: #fecaca; background: rgba(239,68,68,.12);  border-color: var(--danger); }
.alert-success { color: #bbf7d0; background: rgba(34,197,94,.12);  border-color: var(--success); }
.alert-warning { color: #fef08a; background: rgba(250,204,21,.12); border-color: var(--warning); }

/* --- Tabellen (für die Benutzerverwaltung) --- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .topbar { flex-wrap: wrap; }
    .container { padding: 0.75rem; }
    .card { padding: 1rem; }
    .start-intro { --pad: 1rem; }
}

/* --- Administration --- */
h2 { margin-top: 0; font-size: 1.15rem; }
.card-narrow-left { max-width: 460px; }
.card-danger { border-color: var(--danger); }
.table-wrap { overflow-x: auto; }
.badge {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid;
}
.badge-ok  { color: var(--success); border-color: var(--success); }
.badge-off { color: var(--muted);   border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; margin-top: 1rem; }
.btn-danger:hover { background: #dc2626; }
label.checkbox { display: flex; align-items: center; gap: 0.6rem; min-height: var(--touch); font-weight: 400; }
input[type="checkbox"] { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); }
a { color: var(--accent-text); }
a.btn { text-decoration: none; }

/* --- Navigation: Verwaltungsmenü --- */
.nav-menue { position: relative; }
.nav-menue summary { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 0.9rem; border-radius: var(--radius); cursor: pointer; list-style: none; }
.nav-menue summary::-webkit-details-marker { display: none; }
.nav-menue summary::after { content: "\25BE"; margin-left: 0.4rem; color: var(--muted); }
.nav-menue[open] summary, .nav-menue summary:hover { background: var(--panel-2); }
.nav-menue-liste { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3rem; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.btn-klein { min-height: 36px; padding: 0 0.8rem; }
.btn-auto { width: auto; }

/* ================= ESTW-Oberfläche (Stellwerk, Vollbild) ================= */
:root { --estw-bg: #000; --estw-gleis: #8f8f8f; --estw-fs: #22c55e; --estw-besetzt: #ff2d2d; --estw-text: #b8c0c8; --estw-zn: #ffd84d; }
html.estw-html, .estw-body { height: 100%; overflow: hidden; background: var(--estw-bg); overscroll-behavior: none; }
.estw { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--estw-bg);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.estw-kopf { flex: 0 0 auto; display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; background: #0b0b0b; border-bottom: 1px solid #222; }
.estw-btn { min-width: 40px; height: 40px; padding: 0 0.6rem; background: #161616; color: #ddd; border: 1px solid #333; border-radius: 4px;
    font: 600 1rem/1 var(--font); cursor: pointer; }
.estw-btn:hover, .estw-btn.estw-an { border-color: #666; background: #222; }
.estw-start.estw-an { color: var(--estw-fs); }
.estw-tempo { min-width: 48px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.estw-fdl { flex: 0 0 auto; padding: 0 0.6rem; height: 40px; display: flex; align-items: center; border-radius: 4px;
    font: 600 0.85rem/1 var(--font); color: #9ed09e; background: #0d1a0d; border: 1px solid #234423; white-space: nowrap; }
.estw-uhr { font: 700 1.35rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--estw-zn); padding: 0 0.4rem; letter-spacing: 0.03em; }
.estw-melde { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; padding: 0 0.7rem; border-radius: 4px;
    font: 0.92rem/1.2 ui-monospace, Menlo, Consolas, monospace; color: #9aa4ad; background: #050505; border: 1px solid #1d1d1d;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.estw-melde.ok { color: #86efac; }
.estw-melde.fehler { color: #fca5a5; border-color: #5b1d1d; }
.estw-melde.frage { color: var(--estw-zn); border-color: #5c4b12; }
.estw-bild { flex: 1; min-height: 0; position: relative; }
.estw-bild .gb-svg { position: absolute; inset: 0; }

.estw-menue, .estw-liste { position: absolute; z-index: 10; top: 52px; max-height: calc(100% - 64px); overflow: auto;
    background: rgba(12,12,12,.97); border: 1px solid #333; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.estw-menue[hidden], .estw-liste[hidden], .estw-fdl[hidden] { display: none; }
.estw-menue { right: 0.4rem; width: min(300px, calc(100% - 0.8rem)); padding: 0.3rem; display: flex; flex-direction: column; }
.estw-menue hr { border: 0; border-top: 1px solid #2a2a2a; margin: 0.3rem 0; width: 100%; }
.estw-menue form { margin: 0; }
.estw-menue-gruppe { display: flex; flex-direction: column; border-top: 1px solid #2a2a2a; border-bottom: 1px solid #2a2a2a; margin: 0.2rem 0; padding: 0.2rem 0; }
.estw-menue-eintrag { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 0 0.8rem; background: none; border: 0; border-radius: 4px;
    color: #ddd; font: 0.95rem var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.estw-menue-eintrag:hover { background: #1f1f1f; }
.estw-menue-eintrag[hidden] { display: none; }
.estw-hilfe { margin: 0.5rem 0.8rem; font-size: 0.8rem; color: #8a8a8a; line-height: 1.4; }
.estw-liste { right: 0.4rem; width: min(980px, calc(100% - 0.8rem)); padding: 0.6rem; color: #ccc; }
.sim-tabelle .num { text-align: right; font-variant-numeric: tabular-nums; }
.sim-spaet { color: var(--warning); font-weight: 700; }
/* Symbole in der Zugliste (was passiert) */

/* Gleisbild */
.gb-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.gb-svg text { font-family: ui-monospace, Menlo, Consolas, monospace; paint-order: stroke; stroke: var(--estw-bg); stroke-width: 3px; stroke-linejoin: round; }
.gb-kante { stroke: var(--estw-gleis); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gb-kante.gb-fs { stroke: var(--estw-fs); }
.gb-kante.gb-kante-stueck { stroke-linecap: butt; }
.gb-kante.gb-belegt { stroke: var(--estw-besetzt); stroke-linecap: butt; }   /* Zugende eckig */
.gb-fern  { stroke: #555; stroke-width: 3; }   /* Fernbahngleis: durchgehend (grau, nicht bedienbar) */
.gb-kante-hit { fill: none; stroke: transparent; stroke-width: 14; }
.gb-zunge { stroke: #fff; stroke-width: 3; stroke-linecap: butt; stroke-linejoin: miter; }
.gb-weiche-g[data-lage="gerade"] .gb-zunge-abzweig, .gb-weiche-g[data-lage="abzweig"] .gb-zunge-gerade { display: none; }
.gb-weiche-gfm { fill: transparent; stroke: none; }
/* Umlauf: Weichenzunge bzw. Gleissperre blinkt, bis die Endlage erreicht ist */
@keyframes gb-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }
.gb-weiche-g.gb-umlauf .gb-zunge, .gb-gsp-g.gb-umlauf .gb-gsp { animation: gb-blink .8s steps(1, end) infinite; }
.gb-weiche-gfm.gb-belegt { fill: transparent; }
.gb-dkw-bel line { stroke: transparent; stroke-width: 3; stroke-linecap: butt; }
.gb-dkw-bel.gb-belegt line { stroke: transparent; }   /* DKW: ganze Weiche rot */   /* Belegung zeigen die roten Gleisstriche, kein Kreis */
.gb-weiche-gfm.gb-ueber { stroke: var(--estw-zn); stroke-width: 2; stroke-dasharray: 2 2; }
.gb-weiche-nr { fill: #7c9cd6; font-size: 9px; text-anchor: middle; }
/* verschlossene Weiche (z. B. zur F-Bahn): Lagemarker und Nummer orange */
.gb-weiche-fest .gb-zunge { stroke: #f59e0b; }
.gb-weiche-nr-fest { fill: #f59e0b; font-weight: 700; }
.gb-prell { stroke: var(--estw-gleis); stroke-width: 3; }
.gb-grenze { stroke: #555; stroke-width: 1.5; stroke-dasharray: 2 2; }
.gb-bsteig { fill: #1b1f24; stroke: #3a4048; }
.gb-bue    { stroke: #a855f7; stroke-width: 4; opacity: 0.5; }
.gb-bruecke { stroke: #5c636b; stroke-width: 0.8; stroke-linecap: round; }   /* Überwerfung: Brückenstriche */
.gb-bue-nr { fill: #9d7cc9; font-size: 8px; text-anchor: middle; }
.gb-gsp    { stroke: #fff; stroke-width: 3; }
.gb-gsp-g { cursor: pointer; }
.gb-gsp-g.gb-gsp-ab .gb-gsp { stroke: #555; stroke-dasharray: 2 2; }
.gb-weiche-gfm { cursor: pointer; }
.gb-sperre-nr { fill: #9a9a9a; font-size: 8px; text-anchor: middle; }

/* Signale: Halt rot, Fahrt grün, Ra 12 zwei weiße Lichter schräg */
.gb-sig-kopf, .gb-sig-spitze { fill: #000; stroke: #6b6b6b; stroke-width: 1; stroke-linejoin: round; }

.gb-lampe-rot { fill: var(--estw-besetzt); }
.gb-lampe-gruen-aus { fill: #13361f; }
.gb-lampe-gelb { fill: var(--warning); }
.gb-lampe-aus { fill: #1a1a1a; }
.gb-ra12 circle { fill: #fff; display: none; }
.gb-signal[data-zustand="fahrt"] .gb-lampe-rot { fill: #3b1010; }
.gb-signal[data-zustand="fahrt"] .gb-lampe-gruen-aus { fill: var(--estw-fs); }
.gb-vorsignal[data-zustand="fahrt"] .gb-lampe-gelb { fill: #3a3410; }   /* Vorsignal: Fahrt erwarten (grün statt gelb) */
.gb-signal[data-zustand="rangier"] .gb-lampe-rot, .gb-signal[data-zustand="rangier"] .gb-lampe-gruen-aus { fill: #1a1a1a; }
.gb-signal[data-zustand="rangier"] .gb-ra12 circle { display: inline; }
.gb-ra12-sperr circle { display: inline; fill: #3a3a3a; }   /* Lichtsperrsignal: Ra 12 dunkel, solange Hp 0 */
.gb-signal[data-zustand="rangier"] .gb-ra12-sperr circle { fill: #fff; }
.gb-vorsignal .gb-sig-kopf, .gb-vorsignal .gb-sig-spitze { stroke: #8a7a2a; }
.gb-sperrsignal .gb-sig-kopf, .gb-sperrsignal .gb-sig-spitze { stroke: #9a6a3a; }
.gb-signal:not(.gb-vorsignal) { cursor: pointer; }
.gb-signal.gb-start .gb-sig-kopf, .gb-signal.gb-start .gb-sig-spitze { stroke: #7dd3fc; stroke-width: 2.2; }   /* Start einer Zugstraße */
.estw-start-wartet #gleisbild, .estw-start-wartet .zm-panel { filter: blur(6px); pointer-events: none; }
.gb-signal.gb-start-ra .gb-sig-kopf, .gb-signal.gb-start-ra .gb-sig-spitze { stroke: var(--estw-zn); stroke-width: 2.2; }   /* Start einer Rangierstraße (Ra 12) */
.gb-signal.gb-ziel .gb-sig-kopf, .gb-signal.gb-ziel .gb-sig-spitze { stroke: #fff; stroke-width: 2; }
.gb-hit { fill: transparent; stroke: none; }
.gb-pille { fill: #000; stroke: #333; stroke-width: 0.8; }
.gb-pille-text { fill: #aab2ba; font-size: 8.5px; text-anchor: middle; stroke: none !important; }
.gb-gleis .gb-pille { fill: #0d0d0d; }
/* Signalbezeichnung: nur Text, ohne Kasten (Verwechslung mit Zugnummernfeldern vermeiden) */
.gb-sig-nr .gb-pille { fill: none; stroke: none; }
.gb-sig-nr .gb-pille-text { fill: #c8ced6; font-size: 8px; }

/* Zielpunkte (Prellbock, Stellbereichsgrenze) */
.gb-zielpunkt { cursor: pointer; }
.gb-zp { fill: #3a3f45; stroke: #6b7280; stroke-width: 1.2; }
.gb-zielpunkt:hover .gb-zp { fill: #565c64; }
.gb-zielpunkt.gb-ziel .gb-zp { stroke: var(--estw-fs); fill: var(--estw-fs); }
.gb-anst-text { font-size: 8px; font-weight: 700; fill: #e5e7eb; pointer-events: none; stroke-width: 0 !important; }   /* Anschlusstaste */
.gb-zielpunkt.gb-ziel .gb-anst-text { fill: #0b0f14; }
.ohne-anst .gb-anst { display: none; }   /* Anschlüsse vorerst nur für Admins */

/* Zugnummernfelder */
.gb-zn { cursor: default; }   /* Zugnummernfelder immer sichtbar (leer ohne Zug), fest am Abschnitt */
.gb-zn-box { fill: #000; stroke: #3a3a3a; stroke-width: 0.8; }   /* dezent, unabhängig von Fahrstraße und Belegung */
.gb-zn-einbruch .gb-zn-box { stroke: #555; stroke-dasharray: 2 2; }
.gb-zn-text { fill: var(--estw-zn); font-size: 8px; font-weight: 700; text-anchor: middle; stroke: none !important; }
.gb-zn[data-zug] { cursor: pointer; }
.gb-zn-steht .gb-zn-text, .gb-zn-wartet .gb-zn-text { fill: #ff8a8a; }
.gb-zn-haelt .gb-zn-text { fill: #7dd3fc; }
.gb-zn-stoerung .gb-zn-text { fill: #fb923c; }   /* Fahrzeugstörung (Tf hat gemeldet) */
.gb-zn-wendet .gb-zn-text { fill: #c4b5fd; }
.gb-zn-ank .gb-zn-text { fill: #6b6b6b; }
/* Vorschau der nächsten Züge an den Grenzen */
.gb-vorschau { font-size: 10px; }
.gb-vorschau-bg { fill: #050505; stroke: #3a3a3a; stroke-width: 0.8; }
.gb-vorschau-zeile { font-size: 10px; white-space: pre; font-family: Consolas, 'DejaVu Sans Mono', monospace; }
.gb-vorschau-nr { fill: #e6e6e6; font-weight: 700; }
.gb-vorschau-gleis { fill: #8fb3e8; }
.gb-vorschau-zeit { fill: #bdbdbd; }
.gb-vorschau-versp { fill: #bdbdbd; }
.gb-vorschau-spaet { fill: #f0965e; font-weight: 700; }

/* Übergangsblöcke und Betriebsstellen */
.gb-block { stroke: none; opacity: 1; }
.gb-block-text { font-size: 10px; font-weight: 700; }
.gb-bs-box { fill: none; stroke: none; }
.gb-bs-label { fill: #6f7c8a; font-size: 12px; font-weight: 700; text-anchor: middle; letter-spacing: 0.05em; }
.gb-bs-kurz .gb-bs-label { font-size: 10px; }
.gb-steig-name { fill: #8592a0; font-size: 9px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.gb-steig-name-klein { font-size: 7.5px; }
.gb-steig-schild { pointer-events: bounding-box; }

@media (max-width: 600px) {
    .estw-uhr { font-size: 1.05rem; padding: 0 0.15rem; }
    .estw-btn { min-width: 36px; padding: 0 0.4rem; }
    .estw-melde { font-size: 0.78rem; padding: 0 0.4rem; }
}

/* --- Fahrplan (Verwaltung) --- */
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.kopfzeile h1 { margin: 0; }
.filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-bottom: 1rem; }
.filter label { margin: 0; font-weight: 400; }
.filter input { width: 7rem; }
.fp-tabelle td { vertical-align: top; }
.fp-warn { color: var(--warning); cursor: help; }
.fp-fz td:nth-child(n+3) { font-variant-numeric: tabular-nums; }
.fp-fz-knapp td { color: var(--warning); }
.fp-lauf { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fp-halt.fp-aussen { opacity: .55; font-style: italic; }   /* Halt außerhalb des Stellbereichs */
.fp-halt { display: inline-flex; flex-direction: column; padding: 0.15rem 0.45rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; line-height: 1.2; }
.fp-halt small { color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-durch { border-style: dashed; color: var(--muted); }
.fp-wenden, .fp-kehrgleis { border-color: #a78bfa; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; margin-bottom: 1.5rem; }
.formular-raster { align-items: end; }
.formular-raster label { margin-top: 0.8rem; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.formular-raster label > span[data-zeige] { display: inline; }
.formular-raster label[hidden], .formular-raster [hidden] { display: none; }
.formular-raster input, .formular-raster select { margin-top: 0.3rem; width: 100%; box-sizing: border-box; }
.formular-raster .breit { grid-column: 1 / -1; }
.fp-halte { table-layout: fixed; width: 100%; }
.fp-halte th:nth-child(1) { width: 30%; } .fp-halte th:nth-child(2), .fp-halte th:nth-child(3) { width: 16%; }
.fp-halte th:nth-child(4) { width: 13%; } .fp-halte th:nth-child(5) { width: 19%; } .fp-halte th:nth-child(6) { width: 6%; min-width: 2.6rem; }
.fp-halte th:first-child, .fp-halte td:first-child { padding-left: 0; }
.fp-halte th:last-child, .fp-halte td:last-child { padding-right: 0; text-align: right; }
.fp-halte select, .fp-halte input { width: 100%; min-width: 0; box-sizing: border-box; margin: 0; }
.fp-halte td { padding: 0.35rem; vertical-align: middle; }
.container-wide { max-width: 1400px; }

.estw-drehen { display: none; position: absolute; left: 0; right: 0; bottom: 0.8rem; margin: 0; text-align: center; color: #777; font-size: 0.85rem; pointer-events: none; }
@media (orientation: portrait) and (max-width: 700px) { .estw-drehen { display: block; } }
.fp-tabelle td:first-child { white-space: nowrap; }

/* Vorgezogene Zieltasten */
.gb-zieltaste { cursor: pointer; }
.gb-zt-pfeil { fill: #3a3f45; stroke: #6b7280; stroke-width: 0.8; }
.gb-zieltaste:hover .gb-zt-pfeil { fill: #565c64; }
.gb-zt-text { fill: #8b929a; font-size: 6.5px; font-weight: 600; text-anchor: middle; stroke: none !important; }
.gb-zieltaste.gb-ziel .gb-zt-pfeil { fill: var(--estw-fs); stroke: var(--estw-fs); }
.gb-zieltaste.gb-ziel .gb-zt-text { fill: var(--estw-fs); }
.gb-zieltaste.gb-zt-fs .gb-zt-pfeil { stroke: #1e9445; stroke-width: 1.6; }

/* Fahrplan-Formular */
.fp-wahl { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.6rem; }
.fp-radio { display: flex; align-items: center; gap: 0.6rem; margin: 0; min-height: 36px; font-weight: 400; cursor: pointer; }
.fp-radio input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.fp-formular [hidden] { display: none !important; }

/* Fahrplan: gerade/ungerade Zugnummern */
.fp-gruppe { margin-top: 1.2rem; }
.fp-gruppe:first-of-type { margin-top: 0; }
.fp-teil { font-size: 0.95rem; margin: 1rem 0 0; color: var(--muted); }
.fp-teil[hidden] { display: none; }
.fp-auswahl select { min-width: 18rem; }
.fp-verwalten { margin: 0.4rem 0 1rem; }
.fp-verwalten summary { cursor: pointer; color: var(--accent-text); }
.fp-verwalten-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 0.8rem; align-items: start; }
.fp-verwalten-raster form { border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.8rem; }
.fp-verwalten-raster label { margin-top: 0; }
.fp-verwalten-raster input[type=text] { width: 100%; box-sizing: border-box; margin: 0.3rem 0 0.5rem; }
.fp-verwalten-raster .fp-loeschen { border-color: var(--danger); }
.estw-menue select { width: 100%; margin: 0.2rem 0; background: #111; color: #ddd; border: 1px solid #333; border-radius: 4px; padding: 0.4rem; }
.estw-menue-label { font-size: 0.8rem; color: #888; padding: 0.3rem 0.6rem 0; }

/* Zugübersicht (Fenster „Züge“) */
.estw-unter { font-size: 0.8rem; margin: 0.9rem 0 0.35rem; color: #cfd8e0; text-transform: uppercase; letter-spacing: 0.08em; }
.sim-titel { border-left: 3px solid var(--accent); padding-left: 0.5rem; }
.estw-liste .sim-titel:first-child { margin-top: 0.1rem; }
.sim-tabelle { width: 100%; font-size: 0.85rem; border-collapse: collapse; }
.sim-tabelle th { background: #161b22; color: #8b98a5; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.35rem 0.45rem; border-bottom: 2px solid #2b3440; white-space: nowrap; text-align: left; }
.sim-tabelle td { padding: 0.32rem 0.45rem; border-bottom: 1px solid #222a33; white-space: nowrap; vertical-align: top; }
.sim-tabelle tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.sim-tabelle tbody tr:hover td { background: rgba(0,141,79,.10); }
.sim-tabelle .sim-tr { border-left: 1px solid #222a33; }
.sim-tabelle .num { text-align: right; font-variant-numeric: tabular-nums; }
.sim-tabelle .sim-mitte { text-align: center; }
.sim-nr { font-weight: 700; color: #fff; }
.sim-richtung { font-size: 0.75rem; }
.sim-ost { color: var(--accent-text); }   /* Richtung Osten: S-Bahn-Grün */
.sim-west { color: #fbbf24; }
.sim-nr.sim-ost, .sim-nr.sim-west { color: #fff; }
.sim-bs { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.02em; color: #e5edf3; }
.sim-pfeil { color: #5b6773; }
.sim-ziel { color: #8b98a5; font-size: 0.8rem; }
.sim-gleis { display: inline-block; min-width: 2.4em; padding: 0 0.3em; border: 1px solid #3b4652; border-radius: 3px; color: #fff; font-weight: 700; text-align: center; }
.sim-gleis-alt { text-decoration: line-through; color: #8a949e; border-color: #2a323a; font-weight: 400; min-width: 0; margin-right: 0.2em; }
.sim-gleis-neu { color: #fca5a5; border-color: #b91c1c; }
.sim-zeit { font-family: ui-monospace, Menlo, Consolas, monospace; color: #d6dee5; }
.sim-ab { color: #fff; font-weight: 600; }
.sim-hinweis { white-space: nowrap; min-width: 2rem; text-align: center; color: #c3ccd5; }
.sim-folge { font-weight: 700; color: #93c5fd; }
.sim-kom { white-space: normal; min-width: 9rem; max-width: 18rem; }
.sim-kom-text { display: block; color: #fcd34d; font-size: 0.92em; }
.sim-kom-eigen { color: #fde68a; }
.sim-kom-knopf { background: none; border: 1px solid #4b5563; color: #9ca3af; border-radius: 4px; padding: 0 0.4rem; font: inherit; line-height: 1.4; cursor: pointer; }
.sim-kom-knopf:hover, .sim-kom-knopf:focus-visible { color: #fff; border-color: #9ca3af; }
.sim-kom-feld { width: 100%; min-width: 9rem; font: inherit; background: #0b0f14; color: #fff; border: 1px solid #60a5fa; border-radius: 4px; padding: 0.1rem 0.3rem; }
.sim-versp { color: #86efac; font-weight: 600; }
.sim-leicht { color: #fde68a; }
.sim-spaet { color: #fca5a5; font-weight: 700; }
.sim-lage { display: block; font-size: 0.72rem; color: #7d8a96; font-weight: 400; white-space: normal; max-width: 15rem; }
.sim-tabelle tr.sim-wartet .sim-lage { color: #fca5a5; }
.sim-vorschau-tab td { color: #9aa4ad; }
.sim-vorschau-tab .sim-nr, .sim-vorschau-tab .sim-ab { color: #d6dee5; }

/* Gleisbild in anderem Tab neu geöffnet: dieser Tab ist gesperrt */
.estw-abgeloest { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 2rem;
    background: rgba(0, 0, 0, .85); color: #fff; font-size: 1.1rem; text-align: center; }

/* Touch-Bedienung: größere Schaltflächen und Listenzeilen */
@media (pointer: coarse) {
    .estw-btn { min-width: 44px; min-height: 44px; }
    .estw-menue button, .estw-menue select, .estw-menue a { min-height: 44px; }
    .sim-tabelle td, .sim-tabelle th { padding-top: 0.45rem; padding-bottom: 0.45rem; }
}

/* Startzeit-Auswahl beim Öffnen des Gleisbilds */
.estw-start-dialog { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .75); padding: 1rem; }
.estw-start-dialog[hidden] { display: none; }
.estw-start-box { background: #1b2127; border: 1px solid #3a434c; border-radius: 10px; padding: 1.4rem 1.6rem; max-width: 26rem; width: 100%; color: #e6e9ec; }
.estw-start-box h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.estw-start-fahrplan { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; margin-bottom: 1rem; }
.estw-start-fahrplan select { min-height: 40px; font-size: 1rem; }
.estw-start-zeiten { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.estw-start-zeit { font-size: 1.15rem; font-variant-numeric: tabular-nums; padding: .7rem 0; min-height: 48px; }
.estw-start-stoer { border: 1px solid var(--border, #2c3640); border-radius: 8px; margin: 0 0 1rem; padding: .4rem .7rem .55rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.estw-start-stoer legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.estw-start-stoer label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.estw-start-frei { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.estw-start-frei label { flex: 1; display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.estw-start-frei input { font-variant-numeric: tabular-nums; font-size: 1.05rem; min-height: 40px; }
.estw-start-box .muted { font-size: .8rem; margin: .9rem 0 0; }
.estw-start-abbrechen { margin-top: .8rem; width: 100%; }
.estw-start-abbrechen[hidden] { display: none; }

/* Fahrplanübersicht: Suche und Zuggruppen */
.fp-suche { margin: 0 0 1rem; }
.fp-suche input { width: 100%; box-sizing: border-box; font-size: 1rem; padding: .6rem .8rem; }
.fp-zuggruppe { margin-top: 1.4rem; }
.fp-zg-titel { font-size: 1.15rem; margin: 0 0 .3rem; padding: .35rem .6rem; border-left: 4px solid var(--accent); background: rgba(255, 255, 255, .03); }
.fp-zuggruppe h3.fp-gruppe { font-size: 1rem; margin: .8rem 0 .4rem; }
.fp-zuggruppe[hidden], .fp-teil[hidden] { display: none; }

/* Zugliste ohne waagerechte Scrollleiste: Tabellen passen sich der Fensterbreite an, lange Texte brechen um */
.estw-liste { overflow-x: hidden; overflow-y: auto; box-sizing: border-box; }
.estw-liste .sim-tabelle { table-layout: auto; width: 100%; max-width: 100%; }
.estw-liste .sim-tabelle td { white-space: normal; overflow-wrap: anywhere; }
.estw-liste .sim-tabelle td.num, .estw-liste .sim-tabelle .sim-nr, .estw-liste .sim-tabelle .sim-gleis, .estw-liste .sim-tabelle .sim-zeit { white-space: nowrap; overflow-wrap: normal; }
.estw-liste .sim-hinweis { min-width: 0; }
.estw-liste .sim-tabelle th { white-space: normal; }
@media (max-width: 900px) { .estw-liste .sim-tabelle { font-size: 0.78rem; } .estw-liste .sim-tabelle td, .estw-liste .sim-tabelle th { padding: 0.28rem 0.3rem; } }


/* Weichenlage nur ohne eingestellte Fahrstraße markieren (im Fahrweg zeigt die grüne Ausleuchtung die Lage) */
.gb-weiche-g.gb-fs:not(.gb-umlauf) .gb-zunge { display: none; }
/* Doppelkreuzungsweiche: Lage der nicht befahrenen Hälfte nicht zeigen */
.gb-weiche-g.gb-dkw-neben .gb-zunge { display: none; }
/* besetzte Weiche: Lagemarker rot (auch im Fahrweg) */
/* besetzte Weiche: keine eigene rote Zunge – rot ist nur das Gleis, das der Zug wirklich befährt (Fdl 27.11.2026) */
.gb-weiche-g.gb-belegt:not(.gb-umlauf) .gb-zunge { display: none; }

/* Vorlauf nach dem Start: Fortschrittsanzeige */
.estw-vorlauf { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: radial-gradient(ellipse at center, rgba(20, 30, 40, .88) 0%, rgba(0, 0, 0, .92) 100%); backdrop-filter: blur(3px); }
.estw-vorlauf[hidden] { display: none; }
.estw-vorlauf-box { width: 100%; max-width: 30rem; text-align: center; color: #e6e9ec; }
.estw-vorlauf-box h2 { margin: 0 0 .4rem; font-size: 1.05rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9fb0bf; }
.estw-vorlauf-prozent { font-size: 3.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: .8rem;
    background: linear-gradient(90deg, #ffd23f, #3ddc84); -webkit-background-clip: text; background-clip: text; color: transparent; }
.estw-vorlauf-balken { position: relative; height: 14px; border-radius: 7px; background: #11161b; border: 1px solid #333d47; overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
.estw-vorlauf-balken span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 7px; transition: width .08s linear;
    background: linear-gradient(90deg, #ffd23f 0%, #f4e04d 40%, #3ddc84 100%); box-shadow: 0 0 12px rgba(61, 220, 132, .55); overflow: hidden; }
.estw-vorlauf-balken span::after { content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 10px, transparent 10px 20px);
    background-size: 28px 28px; animation: estw-vl-streifen .8s linear infinite; }
@keyframes estw-vl-streifen { from { background-position: 0 0; } to { background-position: 28px 0; } }
.estw-vorlauf-text { margin: .9rem 0 .2rem; min-height: 1.4em; font-size: .95rem; }
.estw-vorlauf-uhr { margin: 0; font-size: .8rem; color: #8a97a3; }
.estw-vorlauf-uhr span { font-variant-numeric: tabular-nums; color: #cfd6dc; }
.estw-vorlauf.estw-fertig .estw-vorlauf-balken span::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .estw-vorlauf-balken span::after { animation: none; } .estw-vorlauf-balken span { transition: none; } }

/* Fahrplan: Knopf „neues Fenster“ und eigenes Fenster */
.estw-liste-fenster { position: absolute; top: 0.45rem; right: 0.5rem; min-width: 0; padding: 0.15rem 0.5rem; font-size: 1rem; line-height: 1.3; }
.estw-html .fp-fenster-body, .fp-fenster-body { overflow: auto; height: auto; position: static; }
.fp-fenster { min-height: 100vh; background: #0d1117; }
.fp-fenster-kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0.7rem;
    background: #000; border-bottom: 1px solid #222a33; }
.fp-fenster-hinweis { color: #8a97a3; font-size: 0.85rem; }
.estw-liste.fp-fenster-liste { position: static; display: block; width: auto; max-height: none; overflow: visible; border: 0; box-shadow: none; }

/* Zuglauf (aufklappbar in Zugliste und Vorschau) */
.sim-tabelle tbody tr.sim-klickbar { cursor: pointer; }
.sim-tabelle tbody tr.sim-offen td { background: rgba(0,141,79,.14); }
.sim-tabelle tbody tr.sim-lauf-zeile > td { background: #0b0f14; padding: 0.3rem 0.5rem 0.6rem 2rem; border-bottom: 1px solid #2d3a46; }
.sim-tabelle tbody tr.sim-lauf-zeile:hover > td { background: #0b0f14; }
.sim-lauf { border-collapse: collapse; font-size: 0.8rem; min-width: 26rem; border-left: 2px solid var(--accent); }
.sim-lauf th { background: none; color: #6f7c88; font-size: 0.68rem; padding: 0.15rem 0.6rem; text-align: left; }
.sim-lauf th.num { text-align: right; }
.sim-lauf th.sim-mitte { text-align: center; }
.sim-lauf td { padding: 0.18rem 0.6rem; border-bottom: 1px solid #1a2128; white-space: nowrap; }
.sim-lauf tr.sim-lauf-vorbei td { color: #5d6873; }
.sim-lauf tr.sim-lauf-vorbei .sim-gleis { opacity: .5; }
.sim-lauf tr.sim-lauf-aussen td { font-style: italic; }   /* außerhalb des Stellbereichs */
.sim-lauf tr.sim-lauf-aussen td.sim-bs { color: #8a96a3; }
.sim-lauf tr.sim-lauf-jetzt td { color: #fff; font-weight: 600; background: rgba(255,210,63,.08); }
.sim-lauf tr.sim-lauf-jetzt td:first-child::before { content: '▸ '; color: #ffd23f; }

/* Bahnübergänge: schließt (gelb blinkend), gesichert (grün) */
.gb-bue.gb-bue-schliesst { stroke: #ffd23f; opacity: 1; animation: gb-blink 0.8s steps(2, start) infinite; }
.gb-bue.gb-bue-gesichert { stroke: #3ddc84; opacity: 0.95; }

/* Grenze des BÜ-Abschnitts */
.gb-stoss { stroke: #8b98a5; stroke-width: 1.2; }

/* Rückfrage-Dialog (ersetzt Browser-Popups) */
.estw-frage-dialog { z-index: 960; }
.estw-frage-text { margin: 0 0 1.2rem; font-size: 1rem; line-height: 1.45; }
.estw-frage-knoepfe { display: flex; justify-content: flex-end; gap: .6rem; }
.estw-frage-knoepfe .btn { min-width: 6.5rem; }

/* Startdialog: Auswahl der Stellbereiche (nur bei mehreren Bereichen) */
.estw-start-bereiche { border: 1px solid #2a333c; border-radius: 6px; padding: .5rem .75rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.estw-start-bereiche legend { font-size: .8rem; color: #9aa6b2; padding: 0 .3rem; }
.estw-bereich { display: flex; align-items: center; gap: .5rem; cursor: pointer; }

/* Auswahl des Stellbereichs: belegte Bereiche (anderer Spieler) */
.estw-btn[hidden] { display: none; }
.estw-instanz { flex: 0 0 auto; padding: 0 0.5rem; height: 40px; display: flex; align-items: center; border-radius: 4px;
    font: 700 0.8rem/1 var(--font); color: #cfe3ff; background: #0d1626; border: 1px solid #24406b; white-space: nowrap; }
.wahl-bereich.wahl-markiert { border-color: #c9a227; box-shadow: 0 0 0 1px rgba(201,162,39,0.5); }
/* Stellwerksauswahl: Instanzen und freies Spiel als Kacheln */
.wahl-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.wahl-welt { border: 1px solid var(--border, #2a2f36); border-radius: 10px; padding: 0.9rem; background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column; gap: 0.6rem; }
.wahl-instanz { border-color: #2a3a52; }
.wahl-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.wahl-titel { font-weight: 700; font-size: 1.1rem; }
.wahl-uhr { font: 600 1.15rem/1 ui-monospace, Menlo, Consolas, monospace; color: #e8d38a; letter-spacing: 0.03em; }
.wahl-text { margin: 0; font-size: 0.85rem; }
.wahl-bereiche { display: flex; flex-direction: column; gap: 0.45rem; }
.wahl-bereich { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.75rem; border-radius: 8px; text-decoration: none;
    color: inherit; border: 1px solid #3a4250; background: rgba(0,0,0,0.25); transition: border-color .15s, transform .15s; }
a.wahl-bereich:hover { border-color: #8aa4c4; }
.wahl-bereich small { opacity: 0.7; }
.wahl-bild { width: 100%; height: 64px; object-fit: contain; background: #07090c; border-radius: 5px; margin-bottom: 0.35rem; }
.wahl-info { display: flex; flex-direction: column; gap: 0.1rem; }
.wahl-belegt { opacity: 0.5; cursor: not-allowed; }
.bereich-wahl { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.bereich-btn.bereich-belegt { opacity: .5; cursor: not-allowed; }

/* Zugmeldeverfahren: Leiste unter dem Kopf */
.zm-panel { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .25rem .6rem; background: #11161b; border-bottom: 1px solid #2a333c; font-size: .8rem; color: #cfd8e0; }
/* schwebt über dem Gleisbild (nicht im Fluss): Ein- und Ausblenden verändert die Größe des Gleisbilds nicht */
.zm-panel { position: absolute; z-index: 9; top: 52px; left: 0.4rem; right: 0.4rem; border: 1px solid #2a333c; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.zm-zeile { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.zm-text b { color: #fff; }
.zm-btn { font: inherit; padding: .1rem .5rem; border: 1px solid #3a4652; background: #1b232b; color: #e5edf3; cursor: pointer; }
.zm-btn:disabled { opacity: .5; }
.zm-ja { border-color: #2f7a46; background: #173322; }
.zm-nein { border-color: #8a3434; background: #3a1717; }
.zm-st { padding: 0 .35rem; border: 1px solid #3a4652; color: #a3a3a3; }
.zm-st-angenommen, .zm-st-eingestellt { border-color: #2f7a46; color: #8fd6a6; }
.zm-st-abgelehnt { border-color: #8a3434; color: #ff9a9a; }
.zm-blink { animation: zm-blink 1s steps(2, start) infinite; }
.zm-blink .zm-btn { animation: none; }
@keyframes zm-blink { 50% { background: #4a3b10; } }
/* angebotener Zug: nur die Zugnummer in der Vorschau blinkt (nicht der Kasten) */
.gb-vorschau-nr.gb-vorschau-angebot { animation: zm-nr-blink 1s steps(2, start) infinite; }
@keyframes zm-nr-blink { 50% { fill-opacity: .15; } }
.zm-panel[hidden] { display: none; }
.zm-hinweis { color: #8a96a3; }
.zm-weg { padding: 0 .35rem; }
.zm-st-block { border-color: #8a6d1f; color: #e3c46a; }
.sim-laenge { color: #6e7a86; font-size: .8em; white-space: nowrap; }

.estw-menue-stand { margin: .4rem .8rem; font-size: .7rem; color: #6b6b6b; }


/* ===== Kopf: dezente Knöpfe statt Leiste ===== */
.kopf { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; }
.seite .kopf { border-bottom: 1px solid var(--border); }
.kopf-marke { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.01em;
    color: var(--text); text-decoration: none; }
.kopf-punkt { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3.5px solid #eb7405; flex: none; }
.kopf-knoepfe { margin-left: auto; display: flex; gap: 0.4rem; align-items: center; }
.knopf { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 0.95rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; cursor: pointer; white-space: nowrap; }
.knopf:hover { background: var(--panel-2); }
.knopf:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.knopf-form { margin: 0; }
.knopf-menue { position: relative; }
.knopf-menue summary { list-style: none; }
.knopf-menue summary::-webkit-details-marker { display: none; }
.knopf-menue summary::after { content: "\25BE"; margin-left: 0.4rem; opacity: 0.6; }
.knopf-liste { position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); min-width: 210px; display: flex; flex-direction: column;
    padding: 0.3rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.knopf-liste a { padding: 0.55rem 0.8rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.knopf-liste a:hover { background: var(--panel-2); }
/* schwebend über dem Netzplan (hell) */
.kopf-schwebend { position: fixed; z-index: 30; top: 0; left: 0; right: 0; pointer-events: none;
    padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left)); }
.kopf-schwebend > * { pointer-events: auto; }
.kopf-schwebend .kopf-marke, .kopf-schwebend .knopf { background: rgba(22,28,35,0.92); color: #e6edf3; border: 1px solid #2c3640;
    box-shadow: 0 2px 12px rgba(0,0,0,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kopf-schwebend .kopf-marke { padding: 0.45rem 0.95rem 0.45rem 0.7rem; border-radius: 999px; }
.kopf-schwebend .knopf:hover { background: #232c36; }
.kopf-schwebend .knopf-liste { background: #161c23; border-color: #2c3640; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.kopf-schwebend .knopf-liste a { color: #e6edf3; }
.kopf-schwebend .knopf-liste a:hover { background: #232c36; }

/* ===== Netzplan über die ganze Seite ===== */
.seite-karte { overflow: hidden; background: #0e1217; overscroll-behavior: none; }
.karte-main { position: fixed; inset: 0; }
.wahl-karte, .netz { position: absolute; inset: 0; }
.netz-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.netz-strecke { fill: none; stroke: #39414b; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.netz-grund { fill: #0e1217; }
.netz-linien { filter: grayscale(1); opacity: 0.38; }
.netz-linie-aktiv { stroke-width: 6; }
.netz-linie { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.netz-halt { fill: #0e1217; stroke: #5d6670; stroke-width: 1.6; }
.netz-halt-stw { fill: #0e1217; stroke: #f2f4f6; stroke-width: 2.5; }
.netz-halt-gross { stroke-width: 2.2; }
.netz-name { font: 500 11px/1 var(--font); fill: #6f7883; paint-order: stroke; stroke: #0e1217; stroke-width: 3px; stroke-linejoin: round; }
.netz-name-gross { font-weight: 700; }
.netz-name-stw { fill: #eef2f5; font-weight: 600; }
.netz-marke text { font: 700 11px/1 var(--font); fill: #fff; }
.netz-band { opacity: 0.22; }
.netz-band polyline { fill: none; stroke-width: 34; stroke-linecap: butt; stroke-linejoin: round; }
.netz-band { transition: opacity 0.15s; }
.netz-fokus .netz-band { opacity: 0.07; }
.netz-fokus .netz-band.netz-band-an { opacity: 0.22; }
.netz-bereich { cursor: pointer; outline: none; }
.netz-bereich-flaeche { opacity: 0; transition: opacity 0.15s; color: #dfe6ee; }   /* Hervorhebung neutral, nicht in Stellwerksfarbe */
.netz-bereich-flaeche polyline { fill: none; stroke: currentColor; stroke-width: 40; stroke-linecap: butt; stroke-linejoin: round; pointer-events: stroke; }
.netz-bereich:hover .netz-bereich-flaeche, .netz-bereich:focus-visible .netz-bereich-flaeche, .netz-bereich.netz-an .netz-bereich-flaeche { opacity: 0.25; }
.netz-schild rect { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.netz-schild text { font: 700 17px/1 var(--font); fill: #fff; }
.netz-server-marke rect { fill: #0e1217; stroke: #3fbf7f; stroke-width: 1.5; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.netz-server-kopf, .netz-server-koerper { fill: #3fbf7f; }
.netz-server-marke text { font: 700 13px/1 var(--font); fill: #e5e7eb; }
.netz-bereich:hover .netz-schild rect, .netz-bereich.netz-an .netz-schild rect { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7)) brightness(1.15); }
.netz-aus { opacity: 0.4; cursor: default; }
.karte-zoom { position: absolute; z-index: 10; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 0.4rem; }
.knopf-rund { width: 42px; height: 42px; min-height: 0; padding: 0; font-size: 1.3rem; line-height: 1; background: rgba(22,28,35,0.92); color: #e6edf3;
    border: 1px solid #2c3640; box-shadow: 0 2px 12px rgba(0,0,0,0.45); }
.knopf-rund:hover { background: #232c36; }
.karte-hinweis { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); top: max(1.1rem, env(safe-area-inset-top));
    max-width: calc(100% - 26rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.8rem; color: #9aa4af;
    background: rgba(22,28,35,0.85); border: 1px solid #232c36; pointer-events: none; }
.nur-klein { display: none; }
.karte-main > .alert, .karte-meldung { position: absolute; z-index: 25; top: 4.4rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 92vw; }
/* Auswahl am Stellwerk: Server 1–3 und freies Spiel */
.netz-popup { position: absolute; z-index: 20; width: 290px; padding: 0.8rem; background: #161c23; color: #e6edf3; border: 1px solid #2c3640;
    border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
.netz-popup[hidden] { display: none; }
/* nie höher als der sichtbare Bereich unter der Kopfleiste (z. B. Handy quer): sonst scrollen */
.netz-popup { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 560px) and (min-width: 761px) {
    .netz-popup { width: 330px; padding: 0.6rem; }
    .netz-popup-bild { display: none; }
    .netz-wahl { margin-top: 0.3rem; padding: 0.35rem 0.6rem; }
}
.netz-popup-kopf { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.2rem; }
.netz-popup-bild { width: 100%; height: 66px; object-fit: contain; background: #07090c; border: 1px solid #232c36; border-radius: 8px; }
.netz-wahl { display: grid; grid-template-columns: 1fr auto; column-gap: 0.5rem; margin-top: 0.4rem; padding: 0.5rem 0.7rem;
    border: 1px solid #2c3640; border-radius: 10px; color: inherit; text-decoration: none; }
a.netz-wahl:hover, a.netz-wahl:focus-visible { border-color: #eb7405; background: #24190f; outline: none; }
.netz-wahl-titel { font-weight: 700; }
.netz-wahl-uhr { font: 600 0.95rem/1.3 ui-monospace, Menlo, Consolas, monospace; color: #e8d38a; text-align: right; }
.netz-wahl-status { grid-column: 1 / -1; font-size: 0.8rem; color: #8b95a1; }
.netz-wahl-status.frei { color: #6fbf8f; }
.netz-wahl-status.belegt { color: #d98f6b; }
.netz-wahl-aus { opacity: 0.55; cursor: not-allowed; }

/* ===== Anmeldung / Registrierung vor dem Netzplan ===== */
.seite-hinter-karte { min-height: 100vh; background: #0e1217; }
.hintergrund-karte { position: fixed; inset: 0; opacity: 0.6; pointer-events: none; }
.hintergrund-karte * { pointer-events: none !important; }
.hintergrund-karte svg { width: 100%; height: 100%; }
.seite-hinter-karte main { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
    padding-top: 4.5rem; padding-bottom: 2rem; }
.seite-hinter-karte .card-narrow { width: 100%; margin: 0 auto; }
.seite-hinter-karte .card { background: rgba(22,28,35,0.94); border-color: #2c3640; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card-fuss { margin: 1rem 0 0; font-size: 0.9rem; }
/* Startseite im Querformat (16:9): Vorstellung links, Anmeldung rechts, alles ohne Scrollen auf einem Bildschirm */
@media (min-width: 900px) and (orientation: landscape) {
    .seite-hinter-karte:has(.start-raster) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
    .seite-hinter-karte:has(.start-raster) main { flex: 1; min-height: 0; padding-top: 4rem; padding-bottom: 0.5rem; }
    .seite-hinter-karte:has(.start-raster) .fuss { padding-top: 0.4rem; }
    .start-raster { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 380px); gap: 1.5rem; justify-content: center; align-items: center; }
    .start-raster .card-narrow { max-width: none; margin: 0; }
    .start-raster .start-intro { margin-bottom: 0; }
}
@media (min-width: 900px) and (orientation: landscape) and (max-height: 820px) {
    .start-intro { --pad: 1.25rem; }
    .start-intro p { margin: 0.5rem 0; }
}
/* niedriger als der Inhalt (z. B. kleine Laptops): dann doch scrollen statt abschneiden */
@media (min-width: 900px) and (orientation: landscape) and (max-height: 620px) {
    .seite-hinter-karte:has(.start-raster) { height: auto; min-height: 100vh; overflow: visible; }
}
.fuss { text-align: center; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); font-size: 0.8rem; }
.fuss a { color: var(--muted); }
.fuss-hinweis { display: block; margin: 0.4rem auto 0; max-width: 40rem; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.seite-hinter-karte .fuss { position: relative; z-index: 2; }
.seite-karte .fuss { position: fixed; z-index: 10; left: max(1rem, env(safe-area-inset-left)); bottom: max(0.75rem, env(safe-area-inset-bottom)); padding: 0; }
.seite-karte .fuss a { color: #6f7883; }
/* Fußleiste fest am unteren Bildschirmrand (Kartenseiten: schon fest). Auf kleinen Bildschirmen bleibt sie im Textfluss, um Platz zu sparen. */
@media (min-width: 761px) and (min-height: 560px) {
    body.seite { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
    body.seite > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
    body.seite .fuss { position: sticky; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--border); }
    body.seite-hinter-karte .fuss { position: sticky; bottom: 0; z-index: 5; background: #0e1217; border-top: 1px solid #1b232c; }
}
@media (max-width: 760px) { .seite-karte:has(.netz-popup:not([hidden])) .fuss { display: none; } }
@media (max-width: 480px) {
    .kopf-name { display: none; }
    .kopf-schwebend .kopf-marke { padding: 0.55rem; }
}
.text-seite { max-width: 760px; margin: 0 auto 1rem; }
.text-seite h2 { margin-top: 1.4rem; }
.text-seite mark { background: #5a4a10; color: #ffe9a3; padding: 0 0.25rem; border-radius: 3px; }
.klein { font-size: 0.85rem; margin: 1rem 0 0; }
.feld-versteckt { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert-info { color: #cfe3ff; background: rgba(59,130,246,0.12); border-color: #3b82f6; }

@media (max-width: 760px) {
    .nur-gross { display: none; }
    .nur-klein { display: inline; }
    .kopf { gap: 0.35rem; }
    .kopf-marke { white-space: nowrap; }
    .kopf-schwebend .kopf-marke { font-size: 0.9rem; padding: 0.4rem 0.75rem 0.4rem 0.6rem; }
    .kopf-knoepfe { gap: 0.3rem; }
    .knopf { min-height: 36px; padding: 0 0.7rem; font-size: 0.82rem; }
    .karte-hinweis { top: auto; bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + 1.9rem); max-width: calc(100% - 2rem); left: max(1rem, env(safe-area-inset-left)); transform: none; }
    .netz-popup { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; width: auto; max-height: 75vh; overflow-y: auto;
        border-radius: 16px 16px 0 0; border-bottom: 0; padding: 0.75rem 0.9rem calc(0.9rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,0.6); }
    .netz-popup::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: #3a4552; margin: 0 auto 0.5rem; }
    .netz-wahl { padding: 0.65rem 0.75rem; }
    .netz-wahl-titel { font-size: 1.05rem; }
    .netz-popup-bild { height: 72px; }
}

/* Dummy-Züge (Testzug für Admins) */
.estw-dummy-box { max-width: 560px; }
.estw-dummy-liste { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; text-align: left; }
.estw-dummy-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.estw-dummy-zeile strong { min-width: 4.5em; }
.estw-dummy-status { flex: 1 1 8em; font-size: .85em; opacity: .8; }

/* Selbsttätige Blocksignale (Sbk): Schirm mit grünlichem Rand */
.gb-sbk .gb-sig-kopf, .gb-sbk .gb-sig-spitze { stroke: #4f8a6a; }
/* Sbk-Kästchen: leer; blinkt hellblau, solange die Fahrstraße wegen des belegten Blocks noch nicht einstellbar ist */
.gb-kasten-rahmen { fill: none; stroke: #6b7480; stroke-width: 0.8; }
.gb-kasten-feld { fill: none; }
.gb-sbk-an .gb-sbk-kasten .gb-kasten-feld { fill: #7dd3fc; }   /* Auto-FS an: Feld im Rahmen leuchtet */
.gb-sbk-wartet .gb-sbk-kasten .gb-kasten-feld { fill: #7dd3fc; animation: gb-sbk-blink 1s steps(1, end) infinite; }
.gb-fsp-an .gb-fsp-kasten .gb-kasten-feld { fill: #facc15; animation: gb-fsp-blink 1s steps(1, end) infinite; }   /* Fahrstraße gespeichert */
@keyframes gb-fsp-blink { 0%, 49.9% { fill: #facc15; } 50%, 100% { fill: transparent; } }
@keyframes gb-sbk-blink { 0%, 49.9% { fill: #7dd3fc; } 50%, 100% { fill: transparent; } }   /* einfach an/aus, je 0,5 s */
.estw-sbk { font-size: 0.85rem; font-weight: 600; color: #777; }
.estw-sbk.estw-an { color: #7dd3fc; }
/* abfahrbereiter Zug vor Halt zeigendem Signal: Zugnummer blinkt */
.gb-zn-blinkt .gb-zn-text { animation: gb-zn-blink 1s steps(1, end) infinite; }
@keyframes gb-zn-blink { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }   /* einfach an/aus, je 0,5 s */

/* Verwaltung: Übersicht – Statuszeile, darunter gleich hohe Kacheln */
.admin-kopf h1 { margin-bottom: 0.6rem; }
.admin-status { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-status li { padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.88rem; color: var(--muted); }
.admin-status li.st-ok { border-color: rgba(63, 191, 127, .5); color: #9be3bf; }
.admin-status li.st-warn { border-color: var(--warning); color: #fef08a; }
.admin-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; align-items: stretch; }
.admin-kachel { margin: 0; display: flex; flex-direction: column; min-height: 9rem; }
.admin-kachel h2 { margin: 0 0 0.6rem; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.admin-kachel p { margin: 0.15rem 0; }
.admin-wert { font-size: 1.15rem; font-weight: 600; }
.pfeil { color: var(--muted); transition: transform .15s, color .15s; }
.admin-link { color: inherit; text-decoration: none; transition: border-color .15s; }
.admin-link:hover, .admin-link:focus-visible { border-color: var(--accent); }
.admin-link:hover .pfeil { color: var(--accent); transform: translateX(3px); }
.admin-kachel-warn { border-color: var(--warning); }
.admin-kachel-neu { border-color: var(--accent); }
.admin-status li.st-neu { border-color: var(--accent); color: #9be3bf; }
.admin-status a { color: inherit; text-decoration: none; }
.admin-tabelle { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.admin-tabelle th { text-align: left; font-weight: 600; padding: 0.2rem 0.8rem 0.2rem 0; white-space: nowrap; }
.admin-tabelle td { padding: 0.2rem 0.6rem 0.2rem 0; }
.admin-details { margin-top: auto; padding-top: 0.5rem; }
.admin-details summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
.admin-details form { margin-top: 0.6rem; }
.admin-kachel:has(.admin-details[open]) { grid-column: span 2; }
@media (max-width: 640px) { .admin-kachel:has(.admin-details[open]) { grid-column: auto; } }
.mono { font-family: var(--mono, ui-monospace, monospace); }
.admin-liste { list-style: none; padding: 0; margin: 0; }
.admin-liste li { padding: 0.2rem 0; }
.admin-kachel textarea { resize: vertical; }
input[type="datetime-local"] { color-scheme: dark; }
.admin-zurueck { margin: 0 0 0.5rem; font-size: 0.9rem; }
.knopf.knopf-warn { border-color: var(--warning); color: #fef08a; }
.wartung-grund { padding: 0.6rem 0.8rem; border-left: 3px solid var(--warning); background: rgba(250,204,21,.08); }
.klein { font-size: 0.85rem; }
/* Hilfe-Seite */
.text-seite.hilfe { max-width: 960px; }
.hilfe-inhalt { font-size: 0.92rem; line-height: 1.8; margin: 0.6rem 0 0.4rem; }
.hilfe-bild { margin: 0.8rem 0; }
.hilfe-bild img { display: block; max-width: 100%; height: auto; border: 1px solid #2a2f36; border-radius: 6px; }
.hilfe-bild figcaption { font-size: 0.85rem; color: var(--muted, #8a93a0); margin-top: 0.3rem; }
.hilfe h2 { scroll-margin-top: 4rem; }
.hilfe-bild-klein img { max-width: 260px; }
/* Rundgang (tour.js) */
.tour-rahmen { position: fixed; z-index: 9000; border: 2px solid var(--accent-text); border-radius: 8px; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); transition: all 0.25s ease; }
.tour-box { position: fixed; z-index: 9001; width: min(360px, calc(100vw - 16px)); background: #161b22; color: #e6edf3;
    border: 1px solid #30363d; border-radius: 10px; padding: 0.9rem 1rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); }
.tour-box.tour-mitte { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-titel { font-size: 1.05rem; margin: 0.15rem 0 0.4rem; }
.tour-text { margin: 0 0 0.8rem; line-height: 1.45; font-size: 0.95rem; }
.tour-zaehler { font-size: 0.75rem; color: #8b949e; }
.tour-knoepfe { display: flex; gap: 0.4rem; justify-content: flex-end; }
.tour-knoepfe .tour-ende { margin-right: auto; }
/* Startseite */
.start-intro h1 { font-size: 1.35rem; }
.start-demo { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.8rem 0 0.4rem; }
.tour-knoepfe .btn { margin-top: 0; width: auto; padding: 0.4rem 0.8rem; }
.start-demo .btn-primary { margin-top: 0.2rem; }
.start-intro { margin-bottom: 1rem; }
.fehler-karte { text-align: center; }
.fehler-code { font-family: ui-monospace, monospace; font-size: 3rem; font-weight: 700; color: var(--accent-text); letter-spacing: 0.1em; }
/* Rückmeldungen (Verwaltung) */
.fb-eintrag { border-top: 1px solid #2a2f36; padding: 0.7rem 0; }
.fb-eintrag.fb-neu { border-left: 3px solid var(--accent); padding-left: 0.7rem; }
.fb-text { white-space: normal; margin: 0.3rem 0 0.5rem; }
.fb-knoepfe { display: flex; gap: 0.4rem; }
.fb-knoepfe .btn { width: auto; margin-top: 0; padding: 0.35rem 0.8rem; }
.gb-linie-hinweis { fill: #5b636d; font-size: 9px; font-weight: 700; text-anchor: middle; pointer-events: none; letter-spacing: 0.04em; }
.gb-fbahn-hinweis { fill: #7d8894; font-size: 8px; font-weight: 700; pointer-events: none; }
.gb-sig-mast { stroke: #6b6b6b; stroke-width: 1.2; }
.gb-vorsignal .gb-sig-mast { stroke: #8a7a2a; }
.gb-sperrsignal .gb-sig-mast { stroke: #9a6a3a; }
.gb-sbk .gb-sig-mast { stroke: #4f8a6a; }

/* Fahrtrichtung: kleines, dezentes Dreieck vor dem Schirm (nur Füllung, Farbe wie der Schirmrand, gedämpft) */
.gb-signal .gb-sig-spitze { fill: #4a4f55; stroke: none !important; }
.gb-vorsignal .gb-sig-spitze { fill: #6b5f22; }
.gb-sperrsignal .gb-sig-spitze { fill: #7a5430; }
.gb-sbk .gb-sig-spitze { fill: #3f6e55; }
.gb-signal.gb-start .gb-sig-spitze { fill: #7dd3fc; }
.gb-signal.gb-start-ra .gb-sig-spitze { fill: var(--estw-zn); }
.gb-signal.gb-ziel .gb-sig-spitze { fill: #fff; }
.tour-rahmen.tour-dunkel { inset: 0; left: 0; top: 0; width: 100vw; height: 100vh; border: 0; border-radius: 0; box-shadow: none; background: rgba(0, 0, 0, 0.55); }
.start-intro { --pad: 1.5rem; overflow: hidden; }

/* Live-Pause (☕): der Computer stellt, das Gleisbild bleibt sichtbar, Bedienung gesperrt */
.estw-kaffee { display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; }
.estw-tasse { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.estw-kaffee:disabled { opacity: 0.4; cursor: not-allowed; }
.estw-kaffee.estw-an { border-color: #fbbf24; color: #fbbf24; }
.estw-kaffee-pause { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 40; }
.estw-kaffee-box { display: flex; align-items: center; gap: 0.9rem; background: rgba(20, 16, 6, 0.94); border: 1px solid #fbbf24;
    border-radius: 10px; padding: 0.7rem 1rem; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); color: #fde68a; max-width: calc(100vw - 2rem); }
.estw-kaffee-box p { margin: 0; }
.estw-kaffee-symbol { font-size: 2rem; display: flex; color: #fbbf24; }
.estw-live-pause .gb-wrap, .estw-live-pause .zm-panel { pointer-events: none; filter: saturate(0.6); }

/* Symbol-Knöpfe in der Kopfleiste (Gesamtansicht) */
.estw-symbol { display: inline-flex; align-items: center; justify-content: center; }
/* Bedienknöpfe des Stellwerks (Auto-FS, SP, später Ersatzsignal …) links; Uhr, Ansicht, Fahrplan, Menü rechts */
.estw-bedien, .estw-ansicht { flex: 0 0 auto; display: flex; align-items: center; gap: 0.35rem; }
.estw-bedien { padding-right: 0.5rem; margin-right: 0.15rem; border-right: 2px solid #2a2a2a; }
#gb-vollbild-kopf .vb-zu, #gb-vollbild-kopf.estw-an .vb-auf { display: none; }
#gb-vollbild-kopf.estw-an .vb-zu { display: inline; }
.estw-icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Verwaltung → Betrieb */
.betrieb-titel { display: inline; font-size: 1.15rem; }
.betrieb-tabelle input[type=text] { width: 100%; min-width: 8rem; }
.betrieb-diff { margin: .4rem 0 1rem; }
.betrieb-neu td { color: var(--success); }
.betrieb-weg td { color: var(--danger); }
/* Mitteilungen des Admins (Fenster auf der Stellwerksauswahl) */
.mitt-hinter { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); padding: 1rem; }
.mitt-box { max-width: 480px; width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.6rem; max-height: 90vh; overflow: auto; }
.mitt-box h2 { margin: 0 0 .6rem; }
.mitt-text { margin: 0 0 1rem; line-height: 1.5; }
.mitt-box textarea { width: 100%; margin: .6rem 0 0; }
.mitt-option { display: block; margin: .3rem 0; }
.mitt-knoepfe { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.mitt-knoepfe .btn { flex: 1 1 0; min-width: 8rem; margin: 0; }
.mitt-sterne { display: inline-flex; flex-direction: row-reverse; font-size: 2.2rem; line-height: 1; }
.mitt-sterne input { position: absolute; opacity: 0; width: 0; height: 0; }
.mitt-sterne label { cursor: pointer; color: var(--muted); padding: 0 .1em; }
.mitt-sterne input:checked ~ label, .mitt-sterne label:hover, .mitt-sterne label:hover ~ label { color: #fbbf24; }
.mitt-sterne input:focus-visible + label { outline: 2px solid #fbbf24; }
/* Taste FRT: Fahrstraße zurücknehmen */
.estw-wt { font-size: 0.85rem; font-weight: 700; color: #e5e7eb; border-color: #4b5563; }
.estw-wt.estw-an { background: #4b5563; color: #fff; border-color: #e5e7eb; }
.estw-frt { font-size: 0.85rem; font-weight: 700; color: #fbbf24; border-color: #78350f; }
.estw-frt.estw-an { background: #b45309; color: #fff; border-color: #fbbf24; }
/* Taste SP: Fahrstraßenspeicher löschen */
.estw-sp { font-size: 0.85rem; font-weight: 700; color: #f87171; border-color: #7f1d1d; }
.estw-sp.estw-an { background: #991b1b; color: #fff; border-color: #f87171; }
.estw-ufgt { font-size: 0.85rem; font-weight: 700; color: #60a5fa; border-color: #1e3a8a; }
.estw-ufgt.estw-an { background: #1d4ed8; color: #fff; border-color: #60a5fa; }

/* Admin: Fehlerübersicht */
.fehler-leeren { margin-top: 0.6rem; }
.fehler-eintrag { border-left: 3px solid var(--border); }
.fehler-eintrag.fehler-neu { border-left-color: var(--danger, #ef4444); }
.fehler-text { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; word-break: break-word; margin: 0.3rem 0; }
.fehler-stack { font-size: 0.75rem; white-space: pre-wrap; word-break: break-all; max-height: 18rem; overflow: auto; background: rgba(0,0,0,.25); padding: 0.5rem; border-radius: 4px; }

/* Chat mit dem Nachbar-Fdl */
.estw-chat { position: relative; }
.chat-punkt { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--bg); }
.chat-panel { position: fixed; top: 3.2rem; right: 0.6rem; z-index: 45; width: min(22rem, calc(100vw - 1.2rem)); max-height: min(28rem, calc(100vh - 5rem));
    display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55); }
.chat-panel[hidden] { display: none; }
.chat-kopf { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.chat-kopf strong { flex: 1; }
.chat-an { font: inherit; font-size: 0.85rem; background: #0b0f14; color: inherit; border: 1px solid var(--border); border-radius: 4px; }
.chat-zu { background: none; border: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.chat-liste { flex: 1; overflow-y: auto; padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; min-height: 6rem; }
.chat-leer { color: var(--muted); font-size: 0.85rem; margin: 0; }
.chat-msg { max-width: 85%; align-self: flex-start; background: #24303c; border-radius: 6px; padding: 0.3rem 0.5rem; }
.chat-msg.chat-eigen { align-self: flex-end; background: #0e3d27; }
.chat-meta { font-size: 0.7rem; color: var(--muted); }
.chat-txt { font-size: 0.9rem; word-break: break-word; white-space: pre-wrap; }
.chat-hinweis { margin: 0; padding: 0 0.7rem 0.4rem; font-size: 0.8rem; color: var(--muted); }
.chat-form { display: flex; gap: 0.4rem; padding: 0.5rem 0.7rem; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; min-width: 0; font: inherit; background: #0b0f14; color: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 0.3rem 0.45rem; }
.chat-form input:disabled { opacity: 0.5; }
.chat-form .btn { flex: 0 0 auto; width: auto; margin: 0; padding: 0.35rem 0.8rem; }
.chat-form input { width: auto; margin: 0; }

/* --- Schichtbericht --- */
.schicht-karte { position: absolute; z-index: 24; top: 4.4rem; left: 1rem; width: min(330px, calc(100vw - 2rem)); padding: 0.7rem 0.9rem;
    background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 0.92rem; }
.schicht-karte[hidden] { display: none; }
.schicht-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.schicht-kopf h2 { margin: 0; font-size: 1.05rem; }
.schicht-zu { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 0.2rem; }
.schicht-zu:hover { opacity: 1; }
.schicht-wo { margin: 0.4rem 0; }
.schicht-werte { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; margin: 0; }
.schicht-werte dt { color: var(--muted); white-space: nowrap; }
.schicht-werte dd { margin: 0; font-weight: 600; }
.schicht-mehr { margin: 0.6rem 0 0; font-size: 0.85rem; }
.schicht-eintrag { border-top: 1px solid var(--border); padding: 0.4rem 0; }
.schicht-eintrag summary { cursor: pointer; font-weight: 600; }

/* --- Breite Bildschirme: gestapelte Karten nebeneinander --- */
.spalten-2 { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--space); }
.kachel-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: var(--space); align-items: start; }
.kachel-raster > .card-narrow-left { max-width: none; }
@media (min-width: 1000px) {
    .spalten-2 { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); align-items: start; }
    .spalten-2 .card-narrow-left { max-width: none; }
}
/* Hilfe: Inhaltsverzeichnis als feste Spalte links */
@media (min-width: 1300px) {
    .text-seite.hilfe { max-width: 1200px; display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 2.5rem; }
    .text-seite.hilfe > * { grid-column: 2; }
    .text-seite.hilfe > .hilfe-inhalt { grid-column: 1; grid-row: 1 / span 400; position: sticky; top: 1rem; align-self: start;
        display: flex; flex-direction: column; gap: 0.15rem; font-size: 0; padding-right: 1rem; border-right: 1px solid var(--border); }
    .text-seite.hilfe > .hilfe-inhalt a { font-size: 0.95rem; padding: 0.2rem 0; }
}

/* --- Übung und Anfänger-Hinweise --- */
.anf-panel { position: absolute; z-index: 15; left: max(0.6rem, env(safe-area-inset-left)); bottom: max(0.6rem, env(safe-area-inset-bottom));
    width: min(380px, calc(100% - 1.2rem)); padding: 0.75rem 0.9rem; background: rgba(20, 26, 33, 0.97); color: #e6edf3;
    border: 1px solid #3fbf7f; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.55); font: 0.92rem/1.45 var(--font); }
.anf-panel[hidden] { display: none; }
.anf-kopf strong { color: #3fbf7f; font-size: 0.95rem; }
.anf-text { margin: 0.35rem 0 0.6rem; }
.anf-knoepfe { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.anf-knoepfe .btn { width: auto; min-height: 36px; padding: 0.35rem 0.8rem; font-size: 0.88rem; margin: 0; }
.anf-link { font-size: 0.85rem; color: #3fbf7f; margin-left: 0.2rem; }
/* Signal, um das es geht: pulsierender gelber Schein */
@keyframes anf-puls { 0%, 100% { filter: drop-shadow(0 0 2px #facc15) drop-shadow(0 0 4px #facc15); } 50% { filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 10px #facc15); } }
.gb-signal.anf-ziel { animation: anf-puls 1.2s ease-in-out infinite; }
@keyframes anf-knopf-puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, .9); } 50% { box-shadow: 0 0 0 5px rgba(250, 204, 21, .25); } }
.estw-btn.anf-knopf-ziel { border-color: #facc15; animation: anf-knopf-puls 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .gb-signal.anf-ziel, .estw-btn.anf-knopf-ziel { animation: none; filter: drop-shadow(0 0 5px #facc15); } }

/* Willkommensbox und Einsteiger-Hinweis auf der Karte */
.willk-karte p { margin: 0.5rem 0; line-height: 1.45; }
.willk-knoepfe { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; }
.willk-knoepfe .btn { width: 100%; text-align: center; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.knopf-reihe form { margin: 0; }
.hilfe-faq dt { font-weight: 700; margin-top: 0.9rem; }
.hilfe-faq dd { margin: 0.25rem 0 0; color: var(--text); }
.st-zeile .zm-text { color: #fdba74; }

/* Zugfunk: Fenster links oben, Tf-Meldungen orange umrandet */
.estw-funk { position: relative; font-size: 0.85rem; font-weight: 700; color: #fdba74; border-color: #7c4a1d; }
.estw-funk.funk-neu { animation: anf-knopf-puls 1.2s ease-in-out infinite; }
.funk-panel { right: 0.6rem; left: auto; width: min(26rem, calc(100vw - 1.2rem)); max-height: min(32rem, calc(100vh - 5rem)); }
.chat-msg.funk-tf { border-left: 3px solid #fb923c; }
.funk-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--border); }
.funk-tabs[hidden] { display: none; }
.funk-tab { font: inherit; font-size: 0.8rem; font-variant-numeric: tabular-nums; padding: 0.15rem 0.55rem; border-radius: 4px; border: 1px solid var(--border);
    background: #0b0f14; color: var(--muted); cursor: pointer; }
.funk-tab:hover { color: inherit; }
.funk-tab.funk-tab-aktiv { background: #1d2a36; color: #e6edf3; border-color: #60a5fa; }
.funk-tab.funk-tab-neu { border-color: #fb923c; color: #fb923c; }
.funk-tab.funk-klingelt { animation: anf-knopf-puls 0.8s ease-in-out infinite; border-color: #facc15; color: #facc15; }
.funk-form { border-top: 1px solid var(--border); padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.85rem; }
.funk-zug select { min-height: 0; height: auto; display: inline-block; font: inherit; background: #0b0f14; color: inherit; border: 1px solid var(--border); border-radius: 4px; margin-left: 0.3rem; padding: 0.15rem 0.3rem; width: auto; }
.funk-knoepfe { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.funk-knoepfe .btn { width: auto; margin: 0; padding: 0.3rem 0.6rem; font-size: 0.82rem; min-height: 32px; }
.funk-knoepfe .btn:disabled { opacity: 0.4; cursor: default; }
.funk-warten { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.fp-st-liste { margin: 0 0 0.8rem; padding-left: 1.1rem; }
.fp-st-liste li { margin: 0.25rem 0; }
.inline-form { display: inline; margin: 0 0 0 0.5rem; }
.btn-klein { padding: 0.2rem 0.6rem; min-height: 0; font-size: 0.82rem; }
.estw-funk.funk-klingelt, .funk-dialog.funk-klingelt { animation: anf-knopf-puls 0.8s ease-in-out infinite; border-color: #facc15; }
.funk-dialog { flex-basis: 100%; }

/* Neuigkeiten (Verwaltung) */
.news-tag { font-size: 0.95rem; color: var(--muted); margin: 1.2rem 0 0.4rem; text-transform: uppercase; letter-spacing: .04em; }
.news-eintrag { display: grid; grid-template-columns: 3.2rem 7.5rem 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--border); }
.news-zeit { font-family: ui-monospace, monospace; color: var(--muted); }
.news-art { font-size: 0.8rem; color: var(--muted); }
.news-konto .news-art { color: #9be3bf; }
.news-feedback .news-art { color: #93c5fd; }
.news-fehler .news-art { color: #fca5a5; }
.news-spiel .news-art { color: #fcd34d; }
.news-neu { background: rgba(63, 191, 127, .07); }
.news-marke { font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--accent); color: #fff; }
@media (max-width: 560px) { .news-eintrag { grid-template-columns: 3rem 1fr; } .news-art { display: none; } .news-marke { grid-column: 2; justify-self: start; } }

/* Serverlast (Verwaltung) */
.last-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin: 1rem 0 1.4rem; }
.last-kachel { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.last-name { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.last-wert { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.last-zusatz { font-size: .8rem; color: var(--muted); min-height: 1em; }
.last-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.last-kopf h2 { margin: 0; font-size: 1.1rem; }
.last-umschalter { display: flex; gap: .4rem; }
.last-umschalter .last-an { border-color: var(--accent-text); color: var(--accent-text); }
.last-diagramme { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; margin-top: .8rem; }
.last-diagramm { margin: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .7rem .3rem; }
.last-diagramm figcaption { font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.last-flaeche { position: relative; }
.last-flaeche svg { display: block; width: 100%; height: auto; }
.last-raster { stroke: #2a333d; stroke-width: 1; }
.last-achse { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.last-kreuz { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.last-tip { position: absolute; pointer-events: none; background: #0b0f14; border: 1px solid var(--border); border-radius: 6px; padding: .25rem .5rem; font-size: .8rem; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.last-hinweis { margin-top: 1rem; font-size: .85rem; }
.last-proc p { margin: .4rem 0; }
.last-proc .mono { word-break: break-all; }
.last-abschnitt { font-size: 1.1rem; margin: .4rem 0 0; }
.last-spieler { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; margin: 0 0 1.6rem; }
.last-unterkopf { font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.last-online { width: 100%; font-size: .9rem; }
.last-online td, .last-online th { padding: .3rem .4rem; text-align: left; }
.last-online tbody { font-variant-numeric: tabular-nums; }
.mod-woerter { width: 100%; font-family: ui-monospace, monospace; margin: .4rem 0 .8rem; }
.mod-ok { color: var(--success); font-weight: 600; }
.mod-nein { color: var(--danger); font-weight: 600; }
.last-klein { font-size: .9rem; font-weight: 600; color: var(--muted); }
.demo-ende-box { max-width: 520px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.8rem; text-align: left; }
.demo-ende-box h2 { margin: 0 0 .6rem; }
.demo-ende-box p { color: var(--text); font-size: 1rem; line-height: 1.5; }
.demo-ende-knoepfe { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.1rem; }
.demo-ende-box .btn:not(.btn-secondary) { background: #2fa96c; color: #fff; border-color: #2fa96c; }
/* Handy hochkant: Kopfleiste umbrechen statt abschneiden (Menü, Fahrplan und Funk bleiben erreichbar) */
@media (max-width: 700px) and (orientation: portrait) {
    .estw-kopf { flex-wrap: wrap; row-gap: .3rem; }
    .estw-kopf .estw-melde { order: 10; flex: 1 1 100%; }
    .estw-kopf .estw-bedien, .estw-kopf .estw-ansicht { flex-wrap: wrap; row-gap: .3rem; }
    .estw-kopf .estw-ansicht { margin-left: 0; flex: 1 1 100%; justify-content: flex-end; }
    .estw-kopf .estw-bedien { border-right: 0; }
}

/* Testseite (test.sbahn-estw.de): deutliche Kennzeichnung, stört die Bedienung nicht */
.testseite-marke { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 10000; pointer-events: none;
    background: #d97706; color: #000; font: 700 0.75rem/1 system-ui, sans-serif; letter-spacing: 0.15em; padding: 0.25rem 0.8rem;
    border-radius: 0 0 6px 6px; opacity: 0.9; }

/* Nächste Züge: aufklappbar, standardmäßig zu */
.sim-vorschau-klapp > summary { list-style: none; cursor: pointer; }
.sim-vorschau-klapp > summary::-webkit-details-marker { display: none; }
.sim-vorschau-klapp > summary h2 { display: inline-block; }
.sim-vorschau-klapp > summary h2::after { content: "\25B8"; margin-left: 0.4rem; color: var(--muted); }
.sim-vorschau-klapp[open] > summary h2::after { content: "\25BE"; }

/* abgestellte Züge: grau abgesetzt, ganz unten in der Zugliste */
.sim-tabelle tr.sim-abgestellt td, .sim-tabelle tr.sim-abgestellt td * { color: #6b7280 !important; }
.sim-tabelle tr.sim-abgestellt { background: rgba(255,255,255,.02); }

/* --- Mein Konto --- */
/* Breit und mittig (16:9): Kopf über die ganze Breite, darunter zwei Spalten */
.konto { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.konto > .card { margin: 0; }
.konto > .konto-kopf { grid-column: 1 / -1; }
.konto > .konto-nachrichten, .konto > .nachr-verwaltung, .konto > .nachr-liste { grid-column: 1 / -1; }
/* zwei feste Spalten: Aufklappen verschiebt nichts in der anderen Spalte */
.konto-spalte { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.konto-spalte > .card { margin: 0; }
.konto-nachrichten { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: inherit; text-decoration: none; }
.konto-nachrichten > span:first-child { display: flex; flex-direction: column; gap: .15rem; }
.konto-nachrichten:hover { border-color: var(--accent); }
@media (max-width: 800px) {
    .konto { grid-template-columns: minmax(0, 1fr); }
    .konto-spalte { display: contents; }   /* Handy: eine Spalte, Reihenfolge Spielen, Passwort, Konto löschen */
    #anfaenger { order: 1; } .konto-klapp:not(.konto-gefahr) { order: 2; } .konto-gefahr { order: 3; }
}
.konto > section:not(.konto-kopf):only-of-type { grid-column: 1 / -1; }
.konto-kopf { display: flex; gap: 1.25rem; align-items: center; border-top: 3px solid var(--accent); }
.konto-zeichen { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: #fff; font-size: 1.8rem; font-weight: 700; }
.konto-wer { min-width: 0; flex: 1; }
.konto-wer h1 { margin: 0 0 0.6rem; font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; overflow-wrap: anywhere; }
.konto-wer h1 .badge { font-size: 0.75rem; }
.konto-daten { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; margin: 0; }
.konto-daten dt { color: var(--muted); font-size: 0.8rem; }
.konto-daten dd { margin: 0; font-weight: 600; }
.konto-zeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--border); }
.konto-zeile:first-of-type { border-top: 0; padding-top: 0.25rem; }
.konto-zeile p { margin: 0.2rem 0 0; font-size: 0.9rem; }
.konto-zeile form { margin: 0; flex: none; }
.konto-zeile > .btn { flex: none; margin: 0; }
.schalter { display: inline-flex; align-items: center; gap: 0.55rem; min-height: var(--touch); padding: 0 0.35rem; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.schalter-knopf { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--border); transition: background .15s; }
.schalter-knopf::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.schalter.an { color: var(--text); }
.schalter.an .schalter-knopf { background: var(--accent); border-color: var(--accent); }
.schalter.an .schalter-knopf::after { transform: translateX(20px); background: #fff; }
.schalter:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--radius); }
.konto-klapp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: var(--touch); margin: -0.5rem 0; }
.konto-klapp > summary::-webkit-details-marker { display: none; }
.konto-klapp > summary h2 { margin: 0; }
.konto-klapp > summary::after { content: "\25B8"; color: var(--muted); font-size: 1.1rem; }
.konto-klapp[open] > summary { margin-bottom: 0.75rem; }
.konto-klapp[open] > summary::after { content: "\25BE"; }
.konto-klapp form { max-width: 420px; }
.konto-gefahr > summary h2 { color: var(--danger); }
.konto-gefahr[open] { border-color: var(--danger); }
@media (max-width: 600px) {
    .konto-kopf { gap: 0.9rem; }
    .konto-zeichen { width: 48px; height: 48px; font-size: 1.35rem; }
    .konto-wer h1 { font-size: 1.25rem; }
}

/* Startseite: wer gerade auf einem Server spielt */
.online-karte { position: absolute; z-index: 23; top: 4.4rem; right: 1rem; width: min(260px, calc(100vw - 2rem)); padding: 0.6rem 0.8rem;
    background: rgba(26, 33, 41, 0.92); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; }
.online-karte h2 { font-size: 0.9rem; margin: 0 0 0.35rem; display: flex; align-items: center; gap: 0.45rem; }
.online-karte p { margin: 0; }
.online-karte ul { list-style: none; margin: 0; padding: 0; max-height: 9.5rem; overflow-y: auto; }
.online-karte li { padding: 0.15rem 0; display: flex; justify-content: space-between; gap: 0.6rem; }
.online-karte li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-karte li .muted { white-space: nowrap; }
.online-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); flex: none; }
.online-punkt.aus { background: var(--muted); box-shadow: none; }
@media (max-width: 600px) {
    .online-karte { top: auto; bottom: 7.5rem; left: 1rem; right: 1rem; width: auto; }
}

/* Zugmeldung: Kasten je eingleisiger Strecke (Fdl 28.11.2026) */
.zm-linie { flex: 1 1 320px; max-width: 460px; padding: .35rem .5rem .45rem; border: 1px solid #2f3a45; border-radius: 4px; background: #151c23; }
.zm-l-kopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .25rem; }
.zm-l-titel { font-weight: 600; color: #e5edf3; }
.zm-skizze { display: flex; align-items: center; gap: .4rem; margin: .15rem 0 .35rem; }
.zm-bf { flex: none; padding: .05rem .4rem; border: 1px solid #4a5866; border-radius: 3px; background: #1b232b; color: #e5edf3; font-size: .75rem; }
.zm-gleis { position: relative; flex: 1; min-height: 1.4rem; display: flex; align-items: center; justify-content: center; gap: .6rem; }
.zm-gleis::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px solid #8f8f8f; z-index: 0; }
.zm-gleis-belegt::before { border-top-color: #ff2d2d; }
.zm-gleis-frei, .zm-gleis-zug { position: relative; z-index: 1; padding: 0 .35rem; background: #151c23; }
.zm-gleis-frei { color: #8fd6a6; font-size: .75rem; }
.zm-gleis-zug { color: #ffd84d; font-weight: 700; white-space: nowrap; }
.zm-l-zeile { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .12rem 0; }
.zm-l-sym { width: 1.1rem; text-align: center; flex: none; }
.zm-l-text { color: #cfd8e0; }
.zm-l-leise .zm-l-text, .zm-l-leise .zm-nr { color: #8a96a3; }
.zm-l-abgelehnt .zm-l-text { color: #ff9a9a; }
.zm-l-wartet .zm-l-text { color: #e3c46a; }
.zm-nr { font: inherit; font-weight: 700; color: #ffd84d; background: none; border: 0; border-bottom: 1px dotted #ffd84d; padding: 0; cursor: pointer; }
.zm-an { border-color: #2f6fa8; background: #14283a; }
/* Zug im Gleisbild hervorheben (Antippen der Zugnummer im Kasten) */
.gb-zn.zm-markiert rect { stroke: #ffd84d; stroke-width: 2.5; animation: zm-mark 0.5s ease-in-out 6 alternate; }
.gb-vorschau-nr.zm-markiert { animation: zm-mark-text 0.5s ease-in-out 6 alternate; }
@keyframes zm-mark { from { stroke-opacity: 1; } to { stroke-opacity: .15; } }
@keyframes zm-mark-text { from { fill: #ffd84d; } to { fill-opacity: .2; } }
.zm-panel { right: auto; max-width: calc(100% - 0.8rem); }
/* Zugmeldekasten fest im Gleisbild (Mahlsdorf, Strausberg): Stil des Stellwerks, Größen in Gleisbild-Einheiten */
.gb-zm { overflow: visible; }
.gb-zm-box { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 8.5px; line-height: 1.35; color: #b8c0c8; }
.gb-zm-box .zm-linie { max-width: none; padding: 4px 6px 5px; border: 1px solid #3a3a3a; border-radius: 0; background: #000; }
.gb-zm-box .zm-l-kopf { margin-bottom: 2px; }
.gb-zm-box .zm-l-titel { color: #b8c0c8; font-weight: 700; }
.gb-zm-box .zm-skizze { margin: 2px 0 3px; gap: 4px; }
.gb-zm-box .zm-bf { font-size: 7.5px; padding: 0 3px; border-color: #555; background: #000; color: #b8c0c8; border-radius: 0; }
.gb-zm-box .zm-gleis { min-height: 11px; gap: 6px; }
.gb-zm-box .zm-gleis::before { border-top-width: 2px; border-top-color: #8f8f8f; }
.gb-zm-box .zm-gleis-belegt::before { border-top-color: #ff2d2d; }
.gb-zm-box .zm-gleis-frei, .gb-zm-box .zm-gleis-zug { background: #000; padding: 0 3px; }
.gb-zm-box .zm-gleis-frei { font-size: 7.5px; }
.gb-zm-box .zm-l-zeile { gap: 3px; padding: 1px 0; }
.gb-zm-box .zm-l-sym { width: 9px; }
.gb-zm-box .zm-nr { color: #ffd84d; border-bottom-color: #ffd84d; }
.gb-zm-box .zm-btn { font-size: 8px; padding: 0 4px; line-height: 1.4; }
.zm-l-zeile .zm-l-text { flex: 1 1 55%; min-width: 0; }
/* nur der sichtbare Kasten nimmt Klicks an; der übrige Platzhalter lässt sie zu den Signalen darunter durch */
.gb-zm, .gb-zm-box { pointer-events: none; }
.gb-zm-box .zm-linie { pointer-events: auto; }
/* feste Kastengröße im Gleisbild: wächst nicht mit dem Inhalt (Fdl 28.11.2026) */
.gb-zm-box { height: 100%; }
.gb-zm-box .zm-linie { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
.gb-zm-box .zm-l-zeilen { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
/* Kasten im Gleisbild: Zeilen einzeilig (Text kürzt sich), Knöpfe daneben, kein störender Scrollbalken (Mausrad geht weiter) */
.gb-zm-box .zm-l-zeilen { scrollbar-width: none; }
.gb-zm-box .zm-l-zeilen::-webkit-scrollbar { display: none; }
.gb-zm-box .zm-l-zeile { flex-wrap: nowrap; }
.gb-zm-box .zm-l-zeile .zm-l-text { flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-zm-box .zm-l-zeile .zm-btn, .gb-zm-box .zm-l-zeile .zm-nr { flex: none; }

/* Glocke in der Kopfzeile: neue Nachrichten vom Admin */
.kopf-glocke { position: relative; gap: .3rem; }
.kopf-glocke-neu { color: #ffd84d; }
.kopf-glocke .glocke-zahl { font-size: .75rem; font-weight: 700; min-width: 1.1rem; text-align: center; padding: 0 .25rem; border-radius: 999px; background: #d83b3b; color: #fff; }
.postfach-nachricht { padding: .5rem 0; border-top: 1px solid var(--line, #2f3a45); }
.postfach-nachricht:first-of-type { border-top: 0; }
.postfach-nachricht h3 { margin: 0 0 .25rem; font-size: 1rem; }
.postfach-nachricht p { margin: 0; }
.postfach-neu { border-left: 3px solid #ffd84d; padding-left: .6rem; }
.postfach-ziel { border: 1px solid var(--line, #2f3a45); border-radius: 6px; margin: 0 0 .75rem; padding: .5rem .75rem; }
.postfach-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .15rem .75rem; margin-top: .5rem; max-height: 18rem; overflow-y: auto; }
.postfach-suche { margin-top: .5rem; max-width: 22rem; }

/* Startseite für Besucher: Netzkarte im Vollbild, links die einklappbare Vorstellung mit Demo und Anmeldung */
.start-panel { position: absolute; z-index: 24; top: 4.4rem; left: 1rem; width: min(380px, calc(100vw - 2rem)); max-height: calc(100vh - 6.5rem); max-height: calc(100dvh - 6.5rem);
    overflow-y: auto; padding: 1rem 1.1rem; background: rgba(22,28,35,0.94); color: var(--text); border: 1px solid #2c3640; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.start-panel-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.start-panel h1 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.start-panel h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.start-panel p { margin: 0.7rem 0; line-height: 1.5; }
.start-panel .start-demo { margin: 0.9rem 0 0.4rem; }
.start-panel .start-demo .btn { width: 100%; }
.start-trenner { border: 0; border-top: 1px solid #2c3640; margin: 1rem 0; }
.start-panel.start-zu #start-inhalt { display: none; }
.start-panel.start-zu h1 { font-size: 1.05rem; }
.netz-popup-hinweis { margin: 0.5rem 0 0.2rem; font-size: 0.85rem; color: #aeb7c1; }
.netz-popup .start-demo { margin: 0.5rem 0 0; }
.netz-popup .btn { width: 100%; margin-top: 0.45rem; }
@media (max-width: 760px) {
    .start-panel { top: 3.6rem; left: 0.5rem; right: 0.5rem; width: auto; max-height: calc(100dvh - 5rem); }
    .seite-karte:has(.start-panel:not(.start-zu)) .fuss { display: none; }   /* ausgeklapptes Panel füllt den Bildschirm */
}
