/* ==============================================================
   Fahrtenbuch SV Frisia 03
   Mobile-first, große Tap-Targets, kontrastreich (auch in praller Sonne)
   Vereinsfarben: Schwarz und Gelb

   Farben, Radien und Schatten stehen in tokens.css und werden hier
   nur noch benutzt – nicht mehr definiert.
   ============================================================== */

* { box-sizing: border-box; }
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;   /* kein horizontales Wackeln/Scrollen auf dem Handy */
}

body {
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
}

/* Sichtbarer Fokus für Tastatur und Screenreader – vorher fiel der
   Fokus bei eigenen Buttons komplett unter den Tisch. */
:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Zahlenkolonnen: gleiche Ziffernbreite, damit nichts springt */
.num, .tabular, output, time { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 18px 40px;
    width: 100%;
}

/* ---------- Kopf ---------- */
.page-head {
    margin: 8px 0 24px;
}

/* App-Logo oben auf jeder Seite (Fahrer-UI) */
.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0 20px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
/* Kurze gelbe Kante statt durchgehender Balken – ruhiger, aber immer noch Frisia */
.app-logo::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -1px;
    transform: translateX(-50%);
    width: 64px; height: 3px;
    background: var(--accent);
    border-radius: var(--r-full);
}
.app-logo img { width: 48px; height: 48px; object-fit: contain; }
.app-logo strong {
    font-size: 18px;
    letter-spacing: -.01em;
    color: var(--col-text);
}
.app-logo small {
    display: block;
    font-size: 12px;
    color: var(--col-muted);
    font-weight: 400;
    margin-top: 2px;
}

.page-head h1 {
    font-size: var(--fs-h1);
    margin: 10px 0 4px;
    letter-spacing: -.025em;
    line-height: 1.15;
    text-wrap: balance;
}
.muted { color: var(--col-muted); }
.small { font-size: 14px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 4px;
    border-radius: var(--r-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-2);
    white-space: nowrap;
}
.badge--ok    { background: var(--ok-bg);    color: var(--ok);    border-color: var(--ok-border); }
.badge--warn  { background: var(--warn-bg);  color: var(--warn);  border-color: var(--warn-border); }
.badge--alert { background: var(--alert-bg); color: var(--alert); border-color: var(--alert-border); }
.badge--info  { background: var(--info-bg);  color: var(--info);  border-color: var(--info-border); }

/* ---------- Karten ---------- */
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--border);
}
.card h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.015em; }
.card p:last-child { margin-bottom: 0; }

/* Status als Kante links: die Fläche bleibt ruhig, der Zustand ist trotzdem
   auf einen Blick da – und funktioniert auch ohne Farbunterscheidung. */
.card--ok    { border-color: var(--ok-border);    background: var(--ok-bg);    border-left: 4px solid var(--ok); }
.card--warn  { border-color: var(--warn-border);  background: var(--warn-bg);  border-left: 4px solid var(--warn); }
.card--alert { border-color: var(--alert-border); background: var(--alert-bg); border-left: 4px solid var(--alert); }
.card--info  { background: var(--col-info-bg); border-color: var(--info-border); }

/* ---------- Schlüssel-Wert-Listen ---------- */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 14px;
    margin: 0;
}
.kv dt { color: var(--col-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--inline {
    grid-template-columns: max-content 1fr;
    font-size: 14px;
    margin-top: 8px;
}

/* ---------- Formulare ---------- */
.form { display: grid; gap: 18px; max-width: 100%; }
/* Grid-Items haben per Default min-width:auto und schrumpfen nicht unter
   ihren Inhalt – das schiebt breite Felder/Buttons aus dem Sichtfeld.
   min-width:0 erlaubt das Schrumpfen auf die Containerbreite. */
.form > * { min-width: 0; }
.field { display: block; min-width: 0; }
.field__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.field__label .small { font-weight: 400; }
.field__required {
    color: var(--alert);
    font-weight: 600;
    margin-left: 2px;
}
.field__hint {
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

/* Kleiner Inline-Link-Button (z.B. "übernehmen" neben Vorschlag) */
.btn-link-mini {
    background: none;
    border: none;
    color: var(--col-link, var(--info));
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font: inherit;
    font-size: 12px;
}
.btn-link-mini:hover { color: var(--info); }

/* Nur-Symbol-Variante (Bearbeiten/Löschen in Tabellen). Ohne Unterstreichung,
   dafür mit größerem Symbol und einer Trefferfläche, die auch am Handy mit
   dem Daumen zu treffen ist (Richtwert 32px). */
.btn-link-mini--ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 19px;          /* .ico ist 1em groß, also 19px */
    text-decoration: none;
    border-radius: 8px;
    vertical-align: middle;
}
.btn-link-mini--ico + .btn-link-mini--ico { margin-left: 2px; }
.btn-link-mini--ico:hover,
.btn-link-mini--ico:focus-visible { background: var(--col-card-active); }

/* Sichtprüfungs-Liste auf der Trip-Detailseite */
.check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.check-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--col-border);
    background: var(--col-card);
}
.check-row--ok {
    background: var(--col-ok-bg);
    border-color: var(--ok-border);
}
.check-row--warn {
    background: var(--col-warn-bg);
    border-color: var(--warn-border);
}
.check-row__sym {
    font-size: 22px;
    line-height: 1;
    text-align: center;
}
.check-row--ok .check-row__sym   { color: var(--ok); }
.check-row--warn .check-row__sym { color: var(--warn); }
.check-row__body strong { display: block; margin-bottom: 2px; }

