:root {
    --desktop-ui-scale: 0.8;
    --bg: #020308;
    --bg-soft: #060913;
    --panel: rgba(8, 10, 20, 0.84);
    --panel-alt: rgba(10, 14, 28, 0.86);
    --panel-muted: rgba(6, 9, 18, 0.88);
    --line: rgba(170, 193, 255, 0.12);
    --line-strong: rgba(170, 193, 255, 0.24);
    --text: #eef4ff;
    --muted: #95a1bb;
    --muted-strong: #d4def0;
    --accent: #9edfff;
    --accent-strong: #b48cff;
    --accent-soft: rgba(158, 223, 255, 0.12);
    --accent-secondary-soft: rgba(180, 140, 255, 0.14);
    --success: #7fd6a1;
    --warn: #ffd27d;
    --danger: #ff93a1;
    --shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    --glow: 0 0 0 1px rgba(158, 223, 255, 0.08), 0 0 42px rgba(158, 223, 255, 0.14), 0 0 64px rgba(180, 140, 255, 0.14);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-main: "Segoe UI Variable", "Bahnschrift", "Aptos", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--text);
    background:
        radial-gradient(circle at 10% 12%, rgba(158, 223, 255, 0.14), transparent 20%),
        radial-gradient(circle at 85% 10%, rgba(180, 140, 255, 0.18), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(98, 116, 255, 0.1), transparent 30%),
        linear-gradient(180deg, #010207 0%, #040611 46%, #060716 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button {
    border: none;
}

img {
    display: block;
    max-width: 100%;
}

.landing-body,
.dashboard-body,
.error-body {
    padding: 18px;
}

.landing-shell,
.error-shell {
    width: 100%;
    margin: 0;
}

.dashboard-shell {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 360px;
    gap: 24px;
    align-items: stretch;
}

.hero-card,
.sidebar-panel,
.panel,
.error-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-muted) 100%);
    box-shadow: var(--shadow), var(--glow);
    backdrop-filter: blur(26px) saturate(130%);
    -webkit-backdrop-filter: blur(26px) saturate(130%);
}

.hero-card,
.error-card {
    padding: 36px;
    border-radius: var(--radius-xl);
}

.sidebar-panel,
.panel {
    border-radius: var(--radius-lg);
    padding: 20px;
}

.sidebar-panel {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-panel .ghost-button {
    width: 100%;
}

.eyebrow,
.section-kicker,
.mini-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.73rem;
    font-weight: 700;
}

.eyebrow,
.section-kicker {
    color: var(--accent);
}

.mini-label {
    color: var(--muted);
}

