.media-layout {
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 12px;
    align-items: stretch;
}

.channel-panel {
    padding: 12px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.channel-panel h2 {
    margin: 0;
    font-size: 1rem;
}

.tt-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tt-panel-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tt-panel-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #3f74bb, #7bb4ff);
    box-shadow: 0 0 0 4px rgba(51, 95, 152, 0.12);
}

.tt-panel-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.tt-panel-stats span,
.tt-player-meta span {
    border: 1px solid rgba(51, 95, 152, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    padding: 6px 10px;
    font-size: 0.76rem;
}

.tt-channel-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.tt-channel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-channel-filters button {
    border: 1px solid rgba(51, 95, 152, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    padding: 6px 12px;
    font: inherit;
    cursor: pointer;
    transition: all 180ms ease;
}

.tt-channel-filters button:hover {
    border-color: rgba(51, 95, 152, 0.38);
}

.tt-channel-filters button.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(51, 95, 152, 0.2);
}

.tt-channel-result {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.tt-channel-toolbar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tt-channel-reset {
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.tt-channel-panel-body {
    overflow: auto;
    min-height: 0;
    padding-left: 2px;
}

.tt-channel-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tt-channel-group:last-child {
    margin-bottom: 0;
}

.tt-channel-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tt-channel-group__head h3 {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text);
}

.tt-channel-group__head span {
    color: var(--muted);
    font-size: 0.76rem;
}

.channel-panel ul {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-channel-group ul {
    margin-bottom: 0;
    overflow: auto;
    min-height: 0;
}

.channel-panel li {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 180ms ease;
}

.channel-panel li:hover {
    border-color: rgba(51, 95, 152, 0.35);
}

.channel-panel li:focus {
    outline: 2px solid rgba(51, 95, 152, 0.6);
    outline-offset: 1px;
}

.channel-panel li.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 8px 18px rgba(51, 95, 152, 0.18);
}

.tt-channel-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tt-channel-copy strong {
    font-size: 0.9rem;
    color: var(--text);
}

.tt-channel-copy small {
    color: var(--muted);
    font-size: 0.76rem;
}

.radio-live-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.radio-live-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    width: 100%;
}

.radio-player-card,
.radio-playlist-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 32px rgba(27, 44, 77, 0.06);
    width: 100%;
}

.radio-player-card {
    padding: 18px;
    background:
        radial-gradient(260px 160px at 100% 0%, rgba(90, 145, 223, 0.16), transparent 70%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 255, 0.96));
}

.radio-playlist-card {
    padding: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.radio-live-page .channel-panel li {
    padding: 12px 14px;
}

.radio-live-page .channel-panel li::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: var(--radius);
    background: rgba(51, 95, 152, 0.22);
    box-shadow: inset 0 0 0 1px rgba(51, 95, 152, 0.16);
}

.radio-live-page .channel-panel li.is-active::before {
    background: linear-gradient(135deg, #335f98, #7bb4ff);
    box-shadow: 0 0 0 5px rgba(51, 95, 152, 0.12);
}

.tt-channel-empty {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.player-panel {
    padding: 12px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(360px 220px at 100% 0%, rgba(90, 145, 223, 0.18), transparent 72%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.95));
}

.tt-player-hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.tt-player-hero h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.tt-player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-player-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
    font-size: 0.9rem;
}

.player-panel video,
.player-panel audio {
    width: 100%;
    border-radius: var(--radius);
    background: #0f223b;
    border: 1px solid rgba(51, 95, 152, 0.25);
}

.tt-tv-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0f223b;
    border: 1px solid rgba(51, 95, 152, 0.25);
    box-shadow: 0 18px 36px rgba(15, 34, 59, 0.18);
}

.tt-tv-frame #tvPlayer {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: var(--radius);
    object-fit: cover;
}

.player-panel audio {
    margin-top: 8px;
}

.tt-radio-player-shell {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(100%, 520px);
    padding: 16px 18px;
    border: 1px solid rgba(51, 95, 152, 0.18);
    border-radius: var(--radius);
    background:
        radial-gradient(180px 120px at 100% 0%, rgba(90, 145, 223, 0.2), transparent 70%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.92));
    box-shadow: 0 16px 36px rgba(27, 44, 77, 0.08);
}

.tt-radio-player-row {
    display: flex;
    align-items: stretch;
    gap: 14px;
}

.tt-radio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 32px;
    padding-inline: 4px;
}

.tt-radio-visualizer span {
    width: 5px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(51, 95, 152, 0.9), rgba(123, 180, 255, 0.35));
    animation: ttRadioPulse 1.2s ease-in-out infinite;
    transform-origin: bottom center;
}

.tt-radio-visualizer span:nth-child(1) { height: 14px; animation-delay: 0s; }
.tt-radio-visualizer span:nth-child(2) { height: 28px; animation-delay: 0.12s; }
.tt-radio-visualizer span:nth-child(3) { height: 18px; animation-delay: 0.24s; }
.tt-radio-visualizer span:nth-child(4) { height: 24px; animation-delay: 0.36s; }

@keyframes ttRadioPulse {
    0%, 100% { transform: scaleY(0.6); opacity: 0.45; }
    50% { transform: scaleY(1); opacity: 1; }
}

.tt-radio-now {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-radio-live-badge,
.tt-radio-current-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 0.78rem;
}

