:root {
  color-scheme: dark;
  --page: #0a0a0b;
  --nav: #0d0d0e;
  --panel: #111113;
  --nested: #161618;
  --raised: #1b1b1e;
  --line: #222226;
  --line-strong: #303036;
  --text: #ececee;
  --muted: #9b9ba3;
  --dim: #6b6b73;
  --accent: #e8763c;
  --accent-2: #f2a477;
  --accent-soft: rgba(232, 118, 60, .1);
  --accent-line: rgba(232, 118, 60, .4);
  --accent-ink: #1a0c04;
  --online: #3fb950;
  --online-soft: rgba(63, 185, 80, .1);
  --warn: #d29922;
  --danger: #f2615a;
  --danger-soft: rgba(242, 97, 90, .1);
  --radius: 8px;
  --radius-sm: 6px;
  --mono: 'Cascadia Mono', 'JetBrains Mono', Consolas, ui-monospace, monospace;
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--text); overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(232, 118, 60, .35); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.01em; font-weight: 600; }
h2 { font-size: .95rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: .95rem; line-height: 1.3; font-weight: 600; }
small { color: var(--dim); }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.technical { font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26262a; border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #34343a; }
::-webkit-scrollbar-track { background: transparent; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 36px; padding: .45rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--raised); font-size: .86rem; font-weight: 550; text-align: center; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .08s; }
.button:active:enabled { transform: translateY(1px); }
.button:hover:enabled { background: #232327; border-color: #3a3a41; }
.button.primary { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); font-weight: 600; }
.button.primary:hover:enabled { background: #f0844d; border-color: #f0844d; }
.button.ghost { background: transparent; border-color: var(--line); }
.button.ghost:hover:enabled { background: var(--nested); border-color: var(--line-strong); }
.button.danger { color: var(--danger); }
.button.danger:hover:enabled { background: var(--danger-soft); border-color: rgba(242, 97, 90, .35); }
.button.compact { min-height: 32px; padding: .32rem .65rem; font-size: .82rem; }
.button.icon-button { min-width: 32px; padding-inline: .45rem; }
.button.icon-button .icon { width: 16px; height: 16px; }
.button.round { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.button.round.primary { width: 44px; height: 44px; }
.button.round.primary .icon { width: 18px; height: 18px; }
.button.wide { width: 100%; min-height: 40px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }

/* Brand */
.wordmark { display: flex; gap: .65rem; align-items: center; font-size: 1rem; line-height: 1.1; font-weight: 700; white-space: nowrap; }
.wordmark small { display: block; margin-top: .2rem; color: var(--dim); font-size: .72rem; font-weight: 400; }
.wordmark.large { font-size: 1.2rem; justify-content: center; }
.brand-mark { flex: none; display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 30px; height: 30px; padding: 7px 7px; border-radius: 6px; background: var(--accent); }
.brand-mark i { display: block; width: 3px; border-radius: 1px; background: var(--accent-ink); height: 40%; transform-origin: bottom; }
.brand-mark i:nth-child(2) { height: 85%; }
.brand-mark i:nth-child(3) { height: 60%; }
.brand-mark i:nth-child(4) { height: 100%; }
.brand-mark.big { width: 48px; height: 48px; padding: 12px 11px; gap: 4px; border-radius: 10px; }
.brand-mark.big i { width: 4px; }
.brand-mark.big i, body.is-playing .sidebar .brand-mark i { animation: bar 1s ease-in-out infinite; }

/* Playing indicator */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { display: block; width: 2px; height: 100%; border-radius: 1px; background: currentColor; transform-origin: bottom; animation: bar 1s ease-in-out infinite; }
.eq i:nth-child(2), .brand-mark i:nth-child(2) { animation-delay: -.3s; animation-duration: 1.15s; }
.eq i:nth-child(3), .brand-mark i:nth-child(3) { animation-delay: -.55s; animation-duration: .85s; }
.eq i:nth-child(4), .brand-mark i:nth-child(4) { animation-delay: -.15s; }
@keyframes bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* Auth */
.auth { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 1.25rem; }
.auth-box { display: grid; gap: 1.5rem; width: min(100%, 370px); }
.auth-card { display: grid; gap: 1rem; padding: clamp(1.2rem, 5vw, 1.6rem); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.auth-heading { display: grid; gap: .35rem; }
.auth-heading h1 { font-size: 1.15rem; }
.auth-heading p { font-size: .86rem; }
.loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); font-size: .88rem; }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 1.4rem; padding: 18px 12px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--nav); border-right: 1px solid var(--line); z-index: 6; }
.sidebar .wordmark { padding: 0 .45rem; }
.sidebar nav, .sidebar-bots { display: grid; align-content: start; gap: 1px; }
.sidebar button:not(.button) { position: relative; display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .6rem; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; text-align: left; font-size: .86rem; font-weight: 500; transition: color .15s, background .15s; }
.sidebar nav .icon { width: 16px; height: 16px; color: var(--dim); }
.sidebar button:not(.button):hover { color: var(--text); background: var(--nested); }
.sidebar nav button::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); transform: scaleY(0); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.sidebar nav button[aria-current="page"] { color: var(--text); background: var(--raised); }
.sidebar nav button[aria-current="page"]::before { transform: scaleY(1); }
.sidebar nav button[aria-current="page"] .icon { color: var(--accent); }
.sidebar-bots h2 { display: flex; justify-content: space-between; align-items: center; padding: 0 .6rem .4rem; color: var(--dim); font-size: .72rem; font-weight: 600; }
.sidebar-bots h2 span { font-variant-numeric: tabular-nums; font-weight: 500; }
.sidebar-bots p { margin: .15rem .6rem; font-size: .8rem; }
.sidebar .bot-link { min-width: 0; padding-block: .42rem; }
.bot-link[aria-current="true"] { color: var(--text); background: var(--nested); }
.bot-link-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-glyph { flex: none; display: grid; place-items: center; width: 18px; height: 18px; color: var(--dim); }
.mini-glyph .icon { width: 14px; height: 14px; }
.mini-glyph .eq { height: 10px; color: var(--accent); }
.dot { flex: 0 0 auto; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4a4a52; }
.dot.online { background: var(--online); }
.dot.warning { background: var(--warn); }
.dot.error { background: var(--danger); }
.account-area { display: grid; gap: .55rem; margin-top: auto; padding: .8rem .35rem 0; border-top: 1px solid var(--line); }
.account-chip { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.account-chip > div { overflow: hidden; }
.account-chip strong, .account-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip strong { font-size: .85rem; font-weight: 600; }
.account-chip small { margin-top: .1rem; font-size: .74rem; }
.account-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); font-weight: 600; font-size: .8rem; }
.account-avatar.small { width: 28px; height: 28px; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.sidebar .account-actions button { justify-content: center; gap: .4rem; padding: .4rem .3rem; font-size: .78rem; border: 1px solid var(--line); }
.sidebar .account-actions .icon { width: 14px; height: 14px; }
.scrim { display: none; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .9rem; min-height: 56px; padding: .6rem clamp(1rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); background: var(--page); }
.breadcrumbs { display: flex; min-width: 0; overflow: hidden; align-items: center; gap: .5rem; color: var(--dim); font-size: .85rem; white-space: nowrap; }
.breadcrumbs i { font-style: normal; color: #3a3a40; }
.breadcrumbs strong { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.menu-button { display: none; }
.main { max-width: 1440px; padding: clamp(1.2rem, 2.6vw, 2rem) clamp(1rem, 3vw, 2.2rem) 3rem; margin-inline: auto; outline: none; }
.main > * + * { margin-top: 1rem; }
.page-intro { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .95rem 1.1rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-icon { order: 2; color: var(--dim); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat strong { display: block; font-size: 1.5rem; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat strong small { font-size: .9rem; font-weight: 400; }
.stat span:not(.stat-icon) { display: block; margin-top: .25rem; font-size: .78rem; color: var(--muted); }
.stat.online strong { color: var(--online); }
.stat.accent strong { color: var(--accent); }

/* Layout + surfaces */
.layout-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 1rem; align-items: start; }
.layout-grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.stack { display: grid; min-width: 0; gap: 1rem; }
.surface { position: relative; min-width: 0; padding: clamp(.95rem, 2vw, 1.2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.section-heading { display: flex; justify-content: space-between; gap: .7rem; align-items: center; margin-bottom: .9rem; }
.section-heading h2 { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.section-heading h2 .icon { width: 15px; height: 15px; color: var(--dim); }
.count { color: var(--muted); font-size: .78rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.count.on { color: var(--online); }

/* Bot cards */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .7rem; }
.bot-card { display: grid; min-width: 0; gap: .65rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--nested); transition: border-color .15s; }
.bot-card:hover { border-color: var(--line-strong); }
.bot-card.selected { border-color: var(--accent-line); }
.bot-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.bot-card h3, .bot-panel h3 { overflow-wrap: anywhere; }
.bot-detail-line { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.bot-title { min-width: 0; }
.bot-title small { display: block; margin-top: .12rem; font-size: .76rem; }
.bot-glyph { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--muted); background: var(--raised); border: 1px solid var(--line); }
.bot-glyph .icon { width: 16px; height: 16px; }
.bot-glyph.playing { color: var(--accent); }
.bot-glyph .eq { height: 12px; }
.bot-host, .bot-track { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); font-size: .8rem; }
.bot-host .icon, .bot-track .icon { width: 14px; height: 14px; color: var(--dim); }
.bot-host span, .bot-track span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-track:not(.muted) { color: var(--text); }
.bot-track .eq { height: 10px; color: var(--accent); }
.bot-panel { display: grid; gap: .85rem; }
.room-form { display: grid; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--nested); }
.room-form .button { justify-self: start; }
.room-form .field-hint { margin: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line); overflow: hidden; }
.facts div { min-width: 0; padding: .55rem .7rem; background: var(--panel); }
.facts dt { color: var(--dim); font-size: .74rem; }
.facts dd { margin: .2rem 0 0; font-size: .86rem; overflow-wrap: anywhere; }

.status { display: inline-flex; align-items: center; gap: .4rem; width: fit-content; color: var(--muted); font-size: .8rem; font-weight: 500; white-space: nowrap; }
.status.online { color: var(--online); }
.status .dot.online { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.status.error { color: var(--danger); }
.status.warning { color: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: center; padding: .1rem .45rem; border-radius: 4px; color: var(--muted); border: 1px solid var(--line-strong); font-size: .72rem; font-weight: 500; font-style: normal; }
.chip.accent { color: var(--accent-2); border-color: var(--accent-line); }

.empty { display: grid; justify-items: center; align-content: center; gap: .5rem; padding: 1.5rem .5rem; color: var(--muted); font-size: .86rem; line-height: 1.5; text-align: center; }
.empty-icon { color: var(--dim); }
.empty-icon .icon { width: 20px; height: 20px; }
.empty p { max-width: 36ch; }
.empty .button { margin-top: .3rem; }
.detail-note { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; color: var(--muted); background: var(--nested); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.detail-note.warning { color: #e3b341; border-color: rgba(210, 153, 34, .35); background: rgba(210, 153, 34, .06); }

/* Player */
.player { display: grid; gap: 1rem; }
.player .section-heading { margin-bottom: 0; }
.now-playing { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; min-width: 0; }
.cover { position: relative; overflow: hidden; display: grid; place-items: center; width: clamp(150px, 16vw, 224px); aspect-ratio: 16 / 9; border-radius: var(--radius-sm); color: var(--dim); background: var(--nested); border: 1px solid var(--line); }
.cover .icon { width: 26px; height: 26px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: cover-in .45s ease-out; }
@keyframes cover-in { from { opacity: 0; transform: scale(1.03); } }
.player.live .cover { color: var(--accent); }
.player.live .cover.has-art { border-color: #34343a; }
input[type=range].seek { --val: 0%; display: block; width: 100%; height: 4px; background: linear-gradient(90deg, var(--accent) var(--val), #26262b var(--val)); transition: height .12s ease; }
input[type=range].seek:hover, input[type=range].seek:focus-visible { height: 6px; }
input[type=range].seek::-webkit-slider-thumb { opacity: 0; transition: opacity .12s ease; }
input[type=range].seek:hover::-webkit-slider-thumb, input[type=range].seek:active::-webkit-slider-thumb, input[type=range].seek:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type=range].seek::-moz-range-thumb { opacity: 0; }
input[type=range].seek:hover::-moz-range-thumb, input[type=range].seek:active::-moz-range-thumb { opacity: 1; }
input[type=range].seek:disabled { opacity: 1; cursor: default; }
.track-identity { display: grid; gap: .25rem; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.eyebrow .eq { height: 10px; }
.player.live .eyebrow { color: var(--accent); }
.track-identity h3 { font-size: 1.1rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.track-identity p { font-size: .82rem; overflow-wrap: anywhere; }
.track-identity .chips { margin-top: .3rem; }
.transport { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .9rem; border-top: 1px solid var(--line); }
.repeat { margin-left: .3rem; }
.volume-control { margin-left: auto; display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .78rem; }
.volume-control .icon { width: 16px; height: 16px; }
.volume-control output { min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { --val: 50%; -webkit-appearance: none; appearance: none; width: clamp(80px, 12vw, 130px); height: 4px; margin: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--val), #2c2c31 var(--val)); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #f2f2f3; border: 0; }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #f2f2f3; }
.source-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .9rem; border-top: 1px solid var(--line); }
.source-form .full { flex-basis: 100%; }
.source-form .button { flex: 1 0 auto; }
.source-input { position: relative; display: block; flex: 999 1 260px; }
.source-input .icon { position: absolute; left: .75rem; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.source-input input { padding-left: 2.15rem !important; }
.inline-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-size: .8rem; font-weight: 500; }
.inline-label select { min-height: 32px; width: auto; padding: .3rem 1.8rem .3rem .6rem; font-size: .82rem; }

/* Lists */
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.list-row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; min-width: 0; padding: .55rem .6rem; border-radius: var(--radius-sm); }
.rows > .list-row + .list-row { border-top: 1px solid var(--line); border-radius: 0; }
.list-row:hover { background: var(--nested); }
.list-row .row-text { flex: 1; min-width: 0; }
.list-row .row-text strong, .list-row .row-text small { display: block; overflow-wrap: anywhere; }
.list-row .row-text strong { font-size: .87rem; font-weight: 500; }
.list-row .row-text small { margin-top: .15rem; font-size: .75rem; }
.list-row .row-text small.technical { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.list-row .row-actions { flex-shrink: 0; justify-content: flex-end; }
.track-index { flex: none; width: 1.6rem; color: var(--dim); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; }
.event-list { max-height: 360px; overflow: auto; }
.timeline .list-row { padding-left: .6rem; }
.timeline .list-row:hover { background: transparent; }
.user-row { gap: .8rem; }
.role-badge { flex: none; padding: .1rem .45rem; border-radius: 4px; font-size: .72rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line-strong); }
.role-badge.admin { color: var(--accent-2); border-color: var(--accent-line); }
.role-badge.operator { color: #8db4e8; border-color: rgba(141, 180, 232, .35); }
.role-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.role-help div { display: grid; gap: .45rem; justify-items: start; padding: .85rem .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--nested); }
.role-help p { color: var(--muted); font-size: .82rem; line-height: 1.45; }

/* Forms */
label { display: grid; gap: .4rem; color: #dcdce0; font-size: .85rem; font-weight: 500; min-width: 0; }
label small, .field-hint { color: var(--muted); line-height: 1.45; font-size: .78rem; font-weight: 400; }
input:not([type=range], [type=checkbox], [type=file]), select, textarea { min-height: 38px; width: 100%; padding: .5rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); background: #0c0c0d; outline: none; transition: border-color .15s; }
input:not([type=range], [type=checkbox], [type=file]):hover, select:hover, textarea:hover { border-color: #3c3c43; }
input::placeholder, textarea::placeholder { color: #5f5f67; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #85858c 50%), linear-gradient(135deg, #85858c 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: #121214; }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input[type=checkbox] { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 32px; height: 18px; margin: 0; border-radius: 18px; background: #2a2a2f; border: 1px solid var(--line-strong); cursor: pointer; transition: background .15s, border-color .15s; }
input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #9d9da5; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background .15s; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: translateX(14px); background: #fff; }
.check { display: flex; align-items: center; gap: .6rem; line-height: 1.35; cursor: pointer; }
.dropzone { position: relative; display: flex !important; align-items: center; gap: .8rem; padding: .9rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--nested); cursor: pointer; transition: border-color .15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); }
.dropzone > .icon { width: 20px; height: 20px; color: var(--muted); }
.dropzone span { display: grid; gap: .2rem; }
.dropzone small { font-weight: 400; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.modal { padding: 1.3rem; width: min(calc(100% - 1.3rem), 600px); max-height: calc(100% - 1.3rem); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: var(--panel); box-shadow: 0 24px 60px -20px #000; }
.modal[open] { animation: modal-in .16s ease-out; }
.modal::backdrop { background: rgba(0, 0, 0, .65); }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px); } }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-heading h2 { font-size: 1.05rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .row-actions { margin-top: .3rem; }
.form-error { color: var(--danger); font-size: .85rem; line-height: 1.4; overflow-wrap: anywhere; }
.simple-form { display: grid; gap: .8rem; }
.simple-form > .button { justify-self: start; }

.quota { padding: .2rem .55rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 500; font-variant-numeric: tabular-nums; margin-left: auto; }
.quota.full { color: var(--warn); border-color: rgba(210, 153, 34, .35); }
.button.is-full { opacity: .6; }
.profile-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--nested); }
.profile-box .full { grid-column: 1 / -1; }
.profile-head { grid-column: 1 / -1; display: grid; gap: .2rem; }
.profile-head h3 { font-size: .92rem; }
.profile-head small { color: var(--muted); font-size: .78rem; }
.avatar-row { display: flex; align-items: center; gap: 1rem; }
.avatar-preview { flex: none; width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line-strong); }
.avatar-preview.empty { display: grid; place-items: center; color: var(--dim); background: var(--raised); }
.avatar-preview.empty .icon { width: 24px; height: 24px; }
.avatar-controls { display: grid; gap: .5rem; flex: 1; min-width: 0; }
.loop-form { display: grid; gap: .8rem; margin-top: .9rem; }
.loop-form .dropzone small { display: block; }
.loop-now { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; padding: .55rem .75rem; border-radius: var(--radius-sm); color: var(--text); border: 1px solid var(--accent-line); background: var(--accent-soft); font-size: .86rem; }
.loop-now .eq { color: var(--accent); }
.field { display: grid; gap: .4rem; min-width: 0; }
.field-label { color: #dcdce0; font-size: .85rem; font-weight: 500; }
.field > small { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.pick-list { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 180px; overflow: auto; padding: .1rem; }
.pick { position: relative; display: inline-flex !important; align-items: center; gap: 0; padding: .28rem .6rem; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; }
.pick:hover { border-color: #44444c; color: var(--text); }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick:has(input:checked) { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.pick:has(input:checked) span::before { content: '✓ '; color: var(--accent); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.pick-filter { margin-bottom: .5rem; }
.pick[hidden] { display: none; }
.auth-switch { text-align: center; color: var(--muted); font-size: .84rem; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.registration-toggle { font-size: .84rem; color: var(--muted); }
.user-row.waiting { box-shadow: inset 2px 0 0 var(--accent); }
.list-row .row-text small.contact { color: var(--dim); }
.expiry.soon { color: var(--warn); }
.expiry.expired { color: var(--danger); font-weight: 600; }
.command-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; }
.command-list li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .7rem; align-items: baseline; padding: .4rem 0; font-size: .8rem; }
.command-list li + li { border-top: 1px solid var(--line); }
.command-list code { color: var(--text); font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; }
.command-list span { color: var(--muted); }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--nested); font-size: .84rem; line-height: 1.45; }
.shortcut > span { display: flex; align-items: center; gap: .55rem; }
.shortcut svg { flex: none; width: 16px; height: 16px; color: var(--accent); }

/* Plugins */
.plugin-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: .85rem; }
.plugin-list, .plugin { scroll-margin-top: 5rem; }
.plugin { display: flex; flex-direction: column; gap: .9rem; }
.plugin::before { content: ''; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); transform: scaleY(0); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.plugin.on { border-color: #2f2f35; }
.plugin.on::before { transform: scaleY(1); }
.plugin.wide { grid-column: 1 / -1; }
.eq-presets { max-height: none; overflow: visible; }
.eq-curve { display: block; width: 100%; height: 120px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #0c0c0d; }
.eq-curve .grid { stroke: #1c1c20; stroke-width: 1; vector-effect: non-scaling-stroke; }
.eq-curve .zero { stroke: #34343a; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.eq-curve .area { fill: var(--accent-soft); }
.eq-curve .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.eq-bands { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .25rem; }
.eq-band { justify-items: center; gap: .4rem; color: var(--dim); font-size: .72rem; font-weight: 500; }
.eq-band output { min-width: 2.4em; text-align: center; color: var(--text); font-size: .74rem; font-variant-numeric: tabular-nums; }
.eq-band input[type=range] { writing-mode: vertical-lr; direction: rtl; width: 4px; height: 128px; background: linear-gradient(to top, var(--accent) var(--val), #2c2c31 var(--val)); }
.eq-foot { justify-content: space-between; }
.plugin-head { display: flex; align-items: flex-start; gap: .7rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.plugin-head > div { flex: 1; min-width: 0; }
.plugin-head p { margin-top: .25rem; font-size: .8rem; line-height: 1.45; }
.plugin-icon { flex: none; padding-top: .1rem; color: var(--dim); }
.plugin-icon .icon { width: 17px; height: 17px; }
.plugin.on .plugin-icon { color: var(--accent); }
.plugin-state { flex: none; color: var(--dim); font-size: .76rem; font-weight: 500; }
.plugin.on .plugin-state { color: var(--online); }
.plugin .button[type=submit] { align-self: flex-start; margin-top: auto; }
.upload-form, .playlist-item { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.upload-form label { flex: 1 1 240px; }
.playlist-item > :not(button) { flex: 1 1 170px; min-width: 125px; }
.playlist-item { margin-bottom: 0; align-items: end; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--nested); }
.list-column { display: grid; gap: .5rem; }

/* Toasts */
.notifications { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: grid; gap: .45rem; max-width: min(420px, calc(100% - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .7rem .9rem; background: var(--raised); color: var(--text); font-size: .86rem; overflow-wrap: anywhere; box-shadow: 0 12px 30px -12px #000; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.toast::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--online); }
.toast.error::before { background: var(--danger); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 1080px) { .layout-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 8; width: min(270px, 86vw); height: 100%; transform: translateX(-102%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 50px -20px #000; }
  .scrim { position: fixed; inset: 0; z-index: 7; display: block; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-button { display: inline-flex; }
  .breadcrumbs { flex: 1; }
  .breadcrumbs > span, .breadcrumbs > i { display: none; }
  .role-help { grid-template-columns: minmax(0, 1fr); }
  .volume-control { margin-left: 0; width: 100%; }
  .volume-control input { flex: 1; }
}
@media (max-width: 560px) {
  .shortcut { flex-direction: column; align-items: stretch; }
  .now-playing { grid-template-columns: minmax(0, 1fr); }
  .cover { order: -1; width: 100%; }
  .eq-band input[type=range] { height: 104px; }
}
@media (max-width: 480px) {
  .stat { padding: .75rem .8rem; }
  .stat-icon { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .role-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }
