@property --nav-compact {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

:root {
    --bg: #c7d1dd;
    --shell: #f6f8fb;
    --panel: #ffffff;
    --line: #cfd8e3;
    --line-strong: #bac7d6;
    --text: #1a2433;
    --muted: #627085;
    --brand: #0f6ee8;
    --brand-soft: #eaf2ff;
    --ok: #1f8f5f;
    --warn: #b46f00;
    --font-ewtn-guadalupe: "EWTN Guadalupe", "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-antonio: "Antonio", "Arial Narrow", "Segoe UI Condensed", "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-ubuntu: "Ubuntu", "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-ubuntu-condensed: "Ubuntu Condensed", "Ubuntu", "Arial Narrow", "Segoe UI Condensed", sans-serif;
}

@font-face {
    font-family: "Antonio";
    src: url("fonts/antonio/Antonio-Variable.ttf") format("truetype");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Ubuntu";
    src: url("fonts/ubuntu/Ubuntu-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Ubuntu";
    src: url("fonts/ubuntu/Ubuntu-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Ubuntu";
    src: url("fonts/ubuntu/Ubuntu-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Ubuntu Condensed";
    src: url("fonts/ubuntu/UbuntuCondensed-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-XLight.otf") format("opentype");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-XLightItalic.otf") format("opentype");
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-LightItalic.otf") format("opentype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-RegularItalic.otf") format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-MediumItalic.otf") format("opentype");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-BoldItalic.otf") format("opentype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-Black.otf") format("opentype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "EWTN Guadalupe";
    src: url("fonts/ewtn-guadalupe/EWTNGuadalupe-BlackItalic.otf") format("opentype");
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

.font-ewtn-guadalupe {
    font-family: var(--font-ewtn-guadalupe);
}

* { box-sizing: border-box; }

/* App scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(98, 112, 133, 0.34) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(98, 112, 133, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(72, 92, 118, 0.46);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

html {
    overflow: hidden;
    height: 100%;
}

/* Prevent light FOUC before body.theme-dark is painted */
html.theme-dark {
    color-scheme: dark;
    background: #111924;
}

body {
    margin: 0;
    padding-top: 10px;
    background:
        radial-gradient(circle at 10% -20%, #e4ebf4 0%, transparent 42%),
        radial-gradient(circle at 100% 0%, #c5d3e5 0%, transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans", "Segoe UI", "Trebuchet MS", sans-serif;
    min-height: 100vh;
    padding-bottom: 38px;
    overflow: hidden;
}

.app {
    width: calc(100% - 20px);
    max-width: 1500px;
    margin: 0 auto 10px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(25, 39, 68, 0.16);
    background: var(--shell);
    height: calc(100vh - 46px);
    display: flex;
    flex-direction: column;
    transition: max-width 0.22s ease;
}

body.app-extended .app {
    max-width: none;
    width: calc(100% - 16px);
}

.app-header,
.app-nav-bar,
.playout-subnav-bar,
.admin-subnav-bar,
.connections-subnav-bar,
.cron-watchdog-subnav-bar,
.youtube-auth-subnav-bar,
.de-control-subnav-bar,
.series-favorites-bar {
    flex-shrink: 0;
}

.app-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #fdfefe 0%, #eff4fa 100%);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    position: relative;
}

.header-maintenance-banner {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: min(520px, 46vw);
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid #9b1c1c;
    background: linear-gradient(180deg, #ff3b30 0%, #c62828 100%);
    color: #fff;
    box-shadow:
        0 0 0 3px rgba(198, 40, 40, 0.22),
        0 8px 18px rgba(198, 40, 40, 0.35);
    animation: header-maintenance-glow 1.2s ease-in-out infinite;
    z-index: 5;
    pointer-events: none;
}

.header-maintenance-banner[hidden] {
    display: none !important;
}

.header-maintenance-banner-text {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.header-maintenance-banner-pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: header-maintenance-dot 1.2s ease-out infinite;
}

@keyframes header-maintenance-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 0 3px rgba(198, 40, 40, 0.22),
            0 8px 18px rgba(198, 40, 40, 0.35);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.04);
        box-shadow:
            0 0 0 6px rgba(198, 40, 40, 0.18),
            0 10px 24px rgba(198, 40, 40, 0.45);
    }
}

@keyframes header-maintenance-dot {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
        opacity: 0.85;
    }
    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        opacity: 1;
    }
}

body.is-maintenance-mode-active .app-header {
    background: linear-gradient(180deg, #fff1f0 0%, #ffd6d3 100%);
    border-bottom-color: #e57373;
}

@media (max-width: 900px) {
    .header-maintenance-banner {
        max-width: min(280px, 42vw);
        padding: 6px 10px;
        gap: 6px;
    }
    .header-maintenance-banner-text {
        font-size: 0.66rem;
        letter-spacing: 0.08em;
    }
}

.app-nav-bar {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    --nav-compact: 0;
    padding: 0 12px;
    border-bottom: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--shell) 88%, #ffffff 12%);
    /* Keep overflow visible so the Menu dropdown is not clipped */
    overflow: visible;
    transition: --nav-compact 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-nav-bar.is-nav-fitting,
.app-nav-bar:not(.is-nav-ready) {
    transition: none !important;
}

.app-nav-bar:not(.is-nav-ready) .app-nav-link {
    visibility: hidden;
}

/* Horizontal scroll for nav links only — Menu stays outside this scroller */
.app-nav-scroll {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.app-nav-scroll::-webkit-scrollbar {
    height: 0;
    display: none;
}

.app-nav-bar.is-nav-reorder .app-nav-indicator {
    display: none;
}

.app-nav-bar.is-nav-reorder {
    user-select: none;
}

.app-nav-scroll.is-reorder-mode .app-nav-link {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.app-nav-link.is-jiggle {
    animation: series-fav-jiggle 0.16s ease-in-out infinite;
}

.app-nav-link.is-jiggle:nth-child(2n) {
    animation-duration: 0.18s;
    animation-delay: -0.04s;
}

.app-nav-link.is-jiggle:nth-child(3n) {
    animation-duration: 0.14s;
    animation-delay: -0.08s;
}

.app-nav-link.is-dragging {
    opacity: 0.28;
    animation: none;
    cursor: grabbing;
}

.app-nav-drag-ghost {
    position: fixed;
    z-index: 420;
    pointer-events: none;
    margin: 0;
    border: none;
    border-bottom: 2px solid var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 78%, transparent);
    color: var(--brand);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    padding: 10px 14px 9px;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 29, 48, 0.22);
    transform: scale(1.06);
}

body.theme-dark .app-nav-drag-ghost {
    color: #93c5fd;
    border-bottom-color: #3b82f6;
    background: color-mix(in srgb, var(--brand) 28%, transparent);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

/* Sliding active underline (main + sub nav bars) */
.app-nav-bar > .app-nav-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--brand, #2a6df0);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.18s ease;
}

.app-nav-bar > .app-nav-indicator.is-visible {
    opacity: 1;
}

.app-nav-bar > .app-nav-indicator.is-snapping {
    transition: none;
}

.app-nav-bar .app-nav-link.is-active {
    /* Underline is drawn by .app-nav-indicator */
    border-bottom-color: transparent;
}

.app-nav-menu-wrap {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    border-right: 1px solid var(--line-strong);
    margin-right: 2px;
}

.app-nav-menu-wrap::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.app-nav-menu-wrap:has(.main-menu.open)::before {
    opacity: 1;
    pointer-events: auto;
}

.app-nav-link-menu.is-open {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 65%, transparent);
}

.app-nav-menu-wrap .main-menu {
    top: calc(100% + 6px);
    left: 0;
    z-index: 120;
    min-width: 232px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 72%, var(--brand) 28%);
    background:
        linear-gradient(180deg, color-mix(in srgb, #ffffff 96%, var(--brand-soft) 4%) 0%, var(--panel) 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.55) inset,
        0 10px 15px -8px rgba(15, 23, 42, 0.12),
        0 24px 40px -12px rgba(15, 23, 42, 0.22);
    transform-origin: top left;
    visibility: hidden;
    filter: blur(6px);
    transition:
        opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.2s ease,
        visibility 0s linear 0.24s;
}

.app-nav-menu-wrap .main-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: inherit;
    border-top: 1px solid color-mix(in srgb, var(--line-strong) 72%, var(--brand) 28%);
    border-left: 1px solid color-mix(in srgb, var(--line-strong) 72%, var(--brand) 28%);
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(15, 23, 42, 0.04);
}

.app-nav-menu-wrap .main-menu.open {
    visibility: visible;
    filter: blur(0);
    transition:
        opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.2s ease,
        visibility 0s linear 0s;
}

.app-nav-menu-wrap .main-menu.open .main-menu-section {
    animation: mainMenuSectionIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-nav-menu-wrap .main-menu.open .main-menu-section:nth-child(2) {
    animation-delay: 0.04s;
}

.app-nav-menu-wrap .main-menu.open .main-menu-section:nth-child(3) {
    animation-delay: 0.08s;
}

@keyframes mainMenuSectionIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG flags — Windows/Edge has no emoji flag glyphs (shows "DE"/"ES" instead). */
.country-flag {
    display: inline-block;
    width: 1.15em;
    height: 0.86em;
    vertical-align: -0.1em;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.country-flag-de {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Crect width='5' height='1' y='0' fill='%23000'/%3E%3Crect width='5' height='1' y='1' fill='%23D00'/%3E%3Crect width='5' height='1' y='2' fill='%23FFCE00'/%3E%3C/svg%3E");
}

.country-flag-es {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23c60b1e'/%3E%3Crect width='3' height='1' y='0.5' fill='%23ffc400'/%3E%3C/svg%3E");
}

.app-nav-link {
    appearance: none;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: calc(0.4em - (var(--nav-compact, 0) * 0.16em));
    font: inherit;
    font-size: calc(0.72rem - (var(--nav-compact, 0) * 0.06rem));
    font-weight: 700;
    font-stretch: calc(100% - (var(--nav-compact, 0) * 28%));
    letter-spacing: calc(0.08em - (var(--nav-compact, 0) * 0.055em));
    line-height: 1;
    margin: 0;
    padding: 10px calc(14px - (var(--nav-compact, 0) * 8px)) 9px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.app-nav-link-menu,
.app-subnav-spacer-label {
    gap: 0.4em;
    font-size: 0.72rem;
    font-stretch: 100%;
    letter-spacing: 0.08em;
    padding: 10px 14px 9px;
    font-family: inherit;
    font-weight: 700;
}

.app-nav-bar.is-nav-narrow .app-nav-link:not(.app-nav-link-menu) {
    font-family: "Arial Narrow", "Segoe UI Condensed", "IBM Plex Sans Condensed", "IBM Plex Sans", "Segoe UI", sans-serif;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
    color: var(--text);
    background: color-mix(in srgb, var(--brand-soft) 55%, transparent);
    outline: none;
}

.app-nav-link:focus-visible {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent);
}

.app-nav-link.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft) 70%, transparent);
    cursor: default;
}

body.theme-dark .app-nav-link.is-active {
    color: #93c5fd;
    border-bottom-color: #3b82f6;
    background: color-mix(in srgb, var(--brand) 22%, transparent);
}

body.theme-dark .app-nav-bar .app-nav-link.is-active {
    border-bottom-color: transparent;
}

body.theme-dark .app-nav-bar > .app-nav-indicator {
    background: #3b82f6;
}

body.theme-dark .app-nav-bar {
    background: color-mix(in srgb, var(--shell) 92%, #0f172a 8%);
}

body.theme-dark .app-nav-menu-wrap::before {
    background: rgba(2, 8, 18, 0.42);
}

body.theme-dark .app-nav-menu-wrap .main-menu {
    background:
        linear-gradient(180deg, color-mix(in srgb, #24384d 92%, #ffffff 8%) 0%, #1f3044 100%);
    border-color: #4a6583;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 16px 36px -10px rgba(0, 0, 0, 0.55);
}

body.theme-dark .app-nav-menu-wrap .main-menu::before {
    border-color: #4a6583;
}

body.theme-dark .app-nav-link {
    color: color-mix(in srgb, var(--muted) 85%, #ffffff 15%);
}

body.theme-dark .app-nav-link:hover,
body.theme-dark .app-nav-link:focus-visible {
    color: var(--text);
    background: color-mix(in srgb, var(--brand) 18%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .app-nav-menu-wrap::before,
    .app-nav-menu-wrap .main-menu,
    .app-nav-menu-wrap .main-menu.open .main-menu-section {
        animation: none !important;
        transition: none !important;
        filter: none !important;
    }

    .app-nav-bar,
    .app-nav-bar > .app-nav-indicator,
    #episodeDialogTabs > .episode-dialog-tab-indicator {
        transition: none;
    }
}


.dashboard-home-btn {
    margin-right: 10px;
}

.dashboard-view {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px 24px 28px;
}

.dashboard-intro {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-welcome {
    margin: 0;
    font-family: var(--font-ewtn-guadalupe);
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.dashboard-subline {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-widget.dashboard-widget-on-air {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    gap: 3px;
    padding: 8px 14px;
}

.dashboard-widget-on-air .dashboard-on-air-subline,
.dashboard-widget-on-air .dashboard-next-subline {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

body.dashboard-widget-edit-mode .dashboard-widget-on-air {
    cursor: default;
    outline: none;
}

.dashboard-on-air-subline {
    color: var(--text);
}

.dashboard-on-air-label {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c62828;
}

body.theme-dark .dashboard-on-air-label {
    color: #ff8a80;
}

#dashboardOnAirTitle,
.dashboard-on-air-title-btn {
    font-weight: 600;
    color: var(--text);
}

.dashboard-on-air-title-btn,
.dashboard-next-title-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    line-height: inherit;
    text-align: left;
    color: inherit;
    cursor: default;
    border-radius: 3px;
}

.dashboard-on-air-title-btn.is-clickable,
.dashboard-next-title-btn.is-clickable {
    cursor: pointer;
}

.dashboard-on-air-title-btn.is-clickable:hover,
.dashboard-next-title-btn.is-clickable:hover {
    text-decoration: underline;
}

.dashboard-on-air-title-btn.is-clickable:focus-visible,
.dashboard-next-title-btn.is-clickable:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.dashboard-on-air-title-btn.is-loading,
.dashboard-next-title-btn.is-loading {
    cursor: wait;
    opacity: 0.7;
}

.dashboard-next-subline {
    margin-top: 2px;
    color: var(--muted);
}

.dashboard-next-label {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

#dashboardNextTitle {
    font-weight: 600;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(336px, 100%), 1fr));
    gap: 14px;
    align-items: stretch;
}


.dashboard-widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(20, 34, 56, 0.08);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    height: auto;
}

.dashboard-widget[hidden] {
    display: none !important;
}

.dashboard-widget-urgent-info {
    border-width: 2px;
    gap: 12px;
}

.dashboard-widget-urgent-info.is-critical {
    border-color: #dc2626;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.14);
}

.dashboard-widget-urgent-info.is-warning {
    border-color: #ca8a04;
    box-shadow: 0 10px 24px rgba(202, 138, 4, 0.14);
}

.dashboard-widget-urgent-info.is-info {
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
}

.dashboard-widget-urgent-info.is-maintenance {
    border-color: #16a34a;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.14);
}

.dashboard-urgent-info-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--ink);
    white-space: normal;
}

.dashboard-urgent-info-msg + .dashboard-urgent-info-msg {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

body.dashboard-widget-edit-mode .dashboard-widget-urgent-info {
    opacity: 1;
    cursor: default;
}

.info-widget-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

.info-widget-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.info-widget-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.info-widget-table th,
.info-widget-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.info-widget-table th {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--panel) 88%, #94a3b8 12%);
}

.info-widget-table tr:last-child td {
    border-bottom: 0;
}

.info-widget-input,
.info-widget-select,
.info-widget-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 8px 10px;
    font: inherit;
}

.info-widget-textarea {
    min-height: 64px;
    resize: vertical;
}

body.theme-dark .info-widget-input,
body.theme-dark .info-widget-select,
body.theme-dark .info-widget-textarea {
    background: #1f2937;
    border-color: #334155;
    color: #e2e8f0;
}

.info-widget-remove-btn {
    white-space: nowrap;
}

.info-widget-hint {
    margin: 10px 0 0;
}

.info-widget-hint code {
    font-size: 0.85em;
}

#infoWidgetStatus.is-error {
    color: #b91c1c;
}

.dashboard-widget-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--line);
}

.dashboard-widget-eyebrow {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-widget-title {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: 0.01em;
}

.dashboard-widget-notepad {
    min-height: 0;
}

.dashboard-notepad-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
}

.dashboard-notepad-tabs {
    display: flex;
    gap: 4px;
    min-width: 0;
}

