/* TUNE-052 canonical TuneHub player. The visual contract lives in
 * docs/documents/design-UI/design-system.md and design/TUNE-052-bemusic-player/. */

:root {
    --th-background: oklch(1 0 0);
    --th-foreground: oklch(0.2478 0 0);
    --th-card: oklch(1 0 0);
    --th-card-foreground: oklch(0.2478 0 0);
    --th-secondary: oklch(0.967 0.001 286.375);
    --th-secondary-foreground: oklch(0.21 0.006 285.885);
    --th-muted: oklch(0.9791 0 0);
    --th-muted-foreground: oklch(0.556 0 0);
    --th-primary: oklch(0.6423 0.1467 133.01);
    --th-primary-foreground: oklch(0.9911 0 190.05);
    --th-border: oklch(0.922 0 0);
    --th-focus: oklch(0.708 0 0);
    --th-destructive: oklch(0.577 0.245 27.325);
    --th-shadow-sm: 0 1px 2px rgb(0 0 0 / 8%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --th-background: oklch(0.0969 0 0);
        --th-foreground: oklch(1 0 0);
        --th-card: oklch(0.1822 0 0);
        --th-card-foreground: oklch(0.985 0 0);
        --th-secondary: oklch(0.274 0.006 286.033);
        --th-secondary-foreground: oklch(0.985 0 0);
        --th-muted: oklch(0.269 0 0);
        --th-muted-foreground: oklch(1 0 0 / 70%);
        --th-primary-foreground: oklch(1 0 0);
        --th-border: oklch(1 0 0 / 10%);
        --th-focus: oklch(0.556 0 0);
        --th-destructive: oklch(0.704 0.191 22.216);
        --th-shadow-sm: 0 1px 2px rgb(0 0 0 / 32%);
    }
}

#mini-player.tunehub-player {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(180px, 30%) minmax(280px, 40%) minmax(180px, 30%);
    grid-template-areas: "track main utilities";
    align-items: center;
    width: 100%;
    height: 96px;
    min-height: 96px;
    margin: 0;
    padding: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: var(--th-card);
    box-shadow: 0 -1px 0 var(--th-border);
    color: var(--th-card-foreground);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.5;
    transform: none;
    transition: min-height 150ms ease, opacity 150ms ease, transform 150ms ease;
}

#mini-player.tunehub-player[hidden] {
    display: none;
}

#mini-player.tunehub-player .player-track-info {
    display: grid;
    grid-area: track;
    grid-template-columns: 56px minmax(0, 1fr) 36px;
    align-items: center;
    min-width: 0;
    gap: 14px;
    padding-right: 14px;
}

#mini-player.tunehub-player .player-art {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    background-color: var(--th-secondary);
}

#mini-player.tunehub-player .player-meta {
    display: grid;
    min-width: 0;
    gap: 0;
}

#mini-player.tunehub-player .player-meta > strong,
#mini-player.tunehub-player .player-meta > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mini-player.tunehub-player .player-meta strong {
    color: var(--th-card-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

#mini-player.tunehub-player .player-title-text {
    max-width: 100%;
}

#mini-player.tunehub-player .player-meta #player-subtitle {
    color: var(--th-muted-foreground);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

#mini-player.tunehub-player .player-meta #player-state {
    width: fit-content;
    margin-top: 2px;
    color: var(--th-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-transform: uppercase;
}

#mini-player.tunehub-player .player-meta #player-state::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 5px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: none;
    content: "";
    vertical-align: 1px;
}

#mini-player.tunehub-player .player-main-controls {
    display: grid;
    grid-area: main;
    min-width: 0;
    gap: 4px;
    padding-inline: 10px;
}

#mini-player.tunehub-player .player-playback-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#mini-player.tunehub-player .player-icon-button,
#mini-player.tunehub-player .player-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--th-foreground);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#mini-player.tunehub-player .player-icon-button:hover,
#mini-player.tunehub-player .player-icon-button:focus-visible,
#mini-player.tunehub-player .player-toggle:hover,
#mini-player.tunehub-player .player-toggle:focus-visible {
    background: color-mix(in srgb, var(--th-foreground), transparent 96%);
    color: var(--th-foreground);
}

