:root {
    color-scheme: dark;
    --bg: #0c0f17;
    --panel: rgba(24, 28, 40, 0.88);
    --panel-solid: #181c28;
    --panel-light: #222738;
    --text: #f7f7fb;
    --muted: #a7adbd;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #fb5d8c;
    --accent-strong: #ff3f79;
    --accent-soft: rgba(251, 93, 140, 0.14);
    --violet: #8f6dff;
    --success: #64d3a5;
    --danger: #ff7885;
    --radius: 20px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: transparent;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.song-card:focus-visible {
    outline: 3px solid rgba(251, 93, 140, 0.55);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.vocaluxe-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 78%, rgba(204, 0, 255, 0.28) 0%, rgba(204, 0, 255, 0) 26%),
        radial-gradient(circle at 2% 42%, rgba(255, 0, 128, 0.32) 0%, rgba(255, 0, 128, 0) 35%),
        radial-gradient(circle at 86% 72%, rgba(0, 120, 255, 0.18) 0%, rgba(0, 120, 255, 0) 28%),
        linear-gradient(100deg, #8d0058 0%, #5c007f 28%, #29008f 52%, #0a1a9b 73%, #0037ad 100%);
}

.vocaluxe-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.15) 100%);
}

.vocaluxe-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.18;
    background:
        repeating-linear-gradient(30deg,
            rgba(255, 255, 255, 0.08) 0,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px,
            transparent 18px),
        repeating-linear-gradient(-30deg,
            rgba(255, 255, 255, 0.08) 0,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px,
            transparent 18px);
}

.vocaluxe-glow {
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    filter: blur(70px);
    animation: vocaluxe-drift 24s linear infinite;
}

.vocaluxe-bubble {
    position: absolute;
    z-index: 3;
    border: 8px solid rgba(139, 80, 255, 0.12);
    border-radius: 50%;
    animation: vocaluxe-drift 8s linear infinite;
}

.vocaluxe-streak {
    position: absolute;
    z-index: 4;
    height: 14px;
    border-radius: 999px;
    opacity: 0.18;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.45) 40%,
        rgba(255, 255, 255, 0.26) 100%);
    filter: blur(0.3px);
    animation: vocaluxe-streak 14s linear infinite;
}

.glow-1 {
    top: 18vh;
    left: -8vw;
    width: 42vw;
    height: 42vw;
    background: rgba(255, 0, 140, 0.18);
    animation-delay: -5s;
}

.glow-2 {
    top: 44vh;
    left: 18vw;
    width: 36vw;
    height: 36vw;
    background: rgba(180, 0, 255, 0.16);
    animation-duration: 28s;
    animation-delay: -12s;
}

.glow-3 {
    right: -6vw;
    bottom: -4vh;
    width: 34vw;
    height: 34vw;
    background: rgba(0, 90, 255, 0.18);
    animation-duration: 26s;
    animation-delay: -18s;
}

.b1 {
    left: 18%;
    bottom: 20%;
    width: 180px;
    height: 180px;
    border-color: rgba(187, 65, 255, 0.14);
    animation-delay: -2s;
}

.b2 {
    left: 23%;
    bottom: 11%;
    width: 78px;
    height: 78px;
    border-color: rgba(195, 70, 255, 0.14);
    animation-duration: 6s;
    animation-delay: -6s;
}

.b3 {
    top: 25%;
    left: 46%;
    width: 110px;
    height: 110px;
    border-color: rgba(125, 70, 255, 0.12);
    animation-duration: 10s;
    animation-delay: -10s;
}

.b4 {
    top: 6%;
    left: 25%;
    width: 76px;
    height: 76px;
    border-color: rgba(95, 55, 255, 0.1);
    animation-duration: 7s;
    animation-delay: -4s;
}

.b5 {
    right: 8%;
    bottom: 10%;
    width: 140px;
    height: 140px;
    border-color: rgba(0, 102, 255, 0.16);
    animation-duration: 11s;
    animation-delay: -12s;
}

.b6 {
    right: 15%;
    bottom: 18%;
    width: 84px;
    height: 84px;
    border-color: rgba(42, 110, 255, 0.12);
    animation-duration: 7s;
    animation-delay: -8s;
}

.b7 {
    top: 14%;
    right: -1%;
    width: 104px;
    height: 104px;
    border-color: rgba(30, 100, 255, 0.14);
    animation-delay: -14s;
}

