.tdr-page-wrapper {
    position: relative;
    background-color: var(--bgc-app);
    overflow-x: clip;
    margin-top: calc(-60px - env(safe-area-inset-top, 0px));
}

@media (max-width: 768px) {
    .tdr-page-wrapper {
        margin-top: calc(-54px - env(safe-area-inset-top, 0px));
    }
}

.tdr-gradient-bg {
    display: none;
}

.tdr-details {
    position: relative;
    z-index: 1;
    color: var(--text-white);
}

.tdr-above-fold {
    min-height: calc(100svh + 60px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .tdr-above-fold {
        /* below 768px, .page-content becomes the real scroll container (flex:1, height
           capped at 100dvh minus the bottom nav dock), so the section must fill that
           actual space rather than the full device viewport, or the player controls
           end up pushed behind the dock. */
        min-height: calc(100dvh - var(--dock-h) - 1px - env(safe-area-inset-bottom, 0px) + 54px + env(safe-area-inset-top, 0px));
    }
}

.tdr-above-fold .tdr-hero {
    flex: 0 0 auto;
}

.tdr-above-fold .tdr-player-section {
    width: 100%;
    box-sizing: border-box;
}

.tdr-hero {
    --hero-accent: 161,153,207;
    position: relative;
    overflow: hidden;
    padding: clamp(48px, 7vw, 88px) clamp(16px, 3vw, 32px) clamp(40px, 5vw, 68px);
    padding-top: calc(60px + env(safe-area-inset-top, 0px) + clamp(48px, 7vw, 88px));
    background:
        linear-gradient(180deg,
            rgba(var(--hero-accent), 0.45) 0%,
            rgba(var(--hero-accent), 0.12) 55%,
            var(--bgc-app) 100%
        );
}

.tdr-hero-inner {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 3vw, 32px);
    text-align: center;
}

.tdr-cover-container {
    position: relative;
    width: clamp(240px, 34vw, 460px);
}

.tdr-cover-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(161,153,207,0.28) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    opacity: 0.5;
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
}

.tdr-cover {
    margin: 0;
    position: relative;
    z-index: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 0 0 1px rgba(255,255,255,0.08);
}

.tdr-cover img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.tdr-cover dotlottie-player {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.tdr-cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdr-cover-placeholder svg {
    width: 60px;
    height: 60px;
    color: var(--text-tunedr);
    opacity: 0.35;
}

.tdr-hero-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.tdr-title-marquee {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
}

.tdr-title-marquee__track {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    width: max-content;
    margin: 0 auto;
}

.tdr-title {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-white);
    margin: 0;
    white-space: nowrap;
}

.tdr-title-sep {
    color: var(--text-grey);
    opacity: 0.5;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.tdr-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.tdr-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-grey);
}

.tdr-meta-item svg {
    opacity: 0.6;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.tdr-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.tdr-author:hover {
    color: var(--text-tunedr);
}

.tdr-author-deleted {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-grey);
    font-style: italic;
}

.tdr-specs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tdr-spec-item {
    display: inline-flex;
    align-items: stretch;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.82rem;
}

.tdr-spec-item:hover {
    border-color: var(--text-tunedr);
    background: rgba(161,153,207,0.1);
}

.tdr-spec-item dt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px 6px 12px;
    color: var(--text-grey);
    font-weight: 400;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.tdr-spec-item dt svg {
    opacity: 0.6;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.tdr-spec-item dd {
    padding: 6px 12px 6px 8px;
    color: var(--text-white);
    font-weight: 700;
}

.tdr-price-row {
    margin-bottom: 20px;
}

.tdr-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(161,153,207,0.18) 0%, rgba(161,153,207,0.08) 100%);
    border: 1px solid rgba(161,153,207,0.3);
    border-radius: 999px;
    color: var(--text-tunedr);
    font-size: 1rem;
    font-weight: 700;
}

.tdr-price-badge svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.tdr-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.tdr-player-section {
    max-width: 1280px;
    margin: 0 auto clamp(24px, 4vw, 40px);
    padding: 0 clamp(16px, 3vw, 32px);
}

