/*
 * TV-Steuerung im Frontend.
 * Eigenständiges Styling – bewusst unabhängig vom wp-admin-Aussehen und auf
 * Bedienung am Tablet/Handy ausgelegt (große Flächen, klare Trennung).
 */

.ts-tvc {
    --tvc-bg: #ffffff;
    --tvc-ink: #0f172a;
    --tvc-muted: #64748b;
    --tvc-line: #e2e8f0;
    --tvc-accent: #2563eb;
    --tvc-go: #16a34a;
    --tvc-stop: #dc2626;
    --tvc-warn: #d97706;

    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px;
    color: var(--tvc-ink);
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
}

.ts-tvc *,
.ts-tvc *::before,
.ts-tvc *::after { box-sizing: inherit; }

/* --- Kopf -------------------------------------------------------------- */

.ts-tvc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ts-tvc-head h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.ts-tvc-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.ts-tvc-picker label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tvc-muted);
}

/* --- Karten ------------------------------------------------------------ */

.ts-tvc-card {
    background: var(--tvc-bg);
    border: 1px solid var(--tvc-line);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

.ts-tvc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ts-tvc-card h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.ts-tvc-card h3 {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tvc-muted);
}

.ts-tvc-card h3:first-of-type { margin-top: 8px; }

/* Regie hervorheben – das ist das Werkzeug am Turniertag. */
.ts-tvc-live {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 60%);
}

.ts-tvc-status {
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--tvc-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ts-tvc-status.is-live {
    background: #dc2626;
    color: #fff;
}

/* --- Regie-Bedienung --------------------------------------------------- */

.ts-tvc-cue-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ts-tvc-modes {
    display: flex;
    gap: 14px;
    font-size: 14px;
}

.ts-tvc-modes label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ts-tvc-cue-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* --- Schaltflächen ----------------------------------------------------- */

.ts-tvc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid var(--tvc-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--tvc-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.ts-tvc-btn:hover { background: #eef2f7; border-color: #cbd5e1; }
.ts-tvc-btn:disabled { opacity: .5; cursor: not-allowed; }

.ts-tvc-btn--go { background: var(--tvc-go); border-color: var(--tvc-go); color: #fff; }
.ts-tvc-btn--go:hover { background: #15803d; border-color: #15803d; }

.ts-tvc-btn--stop { background: var(--tvc-stop); border-color: var(--tvc-stop); color: #fff; }
.ts-tvc-btn--stop:hover { background: #b91c1c; border-color: #b91c1c; }

.ts-tvc-btn--warn { color: var(--tvc-warn); border-color: #fcd34d; background: #fffbeb; }

.ts-tvc-btn--wide { width: 100%; }

/* --- Formularfelder ---------------------------------------------------- */

.ts-tvc input[type="text"],
.ts-tvc input[type="url"],
.ts-tvc input[type="number"],
.ts-tvc select {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--tvc-line);
    border-radius: 8px;
    background: #fff;
    color: var(--tvc-ink);
    font-size: 15px;
    font-family: inherit;
    max-width: 100%;
}

.ts-tvc input[type="color"] {
    width: 100%;
    min-height: 44px;
    padding: 4px;
    border: 1px solid var(--tvc-line);
    border-radius: 8px;
    background: #fff;
}

.ts-tvc-select { flex: 1 1 260px; min-width: 0; }

.ts-tvc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ts-tvc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ts-tvc-field > span {
    font-size: 13px;
    font-weight: 600;
    color: var(--tvc-muted);
}

.ts-tvc-field--wide { grid-column: 1 / -1; }

/* --- Ankreuzfelder ------------------------------------------------------ */

.ts-tvc-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.ts-tvc-check:last-child { border-bottom: 0; }

.ts-tvc-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    flex: 0 0 auto;
    accent-color: var(--tvc-accent);
}

.ts-tvc-check span { display: block; }
.ts-tvc-check strong { display: block; font-weight: 600; }
.ts-tvc-check em {
    display: block;
    font-style: normal;
    font-size: 13px;
    color: var(--tvc-muted);
}

/* --- Bildfolge ---------------------------------------------------------- */

.ts-tvc-scenes { margin-bottom: 12px; }

.ts-tvc-scene {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ts-tvc-scene .ts-tvc-check {
    flex: 1 1 auto;
    border-bottom: 0;
    padding: 6px 0;
}

.ts-tvc-scene-dur {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--tvc-muted);
}

.ts-tvc-scene-dur input { width: 84px; }

/* --- Links & Vorschau --------------------------------------------------- */

.ts-tvc-link { margin-bottom: 14px; }

.ts-tvc-link > label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tvc-muted);
}

.ts-tvc-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ts-tvc-link-row input {
    flex: 1 1 320px;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.ts-tvc-details { margin: 14px 0; }

.ts-tvc-details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}

.ts-tvc-list {
    margin: 6px 0 0 20px;
    padding: 0;
    list-style: disc;
    font-size: 14px;
    color: var(--tvc-muted);
}

.ts-tvc-list code,
.ts-tvc-details code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    font-size: 13px;
}

.ts-tvc-preview { margin-top: 14px; }

.ts-tvc-preview-frame {
    margin-top: 10px;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--tvc-line);
    border-radius: 10px;
    overflow: hidden;
    background: #05070f;
}

.ts-tvc-preview-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* --- Hinweise ----------------------------------------------------------- */

.ts-tvc-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--tvc-muted);
}