.hero-card h1,
.brand-block h1,
.portal-header h2,
.error-card h1 {
    margin: 0;
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.hero-card h1 {
    max-width: 12ch;
    font-size: clamp(2.5rem, 5vw, 4.7rem);
}

.brand-block h1,
.portal-header h2,
.error-card h1 {
    font-size: clamp(1.8rem, 2.8vw, 2.8rem);
}

.hero-copy,
.panel-copy,
.landing-footer,
.header-copy,
.track-card p,
.feature-card p,
.list-row p,
.queue-item p,
.guild-item p,
.user-chip p,
.stat-box span,
.hint-copy {
    color: var(--muted);
}

.hero-copy,
.panel-copy,
.header-copy,
.error-copy,
.hint-copy {
    line-height: 1.58;
}

.hero-copy,
.header-copy {
    margin: 14px 0 0;
    max-width: 720px;
}

.hero-actions {
    margin: 26px 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button,
.command-toggle {
    cursor: pointer;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #eef4ff;
    box-shadow: 0 0 26px rgba(158, 223, 255, 0.16), 0 0 36px rgba(180, 140, 255, 0.18);
}

.secondary-button {
    background: linear-gradient(135deg, rgba(22, 30, 53, 0.92) 0%, rgba(28, 20, 56, 0.92) 100%);
    border: 1px solid var(--line);
}

.ghost-button {
    background: rgba(14, 18, 34, 0.88);
    border: 1px solid var(--line);
    color: var(--muted-strong);
}

.ghost-button.active-nav {
    border-color: rgba(180, 140, 255, 0.3);
    background: linear-gradient(135deg, rgba(18, 28, 58, 0.96) 0%, rgba(34, 22, 66, 0.96) 100%);
    color: var(--text);
    box-shadow: 0 0 22px rgba(180, 140, 255, 0.16);
}

.chip-button {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(14, 18, 34, 0.96);
    border: 1px solid var(--line);
    color: var(--muted-strong);
}

.chip-button.danger {
    background: rgba(110, 40, 56, 0.9);
    border-color: rgba(255, 151, 163, 0.24);
    color: #fff0f3;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.chip-button:hover,
.command-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(180, 140, 255, 0.34);
    box-shadow: 0 0 20px rgba(158, 223, 255, 0.12), 0 0 28px rgba(180, 140, 255, 0.16);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.chip-button:disabled,
.command-toggle:disabled {
    cursor: progress;
    opacity: 0.76;
    transform: none;
}

.primary-button[data-save-state="success"],
.secondary-button[data-save-state="success"] {
    border-color: rgba(131, 213, 157, 0.32);
    color: var(--success);
}

.primary-button[data-save-state="error"],
.secondary-button[data-save-state="error"] {
    border-color: rgba(255, 151, 163, 0.28);
    color: var(--danger);
}

.warning-pill,
.status-banner,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
}

.warning-pill {
    background: rgba(91, 73, 23, 0.36);
    border-color: rgba(255, 215, 138, 0.2);
    color: var(--warn);
}

.badge.muted,
.status-banner.info {
    background: linear-gradient(135deg, rgba(158, 223, 255, 0.08) 0%, rgba(180, 140, 255, 0.08) 100%);
    border-color: rgba(170, 193, 255, 0.2);
    color: #d3e2ff;
}

.badge.success,
.status-banner.success {
    background: rgba(131, 213, 157, 0.14);
    border-color: rgba(131, 213, 157, 0.22);
    color: var(--success);
}

.badge.error,
.status-banner.error {
    background: rgba(122, 41, 55, 0.18);
    border-color: rgba(255, 151, 163, 0.18);
    color: var(--danger);
}

.error-copy {
    display: inline-flex;
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(122, 41, 55, 0.16);
    border: 1px solid rgba(255, 151, 163, 0.16);
    color: var(--danger);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.hero-card-wide {
    min-height: calc(100vh - 36px);
}

.hero-visual {
    display: grid;
    gap: 16px;
}

.visual-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(12, 16, 29, 0.92) 0%, rgba(7, 10, 21, 0.96) 100%);
    box-shadow: var(--shadow), var(--glow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.visual-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.15rem;
}

.visual-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.visual-card-main {
    min-height: 240px;
    background:
        radial-gradient(circle at top right, rgba(158, 223, 255, 0.16), transparent 22%),
        radial-gradient(circle at 78% 22%, rgba(180, 140, 255, 0.18), transparent 18%),
        linear-gradient(180deg, rgba(10, 14, 26, 0.98) 0%, rgba(5, 7, 17, 1) 100%);
}

.feature-card,
.mini-panel,
.command-card,
.list-row,
.queue-item,
.stat-box,
.server-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(14, 18, 34, 0.94) 0%, rgba(9, 12, 24, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 0 26px rgba(158, 223, 255, 0.05), 0 0 30px rgba(180, 140, 255, 0.06);
}

.feature-card {
    padding: 18px;
    border-radius: var(--radius-md);
}

.landing-footer {
    margin-top: 24px;
    font-size: 0.92rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-alt);
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
}

.server-card {
    padding: 16px;
    border-radius: var(--radius-md);
}

.module-nav-card {
    display: grid;
    gap: 14px;
}

.server-picker-card {
    display: grid;
    gap: 14px;
}

.sidebar-select-note {
    margin: 0;
}

.guild-header,
.panel-title-row,
.portal-header,
.toggle-row,
.module-footer,
.inline-action,
.transport-row,
.stats-row,
.list-header,
.command-section-header {
    display: flex;
    align-items: center;
}

.guild-header,
.panel-title-row,
.portal-header,
.list-header,
.command-section-header,
.toggle-row,
.module-footer {
    justify-content: space-between;
    gap: 12px;
}

.guild-list,
.queue-list,
.list-stack {
    display: grid;
    gap: 10px;
}

.queue-list {
    max-height: min(68vh, 920px);
    overflow-y: auto;
    padding-right: 4px;
}

.module-nav-list {
    display: grid;
    gap: 10px;
}

.module-nav-item {
    display: block;
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(16, 21, 39, 0.92) 0%, rgba(15, 13, 34, 0.94) 100%);
    color: var(--text);
    text-decoration: none;
    text-align: left;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.module-nav-item:hover,
.module-nav-item.active {
    border-color: rgba(180, 140, 255, 0.32);
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(158, 223, 255, 0.1), 0 0 26px rgba(180, 140, 255, 0.14);
}

.module-nav-item:focus-visible {
    outline: 2px solid rgba(158, 223, 255, 0.42);
    outline-offset: 2px;
}

.guild-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(40, 48, 64, 0.62);
    text-align: left;
}

