/* Create library L4: premium table rows.
   Keeps the fixed 64px row contract so deleting tracks never stretches a single row. */
.music-create-library {
    gap: 12px;
}

.music-create-library .music-library-head {
    flex-wrap: wrap;
    margin-bottom: 2px;
    padding: 0 2px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.music-library-upload-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Option F: outlined accent + a divider (see docs/upload-button-options.html).
   It previously sat beside the pill row with 8px corners at 32px tall, plus a gradient fill and a
   glow no other control in the bar has. Geometry is now measured off the live .music-filter pills
   (7px / 28px / 12px-900 / 0 11px) -- NOT the values in music_tokens_base.css, which a later sheet
   overrides. An OUTLINE rather than a fill is what keeps it from reading as a selected tab: the
   filled treatment belongs to .music-filter.is-active. */
.music-library-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Tighter gap + padding than the pills so the button reads slightly narrower than its
       label would otherwise make it. Height stays locked to the pills. */
    gap: 6px;
    /* Geometry measured off the live .music-filter pills (7px / 28px / 12px-900) --
       NOT the values in music_tokens_base.css, which a later sheet overrides. */
    /* Matches the filter BAR (36px / 9px radius / solid surface), not the pills inside it --
       this button is a sibling of the bar, so pill sizing left it looking like loose text
       floating beside a solid control. Measured live: bar 36px, pill 28px. */
    min-height: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(12, 10, 12, 0.92);
    box-shadow: none;
    color: hsl(var(--music-accent-h), var(--music-accent-s), 86%);
    cursor: pointer;
    /* 11px, not the pills' 12px: the label has to fit the narrow slot,
       and the tighter tracking buys a few more pixels without looking
       condensed. Height still matches the pills, which is what carries
       the alignment. */
    /* font-family was NEVER set here, so the button fell back to the UA default (Arial) while
       every pill inherits Inter via `font: inherit` -- that mismatch, not the size, is why the
       label read as "off". Now identical type to .music-filter: Inter 12px/900. */
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    padding: 0 11px;
    white-space: nowrap;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

/* The single accent cue at rest — enough to read as an action without a filled button. */
.music-library-upload-btn svg {
    color: hsl(var(--music-accent-h), var(--music-accent-s), 72%);
}

.music-library-upload-btn svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.music-library-upload-btn:hover,
.music-library-upload-btn:focus-visible {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 78%, 0.45);
    background: rgba(232, 48, 79, 0.14);
    box-shadow: none;
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.music-library-upload-btn:disabled {
    cursor: progress;
    opacity: 0.72;
    transform: none;
}

/* No forced width or taller height on the discover copy either -- min-width: 96px was padding
   the button out well past its label, which is what made it read as a long empty box. Both
   variants now hug their text and share the pill height. */
.music-discover-library-actions .music-library-upload-btn {
    height: 28px;
    min-width: 0;
}

.music-discover-library-actions [data-music-playlist-cache] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.music-discover-library-actions [data-music-playlist-cache] svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.music-library-upload-status {
    max-width: min(230px, 32vw);
    overflow: hidden;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-upload-placeholder {
    cursor: default;
    opacity: 0.94;
}

.music-upload-placeholder:hover,
.music-upload-placeholder:focus-within {
    transform: none !important;
}

.music-upload-placeholder.is-error {
    background: rgba(255, 72, 102, 0.055) !important;
}

.music-cover.music-upload-cover-placeholder {
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(135deg, hsla(var(--upload-h1, 185), 82%, 58%, 0.82), hsla(var(--upload-h2, 328), 78%, 55%, 0.74) 56%, hsla(var(--upload-h3, 34), 86%, 58%, 0.72)),
        radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.38), transparent 34%),
        rgba(18, 17, 22, 0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.28);
}

.music-upload-cover-placeholder::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: inherit;
    opacity: 0.38;
}

.music-upload-cover-placeholder i {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 34%, rgba(255, 255, 255, 0.20) 50%, transparent 66%),
        repeating-linear-gradient(0deg, rgba(8, 7, 10, 0.18) 0 2px, transparent 2px 7px);
    background-size: 220% 100%, 100% 100%;
    mix-blend-mode: screen;
    animation: music-upload-cover-scan 1.35s linear infinite;
}

.music-upload-cover-placeholder b {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(5, 5, 8, 0.34);
    color: rgba(255, 255, 255, 0.94);
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.42);
}

