:root{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#f7f8fc;background:#080a0f}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:radial-gradient(circle at 15% 0%,rgba(108,84,255,.24),transparent 31%),radial-gradient(circle at 85% 7%,rgba(53,130,255,.16),transparent 25%),linear-gradient(180deg,#121624 0%,#090b11 48%,#07090d 100%)}body{min-height:100vh}button,input{font:inherit}button,.button-link{border:1px solid #303746;background:#181c27;color:#fff;border-radius:14px;padding:10px 14px;cursor:pointer;text-decoration:none}button:hover{background:#252b3a}.primary{border-color:#705fff!important;background:linear-gradient(135deg,#6254ff,#8068ff)!important}.danger{border-color:#96384a!important;background:linear-gradient(135deg,#9d3145,#d64b58)!important}.big{width:100%;padding:14px;font-weight:800}input{width:100%;border:1px solid #313848;background:#0f131b;color:#fff;border-radius:14px;padding:12px 14px;outline:none}.hidden{display:none!important}.brand-row{display:flex;gap:10px;align-items:center}.logo{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-weight:900;background:linear-gradient(135deg,#6657ff,#9f6cff)}.mini{width:36px;height:36px;border-radius:10px}.muted,.hint{color:#9ba3b4}.small{font-size:.82rem}.landing{min-height:100vh;display:grid;place-items:center;padding:24px}.card{width:min(660px,100%);background:rgba(16,19,28,.9);border:1px solid rgba(105,116,148,.27);border-radius:28px;padding:32px;box-shadow:0 32px 100px rgba(0,0,0,.4)}.card h1{font-size:clamp(2.3rem,6vw,4.6rem);line-height:.98;letter-spacing:-.045em;margin:26px 0 18px}.lead{color:#bdc4d2;font-size:1.08rem;line-height:1.58}.card label{display:grid;gap:8px;margin:28px 0 12px}.features{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.features div{padding:15px;border-radius:17px;background:#11151e;border:1px solid #29303f}.features b,.features span{display:block}.features span{margin-top:6px;color:#9098aa;font-size:.84rem}.hint{font-size:.9rem;line-height:1.45}.room{height:100dvh;overflow:hidden}.topbar{min-height:72px;display:flex;align-items:center;justify-content:space-between;padding:12px 18px;border-bottom:1px solid #282e3c;background:rgba(9,11,17,.9);position:sticky;top:0;z-index:5;backdrop-filter:blur(10px)}.top-actions{display:flex;gap:10px;align-items:center}.status{font-size:.9rem;padding:7px 10px;border-radius:999px;background:#292f3c}.status.online{background:#173a26;color:#9ff0ba}.layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;height:calc(100dvh - 72px);min-height:0}.stage{min-width:0;min-height:0;padding:14px;display:flex;flex-direction:column;gap:12px;overflow:hidden}.videos{flex:1;min-height:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr));gap:12px;align-content:start;overflow:auto}.videos.empty{display:none}.avatars-strip{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px;min-height:0;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:0 2px 2px}.video-card{position:relative;overflow:hidden;border-radius:20px;background:#151a24;border:1px solid #2d3444;box-shadow:0 10px 28px rgba(0,0,0,.18);aspect-ratio:16/9;min-width:0;width:100%}.video-card video{width:100%;height:100%;object-fit:cover;display:block;background:#0d1118}.video-card.local video{transform:scaleX(-1)}.video-card.video-off{aspect-ratio:auto;width:90px;height:auto;min-width:90px;border:none;background:transparent;box-shadow:none;overflow:visible;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:0}.video-card.video-off video{display:none}.avatar{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;border-radius:50%;display:none;align-items:center;justify-content:center;background:#292e42;border:3px solid #444b60;color:#fff;font-weight:800;font-size:22px;transition:border-color .12s,box-shadow .12s}.video-card.video-off .avatar{position:relative;left:auto;top:auto;transform:none;display:flex;width:74px;height:74px}.avatar.speaking{border-color:#42e387;box-shadow:0 0 0 5px rgba(53,209,120,.19),0 0 22px rgba(53,209,120,.33)}.video-card.has-video .avatar{display:flex;left:auto;top:auto;right:12px;bottom:12px;transform:none;width:32px;height:32px;font-size:11px;border-width:2px;opacity:.95}.badge{position:absolute;left:12px;bottom:12px;padding:6px 9px;border-radius:9px;background:rgba(0,0,0,.58);font-size:.85rem;backdrop-filter:blur(8px)}.video-card.video-off .badge{position:static;margin-top:8px;padding:0;background:transparent;font-size:.78rem;text-align:center;color:#d7dbeb;max-width:94px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.video-actions{position:absolute;right:10px;top:10px;display:flex;align-items:center;gap:6px;background:rgba(10,12,18,.72);padding:5px 7px;border-radius:11px;backdrop-filter:blur(8px)}.video-actions button{padding:2px 7px;border-radius:7px}.video-actions input{width:76px;padding:0;accent-color:#8a79ff;cursor:pointer}.video-card.video-off .video-actions{position:static;margin-top:6px;padding:0;background:transparent;backdrop-filter:none}.video-card.video-off .expand-video{display:none}.video-card.video-off .video-actions input{width:70px}.controls{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;flex:0 0 auto}.mic-fader{display:flex;align-items:center;gap:7px;background:#181c27;border:1px solid #303746;border-radius:14px;padding:5px 10px;font-size:.82rem;color:#d5d8e6}.mic-fader input{width:85px;padding:0;accent-color:#8a79ff;cursor:pointer}.mic-fader span{min-width:35px}.sidebar{border-left:1px solid #282e3c;background:rgba(14,16,23,.93);display:flex;flex-direction:column;min-height:0;overflow:hidden}.chat-head{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid #282e3c;flex:0 0 auto}.messages{flex:1;min-height:0;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px}.message{align-self:flex-start;max-width:88%;background:#202532;padding:9px 11px;border-radius:13px;overflow-wrap:anywhere}.message.mine{align-self:flex-end;background:linear-gradient(135deg,#5143c6,#6b54e8)}.message.system{align-self:center;background:transparent;color:#8f95a5;font-size:.85rem;text-align:center}.message-head{font-size:.75rem;color:#c8ccda;margin-bottom:4px}.message img{display:block;max-width:100%;max-height:320px;border-radius:10px}.composer{display:grid;grid-template-columns:1fr auto auto;gap:8px;padding:12px;border-top:1px solid #282e3c;flex:0 0 auto}.file-button{display:grid;place-items:center;width:44px;border:1px solid #303746;border-radius:14px;cursor:pointer;background:#191d27}.room.drag-active:after{content:'Отпустите изображение для отправки';position:fixed;inset:15px;z-index:20;border:2px dashed #8f84ff;border-radius:18px;background:rgba(12,14,24,.8);display:grid;place-items:center;pointer-events:none;font-size:1.2rem}.video-card:fullscreen{width:100vw;height:100vh;max-height:none;aspect-ratio:auto;border-radius:0;background:#090b11}.video-card:fullscreen video{object-fit:contain}.video-card:fullscreen.has-video .avatar{right:22px;bottom:22px}.video-card:fullscreen .video-actions{right:20px;top:20px}
@media(max-width:900px){.layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) minmax(200px,38dvh)}.sidebar{border-left:0;border-top:1px solid #292f3e}.features{grid-template-columns:1fr}}
@media(max-width:700px){body{overflow:hidden}.topbar{min-height:58px;padding:8px 10px;gap:10px}.top-actions{gap:6px}.top-actions button{padding:8px 10px}.layout{height:calc(100dvh - 58px);grid-template-rows:minmax(0,1fr) minmax(185px,34dvh)}.stage{padding:8px;gap:8px}.videos{grid-template-columns:1fr;gap:8px}.video-card{border-radius:18px}.controls{gap:6px;justify-content:stretch}.controls>button,.controls>.mic-fader{flex:1 1 calc(50% - 6px);min-width:0}.controls button{padding:9px 10px}.mic-fader{justify-content:center;padding:5px 8px}.mic-fader input{width:72px}.avatars-strip{gap:8px}.video-card.video-off{width:82px;min-width:82px}.video-card.video-off .avatar{width:66px;height:66px}.messages{padding:10px}.composer{padding:8px;gap:6px}.composer input{padding:10px 12px}.file-button{width:40px}}
@media(max-width:430px){.brand-row{gap:8px}.logo.mini{width:32px;height:32px}.topbar .small{font-size:.75rem}.top-actions{flex-wrap:nowrap}.top-actions button{font-size:.86rem}.status{font-size:.78rem;padding:6px 8px}.controls>button,.controls>.mic-fader{flex:1 1 100%}.layout{grid-template-rows:minmax(0,1fr) minmax(205px,38dvh)}}

/* v5 compact layout */
html,body,.room,.layout,.stage,.sidebar{overflow:hidden}
.videos,.avatars-strip,.messages{scrollbar-width:none;-ms-overflow-style:none}
.videos::-webkit-scrollbar,.avatars-strip::-webkit-scrollbar,.messages::-webkit-scrollbar{width:0;height:0;display:none}

/* when only local video is present, keep preview compact instead of huge */
.videos:has(.video-card.local):not(:has(.video-card:not(.local))){
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  overflow:hidden;
}
.videos:has(.video-card.local):not(:has(.video-card:not(.local))) .video-card.local.has-video{
  width:min(34vw, 420px);
  max-width:420px;
  min-width:260px;
  aspect-ratio:16/9;
}

/* two participant view should stay balanced and not create scroll */
.videos:has(.video-card:nth-child(2)){
  grid-auto-rows:1fr;
}

/* hide visible scrollbars in fullscreen video area if any */
.video-card, .video-card video{overflow:hidden}

@media (max-width: 1100px){
  .videos:has(.video-card.local):not(:has(.video-card:not(.local))) .video-card.local.has-video{
    width:min(42vw, 360px);
    min-width:220px;
  }
}
@media (max-width: 700px){
  .videos:has(.video-card.local):not(:has(.video-card:not(.local))) .video-card.local.has-video{
    width:min(58vw, 250px);
    min-width:170px;
  }
  .stage{padding:8px 8px 6px}
  .avatars-strip{padding-bottom:0}
  .layout{grid-template-rows:minmax(0,1fr) minmax(180px,34dvh)}
}
@media (max-width: 430px){
  .videos:has(.video-card.local):not(:has(.video-card:not(.local))) .video-card.local.has-video{
    width:min(62vw, 220px);
    min-width:150px;
  }
  .layout{grid-template-rows:minmax(0,1fr) minmax(175px,36dvh)}
}


/* v7 bottom dock + icon controls */
.stage{position:relative;padding-bottom:92px}
.controls{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:6;display:flex;justify-content:center;gap:9px;flex-wrap:nowrap;align-items:center;padding:8px 10px;border:1px solid rgba(49,56,72,.9);border-radius:18px;background:rgba(11,14,22,.82);backdrop-filter:blur(12px);box-shadow:0 12px 28px rgba(0,0,0,.25);width:max-content;max-width:calc(100% - 28px)}
.icon-btn{display:grid;place-items:center;width:46px;height:46px;padding:0;border-radius:14px;background:#181c27;border:1px solid #303746}
.icon-btn svg,.control-icon svg{width:22px;height:22px;display:block;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.leave-btn svg{width:20px;height:20px}
.mic-fader{display:flex;align-items:center;gap:8px;background:#181c27;border:1px solid #303746;border-radius:14px;padding:0 10px;height:46px;font-size:.82rem;color:#d5d8e6;min-width:170px}
.mic-fader .control-icon{display:grid;place-items:center;color:#fff}
.mic-fader input{width:92px;padding:0;accent-color:#8a79ff;cursor:pointer}
.mic-fader span:last-child{min-width:38px;text-align:right}
.screen-audio-hint{position:absolute;left:50%;bottom:76px;transform:translateX(-50%);z-index:5;background:rgba(9,11,17,.88);border:1px solid #2c3242;border-radius:12px;padding:8px 12px;color:#9ca5b9;font-size:.82rem;backdrop-filter:blur(8px);max-width:min(92vw,540px);text-align:center}
.topbar{z-index:8}
/* ensure buttons do not drift upward on empty room */
.videos,.avatars-strip{max-width:100%}
@media(max-width:900px){.stage{padding-bottom:84px}.controls{bottom:10px;gap:7px;padding:8px}.icon-btn{width:42px;height:42px}.mic-fader{height:42px;min-width:150px}}
@media(max-width:700px){.stage{padding-bottom:126px}.controls{position:absolute;left:8px;right:8px;bottom:8px;transform:none;max-width:none;width:auto;display:grid;grid-template-columns:repeat(4,42px) 1fr 42px;justify-content:center}.controls>#toggleMic{grid-column:1}.controls>#toggleCam{grid-column:2}.controls>#shareScreen{grid-column:3}.controls>#leaveRoom{grid-column:4}.controls>.mic-fader{grid-column:5/7;min-width:0;width:100%}.mic-fader input{width:100%}.screen-audio-hint{bottom:118px;left:8px;right:8px;transform:none;max-width:none}}
@media(max-width:430px){.controls{grid-template-columns:repeat(4,40px) 1fr 40px;gap:6px;padding:6px}.icon-btn{width:40px;height:40px;border-radius:12px}.mic-fader{height:40px;padding:0 8px}.mic-fader span:last-child{font-size:.78rem;min-width:32px}.screen-audio-hint{font-size:.77rem;padding:7px 10px}}


/* v8. Minimal chat drawer + stable mobile call controls. */
.room{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden}
.room>.topbar{flex:0 0 auto;position:relative}
.room>.layout{flex:1 1 auto;min-height:0;height:auto;overflow:hidden}
.room.chat-collapsed>.layout{grid-template-columns:minmax(0,1fr)}
.room.chat-collapsed .sidebar{display:none}
.room.chat-open .sidebar{display:flex}

.chat-toggle,.chat-close{position:relative;flex:none;display:grid;place-items:center;min-width:36px;height:36px;border-radius:12px;padding:6px;color:#cfd5e4}
.chat-toggle svg,.chat-close svg,.mobile-chat-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.chat-toggle.is-active,.mobile-chat-toggle.is-active{border-color:#7168a8;color:#f2efff;background:#26233e}
.chat-unread{position:absolute;right:-5px;top:-6px;min-width:17px;height:17px;padding:1px 3px;border-radius:99px;background:#7768ff;color:#fff;display:grid;place-items:center;font-size:.62rem;font-weight:800;pointer-events:none}
.chat-head{gap:8px}
.chat-head .chat-close{margin-left:auto;width:30px;min-width:30px;height:30px;background:transparent}
.mobile-chat-toggle{display:none}

/* Room fits viewport without page scrolling, chat messages scroll internally. */
.room .stage{min-height:0;overflow:hidden}
.room .videos{min-height:0;overflow-y:auto;scrollbar-width:none}
.room .sidebar .messages{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.room .sidebar .messages::-webkit-scrollbar,.room .videos::-webkit-scrollbar{display:none}

@media(max-width:700px){
 .room>.topbar{min-height:54px;max-height:64px;padding:7px 10px}
 .room>.layout,.room.chat-collapsed>.layout{position:relative;display:block;flex:1 1 auto;height:auto;min-height:0}
 .room>.layout>.stage{height:100%;width:100%;min-width:0;box-sizing:border-box;padding:9px 9px calc(116px + env(safe-area-inset-bottom,0px));gap:8px;overflow:hidden}
 .room>.layout>.stage .videos{max-height:100%;min-height:0;overflow-y:auto}
 .room>.layout>.stage .avatars-strip{flex:none;max-height:100px;overflow-x:auto;overflow-y:hidden}
 .room>.layout>.sidebar{position:absolute;z-index:9;left:8px;right:8px;bottom:calc(110px + env(safe-area-inset-bottom,0px));width:auto;height:min(49dvh,385px);max-height:calc(100% - 120px);min-height:0;border:1px solid #303746;border-radius:17px;background:#10131b;box-shadow:0 14px 45px rgba(0,0,0,.65);overflow:hidden}
 .room.chat-collapsed>.layout>.sidebar{display:none}
 .room.chat-open>.layout>.sidebar{display:flex}
 .room>.layout>.stage>.controls{left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));transform:none;width:auto;max-width:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:44px 36px;gap:7px;padding:7px 8px;justify-items:center;align-items:center;border-radius:17px;z-index:12}
 .room .controls>.icon-btn{width:44px;height:44px;min-width:0;min-height:0;justify-self:center;padding:0;flex:none}
 .room .controls>#toggleMic{grid-column:1;grid-row:1}
 .room .controls>#toggleCam{grid-column:2;grid-row:1}
 .room .controls>#shareScreen{grid-column:3;grid-row:1}
 .room .controls>#toggleChatMobile{grid-column:4;grid-row:1;display:grid}
 .room .controls>#leaveRoom{grid-column:5;grid-row:1}
 .room .controls>.mic-fader{grid-column:1 / -1;grid-row:2;display:flex;width:100%;min-width:0;height:36px;max-height:36px;justify-self:stretch;margin:0;padding:0 11px;border-radius:11px;gap:9px;flex:none}
 .room .controls>.mic-fader input{width:auto;min-width:0;flex:1;height:22px}
 .room .controls>.mic-fader .control-icon{flex:0 0 auto}
 .room .controls>.mic-fader span:last-child{min-width:38px;flex:0 0 38px}
 .room .screen-audio-hint{bottom:calc(117px + env(safe-area-inset-bottom,0px))}
 .room .top-actions{gap:6px;flex-wrap:nowrap}
 .room .top-actions #toggleChatHeader{display:none}
 .room .composer{padding:8px;gap:7px}
 .room .composer input{font-size:16px;min-width:0}
}
@media(max-width:430px){
 .room .controls>.icon-btn{width:40px;height:40px}
 .room>.layout>.stage>.controls{grid-template-rows:40px 34px;gap:6px}
 .room>.layout>.stage{padding-bottom:calc(108px + env(safe-area-inset-bottom,0px))}
 .room>.layout>.sidebar{bottom:calc(110px + env(safe-area-inset-bottom,0px));height:min(48dvh,350px)}
 .room .controls>.mic-fader{height:34px;max-height:34px}
 .room .top-actions #copyLink{font-size:0;display:grid;place-items:center;width:34px;min-width:34px;height:34px;padding:0}
 .room .top-actions #copyLink::after{content:'🔗';font-size:16px}
 .room .status{padding:6px 8px;font-size:.78rem}
}

/* v15 P2PARTY — language selector and image viewer */
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.landing-language{display:flex;justify-content:flex-end;margin:-10px -8px 0 0}
.language-switch{display:inline-flex;align-items:center;gap:7px;color:#afb7cb;font-size:.78rem;white-space:nowrap;flex-shrink:0}
.language-picker{appearance:none;-webkit-appearance:none;width:auto;min-width:60px;max-width:70px;height:34px;padding:5px 20px 5px 9px;color:#f1f2ff;background:#1a1e2b;border:1px solid #3a4257;border-radius:10px;font-size:.75rem;font-weight:700;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23c5c8d4' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center}
.language-picker:focus-visible,.image-viewer button:focus-visible,.image-viewer a:focus-visible,.message-image-button:focus-visible{outline:2px solid #9a89ff;outline-offset:3px}
.room-language{margin-right:2px}
.message-image-button{display:block;border:0;border-radius:12px;max-width:100%;width:max-content;min-width:0;padding:0;margin:6px 0 0;background:none;box-shadow:none;text-align:left;cursor:zoom-in;overflow:hidden}
.message-image-button:hover{background:none;filter:brightness(1.08)}
.message-image-button img{max-width:100%;max-height:220px;display:block;border-radius:12px;object-fit:contain}
.image-viewer{position:fixed;inset:0;z-index:999;display:grid;place-items:center;isolation:isolate;padding:12px}
.image-viewer-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.79);backdrop-filter:blur(7px)}
.image-viewer-panel{position:relative;z-index:1;display:flex;flex-direction:column;width:min(34vw,610px);min-width:min(350px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 28px);background:#171b28;border:1px solid #49506b;border-radius:18px;box-shadow:0 24px 90px rgba(0,0,0,.7);overflow:hidden}
.image-viewer-header{display:flex;justify-content:space-between;align-items:center;min-height:52px;padding:10px 14px;border-bottom:1px solid #32384b}
.image-viewer-close{height:34px;min-width:34px;padding:0;border-radius:10px;font-size:26px;line-height:1;display:grid;place-items:center}
.image-viewer-media{display:grid;place-items:center;min-height:0;overflow:hidden;padding:12px;flex:1}
.image-viewer-media img{display:block;max-width:100%;max-height:min(64dvh,700px);object-fit:contain;border-radius:8px}
.image-viewer-footer{display:flex;justify-content:flex-end;padding:10px 14px;border-top:1px solid #32384b}
.image-viewer-download{display:inline-flex;align-items:center;justify-content:center;min-height:37px;padding:7px 18px;border-radius:11px;color:white;text-decoration:none;font-weight:700;font-size:.9rem}
@media(max-width:700px){.image-viewer-panel{width:calc(100vw - 24px);min-width:0}.image-viewer-media img{max-height:60dvh}.room .topbar .brand-row{min-width:0;max-width:42vw}.room .topbar .brand-row>div:last-child{min-width:0}.room .topbar .brand-row b{font-size:.91rem}.room .topbar .brand-row #roomLabel{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:115px}.room .top-actions .language-picker{min-width:51px;width:51px;padding-left:6px;padding-right:16px}.room .top-actions{gap:4px}}
@media(max-width:390px){.room .topbar .brand-row .logo{display:none}.room .topbar .brand-row .muted.small{font-size:.69rem}.room .topbar .brand-row{max-width:110px}.room .status{font-size:.7rem;padding:5px 5px}.room .top-actions #copyLink{width:31px;min-width:31px}}

.landing-language .language-switch{display:inline-flex;gap:9px;margin:0}

/* v16 encrypted file attachments */
.file-transfer-message{max-width:100%;overflow-wrap:anywhere}
.file-title{display:flex;gap:7px;align-items:center;min-width:0;margin-top:6px}
.file-title .file-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.87rem;font-weight:600}
.file-title .file-size{white-space:nowrap;color:#aab1c5;font-size:.72rem}
.file-progress{display:block;width:100%;height:7px;margin-top:9px;accent-color:#8976ff}
.file-status{margin-top:5px;font-size:.74rem;color:#b6b8c9}
.file-download{display:inline-flex;margin-top:9px;padding:7px 10px;border:1px solid #6760a9;border-radius:9px;color:#e6e1ff;text-decoration:none;font-size:.78rem;font-weight:700}
.file-download:hover{background:#302a51}
.room .composer .file-button{flex-shrink:0;min-width:30px;display:grid;place-items:center}
@media(max-width:390px){.room .composer{gap:4px;padding:7px}.room .composer .file-button{min-width:27px;padding-left:4px;padding-right:4px}}


/* v17 room history. Only the home/landing page scrolls, call UI remains fixed. */
.landing{height:100dvh;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;align-items:center;padding:22px 14px}
.landing>.card{margin:auto 0;flex:none}
.room-history{margin:25px 0 18px;padding:19px;background:linear-gradient(155deg,rgba(37,38,60,.74),rgba(17,21,31,.88));border:1px solid #34384f;border-radius:19px;min-width:0}
.room-history-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.room-history h2{margin:0;font-size:1.12rem;letter-spacing:-.012em}
.room-history-subtitle{margin:6px 0 0;color:#a5acc2;font-size:.79rem;line-height:1.35}
.history-clear{flex-shrink:0;font-size:.76rem;padding:7px 10px;background:transparent;border-color:#4a425a;color:#c2b9df;border-radius:9px}
.history-list{margin-top:14px;display:flex;flex-direction:column;gap:9px}
.history-empty{padding:15px 12px;border:1px dashed #394057;border-radius:11px;color:#969eb3;font-size:.85rem;line-height:1.5;text-align:center}
.history-item{display:flex;gap:11px;align-items:center;padding:11px;background:#131824;border:1px solid #30394c;border-radius:13px;min-width:0}
.history-item-icon{width:36px;height:36px;flex:none;display:grid;place-items:center;border-radius:11px;color:#bcb4ff;background:#292542;font-size:1rem}
.history-item-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.history-item-name{min-width:0;font-size:.91rem;color:#f2f0ff;font-weight:750;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.history-item-date{font-size:.75rem;color:#9ca7bd}
.history-item-actions{display:flex;align-items:center;gap:5px;flex:0 0 auto}
.history-item-actions button,.history-item-actions a{min-width:32px;min-height:32px;padding:6px 9px;border-radius:9px;font-size:.76rem;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;text-decoration:none;color:#dddffa;border:1px solid #384158;background:#222739}
.history-item-actions .history-open{background:#6554e9;border-color:#7866ff;color:white;font-weight:750}
.history-item-actions .history-remove{font-weight:900;font-size:1.1rem;min-width:31px;padding:3px 8px}
.history-item-actions .history-edit{font-size:.93rem}
.history-item-actions button:hover,.history-item-actions a:hover{filter:brightness(1.2)}
.history-name-editor{display:flex;gap:5px;min-width:0;align-items:center;width:100%}
.history-name-editor input{padding:7px 9px;border-radius:8px;font-size:.85rem;min-width:0;width:100%}
.history-name-editor button{padding:6px 9px;min-height:33px;border-radius:8px;font-size:.8rem}
.history-footer{border-top:1px solid #30354a;margin-top:14px;padding-top:12px}
.card .history-switch{margin:0;display:flex;align-items:center;gap:9px;font-size:.86rem;color:#dfdff1;cursor:pointer}
.history-switch input{appearance:auto;width:16px;height:16px;margin:0;flex:none;accent-color:#8575ff;cursor:pointer}
.history-privacy{font-size:.75rem;line-height:1.5;color:#929ab0;margin:8px 0 0}
.history-disabled{font-size:.75rem;color:#d5c9a8;margin:8px 0 0}
.room-history button:focus-visible,.room-history input:focus-visible,.room-history a:focus-visible{outline:2px solid #a090ff;outline-offset:2px}
@media(max-width:700px){.landing{padding:12px 10px}.landing>.card{padding:22px 17px}.room-history{padding:14px 11px;margin:18px 0}.history-item{gap:7px;padding:9px 7px;flex-wrap:wrap}.history-item-icon{width:31px;height:31px}.history-item-main{flex:1;min-width:calc(100% - 50px)}.history-item-actions{width:100%;justify-content:flex-end;gap:6px}.history-item-actions button,.history-item-actions a{min-height:35px}.history-item-actions .history-open{margin-right:auto}.room-history-heading{align-items:center}}
@media(max-width:360px){.history-item-actions button,.history-item-actions a{padding:6px 7px;font-size:.71rem}.history-item-actions .history-remove{min-width:28px}}

/* Landing may scroll if the history grows, but never shows a scrollbar. */
.landing{scrollbar-width:none;-ms-overflow-style:none}
.landing::-webkit-scrollbar{display:none;width:0;height:0}


/* v19: screen-sharing never stretches the layout or requires video scrolling. */
.room #videos{display:flex;flex-wrap:wrap;align-items:center;align-content:center;justify-content:center;gap:12px;min-height:0;min-width:0;overflow:hidden;}
.room #videos.empty{display:none}
.room #videos>.video-card.has-video{flex:0 0 auto;width:var(--p2p-tile-width, min(100%, 940px));height:var(--p2p-tile-height, auto);max-width:100%;max-height:100%;aspect-ratio:16/9;min-width:0;}
.room #videos>.video-card.screen-sharing video{object-fit:contain;transform:none;background:#080a0f}
.room #videos>.video-card:fullscreen{width:100vw;height:100vh;max-width:none;max-height:none;aspect-ratio:auto;border-radius:0}
.room #videos>.video-card:fullscreen video{object-fit:contain}
/* Compact optional notification sound switch in the existing header. */
.room #toggleEventSounds{display:grid;place-items:center;flex:none;width:36px;min-width:36px;height:36px;padding:7px;border-radius:11px;color:#cfd5e4}
.room #toggleEventSounds svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.room #toggleEventSounds[aria-pressed="false"]{color:#777f90}
@media(max-width:700px){.room #toggleEventSounds{width:30px;min-width:30px;height:34px;padding:6px}.room #toggleEventSounds svg{width:17px;height:17px}}
@media(max-width:360px){.room #toggleEventSounds{width:26px;min-width:26px;padding:5px}.room .top-actions #copyLink{width:27px;min-width:27px}}


/* v20: understated device setup, settings and PiP — preserves the v19 theme */
.g-modal{position:fixed;inset:0;z-index:1100;display:grid;place-items:center;padding:12px;background:rgba(5,7,13,.82);backdrop-filter:blur(9px);overflow:auto}
.g-modal.hidden{display:none!important}
.g-modal-card{width:min(480px,100%);max-height:calc(100dvh - 24px);overflow:auto;background:#171b28;border:1px solid #373e54;border-radius:18px;box-shadow:0 20px 70px rgba(0,0,0,.65);padding:20px}
.g-modal-card h2{margin:0 0 7px;font-size:1.18rem;color:#f6f6ff}
.g-subtitle{color:#aeb6c8;font-size:.79rem;line-height:1.45;margin:6px 0 13px}
.g-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.g-fields label{display:grid;gap:6px;min-width:0;color:#d3d8e8;font-size:.83rem}
.g-fields input,.g-fields select{width:100%;height:40px;min-width:0;border:1px solid #363d50;background:#0c101b;color:#f3f5ff;border-radius:10px;padding:6px 9px;font-size:.87rem;outline-offset:2px}
.g-fields select:disabled{opacity:.55;cursor:not-allowed}
.g-switches{display:flex;flex-direction:column;gap:10px;margin:14px 0}
.g-switches label{display:flex;align-items:center;gap:10px;color:#e3e6ef;font-size:.85rem}
.g-switches input{accent-color:#8b79fa;width:17px;height:17px}
.g-preview{width:100%;aspect-ratio:16/9;max-height:170px;border:1px solid #303849;border-radius:12px;object-fit:contain;background:#090c12}
.g-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px;flex-wrap:wrap}
.g-modal-actions button{min-height:42px;padding:8px 15px}
.g-modal-heading{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:12px}
.g-x{width:32px;min-width:32px;height:32px;padding:0;display:grid;place-items:center;font-size:24px}
.av-settings-trigger{min-width:36px;width:36px;height:36px;padding:0;font-size:21px;display:grid;place-items:center}
.pip-video{font-size:19px!important;padding:1px 6px!important;line-height:1;white-space:nowrap}
@media(max-width:700px){.room .top-actions #openAvSettings{width:30px;height:32px;min-width:30px;font-size:19px}.g-modal-card{padding:15px;max-height:calc(100dvh - 20px)}.g-fields{grid-template-columns:1fr 1fr}.g-modal-card h2{font-size:1rem}}
@media(max-width:350px){.g-fields{grid-template-columns:1fr}.room .top-actions #openAvSettings{width:25px;min-width:25px;font-size:18px}}
/* Reserve room in the mobile header for settings without horizontal overflow. */
@media(max-width:430px){
 .room .topbar .brand-row{max-width:100px!important;flex-shrink:1}
 .room .top-actions{flex:0 1 auto;min-width:0;gap:3px}
 .room .topbar #connectionState{font-size:0!important;width:10px;min-width:10px;max-width:10px;height:10px;padding:0!important;border-radius:50%;overflow:hidden;flex:0 0 10px}
 .room .topbar .room-language{margin:0}
}

/* v21: device test is independent from the join checkboxes. */
.g-test-note{margin:4px 0 10px}
.g-preview-mic{display:flex;align-items:center;gap:12px;margin:8px 0 10px;color:#c9d1e3;font-size:.8rem}
.g-preview-mic span{flex:0 0 auto}
.g-preview-mic progress{flex:1;min-width:0;height:9px;accent-color:#8b79fa;border:0;border-radius:8px;overflow:hidden;background:#303849}
.g-preview-mic progress::-webkit-progress-bar{background:#303849}
.g-preview-mic progress::-webkit-progress-value{background:#8b79fa;transition:width .08s ease}
.g-preview-mic progress::-moz-progress-bar{background:#8b79fa}
#gStopTest.hidden{display:none!important}
@media(max-width:350px){.g-preview-mic{gap:7px;font-size:.72rem}.g-modal-actions{justify-content:stretch}.g-modal-actions button{flex:1 1 auto}}