.guild-item.active {
    border-color: rgba(180, 140, 255, 0.28);
    background: linear-gradient(135deg, rgba(18, 31, 60, 0.82) 0%, rgba(32, 20, 68, 0.78) 100%);
    box-shadow: 0 0 18px rgba(180, 140, 255, 0.16);
}

.guild-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(121, 200, 255, 0.18);
}

.guild-icon.fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.content-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.server-selector-panel {
    display: grid;
    gap: 16px;
}

.server-selector-row {
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) minmax(0, 0.8fr);
    gap: 16px;
    align-items: end;
}

.server-select-stack {
    margin-top: 0;
}

.server-selector-copy {
    display: grid;
    gap: 8px;
    align-content: start;
}

.server-selector-copy strong {
    font-size: 1rem;
}

.module-anchor-section {
    scroll-margin-top: 22px;
}

.queue-panel,
.command-panel {
    scroll-margin-top: 22px;
}

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

.mini-panel {
    padding: 16px;
    border-radius: var(--radius-md);
}

.mini-panel strong {
    display: block;
    margin-top: 10px;
    font-size: 1.15rem;
}

.mini-panel p {
    margin: 6px 0 0;
    color: var(--muted);
}

.primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 18px;
}

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

.module-grid-extended {
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(320px, 0.9fr));
}

.module-grid.module-grid-extended[data-layout="single"] {
    grid-template-columns: 1fr;
}

.module-grid.module-grid-extended[data-layout="pair"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-card-wide {
    min-width: 0;
}

.sub-row {
    margin-top: 20px;
}

.module-callout {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(12, 16, 29, 0.94) 0%, rgba(18, 12, 34, 0.94) 100%);
}

.module-callout strong {
    display: block;
    margin-bottom: 6px;
}

.module-callout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.compact-grid {
    margin-top: 16px;
}

.rule-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.nested-rule-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.ticket-option-card {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(9, 13, 25, 0.94) 0%, rgba(12, 10, 28, 0.96) 100%);
}

.ticket-option-header,
.inline-mini-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-option-header {
    justify-content: space-between;
    margin-bottom: 12px;
}

.rule-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(13, 18, 33, 0.94) 0%, rgba(8, 11, 22, 0.96) 100%);
}

.rule-header,
.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rule-header {
    margin-bottom: 14px;
}

.rule-meta,
.field-subhint {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.9rem;
}

.field-subhint code {
    color: var(--text);
    font-size: 0.88rem;
}

.rule-grid {
    margin-top: 0;
}

.check-row {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(9, 13, 25, 0.9);
    color: var(--muted-strong);
    justify-content: flex-start;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-strong);
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.check-grid .check-row {
    margin-top: 0;
}