.dashboard-notepad-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 5px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: color-mix(in srgb, var(--shell) 70%, transparent);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.dashboard-notepad-tab-label {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-notepad-tab.is-active {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.dashboard-notepad-tab-rename {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.dashboard-notepad-input {
    width: 100%;
    min-height: 148px;
    height: 100%;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--shell) 55%, #fff 45%);
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.dashboard-notepad-input:focus {
    border-color: color-mix(in srgb, var(--accent, #4b78b4) 55%, var(--line));
    box-shadow: 0 0 0 3px rgba(75, 120, 180, 0.16);
}

.dashboard-notepad-input::placeholder {
    color: var(--muted);
}

.dashboard-notepad-status {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-notepad-status.is-error {
    color: #b91c1c;
}

body.theme-dark .dashboard-notepad-input {
    background: color-mix(in srgb, var(--panel) 82%, #000 18%);
}

body.theme-dark .dashboard-notepad-tab {
    background: color-mix(in srgb, var(--panel) 70%, #000 30%);
}

body.theme-dark .dashboard-notepad-tab.is-active {
    background: color-mix(in srgb, var(--panel) 92%, #fff 8%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

body.theme-dark .dashboard-notepad-status.is-error {
    color: #fca5a5;
}

body.dashboard-widget-edit-mode .dashboard-notepad-input,
body.dashboard-widget-edit-mode .dashboard-notepad-tabs {
    pointer-events: none;
}

.dashboard-widget-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid #b7c8de;
    background: #f7fbff;
    color: #3d5878;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

body.theme-dark .dashboard-widget-head {
    border-bottom-color: #3f5875;
}

body.theme-dark .dashboard-widget-tag {
    border-color: #4b6482;
    background: #24384d;
    color: #c8daf0;
}


.dashboard-widgets-editbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #8eb2df;
    border-radius: 10px;
    background: #eef5ff;
}

.dashboard-widgets-editbar[hidden] {
    display: none !important;
}

.dashboard-widgets-editbar-text {
    margin: 0;
    font-size: 0.82rem;
    color: #27466f;
}

.dashboard-widgets-editbar-actions {
    display: flex;
    gap: 8px;
}

.dashboard-widget-edit-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
}

.dashboard-widget-edit-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-widget-settings-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.dashboard-widget-settings-btn:hover,
.dashboard-widget-settings-btn:focus-visible {
    color: var(--text);
    border-color: var(--brand);
}

body.theme-dark .dashboard-widget-settings-btn {
    background: #22354b;
    border-color: #425c79;
    color: #b8c9dc;
}

.dashboard-widget-clock {
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    container-type: inline-size;
    container-name: dashboard-clock;
}

.dashboard-clock-settings-panel {
    margin-bottom: 12px;
    padding: 14px 14px 12px;
    border: 1px solid #d5e1ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
    box-shadow: 0 8px 22px rgba(20, 34, 56, 0.06);
    display: grid;
    gap: 14px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-clock-settings-panel[hidden] {
    display: none !important;
}

body:not(.dashboard-widget-edit-mode) .dashboard-clock-settings-panel {
    display: none !important;
}

.dashboard-clock-settings-head {
    display: grid;
    gap: 4px;
}

.dashboard-clock-settings-head-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
}

.dashboard-clock-settings-head-hint {
    margin: 0;
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.35;
}

.dashboard-clock-settings-section,
.dashboard-clock-settings-row {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.dashboard-clock-settings-row[hidden] {
    display: none !important;
}

.dashboard-clock-settings-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-clock-mode-switch {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px;
    gap: 2px;
    border: 1px solid #d5e1ef;
    border-radius: 11px;
    background: #eef3f9;
}

.dashboard-clock-mode-btn {
    position: relative;
    margin: 0;
}

.dashboard-clock-mode-btn input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dashboard-clock-mode-btn span {
    display: block;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    user-select: none;
}

.dashboard-clock-mode-btn input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.dashboard-clock-mode-btn input:checked + span {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.dashboard-clock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    min-width: 0;
}

.dashboard-clock-toggle-compact {
    gap: 8px;
}

.dashboard-clock-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dashboard-clock-toggle-ui {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #c8d4e3;
    transition: background-color 0.18s ease;
}

.dashboard-clock-toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease;
}

.dashboard-clock-toggle input:checked + .dashboard-clock-toggle-ui {
    background: #3b82f6;
}

.dashboard-clock-toggle input:checked + .dashboard-clock-toggle-ui::after {
    transform: translateX(18px);
}

.dashboard-clock-toggle input:disabled + .dashboard-clock-toggle-ui {
    opacity: 0.45;
}

.dashboard-clock-toggle-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
}

.dashboard-clock-toggle-compact .dashboard-clock-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-clock-color-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.dashboard-clock-color-input-wrap {
    flex: 0 0 auto;
    display: inline-flex;
    padding: 3px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #ffffff;
}

.dashboard-clock-color-field input[type="color"] {
    width: 2.35rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    background: transparent;
    box-shadow: none;
}

.dashboard-clock-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.dashboard-clock-extra-grid[hidden] {
    display: none !important;
}

.dashboard-clock-extra-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    transition: opacity 0.18s ease, border-color 0.18s ease;
}

.dashboard-clock-extra-card.is-off {
    opacity: 0.62;
}

.dashboard-clock-extra-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.dashboard-clock-extra-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #475569;
}

.dashboard-clock-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.dashboard-clock-field > span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-clock-field select,
.dashboard-clock-field input[type="text"] {
    width: 100%;
    min-width: 0;
    border: 1px solid #d5e1ef;
    border-radius: 9px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.84rem;
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-clock-field select:focus-visible,
.dashboard-clock-field input[type="text"]:focus-visible {
    outline: none;
    border-color: #93b4df;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.dashboard-clock-field select:disabled,
.dashboard-clock-field input[type="text"]:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

body.theme-dark .dashboard-clock-settings-panel {
    border-color: #334155;
    background: linear-gradient(180deg, #1a2738 0%, #152030 100%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

body.theme-dark .dashboard-clock-mode-switch {
    border-color: #334155;
    background: #0f172a;
}

body.theme-dark .dashboard-clock-mode-btn span {
    color: #94a3b8;
}

body.theme-dark .dashboard-clock-mode-btn input:checked + span {
    background: #243449;
    color: #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

body.theme-dark .dashboard-clock-toggle-ui {
    background: #475569;
}

body.theme-dark .dashboard-clock-toggle input:checked + .dashboard-clock-toggle-ui {
    background: #60a5fa;
}

body.theme-dark .dashboard-clock-color-input-wrap {
    border-color: #334155;
    background: #1e293b;
}

body.theme-dark .dashboard-clock-extra-card {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.72);
}

body.theme-dark .dashboard-clock-extra-card-title {
    color: #cbd5e1;
}

body.theme-dark .dashboard-clock-field select,
body.theme-dark .dashboard-clock-field input[type="text"] {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .dashboard-clock-field select:disabled,
body.theme-dark .dashboard-clock-field input[type="text"]:disabled {
    background: #0f172a;
    color: #64748b;
}

@media (max-width: 720px) {
    .dashboard-clock-extra-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-clock-body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.dashboard-clock-body.is-analog {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
}

.dashboard-clock-analog-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    container-type: size;
}

.dashboard-widget-clock .dashboard-clock-analog-wrap {
    min-height: 200px;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-widget-clock .dashboard-clock-broadcast {
    min-width: 0;
    max-width: 100%;
}

.dashboard-clock-broadcast {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    color: var(--dashboard-clock-color, #ff0000);
    --clock-dot-dim: var(--dashboard-clock-dot-dim, rgba(255, 0, 0, 0.18));
}

@supports (width: 1cqh) {
    .dashboard-clock-broadcast {
        width: min(100cqw, 100cqh);
        height: min(100cqw, 100cqh);
    }
}

.dashboard-clock-broadcast-bg {
    fill: transparent;
    stroke: none;
}

.dashboard-clock-hour-dot,
.dashboard-clock-second-dot.is-lit,
.dashboard-clock-matrix-dot {
    fill: currentColor;
}

.dashboard-clock-second-dot {
    fill: var(--clock-dot-dim);
    opacity: 0.85;
}

.dashboard-clock-matrix-time {
    filter: drop-shadow(0 0 0.4px var(--dashboard-clock-color, #ff0000));
}

.dashboard-clock-body.is-digital {
    width: 100%;
    align-items: stretch;
    justify-content: center;
}

.dashboard-clock-digital-stack {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.dashboard-clock-digital-divider {
    width: 100%;
    height: 1px;
    margin: 12px 0 10px;
    background: var(--line);
    flex-shrink: 0;
}

.dashboard-clock-digital-lower {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
}

.dashboard-clock-digital-lower .dashboard-clock-digital-wrap.is-secondary {
    flex: 1 1 0;
    min-width: 0;
}

.dashboard-clock-digital-divider.is-inner {
    width: 1px;
    height: auto;
    min-height: 2.4em;
    margin: 0 8px;
    align-self: stretch;
    opacity: 0.85;
}

.dashboard-clock-digital-wrap {
    width: 100%;
    min-width: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.dashboard-clock-digital-time {
    width: 100%;
    box-sizing: border-box;
    font-family: "Courier New", Courier, monospace;
    font-size: clamp(1.25rem, calc(100cqw / 5), 4.75rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: var(--dashboard-clock-color, #ff0000);
    text-shadow: 0 0 10px var(--dashboard-clock-glow, rgba(255, 0, 0, 0.22));
    line-height: 1.05;
    white-space: nowrap;
}

.dashboard-clock-body.is-digital.has-seconds .dashboard-clock-digital-wrap:not(.is-secondary) .dashboard-clock-digital-time {
    font-size: clamp(1.1rem, calc(100cqw / 7.5), 4.25rem);
    letter-spacing: 0.03em;
}

.dashboard-clock-digital-date {
    width: 100%;
    margin-top: 6px;
    font-size: clamp(0.72rem, 3.2cqw, 0.9rem);
    color: var(--muted);
    letter-spacing: 0.04em;
}

.dashboard-clock-digital-tz {
    width: 100%;
    margin-top: 2px;
    font-size: clamp(0.58rem, 2.6cqw, 0.72rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-clock-body.is-digital .dashboard-clock-digital-wrap.is-secondary .dashboard-clock-digital-time {
    font-size: clamp(0.625rem, calc(100cqw / 10), 2.375rem);
    letter-spacing: 0.05em;
}

.dashboard-clock-digital-wrap.is-secondary .dashboard-clock-digital-tz {
    margin-top: 4px;
}

body.theme-dark .dashboard-clock-digital-time {
    color: var(--dashboard-clock-color, #ffffff);
    text-shadow: 0 0 8px var(--dashboard-clock-glow, rgba(255, 255, 255, 0.35));
}

.dashboard-widget-drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 0.95rem;
    user-select: none;
}

.dashboard-widget-visibility-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-widget-visibility-btn::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.dashboard-widget-visibility-btn.is-visible {
    background: #d7f5e3;
    border-color: #45c48a;
    color: #18884f;
    box-shadow: inset 0 0 0 1px rgba(69, 196, 138, 0.28);
}

.dashboard-widget-visibility-btn.is-hidden {
    background: #fde4e4;
    border-color: #e57373;
    color: #b42318;
    box-shadow: inset 0 0 0 1px rgba(229, 115, 115, 0.28);
}

.dashboard-widget-visibility-btn:hover {
    transform: scale(1.04);
}

body.theme-dark .dashboard-widget-visibility-btn.is-visible {
    background: #1f4a35;
    border-color: #45c48a;
    color: #8ef0b8;
}

body.theme-dark .dashboard-widget-visibility-btn.is-hidden {
    background: #4a2323;
    border-color: #e57373;
    color: #ffb4b4;
}

body.dashboard-widget-edit-mode .dashboard-widget {
    cursor: grab;
    outline: 2px dashed rgba(75, 120, 180, 0.35);
    outline-offset: 2px;
}

body.dashboard-widget-edit-mode .dashboard-widget.is-widget-hidden-preview {
    opacity: 0.45;
}

body.dashboard-widget-edit-mode .dashboard-widget.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

body.dashboard-widget-edit-mode .dashboard-widget.is-drop-target {
    outline-color: #4b78b4;
    box-shadow: 0 0 0 3px rgba(75, 120, 180, 0.18);
}

body.dashboard-widget-edit-mode .dashboard-widget-action,
body.dashboard-widget-edit-mode .dashboard-widget-action * {
    pointer-events: none;
}

.header-widgets-btn.is-active,
body.dashboard-widget-edit-mode .header-widgets-btn {
    border-color: #4b78b4;
    box-shadow: 0 0 0 2px rgba(75, 120, 180, 0.22);
}

.header-widgets-btn.is-active:hover,
.header-widgets-btn.is-active:focus-visible,
body.dashboard-widget-edit-mode .header-widgets-btn:hover,
body.dashboard-widget-edit-mode .header-widgets-btn:focus-visible {
    transform: translateY(-1px) scale(1.05);
    border-color: #4b78b4;
    background: #e3efff;
    color: #143252;
    box-shadow:
        0 0 0 1px rgba(75, 120, 180, 0.5),
        0 0 16px rgba(74, 144, 226, 0.52),
        0 0 28px rgba(74, 144, 226, 0.24),
        0 4px 12px rgba(42, 95, 158, 0.2);
}


body.theme-dark.is-maintenance-mode-active .app-header {
    background: linear-gradient(180deg, #4a1515 0%, #2c1010 100%);
    border-bottom-color: #c62828;
}

body.theme-dark .header-maintenance-banner {
    border-color: #ff8a80;
    background: linear-gradient(180deg, #ff5252 0%, #b71c1c 100%);
}

body.theme-dark .header-widgets-btn.is-active:hover,
body.theme-dark .header-widgets-btn.is-active:focus-visible,
body.theme-dark.dashboard-widget-edit-mode .header-widgets-btn:hover,
body.theme-dark.dashboard-widget-edit-mode .header-widgets-btn:focus-visible {
    border-color: #6ba8e8;
    background: #2f4d6d;
    color: #f4f9ff;
    box-shadow:
        0 0 0 1px rgba(107, 168, 232, 0.5),
        0 0 18px rgba(91, 156, 245, 0.58),
        0 0 32px rgba(91, 156, 245, 0.3),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

body.theme-dark .dashboard-widgets-editbar {
    background: #24384d;
    border-color: #4b6482;
}

body.theme-dark .dashboard-widgets-editbar-text {
    color: #dbe8f8;
}

.dashboard-widget-action {
    align-self: stretch;
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

.header-widgets-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.header-intercom-ptt-btn,
.header-intercom-openmic-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.header-intercom-ptt-btn[hidden],
.header-intercom-openmic-btn[hidden] {
    display: none !important;
}

.header-intercom-ptt-btn:disabled,
.header-intercom-openmic-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.header-intercom-ptt-btn.is-live {
    background: #b91c1c;
    border-color: #991b1b;
    color: #fff;
}

.header-intercom-openmic-btn.is-live {
    background: #c2410c;
    border-color: #9a3412;
    color: #fff;
}

.header-intercom-ptt-icon {
    display: block;
    pointer-events: none;
}

.header-widgets-icon {
    display: block;
}

.dashboard-widgets-dialog {
    width: min(420px, 96vw);
}

.dashboard-widgets-hint {
    margin: 0 0 12px;
}

.dashboard-widgets-editor {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-widgets-editor-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px 12px;
}

.dashboard-widgets-editor-row.is-dragging {
    opacity: 0.45;
}

.dashboard-widgets-editor-row.is-drop-target {
    border-color: #4b78b4;
    box-shadow: 0 0 0 2px rgba(75, 120, 180, 0.18);
}

.dashboard-widgets-drag {
    cursor: grab;
    color: var(--muted);
    font-size: 0.9rem;
    user-select: none;
    line-height: 1;
}

.dashboard-widgets-editor-label {
    flex: 1 1 auto;
    font-size: 0.86rem;
    font-weight: 600;
}

.dashboard-widgets-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.dashboard-widgets-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
}

body.theme-dark .dashboard-widget-tv .dashboard-tv-body::after {
    background: linear-gradient(to bottom, transparent, #1e3044);
}

body.theme-dark .dashboard-widget {
    background: #1e3044;
    border-color: #3f5875;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.theme-dark .dashboard-widgets-editor-row {
    background: #24384d;
    border-color: #3f5875;
}

body.theme-dark .header-widgets-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

.dashboard-tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(20, 34, 56, 0.08);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-tile-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-tile-badge {
    border: 1px solid #b7c8de;
    background: #f7fbff;
    color: #1e2f46;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.dashboard-tile-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.dashboard-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px 12px;
}

.dashboard-stat dt {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-stat dd {
    margin: 4px 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.dashboard-tile-action {
    align-self: flex-start;
    margin-top: 2px;
}

.dashboard-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-detail-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px 12px;
}

.dashboard-detail-note {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

.dashboard-detail-heading {
    margin: 0 0 8px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-detail-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text);
}

.dashboard-detail-list li span {
    color: var(--muted);
}

.dashboard-detail-list li strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}


.dashboard-widget .dashboard-detail-list {
    flex: 1 1 auto;
    min-height: 0;
}
.dashboard-widget-tv {
    overflow: hidden;
    min-height: 0;
}

.dashboard-widget-tv .dashboard-tv-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0 -14px -12px;
    padding: 0 14px 0;
}

.dashboard-widget-tv .dashboard-tv-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.75rem;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--panel));
    opacity: 1;
    transition: opacity 0.22s ease;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.dashboard-widget-tv.is-tv-at-bottom .dashboard-tv-body::after,
.dashboard-widget-tv.is-tv-not-overflowing .dashboard-tv-body::after {
    opacity: 0;
}
.dashboard-widget-tv.dashboard-widget-tv-compact {
    height: auto;
    align-self: start;
    min-height: 0;
}

.dashboard-widget-tv.dashboard-widget-tv-compact .dashboard-tv-body {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-widget-tv.dashboard-widget-tv-compact .dashboard-tv-scroll {
    flex: 1 1 auto;
    --dashboard-tv-row-height: 3.35rem;
    --dashboard-tv-visible-rows: 2.75;
    min-height: calc(var(--dashboard-tv-row-height) * var(--dashboard-tv-visible-rows));
    max-height: calc(var(--dashboard-tv-row-height) * var(--dashboard-tv-visible-rows));
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: -12px;
    padding-bottom: 12px;
}

.dashboard-widget-tv.dashboard-widget-tv-compact .dashboard-tv-body::after {
    height: 3.5rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--panel) 72%);
}

body.theme-dark .dashboard-widget-tv.dashboard-widget-tv-compact .dashboard-tv-body::after {
    background: linear-gradient(to bottom, rgba(30, 48, 68, 0), #1e3044 72%);
}

.dashboard-tv-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-right: 2px;
}

.dashboard-tv-scroll::-webkit-scrollbar {
    width: 6px;
}

.dashboard-tv-scroll::-webkit-scrollbar-thumb {
    background: rgba(120, 136, 156, 0.45);
    border-radius: 999px;
}

.dashboard-tv-scroll.is-resetting,
.dashboard-tv-scroll.is-advancing {
    scroll-behavior: smooth;
}

@keyframes dashboard-tv-item-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-tv-item.is-new {
    animation: dashboard-tv-item-in 0.45s ease;
}

.dashboard-tv-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.dashboard-tv-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.dashboard-tv-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-widget-scheduling-todo {
    min-height: 0;
}

/* Match sibling compact TV widgets even with few/empty todo rows. */
.dashboard-widget-scheduling-todo.dashboard-widget-tv-compact .dashboard-tv-scroll {
    min-height: calc(var(--dashboard-tv-row-height) * var(--dashboard-tv-visible-rows));
}

.dashboard-widget-scheduling-todo .dashboard-scheduling-todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-scheduling-todo-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.86rem;
    line-height: 1.25;
    min-width: 0;
}

.dashboard-scheduling-todo-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-scheduling-todo-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    min-width: 0;
}

.dashboard-scheduling-todo-when {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-scheduling-todo-date,
.dashboard-scheduling-todo-time {
    font-weight: 700;
    color: var(--text);
}

.dashboard-scheduling-todo-sep {
    color: var(--muted);
    font-weight: 500;
}

.dashboard-scheduling-todo-issue {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
}

.dashboard-scheduling-todo-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: baseline;
}

.dashboard-scheduling-todo-media {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dashboard-scheduling-todo-media-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: inherit;
    border-radius: 4px;
}

.dashboard-scheduling-todo-media-btn:hover .dashboard-scheduling-todo-media,
.dashboard-scheduling-todo-media-btn:focus-visible .dashboard-scheduling-todo-media {
    color: #1d4ed8;
    text-decoration: underline;
}

.dashboard-scheduling-todo-media-btn:hover .dashboard-scheduling-todo-open-icon,
.dashboard-scheduling-todo-media-btn:focus-visible .dashboard-scheduling-todo-open-icon {
    color: #1d4ed8;
    opacity: 1;
}

.dashboard-scheduling-todo-media-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.dashboard-scheduling-todo-open-icon {
    flex: 0 0 auto;
    color: var(--muted);
    opacity: 0.85;
}

body.theme-dark .dashboard-scheduling-todo-media-btn:hover .dashboard-scheduling-todo-media,
body.theme-dark .dashboard-scheduling-todo-media-btn:focus-visible .dashboard-scheduling-todo-media,
body.theme-dark .dashboard-scheduling-todo-media-btn:hover .dashboard-scheduling-todo-open-icon,
body.theme-dark .dashboard-scheduling-todo-media-btn:focus-visible .dashboard-scheduling-todo-open-icon {
    color: #93c5fd;
}

.dashboard-scheduling-todo-item.is-noprogram .dashboard-scheduling-todo-badge {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard-scheduling-todo-item.is-nofile .dashboard-scheduling-todo-badge {
    background: #ffedd5;
    color: #9a3412;
}

.dashboard-scheduling-todo-name {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-weight: 500;
    font-size: 0.82rem;
    opacity: 0.92;
}

.dashboard-scheduling-todo-empty {
    padding: 4px 0 2px;
    color: var(--muted);
    font-size: 0.88rem;
}

body.theme-dark .dashboard-scheduling-todo-item {
    border-bottom-color: #334155;
}

body.theme-dark .dashboard-scheduling-todo-item.is-noprogram .dashboard-scheduling-todo-badge {
    background: #7f1d1d;
    color: #fecaca;
}

body.theme-dark .dashboard-scheduling-todo-item.is-nofile .dashboard-scheduling-todo-badge {
    background: #7c2d12;
    color: #fed7aa;
}

.dashboard-widget-my-shift-schedule.dashboard-widget-tv-compact .dashboard-tv-scroll {
    min-height: calc(var(--dashboard-tv-row-height) * var(--dashboard-tv-visible-rows));
}

.dashboard-widget-my-shift-schedule .dashboard-my-shift-schedule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-my-shift-schedule-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.86rem;
    line-height: 1.25;
    min-width: 0;
}

.dashboard-my-shift-schedule-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-my-shift-schedule-item.is-openable {
    cursor: pointer;
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
    margin-left: -4px;
    margin-right: -4px;
}

.dashboard-my-shift-schedule-item.is-openable:hover,
.dashboard-my-shift-schedule-item.is-openable:focus-visible {
    background: color-mix(in srgb, var(--text) 6%, transparent);
}

.dashboard-my-shift-schedule-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    min-width: 0;
}

.dashboard-my-shift-schedule-when {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-my-shift-schedule-date,
.dashboard-my-shift-schedule-time {
    font-weight: 600;
}

.dashboard-my-shift-schedule-sep {
    color: var(--muted);
    opacity: 0.7;
}

.dashboard-my-shift-schedule-dest {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.dashboard-my-shift-schedule-name {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-weight: 500;
    font-size: 0.82rem;
    opacity: 0.92;
}

.dashboard-my-shift-schedule-empty {
    padding: 4px 0 2px;
    color: var(--muted);
    font-size: 0.88rem;
}

body.theme-dark .dashboard-my-shift-schedule-item {
    border-bottom-color: #334155;
}

body.theme-dark .dashboard-my-shift-schedule-dest {
    background: #334155;
    color: #e2e8f0;
}

.dashboard-tv-time-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 52px;
}

.dashboard-tv-time {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    white-space: nowrap;
}

.dashboard-tv-day {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.1;
}

.dashboard-tv-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dashboard-tv-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.dashboard-tv-badge {
    display: inline-block;
    flex: 0 0 auto;
    margin: 2px 0 0;
    align-self: flex-start;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #fff;
    line-height: 1.35;
    vertical-align: middle;
}

.dashboard-tv-badge-live {
    background: #c62828;
}

.dashboard-tv-badge-neu {
    background: #1565c0;
}

.dashboard-tv-title-text {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    word-break: break-word;
}


.dashboard-tv-desc {
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--muted);
    font-style: italic;
}

body.theme-dark .dashboard-tv-item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dashboard-proxy-active {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 6px;
}

.dashboard-proxy-active[hidden] {
    display: none !important;
}

.dashboard-proxy-active-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-proxy-active-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.dashboard-proxy-active-status {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand);
}

.dashboard-proxy-active-episode {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-proxy-active-message {
    font-size: 0.74rem;
    line-height: 1.35;
    min-height: 1.35em;
}

.dashboard-proxy-active-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-proxy-progress-bar {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    background: #e6edf5;
    overflow: hidden;
}

.dashboard-proxy-progress-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand);
    transition: width 0.35s ease;
}

.dashboard-proxy-active-progress > strong {
    flex: 0 0 auto;
    font-size: 0.82rem;
    min-width: 2.5rem;
    text-align: right;
}

body.theme-dark .dashboard-proxy-progress-bar {
    background: #2a3340;
}

.dashboard-widget-epg-ftp .dashboard-epg-ftp-jobs {
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    align-content: start;
}

.dashboard-widget-epg-ftp .dashboard-epg-ftp-job {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.dashboard-widget-epg-ftp .dashboard-epg-ftp-job + .dashboard-epg-ftp-job {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.dashboard-detail-empty {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

body.theme-dark .dashboard-detail-section {
    background: #24384d;
    border-color: #3f5875;
}


.mam-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mam-app[hidden] {
    display: none !important;
}

body.view-dashboard .header-all-assets-btn {
    display: none;
}

body.view-mam .header-widgets-btn,
body.view-mam #dashboardWidgetsMobileBtn {
    display: none !important;
}

body.theme-dark .dashboard-tile {
    background: #1e3044;
    border-color: #3f5875;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.theme-dark .dashboard-tile-badge {
    border-color: #4b6482;
    background: #24384d;
    color: #e6eef8;
}

body.theme-dark .dashboard-stat {
    background: #24384d;
    border-color: #3f5875;
}

.app-title {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    line-height: 22px;
    min-height: 22px;
}

.app-title-logo {
    height: 22px;
    width: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    align-self: center;
}

.app-title-logo.logo-for-dark,
.login-logo.logo-for-dark,
.maintenance-overlay-brand .logo-for-dark {
    display: none;
}

body.theme-dark .app-title-logo.logo-for-light,
body.theme-dark .login-logo.logo-for-light,
body.theme-dark .maintenance-overlay-brand .logo-for-light {
    display: none;
}

body.theme-dark .app-title-logo.logo-for-dark,
body.theme-dark .login-logo.logo-for-dark {
    display: block;
}

body.theme-dark .maintenance-overlay-brand .logo-for-dark {
    display: inline-block;
}

.app-title-sep {
    display: inline-block;
    width: 1px;
    height: 28px;
    margin: 0;
    padding: 0;
    background: var(--muted);
    opacity: 0.55;
    align-self: center;
    flex-shrink: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
    vertical-align: middle;
}

.app-title-view {
    font-weight: 400;
    line-height: 22px;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    align-self: center;
    transform: translateY(1px);
}

.app-title-view .country-flag {
    width: 1.05em;
    height: 0.78em;
}

.dashboard-widget-eyebrow .country-flag,
.maintenance-admin-title .country-flag,
.admin-user-page-option-text .country-flag,
.admin-user-side-lead .country-flag {
    margin-left: 0.15em;
}

.header-left > div:has(.app-title) {
    display: flex;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.main-menu-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}


.main-menu-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.main-menu-section[hidden] {
    display: none !important;
}



.main-menu .btn.main-menu-placeholder,
.main-menu .btn.main-menu-placeholder:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.theme-dark .main-menu-divider {
    background: #3f5875;
}

.main-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 190px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(20, 34, 56, 0.18);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.main-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.main-menu .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    text-align: left;
}

.main-menu .btn:hover {
    background: color-mix(in srgb, var(--brand-soft) 72%, #ffffff 28%);
    border-color: color-mix(in srgb, var(--brand) 22%, var(--line) 78%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.main-menu .btn.primary {
    font-weight: 700;
}

.main-menu .btn.primary:hover {
    background: #0b56b6;
    border-color: #0b56b6;
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(11, 86, 182, 0.85);
}


.main-menu .btn:active {
    transform: scale(0.985);
}

.main-menu .btn.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.7);
}

body.theme-dark .main-menu .btn.is-active {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #0f172a;
}

.main-menu-divider {
    height: 1px;
    margin: 4px 6px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.header-logo {
    height: 24px;
    width: auto;
    display: block;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-only {
    display: none;
}

.theme-lamp-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
}

.header-live-preview-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-live-preview-icon {
    display: block;
}

.live-preview-float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 320px;
    max-width: calc(100vw - 32px);
    z-index: 180;
    display: none;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.45);
    background: #000;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.live-preview-float.open {
    display: block;
}

.live-preview-float.is-de-control-docked {
    box-shadow: none;
    border-radius: 10px;
    max-width: none;
    z-index: 90;
    overflow: hidden;
}

.live-preview-float.is-de-control-docked .live-preview-stage {
    height: 100%;
}

.live-preview-float.is-de-control-docked .live-preview-player {
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
}

.live-preview-float.is-de-control-docked .live-preview-resize-handle {
    display: none;
}

.live-preview-float.is-dragging .live-preview-stage {
    cursor: grabbing;
}

.live-preview-stage {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
}
.live-preview-close,
.live-preview-source-wrap,
.live-preview-volume-stack,
.live-preview-fullscreen-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.live-preview-stage:hover .live-preview-close,
.live-preview-stage:hover .live-preview-source-wrap,
.live-preview-stage:hover .live-preview-volume-stack,
.live-preview-stage:hover .live-preview-fullscreen-btn,
.live-preview-stage:focus-within .live-preview-close,
.live-preview-stage:focus-within .live-preview-source-wrap,
.live-preview-stage:focus-within .live-preview-volume-stack,
.live-preview-stage:focus-within .live-preview-fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

.live-preview-float.is-dragging .live-preview-close,
.live-preview-float.is-dragging .live-preview-source-wrap,
.live-preview-float.is-dragging .live-preview-volume-stack,
.live-preview-float.is-dragging .live-preview-fullscreen-btn {
    opacity: 0;
    pointer-events: none;
}

@media (hover: none) {
    .live-preview-close,
    .live-preview-source-wrap,
    .live-preview-volume-stack,
    .live-preview-fullscreen-btn {
        opacity: 0.52;
        pointer-events: auto;
        transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .live-preview-volume-stack {
        opacity: 0.34;
    }

    .live-preview-volume-panel {
        background: linear-gradient(180deg, rgba(18, 22, 30, 0.22), rgba(8, 10, 14, 0.32));
        border-color: rgba(255, 255, 255, 0.05);
        box-shadow: none;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .live-preview-volume-track-bg {
        background:
            linear-gradient(to top,
                rgba(91, 155, 213, 0.1) 0%,
                rgba(91, 155, 213, 0.04) 35%,
                rgba(255, 255, 255, 0.02) 100%),
            rgba(18, 21, 28, 0.28);
        border-color: rgba(255, 255, 255, 0.04);
        box-shadow: none;
    }

    .live-preview-volume-track-bg::after {
        background: rgba(100, 165, 255, 0.28);
        box-shadow: none;
    }

    .live-preview-mute-btn {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .live-preview-source-bar,
    .live-preview-source-menu-btn {
        background: rgba(0, 0, 0, 0.26);
    }

    .live-preview-close {
        background: rgba(0, 0, 0, 0.26);
    }

    .live-preview-fullscreen-btn {
        background: linear-gradient(180deg, rgba(18, 22, 30, 0.22), rgba(8, 10, 14, 0.32));
        border-color: rgba(255, 255, 255, 0.05);
        box-shadow: none;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .live-preview-volume-stack:focus-within,
    .live-preview-volume-stack:active,
    .live-preview-fullscreen-btn:active,
    .live-preview-close:active,
    .live-preview-source-wrap:active,
    .live-preview-source-menu-btn:active {
        opacity: 0.82;
    }

    .live-preview-volume-stack:focus-within .live-preview-volume-panel {
        background: linear-gradient(180deg, rgba(18, 22, 30, 0.42), rgba(8, 10, 14, 0.52));
    }
}

.live-preview-source-wrap {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    max-width: calc(100% - 44px);
}

.live-preview-source-bar {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    max-width: 100%;
    padding: 2px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    overflow: hidden;
}

.live-preview-source-wrap.is-menu-mode .live-preview-source-bar {
    display: none;
}

.live-preview-source-menu {
    position: relative;
    display: inline-flex;
}

.live-preview-source-menu[hidden] {
    display: none !important;
}

.live-preview-source-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.live-preview-source-menu-btn:hover,
.live-preview-source-menu-btn.is-open {
    color: #fff;
    background: rgba(91, 155, 213, 0.88);
}

.live-preview-source-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    display: none;
    min-width: 168px;
    max-width: min(240px, calc(100vw - 32px));
    max-height: min(280px, 50vh);
    overflow: auto;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(18, 22, 30, 0.96), rgba(8, 10, 14, 0.98));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.live-preview-source-dropdown.open {
    display: block;
}

.live-preview-source-menu-item {
    display: block;
    width: 100%;
    border: none;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: left;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    cursor: pointer;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-preview-source-menu-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.live-preview-source-menu-item.active {
    color: #fff;
    background: rgba(91, 155, 213, 0.88);
}

.live-preview-source-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
    cursor: pointer;
    line-height: 1.2;
}

.live-preview-source-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.live-preview-source-btn.active {
    color: #fff;
    background: rgba(91, 155, 213, 0.88);
}
.live-preview-settings-panel {
    min-height: 0;
    overflow: auto;
}

.live-preview-settings-streams {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-preview-settings-row {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) minmax(180px, 2fr) auto auto;
    gap: 12px;
    align-items: end;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
    transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.live-preview-settings-row.is-dragging {
    opacity: 0.7;
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
}

.live-preview-settings-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 44px;
    color: var(--muted);
    cursor: grab;
    border-radius: 10px;
    align-self: end;
    user-select: none;
    touch-action: none;
}

.live-preview-settings-drag-handle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--shell) 40%, #ffffff);
}

.live-preview-settings-drag-handle:active {
    cursor: grabbing;
}

.live-preview-settings-field {
    margin: 0;
    min-width: 0;
}

.live-preview-settings-field input {
    width: 100%;
}


.live-preview-settings-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
}

.live-preview-settings-remove-btn {
    min-width: 44px;
    height: 44px;
    padding: 0;
    line-height: 1;
    align-self: end;
}

.live-preview-settings-linco {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 56px;
    margin: 0;
}

.live-preview-settings-linco label {
    text-align: center;
}

.live-preview-settings-linco input {
    width: 18px;
    height: 18px;
    margin: 13px 0 0;
    accent-color: #6d5ae6;
    cursor: pointer;
}

.live-preview-settings-linco:has(input:checked) label {
    color: #6d5ae6;
}

.live-preview-settings-actions {
    margin-top: 0;
}

.live-preview-settings-footer {
    margin-top: 0;
}

body.theme-dark .live-preview-settings-row {
    background: #1e3044;
    border-color: #3f5875;
}

body.theme-dark .live-preview-settings-drag-handle {
    color: rgba(255, 255, 255, 0.38);
}

body.theme-dark .live-preview-settings-drag-handle:hover {
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .live-preview-settings-row.is-dragging {
    opacity: 0.75;
    border-color: color-mix(in srgb, var(--brand) 40%, #3f5875);
}

@media (max-width: 720px) {
    .live-preview-settings-row {
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas:
            "drag title linco remove"
            "drag url linco remove";
    }
    .live-preview-settings-drag-handle { grid-area: drag; align-self: center; }
    .live-preview-settings-field:has(.live-preview-settings-title) { grid-area: title; }
    .live-preview-settings-field:has(.live-preview-settings-url) { grid-area: url; }
    .live-preview-settings-linco { grid-area: linco; align-self: center; }
    .live-preview-settings-remove-btn { grid-area: remove; align-self: center; }
}

.live-preview-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.live-preview-close:hover {
    background: rgba(0, 0, 0, 0.78);
}

.live-preview-flash {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}

.live-preview-flash.show {
    opacity: 1;
}

.live-preview-flash-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.live-preview-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    z-index: 4;
    cursor: nwse-resize;
    border-bottom-right-radius: 10px;
    background: linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.55) 45% 100%);
}

.live-preview-player {
    width: 100%;
    display: block;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    vertical-align: top;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.live-preview-stage.loading .live-preview-player {
    opacity: 0;
}
.live-preview-volume-stack {
    position: absolute;
    right: 8px;
    top: calc(6px + 28px + 6px);
    bottom: calc(8px + 38px + 6px);
    left: auto;
    z-index: 3;
    height: auto;
    min-height: 0;
    max-height: none;
    pointer-events: auto;
}

.live-preview-volume-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 7px 7px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(18, 22, 30, 0.72), rgba(8, 10, 14, 0.88));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.live-preview-volume-track-wrap {
    position: relative;
    flex: 1 1 auto;
    width: 14px;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.live-preview-volume-track-bg {
    position: absolute;
    inset: 0;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(to top,
            rgba(91, 155, 213, 0.22) 0%,
            rgba(91, 155, 213, 0.08) 35%,
            rgba(255, 255, 255, 0.03) 100%),
        #12151c;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.live-preview-volume-track-bg::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 35%;
    height: 1px;
    background: rgba(100, 165, 255, 0.55);
    box-shadow: 0 0 3px rgba(100, 165, 255, 0.35);
    pointer-events: none;
}

.live-preview-control-btn {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.live-preview-control-btn:hover {
    background: rgba(20, 28, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
}

.live-preview-control-btn:active {
    transform: scale(0.96);
}

.live-preview-mute-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.live-preview-mute-btn:hover {
    background: rgba(91, 155, 213, 0.18);
    border-color: rgba(91, 155, 213, 0.45);
    color: #fff;
}

.live-preview-mute-btn.is-muted {
    color: #f07070;
    background: rgba(224, 72, 72, 0.12);
    border-color: rgba(224, 72, 72, 0.35);
}

.live-preview-mute-icon {
    display: block;
}

.live-preview-mute-icon-off {
    display: none;
}

.live-preview-mute-btn.is-muted .live-preview-mute-icon-on {
    display: none;
}

.live-preview-mute-btn.is-muted .live-preview-mute-icon-off {
    display: block;
}

.live-preview-fullscreen-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(18, 22, 30, 0.72), rgba(8, 10, 14, 0.88));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: auto;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.live-preview-fullscreen-btn:hover {
    background: linear-gradient(180deg, rgba(28, 36, 48, 0.88), rgba(12, 16, 22, 0.94));
    border-color: rgba(91, 155, 213, 0.45);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.live-preview-fullscreen-btn:active {
    transform: scale(0.96);
}

.live-preview-fullscreen-btn.is-active {
    background: linear-gradient(180deg, rgba(24, 44, 68, 0.9), rgba(10, 18, 28, 0.94));
    border-color: rgba(91, 155, 213, 0.55);
    color: #dbeafe;
}

.live-preview-fs-icon {
    display: block;
}

.live-preview-fs-icon-exit {
    display: none;
}

.live-preview-fullscreen-btn.is-active .live-preview-fs-icon-enter {
    display: none;
}

.live-preview-fullscreen-btn.is-active .live-preview-fs-icon-exit {
    display: block;
}

.live-preview-stage:fullscreen .live-preview-fullscreen-btn,
.live-preview-stage:-webkit-full-screen .live-preview-fullscreen-btn {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
}

.live-preview-volume {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 14px;
    min-height: 0;
    margin: 0;
    padding: 8px 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: vertical-lr;
    direction: rtl;
}

.live-preview-volume:focus {
    outline: none;
}

.live-preview-volume:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.95), 0 2px 8px rgba(0, 0, 0, 0.45);
}

.live-preview-volume::-webkit-slider-runnable-track {
    width: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: none;
}

.live-preview-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    margin-left: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    background: linear-gradient(180deg, #ffffff, #dbeafe);
    box-shadow: 0 0 0 1px rgba(91, 155, 213, 0.85), 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: grab;
}

.live-preview-volume:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.08);
}

.live-preview-volume::-moz-range-track {
    width: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: none;
}

.live-preview-volume::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    background: linear-gradient(180deg, #ffffff, #dbeafe);
    box-shadow: 0 0 0 1px rgba(91, 155, 213, 0.85), 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: grab;
}

.live-preview-stage:fullscreen,
.live-preview-stage:-webkit-full-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: #000;
}

.live-preview-stage:fullscreen .live-preview-player,
.live-preview-stage:-webkit-full-screen .live-preview-player {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
}

.live-preview-stage:fullscreen .live-preview-volume-stack,
.live-preview-stage:-webkit-full-screen .live-preview-volume-stack {
    right: 16px;
    left: auto;
    top: calc(6px + 28px + 8px);
    bottom: calc(16px + 42px + 8px);
    height: auto;
    max-height: none;
}

.live-preview-float.is-fullscreen {
    z-index: 10000;
}

.live-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.94);
    pointer-events: none;
}

.live-preview-stage.loading .live-preview-loading {
    display: flex;
}

.live-preview-loading-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: #5b9bd5;
    border-right-color: rgba(91, 155, 213, 0.55);
    animation: live-preview-spin 0.85s linear infinite;
    box-sizing: border-box;
}

.live-preview-loading-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    user-select: none;
}

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

.header-fullscreen-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.header-extend-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.header-extend-btn.is-active {
    background: #cfe0f5;
    border-color: #6ea8e6;
    color: #0b56b6;
    box-shadow: 0 0 0 1px rgba(110, 168, 230, 0.28);
}

.header-reload-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.main-menu-btn,
.theme-lamp-btn,
.header-widgets-btn,
.header-intercom-ptt-btn,
.header-intercom-openmic-btn,
.header-all-assets-btn,
.header-live-preview-btn,
.header-fullscreen-btn,
.header-extend-btn,
.header-reload-btn {
    transition:
        transform 0.22s ease,
        box-shadow 0.28s ease,
        border-color 0.22s ease,
        background-color 0.22s ease,
        color 0.22s ease;
    will-change: transform, box-shadow;
}

.main-menu-btn:hover,
.theme-lamp-btn:hover,
.header-widgets-btn:hover,
.header-intercom-ptt-btn:hover:not(:disabled):not(.is-live),
.header-intercom-openmic-btn:hover:not(:disabled):not(.is-live),
.header-all-assets-btn:hover,
.header-live-preview-btn:hover,
.header-fullscreen-btn:hover,
.header-extend-btn:hover,
.header-reload-btn:hover,
.main-menu-btn:focus-visible,
.theme-lamp-btn:focus-visible,
.header-widgets-btn:focus-visible,
.header-intercom-ptt-btn:focus-visible:not(:disabled):not(.is-live),
.header-intercom-openmic-btn:focus-visible:not(:disabled):not(.is-live),
.header-all-assets-btn:focus-visible,
.header-live-preview-btn:focus-visible,
.header-fullscreen-btn:focus-visible,
.header-extend-btn:focus-visible,
.header-reload-btn:focus-visible {
    transform: translateY(-1px) scale(1.05);
    border-color: #6ea8e6;
    background: #eef6ff;
    color: #143252;
    box-shadow:
        0 0 0 1px rgba(110, 168, 230, 0.42),
        0 0 16px rgba(74, 144, 226, 0.48),
        0 0 28px rgba(74, 144, 226, 0.22),
        0 4px 12px rgba(42, 95, 158, 0.18);
}

.main-menu-btn:active,
.theme-lamp-btn:active,
.header-widgets-btn:active,
.header-all-assets-btn:active,
.header-live-preview-btn:active,
.header-fullscreen-btn:active,
.header-extend-btn:active,
.header-reload-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 0 0 1px rgba(110, 168, 230, 0.3),
        0 0 10px rgba(74, 144, 226, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .main-menu-btn,
    .theme-lamp-btn,
    .header-widgets-btn,
    .header-all-assets-btn,
    .header-live-preview-btn,
    .header-fullscreen-btn,
    .header-extend-btn,
    .header-reload-btn {
        transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    }

    .main-menu-btn:hover,
    .theme-lamp-btn:hover,
    .header-all-assets-btn:hover,
    .header-widgets-btn:hover,
    .header-live-preview-btn:hover,
    .header-fullscreen-btn:hover,
    .header-extend-btn:hover,
    .header-reload-btn:hover,
    .main-menu-btn:focus-visible,
    .theme-lamp-btn:focus-visible,
    .header-widgets-btn:focus-visible,
    .header-live-preview-btn:focus-visible,
    .header-fullscreen-btn:focus-visible,
    .header-extend-btn:focus-visible,
    .header-reload-btn:focus-visible {
        transform: none;
    }
}

.header-clock {
    font-family: var(--font-ewtn-guadalupe);
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 72px;
    text-align: right;
}

.header-datetime-display {
    font-family: var(--font-ewtn-guadalupe);
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0;
    font-kerning: none;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
}

.header-datetime-digit {
    display: inline-block;
    width: 1ch;
    text-align: center;
    font-kerning: none;
}

.header-datetime-sep {
    flex-shrink: 0;
}

.header-datetime-pipe {
    padding: 0 0.65em;
}

.app-sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--ok);
    display: inline-block;
    margin-right: 6px;
}

.toolbar {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: #f3f7fc;
}

.btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 10px;
    cursor: default;
    text-transform: uppercase;
}

button {
    text-transform: uppercase;
}

.btn.danger {
    background: #a11d1d;
    border-color: #7c1414;
    color: #fff;
}

.btn.danger:hover {
    background: #bb2424;
    border-color: #8b1717;
}

.delete-confirm-dialog {
    border: 4px solid #d72626 !important;
    box-shadow: 0 0 0 0 rgba(215, 38, 38, 0.55), 0 14px 34px rgba(22, 35, 58, 0.28);
    animation: deletePulse 1.6s ease-in-out infinite;
}

.delete-confirm-line {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.delete-confirm-check {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d72626;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
}

.delete-confirm-check:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid #d72626;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

@keyframes deletePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(215, 38, 38, 0.58), 0 14px 34px rgba(22, 35, 58, 0.28);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(215, 38, 38, 0), 0 14px 34px rgba(22, 35, 58, 0.28);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(215, 38, 38, 0), 0 14px 34px rgba(22, 35, 58, 0.28);
    }
}

.btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.series-favorites-bar[hidden] {
    display: none !important;
}

.series-favorites-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--line-strong);
    background: #f4f7fb;
    flex-wrap: wrap;
}

.series-favorites-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5d78;
    white-space: nowrap;
}

.series-favorites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.series-fav-btn {
    border: 1px solid #b8c7da;
    background: #fff;
    color: #1f3552;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1.2;
}

.series-fav-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.series-favorites-list.is-reorder-mode .series-fav-btn {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.series-fav-btn.is-jiggle {
    animation: series-fav-jiggle 0.16s ease-in-out infinite;
}

.series-fav-btn.is-jiggle:nth-child(2n) {
    animation-duration: 0.18s;
    animation-delay: -0.04s;
}

.series-fav-btn.is-jiggle:nth-child(3n) {
    animation-duration: 0.14s;
    animation-delay: -0.08s;
}

.series-fav-btn.is-dragging {
    opacity: 0.28;
    animation: none;
    cursor: grabbing;
}

.series-fav-drag-ghost {
    position: fixed;
    z-index: 420;
    pointer-events: none;
    margin: 0;
    border: 1px solid #b8c7da;
    background: #fff;
    color: #1f3552;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
    box-shadow: 0 10px 24px rgba(15, 29, 48, 0.22);
    transform: scale(1.08);
}

.series-fav-drag-ghost.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

@keyframes series-fav-jiggle {
    0% { transform: rotate(-1.4deg) translateY(0); }
    50% { transform: rotate(1.4deg) translateY(-1px); }
    100% { transform: rotate(-1.4deg) translateY(0); }
}

.series-fav-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.series-context-menu {
    min-width: 180px;
    padding: 8px;
}

.series-context-menu .series-context-own-name-label {
    margin-top: 8px;
    margin-bottom: 6px;
    text-transform: none;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.series-context-menu #seriesContextOwnNameWrap[hidden] {
    display: none !important;
}

.series-context-menu .categories-context-input {
    width: 100%;
    margin-bottom: 0;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(250px, 0.95fr) minmax(280px, 1.05fr) minmax(0, 2.2fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    background: #d3dce8;
    align-items: stretch;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.panel-series { grid-column: 1; grid-row: 1; min-height: 0; max-height: 100%; }
.panel-meta { grid-column: 2; grid-row: 1; min-height: 0; max-height: 100%; }
.panel-episodes { grid-column: 3; grid-row: 1; min-height: 0; max-height: 100%; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-head {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    background: #f9fbfe;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.panel-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #32445e;
}

.active-serie-head-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.serie-fav-heart[hidden] {
    display: none !important;
}

.serie-fav-heart {
    border: 0;
    background: transparent;
    padding: 1px;
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.serie-fav-heart:hover .serie-fav-heart-icon {
    animation: serie-fav-heart-pulse 1.1s ease-in-out infinite;
}

.serie-fav-heart:hover .serie-fav-heart-shape {
    stroke: #e53935;
}

@keyframes serie-fav-heart-pulse {
    0%, 100% { transform: scale(1); }
    16% { transform: scale(1.16); }
    32% { transform: scale(1); }
    48% { transform: scale(1.1); }
    64% { transform: scale(1); }
}

.serie-fav-heart .serie-fav-heart-icon {
    transform-origin: center;
}

.serie-fav-heart .serie-fav-heart-shape {
    fill: none;
    stroke: #c94c4c;
    stroke-width: 1.75;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.serie-fav-heart.is-active .serie-fav-heart-shape {
    fill: #e53935;
    stroke: #e53935;
}

.count-chip {
    font-size: 0.72rem;
    color: #0f7a2b;
    border: 1px solid #bdd1ef;
    background: var(--brand-soft);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    text-shadow: none;
}

.mini-editable {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    border: 1px solid transparent;
    vertical-align: middle;
}

.mini-editable.on {
    color: #0f7a2b;
    background: #e9f7ef;
    border-color: #9bd6b0;
}

.mini-editable.off {
    color: #a31f1f;
    background: #fdeeee;
    border-color: #efb2b2;
}

.panel-body {
    padding: 10px;
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.panel-series .panel-body,
.panel-episodes .panel-body {
    display: flex;
    flex-direction: column;
}
.panel-episodes .panel-body {
    overflow: hidden;
}

.panel-episodes .field-inline {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    overflow: visible;
    display: flex;
    flex-wrap: nowrap;
    align-items: end;
    gap: 6px;
    margin-bottom: 10px;
}

.panel-episodes .field-inline .field {
    flex: 1 1 0;
    min-width: 0;
}

.panel-episodes .field-inline .field input {
    width: 100%;
}

.panel-episodes .field-inline > .btn,
.panel-episodes .field-inline > .menu-wrap {
    flex: 0 0 auto;
}

.panel-episodes .field-inline #addEpisodeBtn,
.panel-episodes .field-inline #episodeSortToggleBtn,
.panel-episodes .field-inline #episodeArchiveToggleBtn {
    white-space: nowrap;
    padding: 0 10px;
}

.panel-episodes .field-inline #episodeSortToggleBtn[hidden] {
    display: none !important;
}

.panel-episodes .field-inline #episodeArchiveToggleBtn.is-active {
    background: #eaf4ff;
    border-color: #8fb3df;
    color: #1c4f8f;
}

.panel-episodes .menu-wrap {
    position: relative;
    overflow: visible;
}

.panel-episodes .episode-add-menu {
    top: calc(100% + 6px);
    bottom: auto;
    z-index: 200;
}

.panel-episodes .episode-add-menu.is-fixed {
    position: fixed;
    z-index: 10000;
}

.panel-episodes .table-wrap {
    position: relative;
    z-index: 1;
    min-height: 0;
}

.panel-series .series-filter-row {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    overflow: visible;
}

.panel-series .menu-wrap {
    position: relative;
    overflow: visible;
}

.panel-series .series-sort-menu {
    z-index: 200;
}

.panel-series .series-sort-menu.is-fixed {
    position: fixed;
    z-index: 10000;
}


.field {
    display: grid;
    gap: 5px;
    margin-bottom: 10px;
}

label {
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.89rem;
    outline: none;
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 110, 232, 0.12);
}

.series-list {
.series-list.is-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

.series-list-loading {
    margin: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}


    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    flex: 1;
    padding: 3px 5px;
}

.series-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e6edf6;
    background-color: #fff;
    color: inherit;
    text-align: left;
    padding: 9px 10px;
    cursor: pointer;
    position: relative;
    text-transform: none;
}

.series-item:last-child { border-bottom: 0; }
.series-item:hover { background-color: #f3f8ff; }
.series-item.active {
    background-color: #e7f0ff;
}

.series-list .series-item.active {
    position: sticky;
    top: 3px;
    bottom: 3px;
    z-index: 8;
    background-color: #e7f0ff;
    box-shadow: 0 3px 10px rgba(26, 36, 51, 0.12);
}

.series-prefix {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}


.series-episode-count--empty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.series-no-episodes-icon {
    color: #e0b020;
    flex-shrink: 0;
}

body.theme-dark .series-no-episodes-icon {
    color: #f2c94c;
}

.series-episode-count {
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
}

.series-name {
    font-size: 0.86rem;
    line-height: 1.35;
    font-weight: 400;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.kv {
    border: 1px solid var(--line);
    background: #fbfdff;
    border-radius: 8px;
    padding: 7px 8px;
}

.kv .k {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.kv .v {
    font-size: 0.82rem;
    line-height: 1.3;
    word-break: break-word;
    white-space: pre-wrap;
}

.editable-meta {
    cursor: text;
}

.editable-meta.editing {
    cursor: default;
}

.editable-meta.editing .editable-meta-value {
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.editable-meta-input,
.editable-meta-textarea,
.editable-meta-user-select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 5px 8px;
    font-size: 0.82rem;
    line-height: 1.3;
    outline: none;
    height: 32px;
}

.editable-meta-textarea {
    min-height: 192px;
    height: auto;
    resize: vertical;
}

.editable-meta-user-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 14px) calc(50% - 1px),
        calc(100% - 9px) calc(50% - 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.editable-meta-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.meta-action-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
}

.meta-action-btn-save {
    color: #15803d;
    border-color: #86efac;
    background: #f0fdf4;
}

.meta-action-btn-save:hover {
    background: #dcfce7;
    border-color: #4ade80;
}

.meta-action-btn-cancel {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

.meta-action-btn-cancel:hover {
    background: #fee2e2;
    border-color: #f87171;
}

body.theme-dark .meta-action-btn-save {
    color: #86efac;
    border-color: #166534;
    background: #052e16;
}

body.theme-dark .meta-action-btn-save:hover {
    background: #14532d;
    border-color: #22c55e;
}

body.theme-dark .meta-action-btn-cancel {
    color: #fca5a5;
    border-color: #991b1b;
    background: #450a0a;
}

body.theme-dark .meta-action-btn-cancel:hover {
    background: #7f1d1d;
    border-color: #ef4444;
}

.editable-meta-actions .btn {
    height: 26px;
    padding: 0 10px;
    cursor: pointer;
}

.meta-expand-btn {
    margin-left: auto;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
    background: #fff;
    min-height: 0;
    max-height: none;
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

th, td {
    padding: 8px 9px;
    border-bottom: 1px solid #e8eef6;
    text-align: left;
    vertical-align: top;
    font-size: 0.81rem;
}

th {
    position: sticky;
    top: 0;
    background: #f3f7fc;
    z-index: 1;
    color: #3a4d68;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}

tr:hover td { background: #f8fbff; }
.episode-row { cursor: pointer; }
.episode-list-media-id-cell {
    white-space: nowrap;
}

.episode-list-duration-cell,
.episode-list-duration-col {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.episode-list-duration-cell {
    color: #4a5f78;
    font-size: 0.92em;
}

.episode-list-playout-cell,
.episode-list-playout-col {
    white-space: nowrap;
    text-align: left;
    width: 1%;
}

.episode-list-playout-cell {
    padding-left: 8px;
}

.episode-playout-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.1;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.episode-playout-badge-fixed {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #93c5fd;
}

.episode-playout-badge-infinity {
    color: #a16207;
    background: #fef3c7;
    border-color: #fcd34d;
}

body.theme-dark .episode-list-duration-cell {
    color: #9db0c6;
}

body.theme-dark .episode-playout-badge-fixed {
    color: #93c5fd;
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.theme-dark .episode-playout-badge-infinity {
    color: #fbbf24;
    background: #3f2e12;
    border-color: #d97706;
}

.episode-list-episode-no-stack,
.categories-episode-no-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 24px;
}

.episode-list-episode-no-main,
.categories-episode-no-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.episode-youtube-feed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cc0000;
    line-height: 0;
    flex-shrink: 0;
}

.episode-youtube-feed-icon-svg {
    display: block;
}

body.theme-dark .episode-youtube-feed-icon {
    color: #ff4444;
}

.episode-list-episode-no-cell {
    white-space: nowrap;
    vertical-align: top;
    text-align: center;
}
.recurring-platform-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.recurring-platform-badge-tv {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #93c5fd;
}

.recurring-platform-badge-yt {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fca5a5;
}

.recurring-platform-badge-both {
    color: #15803d;
    background: #dcfce7;
    border-color: #86efac;
}

body.theme-dark .recurring-platform-badge-tv {
    color: #93c5fd;
    background: rgba(29, 78, 216, 0.22);
    border-color: rgba(59, 130, 246, 0.45);
}

body.theme-dark .recurring-platform-badge-yt {
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.22);
    border-color: rgba(239, 68, 68, 0.45);
}

body.theme-dark .recurring-platform-badge-both {
    color: #86efac;
    background: rgba(21, 128, 61, 0.22);
    border-color: rgba(34, 197, 94, 0.45);
}


.episode-list-no-broadcast-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: #d92d20;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.episode-list-title-cell {
    line-height: 1.35;
    vertical-align: top;
}

.episode-list-program-title {
    display: block;
    font-size: 0.88em;
    color: var(--muted);
}

.episode-list-airing-schedule {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    color: var(--text);
    font-weight: 650;
}

.episode-list-no-airings {
    display: inline-block;
    max-width: 100%;
    padding: 1px 6px;
    border: 1px solid #dc2626;
    border-radius: 4px;
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.08);
    font-size: 0.78em;
    font-weight: 750;
    letter-spacing: 0.02em;
    line-height: 1.35;
    box-sizing: border-box;
}

body.theme-dark .episode-list-airing-schedule {
    color: #e8eef5;
}

body.theme-dark .episode-list-no-airings {
    border-color: #f87171;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
}

.episode-list-episode-title {
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

body.theme-dark .episode-list-program-title {
    color: #9eb0c4;
}

.episode-list-title-cell-program-only .episode-list-program-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text);
}

body.theme-dark .episode-list-title-cell-program-only .episode-list-program-title {
    color: #e8eef5;
}


.ep-media-col {
    width: 52px;
    text-align: center;
    white-space: nowrap;
    padding-left: 4px;
    padding-right: 4px;
}

.ep-media-badges {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.ep-media-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    letter-spacing: 0;
}

.ep-media-yes { background: #1a9d52; }

button.ep-media-badge {
    border: 0;
    padding: 0 3px;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

button.ep-media-badge-proxy.ep-media-yes {
    cursor: pointer;
}

button.ep-media-badge-proxy.ep-media-yes:hover {
    filter: brightness(1.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.ep-media-no { background: #c0392b; }

.ep-media-badge-qc {
    min-width: 22px;
    font-size: 0.58rem;
}

.ep-media-qc-pass { background: #1a9d52; }

.ep-media-qc-warn { background: #d4a017; }

.ep-media-qc-missing { background: #c0392b; }

.episode-segment-label td {
    padding: 10px 8px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: #f6f9fd;
}

.episode-segment-label:first-child td {
    border-top: 0;
}

body.theme-dark .episode-segment-label td {
    background: #1a2433;
}

.tag {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid;
}

.tag.ok {
    color: #146d48;
    background: #eaf9f2;
    border-color: #b4e6cf;
}

.tag.warn {
    color: #8e5c08;
    background: #fff4df;
    border-color: #f1d8a9;
}

.muted { color: var(--muted); }

.empty,
.hint,
.error {
    border: 1px dashed var(--line);
    border-radius: 9px;
    padding: 10px;
    font-size: 0.83rem;
    color: var(--muted);
    background: #fcfdff;
}

.error {
    color: #8a1f1f;
    border-color: #efbdbd;
    background: #fff5f5;
}

.serie-intro {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.statusbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    border-top: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #f4f8fd 0%, #edf3fa 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #495d79;
}

.status-items {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.status-items > span + span::before {
    content: "|";
    margin-right: 14px;
    color: var(--muted);
    font-weight: 700;
}

.toast-host {
    position: fixed;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    align-items: center;
}

.toast {
    border: 1px solid #c8d6e8;
    background: #ffffff;
    color: #1a2433;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.78rem;
    box-shadow: 0 10px 24px rgba(20, 34, 56, 0.18);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: #88d1a3;
    background: #edf9f1;
}

.toast.error {
    border-color: #e9a3a3;
    background: #fff2f2;
}
.toast.toast-with-copy {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(92vw, 520px);
}

.toast-body {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

.toast-copy-btn {
    flex: 0 0 auto;
    border: 1px solid #d9a0a0;
    background: #fff;
    color: #8f2f2f;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.toast-copy-btn:hover {
    background: #ffe8e8;
}

.toast-copy-btn.copied {
    color: #1f6b3a;
    border-color: #88d1a3;
    background: #edf9f1;
}

.episode-context-menu {
    position: fixed;
    min-width: 110px;
    background: #ffffff;
    border: 1px solid #c6d3e5;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 29, 48, 0.22);
    padding: 6px;
    z-index: 260;
    display: none;
}

.episode-context-menu.open { display: block; }

.episode-list-context-menu {
    min-width: 180px;
}

.episode-list-context-menu .categories-context-label {
    margin-top: 0;
}

.episode-list-context-menu .categories-context-input {
    width: 100%;
    margin-bottom: 6px;
}

.episode-list-context-menu .categories-context-apply {
    width: 100%;
}

.episode-context-copy {
    width: 100%;
    border: 1px solid #b7c8de;
    background: #f7fbff;
    color: #1e2f46;
    border-radius: 6px;
    height: 32px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.episode-context-copy:hover { background: #e7f0fb; }

.app-nav-context-menu {
    min-width: 160px;
}

body.theme-dark {
    --bg: #111924;
    --shell: #162231;
    --panel: #1c2b3d;
    --line: #31465e;
    --line-strong: #3e5672;
    --text: #e8eff8;
    --muted: #a8b7c8;
    --brand-soft: #203959;
    --ok: #45c48a;
    --warn: #f2b24f;
}

body.theme-dark {
    background:
        radial-gradient(circle at 10% -20%, #1a2a3b 0%, transparent 42%),
        radial-gradient(circle at 100% 0%, #152334 0%, transparent 34%),
        var(--bg);
}

body.theme-dark .app-header,
body.theme-dark .toolbar,
body.theme-dark .stats,
body.theme-dark .panel-head,
body.theme-dark .statusbar {
    background: #1a2a3b;
}

body.theme-dark .statusbar {
    color: #d7e3f2;
    border-top-color: #3e5672;
}

body.theme-dark .statusbar strong {
    color: #f1f5f9;
}

body.theme-dark .status-items > span + span::before {
    color: #7b91a8;
}

body.theme-dark #statusClock {
    color: #d7e3f2;
}

body.theme-dark .btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .main-menu-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}


.main-menu {
    background: #1f3044;
    border-color: #3f5875;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.theme-dark .main-menu .btn:hover {
    background: color-mix(in srgb, #2b425c 88%, var(--brand) 12%);
    border-color: #5a7698;
    box-shadow: none;
}

body.theme-dark .main-menu .btn.primary:hover {
    background: #0a4da6;
    border-color: #0a4da6;
    color: #fff;
}

body.theme-dark .theme-lamp-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .header-intercom-ptt-btn,
body.theme-dark .header-intercom-openmic-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .header-intercom-ptt-btn.is-live {
    background: #dc2626;
    border-color: #ef4444;
    color: #fff;
}

body.theme-dark .header-intercom-openmic-btn.is-live {
    background: #ea580c;
    border-color: #fb923c;
    color: #fff;
}

body.theme-dark .header-all-assets-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .header-live-preview-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .header-fullscreen-btn,
body.theme-dark .header-extend-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}

body.theme-dark .header-extend-btn.is-active {
    background: #2a4562;
    border-color: #6ba8e8;
    color: #f4f9ff;
    box-shadow: 0 0 0 1px rgba(107, 168, 232, 0.35);
}

body.theme-dark .header-reload-btn {
    background: #22354b;
    color: #e9f1fb;
    border-color: #425c79;
}
body.theme-dark .main-menu-btn:hover,
body.theme-dark .theme-lamp-btn:hover,
body.theme-dark .header-all-assets-btn:hover,
body.theme-dark .header-widgets-btn:hover,
body.theme-dark .header-intercom-ptt-btn:hover:not(:disabled):not(.is-live),
body.theme-dark .header-intercom-openmic-btn:hover:not(:disabled):not(.is-live),
body.theme-dark .header-live-preview-btn:hover,
body.theme-dark .header-fullscreen-btn:hover,
body.theme-dark .header-extend-btn:hover,
body.theme-dark .header-reload-btn:hover,
body.theme-dark .main-menu-btn:focus-visible,
body.theme-dark .theme-lamp-btn:focus-visible,
body.theme-dark .header-all-assets-btn:focus-visible,
body.theme-dark .header-widgets-btn:focus-visible,
body.theme-dark .header-intercom-ptt-btn:focus-visible:not(:disabled):not(.is-live),
body.theme-dark .header-intercom-openmic-btn:focus-visible:not(:disabled):not(.is-live),
body.theme-dark .header-live-preview-btn:focus-visible,
body.theme-dark .header-fullscreen-btn:focus-visible,
body.theme-dark .header-extend-btn:focus-visible,
body.theme-dark .header-reload-btn:focus-visible {
    border-color: #6ba8e8;
    background: #2a4562;
    color: #f4f9ff;
    box-shadow:
        0 0 0 1px rgba(107, 168, 232, 0.45),
        0 0 18px rgba(91, 156, 245, 0.55),
        0 0 32px rgba(91, 156, 245, 0.28),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

body.theme-dark .main-menu-btn:active,
body.theme-dark .theme-lamp-btn:active,
body.theme-dark .header-all-assets-btn:active,
body.theme-dark .header-widgets-btn:active,
body.theme-dark .header-live-preview-btn:active,
body.theme-dark .header-fullscreen-btn:active,
body.theme-dark .header-extend-btn:active,
body.theme-dark .header-reload-btn:active {
    box-shadow:
        0 0 0 1px rgba(107, 168, 232, 0.32),
        0 0 12px rgba(91, 156, 245, 0.4);
}
/* Workspace 3-column panel button / row hover aura */
.workspace button.btn,
.workspace a.btn,
.workspace .menu-btn {
    cursor: pointer;
    transition:
        transform 0.22s ease,
        box-shadow 0.28s ease,
        border-color 0.22s ease,
        background-color 0.22s ease,
        color 0.22s ease,
        filter 0.22s ease;
}

.workspace button.btn:hover:not(:disabled),
.workspace a.btn:hover,
.workspace .menu-btn:hover,
.workspace button.btn:focus-visible:not(:disabled),
.workspace a.btn:focus-visible,
.workspace .menu-btn:focus-visible {
    transform: translateY(-1px) scale(1.03);
    border-color: #6ea8e6;
    background: #eef6ff;
    color: #143252;
    box-shadow:
        0 0 0 1px rgba(110, 168, 230, 0.42),
        0 0 16px rgba(74, 144, 226, 0.48),
        0 0 28px rgba(74, 144, 226, 0.22),
        0 4px 12px rgba(42, 95, 158, 0.18);
}

.workspace button.btn.primary:hover:not(:disabled),
.workspace button.btn.primary:focus-visible:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(10, 77, 166, 0.5),
        0 0 18px rgba(10, 77, 166, 0.58),
        0 0 32px rgba(10, 77, 166, 0.28),
        0 4px 12px rgba(10, 77, 166, 0.22);
}

.workspace button.btn.danger:hover:not(:disabled),
.workspace button.btn.danger:focus-visible:not(:disabled) {
    background: #bb2424;
    border-color: #f87171;
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.45),
        0 0 18px rgba(215, 38, 38, 0.52),
        0 0 30px rgba(215, 38, 38, 0.24),
        0 4px 12px rgba(124, 20, 20, 0.22);
}

.workspace button.btn:active:not(:disabled),
.workspace a.btn:active,
.workspace .menu-btn:active {
    transform: translateY(0) scale(0.98);
}

.workspace .meta-action-btn-save:hover,
.workspace .meta-action-btn-save:focus-visible {
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.45),
        0 0 16px rgba(34, 197, 94, 0.45),
        0 0 26px rgba(34, 197, 94, 0.2);
}

.workspace .meta-action-btn-cancel:hover,
.workspace .meta-action-btn-cancel:focus-visible {
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.45),
        0 0 16px rgba(239, 68, 68, 0.45),
        0 0 26px rgba(239, 68, 68, 0.2);
}

.workspace .series-item {
    transition:
        background-color 0.22s ease,
        box-shadow 0.28s ease;
    border-radius: 8px;
}

.workspace .series-item:hover,
.workspace .series-item:focus-visible {
    background: #f3f8ff;
    box-shadow:
        inset 4px 0 0 #4a90e2,
        inset 0 0 0 1px rgba(74, 144, 226, 0.2),
        inset 0 0 14px rgba(74, 144, 226, 0.1);
}

.workspace .series-item.active:hover,
.workspace .series-item.active:focus-visible {
    background: #e7f0ff;
}

.workspace .serie-fav-heart {
    transition: transform 0.22s ease, box-shadow 0.28s ease, filter 0.22s ease;
}

.workspace .serie-fav-heart:hover,
.workspace .serie-fav-heart:focus-visible {
    transform: scale(1.12);
    filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.55));
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.42);
}

.panel .series-sort-option {
    transition:
        background-color 0.2s ease,
        box-shadow 0.24s ease,
        transform 0.2s ease;
}

.panel .series-sort-option:hover,
.panel .series-sort-option:focus-visible {
    background: #eef6ff;
    transform: translateX(2px);
    box-shadow:
        inset 3px 0 0 #4a90e2,
        0 0 14px rgba(74, 144, 226, 0.28);
}

.workspace tr.episode-row td {
    transition: background-color 0.2s ease, box-shadow 0.24s ease;
}

.workspace tr.episode-row:hover td {
    background: #eef6ff;
}

.workspace tr.episode-row:hover td:first-child {
    box-shadow: inset 4px 0 0 #4a90e2;
}

.workspace tr.episode-row:hover td:last-child {
    box-shadow: 0 0 16px rgba(74, 144, 226, 0.18);
}

body.theme-dark .workspace button.btn:hover:not(:disabled),
body.theme-dark .workspace a.btn:hover,
body.theme-dark .workspace .menu-btn:hover,
body.theme-dark .workspace button.btn:focus-visible:not(:disabled),
body.theme-dark .workspace a.btn:focus-visible,
body.theme-dark .workspace .menu-btn:focus-visible {
    border-color: #6ba8e8;
    background: #2a4562;
    color: #f4f9ff;
    box-shadow:
        0 0 0 1px rgba(107, 168, 232, 0.45),
        0 0 18px rgba(91, 156, 245, 0.55),
        0 0 32px rgba(91, 156, 245, 0.28),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

body.theme-dark .workspace button.btn.danger:hover:not(:disabled),
body.theme-dark .workspace button.btn.danger:focus-visible:not(:disabled) {
    background: #c62828;
    border-color: #f87171;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.4),
        0 0 18px rgba(239, 68, 68, 0.5),
        0 0 30px rgba(239, 68, 68, 0.22);
}

body.theme-dark .workspace .series-item:hover,
body.theme-dark .workspace .series-item:focus-visible {
    background: #243a52;
    box-shadow:
        inset 4px 0 0 #5b9cf5,
        inset 0 0 0 1px rgba(91, 156, 245, 0.24),
        inset 0 0 14px rgba(91, 156, 245, 0.12);
}

body.theme-dark .workspace .series-item.active:hover,
body.theme-dark .workspace .series-item.active:focus-visible {
    background: #2a4660;
}

body.theme-dark .workspace tr.episode-row:hover td {
    background: #243a52;
}

body.theme-dark .workspace tr.episode-row:hover td:first-child {
    box-shadow: inset 4px 0 0 #5b9cf5;
}

body.theme-dark .panel .series-sort-option:hover,
body.theme-dark .panel .series-sort-option:focus-visible {
    background: #2a4562;
    box-shadow:
        inset 3px 0 0 #5b9cf5,
        0 0 14px rgba(91, 156, 245, 0.32);
}

@media (prefers-reduced-motion: reduce) {
    .workspace button.btn,
    .workspace a.btn,
    .workspace .menu-btn,
    .workspace .series-item,
    .workspace .serie-fav-heart,
    .panel .series-sort-option,
    .workspace tr.episode-row td {
        transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    }

    .workspace button.btn:hover:not(:disabled),
    .workspace a.btn:hover,
    .workspace .menu-btn:hover,
    .workspace .series-item:hover,
    .workspace .serie-fav-heart:hover,
    .panel .series-sort-option:hover {
        transform: none;
    }
}

body.theme-dark .btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

body.theme-dark .btn.danger {
    background: #8b1f1f;
    border-color: #b74242;
    color: #fff;
}

body.theme-dark .series-favorites-bar {
    background: #1a2433;
    border-bottom-color: #2f3f55;
}

body.theme-dark .series-favorites-label {
    color: #b8c7da;
}

body.theme-dark .series-fav-btn {
    background: #243247;
    border-color: #3a5068;
    color: #e8eef7;
}

body.theme-dark .series-fav-btn:hover {
    border-color: #7eb0ff;
    color: #7eb0ff;
}

body.theme-dark .series-fav-drag-ghost {
    background: #243247;
    border-color: #3a5068;
    color: #e8eef7;
}

body.theme-dark .series-fav-drag-ghost.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

body.theme-dark .series-fav-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

body.theme-dark .workspace {
    background: #23384f;
}

body.theme-dark,
body.theme-dark * {
    scrollbar-color: rgba(158, 178, 200, 0.36) transparent;
}

body.theme-dark *::-webkit-scrollbar-thumb {
    background-color: rgba(158, 178, 200, 0.3);
}

body.theme-dark *::-webkit-scrollbar-thumb:hover {
    background-color: rgba(190, 210, 230, 0.48);
}

body.theme-dark .delete-confirm-dialog {
    border-color: #ff3a3a !important;
}

body.theme-dark .delete-confirm-check {
    background: #1f3044;
    border-color: #ff4a4a;
}

body.theme-dark .delete-confirm-check:checked::after {
    border-color: #ff4a4a;
}

body.theme-dark .series-sort-menu {
    background: #1e3044;
    border-color: #3d556f;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.theme-dark .series-sort-option:hover {
    background: #2a425b;
}

body.theme-dark .series-sort-option.active {
    background: #304d6a;
}

body.theme-dark .panel-title {
    color: #eef5ff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

body.theme-dark .serie-fav-heart .serie-fav-heart-shape {
    stroke: #ff8a80;
}

body.theme-dark .serie-fav-heart.is-active .serie-fav-heart-shape {
    fill: #ff5252;
    stroke: #ff5252;
}

body.theme-dark .count-chip {
    color: #39ff14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.35);
}

body.theme-dark .mini-editable.on {
    color: #39ff14;
    background: rgba(57, 255, 20, 0.12);
    border-color: rgba(57, 255, 20, 0.45);
}

body.theme-dark .mini-editable.off {
    color: #ff6a6a;
    background: rgba(255, 80, 80, 0.16);
    border-color: rgba(255, 106, 106, 0.5);
}

body.theme-dark .episode-dialog-head {
    background: #27415b;
    border-bottom-color: #4a6786;
}

body.theme-dark .episode-dialog-foot {
    background: #1a2838;
    border-top-color: #4a6786;
}

body.theme-dark .episode-dialog-title {
    color: #f3f8ff;
}

body.theme-dark .user-access-dialog {
    background: #1f3044;
    border-color: #3f5875;
}

body.theme-dark .user-access-head {
    background: #27415b;
    border-bottom-color: #4a6786;
}

body.theme-dark .user-access-title {
    color: #f3f8ff;
}

body.theme-dark .user-access-table th {
    background: #22384e;
}

body.theme-dark .user-access-table th,
body.theme-dark .user-access-table td {
    border-bottom-color: #2d425a;
}

body.theme-dark .toast {
    border-color: #3f5875;
    background: #1e3044;
    color: #e6eef8;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.theme-dark .toast.success {
    border-color: #3f8f61;
    background: #1b3b2a;
}

body.theme-dark .toast.error {
    border-color: #a44d4d;
    background: #402626;
}
body.theme-dark .toast-copy-btn {
    border-color: #8a4a4a;
    background: #4a2a2a;
    color: #f2c7c7;
}

body.theme-dark .toast-copy-btn:hover {
    background: #5a3434;
}

body.theme-dark .toast-copy-btn.copied {
    border-color: #3f8f61;
    background: #1b3b2a;
    color: #b8e6c8;
}

body.theme-dark .episode-context-menu {
    background: #1f3044;
    border-color: #4b6482;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

body.theme-dark .episode-context-copy {
    border-color: #4b6482;
    background: #263a52;
    color: #e8eff8;
}

body.theme-dark .episode-context-copy:hover { background: #2f4762; }

body.theme-dark .episode-dialog-close {
    background: #1d2f44;
    color: #eef5ff;
    border-color: #4d6886;
}

body.theme-dark .episode-nav-btn {
    background: #1d2f44;
    color: #eef5ff;
    border-color: #4d6886;
    text-shadow: none;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .series-list,
body.theme-dark .table-wrap,
body.theme-dark .kv,
body.theme-dark .episode-kv,
body.theme-dark .episode-preview-wrap,
body.theme-dark .episode-dialog {
    background: #1f3044;
    color: #e8eff8;
}

body.theme-dark .editable-meta.editing .editable-meta-user-select {
    border-color: #4b6482 !important;
    color: #e8eff8 !important;
    background-color: #1f3044 !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #9eb4cd 50%) !important,
        linear-gradient(135deg, #9eb4cd 50%, transparent 50%) !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

body.theme-dark .editable-meta.editing .editable-meta-user-select option,
body.theme-dark .editable-meta.editing .editable-meta-user-select optgroup {
    background: #1f3044 !important;
    color: #e8eff8 !important;
}

body.theme-dark .episode-meta-input,
body.theme-dark .episode-meta-textarea {
    background: #1f3044 !important;
    color: #e8eff8 !important;
    border-color: #4b6482 !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

body.theme-dark .episode-meta-input::placeholder,
body.theme-dark .episode-meta-textarea::placeholder {
    color: #a8b7c8 !important;
    opacity: 1;
}

body.theme-dark .empty,
body.theme-dark .hint {
    background: #1f3044;
    color: #c9d7e7;
    border-color: #415a76;
}

body.theme-dark th {
    background: #213448;
    color: #c8d6e6;
}

body.theme-dark th,
body.theme-dark td {
    border-bottom-color: #2d425a;
}

body.theme-dark tr:hover td,
body.theme-dark .series-item:hover {
    background-color: #263b52;
}

body.theme-dark .series-item {
    background-color: #1a2a3b;
}

body.theme-dark .series-item.active {
    background-color: #2a4664;
}

body.theme-dark .series-list .series-item.active {
    background-color: #2a4664;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

body.theme-dark .series-item {
    border-bottom-color: #2d425a;
}

body.theme-dark 
.series-episode-count--empty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.series-no-episodes-icon {
    color: #e0b020;
    flex-shrink: 0;
}

body.theme-dark .series-no-episodes-icon {
    color: #f2c94c;
}

.series-episode-count {
    color: #8fa3b8;
}

body.theme-dark .editable-row {
    background: #1f3044;
}

body.theme-dark .editable-row.editable-active {
    border-color: #34d06b;
    background: linear-gradient(135deg, rgba(52, 208, 107, 0.24) 0%, rgba(52, 208, 107, 0.08) 100%);
}

body.theme-dark .editable-row.editable-inactive {
    border-color: #ff5a52;
    background: linear-gradient(135deg, rgba(255, 90, 82, 0.24) 0%, rgba(255, 90, 82, 0.08) 100%);
}

body.modal-open .app {
    filter: blur(6px) saturate(0.9);
    pointer-events: none;
    user-select: none;
}

body.modal-open .live-preview-float {
    pointer-events: none;
    user-select: none;
}

.episode-modal {
    position: fixed;
    inset: 0;
    background: rgba(19, 31, 50, 0.28);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 16px;
    overscroll-behavior: contain;
}

.episode-modal.open { display: flex; }

#accountModal.episode-modal {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#accountModal.episode-modal .account-dialog {
    position: relative;
    z-index: 1;
}

.account-dialog {
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
}

.account-dialog-body {
    padding: 14px 16px 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-dialog-lead,
.account-dialog-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.account-password-reqs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 0.78rem;
    color: var(--muted);
}

.account-password-reqs li {
    position: relative;
    padding-left: 1.2em;
    line-height: 1.35;
}

.account-password-reqs li::before {
    content: '○';
    position: absolute;
    left: 0;
    color: var(--muted);
}

.account-password-reqs li.is-met {
    color: var(--text);
}

.account-password-reqs li.is-met::before {
    content: '●';
    color: #2f855a;
}

.account-mfa-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.account-mfa-block + .account-mfa-block {
    border-top: 1px solid var(--line);
}

.account-mfa-block-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
}

.account-passkey-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-passkey-list:empty {
    display: none;
}

.account-passkey-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text);
}

.account-passkey-row button {
    flex: 0 0 auto;
}

.account-dialog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.account-field input {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}

.account-field input[readonly] {
    background: color-mix(in srgb, var(--shell) 70%, #fff 30%);
    color: var(--muted);
    cursor: default;
}

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

.account-dialog-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.account-dialog-section-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.account-dialog-meta {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.account-dialog-error {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #f5c2c7;
    background: #fff5f5;
    color: #b42318;
    font-size: 0.8rem;
}

.account-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

@media (max-width: 560px) {
    .account-dialog-grid,
    .account-password-reqs {
        grid-template-columns: 1fr;
    }
}

body.theme-dark .account-field input[readonly] {
    background: color-mix(in srgb, var(--panel) 80%, #000 20%);
}

body.theme-dark .account-dialog-error {
    border-color: #7f1d1d;
    background: color-mix(in srgb, #7f1d1d 35%, transparent);
    color: #fecaca;
}

body.theme-dark .account-password-reqs li.is-met {
    color: #dbeafe;
}

body.theme-dark .account-password-reqs li.is-met::before {
    color: #4ade80;
}

.user-access-dialog {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
    background: #ffffff;
    border: 1px solid #c6d3e5;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.user-access-head {
    padding: 10px 12px;
    background: linear-gradient(180deg, #f4f8fd 0%, #eaf1fb 100%);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-access-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.user-access-body {
    padding: 10px;
    overflow: auto;
    min-height: 240px;
}

.user-access-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.user-access-table th,
.user-access-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e8eef6;
    text-align: left;
    font-size: 0.8rem;
    vertical-align: middle;
}

.user-access-table th {
    position: sticky;
    top: 0;
    background: #f3f7fd;
    z-index: 1;
}

.user-access-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.categories-dialog {
    width: min(1380px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

#categoriesDialog,
#mamSeriesDialog {
    position: relative;
}

#categoriesDialogHead,
#mamSeriesDialogHead {
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

#categoriesDialog.categories-dialog-custom-size,
#mamSeriesDialog.categories-dialog-custom-size {
    position: fixed;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
}

#categoriesDialog.categories-dialog-fullscreen .video-dialog-resize-handle,
#mamSeriesDialog.categories-dialog-fullscreen .video-dialog-resize-handle {
    display: none;
}

#categoriesDialog.categories-dialog-fullscreen #categoriesDialogHead,
#mamSeriesDialog.categories-dialog-fullscreen #mamSeriesDialogHead {
    cursor: default;
}

#categoriesModal.episode-modal {
    z-index: 110;
}

#allAssetsModal.episode-modal {
    z-index: 110;
}

#episodeModal.episode-modal {
    z-index: 130;
}

#originalAssignModal.episode-modal,
#airingAddModal.episode-modal,
#airingExceptionModal.episode-modal,
#forcedAiringAddModal.episode-modal,
#epgPlusAddModal.episode-modal,
#epgPlusArchiveModal.episode-modal,
#daypartModal.episode-modal,
#yearpartModal.episode-modal,
#textEditModal.episode-modal {
    z-index: 140;
}

#forcedAiringRecurringConfirmModal.episode-modal {
    z-index: 145;
}

#seriesImageModal.episode-modal,
#episodePicturePreviewModal.episode-modal,
#canvasModal.episode-modal,
#deleteEpisodeModal.episode-modal,
#deleteSeriesModal.episode-modal {
    z-index: 150;
}

#playoutBackendModal.episode-modal,
#adminBackendModal.episode-modal {
    z-index: 160;
}

#categoriesModal.categories-modal-fullscreen,
#mamSeriesModal.categories-modal-fullscreen {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

#categoriesModal.categories-modal-fullscreen #categoriesDialog.categories-dialog-fullscreen,
#mamSeriesModal.categories-modal-fullscreen #mamSeriesDialog.categories-dialog-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
}

#categoriesDialog .video-dialog-resize-handle,
#mamSeriesDialog .video-dialog-resize-handle {
    z-index: 3;
}

.categories-dialog .user-access-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: min(78vh, 760px);
    max-height: calc(100vh - 96px);
    padding: 14px 16px;
}

#categoriesDialog.categories-dialog-custom-size .user-access-body,
#categoriesDialog.categories-dialog-fullscreen .user-access-body,
#mamSeriesDialog.categories-dialog-custom-size .user-access-body,
#mamSeriesDialog.categories-dialog-fullscreen .user-access-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#categoriesDialog.categories-dialog-custom-size .categories-board,
#categoriesDialog.categories-dialog-fullscreen .categories-board,
#mamSeriesDialog.categories-dialog-custom-size .mam-series-board,
#mamSeriesDialog.categories-dialog-fullscreen .mam-series-board {
    min-height: 0;
    flex: 1 1 auto;
}

.categories-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.categories-add-btn {
    font-size: 13px;
    padding: 6px 12px;
}
.categories-dialog .categories-toolbar {
    flex-shrink: 0;
}
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.categories-group.is-open .categories-list-item {
    border-color: #8eb2da;
    background: #eef5fd;
}
.categories-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d5dfeb;
    border-radius: 6px;
    background: #f8fbff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.categories-list-item:hover {
    background: #eef5fd;
}
.categories-list-name {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    font-size: 15px;
    font-weight: 600;
}
.categories-list-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.categories-list-count {
    min-width: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e8f0fa;
    color: #35506d;
    font-size: 12px;
    text-align: center;
}
.categories-list-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #5a7088;
    border-bottom: 2px solid #5a7088;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}
.categories-group.is-open .categories-list-chevron {
    transform: rotate(-135deg);
}
.categories-programs {
    margin: 0 0 4px;
    padding: 8px 12px 12px 18px;
    border: 1px solid #d5dfeb;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #fbfdff;
}
.categories-programs .categories-program-item {
    padding: 7px 0;
    border-bottom: 1px solid #e8eef6;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}
.categories-programs .categories-program-item:last-child {
    border-bottom: 0;
}
.categories-programs-empty,
.categories-programs .hint,
.categories-programs .error {
    padding: 6px 0;
    font-size: 13px;
}
body.theme-dark .categories-summary {
    color: #9eb0c4;
}
body.theme-dark .categories-group.is-open .categories-list-item,
body.theme-dark .categories-list-item:hover {
    background: #243247;
    border-color: #4f6f95;
}
body.theme-dark .categories-list-item {
    border-color: #3a4d66;
    background: #1a2433;
}
body.theme-dark .categories-list-count {
    background: #243247;
    color: #d7e3f0;
}
body.theme-dark .categories-list-chevron {
    border-color: #9eb0c4;
}
body.theme-dark .categories-programs {
    border-color: #3a4d66;
    background: #151d29;
}
body.theme-dark .categories-programs .categories-program-item {
    border-bottom-color: #2a3a50;
}

.categories-board {
    display: grid;
    grid-template-columns: minmax(210px, 0.95fr) minmax(260px, 1.15fr) minmax(280px, 1.25fr);
    flex: 1 1 auto;
    min-height: 320px;
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    overflow: hidden;
    background: #fbfdff;
}
.categories-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-right: 1px solid #d5dfeb;
}
.categories-col:last-child {
    border-right: 0;
}
.categories-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #35506d;
    background: #eef5fd;
    border-bottom: 1px solid #d5dfeb;
}
.categories-col-head-label {
    min-width: 0;
}
.categories-col-sort-btn {
    flex-shrink: 0;
    min-width: 28px;
    padding: 2px 8px;
    border: 1px solid #c6d3e5;
    border-radius: 4px;
    background: #fff;
    color: #35506d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}
.categories-col-sort-btn:hover {
    background: #eef5fd;
    border-color: #8eb2da;
}
.categories-col-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}
.categories-col-placeholder,
.categories-col-empty {
    padding: 12px 8px;
    color: #5a7088;
    font-size: 13px;
}
.categories-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5dfeb;
    border-radius: 6px;
    background: #f8fbff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.categories-cat-item:hover,
.categories-cat-item.is-active,
.categories-program-item.is-active {
    border-color: #8eb2da;
    background: #eef5fd;
}
.categories-cat-item.is-drop-target {
    border-color: #4f8fd4;
    box-shadow: inset 0 0 0 1px #4f8fd4;
}
.categories-program-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "prefix title"
        "prefix meta";
    gap: 2px 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5dfeb;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: grab;
}
.categories-program-prefix {
    grid-area: prefix;
    align-self: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.categories-program-title {
    grid-area: title;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}
.categories-program-meta {
    grid-area: meta;
    font-size: 12px;
    color: #5a7088;
}
.categories-episode-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #e3ebf5;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    font-size: 13px;
    line-height: 1.35;
    cursor: pointer;
}
.categories-episode-item.has-media-badges {
    grid-template-columns: 44px minmax(0, 1fr) auto min-content;
    align-items: center;
}
.categories-episode-item:hover {
    border-color: #8eb2da;
    background: #eef5fd;
}
.categories-episode-media {
    align-self: center;
}
.categories-episode-media .ep-media-badges {
    flex-wrap: nowrap;
}
.categories-episode-no {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-weight: 700;
    color: #35506d;
}
.categories-episode-title {
    word-break: break-word;
}

.categories-episode-title-program-only {
    font-weight: 600;
}

.categories-episode-no-broadcast-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    color: #d92d20;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}
.categories-episode-id {
    font-size: 12px;
    color: #5a7088;
    white-space: nowrap;
}
body.theme-dark .categories-board {
    border-color: #3a4d66;
    background: #151d29;
}
body.theme-dark .categories-col {
    border-right-color: #3a4d66;
}
body.theme-dark .categories-col-sort-btn {
    border-color: #3a4d66;
    background: #1a2433;
    color: #d7e3f0;
}
body.theme-dark .categories-col-sort-btn:hover {
    background: #243247;
    border-color: #4f6f95;
}
body.theme-dark .categories-col-head {
    background: #243247;
    border-bottom-color: #3a4d66;
    color: #d7e3f0;
}
body.theme-dark .categories-col-placeholder,
body.theme-dark .categories-col-empty {
    color: #9eb0c4;
}
body.theme-dark .categories-cat-item,
body.theme-dark .categories-program-item,
body.theme-dark .categories-episode-item {
    border-color: #3a4d66;
    background: #1a2433;
}
body.theme-dark .categories-cat-item:hover,
body.theme-dark .categories-cat-item.is-active,
body.theme-dark .categories-program-item.is-active,
body.theme-dark .categories-episode-item:hover {
    background: #243247;
    border-color: #4f6f95;
}
body.theme-dark .categories-program-meta,
body.theme-dark .categories-episode-id {
    color: #9eb0c4;
}
body.theme-dark .categories-episode-no {
    color: #d7e3f0;
}
.categories-program-item.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}
.categories-group.is-drop-target > .categories-list-item,
.categories-group.is-drop-target > .categories-programs {
    border-color: #4f8fd4;
    box-shadow: inset 0 0 0 1px #4f8fd4;
}
.categories-program-context-menu {
    min-width: 240px;
    padding: 10px;
    z-index: 270;
}
.categories-context-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    color: #35506d;
}
.categories-context-select {
    width: 100%;
    margin-bottom: 8px;
    padding: 7px 8px;
    border: 1px solid #c5d3e3;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}
.categories-context-apply {
    width: 100%;
}
.categories-context-delete {
    width: 100%;
    margin-top: 8px;
}
.categories-name-context-menu {
    min-width: 240px;
    padding: 10px;
    z-index: 271;
}
.categories-context-input {
    width: 100%;
    margin-bottom: 8px;
    padding: 7px 8px;
    border: 1px solid #c5d3e3;
    border-radius: 4px;
    background: #fff;
    font: inherit;
    box-sizing: border-box;
}
body.theme-dark .categories-context-input {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}
body.theme-dark .categories-context-label {
    color: #d7e3f0;
}

#mamSeriesModal.episode-modal {
    z-index: 110;
}

.mam-series-dialog {
    width: min(1380px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

.mam-series-dialog .user-access-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: min(78vh, 760px);
    max-height: calc(100vh - 96px);
    padding: 14px 16px;
}

.mam-series-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.mam-series-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c5d3e3;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    color: inherit;
}

.mam-series-search-input:focus {
    outline: none;
    border-color: #8eb2da;
    box-shadow: 0 0 0 2px rgba(142, 178, 218, 0.25);
}

.mam-series-board {
    flex: 1 1 auto;
    min-height: 320px;
}

.mam-series-board .categories-col-list .mam-series-episode-item {
    border-radius: 6px;
    margin-bottom: 0;
}

.mam-series-board .categories-col-list .mam-series-episodes-active,
.mam-series-board .categories-col-list .mam-series-episodes-excluded {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mam-series-list-count-episodes {
    background: #e8f0fa;
}

body.theme-dark .mam-series-search-input {
    background: #182230;
    border-color: #31455d;
    color: #e8eef5;
}

body.theme-dark .mam-series-list-count-episodes {
    background: #243247;
}
.mam-series-group.is-open > .mam-series-title-item {
    border-color: #8eb2da;
    background: #eef5fd;
}
.mam-series-title-item,
.mam-series-season-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d5dfeb;
    border-radius: 6px;
    background: #f8fbff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mam-series-title-item:hover,
.mam-series-season-item:hover {
    background: #eef5fd;
}
.mam-series-title-name {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.mam-series-title-text {
    display: block;
    min-width: 0;
    word-break: break-word;
}
.mam-series-block-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0b56b6;
    background: color-mix(in srgb, #0f6ee8 12%, #ffffff);
    border: 1px solid color-mix(in srgb, #0f6ee8 24%, transparent);
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.3;
}
.mam-series-block-label.is-manual {
    color: #8a4b00;
    background: color-mix(in srgb, #f59e0b 16%, #ffffff);
    border-color: color-mix(in srgb, #f59e0b 35%, transparent);
}
body.theme-dark .mam-series-block-label.is-manual {
    color: #ffd18a;
    background: color-mix(in srgb, #f59e0b 22%, #1e3044);
    border-color: color-mix(in srgb, #f59e0b 40%, #3f5875);
}
.mam-series-block-label.is-no-episodes {
    color: #b42318;
    background: color-mix(in srgb, #f87171 18%, #ffffff);
    border-color: color-mix(in srgb, #f87171 40%, transparent);
}
body.theme-dark .mam-series-block-label.is-no-episodes {
    color: #ffb4a8;
    background: color-mix(in srgb, #f87171 22%, #1e3044);
    border-color: color-mix(in srgb, #f87171 40%, #3f5875);
}
body.theme-dark .mam-series-block-label {
    color: #8ec5ff;
    background: color-mix(in srgb, #0f6ee8 22%, #1e3044);
    border-color: color-mix(in srgb, #0f6ee8 35%, #3f5875);
}
.mam-series-season-name {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    font-size: 14px;
    font-weight: 600;
}
.mam-series-list-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.mam-series-list-count {
    min-width: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e8f0fa;
    color: #35506d;
    font-size: 12px;
    text-align: center;
}
.mam-series-list-count-episodes {
    background: #edf7ef;
    color: #2f5a3d;
}
.mam-series-list-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #5a7088;
    border-bottom: 2px solid #5a7088;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}
.mam-series-group.is-open > .mam-series-title-item .mam-series-list-chevron,
.mam-series-season-group.is-open > .mam-series-season-item .mam-series-list-chevron {
    transform: rotate(-135deg);
}
.mam-series-seasons[hidden],
.mam-series-episodes[hidden] {
    display: none !important;
}
.mam-series-seasons {
    margin: 6px 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mam-series-season-group.is-open > .mam-series-season-item {
    border-color: #8eb2da;
    background: #eef5fd;
}
.mam-series-episodes {
    margin: 4px 0 0 18px;
    padding: 4px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mam-series-episode-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-left: 2px solid #c5d8ef;
    color: #35506d;
    font-size: 13px;
    cursor: grab;
}
.mam-series-episode-item.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}
.mam-series-episodes.is-saving-playorder {
    opacity: 0.7;
    pointer-events: none;
}
.mam-series-episode-playorder {
    flex: 0 0 auto;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3dd;
    color: #7a4e00;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.mam-series-episode-label {
    flex: 1 1 auto;
    min-width: 0;
}
.mam-series-episode-item:nth-child(even) {
    background: rgba(238, 245, 253, 0.55);
}
.mam-series-episodes-empty,
.mam-series-seasons-empty,
.mam-series-seasons .hint,
.mam-series-episodes .hint,
.mam-series-seasons .error,
.mam-series-episodes .error {
    padding: 8px 10px;
    font-size: 13px;
}
body.theme-dark .mam-series-summary {
    color: #9fb0c4;
}
body.theme-dark .mam-series-group.is-open > .mam-series-title-item,
body.theme-dark .mam-series-season-group.is-open > .mam-series-season-item,
body.theme-dark .mam-series-title-item:hover,
body.theme-dark .mam-series-season-item:hover {
    background: #1f2d3f;
    border-color: #4f7096;
}
body.theme-dark .mam-series-title-item,
body.theme-dark .mam-series-season-item {
    background: #182230;
    border-color: #31455d;
    color: #e8eef5;
}
body.theme-dark .mam-series-list-count {
    background: #243246;
    color: #d7e3f0;
}
body.theme-dark .mam-series-list-count-episodes {
    background: #223428;
    color: #cfe8d6;
}
body.theme-dark .mam-series-list-chevron {
    border-color: #9fb0c4;
}
body.theme-dark .mam-series-episode-item {
    border-left-color: #4f7096;
    color: #d7e3f0;
}
body.theme-dark .mam-series-episode-playorder {
    background: #3a3020;
    color: #f0d7a6;
}
.mam-series-excluded-heading {
    margin: 12px 0 4px 18px;
    padding-top: 8px;
    border-top: 1px solid #e8caca;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #8a4a4a;
    text-transform: lowercase;
}
.mam-series-episodes-excluded .mam-series-episode-item {
    cursor: context-menu;
}
.mam-series-episode-playorder.is-excluded-label {
    background: #fdeaea;
    color: #8a3030;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    text-align: center;
}
.mam-series-episodes-empty-inline {
    padding: 8px 10px;
    font-size: 13px;
    color: #5a7088;
}
.mam-series-context-menu {
    min-width: 220px;
    padding: 10px;
    z-index: 272;
}
.mam-series-context-action {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d5dfeb;
    border-radius: 4px;
    background: #f8fbff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mam-series-context-action:hover {
    background: #eef5fd;
}
.mam-series-context-action-block {
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
body.theme-dark .mam-series-excluded-heading {
    color: #e0a8a8;
    border-top-color: #5a3030;
}
body.theme-dark .mam-series-episode-playorder.is-excluded-label {
    background: #3a2020;
    color: #f0bcbc;
}
body.theme-dark .mam-series-context-action {
    background: #182230;
    border-color: #31455d;
    color: #e8eef5;
}
body.theme-dark .mam-series-context-action:hover {
    background: #1f2d3f;
}
body.theme-dark .mam-series-episode-item:nth-child(even) {
    background: rgba(31, 45, 63, 0.55);
}

body.theme-dark .categories-context-select {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}
.user-access-check {
    width: 18px;
    height: 18px;
    accent-color: #0f6ee8;
}

.external-user-dialog {
    width: min(920px, calc(100vw - 32px));
}
.external-user-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: min(72vh, 680px);
}
.external-user-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.external-user-select-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a6078;
}
.external-user-select {
    min-width: min(420px, 100%);
    padding: 8px 10px;
    border: 1px solid #c6d3e5;
    border-radius: 8px;
    background: #fff;
    font-size: 0.84rem;
}
.external-user-lists {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.external-user-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2f4560;
    margin-bottom: 8px;
}
.external-user-search-row {
    margin-bottom: 8px;
}
.external-user-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c6d3e5;
    border-radius: 8px;
    font-size: 0.84rem;
}
.external-user-program-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.external-user-program-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #f8fbff;
}
.external-user-program-label {
    font-size: 0.82rem;
    color: #24384f;
    line-height: 1.35;
}
.external-user-program-btn {
    flex-shrink: 0;
    min-width: 84px;
}
.external-user-list-empty,
.external-user-search-hint {
    font-size: 0.78rem;
    color: #6a8098;
}
.external-user-search-hint {
    margin-top: 8px;
}
body.theme-dark .external-user-select,
body.theme-dark .external-user-search {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}
body.theme-dark .external-user-select-label,
body.theme-dark .external-user-section-title {
    color: #c8d6e8;
}
body.theme-dark .external-user-program-row {
    border-color: #33465f;
    background: #172233;
}
body.theme-dark .external-user-program-label {
    color: #e8eef5;
}
body.theme-dark .external-user-list-empty,
body.theme-dark .external-user-search-hint {
    color: #9db0c7;
}

.image-modal-content {
    position: relative;
    max-width: calc(100vw - 42px);
    max-height: calc(100vh - 42px);
    border-radius: 12px;
    border: 1px solid #c6d3e5;
    background: #101b2b;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.35);
    padding: 10px;
}

.image-modal-content img {
    display: block;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 84px);
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #ffffff;
}

.episode-dialog {
    width: min(960px, calc(100vw - 30px));
    max-height: calc(100vh - 70px);
    background: #ffffff;
    border: 1px solid #c6d3e5;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.35);
    overflow: hidden;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
}
#episodeModal.episode-modal.open {
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

#episodeModal #episodeDialog.episode-dialog {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    max-height: calc(100vh - 20px);
}

.episode-dialog-head {
    padding: 10px 12px;
    background: linear-gradient(180deg, #f4f8fd 0%, #eaf1fb 100%);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: move;
    flex-shrink: 0;
}

.episode-dialog-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

.episode-dialog-no-broadcast {
    display: inline-block;
    flex: none;
    color: #fff;
    background: #d92d20;
    border: 1px solid #b42318;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 5px;
    text-transform: uppercase;
    box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.25);
    animation: episode-no-broadcast-pulse 1.4s ease-in-out infinite;
}

.episode-dialog-title-sep,
.episode-dialog-title-main {
    font-weight: 700;
}

@keyframes episode-no-broadcast-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.82; transform: scale(1.02); }
}

body.theme-dark .episode-dialog-no-broadcast {
    background: #f04438;
    border-color: #f97066;
    color: #fff;
}

.episode-dialog-close {
    border: 1px solid #c5d3e6;
    background: #fff;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 3px 10px;
    cursor: pointer;
}

#episodeModal button,
#episodeModal a.btn {
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease;
}

#episodeModal button:hover:not(:disabled):not(.episode-dialog-tab):not(.video-cuts-filler-toggle):not(.episode-auto-youtube-toggle):not(.video-cuts-item-delete),
#episodeModal a.btn:hover:not(.is-disabled-visual) {
    transform: translateY(-1px);
    border-color: var(--brand, #0f6ee8);
    background: #edf5ff;
    box-shadow: 0 4px 14px rgba(15, 110, 232, 0.16);
}

#episodeModal button:active:not(:disabled):not(.episode-dialog-tab):not(.video-cuts-filler-toggle):not(.episode-auto-youtube-toggle):not(.video-cuts-item-delete),
#episodeModal a.btn:active:not(.is-disabled-visual) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 110, 232, 0.12);
}

#episodeModal button.btn.primary:hover:not(:disabled),
#episodeModal button.btn.primary:focus-visible:not(:disabled) {
    background: var(--brand, #0f6ee8);
    border-color: var(--brand, #0f6ee8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 110, 232, 0.28);
}

#episodeModal button.btn.danger:hover:not(:disabled),
#episodeModal button.btn.danger:focus-visible:not(:disabled) {
    background: #bb2424;
    border-color: #bb2424;
    color: #fff;
    box-shadow: 0 4px 14px rgba(187, 36, 36, 0.28);
}

#episodeModal button.episode-dialog-close:hover:not(:disabled) {
    color: #143252;
}

#episodeModal .episode-dialog-tab:hover {
    transform: translateY(-1px);
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 3px 10px rgba(15, 110, 232, 0.1);
}

#episodeModal .episode-dialog-tab.active:hover {
    transform: none;
    background: #fff;
    box-shadow: none;
}

body.theme-dark #episodeModal button:hover:not(:disabled):not(.episode-dialog-tab):not(.video-cuts-filler-toggle):not(.episode-auto-youtube-toggle):not(.video-cuts-item-delete),
body.theme-dark #episodeModal a.btn:hover:not(.is-disabled-visual) {
    background: rgba(63, 116, 200, 0.2);
    color: #eef5ff;
    box-shadow: 0 4px 14px rgba(63, 116, 200, 0.22);
}

body.theme-dark #episodeModal button.episode-dialog-close:hover:not(:disabled) {
    color: #eef5ff;
}

body.theme-dark #episodeModal .episode-dialog-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 3px 10px rgba(63, 116, 200, 0.18);
}


.episode-dialog-tabs {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f6f9fd 0%, #eef4fb 100%);
}

/* Sliding active underline (DE episode popup) */
#episodeDialogTabs > .episode-dialog-tab-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: #2a6df0;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.18s ease;
}