/* Sichtprüfungs-Karten (Innenraum, Schaden) – große Touch-Targets */
/* Fieldsets haben einen Browser-Default min-inline-size: min-content,
   der sie über den Viewport hinausschieben kann. Explizit aufheben. */
fieldset {
    min-width: 0;
    max-width: 100%;
}
/* hidden-Attribut zuverlässig durchsetzen (manche Browser rendern
   fieldset[hidden] sonst trotzdem) */
[hidden] { display: none !important; }
.check-fieldset {
    border: none;
    padding: 0;
    margin-bottom: 16px;
    min-width: 0;
}
.check-fieldset legend.field__label {
    padding: 0;
    margin-bottom: 4px;
}
.check-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.check-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 8px;
    background: var(--col-card);
    border: 2px solid var(--col-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
    min-height: 80px;
    text-align: center;
}
.check-card:hover { background: var(--col-card-hover); }
.check-card input[type=radio] {
    /* nativen Radio verstecken, der Karten-Klick übernimmt die Auswahl */
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
}
.check-card__sym {
    font-size: 26px;
    line-height: 1;
}
.check-card__txt {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.check-card:has(input:checked) {
    background: var(--col-ok-bg);
    border-color: var(--ok);
    box-shadow: inset 0 0 0 1px var(--ok);
}
.check-card.check-card--warn:has(input:checked) {
    background: var(--col-warn-bg);
    border-color: var(--warn);
    box-shadow: inset 0 0 0 1px var(--warn);
}
.check-card.check-card--alert:has(input:checked) {
    background: var(--col-alert-bg);
    border-color: var(--alert);
    box-shadow: inset 0 0 0 1px var(--alert);
}

/* Busplan-Vorschlag: Karten pro Tag mit klar abgesetzten Spielzeilen */
.vorschlag-tage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}
.vorschlag-tag {
    background: var(--col-card-hover);
    border: 1px solid var(--col-border);
    border-radius: 8px;
    padding: 10px 12px;
}
.vorschlag-tag__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}
.vorschlag-zeile {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 60px 60px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-soft);
}
.vorschlag-zeile:last-child { border-bottom: none; }
.vorschlag-zeile__team    { line-height: 1.3; }
.vorschlag-zeile__gegner  { }
.vorschlag-zeile__km      { text-align: right; font-variant-numeric: tabular-nums; }
.vorschlag-busse {
    text-align: right;
    font-size: 18px;
    line-height: 1;
}
.vorschlag-busse--reduziert {
    opacity: 0.6;
}
.vorschlag-zeile__hinweis {
    grid-column: 1 / -1;
    padding-left: 4px;
}
@media (max-width: 700px) {
    .vorschlag-zeile {
        grid-template-columns: 1fr 60px;
    }
    .vorschlag-zeile__gegner { grid-column: 1 / -1; }
    .vorschlag-zeile__km { text-align: left; }
}

.field__input {
    width: 100%;
    padding: 13px 14px;
    font-size: var(--fs-base);
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field__input:hover { border-color: var(--border-strong); }
.field__input:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: var(--ring);
}
.field__input::placeholder { color: var(--text-3); }
.field__input:disabled { background: var(--surface-2); color: var(--text-3); }
/* Große Zahleneingabe (Tachostand): Monospace, damit die Ziffern beim
   Tippen nicht springen und Zahlendreher auffallen. */