.tdr-custom-player {
    padding: 24px 24px 28px;
}

.tdr-player-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tdr-player-times {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.tdr-player-time {
    font-size: 0.82rem;
    color: var(--text-grey);
    font-variant-numeric: tabular-nums;
}

.tdr-player-center {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.tdr-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-white);
    transition: opacity 0.15s, transform 0.15s;
}

.tdr-play-btn:hover {
    opacity: 0.7;
    transform: scale(1.08);
}

.play-icon {
    display: flex;
    align-items: center;
}

.pause-icon {
    display: none;
    align-items: center;
}

.tdr-play-btn svg {
    width: 26px;
    height: 26px;
}

.tdr-player-progress {
    width: 100%;
    position: relative;
}

.tdr-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
    overflow: visible;
}

.tdr-progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--text-tunedr);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.tdr-progress-bar input[type="range"] {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    transform: translateY(-50%);
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.tdr-content-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px) clamp(32px, 5vw, 64px);
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.tdr-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tdr-card {
    padding: 24px;
}

.tdr-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tdr-card-header svg {
    width: 18px;
    height: 18px;
    color: var(--text-tunedr);
    opacity: 0.8;
    flex-shrink: 0;
}

.tdr-card-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tdr-description-body {
    position: relative;
}

.tdr-description-text {
    color: var(--text-grey);
    line-height: 1.75;
    font-size: 0.92rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 8rem;
    overflow: hidden;
    transition: max-height 380ms ease;
    will-change: max-height;
}

.tdr-description-body.expanded .tdr-description-text {
    max-height: 2000px;
}

.tdr-expand-btn {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text-tunedr);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    font-family: var(--font-family-app);
    opacity: 0.85;
    transition: opacity 0.15s;
}

.tdr-expand-btn:hover {
    opacity: 1;
}

.tdr-credits-inline {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.tdr-credits-inline h3 {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.tdr-credit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tdr-credit-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text-white);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family-app);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tdr-credit-link:hover {
    border-color: var(--text-tunedr);
    background: rgba(161,153,207,0.08);
    color: var(--text-tunedr);
}

.tdr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 24px;
    overflow: hidden;
}

.tdr-taxonomy-section {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tdr-taxonomy-section:last-child {
    border-bottom: none;
}

.tdr-taxonomy-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.tdr-spec-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tdr-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tdr-spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tdr-spec-row:first-child {
    padding-top: 0;
}

.tdr-spec-row dt {
    font-size: 0.78rem;
    color: var(--text-grey);
    font-weight: 400;
    flex-shrink: 0;
}

.tdr-spec-row dd {
    font-size: 0.85rem;
    color: var(--text-white);
    font-weight: 600;
    margin: 0;
    text-align: right;
}

.tdr-spec-unit {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-grey);
    margin-left: 2px;
}

.tdr-spec-row--price dt {
    color: var(--text-white);
    font-weight: 600;
}

.tdr-spec-row--price dd {
    font-size: 1rem;
    color: var(--text-tunedr);
    font-weight: 700;
}

.tdr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tdr-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tdr-chip-style {
    color: var(--text-tunedr);
}

.tdr-chip-instrument {
    color: var(--success);
}

.tdr-chip:hover {
    color: var(--text-white);
}

.tdr-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    background: transparent;
    color: var(--text-grey);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tdr-tag:hover {
    color: var(--text-tunedr);
}

.tdr-empty-state {
    color: var(--text-grey);
    font-size: 0.82rem;
    font-style: italic;
    opacity: 0.6;
}

.tdr-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
}

.tdr-modal-inner {
    min-height: 120px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.tdr-credit-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tdr-credit-banner {
    position: relative;
    width: 100%;
    height: 140px;
    background: rgba(255,255,255,0.04);
    overflow: visible;
}

.tdr-credit-banner img,
.tdr-credit-banner__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tdr-credit-banner__placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08));
}