#episodeDialogTabs > .episode-dialog-tab-indicator.is-visible {
    opacity: 1;
}

#episodeDialogTabs > .episode-dialog-tab-indicator.is-snapping {
    transition: none;
}

#episodeDialogTabs .episode-dialog-tab.active {
    border-bottom-color: transparent;
}

.episode-dialog-tab {
    border: 0;
    background: transparent;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.episode-dialog-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.55);
}

.episode-dialog-tab.active {
    color: var(--text);
    background: #fff;
    border-bottom-color: #2a6df0;
}

.episode-dialog-tab[hidden] {
    display: none;
}

#episodeDialog .episode-dialog-tab {
    position: relative;
}

#episodeDialog .episode-dialog-tab + .episode-dialog-tab:not([hidden])::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: calc(20% + 2px);
    width: 1px;
    background: linear-gradient(
        180deg,
        rgba(197, 211, 230, 0) 0%,
        rgba(168, 186, 210, 0.95) 24%,
        rgba(168, 186, 210, 0.95) 76%,
        rgba(197, 211, 230, 0) 100%
    );
    pointer-events: none;
}

#episodeDialog .episode-dialog-tab.active + .episode-dialog-tab:not([hidden])::before,
#episodeDialog .episode-dialog-tab + .episode-dialog-tab.active:not([hidden])::before {
    background: linear-gradient(
        180deg,
        rgba(197, 211, 230, 0) 0%,
        rgba(148, 168, 196, 0.85) 24%,
        rgba(148, 168, 196, 0.85) 76%,
        rgba(197, 211, 230, 0) 100%
    );
}