.music-upload-cover-placeholder.has-cover::after,
.music-upload-cover-placeholder.has-cover i,
.music-upload-cover-placeholder.has-cover b {
    display: none;
}

.music-upload-stage {
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.music-upload-progress {
    position: relative;
    display: block;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.music-upload-progress i {
    position: absolute;
    inset: 0 auto 0 0;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff4f79, #55d8c7, #a978ff);
    transition: width 0.2s ease;
}

.music-upload-placeholder.is-error .music-upload-progress i {
    background: #ff486f;
}

.music-upload-dismiss {
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    line-height: 1;
}

@keyframes music-upload-cover-scan {
    from { background-position: 180% 0, 0 0; }
    to { background-position: -40% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .music-upload-cover-placeholder i {
        animation: none;
    }

    .music-upload-progress i {
        transition: none;
    }
}

#music-create-library-list.music-track-list {
    gap: 0;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 15px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.005)),
        rgba(7, 7, 10, 0.82);
}

#music-create-library-list .music-track-row {
    grid-template-columns: 16px 42px minmax(0, 1fr) 140px 110px 90px minmax(180px, 260px) 58px 34px;
    gap: 12px;
    border-width: 0 0 1px;
    border-color: rgba(255, 255, 255, 0.07);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 10px 16px;
    transform: translateY(8px);
}

.music-track-marker {
    display: grid;
    place-items: center;
    justify-self: center;
    align-self: center;
    width: 16px;
    min-width: 16px;
    height: 22px;
    color: rgba(230, 224, 235, 0.46);
    font-family: var(--music-mono);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.music-track-marker.is-index {
    opacity: 0.78;
}

.music-track-row:hover .music-track-marker.is-index,
.music-track-row:focus-within .music-track-marker.is-index {
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
}

.music-track-marker.is-new {
    color: hsl(var(--music-accent-h), var(--music-accent-s), 72%);
}

.music-track-marker.is-playing {
    color: var(--music-green);
}

.music-track-marker.is-paused {
    color: rgba(240, 201, 136, 0.82);
}

.music-track-marker.is-stopped {
    color: rgba(230, 224, 235, 0.46);
}

.music-track-marker .music-eq {
    height: 14px;
    transform: translateY(1px);
}

.music-track-marker .music-eq i {
    width: 2.5px;
    background: currentColor;
}

.music-new-track-dot {
    display: block;
    justify-self: center;
    align-self: center;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--music-pink);
    box-shadow:
        0 0 0 3px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.15),
        0 0 18px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.music-new-track-dot.is-visible {
    opacity: 1;
    visibility: visible;
}

#music-create-library-list .music-track-row.is-new-run {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.18);
    background:
        linear-gradient(90deg, hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.08), transparent 18%),
        transparent;
}

#music-create-library-list .music-track-row.is-new-run .music-cover {
    box-shadow:
        0 0 0 1px hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.18),
        0 10px 22px rgba(0, 0, 0, 0.36);
}

#music-create-library-list .music-job-row {
    grid-template-columns: 16px 42px minmax(220px, 1fr) minmax(144px, 174px) minmax(180px, 280px) 62px;
}

.music-job-cancel-btn {
    display: inline-grid;
    place-items: center;
    justify-self: end;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font: 900 18px/1 var(--font-ui);
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.music-job-actions {
    display: inline-flex;
    justify-self: end;
    gap: 6px;
}

.music-job-retry-btn {
    color: hsl(var(--music-accent-h), var(--music-accent-s), 78%);
}

.music-job-cancel-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.music-job-cancel-btn:hover,
.music-job-cancel-btn:focus-visible {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.42);
    background: hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.14);
    color: #fff;
    transform: translateY(-1px);
}

#music-create-library-list .music-job-row.is-failed,
.music-simple-v2 .music-job-row.is-failed {
    border-color: rgba(255, 116, 145, 0.24);
    background:
        linear-gradient(90deg, rgba(255, 80, 116, 0.12), rgba(255, 255, 255, 0.018) 54%, transparent),
        rgba(20, 8, 12, 0.42);
}

.music-job-row.is-failed .music-track-row-meta {
    color: rgba(255, 186, 199, 0.88);
}

#music-create-library-list .music-track-row:last-child {
    border-bottom-color: transparent;
}

#music-create-library-list .music-track-row:hover,
#music-create-library-list .music-track-row:focus-within {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    transform: translateY(0);
}