.small-button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.field-stack {
    display: grid;
    gap: 10px;
}

.field-stack select[multiple] {
    min-height: 132px;
    padding-block: 10px;
}

.field-span-2 {
    grid-column: span 2;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.field-stack label {
    color: var(--muted-strong);
    font-size: 0.93rem;
    font-weight: 700;
}

.field-stack input,
.field-stack select,
.field-stack textarea {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(7, 10, 21, 0.9);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-stack input::placeholder {
    color: var(--muted);
}

.field-stack input:focus,
.field-stack select:focus,
.field-stack textarea:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(158, 223, 255, 0.08), 0 0 26px rgba(180, 140, 255, 0.12);
}

.field-stack input:disabled,
.field-stack select:disabled,
.field-stack textarea:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}

.field-stack textarea {
    resize: vertical;
    min-height: 132px;
}

.inline-action {
    gap: 10px;
}

.inline-action input,
.inline-action select {
    flex: 1;
}

.transport-row {
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.hint-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-secondary-soft) 100%);
    border: 1px solid var(--line);
    color: var(--muted-strong);
    font-size: 0.85rem;
}

.track-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(14, 20, 37, 0.94) 0%, rgba(8, 12, 24, 0.98) 100%);
    box-shadow: 0 0 28px rgba(158, 223, 255, 0.06), 0 0 38px rgba(180, 140, 255, 0.08);
}

.track-artwork {
    width: 100%;
    max-height: 220px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--line);
    box-shadow: 0 0 26px rgba(158, 223, 255, 0.08), 0 0 28px rgba(180, 140, 255, 0.08);
}

.track-card strong {
    display: block;
    font-size: 1.08rem;
}

.track-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.track-title-row .badge {
    flex-shrink: 0;
}

.track-card p {
    margin: 8px 0 0;
}

.track-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 700;
}

.track-progress {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.track-progress-bar {
    position: relative;
    overflow: hidden;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgba(170, 193, 255, 0.18);
    background: linear-gradient(135deg, rgba(10, 14, 28, 0.96) 0%, rgba(12, 9, 28, 0.96) 100%);
    box-shadow: inset 0 0 18px rgba(5, 8, 18, 0.8), 0 0 24px rgba(158, 223, 255, 0.12), 0 0 34px rgba(180, 140, 255, 0.12);
}

.track-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(149, 232, 255, 0.9) 0%, rgba(166, 190, 255, 0.94) 46%, rgba(197, 139, 255, 0.96) 100%);
    box-shadow: 0 0 30px rgba(158, 223, 255, 0.34), 0 0 40px rgba(180, 140, 255, 0.28);
    transition: width 180ms linear;
}

.track-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.stats-row {
    gap: 12px;
    margin-top: 18px;
}

.stat-box {
    flex: 1;
    min-width: 0;
    padding: 14px;
    border-radius: var(--radius-md);
}

.stat-box strong {
    display: block;
}

.stat-box span {
    display: block;
    margin-bottom: 6px;
}