.tt-radio-live-badge {
    background: rgba(31, 181, 116, 0.12);
    color: #0f8a54;
}

.tt-radio-live-badge.is-live {
    background: rgba(239, 75, 75, 0.12);
    color: #c63b3b;
}

.tt-radio-live-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius);
    background: currentColor;
}

.tt-radio-current-category {
    border: 1px solid rgba(51, 95, 152, 0.16);
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
}

.tt-radio-play {
    border: 0;
    border-radius: var(--radius);
    min-width: 112px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #335f98, #5f8fd1);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(51, 95, 152, 0.24);
}

.tt-radio-play:hover {
    filter: brightness(1.04);
}

.tt-radio-play:focus-visible {
    outline: 3px solid rgba(51, 95, 152, 0.22);
    outline-offset: 3px;
}

.tt-radio-volume {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 0.8rem;
}

.tt-radio-volume input {
    width: 100%;
}

.radio-live-page .player-panel {
    justify-content: flex-start;
}

.radio-live-page .tt-player-hero {
    margin-bottom: 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-live-page .tt-player-hero__main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-live-page .tt-player-footer {
    width: min(100%, 260px);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.radio-live-page .tt-panel-heading {
    margin-bottom: 10px;
}

.radio-live-page .tt-panel-stats {
    justify-content: flex-start;
}

.radio-live-page .tt-channel-toolbar {
    gap: 10px;
    margin-bottom: 12px;
}

.radio-live-page .tt-channel-panel-body,
.radio-live-page .tt-channel-group ul {
    overflow: visible;
    max-height: none;
}

.radio-live-page .tt-channel-group {
    margin-bottom: 12px;
}

.tt-player-footer {
    margin-top: 12px;
}

.tt-player-info {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.tt-player-hint {
    margin: 6px 0 0;
    color: #5b6f8b;
    font-size: 0.78rem;
}

@media (min-width: 992px) {
    .main-site.media-live-page {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .media-live-main {
        flex: 1 1 auto;
        display: flex;
        min-height: 0;
    }

    .media-live-main.container {
        width: min(1240px, 100%);
        padding-inline: 16px;
    }

    .media-live-main .media-layout {
        grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
        min-height: 0;
        height: 100%;
        flex: 1 1 auto;
    }

    .media-live-main .player-panel {
        padding: 18px;
    }

    .media-live-page:not(.radio-live-page) .player-panel {
        position: sticky;
        top: 16px;
        align-self: start;
        height: auto;
        z-index: 20;
    }

    .media-live-page:not(.radio-live-page) .media-layout {
        align-items: start;
    }

    .media-live-main .player-panel video {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    .media-live-main .tt-tv-frame {
        max-height: min(70vh, 760px);
    }

    .media-live-main .channel-panel,
    .media-live-main .player-panel {
        height: 100%;
    }

    .media-live-page:not(.radio-live-page) .player-panel {
        height: auto;
    }

    .media-live-main .tt-channel-panel-body {
        overflow: auto;
    }

    .media-live-main .tt-channel-group {
        margin-bottom: 14px;
    }

    .media-live-main .tt-channel-group ul {
        max-height: min(34vh, 320px);
    }

    .media-live-page:not(.radio-live-page) .tt-channel-panel-body,
    .media-live-page:not(.radio-live-page) .tt-channel-group ul {
        overflow: visible;
        max-height: none;
    }

    .radio-live-page .media-live-main .media-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .radio-live-page .media-live-main .tt-channel-panel-body,
    .radio-live-page .media-live-main .tt-channel-group ul {
        overflow: visible;
        max-height: none;
    }

    .radio-live-page .radio-player-card {
        position: sticky;
        top: 16px;
        align-self: start;
        z-index: 20;
    }
}

@media (max-width: 991px) {
    .media-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .tt-channel-panel-body {
        max-height: 50vh;
    }

    .tt-panel-heading {
        flex-direction: column;
    }

    .tt-panel-stats {
        justify-content: flex-start;
    }

    .radio-live-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .radio-live-page .tt-player-hero__main {
        align-items: flex-start;
    }

    .radio-live-page .tt-channel-panel-body,
    .radio-live-page .tt-channel-group ul {
        max-height: none;
        overflow: visible;
    }

    .tt-radio-player-row {
        flex-direction: column;
    }

    .tt-radio-player-shell {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .tt-radio-play {
        width: 100%;
    }

    .tt-channel-toolbar-meta {
        align-items: flex-start;
    }
}

html[data-theme="dark"] .channel-panel,
html[data-theme="dark"] .player-panel,
html[data-theme="dark"] .radio-player-card,
html[data-theme="dark"] .radio-playlist-card {
    background:
        radial-gradient(220px 120px at 100% 0%, rgba(134, 174, 232, 0.16), transparent 72%),
        linear-gradient(160deg, rgba(18, 29, 45, 0.98), rgba(14, 22, 35, 0.96));
    border-color: var(--line);
    color: var(--text);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .tt-panel-stats span,
html[data-theme="dark"] .tt-player-meta span,
html[data-theme="dark"] .tt-channel-filters button,
html[data-theme="dark"] .tt-radio-current-category {
    background: rgba(23, 36, 54, 0.94);
    border-color: var(--line);
    color: var(--text);
}

html[data-theme="dark"] .tt-channel-filters button.is-active,
html[data-theme="dark"] .tt-radio-play {
    color: #08111d;
}