.s1 {
    top: 6%;
    left: 3%;
    width: 240px;
    animation-delay: -1s;
}

.s2 {
    top: 10%;
    left: 10%;
    width: 170px;
    animation-duration: 2s;
    animation-delay: -5s;
}

.s3 {
    top: 16%;
    left: 6%;
    width: 120px;
    animation-duration: 3s;
    animation-delay: -7s;
}

.s4 {
    top: 62%;
    left: 24%;
    width: 130px;
    opacity: 0.12;
    animation-delay: -3s;
}

.s5 {
    top: 18%;
    right: -1%;
    width: 220px;
    opacity: 0.1;
    animation-duration: 4s;
    animation-delay: -9s;
}

.s6 {
    top: 66%;
    right: 5%;
    width: 160px;
    opacity: 0.1;
    animation-duration: 2.5s;
    animation-delay: -6s;
}

.s7 {
    top: 70%;
    left: 46%;
    width: 95px;
    opacity: 0.1;
    animation-duration: 1.6s;
    animation-delay: -11s;
}

.s8 {
    right: 18%;
    bottom: 12%;
    width: 145px;
    opacity: 0.08;
    animation-duration: 3.1s;
    animation-delay: -4s;
}

@keyframes vocaluxe-drift {
    from {
        transform: translate3d(220px, -220px, 0);
    }
    to {
        transform: translate3d(-420px, 420px, 0);
    }
}

@keyframes vocaluxe-streak {
    from {
        transform: translate3d(260px, -260px, 0) rotate(-43deg);
    }
    to {
        transform: translate3d(-520px, 520px, 0) rotate(-43deg);
    }
}

.login-shell,
.app-shell {
    position: relative;
    z-index: 1;
}

@supports (-webkit-touch-callout: none) {
    .vocaluxe-bg {
        height: 100svh;
        min-height: 100dvh;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(100%, 440px);
    padding: 46px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(30, 35, 49, 0.94), rgba(17, 20, 29, 0.94));
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 28px;
    border-radius: 18px;
    color: white;
    background: linear-gradient(145deg, var(--accent), var(--violet));
    box-shadow: 0 14px 38px rgba(251, 93, 140, 0.28);
    font-size: 27px;
    font-weight: 800;
}

.brand-mark-small {
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 13px;
    font-size: 21px;
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0;
    font-size: clamp(2rem, 7vw, 2.8rem);
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.login-copy {
    margin: 18px 0 30px;
    color: var(--muted);
    line-height: 1.65;
}

.login-card form {
    display: grid;
    gap: 10px;
}

.login-card label,
.filter-grid label {
    color: #d9dce5;
    font-size: 0.83rem;
    font-weight: 700;
}

.login-card input,
.search-box input,
.filter-grid select,
.language-picker select {
    width: 100%;
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.login-card input {
    height: 50px;
    margin-bottom: 8px;
    padding: 0 15px;
    border-radius: 12px;
}

.language-picker {
    display: grid;
    gap: 7px;
    color: #d9dce5;
    font-size: 0.78rem;
    font-weight: 700;
}

.language-picker select {
    height: 40px;
    padding: 0 11px;
    border-radius: 10px;
}

.login-language {
    margin: 0 0 18px;
}

.topbar-language select {
    width: 66px;
    border-color: var(--line);
}

select,
.filter-grid select,
.language-picker select,
.topbar-language select {
    color: #fff;
    background-color: #090b10;
    color-scheme: dark;
}

select option,
select optgroup {
    color: #fff;
    background-color: #090b10;
}

.form-error {
    margin: 4px 0 6px;
    color: #ff9aa4;
    font-size: 0.88rem;
    line-height: 1.45;
}

.login-hint {
    margin: 22px 0 0;
    color: #777e91;
    font-size: 0.79rem;
    text-align: center;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text);
    background: var(--panel-light);
    font-weight: 750;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button-wide {
    width: 100%;
    margin-top: 10px;
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--accent-strong), #ef4eb0);
    box-shadow: 0 10px 28px rgba(251, 63, 121, 0.2);
}

.button-secondary,
.button-filter {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.05);
}

.button-admin {
    min-height: 40px;
    color: #ffd8e5;
    border-color: rgba(251, 93, 140, 0.24);
    background: var(--accent-soft);
}

