/**
 * Hausgeflüster – Frontend Public CSS
 *
 * Design system, DIVI isolation, map layout and marker styles.
 * Additional sections for popup, player, panel, mini-player will be
 * added in subsequent steps.
 */

/* =====================================================================
 * CSS Custom Properties (Design System)
 * ================================================================== */

:root {
    /* Primary colours */
    --hg-color-dark: #333333;
    --hg-color-red: #ee524b;
    --hg-color-blue: #62adcf;

    /* Derived colours */
    --hg-color-red-light: #f4847e;
    --hg-color-red-dark: #d4403a;
    --hg-color-blue-light: #8ec4dd;
    --hg-color-blue-dark: #4a8fad;

    /* Neutrals */
    --hg-color-bg: #faf8f5;
    --hg-color-bg-card: #ffffff;
    --hg-color-border: #e8e4df;
    --hg-color-text: #333333;
    --hg-color-text-light: #777777;
    --hg-color-overlay: rgba(51, 51, 51, 0.6);

    /* Shadows */
    --hg-shadow-sm: 0 2px 8px rgba(51, 51, 51, 0.1);
    --hg-shadow-md: 0 4px 16px rgba(51, 51, 51, 0.15);
    --hg-shadow-lg: 0 8px 32px rgba(51, 51, 51, 0.2);

    /* Radii */
    --hg-radius-sm: 8px;
    --hg-radius-md: 12px;
    --hg-radius-lg: 20px;
    --hg-radius-full: 50%;

    /* Transitions */
    --hg-transition-fast: 150ms ease;
    --hg-transition-normal: 300ms ease;
    --hg-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --hg-font-display: 'Caveat', cursive;
    --hg-font-body: 'Inter', sans-serif;
    --hg-font-size-xs: 0.75rem;
    --hg-font-size-sm: 0.875rem;
    --hg-font-size-base: 1rem;
    --hg-font-size-lg: 1.25rem;
    --hg-font-size-xl: 1.5rem;
    --hg-font-size-2xl: 2rem;
    --hg-font-size-3xl: 2.5rem;

    /* Z-Index Layers */
    --hg-z-map: 1;
    --hg-z-markers: 10;
    --hg-z-panel-tab: 50;
    --hg-z-panel: 60;
    --hg-z-mini-player: 70;
    --hg-z-overlay: 80;
    --hg-z-popup: 90;
    --hg-z-popup-nav: 95;
}

/* =====================================================================
 * DIVI Isolation & App Container Reset
 * ================================================================== */

.hg-app {
    position: relative;
    width: 100%;
    font-family: var(--hg-font-body);
    color: var(--hg-color-text);
    background: var(--hg-color-bg);
    line-height: 1.6;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hg-app *,
.hg-app *::before,
.hg-app *::after {
    box-sizing: border-box;
}

/* Reset DIVI common overrides */
.hg-app button {
    font-family: var(--hg-font-body) !important;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.hg-app img {
    max-width: 100%;
    height: auto;
    display: block;
    border: none !important;
    box-shadow: none !important;
}

.hg-app p {
    margin: 0;
    padding: 0 !important;
}

.hg-app .hg-map-container p {
    margin: 0 0 0.5em;
    padding: 0 !important;
}

.hg-app h2,
.hg-app h3,
.hg-app h4 {
    margin: 0;
    padding: 0;
    line-height: 1.3;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.hg-app a {
    text-decoration: none;
    color: var(--hg-color-blue);
}

/* Global focus-visible indicator for all interactive elements */
.hg-app button:focus-visible,
.hg-app [tabindex]:focus-visible {
    outline: 2px solid var(--hg-color-blue);
    outline-offset: 2px;
}

/* Remove default outline for mouse/touch clicks */
.hg-app button:focus:not(:focus-visible),
.hg-app [tabindex]:focus:not(:focus-visible) {
    outline: none;
}

/* =====================================================================
 * Map Container
 * ================================================================== */

.hg-map-container {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    background: var(--hg-color-bg);
    z-index: var(--hg-z-map);
}

@media (min-width: 1024px) {
    .hg-map-container {
        height: 95vh !important;
    }
}

/* Map Wrapper (Panzoom target) */
.hg-map-wrapper {
    position: relative;
    width: 100%;
    cursor: grab;
    /* Note: Panzoom sets transform-origin: 50% 50% via inline style */
}

.hg-map-wrapper:active {
    cursor: grabbing;
}

.hg-map-image {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Markers Layer – positioned over the map image */
.hg-markers-layer {
    position: absolute;
    inset: 0;
    z-index: var(--hg-z-markers);
    pointer-events: none;
}

/* =====================================================================
 * Zoom Controls
 * ================================================================== */

.hg-map-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: calc(var(--hg-z-markers) + 5);
}

.hg-map-controls button {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-sm);
    background: var(--hg-color-bg-card);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-color-border);
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast),
        transform var(--hg-transition-fast);
}