#mini-player.tunehub-player .player-icon-button:focus-visible,
#mini-player.tunehub-player .player-toggle:focus-visible,
#mini-player.tunehub-player input:focus-visible {
    outline: 2px solid var(--th-focus);
    outline-offset: 2px;
}

#mini-player.tunehub-player .player-icon-button:active,
#mini-player.tunehub-player .player-toggle:active {
    transform: translateY(1px);
}

#mini-player.tunehub-player .player-icon-button .admin-icon,
#mini-player.tunehub-player .player-toggle .admin-icon,
#mini-player.tunehub-player .volume-icon .admin-icon {
    width: 20px;
    height: 20px;
}

#mini-player.tunehub-player .player-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 999px;
}

#mini-player.tunehub-player .player-toggle .player-icon {
    display: none;
}

#mini-player.tunehub-player .player-toggle[data-playing="true"] .player-icon-pause,
#mini-player.tunehub-player .player-toggle[data-playing="false"] .player-icon-play {
    display: inline-flex;
}

#mini-player.tunehub-player .player-toggle .admin-icon {
    width: 28px;
    height: 28px;
}

#mini-player.tunehub-player .player-toggle-label,
#mini-player.tunehub-player .player-volume-value {
    display: none;
}

#mini-player.tunehub-player .player-progress-wrap {
    display: grid;
    grid-template-columns: 40px minmax(80px, 1fr) 40px;
    align-items: center;
    min-width: 0;
    gap: 12px;
    color: var(--th-muted-foreground);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 16px;
}

#mini-player.tunehub-player .player-progress-wrap[hidden],
#mini-player.tunehub-player .player-extra-controls [hidden] {
    display: none;
}

#mini-player.tunehub-player #player-progress {
    width: 100%;
    height: 4px;
    min-height: 4px;
    margin: 0;
    padding: 0;
    accent-color: var(--th-primary);
    cursor: pointer;
}

#mini-player.tunehub-player .player-secondary-controls {
    display: flex;
    grid-area: utilities;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    gap: 2px;
    padding-left: 14px;
}

#mini-player.tunehub-player .player-track-info > .player-placeholder-control {
    justify-self: end;
}

#mini-player.tunehub-player .volume-control {
    display: grid;
    grid-template-columns: 36px 96px;
    align-items: center;
    gap: 0;
    min-width: 0;
    margin: 0 4px;
}

#mini-player.tunehub-player .volume-control input {
    width: 96px;
    height: 4px;
    min-height: 0;
    margin: 0;
    accent-color: var(--th-primary);
    cursor: pointer;
}

#mini-player.tunehub-player .volume-control output {
    display: none;
}

#mini-player.tunehub-player .player-extra-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

#mini-player.tunehub-player .player-extra-controls .player-icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}

#mini-player.tunehub-player .sleep-timer-control {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#mini-player.tunehub-player .sleep-timer-badge {
    position: absolute;
    top: -3px;
    right: -2px;
    min-width: 20px;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--th-primary);
    color: var(--th-primary-foreground);
    font-size: 9px;
    line-height: 12px;
}

#mini-player.tunehub-player .sleep-timer-menu {
    z-index: 2;
    border-color: var(--th-border);
    background: var(--th-card);
    color: var(--th-card-foreground);
}

#mini-player.tunehub-player .player-placeholder-control[aria-disabled="true"] {
    opacity: 1;
}