#episodeDialogMain {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#episodeDialog > #episodeDialogBody.episode-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.episode-dialog-tabpanel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.episode-dialog-tabpanel.is-active {
    display: block;
}

#episodeDialogBody[hidden] {
    display: none !important;
    flex: 0 0 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#episodeDialog.episode-dialog-media-sized {
    width: min(840px, calc(100vw - 30px));
    max-width: 96vw;
    max-height: calc(100dvh - 48px);
}

#episodeDialog.episode-dialog-media-sized:not(.episode-dialog-custom-size) {
    height: min(815px, calc(100dvh - 48px));
    max-height: calc(100dvh - 48px);
    min-height: 0;
}
#episodeDialog.episode-dialog-custom-size {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
}

#episodeDialog.episode-dialog-custom-size #episodeDialogMain {
    flex: 1 1 auto;
    min-height: 0 !important;
}

#episodeDialog.episode-dialog-custom-size #episodeDialogTabMedia,
#episodeDialog.episode-dialog-custom-size #episodeDialogBody {
    min-height: 0;
    overflow: auto;
}

#episodeDialog.episode-dialog-custom-size #episodeMediaPlayerRoot.episode-embedded-video-shell #videoDialogBody.episode-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#episodeDialog.episode-dialog-custom-size .video-player-stage {
    container-type: size;
    flex: 1 1 0;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

#episodeDialog.episode-dialog-custom-size .video-player-main {
    container-type: size;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#episodeDialog.episode-dialog-custom-size .video-player-stage.loading {
    min-height: 120px;
}

#episodeDialog.episode-dialog-custom-size .video-player-main .video-player-el {
    aspect-ratio: 16 / 9;
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

#episodeDialog.episode-dialog-custom-size .video-waveform-wrap,
#episodeDialog.episode-dialog-custom-size .video-transport-bar,
#episodeDialog.episode-dialog-custom-size .video-markers-panel {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

#episodeDialog.episode-dialog-fullscreen .video-dialog-resize-handle {
    display: none;
}


#episodeDialog.episode-dialog-media-sized #episodeDialogMain {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template: 1fr / 1fr;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

#episodeDialog.episode-dialog-media-sized #episodeDialogMain > #episodeDialogBody,
#episodeDialog.episode-dialog-media-sized #episodeDialogMain > #episodeDialogTabMedia {
    grid-area: 1 / 1;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    align-self: stretch;
    justify-self: stretch;
}

#episodeDialog.episode-dialog-media-sized #episodeDialogMain > .episode-tab-inactive {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

#episodeDialog.episode-dialog-media-sized #episodeDialogMain > :not(.episode-tab-inactive) {
    z-index: 1;
}


#episodeDialog.episode-dialog-media-sized #episodeDialogTabMedia {
    display: flex;
    flex-direction: column;
}

#episodeDialog.episode-dialog-media-sized #episodeDialogMain > #episodeDialogBody {
    display: flex !important;
    flex-direction: column;
}

#episodeDialog.is-media-tab {
    max-height: calc(100dvh - 16px);
    min-height: 0;
}

#episodeDialog.is-media-tab:not(.episode-dialog-media-sized) > #episodeDialogBody {
    display: none !important;
    flex: 0 0 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#episodeDialog.is-media-tab #episodeDialogTabMedia {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

#episodeDialogTabMedia:has(#episodeMediaPlayerRoot:not([hidden])) {
    padding: 0 !important;
    gap: 0;
}

#episodeDialogTabMedia:has(#episodeMediaPlayerRoot:not([hidden])) #episodeMediaActions {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
}

.episode-media-panel {
    min-height: min(240px, 32vh);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#episodeMediaPlayerRoot[hidden] {
    display: none !important;
    flex: 0 0 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

#episodeDialogTabMedia.episode-media-actions-only,
#episodeDialog.episode-media-actions-only #episodeDialogTabMedia {
    justify-content: center;
    align-items: center;
}

#episodeDialogTabMedia.episode-media-actions-only,
#episodeDialog.episode-media-actions-only #episodeDialogTabMedia {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

#episodeDialogTabMedia.episode-media-actions-only .episode-media-panel,
#episodeDialog.episode-media-actions-only #episodeDialogTabMedia .episode-media-panel {
    flex: 0 1 auto;
    width: 100%;
    min-height: 0;
    padding: 20px 16px;
}

.episode-media-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
}

.episode-media-found-file {
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.35;
    word-break: break-word;
}

.episode-media-actions-stack .episode-media-actions,
.episode-media-actions-stack .episode-original-check,
.episode-media-actions-stack .episode-media-found-file,
.episode-media-actions-stack .episode-video-upload,
.episode-media-actions-stack .btn {
    width: 100%;
    max-width: 560px;
}

.episode-media-actions-stack .episode-video-upload-row .episode-video-upload-btn {
    width: auto;
    max-width: none;
}

.episode-media-panel[hidden],
#episodeMediaActions[hidden] {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.episode-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 520px;
}

.episode-video-upload {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.episode-video-upload-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.episode-video-upload-btn {
    position: relative;
    overflow: hidden;
    flex: 1 1 auto;
    width: 100%;
    max-width: 520px;
    min-height: 36px;
    padding: 0;
    text-align: center;
}

.episode-video-upload-btn.is-progress {
    cursor: default;
    background: #e6edf5;
    border-color: var(--line-strong);
    opacity: 1;
}

.episode-video-upload-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, #2f6fed, #4c8dff);
    opacity: 0.5;
    transition: width 0.15s ease;
    pointer-events: none;
    z-index: 0;
}

.episode-video-upload-shimmer {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 42%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.18) 25%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0.18) 75%,
        rgba(255, 255, 255, 0) 100%
    );
    mix-blend-mode: soft-light;
}

.episode-video-upload-btn.is-progress .episode-video-upload-shimmer {
    display: block;
    animation: episode-video-upload-shimmer 1.05s linear infinite;
}

@keyframes episode-video-upload-shimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}

.episode-video-upload-label {
    position: relative;
    z-index: 2;
    display: block;
    padding: 7px 12px;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-video-upload-cancel {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(180, 40, 40, 0.35);
    border-radius: 8px;
    background: #fff5f5;
    color: #c62828;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.episode-video-upload-cancel:hover {
    background: #ffe3e3;
    border-color: #c62828;
}

.episode-video-upload-cancel[hidden] {
    display: none !important;
}

body.theme-dark .episode-video-upload-btn.is-progress {
    background: #2a3441;
}

body.theme-dark .episode-video-upload-cancel {
    background: rgba(198, 40, 40, 0.16);
    border-color: rgba(255, 120, 120, 0.35);
    color: #ff8a8a;
}

body.theme-dark .episode-video-upload-cancel:hover {
    background: rgba(198, 40, 40, 0.28);
    border-color: #ff8a8a;
}

.episode-media-no-file-notice {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 4px;
    text-align: center;
}

.episode-media-no-file-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #24344f;
}

.episode-media-no-file-title strong {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.episode-media-no-file-sub {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--muted, #5a6b82);
}

body.theme-dark .episode-media-no-file-title {
    color: #e4ecf7;
}

body.theme-dark .episode-media-no-file-sub {
    color: #9aabbf;
}

.statusbar-video-upload {
    color: #c62828;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.statusbar-video-upload.is-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.statusbar-video-upload.is-clickable:hover {
    color: #a11f1f;
}

body.theme-dark .statusbar-video-upload {
    color: #ff6b6b;
}

body.theme-dark .statusbar-video-upload.is-clickable:hover {
    color: #ff8f8f;
}

.statusbar-intercom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1e4d8c;
}

.statusbar-intercom[hidden] {
    display: none !important;
}

.statusbar-intercom.is-talking {
    color: #b91c1c;
}

.statusbar-intercom-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.statusbar-intercom.is-connected .statusbar-intercom-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.statusbar-intercom.is-talking .statusbar-intercom-dot {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    animation: intercom-dot-pulse 1s ease-in-out infinite;
}

@keyframes intercom-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}

body.theme-dark .statusbar-intercom {
    color: #93c5fd;
}

body.theme-dark .statusbar-intercom.is-talking {
    color: #fca5a5;
}

.video-upload-done-modal {
    position: fixed;
    inset: 0;
    z-index: 280;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 28, 44, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.video-upload-done-modal[hidden] {
    display: none !important;
}

.video-upload-done-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.video-upload-done-dialog {
    width: min(420px, 100%);
    padding: 28px 26px 22px;
    border-radius: 14px;
    border: 1px solid rgba(73, 93, 121, 0.18);
    background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fb 100%);
    box-shadow: 0 18px 48px rgba(18, 28, 44, 0.22);
    text-align: center;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s ease;
}

.video-upload-done-modal.is-open .video-upload-done-dialog {
    transform: translateY(0) scale(1);
}

.video-upload-done-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    color: #1f7a4c;
    display: grid;
    place-items: center;
}

.video-upload-done-dialog h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1c2b42;
    letter-spacing: -0.01em;
}

.video-upload-done-desc {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #5a6b82;
}

.video-upload-done-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(73, 93, 121, 0.06);
    text-align: left;
}

.video-upload-done-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 10px;
    align-items: baseline;
}

.video-upload-done-k {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7a8aa0;
}

.video-upload-done-v {
    font-size: 0.92rem;
    font-weight: 600;
    color: #24344f;
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

.video-upload-done-dialog .btn.primary {
    min-width: 120px;
}

body.theme-dark .video-upload-done-modal {
    background: rgba(4, 8, 14, 0.55);
}

body.theme-dark .video-upload-done-dialog {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #1b2433 0%, #151c28 100%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

body.theme-dark .video-upload-done-icon {
    color: #4fd08a;
}

body.theme-dark .video-upload-done-dialog h2 {
    color: #e8eef8;
}

body.theme-dark .video-upload-done-desc {
    color: #9aabbf;
}

body.theme-dark .video-upload-done-meta {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .video-upload-done-k {
    color: #8496ad;
}

body.theme-dark .video-upload-done-v {
    color: #e4ecf7;
}

body.theme-dark .episode-video-upload-progress-track {
    background: rgba(255, 255, 255, 0.12);
}

.episode-media-tabpanel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.episode-media-tabpanel.is-active {
    display: flex;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
    padding: 0;
    --video-surface: #ffffff;
    --video-stage-bg: #000000;
    --video-chrome-bg: #f4f8fd;
    --video-chrome-border: var(--line);
    --video-chrome-text: var(--text);
    --video-chrome-muted: var(--muted);
    --video-input-bg: #ffffff;
    --video-input-border: var(--line-strong);
    --video-input-text: var(--text);
    --video-timecode-color: var(--text);
    --video-length-color: var(--muted);
    --video-separator-color: var(--muted);
    --video-waveform-bg: #eef2f8;
    --video-waveform-border: var(--line);
    --video-waveform-peak: #3d7ab8;
    --video-waveform-progress-bg: #d4deec;
    --video-waveform-progress-label: var(--muted);
}

body.theme-dark #episodeMediaPlayerRoot.episode-embedded-video-shell {
    --video-surface: var(--panel);
    --video-chrome-bg: #1e1e1e;
    --video-chrome-border: #333333;
    --video-chrome-text: #eeeeee;
    --video-chrome-muted: #888888;
    --video-input-bg: #111111;
    --video-input-border: #444444;
    --video-input-text: #eeeeee;
    --video-timecode-color: #ffffff;
    --video-length-color: #cccccc;
    --video-separator-color: #666666;
    --video-waveform-bg: #111111;
    --video-waveform-border: #333333;
    --video-waveform-peak: #5b9bd5;
    --video-waveform-progress-bg: #2a2a2a;
    --video-waveform-progress-label: #bbbbbb;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell #videoDialogBody.episode-dialog-body {
    overflow: hidden;
    min-height: 0;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    gap: 0;
    background: var(--video-surface, #fff);
    max-height: none;
}

/* Same stacked layout as legacy #videoDialog popup (windowed mode) */
#episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-stage {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(473px, calc(100dvh - 340px));
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-stage.loading {
    min-height: 80px;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-main .video-player-el {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

#episodeMediaPlayerRoot.episode-embedded-video-shell .video-waveform-wrap,
#episodeMediaPlayerRoot.episode-embedded-video-shell .video-transport-bar,
#episodeMediaPlayerRoot.episode-embedded-video-shell .video-markers-panel {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

#episodeDialog.episode-dialog-fullscreen.is-media-tab {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
}

#episodeDialog.episode-dialog-fullscreen.is-media-tab #episodeDialogTabMedia {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
}

#episodeDialog.episode-dialog-fullscreen.is-media-tab #episodeMediaPlayerRoot.episode-embedded-video-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell #videoDialogBody.episode-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-stage {
    container-type: size;
    flex: 1 1 auto;
    min-height: 120px;
    max-height: none;
    width: 100%;
    aspect-ratio: unset;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-main {
    container-type: size;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-stage.loading {
    min-height: 120px;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-player-main .video-player-el {
    aspect-ratio: 16 / 9;
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
}

#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-waveform-wrap,
#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-transport-bar,
#episodeDialog.episode-dialog-fullscreen #episodeMediaPlayerRoot.episode-embedded-video-shell .video-markers-panel {
    flex: 0 0 auto;
    flex-shrink: 0;
}

#episodeDialog.episode-dialog-fullscreen .episode-dialog-foot {
    flex-shrink: 0;
}

.episode-media-empty {
    text-align: center;
    font-size: 0.88rem;
}

body.theme-dark .episode-dialog-tabs {
    background: linear-gradient(180deg, #1a2433 0%, #152030 100%);
}

body.theme-dark .episode-dialog-tab.active {
    background: #223047;
    border-bottom-color: #5b9cf5;
}

body.theme-dark #episodeDialogTabs .episode-dialog-tab.active {
    border-bottom-color: transparent;
}

body.theme-dark #episodeDialogTabs > .episode-dialog-tab-indicator {
    background: #5b9cf5;
}

body.theme-dark #episodeDialog .episode-dialog-tab + .episode-dialog-tab:not([hidden])::before {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.11) 24%,
        rgba(255, 255, 255, 0.11) 76%,
        rgba(255, 255, 255, 0) 100%
    );
}

body.theme-dark #episodeDialog .episode-dialog-tab.active + .episode-dialog-tab:not([hidden])::before,
body.theme-dark #episodeDialog .episode-dialog-tab + .episode-dialog-tab.active:not([hidden])::before {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.16) 24%,
        rgba(255, 255, 255, 0.16) 76%,
        rgba(255, 255, 255, 0) 100%
    );
}

.episode-dialog-preview {
    flex-shrink: 0;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
}

#episodeDialog .episode-dialog-body {
    overflow-anchor: none;
}

.episode-dialog-body {
    padding: 12px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    display: grid;
    gap: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.episode-dialog-foot {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    padding: 8px 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6fd 100%);
    min-height: 48px;
}

.episode-foot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
}

.episode-add-wrap,
.episode-nav {
    flex: 0 0 auto;
}

.episode-dialog-status {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.canvas-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: block;
}

body.theme-dark .canvas-frame {
    background: #111924;
}

.canvas-dialog-body {
    flex: 1;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    max-height: none;
    display: block;
}

body.theme-dark .canvas-dialog-body {
    background: #111924;
}

.episode-preview-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #f8fbff;
    text-align: center;
    min-height: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.episode-preview-image {
    width: auto;
    max-width: 100%;
    max-height: 230px;
    border-radius: 8px;
    border: 1px solid #d4deec;
    background: #ffffff;
    display: inline-block;
    cursor: zoom-in;
}

.episode-preview-image.no-upscale {
    width: auto;
    max-width: 100%;
    object-fit: initial;
}
.episode-preview-wrap.is-expanded {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 105px;
    max-height: none;
    overflow: visible;
}

.episode-preview-wrap.is-expanded .episode-preview-image {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center top;
    cursor: zoom-out;
}



#episodeDialogBody .episode-dialog-tabpanel[hidden] {
    display: none !important;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="general"].is-active {
    display: block;
    padding: 16px 14px 20px;
}
.episode-general-layout {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.episode-general-preview {
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
}

.episode-general-preview .episode-preview-wrap {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.episode-liveevent-previews {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.episode-liveevent-previews .episode-preview-image-youtube {
    object-fit: cover;
    object-position: center center;
}

.episode-preview-wrap-labeled {
    padding-top: 30px;
}

.episode-preview-label {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6b82;
    text-align: left;
    line-height: 1.2;
    pointer-events: none;
}

body.theme-dark .episode-preview-label {
    color: #9eb0c8;
}

.episode-preview-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.episode-preview-actions-youtube {
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.episode-preview-actions-youtube .episode-preview-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    padding: 2px 10px;
    border-radius: 8px;
    line-height: 1;
    box-sizing: border-box;
}

.episode-preview-actions-youtube .change-picture-link {
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    padding: 2px 10px;
}

.episode-preview-actions-youtube .episode-preview-action-btn.is-disabled-visual {
    opacity: 0.55;
    pointer-events: none;
}

.episode-youtube-thumbnail-upload-btn {
    min-width: 34px;
    width: auto;
    flex: 0 0 auto;
}

.episode-youtube-thumbnail-upload-btn.is-busy {
    opacity: 0.72;
}

.episode-youtube-thumbnail-upload-icon {
    display: block;
    width: 16px;
    height: 16px;
}

.episode-preview-wrap-youtube.is-uploading-thumbnail .episode-preview-image-youtube,
.episode-preview-wrap-youtube.is-preview-refreshing .episode-preview-image-youtube {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.episode-youtube-preview-upload-progress {
    width: 100%;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.episode-youtube-preview-upload-progress[hidden] {
    display: none !important;
}

.episode-youtube-preview-upload-progress-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #3f5f86;
    text-align: center;
}

.episode-youtube-preview-upload-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #d9e6f5;
    overflow: hidden;
}

.episode-youtube-preview-upload-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #3f74c8, #0f6ee8);
    transition: width 0.2s ease;
}

.episode-youtube-preview-upload-progress-bar.is-indeterminate {
    width: 42%;
    animation: episodeYoutubePreviewUploadIndeterminate 1.1s ease-in-out infinite;
}

@keyframes episodeYoutubePreviewUploadIndeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}


body.theme-dark .episode-youtube-preview-upload-progress-label {
    color: #9eb0c8;
}

body.theme-dark .episode-youtube-preview-upload-progress-track {
    background: rgba(255, 255, 255, 0.1);
}

.episode-general-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.episode-general-preview-meta .episode-kv {
    width: 100%;
    box-sizing: border-box;
}


.episode-general-layout.episode-general-layout-no-preview {
    grid-template-columns: minmax(0, 1fr);
}

.episode-general-layout-no-preview .episode-general-preview-meta {
    margin-top: 0;
}

.episode-general-youtube-sync {
    margin-top: 10px;
}

.episode-general-youtube-sync .btn {
    cursor: pointer;
}

.episode-general-youtube-sync .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.episode-youtube-upload-wrap {
    width: 100%;
}

.episode-youtube-upload-wrap .btn {
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.episode-youtube-upload-wrap .btn:disabled {
    cursor: not-allowed;
}

.episode-used-ai-kv .episode-kv-v {
    white-space: normal;
}

.episode-used-ai-switches {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.episode-used-ai-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.episode-used-ai-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background-color 0.18s ease;
}

.episode-used-ai-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease;
}

.episode-used-ai-switch.is-on .episode-used-ai-switch-track {
    background: #34c759;
}

.episode-used-ai-switch.is-on .episode-used-ai-switch-thumb {
    transform: translateX(14px);
}

.episode-used-ai-switch-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.2;
    color: #2f3742;
}

.episode-used-ai-switch:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.theme-dark .episode-used-ai-switch-track {
    background: #4b5563;
}

body.theme-dark .episode-used-ai-switch.is-on .episode-used-ai-switch-track {
    background: #30d158;
}

body.theme-dark .episode-used-ai-switch-label {
    color: #d7dde5;
}

.episode-used-ai-switch.is-unset {
    opacity: 0.55;
}

.episode-general-fields {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-filler-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.episode-filler-option {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fcfdff;
    padding: 10px 12px;
    min-width: 0;
}

.episode-filler-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    user-select: none;
}

.episode-filler-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    accent-color: var(--brand);
}

.episode-filler-option-text {
    line-height: 1.35;
    white-space: nowrap;
}

.episode-filler-option-label input:disabled {
    cursor: not-allowed;
}

.episode-filler-option-label input:disabled + .episode-filler-option-text {
    opacity: 0.65;
    cursor: not-allowed;
}

body.theme-dark .episode-filler-option {
    background: #1a2433;
    border-color: #3a4d66;
}

@media (max-width: 720px) {
    .episode-filler-fields {
        grid-template-columns: 1fr;
    }
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="general"] .episode-kv[data-field="beschreibung"] .episode-kv-v,
#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="general"] .episode-kv[data-field="besonderheiten"] .episode-kv-v {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="general"] .episode-kv[data-field="beschreibung"].editing .episode-kv-v {
    max-height: none;
    overflow: visible;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="general"] .episode-kv[data-field="beschreibung"].editing .episode-meta-textarea {
    min-height: 260px;
}

@media (max-width: 720px) {
    .episode-general-layout {
        grid-template-columns: 1fr;
    }

    .episode-general-preview {
        position: static;
    }
}


#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="entities"].is-active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 14px 20px;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="entities"] .episode-kv-grid:not(.episode-kv-grid-full) {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="entities"] .episode-kv-grid-full {
    margin-top: 8px;
}

.meta-list-input-wrap-with-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-list-input-wrap-with-user .meta-list-user-select {
    width: 100%;
}

.episode-kv-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 0.5fr);
    gap: 10px;
    align-items: start;
}

.episode-kv-grid.half {
    grid-template-columns: 1fr 1fr;
}

.episode-kv-grid-full {
    grid-template-columns: 1fr;
}

.episode-kv {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fcfdff;
    padding: 9px 10px 10px;
}

.episode-kv-k {
    font-size: 0.67rem;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.03em;
}

.episode-kv-v {
    font-size: 0.81rem;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
}

.book-info-row {
    grid-template-columns: 1fr;
    align-items: stretch !important;
    gap: 10px;
}

.book-id-kv {
    width: 100%;
    max-width: 100%;
    min-height: 0 !important;
    height: fit-content;
    align-self: stretch !important;
}

.book-id-kv .episode-kv-v {
    display: block;
    white-space: normal;
}

.episode-editable {
    cursor: text;
}

.episode-editable.editing {
    cursor: default;
}

.episode-editable.editing .episode-kv-v {
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.episode-meta-input,
.episode-meta-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 5px 8px;
    font-size: 0.82rem;
    line-height: 1.3;
    outline: none;
    height: 32px;
}

.episode-meta-textarea {
    min-height: 110px;
    height: auto;
    resize: vertical;
}

.episode-duration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.episode-duration-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.episode-duration-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.episode-duration-grid .episode-duration-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.episode-duration-grid .episode-meta-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.episode-meta-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.episode-meta-actions .btn {
    height: 26px;
    padding: 0 10px;
    cursor: pointer;
}

.episode-program-title-restore-btn {
    font-size: 0.76rem;
    white-space: nowrap;
}

.episode-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.episode-add-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.episode-nav-btn {
    min-width: 52px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.episode-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.change-picture-link {
    height: 28px;
    padding: 2px 10px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.change-picture-link:hover,
.change-picture-link:focus,
.change-picture-link:active,
.change-picture-link:visited {
    text-decoration: none;
}

.field-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.field-inline .field {
    margin: 0;
}

.field-inline .btn {
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
}

#addEpisodeBtn {
    background: #eaf4ff;
    border-color: #8fb3df;
    color: #1c4f8f;
}

body.theme-dark #addEpisodeBtn {
    background: #2b4770;
    border-color: #5f84b8;
    color: #dcecff;
}

.series-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.series-filter-row .field {
    margin: 0;
}

.menu-wrap {
    position: relative;
}

.menu-btn {
    height: 36px;
    min-width: 40px;
    padding: 0 12px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.series-sort-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(20, 34, 56, 0.18);
    padding: 6px;
    z-index: 35;
    display: none;
}

.series-sort-menu.open {
    display: block;
}

.series-sort-title {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 5px 8px 6px;
    font-weight: 700;
}

.series-sort-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.series-sort-option:hover {
    background: #eef4fc;
}

.series-sort-option.active {
    background: #e7f0ff;
    font-weight: 700;
}

.series-sort-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}

.editable-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    border: 4px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    background: #f8fbff;
}

.editable-label {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.editable-row.editable-active {
    border-color: #34c759;
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.16) 0%, rgba(52, 199, 89, 0.05) 100%);
}

.editable-row.editable-inactive {
    border-color: #ff3b30;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.16) 0%, rgba(255, 59, 48, 0.05) 100%);
}

@media (max-width: 1120px) {
    .workspace { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); }
    .panel-series { grid-column: 1; grid-row: 1; }
    .panel-meta { grid-column: 1; grid-row: 2; }
    .panel-episodes { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 980px) {
    body { padding-bottom: 0; }
    .app { height: calc(100vh - 70px); }
    .workspace { grid-template-columns: 1fr; }
    .panel-series,
    .panel-meta,
    .panel-episodes { grid-column: auto; grid-row: auto; }
    .series-list,
    .table-wrap {
        min-height: 0;
        max-height: 48vh;
    }
    .statusbar { display: none; }
    .toast-host { top: 10px; left: 50%; right: auto; transform: translateX(-50%); }
    .header-datetime .theme-lamp-btn,
    .header-datetime .header-live-preview-btn,
    .header-datetime .header-fullscreen-btn,
    .header-datetime .header-extend-btn,
    .header-datetime .header-reload-btn { display: none; }
    .mobile-only { display: inline-flex; }
}

body.mobile-accordion .panel .panel-head {
    cursor: pointer;
}

body.mobile-accordion .panel .panel-body {
    display: none !important;
}

body.mobile-accordion .panel.mobile-open .panel-body {
    display: block !important;
}

body.mobile-accordion .panel-series.mobile-open .panel-body,
body.mobile-accordion .panel-episodes.mobile-open .panel-body {
    display: flex !important;
}

@media (max-width: 700px) {
    .detail-grid { grid-template-columns: 1fr; }
    .episode-kv-grid,
    .episode-kv-grid.half { grid-template-columns: 1fr; }
    .book-info-row { grid-template-columns: 1fr; }
    .book-id-kv,
    .book-id-kv .episode-kv-v { width: 100%; max-width: 100%; }
    .field-inline { grid-template-columns: 1fr; }
    .header-datetime {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }
}

@media (max-width: 980px) {
    .episode-modal {
        padding: 0;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .episode-dialog {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        border: 0;
        display: flex;
        flex-direction: column;
    }

    .episode-dialog-head {
        padding: 6px 10px;
        cursor: default;
    }

    
.episode-dialog-tabs {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f6f9fd 0%, #eef4fb 100%);
}

.episode-dialog-tab {
    border: 0;
    background: transparent;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.episode-dialog-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.55);
}

.episode-dialog-tab.active {
    color: var(--text);
    background: #fff;
    border-bottom-color: #2a6df0;
}

.episode-dialog-tab[hidden] {
    display: none;
}

#episodeDialogMain {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

#episodeDialog > #episodeDialogBody.episode-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.episode-dialog-tabpanel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.episode-dialog-tabpanel.is-active {
    display: block;
}

.episode-dialog-preview {
        padding: 8px;
        flex-shrink: 0;
    }

    .episode-dialog-body {
        padding: 8px;
        max-height: none;
        flex: 1;
        min-height: 0;
        display: block;
        overflow-y: auto;
        overflow-anchor: none;
    }

    .episode-dialog-foot {
        padding: 8px 10px;
    }

    .episode-nav {
        margin-left: auto;
    }

    .image-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: 0;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .image-modal-content img {
        max-width: 100%;
        max-height: 100%;
    }

    .episode-picture-preview-content {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        padding: 12px;
    }

    .episode-picture-preview-content img {
        max-width: calc(100vw - 72px);
        max-height: calc(100vh - 150px);
        object-fit: contain;
    }
}

/* Video player */
.video-player-stage {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    min-height: min(473px, calc(100vh - 330px));
    background: var(--video-stage-bg, #000);
}
.video-player-main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--video-stage-bg, #000);
}