.hg-map-controls button:hover {
    background: var(--hg-color-red);
    color: #fff;
    border-color: var(--hg-color-red);
    transform: scale(1.05);
}

.hg-map-controls button:active {
    transform: scale(0.95);
}

/* =====================================================================
 * Markers
 * ================================================================== */

.hg-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: var(--hg-radius-full);
    border: 2.5px solid #fff;
    background: var(--hg-color-red);
    cursor: pointer;
    pointer-events: auto;
    z-index: var(--hg-z-markers);
    animation: hg-pulse 3s ease-in-out infinite;
    transition:
        transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 200ms ease,
        background 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        0 0 0 0 rgba(238, 82, 75, 0);
    outline: none;
}

.hg-marker:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(238, 82, 75, 0.2);
}

.hg-marker:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px var(--hg-color-blue),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Active state – selected marker */
.hg-marker--active {
    transform: translate(-50%, -50%) scale(1.3);
    animation: none;
    background: var(--hg-color-red);
    box-shadow:
        0 4px 12px rgba(238, 82, 75, 0.35),
        0 0 0 5px rgba(238, 82, 75, 0.15);
    z-index: calc(var(--hg-z-markers) + 5);
}

.hg-marker--active:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

/* Highlight state – panel hover */
.hg-marker--highlight {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(98, 173, 207, 0.4);
}

/* Sort-order number inside marker */
.hg-marker-number {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Tooltip (house name) – shown on hover */
.hg-marker-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--hg-color-dark);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--hg-font-size-xs);
    font-family: var(--hg-font-display);
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: calc(var(--hg-z-markers) + 10);
}

.hg-marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--hg-color-dark);
}

.hg-marker:hover .hg-marker-tooltip,
.hg-marker:focus-visible .hg-marker-tooltip {
    display: block;
}

/* Active marker always shows tooltip */
.hg-marker--active .hg-marker-tooltip {
    display: block;
}

/* =====================================================================
 * Marker Pulse Animation
 * ================================================================== */

@keyframes hg-pulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 2px 6px rgba(0, 0, 0, 0.15),
            0 0 0 0 rgba(238, 82, 75, 0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.06);
        box-shadow:
            0 2px 6px rgba(0, 0, 0, 0.15),
            0 0 0 6px rgba(238, 82, 75, 0.12);
    }
}

/* =====================================================================
 * Popup Overlay
 * ================================================================== */

.hg-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--hg-color-overlay);
    z-index: var(--hg-z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hg-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-popup-overlay[hidden] {
    display: none;
}

.hg-popup-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop split-view: overlay only covers right half, no dark backdrop */
@media (min-width: 1024px) {
    .hg-popup-overlay {
        left: 50%;
        right: 0;
        width: 50%;
        background: none;
        align-items: stretch;
        justify-content: stretch;
    }
}

/* =====================================================================
 * Popup Container
 * ================================================================== */

.hg-popup {
    position: relative;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-lg);
    width: 95vw;
    max-width: 600px;
    max-height: 90vh;
    z-index: var(--hg-z-popup);
    box-shadow: var(--hg-shadow-lg);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition:
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity var(--hg-transition-normal);
    outline: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.hg-popup--visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Mobile: slide-up bottom sheet */
@media (max-width: 767px) {
    .hg-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--hg-radius-lg) var(--hg-radius-lg) 0 0;
        transform: translateY(100%);
        transition:
            transform 400ms cubic-bezier(0.4, 0, 0.2, 1),
            opacity var(--hg-transition-normal);
    }

    .hg-popup--visible {
        transform: translateY(0);
    }
}

/* Desktop split-view: popup fills right half, slides in from right */
@media (min-width: 1024px) {
    .hg-popup {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
        transform: translateX(100%);
        opacity: 1;
        transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hg-popup--visible {
        transform: translateX(0);
    }
}

/* Popup scrollable body */
.hg-popup-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
}