#mini-player.tunehub-player[data-player-state="collapsed"] {
    right: 8px;
    bottom: 8px;
    left: auto;
    grid-template-columns: 40px minmax(120px, 1fr) 40px;
    grid-template-areas: "track main";
    width: min(420px, calc(100% - 16px));
    min-height: 64px;
    height: 64px;
    padding: 8px;
    border: 1px solid var(--th-border);
    border-radius: 12px;
    box-shadow: var(--th-shadow-sm);
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-track-info {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    padding-right: 0;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-art {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-track-info > .player-placeholder-control,
#mini-player.tunehub-player[data-player-state="collapsed"] .player-secondary-controls,
#mini-player.tunehub-player[data-player-state="collapsed"] #player-subtitle,
#mini-player.tunehub-player[data-player-state="collapsed"] #player-state,
#mini-player.tunehub-player[data-player-state="collapsed"] .player-progress-wrap,
#mini-player.tunehub-player[data-player-state="collapsed"] .player-desktop-only {
    display: none;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-main-controls {
    display: contents;
    padding: 0;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-playback-controls {
    grid-area: main;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-playback-controls > .player-placeholder-control {
    display: none;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
}

#mini-player.tunehub-player[data-player-state="collapsed"] .player-toggle .admin-icon {
    width: 22px;
    height: 22px;
}

@media (max-width: 1024px) {
    #mini-player.tunehub-player,
    #mini-player.tunehub-player[data-player-state="collapsed"] {
        right: 4px;
        bottom: 4px;
        left: 4px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "track main" "progress progress";
        width: auto;
        min-height: 0;
        height: auto;
        margin: 0;
        padding: 8px 10px 0;
        gap: 0 10px;
        overflow: hidden;
        border: 1px solid color-mix(in srgb, var(--th-border), transparent 20%);
        border-radius: 12px;
        box-shadow: var(--th-shadow-sm);
    }

    #mini-player.tunehub-player .player-track-info,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-track-info {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 0;
    }

    #mini-player.tunehub-player .player-art,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-art {
        width: 36px;
        min-width: 36px;
        height: 36px;
    }

    #mini-player.tunehub-player .player-track-info > .player-placeholder-control,
    #mini-player.tunehub-player .player-secondary-controls,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-secondary-controls,
    #mini-player.tunehub-player .player-desktop-only {
        display: none;
    }

    #mini-player.tunehub-player .player-meta #player-state,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-meta #player-state {
        display: none;
    }

    #mini-player.tunehub-player .player-main-controls,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-main-controls {
        display: contents;
        padding: 0;
    }

    #mini-player.tunehub-player .player-playback-controls,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-playback-controls {
        display: flex;
        grid-area: main;
        gap: 0;
    }

    #mini-player.tunehub-player .player-playback-controls > .player-placeholder-control:not([data-player-placeholder="previous"]):not([data-player-placeholder="next"]) {
        display: none;
    }

    #mini-player.tunehub-player .player-icon-button {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    #mini-player.tunehub-player .player-toggle,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }

    #mini-player.tunehub-player .player-progress-wrap,
    #mini-player.tunehub-player[data-player-state="collapsed"] .player-progress-wrap {
        display: grid;
        grid-area: progress;
        grid-template-columns: minmax(0, 1fr);
        min-height: 2px;
        margin-top: 6px;
        gap: 0;
        font-size: 0;
        line-height: 0;
    }

    #mini-player.tunehub-player .player-progress-wrap span {
        display: none;
    }

    #mini-player.tunehub-player #player-progress {
        height: 2px;
        min-height: 2px;
        padding: 0;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mini-player.tunehub-player,
    #mini-player.tunehub-player * {
        transition: none;
        animation: none;
    }
}

/* TUNE-125 Public Web Radio full player. The dialog presents the existing Radio session. */
#radio-full-player {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--th-card);
    color: var(--th-foreground);
}

#radio-full-player::backdrop {
    background: var(--th-background);
}

#radio-full-player[open] {
    display: block;
}

#radio-full-player .radio-full-player-ambient,
#radio-full-player .radio-full-player-overlay {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    pointer-events: none;
}

#radio-full-player .radio-full-player-ambient {
    z-index: 0;
    object-fit: cover;
    opacity: 0.16;
    filter: blur(64px) saturate(1.15);
    transform: scale(1.08);
}

#radio-full-player .radio-full-player-overlay {
    z-index: 1;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--th-card) 76%, transparent) 0%,
        color-mix(in srgb, var(--th-card) 92%, transparent) 48%,
        var(--th-card) 100%
    );
}

#radio-full-player .radio-full-player-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    gap: 4px;
}

#radio-full-player .radio-full-player-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 48px;
}

#radio-full-player .radio-full-player-header-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

#radio-full-player .radio-full-player-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--th-muted-foreground);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.3;
    text-transform: uppercase;
}

#radio-full-player .radio-full-player-state::before {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--th-muted-foreground);
    content: "";
}

#radio-full-player[data-playback-state="playing"] .radio-full-player-state::before {
    background: var(--th-primary);
}

#radio-full-player[data-playback-state="failed"] .radio-full-player-state::before {
    background: var(--th-destructive);
}

#radio-full-player .radio-full-player-main {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    overflow: auto;
    padding: 0 8px 4px;
    text-align: center;
}

