* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #10151c;
    color: #ecf2f9;
    font-size: 15px;
    line-height: 1.55;
    --panel: #181f29;
    --border: #303b4a;
    --muted: #a8b6c7;
    --accent: #6be0de;
    --dark-accent: #132527;
}

.obs-document, .obs-page {
    background: transparent;
    margin: 0;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
}

.workspace {
    max-width: 1300px;
    margin: 0 auto;
    padding: clamp(14px, 3vw, 46px);
}

.operator-page .workspace {
    max-width: 780px;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

h1, h2, p {
    margin: 0;
}

h1 {
    font-size: clamp(25px, 4vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 720;
}

h2 {
    font-size: 17px;
    font-weight: 650;
}

.guest-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(250px, 1fr);
    gap: 16px;
    align-items: start;
}

.panel-stack {
    display: grid;
    gap: 14px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    min-width: 0;
}

.narrow-panel {
    max-width: 420px;
}

.panel-heading, .panel-controls, .panel-body {
    padding: 15px 17px;
}

.panel-heading {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.panel-body {
    display: grid;
    align-items: start;
    justify-items: start;
    gap: 16px;
    border-top: 1px solid var(--border);
}

.compact-body {
    font-size: 14px;
    color: var(--muted);
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    background: #6d8196;
    border-radius: 50%;
}

.status[data-tone="live"] {
    color: #82e7d8;
}

.status[data-tone="live"]::before {
    background: #66ddbe;
}

.status[data-tone="wait"] {
    color: #f0cd89;
}

.status[data-tone="wait"]::before {
    background: #e9bb66;
}

.status-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stage {
    position: relative;
    aspect-ratio: 16 / 9;
    min-width: 0;
    overflow: hidden;
    background: #090d13;
    border-block: 1px solid var(--border);
}

.stage video, .stage-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage video {
    object-fit: contain;
}

.stage-placeholder {
    display: grid;
    place-content: center;
    text-align: center;
    padding: 16px;
    background: #0d121a;
    color: var(--muted);
}

.button-row {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.button, input, select {
    border: 1px solid transparent;
    border-radius: 7px;
    font: inherit;
    min-height: 42px;
}

.button {
    font-weight: 650;
    padding: 7px 14px;
    cursor: pointer;
}

.button.primary {
    color: #101c23;
    background: var(--accent);
}

.button.secondary {
    color: #e5edf6;
    background: #222d39;
    border-color: #3b4b5d;
}

.button[aria-pressed="true"] {
    background: var(--dark-accent);
    border-color: #53bab5;
    color: #89e8e1;
}

.button.danger {
    color: #ffc1b9;
}

.button:hover:not(:disabled) {
    filter: brightness(1.12);
}

.button:disabled {
    opacity: 0.45;
    cursor: default;
}

button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.field {
    display: grid;
    gap: 7px;
    width: 100%;
    color: var(--muted);
    font-size: 13px;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    color: #f0f4f9;
    background: #101720;
    border-color: #3b4b5d;
}

.hint {
    color: var(--muted);
    font-size: 13px;
}

.microphone-panel > .inline-message {
    margin: 0 17px 15px;
}

.workspace > .inline-message {
    margin-top: 14px;
}

.inline-message {
    padding: 9px 11px;
    color: #dce9f7;
    border: 1px solid #394e62;
    border-radius: 7px;
    background: #202a36;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.inline-message[data-tone="error"] {
    color: #ffcbc4;
    border-color: #734b50;
    background: #31252c;
}

@media (max-width: 760px) {
    .guest-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 460px) {
    .panel-heading, .panel-controls, .panel-body {
        padding-inline: 12px;
    }

    .microphone-panel > .inline-message {
        margin-inline: 12px;
    }
}