.video-audio-meters {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    gap: 2px;
    padding: 6px 1px;
    align-self: stretch;
}
.video-audio-meters-left {
    padding-left: 3px;
    padding-right: 1px;
}
.video-audio-meters-right {
    padding-right: 3px;
    padding-left: 1px;
}
.video-audio-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 1px;
    width: 16px;
    min-height: 0;
    flex: 0 0 auto;
}
.video-audio-meter.is-inactive {
    opacity: 0.38;
}
.video-audio-meter-track {
    position: relative;
    flex: 1 1 auto;
    width: 8px;
    min-height: 68px;
    border: 1px solid #333;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    background:
        linear-gradient(to top,
            rgba(60, 184, 90, 0.14) 0%,
            rgba(60, 184, 90, 0.14) var(--ebu-yellow-pct, 68%),
            rgba(232, 200, 48, 0.18) var(--ebu-yellow-pct, 68%),
            rgba(232, 200, 48, 0.18) var(--ebu-red-pct, 98%),
            rgba(224, 72, 72, 0.22) var(--ebu-red-pct, 98%),
            rgba(224, 72, 72, 0.22) 100%),
        #141414;
}
.video-audio-meter-track::before {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: var(--ebu-ref-pct, 60%);
    height: 1px;
    background: rgba(100, 165, 255, 0.9);
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 2px rgba(100, 165, 255, 0.5);
}
.video-audio-meter-fill {
    width: 100%;
    height: 0%;
    background: #3cb85a;
    transition: height 0.05s linear, background-color 0.08s linear;
}
.video-audio-meter-fill.is-green {
    background: #3cb85a;
}
.video-audio-meter-fill.is-yellow {
    background: #e8c830;
}
.video-audio-meter-fill.is-red {
    background: #e04848;
}
.video-audio-meter.is-inactive .video-audio-meter-fill {
    background: #3a3a3a;
    height: 0% !important;
}
.video-audio-meter-lufs {
    font-size: 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #777;
    line-height: 1;
    user-select: none;
    letter-spacing: -0.02em;
}
.video-audio-meter-unit {
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #555;
    line-height: 1;
    user-select: none;
    text-transform: uppercase;
}
.video-audio-meter-lufs.is-green {
    color: #6fd06f;
}
.video-audio-meter-lufs.is-yellow {
    color: #e8c830;
}
.video-audio-meter-lufs.is-red {
    color: #f07070;
}
.video-audio-meter-label {
    font-size: 9px;
    color: #666;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}
.video-player-stage.loading {
    min-height: min(473px, calc(100vh - 330px));
}
.video-player-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    background: #000;
    box-sizing: border-box;
}
.video-player-stage.loading .video-player-loading {
    display: flex;
}
.video-player-stage.loading .video-player-el {
    opacity: 0;
    pointer-events: none;
}
.video-player-loading-label {
    font-size: 13px;
    color: #bbb;
    letter-spacing: 0.02em;
    user-select: none;
}
.video-player-loading-track {
    width: 100%;
    max-width: 420px;
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    overflow: hidden;
}
.video-player-loading-bar {
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, #3d7ab8 0%, #5b9bd5 100%);
    border-radius: 3px;
    animation: video-waveform-progress-slide 1.25s ease-in-out infinite;
}

/* No native browser video chrome — custom transport + waveform below */
.video-player-el::-webkit-media-controls {
    display: none !important;
}
.video-player-el::-webkit-media-controls-enclosure {
    display: none !important;
}
.video-player-el::-webkit-media-controls-panel {
    display: none !important;
}
.video-player-el::-webkit-media-controls-overlay-play-button {
    display: none !important;
}
.video-player-el::-webkit-media-controls-start-playback-button {
    display: none !important;
}
.video-player-el {
    cursor: pointer;
    object-fit: contain;
    transform: translateZ(0);
}

.video-player-el {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    background: #000;
    vertical-align: top;
}

.video-pause-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: none;
    background: #000;
    z-index: 2;
}
.video-pause-frame.visible {
    display: block;
}

.video-waveform-wrap {
    touch-action: none;
}
.video-waveform-wrap.scrubbing {
    cursor: grabbing;
}
/* Video player waveform (below native controls) */
.video-waveform-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 28px;
    background: var(--video-waveform-bg, #111);
    border-top: 1px solid var(--video-waveform-border, #333);
    cursor: pointer;
    user-select: none;
    display: none;
    --wf-pad: 2%;
}

.video-waveform-wrap.generating {
    cursor: default;
    pointer-events: none;
}
.video-waveform-wrap.generating canvas,
.video-waveform-wrap.generating .video-waveform-playhead,
.video-waveform-wrap.generating .video-waveform-marker,
.video-waveform-wrap.generating .video-waveform-range,
.video-waveform-wrap.generating .video-waveform-cuts {
    opacity: 0;
    pointer-events: none;
}
.video-waveform-progress {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    background: var(--video-waveform-bg, #111);
    box-sizing: border-box;
}
.video-waveform-wrap.generating .video-waveform-progress {
    display: flex;
}
.video-waveform-progress-label {
    font-size: 12px;
    color: var(--video-waveform-progress-label, #bbb);
    letter-spacing: 0.02em;
    user-select: none;
}
.video-waveform-progress-track {
    width: 100%;
    max-width: 420px;
    height: 6px;
    background: var(--video-waveform-progress-bg, #2a2a2a);
    border-radius: 3px;
    overflow: hidden;
}
.video-waveform-progress-bar {
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, #3d7ab8 0%, #5b9bd5 100%);
    border-radius: 3px;
    animation: video-waveform-progress-slide 1.25s ease-in-out infinite;
}
@keyframes video-waveform-progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(380%); }
}
.video-waveform-wrap.visible {
    display: block;
}
.video-waveform-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.video-timeline-ruler {
    display: none;
    position: relative;
    width: 100%;
    height: 22px;
    background: var(--video-waveform-bg, #111);
    border-top: 1px solid #3a3a3a;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    overflow: visible;
    padding-bottom: 2px;
}
.video-timeline-ruler.visible {
    display: block;
}
.video-timeline-ruler.generating {
    opacity: 0.35;
    pointer-events: none;
}
.video-timeline-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.video-timeline-tick-mark {
    width: 1px;
    height: 4px;
    background: #777;
    flex: 0 0 auto;
}
.video-timeline-tick.is-major .video-timeline-tick-mark {
    height: 6px;
    background: #9a9a9a;
}
.video-timeline-tick.is-minor .video-timeline-tick-mark {
    height: 3px;
    background: #555;
}
.video-timeline-tick-label {
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: #8a8a8a;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}
.video-timeline-tick.is-minor .video-timeline-tick-label {
    display: none;
}
.video-timeline-tick.is-edge-start {
    transform: translateX(0);
    align-items: flex-start;
}
.video-timeline-tick.is-edge-end {
    transform: translateX(-100%);
    align-items: flex-end;
}

/* ── Timeline ruler marker overlay ───────────────────────────────── */
.video-timeline-ruler-ticks {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}
.video-timeline-ruler-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}
.vtl-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(76, 175, 80, 0.16);
    border-left: 1px solid rgba(76, 175, 80, 0.55);
    border-right: 1px solid rgba(229, 57, 53, 0.55);
    pointer-events: none;
}
.vtl-cut {
    position: absolute;
    top: 0;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        rgba(239, 68, 68, 0.32) 0px,
        rgba(239, 68, 68, 0.32) 3px,
        transparent 3px,
        transparent 6px
    );
    border-left: 1px solid rgba(239, 68, 68, 0.65);
    border-right: 1px solid rgba(239, 68, 68, 0.65);
    pointer-events: auto;
    cursor: pointer;
}
.vtl-cut.is-selected {
    background: repeating-linear-gradient(
        -45deg,
        rgba(239, 68, 68, 0.55) 0px,
        rgba(239, 68, 68, 0.55) 3px,
        rgba(239, 68, 68, 0.15) 3px,
        rgba(239, 68, 68, 0.15) 6px
    );
    border-color: rgba(239, 68, 68, 0.95);
}
/* TC IN / OUT / pending markers on ruler — same colors as waveform */
.vtl-marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    transform: translateX(-50%);
    pointer-events: none;
}
.vtl-marker-in {
    background: #4caf50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.9);
}
.vtl-marker-out {
    background: #e53935;
    box-shadow: 0 0 4px rgba(229, 57, 53, 0.9);
}
.vtl-marker-cut-pending {
    background: #ffb300;
    box-shadow: 0 0 6px rgba(255, 179, 0, 0.95);
}

.video-waveform-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff6b35;
    pointer-events: none;
    left: 0;
    transform: translateX(-1px);
    box-shadow: 0 0 4px rgba(255, 107, 53, 0.8);
}

.video-waveform-range {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.22);
    pointer-events: none;
    display: none;
    z-index: 1;
}
.video-waveform-range.visible {
    display: block;
}
.video-waveform-cuts {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.video-waveform-cut {
    position: absolute;
    top: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(220, 60, 60, 0.38),
            rgba(220, 60, 60, 0.38) 4px,
            rgba(120, 20, 20, 0.28) 4px,
            rgba(120, 20, 20, 0.28) 8px
        );
    border-left: 1px solid rgba(255, 120, 120, 0.9);
    border-right: 1px solid rgba(255, 120, 120, 0.9);
    box-sizing: border-box;
    pointer-events: auto;
    cursor: pointer;
}
.video-waveform-cut:hover,
.video-waveform-cut.is-selected {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 80, 80, 0.55),
            rgba(255, 80, 80, 0.55) 4px,
            rgba(160, 30, 30, 0.4) 4px,
            rgba(160, 30, 30, 0.4) 8px
        );
}
.video-waveform-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    pointer-events: none;
    display: none;
    z-index: 3;
}
.video-waveform-marker.visible {
    display: block;
}
.video-waveform-marker.in {
    background: #4caf50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.9);
}
.video-waveform-marker.out {
    background: #e53935;
    box-shadow: 0 0 4px rgba(229, 57, 53, 0.9);
}
.video-waveform-marker.cut-pending {
    background: #ffb300;
    width: 2px;
    box-shadow: 0 0 6px rgba(255, 179, 0, 0.95);
    z-index: 4;
}
.video-waveform-playhead {
    z-index: 5;
}
.video-transport-cut-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 4.5rem;
    color: #d0d0d0;
    border-color: #4a4a4a;
}
.video-transport-cut-btn .video-cut-icon {
    font-size: 14px;
    line-height: 1;
}
.video-transport-cut-btn.is-pending {
    background: #2a2418;
    border-color: #6b5a2e;
    color: #c4a45a;
    box-shadow: none;
}
.video-cuts-panel {
    margin: 0;
    padding: 6px 10px 8px;
    background: var(--video-chrome-bg, #1e1e1e);
    border-top: 1px solid var(--video-chrome-border, #333);
    color: #d8d8d8;
}
.video-cuts-panel[hidden] {
    display: none !important;
}
.video-cuts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.video-cuts-head-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.video-cuts-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9a9a;
}
.video-cuts-summary {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(180, 50, 50, 0.18);
    border: 1px solid rgba(200, 70, 70, 0.35);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #e08a8a;
    font-variant-numeric: tabular-nums;
}
.video-cuts-summary:empty {
    display: none;
}
.video-cuts-unsaved {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(196, 122, 26, 0.18);
    border: 1px solid rgba(196, 122, 26, 0.45);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d4a15a;
}
.video-cuts-unsaved[hidden] {
    display: none !important;
}
.video-cuts-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.video-cuts-save-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    white-space: nowrap;
}
.video-cuts-save-btn[hidden] {
    display: none !important;
}
.video-cuts-hint {
    margin: 0;
    font-size: 10px;
    line-height: 1.25;
    color: #7a7a7a;
    text-align: right;
}
.video-cuts-table-wrap {
    border: 1px solid #333;
    border-radius: 6px;
    overflow: auto;
    max-height: 112px;
    background: #1a1a1a;
}
.video-cuts-table-wrap[hidden] {
    display: none !important;
}
.video-cuts-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.video-cuts-table thead th {
    padding: 4px 8px;
    text-align: left;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #8c8c8c;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1;
}
.video-cuts-table tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid #2a2a2a;
    color: #d0d0d0;
    vertical-align: middle;
}
.video-cuts-table tbody tr:last-child td {
    border-bottom: 0;
}
.video-cuts-table tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}
.video-cuts-table tbody tr:hover td {
    background: #222;
}
.video-cuts-table tbody tr.is-selected td {
    background: rgba(255, 179, 0, 0.1);
}
.video-cuts-table tbody tr.is-selected td:first-child {
    box-shadow: inset 2px 0 0 #e0a800;
}
.video-cuts-col-num {
    width: 32px;
}
.video-cuts-col-tc {
    width: 28%;
}
.video-cuts-col-dur {
    width: 18%;
}
.video-cuts-col-filler {
    width: 72px;
    text-align: center !important;
}
.video-cuts-col-act {
    width: 36px;
    text-align: right !important;
}
.video-cuts-filler-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 2px 4px;
    border: 0;
    background: transparent;
    color: #9a9a9a;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.video-cuts-filler-toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.video-cuts-filler-toggle-ui {
    position: relative;
    width: 28px;
    height: 16px;
    border-radius: 999px;
    background: #3a3a3a;
    border: 1px solid #555;
    flex: 0 0 auto;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.video-cuts-filler-toggle-ui::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cfcfcf;
    transition: transform 0.12s ease, background 0.12s ease;
}
.video-cuts-filler-toggle.is-on {
    color: #d4b45a;
}
.video-cuts-filler-toggle.is-on .video-cuts-filler-toggle-ui {
    background: #5c4a1a;
    border-color: #e0a800;
}
.video-cuts-filler-toggle.is-on .video-cuts-filler-toggle-ui::after {
    transform: translateX(12px);
    background: #ffd666;
}
.video-cuts-filler-toggle:hover:not(:disabled),
.video-cuts-filler-toggle:focus-visible:not(:disabled) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
    color: #cfcfcf;
}
.video-cuts-filler-toggle.is-on:hover:not(:disabled),
.video-cuts-filler-toggle.is-on:focus-visible:not(:disabled) {
    color: #ffd666;
}
.video-cuts-filler-toggle-label {
    min-width: 22px;
    text-align: left;
}
.video-cuts-item-num {
    color: #7a7a7a;
    font-weight: 600;
}
.video-cuts-item-tc {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: #d4d4d4;
}
.video-cuts-item-dur {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #d4b45a;
    font-weight: 600;
}
.video-cuts-item-delete {
    appearance: none;
    border: 1px solid #3a3a3a;
    background: #242424;
    color: #b0b0b0;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.video-cuts-item-delete:hover:not(:disabled) {
    background: #2e2e2e;
    border-color: #555;
    color: #ececec;
}
.video-cuts-item-delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.video-cuts-table tbody:empty::after {
    content: none;
}
.video-cuts-panel.is-readonly .video-cuts-item-delete {
    display: none;
}

.video-transport-bar {
    display: none;
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    background: var(--video-chrome-bg, #1a1a1a);
    border-top: 1px solid var(--video-chrome-border, #333);
    box-sizing: border-box;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.video-transport-bar.visible {
    display: flex;
}
.video-transport-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-width: 0;
    line-height: 1.2;
    white-space: nowrap;
}
.video-transport-btn-primary {
    min-width: 72px;
    font-weight: 600;
}
#videoLast30Btn {
    min-width: 72px;
}
.video-markers-panel {
    padding: 10px 12px 12px;
    background: var(--video-chrome-bg, #1e1e1e);
    border-top: 1px solid var(--video-chrome-border, #333);
    color: var(--video-chrome-text, #eee);
}
.video-markers-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
}
.video-marker-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.video-marker-col.in {
    align-items: flex-start;
}
.video-marker-col.out {
    align-items: flex-end;
    text-align: right;
}
.video-marker-col.out .video-marker-input,
.video-marker-col.out .video-marker-btn {
    width: 100%;
    max-width: 200px;
}
.video-marker-col.in .video-marker-input {
    width: 100%;
    max-width: 200px;
}
.video-marker-tc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 200px;
}
.video-marker-tc-row .video-marker-input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: auto;
}
.video-marker-tc-row .video-marker-goto-btn {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
}
.video-marker-col.out .video-marker-tc-row {
    max-width: 200px;
    margin-left: auto;
}
.video-marker-col.out .video-marker-tc-row .video-marker-goto-btn,
.video-marker-col.out .video-marker-tc-row .video-marker-input {
    width: auto;
    max-width: none;
}

.video-marker-clear-btn {
    width: 100%;
    max-width: 200px;
}
.video-marker-fade-btn {
    width: 100%;
    max-width: 200px;
}
.video-marker-fade-btn.active {
    font-weight: 700;
    background: #1b5e20;
    border-color: #4caf50;
    color: #fff;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.85);
}
.video-marker-col.out .video-marker-fade-btn {
    width: 100%;
    max-width: 200px;
}
.video-marker-btn-row {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 200px;
}
.video-marker-btn-row .video-marker-btn {
    flex: 1 1 50%;
    width: 50%;
    max-width: none;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
}

.video-marker-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding-top: 2px;
    min-width: 168px;
    height: 100%;
}
.video-timecode-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--video-chrome-muted, #888);
}

.video-length-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}
.video-length-rows.video-length-inline {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.video-length-inline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.video-length-separator {
    color: var(--video-separator-color, #666);
    font-size: 13px;
    line-height: 1.2;
    padding-bottom: 1px;
    user-select: none;
}
.video-length-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.video-length-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--video-length-color, #ccc);
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.video-remaining-row {
    margin-top: 4px;
}
.video-live-timecode {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 20px;
    font-weight: 600;
    color: var(--video-timecode-color, #fff);
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.video-marker-label {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.video-marker-label.in { color: #4caf50; }
.video-marker-label.out { color: #f44336; }
.video-marker-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--video-input-border, #444);
    border-radius: 4px;
    background: var(--video-input-bg, #111);
    color: var(--video-input-text, #eee);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    box-sizing: border-box;
}
.video-marker-input.video-marker-input-readonly {
    opacity: 0.75;
    cursor: default;
}
.video-marker-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    margin-top: auto;
    padding-top: 6px;
}

.video-marker-center .video-marker-actions .btn {
    width: auto;
    flex: 0 1 auto;
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
    padding-left: 10px;
    padding-right: 10px;
}
.video-marker-btn {
    white-space: nowrap;
}



#videoDialog {
    position: fixed;
    --video-surface: #ffffff;
    --video-stage-bg: #000000;
    --video-chrome-bg: #f4f8fd;
    --video-chrome-border: var(--line);
    --video-chrome-text: var(--text);
    --video-chrome-muted: var(--muted);
    --video-input-bg: #ffffff;
    --video-input-border: var(--line-strong);
    --video-input-text: var(--text);
    --video-timecode-color: var(--text);
    --video-length-color: var(--muted);
    --video-separator-color: var(--muted);
    --video-waveform-bg: #eef2f8;
    --video-waveform-border: var(--line);
    --video-waveform-peak: #3d7ab8;
    --video-waveform-progress-bg: #d4deec;
    --video-waveform-progress-label: var(--muted);
    --video-modal-scrim: rgba(16, 29, 49, 0.22);
}
body.theme-dark #videoDialog {
    --video-surface: var(--panel);
    --video-chrome-bg: #1e1e1e;
    --video-chrome-border: #333333;
    --video-chrome-text: #eeeeee;
    --video-chrome-muted: #888888;
    --video-input-bg: #111111;
    --video-input-border: #444444;
    --video-input-text: #eeeeee;
    --video-timecode-color: #ffffff;
    --video-length-color: #cccccc;
    --video-separator-color: #666666;
    --video-waveform-bg: #111111;
    --video-waveform-border: #333333;
    --video-waveform-peak: #5b9bd5;
    --video-waveform-progress-bg: #2a2a2a;
    --video-waveform-progress-label: #bbbbbb;
    --video-modal-scrim: rgba(19, 31, 50, 0.28);
}
#videoDialog.video-dialog-custom-size {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
}
#videoDialog.video-dialog-custom-size #videoDialogBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#videoDialog.video-dialog-custom-size .video-player-stage {
    container-type: size;
    flex: 1 1 0;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
#videoDialog.video-dialog-custom-size .video-player-main {
    container-type: size;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#videoDialog.video-dialog-custom-size .video-player-stage.loading {
    min-height: 120px;
}
#videoDialog.video-dialog-custom-size .video-player-main .video-player-el {
    aspect-ratio: 16 / 9;
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}
#videoDialog.video-dialog-custom-size .video-waveform-wrap,
#videoDialog.video-dialog-custom-size .video-transport-bar {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}
#videoDialog.video-dialog-custom-size .video-markers-panel {
    flex-shrink: 0;
}
.video-dialog-resize-handle {
    position: absolute;
    z-index: 25;
    touch-action: none;
    user-select: none;
}
.video-dialog-resize-n {
    top: -4px;
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: n-resize;
}
.video-dialog-resize-s {
    bottom: -4px;
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: s-resize;
}
.video-dialog-resize-e {
    right: -4px;
    top: 10px;
    bottom: 10px;
    width: 8px;
    cursor: e-resize;
}
.video-dialog-resize-w {
    left: -4px;
    top: 10px;
    bottom: 10px;
    width: 8px;
    cursor: w-resize;
}
.video-dialog-resize-ne {
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    cursor: ne-resize;
}
.video-dialog-resize-se {
    bottom: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    cursor: se-resize;
}
.video-dialog-resize-sw {
    bottom: -5px;
    left: -5px;
    width: 14px;
    height: 14px;
    cursor: sw-resize;
}
.video-dialog-resize-nw {
    top: -5px;
    left: -5px;
    width: 14px;
    height: 14px;
    cursor: nw-resize;
}
#videoDialog.video-dialog-fullscreen .video-dialog-resize-handle {
    display: none;
}
.episode-dialog-head-actions,
.video-dialog-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#episodeModal.episode-modal-fullscreen {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

#episodeModal.episode-modal-fullscreen #episodeDialog.episode-dialog-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    border-radius: 0;
    border: 0;
}

#episodeDialog.episode-dialog-fullscreen .episode-dialog-head {
    cursor: default;
}

@media (max-width: 980px) {
    #episodeFullscreenBtn {
        display: none;
    }
}
#videoModal.video-modal-fullscreen {
    padding: 0;
    pointer-events: auto;
    background: var(--video-modal-scrim, rgba(19, 31, 50, 0.28));
}
#videoDialog.video-dialog-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    border-radius: 0;
    border: 0;
}
#videoDialog.video-dialog-fullscreen #videoDialogBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#videoDialog.video-dialog-fullscreen .video-player-stage {
    container-type: size;
    width: 100%;
    max-width: 100%;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000;
}
#videoDialog.video-dialog-fullscreen .video-player-main {
    container-type: size;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
#videoDialog.video-dialog-fullscreen .video-player-stage.loading {
    min-height: 0;
}
#videoDialog.video-dialog-fullscreen .video-player-main .video-player-el {
    aspect-ratio: 16 / 9;
    width: min(100cqw, calc(100cqh * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
}
#videoDialog.video-dialog-fullscreen .video-waveform-wrap,
#videoDialog.video-dialog-fullscreen .video-transport-bar {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}
#videoDialog.video-dialog-fullscreen .video-markers-panel {
    flex-shrink: 0;
}
/* Windowed video dialog: shrink video stage to fit viewport (like fullscreen) */
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .episode-dialog-head {
    flex-shrink: 0;
}
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-player-stage {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(473px, calc(100dvh - 340px));
    min-height: 80px;
}
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-player-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-player-stage.loading {
    min-height: 80px;
}
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-player-main .video-player-el {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-waveform-wrap,
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-transport-bar,
#videoDialog.episode-dialog:not(.video-dialog-fullscreen):not(.video-dialog-custom-size) .video-markers-panel {
    flex-shrink: 0;
}
/* Video dialog: no inner scrollbars (Edge) */
#videoModal.episode-modal {
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}
#videoModal.episode-modal #videoDialog {
    pointer-events: auto;
    z-index: 130;
}
#videoDialog.episode-dialog {
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#videoDialogBody.episode-dialog-body {
    overflow: hidden;
    min-height: 0;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--video-surface, #fff);
    max-height: none;
}
.video-player-main .video-player-el {
    max-height: min(473px, calc(100vh - 330px));
}
.video-marker-actions {
    flex-wrap: wrap;
}
#videoRegenerateWaveformBtn,
#videoDetectSilenceCutsBtn,
#videoDownloadProxyBtn {
    font-size: 12px;
}
.meta-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.meta-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
}
.meta-list-marker {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #9aa8b5;
    margin-top: 0.55em;
    flex-shrink: 0;
    opacity: 0.85;
}
.meta-list-text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}
.meta-list-field .v,
.meta-list-field .episode-kv-v,
.meta-list-field .editable-meta-value {
    white-space: normal;
}
.meta-list-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
}

.editable-meta.editing .editable-meta-value,
.episode-editable.editing .episode-kv-v,
.meta-list-row,
.meta-list-input-wrap {
    overflow: visible;
}
.meta-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-list-input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.editable-meta-value .editable-genre-wrap {
    margin-bottom: 4px;
}
.editable-meta-value .editable-genre-wrap .editable-meta-input {
    width: 100%;
    min-width: 0;
}
.meta-list-row .meta-list-input {
    width: 100%;
    min-width: 0;
}
.meta-list-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #c5d3e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 35, 60, 0.12);
}
.meta-list-suggestion {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.meta-list-suggestion:hover,
.meta-list-suggestion.is-active {
    background: #e8f0fa;
}
body.theme-dark .meta-list-suggestions {
    border-color: #3a4d66;
    background: #1a2433;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
body.theme-dark .meta-list-suggestion:hover,
body.theme-dark .meta-list-suggestion.is-active {
    background: #243247;
}
.meta-list-remove-btn {
    flex-shrink: 0;
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    opacity: 0.75;
}
.meta-list-remove-btn:hover {
    opacity: 1;
}
.editable-meta-select {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid #c5d3e3;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}
body.theme-dark .editable-meta-select {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}
.meta-list-add-btn {
    align-self: flex-start;
    font-size: 11px;
    padding: 3px 10px;
    margin-top: 2px;
}
body.theme-dark .meta-list-marker {
    background: #7f8c98;
}


.backup-panel-body {
    min-height: 0;
    overflow: auto;
}

.backup-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.backup-list-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.backup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.backup-table th,
.backup-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e6edf5;
}

.backup-table th {
    position: sticky;
    top: 0;
    background: #f4f8fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.backup-row {
    cursor: context-menu;
}

.backup-row:hover td {
    background: #f7fbff;
}

.backup-context-delete {
    color: #b42318;
}

body.theme-dark .backup-list-wrap {
    background: #152235;
    border-color: #2a3d57;
}

body.theme-dark .backup-table th {
    background: #1b2c42;
}

body.theme-dark .backup-table td {
    border-bottom-color: #2a3d57;
}

body.theme-dark .backup-row:hover td {
    background: #1a2d45;
}

/* Admin Backend (unified admin popup) */
.admin-backend-modal.episode-modal.open {
    align-items: stretch;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.admin-backend-modal .admin-backend-dialog {
    width: min(1080px, calc(100vw - 24px));
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    background: #ffffff;
    border: 1px solid #c6d3e5;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-self: center;
}

.admin-backend-head {
    position: relative;
    z-index: 6;
    flex: none;
    padding: 10px 14px;
    background: linear-gradient(180deg, #f4f8fd 0%, #eaf1fb 100%);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: none;
}

.admin-backend-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.admin-backend-tabs {
    position: relative;
    z-index: 5;
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    flex: none;
}

.admin-backend-tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.admin-backend-tab:hover {
    color: var(--text);
    background: rgba(47, 111, 235, 0.06);
}

.admin-backend-tab.is-active {
    color: var(--brand);
    background: #ffffff;
    border-color: #c6d3e5;
    box-shadow: 0 1px 2px rgba(16, 29, 49, 0.08);
}

.admin-backend-panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-backend-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: none;
    flex-direction: column;
}

.admin-backend-panel.is-active {
    display: flex;
}

.admin-backend-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

.admin-backend-audit-toolbar {
    flex: none;
    padding: 10px 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.global-audit-user-select {
    min-width: 200px;
    max-width: min(320px, 42vw);
}

.job-queue-split-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    height: 100%;
    align-items: stretch;
    box-sizing: border-box;
    padding: 12px;
    overflow: hidden;
}

.job-queue-split-col {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel, #fff);
}

.job-queue-split-col .proxy-queue-panel-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

@media (max-width: 1100px) {
    .job-queue-split-panel {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    .job-queue-split-col {
        min-height: 420px;
    }
}

.proxy-queue-panel-body {
    min-height: 0;
    overflow: auto;
}

.proxy-queue-panel-body .maintenance-admin-card {
    gap: 16px;
}

.proxy-queue-panel-body .proxy-queue-toolbar {
    margin-bottom: 0;
    justify-content: space-between;
}

.proxy-queue-panel-body .proxy-queue-ladder {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.proxy-queue-panel-body .proxy-queue-section-title {
    margin: 0 0 10px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text);
}

.proxy-queue-panel-body .proxy-queue-history-scroll {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: auto;
    background: #fff;
}

.proxy-queue-panel-body .proxy-queue-log-details {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
}

.proxy-queue-panel-body .proxy-queue-worker-hint {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--brand-soft) 55%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.playout-yearpart-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 12px !important;
}

.playout-yearpart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    flex: none;
}

.playout-yearpart-toolbar-secondary {
    margin-top: 2px;
}

.playout-yearpart-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.playout-yearpart-select,
.playout-yearpart-name-input {
    min-width: min(320px, 100%);
    flex: 1 1 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.89rem;
}

.playout-yearpart-grid-wrap {
    flex: 1 1 auto;
    min-height: 240px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fcfdff;
    padding: 8px;
}

.playout-yearpart-grid-wrap .schedule-grid-scroll {
    max-height: none;
}

.playout-yearpart-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: none;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.playout-yearpart-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

#playoutYearpartSaveBtn.is-dirty:not(:disabled) {
    background: #0f6ee8;
    border-color: #0f6ee8;
    color: #fff;
}

#playoutYearpartSaveBtn.is-dirty:not(:disabled):hover {
    background: #0b5bc4;
    border-color: #0b5bc4;
}

body.theme-dark .playout-yearpart-grid-wrap {
    background: #1a2433;
    border-color: #3a4d66;
}

body.theme-dark .playout-yearpart-select,
body.theme-dark .playout-yearpart-name-input {
    background: #1a2433;
    border-color: #3a4d66;
    color: #e8eef5;
}

body.theme-dark #playoutYearpartSaveBtn.is-dirty:not(:disabled) {
    background: #3d8ef0;
    border-color: #3d8ef0;
}

.playout-daypart-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 12px !important;
}

.playout-daypart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    flex: none;
}

.playout-daypart-toolbar-secondary {
    margin-top: 2px;
}

.playout-daypart-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.playout-daypart-select,
.playout-daypart-name-input {
    min-width: min(320px, 100%);
    flex: 1 1 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.89rem;
}

.playout-daypart-grid-wrap {
    flex: 1 1 auto;
    min-height: 240px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fcfdff;
    padding: 8px;
}

.playout-daypart-grid-wrap .schedule-grid-scroll {
    max-height: none;
}

.playout-daypart-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: none;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.playout-daypart-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

#playoutDaypartSaveBtn.is-dirty:not(:disabled) {
    background: #0f6ee8;
    border-color: #0f6ee8;
    color: #fff;
}

#playoutDaypartSaveBtn.is-dirty:not(:disabled):hover {
    background: #0b5bc4;
    border-color: #0b5bc4;
}

body.theme-dark .playout-daypart-grid-wrap {
    background: #1a2433;
    border-color: #3a4d66;
}

body.theme-dark .playout-daypart-select,
body.theme-dark .playout-daypart-name-input {
    background: #1a2433;
    border-color: #3a4d66;
    color: #e8eef5;
}

body.theme-dark #playoutDaypartSaveBtn.is-dirty:not(:disabled) {
    background: #3d8ef0;
    border-color: #3d8ef0;
}

.youtube-auth-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.youtube-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.youtube-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.youtube-auth-field label {
    font-size: 13px;
    font-weight: 600;
}