#radio-full-player .radio-full-player-artwork {
    display: flex;
    min-height: 0;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(12px, 3dvh, 34px) 0 12px;
}

#radio-full-player .radio-full-player-art {
    width: min(76vw, 520px, max(150px, calc(100dvh - 440px)));
    aspect-ratio: 1;
    flex: 0 0 auto;
    border: 1px solid var(--th-border);
    border-radius: 18px;
    background-color: var(--th-secondary);
    box-shadow: var(--th-shadow-sm);
}

#radio-full-player .radio-full-player-station-info {
    display: grid;
    justify-items: center;
    padding: 4px 0 clamp(16px, 3.5dvh, 34px);
    gap: 8px;
}

#radio-full-player .radio-full-player-title {
    max-width: min(760px, 100%);
    margin: 0;
    color: var(--th-foreground);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#radio-full-player .radio-full-player-country,
#radio-full-player .radio-full-player-stream {
    margin: 0;
    color: var(--th-muted-foreground);
    font-size: 14px;
    line-height: 1.4;
}

#radio-full-player .radio-full-player-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

#radio-full-player .radio-full-player-icon-button,
#radio-full-player .radio-full-player-action,
#radio-full-player .radio-full-player-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--th-foreground);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#radio-full-player .radio-full-player-icon-button {
    width: 44px;
    padding: 0;
}

#radio-full-player .radio-full-player-action {
    min-height: 46px;
    border-color: var(--th-border);
    background: color-mix(in srgb, var(--th-card) 86%, transparent);
    padding: 0 14px;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

#radio-full-player .radio-full-player-toggle {
    width: 76px;
    min-width: 76px;
    height: 76px;
    min-height: 76px;
    border-color: var(--th-primary);
    background: var(--th-primary);
    color: var(--th-primary-foreground);
    box-shadow: var(--th-shadow-sm);
}

#radio-full-player .radio-full-player-toggle .admin-icon {
    width: 32px;
    height: 32px;
}

#radio-full-player .radio-full-player-toggle .player-icon {
    display: none;
}

#radio-full-player .radio-full-player-toggle[data-playing="true"] .player-icon-pause,
#radio-full-player .radio-full-player-toggle[data-playing="false"] .player-icon-play {
    display: inline-flex;
}

#radio-full-player .radio-full-player-icon-button .admin-icon,
#radio-full-player .radio-full-player-action .admin-icon {
    width: 20px;
    height: 20px;
}

#radio-full-player .radio-full-player-favorite[aria-pressed="true"] {
    color: var(--th-primary);
}

#radio-full-player .radio-full-player-icon-button:hover,
#radio-full-player .radio-full-player-icon-button:focus-visible {
    background: color-mix(in srgb, var(--th-foreground), transparent 94%);
}

#radio-full-player .radio-full-player-icon-button:hover,
#radio-full-player .radio-full-player-icon-button:focus-visible,
#radio-full-player .radio-full-player-action:hover,
#radio-full-player .radio-full-player-action:focus-visible {
    color: var(--th-foreground);
}

#radio-full-player .radio-full-player-action:hover,
#radio-full-player .radio-full-player-action:focus-visible {
    border-color: color-mix(in srgb, var(--th-primary) 48%, var(--th-border));
    background: color-mix(in srgb, var(--th-primary) 8%, var(--th-card));
}

#radio-full-player .radio-full-player-toggle:hover,
#radio-full-player .radio-full-player-toggle:focus-visible {
    filter: brightness(0.96);
}

#radio-full-player .radio-full-player-icon-button:focus-visible,
#radio-full-player .radio-full-player-action:focus-visible,
#radio-full-player .radio-full-player-toggle:focus-visible,
#radio-full-player input:focus-visible,
#radio-full-player .radio-full-player-menu button:focus-visible {
    outline: 2px solid var(--th-focus);
    outline-offset: 2px;
}

#radio-full-player .radio-full-player-controls {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    align-items: center;
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 4px 0 max(8px, env(safe-area-inset-bottom));
}

#radio-full-player .radio-full-player-leading-controls,
#radio-full-player .radio-full-player-trailing-controls {
    display: flex;
    align-items: center;
}

