/*
------------------------------------------------------------------------------------
 themes, dark is the default (see data-theme on the html element)
------------------------------------------------------------------------------------
*/

:root,
:root[data-theme="dark"] {
    --bg: #0B0C10;
    --bg-raised: #101217;
    --surface: #15181E;
    --surface-hover: #1B1F27;
    --surface-active: #222733;
    --border: #232733;
    --border-strong: #313746;
    --text: #C9CCD3;
    --text-strong: #F2F3F5;
    --text-muted: #8C92A0;
    --text-faint: #5F6573;
    --accent: #FF9F43;
    --accent-strong: #FFB566;
    --accent-text: #FFB566;
    --accent-soft: rgba(255, 159, 67, 0.14);
    --accent-gradient: linear-gradient(135deg, #FFC266 0%, #FF6A3D 100%);
    --on-accent: #1A0E06;
    --error: #FF7070;
    --error-soft: rgba(255, 112, 112, 0.12);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
    --glass: rgba(16, 18, 23, 0.82);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #F6F7F9;
    --bg-raised: #FFFFFF;
    --surface: #FFFFFF;
    --surface-hover: #F0F2F5;
    --surface-active: #E7EAF0;
    --border: #E3E6EB;
    --border-strong: #CDD2DA;
    --text: #3A3F4A;
    --text-strong: #111318;
    --text-muted: #636A78;
    --text-faint: #99A0AC;
    --accent: #F28A1F;
    --accent-strong: #E07410;
    --accent-text: #B4560A;
    --accent-soft: rgba(242, 138, 31, 0.12);
    --accent-gradient: linear-gradient(135deg, #FFB24D 0%, #F2602F 100%);
    --on-accent: #1A0E06;
    --error: #C62828;
    --error-soft: rgba(198, 40, 40, 0.08);
    --shadow: 0 16px 40px rgba(17, 19, 24, 0.12), 0 2px 6px rgba(17, 19, 24, 0.06);
    --glass: rgba(255, 255, 255, 0.86);
    color-scheme: light;
}

:root {
    --sidebar-width: 240px;
    --topbar-height: 68px;
    --player-height: 84px;
    --radius: 10px;
    --radius-small: 7px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
------------------------------------------------------------------------------------
 base
------------------------------------------------------------------------------------
*/

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, p, ul, form {
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

a {
    color: var(--accent-text);
    text-decoration: none;
}

button, input, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

svg {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.invisible, #csrf_token {
    display: none;
}

input[type=text], input[type=password], input[type=search], select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    color: var(--text-strong);
    background-color: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type=text]:focus, input[type=password]:focus, input[type=search]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px;
    font-weight: 600;
    color: var(--on-accent);
    background: var(--accent-gradient);
    border: 0;
    border-radius: var(--radius-small);
    transition: filter 0.15s, transform 0.1s;
}

.button:hover {
    filter: brightness(1.08);
}

.button:active {
    transform: translateY(1px);
}

.button.secondary {
    color: var(--text-strong);
    background: var(--surface-hover);
    border: 1px solid var(--border-strong);
}

.iconButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-small);
    transition: color 0.15s, background-color 0.15s;
}

.iconButton:hover {
    color: var(--text-strong);
    background-color: var(--surface-hover);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.brand .logo {
    width: 32px;
    height: 32px;
    stroke: none;
}

/*
------------------------------------------------------------------------------------
 layout: sidebar, top bar, content and the player bar at the bottom
------------------------------------------------------------------------------------
*/

body.app {
    padding-left: var(--sidebar-width);
    padding-bottom: calc(var(--player-height) + env(safe-area-inset-bottom));
}

#sidebar {
    position: fixed;
    top: 0;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom));
    left: 0;
    z-index: 300;
    width: var(--sidebar-width);
    padding: 22px 14px;
    overflow-y: auto;
    background-color: var(--bg-raised);
    border-right: 1px solid var(--border);
}

#sidebar .brand {
    padding: 0 10px 26px;
}

#sidebar h2 {
    margin: 18px 12px 8px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

#sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#sidebar a.loadList {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 12px;
    font-weight: 550;
    color: var(--text-muted);
    border-radius: var(--radius-small);
    transition: color 0.15s, background-color 0.15s;
}

