:root {
    color-scheme: dark;
    font-family: var(--chat-font-family, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size: var(--chat-font-size, 1rem);
    background: var(--chat-background, #061126);
    color: var(--chat-text, #e7efff);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(ellipse at 48% -15%, rgba(35, 83, 163, .25), transparent 47%),
        var(--chat-background, #061126);
    color: var(--chat-text, #e7efff);
}

body.radio-chat-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.chat-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(100% - 48px, 1760px);
    height: 100%;
    margin: 0 auto;
    padding: 10px 0;
}

.topbar {
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.live-status {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    border: 1px solid #174b81;
    border-radius: 9px;
    background: #081a34;
    color: #eef5ff;
    font-size: 0.875rem;
    font-weight: 650;
}

.live-indicator,
.online-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #00e3a2;
    box-shadow: 0 0 13px rgba(0, 227, 162, .35);
}

.status-divider {
    width: 1px;
    height: 18px;
    margin: 0 2px;
    background: #294265;
}

.broadcast-visibility {
    color: #c3d3ee;
    font-size: 0.75rem;
    font-weight: 450;
}

.connection-status {
    color: #ffcf77;
    font-size: 0.6875rem;
    font-weight: 500;
}

.admin-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #285193;
    border-radius: 8px;
    background: #102956;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

.admin-button[hidden] {
    display: none;
}

@media (max-width: 620px) {
    .topbar {
        flex-wrap: wrap;
    }
}

.role-badge {
    padding: 4px 7px;
    border-left: 1px solid #385785;
    color: #c1d5fb;
    font-size: 0.625rem;
    font-weight: 500;
}

.panel-tabs {
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid #174b81;
    border-radius: 9px;
    background: rgba(5, 20, 43, .9);
}

.panel-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 116px;
    height: 39px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #b6c8e8;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.panel-tab.is-active {
    background: linear-gradient(110deg, #313bd0, #1268dc);
    color: #fff;
    box-shadow: 0 5px 16px rgba(17, 91, 222, .23);
}

.radio-player {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 34px);
    height: clamp(190px, 27vh, 240px);
    min-height: 0;
    margin-top: 8px;
    padding: clamp(10px, 1.8vw, 20px);
    overflow: hidden;
    border: 1px solid var(--chat-accent, #2259a0);
    border-radius: 16px;
    background:
        linear-gradient(90deg, rgba(6, 17, 38, .78), rgba(6, 17, 38, .62) 55%, rgba(6, 17, 38, .48)),
        url("/chat/assets/autodj-background.png") center 50% / cover no-repeat,
        var(--chat-surface, #081a34);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

.player-artwork {
    position: relative;
    width: min(clamp(132px, 18vw, 190px), 20vh);
    aspect-ratio: 1;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: linear-gradient(145deg, var(--chat-accent, #137de8), var(--chat-background, #061126) 76%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .32);
}

.player-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-artwork-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(3rem, 8vw, 5rem);
}

.player-live-pill {
    position: absolute;
    top: 9px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 20px;
    background: rgba(14, 20, 34, .82);
    color: #fff;
    font-size: .625rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.player-live-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff3159;
    box-shadow: 0 0 10px rgba(255, 49, 89, .8);
}

.player-main {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: clamp(4px, .8vh, 8px);
}

.player-heading,
.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.player-kicker {
    color: #9db8e5;
    font-size: .625rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.player-station h2 {
    overflow: hidden;
    margin: 4px 0 0;
    color: var(--chat-text, #e7efff);
    font-size: clamp(1.125rem, 2.2vw, 1.625rem);
    font-weight: 750;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-listeners {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(170, 197, 240, .2);
    border-radius: 20px;
    background: rgba(4, 13, 30, .42);
    color: #d6e5ff;
    font-size: .6875rem;
    font-weight: 650;
}

.on-air-profile-button {
    padding: 8px 11px;
    border: 1px solid var(--chat-accent, #137de8);
    border-radius: 20px;
    background: rgba(4, 13, 30, .55);
    color: var(--chat-text, #e7efff);
    font-size: .6875rem;
    font-weight: 650;
    cursor: pointer;
}

.on-air-profile-button[hidden] {
    display: none;
}

.moderator-profile-dialog {
    position: fixed;
    width: min(440px, calc(100% - 32px));
    max-height: min(80vh, 680px);
    padding: 28px;
    overflow: auto;
    border: 1px solid var(--chat-accent, #137de8);
    border-radius: 14px;
    background: var(--chat-surface, #081a34);
    color: var(--chat-text, #e7efff);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}

.moderator-profile-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(3px);
}

.moderator-profile-dialog[open] {
    display: grid;
    gap: 12px;
}

.moderator-profile-dialog > img {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
}

.moderator-profile-dialog > img[hidden] {
    display: none;
}

.moderator-profile-dialog h2,
.moderator-profile-dialog p {
    margin: 0;
}

.moderator-profile-dialog p {
    white-space: pre-line;
    line-height: 1.55;
}

.moderator-profile-dialog nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.moderator-profile-dialog nav a {
    padding: 7px 10px;
    border: 1px solid var(--chat-accent, #137de8);
    border-radius: 18px;
    color: var(--chat-text, #e7efff);
    text-decoration: none;
}

.moderator-profile-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.player-track {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.player-track strong {
    overflow: hidden;
    color: var(--chat-text, #e7efff);
    font-size: clamp(1rem, 1.8vw, 1.375rem);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-track span {
    overflow: hidden;
    color: #a9bddc;
    font-size: .8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autodj-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 13px;
    border: 1px solid rgba(95, 183, 255, .25);
    border-radius: 10px;
    background: rgba(6, 17, 38, .22);
    box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

.autodj-banner[hidden],
#player-dj[hidden] {
    display: none;
}

.autodj-icon {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border: 1px solid rgba(118, 190, 255, .32);
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(40, 121, 221, .65), rgba(71, 54, 177, .58));
    color: #e6f4ff;
    font-size: 1.125rem;
}

.autodj-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.autodj-copy strong {
    color: #edf7ff;
    font-size: .6875rem;
    font-weight: 850;
    letter-spacing: .14em;
}

.autodj-copy small {
    overflow: hidden;
    color: #a9c5e8;
    font-size: .6875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autodj-equalizer {
    display: flex;
    height: 22px;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.autodj-equalizer i {
    width: 3px;
    height: 8px;
    border-radius: 3px;
    background: #64c8ff;
    box-shadow: 0 0 8px rgba(72, 179, 255, .45);
    animation: autodj-wave .8s ease-in-out infinite alternate;
}

.autodj-equalizer i:nth-child(2),
.autodj-equalizer i:nth-child(4) {
    height: 16px;
    animation-delay: .2s;
}

.autodj-equalizer i:nth-child(3) {
    height: 21px;
    animation-delay: .4s;
}

.autodj-equalizer i:nth-child(5) {
    animation-delay: .3s;
}

@keyframes autodj-wave {
    to { transform: scaleY(.42); opacity: .65; }
}

.player-controls {
    justify-content: flex-start;
}

.player-toggle {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--chat-accent, #137de8);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--chat-accent, #137de8) 40%, transparent);
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
}

.player-toggle:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: scale(1.05);
}

.player-toggle:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.player-volume-control {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(230px, 42%);
}

.player-mute {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #c9d9f3;
    font-size: .9375rem;
    cursor: pointer;
}

.player-mute:hover {
    background: rgba(255, 255, 255, .08);
}

.player-volume-control input {
    width: 100%;
    height: 4px;
    accent-color: var(--chat-accent, #137de8);
    cursor: pointer;
}

.player-status {
    margin-left: auto;
    color: #9db1d0;
    font-size: .6875rem;
    text-align: right;
}

.player-error {
    margin: -7px 0 0;
    color: #ffb6c1;
    font-size: .6875rem;
}

.player-error[hidden],
.player-artwork img[hidden],
.player-artwork-placeholder[hidden],
.player-live-pill[hidden] {
    display: none;
}

.soundwave {
    color: #cedcff;
    letter-spacing: 2px;
    font-size: 0.8125rem;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 23%);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    margin-top: 8px;
}

.chat-column,
.chat-panel,
.users-panel {
    min-width: 0;
    min-height: 0;
    border: 1px solid #174b81;
    border-radius: 9px;
    background: rgba(5, 19, 41, .96);
}

.chat-column {
    height: 100%;
}

.chat-panel {
    position: relative;
    display: flex;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.message-area {
    position: relative;
    flex: 1;
    min-height: 0;
}

.chat-watermark {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    opacity: .5;
    pointer-events: none;
}

.chat-watermark[hidden] {
    display: none;
}

.panel-tabs {
    position: relative;
    z-index: 1;
    min-height: 48px;
    flex: 0 0 48px;
    border: 0;
    border-bottom: 1px solid #193d6c;
    border-radius: 8px 8px 0 0;
    padding: 4px;
}

.panel-tab {
    min-width: 94px;
    height: 38px;
    padding: 0 13px;
}

.messages {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    gap: 13px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 14px 10px;
    scrollbar-width: none;
}

.messages::-webkit-scrollbar,
.users-panel::-webkit-scrollbar {
    display: none;
}

.empty-state {
    margin: auto;
    padding: 18px;
    color: #97afd5;
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
}

.messages[hidden],
.composer[hidden] {
    display: none;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 0 0 auto;
    animation: message-in .18s ease-out;
}

.messages > .message:first-of-type {
    margin-top: auto;
}

@keyframes message-in {
    from { opacity: .4; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(163, 193, 255, .46);
    border-radius: 50%;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 750;
    box-shadow: 0 2px 9px rgba(0, 0, 0, .3);
}

.avatar-mara { background: linear-gradient(145deg, #f8aa93, #803c93); }
.avatar-alex { background: linear-gradient(145deg, #f8d3a1, #344d86); }
.avatar-tobias { background: linear-gradient(145deg, #66c2e8, #324e8d); }
.avatar-blume { background: linear-gradient(145deg, #f5bb3e, #3c9b73); }
.avatar-night { background: linear-gradient(145deg, #81d1d1, #2b3c70); }
.avatar-luna { background: linear-gradient(145deg, #e6a3e8, #583ba0); }
.avatar-markus { background: linear-gradient(145deg, #e1b284, #315c7c); }
.avatar-bella { background: linear-gradient(145deg, #f2acbb, #76518f); }

.message-body {
    min-width: 0;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(5, 19, 41, .85);
}

.message-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #e9f1ff;
    font-size: 0.75rem;
}

.message-heading time {
    color: #92a9ce;
    font-size: 0.625rem;
}

.message-delete {
    padding: 2px 5px;
    border: 1px solid #41659c;
    border-radius: 4px;
    background: #102956;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.message-delete[hidden] {
    display: none;
}

.user-profile-button {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.user-profile-button:hover {
    text-decoration: underline;
}

.user-profile-button:focus-visible {
    outline: 2px solid #7da8ff;
    outline-offset: 2px;
}

.message-body p {
    margin: 4px 0 5px;
    color: #d3def2;
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: .025em;
}

.moderator { background: #7136e6; color: #fff; }
.badge.admin { background: #b94a20; color: #fff; }
.dj { background: #078bd9; color: #fff; }

.reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.reaction {
    min-width: 35px;
    padding: 3px 7px;
    border: 1px solid #254b82;
    border-radius: 16px;
    background: #10254a;
    color: #e5eeff;
    font-size: 0.6875rem;
    cursor: pointer;
}

.reaction.reacted {
    border-color: #7958ed;
    background: #29235f;
}

.pinned-message {
    display: block;
    margin-bottom: 3px;
    padding: 9px 12px;
    border: 1px solid #22579b;
    border-radius: 7px;
    background: linear-gradient(100deg, #0d2854, #0a1c3c);
}

.pinned-message p {
    margin: 4px 0 0 25px;
    color: #d5e2fb;
    font-size: 0.75rem;
}

.pin-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd9f1;
    font-size: 0.6875rem;
}

.pin-heading time {
    margin-left: auto;
    color: #a7bbdc;
    font-size: 0.625rem;
}

.composer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 58px;
    padding: 8px 10px;
    border-top: 1px solid #1b3c68;
    background: #071831;
}

.guest-name input,
.message-input input {
    width: 100%;
    height: 40px;
    border: 1px solid #244c86;
    outline: none;
    background: #0c2145;
    color: #ecf3ff;
    font-size: 0.75rem;
}

.guest-name {
    width: 125px;
    flex: 0 0 125px;
}

.guest-name input {
    padding: 0 10px;
    border-radius: 7px 0 0 7px;
}

.message-input {
    min-width: 0;
    flex: 1;
}

.message-input input {
    padding: 0 12px;
    border-left: 0;
    border-radius: 0 7px 7px 0;
}

.message-input input::placeholder,
.guest-name input::placeholder {
    color: #93a8cb;
}

.guest-name input:focus,
.message-input input:focus {
    border-color: #568aff;
}

.emoji-picker-wrap {
    position: relative;
    flex: 0 0 40px;
}

.emoji-button,
.send-button {
    height: 40px;
    border: 1px solid #294f8a;
    border-radius: 7px;
    background: #112956;
    cursor: pointer;
}

.emoji-button {
    width: 40px;
    color: #dce8ff;
    font-size: 1.1875rem;
}

.emoji-picker[hidden] {
    display: none;
}

.emoji-picker {
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: calc(100% + 9px);
    display: grid;
    width: min(292px, calc(100vw - 24px));
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 3px;
    padding: 8px;
    border: 1px solid #31588f;
    border-radius: 9px;
    background: #0a1c38;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

.emoji-option {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font-size: 1.1875rem;
    cursor: pointer;
}

.emoji-option:hover,
.emoji-option:focus-visible {
    outline: none;
    background: #1b3c68;
}

.send-button {
    min-width: 104px;
    padding: 0 13px;
    border-color: transparent;
    background: linear-gradient(105deg, #7042f6, #137de8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.send-button span {
    margin-right: 5px;
}

.prototype-note {
    margin: 0;
    padding: 0 12px 7px;
    background: #071831;
    color: #8398ba;
    font-size: 0.625rem;
}

.users-panel {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 13px;
    scrollbar-width: none;
}

.users-panel .empty-state {
    padding: 24px 8px;
    font-size: 0.6875rem;
}

.users-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 37px;
    padding-bottom: 9px;
    border-bottom: 1px solid #1b3d68;
    font-size: 0.875rem;
}

.users-heading > span:last-child {
    margin-left: auto;
    color: #a8c0e8;
    font-size: 1.25rem;
}

.presence-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: #b6c8e8;
    font-size: 0.6875rem;
}

.presence-control select {
    min-width: 0;
    padding: 5px;
    border: 1px solid #285193;
    border-radius: 6px;
    background: #102956;
    color: #fff;
    font: inherit;
}

.presence-error {
    margin: 6px 0 0;
    color: #ffcf77;
    font-size: 0.6875rem;
}

.chat-privacy-link {
    margin: 8px 0;
    font-size: 0.6875rem;
}

.chat-privacy-link a {
    color: #b6c8e8;
}

.online-dot.is-away {
    background: #ffbf47;
    box-shadow: 0 0 13px rgba(255, 191, 71, .35);
}

.online-dot.is-busy {
    background: #f66b75;
    box-shadow: 0 0 13px rgba(246, 107, 117, .35);
}

.user-info .user-presence.is-online { color: #5de3b4; }
.user-info .user-presence.is-away { color: #ffbf47; }
.user-info .user-presence.is-busy { color: #f66b75; }

.users-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 12px 0 8px;
    color: #dfe9fa;
    font-size: 0.75rem;
    font-weight: 700;
}

.users-section-title span {
    color: #bed0ee;
    font-size: 0.9375rem;
}

.user-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.user-row .avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 0.6875rem;
}

.user-info {
    display: grid;
    min-width: 0;
    gap: 3px;
    flex: 1;
}

.user-info > strong,
.user-info > .user-profile-button {
    overflow: hidden;
    color: #e7efff;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 650;
    line-height: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info small {
    overflow: hidden;
    color: #97afd5;
    font-size: 0.625rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info .badge {
    margin-left: 4px;
    vertical-align: 1px;
}

.online-dot {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
}

.listener-title {
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid #1b3d68;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

#connection-status {
    color: #ffcf77;
}

body .live-status,
body .chat-column,
body .chat-panel,
body .users-panel {
    border-color: var(--chat-accent, #174b81);
    background-color: var(--chat-surface, #081a34);
}

body .topbar .admin-button,
body .send-button {
    border-color: var(--chat-accent, #137de8);
    background: var(--chat-accent, #137de8);
}

body .radio-player {
    border-color: var(--chat-accent, #137de8);
    background-color: var(--chat-surface, #081a34);
}

body .composer,
body .prototype-note {
    background-color: var(--chat-background, #061126);
}

body .guest-name input,
body .message-input input,
body .emoji-button,
body .emoji-picker {
    border-color: var(--chat-accent, #137de8);
    background-color: var(--chat-background, #061126);
    color: var(--chat-text, #e7efff);
}

body .guest-name input:focus,
body .message-input input:focus {
    border-color: var(--chat-accent, #137de8);
}

body .message-body,
body .user-info strong,
body .user-info .user-profile-button,
body .users-section-title,
body .empty-state {
    color: var(--chat-text, #e7efff);
}

@media (max-width: 850px) {
    .chat-shell {
        width: min(100% - 28px, 740px);
        padding: 8px 0;
    }

    .workspace {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 8px;
    }

    .chat-panel,
    .users-panel {
        height: 100%;
        min-height: 0;
    }

    .panel-tab {
        min-width: 0;
        padding: 0 9px;
    }
}

@media (max-width: 620px) {
    .chat-shell {
        width: 100%;
        padding: 6px;
    }

    .topbar {
        min-height: 42px;
        gap: 5px;
    }

    .topbar form {
        margin: 0;
    }

    .live-status {
        min-width: 0;
    }

    #live-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .live-status {
        min-height: 36px;
        gap: 7px;
        padding: 0 9px;
        font-size: 0.6875rem;
    }

    .broadcast-visibility,
    .status-divider,
    .role-badge {
        display: none;
    }

    .admin-button {
        min-height: 36px;
        padding: 0 9px;
        font-size: 0.6875rem;
    }

    .radio-player {
        align-items: flex-start;
        gap: 12px;
        height: clamp(150px, 22vh, 190px);
        margin-top: 6px;
        padding: 8px;
    }

    .player-artwork {
        width: clamp(88px, 27vw, 124px);
        border-radius: 9px;
    }

    .player-main {
        gap: 11px;
        padding: 2px 0;
    }

    .player-heading {
        align-items: center;
        gap: 6px;
    }

    .player-station h2 {
        max-width: 100%;
        font-size: 1rem;
    }

    .player-listeners {
        padding: 5px 8px;
        font-size: .625rem;
    }

    .player-track strong {
        font-size: .875rem;
    }

    .player-track span {
        font-size: .6875rem;
    }

    .autodj-banner {
        gap: 8px;
        padding: 5px 8px;
    }

    .autodj-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .autodj-copy small {
        font-size: .625rem;
    }

    .autodj-equalizer {
        gap: 2px;
    }

    .player-controls {
        flex-wrap: wrap;
        gap: 7px;
    }

    .player-toggle {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .player-volume-control {
        width: min(150px, calc(100% - 48px));
    }

    .player-status {
        display: none;
    }

    .workspace {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 6px;
        margin-top: 6px;
    }

    .chat-panel {
        height: 100%;
        min-height: 0;
    }

    .panel-tabs {
        min-height: 43px;
        flex-basis: 43px;
    }

    .panel-tab {
        flex: 1;
        gap: 4px;
        padding: 0 3px;
        font-size: 0.625rem;
    }

    .messages {
        gap: 11px;
        padding: 10px 9px;
    }

    .avatar {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .message-body p {
        font-size: 0.75rem;
    }

    .composer {
        gap: 4px;
        padding: 6px;
    }

    .guest-name {
        width: 84px;
        flex-basis: 84px;
    }

    .guest-name input,
    .message-input input {
        height: 38px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 0.6875rem;
    }

    .emoji-button {
        width: 34px;
        height: 38px;
    }

    .emoji-picker-wrap {
        flex-basis: 34px;
    }

    .send-button {
        min-width: 40px;
        width: 40px;
        height: 38px;
        padding: 0;
        font-size: 0;
    }

    .send-button span {
        margin: 0;
        font-size: 1.125rem;
    }

    .users-panel {
        height: clamp(72px, 15vh, 112px);
        min-height: 0;
        overflow-y: auto;
        padding: 6px 9px;
    }

    .users-heading {
        min-height: 26px;
        padding-bottom: 4px;
        font-size: .75rem;
    }

    .users-section-title {
        margin: 5px 0;
        font-size: .6875rem;
    }

    .user-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .user-row {
        gap: 5px;
    }

    .user-row .avatar {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

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

@media (max-height: 620px) {
    .radio-player {
        height: clamp(170px, 46vh, 200px);
        padding: 8px;
    }

    .player-artwork {
        width: min(clamp(78px, 20vh, 124px), 18vh);
    }

    .autodj-banner {
        gap: 8px;
        padding: 5px 8px;
    }

    .autodj-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .player-toggle {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

@media (max-height: 620px) and (max-width: 620px) {
    .radio-player {
        height: 150px;
    }

    .autodj-banner {
        display: none;
    }
}

@media (max-height: 500px) and (min-width: 621px) {
    .topbar {
        min-height: 42px;
    }

    .radio-player {
        height: 150px;
        margin-top: 6px;
    }

    .autodj-banner {
        display: none;
    }
}

@media (max-height: 500px) and (max-width: 620px) {
    .workspace {
        grid-template-rows: minmax(0, 1fr);
    }

    .users-panel {
        display: none;
    }
}

.chat-auth {
    width: min(100% - 32px, 480px);
    margin: 8vh auto;
    padding: 28px;
    border: 1px solid #174b81;
    border-radius: 14px;
    background: var(--chat-surface, #081a34);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.chat-auth h1,
.chat-auth h2 {
    margin-top: 0;
}

.chat-auth section + section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #174b81;
}

.chat-auth form {
    display: grid;
    gap: 12px;
}

.chat-auth label {
    display: grid;
    gap: 6px;
    color: #b7c8e2;
    font-size: .9rem;
}

.chat-auth input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #28547f;
    border-radius: 7px;
    background: #061126;
    color: #e7efff;
}

.chat-auth button {
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: var(--chat-accent, #137de8);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.chat-auth a {
    color: #8bc4ff;
}

.chat-auth-message {
    padding: 12px;
    border-radius: 7px;
    background: rgba(19, 125, 232, .15);
}

/* Shared compact authentication screens. */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(ellipse at 20% 10%, #163766 0, transparent 55%), #040c1b; }
.auth-page .auth-card { box-sizing: border-box; width: min(100%, 520px); margin: 0; padding: 40px; border-color: #294362; border-radius: 24px; background: linear-gradient(145deg, #101f36, #081326); box-shadow: 0 30px 90px #0006; }
.auth-brand { color: #83bfff; font-size: .72rem; font-weight: 800; letter-spacing: .18em; margin-bottom: 24px; }
.auth-card h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -.04em; margin-bottom: 12px; }
.auth-card > p { color: #b7c8e2; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 5px; margin: 28px 0; background: #030c1b; border: 1px solid #294362; border-radius: 12px; }
.auth-tabs a { text-align: center; text-decoration: none; padding: 11px 4px; font-size: .85rem; border-radius: 8px; color: #aec1da; }
.auth-tabs a[aria-current] { background: #203d61; color: #fff; box-shadow: 0 2px 6px #0003; }
.auth-card form { gap: 19px; margin-top: 24px; }
.auth-card input { min-height: 50px; box-sizing: border-box; border-radius: 10px; }
.auth-card button { min-height: 50px; border-radius: 10px; background: #197ee8; font-size: .95rem; }
.auth-card button:hover { background: #3296ff; }
.auth-card :is(a, button, input):focus-visible { outline: 3px solid #83bfff; outline-offset: 3px; }
.auth-card footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; border-top: 1px solid #294362; padding-top: 22px; margin-top: 30px; font-size: .78rem; }
.auth-card .auth-footnote { font-size: .8rem; margin-top: 20px; }
@media (max-width: 540px) { .auth-page { padding: 20px 12px; } .auth-page .auth-card { padding: 28px 22px; } }

/* Cover and presenter portrait share exactly the same responsive dimensions. */
.radio-player { --player-cover-size: min(clamp(132px, 18vw, 190px), 20vh); height: auto; min-height: clamp(190px, 27vh, 240px); }
.player-artwork { width: var(--player-cover-size); height: var(--player-cover-size); box-sizing: border-box; }
.player-station { min-width: 0; flex: 1; }
.player-presenter { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 10px; }
.player-presenter-image { display: block; width: var(--player-cover-size); height: var(--player-cover-size); flex: 0 0 var(--player-cover-size); box-sizing: border-box; object-fit: contain; object-position: center; border: 2px solid var(--chat-accent, #137de8); border-radius: 12px; background: var(--chat-surface, #081a34); }
@media (max-width: 620px) {
    .radio-player { --player-cover-size: clamp(88px, 27vw, 124px); min-height: 150px; display: grid; grid-template-columns: var(--player-cover-size) minmax(0, 1fr); align-items: center; }
    .player-artwork { grid-column: 1; grid-row: 1; }
    .player-main { grid-column: 1 / -1; grid-row: 2; }
    .player-heading { flex-wrap: wrap; }
    .player-station { flex-basis: 100%; }
    .player-presenter { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--player-cover-size); align-items: center; gap: 6px; }
    .player-presenter .player-listeners { grid-column: 1; grid-row: 1; justify-self: end; align-self: end; }
    .player-presenter-image { grid-column: 2; grid-row: 1 / 3; }
    .player-presenter .on-air-profile-button { grid-column: 1; grid-row: 2; align-self: start; overflow-wrap: anywhere; }

}
@media (max-height: 620px) {
    .radio-player { --player-cover-size: min(clamp(78px, 20vh, 124px), 18vh); min-height: 150px; }
}

.presence-notice {
    margin: 8px 16px;
    color: #a9b4c9;
    font-size: 0.85rem;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Listener requests, reporting and session ignore controls. */
.message[hidden], .community-form[hidden] { display: none; }
.community-button { padding: 4px 7px; border: 1px solid #41659c; border-radius: 5px; background: #102956; color: #e7efff; font: inherit; font-size: 0.75rem; cursor: pointer; }
.community-button:disabled { opacity: .55; cursor: wait; }
.community-button[aria-pressed="true"] { border-color: #e6b55c; color: #ffd994; }
.request-open { width: 100%; margin: 12px 0; padding: 10px; }
.ignore-panel { margin-bottom: 12px; font-size: .75rem; color: #b7c9e3; }
.ignore-panel summary { cursor: pointer; padding: 6px 0; }
.ignore-panel ul { list-style: none; padding: 0; }
.ignore-panel li { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 6px 0; overflow-wrap: anywhere; }
.user-info .ignore-toggle { margin-top: 4px; align-self: flex-start; }
.community-dialog { position: fixed; width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #294d7b; border-radius: 12px; background: #081a34; color: #e7efff; }
.community-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.community-dialog h2 { margin: 0 28px 12px 0; font-size: 1.2rem; }
.community-dialog p { font-size: .85rem; line-height: 1.5; }
.community-close { position: absolute; right: 12px; top: 8px; background: transparent; color: #fff; border: 0; font-size: 1.8rem; cursor: pointer; }
.community-form { display: grid; gap: 12px; }
.community-form label { display: grid; gap: 6px; font-size: .85rem; }
.community-form input, .community-form select, .community-form textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: 9px; border: 1px solid #41659c; border-radius: 6px; background: #061126; color: #e7efff; font: inherit; }
.community-form textarea { resize: vertical; }
.community-dialog blockquote { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; margin: 12px 0; padding: 10px; border-left: 3px solid #41659c; }

/* Optional Owncast demo on the operator site. */
.owncast-offer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 0; padding: 14px 18px; border: 1px solid #426795; border-radius: 14px; background: #102744; color: #e7efff; }
.owncast-offer p { margin: 5px 0 0; font-size: .85rem; color: #c2d5ee; }
.owncast-offer nav { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.owncast-offer a { text-decoration: none; }
.auth-card .owncast-offer { display: block; margin-top: 24px; }
.auth-card .owncast-offer nav { margin-top: 14px; }
.has-owncast-demo .chat-shell { grid-template-rows: auto auto auto minmax(0, 1fr); }
@media (max-width: 850px) { .owncast-offer { align-items: flex-start; flex-direction: column; gap: 10px; padding: 10px 12px; } }