#radio-full-player .radio-full-player-leading-controls {
    justify-content: flex-start;
    gap: clamp(4px, 2vw, 12px);
}

#radio-full-player .radio-full-player-trailing-controls {
    justify-content: flex-end;
}

#radio-full-player .radio-full-player-toggle {
    justify-self: center;
}

#radio-full-player .radio-full-player-menu {
    position: absolute;
    z-index: 4;
    display: grid;
    min-width: 184px;
    padding: 6px;
    border: 1px solid var(--th-border);
    border-radius: 12px;
    background: var(--th-popover);
    box-shadow: var(--th-shadow-sm);
}

#radio-full-player .radio-full-player-menu button {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--th-foreground);
    cursor: pointer;
    font: inherit;
    text-align: left;
    gap: 10px;
}

#radio-full-player .radio-full-player-menu button:hover {
    background: var(--th-secondary);
}

#radio-full-player .radio-full-player-menu .admin-icon {
    width: 18px;
    height: 18px;
}

#radio-full-player .radio-full-player-sleep {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

#radio-full-player .radio-full-player-sleep-label {
    position: absolute;
    right: -4px;
    bottom: -4px;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--th-card);
    color: var(--th-primary);
    font-size: 10px;
    font-weight: 600;
}

#radio-full-player .radio-full-player-sleep-menu {
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 160px;
}

#radio-full-player .radio-full-player-toast {
    position: fixed;
    right: max(16px, calc(env(safe-area-inset-right) + 16px));
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
    z-index: 3;
    box-sizing: border-box;
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    margin: 0;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--th-card) 18%, transparent);
    border-radius: 12px;
    background: var(--th-foreground);
    box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
    color: var(--th-card);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    pointer-events: none;
}

#radio-full-player .radio-full-player-toast[data-visible="true"] {
    animation: radio-full-player-toast 3200ms ease both;
}

@keyframes radio-full-player-toast {
    0% { opacity: 0; transform: translateY(8px); }
    10%, 84% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(4px); }
}

#radio-full-player #radio-full-player-vote[data-vote-status="voted"] {
    border-color: color-mix(in srgb, var(--th-primary) 45%, var(--th-border));
    color: var(--th-primary);
}

#radio-full-player #radio-full-player-vote:disabled {
    cursor: default;
    opacity: 0.76;
}

#radio-full-player .radio-full-player-info-sheet {
    position: fixed;
    inset: auto 0 0;
    box-sizing: border-box;
    width: min(100%, 720px);
    max-width: min(100%, 720px);
    max-height: min(88vh, 92dvh);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--th-border);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: var(--th-card);
    color: var(--th-foreground);
    box-shadow: 0 -16px 48px color-mix(in srgb, #000 18%, transparent);
}

#radio-full-player .radio-full-player-info-sheet::backdrop {
    background: color-mix(in srgb, #000 38%, transparent);
}

#radio-full-player .radio-full-player-info-sheet[open] {
    display: block;
    animation: radio-info-sheet-enter 220ms ease-out both;
}

#radio-full-player .radio-full-player-info-sheet-content {
    display: flex;
    box-sizing: border-box;
    max-height: min(88vh, 92dvh);
    flex-direction: column;
    padding: max(8px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}

#radio-full-player .radio-full-player-info-header {
    display: flex;
    min-height: 52px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--th-border);
}

#radio-full-player .radio-full-player-info-header h2 {
    margin: 0;
    color: var(--th-foreground);
    font-size: 18px;
    font-weight: 650;
}

#radio-full-player .radio-full-player-info-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 0 8px;
    overscroll-behavior: contain;
}

#radio-full-player .radio-full-player-info-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-card, 14px);
    background: color-mix(in srgb, var(--th-secondary) 38%, var(--th-card));
}

#radio-full-player .radio-full-player-info-art {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: cover;
    background: var(--th-secondary);
}

#radio-full-player .radio-full-player-info-hero-copy {
    min-width: 0;
}

#radio-full-player .radio-full-player-info-station-name {
    margin: 0 0 6px;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 650;
}

#radio-full-player .radio-full-player-info-location,
#radio-full-player .radio-full-player-info-online {
    margin: 0;
    color: var(--th-muted-foreground);
    font-size: 13px;
    line-height: 1.45;
}

#radio-full-player .radio-full-player-info-online[data-online="true"] {
    color: var(--th-primary);
}