.button-quiet {
    min-height: 40px;
    color: var(--muted);
    background: transparent;
}

.app-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 0 40px 80px;
}

.topbar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.brand small,
.brand strong {
    display: block;
}

.brand small {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.brand strong {
    font-size: 0.96rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 1.35rem;
}

.icon-button.is-spinning span {
    display: block;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px;
    padding: 74px 0 68px;
}

.hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(3rem, 7vw, 6.8rem);
    font-weight: 800;
    line-height: 0.91;
    letter-spacing: -0.065em;
}

.hero h1 em {
    color: transparent;
    background: linear-gradient(100deg, #ff6698, #bd79ff);
    background-clip: text;
    -webkit-background-clip: text;
    font-style: normal;
}

.hero-copy {
    max-width: 600px;
    margin: 25px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.library-stat {
    min-width: 180px;
    padding: 24px 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    text-align: right;
}

.library-stat span,
.library-stat small {
    display: block;
}

.library-stat span {
    font-size: 2.4rem;
    font-weight: 850;
    letter-spacing: -0.05em;
}

.library-stat small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
}

.library {
    padding-top: 8px;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box > span {
    position: absolute;
    left: 18px;
    color: var(--muted);
    font-size: 1.5rem;
    pointer-events: none;
}

.search-box input {
    height: 58px;
    padding: 0 58px;
    border-radius: 16px;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: #777e91;
}

.search-box kbd {
    position: absolute;
    right: 16px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: #777e91;
    background: #121620;
    font: 0.75rem ui-monospace, monospace;
}

.button-filter {
    min-width: 116px;
    min-height: 58px;
}

.filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    margin-left: 5px;
    border-radius: 20px;
    color: white;
    background: var(--accent-strong);
    font-size: 0.7rem;
}

.filter-panel {
    display: none;
    margin-top: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.filter-panel.is-open {
    display: block;
    animation: reveal 180ms ease-out;
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(-6px); }
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.filter-grid label {
    display: grid;
    gap: 8px;
}

.filter-grid select {
    height: 44px;
    padding: 0 12px;
    border-radius: 11px;
}

.filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.favorite-filter {
    cursor: pointer;
    color: #e9d18f;
    font-weight: 700;
}

.favorite-filter input {
    margin-right: 7px;
}

.text-button {
    padding: 4px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-weight: 700;
}

.library-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin: 52px 0 22px;
}

.library-heading h2 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -0.035em;
}

.index-status {
    margin: 0;
    color: #777e91;
    font-size: 0.76rem;
}

.library-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.view-switch {
    display: flex;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #090b10;
}

.view-switch button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #747b8d;
    background: transparent;
    font-size: 1rem;
}

.view-switch button[aria-pressed="true"] {
    color: #fff;
    background: var(--panel-light);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.song-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px 18px;
}

.song-card {
    min-width: 0;
    border-radius: 17px;
    cursor: pointer;
    transition: transform 180ms ease;
}

.song-card:hover {
    transform: translateY(-4px);
}

.song-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--panel-light);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: transform 250ms ease, opacity 180ms ease;
}

.song-cover img.is-loaded {
    opacity: 1;
}

.song-card:hover .song-cover img {
    transform: scale(1.035);
}

.song-cover-fallback {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at 25% 20%, rgba(251, 93, 140, 0.3), transparent 45%),
        linear-gradient(145deg, #282e42, #171b28);
    font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.playable-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding-left: 2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: white;
    background: rgba(12, 15, 23, 0.78);
    backdrop-filter: blur(8px);
    font-size: 0.78rem;
}

.favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: white;
    background: rgba(12, 15, 23, 0.66);
    backdrop-filter: blur(8px);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
}

.song-card:hover .favorite-button,
.song-card:focus-within .favorite-button,
.favorite-button.is-favorite {
    opacity: 1;
}

.favorite-button:hover {
    transform: scale(1.08);
}

.favorite-button.is-favorite {
    color: #ffd66b;
}

.song-card-body {
    padding: 13px 4px 0;
}

.song-separator {
    display: none;
}

.song-artist,
.song-meta,
.song-card h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-artist {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.song-card h3 {
    margin: 0;
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.song-meta {
    margin: 7px 0 0;
    color: #777e91;
    font-size: 0.72rem;
}

.song-grid.is-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

.song-grid.is-list .song-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    min-height: 82px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
}

.song-grid.is-list .song-card:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.045);
}