.tdr-credit-avatar-wrapper {
    position: absolute;
    left: 20px;
    bottom: -32px;
    width: var(--size-avatar-user);
    height: var(--size-avatar-user);
    border-radius: 50%;
    border: 3px solid var(--bgc-modale);
    background: var(--bgc-input-div);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.tdr-credit-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tdr-credit-avatar__placeholder {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-grey);
}

.tdr-credit-main {
    padding: 48px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tdr-credit-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tdr-credit-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tdr-badge--pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-grey);
    font-size: 0.8rem;
    font-weight: 600;
}

.tdr-credit-desc-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px 14px;
}

.tdr-credit-bio {
    margin: 0;
    color: var(--text-white);
    font-size: 0.82rem;
    line-height: 1.6;
}

.tdr-credit-no-info {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-grey);
    font-size: 0.82rem;
    line-height: 1.6;
}

.tdr-credit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tdr-credit-grid li {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.tdr-credit-grid strong {
    color: var(--text-grey);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tdr-credit-grid span {
    color: var(--text-white);
    font-size: 0.82rem;
    font-weight: 600;
}

.tdr-profile-actions {
    display: flex;
    padding-bottom: 4px;
}

.tdr-profile-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tdr-profile-banner {
    width: 100%;
    aspect-ratio: 3 / 1;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.tdr-profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tdr-profile-banner__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08));
}

.tdr-profile-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    padding: 16px 20px 20px;
}

.tdr-profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    background: var(--bgc-input-div);
    margin-top: -20px;
}

.tdr-profile-avatar img,
.tdr-profile-avatar dotlottie-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tdr-profile-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tdr-profile-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tdr-profile-username {
    color: var(--text-grey);
    font-size: 0.8rem;
    margin: 0;
}

.tdr-profile-username.is-author {
    color: var(--author-music);
}

.tdr-profile-bio {
    margin: 0;
    color: var(--text-white);
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.tdr-profile-stats {
    display: flex;
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-grey);
    font-size: 0.8rem;
}

.tdr-profile-stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tdr-profile-stats strong {
    color: var(--text-white);
    font-size: 0.85rem;
    font-weight: 700;
}

.tdr-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 0 16px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.15s, border-color 0.15s;
}

.tdr-profile-link:hover {
    opacity: 0.82;
    border-color: rgba(255,255,255,0.2);
}

.tdr-profile-empty {
    color: var(--text-grey);
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
}

@media (max-width: 1024px) {
    .tdr-content-grid {
        grid-template-columns: 1fr 290px;
    }
}

@media (max-width: 700px) {
    .tdr-content-grid {
        grid-template-columns: 1fr;
        padding: 0 clamp(12px, 4vw, 20px) clamp(24px, 4vw, 48px);
    }

    .tdr-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .tdr-hero {
        padding-top: calc(54px + env(safe-area-inset-top, 0px) + 32px);
    }
}

@media (max-width: 600px) {
    .tdr-hero {
        padding: 32px clamp(14px, 4vw, 20px) 28px;
        padding-top: calc(54px + env(safe-area-inset-top, 0px) + 32px);
    }

    .tdr-player-section {
        padding: 0 clamp(12px, 4vw, 20px);
    }

    .tdr-custom-player {
        padding: 16px;
    }

    .tdr-play-btn {
        width: 44px;
        height: 44px;
    }

    .tdr-specs-bar {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .tdr-card {
        padding: 18px 16px;
    }

    .tdr-title {
        font-size: 1.5rem;
        letter-spacing: -0.02em;
    }

    .tdr-spec-item dt {
        display: none;
    }

    .tdr-spec-item {
        border-radius: 8px;
    }

    .tdr-spec-item dd {
        padding: 7px 12px;
    }
}

@media (max-width: 360px) {
    .tdr-chip,
    .tdr-tag {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

@media (hover: none) {
    .tdr-tag,
    .tdr-chip,
    .tdr-spec-item,
    .tdr-credit-link {
        transform: none;
    }
}