/* =====================================================================
 * Popup Close Button
 * ================================================================== */

.hg-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-bg-card);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--hg-z-popup) + 5);
    box-shadow: var(--hg-shadow-sm);
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast);
}

.hg-popup-close:hover {
    background: var(--hg-color-red);
    color: #fff;
}

.hg-popup-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--hg-color-blue);
}

/* =====================================================================
 * Popup Navigation Arrows
 * ================================================================== */

.hg-popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--hg-color-red);
    font-size: var(--hg-font-size-lg);
    color: #fff !important;
    cursor: pointer;
    z-index: var(--hg-z-popup-nav);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 0 rgba(238, 82, 75, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
        background 150ms ease,
        color 150ms ease,
        box-shadow 200ms ease,
        border-color 150ms ease;
}

.hg-popup-nav:hover {
    background: var(--hg-color-red);
    color: #fff;
    border-color: var(--hg-color-red);
    transform: translateY(-50%) scale(1.08);
    box-shadow:
        0 4px 12px rgba(238, 82, 75, 0.3),
        0 0 0 3px rgba(238, 82, 75, 0.12);
}

.hg-popup-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.hg-popup-prev {
    left: -20px;
}

.hg-popup-next {
    right: -20px;
}

/* Mobile: arrows inside the popup */
@media (max-width: 767px) {
    .hg-popup-nav {
        width: 36px;
        height: 36px;
        font-size: var(--hg-font-size-base);
        top: auto;
        bottom: 16px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    .hg-popup-nav:hover {
        transform: translateY(0) scale(1.08);
    }

    .hg-popup-nav:active {
        transform: translateY(0) scale(0.95);
    }

    .hg-popup-prev {
        left: 12px;
    }

    .hg-popup-next {
        right: 12px;
    }
}

/* Desktop split-view: nav buttons inside popup edges */
@media (min-width: 1024px) {
    .hg-popup-prev {
        left: 12px;
    }

    .hg-popup-next {
        right: 12px;
    }
}

/* =====================================================================
 * Popup Header
 * ================================================================== */

.hg-popup-header {
    padding: 24px 24px 16px;
}

/* Title */
.hg-popup-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-3xl);
    color: var(--hg-color-dark);
    margin: 8px 0 4px;
}

/* Address */
.hg-popup-address {
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-text-light);
}

/* Description (below address) */
.hg-popup-description {
    font-size: var(--hg-font-size-base);
    color: var(--hg-color-text);
    margin-top: 8px;
    line-height: 1.6;
}

/* =====================================================================
 * Popup Image + Play Overlay
 * ================================================================== */

.hg-popup-main-audio {
    padding: 0 24px;
}

.hg-popup-image-wrapper {
    position: relative;
    border-radius: var(--hg-radius-md);
    overflow: hidden;
}

.hg-popup-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.hg-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background var(--hg-transition-fast);
}

.hg-play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.hg-play-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: var(--hg-shadow-lg);
    transition: transform var(--hg-transition-fast);
}

.hg-play-overlay:hover .hg-play-icon {
    transform: scale(1.1);
}

/* =====================================================================
 * Transcript Section
 * ================================================================== */

.hg-transcript-section {
    padding: 12px 24px;
}

.hg-transcript-toggle {
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-blue);
    font-weight: 500;
    transition: color var(--hg-transition-fast);
}

.hg-transcript-toggle:hover {
    color: var(--hg-color-blue-dark);
}

.hg-transcript-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--hg-color-bg);
    border-radius: var(--hg-radius-sm);
    margin-top: 8px;
    font-size: var(--hg-font-size-base);
    line-height: 1.8;
}

/* =====================================================================
 * Info Cards Section (current businesses)
 * ================================================================== */

.hg-info-cards-section {
    padding: 0 24px 24px;
}

.hg-info-cards-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-xl);
    color: var(--hg-color-dark);
    margin: 0 0 12px;
    line-height: 1.3;
}

.hg-info-card {
    padding: 16px;
    background: var(--hg-color-bg);
    border: 1px solid var(--hg-color-border);
    border-radius: var(--hg-radius-md);
    margin-bottom: 12px;
}

.hg-info-card:last-child {
    margin-bottom: 0;
}