.song-grid.is-list .song-cover {
    width: 68px;
    height: 68px;
    border-radius: 9px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.song-grid.is-list .song-card-body {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    padding: 0 14px;
}

.song-grid.is-list .song-artist {
    flex: 0 1 auto;
    max-width: 42%;
    margin: 0;
    font-size: 0.82rem;
}

.song-grid.is-list .song-separator {
    display: block;
    flex: 0 0 auto;
    color: #697083;
}

.song-grid.is-list .song-card h3 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
}

.song-grid.is-list .song-meta {
    display: none;
}

.song-grid.is-list .playable-badge {
    right: 5px;
    bottom: 5px;
    width: 25px;
    height: 25px;
    font-size: 0.58rem;
}

.song-grid.is-list .favorite-button {
    top: 4px;
    right: 4px;
    width: 27px;
    height: 27px;
    font-size: 0.92rem;
}

.empty-state {
    padding: 72px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.empty-state > div {
    color: rgba(255, 255, 255, 0.18);
    font-size: 3.6rem;
}

.empty-state h2 {
    margin: 15px 0 7px;
}

.empty-state p {
    margin: 0 0 22px;
    color: var(--muted);
}

.song-dialog {
    width: min(960px, calc(100% - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    color: var(--text);
    background: #171b27;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
}

.song-dialog[open] {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
    animation: dialog-in 190ms ease-out;
}

.song-dialog::backdrop {
    background: rgba(4, 6, 10, 0.82);
    backdrop-filter: blur(12px);
}

.admin-dialog {
    width: min(680px, calc(100% - 32px));
    max-height: min(780px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    color: var(--text);
    background: #171b27;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
}

.admin-dialog[open] {
    display: block;
    animation: dialog-in 190ms ease-out;
}

.admin-dialog::backdrop {
    background: rgba(4, 6, 10, 0.82);
    backdrop-filter: blur(12px);
}

.admin-dialog-content {
    padding: 48px 44px 38px;
    overflow-y: auto;
    max-height: min(780px, calc(100vh - 32px));
}

.admin-dialog h2 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3rem);
    letter-spacing: -0.05em;
}

.admin-copy {
    max-width: 560px;
    margin: 14px 0 25px;
    color: var(--muted);
    line-height: 1.6;
}

.upload-picker {
    position: relative;
    display: grid;
    justify-items: start;
    gap: 12px;
    padding: 25px;
    border: 1px dashed rgba(251, 93, 140, 0.35);
    border-radius: 17px;
    background: rgba(251, 93, 140, 0.055);
}

.upload-picker-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

#songFolderInput {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-selection,
.upload-current-file {
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.82rem;
}

.upload-rules {
    display: grid;
    gap: 8px;
    margin: 20px 0 0;
    padding-left: 22px;
    color: #9299aa;
    font-size: 0.8rem;
    line-height: 1.5;
}

.upload-progress {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.upload-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 11px;
    font-size: 0.83rem;
}

.upload-progress-heading span {
    color: var(--accent);
    font-weight: 800;
}

.upload-progress progress {
    display: block;
    width: 100%;
    height: 9px;
    margin-bottom: 11px;
    border: 0;
    border-radius: 99px;
    overflow: hidden;
    background: #282d3d;
}

.upload-progress progress::-webkit-progress-bar {
    background: #282d3d;
}

.upload-progress progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--accent), var(--violet));
}

.upload-progress progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--violet));
}

.upload-summary {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(100, 211, 165, 0.25);
    border-radius: 12px;
    color: #c6f7e1;
    background: rgba(100, 211, 165, 0.07);
    font-size: 0.85rem;
    line-height: 1.55;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 25px;
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
}

.dialog-close {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    color: white;
    background: rgba(10, 12, 18, 0.72);
    backdrop-filter: blur(8px);
    font-size: 1.75rem;
}

.dialog-cover-wrap {
    position: relative;
    align-self: start;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #24293a;
}