.ts-tvc-warn {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 14px;
}

.ts-tvc-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.ts-tvc-notice--ok { background: #ecfdf5; border: 1px solid #86efac; color: #166534; }
.ts-tvc-notice--error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

.ts-tvc-denied {
    max-width: 720px;
    margin: 32px auto;
    padding: 28px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    text-align: center;
    color: #991b1b;
}

.ts-tvc-denied h2 { margin: 0 0 8px; font-size: 20px; }

.ts-tvc-inline-form { margin: 14px 0 0; }

/* --- Speichern ----------------------------------------------------------- */

.ts-tvc-save {
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 40%);
}

.ts-tvc-save .ts-tvc-btn { min-height: 54px; font-size: 17px; }

/* --- Handy --------------------------------------------------------------- */

@media (max-width: 640px) {
    .ts-tvc { padding: 0 12px; }
    .ts-tvc-head h1 { font-size: 22px; }
    .ts-tvc-picker { width: 100%; }
    .ts-tvc-picker select { flex: 1 1 auto; min-width: 0; }
    .ts-tvc-cue-buttons { grid-template-columns: 1fr 1fr; }
    .ts-tvc-scene { flex-wrap: wrap; }
}

/* Dunkle Themes: Karten bleiben lesbar. */
@media (prefers-color-scheme: dark) {
    .ts-tvc {
        --tvc-bg: #111827;
        --tvc-ink: #f1f5f9;
        --tvc-muted: #94a3b8;
        --tvc-line: #334155;
    }
    .ts-tvc-live { background: linear-gradient(180deg, #1e293b 0%, #111827 60%); border-color: #1e40af; }
    .ts-tvc-btn { background: #1e293b; }
    .ts-tvc-btn:hover { background: #273449; }
    .ts-tvc input[type="text"],
    .ts-tvc input[type="url"],
    .ts-tvc input[type="number"],
    .ts-tvc select { background: #0f172a; color: #f1f5f9; }
    .ts-tvc-check { border-bottom-color: #1e293b; }
    .ts-tvc-scene { border-bottom-color: #1e293b; }
    .ts-tvc-save { background: linear-gradient(180deg, rgba(17,24,39,0) 0%, #111827 40%); }
}

/* --- Vorstellungsliste (wer läuft über die Videowall?) ------------------ */

.ts-tvc-roster { border: 1px solid var(--tvc-line); border-radius: 10px; margin-bottom: 10px; }

.ts-tvc-roster > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    font-size: 15px;
}

.ts-tvc-roster-count {
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ts-tvc-roster-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 10px;
}

.ts-tvc-roster-actions .ts-tvc-btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }

.ts-tvc-roster-list {
    margin: 0;
    padding: 0 14px 12px;
    list-style: none;
}

.ts-tvc-roster-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.ts-tvc-roster-list li:last-child { border-bottom: 0; }
.ts-tvc-roster-list .ts-tvc-check { flex: 1 1 auto; border-bottom: 0; min-width: 0; }
.ts-tvc-roster-pos { width: 72px; flex: 0 0 auto; text-align: center; }

@media (prefers-color-scheme: dark) {
    .ts-tvc-roster-count { background: #312e81; color: #c7d2fe; }
    .ts-tvc-roster-list li { border-bottom-color: #1e293b; }
}

/* --- Reihenfolge ziehen -------------------------------------------------- */

.ts-tvc-grip {
    flex: 0 0 auto;
    padding: 4px 6px;
    color: var(--tvc-muted);
    font-size: 18px;
    line-height: 1;
    cursor: grab;
    touch-action: none;          /* sonst scrollt das Tablet statt zu ziehen */
    user-select: none;
}

.ts-tvc-grip:active { cursor: grabbing; }

.ts-tvc-seq {
    flex: 0 0 auto;
    min-width: 26px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tvc-muted);
    font-variant-numeric: tabular-nums;
}

.ts-tvc-movers { flex: 0 0 auto; display: flex; gap: 4px; }

.ts-tvc-move {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--tvc-line);
    border-radius: 6px;
    background: #fff;
    color: var(--tvc-ink);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.ts-tvc-move:hover { background: #eef2f7; }

.ts-tvc-roster > summary { cursor: pointer; }
.ts-tvc-roster-team { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.ts-tvc-sortable.is-sorting { cursor: grabbing; }

[data-sort-item].is-dragging {
    opacity: .85;
    outline: 2px dashed var(--tvc-accent);
    outline-offset: 2px;
    border-radius: 8px;
    background: #eef2ff;
}

.ts-tvc-sortable[data-sortable="teams"] > .ts-tvc-roster { transition: transform .12s ease; }

@media (prefers-color-scheme: dark) {
    .ts-tvc-move { background: #1e293b; }
    [data-sort-item].is-dragging { background: #1e293b; }
}

/* --- Bildregie ----------------------------------------------------------- */

.ts-tvc-program-mode { margin-bottom: 12px; }

.ts-tvc-program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.ts-tvc-prog {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 62px;
    text-align: left;
}

.ts-tvc-prog strong { font-size: 15px; font-weight: 700; }
.ts-tvc-prog small { font-size: 12px; font-weight: 500; color: var(--tvc-muted); }

/* Das Bild, das gerade läuft – wie das rote Licht an der Kamera. */
.ts-tvc-prog.is-onair {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.ts-tvc-prog.is-onair small { color: rgba(255, 255, 255, .85); }

.ts-tvc-prog:disabled { opacity: .45; }

@media (prefers-color-scheme: dark) {
    .ts-tvc-prog.is-onair { background: #b91c1c; border-color: #b91c1c; }
}

/* --- Live-Vorschau -------------------------------------------------------- */

.ts-tvc-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ts-tvc-preview-status {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 13px;
    color: var(--tvc-muted);
}

/* Mindesthöhe, damit der Rahmen auch ohne aspect-ratio sichtbar bleibt. */
.ts-tvc-preview-frame { min-height: 220px; }
.ts-tvc-preview-frame[hidden] { display: none; }

/* --- Datenbank-Update ---------------------------------------------------- */

.ts-tvc-dbupdate {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffbeb 0%, var(--tvc-bg) 60%);
}

.ts-tvc-dbupdate .ts-tvc-status { background: #fef3c7; color: #92400e; }
.ts-tvc-dbupdate .ts-tvc-list { margin-left: 18px; }
.ts-tvc-dbupdate .ts-tvc-list li { margin-bottom: 8px; color: var(--tvc-ink); }

@media (prefers-color-scheme: dark) {
    .ts-tvc-dbupdate { background: linear-gradient(180deg, #292416 0%, var(--tvc-bg) 60%); border-color: #78350f; }
    .ts-tvc-dbupdate .ts-tvc-status { background: #78350f; color: #fde68a; }
}

/* --- Vorschau-Optionen --------------------------------------------------- */

.ts-tvc-preview-opts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-top: 10px;
}

.ts-tvc-check--inline { flex: 1 1 320px; border-bottom: 0; padding: 0; }
.ts-tvc-preview-opts .ts-tvc-field { flex: 0 1 260px; }

/* --- Zustandsanzeige der Regie -------------------------------------------- */

.ts-tvc-onair {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid var(--tvc-line);
    background: #f8fafc;
}

.ts-tvc-onair.is-running { border-color: #fca5a5; background: #fef2f2; }

.ts-tvc-onair-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.ts-tvc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.ts-tvc-onair.is-running .ts-tvc-dot {
    background: #dc2626;
    animation: ts-tvc-blink 1.4s ease-in-out infinite;
}

@keyframes ts-tvc-blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.ts-tvc-onair-mode {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    font-size: 12px;
    font-weight: 600;
    color: var(--tvc-muted);
}

.ts-tvc-onair-now { margin-top: 8px; font-size: 15px; }
.ts-tvc-onair-now span { color: var(--tvc-muted); font-size: 13px; }

/* Fortschritt: eine Marke je Karte, die laufende hervorgehoben. */
.ts-tvc-onair-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.ts-tvc-onair-bar i {
    width: 22px;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
}

.ts-tvc-onair-bar i.is-done { background: #94a3b8; }
.ts-tvc-onair-bar i.is-now { background: #dc2626; width: 34px; }

/* Knöpfe ohne Funktion sind erkennbar aus dem Spiel. */
.ts-tvc-cue-buttons .ts-tvc-btn:disabled { opacity: .4; }

/* Laufende Bildregie-Auswahl bzw. Automatik */
.ts-tvc-btn--wide.is-onair {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* --- Vorschau als <details> ------------------------------------------------ */

details.ts-tvc-preview { margin-top: 14px; }

details.ts-tvc-preview > summary {
    cursor: pointer;
    padding: 10px 0;
    font-weight: 700;
    font-size: 15px;
}

@media (prefers-color-scheme: dark) {
    .ts-tvc-onair { background: #0f172a; }
    .ts-tvc-onair.is-running { background: #2a1414; border-color: #7f1d1d; }
    .ts-tvc-onair-bar i { background: #334155; }
}

.ts-tvc-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, .65);
    font-size: 14px;
}

/* --- Regie-Ansicht: Vorschau und Programm nebeneinander -------------------- */

details.ts-tvc-gallery { margin-top: 14px; }

details.ts-tvc-gallery > summary {
    cursor: pointer;
    padding: 10px 0;
    font-weight: 700;
    font-size: 15px;
}

.ts-tvc-monitors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
}

.ts-tvc-monitor {
    border: 2px solid var(--tvc-line);
    border-radius: 10px;
    overflow: hidden;
    background: #0b1020;
    min-width: 0;
}

/* Signalfarben wie am Bildmischer: Vorschau grün, Programm rot. */
.ts-tvc-monitor--preview { border-color: #16a34a; }
.ts-tvc-monitor--program { border-color: #dc2626; }

.ts-tvc-monitor-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .06);
}

.ts-tvc-tally {
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #fff;
}

.ts-tvc-tally--preview { background: #16a34a; }
.ts-tvc-tally--onair { background: #dc2626; }

.ts-tvc-monitor-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-tvc-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #05070f;
}

.ts-tvc-screen iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ts-tvc-screen-off {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
    text-align: center;
    color: rgba(226, 232, 240, .6);
    font-size: 13px;
}

.ts-tvc-monitor-opts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .04);
}

.ts-tvc-monitor-opts .ts-tvc-select { flex: 1 1 150px; }
.ts-tvc-monitor-opts .ts-tvc-check--inline { flex: 0 1 auto; color: #e2e8f0; }
.ts-tvc-monitor-opts .ts-tvc-check--inline strong { font-size: 13px; }

.ts-tvc-take-form { padding: 0 10px 10px; }

.ts-tvc-take {
    width: 100%;
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    font-weight: 800;
}

.ts-tvc-take:hover { background: #b91c1c; border-color: #b91c1c; }

@media (max-width: 782px) {
    .ts-tvc-monitors { grid-template-columns: 1fr; }
}

/* --- Bildbereiche in der Bildfolge ---------------------------------------- */

.ts-tvc-scene-place {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ts-tvc-scene-place select { min-width: 140px; }
.ts-tvc-scene-place .ts-tvc-check { border-bottom: 0; padding: 0; }

/* --- Ausgänge (Kanäle) ---------------------------------------------------- */

.ts-tvc-outputs { border-color: #bfdbfe; }

.ts-tvc-outputbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ts-tvc-output {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    padding: 9px 14px;
    border: 2px solid var(--tvc-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--tvc-ink);
    text-decoration: none;
}

.ts-tvc-output:hover { background: #eef2f7; }

/* Der gerade bearbeitete Kanal ist deutlich abgesetzt. */
.ts-tvc-output.is-current {
    border-color: var(--tvc-accent);
    background: #eef2ff;
}

.ts-tvc-output strong { font-size: 15px; }
.ts-tvc-output small { font-size: 12px; color: var(--tvc-muted); }
.ts-tvc-output.is-current small { color: #3730a3; }

.ts-tvc-outputforms {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ts-tvc-outputforms form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.ts-tvc-outputforms input[type="text"] { flex: 1 1 200px; min-width: 0; }

@media (prefers-color-scheme: dark) {
    .ts-tvc-output { background: #1e293b; }
    .ts-tvc-output:hover { background: #273449; }
    .ts-tvc-output.is-current { background: #312e81; }
    .ts-tvc-output.is-current small { color: #c7d2fe; }
}

/* --- Regie-Pult: Live-Meldung und Einlaufliste ------------------------------ */
.ts-tvc-live-msg { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #dcfce7; color: #166534; font-weight: 700; }
.ts-tvc-live-msg.is-bad { background: #fee2e2; color: #991b1b; }
.ts-tvc-live { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(127, 127, 127, .25); }
.ts-tvc-live-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ts-tvc-live-head h3 { margin: 0; }
.ts-tvc-live-head h3 small { font-weight: 400; opacity: .7; }
.ts-tvc-live-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.ts-tvc-entry { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ts-tvc-entry li { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(127, 127, 127, .25); background: rgba(127, 127, 127, .06); touch-action: pan-y; }
.ts-tvc-entry li.is-off { opacity: .45; }
.ts-tvc-entry li.is-now { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, .35); }
.ts-tvc-entry li.is-dragging { opacity: .8; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.ts-tvc-entry-name { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; margin: 0; }
.ts-tvc-entry-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-tvc-entry-name em { font-style: normal; font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-tvc-entry-go { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #2563eb; color: #fff; font-size: 15px; cursor: pointer; }
.ts-tvc-entry-go:hover { background: #1d4ed8; }
.ts-tvc-onair-bar i[data-card] { cursor: pointer; }
@media (max-width: 600px) {
    .ts-tvc-entry li { grid-template-columns: auto 1fr auto; }
    .ts-tvc-entry li .ts-tvc-seq, .ts-tvc-entry li .ts-tvc-movers { display: none; }
}
.ts-tvc-entry[hidden], .ts-tvc-live-msg[hidden] { display: none !important; }

/* --- Regie-Pult: Jetzt / Als Nächstes, Schritte, Standzeit --------------------- */
.ts-tvc-now { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; margin: 6px 0 12px; }
.ts-tvc-now-box { padding: 14px 16px; border-radius: 14px; background: #0f172a; color: #e2e8f0; min-height: 96px; display: grid; align-content: start; gap: 3px; }
.ts-tvc-now-box small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.ts-tvc-now-box b { font-size: 22px; line-height: 1.2; color: #fff; }
.ts-tvc-now-box span { font-size: 13px; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.ts-tvc-now.is-running .ts-tvc-now-box.is-now { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.ts-tvc-now.is-running .ts-tvc-now-box.is-now small::before { content: "● "; color: #fecaca; }
.ts-tvc-now-box.is-next { background: #1e293b; }
.ts-tvc-now-box.is-next b { font-size: 18px; }
.ts-tvc-now-bar { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; align-items: center; }
.ts-tvc-now-bar i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); cursor: pointer; }
.ts-tvc-now-bar i.is-done { background: rgba(255, 255, 255, .6); }
.ts-tvc-now-bar i.is-now { background: #fff; width: 28px; }
.ts-tvc-now-bar em { font-style: normal; font-size: 11px; color: #fecaca; margin-left: 4px; }
.ts-tvc-sched { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: #fef3c7; color: #92400e; font-weight: 700; margin: 0 0 12px; }
.ts-tvc-sched[hidden] { display: none !important; }
.ts-tvc-steps { display: grid; gap: 10px; }
.ts-tvc-step { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid rgba(127, 127, 127, .22); background: rgba(127, 127, 127, .04); }
.ts-tvc-step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2563eb; color: #fff; font-weight: 900; }
.ts-tvc-step-h { display: block; font-weight: 800; margin: 3px 0 8px; }
.ts-tvc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.ts-tvc-then, .ts-tvc-unit { font-size: 13px; opacity: .75; }
.ts-tvc-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.ts-tvc-radio input[type="time"] { padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(127, 127, 127, .4); font-size: 15px; }
.ts-tvc-stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(127, 127, 127, .4); border-radius: 10px; overflow: hidden; }
.ts-tvc-stepper button { width: 40px; border: 0; background: rgba(127, 127, 127, .12); font-size: 20px; font-weight: 800; cursor: pointer; }
.ts-tvc-stepper input { width: 64px; border: 0; text-align: center; font-size: 18px; font-weight: 800; -moz-appearance: textfield; }
.ts-tvc-stepper input::-webkit-outer-spin-button, .ts-tvc-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ts-tvc-presets { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ts-tvc-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(127, 127, 127, .35); background: transparent; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.ts-tvc-chip:hover { border-color: #2563eb; color: #2563eb; }
.ts-tvc-dur { font-size: 12.5px; font-weight: 700; color: #2563eb; }
.ts-tvc-hint kbd { display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(127, 127, 127, .4); font-size: 11px; }
@media (max-width: 640px) {
    .ts-tvc-now { grid-template-columns: 1fr; }
    .ts-tvc-step { grid-template-columns: 1fr; }
    .ts-tvc-step-n { display: none; }
}

/* Einstieg in die Vollbild-Regie */
.ts-tvc-regie {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 14px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #111827, #1f2937);
    border: 1px solid #ef4444;
    color: #f8fafc;
    text-decoration: none;
}
.ts-tvc-regie:hover { background: linear-gradient(135deg, #1f2937, #374151); color: #fff; }
.ts-tvc-regie-ico { font-size: 28px; }
.ts-tvc-regie b { display: block; font-size: 16px; }
.ts-tvc-regie small { display: block; color: #cbd5e1; font-size: 13px; }
.ts-tvc-regie > span:last-child { margin-left: auto; font-size: 18px; }

/* --- Orientierung: Veranstaltung, Regie-Karte, Reiter (10/2026) ------------------------------ */
.ts-tvc-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ts-tvc-title h1 { margin: 0; }
.ts-tvc-event { margin: 0; font-size: 14px; color: #475569; }
.ts-tvc-event b { color: #0f172a; }
.ts-tvc .ts-tvc-regie { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff !important; text-decoration: none; box-shadow: 0 10px 30px rgba(30, 58, 138, .25); margin: 0 0 16px; }
.ts-tvc .ts-tvc-regie:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(30, 58, 138, .35); }
.ts-tvc-regie-ico { font-size: 40px; line-height: 1; }
.ts-tvc-regie-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ts-tvc-regie-txt b { font-size: 18px; }
.ts-tvc-regie-txt small { font-size: 13.5px; line-height: 1.45; color: #cbd5e1; }
.ts-tvc-regie-txt em { font-style: normal; font-weight: 700; color: #fff; }
.ts-tvc-regie-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-tvc-regie-steps i { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.ts-tvc-regie-go { font-weight: 800; padding: 10px 16px; border-radius: 12px; background: #22c55e; color: #052e16; white-space: nowrap; }
@media (max-width: 640px) { .ts-tvc .ts-tvc-regie { grid-template-columns: minmax(0, 1fr); } .ts-tvc-regie-ico { display: none; } .ts-tvc-regie-go { justify-self: start; } }
.ts-tvc-tabs { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px; margin: 0 0 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.ts-tvc-tabs[hidden] { display: none; }
.ts-tvc .ts-tvc-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px !important; border-radius: 10px !important; border: 1px solid transparent !important; background: transparent !important; color: #0f172a !important; font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; box-shadow: none !important; min-width: 0; text-transform: none; letter-spacing: 0; }
.ts-tvc .ts-tvc-tabs button small { font-size: 11.5px; font-weight: 500; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-tvc .ts-tvc-tabs button:hover { background: #f1f5f9 !important; }
.ts-tvc .ts-tvc-tabs button.is-on { background: #1e3a8a !important; color: #fff !important; }
.ts-tvc .ts-tvc-tabs button.is-on small { color: #c7d2fe; }
@media (max-width: 900px) { .ts-tvc-tabs { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; } }
@media (max-width: 640px) { .ts-tvc .ts-tvc-tabs button small { display: none; } .ts-tvc-tabs { grid-template-columns: repeat(5, minmax(96px, 1fr)); } }
.ts-tvc [data-tvc-tab][hidden] { display: none !important; }