.hg-info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.hg-info-card-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--hg-radius-sm);
    flex-shrink: 0;
}

.hg-info-card-name {
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-lg);
    font-weight: 600;
    color: var(--hg-color-dark);
    margin: 0;
    line-height: 1.3;
}

.hg-info-card-description {
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-text-light);
    line-height: 1.6;
    margin: 0 0 10px;
}

/* Hide bottom margin when description is the last element */
.hg-info-card-description:last-child {
    margin-bottom: 0;
}

.hg-info-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hg-info-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-blue);
    text-decoration: none;
    transition: color var(--hg-transition-fast);
}

.hg-info-card-link:hover {
    color: var(--hg-color-blue-dark);
}

.hg-info-card-link-icon {
    font-size: var(--hg-font-size-base);
}

/* =====================================================================
 * Snippet Grid
 * ================================================================== */

.hg-popup-snippets {
    padding: 0 24px 24px;
}

.hg-popup-snippets-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-xl);
    color: var(--hg-color-dark);
    margin-bottom: 12px;
}

.hg-snippets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 480px) {
    .hg-snippets-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Snippet Card */
.hg-snippet-card {
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-md);
    padding: 0;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition:
        box-shadow var(--hg-transition-fast),
        transform var(--hg-transition-fast);
    overflow: hidden;
}

.hg-snippet-card:hover {
    box-shadow: var(--hg-shadow-md);
    transform: translateY(-2px);
}

/* Snippet Image Wrapper – contains image + play overlay + duration badge */
.hg-snippet-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--hg-color-bg);
    cursor: pointer;
}

.hg-snippet-image-wrapper--no-image {
    background: linear-gradient(135deg, var(--hg-color-bg) 0%, #e8e4df 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-snippet-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hg-snippet-card:hover .hg-snippet-image {
    transform: scale(1.04);
}

/* Play Overlay on image */
.hg-snippet-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: background var(--hg-transition-fast);
    padding: 0;
}

.hg-snippet-play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.hg-snippet-play-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(238, 82, 75, 0.4);
    transition:
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
    padding-left: 2px;
}

.hg-snippet-play-overlay:hover .hg-snippet-play-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(238, 82, 75, 0.5);
}

/* Duration badge – bottom-right corner of image */
.hg-snippet-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Snippet Progress Bar – thin bar between image and info */
.hg-snippet-progress {
    height: 3px;
    background: var(--hg-color-border);
    overflow: hidden;
}

.hg-snippet-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    transition: width 100ms linear;
}

/* Snippet Info area (title + transcript toggle) */
.hg-snippet-info {
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hg-snippet-title {
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    color: var(--hg-color-dark);
    margin: 0;
    line-height: 1.35;
    flex: 1 1 auto;
}

/* Snippet Transcript */
.hg-snippet-transcript-toggle {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-blue);
    flex-shrink: 0;
    white-space: nowrap;
    padding: 2px 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color var(--hg-transition-fast);
}

.hg-snippet-transcript-toggle:hover {
    color: var(--hg-color-blue-dark);
}

.hg-snippet-transcript {
    font-size: var(--hg-font-size-sm);
    line-height: 1.7;
    color: var(--hg-color-text-light);
    padding: 10px 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--hg-color-border);
}

/* =====================================================================
 * Audio Player (in-popup)
 * ================================================================== */

.hg-player {
    padding: 16px 24px;
}

.hg-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

/* Skip buttons (±15s) */
.hg-player-skip-back,
.hg-player-skip-forward {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    color: var(--hg-color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
}

.hg-player-skip-back:hover,
.hg-player-skip-forward:hover {
    color: var(--hg-color-red);
    background: rgba(238, 82, 75, 0.08);
}

.hg-player-skip-back svg,
.hg-player-skip-forward svg {
    width: 24px;
    height: 24px;
}

/* Play / Pause button */
.hg-player-play-pause {
    width: 56px;
    height: 56px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red);
    color: #fff;
    font-size: var(--hg-font-size-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hg-shadow-sm);
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
}

.hg-player-play-pause:hover {
    background: var(--hg-color-red-dark);
    transform: scale(1.05);
}

.hg-player-play-pause:active {
    transform: scale(0.95);
}

.hg-player-icon-play,
.hg-player-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hg-player-icon-play[hidden],
.hg-player-icon-pause[hidden] {
    display: none;
}