#radio-full-player .radio-full-player-info-section {
    margin: 0 0 16px;
}

#radio-full-player .radio-full-player-info-section h3 {
    margin: 0 0 6px;
    color: var(--th-foreground);
    font-size: 14px;
    font-weight: 650;
}

#radio-full-player .radio-full-player-info-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1.3fr) auto;
    align-items: center;
    gap: 8px 12px;
    min-height: 40px;
    border-bottom: 1px solid color-mix(in srgb, var(--th-border) 65%, transparent);
}

#radio-full-player .radio-full-player-info-label {
    color: var(--th-muted-foreground);
    font-size: 13px;
}

#radio-full-player .radio-full-player-info-value {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    text-align: right;
}

#radio-full-player .radio-full-player-info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 4px;
}

#radio-full-player .radio-full-player-info-tag {
    max-width: 100%;
    padding: 5px 10px;
    overflow-wrap: anywhere;
    border: 1px solid var(--th-border);
    border-radius: 999px;
    color: var(--th-muted-foreground);
    font-size: 12px;
}

@keyframes radio-info-sheet-enter {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}

#radio-full-player .radio-full-player-sleep-menu[hidden],
#radio-full-player .radio-full-player-menu[hidden],
#radio-full-player [hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    #radio-full-player .radio-full-player-content {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
        gap: 2px;
    }

    #radio-full-player .radio-full-player-main {
        padding-right: 4px;
        padding-left: 4px;
    }

    #radio-full-player .radio-full-player-art {
        width: min(76vw, 520px, max(150px, calc(100dvh - 440px)));
    }

    #radio-full-player .radio-full-player-controls {
        width: min(100%, 390px);
    }
}

@media (max-height: 720px) {
    #radio-full-player .radio-full-player-artwork {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #radio-full-player .radio-full-player-art {
        width: min(68vw, 420px, max(140px, calc(100dvh - 480px)));
    }

    #radio-full-player .radio-full-player-station-info {
        padding-bottom: 12px;
        gap: 6px;
    }

    #radio-full-player .radio-full-player-actions {
        margin-top: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #radio-full-player,
    #radio-full-player * {
        transition: none;
        animation: none;
    }
}

/* TUNE-062 Radio-only player presentation. Podcast keeps the legacy player subtree above. */
#mini-player.tunehub-player[data-media-kind="radio"] {
    display: block;
    height: 96px;
    min-height: 96px;
    padding: 16px;
}

#mini-player.tunehub-player[data-media-kind="radio"] > .player-track-info,
#mini-player.tunehub-player[data-media-kind="radio"] > .player-main-controls,
#mini-player.tunehub-player[data-media-kind="radio"] > .player-secondary-controls,
#mini-player.tunehub-player[data-media-kind="podcast"] > #radio-player {
    display: none;
}

#mini-player.tunehub-player[data-media-kind="radio"] > #radio-player:not([hidden]) {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 64px;
    min-width: 0;
    margin-inline: 0;
    gap: 0;
    isolation: isolate;
    overflow: visible;
}

#radio-player .radio-player-ambient-clip {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

#radio-player .radio-player-ambient,
#radio-player .radio-player-ambient-overlay {
    position: absolute;
    top: -16px;
    right: 0;
    bottom: -16px;
    left: 0;
    pointer-events: none;
}

#radio-player .radio-player-ambient {
    z-index: -2;
    left: auto;
    width: 54%;
    height: calc(100% + 32px);
    bottom: auto;
    max-width: none;
    object-fit: cover;
    object-position: center;
    opacity: 0.24;
    filter: blur(52px) saturate(1.35);
    transform: scale(1.12);
    user-select: none;
}

#radio-player .radio-player-ambient-overlay {
    z-index: -1;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--th-card) 98%, var(--th-background)) 0%,
        color-mix(in srgb, var(--th-card) 90%, transparent) 35%,
        color-mix(in srgb, var(--th-card) 56%, transparent) 70%,
        color-mix(in srgb, var(--th-card) 82%, var(--th-background)) 100%
    );
}

#radio-player .radio-player-station,
#radio-player .radio-player-playback {
    position: relative;
    z-index: 1;
}

#radio-player .radio-player-station {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    flex: 0 1 460px;
    width: min(460px, 40%);
    max-width: min(460px, 40%);
    min-width: 0;
    gap: 14px;
}