.field__input--big {
    font-size: var(--fs-big);
    font-weight: 700;
    text-align: center;
    letter-spacing: .04em;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

textarea.field__input { resize: vertical; min-height: 70px; }
/* Auswahlpfeil: die Farbe steckt als ganzes url() in einem Token, damit
   sie im dunklen Theme mitwechselt – innerhalb einer Data-URI lässt sich
   currentColor nicht verwenden. */
select.field__input {
    background-image: var(--select-pfeil);
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.hint { display: block; font-size: 14px; color: var(--col-muted); margin-top: 6px; }
.hint--warn { color: var(--col-warn); }
.hint--alert{ color: var(--col-alert); font-weight: 600; }

/* ---------- Radio-Gruppen ---------- */
.radiogroup { display: grid; gap: 8px; }
/* Sechs Tankstufen mit ausgeschriebenen Wörtern: 2 Reihen à 3.
   In sechs Spalten wäre für "Dreiviertel" kein Platz. */
.radiogroup--tank   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.radiogroup--ampel  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.radiogroup--2      { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Auf schmalen Handys: Tankstufen in drei Reihen statt drei enge Spalten */
@media (max-width: 460px) {
    .radiogroup--tank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.radio {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: transform .08s var(--ease), border-color .15s var(--ease),
                background .15s var(--ease);
}
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio:hover { border-color: var(--border-strong); }
.radio:active { transform: scale(.97); }
.radio:has(input:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.radio:has(input:checked) {
    border-color: var(--accent-strong);
    background: var(--accent);
    color: var(--accent-ink);
}

.radio--tank  { font-size: 15px; padding: 14px 6px; }

/* Tankstufe: Füllbalken über dem ausgeschriebenen Wort. Der Balken zeigt den
   Füllstand, damit die Reihenfolge voll -> leer ohne Lesen erkennbar ist. */
.tank-stufe        { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; }
.tank-stufe__wort  { font-size: 14px; line-height: 1.2; hyphens: auto; }
.tank-balken {
    display: block;
    width: 80%; max-width: 76px; height: 9px;
    background: var(--col-border);
    border-radius: 999px;
    overflow: hidden;
}
.tank-balken > span { display: block; height: 100%; border-radius: 999px; }
.tank-balken--gruen > span { background: var(--col-ok); }
.tank-balken--gelb  > span { background: var(--col-warn); }
.tank-balken--rot   > span { background: var(--col-alert); }
.radio--ampel { padding: 18px 6px; }

.radio--gruen:has(input:checked) { background: var(--col-ok-bg);    border-color: var(--col-ok);    color: var(--col-ok); }
.radio--gelb:has(input:checked)  { background: var(--col-warn-bg);  border-color: var(--col-warn);  color: var(--col-warn); }
.radio--rot:has(input:checked)   { background: var(--col-alert-bg); border-color: var(--col-alert); color: var(--col-alert); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 15px 22px;
    font-size: 17px; font-weight: 600;
    letter-spacing: -.005em;
    border: 1px solid transparent; border-radius: var(--r);
    text-decoration: none; cursor: pointer;
    transition: transform .08s var(--ease), background .15s var(--ease),
                color .15s var(--ease), box-shadow .15s var(--ease);
    font-family: inherit;
    line-height: 1.2;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
    background: var(--btn-bg);
    color: var(--btn-fg);
    box-shadow: var(--shadow-1);
}
.btn--primary:hover {
    background: var(--btn-bg-hover);
    color: var(--btn-fg-hover);
}
.btn--ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
/* Zerstörende Aktion – muss sich vom Primärbutton unterscheiden */
.btn--danger { background: var(--alert); color: var(--surface); }
.btn--danger:hover { filter: brightness(1.08); }
.btn--full    { width: 100%; }
.btn--small   { padding: 9px 14px; font-size: 15px; }

.actions { display: grid; gap: 10px; margin-top: 18px; max-width: 100%; }
.actions > * { min-width: 0; }
.btn { max-width: 100%; }

/* ---------- Banner ---------- */
.banner {
    padding: 12px 14px;
    border-radius: var(--r);
    margin: 12px 0;
    border-left: 4px solid;
    background: var(--col-card);
}
.banner--warn  { background: var(--col-warn-bg);  border-color: var(--col-warn); }
.banner--alert { background: var(--col-alert-bg); border-color: var(--col-alert); font-weight: 600; }

/* ---------- Autocomplete ---------- */
.autocomplete {
    list-style: none;
    margin: 6px 0 0; padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-2);
    max-height: 280px; overflow-y: auto;
}
.autocomplete li {
    padding: 10px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
}
.autocomplete li:hover, .autocomplete li.active { background: var(--accent-quiet); }
.autocomplete .ac-name  { font-weight: 600; }
.autocomplete .ac-meta  { font-size: 13px; color: var(--col-muted); }

/* ---------- Loading ---------- */
.loading-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.loading-card { text-align: center; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--col-border);
    border-top-color: var(--col-accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin .8s linear infinite;
}
.spinner--inline {
    display: inline-block;
    width: 14px; height: 14px;
    border-width: 2px;
    margin: 0 8px -2px 0;
    vertical-align: baseline;
}

/* Card-Variante für Spielvorschlag */
.card--info {
    background: var(--col-info-bg);
    border-left: 4px solid var(--col-accent);
}

/* ===== Spielvorschlag nach Mannschaftsauswahl ===== */
.spielvorschlag {
    margin-top: 12px;
    background: var(--col-card);
    border: 1px solid var(--col-border);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}
.spielvorschlag__lade {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--col-muted);
    font-size: 15px;
}
.spielvorschlag__titel {
    font-weight: 700;
    font-size: 15px;
    color: var(--col-primary);
    margin-bottom: 12px;
}

/* Einzelnes erkanntes Spiel (kein Auswahl-Radio) */
.spielvorschlag__single {
    background: var(--accent-quiet);
    border: 1px solid var(--accent-strong);
    border-radius: var(--r);
    padding: 14px;
}
.spielvorschlag__single-gegner {
    font-size: 18px;
    font-weight: 700;
    color: var(--col-primary);
    margin-bottom: 8px;
}
.spielvorschlag__single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.spielvorschlag__chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--col-card);
    border: 1px solid var(--col-border);
    color: var(--col-text);
    white-space: nowrap;
}
.spielvorschlag__chip--wb {
    background: transparent;
    color: var(--col-muted);
    font-weight: 500;
}

/* Mehrere Spiele zur Auswahl */
.spielvorschlag__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 8px;
    background: var(--col-card);
    border: 1.5px solid var(--col-border);
    border-radius: var(--r);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.spielvorschlag__option:last-of-type { margin-bottom: 0; }
.spielvorschlag__option:hover {
    border-color: var(--col-accent);
}
.spielvorschlag__option.is-active {
    background: var(--col-info-bg);
    border-color: var(--col-accent);
    box-shadow: inset 0 0 0 1px var(--col-accent);
}
.spielvorschlag__option input[type=radio] {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--col-accent);
    flex: 0 0 auto;
}
.spielvorschlag__opt-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.spielvorschlag__opt-gegner {
    font-size: 16px;
    line-height: 1.25;
}
.spielvorschlag__opt-zeit {
    font-size: 13px;
    color: var(--col-muted);
    font-variant-numeric: tabular-nums;
}

