/* ═══════════════════════════════════════════════════════
   Leitstelle — dichtes Einsatzleit-Layout
   Drei Spalten: Einsatzmittel · Funkverkehr · Lage
   Unten durchgehend die Sprechleiste
   ═══════════════════════════════════════════════════════ */

.ls {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 10px;
    flex: 1; min-height: 0;   /* nimmt den Platz, den die Sprechleiste übrig lässt */
}
.ls-spalte {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ls-kopf {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    font-family: var(--cond); font-size: var(--fs-2xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim);
    flex: none;
}
.ls-kopf .zahl { margin-left: auto; font-family: var(--mono); font-size: var(--fs-2xs); }
.ls-koerper { flex: 1; overflow-y: auto; min-height: 0; }

/* ── Einsatzmittel ────────────────────────────────────── */
.mittel {
    display: flex; align-items: stretch; gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.035);
    cursor: default;
}
.mittel:hover { background: rgba(255,255,255,0.02); }
.mittel.gewaehlt { background: var(--red-dim); }

.mittel .fms {
    width: 34px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: var(--fs-base); font-weight: 600;
    border-radius: 0;
}
.mittel .daten { flex: 1; min-width: 0; padding: 0.45rem 0.6rem; }
.mittel .rufname {
    font-size: var(--fs-sm); font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mittel .unten {
    display: flex; gap: 0.4rem; align-items: baseline;
    font-size: var(--fs-2xs); color: var(--text-dim); margin-top: 0.1rem;
}
.mittel .typ { color: var(--text-mid); }
.mittel .rechts {
    flex: none; padding: 0.45rem 0.6rem 0.45rem 0;
    text-align: right; font-size: var(--fs-3xs); color: var(--text-dim);
    display: flex; flex-direction: column; justify-content: center; gap: 0.1rem;
}
.mittel .wache { font-family: var(--mono); }

/* FMS-Farben 1:1 aus dem Spiel (BOS.StatusFarben) */
.fms-0 {
    background: #ff0000; color: #fff;
    /* Prio. Sprechen ist genauso dringend wie Sprechwunsch — gleiches Blinken. */
    animation: fms-dringend-blinken 1s steps(1) infinite;
}
.fms-1 { background: #00aa00; color: #000; }
.fms-2 { background: #55ff7f; color: #000; }
.fms-3 { background: #aaffff; color: #000; }
.fms-4 { background: #ff5500; color: #fff; }
.fms-5 {
    background: #5500ff; color: #fff;
    /* Sprechwunsch soll auffallen, bis die Leitstelle reagiert. */
    animation: fms-dringend-blinken 1s steps(1) infinite;
}
@keyframes fms-dringend-blinken {
    0%, 49%  { opacity: 1; }
    50%, 100% { opacity: 0.35; }
}
.fms-6 { background: #464646; color: #fff; }
.fms-7 { background: #ff55ff; color: #000; }
.fms-8 { background: #ffaaff; color: #000; }
.fms-9 { background: #464646; color: #fff; }

/* Kleine Ausführung für Listen und Legende */
.fms.klein {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 0.3rem;
    border-radius: var(--radius-sm); font-family: var(--mono); font-size: var(--fs-2xs);
}

.wachenkopf {
    padding: 0.4rem 0.8rem 0.25rem;
    font-family: var(--cond); font-size: var(--fs-3xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); background: rgba(255,255,255,0.015);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    position: sticky; top: 0; z-index: 1;
    backdrop-filter: blur(6px);
}

/* ── Funkverkehr ──────────────────────────────────────── */
.verkehr { padding: 0.3rem 0; }
.eintrag {
    display: flex; gap: 0.6rem; align-items: flex-start;
    padding: 0.3rem 0.8rem;
    font-size: var(--fs-xs); line-height: 1.45;
    border-bottom: 1px solid rgba(255,255,255,0.025);
}
.eintrag:hover { background: rgba(255,255,255,0.02); }
.eintrag .zeit {
    flex: none; font-family: var(--mono); font-size: var(--fs-2xs);
    color: var(--text-dim); padding-top: 0.08rem;
}
.eintrag .inhalt { flex: 1; min-width: 0; color: var(--text-mid); }
.eintrag .wer { color: var(--text); font-weight: 600; }

.marke-e {
    display: inline-block; flex: none;
    font-size: var(--fs-3xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0.1rem 0.4rem; border-radius: var(--radius-sm);
    margin-right: 0.4rem;
}
.marke-sprache { background: rgba(79,142,247,0.15); color: var(--blue); }
.marke-status  { background: rgba(31,207,90,0.13);  color: var(--green); }
.marke-alarm   { background: rgba(232,25,44,0.18);  color: #ff6b7a; }
.marke-ende    { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.eintrag.laufend { background: rgba(232,25,44,0.06); }

/* ── Rechte Spalte: Reiter ────────────────────────────── */
.reiter { display: flex; border-bottom: 1px solid var(--border); flex: none; }
.reiter button {
    flex: 1; padding: 0.55rem 0.3rem;
    background: var(--surface2); border: none; border-bottom: 2px solid transparent;
    color: var(--text-dim); font-family: var(--sans); font-size: var(--fs-2xs);
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.reiter button:hover  { color: var(--text); }
.reiter button.aktiv  { color: var(--red); border-bottom-color: var(--red); background: var(--surface); }

.einsatz {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.035);
    border-left: 3px solid var(--red);
}
.einsatz .stichwort { font-family: var(--cond); font-size: var(--fs-base); font-weight: 700; letter-spacing: 0.02em; }
.einsatz .ort   { font-size: var(--fs-2xs); color: var(--text-mid); margin-top: 0.12rem; }
.einsatz .fuss  {
    display: flex; justify-content: space-between; gap: 0.5rem;
    font-size: var(--fs-2xs); color: var(--text-dim); margin-top: 0.3rem;
}
.einsatz .dauer { font-family: var(--mono); }

/* ── Sprechleiste unten ───────────────────────────────── */
.sprechleiste {
    display: flex; align-items: stretch; gap: 8px;
    margin-top: 10px; flex: none;
    /* Feste Bauhöhe: die Kanalfelder sollen den Streifen unten ausfüllen,
       statt als schmale Kärtchen am linken Rand zu kleben. */
    min-height: 210px;
}
.gross-taste {
    flex: none; width: 210px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    background: var(--surface2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-mid);
    font-family: var(--cond); font-size: var(--fs-md); font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s,
                box-shadow 0.16s, transform 130ms var(--ein);
}
.gross-taste:active:not(:disabled) { transform: scale(0.985); }
.gross-taste i { font-size: var(--fs-md); }
.gross-taste small {
    font-family: var(--sans); font-size: var(--fs-3xs); font-weight: 500;
    letter-spacing: 0.04em; text-transform: none; color: var(--text-dim);
}
.gross-taste:disabled { opacity: 0.35; cursor: not-allowed; }
.gross-taste.bereit   { border-color: var(--border-red); color: var(--text); }
.gross-taste.bereit:hover { background: var(--surface3); }
.gross-taste.sendet {
    background: var(--red); border-color: var(--red); color: #fff;
    box-shadow: 0 0 18px var(--red-glow);
}
.gross-taste.fremd { border-color: rgba(245,158,11,0.45); color: var(--yellow); }

.kanalbereich { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kanalreihe { flex: 1; display: flex; gap: 6px; min-width: 0; }

/* Die Kanalfelder selbst stehen in css/tabs/funk.css — dieselbe Bauform in
   beiden Bereichen, damit man sich nicht umgewöhnen muss. Hier liegen sie
   aber nebeneinander: jedes bekommt denselben Anteil der Breite und die
   volle Höhe des Streifens, egal ob drei TMO- oder fünf DMO-Gruppen. */
.kanalreihe .kanal {
    flex: 1 1 0; min-width: 0; height: 100%;
    justify-content: flex-start;
    padding: 0.7rem 0.8rem; gap: 0.45rem;
    /* Nebeneinander liest sich die Kennfarbe oben besser als an der Seite. */
    border-left-width: 1px; border-top: 3px solid var(--border);
}
.kanalreihe .kanal.sendekanal { border-left-color: var(--border); border-top-color: var(--red); }
.kanalreihe .kanal.laeuft     { border-left-color: var(--border); border-top-color: var(--green); }
.kanalreihe .kanal .name      { font-size: var(--fs-sm); }
.kanalreihe .kanal .aktivitaet { margin-top: 0.1rem; }
/* Der freie Platz gehört den Teilnehmern — dafür ist der Streifen hoch. */
.kanalreihe .kanal .hoerer { flex: 1; max-height: none; align-content: flex-start; }
.kanalreihe .kanal .kanal-waehlen { margin-top: 0; padding: 0.42rem 0.4rem; font-size: var(--fs-2xs); }

.kanalbereich .modus-reiter { margin-bottom: 0; }
.kanalbereich .modus-reiter { margin-bottom: 0; }

/* ── Serverwahl ───────────────────────────────────────── */
.wahlbalken {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none;
    padding: 0.55rem 0.7rem; margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid rgba(245,158,11,0.28);
    border-radius: var(--radius-sm);
}
.wahlbalken .marke {
    display: inline-flex; align-items: center; gap: 0.3rem; flex: none;
    font-size: var(--fs-3xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.12rem 0.45rem; border-radius: 999px;
    background: rgba(245,158,11,0.12); color: var(--yellow);
    border: 1px solid rgba(245,158,11,0.3);
}
.suchfeld { position: relative; flex: 1; min-width: 180px; }
.suchfeld i {
    position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); font-size: var(--fs-2xs); pointer-events: none;
}
.suchfeld input { padding-left: 1.9rem; }

.trefferliste {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
    max-height: 260px; overflow-y: auto;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
}
.trefferliste:empty { display: none; }
.treffer {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.7rem; cursor: pointer; width: 100%;
    background: none; border: none; border-bottom: 1px solid rgba(255,255,255,0.03);
    font-family: var(--sans); text-align: left; color: var(--text-mid);
}
.treffer:hover, .treffer.markiert { background: var(--surface3); color: var(--text); }
.treffer .name { flex: 1; min-width: 0; font-size: var(--fs-xs); }
.treffer .name span { display: block; font-size: var(--fs-2xs); color: var(--text-dim); }
.treffer .zahl { flex: none; font-family: var(--mono); font-size: var(--fs-2xs); color: var(--text-dim); }
.treffer .eigen {
    flex: none; font-size: var(--fs-3xs); text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--green); border: 1px solid rgba(31,207,90,0.3); border-radius: 999px;
    padding: 0.05rem 0.35rem;
}

.wahlbalken .angesehen { font-size: var(--fs-xs); color: var(--text-mid); }
.wahlbalken .angesehen b { color: var(--text); }

/* ── Mobil: Spalten untereinander ─────────────────────── */
@media (max-width: 1180px) {
    .ls { grid-template-columns: 1fr; height: auto; flex: none; }
    .ls-spalte { max-height: 340px; }
    .sprechleiste { flex-direction: column; height: auto; min-height: 0; }
    .gross-taste { width: 100%; min-height: 96px; }
    .kanalreihe { flex-wrap: wrap; }
    .kanalreihe .kanal { flex: 1 1 calc(50% - 3px); height: auto; }
    .kanalreihe .kanal .hoerer { flex: none; max-height: 7.2rem; }
    .kanalbereich { width: 100%; }
}
@media (max-width: 560px) {
    .kanalreihe .kanal { flex: 1 1 100%; }
    .ls-statusleiste-knoepfe { flex: 1 1 100%; margin-left: 0; }
}

/* ── Einsatzalarm-Meldung (oben rechts, verschwindet von selbst) ──── */
.einsatz-toast {
    position: fixed; top: 14px; right: 14px; z-index: 500;
    display: flex; align-items: flex-start; gap: 0.6rem;
    max-width: 320px;
    padding: 0.7rem 0.9rem;
    background: var(--surface2);
    border: 1px solid var(--border-red);
    border-left: 3px solid var(--red);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
}
.einsatz-toast.sichtbar { opacity: 1; transform: translateY(0); }
.einsatz-toast i { color: var(--red); font-size: var(--fs-md); margin-top: 0.1rem; flex: none; }
.einsatz-toast .titel { font-family: var(--cond); font-weight: 700; font-size: var(--fs-base); }
.einsatz-toast .zeile { font-size: var(--fs-2xs); color: var(--text-mid); margin-top: 0.15rem; }

@media (max-width: 560px) {
    .einsatz-toast { left: 10px; right: 10px; max-width: none; }
}

/* ── Statuszeile: Dienstbesetzung, Wetter und Fensterknöpfe zusammen ── */
.ls-statusleiste {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-bottom: 10px; flex: none;
}
.ls-statusleiste .dienst-wer,
.ls-statusleiste .wetterleiste { margin: 0; flex: 1 1 220px; min-width: 200px; }
.ls-statusleiste-knoepfe { display: flex; gap: 6px; flex: none; margin-left: auto; }

/* Wer ist gerade überall im Leitstellendienst — mehrere Leute gleichzeitig
   sind normal, das hier macht es nur sichtbar. */
.dienst-wer {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
    padding: 0.4rem 0.8rem; flex: none;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.dienst-wer .titel {
    font-size: var(--fs-3xs); text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); margin-right: 0.2rem;
}
.dienst-wer .chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: var(--fs-2xs); padding: 0.15rem 0.55rem; border-radius: 999px;
    background: var(--surface3); border: 1px solid rgba(79,142,247,0.3); color: var(--blue);
}
.dienst-wer .chip.ich { border-color: var(--border-red); color: var(--text); }
.dienst-wer .chip i { font-size: var(--fs-3xs); }

/* Warte-Screen (Stile in css/tabs/funk.css) — ohne Server bleibt vom
   Leitstellenplatz nur die Erklärung stehen. */
.ls-inhalt-wrapper { display: contents; }
.ls-inhalt-wrapper[hidden] { display: none !important; }