#radio-player .radio-player-station[data-radio-full-player-station-open] {
    border-radius: 8px;
    cursor: pointer;
}

#radio-player .radio-player-station[data-radio-full-player-station-open]:focus-visible {
    outline: 2px solid var(--th-focus);
    outline-offset: 3px;
}

#radio-player .radio-player-art {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border: 0;
    border-radius: 4px;
    background-color: var(--th-secondary);
    box-shadow: none;
}

#radio-player .radio-player-copy,
#radio-player .radio-player-title-row,
#radio-player .radio-player-stream {
    display: flex;
    min-width: 0;
}

#radio-player .radio-player-copy {
    flex-direction: column;
    justify-content: center;
    max-width: 100%;
    gap: 2px;
    overflow: hidden;
}

#radio-player .radio-player-elapsed {
    color: var(--th-muted-foreground);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 16px;
    white-space: nowrap;
}

#radio-player .radio-player-title-row {
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: 0;
}

#radio-player #radio-player-title {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    color: var(--th-card-foreground);
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
}

#radio-player .radio-player-title-text {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 20px;
    white-space: normal;
}

#radio-player .radio-player-country,
#radio-player .radio-player-stream {
    color: var(--th-muted-foreground);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    white-space: nowrap;
}

#radio-player .radio-player-country {
    overflow: hidden;
    text-overflow: ellipsis;
}

#radio-player .radio-player-country,
#radio-player .radio-player-stream-details,
#radio-player #radio-player-stream-separator {
    display: none;
}

#radio-player .radio-player-stream {
    display: none;
}

#radio-player .radio-player-stream {
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

#radio-player .radio-player-state {
    position: absolute;
    top: 50%;
    left: calc(50% + 31px);
    display: block;
    max-width: min(220px, calc(50% - 180px));
    overflow: hidden;
    color: var(--th-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    transform: translateY(-50%);
    white-space: nowrap;
}

#radio-player .radio-player-state:not([hidden])::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 5px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    vertical-align: 1px;
}

#radio-player .radio-player-stream-details {
    overflow: hidden;
    text-overflow: ellipsis;
}

#radio-player .radio-player-control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--th-foreground);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#radio-player .radio-player-control:hover,
#radio-player .radio-player-control:focus-visible {
    background: color-mix(in srgb, var(--th-foreground), transparent 96%);
    color: var(--th-foreground);
}

#radio-player .radio-player-control:focus-visible,
#radio-player input:focus-visible {
    outline: 2px solid var(--th-focus);
    outline-offset: 2px;
}

#radio-player .radio-player-control:active {
    transform: translateY(1px);
}

#radio-player .radio-player-control .admin-icon {
    width: 20px;
    height: 20px;
}

#radio-player .radio-player-favorite {
    position: absolute;
    top: 50%;
    right: 46px;
    color: var(--th-muted-foreground);
    transform: translateY(-50%);
    pointer-events: auto;
}

#radio-player .radio-player-favorite[aria-pressed="true"] {
    color: var(--th-primary);
}

#radio-player .radio-player-playback {
    position: absolute;
    inset: 0;
    display: block;
    min-width: 0;
    pointer-events: none;
}

#radio-player .radio-player-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 999px;
    background: var(--th-primary);
    color: var(--th-primary-foreground);
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

#radio-player .radio-player-retry {
    position: absolute;
    top: 50%;
    left: calc(50% - 62px);
    transform: translateY(-50%);
    pointer-events: auto;
}

#radio-player .radio-player-favorite:active,
#radio-player .radio-player-retry:active {
    transform: translateY(calc(-50% + 1px));
}

#radio-player .radio-player-toggle:active {
    transform: translate(-50%, calc(-50% + 1px));
}

#radio-player .radio-player-toggle .player-icon {
    display: none;
}

#radio-player .radio-player-toggle[data-playing="true"] .player-icon-pause,
#radio-player .radio-player-toggle[data-playing="false"] .player-icon-play {
    display: inline-flex;
}

#radio-player .radio-player-toggle .admin-icon {
    width: 28px;
    height: 28px;
}

#radio-player .radio-player-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#radio-player .radio-player-utilities {
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
}