/* Progress section */
.hg-player-progress {
    padding: 0 24px;
}

/* Progress bar track */
.hg-player-progress-bar {
    position: relative;
    height: 6px;
    background: var(--hg-color-border);
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
}

/* Filled portion */
.hg-player-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    border-radius: 3px;
    transition: width 100ms linear;
    pointer-events: none;
}

/* Draggable handle */
.hg-player-progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--hg-color-red);
    border-radius: var(--hg-radius-full);
    border: 2px solid #fff;
    box-shadow: var(--hg-shadow-sm);
    cursor: grab;
    transition: transform var(--hg-transition-fast);
    z-index: 2;
}

.hg-player-progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.hg-player-progress-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.3);
}

/* Time labels */
.hg-player-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
 * Playing Snippet Card Highlight
 * ================================================================== */

.hg-snippet-card--playing {
    box-shadow:
        0 0 0 2px var(--hg-color-red),
        0 2px 8px rgba(238, 82, 75, 0.15);
}

.hg-snippet-card--playing .hg-snippet-play-overlay {
    background: rgba(238, 82, 75, 0.2);
}

.hg-snippet-card--playing .hg-snippet-progress {
    background: rgba(238, 82, 75, 0.15);
}

/* =====================================================================
 * Side Panel – Tab Handle
 * ================================================================== */

.hg-panel-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--hg-z-panel-tab);
    background: var(--hg-color-red);
    color: #fff;
    border: none;
    border-radius: var(--hg-radius-md) 0 0 var(--hg-radius-md);
    padding: 12px 8px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-lg);
    box-shadow: var(--hg-shadow-md);
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hg-panel-tab:hover {
    background: var(--hg-color-red-dark);
}

.hg-panel-tab--active {
    transform: translateY(-50%) translateX(4px);
    opacity: 0.7;
}

.hg-panel-tab-icon {
    font-size: var(--hg-font-size-xl);
    line-height: 1;
}

.hg-panel-tab-label {
    font-family: var(--hg-font-display);
}

/* Mobile: bottom-centre tab */
@media (max-width: 767px) {
    .hg-panel-tab {
        position: fixed;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 0;
        transform: translateX(-50%);
        writing-mode: horizontal-tb;
        border-radius: var(--hg-radius-md) var(--hg-radius-md) 0 0;
        padding: 8px 24px;
        flex-direction: row;
    }

    .hg-panel-tab--active {
        transform: translateX(-50%) translateY(4px);
    }
}

/* =====================================================================
 * Side Panel – Container
 * ================================================================== */

.hg-panel {
    position: fixed;
    right: -350px;
    top: 0;
    bottom: 0;
    width: 340px;
    background: var(--hg-color-bg-card);
    z-index: var(--hg-z-panel);
    box-shadow: var(--hg-shadow-lg);
    transition: right var(--hg-transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hg-panel--open {
    right: 0;
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
    .hg-panel {
        right: auto;
        left: 0;
        top: auto;
        bottom: -100%;
        width: 100%;
        height: 70vh;
        border-radius: var(--hg-radius-lg) var(--hg-radius-lg) 0 0;
        transition: bottom var(--hg-transition-slow);
    }

    .hg-panel--open {
        bottom: 0;
    }
}

/* =====================================================================
 * Side Panel – Header
 * ================================================================== */

.hg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hg-color-border);
    flex-shrink: 0;
}

.hg-panel-logo {
    max-height: 36px;
    width: auto;
}

.hg-panel-close {
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    font-size: var(--hg-font-size-xl);
    color: var(--hg-color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
}

.hg-panel-close:hover {
    color: var(--hg-color-red);
    background: rgba(238, 82, 75, 0.08);
}

/* =====================================================================
 * Side Panel – Tabs
 * ================================================================== */

.hg-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--hg-color-border);
    flex-shrink: 0;
    font-size: 16px;
}

.hg-panel-tab-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    color: var(--hg-color-text-light);
    text-align: center;
    border-bottom: 2px solid transparent;
    transition:
        color var(--hg-transition-fast),
        border-color var(--hg-transition-fast);
}

.hg-panel-tab-btn:hover {
    color: var(--hg-color-text);
}

.hg-panel-tab-btn.active {
    color: var(--hg-color-red);
    border-bottom-color: var(--hg-color-red);
}

