:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#24344c;background:#e7ecf8;font-synthesis:none}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{height:100vh;height:100svh;overflow:hidden}
.ambient{position:fixed;inset:0;z-index:-1;background:radial-gradient(ellipse at 12% 20%,#d5e4ff,transparent 46%),radial-gradient(ellipse at 90% 0%,#efe4ff,transparent 42%),radial-gradient(ellipse at 70% 100%,#d9f3f1,transparent 40%),#e7ecf8}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:default}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
.app{height:100%;display:flex;flex-direction:column;padding:14px 18px 16px;gap:12px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fffc;border:1px solid #ffffffea;border-radius:22px;padding:10px 14px 10px 16px;box-shadow:0 10px 30px #6d82aa14}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#1d2b42;font-weight:750;letter-spacing:1.5px;font-size:18px}
.brand-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:#fff;border:1px solid #e6edf8}
.brand-icon svg{width:26px;height:18px}
.top-actions{display:flex;align-items:center;gap:8px}
.text-btn,.icon-btn,.conn{border:0;background:transparent;color:#5d6d86;display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600}
.text-btn svg{width:16px;height:16px}
.icon-btn{width:34px;height:34px;border-radius:50%;background:#fff;border:1px solid #e6edf8;justify-content:center;color:#31445f}
.conn{background:#fff;border:1px solid #e6edf8;border-radius:999px;padding:7px 12px}
.conn i{width:8px;height:8px;border-radius:50%;background:#c5cedb;display:inline-block}
.conn.ok i{background:#3cba7a}
.conn.bad i{background:#e15b64}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#eef2f8;border:1px solid #e1e8f3;color:#31445f;font-size:12px;font-weight:750}
.workspace{flex:1;min-height:0;display:flex;gap:12px}
.stage-card,.panel,.switcher{background:#fffc;border:1px solid #ffffffea;box-shadow:0 16px 40px #6d82aa16}
.stage-card{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;border-radius:28px;overflow:clip}
.screen{flex:1;min-height:0;position:relative;display:grid;place-items:center;background:linear-gradient(180deg,#f7f9fd,#e7eef8)}
#placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center;padding:24px;width:100%;height:100%}
.art{width:min(340px,46%);aspect-ratio:1;object-fit:cover;border-radius:50%}
#screenText{margin:0;color:#5d6e88;font-size:15px}
.screen video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#101820}
.screen:fullscreen{background:#101820;border-radius:0}
.live-card{position:absolute;top:16px;right:16px;background:#ffffffd4;border:1px solid #fff;border-radius:16px;padding:10px 12px;backdrop-filter:blur(10px);text-align:right}
.live-card strong{display:block;font-size:14px}
.live-card span{color:#3f8f68;font-size:12px;font-weight:650}
.live-card i{width:7px;height:7px;border-radius:50%;background:#3cba7a;display:inline-block}
.fullscreen{position:absolute;right:14px;bottom:14px;border:1px solid #ffffffcc;background:#ffffffc7;border-radius:12px;width:38px;height:38px}
.dock{padding:14px 18px 16px;border-top:1px solid #eef2f8}
#join,.session-bar{display:flex;align-items:end;gap:16px}
.field{display:flex;flex-direction:column;gap:6px;font-size:11px;letter-spacing:1px;font-weight:750;color:#7b8ba3;min-width:0;flex:1}
.input,.code-chip{display:flex;align-items:center;gap:8px;height:48px;border:1px solid #e6edf6;background:#f8fafc;border-radius:14px;padding:0 12px;color:#8ea0b8}
.input svg,.code-chip svg{width:18px;height:18px;flex:none}
.input input,.code-chip input{border:0;background:transparent;width:100%;height:100%;outline:none;color:#24344c;font-size:14px;letter-spacing:0;direction:ltr;unicode-bidi:isolate}
#code,#joinedCode{letter-spacing:3px;font-size:16px}
.code-chip{flex:0 1 240px;font-size:11px;letter-spacing:.4px;font-weight:650;color:#8ea0b8;position:relative}
.code-chip input{padding-top:12px}
.code-chip::before{content:"Invite code";position:absolute;top:4px;left:12px;font-size:10px}
#copyCode{border:0;background:transparent;color:#607289;padding:4px}
.primary{height:48px;border:0;border-radius:14px;background:#243044;color:#fff;padding:0 18px;font-weight:700;display:inline-flex;align-items:center;gap:16px;box-shadow:0 8px 18px #24304422}
.primary:hover{background:#31445f}
.leave{height:44px;border:0;border-radius:14px;background:#fde8ea;color:#e15b64;font-weight:750;padding:0 16px;display:inline-flex;align-items:center;gap:8px}
.leave::before{content:"";width:14px;height:14px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 5h8v2H7v10h6v2H5zM13 8l5 4-5 4v-3H9v-2h4z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 5h8v2H7v10h6v2H5zM13 8l5 4-5 4v-3H9v-2h4z'/%3E%3C/svg%3E") center/contain no-repeat}
.round-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.round{border:0;background:transparent;color:#607289;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;font-weight:650;min-width:72px}
.bubble{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#f4f7fb;border:1px solid #e6edf6;color:#31445f}
.bubble svg{width:20px;height:20px}
.round.is-on .bubble,.round.is-active .bubble{background:#e8eeff;color:#3156d6;border-color:#d5e0ff}
.round:disabled{opacity:.45}
.dock-status{min-height:18px;margin:8px 0 0;color:#8a4b55;font-size:12px}
.dock-status:empty{display:none}
.rail{width:280px;flex:none;min-height:0;display:flex;flex-direction:column;align-items:stretch;gap:12px}
.panel{flex:1;min-height:0;overflow:clip;border-radius:24px;padding:14px;display:flex;flex-direction:column}
.panel header{display:flex;justify-content:space-between;align-items:center;font-weight:750;font-size:14px;margin-bottom:10px}
.panel header span{display:inline-flex;align-items:center;gap:6px}
.panel header svg{width:18px;height:18px}
.hint{font-size:11px;font-weight:600;color:#8ea0b8}
#peopleList,#messages{list-style:none;margin:0;padding:0;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px}
.person{display:grid;grid-template-columns:36px 1fr auto;gap:8px;align-items:center;background:#f7f9fc;border-radius:16px;padding:8px}
.person b{display:block;font-size:13px}
.person small{color:#6d7f98;font-weight:650}
.person .you{color:#8ea0b8;font-weight:650}
.face{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#e7eef8;color:#31445f;font-size:12px;font-weight:750}
.tag{font-size:10px;font-weight:750;color:#5b67d6;background:#eceeff;border-radius:999px;padding:2px 6px;margin-left:4px}
.mic-mark{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#7d8da6}
.invite{margin-top:10px;height:42px;border-radius:14px;border:1px solid #e6edf6;background:#f8fafc;color:#31445f;font-weight:700;display:flex;align-items:center;justify-content:center;gap:8px}
.invite svg{width:18px;height:18px}
#messages{flex:1}
#messages li{background:#f7f9fc;border-radius:14px;padding:8px 10px}
#messages li.mine{background:#e8eeff;margin-left:28px}
#messages li.empty{background:transparent;color:#8ea0b8;font-size:12px;line-height:1.4}
#messages b,#messages span{display:block;direction:ltr;unicode-bidi:isolate}
#messages b{font-size:12px}
#messages span{font-size:13px;color:#31445f}
.round.has-unread .bubble{box-shadow:inset 0 0 0 2px #3156d6}
#chatForm{display:flex;gap:8px;margin-top:10px;min-width:0}
#chatInput{flex:1;min-width:0;height:42px;border-radius:12px;border:1px solid #e6edf6;background:#f8fafc;padding:0 10px;direction:ltr;unicode-bidi:isolate}
.switcher{display:flex;align-items:center;gap:8px;width:100%;flex:none;margin:0;border-radius:22px;padding:10px;justify-content:space-around}
.menu{position:fixed;z-index:5;max-width:280px;background:#fff;border:1px solid #e6edf6;border-radius:16px;box-shadow:0 16px 40px #6d82aa22;padding:12px 14px;color:#4d5e78;font-size:13px;line-height:1.45}
.menu p{margin:0}
input:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #7ea0d8;outline-offset:2px}
[hidden]{display:none!important}
@media(max-width:980px){
  .text-btn span,.text-btn{font-size:0}
  .text-btn svg{font-size:initial}
  .text-btn{width:34px;height:34px;border-radius:50%;background:#fff;border:1px solid #e6edf8;justify-content:center}
  .rail{width:min(280px,42vw)}
}
@media(max-width:760px){
  html{-webkit-text-size-adjust:100%}
  .app{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));gap:8px}
  .topbar{gap:8px;padding:8px 10px;border-radius:18px}
  .brand{font-size:15px;letter-spacing:.4px;gap:6px;min-width:0}
  .brand-icon{width:32px;height:32px;flex:none}
  #networkText{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
  .conn{padding:8px}
  .top-actions{gap:4px}
  .workspace{flex-direction:column}
  .stage-card{flex:1 1 0;min-height:0;border-radius:22px}
  .rail{width:100%;flex:1 1 0;min-height:0}
  .screen{min-height:200px}
  #placeholder{gap:10px;padding:12px;min-height:0}
  .art{width:min(160px,46%);max-height:42%}
  #screenText{font-size:14px}
  .dock{padding:12px}
  #join{flex-direction:column;align-items:stretch;gap:10px}
  .session-bar{flex-wrap:wrap;align-items:center;gap:8px}
  .field,.code-chip{width:100%;flex:1 1 100%}
  .primary{width:100%;justify-content:center}
  .leave{width:auto;flex:none}
  .round-actions{width:auto;flex:1;margin-left:0;justify-content:flex-end}
  .live-card{padding:6px 8px;border-radius:12px}
  .live-card strong{font-size:12px}
  .live-card span{font-size:11px}
  .round{min-width:0;flex:1}
  .input input,.code-chip input,#chatInput{font-size:16px}
  #chatForm{align-items:center}
  #chatForm .primary{width:auto;height:42px;padding:0 14px;flex:none}
  .live-card{top:10px;right:10px;max-width:calc(100% - 64px)}
  .panel header{flex-wrap:wrap;gap:4px}
  #messages li.mine{margin-left:12px}
  .menu{max-width:calc(100vw - 24px)}
}
@media(max-width:760px) and (max-height:500px){
  .workspace{flex-direction:row}
  .screen{min-height:0}
  .rail{width:min(260px,46vw);flex:none}
  .art{width:96px;max-height:none}
  #join{flex-direction:row;flex-wrap:wrap;align-items:end}
  .session-bar{flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px}
  .field{flex:1 1 120px;width:auto}
  .code-chip{flex:1 1 100%;width:auto;min-width:0}
  #code,#joinedCode{letter-spacing:2px}
  .primary,.leave{width:auto;flex:none}
  .round-actions{flex:none}
  .bubble{width:40px;height:40px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
