/* 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-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: center;
    width: min(1320px, 100%);
    height: 64px;
    min-width: 0;
    margin-inline: auto;
    gap: 10px;
    isolation: isolate;
    overflow: hidden;
}

#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 auto;
    max-width: min(420px, 34vw);
    min-width: 0;
    gap: 14px;
}

#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-title-row {
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: 0;
}

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

#radio-player .radio-player-title-text {
    display: block;
    max-width: 100%;
}

#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-stream {
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

#radio-player .radio-player-state {
    flex: 0 0 auto;
    color: var(--th-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-transform: uppercase;
}

#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 {
    color: var(--th-muted-foreground);
}

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

#radio-player .radio-player-playback {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 10px;
}

#radio-player .radio-player-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 999px;
    background: var(--th-primary);
    color: var(--th-primary-foreground);
}

#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-volume,
#radio-player .radio-player-volume-menu {
    position: relative;
}

#radio-player .radio-player-volume {
    display: inline-flex;
    flex: 0 0 auto;
}

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

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

#radio-player .radio-player-volume-menu {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 8px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 132px;
    padding: 10px 0;
    border: 1px solid var(--th-border);
    border-radius: 10px;
    background: var(--th-card);
    box-shadow: var(--th-shadow-sm);
    transform: translateX(50%);
}

#radio-player .radio-player-volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
}

#radio-player .radio-player-volume-control input {
    max-width: none;
    flex: 0 0 108px;
    width: 108px;
    height: 4px;
    min-height: 0;
    margin: 0;
    accent-color: var(--th-primary);
    cursor: pointer;
    transform: rotate(-90deg);
}

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

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

#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);
    }

    #mini-player.tunehub-player[data-media-kind="radio"] > #radio-player:not([hidden]) {
        justify-content: space-between;
        height: auto;
        min-height: 36px;
        gap: 8px 10px;
    }

    #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 {
        max-width: none;
        flex: 1 1 auto;
    }

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

    #radio-player .radio-player-playback {
        flex: 0 0 auto;
    }

    /* Do not create a second compact row just for volume and sleep timer. */
    #radio-player .radio-player-utilities {
        display: none;
    }
}

@media (max-width: 640px) {
    #radio-player .radio-player-playback {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    #radio-player .radio-player-country,
    #radio-player .radio-player-stream-details,
    #radio-player #radio-player-stream-separator {
        display: none;
    }
}

#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;
    }
}