/* =====================================================================
 * Side Panel – Inline Playing State (playlist feedback)
 * ================================================================== */

/* Equalizer bars inside each item (hidden by default) */
.hg-panel-item-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex-shrink: 0;
}

.hg-panel-item-eq span {
  display: block;
  width: 3px;
  background: var(--hg-color-red);
  border-radius: 1px;
  animation: hg-eq-bar 1.2s ease-in-out infinite;
}

.hg-panel-item-eq span:nth-child(1) {
  height: 60%;
  animation-delay: 0s;
}

.hg-panel-item-eq span:nth-child(2) {
  height: 100%;
  animation-delay: 0.2s;
}

.hg-panel-item-eq span:nth-child(3) {
  height: 40%;
  animation-delay: 0.4s;
}

@keyframes hg-eq-bar {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* Playing item: show equalizer, hide number badge */
.hg-panel-item--playing .hg-panel-item-eq {
  display: flex;
}

.hg-panel-item--playing .hg-panel-item-number {
  display: none;
}

/* Playing item highlight */
.hg-panel-item--playing {
  background: rgba(238, 82, 75, 0.06);
  border-left-color: var(--hg-color-red);
}

.hg-panel-item--playing .hg-panel-item-title {
  color: var(--hg-color-red);
  font-weight: 600;
}

.hg-panel-item--playing .hg-panel-item-play {
  background: var(--hg-color-red);
  color: #fff;
}

.hg-panel-item--playing .hg-panel-item-play:hover {
  background: var(--hg-color-red-dark);
}

/* Paused state: freeze equalizer */
.hg-panel-item--paused .hg-panel-item-eq span {
  animation-play-state: paused;
}

.hg-panel-item--paused .hg-panel-item-play {
  background: transparent;
  color: var(--hg-color-red);
}

.hg-panel-item--paused .hg-panel-item-play:hover {
  background: var(--hg-color-red);
  color: #fff;
}

/* =====================================================================
 * Side Panel – Content / List
 * ================================================================== */

.hg-panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.hg-panel-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--hg-color-text-light);
    font-style: italic;
    font-size: var(--hg-font-size-sm);
}

/* =====================================================================
 * Side Panel – List Item
 * ================================================================== */

.hg-panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background var(--hg-transition-fast);
    border-left: 3px solid transparent;
}

.hg-panel-item:hover {
    background: var(--hg-color-bg);
}

.hg-panel-item--active {
    background: var(--hg-color-bg);
    border-left-color: var(--hg-color-red);
}

/* Number badge */
.hg-panel-item-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-border);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-panel-item--active .hg-panel-item-number {
    background: var(--hg-color-red);
    color: #fff;
}

/* Info block */
.hg-panel-item-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hg-panel-item-title {
    font-size: var(--hg-font-size-sm);
    font-weight: 500;
    color: var(--hg-color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-panel-item-subtitle {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Play button */
.hg-panel-item-play {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    color: var(--hg-color-red);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast);
}

.hg-panel-item-play:hover {
    background: var(--hg-color-red);
    color: #fff;
}

/* =====================================================================
 * Side Panel – Footer (Offline)
 * ================================================================== */

.hg-panel-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--hg-color-border);
}

.hg-offline-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--hg-radius-sm);
    background: var(--hg-color-blue);
    color: #fff;
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    text-align: center;
    transition: background var(--hg-transition-fast);
}

.hg-offline-btn:hover {
    background: var(--hg-color-blue-dark);
}

.hg-offline-progress {
    margin-top: 8px;
}