#sidebar a.loadList:hover {
    color: var(--text-strong);
    background-color: var(--surface-hover);
}

#sidebar li.active a.loadList {
    color: var(--text-strong);
    background-color: var(--surface-active);
}

#sidebar li.active a.loadList svg {
    color: var(--accent);
}

#topbar {
    position: sticky;
    top: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-height);
    padding: 0 32px;
    background-color: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

#searchform {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 520px;
}

#searchform .searchIcon {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 18px;
    color: var(--text-faint);
    pointer-events: none;
}

#searchform input.searchterm {
    height: 42px;
    padding: 0 46px 0 40px;
    background-color: var(--surface);
    border-color: var(--border);
    border-radius: 999px;
}

#searchform input.searchterm::-webkit-search-cancel-button {
    display: none;
}

#searchoptions {
    position: absolute;
    right: 5px;
    border-radius: 999px;
}

#profile {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    margin-left: auto;
    padding: 0 10px 0 5px;
    font-weight: 550;
    color: var(--text-strong);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background-color 0.15s;
}

#profile:hover {
    background-color: var(--surface-hover);
}

#profile .avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    font-size: 13px;
    font-weight: 700;
    color: var(--on-accent);
    background: var(--accent-gradient);
    border-radius: 50%;
}

#profile .chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

#main {
    padding: 28px 32px 40px;
    /* never widen the page, "clip" keeps the sticky table header working */
    overflow-x: clip;
}

/*
------------------------------------------------------------------------------------
 popovers: advanced search and account menu
------------------------------------------------------------------------------------
*/

.popover {
    display: none;
    position: fixed;
    z-index: 400;
    padding: 16px;
    background-color: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#searchdetails {
    top: calc(var(--topbar-height) - 8px);
    left: calc(var(--sidebar-width) + 32px);
    width: min(400px, calc(100vw - 32px));
}

#searchdetails label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

#searchdetails .option {
    flex: 1;
    min-width: 0;
    margin-bottom: 14px;
}

#searchdetails .optionRow {
    display: flex;
    gap: 12px;
}

#searchdetails .actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

#accountoptions {
    top: calc(var(--topbar-height) - 8px);
    right: 32px;
    width: 220px;
    padding: 8px;
}

#accountoptions h2 {
    padding: 10px 10px 6px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

#accountoptions a, #accountoptions .linkbutton {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    font-weight: 500;
    text-align: left;
    color: var(--text);
    background: none;
    border: 0;
    border-radius: var(--radius-small);
}

#accountoptions a:hover, #accountoptions .linkbutton:hover {
    color: var(--text-strong);
    background-color: var(--surface-hover);
}

#accountoptions li.active a {
    color: var(--text-strong);
}

#accountoptions li.active a::after {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
}

#accountoptions .menuFooter {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/*
------------------------------------------------------------------------------------
 lists
------------------------------------------------------------------------------------
*/

.listHeader {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
}

.listHeader h1 {
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.listHeader .searchSummary {
    overflow: hidden;
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

#main table.list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

#main table.list th {
    position: sticky;
    top: var(--topbar-height);
    z-index: 10;
    height: 38px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-faint);
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
}

#main table.list th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

#main table.list th[data-sort]:hover {
    color: var(--text-strong);
}

#main table.list th.sort_asc, #main table.list th.sort_desc {
    color: var(--accent-text);
}

#main table.list th.sort_asc::after {
    content: " ↑";
}

#main table.list th.sort_desc::after {
    content: " ↓";
}

#main table.list th.options {
    width: 92px;
}

#main table.list th.song_title, #main table.list th.favourite_title {
    width: 28%;
}

#main table.list th.song_artist, #main table.list th.favourite_artist {
    width: 20%;
}

#main table.list th.song_album, #main table.list th.favourite_album {
    width: 20%;
}

#main table.list th.favourite_added {
    width: 210px;
}

#main table.list th.song_year {
    width: 8%;
}

#main table.list th.song_length {
    width: 8%;
}

#main table.list th.song_genre, #main table.list th.favourite_genre {
    width: 12%;
}

#main table.list td {
    height: 52px;
    padding: 0 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.12s;
}