.youtube-auth-field input,
.youtube-auth-field textarea,
.youtube-auth-readonly {
    width: 100%;
    border: 1px solid #d5e1ef;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

.youtube-auth-field textarea {
    min-height: 72px;
    resize: vertical;
}

.youtube-auth-readonly {
    color: #22354b;
    background: #f3f6fa;
    cursor: default;
    user-select: text;
}

.youtube-auth-secret-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.youtube-auth-secret-wrap input {
    flex: 1 1 auto;
    min-width: 0;
}

.youtube-auth-reveal-btn {
    flex: 0 0 auto;
    width: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.youtube-auth-reveal-btn:hover {
    background: #e2ebf6;
}

.youtube-auth-reveal-btn:active,
.youtube-auth-reveal-btn.is-held {
    background: #d5e3f2;
}

.youtube-auth-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.youtube-auth-status {
    font-size: 0.83rem;
    color: var(--muted);
}

.youtube-auth-status.error {
    color: #8a1f1f;
}

body.theme-dark .youtube-auth-field input,
body.theme-dark .youtube-auth-field textarea,
body.theme-dark .youtube-auth-readonly,
body.theme-dark .youtube-auth-reveal-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}

body.theme-dark .youtube-auth-reveal-btn:hover,
body.theme-dark .youtube-auth-reveal-btn.is-held {
    background: rgba(255, 255, 255, 0.08);
}


body.theme-dark .admin-backend-modal .admin-backend-dialog {
    background: var(--panel);
    border-color: var(--line);
}

body.theme-dark .admin-backend-head {
    background: linear-gradient(180deg, #1e2a3a 0%, #172333 100%);
}

body.theme-dark .admin-backend-tabs {
    background: #141f2d;
}

body.theme-dark .admin-backend-tab.is-active {
    background: var(--panel);
    border-color: var(--line);
}
.proxy-queue-dialog {
    width: min(960px, 96vw);
    max-height: min(86vh, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
}
.proxy-queue-dialog .user-access-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}
.proxy-queue-history-scroll {
    max-height: min(42vh, 380px);
    flex: none;
}
.proxy-queue-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.proxy-queue-table th, .proxy-queue-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.proxy-queue-table th { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.proxy-queue-progress { display: inline-block; width: 88px; height: 8px; border-radius: 999px; background: #e6edf5; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.proxy-queue-progress > span { display: block; height: 100%; background: var(--brand); }
.proxy-queue-row-pending { cursor: context-menu; }
.proxy-queue-row-pending:hover td { background: rgba(47, 111, 235, 0.06); }
.proxy-queue-context-menu { min-width: 168px; }
.proxy-queue-context-menu .episode-context-copy + .episode-context-copy { margin-top: 6px; }
.proxy-queue-context-delete { border-color: #e3b4b4; background: #fff5f5; color: #8a1f1f; }
.proxy-queue-context-delete:hover { background: #fde8e8; }
.create-proxy-btn {
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.remove-assignment-btn {
    text-align: center;
}
.proxy-create-progress-btn {
    position: relative;
    overflow: hidden;
    min-width: 152px;
    padding: 0;
    cursor: pointer;
    background: #e6edf5;
    border-color: var(--line-strong);
}
body.theme-dark .proxy-create-progress-btn {
    background: #2a3441;
}
.proxy-create-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--brand);
    opacity: 0.42;
    transition: width 0.45s ease;
    pointer-events: none;
}
.proxy-create-progress-label {
    position: relative;
    z-index: 1;
    display: block;
    padding: 6px 12px;
    line-height: 1.25;
    text-align: center;
}
.proxy-create-queued-btn .proxy-create-progress-label {
    color: var(--muted);
    font-weight: 600;
}

.original-assign-dialog { width: min(760px, 96vw); max-height: 86vh; }
.original-assign-meta { font-size: 0.82rem; margin-bottom: 8px; min-height: 1.2em; }
.original-assign-list {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fcfdff;
    max-height: min(52vh, 420px);
    overflow: auto;
}
.original-assign-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.original-assign-item:last-child { border-bottom: 0; }
.original-assign-item:hover,
.original-assign-item:focus-visible {
    background: #eef4fc;
    outline: none;
}
.original-assign-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-word;
}
.original-assign-item-meta {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}
body.theme-dark .original-assign-list { background: #1a2433; }
body.theme-dark .original-assign-item:hover,
body.theme-dark .original-assign-item:focus-visible { background: #243247; }

.proxy-queue-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.proxy-queue-worker-hint { margin-bottom: 10px; }
.proxy-queue-log-details { margin-bottom: 12px; }
.proxy-queue-log-pre { white-space: pre-wrap; font-size: 0.78rem; margin: 8px 0 0; }
.proxy-queue-active-section { margin-bottom: 16px; }
.proxy-queue-section-title {
    margin: 0 0 10px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.proxy-queue-active-hint { margin: 0 0 10px; font-size: 0.82rem; }
.proxy-queue-active-empty { padding: 12px 0; }
.proxy-queue-ladder {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--panel);
}
.proxy-queue-step {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
}
.proxy-queue-step:first-child { border-top: none; }
.proxy-queue-step-rail {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: rgba(47, 111, 235, 0.04);
    border-right: 1px solid var(--line);
}
.proxy-queue-step-running .proxy-queue-step-rail { background: rgba(34, 139, 87, 0.08); }
.proxy-queue-step-pending { cursor: context-menu; }
.proxy-queue-step-pending:hover .proxy-queue-step-body { background: rgba(47, 111, 235, 0.05); }
.proxy-queue-connector {
    position: absolute;
    top: -14px;
    left: 50%;
    width: 2px;
    height: 14px;
    transform: translateX(-50%);
    background: var(--line-strong);
}
.proxy-queue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.proxy-queue-badge-now {
    color: #0d5f3d;
    background: #e8f8ef;
    border-color: #9fd4b6;
}
.proxy-queue-badge-next {
    color: #1f4f9a;
    background: #e8f1ff;
    border-color: #a9c4ef;
}
.proxy-queue-badge-wait {
    min-width: 28px;
    width: 28px;
    padding: 0;
    border-radius: 50%;
    color: var(--muted);
    background: #eef3f8;
    border-color: var(--line);
    font-size: 0.8rem;
    text-transform: none;
}
.proxy-queue-step-body { padding: 12px 14px; min-width: 0; }
.proxy-queue-step-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 4px;
}
.proxy-queue-step-episode { font-size: 0.95rem; letter-spacing: 0.02em; }
.proxy-queue-step-status {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}
.proxy-queue-step-running .proxy-queue-step-status { color: #0d5f3d; }
.proxy-queue-step-meta { font-size: 0.84rem; color: var(--text); margin-bottom: 6px; }
.proxy-queue-step-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.proxy-queue-step-progress-label { font-size: 0.8rem; color: var(--muted); min-width: 2.5em; }
.proxy-queue-step-foot { font-size: 0.76rem; }
.proxy-queue-history-section { margin-top: 4px; }
.proxy-queue-history-summary { cursor: pointer; list-style: none; }
.proxy-queue-history-summary::-webkit-details-marker { display: none; }
.proxy-queue-history-table { margin-top: 8px; }
.proxy-queue-history-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.proxy-queue-history-error td {
    font-size: 0.82rem;
    color: #b42318;
    padding-top: 0;
    border-bottom: 1px solid var(--line);
}
body.theme-dark .proxy-queue-badge-now { color: #9fe0bc; background: rgba(34, 139, 87, 0.18); border-color: rgba(34, 139, 87, 0.45); }
body.theme-dark .proxy-queue-badge-next { color: #b8d0ff; background: rgba(47, 111, 235, 0.18); border-color: rgba(47, 111, 235, 0.45); }
body.theme-dark .proxy-queue-badge-wait { background: rgba(255, 255, 255, 0.06); }
body.theme-dark .proxy-queue-step-running .proxy-queue-step-rail { background: rgba(34, 139, 87, 0.14); }

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="audit"].is-active {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px 20px;
    align-items: stretch;
}

.episode-audit-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.episode-audit-section {
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #f8fbff;
    overflow: hidden;
}

.episode-audit-heading {
    margin: 0;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #d7e1ef;
    background: #eef4fb;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #35506d;
}

.episode-audit-meta-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #e3ebf5;
}

.episode-audit-meta-row:last-child {
    border-bottom: none;
}

.episode-audit-meta-k {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4a6078;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.episode-audit-meta-v {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: baseline;
    min-width: 0;
}

.episode-audit-meta-time {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    color: #1f3348;
    font-weight: 600;
}

.episode-audit-meta-user {
    color: #516579;
}

.episode-audit-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
}

.episode-audit-log-entry {
    border: 1px solid #dbe6f2;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.episode-audit-log-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 10px 12px;
    background: #f3f8fd;
    border-bottom: 1px solid #e3ebf5;
}

.episode-audit-log-action {
    font-weight: 600;
    color: #24384d;
}

.episode-audit-log-meta {
    font-size: 0.95rem;
    color: #5a7088;
    font-variant-numeric: tabular-nums;
}

.episode-audit-changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.episode-audit-changes-table th,
.episode-audit-changes-table td {
    padding: 8px 12px;
    border-top: 1px solid #edf2f8;
    vertical-align: top;
    text-align: left;
}

.episode-audit-changes-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5a7088;
    background: #fafcfe;
}

.episode-audit-old {
    color: #8a4a4a;
    word-break: break-word;
}

.episode-audit-new {
    color: #2f6b45;
    word-break: break-word;
}

.episode-audit-loading,
.episode-audit-empty,
.episode-audit-error {
    padding: 18px 16px;
    color: #516579;
}

.episode-audit-error {
    color: #b42318;
}

body.theme-dark .episode-audit-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .episode-audit-heading {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #c8d8ea;
}

body.theme-dark .episode-audit-meta-row {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .episode-audit-meta-k {
    color: #9eb2c8;
}

body.theme-dark .episode-audit-meta-time {
    color: #e6eef8;
}

body.theme-dark .episode-audit-meta-user,
body.theme-dark .episode-audit-log-meta,
body.theme-dark .episode-audit-loading,
body.theme-dark .episode-audit-empty {
    color: #9eb2c8;
}

body.theme-dark .episode-audit-log-entry {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .episode-audit-log-head {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .episode-audit-log-action {
    color: #e6eef8;
}

body.theme-dark .episode-audit-changes-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #9eb2c8;
}

body.theme-dark .episode-audit-changes-table td {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .episode-audit-old {
    color: #f0a8a8;
}

body.theme-dark .episode-audit-new {
    color: #8fd4a8;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="scheduling"].is-active {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px 20px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Keep Allowed Period / Broadcasts / Forced Airings at natural height — never shrink/clip. */
#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="scheduling"].is-active > .episode-scheduling-section,
#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="scheduling"].is-active .episode-scheduling-subpanel > .episode-scheduling-section {
    flex: 0 0 auto;
    min-height: auto;
}

.episode-scheduling-subnav {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 4px;
    border-bottom: 1px solid #d5e1ef;
    box-sizing: border-box;
}

.episode-scheduling-subtab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #5a7290;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px 10px;
    margin: 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.episode-scheduling-subtab:hover {
    color: #35506d;
}

.episode-scheduling-subtab.active {
    color: #1f3348;
    border-bottom-color: #3b6ea5;
}

.episode-scheduling-subpanel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
}

.episode-scheduling-subpanel[hidden] {
    display: none !important;
}

.episode-scheduling-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 14px 16px;
    width: 100%;
    max-width: none;
    padding: 0 16px 16px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #f8fbff;
    overflow: hidden;
    box-sizing: border-box;
}

.episode-scheduling-heading {
    grid-column: 1 / -1;
    margin: 0 -16px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #d7e1ef;
    background: #eef4fb;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #35506d;
}

.episode-date-field,
.episode-broadcasts-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    align-self: start;
}

.episode-date-label {
    min-height: 1.15em;
    line-height: 1.15;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.episode-date-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.episode-date-input-wrap,
.episode-date-input {
    min-height: 36px;
    box-sizing: border-box;
}

.episode-date-input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.episode-date-input {
    width: 100%;
    min-width: 0;
}

.episode-date-placeholder {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1;
    user-select: none;
}

.episode-date-input-wrap.is-empty .episode-date-input {
    color: transparent;
}

.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit,
.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-fields-wrapper,
.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-text,
.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-month-field,
.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-day-field,
.episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-year-field {
    color: transparent;
}

.episode-date-input-wrap:not(.is-empty) .episode-date-placeholder {
    display: none;
}
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-fields-wrapper,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-text,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-month-field,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-day-field,
body.theme-dark .episode-date-input-wrap.is-empty .episode-date-input::-webkit-datetime-edit-year-field {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit-fields-wrapper,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit-text,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit-month-field,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit-day-field,
body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-input::-webkit-datetime-edit-year-field {
    color: #e8eff8 !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

body.theme-dark .episode-date-input-wrap:not(.is-empty) .episode-date-placeholder {
    display: none !important;
}


.episode-date-clear-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
    color: var(--muted);
}

.episode-date-clear-btn:hover:not(:disabled) {
    color: var(--danger, #c0392b);
}

.episode-date-clear-btn[hidden] {
    display: none;
}

.episode-date-validation-error {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: var(--danger, #c0392b);
}

@media (max-width: 560px) {
    .episode-scheduling-section {
        grid-template-columns: 1fr;
    }
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="music"].is-active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 14px 20px;
}

.episode-music-section,
.episode-entities-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.episode-entities-toolbar {
    display: flex;
    justify-content: flex-end;
}

.episode-entities-copy-prev:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.episode-music-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.episode-music-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.episode-music-copy-prev:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.episode-music-heading {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.episode-music-tracks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-music-empty {
    margin: 0;
    font-size: 0.9rem;
}

.episode-music-track {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fcfdff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-music-track-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.episode-music-track-no {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}

.episode-music-track-delete {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
    color: var(--muted);
    border: 1px solid var(--line);
    background: transparent;
}

.episode-music-track-delete:hover:not(:disabled) {
    color: var(--danger, #c0392b);
}

.episode-music-track-head.is-clickable {
    cursor: pointer;
}

.episode-music-track-no {
    cursor: pointer;
    user-select: none;
}

.episode-music-track.is-collapsed .episode-music-track-body {
    display: none;
}

.episode-music-track-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.episode-music-track-save {
    min-width: 88px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.episode-music-track-save:disabled {
    background: #e8ecf1;
    border-color: #d5dbe3;
    color: #8b95a5;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.85;
}

.episode-music-track-save.is-dirty:not(:disabled) {
    background: #1f9d55;
    border-color: #18844a;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.35);
}

.episode-music-track-save.is-dirty:not(:disabled):hover {
    background: #18844a;
    border-color: #157a40;
    box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.45);
}

.episode-music-track-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.episode-music-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.episode-music-field-full {
    grid-column: 1 / -1;
}

.episode-music-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.episode-music-field .episode-meta-input,
.episode-music-field .episode-meta-textarea,
.episode-music-field select.episode-meta-input {
    width: 100%;
    min-width: 0;
}

.episode-music-field .episode-meta-textarea {
    min-height: 64px;
    resize: vertical;
}

.episode-music-readonly {
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .episode-music-track-grid {
        grid-template-columns: 1fr;
    }
}

body.theme-dark .episode-music-track-save:disabled {
    background: #2a3548;
    border-color: #3a475c;
    color: #8b95a5;
}

body.theme-dark .episode-music-track-save.is-dirty:not(:disabled) {
    background: #18844a;
    border-color: #22c55e;
    color: #ecfdf3;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
}

body.theme-dark .episode-music-track-save.is-dirty:not(:disabled):hover {
    background: #157a40;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.38);
}

body.theme-dark .episode-music-track {
    background: rgba(255, 255, 255, 0.03);
}

.episode-mediainfo-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px 8px;
}

.episode-mediainfo-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.episode-mediainfo-heading {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.episode-mediainfo-meta {
    font-size: 0.78rem;
}

.episode-mediainfo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
}

.episode-mediainfo-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fcfdff;
}

.episode-mediainfo-k {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.episode-mediainfo-v {
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.episode-mediainfo-section.is-empty {
    flex: 1 1 auto;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.episode-mediainfo-empty {
    margin: 0;
    font-size: 0.9rem;
}

.episode-mediainfo-section.is-empty .episode-mediainfo-empty {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--muted);
}

@media (max-width: 720px) {
    .episode-mediainfo-grid {
        grid-template-columns: 1fr;
    }
}

body.theme-dark .episode-mediainfo-row {
    background: rgba(255, 255, 255, 0.03);
}

.episode-youtube-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.episode-youtube-section.is-empty {
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.episode-youtube-empty {
    margin: 0;
    text-align: center;
}

.episode-youtube-player-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
}

.episode-youtube-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.episode-youtube-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.episode-youtube-id-label {
    font-size: 12px;
}

.episode-youtube-id {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
}

.episode-youtube-link {
    margin-left: auto;
    font-size: 13px;
    color: var(--accent, #2f6fed);
    text-decoration: none;
}

.episode-youtube-link:hover {
    text-decoration: underline;
}
.episode-youtube-section.is-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 180px;
}

.episode-youtube-create-btn {
    min-width: 220px;
}

.episode-youtube-create-form,
.episode-youtube-create-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-youtube-create-section {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.episode-youtube-create-form {
    flex: 1 1 auto;
    min-height: 0;
}

.episode-youtube-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.episode-youtube-field label {
    font-size: 13px;
    font-weight: 600;
}

.episode-youtube-char-count {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
}

.episode-youtube-readonly,
.episode-youtube-field input,
.episode-youtube-field textarea,
.episode-youtube-field select {
    width: 100%;
    border: 1px solid #d5e1ef;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

.episode-youtube-readonly {
    color: #22354b;
    background: #f3f6fa;
}

.episode-youtube-field textarea {
    min-height: 280px;
    resize: vertical;
}

.episode-youtube-field-grow {
    flex: 1 1 0;
    min-height: 280px;
    overflow: hidden;
}

.episode-youtube-field-grow textarea {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    resize: none;
    overflow: auto;
}

.episode-youtube-create-actions,
.episode-youtube-manage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    flex-shrink: 0;
}

.episode-youtube-manage-actions {
    justify-content: space-between;
}

.episode-youtube-manage-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.episode-youtube-manage-status {
    font-size: 0.83rem;
    color: var(--muted);
    min-height: 1.2em;
}

.episode-youtube-manage-status.error {
    color: #8a1f1f;
}

.episode-youtube-manage-archive {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #f6f9fd;
}

.episode-youtube-archive-online {
    font-size: 0.92rem;
    font-weight: 600;
    color: #24364f;
    line-height: 1.45;
}

.episode-youtube-online-duration-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e4edf8;
    color: #35506d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.episode-youtube-archive-views {
    font-size: 0.88rem;
    color: var(--muted);
}

.episode-youtube-manage-actions-archive {
    justify-content: flex-end;
}

body.theme-dark .episode-youtube-manage-archive {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

body.theme-dark .episode-youtube-archive-online {
    color: var(--text);
}

body.theme-dark .episode-youtube-online-duration-tag {
    background: rgba(255, 255, 255, 0.08);
    color: #c5d4e8;
}

.episode-youtube-create-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(3px);
    border-radius: 10px;
}

.episode-youtube-create-overlay[hidden] {
    display: none !important;
}

.episode-youtube-create-overlay-card {
    width: min(340px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #d5e1ef;
    box-shadow: 0 10px 28px rgba(24, 44, 74, 0.12);
}

.episode-youtube-create-overlay-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #24364f;
    text-align: center;
}

.episode-youtube-create-overlay.is-error .episode-youtube-create-overlay-label {
    color: #8a1f1f;
}

.episode-youtube-create-overlay-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #d8e3f0;
    overflow: hidden;
}

.episode-youtube-create-overlay-track[hidden] {
    display: none !important;
}

.episode-youtube-create-overlay-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3f74c8 0%, #5f94df 100%);
    transition: width 0.12s ease;
}

.episode-youtube-create-overlay-bar.is-indeterminate {
    width: 42%;
    animation: episodeYoutubeCreateOverlayIndeterminate 1.15s ease-in-out infinite;
}

@keyframes episodeYoutubeCreateOverlayIndeterminate {
    0% {
        transform: translateX(-130%);
    }
    100% {
        transform: translateX(330%);
    }
}

.episode-youtube-create-section.is-busy .episode-youtube-create-form,
.episode-youtube-create-section.is-busy .episode-youtube-create-actions {
    pointer-events: none;
}

body.theme-dark .episode-youtube-create-overlay {
    background: rgba(16, 22, 31, 0.82);
}

body.theme-dark .episode-youtube-create-overlay-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

body.theme-dark .episode-youtube-create-overlay-label {
    color: var(--text);
}

body.theme-dark .episode-youtube-create-overlay-track {
    background: rgba(255, 255, 255, 0.12);
}

body.theme-dark .episode-youtube-readonly,
body.theme-dark .episode-youtube-field input,
body.theme-dark .episode-youtube-field textarea,
body.theme-dark .episode-youtube-field select {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}


body.theme-dark .episode-youtube-id {
    background: rgba(255, 255, 255, 0.08);
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="youtube"].is-active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

#episodeDialogBody .episode-dialog-tabpanel[data-episode-tab-panel="youtube"].is-active:has(.episode-youtube-create-section) {
    overflow: hidden;
}

.episode-scheduling-part-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin: 2px -16px 0;
    padding: 12px 16px 0;
    border-top: 1px solid #d7e1ef;
}

.episode-scheduling-part-btn {
    flex: 1 1 0;
    min-height: 36px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.episode-scheduling-part-btn.has-data {
    background: #22a559;
    border-color: #1a8f4a;
    color: #fff;
}

.episode-scheduling-part-btn.has-data:hover {
    background: #1f9850;
    border-color: #178542;
    color: #fff;
}

.schedule-grid-dialog {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #c6d3e5;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.28);
    overflow: hidden;
}

.schedule-grid-dialog-wide {
    width: min(1180px, calc(100vw - 24px));
}

.schedule-grid-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2eaf4;
    background: #f7faff;
}

.schedule-grid-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.schedule-grid-body {
    padding: 12px 14px;
    overflow: auto;
    min-height: 320px;
    max-height: calc(100vh - 180px);
}

.schedule-grid-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 14px;
    border-top: 1px solid #e2eaf4;
    background: #fcfdff;
}

.schedule-grid-foot-actions {
    display: flex;
    gap: 8px;
}

.schedule-grid-scroll {
    overflow: auto;
    max-width: 100%;
}

.schedule-grid-table {
    border-collapse: separate;
    border-spacing: 2px;
    min-width: 100%;
}

.schedule-grid-table th,
.schedule-grid-table td {
    padding: 0;
    vertical-align: middle;
}

.schedule-grid-corner {
    width: 56px;
    min-width: 56px;
}

.schedule-grid-col-head,
.schedule-grid-row-head {
    font-size: 0.68rem;
    font-weight: 600;
    color: #5a7088;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 4px 6px;
}

.schedule-grid-col-head:hover,
.schedule-grid-row-head:hover {
    color: #0f6ee8;
}

.schedule-grid-row-head {
    text-align: right;
    width: 56px;
    min-width: 56px;
}

.schedule-grid-cell {
    display: block;
    width: 100%;
    min-width: 28px;
    height: 22px;
    border: 1px solid #d7e1ef;
    border-radius: 4px;
    background: #fff;
    padding: 0;
    cursor: pointer;
}

.schedule-grid-yearpart .schedule-grid-cell {
    min-width: 24px;
    height: 20px;
}

.schedule-grid-cell.is-active {
    background: #22a559;
    border-color: #1a8f4a;
}

.schedule-grid-cell:disabled {
    cursor: default;
    opacity: 0.85;
}

.schedule-grid-empty {
    background: transparent;
    border: none;
    min-width: 24px;
}

body.theme-dark .schedule-grid-dialog {
    background: #152131;
    border-color: #33465f;
}

body.theme-dark .schedule-grid-head,
body.theme-dark .schedule-grid-foot {
    background: #1a2433;
    border-color: #33465f;
}

body.theme-dark .schedule-grid-title {
    color: #e8eef5;
}

body.theme-dark .schedule-grid-col-head,
body.theme-dark .schedule-grid-row-head {
    color: #9db0c7;
}

body.theme-dark .schedule-grid-cell {
    background: #223247;
    border-color: #3a4d66;
}

body.theme-dark .schedule-grid-cell.is-active {
    background: #22a559;
    border-color: #1a8f4a;
}

body.theme-dark .episode-scheduling-part-btn.has-data {
    background: #22a559;
    border-color: #1a8f4a;
    color: #fff;
}

#daypartSaveBtn,
#yearpartSaveBtn {
    min-width: 88px;
}

#daypartSaveBtn:disabled,
#yearpartSaveBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#daypartSaveBtn.is-dirty,
#yearpartSaveBtn.is-dirty {
    background: #22a559;
    border-color: #1a8f4a;
    color: #fff;
}

#daypartSaveBtn.is-dirty:hover,
#yearpartSaveBtn.is-dirty:hover {
    background: #1f9850;
    border-color: #178542;
    color: #fff;
}

body.theme-dark #daypartSaveBtn.is-dirty,
body.theme-dark #yearpartSaveBtn.is-dirty {
    background: #22a559;
    border-color: #1a8f4a;
    color: #fff;
}

.schedule-grid-presets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #e2eaf4;
    background: #f8fbff;
}

.schedule-grid-presets-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-grid-presets-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a7088;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.schedule-grid-preset-select {
    flex: 1 1 180px;
    min-width: 160px;
    padding: 7px 10px;
    border: 1px solid #c6d3e5;
    border-radius: 8px;
    background: #fff;
    font-size: 0.84rem;
}

.schedule-grid-preset-name {
    flex: 1 1 180px;
    min-width: 160px;
    padding: 7px 10px;
    border: 1px solid #c6d3e5;
    border-radius: 8px;
    font-size: 0.84rem;
}

body.theme-dark .schedule-grid-presets {
    background: #172233;
    border-color: #33465f;
}

body.theme-dark .schedule-grid-presets-label {
    color: #9db0c7;
}

body.theme-dark .schedule-grid-preset-select,
body.theme-dark .schedule-grid-preset-name {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}
.rating-settings-dialog {
    width: min(520px, calc(100vw - 32px));
}
.rating-settings-body {
    min-height: 0;
    overflow: auto;
}
.rating-settings-select {
    width: 100%;
    max-width: 280px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.rating-settings-select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 70%, transparent);
}
.rating-settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rating-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
}
.rating-settings-item-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.rating-settings-default-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, #1f8f5f 12%, #ffffff);
    color: #1f8f5f;
    border: 1px solid color-mix(in srgb, #1f8f5f 22%, transparent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.rating-settings-add-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.rating-settings-add-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.rating-settings-add-input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 70%, transparent);
}
.rating-settings-actions {
    margin-top: 0;
}
.episode-rating-select {
    min-width: 120px;
}
.episode-broadcasts-limit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 36px;
}

.episode-broadcasts-limit-input {
    width: 96px;
    max-width: 100%;
    min-height: 36px;
    box-sizing: border-box;
}


.episode-broadcasts-limit-input[hidden],
.episode-broadcasts-unlimited[hidden] {
    display: none !important;
}

.episode-broadcasts-unlimited {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border, #d5dfeb);
    border-radius: 6px;
    background: var(--surface-muted, #f4f7fb);
    color: var(--text, #1a2a3a);
    font-weight: 600;
}

.episode-broadcasts-readonly {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border, #d5dfeb);
    border-radius: 6px;
    background: var(--surface-muted, #f4f7fb);
    color: var(--text, #1a2a3a);
    font-variant-numeric: tabular-nums;
}

body.theme-dark .episode-scheduling-section {
    background: #1a2433;
    border-color: #33465f;
}

body.theme-dark .episode-scheduling-heading {
    background: #223247;
    border-bottom-color: #33465f;
    color: #c5d4e8;
}

body.theme-dark .episode-scheduling-part-actions {
    border-top-color: #33465f;
}

.episode-airings-section {
    grid-template-columns: 1fr;
    gap: 14px;
}

.episode-airings-heading-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -16px;
    padding: 0;
    border-bottom: 1px solid #d7e1ef;
    background: #eef4fb;
}

.episode-airings-heading-row .episode-scheduling-heading {
    grid-column: auto;
    flex: 1 1 auto;
    margin: 0;
    border-bottom: 0;
    background: transparent;
}

.episode-auto-youtube-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin: 0 12px 0 0;
    padding: 4px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.episode-auto-youtube-toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.episode-auto-youtube-toggle-caption {
    color: #475569;
}

.episode-auto-youtube-toggle-ui {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #cbd5e1;
    border: 1px solid #94a3b8;
    flex: 0 0 auto;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.episode-auto-youtube-toggle-ui::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.12s ease;
}

.episode-auto-youtube-toggle.is-on {
    color: #166534;
}

.episode-auto-youtube-toggle.is-on .episode-auto-youtube-toggle-caption {
    color: #166534;
}

.episode-auto-youtube-toggle.is-on .episode-auto-youtube-toggle-ui {
    background: #16a34a;
    border-color: #15803d;
}

.episode-auto-youtube-toggle.is-on .episode-auto-youtube-toggle-ui::after {
    transform: translateX(16px);
}

.episode-auto-youtube-toggle:hover:not(:disabled),
.episode-auto-youtube-toggle:focus-visible:not(:disabled) {
    background: rgba(148, 163, 184, 0.18);
    box-shadow: none;
    transform: none;
}

.episode-auto-youtube-toggle-state {
    min-width: 2em;
    text-align: left;
}

body.theme-dark .episode-airings-heading-row {
    border-bottom-color: #33465f;
    background: #223247;
}

body.theme-dark .episode-auto-youtube-toggle {
    color: #94a3b8;
}

body.theme-dark .episode-auto-youtube-toggle-caption {
    color: #cbd5e1;
}

body.theme-dark .episode-auto-youtube-toggle-ui {
    background: #475569;
    border-color: #64748b;
}

body.theme-dark .episode-auto-youtube-toggle.is-on {
    color: #86efac;
}

body.theme-dark .episode-auto-youtube-toggle.is-on .episode-auto-youtube-toggle-caption {
    color: #86efac;
}

body.theme-dark .episode-auto-youtube-toggle.is-on .episode-auto-youtube-toggle-ui {
    background: #16a34a;
    border-color: #22c55e;
}

body.theme-dark .episode-auto-youtube-toggle:hover:not(:disabled),
body.theme-dark .episode-auto-youtube-toggle:focus-visible:not(:disabled) {
    background: rgba(148, 163, 184, 0.14);
}

.episode-airings-table-wrap {
    width: 100%;
    min-height: 48px;
}

.episode-airings-table {
    width: 100%;
    border-collapse: collapse;
}

.episode-airings-cell {
    padding: 10px 4px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text, #1a2a3a);
    font-variant-numeric: tabular-nums;
}

.episode-airings-head {
    font-weight: 700;
}

.episode-airings-tail {
    font-weight: 400;
}

.episode-airings-row {
    cursor: context-menu;
}

.episode-airings-row:hover .episode-airings-cell {
    color: #17324a;
}

.episode-airings-divider-row td {
    padding: 4px 0 6px;
}

.episode-airings-divider {
    display: block;
    height: 1px;
    background: #d5e1ef;
    opacity: 0.85;
}

.episode-airings-empty {
    padding: 12px 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

.episode-airing-add-btn {
    align-self: flex-start;
    font-weight: 600;
}
.episode-forced-airings-section {
    grid-template-columns: 1fr;
    gap: 12px;
}

.episode-forced-airings-section .episode-airings-actions {
    width: 100%;
}

.episode-forced-airings-section .episode-scheduling-heading {
    /* Same full-bleed underline as Allowed Period / Broadcasts */
    grid-column: 1 / -1;
    margin: 0 -16px;
    width: auto;
}

.episode-forced-airings-hint,
.forced-airing-add-hint {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--muted);
}

.forced-airing-confirm-lead {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
    color: #1f3348;
}

.forced-airing-confirm-kv {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #fff;
}

.forced-airing-confirm-kv .k {
    margin-bottom: 4px;
}

.forced-airing-confirm-kv .v {
    word-break: break-word;
}

body.theme-dark .forced-airing-confirm-lead {
    color: #e7eef7;
}

body.theme-dark .forced-airing-confirm-kv {
    border-color: #2a3d52;
    background: #162433;
}

.episode-forced-airings-table-wrap {
    width: 100%;
    max-height: 240px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #fff;
    overflow: auto;
}

.episode-forced-airings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.episode-forced-airings-table th,
.episode-forced-airings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6edf6;
    text-align: left;
    vertical-align: middle;
}

.episode-forced-airings-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b647d;
    background: #f3f7fc;
    box-shadow: inset 0 -1px 0 #e6edf6;
}

.episode-forced-airings-table tr:last-child td {
    border-bottom: 0;
}

.episode-forced-airing-row {
    cursor: context-menu;
}

.episode-forced-airing-row:hover td {
    background: #f7fbff;
}

.episode-forced-airing-override {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #fef3c7;
    color: #92400e;
}

body.theme-dark .episode-forced-airing-override {
    background: #78350f;
    color: #fde68a;
}

.episode-forced-airings-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.episode-planned-airings-section {
    grid-template-columns: 1fr;
    gap: 10px;
}

.episode-planned-airings-hint {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--muted);
}

.episode-planned-airings-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid #d7e1ef;
    border-radius: 8px;
    background: #fff;
}

.episode-planned-airings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.episode-planned-airings-table th,
.episode-planned-airings-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e4ebf4;
    text-align: left;
    vertical-align: top;
}

.episode-planned-airings-table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #35506d;
    background: #eef4fb;
    white-space: nowrap;
}

.episode-planned-airings-table tr:last-child td {
    border-bottom: 0;
}

.episode-planned-airing-time,
.episode-planned-airing-channel {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.episode-planned-airing-weekday {
    display: inline-block;
    margin-left: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.episode-planned-airings-empty {
    margin: 0;
    padding: 12px 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

body.theme-dark .episode-planned-airings-table-wrap {
    border-color: #334155;
    background: #0f172a;
}

body.theme-dark .episode-planned-airings-table th {
    background: #1e293b;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

body.theme-dark .episode-planned-airings-table td {
    border-bottom-color: #334155;
}

body.theme-dark .episode-scheduling-subnav {
    border-bottom-color: #334155;
}

body.theme-dark .episode-scheduling-subtab {
    color: #94a3b8;
}

body.theme-dark .episode-scheduling-subtab:hover,
body.theme-dark .episode-scheduling-subtab.active {
    color: #e2e8f0;
}

body.theme-dark .episode-scheduling-subtab.active {
    border-bottom-color: #60a5fa;
}

body.theme-dark .episode-forced-airings-table-wrap {
    border-color: #334155;
    background: #0f172a;
}

body.theme-dark .episode-forced-airings-table th {
    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

body.theme-dark .episode-forced-airings-table td {
    border-bottom-color: #1e293b;
}

body.theme-dark .episode-forced-airing-row:hover td {
    background: #1e293b;
}

.episode-epg-plus-section {
    grid-template-columns: 1fr;
    gap: 14px;
}

.episode-epg-plus-table-wrap {
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #fff;
    overflow: auto;
}

.episode-epg-plus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.episode-epg-plus-table th,
.episode-epg-plus-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6edf6;
    text-align: left;
    vertical-align: top;
}

.episode-epg-plus-table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5a7088;
    background: #f4f8fc;
}

.episode-epg-plus-row {
    cursor: context-menu;
}

.episode-epg-plus-row:hover td {
    background: #f7fbff;
}

.episode-epg-plus-date {
    white-space: nowrap;
    font-weight: 600;
}

.episode-epg-plus-snippet {
    color: #334155;
    line-height: 1.35;
}

.episode-epg-plus-empty {
    padding: 14px 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.episode-epg-plus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.epg-plus-field-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epg-plus-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.epg-plus-take-general-btn {
    font-size: 0.78rem;
    padding: 4px 10px;
}

.epg-plus-description-input {
    min-height: 140px;
    resize: vertical;
}

.airing-add-dialog.epg-plus-archive-dialog {
    width: min(840px, calc(100vw - 32px));
}

.epg-plus-archive-hint {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

body.theme-dark .episode-epg-plus-table th {
    background: #1a2838;
    color: #9eb4cc;
}

body.theme-dark .episode-epg-plus-table td {
    border-bottom-color: #2a3d52;
}

body.theme-dark .episode-epg-plus-row:hover td {
    background: #1e2f42;
}


.airing-add-dialog {
    width: min(480px, 96vw);
    margin: 8vh auto;
    border-radius: 12px;
    border: 1px solid #d5e1ef;
    background: #f8fbff;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(16, 36, 62, 0.18);
}

.airing-add-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px 8px;
}

.airing-add-datetime-row {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.airing-add-date-field .episode-date-input,
.airing-add-time-field .episode-airing-time-input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    box-sizing: border-box;
}

.airing-add-mode-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.airing-add-primary-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.airing-add-primary-fields[hidden] {
    display: none !important;
}

.airing-add-duration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.airing-add-duration-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.airing-add-duration-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.airing-add-duration-input {
    width: 100%;
    min-height: 36px;
}

.airing-add-time-end-wrap .airing-add-mode-pill-text {
    min-width: 108px;
    font-size: 0.78rem;
}

.airing-add-platform-wrap .airing-add-mode-pill-text {
    min-width: 118px;
    font-size: 0.74rem;
}
.airing-add-mode-wrap[hidden] {
    display: none !important;
}

.airing-add-mode-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.airing-add-mode-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    user-select: none;
}

.airing-add-mode-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    pointer-events: none;
}

.airing-add-mode-pill-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 9px 16px;
    border: 1px solid #b8c9de;
    border-radius: 8px;
    background: #fff;
    color: #2a4562;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.airing-add-mode-pill input[type="radio"]:focus-visible + .airing-add-mode-pill-text {
    box-shadow: 0 0 0 3px rgba(15, 110, 232, 0.18);
}

.airing-add-mode-pill input[type="radio"]:checked + .airing-add-mode-pill-text {
    border-color: var(--brand, #0f6ee8);
    background: #e8f2ff;
    color: #0c4f9c;
    box-shadow: inset 0 0 0 1px rgba(15, 110, 232, 0.12);
}

.airing-add-mode-pill:hover .airing-add-mode-pill-text {
    border-color: #8aaed4;
}

.airing-context-menu .episode-context-copy {
    display: block;
    width: 100%;
    text-align: left;
}

.airing-context-menu .episode-context-copy + .episode-context-copy {
    margin-top: 4px;
}
.airing-context-menu .episode-context-copy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.theme-dark .episode-airings-cell {
    color: #e8eef5;
}

body.theme-dark .episode-airings-row:hover .episode-airings-cell {
    color: #fff;
}

body.theme-dark .episode-airings-divider {
    background: #33465f;
}

body.theme-dark .airing-add-dialog {
    background: #1a2433;
    border-color: #33465f;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

body.theme-dark .airing-add-mode-pill-text {
    background: #1e2d40;
    border-color: #4a6480;
    color: #d7e4f4;
}

body.theme-dark .airing-add-mode-pill input[type="radio"]:checked + .airing-add-mode-pill-text {
    background: #234066;
    border-color: #5b9fff;
    color: #ffffff;
}

body.theme-dark .airing-add-mode-pill:hover .airing-add-mode-pill-text {
    border-color: #6f8fb3;
}
body.theme-dark .episode-airing-segment {
    background: #1e2d40;
    border-color: #33465f;
    box-shadow: none;
}

body.theme-dark .episode-airing-segment-heading {
    color: #a8bdd6;
}

body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input,
body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input::-webkit-datetime-edit,
body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input::-webkit-datetime-edit-fields-wrapper,
body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input::-webkit-datetime-edit-hour-field,
body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input::-webkit-datetime-edit-minute-field,
body.theme-dark .episode-airing-time-wrap.is-empty .episode-airing-time-input::-webkit-datetime-edit-ampm-field {
    color: #8fa3bc;
}

body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input,
body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input::-webkit-datetime-edit,
body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input::-webkit-datetime-edit-fields-wrapper,
body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input::-webkit-datetime-edit-hour-field,
body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input::-webkit-datetime-edit-minute-field,
body.theme-dark .episode-airing-time-wrap:not(.is-empty) .episode-airing-time-input::-webkit-datetime-edit-ampm-field {
    color: #e8eef5;
}
body.theme-dark .episode-broadcasts-unlimited,
body.theme-dark .episode-broadcasts-readonly {
    background: #1e2d40;
    border-color: #33465f;
    color: #e8eef5;
}

.episode-pictures-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 2px 8px;
}

.episode-pictures-uploader {
    position: relative;
    display: block;
    border: 2px dashed #9eb4d0;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: #2f4563;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    outline: none;
}

.episode-pictures-uploader:hover,
.episode-pictures-uploader:focus-visible {
    border-color: #5f86c4;
    box-shadow: 0 8px 24px rgba(47, 69, 99, 0.12);
}

.episode-pictures-uploader.is-dragover {
    border-color: #3f74c8;
    background: linear-gradient(180deg, #edf5ff 0%, #dce9fb 100%);
    transform: translateY(-1px);
}

.episode-pictures-uploader.is-uploading {
    opacity: 0.72;
    pointer-events: none;
}

.episode-pictures-file-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}
.episode-pictures-uploader-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 0;
    padding: 12px 16px;
}

.episode-pictures-uploader-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(63, 116, 200, 0.12);
    color: #3f74c8;
    flex: 0 0 auto;
}

.episode-pictures-uploader-divider {
    width: 1px;
    align-self: stretch;
    min-height: 44px;
    background: #c6d3e5;
    flex: 0 0 auto;
}

.episode-pictures-uploader-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.episode-pictures-uploader-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.episode-pictures-uploader-hint,
.episode-pictures-uploader-drop {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #5f7390;
}

.episode-pictures-uploader-drop {
    font-weight: 600;
    color: #3f74c8;
}

.episode-pictures-upload-progress {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(248, 251, 255, 0.96);
    border-radius: inherit;
}

.episode-pictures-upload-progress[hidden] {
    display: none !important;
}

.episode-pictures-upload-progress-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #24364f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-pictures-upload-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #d8e3f0;
    overflow: hidden;
}

.episode-pictures-upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3f74c8 0%, #5f94df 100%);
    transition: width 0.12s ease;
}

.episode-pictures-upload-progress-meta {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3f74c8;
    text-align: right;
}

.episode-pictures-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-picture-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d4dfef;
    border-radius: 12px;
    background: #ffffff;
    color: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.episode-picture-item:hover {
    border-color: #8fadd6;
    box-shadow: 0 8px 18px rgba(47, 69, 99, 0.08);
    transform: translateY(-1px);
}

.episode-picture-open {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.episode-picture-copy {
    min-width: 0;
}

.episode-picture-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.episode-picture-title {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
    color: #24364f;
    word-break: break-word;
}

.episode-picture-rename-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #8fadd6;
    border-radius: 8px;
    font: inherit;
    color: #24364f;
    background: #ffffff;
}

.episode-picture-rename-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #d4dfef;
    border-radius: 8px;
    background: #f5f8fc;
    color: #3f5f86;
    cursor: pointer;
    flex: 0 0 auto;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.episode-picture-rename-btn:hover {
    border-color: #8fadd6;
    background: #edf4fb;
    color: #2f5588;
}

.episode-picture-upload-meta {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.4;
}

.episode-picture-delete-btn {
    align-self: center;
    white-space: nowrap;
}

.episode-picture-thumb-wrap {
    display: block;
    width: 72px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f8;
    border: 1px solid #d8e1ef;
}

.episode-picture-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-pictures-empty {
    margin: 0;
}

.episode-picture-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    padding: 16px;
    overflow: auto;
}

.episode-picture-preview-content img {
    display: block;
    cursor: zoom-out;
    width: auto;
    height: auto;
    max-width: min(calc(100vw - 128px), 1100px);
    max-height: calc(100vh - 180px);
    object-fit: contain;
    object-position: center;
}

.episode-picture-preview-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.episode-picture-nav-btn {
    min-width: 44px;
    padding: 8px 12px;
    font-size: 1.05rem;
    line-height: 1;
}

.episode-picture-download-btn {
    min-width: 140px;
    text-decoration: none;
    text-align: center;
}

body.theme-dark .episode-pictures-uploader {
    border-color: #4a6283;
    background: linear-gradient(180deg, #162235 0%, #121b2b 100%);
    color: #d8e4f4;
}

body.theme-dark .episode-pictures-uploader.is-dragover {
    border-color: #6f9be0;
    background: linear-gradient(180deg, #1a2a42 0%, #152033 100%);
}

body.theme-dark .episode-pictures-uploader-icon {
    background: rgba(111, 155, 224, 0.16);
    color: #8db4ea;
}

body.theme-dark .episode-pictures-uploader-divider {
    background: #4a6283;
}

body.theme-dark .episode-pictures-uploader-hint {
    color: #9db0c7;
}

body.theme-dark .episode-pictures-uploader-drop {
    color: #8db4ea;
}

body.theme-dark .episode-pictures-upload-progress {
    background: rgba(18, 27, 43, 0.96);
}

body.theme-dark .episode-pictures-upload-progress-label {
    color: #d8e4f4;
}

body.theme-dark .episode-pictures-upload-progress-track {
    background: #334760;
}

body.theme-dark .episode-pictures-upload-progress-meta {
    color: #8db4ea;
}

body.theme-dark .episode-picture-item {
    background: #121b2b;
    border-color: #334760;
}

body.theme-dark .episode-picture-title {
    color: #d8e4f4;
}

body.theme-dark .episode-picture-rename-input {
    background: #0d1522;
    border-color: #4a6283;
    color: #d8e4f4;
}

body.theme-dark .episode-picture-rename-btn {
    background: #162235;
    border-color: #4a6283;
    color: #9db0c7;
}

body.theme-dark .episode-picture-rename-btn:hover {
    background: #1a2a42;
    border-color: #6f9be0;
    color: #d8e4f4;
}

body.theme-dark .episode-picture-thumb-wrap {
    background: #0d1522;
    border-color: #334760;
}

.global-audit-dialog {
    width: min(1120px, calc(100vw - 24px));
}

.global-audit-head {
    flex-wrap: wrap;
    gap: 10px;
}

.global-audit-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
}

.global-audit-limit-label {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #516579;
}

.global-audit-limit-select {
    min-width: 88px;
    padding: 5px 8px;
    border: 1px solid #c5d3e3;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
}

.global-audit-body {
    padding: 12px 14px 16px;
    min-height: 320px;
    max-height: calc(100vh - 120px);
}

.global-audit-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.global-audit-count {
    font-size: 0.82rem;
    color: #516579;
}

.global-audit-log-head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.global-audit-log-head-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}

.global-audit-episode-ref {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f0fb;
    border: 1px solid #c5d8ef;
    color: #1f456f;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.global-audit-log-entry .episode-audit-log-action {
    font-size: 0.84rem;
}