.hg-offline-progress-track {
    height: 4px;
    background: var(--hg-color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.hg-offline-progress-bar {
    height: 100%;
    width: 0;
    background: var(--hg-color-blue);
    border-radius: 2px;
    transition: width 200ms linear;
}

.hg-offline-progress-text {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
}

/* =====================================================================
 * Mini Player
 * ================================================================== */

.hg-mini-player {
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: auto;
    max-width: 480px;
    width: calc(100% - 32px);
    background: var(--hg-color-dark);
    color: #ffffff;
    z-index: var(--hg-z-mini-player);
    transform: translateY(calc(100% + 32px));
    transition: transform var(--hg-transition-normal),
                max-width var(--hg-transition-normal),
                border-radius var(--hg-transition-fast);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border-radius: var(--hg-radius-md);
}

.hg-mini-player--visible {
    transform: translateY(0);
}

/* Minimized state: compact pill */
.hg-mini-player--minimized {
    max-width: 200px;
}

.hg-mini-player--minimized .hg-mini-player-progress-bar,
.hg-mini-player--minimized .hg-mini-player-time,
.hg-mini-player--minimized .hg-mini-player-autoplay,
.hg-mini-player--minimized .hg-mini-player-skip-back,
.hg-mini-player--minimized .hg-mini-player-skip-forward,
.hg-mini-player--minimized .hg-mini-player-next,
.hg-mini-player--minimized .hg-mini-player-info {
    display: none !important;
}

.hg-mini-player--minimized .hg-mini-player-content {
    padding: 6px 10px;
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
}

.hg-mini-player--minimized .hg-mini-player-controls {
    gap: 2px;
    margin-left: 0;
}

/* Rotate chevron when minimized (points up to expand) */
.hg-mini-player--minimized .hg-mini-player-minimize svg {
    transform: rotate(180deg);
}

/* Seekable progress bar at top */
.hg-mini-player-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    z-index: 2;
    transition: height var(--hg-transition-fast);
}

.hg-mini-player-progress-bar:hover {
    height: 6px;
}

.hg-mini-player-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    transition: width 100ms linear;
    pointer-events: none;
}

/* Content layout – two rows */
.hg-mini-player-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 14px 8px 16px;
    gap: 4px 10px;
}

/* Info section – full width top row */
.hg-mini-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 100%;
    cursor: pointer;
}

.hg-mini-player-info:hover .hg-mini-player-title {
    color: var(--hg-color-red-light);
}

.hg-mini-player-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-lg);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transition: color var(--hg-transition-fast);
    flex-shrink: 1;
    min-width: 0;
}

.hg-mini-player-subtitle {
    font-size: var(--hg-font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    flex-shrink: 1;
    min-width: 0;
}

/* Dot separator between title and subtitle */
.hg-mini-player-subtitle:not(:empty)::before {
    content: '\00B7';
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 700;
}

/* Time display */
.hg-mini-player-time {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: var(--hg-font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}

.hg-mini-player-separator {
    margin: 0 1px;
    opacity: 0.4;
}

/* Controls – push to right side of second row */
.hg-mini-player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Shared button base for mini-player controls */
.hg-mini-player-skip-back,
.hg-mini-player-skip-forward,
.hg-mini-player-next {
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--hg-transition-fast), background var(--hg-transition-fast);
    padding: 0;
}

.hg-mini-player-skip-back:hover,
.hg-mini-player-skip-forward:hover,
.hg-mini-player-next:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.hg-mini-player-play-pause {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red);
    color: #ffffff;
    border: none;
    font-size: var(--hg-font-size-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
}

.hg-mini-player-play-pause:hover {
    background: var(--hg-color-red-dark);
    transform: scale(1.05);
}

/* Play/pause icon visibility */
.hg-mini-player-icon-play,
.hg-mini-player-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-mini-player-icon-play[hidden],
.hg-mini-player-icon-pause[hidden] {
    display: none !important;
}

.hg-mini-player-minimize {
    width: 28px;
    height: 28px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
    margin-left: 4px;
}

.hg-mini-player-minimize:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.hg-mini-player-minimize svg {
    transition: transform var(--hg-transition-fast);
}

.hg-mini-player-close {
    width: 28px;
    height: 28px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: none;
    font-size: var(--hg-font-size-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
}

.hg-mini-player-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Mini-player auto-play toggle */
.hg-mini-player-autoplay {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.hg-mini-player-autoplay-track {
  position: relative;
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  transition: background var(--hg-transition-fast);
  display: flex;
  align-items: center;
  padding: 2px;
  outline: none;
  cursor: pointer;
  border: none;
}

.hg-mini-player-autoplay-track:focus-visible {
  box-shadow: 0 0 0 2px var(--hg-color-red-light);
}

.hg-mini-player-autoplay-track[aria-checked="true"] {
  background: var(--hg-color-red);
}

.hg-mini-player-autoplay-knob {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform var(--hg-transition-fast);
  pointer-events: none;
}

.hg-mini-player-autoplay-track[aria-checked="true"] .hg-mini-player-autoplay-knob {
  transform: translateX(14px);
}

.hg-mini-player-autoplay-label {
  font-size: var(--hg-font-size-xs);
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

/* Mobile: full-width bottom bar */
@media (max-width: 767px) {
    .hg-mini-player {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 0;
    }

    .hg-mini-player--minimized {
        max-width: 160px;
        left: auto;
        right: 8px;
        bottom: 8px;
        border-radius: var(--hg-radius-md);
    }

    .hg-mini-player-content {
        padding: 6px 10px 8px;
        gap: 2px 8px;
    }

    .hg-mini-player-title {
        font-size: var(--hg-font-size-base);
    }

    .hg-mini-player-time {
        display: none;
    }

    .hg-mini-player-subtitle {
        display: none;
    }

    .hg-mini-player-skip-back,
    .hg-mini-player-skip-forward {
        width: 28px;
        height: 28px;
    }

    .hg-mini-player-play-pause {
        width: 36px;
        height: 36px;
    }

    .hg-mini-player-autoplay-label {
        display: none;
    }
}

/* =====================================================================
 * Auto-Play Toggle (in popup player)
 * ================================================================== */

.hg-player-extras {
    display: flex;
    justify-content: flex-end;
    padding: 2px 16px 6px;
}

.hg-player-autoplay-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.hg-player-autoplay-label {
    white-space: nowrap;
    font-size: 0.6875rem;
    color: var(--hg-color-text-light);
}

/* Toggle track */
.hg-player-autoplay-track {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: var(--hg-color-border);
    border-radius: 9px;
    transition: background var(--hg-transition-fast);
    outline: none;
}

.hg-player-autoplay-track:focus-visible {
    box-shadow: 0 0 0 2px var(--hg-color-red-light);
}

/* Toggle knob */
.hg-player-autoplay-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--hg-transition-fast);
}

/* Active state */
.hg-player-autoplay-track[aria-checked="true"] {
    background: var(--hg-color-red);
}

.hg-player-autoplay-track[aria-checked="true"] .hg-player-autoplay-knob {
    transform: translateX(14px);
}

/* =====================================================================
 * Popup Content Transition (stop-to-stop navigation)
 * ================================================================== */

.hg-popup-body {
    transition: opacity 200ms ease;
}

.hg-popup-body--fading {
    opacity: 0;
}

/* =====================================================================
 * Edge Cases: missing content
 * ================================================================== */

/* Hide image wrapper when stop has no image */
.hg-popup-image-wrapper[hidden] {
    display: none;
}

/* Hide play overlay when stop has no audio */
.hg-play-overlay[hidden] {
    display: none;
}

/* Disabled offline button */
.hg-offline-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--hg-color-border);
    color: var(--hg-color-text-light);
}