#music-create-library-list .music-track-row.is-active {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.25);
    background:
        linear-gradient(90deg, hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.18), rgba(255, 255, 255, 0.032) 56%, rgba(255, 255, 255, 0.018));
    box-shadow: inset 3px 0 0 hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.92);
}

#music-create-library-list .music-track-row .music-cover {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

#music-create-library-list .music-track-row:hover .music-cover,
#music-create-library-list .music-track-row:focus-within .music-cover {
    transform: none;
}

#music-create-library-list .music-wave {
    height: 15px;
    min-height: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

#music-create-library-list .music-track-main {
    min-width: 0;
}

#music-create-library-list .music-track-interactions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    transform: translateX(-12px);
}

#music-create-library-list .music-track-interactions .music-interaction-btn {
    width: 27px;
    height: 27px;
}

.music-interaction-btn--delete {
    color: rgba(236, 230, 240, 0.42);
}

.music-interaction-btn--delete:hover,
.music-interaction-btn--delete:focus-visible {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.42);
    background: hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.14);
    color: hsl(var(--music-accent-h), var(--music-accent-s), 78%);
}

.music-interaction-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.028);
    color: rgba(236, 230, 240, 0.58);
    padding: 0;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.music-interaction-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.85;
}

.music-interaction-btn:hover,
.music-interaction-btn:focus-visible {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.36);
    background: hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.105);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.music-interaction-btn.is-active {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.52);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), transparent 42%),
        hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.2);
    color: hsl(var(--music-accent-h), var(--music-accent-s), 76%);
    box-shadow: 0 0 0 1px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.12);
}

#music-create-library-list .music-track-cell {
    min-width: 0;
    overflow: hidden;
    color: rgba(230, 224, 235, 0.88);
    font-size: 11px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#music-create-library-list .music-track-cell small {
    display: block;
    margin-bottom: 2px;
    color: var(--music-faint);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#music-create-library-list .music-track-cell strong {
    display: block;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.92);
    font-size: 11.5px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#music-create-library-list .music-track-progress {
    min-width: 0;
}

#music-create-library-list .music-track-progress .music-cap-time {
    display: none;
}

#music-create-library-list .music-cap-buffer.is-loading::after {
    top: 2px;
    right: 2px;
    bottom: 2px;
    width: 7px;
}

#music-create-library-list .music-track-time,
#music-discover-library-list .music-track-time {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 54px;
    min-height: 22px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--music-mono);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    text-align: right;
    text-transform: none;
    white-space: nowrap;
}

#music-create-library-list .music-track-actions {
    width: 34px;
    justify-content: flex-end;
}

#music-create-library-list .music-more-trigger {
    width: 28px;
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    letter-spacing: 0;
}

#music-create-library-list .music-more-trigger {
    background: transparent;
}

#music-create-library-list .music-track-provider-chip {
    justify-self: start;
}

#music-create-library-list .music-track-model-rail {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#music-create-library-list .music-track-rail-mark {
    display: grid;
    place-items: center;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    overflow: hidden;
    border: 1px solid rgba(149, 92, 255, 0.26);
    border-radius: 10px;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.18), transparent 42%),
        rgba(149, 92, 255, 0.12);
}

#music-create-library-list .music-track-model-rail.is-elevenlabs .music-track-rail-mark {
    border-color: rgba(67, 214, 190, 0.28);
    background: rgba(67, 214, 190, 0.1);
}

#music-create-library-list .music-track-model-rail.is-lyria .music-track-rail-mark {
    border-color: rgba(126, 177, 255, 0.28);
    background: rgba(126, 177, 255, 0.1);
}

#music-create-library-list .music-track-model-rail.is-stable .music-track-rail-mark {
    border-color: rgba(255, 204, 102, 0.25);
    background: rgba(255, 204, 102, 0.08);
}

#music-create-library-list .music-track-model-rail.is-cassette .music-track-rail-mark {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.28);
    background: hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.09);
}

#music-create-library-list .music-track-rail-mark img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

#music-create-library-list .music-track-rail-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

#music-create-library-list .music-track-rail-copy small {
    color: var(--music-faint);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#music-create-library-list .music-track-rail-copy strong {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11.5px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-track-state-tag {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--music-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.music-track-state-tag.is-rendered {
    border-color: rgba(67, 214, 190, 0.24);
    background: rgba(67, 214, 190, 0.075);
    color: var(--music-teal);
}

.music-track-state-tag.is-rendering {
    border-color: rgba(255, 207, 122, 0.24);
    background: rgba(255, 207, 122, 0.075);
    color: #ffcf7a;
}

