:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  --bg: #101210;
  --panel: #191c19;
  --surface: #232923;
  --line: #373e36;
  --text: #f4f6ef;
  --muted: #b3bdb0;
  --accent: #d5f96f;
  --danger: #ffaba9;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 80% 0, #202718 0, var(--bg) 42rem); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3, .account-name { overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 4.6vw, 3.8rem); line-height: 1.06; letter-spacing: -.05em; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; }
h3 { font-size: 1.08rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shell { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, .brand, .account, .section-header { display: flex; align-items: center; gap: .75rem; }
.topbar-inner, .section-header { justify-content: space-between; }
.topbar-inner { min-height: 72px; padding-block: .65rem; }
.brand { font-size: 1.18rem; font-weight: 750; letter-spacing: -.04em; white-space: nowrap; }
.account { justify-content: flex-end; min-width: 0; }
.account-name, .muted { color: var(--muted); }
.muted { line-height: 1.55; }
.eyebrow { color: var(--accent); margin-bottom: .7rem; font-size: .77rem; font-weight: 720; letter-spacing: .09em; text-transform: uppercase; }
.entry { display: grid; place-items: start center; padding-block: clamp(3rem, 12vh, 8rem); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.entry-card { width: min(100%, 460px); padding: clamp(1.3rem, 5vw, 2.4rem); box-shadow: 0 20px 55px #0005; }
.entry-card h1 { font-size: clamp(1.95rem, 6vw, 2.9rem); margin-bottom: .9rem; }
.entry-card form { margin-top: 1.6rem; }
.page-heading { margin-block: clamp(1.8rem, 6vw, 4rem) 1.8rem; }
.workspace-grid { display: grid; grid-template-columns: minmax(230px, .85fr) minmax(0, 2.15fr); gap: 1rem; }
.rooms, .stage, .admin-card { min-width: 0; padding: clamp(1rem, 2vw, 1.4rem); }
.rooms .section-header { margin-bottom: .8rem; }
.room-list, .user-list { list-style: none; padding: 0; display: grid; gap: .65rem; }
.room { min-width: 0; display: grid; gap: .55rem; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; }
.room.active { border-color: var(--accent); }
.room p { font-size: .86rem; overflow-wrap: anywhere; }
.room .button { justify-self: start; }
.stage-empty { min-height: 22rem; display: grid; place-content: center; justify-items: center; text-align: center; padding: 1rem; gap: .7rem; }
.stage-mark { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 22px; background: #2c361c; color: var(--accent); margin-bottom: .25rem; }
.stage-mark svg { stroke: currentColor; stroke-width: 1.5; }
.call-heading { align-items: baseline; flex-wrap: wrap; margin-bottom: .85rem; }
.call-state { color: var(--accent); font-size: .87rem; overflow-wrap: anywhere; }
.video-stage { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 15px; background: #0b0e0b; }
video { display: block; width: 100%; height: 100%; object-fit: contain; }
.remote-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: #0b0e0b; color: var(--muted); text-align: center; font-size: .9rem; }
.preview { position: absolute; width: clamp(95px, 29%, 190px); aspect-ratio: 4 / 3; bottom: .6rem; right: .6rem; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.preview video { object-fit: cover; transform: scaleX(-1); }
.preview-label, .camera-overlay { position: absolute; color: var(--text); font-size: .75rem; }
.preview-label { left: .35rem; bottom: .3rem; border-radius: .35rem; background: #000c; padding: .14rem .4rem; }
.camera-overlay { inset: 0; display: grid; place-items: center; text-align: center; background: var(--surface); padding: .15rem .3rem 1rem; }
.controls { margin-top: .85rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.controls .danger { margin-inline-start: auto; }
.admin { margin-block: 2.2rem; }
.admin > h2 { margin-bottom: .8rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-card > h3 { margin-bottom: 1rem; }
.users-details { margin-top: 1.2rem; color: var(--muted); }
.users-details summary { cursor: pointer; }
.users-details ul, .users-details p { margin-top: .55rem; }
.user-list { gap: .25rem; overflow-wrap: anywhere; }

form { display: grid; gap: .85rem; }
label { display: grid; gap: .35rem; font-size: .88rem; }
label.check { display: flex; align-items: center; gap: .55rem; }
input:not([type='checkbox']), select { width: 100%; min-width: 0; min-height: 43px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: .55rem .7rem; }
input[type='checkbox'] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.button { border: 1px solid transparent; border-radius: 10px; min-height: 42px; padding: .45rem .82rem; cursor: pointer; font-size: .87rem; font-weight: 660; }
.button:disabled { opacity: .53; cursor: not-allowed; }
.button.primary { background: var(--accent); color: #171e0d; }
.button.primary:hover:not(:disabled) { background: #e1ff9b; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button.secondary:hover:not(:disabled), .button.ghost:hover:not(:disabled) { background: #30382f; color: var(--text); }
.button.secondary[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger { background: #502726; color: #fff0ef; }
.button.danger:hover:not(:disabled) { background: #673130; }
.message { color: var(--accent); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.error { color: var(--danger); }
#workspace-error { margin-block: -.75rem 1rem; }

@media (max-width: 690px) {
  .workspace-grid, .admin-grid { grid-template-columns: 1fr; }
  .workspace-grid:has(#call-stage:not([hidden])) .stage { order: -1; }
  .stage-empty { min-height: 13rem; }
  .controls .danger { margin-inline-start: 0; }
}