#radio-player .radio-player-utilities {
    display: inline-flex;
    position: absolute;
    top: 50%;
    right: 2px;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    transform: translateY(-50%);
    pointer-events: auto;
}

@media (min-width: 1025px) {
    /* Align the desktop dock to the shell's sidebar and ad-rail content edges. */
    #radio-player .radio-player-station {
        position: static;
    }

    #radio-player .radio-player-copy {
        overflow: visible;
    }

    #radio-player .radio-player-elapsed {
        position: absolute;
        top: 50%;
        right: calc(50% + 31px);
        transform: translateY(-50%);
    }

    #radio-player .radio-player-favorite {
        right: 64px;
    }

    #radio-player .radio-player-utilities {
        right: 20px;
    }
}

#radio-player .radio-player-sleep-timer {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

#radio-player .radio-player-sleep-toggle {
    color: var(--th-muted-foreground);
}

#radio-player .radio-player-sleep-toggle[data-timer-active="true"] {
    color: var(--th-primary);
}

#radio-player .radio-player-sleep-toggle .admin-icon {
    width: 19px;
    height: 19px;
}

#radio-player .radio-player-sleep-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 16px;
    padding: 0 4px;
    border: 1px solid var(--th-card);
    border-radius: 999px;
    background: var(--th-primary);
    color: var(--th-primary-foreground);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

#radio-player .radio-player-sleep-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 10;
    display: grid;
    min-width: 156px;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--th-border);
    border-radius: 10px;
    background: var(--th-card);
    box-shadow: var(--th-shadow-sm);
}

#radio-player .radio-player-sleep-menu button {
    min-height: 34px;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--th-card-foreground);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

#radio-player .radio-player-sleep-menu button:hover,
#radio-player .radio-player-sleep-menu button:focus-visible {
    background: color-mix(in srgb, var(--th-foreground), transparent 92%);
}

#radio-player [hidden] {
    display: none;
}

@media (max-width: 1024px) {
    #mini-player.tunehub-player[data-media-kind="radio"] {
        right: 4px;
        bottom: 4px;
        left: 4px;
        width: auto;
        height: auto;
        min-height: 0;
        padding: 8px 10px;
        border: 1px solid var(--th-border);
        border-radius: 12px;
        box-shadow: var(--th-shadow-sm);
        overflow: visible;
    }

    #mini-player.tunehub-player[data-media-kind="radio"] > #radio-player:not([hidden]) {
        justify-content: flex-start;
        height: auto;
        min-height: 64px;
        gap: 0;
    }

    #radio-player .radio-player-ambient {
        top: -8px;
        width: 46%;
        height: calc(100% + 16px);
        bottom: auto;
        opacity: 0.18;
    }

    #radio-player .radio-player-ambient-overlay {
        top: -8px;
        bottom: -8px;
    }

    #radio-player .radio-player-station {
        grid-template-columns: 44px minmax(0, 1fr);
        width: calc(50% - 32px);
        max-width: calc(50% - 32px);
        flex: 0 0 calc(50% - 32px);
        gap: 8px;
    }

    #radio-player .radio-player-elapsed {
        position: static;
        display: block;
        transform: none;
    }

    #radio-player .radio-player-state {
        left: calc(50% + 26px);
        max-width: max(0px, calc(50% - 116px));
    }

    #radio-player .radio-player-state::before {
        display: none;
    }

    #radio-player .radio-player-art {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    #radio-player #radio-player-title {
        min-width: 0;
    }

}

@media (max-width: 480px) {
    #radio-player .radio-player-station {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    #radio-player .radio-player-art {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }
}

#mini-player.tunehub-player #radio-player[hidden] {
    display: none;
}

/* All active TuneHub favorite hearts use the filled primary-color treatment. */
[data-favorite-toggle][aria-pressed="true"],
.station-favorite-toggle.is-saved,
.favorite-detail-button[aria-pressed="true"] {
    color: var(--th-primary);
}

[data-favorite-toggle][aria-pressed="true"] svg,
.station-favorite-toggle.is-saved svg,
.favorite-detail-button[aria-pressed="true"] svg {
    fill: var(--th-primary);
    stroke: var(--th-primary);
}

@media (prefers-reduced-motion: reduce) {
    #radio-player,
    #radio-player * {
        transition: none;
        animation: none;
    }
}