.music-track-state-tag.is-plan {
    border-color: rgba(149, 92, 255, 0.24);
    background: rgba(149, 92, 255, 0.075);
    color: #d8d2ff;
}

.music-track-state-tag.is-failed {
    border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.28);
    background: hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.08);
    color: var(--music-pink-2);
}

#music-create-library-list .music-track-row:hover .music-more-trigger,
#music-create-library-list .music-track-row:focus-within .music-more-trigger {
    background: rgba(255, 255, 255, 0.065);
}

.music-track-provider-chip {
    display: inline-flex;
    align-items: center;
    max-width: 148px;
    min-width: 0;
    height: 28px;
    gap: 7px;
    padding: 4px 9px 4px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--music-text);
    font-size: 11px;
    font-weight: 950;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.music-track-provider-chip strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-track-provider-icon,
.music-track-provider-chip > i {
    width: 19px;
    height: 19px;
    display: grid;
    flex: 0 0 19px;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
}

.music-track-provider-icon img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.music-track-provider-chip.is-suno { border-color: rgba(108, 92, 255, 0.28); color: #d8d2ff; }
.music-track-provider-chip.is-elevenlabs { border-color: rgba(67, 214, 190, 0.3); color: #c7fff5; }
.music-track-provider-chip.is-lyria { border-color: rgba(126, 177, 255, 0.3); color: #d8e7ff; }
.music-track-provider-chip.is-stable { border-color: rgba(255, 204, 102, 0.28); color: #ffe2a6; }
.music-track-provider-chip.is-cassette { border-color: hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.32); color: var(--music-pink-soft); }

.music-track-provider-chip.is-streaming {
    color: #9cf4df;
    border-color: rgba(67, 214, 190, 0.34);
    border-radius: 7px;
    background: rgba(67, 214, 190, 0.075);
}

.music-job-row.is-failed .music-track-provider-chip.is-streaming {
    color: #ff9caf;
    border-color: rgba(255, 116, 145, 0.32);
    background: rgba(255, 80, 116, 0.075);
}

.music-job-row.is-failed .music-track-provider-chip.is-streaming > i::before,
.music-job-row.is-failed .music-track-provider-chip.is-streaming > i::after {
    display: none;
}

.music-track-provider-chip.is-streaming > i {
    position: relative;
    border-radius: 5px;
    background: rgba(67, 214, 190, 0.14);
}

.music-track-provider-chip.is-streaming > i::before,
.music-track-provider-chip.is-streaming > i::after {
    content: "";
    position: absolute;
    bottom: 5px;
    width: 3px;
    border-radius: 999px;
    background: currentColor;
    animation: music-stream-bars 0.8s ease-in-out infinite alternate;
}

.music-track-provider-chip.is-streaming > i::before {
    left: 6px;
    height: 7px;
}

.music-track-provider-chip.is-streaming > i::after {
    right: 6px;
    height: 11px;
    animation-delay: 0.18s;
}

@keyframes music-stream-bars {
    from { transform: scaleY(0.45); opacity: 0.5; }
    to { transform: scaleY(1); opacity: 1; }
}

.music-status-badge {
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--music-muted);
    font-size: 10px;
    font-weight: 900;
    padding: 5px 7px;
    text-transform: uppercase;
}

.music-status-badge[data-status="rendered"] {
    color: var(--music-teal);
}

.music-status-badge[data-status="failed"] {
    color: #ff9caf;
    background: rgba(255, 80, 116, 0.12);
}

.music-cover {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(135deg, hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.95), rgba(118, 75, 255, 0.8)), #1b1016;
}

/* Film-grain overlay (ports the prototype's <Cover> noise layer). The oklch
   radial + conic come from the inline coverStyle() background. */
.music-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.26;
    pointer-events: none;
}

.music-cover--small {
    width: 34px;
    height: 34px;
    border-radius: 7px;
}

.music-wave {
    position: relative;
    display: flex;
    align-items: center;
    height: 24px;
    min-height: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    /* Neutral "not loaded yet" track. The pink→violet capsule is the .music-cap-buffer
       fill (= the whole song / how much is loaded); it sits at 100% once rendered, so a
       saved track looks like a full pink capsule. The green .music-cap-fill is playback. */
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -10px 20px rgba(0, 0, 0, 0.22), 0 10px 24px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.06);
}

/* Pink→violet "loaded song" fill. Width = how much of the song exists: 100% for a
   rendered track, and it GROWS while the song is still rendering (with a pulsing tip). */