.toggle-row {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(10, 14, 28, 0.9) 0%, rgba(14, 10, 30, 0.9) 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-flex;
    width: 52px;
    height: 30px;
    justify-self: end;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.switch-ui {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(32, 38, 59, 0.9);
    border: 1px solid var(--line);
    transition: background 160ms ease, box-shadow 160ms ease;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #edf4ff;
    transition: transform 160ms ease;
}

.switch input:checked + .switch-ui {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 0 18px rgba(158, 223, 255, 0.22), 0 0 30px rgba(180, 140, 255, 0.22);
}

.switch input:checked + .switch-ui::after {
    transform: translateX(22px);
}

.module-footer {
    margin-top: 18px;
}

.stacked-lists {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.list-row,
.queue-item {
    padding: 12px 14px;
    border-radius: var(--radius-md);
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.list-row p,
.queue-item p {
    margin: 4px 0 0;
}

.queue-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.queue-item-main {
    min-width: 0;
}

.queue-item-draggable {
    cursor: grab;
    user-select: none;
}

.queue-item-draggable:active {
    cursor: grabbing;
}

.queue-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-item-header strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.queue-index {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(131, 154, 255, 0.2);
    background: rgba(116, 167, 255, 0.12);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.queue-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    border-radius: 12px;
    border: 1px dashed rgba(145, 187, 255, 0.24);
    background: rgba(20, 26, 48, 0.7);
    color: var(--muted);
    font-size: 1rem;
    letter-spacing: 0.08em;
    cursor: grab;
    user-select: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.queue-drag-handle:hover {
    border-color: rgba(149, 196, 255, 0.4);
    box-shadow: 0 0 22px rgba(121, 174, 255, 0.12);
}

.queue-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.queue-drag-handle.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.queue-item-dragging {
    opacity: 0.52;
    transform: scale(0.992);
}

.queue-drop-before {
    border-top: 2px solid rgba(124, 184, 255, 0.88);
    box-shadow: inset 0 10px 18px rgba(98, 168, 255, 0.08);
}

.queue-drop-after {
    border-bottom: 2px solid rgba(180, 140, 255, 0.86);
    box-shadow: inset 0 -10px 18px rgba(180, 140, 255, 0.08);
}

.queue-item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.queue-action {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(16, 22, 40, 0.82);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.queue-action:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(128, 170, 255, 0.38);
    box-shadow: 0 0 20px rgba(111, 146, 255, 0.16);
}

.queue-action-secondary {
    background: rgba(20, 27, 48, 0.88);
}

.queue-action-danger {
    border-color: rgba(255, 118, 162, 0.2);
    background: rgba(58, 17, 38, 0.76);
}

.queue-action-danger:hover:not(:disabled) {
    border-color: rgba(255, 129, 170, 0.44);
    box-shadow: 0 0 22px rgba(255, 116, 176, 0.14);
}

.queue-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.queue-item-meta {
    overflow-wrap: anywhere;
}

.command-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.command-section {
    display: grid;
    gap: 12px;
}

.command-section-header h4 {
    margin: 0;
}

.command-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.command-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-md);
}

.command-card strong {
    display: block;
    margin-bottom: 6px;
}

.command-card p {
    margin: 0;
    color: var(--muted);
}

.command-toggle {
    min-width: 78px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(66, 98, 78, 0.24);
    border: 1px solid rgba(131, 213, 157, 0.24);
    color: var(--success);
    font-weight: 700;
    justify-self: end;
    align-self: center;
}

.command-toggle.off {
    background: rgba(63, 39, 48, 0.24);
    border-color: rgba(255, 151, 163, 0.2);
    color: var(--danger);
}

.empty-state {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line);
    color: var(--muted);
    background: rgba(8, 11, 22, 0.82);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-strong);
}

.status-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.brand-block-rich,
.brand-media,
.portal-footer,
.footer-links,
.top-banner,
.runtime-media {
    display: flex;
    align-items: center;
}

.brand-block-rich,
.top-banner {
    gap: 14px;
}

.brand-block-rich {
    flex-direction: column;
    align-items: flex-start;
}

.brand-media {
    gap: 14px;
    align-items: center;
}

.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(170, 193, 255, 0.24);
    background: rgba(170, 193, 255, 0.08);
    box-shadow: 0 0 30px rgba(158, 223, 255, 0.18), 0 0 34px rgba(180, 140, 255, 0.18);
}

.runtime-avatar {
    width: 48px;
    height: 48px;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hero-status {
    margin: 2px 0 0;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 210, 125, 0.16);
    background: rgba(83, 67, 27, 0.22);
    color: var(--warn);
    font-weight: 700;
}

.top-banner {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 210, 125, 0.16);
    background: rgba(72, 58, 23, 0.16);
    color: var(--muted-strong);
    flex-direction: column;
    align-items: flex-start;
}

.top-banner p {
    margin: 6px 0 0;
    color: var(--muted);
}

.hero-illustration {
    width: 100%;
    max-height: 240px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--line);
}