.dialog-cover-wrap img,
.dialog-cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dialog-cover-fallback {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    color: rgba(255, 255, 255, 0.2);
    background:
        radial-gradient(circle at 28% 24%, rgba(251, 93, 140, 0.35), transparent 42%),
        linear-gradient(145deg, #30364d, #191d2a);
    font-size: 7rem;
}

.dialog-content {
    min-width: 0;
    padding: 52px 42px 40px;
    overflow-y: auto;
}

.dialog-content h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.dialog-artist {
    margin: 12px 0 20px;
    color: var(--muted);
    font-size: 1.25rem;
}

.song-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 26px;
}

.song-tags span {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    color: #c4c8d3;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.72rem;
    font-weight: 700;
}

.dialog-content audio {
    width: 100%;
    margin: 4px 0 26px;
}

.media-note {
    margin: 0 0 25px;
    padding: 14px;
    border: 1px solid rgba(255, 120, 133, 0.22);
    border-radius: 11px;
    color: #ffabb3;
    background: rgba(255, 120, 133, 0.08);
    font-size: 0.86rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
    margin: 0;
    border-top: 1px solid var(--line);
}

.metadata-grid dt,
.metadata-grid dd {
    min-width: 0;
    margin: 0;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.8rem;
}

.metadata-grid dt {
    color: #777e91;
}

.metadata-grid dd {
    overflow-wrap: anywhere;
    color: #dfe1e8;
    font-weight: 650;
}

.toast {
    position: fixed;
    z-index: 20;
    right: 24px;
    bottom: 24px;
    max-width: min(420px, calc(100% - 48px));
    padding: 14px 17px;
    border: 1px solid rgba(100, 211, 165, 0.3);
    border-radius: 12px;
    color: #c6f7e1;
    background: rgba(24, 49, 40, 0.95);
    box-shadow: var(--shadow);
    font-size: 0.86rem;
}

.toast.is-error {
    border-color: rgba(255, 120, 133, 0.3);
    color: #ffd0d5;
    background: rgba(61, 27, 34, 0.96);
}

@media (max-width: 1120px) {
    .song-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell {
        padding: 0 22px 60px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 56px 0 50px;
    }

    .library-stat {
        display: none;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .song-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .song-dialog[open] {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .dialog-cover-wrap,
    .dialog-cover-fallback {
        aspect-ratio: 1 / 1;
    }

    .dialog-content {
        overflow: visible;
    }

    .admin-dialog-content {
        padding: 40px 28px 30px;
    }
}

@media (max-width: 580px) {
    .app-shell {
        padding-inline: 15px;
    }

    .login-shell {
        padding: 15px;
    }

    .login-card {
        padding: 34px 25px;
    }

    .topbar {
        min-height: 74px;
    }

    .brand small,
    .button-quiet {
        display: none;
    }

    .topbar-actions {
        gap: 5px;
    }

    .topbar-language select {
        width: 58px;
    }

    .button-admin {
        width: 40px;
        min-width: 40px;
        padding: 0;
    }

    .button-admin span:last-child {
        display: none;
    }

    .brand strong {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero {
        padding: 46px 0 40px;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 15vw, 4.6rem);
    }

    .hero-copy {
        font-size: 0.9rem;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .button-filter {
        min-height: 46px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-footer,
    .library-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .library-heading {
        gap: 9px;
        margin-top: 42px;
    }

    .library-heading-actions {
        width: 100%;
        justify-content: space-between;
    }

    .song-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 11px;
    }

    .song-grid.is-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .song-grid.is-list .song-card {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 72px;
        padding: 6px;
    }

    .song-grid.is-list .song-cover {
        width: 58px;
        height: 58px;
    }

    .song-grid.is-list .song-card-body {
        gap: 5px;
        padding: 0 9px;
    }

    .song-grid.is-list .song-artist {
        max-width: 40%;
        font-size: 0.72rem;
    }

    .song-grid.is-list .song-card h3 {
        font-size: 0.9rem;
    }

    .favorite-button {
        opacity: 1;
    }

    .song-card-body {
        padding-top: 10px;
    }

    .song-dialog {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 19px;
    }

    .dialog-content {
        padding: 35px 22px 28px;
    }

    .admin-dialog {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 19px;
    }

    .admin-dialog-content {
        max-height: calc(100vh - 16px);
        padding: 36px 20px 24px;
    }

    .upload-picker {
        padding: 20px;
    }

    .admin-actions {
        flex-direction: column-reverse;
    }

    .admin-actions .button {
        width: 100%;
    }

    .dialog-content h2 {
        font-size: 2.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
