:root {
    color-scheme: dark;
    --bg: #2f2f2f;
    --panel: #444;
    --panel-dark: #333;
    --stage: #f6f6f6;
    --topbar: #777;
    --text: #f1f1f1;
    --muted: #c8c8c8;
    --line: #5c5c5c;
    --button: #f4f4f4;
    --button-text: #555;
    --accent: #58a6ff;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #1f1f1f;
    font-family: Arial, Helvetica, sans-serif;
}

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

.app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
}

.workspace {
    display: grid;
    grid-template-rows: 96px minmax(0, 1fr);
    min-width: 0;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto 160px;
    align-items: center;
    gap: 32px;
    padding: 20px 32px;
    background: var(--topbar);
    color: var(--text);
}

.stream-name {
    font-size: 24px;
    font-weight: 700;
}

.status {
    margin-top: 6px;
    color: #efefef;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 24px;
    font-weight: 700;
}

.topbar button,
.side-panel button {
    height: 42px;
    border: 0;
    border-radius: 2px;
    background: var(--button);
    color: var(--button-text);
    cursor: pointer;
}

.topbar button:disabled,
.side-panel button:disabled {
    opacity: 0.55;
    cursor: default;
}

.stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: var(--stage);
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.empty-video {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #8b8b8b;
    font-size: 24px;
    pointer-events: none;
}

.overlay-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.edit-button {
    position: absolute;
    right: 32px;
    bottom: 32px;
    width: 64px;
    height: 60px;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    background: #fff;
    color: #444;
    font-size: 22px;
    cursor: pointer;
}

.side-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 22px;
    padding: 24px 14px;
    background: var(--panel);
    color: var(--text);
    border-left: 1px solid var(--line);
}

.panel-section {
    display: grid;
    gap: 8px;
}

.panel-section label,
.panel-section span,
.section-title {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 0;
    border-radius: 2px;
    background: #f5f5f5;
    color: #333;
    padding: 8px;
}

input[type="color"] {
    height: 34px;
    padding: 0;
}

textarea {
    resize: vertical;
}

.streams {
    min-height: 0;
}

.stream-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow: auto;
}

.stream-item {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #666;
    background: var(--panel-dark);
    cursor: pointer;
}

.stream-item.selected {
    border-color: var(--accent);
}

.stream-title {
    color: #fff;
    font-weight: 700;
}

.stream-meta {
    color: var(--muted);
    font-size: 12px;
}

.tools {
    display: none;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.side-panel.editing .tools {
    display: grid;
}

.tool-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.tool-row label {
    display: grid;
    gap: 8px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tool-grid button {
    min-height: 48px;
}

.overlay-object {
    cursor: move;
}

.overlay-object.selected {
    filter: drop-shadow(0 0 3px var(--accent));
}

.preview {
    stroke-dasharray: 8 6;
    pointer-events: none;
}