/* Ziel-Anzeige */
.spielvorschlag__ziel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--col-card-hover);
    border-radius: var(--r);
}
.spielvorschlag__ziel-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--col-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.spielvorschlag__ziel-text {
    font-size: 16px;
    overflow-wrap: anywhere;
}
.spielvorschlag__ziel--leer {
    background: var(--col-warn-bg);
}
.spielvorschlag__zuruecksetzen {
    background: none;
    border: none;
    color: var(--col-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 0;
    text-decoration: underline;
    font-family: inherit;
}
.spielvorschlag__zuruecksetzen:hover { color: var(--col-text); }
.spielvorschlag__leer {
    font-size: 14px;
    color: var(--col-muted);
    line-height: 1.4;
}

/* fussball.de Team-Picker: Dropdown + Refresh-Button nebeneinander */
.fb-team-picker {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.fb-team-picker select { flex: 1; }
.fb-team-picker button {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 18px;
    line-height: 1;
}

/* Vereins-Autocomplete (Einstellungen-Seite) */
.autocomplete--vereine li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
}
.autocomplete--vereine img {
    width: 36px; height: 36px; flex-shrink: 0;
    object-fit: contain;
}
.autocomplete--vereine strong {
    display: block;
    font-size: 15px;
}
.autocomplete--vereine small {
    display: block;
    color: var(--col-muted);
    font-size: 13px;
}
.hint--ok { color: var(--col-ok); font-weight: 500; }

/* Verein-Chip nach Auswahl: Logo + Name + Entfernen-Button */
.verein-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--col-accent);
    border-radius: var(--r);
    background: var(--col-info-bg);
}
.verein-chip__logo {
    width: 44px; height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}