body.theme-dark .global-audit-limit-label,
body.theme-dark .global-audit-count {
    color: #9eb2c8;
}

body.theme-dark .global-audit-limit-select {
    border-color: #3a4d66;
    background: #1a2433;
    color: #e8eef5;
}

body.theme-dark .global-audit-episode-ref {
    background: rgba(91, 156, 245, 0.14);
    border-color: rgba(91, 156, 245, 0.35);
    color: #c8dcfa;
}

.global-audit-entity-kind {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef2f7;
    border: 1px solid #d5dee8;
    color: #5a6b7d;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.global-audit-series-ref {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3e8fb;
    border: 1px solid #dbc5ef;
    color: #5a2d87;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.theme-dark .global-audit-entity-kind {
    background: #243041;
    border-color: #3a4d66;
    color: #9eb2c8;
}

body.theme-dark .global-audit-series-ref {
    background: rgba(180, 120, 245, 0.14);
    border-color: rgba(180, 120, 245, 0.35);
    color: #e0c8fa;
}

.json-import-dialog {
    width: min(980px, calc(100vw - 24px));
}

.json-import-body {
    min-height: 0;
    overflow: auto;
}

.json-import-body .maintenance-admin-card {
    gap: 16px;
}

.json-import-body .json-import-select,
.json-import-body .json-import-path-select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.json-import-body input[type="file"] {
    padding: 10px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
}

.json-import-body .json-import-actions {
    margin-top: 0;
    justify-content: flex-end;
}

.json-import-body .json-import-config-grid {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.json-import-body .json-import-skip-check {
    margin: 0;
}

.json-import-body .json-import-section-title {
    margin: 4px 0 0;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text);
}

.json-import-body .json-import-mapping-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: auto;
    max-height: min(42vh, 420px);
    background: #fff;
}

.json-import-body .json-import-mapping-toolbar {
    margin: 0;
}

.json-import-intro {
    margin: 0 0 14px;
}

.json-import-target-row,
.json-import-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.json-import-label {
    min-width: 72px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #516579;
}

.json-import-select {
    min-width: 200px;
    padding: 6px 8px;
    border: 1px solid #c5d3e3;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 0.86rem;
}

.json-import-target-hint {
    font-size: 0.84rem;
    color: #516579;
}

.json-import-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.json-import-mapping-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.json-import-mapping-wrap {
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    overflow: auto;
    max-height: min(52vh, 520px);
}

.json-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.json-import-table th,
.json-import-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e8eef5;
    vertical-align: top;
    text-align: left;
}

.json-import-table th {
    position: sticky;
    top: 0;
    background: #f4f8fc;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #516579;
    z-index: 1;
}

.json-import-table tr:last-child td {
    border-bottom: 0;
}

.json-import-field-label {
    font-weight: 600;
    color: #1f3347;
}

.json-import-field-key {
    display: block;
    margin-top: 2px;
    font-size: 0.74rem;
    color: #6b7f92;
}

.json-import-path-select {
    width: 100%;
    min-width: 180px;
    padding: 5px 7px;
    border: 1px solid #c5d3e3;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
}

.json-import-preview {
    max-width: 280px;
    word-break: break-word;
    color: #33485c;
    font-size: 0.8rem;
    line-height: 1.35;
}

.json-import-preview.is-empty {
    color: #8a9bab;
    font-style: italic;
}

.json-import-status {
    margin-top: 10px;
    font-size: 0.84rem;
    color: #516579;
}

.json-import-status.is-error {
    color: #b42318;
}

.json-import-status.is-success {
    color: #1a6b3c;
}

body.theme-dark .json-import-select,
body.theme-dark .json-import-path-select {
    background: #0f1824;
    border-color: #334760;
    color: #d8e4f0;
}

body.theme-dark .json-import-mapping-wrap {
    border-color: #334760;
}

body.theme-dark .json-import-table th {
    background: #152030;
    color: #9eb2c8;
}

body.theme-dark .json-import-table td {
    border-bottom-color: #243041;
}

body.theme-dark .json-import-field-label {
    color: #d8e4f0;
}

body.theme-dark .json-import-preview {
    color: #b8c8d8;
}

.json-import-config-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    background: #f8fbfe;
}

.json-import-config-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.json-import-config-row .json-import-select {
    flex: 1 1 240px;
}

.json-import-skip-check {
    /* uses .maintenance-switch-row layout */
}

.json-import-section-title {
    margin: 14px 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #516579;
}

.json-import-preview-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8eef5;
}

.json-import-preview-summary {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 0.84rem;
    color: #33485c;
}

.json-import-action {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.json-import-action-create {
    background: #e4f5ea;
    color: #1a6b3c;
}

.json-import-action-skip {
    background: #eef2f7;
    color: #516579;
}


.json-import-action-exists {
    background: #fff4d6;
    color: #8a6400;
}

.json-import-action-overwrite {
    background: #ffe8cc;
    color: #9a4d00;
}

body.theme-dark .json-import-action-exists {
    background: #3d3420;
    color: #f2d48b;
}

body.theme-dark .json-import-action-overwrite {
    background: #4a331f;
    color: #ffc98a;
}

.json-import-action-error {
    background: #fde8e6;
    color: #b42318;
}

body.theme-dark .json-import-config-grid {
    background: #101a28;
    border-color: #334760;
}

body.theme-dark .json-import-skip-check,
body.theme-dark .json-import-preview-summary {
    color: #b8c8d8;
}

/* session-expired-overlay */
body.session-expired-active {
    overflow: hidden;
}

body.session-expired-active::before {
    content: '';
    position: fixed;
    inset: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(15, 23, 42, 0.18);
    z-index: 99998;
    pointer-events: none;
}

.session-expired-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.35);
}

.session-expired-overlay.open {
    display: flex;
}

.session-expired-dialog {
    width: min(440px, 100%);
    padding: 28px 28px 24px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    text-align: center;
}

.session-expired-dialog h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
    color: #0f172a;
}

.session-expired-dialog p {
    margin: 0 0 22px;
    line-height: 1.5;
    color: #475569;
}

.session-expired-login-btn {
    min-width: 168px;
    padding: 11px 22px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 110, 232, 0.28);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.session-expired-login-btn:hover {
    background: #0b5dcc;
    border-color: #0b5dcc;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 110, 232, 0.38);
}

.session-expired-login-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 110, 232, 0.28), 0 12px 26px rgba(15, 110, 232, 0.34);
}

.session-expired-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 14px rgba(15, 110, 232, 0.3);
}

body.theme-dark .session-expired-login-btn {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

body.theme-dark .session-expired-login-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.45);
}

body.theme-dark .session-expired-dialog {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

body.theme-dark .session-expired-dialog h2 {
    color: #f8fafc;
}

body.theme-dark .session-expired-dialog p {
    color: #cbd5e1;
}
/* all-assets-modal */
.header-all-assets-btn {
    border: 1px solid var(--line-strong);
    background: #d9e3f0;
    color: #22354b;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-all-assets-icon {
    display: block;
}

.user-access-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.all-assets-count-chip {
    flex: 0 0 auto;
}

#allAssetsModal.episode-modal.open {
    align-items: stretch;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.all-assets-dialog {
    width: min(1180px, 96vw);
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    align-self: center;
    overflow: hidden;
}

.all-assets-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.all-assets-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.all-assets-search {
    flex: 1 1 280px;
    min-width: 220px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.86rem;
    background: #fff;
    color: var(--text);
}

.all-assets-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.all-assets-sort-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
}

.all-assets-sort-btn.is-active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.all-assets-sort-btn:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.all-assets-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.all-assets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.all-assets-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f5f8fc;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.all-assets-table tbody td {
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    vertical-align: top;
}

.all-assets-row {
    cursor: pointer;
}

.all-assets-row:hover {
    background: #f8fbff;
}

.all-assets-media-id {
    font-weight: 600;
    white-space: nowrap;
}

.all-assets-title-cell {
    min-width: 260px;
}

.all-assets-category,
.all-assets-year {
    white-space: nowrap;
}

.all-assets-media-col {
    width: 72px;
}

.all-assets-empty {
    padding: 18px;
}

#allAssetsModal.all-assets-modal-fullscreen,
#allAssetsModal.all-assets-modal-fullscreen #allAssetsDialog.all-assets-dialog-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
}

#allAssetsDialog.all-assets-dialog-fullscreen .all-assets-table-wrap {
    max-height: calc(100vh - 150px);
}

body.theme-dark .all-assets-search,
body.theme-dark .all-assets-sort-btn,
body.theme-dark .all-assets-table-wrap {
    background: #1e293b;
    color: #e8eef5;
    border-color: rgba(148, 163, 184, 0.25);
}

body.theme-dark .all-assets-table thead th {
    background: #0f172a;
}

body.theme-dark .all-assets-row:hover {
    background: rgba(59, 130, 246, 0.08);
}


.playout-youtube-feed-panel {
    --ytf-live: #be123c;
    --ytf-relive: #6d28d9;
    --ytf-preview: #15803d;
    padding: 16px 18px 22px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playout-youtube-feed-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: block;
}

.ytf-layout {
    display: grid;
    grid-template-columns: minmax(330px, 510px) minmax(0, 1fr);
    gap: 18px 22px;
    align-items: start;
    width: 100%;
}

.ytf-preview-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ytf-controls-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ytf-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ytf-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #64748b);
}

.ytf-status {
    padding: 8px 12px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 13px;
    color: #1e3a8a;
}
.ytf-status[hidden] { display: none !important; }
.ytf-status.is-error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.ytf-pill {
    padding: 9px 11px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text, #1e293b);
}
.ytf-live-title strong {
    font-weight: 700;
}

.ytf-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--line, #e2e8f0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.ytf-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ytf-presetbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ytf-preset-btn {
    appearance: none;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ytf-preset-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
}

.ytf-input {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #fff;
    color: var(--text, #0f172a);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ytf-input:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}

.ytf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ytf-btn {
    min-width: 88px;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-width: 1px !important;
    box-shadow: none !important;
}
.ytf-btn-preview {
    background: #ecfdf5 !important;
    border-color: #86efac !important;
    color: var(--ytf-preview) !important;
}
.ytf-btn-preview:hover {
    background: #d1fae5 !important;
    border-color: #4ade80 !important;
}
.ytf-btn-live {
    background: #fff1f2 !important;
    border-color: #fda4af !important;
    color: var(--ytf-live) !important;
}
.ytf-btn-live:hover {
    background: #ffe4e6 !important;
    border-color: #fb7185 !important;
}
.ytf-btn-relive {
    background: #f5f3ff !important;
    border-color: #c4b5fd !important;
    color: var(--ytf-relive) !important;
}
.ytf-btn-relive:hover {
    background: #ede9fe !important;
    border-color: #a78bfa !important;
}
.ytf-btn-copy {
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.ytf-hint {
    margin: -2px 0 0;
    padding: 0;
    font-size: 11px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.35;
    color: #94a3b8;
}

.ytf-player-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.ytf-player-input {
    cursor: pointer;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #475569;
}

.ytf-presets-editor {
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    padding: 0;
    background: #fff;
    overflow: hidden;
}
.ytf-presets-editor summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 12px;
    list-style: none;
    color: #334155;
    user-select: none;
}
.ytf-presets-editor summary::-webkit-details-marker { display: none; }
.ytf-presets-editor summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.ytf-presets-editor[open] summary::before {
    transform: rotate(90deg);
}
.ytf-presets-editor[open] summary {
    border-bottom: 1px solid var(--line, #e2e8f0);
    background: #f8fafc;
}
.ytf-presets-editor-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}
.ytf-presets-list { display: grid; gap: 8px; }
.ytf-preset-edit-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.35fr) 1fr auto;
    gap: 8px;
}
.ytf-presets-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ytf-replay-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.ytf-replay-modal[hidden] { display: none !important; }
.ytf-replay-card {
    width: min(92vw, 340px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}
.ytf-replay-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
}
.ytf-replay-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: end;
    margin: 12px 0 14px;
}
.ytf-replay-row label {
    display: grid;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ytf-replay-row input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
}
.ytf-replay-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

body.theme-dark .ytf-pill,
body.theme-dark .ytf-presets-editor,
body.theme-dark .ytf-replay-card,
body.theme-dark .ytf-preset-btn {
    background: var(--panel, #1e1e1e);
    color: var(--text, #eee);
    border-color: #333;
}
body.theme-dark .ytf-presets-editor[open] summary {
    background: #171717;
    border-color: #333;
}
body.theme-dark .ytf-input,
body.theme-dark .ytf-replay-row input {
    background: #111;
    color: #eee;
    border-color: #333;
}
body.theme-dark .ytf-preset-btn:hover {
    background: #262626;
    border-color: #525252;
    color: #fff;
}
body.theme-dark .ytf-status {
    background: #0f172a;
    border-color: #1e3a8a;
    color: #dbeafe;
}
body.theme-dark .ytf-player-input {
    color: #94a3b8;
}
body.theme-dark .ytf-btn-preview {
    background: rgba(21, 128, 61, 0.18) !important;
    border-color: rgba(74, 222, 128, 0.35) !important;
    color: #86efac !important;
}
body.theme-dark .ytf-btn-live {
    background: rgba(190, 18, 60, 0.18) !important;
    border-color: rgba(251, 113, 133, 0.35) !important;
    color: #fda4af !important;
}
body.theme-dark .ytf-btn-relive {
    background: rgba(109, 40, 217, 0.18) !important;
    border-color: rgba(167, 139, 250, 0.35) !important;
    color: #c4b5fd !important;
}

@media (max-width: 900px) {
    .ytf-layout {
        grid-template-columns: 1fr;
    }
    .ytf-preview-col {
        max-width: 630px;
    }
    .ytf-preset-edit-row {
        grid-template-columns: 1fr;
    }
}

.episode-row.is-bulk-selected > td {
    background: #dbeafe;
}

.episode-row.is-bulk-selected:hover > td {
    background: #cfe0fc;
}

#episodeList.is-drag-selecting {
    user-select: none;
    cursor: crosshair;
}

.bulk-edit-dialog {
    position: relative;
}

.bulk-edit-dialog.is-saving .episode-dialog-close {
    opacity: 0.45;
    pointer-events: none;
}

.bulk-edit-save-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(248, 251, 255, 0.94);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.bulk-edit-save-overlay[hidden] {
    display: none !important;
}

.bulk-edit-save-panel {
    width: min(420px, 100%);
    padding: 22px 22px 20px;
    border-radius: 12px;
    border: 1px solid #c6d3e5;
    background: #fff;
    box-shadow: 0 16px 36px rgba(16, 29, 49, 0.18);
    text-align: center;
}

.bulk-edit-save-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #1a2940;
}

.bulk-edit-save-message {
    margin: 0 0 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #516079;
}

.bulk-edit-save-progress-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e3ebf6;
}

.bulk-edit-save-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f8fd9 0%, #2f6fbf 100%);
    transition: width 0.18s ease;
}

.bulk-edit-save-progress-meta {
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3d516c;
}

body.theme-dark .bulk-edit-save-overlay {
    background: rgba(15, 23, 42, 0.88);
}

body.theme-dark .bulk-edit-save-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

body.theme-dark .bulk-edit-save-title {
    color: #e2e8f0;
}

body.theme-dark .bulk-edit-save-message {
    color: #94a3b8;
}

body.theme-dark .bulk-edit-save-progress-track {
    background: rgba(148, 163, 184, 0.25);
}

body.theme-dark .bulk-edit-save-progress-meta {
    color: #cbd5e1;
}

#bulkEditModal.episode-modal.open {
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

#bulkEditModal #bulkEditDialog.bulk-edit-dialog {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(920px, calc(100vw - 24px));
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#bulkEditDialogMain {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#bulkEditDialogBody.episode-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    gap: 0;
}

#bulkEditDialogBody .episode-dialog-tabpanel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

#bulkEditDialogBody .episode-dialog-tabpanel[hidden] {
    display: none !important;
}

.bulk-edit-general-grid {
    margin-top: 4px;
}

.bulk-edit-music-empty {
    margin: 12px 0;
}

.bulk-edit-filler-fields {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bulk-edit-filler-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.bulk-edit-filler-label {
    min-width: 108px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted, #5a6578);
}

.bulk-edit-filler-choice-row {
    flex: 1 1 160px;
    max-width: 220px;
}

.bulk-edit-filler-choice.active {
    background: #e8f0fa;
    border-color: #5b9bd5;
}

body.theme-dark .bulk-edit-filler-choice.active {
    background: #243247;
    border-color: #5b9bd5;
}

#bulkEditDialogBody .episode-entities-section,
#bulkEditDialogBody .episode-kv-grid,
#bulkEditDialogBody .meta-list-editor,
#bulkEditDialogBody .meta-list-input-wrap {
    overflow: visible;
}

.bulk-edit-video-section {
    margin-top: 4px;
}

#bulkEditDialogBody .bulk-edit-video-markers-grid {
    grid-template-columns: 1fr 1fr;
    max-width: 560px;
    gap: 24px;
}

#bulkEditDialogBody .bulk-edit-video-markers-grid .video-marker-col.in,
#bulkEditDialogBody .bulk-edit-video-markers-grid .video-marker-col.out {
    align-items: stretch;
}

#bulkEditDialogBody .bulk-edit-video-markers-grid .video-marker-col.out .video-marker-input,
#bulkEditDialogBody .bulk-edit-video-markers-grid .video-marker-col.out .video-marker-btn {
    align-self: stretch;
}

.bulk-edit-fade-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.bulk-edit-fade-row .bulk-edit-fade-choice {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
}

.bulk-edit-broadcasts-row {
    flex-wrap: wrap;
    align-items: center;
}

.bulk-edit-broadcasts-row .episode-broadcasts-limit-input {
    flex: 1 1 88px;
    min-width: 88px;
    max-width: 120px;
}

.bulk-edit-broadcasts-hint {
    margin: 8px 0 0;
    font-size: 0.82rem;
}

#bulkEditBroadcastsSetLimitBtn.active,
#bulkEditBroadcastsSetUnlimitedBtn.active {
    background: #e8f0fa;
    border-color: #5b9bd5;
}

body.theme-dark #bulkEditBroadcastsSetLimitBtn.active,
body.theme-dark #bulkEditBroadcastsSetUnlimitedBtn.active {
    background: #243247;
    border-color: #5b9bd5;
}

#bulkEditDialogFoot {
    justify-content: flex-end;
}

#bulkEditSaveBtn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

#bulkEditSaveBtn:disabled {
    background: #e8ecf1;
    border-color: #d5dbe3;
    color: #8b95a5;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.85;
}

body.theme-dark #bulkEditSaveBtn:disabled {
    background: #2a3548;
    border-color: #3a475c;
    color: #8b95a5;
    opacity: 0.85;
}

.airing-add-dialog.airing-add-dialog-recurring {
    width: min(560px, 96vw);
}

.airing-add-recurrence-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.airing-add-recurrence-wrap[hidden] {
    display: none !important;
}

.airing-add-recurrence-type {
    width: 100%;
}

.airing-add-recurrence-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.airing-add-recurrence-panel[hidden] {
    display: none !important;
}

.airing-add-recurrence-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.airing-add-weekday-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.airing-add-weekday-pill {
    display: inline-flex;
    cursor: pointer;
}

.airing-add-weekday-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.airing-add-weekday-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #c5d4e6;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #2a4365;
}

.airing-add-weekday-pill input:checked + span {
    border-color: #2b6cb0;
    background: #ebf4ff;
    color: #1a365d;
}

.episode-airings-recurrence-summary {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d5e1ef;
    background: #eef5fc;
    font-size: 13px;
    line-height: 1.45;
    color: #1a365d;
}

.episode-airings-recurrence-summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2b6cb0;
}

body.theme-dark .episode-airings-recurrence-summary {
    border-color: #3d4f66;
    background: #1e2a3a;
    color: #d8e6f5;
}

body.theme-dark .airing-add-weekday-pill span {
    border-color: #3d4f66;
    background: #1a2433;
    color: #c8d9ee;
}

body.theme-dark .airing-add-weekday-pill input:checked + span {
    border-color: #63b3ed;
    background: #234063;
    color: #ebf8ff;
}

.episode-airings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.airing-exception-dialog {
    width: min(520px, 96vw);
}

.airing-exception-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #4a5568;
}

.episode-airings-row-exception .episode-airings-head {
    color: #c05621;
}

body.theme-dark .airing-exception-hint {
    color: #a0aec0;
}

body.theme-dark .episode-airings-row-exception .episode-airings-head {
    color: #f6ad55;
}

/* Login page (no footer) */
.login-bg-words {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-bg-word {
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--font-ewtn-guadalupe);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text);
    white-space: nowrap;
    user-select: none;
    will-change: transform;
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(196, 30, 58, 0.07), transparent 55%),
        var(--bg);
    color: var(--text);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}


.login-card {
    position: relative;
    z-index: 1;
    margin-top: 0;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 28px 56px -12px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.login-brand {
    margin: 0;
    line-height: 0;
    padding: 28px 28px 12px;
}

.login-logo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
}

.login-card-body {
    padding: 8px 28px 28px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.login-field span {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-field input[type="text"],
.login-field input[type="password"],
.login-field input[type="email"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field input:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

.login-totp-code::-webkit-credentials-auto-fill-button,
.login-totp-code::-webkit-contacts-auto-fill-button,
.login-totp-code::-webkit-caps-lock-indicator,
.login-totp-code::-webkit-strong-password-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

.login-error {
    background: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.875rem;
}


.login-form.is-hidden {
    display: none;
}

.login-card.is-loading .login-brand {
    padding-bottom: 6px;
}

.login-card.is-loading .login-card-body {
    padding-top: 0;
    padding-bottom: 22px;
}

.login-loading {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 2px 0 0;
    min-height: 0;
}

.login-loading.is-visible {
    display: flex;
}

.login-loading-track {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 35%, transparent);
    overflow: hidden;
}

.login-loading-track-fill {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent 0%, #c41e3a 35%, #f06b7d 50%, #c41e3a 65%, transparent 100%);
    animation: login-shimmer 1.05s ease-in-out infinite;
}

.login-loading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 14px;
}

.login-loading-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c41e3a;
    animation: login-dot-bounce 0.85s ease-in-out infinite;
}

.login-loading-dot:nth-child(2) {
    animation-delay: 0.13s;
}

.login-loading-dot:nth-child(3) {
    animation-delay: 0.26s;
}

.login-loading-text {
    margin: 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    animation: login-text-pulse 1.5s ease-in-out infinite;
}

@keyframes login-shimmer {
    0% {
        transform: translateX(-130%);
    }
    100% {
        transform: translateX(320%);
    }
}

@keyframes login-dot-bounce {
    0%, 70%, 100% {
        transform: translateY(0) scale(0.92);
        opacity: 0.35;
    }
    35% {
        transform: translateY(-4px) scale(1);
        opacity: 1;
    }
}

@keyframes login-text-pulse {
    0%, 100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-loading-track-fill,
    .login-loading-dot,
    .login-loading-text {
        animation: none;
    }

    .login-loading-track-fill {
        width: 100%;
        opacity: 0.45;
    }

    .login-loading-dot {
        opacity: 0.7;
    }
}


.login-panel-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.login-panel-lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-panel-lead strong {
    color: var(--text);
    font-weight: 600;
}

.login-forgot-wrap {
    margin: 14px 0 0;
    text-align: center;
}

.login-forgot-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: none;
}

.login-forgot-link:hover {
    color: color-mix(in srgb, var(--muted) 70%, var(--text));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-back-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent, #c41e3a);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-back-link:hover {
    color: color-mix(in srgb, var(--accent, #c41e3a) 82%, #000);
}

.login-back-link-wrap {
    margin: 16px 0 0;
    text-align: center;
}

.login-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-message-success {
    background: color-mix(in srgb, #38a169 14%, transparent);
    border: 1px solid color-mix(in srgb, #38a169 28%, transparent);
    color: color-mix(in srgb, #276749 88%, var(--text));
}

.login-submit {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
}

.login-password-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-password-modal[hidden] {
    display: none !important;
}

.login-password-dialog {
    width: 100%;
    max-width: 420px;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 18px;
    padding: 24px 28px 22px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 28px 56px -12px rgba(15, 23, 42, 0.28);
}

.login-password-hint {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}

.login-password-reqs {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--muted);
}

.login-password-reqs li {
    position: relative;
    padding-left: 1.15em;
}

.login-password-reqs li::before {
    content: '○';
    position: absolute;
    left: 0;
    color: var(--muted);
}

.login-password-reqs li.is-met {
    color: var(--text);
}

.login-password-reqs li.is-met::before {
    content: '●';
    color: #2f855a;
}

.login-password-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-password-skip-hint {
    margin: 4px 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
}

.login-totp-dialog {
    max-width: 440px;
}

.login-mfa-choose-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 12px;
}

.login-mfa-choose-actions .login-submit {
    width: 100%;
}

.login-mfa-choose-actions .login-password-hint {
    margin: 0 0 10px;
}

.login-mfa-or {
    margin: 2px 0 8px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-totp-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0 14px;
}

.login-totp-qr {
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    line-height: 0;
}

.login-totp-qr img,
.login-totp-qr canvas,
.login-totp-qr table {
    display: block;
}

.login-totp-secret {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    word-break: break-all;
}

.login-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 4px;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text);
    cursor: pointer;
    line-height: 1.35;
}

.login-trust input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    accent-color: #c41e3a;
}

.login-trust span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text);
}

.login-totp-recovery-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.login-totp-recovery-list li {
    text-align: center;
    letter-spacing: 0.06em;
}

body.theme-dark .login-password-dialog {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 28px 56px -12px rgba(0, 0, 0, 0.45);
}

body.theme-dark .login-page {
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(196, 30, 58, 0.12), transparent 55%),
        var(--bg);
}

html.theme-dark {
    background: #111924;
    color-scheme: dark;
}

body.theme-dark .login-card {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 28px 56px -12px rgba(0, 0, 0, 0.45);
}

body.theme-dark .login-field input[type="text"],
body.theme-dark .login-field input[type="password"],
body.theme-dark .login-field input[type="email"] {
    background: #162231;
    border-color: #3e5672;
    color: #e8eff8;
}

body.theme-dark .login-field input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

body.theme-dark .login-forgot-link,
body.theme-dark .login-back-link {
    color: #93c5fd;
}

body.theme-dark .login-forgot-link:hover,
body.theme-dark .login-back-link:hover {
    color: #bfdbfe;
}

body.theme-dark .login-panel-title {
    color: #e8eff8;
}

body.theme-dark .login-panel-lead {
    color: #a8b7c8;
}

body.theme-dark .login-loading-text {
    color: #d7e3f2;
}

body.theme-dark .login-bg-word {
    color: #e8eff8;
}

@media (max-width: 480px) {
    .login-shell {
        padding-top: 2rem;
    }


    .login-brand {
        padding: 22px 22px 10px;
    }

    .login-card-body {
        padding: 6px 22px 24px;
    }
}


.user-manage-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.user-manage-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.user-manage-table th,
.user-manage-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e8eef6;
    text-align: left;
    font-size: 0.8rem;
    vertical-align: middle;
}

.user-manage-table th {
    position: sticky;
    top: 0;
    background: #f3f7fd;
    z-index: 1;
}

.user-manage-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.user-manage-modal.episode-modal {
    z-index: 170;
}

.user-manage-modal.episode-modal.open {
    display: flex;
}

.user-manage-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.user-manage-form-body {
    padding: 16px;
}

.user-manage-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.user-manage-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}

.user-manage-field span {
    color: var(--muted);
}

.admin-user-password-hint {
    font-size: 0.74rem !important;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
    line-height: 1.35;
}

.user-manage-field input[type="text"],
.user-manage-field input[type="email"],
.user-manage-field input[type="password"],
.user-manage-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--bg);
    box-sizing: border-box;
}

.user-manage-field-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
}

.user-manage-field-check input {
    width: auto;
}

.user-manage-form-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
    font-size: 0.84rem;
}

.user-manage-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

body.theme-dark .user-manage-table th {
    background: #243246;
}

body.theme-dark .user-manage-table th,
body.theme-dark .user-manage-table td {
    border-bottom-color: #33465f;
}

@media (max-width: 720px) {
    .user-manage-form-grid {
        grid-template-columns: 1fr;
    }
    .user-manage-field-check {
        margin-top: 0;
    }
}

/* Idle session warning (last 2 minutes) */
body.idle-warning-active {
    overflow: hidden;
}

body.idle-warning-active::before {
    content: '';
    position: fixed;
    inset: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(15, 23, 42, 0.18);
    z-index: 99996;
    pointer-events: none;
}

.idle-warning-overlay {
    z-index: 99997;
}

.idle-warning-dialog .idle-warning-hint {
    margin: 0 0 20px;
    font-size: 0.88rem;
    color: #64748b;
}

.idle-warning-countdown {
    margin: 4px 0 14px;
    font-size: clamp(2.4rem, 8vw, 3.2rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    color: #c41e3a;
    line-height: 1.1;
    animation: idle-warning-pulse 1.2s ease-in-out infinite;
}

@keyframes idle-warning-pulse {
    0%, 100% {
        opacity: 0.72;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

body.theme-dark .idle-warning-dialog .idle-warning-hint {
    color: #94a3b8;
}

body.theme-dark .idle-warning-countdown {
    color: #f06b7d;
}

@media (prefers-reduced-motion: reduce) {
    .idle-warning-countdown {
        animation: none;
    }
}
.smtp-password-hint {
    font-weight: 400;
    color: #64748b;
    font-size: 0.82em;
}

body.theme-dark .smtp-password-hint {
    color: #94a3b8;
}
.dashboard-widget-temperatures {
    min-height: 0;
}

.dashboard-widget-server-uptime {
    min-height: 0;
}

.dashboard-server-uptime-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0 4px;
}

.dashboard-server-uptime-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-server-uptime-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.dashboard-server-uptime-boot,
.dashboard-server-uptime-up {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.dashboard-server-uptime-up {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

body.theme-dark .dashboard-server-uptime-label {
    color: #94a3b8;
}

body.theme-dark .dashboard-server-uptime-boot,
body.theme-dark .dashboard-server-uptime-up {
    color: #e2e8f0;
}

.dashboard-temp-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
}

.dashboard-temp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-temp-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    padding: 8px 10px 7px;
    border: 1px solid #dbe4ef;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    min-width: 0;
}

.dashboard-temp-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #94a3b8;
}

.dashboard-temp-card.is-cool::before { background: linear-gradient(180deg, #38bdf8, #0ea5e9); }
.dashboard-temp-card.is-ok::before { background: linear-gradient(180deg, #34d399, #10b981); }
.dashboard-temp-card.is-warm::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.dashboard-temp-card.is-hot::before { background: linear-gradient(180deg, #fb7185, #ef4444); }
.dashboard-temp-card.is-unknown::before { background: #94a3b8; }

.dashboard-temp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-temp-card-name {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.dashboard-temp-card-name-line {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.15;
}

.dashboard-temp-card-value {
    font-family: "Courier New", Courier, monospace;
    font-size: clamp(1.05rem, 3.2cqw, 1.45rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.dashboard-temp-card-value small {
    font-size: 0.72em;
    font-weight: 700;
    opacity: 0.72;
}

.dashboard-temp-card-bar {
    margin-top: 6px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.dashboard-temp-card-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #10b981, #f59e0b, #ef4444);
    transition: width 0.35s ease;
}

.dashboard-temp-card.is-unknown .dashboard-temp-card-value {
    font-size: 1rem;
    color: #94a3b8;
}

.dashboard-social-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
}

.dashboard-social-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-social-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 252, 0.96) 100%);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-social-row:hover,
.dashboard-social-row:focus-visible {
    border-color: #b8c7d9;
    box-shadow: 0 4px 12px rgba(20, 34, 56, 0.08);
    outline: none;
}

.dashboard-social-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
}

.dashboard-social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.dashboard-social-row.is-youtube .dashboard-social-icon { background: #ff0000; }
.dashboard-social-row.is-facebook .dashboard-social-icon { background: #1877f2; }
.dashboard-social-row.is-instagram .dashboard-social-icon {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%);
}

.dashboard-social-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dashboard-social-platform {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.dashboard-social-metric {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.2;
}

.dashboard-social-count {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dashboard-social-count.is-empty {
    color: #94a3b8;
    font-weight: 700;
}

body.theme-dark .dashboard-social-row {
    border-color: #334155;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
}

body.theme-dark .dashboard-social-metric {
    color: #94a3b8;
}

body.theme-dark .dashboard-social-row:hover,
body.theme-dark .dashboard-social-row:focus-visible {
    border-color: #475569;
}

body.theme-dark .dashboard-temp-card {
    border-color: #334155;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .dashboard-temp-card-value {
    color: #e2e8f0;
}

body.theme-dark .dashboard-temp-card-name-line {
    color: #94a3b8;
}

body.theme-dark .dashboard-temp-card-bar {
    background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 720px) {
    .dashboard-temp-grid {
        grid-template-columns: 1fr;
    }
}


.app-subnav-spacer {
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
    flex-shrink: 0;
    width: var(--nav-menu-col-width, auto);
    min-width: var(--nav-menu-col-width, 0);
    max-width: var(--nav-menu-col-width, none);
}

.app-subnav-spacer .app-subnav-spacer-label {
    visibility: hidden;
    display: flex;
    width: 100%;
    overflow: hidden;
}

.admin-subnav-bar[hidden] {
    display: none !important;
}

.connections-subnav-bar[hidden] {
    display: none !important;
}

.cron-watchdog-subnav-bar[hidden] {
    display: none !important;
}

.youtube-auth-subnav-bar[hidden] {
    display: none !important;
}

.connections-region-panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.connections-region-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.connections-region-panel[hidden] {
    display: none !important;
}

.admin-backend-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    background: #d3dce8;
}

.admin-backend-app[hidden] {
    display: none !important;
}

.admin-backend-app .admin-backend-panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-backend-app .admin-backend-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.admin-backend-app .admin-backend-panel-body {
    min-height: 0;
}

body.view-admin-backend .header-widgets-btn,
body.view-admin-backend #dashboardWidgetsMobileBtn,
body.view-admin-backend .header-all-assets-btn,
body.view-admin-backend #allAssetsBtn {
    display: none !important;
}

body.theme-dark .admin-backend-app {
    background: #1a2838;
}
.playout-subnav-bar[hidden] {
    display: none !important;
}

.de-control-subnav-bar[hidden] {
    display: none !important;
}

.playout-backend-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    background: #d3dce8;
}

.playout-backend-app[hidden] {
    display: none !important;
}

.playout-backend-app .playout-backend-panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.playout-backend-app .admin-backend-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.playout-backend-app .admin-backend-panel-body {
    min-height: 0;
}

.playout-backend-app .playout-youtube-feed-panel {
    min-height: 0;
    height: 100%;
}

.playout-backend-app .playout-youtube-feed-frame {
    border: 0;
    min-height: 420px;
}

.de-control-app .playout-youtube-feed-panel {
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.de-control-app .playout-youtube-feed-frame {
    border: 0;
    flex: 1 1 auto;
    min-height: 420px;
    width: 100%;
    background: #0f172a;
}

.de-control-app .ytf-layout {
    flex: 1 1 auto;
    min-height: 0;
}

.playout-backend-app .proxy-queue-panel-body,
.playout-backend-app .playout-daypart-panel,
.playout-backend-app .playout-yearpart-panel,
.playout-backend-app .rating-settings-body {
    min-height: 0;
}

body.view-playout-backend .header-widgets-btn,
body.view-playout-backend #dashboardWidgetsMobileBtn,
body.view-playout-backend .header-all-assets-btn,
body.view-playout-backend #allAssetsBtn {
    display: none !important;
}

body.theme-dark .playout-backend-app {
    background: #1a2838;
}
.youtube-live-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.youtube-live-app[hidden] {
    display: none !important;
}

.schedule-grid-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f4f7fb;
}

.schedule-grid-app[hidden] {
    display: none !important;
}

body.view-schedule-grid .header-widgets-btn,
body.view-schedule-grid #dashboardWidgetsMobileBtn,
body.view-schedule-grid .header-all-assets-btn,
body.view-schedule-grid #allAssetsBtn {
    display: none !important;
}

body.theme-dark .schedule-grid-app {
    background: #1a2838;
}

.es-grid-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f4f7fb;
}

.es-grid-app[hidden] {
    display: none !important;
}

.de-grid-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f4f7fb;
}

.de-grid-app[hidden] {
    display: none !important;
}

body.view-de-grid .header-widgets-btn,
body.view-de-grid #dashboardWidgetsMobileBtn,
body.view-de-grid .header-all-assets-btn,
body.view-de-grid #allAssetsBtn {
    display: none !important;
}

body.theme-dark .de-grid-app {
    background: #1a2838;
}

/* Show AsRun modal (Scheduling ES) */
#esAsrunModal.episode-modal {
    z-index: 140;
}

.es-asrun-dialog {
    width: min(1100px, calc(100vw - 24px));
    height: min(85vh, 820px);
    max-height: calc(100vh - 40px);
}

.es-asrun-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 12px;
}

.es-asrun-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.es-asrun-date-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #35506d;
}

.es-asrun-date-input {
    width: auto;
    min-width: 200px;
    max-width: min(320px, 70vw);
}

.es-asrun-table-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: auto;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fbfcfe;
}

.es-asrun-table-wrap.is-loading::after {
    content: 'Loading…';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 252, 254, 0.72);
    color: #5b6b82;
    font-size: 0.9rem;
    font-weight: 650;
    z-index: 2;
    pointer-events: none;
}

#esAsrunEmptyHint {
    margin: 0;
    padding: 16px;
}

.es-asrun-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.es-asrun-table th,
.es-asrun-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e4ebf4;
    text-align: left;
    vertical-align: top;
}

.es-asrun-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef3f9;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b82;
}

.es-asrun-table tbody tr:hover {
    background: #f3f7fc;
}

.es-asrun-time {
    display: block;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: #1f2a37;
}

.es-asrun-dur {
    display: block;
    margin-top: 2px;
    font-size: 0.74rem;
    color: #667085;
    font-variant-numeric: tabular-nums;
}

.es-asrun-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.es-asrun-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.es-asrun-item-name {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1f2a37;
    word-break: break-word;
    line-height: 1.25;
}

.es-asrun-item-file {
    display: block;
    font-size: 0.74rem;
    color: #667085;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.es-asrun-live-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.es-asrun-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
    border: 1px solid transparent;
}

