:root {
  color-scheme: dark;
  --ink: #f4eeeb;
  --muted: #c2b6bf;
  --accent: #ffb9a0;
  --accent-ink: #231313;
  --base: #111017;
  --panel: #201b29;
  --line: #ffffff20;
  --green: #8ce2b0;
  --danger: #b7384d;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box }
[hidden], .hidden { display: none !important }
body { margin: 0; background: var(--base); color: var(--ink) }
button, input { font: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .48 }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
h1, h2, p { margin: 0 }
.studio-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 48% 60%, #382338, transparent 66%), #100d15 }
.studio-shell { width: min(100%, 1080px); overflow: hidden; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 28px 92px #08060db8; background: var(--base) }
.sitebar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #15131c }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; letter-spacing: -.02em; font-size: 20px; font-weight: 700; text-decoration: none }
.wordmark b { color: var(--accent) }
.mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; color: var(--accent); background: #2a222e; border: 1px solid var(--line) }
.secure, .subtle { color: var(--muted); font-size: 13px }
.spread { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0,1.18fr) minmax(0,1fr); min-height: 456px; background: radial-gradient(ellipse at 46% 90%, #a844615e, transparent 64%), radial-gradient(ellipse at 13% 5%, #342440, transparent 66%), linear-gradient(112deg, #1c1524, #18141e 64%, #15131b) }
.spread::before { position: absolute; content: ""; inset: 0; z-index: -1; opacity: .37; background: repeating-linear-gradient(90deg, transparent 0 67px, #fff1 68px 69px), repeating-linear-gradient(0deg, transparent 0 67px, #fff1 68px 69px); mask-image: radial-gradient(ellipse at 25% 0%, black, transparent 78%) }
.spread::after { position: absolute; content: ""; inset: 0; z-index: -1; background: linear-gradient(103deg, transparent 26%, #17131b15 44%, #17131b91 71%, #17131bb8); pointer-events: none }
.lens { position: absolute; z-index: -1; pointer-events: none; width: clamp(300px,55%,630px); aspect-ratio: 1; left: 24%; top: 26%; border-radius: 50%; transform: rotate(-33deg) scaleY(.83); background: radial-gradient(ellipse at 33% 17%, #ffcfb8cc, transparent 11%), radial-gradient(ellipse at 45% 46%, #0f0b16 0 26%, #4e254a 41%, transparent 62%), conic-gradient(from 42deg, #1d1125, #7d3560 15%, #ffc0a7 23%, #6c3558 36%, #190e20 47%, #b66769 61%, #e8a496 66%, #42152e 76%, #1d1125); box-shadow: inset 0 0 36px #210f2f, 0 12px 68px #a84461ba; mask-image: radial-gradient(ellipse at 45% 47%, black 43%, #000b 57%, transparent 73%); opacity: .7 }
.lens::after { content: ""; position: absolute; inset: 7%; border: 1px solid #ffd3c657; border-radius: 50%; box-shadow: 0 0 0 12px #fff1, 0 0 0 25px #fff1, 0 0 0 39px #fff1, inset 0 0 25px #e2a1bd77 }
.cover { display: flex; flex-direction: column; justify-content: space-between; gap: 36px; min-width: 0; padding: clamp(24px,4.2vw,44px) }
.cover h1 { margin: 14px 0 18px; font: 400 clamp(38px,5.5vw,65px)/.99 Georgia, serif; letter-spacing: -.055em }
.cover h1 em { color: var(--accent) }
.cover p { color: #ded2dc; max-width: 255px }
.cover-foot, .studio-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: #d3c5d1; font-size: 12px }
.cover-foot span+span::before { content: "·"; margin-right: 10px; color: var(--accent) }
.studio-footer { justify-content: space-between; padding: 10px 24px; background: #15121c; border-top: 1px solid var(--line) }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--accent) }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px #8ce2b07a; flex: none }
.dot.bad { background: #fb8992; box-shadow: none }
.entry { display: flex; align-items: center; justify-content: center; padding: 28px clamp(20px,4.6vw,52px); min-width: 0 }
.entry-content { width: 100%; max-width: 330px; display: grid; gap: 17px }
.entry-content h2 { font-size: clamp(25px,3.4vw,33px); font-weight: 630; letter-spacing: -.04em; line-height: 1.15; margin-bottom: 6px }
.fields, .fields label, .password-group { display: grid; gap: 5px }
.fields { gap: 13px; font-size: 13px; color: #ddd3db }
.field { display: flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid #f9e4ec25; background: #100e17c9; border-radius: 10px; padding: 0 12px }
.field:focus-within { border-color: var(--accent) }
.field input { width: 100%; min-width: 0; min-height: 45px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: 0 }
.field input::placeholder { color: #a99fac }
.quiet { display: grid; place-items: center; padding: 8px; color: var(--muted); background: none; border: 0 }
.quiet svg, .ctrl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; background: linear-gradient(120deg,#f9dbca,var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 25px #a74d6640; text-decoration: none; text-align: center; font-size: 15px; font-weight: 600 }
.btn:hover, .ctrl:hover { filter: brightness(1.12) }
.btn.ghost, .ctrl { color: var(--ink); background: #292432; border: 1px solid var(--line); box-shadow: none }
.btn.compact { min-height: 40px; padding: 7px 12px; font-size: 13px }
.btn[aria-pressed="true"], .ctrl.active { color: var(--accent); border-color: #ffb9a060 }
.form-error { color: #ffacb4; font-size: 13px }
.invite { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: #100e17c9; overflow-wrap: anywhere; color: var(--accent); font: 12px/1.4 ui-monospace, monospace; user-select: all }
.stage { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; background: #121018 }
.stage:fullscreen { width: 100%; height: 100%; background: #121018 }
.call-header { min-height: 62px; padding-top: max(9px,env(safe-area-inset-top)); padding-bottom: 9px }
.call-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #231e2b; font-size: 12px }
.call-meta time { border-left: 1px solid var(--line); padding-left: 8px; font-weight: 650; font-variant-numeric: tabular-nums }
.call-area { position: relative; min-height: 0; margin: 12px 13px 0 }
.tiles { position: absolute; inset: 0; container-type: size; isolation: isolate; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; border-radius: 14px; overflow: hidden }
.tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #08070b }
.tile video { width: 100%; height: 100%; display: block; object-fit: contain }
.tile.local video { transform: scaleX(-1) }
.tile.local.sharing video { transform: none }
.nametag { position: absolute; left: 10px; bottom: 9px; padding: 4px 8px; border-radius: 6px; background: #0b0914cf; font-size: 12px; font-weight: 600 }
.tiles:not(.has-remote) { grid-template-columns: 1fr }
.tiles:not(.has-remote) .remote { display: none }
.tiles.spotlight { display: block; background: #08070b }
.tiles.spotlight .remote { position: absolute; inset: 0; border: 0 }
.tiles.spotlight .local { position: absolute; z-index: 2; top: 0; left: 0; width: min(clamp(94px,var(--pip-size,22%),340px),85cqh); aspect-ratio: 1.28; border-color: #f5d8e266; box-shadow: 0 7px 24px #08060ece; touch-action: none; cursor: grab; transform: translate3d(var(--pip-x,0px),var(--pip-y,0px),0); transition: transform 260ms cubic-bezier(.22,.75,.24,1) }
.tiles.spotlight .local video { object-fit: cover }
.tiles.spotlight .local.sharing video { object-fit: contain }
.tiles.spotlight .local.dragging { cursor: grabbing; transition: none }
.pip-close { display: none; position: absolute; z-index: 3; top: 4px; right: 4px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #120e19dd; color: var(--ink) }
.tiles.spotlight .pip-close { display: grid; place-items: center }
.drop-zones { position: absolute; inset: 0; z-index: 1; display: none; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 1px; pointer-events: none; background: linear-gradient(90deg,transparent calc(50% - .5px),#ffefdc55 calc(50% - .5px) calc(50% + .5px),transparent calc(50% + .5px)),linear-gradient(0deg,transparent calc(50% - .5px),#ffefdc55 calc(50% - .5px) calc(50% + .5px),transparent calc(50% + .5px)) }
.tiles.is-dragging .drop-zones { display: grid }
.drop-zones span { background: #15101a42 }
.drop-zones .is-target { background: #ffb9a032; box-shadow: inset 0 0 0 1px #ffb9a070 }
.controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding: 11px 13px max(11px,env(safe-area-inset-bottom)); background: #15121c }
.dock-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px }
.ctrl { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 10px }
.ctrl.off, .ctrl.hangup { background: var(--danger); border-color: #ff8d9855; color: #fff }
.badge { display: none; position: absolute; top: -6px; right: -5px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 99px; background: var(--danger); color: white; font: 700 10px/17px system-ui }
.badge.show { display: block }
#btnMic::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--green); border-radius: 12px; opacity: var(--lvl,0); pointer-events: none }
#btnMic.off::after { opacity: 0 }
.overlay { position: absolute; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 18px; overflow: auto; background: radial-gradient(ellipse at 40% 80%,#48263b,#17121e 67%) }
.overlay.show { display: flex }
.panel, .card { display: grid; gap: 13px; padding: 26px; width: min(100%,400px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg,#292031,#18151f); box-shadow: 0 22px 65px #09070eb0 }
.panel h2, .card h2 { font: 400 clamp(25px,5vw,34px)/1.12 Georgia, serif }
.panel p, .card p { color: var(--muted); font-size: 14px }
.card { position: absolute; z-index: 5; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(calc(100% - 32px),380px); display: none }
.card.show { display: grid }
.toast { position: absolute; z-index: 12; left: 50%; bottom: 85px; transform: translateX(-50%); max-width: 90vw; padding: 9px 14px; border-radius: 9px; background: #241e2e; border: 1px solid var(--line); opacity: 0; pointer-events: none; text-align: center; transition: opacity .16s }
.toast.show { opacity: 1 }
.chat { display: none; position: absolute; z-index: 7; top: 65px; bottom: 66px; right: 13px; width: min(335px,calc(100% - 26px)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #1c1724; box-shadow: 0 12px 30px #08060e99 }
.chat.show { display: grid; grid-template-rows: auto minmax(0,1fr) auto }
.chat-head, .chat-form { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line) }
.chat-close, .chat-form button { min-width: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; background: #342938; color: var(--ink) }
.chat-msgs { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding: 12px }
.msg { max-width: 85%; padding: 7px 10px; border-radius: 8px; overflow-wrap: anywhere; font-size: 14px }
.msg.me { align-self: flex-end; background: #613e50 }
.msg.them { align-self: flex-start; background: #342938 }
.chat-form { border-top: 1px solid var(--line); border-bottom: 0 }
.chat-form input { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #100e17; color: var(--ink) }
@media(max-width:680px) {
  .studio-page { padding: 12px }
  .studio-shell { border-radius: 17px }
  .spread { grid-template-columns: 1fr }
  .spread::after { background: linear-gradient(180deg,transparent 0,#17131b24 27%,#17131b9c 66%,#17131bba) }
  .lens { width: 92%; top: 0; left: 34%; opacity: .62 }
  .cover { padding: 22px; gap: 16px }
  .cover h1 { margin: 8px 0; font-size: 39px }
  .cover-foot { display: none }
  .entry { padding: 22px 18px }
  .entry-content { max-width: 420px }
  .sitebar, .studio-footer { padding-inline: 13px }
  .call-area { margin: 7px 7px 0 }
  .controls { padding-inline: 7px; gap: 7px }
  .controls .dock-group { gap: 5px }
  .call-label { display: none }
  .call-meta time { border: 0; padding: 0 }
  .tiles.has-remote:not(.spotlight) { grid-template-columns: 1fr; grid-template-rows: repeat(2,minmax(0,1fr)) }
}
@media(max-width:370px) {
  .ctrl { width: 38px; height: 38px }
  #btnPipToggle { font-size: 12px; padding-inline: 7px }
}
@media(pointer:coarse) {
  .ctrl, .pip-close { min-width: 44px; min-height: 44px }
  .quiet { min-width: 44px; min-height: 44px }
}
@media(orientation:landscape) and (max-height:500px) {
  .call-header { min-height: 49px }
  .call-area { margin-top: 4px }
  .controls { padding-block: 5px }
  .panel { padding: 14px; gap: 8px }
}
@media(prefers-reduced-motion:reduce) {
  .tiles.spotlight .local, .toast { transition: none }
}
