:root {
    --accent: #8b5cf6;
    --bg: #08090b;
    --panel: #111317;
    --panel2: #171a20;
    --line: #292d35;
    --text: #f5f6f8;
    --muted: #8d95a3;
    --danger: #ef476f;
    --success: #31c48d;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: dark
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh
}

button,
input,
select {
    font: inherit
}

button,
a {
    color: inherit
}

a {
    color: var(--accent)
}

h1,
h2,
p {
    margin-top: 0
}

h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1
}

h2 {
    font-size: 1.2rem
}

.muted,
small {
    color: var(--muted)
}

.eyebrow {
    color: var(--accent);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .18em
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px
}

.admin-grid .card {
    scroll-margin-top: 20px
}

.admin-grid .card:focus {
    outline: 2px solid color-mix(in srgb, var(--accent), transparent 30%);
    outline-offset: 3px
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel2);
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.button.small {
    padding: 8px 13px;
    font-size: .8rem
}

.alert {
    padding: 14px 18px;
    border-radius: 14px;
    margin: 16px 0
}

.alert.error {
    background: #3a151d;
    color: #ffb7c7;
    border: 1px solid #7a2639
}

.alert.success {
    background: #0d3529;
    color: #9cf1cf;
    border: 1px solid #176246
}

.hidden {
    display: none !important
}

label {
    display: grid;
    gap: 7px;
    margin: 16px 0;
    color: #d8dbe1;
    font-weight: 700
}

input,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #3b404a;
    border-radius: 12px;
    background: #090a0c;
    color: var(--text)
}

input:focus,
select:focus {
    outline: 2px solid color-mix(in srgb, var(--accent), transparent 35%);
    border-color: var(--accent)
}

code {
    color: #ff8ac1
}

.install-shell {
    width: min(950px, calc(100% - 32px));
    margin: 60px auto 100px
}

.installer form {
    display: grid;
    gap: 20px
}

.requirements .pill {
    display: inline-block;
    margin: 5px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid
}

.pill.ok {
    color: #8ef0c5;
    background: #0c2e24;
    border-color: #166b4a
}

.pill.bad {
    color: #ff9aae;
    background: #38121a;
    border-color: #7d2336
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px
}

.login-shell {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    width: min(900px, 100%);
    border: 1px solid var(--line);
    border-radius: 30px;
    overflow: hidden
}

.brand-panel {
    padding: 70px 50px;
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--accent), transparent 55%), transparent 60%), var(--panel)
}

.login-card {
    border: 0;
    border-radius: 0;
    padding: 50px
}

.app-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: calc(100vh - 100px)
}

.sidebar {
    position: sticky;
    top: 0;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    background: #0b0c0f;
    border-right: 1px solid var(--line);
    overflow: auto
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 12px 38px
}

.logo span {
    color: var(--accent)
}

.sidebar-label {
    margin: 0 12px 12px;
    color: var(--muted);
    font-size: .7rem;
    letter-spacing: .14em;
    font-weight: 800
}

.nav-item {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 14px;
    padding: 13px 15px;
    margin: 3px 0;
    text-decoration: none;
    text-align: left;
    color: #b7bdc8;
    cursor: pointer
}

.nav-item:hover,
.nav-item.active {
    background: color-mix(in srgb, var(--accent), transparent 84%);
    color: #fff
}

.nav-item.active {
    box-shadow: inset 3px 0 var(--accent)
}

.sidebar-spacer {
    flex: 1
}

.sidebar footer {
    border-top: 1px solid var(--line);
    margin-top: 20px;
    padding: 20px 12px 0;
    color: #737b88;
    font-size: .72rem;
    line-height: 1.7
}

.sidebar footer>span {
    color: #a5aab3
}



.sugacoma i {
    font-style: normal;
    font-weight: 800
}

.sugacoma i:nth-child(1) {
    color: #FF48FF;
}

.sugacoma i:nth-child(2) {
    color: #88A0A0
}

.sugacoma i:nth-child(3) {
    color: #C0D098
}

.sugacoma i:nth-child(4) {
    color: #FF60FF
}

.content {
    padding: 42px clamp(22px, 4vw, 64px) 150px;
    min-width: 0
}

.content header,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.user-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 15px
}

.mobile-menu {
    display: none
}

.mobile-menu-close,
.mobile-drawer-backdrop {
    display: none
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: auto;
    margin: 22px 0
}

.breadcrumbs button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 5px;
    white-space: nowrap;
    cursor: pointer
}

.breadcrumbs button:hover {
    color: #fff
}

.browser h2 {
    margin: 32px 0 14px
}

.count {
    color: var(--muted);
    font-size: .8rem
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 75px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    text-align: left;
    cursor: pointer
}

.folder-art {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--panel2)
}

.folder-art>span {
    font-size: 1.4rem;
    color: var(--accent)
}

.folder-art img,
.now-playing .cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .18s ease
}

.folder-art.loaded img,
.now-playing .cover.loaded img {
    opacity: 1
}

.folder-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px)
}

.track-list {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden
}

.track-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 42px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line)
}

.track-row:last-child {
    border: 0
}

.track-row strong,
.track-row small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.track-play,
.favorite,
.icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--panel2);
    cursor: pointer
}

.track-play:hover {
    background: var(--accent)
}

.track-play.current {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 78%)
}

.favorite {
    color: #616875
}

.favorite.active {
    color: #ff4f86
}

.format {
    font-size: .68rem;
    color: var(--muted)
}

.empty-state,
.loading {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 55vh;
    color: var(--muted)
}

.empty-state span {
    font-size: 4rem;
    color: var(--accent)
}