.audio-layout {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.audio-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.control-subpanel {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(12, 16, 30, 0.92) 0%, rgba(7, 10, 21, 0.96) 100%);
    box-shadow: 0 0 28px rgba(158, 223, 255, 0.06), 0 0 30px rgba(180, 140, 255, 0.08);
}

.subpanel-heading {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.subpanel-heading strong {
    font-size: 1rem;
}

.chip-button.accent {
    background: linear-gradient(135deg, rgba(18, 30, 64, 0.96) 0%, rgba(36, 20, 74, 0.96) 100%);
    border-color: rgba(170, 193, 255, 0.24);
    color: #d6e6fb;
}

.chip-button.active-toggle {
    background: linear-gradient(135deg, rgba(30, 66, 104, 0.42) 0%, rgba(72, 38, 118, 0.38) 100%);
    border-color: rgba(170, 193, 255, 0.36);
    box-shadow: 0 0 26px rgba(158, 223, 255, 0.16), 0 0 34px rgba(180, 140, 255, 0.18);
}

.danger-outline-button {
    background: linear-gradient(135deg, rgba(48, 16, 28, 0.92) 0%, rgba(66, 24, 42, 0.92) 100%);
    border-color: rgba(255, 147, 161, 0.26);
    color: #ffd9df;
}

.system-action-row {
    align-items: center;
}

.portal-footer {
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.portal-footer-sidebar {
    margin-top: auto;
}

.portal-footer p {
    margin: 0;
}

.cookie-notice {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    width: min(420px, calc(100vw - 24px));
    padding: 16px 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 186, 255, 0.2);
    background: linear-gradient(145deg, rgba(8, 12, 28, 0.96) 0%, rgba(18, 20, 46, 0.94) 100%);
    box-shadow: 0 0 30px rgba(105, 176, 255, 0.16), 0 0 46px rgba(160, 120, 255, 0.12);
    backdrop-filter: blur(24px);
}

.cookie-notice-copy {
    display: grid;
    gap: 6px;
}

.cookie-notice-copy strong {
    color: var(--text);
}

.cookie-notice-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.92rem;
}

.cookie-notice-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-upload-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
}

.asset-upload-meta {
    font-size: 0.82rem;
    color: rgba(214, 220, 255, 0.72);
}

.asset-upload-meta[data-state="success"] {
    color: #96f7cf;
}

.asset-upload-meta[data-state="error"] {
    color: #ff9cab;
}

.footer-links {
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted-strong);
}

.footer-links a:hover {
    color: var(--text);
}

.legal-layout {
    max-width: 980px;
    margin: 0 auto;
}

.legal-card {
    min-height: auto;
}

.copy-list {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.copy-list strong {
    display: block;
    margin-bottom: 8px;
}

.copy-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
    white-space: pre-line;
}

.stats-layout {
    max-width: 1280px;
}

.stats-hero {
    display: grid;
    gap: 24px;
}

.stats-system-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(180, 140, 255, 0.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(180, 140, 255, 0.16), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(158, 223, 255, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(10, 14, 28, 0.96) 0%, rgba(16, 14, 36, 0.96) 100%);
    box-shadow: 0 0 34px rgba(158, 223, 255, 0.08), 0 0 48px rgba(180, 140, 255, 0.1);
}

.stats-system-banner h2 {
    margin: 6px 0 0;
    font-size: clamp(1.55rem, 2.6vw, 2.2rem);
}

.stats-system-banner .panel-copy {
    margin: 10px 0 0;
}

.stats-system-state {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.stats-status-strip,
.stats-chart-overview,
.stats-board-grid {
    display: grid;
    gap: 16px;
}

.stats-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-status-strip .mini-panel,
.stats-chart-overview .mini-panel {
    min-height: 128px;
}

.stats-block {
    display: grid;
    gap: 14px;
}

.stats-live-list {
    display: grid;
    gap: 12px;
}

.stats-live-row {
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(11, 14, 28, 0.86) 0%, rgba(8, 11, 22, 0.9) 100%);
}