.verein-chip__name {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    color: var(--col-text);
}
.verein-chip__entfernen {
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--col-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.verein-chip__entfernen:hover {
    background: var(--col-alert-bg);
    color: var(--col-alert);
}

/* Auswärtsspiele-Tabelle auf dem Dashboard */
.aw-tbl td { vertical-align: top; padding: 10px 8px; }
.aw-tbl .aw-datum  { white-space: nowrap; width: 80px; }
.aw-tbl .aw-zeit   { white-space: nowrap; width: 60px; }
.aw-tbl .aw-team   { width: 32%; }
.aw-tbl .aw-gegner { width: 50%; }
.aw-tbl .aw-link   { white-space: nowrap; text-align: right; }

/* Tagesgruppe in der Bus-Disposition */
.busplan-tag {
    margin-bottom: 16px;
    border: 1px solid var(--col-border);
    border-radius: 8px;
    padding: 10px 12px 4px;
    background: var(--col-card);
}
.busplan-tag.aw-bald     { border-left: 4px solid var(--warn); }
.busplan-tag.aw-naechste { border-left: 4px solid var(--ok); }
.busplan-tag.aw-vergangen { opacity: 0.55; }
.busplan-tag__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.busplan-tag__titel { margin: 0; font-size: 16px; }
.busplan-tag .aw-tbl { margin: 0; }
.busplan-tag .aw-tbl td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-soft);
}
.busplan-tag .aw-tbl tr:last-child td { border-bottom: none; }

/* Sonderfahrt-Zeile leicht andersfarbig */
.busplan-sonderfahrt td {
    background: var(--col-card-hover);
}

/* Offener Bus-Antrag im Tag: keine Fahrt, sondern eine Entscheidung –
   deshalb warnfarbig abgesetzt statt wie eine geplante Zeile. */
.busplan-antrag--offen td {
    background: var(--warn-bg);
}
.busplan-antrag--offen td:first-child {
    box-shadow: inset 3px 0 0 var(--warn);
}
/* Im Kompakt-Modus stehen die Knöpfe hinter dem Bus-Symbol (das schiebt sich
   per margin-left:auto nach rechts) – deshalb hier kein zweites auto. */
.busplan-antrag__knoepfe {
    white-space: nowrap;
    display: inline-flex;
    gap: 4px;
}
.busplan-antrag-li { flex-wrap: wrap; }
/* Abgelehnte Anträge bleiben am Tag stehen, aber sichtbar zurückgenommen. */
.busplan-tag__rest--abgelehnt { margin-top: 6px; }
.busplan-antrag-li--abgelehnt strong {
    text-decoration: line-through;
    color: var(--text-2) !important;
}

/* Manuell überschriebene Bus-Auswahl: dezenter Rand */
.busse-select--manuell {
    border-color: var(--info);
    background: var(--col-card-active);
}

/* Bestätigte Tage – kompakt, grün, blass aber lesbar */
.busplan-tag--bestaetigt {
    background: var(--col-ok-bg);
    border-color: var(--ok-border);
    border-left: 4px solid var(--ok);
    opacity: 0.85;
    padding: 8px 12px;
}
.busplan-tag--bestaetigt .busplan-tag__head {
    margin-bottom: 4px;
}
.busplan-tag--bestaetigt .busplan-tag__titel {
    font-size: 14px;
    color: var(--text-2);
    font-weight: 600;
}
.busplan-tag__zusammenfassung {
    margin: 0;
    padding: 0 0 0 26px;
    list-style: none;
}
.busplan-tag__zusammenfassung li {
    padding: 2px 0;
    font-size: 13px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.busplan-tag__zusammenfassung li strong {
    color: var(--text);
}
.busplan-tag__bus {
    margin-left: auto;
    white-space: nowrap;
}
.busplan-tag__rest {
    margin: 4px 0 0 26px;
}
.busplan-tag__rest > summary {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}
.busplan-tag__zusammenfassung--rest {
    opacity: 0.65;
    margin-top: 2px;
    padding-left: 0;
}

/* Verlegung: Hinweis im Kopf des Tages, der eine Fahrt abgegeben hat */
.busplan-tag__verlegt {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn);
}
.busplan-tag__verlegt .ico { flex: none; align-self: center; }
.busplan-tag__verlegt .muted { color: inherit; opacity: .8; }

/* Tag, dessen einzige Fahrt weggewandert ist – bleibt sichtbar, damit der
   dort verplante Bus nicht stillschweigend gebunden bleibt. */
