.page-shell {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    isolation: isolate;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    min-height: 76px;
    padding: 14px 0;
    backdrop-filter: blur(18px);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 8px -14px;
    z-index: -1;
    border: 1px solid rgba(167, 184, 218, 0.13);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(9, 14, 29, 0.82), rgba(7, 10, 21, 0.62)),
        rgba(7, 10, 20, 0.5);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100vw;
    height: 1px;
    transform: translateX(-50%);
    background: var(--line);
}

.brand,
.header-actions,
.hero-actions,
.player-controls,
.player-tools,
.chip-grid,
.form-row,
.form-split,
.meta-line,
.room-card-footer,
.presence-row,
.profile-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    grid-column: 1;
    min-width: 0;
}

.brand picture {
    display: block;
    line-height: 0;
}

.brand-logo {
    display: block;
    width: auto;
    height: 56px;
    max-width: 210px;
    object-fit: contain;
}

.nav-menu-toggle {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(167, 184, 218, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
        rgba(12, 18, 34, 0.84);
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.18);
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.nav-menu-toggle:hover {
    border-color: rgba(88, 213, 246, 0.34);
    background-color: rgba(88, 213, 246, 0.1);
    transform: translateY(-1px);
}

.nav-menu-icon,
.nav-menu-icon::before,
.nav-menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.nav-menu-icon {
    position: relative;
}

.nav-menu-icon::before,
.nav-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-menu-icon::before {
    transform: translateY(-6px);
}

.nav-menu-icon::after {
    transform: translateY(6px);
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-icon {
    background: transparent;
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-icon::before {
    transform: rotate(45deg);
}

.nav-menu-toggle[aria-expanded="true"] .nav-menu-icon::after {
    transform: rotate(-45deg);
}

.brand-mark {
    display: inline-flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid rgba(88, 213, 246, 0.22);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(52, 92, 129, 0.46), rgba(17, 19, 41, 0.82));
    box-shadow: inset 0 0 22px rgba(88, 213, 246, 0.12);
}

.brand-mark span,
.sound-icon span,
.mini-visualizer span {
    width: 4px;
    height: var(--bar-height, 50%);
    min-height: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), var(--violet));
}

.brand-name {
    font-size: 1.18rem;
    font-weight: 760;
    white-space: nowrap;
}

.primary-nav {
    grid-column: 2;
    display: flex;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    border: 1px solid rgba(167, 184, 218, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
    display: none;
}

.primary-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 680;
    white-space: nowrap;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(167, 184, 218, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.primary-nav a:hover {
    transform: translateY(-1px);
}

.primary-nav a.is-active {
    border-color: rgba(88, 213, 246, 0.24);
    background:
        linear-gradient(180deg, rgba(88, 213, 246, 0.13), rgba(123, 110, 246, 0.09)),
        rgba(255, 255, 255, 0.055);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 24px rgba(88, 213, 246, 0.08);
}

.feature-unavailable {
    color: var(--subtle);
}

.feature-unavailable s {
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(231, 169, 95, 0.9);
}

.icon-button s {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.nav-badge,
.pill,
.room-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(123, 110, 246, 0.32);
    border-radius: 999px;
    background: rgba(123, 110, 246, 0.14);
    color: #c8c3ff;
    font-size: 0.76rem;
}

.room-status-pill {
    border-color: rgba(84, 215, 157, 0.36);
    background: rgba(84, 215, 157, 0.12);
    color: #bff5dc;
    font-weight: 760;
}

.header-actions {
    grid-column: 3;
    justify-content: end;
    gap: 10px;
}

.fair-use-chip {
    display: grid;
    gap: 5px;
    min-width: 148px;
    padding: 7px 10px;
    border: 1px solid rgba(84, 215, 157, 0.24);
    border-radius: var(--radius);
    background: rgba(84, 215, 157, 0.08);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 740;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.fair-use-chip:hover,
.fair-use-chip:focus-visible {
    border-color: rgba(84, 215, 157, 0.42);
    background: rgba(84, 215, 157, 0.12);
    color: var(--text);
}

.fair-use-chip-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.fair-use-chip strong {
    color: var(--text);
    font-size: 0.84rem;
    white-space: nowrap;
}

.fair-use-chip-meter {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.fair-use-chip-meter span {
    display: block;
    width: var(--quota-percent, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mint), var(--cyan), var(--amber));
}

.ghost-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 680;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.ghost-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(167, 184, 218, 0.14);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid rgba(88, 213, 246, 0.24);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #2b8cff, #7859f7);
    color: #fff;
    font-weight: 760;
    box-shadow: 0 16px 34px rgba(45, 120, 255, 0.22);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        filter 160ms ease,
        transform 160ms ease;
}

.button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(45, 120, 255, 0.28);
}

.button:focus-visible,
.ghost-link:focus-visible,
.fair-use-chip:focus-visible,
.nav-menu-toggle:focus-visible,
.primary-nav a:focus-visible {
    outline: 2px solid rgba(88, 213, 246, 0.72);
    outline-offset: 3px;
}

.button-muted {
    border-color: rgba(167, 184, 218, 0.18);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.button-muted:hover {
    border-color: rgba(167, 184, 218, 0.28);
    background: rgba(255, 255, 255, 0.09);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 14px 30px rgba(0, 0, 0, 0.16);
}

.button-danger {
    border-color: rgba(210, 109, 145, 0.42);
    background: rgba(210, 109, 145, 0.14);
    box-shadow: none;
    color: #ffd7e4;
}

.button-small {
    min-height: 38px;
    padding: 0 15px;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.header-actions .button-small {
    min-height: 40px;
    border-color: rgba(88, 213, 246, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 12px 28px rgba(45, 120, 255, 0.2);
}

.full-width {
    width: 100%;
}

main {
    display: grid;
    gap: 22px;
    padding: 34px 0 28px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow:
        var(--shadow),
        0 0 28px rgb(var(--neon-primary-rgb) / var(--time-panel-glow-opacity));
    backdrop-filter: blur(18px);
}