.stats-live-row strong,
.stats-live-row p {
    margin: 0;
}

.stats-live-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.stats-range-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-range-tab {
    min-width: 66px;
    justify-content: center;
}

.stats-range-tab.active {
    border-color: rgba(180, 140, 255, 0.32);
    background: linear-gradient(135deg, rgba(28, 34, 66, 0.96) 0%, rgba(36, 22, 70, 0.96) 100%);
    box-shadow: 0 0 22px rgba(180, 140, 255, 0.18), 0 0 18px rgba(158, 223, 255, 0.08);
    color: var(--text);
}

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

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

.chart-card {
    display: grid;
    gap: 14px;
}

.chart-surface {
    display: grid;
    align-items: stretch;
    min-height: 300px;
    padding: 14px 12px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(170, 193, 255, 0.1);
    background: linear-gradient(180deg, rgba(6, 9, 18, 0.92) 0%, rgba(9, 11, 22, 0.98) 100%);
}

.chart-svg {
    width: 100%;
    height: 240px;
    overflow: visible;
}

.chart-grid-line {
    stroke: rgba(170, 193, 255, 0.12);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    stroke: none;
}

.chart-point {
    stroke: rgba(2, 3, 8, 0.85);
    stroke-width: 2;
}

.chart-label-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 10px;
    align-items: start;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.77rem;
    line-height: 1.3;
}

.chart-label-row span {
    text-align: left;
}

.chart-empty {
    display: grid;
    place-items: center;
    min-height: 240px;
    text-align: center;
    color: var(--muted);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(7, 10, 19, 0.92) 0%, rgba(12, 15, 28, 0.96) 100%);
}

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

.stats-note {
    margin-top: 4px;
}

@media (min-width: 1181px) {
    .landing-body,
    .dashboard-body,
    .error-body {
        overflow-x: hidden;
    }

    .landing-shell,
    .dashboard-shell,
    .error-shell,
    .legal-layout {
        width: calc(100% / var(--desktop-ui-scale));
        transform: scale(var(--desktop-ui-scale));
        transform-origin: top left;
    }
}

@media (max-width: 1180px) {
    .landing-grid,
    .dashboard-shell,
    .primary-grid,
    .module-grid,
    .module-grid-extended,
    .audio-split-grid,
    .stats-status-strip,
    .stats-chart-overview,
    .stats-chart-grid,
    .stats-board-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-panel {
        position: static;
    }

    .server-selector-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .overview-strip,
    .command-section-grid,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .landing-body,
    .dashboard-body,
    .error-body {
        padding: 12px;
    }

    .hero-card,
    .sidebar-panel,
    .panel,
    .error-card {
        padding: 16px;
    }

    .overview-strip,
    .settings-grid,
    .command-section-grid,
    .feature-grid,
    .module-grid-extended,
    .check-grid {
        grid-template-columns: 1fr;
    }

    .stats-system-banner {
        grid-template-columns: 1fr;
    }

    .stats-live-meta {
        justify-content: flex-start;
    }

    .chart-surface {
        min-height: 250px;
        padding: 12px 10px 10px;
    }

    .portal-header,
    .panel-title-row,
    .guild-header,
    .module-footer,
    .inline-action,
    .inline-mini-actions,
    .ticket-option-header,
    .stats-row,
    .list-row {
        flex-direction: column;
        align-items: stretch;
    }

    .queue-item {
        grid-template-columns: 1fr;
    }

    .queue-item-actions {
        justify-content: flex-start;
    }

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

    .field-span-2 {
        grid-column: span 1;
    }

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

    .hero-meta,
    .brand-media,
    .portal-footer,
    .cookie-notice,
    .cookie-notice-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-notice {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

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

    .command-toggle,
    .chip-button,
    .primary-button,
    .secondary-button,
    .ghost-button {
        width: 100%;
    }

    .command-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .hero-card h1 {
        max-width: none;
    }
}

@media (max-width: 520px) {
    .module-nav-list {
        grid-template-columns: 1fr;
    }
}