.busplan-tag--leer {
    border-left: 4px solid var(--warn);
    padding-bottom: 10px;
}
.busplan-tag--leer .busplan-tag__titel { color: var(--text-2); font-size: 14px; }
.aw-tbl tr.aw-bald td {
    background: var(--accent);
    color: var(--accent-ink);
}
.aw-tbl tr.aw-bald .muted { color: rgba(0,0,0,.6) !important; }
.aw-tbl tr.aw-naechste td {
    background: var(--col-info-bg);
}

/* Heim-Spiele optisch absetzen: gedämpfter Hintergrund + Text */
.aw-tbl tr.aw-heim td {
    background: var(--col-card-hover);
    color: var(--text-2);
}
.aw-tbl tr.aw-heim td strong {
    color: var(--text-2);
    font-weight: 500;
}
.badge--neutral {
    background: var(--col-card-active);
    color: var(--text-2);
}

/* Filter-Leiste auf der Spiele-Seite */
.filter-leiste {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--col-card-hover);
    border: 1px solid var(--col-border);
    border-radius: var(--r);
}
.filter-feld {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-label {
    font-size: 12px;
    color: var(--col-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.filter-leiste select {
    padding: 6px 8px;
    border: 1px solid var(--col-border);
    border-radius: 6px;
    background: var(--col-card);
    font-size: 14px;
    min-width: 200px;
}
.filter-reset { align-self: flex-end; }

@media (max-width: 700px) {
    .filter-leiste { padding: 8px; gap: 10px; }
    .filter-leiste select { min-width: 0; width: 100%; }
    .filter-feld { width: 100%; }
    .seg-control { width: 100%; }
    .seg { flex: 1; text-align: center; }
}

/* Segmentierter Toggle-Schalter (Alle / Heim / Auswärts u.ä.) */
.seg-control {
    display: inline-flex;
    border: 1px solid var(--col-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--col-card);
}
.seg {
    padding: 6px 12px;
    font-size: 14px;
    text-decoration: none;
    color: var(--col-text);
    border-right: 1px solid var(--col-border);
    background: var(--col-card);
    transition: background 0.1s;
}
.seg:last-child { border-right: none; }
.seg:hover { background: var(--col-card-active); }
.seg.is-active {
    background: var(--col-accent);
    color: var(--accent-ink);
    font-weight: 600;
}

/* Busplan-Block */
.busplan-card { margin-bottom: 16px; }
.busplan-text {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r);
    padding: 14px 16px;
    margin: 12px 0 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
    color: var(--col-text);
}
.busse-select {
    /* Die Auswahl zeigt 🚐-Symbole statt Zahlen – die brauchen mehr Größe,
       sonst sind ein und zwei Busse kaum zu unterscheiden. */
    font-size: 18px;
    line-height: 1.3;
    padding: 4px 6px;
    max-width: 100%;
    background: var(--col-card);
    border: 1px solid var(--col-border);
    border-radius: 6px;
}
/* 🚐-Symbole im Vorschlagshinweis: der Hinweistext daneben darf klein
   bleiben, das Symbol selbst nicht. */
.bus-sym { font-size: 17px; vertical-align: -2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Details/Summary */
details summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
    content: "";
    display: inline-block;
    width: 0; height: 0;
    margin-right: 8px;
    vertical-align: 1px;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    color: var(--text-3);
    transition: transform .15s var(--ease);
}
details[open] summary::before { transform: rotate(90deg); }

/* Sofort-Hinweis unter Tachostand-Eingabe (start.php) */
.km-hinweis {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--col-card-active);
    color: var(--col-text);
    font-size: 15px;
    line-height: 1.4;
}
.km-hinweis--warn {
    background: var(--col-warn-bg);
    border: 1px solid var(--col-warn);
    color: var(--col-warn);
}
.km-hinweis--ok {
    background: var(--col-ok-bg);
    border: 1px solid var(--col-ok);
    color: var(--col-ok);
    font-weight: 500;
}

/* ---------- Foto-Eingabe (Kamera direkt) ---------- */
.foto-eingabe { margin-top: 4px; }
.foto-eingabe__liste {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.foto-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--col-border);
    flex: 0 0 auto;
}
.foto-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.foto-thumb__del {
    position: absolute;
    top: 2px; right: 2px;
    width: 24px; height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.foto-eingabe__count {
    padding: 6px 12px;
    background: var(--col-ok-bg);
    color: var(--col-ok);
    border-radius: var(--r);
    font-size: 14px;
    font-weight: 500;
    align-self: center;
}

/* Eingegebener Tachostand in der Plausi-Rückfrage */
.plausi-wert {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 12px 0 16px;
    padding: 14px 16px;
    background: var(--col-card);
    border: 1px solid var(--col-border);
    border-radius: var(--r);
}
.plausi-wert__label {
    font-size: 13px;
    color: var(--col-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.plausi-wert__zahl {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--col-text);
    line-height: 1.1;
}
.plausi-wert__vergleich {
    font-size: 14px;
    color: var(--col-muted);
    margin-top: 4px;
}

/* Platzhalter-Thumbnail wenn keine Bildvorschau möglich (z.B. HEIC) */
.foto-thumb__ph {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 28px;
    background: var(--col-card-hover, var(--surface-2));
}

/* Funktional vorhanden, aber visuell versteckt (statt [hidden], das auf
   iOS Safari File-Inputs beim Submit aushebeln kann). */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   Geplante Fahrten – Direktvorschlag beim Fahrtantritt
   ========================================================= */
.geplant-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.geplant-karte {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--col-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .05s;
    -webkit-tap-highlight-color: transparent;
}
.geplant-karte:hover { background: var(--col-card-hover); }
.geplant-karte:active { transform: scale(.99); background: var(--col-card-active); }
.geplant-karte:focus-visible { outline: none; border-color: var(--col-accent); }

.geplant-karte__zeit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding-right: 12px;
    border-right: 1px solid var(--border-soft);
}
.geplant-karte__tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-3);
}
.geplant-karte__zeit strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}
.geplant-karte__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.geplant-karte__titel { font-size: 16px; line-height: 1.25; }
.geplant-karte__sub   { font-size: 13px; color: var(--text-3); }
.geplant-karte__ziel  {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
    overflow-wrap: anywhere;
}
.geplant-karte__pfeil {
    font-size: 22px;
    color: var(--col-accent-dk);
    flex-shrink: 0;
}
.geplant-manuell {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}
.geplant-manuell:hover { color: var(--text); }