.music-cap-buffer {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: var(--music-duration-grad);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -10px 20px rgba(0, 0, 0, 0.22);
    transition: width 0.2s linear;
}

.music-cap-buffer.is-loading {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 16px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.22);
}

/* Pulsing leading tip while the song is still loading/rendering. */
.music-cap-buffer.is-loading::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    bottom: 2px;
    width: 9px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff, var(--music-pink-2));
    box-shadow: 0 0 12px hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.6), -10px 0 18px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.35);
    animation: musicLoadTip 1.05s ease-in-out infinite;
}

@keyframes musicLoadTip {
    0%, 100% { opacity: 0.55; box-shadow: 0 0 8px hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.4), -6px 0 12px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.2); }
    50% { opacity: 1; box-shadow: 0 0 22px hsla(var(--music-accent-h), var(--music-accent-s), 72%, 0.85), -14px 0 24px hsla(var(--music-accent-h), var(--music-accent-s), var(--music-accent-l), 0.5); }
}

.music-wave i {
    flex: 1;
    min-width: 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.16);
}

.music-wave i.is-played {
    background: var(--music-pink);
}

.music-cap-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: 0;
    background:
        radial-gradient(circle at 10% 42%, rgba(98, 231, 165, 0.92) 0 1.6px, transparent 2.5px),
        radial-gradient(circle at 24% 74%, rgba(74, 214, 189, 0.78) 0 1.9px, transparent 3.1px),
        radial-gradient(circle at 42% 30%, rgba(42, 198, 116, 0.82) 0 1.3px, transparent 2.4px),
        radial-gradient(circle at 64% 62%, rgba(98, 231, 165, 0.72) 0 1.7px, transparent 2.9px),
        radial-gradient(circle at 82% 38%, rgba(62, 206, 156, 0.78) 0 1.5px, transparent 2.7px),
        var(--music-duration-progress);
    background-size: 86px 24px, 118px 24px, 104px 24px, 138px 24px, 96px 24px, 180% 100%;
    box-shadow: 0 0 18px rgba(53, 208, 127, 0.28), inset -18px 0 24px rgba(74, 214, 189, 0.16), inset 14px 0 18px rgba(138, 92, 255, 0.16);
    transition: width 0.16s linear;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), rgba(0, 0, 0, 0.18) 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), rgba(0, 0, 0, 0.18) 100%);
    animation: musicDurationFlow 5.8s ease-in-out infinite alternate;
}

.music-cap-fill::before {
    content: "";
    position: absolute;
    inset: -28% -16%;
    background:
        radial-gradient(circle at 17% 45%, rgba(98, 231, 165, 0.34) 0 12%, transparent 31%),
        radial-gradient(circle at 48% 34%, rgba(55, 204, 141, 0.38) 0 17%, transparent 39%),
        radial-gradient(circle at 76% 66%, rgba(74, 214, 189, 0.34) 0 13%, transparent 35%),
        radial-gradient(circle at 28% 82%, rgba(42, 198, 116, 0.34) 0 14%, transparent 37%);
    filter: blur(8px);
    mix-blend-mode: soft-light;
    opacity: 0.7;
    transform: translate3d(-8%, 0, 0);
    animation: musicDurationBlend 7s ease-in-out infinite alternate;
}

.music-cap-fill::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    bottom: 2px;
    width: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(98, 231, 165, 0.9), rgba(54, 201, 151, 0.86) 48%, rgba(35, 168, 101, 0.82));
    box-shadow: 0 0 11px rgba(98, 231, 165, 0.36), -9px 0 16px rgba(74, 214, 189, 0.24);
    opacity: 0.86;
}

@keyframes musicDurationFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

@keyframes musicDurationBlend {
    0% {
        transform: translate3d(-10%, -3%, 0) scale(1);
    }

    100% {
        transform: translate3d(12%, 4%, 0) scale(1.08);
    }
}