#main table.list tbody tr:hover td {
    background-color: var(--surface-hover);
}

#main table.list tbody tr:hover td:first-child {
    border-radius: var(--radius-small) 0 0 var(--radius-small);
}

#main table.list tbody tr:hover td:last-child {
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

#main table.list td.filter {
    cursor: pointer;
}

#main table.list td.filter:hover {
    color: var(--accent-text);
}

/* the first text column is the song title, or the name in artist/album/... lists */
#main table.list td.filter:first-child,
#main table.list td.actions + td.filter {
    font-weight: 600;
    color: var(--text-strong);
}

#main table.list td.filter:first-child:hover,
#main table.list td.actions + td.filter:hover {
    color: var(--accent-text);
}

#main table.list td .subline {
    display: none;
}

#main table.list td.muted {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

#main table.list td.actions {
    overflow: visible;
}

.toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    vertical-align: middle;
    color: var(--text-faint);
    background: transparent;
    border: 0;
    border-radius: 50%;
    transition: color 0.15s, background-color 0.15s, transform 0.1s;
}

.toggle:hover {
    color: var(--text-strong);
    background-color: var(--surface-active);
}

.toggle:active {
    transform: scale(0.92);
}

.toggle svg {
    width: 18px;
    height: 18px;
}

.toggle.active {
    color: var(--accent);
}

.toggle.vote.active {
    background-color: var(--accent-soft);
}

.toggle.favourite.active svg {
    fill: currentColor;
}

.votePill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
    background-color: var(--accent-soft);
    border-radius: 999px;
}

.votePill.autoplay {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--surface-active);
}

#main table.list td div.voteTooltip {
    display: none;
    position: fixed;
    z-index: 400;
    min-width: 140px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-strong);
    background-color: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
}

#main div.noContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 80px 20px;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
}

#main div.noContent svg {
    width: 44px;
    height: 44px;
    padding: 10px;
    color: var(--text-faint);
    background-color: var(--surface);
    border-radius: 50%;
    box-sizing: content-box;
}

/*
------------------------------------------------------------------------------------
 player bar
------------------------------------------------------------------------------------
*/

#nowPlaying {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 350;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    height: calc(var(--player-height) + env(safe-area-inset-bottom));
    padding: 0 24px env(safe-area-inset-bottom);
    background-color: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--border);
}

/* thin progress line along the top, only shown on small screens */
#nowPlaying .npProgress {
    display: none;
    position: absolute;
    top: -1px;
    right: 0;
    left: 0;
    height: 2px;
}

.npTrack {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.cover {
    --hue: 28;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: none;
    font-size: 22px;
    font-weight: 750;
    color: rgba(255, 255, 255, 0.92);
    background: linear-gradient(135deg, hsl(var(--hue) 85% 62%), hsl(calc(var(--hue) + 45) 70% 38%));
    border-radius: var(--radius-small);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover img[hidden] {
    display: none;
}

#nowPlaying.idle .cover {
    background: var(--surface-active);
    box-shadow: none;
}

.npText {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.npText > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.npLabel {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.songTitle {
    font-size: 15px;
    font-weight: 650;
    color: var(--text-strong);
}

.songArtist {
    font-size: 13px;
    color: var(--text-muted);
}

.equalizer {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 11px;
}

.equalizer i {
    width: 3px;
    height: 100%;
    background-color: var(--accent);
    border-radius: 1px;
    transform-origin: bottom;
    animation: equalizer 0.9s ease-in-out infinite alternate;
}

.equalizer i:nth-child(2) {
    animation-delay: -0.3s;
}

.equalizer i:nth-child(3) {
    animation-delay: -0.6s;
}

#nowPlaying.listening .equalizer {
    display: inline-flex;
}

#nowPlaying.listening .npLabel {
    color: var(--accent-text);
}

@keyframes equalizer {
    from { transform: scaleY(0.25); }
    to { transform: scaleY(1); }
}

.npControls {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

#listen {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    padding: 0;
    color: var(--on-accent);
    background: var(--accent-gradient);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(255, 122, 61, 0.35);
    transition: transform 0.12s, filter 0.15s;
}

#listen:hover {
    filter: brightness(1.08);
    transform: scale(1.05);
}

