:root {
    color-scheme: dark;
    --bg: #0b0b0b;
    --surface: #151515;
    --surface-raised: #1c1c1c;
    --border: #383838;
    --border-soft: #292929;
    --text: #f5f5f5;
    --muted: #a0a0a0;
    --accent: #ffcc00;
    --live: #ffcc00;
    /* Eigene Farbe: vorher war "angekündigt" exakt dasselbe Gelb wie "live",
       auf der Übersicht ließen sich beide Zustände nicht unterscheiden. */
    --announced: #7db3ff;
    --radius: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 75% -20%, rgba(255, 204, 0, .08), transparent 35%), var(--bg); }
a { color: inherit; }

/*
 * Gleicher Aufbau und gleiche Höhe wie .public-header auf der Live-Seite.
 *
 * height statt min-height: mit min-height richtete sich die Höhe nach dem
 * höchsten Kind, und der Abmelden-Button machte den Adminkopf dadurch höher
 * als den der Übersicht. Die 56 px müssen mit --public-header-height in
 * live-page.css übereinstimmen; die beiden Seiten teilen sich kein Stylesheet.
 * 70 px zu 35 px Logohöhe: dasselbe Verhältnis wie vorher 56 zu 28.
 */
.site-header {
    height: 70px;
    /* Fester Wert statt clamp: mit einer breitenabhängigen Angabe wandert das
       Logo beim Größerziehen des Fensters und sitzt auf Seiten, die
       unterschiedlich breit aufgebaut sind, an verschiedenen Stellen.
       Muss in app.css und live-page.css identisch sein. */
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #ffcc00;
    background: #ffcc00;
}
.site-wordmark {
    margin-left: auto;
    color: #111111;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .16em;
    white-space: nowrap;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 14px; font-weight: 800; letter-spacing: .16em; }
/* Über die Höhe skaliert, damit das Seitenverhältnis stimmt. Die Farbe kommt
   über fill="currentColor" vom umgebenden .brand. Der Wert muss mit
   live-page.css übereinstimmen, sonst ist das Logo dort anders groß. */