.music-cap-time {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    min-height: 18px;
    margin-left: 5px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(10, 7, 8, 0.42);
    backdrop-filter: blur(5px);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.music-cap-halo {
    display: none;
}

.music-empty-card,
.music-empty-inline {
    color: var(--music-faint);
    font-size: 13px;
    line-height: 1.55;
}

.music-empty-card {
    padding: 18px;
}

/* Mobile: the filter row + upload button share one wrapping flex line and grow to a comfortable
   touch target. Previously the upload button kept its desktop width and pushed the pill row into
   a cramped horizontal scroll. */
@media (max-width: 640px) {
    .music-library-upload-cluster {
        width: 100%;
    }

    .music-library-upload-btn {
        width: 100%;
        min-height: 36px;
        height: 36px;
        font-size: 13px;
    }

    /* Match the taller touch target so the row stays visually level. */
    .music-filter {
        min-height: 36px;
        height: 36px;
        padding: 0 13px;
    }
}

/* The hairline that separates "filters" from "actions", so an accent-bordered button can never be
   mistaken for a selected filter. */
.music-library-upload-cluster {
    position: relative;
    padding-left: 11px;
}

.music-library-upload-cluster::before {
    content: none;
}

/* No divider when the cluster wraps onto its own row on mobile -- it would float mid-air. */
@media (max-width: 640px) {
    .music-library-upload-cluster { padding-left: 0; }
    .music-library-upload-cluster::before { display: none; }
}

/* The row that holds these is an inline-grid with `repeat(5, minmax(64px, 1fr))` columns
   (music_tokens_base.css), so any child gets STRETCHED to fill its track -- which is why the
   button read as a long box with the label floating in the middle, and why tightening padding
   never helped. fit-content + flex:0 0 auto makes it size to its label whatever the parent does. */
.music-library-upload-cluster {
    flex: 0 0 auto;
    width: fit-content;
    justify-self: start;
}

.music-library-upload-btn {
    flex: 0 0 auto;
    width: fit-content;
    min-width: 0;
    justify-self: start;
}

@media (max-width: 640px) {
    /* On mobile we DO want the full row -- overriding the desktop hug. */
    .music-library-upload-cluster,
    .music-library-upload-btn {
        width: 100%;
    }
}

/* ONE continuous bar. The pills and the upload button were two separate capsules sitting side by
   side, so the button always read as a neighbour rather than part of the control. They now butt
   together: the filter bar squares its right corners and drops its right border, the cluster
   squares its left corners and keeps a hairline left border as the internal divider, and the
   parent's 8px gap is cancelled so the two surfaces meet. The button reverts to PILL sizing,
   because it is now a member inside the bar rather than a peer of it. */
.music-create-library .music-library-head .music-library-filter-bar {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.music-create-library .music-library-head .music-library-upload-cluster {
    margin-left: -8px;
    box-sizing: border-box;
    height: 36px;
    align-items: center;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 9px 9px 0;
    /* The bar's background-COLOR alone was never enough: it also carries a white gradient overlay
       and an inset top highlight, which is what makes it read lighter than a flat fill. Copying
       both is what makes the two halves look like one surface rather than two shades. */
    background-color: rgba(12, 10, 12, 0.92);
    background-image: linear-gradient(rgba(255, 255, 255, 0.043), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.music-create-library .music-library-head .music-library-upload-btn {
    height: 28px;
    min-height: 28px;
    border-radius: 7px;
    border-color: transparent;
    background: transparent;
    padding: 0 11px;
}

/* Hover copied verbatim from .music-library-filter-bar .music-filter:hover
   (music_tokens_base.css:951) -- the accent-tinted hover made this button behave differently from
   every pill beside it, which is the only remaining tell that it is not one of them. */
.music-create-library .music-library-head .music-library-upload-btn:hover,
.music-create-library .music-library-head .music-library-upload-btn:focus-visible {
    color: #fff;
    outline: none;
    border-color: rgba(255, 255, 255, 0.085);
    background: rgba(255, 255, 255, 0.055);
}

/* Mobile keeps them stacked, so undo the joining. */
@media (max-width: 640px) {
    .music-create-library .music-library-head .music-library-filter-bar {
        border-top-right-radius: 9px;
        border-bottom-right-radius: 9px;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .music-create-library .music-library-head .music-library-upload-cluster {
        margin-left: 0;
        border-radius: 9px;
        height: auto;
    }
}

/* HTML's `hidden` attribute is only `display: none` in the UA stylesheet, so ANY explicit display
   on these controls beats it. .music-ghost-btn sets display: inline-flex, so the hidden Cache /
   Rename / Delete actions and the hidden upload-status line were still taking up layout -- a
   phantom 42px row that pushed the mobile library header to 99px tall. Measured live at 375px:
   a [hidden] Cache button reporting 96x42. */
.music-ghost-btn[hidden],
.music-library-upload-btn[hidden],
.music-library-upload-status[hidden],
.music-discover-library-actions [hidden] {
    display: none !important;
}