#listen:active {
    transform: scale(0.96);
}

#listen svg {
    grid-area: 1 / 1;
    width: 22px;
    height: 22px;
    fill: currentColor;
    stroke: none;
}

#listen .iconStop, #listen.playing .iconPlay {
    display: none;
}

#listen.playing .iconStop {
    display: block;
}

#skip {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

#skip[hidden] {
    display: none;
}

#skip:hover {
    color: var(--text-strong);
    background-color: var(--surface-hover);
}

#skip.active {
    color: var(--accent);
    background-color: var(--accent-soft);
    border-color: transparent;
}

#skip svg {
    width: 18px;
    height: 18px;
}

#skip svg path:first-child {
    fill: currentColor;
}

#skip .skipCount:not(:empty) {
    position: absolute;
    top: -6px;
    right: -10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--on-accent);
    background: var(--accent-gradient);
    border-radius: 999px;
}

.npTime {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.npBar {
    position: relative;
    flex: 1;
    height: 4px;
    overflow: hidden;
    background-color: var(--surface-active);
    border-radius: 999px;
}

.npBar .fill, .npProgress .fill {
    width: 0;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: inherit;
    transition: width 1s linear;
}

.npSide {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    min-width: 0;
}

.npVotes {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.volume {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    color: var(--text-muted);
}

#volume {
    width: 96px;
    accent-color: var(--accent);
    cursor: pointer;
}

/*
------------------------------------------------------------------------------------
 login
------------------------------------------------------------------------------------
*/

body.loginPage {
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(255, 159, 67, 0.16), transparent 60%),
        radial-gradient(700px 500px at 110% 110%, rgba(255, 106, 61, 0.12), transparent 60%),
        var(--bg);
}

.loginCard {
    width: 100%;
    max-width: 380px;
    padding: 36px 32px;
    background-color: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.loginCard .brand {
    margin-bottom: 28px;
}

.loginCard h1 {
    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.loginCard .tagline {
    margin: 4px 0 24px;
    color: var(--text-muted);
}

.loginCard label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.loginCard input[type=text], .loginCard input[type=password] {
    margin-bottom: 16px;
}

.loginCard .button {
    width: 100%;
    margin-top: 4px;
}

.loginCard p.login_error {
    margin-bottom: 16px;
    padding: 10px 12px;
    color: var(--error);
    background-color: var(--error-soft);
    border-radius: var(--radius-small);
}

.loginSeparator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-faint);
}

.loginSeparator::before, .loginSeparator::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.loginCard div.login {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.loginCard div.login img {
    display: block;
    border-radius: var(--radius-small);
}

/*
------------------------------------------------------------------------------------
 user management
------------------------------------------------------------------------------------
*/

body.managePage {
    padding: 0 16px 48px;
}

.manageHeader, .manageMain {
    max-width: 820px;
    margin: 0 auto;
}

.manageHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 10px;
}

.backLink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 550;
    color: var(--text-muted);
}

.backLink:hover {
    color: var(--text-strong);
}

.backLink svg {
    width: 18px;
    height: 18px;
}

.manageMain h1 {
    margin: 24px 0 20px;
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.notice {
    margin-bottom: 16px;
    padding: 10px 14px;
    color: var(--text-strong);
    background-color: var(--accent-soft);
    border-radius: var(--radius-small);
}

.notice.error {
    color: var(--error);
    background-color: var(--error-soft);
}

.panel {
    margin-bottom: 20px;
    background-color: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}

.panel summary::-webkit-details-marker {
    display: none;
}

.addUser > summary {
    font-weight: 650;
    color: var(--accent-text);
}

.addUser > .manageForm {
    padding: 4px 18px 18px;
}

.userRow + .userRow {
    border-top: 1px solid var(--border);
}

.userRow > summary:hover {
    background-color: var(--surface-hover);
}

.userRow:first-child > summary {
    border-radius: var(--radius) var(--radius) 0 0;
}

.userRow .avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    font-weight: 700;
    color: var(--on-accent);
    background: var(--accent-gradient);
    border-radius: 50%;
}

.userRow .who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.userRow .who strong {
    font-weight: 600;
    color: var(--text-strong);
}

.userRow .who span {
    font-size: 13px;
    color: var(--text-muted);
}