.empty-state h2 {
    color: #fff;
    margin: 12px 0
}

.player-bar {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: #101216ef;
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 2fr) 50px;
    align-items: center;
    gap: 20px;
    padding: 14px 28px
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0
}

.now-playing .cover {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #222)
}

.now-playing>div:last-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden
}

.now-playing strong,
.now-playing span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.now-playing span {
    color: var(--muted);
    font-size: .8rem;
    margin-top: 4px
}

.now-playing .scroll-once {
    overflow: visible;
    text-overflow: clip;
    animation: now-playing-scroll-once var(--scroll-duration, 5s) linear 1 1s forwards;
    will-change: transform
}

@keyframes now-playing-scroll-once {
    from {
        transform: translateX(0)
    }

    to {
        transform: translateX(calc(-1 * var(--scroll-distance, 0px)))
    }
}

@media(prefers-reduced-motion:reduce) {
    .now-playing .scroll-once {
        animation: none
    }
}

audio {
    width: 100%
}

.admin-page {
    padding: 32px
}

.admin-header {
    max-width: 1200px;
    margin: auto
}

.admin-grid {
    max-width: 1200px;
    margin: 25px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.wide {
    grid-column: 1/-1
}

.table {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid var(--line)
}

.table-row:last-child {
    border: 0
}

.table-row small {
    display: block;
    margin-top: 3px;
    word-break: break-all
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: end;
    gap: 15px;
    margin-top: 20px
}

.inline-form label {
    margin: 0
}

.check {
    display: flex;
    align-items: center
}

.check input {
    width: auto
}

.admin-grid form {
    margin-bottom: 5px
}

#library-order-fields {
width: 100%;
margin-top:10px

}

.update-heading,
.update-actions,
.update-counts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap
}

.update-heading .pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: capitalize
}

.update-repository {
    grid-template-columns: minmax(220px, 1fr) auto
}

.update-actions,
.update-counts,
.install-update-form {
    margin-top: 18px
}

.update-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    margin-top: 22px
}

.update-summary>div {
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0b0c0f
}

.update-summary span {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em
}

.status-pill.safe,
.status-pill.already_current {
    color: #9cf1cf;
    border-color: #176246;
    background: #0d3529
}

.status-pill.conflict {
    color: #ffb7c7;
    border-color: #7a2639;
    background: #3a151d
}

.status-pill.local {
    color: #ffe19a;
    border-color: #705817;
    background: #34290e
}

.update-table {
    margin-top: 16px;
    max-height: 430px;
    overflow: auto
}

.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
}

.library-jump {
    position: relative;
    margin: 10px 10px 0
}

.library-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #090a0c;
    color: var(--muted)
}

.library-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 75%)
}

.library-search-box input {
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: .82rem
}

.library-search-results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: min(390px, 52vh);
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #101216;
    box-shadow: 0 18px 45px #000b
}

.library-search-results button {
    display: block;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer
}

.library-search-results button:hover,
.library-search-results button:focus {
    background: color-mix(in srgb, var(--accent), transparent 82%);
    outline: 0
}

.library-search-results strong,
.library-search-results span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.library-search-results span,
.library-search-results p {
    color: var(--muted);
    font-size: .7rem
}

.library-search-results p {
    margin: 0;
    padding: 12px
}

@media(max-width:760px) {
    body.mobile-drawer-open {
        position: fixed;
        width: 100%;
        overflow: hidden;
        touch-action: none
    }

    .login-shell {
        grid-template-columns: 1fr
    }

    .brand-panel {
        padding: 38px 28px
    }

    .login-card {
        padding: 32px 25px
    }

    .app-shell {
        grid-template-columns: 1fr;
        min-height: 100dvh
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100dvh;
        width: 270px;
        max-width: calc(100vw - 42px);
        padding-top: max(28px, calc(16px + env(safe-area-inset-top)));
        padding-bottom: max(28px, calc(16px + env(safe-area-inset-bottom)));
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
        box-shadow: 18px 0 45px #0009
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        transition-delay: 0s
    }

    .sidebar .logo {
        padding-right: 42px
    }

    .mobile-menu-close {
        position: absolute;
        top: max(16px, env(safe-area-inset-top));
        right: 14px;
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 50%;
        background: var(--panel2);
        color: var(--text);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer
    }

    .mobile-drawer-backdrop {
        position: fixed;
        z-index: 29;
        inset: 0;
        display: block;
        border: 0;
        background: #0009;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility 0s linear .2s
    }

    .mobile-drawer-backdrop.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s
    }

    .mobile-menu {
        position: fixed;
        z-index: 28;
        top: max(12px, env(safe-area-inset-top));
        left: 12px;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #101216e8;
        box-shadow: 0 8px 24px #0008;
        backdrop-filter: blur(14px)
    }

    .content {
        padding: 24px 18px calc(180px + env(safe-area-inset-bottom))
    }

    .content>header {
        padding-left: 56px
    }

    .player-bar {
        left: 10px;
        right: 10px;
        bottom: calc(-2px + env(safe-area-inset-bottom));
        width: auto;
        height: 140px;
        grid-template-columns: 1fr 40px;
        padding: 10px 14px;
        border: 1px solid var(--line);
        border-radius: 20px;
        overflow: hidden
    }

    .player-bar audio {
        grid-column: 1/-1;
        grid-row: 2;
        padding-bottom: 20px
    }

    .admin-page {
        padding: 18px
    }

    .admin-grid {
        grid-template-columns: 1fr
    }

    .inline-form {
        grid-template-columns: 1fr
    }

    .wide {
        grid-column: auto
    }
}