.hg-offline-btn:disabled:hover {
    background: var(--hg-color-border);
}

/* =====================================================================
 * Reduced Motion
 * ================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hg-marker {
        animation: none;
    }

    .hg-marker,
    .hg-map-controls button,
    .hg-popup,
    .hg-popup-overlay,
    .hg-popup-nav,
    .hg-popup-close,
    .hg-play-overlay,
    .hg-play-icon,
    .hg-snippet-card,
    .hg-snippet-image,
    .hg-snippet-play-overlay,
    .hg-snippet-play-icon,
    .hg-snippet-progress-filled,
    .hg-player-play-pause,
    .hg-player-skip-back,
    .hg-player-skip-forward,
    .hg-player-progress-handle,
    .hg-player-progress-filled,
    .hg-panel,
    .hg-panel-tab,
    .hg-panel-item,
    .hg-panel-item-play,
    .hg-panel-tab-btn,
    .hg-panel-close,
    .hg-transcript-toggle,
    .hg-snippet-transcript-toggle,
    .hg-offline-btn,
    .hg-offline-progress-bar,
    .hg-mini-player,
    .hg-mini-player-play-pause,
    .hg-mini-player-skip-back,
    .hg-mini-player-skip-forward,
    .hg-mini-player-next,
    .hg-mini-player-close,
    .hg-mini-player-progress-bar,
    .hg-mini-player-info,
    .hg-player-autoplay-track,
    .hg-player-autoplay-knob,
    .hg-mini-player-autoplay-track,
    .hg-mini-player-autoplay-knob,
    .hg-mini-player-minimize,
    .hg-mini-player-minimize svg,
    .hg-popup-body {
        transition-duration: 0ms !important;
    }

    .hg-panel-item-eq span {
        animation: none !important;
    }
}