.brand-mark { height: 35px; width: auto; display: block; }
.site-header .brand { color: #111111; }

.overview-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(64px, 9vw, 118px) 0 80px; }
.overview-heading { max-width: 650px; margin-bottom: 44px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.overview-heading h1 { margin-bottom: 14px; font-size: clamp(38px, 6vw, 70px); line-height: .98; letter-spacing: -.045em; }
.overview-heading > p:last-child { color: var(--muted); font-size: 18px; line-height: 1.6; }

.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.channel-card { min-height: 270px; padding: 25px; display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.025), transparent), var(--surface); transition: border-color .16s ease, transform .16s ease, background .16s ease; }
.channel-card:hover { transform: translateY(-3px); border-color: #666666; background-color: var(--surface-raised); }
.channel-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.channel-card-topline, .channel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.status-live { color: var(--live); }
.status-announced { color: var(--announced); }
.status-offline { color: #9a9a9a; }
.car-count { color: var(--muted); font-size: 12px; }
.channel-copy { margin: auto 0; }
.channel-copy h2 { margin-bottom: 7px; font-size: 31px; letter-spacing: -.025em; }
.channel-copy p { margin: 0; color: var(--muted); }
.channel-footer { padding-top: 18px; border-top: 1px solid var(--border-soft); font-size: 13px; }
.open-arrow { color: var(--accent); font-size: 22px; }


@media (max-width: 760px) {
    /* .site-header bekommt hier bewusst keinen anderen Seitenabstand mehr:
       die Live-Seite hat keine solche Ausnahme, das Logo säße sonst auf
       schmalen Fenstern wieder woanders. */
    .overview-shell { width: min(100% - 28px, 580px); padding-top: 54px; }
    .overview-heading { margin-bottom: 30px; }
    .overview-heading > p:last-child { font-size: 16px; }
    .channel-grid { grid-template-columns: 1fr; }
    .channel-card { min-height: 235px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(100%, 440px); }
.auth-shell > .brand { margin: 0 0 22px 4px; }
.auth-card { padding: clamp(26px, 6vw, 42px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.auth-card h1 { margin-bottom: 10px; font-size: 34px; letter-spacing: -.035em; }
.form-intro { margin-bottom: 28px; color: var(--muted); line-height: 1.5; }
.auth-card form { display: grid; gap: 19px; }
.auth-card label { display: grid; gap: 8px; color: #d0d0d0; font-size: 13px; font-weight: 650; }
.auth-card input:not([type="checkbox"]) { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #505050; border-radius: 0; color: var(--text); background: #0d0d0d; font: inherit; }
.auth-card input:focus { border-color: var(--accent); outline: 2px solid rgba(255,204,0,.16); }
.check-row { grid-template-columns: auto 1fr; align-items: center; }
.check-row input { accent-color: var(--accent); }
.primary-button { min-height: 47px; padding: 0 18px; border: 0; border-radius: 0; color: #111111; background: var(--accent); font: inherit; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: #ffda33; }
.form-error { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #ffcc00; border-radius: 0; color: #ffdf5f; background: #292300; font-size: 13px; line-height: 1.45; }
.text-button { padding: 8px 12px; border: 1px solid var(--border); border-radius: 0; color: var(--text); background: transparent; cursor: pointer; }
.dashboard-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 70px 0; }
.dashboard-shell > h1 { margin-bottom: 38px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.04em; }
.empty-panel { padding: 34px; border: 1px dashed #555555; border-radius: var(--radius); background: var(--surface); }
.empty-panel h2 { margin-bottom: 8px; }
.empty-panel p { margin: 0; color: var(--muted); }
/* margin-left:auto hält die Navigation am rechten Rand. Ohne das säße
   "Abmelden" direkt neben dem Logo und wirkte wie Teil der Marke. */
.admin-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.admin-nav > a { color: #333333; font-size: 13px; font-weight: 700; text-decoration: none; }
.admin-nav > a:hover, .admin-nav > a.active { color: #000000; }
.site-header .text-button { border-color: #333333; color: #111111; }
.page-heading { margin-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.04em; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.panel-stack { display: grid; gap: 20px; }
.panel { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel h2 { margin-bottom: 22px; font-size: 20px; }
.stack-form { display: grid; gap: 17px; }
.stack-form label { display: grid; gap: 7px; color: #d0d0d0; font-size: 13px; font-weight: 650; }
.stack-form input:not([type="checkbox"]), .stack-form textarea, .stack-form select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #505050; border-radius: 0; color: var(--text); background: #0d0d0d; font: inherit; }
.stack-form textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.secondary-button, .secondary-link, .primary-link { display: inline-flex; min-height: 42px; padding: 0 15px; align-items: center; justify-content: center; border: 1px solid #666666; border-radius: 0; color: var(--text); background: #1c1c1c; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-link { margin-top: 22px; border-color: var(--accent); color: #111111; background: var(--accent); }
.admin-list { display: grid; }
.admin-list a { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border-soft); text-decoration: none; }
.admin-list a:first-child { padding-top: 0; }
.admin-list a:last-child { padding-bottom: 0; border-bottom: 0; }
.admin-list small { margin-top: 4px; display: block; color: var(--muted); }
.muted { color: var(--muted); line-height: 1.55; }
.form-success { margin-bottom: 20px; padding: 12px 14px; border: 1px solid #ffcc00; border-radius: 0; color: #ffdf5f; background: #292300; }
.secret-panel { margin-bottom: 20px; padding: 20px; border: 1px solid #ffcc00; border-radius: var(--radius); background: #292300; }
.secret-panel code { margin: 12px 0 8px; padding: 12px; display: block; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 0; color: #ffdf5f; background: #111111; user-select: all; }
.secret-panel p { margin: 0; color: #d8c56f; font-size: 12px; }
.back-link { margin-bottom: 20px; display: inline-block; color: var(--muted); text-decoration: none; }
.compact-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.inline-form { margin-top: 14px; }
.empty-public { grid-column: 1 / -1; padding: 42px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); background: var(--surface); }
.empty-public h2 { color: var(--text); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 0 10px 10px 0; text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
/* Mittig statt oben: die erste Spalte ist zweizeilig, alle anderen einzeilig.
   Mit vertical-align:top klebten Länge und Datum an der Oberkante und standen
   sichtbar höher als die Schaltfläche daneben. */
.data-table td { padding: 12px 10px 12px 0; vertical-align: middle; border-top: 1px solid var(--border-soft); }
.data-table td:last-child, .data-table th:last-child { padding-right: 0; text-align: right; }
.data-table small { color: var(--muted); }
.data-table .row-broken strong { color: #ff8a7a; }
/* Zahlenspalten rechtsbündig und ohne Umbruch: sonst rutscht "6.970 m" auf zwei
   Zeilen, sobald die Spalte schmal wird. */
.data-table th.num, .data-table td.num { text-align: right; white-space: nowrap; }
.data-table form { margin: 0; }
.data-table .nowrap { white-space: nowrap; }
/* Die Namensspalte nimmt den übrigen Platz auf, alle anderen bleiben so schmal
   wie ihr Inhalt. Ohne das drängen sich die Spalten links zusammen und vor der
   Schaltfläche klafft eine Lücke. */
.trackmap-table th:first-child, .trackmap-table td:first-child { width: 100%; min-width: 190px; }
.text-button.danger { color: #ff8a7a; border-color: #5a2626; }
.text-button.danger:hover { border-color: #8c3a3a; background: #2a1414; }
.stack-form input[type="file"] { padding: 9px 11px; color: var(--muted); }

/* Löschbereich. Deutlich abgesetzt, weil er als Einziger etwas entfernt, das
   sich nicht wiederherstellen lässt. */
.danger-panel { border-color: #5a2626; }
.danger-panel h2 { color: #ff8a7a; }
.danger-panel code { padding: 2px 6px; border-radius: 0; color: #ffdf5f; background: #111111; }
/* Bleibt sichtbar, solange die Ausnahme läuft – sie soll nicht vergessen werden. */
.danger-banner { margin-bottom: 20px; padding: 14px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; border: 1px solid #8c3a3a; color: #ffdada; background: #3a1414; font-size: 13px; line-height: 1.5; }
.danger-banner .inline-form { margin: 0; margin-left: auto; }
.danger-button { min-height: 47px; padding: 0 18px; border: 1px solid #8c3a3a; border-radius: 0; color: #ffdada; background: #4a1c1c; font: inherit; font-weight: 800; cursor: pointer; }
.danger-button:hover { background: #5f2323; }

@media (max-width: 820px) {
    .admin-grid, .form-row { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .admin-nav { gap: 10px; }
}