.badges {
    display: flex;
    gap: 6px;
    margin-right: auto;
}

.badge {
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    background-color: var(--surface-active);
    border-radius: 999px;
}

.badge.accent {
    color: var(--accent-text);
    background-color: var(--accent-soft);
}

.badge.muted {
    color: var(--error);
    background-color: var(--error-soft);
}

.lastLogin {
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-muted);
}

.userRow .chevron {
    width: 18px;
    height: 18px;
    color: var(--text-faint);
    transition: transform 0.15s;
}

.userRow[open] .chevron {
    transform: rotate(180deg);
}

.userPanel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 28px;
    padding: 8px 18px 22px 66px;
}

.manageForm h2 {
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.manageForm .field {
    margin-bottom: 14px;
}

.manageForm .field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.manageForm .field.checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.manageForm input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    flex: none;
    accent-color: var(--accent);
}

.manageForm .field.checkbox .help {
    padding-left: 28px;
}

.manageForm .help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.manageForm .help ul {
    padding-left: 16px;
    list-style: disc;
}

.manageForm .invalid input {
    border-color: var(--error);
}

.formError {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--error);
}

.manageForm .actions {
    display: flex;
    gap: 10px;
}

.button.dangerButton {
    color: #FFFFFF;
    background: #D93A3A;
}

/*
------------------------------------------------------------------------------------
 small screens
------------------------------------------------------------------------------------
*/

@media (max-width: 1100px) {
    #main table.list [data-hide="lg"] {
        display: none;
    }

    #nowPlaying {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    }

    .npVotes {
        display: none;
    }
}

@media (max-width: 860px) {
    :root {
        --topbar-height: 60px;
        --player-height: 72px;
    }

    body.app {
        padding-left: 0;
    }

    #sidebar {
        position: static;
        width: auto;
        padding: 14px 16px 10px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    #sidebar .brand {
        padding: 0 0 12px;
        font-size: 18px;
    }

    #sidebar .brand .logo {
        width: 28px;
        height: 28px;
    }

    #sidebar h2 {
        display: none;
    }

    #sidebar nav {
        display: flex;
        gap: 6px;
        margin: 0 -16px;
        padding: 0 16px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    #sidebar nav::-webkit-scrollbar {
        display: none;
    }

    #sidebar ul {
        flex-direction: row;
        gap: 6px;
    }

    #sidebar a.loadList {
        height: 34px;
        padding: 0 12px;
        gap: 8px;
        white-space: nowrap;
        background-color: var(--surface);
        border: 1px solid var(--border);
        border-radius: 999px;
    }

    #sidebar a.loadList svg {
        width: 16px;
        height: 16px;
    }

    #topbar {
        padding: 0 16px;
        gap: 10px;
    }

    #profile .username, #profile .chevron {
        display: none;
    }

    #profile {
        padding: 0 4px;
    }

    #searchdetails {
        left: 16px;
    }

    #accountoptions {
        right: 16px;
    }

    .userPanel {
        padding-left: 18px;
    }

    .lastLogin {
        display: none;
    }

    #main {
        padding: 20px 8px 32px;
    }

    .listHeader {
        padding: 0 8px;
    }

    .listHeader h1 {
        font-size: 24px;
    }

    #main table.list [data-hide="md"] {
        display: none;
    }

    #main table.list th.options {
        width: 80px;
    }

    #main table.list td {
        height: 58px;
        padding: 0 8px;
    }

    #main table.list th.song_title, #main table.list th.favourite_title {
        width: auto;
    }

    /* votes, the only other column left in the queue */
    #main table.list th.favourite_genre {
        width: 72px;
    }

    #main table.list td .primary, #main table.list td .subline {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #main table.list td .subline {
        font-size: 13px;
        font-weight: 400;
        color: var(--text-muted);
    }

    #nowPlaying {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 0 16px env(safe-area-inset-bottom);
    }

    #nowPlaying .npProgress {
        display: block;
    }

    .npTime, .npSide {
        display: none;
    }

    .npControls {
        grid-column: 2;
        grid-row: 1;
    }

    .cover {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .npLabel {
        display: none;
    }

    #nowPlaying.listening .npLabel {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