/* Dem Bus zugewiesene Fahrt hervorheben */
.geplant-karte--zugewiesen {
    border-color: var(--col-accent);
    background: var(--accent-quiet);
}
.geplant-karte__badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--col-accent);
    color: var(--accent-ink);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    margin-bottom: 3px;
}
/* Gemeindefahrt-Direktbutton */
.geplant-gemeinde {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    background: var(--col-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.geplant-gemeinde:hover { background: var(--col-card-hover); }
.geplant-gemeinde:active { background: var(--col-card-active); }

/* Container für zugewiesene/geplante Fahrten im Mannschafts-Block */
.geplant-block { margin-bottom: 16px; }
.geplant-block .field__label { display: block; margin-bottom: 6px; }
/* Vom Fahrer ausgewählte Karte – deutlich hervorgehoben */
.geplant-karte--aktiv {
    border-color: var(--ok);
    border-width: 2px;
    background: var(--ok-bg);
    box-shadow: 0 0 0 3px rgba(21,128,61,.25);
}
.geplant-karte--aktiv .geplant-karte__pfeil { display: none; }
.geplant-karte--aktiv .geplant-karte__body::after {
    content: "✓ Ausgewählt";
    display: inline-block;
    align-self: flex-start;
    margin-top: 4px;
    background: var(--ok);
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
}
/* Bei aktiver Karte das gelbe "Bus eingeplant"-Badge ausblenden, um doppelte
   Badges zu vermeiden */
.geplant-karte--aktiv .geplant-karte__badge { display: none; }

/* Mannschaft, die sich aus dem gewählten Spiel ergibt – reine Anzeige,
   statt des Dropdowns. Der Wert steckt im versteckten Select. */
.team-fest__wert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 2px solid var(--ok);
    border-radius: 10px;
    background: var(--ok-bg);
    font-size: 16px;
    font-weight: 600;
}
.team-fest__haken { color: var(--ok); flex-shrink: 0; }

/* Entfernung/Fahrzeit auf den geplanten Fahrt-Karten */
.geplant-karte__route {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}
.geplant-karte__route .muted { color: var(--text-3); font-size: 11px; }

/* Live-Anzeige Entfernung/Fahrzeit unter dem Zielfeld */
.ziel-route {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--info-bg);
    font-size: 14px;
    color: var(--text);
}
.ziel-route--ok { background: var(--ok-bg); }
.ziel-route .muted { color: var(--text-3); font-size: 12px; }