.es-asrun-status.is-aired {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.es-asrun-status.is-not-aired {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.es-asrun-status.is-skipped {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.es-asrun-status.is-other {
    background: #e8eef7;
    color: #334155;
    border-color: #c9d5e6;
}

body.theme-dark .es-asrun-dialog,
body.theme-dark .es-asrun-table-wrap {
    background: #1a2838;
    border-color: #2f4258;
}

body.theme-dark .es-asrun-table-wrap.is-loading::after {
    background: rgba(26, 40, 56, 0.72);
    color: #9db0c7;
}

body.theme-dark .es-asrun-table th {
    background: #223447;
    color: #9db0c7;
}

body.theme-dark .es-asrun-table th,
body.theme-dark .es-asrun-table td {
    border-bottom-color: #2f4258;
}

body.theme-dark .es-asrun-table tbody tr:hover {
    background: #243648;
}

body.theme-dark .es-asrun-time,
body.theme-dark .es-asrun-item-name {
    color: #e8eef5;
}

body.theme-dark .es-asrun-dur,
body.theme-dark .es-asrun-date-label,
body.theme-dark .es-asrun-item-file {
    color: #9db0c7;
}

body.view-es-grid .header-widgets-btn,
body.view-es-grid #dashboardWidgetsMobileBtn,
body.view-es-grid .header-all-assets-btn,
body.view-es-grid #allAssetsBtn {
    display: none !important;
}

body.theme-dark .es-grid-app {
    background: #1a2838;
}

.youtube-live-workspace {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 13fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    background: #d3dce8;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.youtube-live-list-panel,
.youtube-live-detail-panel {
    min-height: 0;
    max-height: 100%;
}

.youtube-live-events-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: auto;
}

.youtube-live-event-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 2px 10px;
    align-items: start;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.youtube-live-event-item:hover,
.youtube-live-event-item:focus-visible {
    border-color: #9eb4cf;
    box-shadow: 0 0 0 2px rgba(158, 180, 207, 0.25);
}

.youtube-live-event-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.youtube-live-event-thumb {
    grid-row: 1 / span 3;
    width: 72px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #e2e8f0;
}

.youtube-live-event-thumb.is-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #64748b;
}

.youtube-live-event-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.youtube-live-event-meta {
    grid-column: 2;
    font-size: 0.72rem;
    color: #475569;
}

.youtube-live-event-item.is-live {
    border-color: #dc2626;
    background: #fff5f5;
}

.youtube-live-event-badges {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.youtube-live-event-live,
.youtube-live-event-testing {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 1px 7px;
}

.youtube-live-event-live {
    color: #fff;
    background: #dc2626;
}

.youtube-live-event-testing {
    color: #92400e;
    background: #fef3c7;
}

body.theme-dark .youtube-live-event-item.is-live {
    background: #3f1d1d;
    border-color: #ef4444;
}

body.theme-dark .youtube-live-event-testing {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.22);
}

.youtube-live-event-badges .youtube-live-event-privacy {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.youtube-live-event-feed {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1e3a5f;
    background: #e8eef6;
    border-radius: 999px;
    padding: 1px 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.youtube-live-event-viewers {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}

.youtube-live-event-feed.is-missing {
    color: #94a3b8;
    background: #f1f5f9;
    font-weight: 600;
}

body.theme-dark .youtube-live-event-feed {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.18);
}

body.theme-dark .youtube-live-event-viewers {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.22);
}

body.theme-dark .youtube-live-event-feed.is-missing {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.14);
}

body.theme-dark .youtube-live-workspace {
    background: #0f172a;
}

body.theme-dark .youtube-live-event-item {
    background: #1e293b;
    border-color: #334155;
}

body.theme-dark .youtube-live-event-item.active {
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.theme-dark .youtube-live-event-title {
    color: #e2e8f0;
}

body.theme-dark .youtube-live-event-meta {
    color: #94a3b8;
    background: transparent;
}

body.theme-dark .youtube-live-event-item.is-live {
    background: #3f1d1d;
    border-color: #ef4444;
}

.youtube-live-event-badges {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.youtube-live-event-live,
.youtube-live-event-testing {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 1px 7px;
}

.youtube-live-event-live {
    color: #fff;
    background: #dc2626;
}

.youtube-live-event-testing {
    color: #92400e;
    background: #fef3c7;
}

body.theme-dark .youtube-live-event-testing {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.22);
}

.youtube-live-event-privacy {
    color: #94a3b8;
}

body.view-youtube-live .header-widgets-btn,
body.view-youtube-live #dashboardWidgetsMobileBtn,
body.view-youtube-live .header-all-assets-btn,
body.view-youtube-live #allAssetsBtn {
    display: none !important;
}

@media (max-width: 960px) {
    .youtube-live-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(220px, 42vh) minmax(0, 1fr);
    }
}
.youtube-live-detail-panel .panel-body {
    overflow: auto;
}

.youtube-manager-detail {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.youtube-live-detail-panel .panel-body {
    position: relative;
    min-height: 280px;
}

.youtube-manager-detail.is-busy .youtube-manager-detail-actions,
.youtube-manager-detail.is-busy #youtubeManagerDetailForm,
.youtube-manager-detail.is-busy .youtube-manager-thumbnails {
    pointer-events: none;
}


.youtube-manager-preview-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.youtube-manager-preview-row .episode-youtube-player-wrap {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    margin: 0;
    min-width: 0;
}

.youtube-manager-thumbnails {
    flex: 0 0 108px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.youtube-manager-thumbnail-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
}

.youtube-manager-thumbnail-btn img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #e2e8f0;
}

.youtube-manager-thumbnail-btn.is-placeholder {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-manager-thumbnail-placeholder-text {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
    padding: 8px;
    text-align: center;
}

.youtube-manager-thumbnail-label {
    position: absolute;
    left: 6px;
    top: 6px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    padding: 1px 6px;
}

.youtube-manager-thumbnail-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.youtube-manager-thumbnail-btn:hover .youtube-manager-thumbnail-hint,
.youtube-manager-thumbnail-btn:focus-visible .youtube-manager-thumbnail-hint {
    opacity: 1;
}

.youtube-manager-thumbnail-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

body.theme-dark .youtube-manager-thumbnail-btn {
    background: #1e293b;
    border-color: #334155;
}

body.theme-dark .youtube-manager-thumbnail-placeholder-text {
    color: #94a3b8;
}

@media (max-width: 720px) {
    .youtube-manager-preview-row {
        flex-direction: column;
    }

    .youtube-manager-thumbnails {
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .youtube-manager-thumbnail-btn {
        width: 108px;
    }
}

.youtube-manager-detail .episode-youtube-player-wrap {
    width: 50%;
    max-width: 50%;
    margin: 0 auto;
}

.youtube-manager-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    font-size: 0.78rem;
}

.youtube-manager-detail-meta code {
    font-size: 0.78rem;
}

.youtube-manager-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.youtube-manager-readonly-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.72rem;
}

.youtube-manager-readonly-item span {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.youtube-manager-readonly-item strong {
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 600;
}

.youtube-manager-detail .episode-youtube-create-form {
    display: grid;
    gap: 10px;
}

.youtube-manager-detail .episode-youtube-field-title textarea {
    min-height: 2.8em;
    max-height: 6em;
    resize: vertical;
    line-height: 1.3;
    overflow: auto;
}

.youtube-manager-detail .episode-youtube-field-grow textarea {
    min-height: 60px;
    resize: vertical;
}

.btn.youtube-go-live {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
}

.btn.youtube-go-live:hover {
    background: #ef4444;
    border-color: #dc2626;
}

.btn.youtube-go-live:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.youtube-manager-detail-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.youtube-manager-detail-status {
    font-size: 0.78rem;
    color: var(--muted);
}

.youtube-manager-detail-status.error {
    color: #b45309;
}


.youtube-manager-detail .episode-youtube-field-locked select:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: #f3f6fa;
}

body.theme-dark .youtube-manager-detail .episode-youtube-field-locked select:disabled {
    background: #1e293b;
}

body.theme-dark .youtube-manager-readonly-item strong {
    color: #e2e8f0;
}

@media (max-width: 720px) {
    .youtube-manager-readonly-grid {
        grid-template-columns: 1fr;
    }
}
.maintenance-panel {
    padding: 18px;
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--brand-soft) 70%, transparent) 0%, transparent 42%),
        color-mix(in srgb, var(--shell) 88%, #ffffff 12%);
}

.maintenance-admin {
    width: 100%;
    max-width: none;
}

.maintenance-admin-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.maintenance-admin-card.is-active {
    border-color: color-mix(in srgb, #c62828 35%, var(--line));
    box-shadow:
        0 0 0 1px color-mix(in srgb, #c62828 12%, transparent),
        0 14px 30px rgba(198, 40, 40, 0.08);
}

.maintenance-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.maintenance-admin-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.maintenance-admin-lead {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
    max-width: 72ch;
}

.maintenance-status-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.maintenance-status-badge.is-idle {
    color: #1f8f5f;
    background: color-mix(in srgb, #1f8f5f 12%, #ffffff);
    border-color: color-mix(in srgb, #1f8f5f 22%, transparent);
}

.maintenance-status-badge.is-active {
    color: #b42318;
    background: color-mix(in srgb, #c62828 12%, #ffffff);
    border-color: color-mix(in srgb, #c62828 24%, transparent);
}

.maintenance-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.maintenance-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.maintenance-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
    cursor: pointer;
}

.maintenance-switch-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.maintenance-switch-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.maintenance-switch-hint {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.maintenance-switch {
    position: relative;
    flex: none;
    width: 48px;
    height: 28px;
}

.maintenance-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.maintenance-switch-ui {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #c5d0de;
    border: 1px solid #aebccd;
    transition: background 0.18s ease, border-color 0.18s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.maintenance-switch-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.18s ease;
}

.maintenance-switch input:checked + .maintenance-switch-ui {
    background: #c62828;
    border-color: #a61f1a;
}

.maintenance-switch input:checked + .maintenance-switch-ui::after {
    transform: translateX(20px);
}

.maintenance-switch input:focus-visible + .maintenance-switch-ui {
    outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
    outline-offset: 2px;
}

.maintenance-message-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maintenance-message-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.maintenance-message-label-row label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
}

.maintenance-message-hint {
    font-size: 0.74rem;
    color: var(--muted);
}

.maintenance-message-field input,
.maintenance-message-field select,
.maintenance-message-field textarea,
.maintenance-message-field .youtube-auth-readonly {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.maintenance-message-field textarea {
    min-height: 108px;
    resize: vertical;
}

.maintenance-message-field .youtube-auth-readonly {
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
    cursor: default;
    user-select: text;
}

.maintenance-message-field input:focus,
.maintenance-message-field select:focus,
.maintenance-message-field textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 70%, transparent);
}

.smtp-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.smtp-test-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--shell) 70%, #ffffff);
}

.smtp-test-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.smtp-test-row input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.smtp-test-row input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 70%, transparent);
}

.smtp-test-row .btn {
    flex: none;
}

@media (max-width: 720px) {
    .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .smtp-test-row {
        flex-direction: column;
    }
}

.maintenance-admin-status {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.maintenance-admin-status.ok {
    color: #146c43;
    background: color-mix(in srgb, #1f8f5f 12%, #ffffff);
    border: 1px solid color-mix(in srgb, #1f8f5f 22%, transparent);
}

.maintenance-admin-status.error {
    color: #b42318;
    background: color-mix(in srgb, #c62828 12%, #ffffff);
    border: 1px solid color-mix(in srgb, #c62828 22%, transparent);
}

.maintenance-admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.maintenance-admin-footer-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.cron-watchdog-admin {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cron-job-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connections-admin .connections-section-summary {
    display: flex;
    align-items: center;
    gap: 8px 10px;
    grid-template-columns: unset;
}

.connections-admin .connections-section-summary .cron-job-summary-title {
    flex: 1 1 auto;
    min-width: 0;
}

.connections-admin .connections-section-summary .cron-job-summary-chevron {
    margin-left: auto;
    flex: 0 0 auto;
    justify-self: unset;
}

.connections-admin .cron-job-detail .smtp-form-grid,
.connections-admin .cron-job-detail .maintenance-message-field {
    margin-top: 10px;
}

.connections-admin .cron-job-detail .smtp-form-grid:first-child,
.connections-admin .cron-job-detail > .maintenance-message-field:first-child {
    margin-top: 0;
}

.cron-job-row {
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.cron-job-row.is-enabled {
    border-color: #bbf7d0;
}

.cron-job-row.is-disabled {
    border-color: #e2e8f0;
}

.cron-job-summary {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) auto minmax(90px, auto) auto minmax(180px, 1.4fr) auto;
    align-items: center;
    gap: 8px 10px;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.cron-job-row.is-open .cron-job-summary {
    background: #eff6ff;
    border-bottom: 1px solid #dbe3ee;
}

.cron-job-summary:hover {
    background: #f1f5f9;
}

.cron-job-summary-title {
    font-weight: 750;
    font-size: 0.92rem;
    color: #0f172a;
}

.cron-job-summary-sep {
    color: #94a3b8;
    font-weight: 600;
}

.cron-job-summary-state {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    justify-self: start;
}

.cron-job-summary-state.is-on {
    color: #166534;
    background: #dcfce7;
}

.cron-job-summary-state.is-off {
    color: #64748b;
    background: #e2e8f0;
}

.cron-job-summary-last {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cron-job-summary-last.is-ok {
    color: #15803d;
}

.cron-job-summary-last.is-error {
    color: #b91c1c;
}

.cron-job-summary-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    justify-self: end;
}

.cron-job-row.is-open .cron-job-summary-chevron {
    transform: rotate(45deg);
}

.cron-job-detail {
    padding: 12px 14px 14px;
    background: #fff;
}

.cron-job-desc {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.4;
}

.cron-job-card .cron-job-fields,
.cron-job-detail .cron-job-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.cron-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.cron-field input[type="time"],
.cron-field input[type="number"],
.cron-field input[type="text"] {
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    font-weight: 600;
    background: #fff;
}

.cron-field input[type="text"] {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
}

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

.cron-last-run {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.cron-job-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cron-log-tail {
    margin: 0;
    max-height: 140px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.cron-history-wrap {
    overflow: auto;
    max-height: 360px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
}

.cron-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cron-history-table th,
.cron-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.cron-history-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
}

.cron-history-ok td:nth-child(3) { color: #15803d; font-weight: 700; }
.cron-history-error td:nth-child(3) { color: #b91c1c; font-weight: 700; }
.cron-history-skipped td:nth-child(3) { color: #64748b; font-weight: 700; }

.cron-tick.is-fresh { color: #15803d; }
.cron-tick.is-stale { color: #b45309; }

@media (max-width: 900px) {
    .cron-job-summary {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title chevron"
            "state state"
            "last last";
    }
    .cron-job-summary-title { grid-area: title; }
    .cron-job-summary-state { grid-area: state; }
    .cron-job-summary-last { grid-area: last; white-space: normal; }
    .cron-job-summary-chevron { grid-area: chevron; }
    .cron-job-summary-sep { display: none; }
}

body.theme-dark .cron-job-row {
    background: #1a2a3b;
    border-color: #3e5672;
}
body.theme-dark .cron-job-summary {
    background: #162334;
    color: #e8eff8;
}
body.theme-dark .cron-job-row.is-open .cron-job-summary,
body.theme-dark .cron-job-summary:hover {
    background: #1e3348;
}
body.theme-dark .cron-job-summary-title { color: #e8eff8; }
body.theme-dark .cron-job-detail { background: #1a2a3b; }
body.theme-dark .cron-job-desc { color: #94a3b8; }
body.theme-dark .cron-job-summary-last { color: #94a3b8; }
body.theme-dark .cron-field { color: #cbd5e1; }
body.theme-dark .cron-last-run { color: #e2e8f0; }
body.theme-dark .cron-field input[type="time"],
body.theme-dark .cron-field input[type="number"],
body.theme-dark .cron-field input[type="text"] {
    background: #1e3044;
    border-color: #3f5875;
    color: #e2e8f0;
}
body.theme-dark .cron-history-wrap { border-color: #3f5875; }
body.theme-dark .cron-history-table th {
    background: #1e3044;
    color: #e2e8f0;
}
body.theme-dark .cron-history-table th,
body.theme-dark .cron-history-table td {
    border-bottom-color: #3f5875;
}

body.theme-dark .maintenance-panel {
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--brand) 18%, transparent) 0%, transparent 42%),
        #1a2838;
}

body.theme-dark .maintenance-admin-card {
    background: #22354b;
    border-color: #3f5875;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

body.theme-dark .maintenance-admin-card.is-active {
    border-color: color-mix(in srgb, #ff8a80 35%, #3f5875);
}

body.theme-dark .maintenance-switch-row {
    background: #1e3044;
    border-color: #3f5875;
}

body.theme-dark .maintenance-switch-ui {
    background: #3f5875;
    border-color: #5a7698;
}

body.theme-dark .maintenance-message-field input,
body.theme-dark .maintenance-message-field select,
body.theme-dark .maintenance-message-field textarea,
body.theme-dark .maintenance-message-field .youtube-auth-readonly,
body.theme-dark .smtp-test-row input {
    background: #1e3044;
    border-color: #3f5875;
    color: #e9f1fb;
}

body.theme-dark .maintenance-message-field .youtube-auth-readonly {
    background: #1a2838;
}

body.theme-dark .maintenance-message-field input:focus,
body.theme-dark .maintenance-message-field select:focus,
body.theme-dark .maintenance-message-field textarea:focus,
body.theme-dark .smtp-test-row input:focus {
    border-color: color-mix(in srgb, var(--brand) 45%, #3f5875);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

body.theme-dark .smtp-test-block {
    background: #1e3044;
    border-color: #3f5875;
}

body.theme-dark .rating-settings-select,
body.theme-dark .rating-settings-add-input {
    background: #1e3044;
    border-color: #3f5875;
    color: #e9f1fb;
}

body.theme-dark .rating-settings-item,
body.theme-dark .proxy-queue-panel-body .proxy-queue-log-details {
    background: #1e3044;
    border-color: #3f5875;
}

body.theme-dark .rating-settings-default-badge {
    background: color-mix(in srgb, #1f8f5f 22%, #1e3044);
    color: #7dcea0;
    border-color: color-mix(in srgb, #1f8f5f 28%, transparent);
}

body.theme-dark .proxy-queue-panel-body .proxy-queue-ladder,
body.theme-dark .proxy-queue-panel-body .proxy-queue-history-scroll {
    background: #1e3044;
    border-color: #3f5875;
}

body.theme-dark .proxy-queue-panel-body .proxy-queue-worker-hint {
    background: color-mix(in srgb, var(--brand) 18%, #1e3044);
    border-color: color-mix(in srgb, var(--brand) 28%, #3f5875);
}


body.theme-dark .maintenance-status-badge.is-idle {
    color: #7dcea0;
    background: color-mix(in srgb, #1f8f5f 22%, #1e3044);
}

body.theme-dark .maintenance-status-badge.is-active {
    color: #ff8a80;
    background: color-mix(in srgb, #c62828 22%, #1e3044);
}

body.theme-dark .maintenance-admin-footer {
    border-top-color: #3f5875;
}

body.theme-dark .maintenance-admin-status.ok {
    color: #7dcea0;
    background: color-mix(in srgb, #1f8f5f 18%, #1e3044);
}

body.theme-dark .maintenance-admin-status.error {
    color: #ff8a80;
    background: color-mix(in srgb, #c62828 18%, #1e3044);
}

body.theme-dark .json-import-body .json-import-select,
body.theme-dark .json-import-body .json-import-path-select,
body.theme-dark .json-import-body .json-import-mapping-wrap,
body.theme-dark .backup-list-wrap {
    background: #1e3044;
    border-color: #3f5875;
    color: #e9f1fb;
}

body.theme-dark .json-import-body input[type="file"] {
    background: #1a2838;
    border-color: #3f5875;
    color: #e9f1fb;
}


@media (max-width: 720px) {
    .maintenance-admin-head {
        flex-direction: column;
    }

    .maintenance-switch-row {
        align-items: flex-start;
    }

    .maintenance-message-label-row {
        flex-direction: column;
        gap: 4px;
    }
}

.maintenance-mode-message {
    margin: 0 0 18px;
    color: var(--text);
    line-height: 1.55;
    font-size: 0.95rem;
}

.maintenance-mode-actions {
    display: grid;
    gap: 12px;
}

.maintenance-notify-btn {
    width: 100%;
}

.maintenance-notify-confirmed {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.maintenance-overlay.is-visible {
    display: flex;
}

.maintenance-overlay[hidden] {
    display: none !important;
}

.maintenance-overlay-card {
    width: min(100%, 460px);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 28px 56px -12px rgba(15, 23, 42, 0.35);
}

.maintenance-overlay-brand img {
    width: 100%;
    max-width: 220px;
    display: block;
    margin: 0 auto 18px;
}

.maintenance-overlay-title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 1.2rem;
}

.maintenance-overlay-message {
    margin: 0 0 18px;
    color: var(--text);
    line-height: 1.55;
    text-align: center;
    white-space: pre-wrap;
}

.maintenance-overlay-success,
.maintenance-overlay-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.maintenance-overlay-success {
    background: color-mix(in srgb, #38a169 14%, transparent);
    border: 1px solid color-mix(in srgb, #38a169 28%, transparent);
    color: color-mix(in srgb, #276749 88%, var(--text));
}

.maintenance-overlay-error {
    background: color-mix(in srgb, #e53e3e 12%, transparent);
    border: 1px solid color-mix(in srgb, #e53e3e 28%, transparent);
    color: color-mix(in srgb, #c53030 88%, var(--text));
}

body.is-maintenance-locked {
    overflow: hidden;
}

.admin-user-hub {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: min(72vh, 680px);
}

.admin-user-list-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-user-list-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-user-input,
.admin-user-search {
    padding: 9px 12px;
    border: 1px solid #d5e1ef;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
    color: #22354f;
    box-sizing: border-box;
}

.admin-user-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.admin-user-hub .admin-user-input,
.admin-user-hub select.admin-user-input,
.admin-backend-app .admin-user-input,
.admin-backend-app select.admin-user-input,
.admin-user-hub .user-manage-field input[type="text"],
.admin-user-hub .user-manage-field input[type="email"],
.admin-user-hub .user-manage-field input[type="password"],
.admin-user-hub .user-manage-field select {
    width: 100%;
    background: #ffffff !important;
    color: #22354f !important;
    border: 1px solid #cfd9e6 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    -webkit-text-fill-color: #22354f !important;
    appearance: none;
}

.admin-user-hub .admin-user-input:focus,
.admin-user-hub select.admin-user-input:focus,
.admin-backend-app .admin-user-input:focus,
.admin-backend-app select.admin-user-input:focus {
    outline: none;
    border-color: #7aa2d6 !important;
    box-shadow: 0 0 0 3px rgba(122, 162, 214, 0.18) !important;
}

.admin-user-input::placeholder,
.admin-user-hub .admin-user-input::placeholder {
    color: #8a9bb0 !important;
    -webkit-text-fill-color: #8a9bb0 !important;
}

body.theme-dark .admin-user-hub .admin-user-input,
body.theme-dark .admin-user-hub select.admin-user-input,
body.theme-dark .admin-backend-app .admin-user-input,
body.theme-dark .admin-backend-app select.admin-user-input,
body.theme-dark .admin-user-hub .admin-user-search,
body.theme-dark .admin-user-hub .user-manage-field input[type="text"],
body.theme-dark .admin-user-hub .user-manage-field input[type="email"],
body.theme-dark .admin-user-hub .user-manage-field input[type="password"],
body.theme-dark .admin-user-hub .user-manage-field select {
    background: #1a2a3b !important;
    color: #e8eff8 !important;
    border: 1px solid #3e5672 !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

body.theme-dark .admin-user-hub .admin-user-input:focus,
body.theme-dark .admin-user-hub select.admin-user-input:focus,
body.theme-dark .admin-backend-app .admin-user-input:focus,
body.theme-dark .admin-backend-app select.admin-user-input:focus,
body.theme-dark .admin-user-hub .admin-user-search:focus {
    border-color: #7aa2d6 !important;
    box-shadow: 0 0 0 3px rgba(122, 162, 214, 0.22) !important;
}

body.theme-dark .admin-user-hub .admin-user-input::placeholder,
body.theme-dark .admin-user-hub .admin-user-search::placeholder {
    color: #8fa3bb !important;
    -webkit-text-fill-color: #8fa3bb !important;
}

body.theme-dark .admin-user-list-scroll {
    background: #162231;
    border-color: #3e5672;
}

body.theme-dark .admin-user-list-table th,
body.theme-dark .admin-user-list-table td {
    color: #e8eff8;
    border-bottom-color: #31465e;
}

body.theme-dark .admin-user-list-table th {
    background: #1a2a3b;
    color: #c5d3e3;
}

body.theme-dark .admin-user-list-row:hover {
    background: #1e3044;
}

body.theme-dark .admin-user-list-row.is-selected {
    background: #24384d;
}

body.theme-dark .admin-user-list-empty,
body.theme-dark .admin-user-hub .hint,
body.theme-dark .admin-user-side-lead,
body.theme-dark .admin-user-side-empty,
body.theme-dark .admin-user-detail-id,
body.theme-dark .admin-user-detail-empty {
    color: #8fa3bb;
}

body.theme-dark .admin-user-detail-section {
    background: #162231;
    border-color: #3e5672;
}

body.theme-dark .admin-user-detail-title {
    color: #e8eff8;
}

body.theme-dark .admin-user-detail-meta {
    color: #a8b7c8;
    border-top-color: #31465e;
}

body.theme-dark .admin-user-detail-meta span {
    color: #8fa3bb;
}

body.theme-dark .admin-user-side-lead {
    color: #8fa3bb;
}

body.theme-dark .admin-backend-modal .admin-user-input,
body.theme-dark .admin-backend-modal .admin-user-search,
body.theme-dark .admin-backend-modal select.admin-user-input {
    background: #1a2a3b !important;
    color: #e8eff8 !important;
    border: 1px solid #3e5672 !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

body.theme-dark .admin-backend-modal .admin-user-input::placeholder,
body.theme-dark .admin-backend-modal .admin-user-search::placeholder {
    color: #8fa3bb !important;
    -webkit-text-fill-color: #8fa3bb !important;
}

.admin-backend-modal .admin-user-input,
.admin-backend-modal .admin-user-search,
.admin-backend-modal select.admin-user-input {
    background: #fff !important;
    color: #22354f !important;
    border: 1px solid #d5e1ef !important;
    -webkit-text-fill-color: #22354f !important;
}

.admin-backend-modal .admin-user-input::placeholder,
.admin-backend-modal .admin-user-search::placeholder {
    color: #8a9bb0 !important;
    -webkit-text-fill-color: #8a9bb0 !important;
}

.admin-user-list-scroll {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #e2eaf4;
    border-radius: 10px;
    background: #fff;
    outline: none;
}

.admin-user-list-scroll:focus-visible {
    box-shadow: 0 0 0 3px rgba(122, 162, 214, 0.28);
}

.admin-user-list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.admin-user-list-table th,
.admin-user-list-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #e8eef6;
    text-align: left;
    font-size: 0.82rem;
    vertical-align: middle;
    color: #22354f;
}

.admin-user-list-table th {
    position: sticky;
    top: 0;
    background: #f3f7fd;
    z-index: 1;
    font-weight: 700;
}

.admin-user-list-row {
    cursor: pointer;
}

.admin-user-list-row:hover {
    background: #f5f9ff;
}

.admin-user-list-row.is-selected {
    background: #e8f1ff;
}

.admin-user-list-empty {
    text-align: center;
    color: #6a8098;
    font-size: 0.82rem;
    padding: 16px;
}

.admin-user-detail-section {
    flex: 1 1 auto;
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    padding: 18px 20px;
    background: #fff;
    overflow: auto;
    min-height: 0;
}

.admin-user-detail-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1.05fr);
    gap: 20px;
    align-items: start;
}

.admin-user-detail-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.admin-user-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-user-detail-fields .user-manage-field {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.admin-user-detail-fields .user-manage-field > span:first-child {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #627085;
}

.admin-user-detail-fields .admin-user-switch-field {
    grid-template-columns: 140px auto;
    justify-content: start;
    align-items: center;
}

.admin-user-detail-fields .admin-user-switch-field > span:first-child {
    text-transform: uppercase;
}

.admin-user-detail-side {
    min-width: 0;
    max-width: 100%;
    border: 1px solid #e2eaf4;
    border-radius: 12px;
    background: #f7faff;
    padding: 16px;
    min-height: 220px;
    overflow: hidden;
}

.admin-user-side-title,
.admin-user-side-lead {
    overflow-wrap: anywhere;
}

.admin-user-side-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.admin-user-side-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #24384f;
}

.admin-user-side-lead {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #6a8098;
}

.admin-user-side-empty {
    margin: auto;
    text-align: center;
    color: #8a9bb0;
    font-size: 0.84rem;
}

.admin-user-page-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-user-page-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    color: #24384f;
    min-width: 0;
    overflow: hidden;
}

.admin-user-page-option:hover {
    border-color: #9ab4d8;
    background: #f3f7fd;
}

.admin-user-page-option-text {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-user-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    display: inline-block;
}

.admin-user-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.admin-user-switch-ui {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #c9d4e2;
    border: 1px solid #b3c0d0;
    transition: background 0.18s ease, border-color 0.18s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.admin-user-switch-ui::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    transition: transform 0.18s ease;
}

.admin-user-switch input:checked + .admin-user-switch-ui {
    background: #0f6ee8;
    border-color: #0b56b6;
}

.admin-user-switch input:checked + .admin-user-switch-ui::after {
    transform: translateX(18px);
}

.admin-user-switch input:disabled + .admin-user-switch-ui {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-user-switch input:focus-visible + .admin-user-switch-ui {
    outline: 2px solid rgba(15, 110, 232, 0.35);
    outline-offset: 2px;
}

.admin-user-side-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.admin-user-side-tab {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid #d5e1ef;
    border-radius: 8px;
    background: #fff;
    color: #4a6078;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.admin-user-side-tab:hover,
.admin-user-side-tab:focus-visible {
    border-color: #9ab4d8;
    background: #f3f7fd;
    outline: none;
}

.admin-user-side-tab.is-active {
    background: #24384f;
    border-color: #24384f;
    color: #fff;
}

.admin-user-side-hint {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #9a6b2f;
}

.admin-user-notify-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-user-widget-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    max-height: min(52vh, 420px);
    overflow: auto;
    padding-right: 2px;
}

.admin-user-notify-option .admin-user-page-option-text {
    letter-spacing: 0.02em;
}

.admin-user-widget-option .admin-user-page-option-text {
    font-weight: 600;
}

.admin-user-facility-add {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: -2px 0 4px;
}

.admin-user-facility-add-toggle {
    align-self: flex-start;
    padding: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    color: #2f6fad;
    font-size: 0.82rem;
    font-weight: 600;
}

.admin-user-facility-add-toggle:hover,
.admin-user-facility-add-toggle:focus-visible {
    color: #1f4f86;
    text-decoration: underline;
    outline: none;
}

.admin-user-facility-add-form {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2eaf4;
    border-radius: 10px;
    background: #fff;
}

.admin-user-facility-add-form:not([hidden]) {
    display: flex;
}

.admin-user-facility-add-form[hidden] {
    display: none !important;
}

.admin-user-facility-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}

body.theme-dark .admin-user-facility-add-form {
    background: #1b2431;
    border-color: #334155;
}

body.theme-dark .admin-user-facility-add-toggle {
    color: #9ec5ff;
}

.email-template-preview-wrap {
    margin-top: 8px;
    border: 1px solid #e2eaf4;
    border-radius: 10px;
    background: #f7f9fc;
    padding: 12px 14px;
}

.email-template-preview-title {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.email-template-preview-card {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 8px;
    padding: 12px 14px;
}

.email-template-preview-subject {
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: #22354f;
}

.email-template-preview-html {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1a2433;
}

.email-template-preview-text {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
}

body.theme-dark .email-template-preview-wrap,
body.theme-dark .email-template-preview-card {
    background: #1b2431;
    border-color: #334155;
}

body.theme-dark .email-template-preview-subject,
body.theme-dark .email-template-preview-html {
    color: #e5eef9;
}

body.theme-dark .admin-user-side-tab {
    background: #1b2431;
    border-color: #334155;
    color: #cbd5e1;
}

body.theme-dark .admin-user-side-tab.is-active {
    background: #7aa2d6;
    border-color: #7aa2d6;
    color: #0f172a;
}

body.theme-dark .admin-user-side-hint {
    color: #fbbf24;
}

.admin-user-switch input:disabled + .admin-user-switch-ui {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-user-programs-inline .external-user-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #627085;
    margin-bottom: 8px;
}

.admin-user-programs-inline .external-user-program-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow: auto;
    padding-right: 2px;
}

.admin-user-programs-inline .external-user-program-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #fff;
}

.admin-user-programs-inline .external-user-program-label {
    font-size: 0.8rem;
    color: #24384f;
    line-height: 1.35;
}

.admin-user-programs-inline .external-user-search {
    width: 100%;
    margin-bottom: 8px;
}

.admin-user-detail-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #e8eef6;
}

body.theme-dark .admin-user-detail-side {
    background: #1a2a3b;
    border-color: #3e5672;
}

body.theme-dark .admin-user-page-option {
    background: #162231;
    border-color: #3e5672;
    color: #e8eff8;
}

body.theme-dark .admin-user-page-option:hover {
    background: #1e3044;
    border-color: #5b7a9c;
}

body.theme-dark .admin-user-programs-inline .external-user-program-row {
    background: #162231;
    border-color: #3e5672;
    color: #e8eff8;
}

body.theme-dark .admin-user-side-title {
    color: #e8eff8;
}

body.theme-dark .admin-user-page-option-text {
    color: #e8eff8;
}

body.theme-dark .admin-user-programs-inline .external-user-program-label {
    color: #e8eff8;
}

body.theme-dark .admin-user-programs-inline .external-user-section-title {
    color: #9db0c5;
}

body.theme-dark .admin-user-detail-fields .user-manage-field > span:first-child {
    color: #9db0c5;
}

body.theme-dark .admin-user-switch-ui {
    background: #31465e;
}

body.theme-dark .admin-user-switch input:checked + .admin-user-switch-ui {
    background: #3b82f6;
}

body.theme-dark .admin-backend-modal .admin-user-hub .user-manage-field span {
    color: #9db0c5;
}

@media (max-width: 980px) {
    .admin-user-detail-split {
        grid-template-columns: 1fr;
    }

    .admin-user-detail-fields .user-manage-field,
    .admin-user-detail-fields .user-manage-field-check {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.admin-user-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.admin-user-detail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-user-detail-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #24384f;
}

.admin-user-detail-id {
    font-size: 0.78rem;
    color: #6a8098;
}

.admin-user-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 16px;
    margin: 14px 0 6px;
    font-size: 0.8rem;
    color: #4a6078;
}

.admin-user-detail-meta span {
    display: block;
    font-weight: 600;
    color: #6a8098;
    margin-bottom: 2px;
}

.admin-user-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.admin-backend-modal .admin-user-hub .user-manage-field span {
    color: #4a6078;
}

.extern-user-programs-modal.episode-modal {
    z-index: 175;
}

.extern-user-programs-modal.episode-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.extern-user-programs-modal .user-access-head {
    flex: none;
}

.extern-user-programs-modal .external-user-dialog {
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #c6d3e5;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(16, 29, 49, 0.35);
}

.extern-user-programs-modal .external-user-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 20px 22px;
}

.extern-user-programs-modal .external-user-lists {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.extern-user-programs-modal .external-user-section-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #2f4560;
    margin-bottom: 10px;
}

.extern-user-programs-modal .external-user-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d5e1ef;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
    color: #22354f;
    box-sizing: border-box;
}

.extern-user-programs-modal .external-user-search::placeholder {
    color: #8a9bb0;
}

.extern-user-programs-modal .external-user-program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extern-user-programs-modal .external-user-program-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #f8fbff;
}

.extern-user-programs-modal .external-user-program-label {
    font-size: 0.84rem;
    color: #24384f;
    line-height: 1.4;
}

.extern-user-programs-modal .external-user-list-empty,
.extern-user-programs-modal .external-user-search-hint {
    font-size: 0.8rem;
    color: #6a8098;
}

.extern-user-programs-modal .external-user-search-hint {
    margin-top: 10px;
}

body.theme-dark .extern-user-programs-modal .external-user-search,
body.theme-dark .extern-user-programs-modal .admin-user-input {
    background: #1a2a3b !important;
    color: #e8eff8 !important;
    border-color: #3e5672 !important;
    -webkit-text-fill-color: #e8eff8 !important;
}

/* —— Interkom widget —— */
.dashboard-widget-intercom .intercom-widget-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.intercom-widget-head-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.intercom-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
}

.intercom-row-power {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.intercom-status {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.intercom-status[data-kind="ok"] {
    color: #15803d;
}

.intercom-status[data-kind="error"] {
    color: #b91c1c;
}

.intercom-status[data-kind="pending"] {
    color: #a16207;
}

.intercom-active,
.intercom-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.intercom-active[hidden],
.intercom-settings-panel[hidden] {
    display: none !important;
}

.intercom-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.intercom-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.intercom-field input[type="range"] {
    width: 100%;
}

.intercom-field select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 6px 8px;
    font-size: 0.86rem;
}

.intercom-talk-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.intercom-mic-btn,
.intercom-openmic-btn {
    flex: 1;
    width: auto;
    min-height: 44px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    touch-action: none;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.intercom-ptt-icon {
    flex: 0 0 auto;
    display: block;
}

.intercom-ptt-label {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.intercom-mic-btn.is-live {
    background: #b91c1c;
    border-color: #991b1b;
    color: #fff;
}

.intercom-openmic-btn.is-live {
    background: #c2410c;
    border-color: #9a3412;
    color: #fff;
}

body.theme-dark .intercom-mic-btn.is-live,
body.theme-dark .btn.intercom-mic-btn.is-live {
    background: #dc2626;
    border-color: #ef4444;
    color: #fff;
}

body.theme-dark .intercom-mic-btn.is-live:hover,
body.theme-dark .btn.intercom-mic-btn.is-live:hover {
    background: #ef4444;
    border-color: #f87171;
    color: #fff;
}

body.theme-dark .intercom-openmic-btn.is-live,
body.theme-dark .btn.intercom-openmic-btn.is-live {
    background: #ea580c;
    border-color: #fb923c;
    color: #fff;
}

body.theme-dark .intercom-openmic-btn.is-live:hover,
body.theme-dark .btn.intercom-openmic-btn.is-live:hover {
    background: #f97316;
    border-color: #fdba74;
    color: #fff;
}

.intercom-hint {
    margin: 0;
    font-size: 0.75rem;
}

#intercomRemoteAudio {
    display: none;
}

body.theme-dark .intercom-field select {
    background: #22354b;
    border-color: #425c79;
    color: #e8eef6;
}

.connections-intercom-bitrate-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

#connIntercomBitrate {
    width: 100%;
}

body.theme-dark .intercom-status[data-kind="ok"] {
    color: #4ade80;
}

body.theme-dark .intercom-status[data-kind="error"] {
    color: #f87171;
}