/* ==============================================================
   Meldungen und Rückfragen (assets/ui.js)
   Ersetzt alert() und confirm().
   ============================================================== */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(440px, calc(100vw - 24px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--r);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
    cursor: pointer;
    animation: toast-auf .22s var(--ease);
}
.toast.is-weg { animation: toast-zu .2s var(--ease) forwards; }
.toast__dot {
    flex: 0 0 auto;
    width: 8px; height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.toast__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast--ok     { border-color: var(--ok-border);    background: var(--ok-bg);    color: var(--ok); }
.toast--ok .toast__dot { background: var(--ok); }
.toast--warn   { border-color: var(--warn-border);  background: var(--warn-bg);  color: var(--warn); }
.toast--warn .toast__dot { background: var(--warn); }
.toast--fehler { border-color: var(--alert-border); background: var(--alert-bg); color: var(--alert); }
.toast--fehler .toast__dot { background: var(--alert); }

@keyframes toast-auf {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes toast-zu {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* ---------- Rückfrage-Dialog ---------- */
.ui-dialog {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(10,10,8,.55);
    animation: dialog-grund .15s var(--ease);
}
body.ui-dialog-offen { overflow: hidden; }
.ui-dialog__box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    padding: 22px;
    width: 100%;
    max-width: 400px;
    animation: dialog-auf .2s var(--ease);
}
.ui-dialog__titel {
    margin: 0 0 8px;
    font-size: 18px;
    letter-spacing: -.02em;
}
.ui-dialog__text {
    margin: 0;
    color: var(--text-2);
    line-height: 1.5;
}
.ui-dialog__aktionen {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}
.ui-dialog__aktionen .btn { min-width: 96px; }

@keyframes dialog-grund { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-auf {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 460px) {
    .ui-dialog__aktionen { flex-direction: column-reverse; }
    .ui-dialog__aktionen .btn { width: 100%; }
}

/* ---------- Theme-Umschalter ---------- */
.theme-schalter {
    display: inline-grid;
    place-items: center;
    width: 30px; height: 30px;
    flex: 0 0 auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.theme-schalter:hover { background: var(--surface-3); color: var(--text); }

/* Theme-Schalter in der Logo-Zeile der Fahrer-Ansicht */
.app-logo { position: relative; }
.app-logo__theme {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-60%);
}

/* ==============================================================
   Seitenwechsel
   ==============================================================

   Die App besteht aus klassischen PHP-Seiten – jeder Menüklick war
   bisher ein Weißblitz. Mit der View-Transitions-API blendet der
   Browser zwischen zwei Dokumenten über, ohne dass am Aufbau der
   Seiten etwas geändert werden muss.

   Browser ohne Unterstützung ignorieren den Block und navigieren
   wie bisher – es geht nichts verloren.
   ============================================================== */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: .2s;
    animation-timing-function: var(--ease);
}

/* Feste Bereiche sollen beim Wechsel stehen bleiben statt mitzublenden.
   Ohne eigenen Namen gehören sie zum Wurzel-Schnappschuss und flackern mit. */
.admin__sidebar { view-transition-name: sidebar; }
.app-logo       { view-transition-name: kopfzeile; }
.toast-host     { view-transition-name: meldungen; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

/* Nach dem Neuaufbau kurz markieren, was sich geändert hat */
.ist-frisch {
    animation: frisch 1.6s var(--ease);
}
@keyframes frisch {
    0%, 55% { box-shadow: 0 0 0 3px var(--accent); }
    100%    { box-shadow: 0 0 0 3px transparent; }
}

/* ==============================================================
   Strichsymbole (Helpers::icon)
   Werden 1em groß und nehmen die Textfarbe an – ein Symbol in einer
   Überschrift wächst also mit der Überschrift mit.
   ============================================================== */
.ico {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -.14em;
    flex: none;
}
/* In Flex-Zeilen (Buttons, Badges) sorgt deren gap für den Abstand.
   Im Fließtext steht das Symbol als inline-block mit normalem Wortabstand. */
.badge > .ico { margin-right: -1px; }
.ico--warnung { color: var(--warn); }
.ico--stopp,
.ico--kreuz   { color: currentColor; }

/* Große Symbole in Auswahlkarten und Kacheln: dort gibt die Umgebung
   die Schriftgröße vor, das Symbol folgt automatisch. */
.check-card__sym .ico,
.check-row__sym .ico,
.pm-kachel__icon .ico { width: 1em; height: 1em; }

/* Wartesymbol in Buttons dreht sich, solange die Aktion läuft */
.ico--sanduhr.ist-aktiv { animation: spin 1.4s linear infinite; }
