:root{color-scheme:dark;--bg:#0b0d14;--panel:#141823;--field:#1d2331;--line:#2b3345;--text:#f4f5fa;--muted:#a0adc3;--accent:#ff7919;--green:#3ce39c;--red:#ff637d;--yellow:#f6cd63;--radius:20px;font:16px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button{border:1px solid var(--line);background:var(--field);color:var(--text);border-radius:12px;padding:12px 16px;min-height:46px;cursor:pointer;font-weight:650;transition:background .15s,transform .15s}button:active{transform:scale(.98)}button:disabled{opacity:.48;cursor:wait}button.primary{background:var(--accent);color:#1b0b00;border-color:transparent}button.success{background:#123b2f;color:var(--green);border-color:#276b51}button.danger{background:#3a1d2a;color:var(--red);border-color:#6a3043}button.selected{background:#123b2f;border-color:var(--green);color:var(--green)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #56b9ff;outline-offset:2px}a{color:inherit}h1,h2,p{margin-top:0}h1{font-size:clamp(1.8rem,5vw,2.8rem);letter-spacing:-.045em;margin-bottom:8px}h2{font-size:1.08rem;letter-spacing:-.015em;margin-bottom:16px}p{line-height:1.6;color:var(--muted)}small{line-height:1.5}.subtle{font-size:.82rem;color:var(--muted)}.eyebrow{display:block;font-size:.66rem;letter-spacing:.15em;font-weight:750;color:var(--accent);margin-bottom:10px}label{display:flex;flex-direction:column;gap:8px;font-size:.82rem;color:var(--muted);margin-bottom:14px}input,select,textarea{width:100%;min-height:46px;border:1px solid var(--line);background:var(--bg);color:var(--text);border-radius:10px;padding:11px;min-width:0}textarea{resize:vertical;line-height:1.5}input[type=color]{padding:4px;min-width:56px}input[type=checkbox]{width:20px;height:20px;min-height:20px;accent-color:var(--accent)}label.check{flex-direction:row;align-items:center}.button-row{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0 3px}.button-row button{flex:1 1 auto}.form-row{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.form-row label{flex:1 1 120px;margin:0}.form-row .small-field{flex:0 1 100px}.form-row button{margin-bottom:0}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:22px;margin-bottom:18px;overflow:hidden}.panel-heading,.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.panel-heading h2,.section-heading h2{margin:0}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:24px 0}.badge{display:inline-flex;align-items:center;gap:7px;padding:5px 10px;border:1px solid var(--line);background:var(--field);border-radius:30px;font-size:.68rem;font-weight:700;white-space:nowrap}.badge.good{color:var(--green);border-color:#265942}.badge.bad{color:var(--red);border-color:#744056}.badge.pending{color:var(--yellow)}.topbar{max-width:1180px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:calc(16px + env(safe-area-inset-top)) 24px 12px}.brand{display:flex;align-items:center;gap:9px;text-decoration:none;font-size:1.05rem;letter-spacing:-.03em}.brand img{border-radius:9px}.brand em{font-style:normal;color:var(--accent)}.brand>span{font-size:.58rem;font-weight:700;letter-spacing:.1em;color:var(--muted);border:1px solid var(--line);border-radius:5px;padding:3px 5px;margin-left:4px}.icon-button{min-height:36px;font-size:.78rem;padding:7px 12px;background:transparent}.connection-bar{max-width:1132px;margin:auto;display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.connection-bar #sync{margin-left:auto}.live-label{font-size:.68rem;font-weight:800;letter-spacing:.07em;color:var(--muted)}.live-label.on{color:var(--red)}main{max-width:1132px;margin:auto;padding-bottom:115px}.page{display:none}.page.active{display:block}.source-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:20px}.source-card{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;min-width:0}.source-card .source-top{padding:18px 18px 12px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:9px;font-size:.76rem;min-height:54px}.status-dot{width:8px;height:8px;border-radius:50%;background:var(--muted);flex:none}.source-card.good .status-dot{background:var(--green)}.source-card.bad .status-dot{background:var(--red)}.source-card.pending .status-dot{border:2px solid #6b6041;border-top-color:var(--yellow);background:none;width:15px;height:15px;animation:spin .8s linear infinite}.source-card.out .status-dot{background:var(--accent)}@keyframes spin{to{transform:rotate(360deg)}}.source-card.good .source-top{color:var(--green)}.source-card.bad .source-top{color:var(--red)}.source-card.pending .source-top{color:var(--yellow)}.source-card.out .source-top{color:var(--accent)}.source-card .source-body{padding:20px 18px}.source-card h2{font-size:1.45rem;margin:0 0 7px}.source-card .target{font-size:.83rem;color:var(--muted);min-height:22px}.source-card .camera-go{width:100%;margin:16px 0 9px}.source-card.active{border-color:var(--green)}.source-card .tiny-actions{display:flex;gap:7px}.tiny-actions button{flex:1;padding:8px;font-size:.72rem;min-height:37px}.source-card .last-check{display:block;font-size:.65rem;color:var(--muted);margin-top:13px}.source-card progress{width:100%;accent-color:var(--yellow);height:5px}.note{font-size:.78rem;color:var(--muted);line-height:1.6;padding:0 4px}.tabs{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,1180px);padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:flex;gap:4px;background:color-mix(in srgb,var(--panel) 94%,transparent);backdrop-filter:blur(20px);border:1px solid var(--line);border-radius:22px 22px 0 0;z-index:20;overflow-x:auto;scrollbar-width:none}.tabs button{flex:1;min-width:70px;background:transparent;border:0;color:var(--muted);font-size:1.16rem;min-height:55px;padding:7px}.tabs span{display:block;font-size:.64rem;margin-top:5px;white-space:nowrap}.tabs .active{background:var(--field);color:var(--accent)}.preview-cover{text-align:center;padding:42px 20px}.preview-symbol{font-size:2rem;width:70px;height:70px;border:1px solid var(--line);background:#ff791917;color:var(--accent);border-radius:24px;display:grid;place-items:center;margin:0 auto 22px}.preview-cover p{max-width:370px;margin:0 auto 24px}.broadcast-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.broadcast-grid .panel{margin:0 0 16px}.broadcast-grid button{width:100%;margin-top:8px}.broadcast-grid .badge{margin-bottom:16px}.job-card .button-row button{font-size:.8rem}.login{min-height:100dvh;display:grid;place-items:center;padding:30px;background:radial-gradient(ellipse at 40% 0,#552d1a44,transparent 60%)}.login-card{width:min(100%,440px);background:var(--panel);border:1px solid var(--line);border-radius:28px;padding:32px}.login-card>img{border-radius:18px;margin-bottom:28px}.login-card h1 span{color:var(--accent)}.login-card small{display:block;color:var(--muted);font-size:.75rem;margin-top:24px}.login-card button{width:100%}.login-card .eyebrow{font-size:.58rem}.preview-modal{position:fixed;inset:0;background:#000;z-index:50;isolation:isolate;overflow:hidden}.preview-modal canvas{position:absolute;width:100%;height:100%;object-fit:contain}.preview-modal.zoomed canvas{object-fit:cover}.preview-badge{position:absolute;left:max(14px,env(safe-area-inset-left));top:calc(10px + env(safe-area-inset-top));max-width:calc(100% - 90px);background:#080e1888;border:1px solid #ffffff28;border-radius:10px;padding:9px 13px;color:#fff;backdrop-filter:blur(10px)}.preview-badge b{display:block;font-size:.76rem}.preview-badge small{display:block;color:#a1f8d2;font-size:.65rem;margin-top:4px}.overlay-button{background:#0a101a88;border:1px solid #ffffff70;border-radius:12px;backdrop-filter:blur(12px);color:#fff;font-size:.73rem;min-height:42px;padding:10px 13px}.close{position:absolute;right:max(10px,env(safe-area-inset-right));top:calc(9px + env(safe-area-inset-top));font-size:1.7rem;padding:0;width:44px;height:44px}.preview-footer{position:absolute;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;display:flex;gap:7px;justify-content:center;flex-wrap:wrap;z-index:4}.preview-scenes{position:absolute;left:max(10px,env(safe-area-inset-left));bottom:calc(120px + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:flex-start;gap:7px;max-height:48%;overflow:auto;z-index:3}.preview-scenes button{font-size:.65rem;min-height:36px;padding:8px 10px;background:#111a27a8;border:1px solid #ffffff55;backdrop-filter:blur(12px);color:#fff}.preview-scenes button.active{background:#13422faa;border-color:#49e7a2}.preview-scenes button:nth-child(2n){margin-left:8px}.floating-comments{position:absolute;right:10px;top:20%;width:min(340px,72vw);height:55%;background:#0c101aeb;border:1px solid #ffffff55;border-radius:14px;overflow:hidden;z-index:6;box-shadow:0 12px 60px #0008;display:flex;flex-direction:column}.float-handle{display:flex;align-items:center;gap:4px;padding:7px 8px;touch-action:none;cursor:move;background:#1b2233;color:#fff}.float-handle strong{flex:1;font-size:.65rem}.float-handle button{font-size:1rem;min-height:30px;padding:2px 9px;color:#fff;background:#2b3549;border:1px solid #647189}.floating-comments>img{width:100%;height:auto;max-height:75px;object-fit:contain;background:#101217}.floating-comments .zoom-surface{flex:1;min-height:0}.zoom-surface{position:relative;overflow:hidden;touch-action:none;background:#080a10;min-height:220px;display:flex;align-items:center;justify-content:center}.zoom-surface img{width:100%;height:100%;object-fit:contain;transform-origin:0 0;user-select:none;-webkit-user-drag:none;pointer-events:none}.zoom-surface.interacting{outline:2px solid var(--green);outline-offset:-2px}dialog{width:min(94vw,940px);max-height:92dvh;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:22px;padding:22px;overflow:auto}dialog::backdrop{background:#000b;backdrop-filter:blur(8px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.dialog-heading h2{margin:0}#sourceZoom{height:60dvh;margin-top:14px;border-radius:12px}#editDialog{width:min(94vw,600px)}.edit-box{position:absolute;border:2px solid #3ce39c;background:#3ce39c15;touch-action:none;cursor:move;z-index:2}.edit-box:after{content:'ARRASTE';position:absolute;top:-23px;left:-2px;background:#3ce39c;color:#062519;font-size:10px;font-weight:800;padding:4px 7px}#toast{position:fixed;bottom:calc(100px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:1000;max-width:90vw;min-width:180px;text-align:center;padding:13px 18px;background:#29354e;color:#fff;border:1px solid #61718d;border-radius:14px;font-size:.83rem;box-shadow:0 8px 40px #0007}#toast.error{background:#482335;border-color:#a54563}pre{white-space:pre-wrap;word-break:break-word;font-size:.7rem;color:var(--muted);line-height:1.6}summary{cursor:pointer;font-weight:700}[hidden]{display:none!important}html[data-theme=light]{color-scheme:light;--bg:#f1f4f8;--panel:#fff;--field:#e9eef6;--line:#cdd5e2;--text:#172234;--muted:#53647e;--green:#09794b;--red:#be2447}html[data-font='18']{font-size:18px}html[data-font='20']{font-size:20px}@media(prefers-color-scheme:light){html[data-theme=system]{color-scheme:light;--bg:#f1f4f8;--panel:#fff;--field:#e9eef6;--line:#cdd5e2;--text:#172234;--muted:#53647e;--green:#09794b;--red:#be2447}}@media(max-width:1180px){main{padding:0 22px 110px}.connection-bar{margin:0 22px}}@media(max-width:760px){.topbar{padding-left:18px;padding-right:18px}main{padding:0 16px 110px}.connection-bar{margin:0 18px;gap:8px}.connection-bar #sync{font-size:.64rem}.page-heading{margin:24px 0 20px}.page-heading>button{font-size:.74rem;padding:10px 12px}.source-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.source-card .source-top{padding:14px 12px;font-size:.65rem}.source-card .source-body{padding:16px 12px}.source-card h2{font-size:1.13rem}.source-card .target{font-size:.7rem}.source-card .camera-go{padding:9px 8px;font-size:.75rem}.tiny-actions{flex-wrap:wrap}.tiny-actions button{font-size:.65rem;padding:7px}.panel{padding:18px;border-radius:18px}.section-heading>.subtle{font-size:.65rem;max-width:135px;text-align:right}.tabs{border-radius:18px 18px 0 0;padding-left:6px;padding-right:6px}.tabs button{min-width:64px}.broadcast-grid{gap:10px}.broadcast-grid .panel{padding:16px}.broadcast-grid button{font-size:.75rem;padding:10px 8px}.preview-footer{gap:5px}.overlay-button{font-size:.65rem;padding:9px 10px}.form-row{gap:10px}.form-row>button{flex:1}.floating-comments{top:18%;height:50%}}@media(max-width:370px){.source-grid{grid-template-columns:1fr}.connection-bar #sync{display:none}.brand{font-size:.95rem}.tabs button{min-width:62px}}@media(orientation:landscape) and (max-height:600px){.preview-scenes{bottom:85px;max-height:60%}.preview-footer{bottom:8px}.preview-badge{top:9px}.close{top:9px}.floating-comments{top:65px;height:65%;width:28%}}
input,select,textarea{font-size:1rem}.main-controls:not([open]) .panel-heading{margin-bottom:0}.main-controls[open] summary{margin-bottom:18px}
.overlay-button.phone-on{background:#09633caa;border-color:#40efa1;color:#a9ffdb}.overlay-button.phone-off{background:#6c2035aa;border-color:#ff788e;color:#ffd0d8}#chatReset{font-size:.7rem;padding:2px 7px}
.preview-badge{padding:4px 8px!important;border-radius:8px!important;max-width:min(58vw,270px)!important;background:#080e187a!important}
.preview-badge b{font-size:.62rem!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.preview-badge small{font-size:.55rem!important;margin-top:1px!important;line-height:1.2!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-badge small:empty{display:none!important}
.preview-head-row{display:flex;align-items:center;gap:5px;flex-wrap:nowrap}.fps-pill{display:inline-flex;align-items:center;padding:1px 6px;border-radius:999px;background:#0e4f3acc;border:1px solid #40efa1;color:#a9ffdb;font-size:.58rem;font-weight:800;letter-spacing:.03em;flex:none}
.peers-status{color:#ffca7a!important;font-weight:600}
.webcams-bar{max-width:1132px;margin:8px auto 0;padding:8px 14px;background:#102922;border:1px solid #2b6e56;border-radius:12px;color:#9ef7d1;font-size:.74rem;font-weight:650;display:flex;flex-wrap:wrap;gap:10px;align-items:center}
@media(max-width:1180px){.webcams-bar{margin:8px 22px 0}}@media(max-width:760px){.webcams-bar{margin:8px 18px 0;font-size:.68rem}}

/* Reserved control regions remain disjoint in both orientations and at larger font sizes. */
.preview-modal{--footer-height:160px;--badge-bottom:72px}
.preview-footer{display:grid;grid-template-columns:repeat(auto-fit,minmax(92px,1fr));align-content:start;gap:6px;max-height:40dvh;overflow-y:auto;overscroll-behavior:contain;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));padding:4px;background:#080e1855;border-radius:12px}
.preview-footer .overlay-button{min-width:0;min-height:40px;padding:7px 5px;font-size:.7rem;line-height:1.2;overflow-wrap:anywhere}
.preview-scenes{top:calc(var(--badge-bottom) + 10px);bottom:calc(var(--footer-height) + 24px + env(safe-area-inset-bottom));max-height:none;max-width:128px;justify-content:flex-end;pointer-events:auto}
.preview-scenes button{flex-shrink:0;max-width:116px;overflow-wrap:anywhere}
.overlay-button.automation-on{background:#14633bbd;border-color:#4cf2a3;color:#fff}.overlay-button.automation-off{background:#702536bd;border-color:#ff778d;color:#fff}
.float-handle{flex-wrap:wrap;flex-shrink:0}.float-handle strong{min-width:90px}.float-handle button{flex-shrink:0}.floating-comments{max-height:calc(100% - var(--footer-height) - 90px)}
@media(orientation:landscape) and (max-height:600px){.preview-footer{grid-template-columns:repeat(6,minmax(0,1fr));max-height:36dvh}.preview-footer .overlay-button{min-height:34px;padding:5px;font-size:.65rem}.preview-scenes{top:calc(var(--badge-bottom) + 6px);bottom:calc(var(--footer-height) + 20px + env(safe-area-inset-bottom))}}

body:has(.preview-modal:not([hidden])) #toast{top:70px;bottom:auto;pointer-events:none;max-width:70vw}


/* Minimal preview: ordered scenes on the right and camera/mic below the tools switch. */
.preview-modal{--quick-height:90px;--scene-button-height:36px}
.preview-quick{position:absolute;right:max(10px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));width:min(220px,70vw);z-index:8;display:grid;gap:6px}
.preview-quick .overlay-button{min-height:40px;padding:7px;font-size:.75rem;background:#121c29c9;border-color:#ffffff80;color:#fff}
.quick-media{display:grid;grid-template-columns:1fr 1fr;gap:6px}.preview-quick .phone-on{background:#14633bbd!important;border-color:#4cf2a3}.preview-quick .phone-off{background:#702536bd!important;border-color:#ff778d}
.preview-footer[hidden]{display:none!important}.preview-footer{bottom:calc(var(--quick-height) + 20px + env(safe-area-inset-bottom));max-height:36dvh;z-index:7}
.preview-scenes{left:auto;right:max(10px,env(safe-area-inset-right));top:max(calc(var(--badge-bottom) + 8px),min(18vh,140px));bottom:calc(var(--quick-height) + var(--footer-height) + 30px + env(safe-area-inset-bottom));max-height:none;width:100px;max-width:28vw;align-items:stretch;justify-content:flex-start;gap:4px}
.preview-scenes button,.preview-scenes button:nth-child(2n){margin-left:0;width:100%;height:var(--scene-button-height);min-height:24px;padding:3px 6px;font-size:.72rem;flex-shrink:0}
.preview-badge,.preview-scenes button{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}.preview-footer{backdrop-filter:none!important}
@media(orientation:landscape) and (max-height:600px){.preview-quick{width:190px}.preview-quick .overlay-button{min-height:34px;font-size:.7rem}.preview-footer{bottom:calc(var(--quick-height) + 18px + env(safe-area-inset-bottom))}.preview-scenes{bottom:calc(var(--quick-height) + var(--footer-height) + 24px + env(safe-area-inset-bottom));top:calc(var(--badge-bottom) + 8px)}}

.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}

.floating-comments{padding:10px;border:2px solid #70dbc7;min-width:170px;min-height:190px;resize:none}
.chat-resize{position:absolute;z-index:12;touch-action:none;user-select:none}
.chat-resize-n,.chat-resize-s{left:26px;right:26px;height:20px;cursor:ns-resize}
.chat-resize-n{top:-2px}.chat-resize-s{bottom:-2px}
.chat-resize-e,.chat-resize-w{top:26px;bottom:26px;width:20px;cursor:ew-resize}
.chat-resize-e{right:-2px}.chat-resize-w{left:-2px}
.chat-resize-ne,.chat-resize-nw,.chat-resize-se,.chat-resize-sw{width:26px;height:26px}
.chat-resize-ne{top:-2px;right:-2px;cursor:nesw-resize}.chat-resize-nw{top:-2px;left:-2px;cursor:nwse-resize}
.chat-resize-se{bottom:-2px;right:-2px;cursor:nwse-resize}.chat-resize-sw{bottom:-2px;left:-2px;cursor:nesw-resize}
.chat-resize::after{content:'';position:absolute;background:#70dbc7;border-radius:3px;opacity:.9}
.chat-resize-n::after,.chat-resize-s::after{width:32px;height:3px;left:calc(50% - 16px);top:8px}
.chat-resize-e::after,.chat-resize-w::after{width:3px;height:32px;top:calc(50% - 16px);left:8px}
.chat-resize-se::after,.chat-resize-sw::after,.chat-resize-ne::after,.chat-resize-nw::after{width:10px;height:10px;left:8px;top:8px;background:transparent;border:2px solid #70dbc7}
.float-handle{flex-wrap:wrap;min-height:44px;flex-shrink:0;touch-action:none}.float-handle strong{flex:1 0 100%;font-size:12px}.float-handle button{flex:1;padding:4px;min-width:0}

/* Chat content reaches the frame; resize hit areas remain invisible. */
.floating-comments{padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;max-height:none}
.chat-resize::after{display:none}.chat-resize-n,.chat-resize-s{height:7px;left:12px;right:12px}.chat-resize-n{top:0}.chat-resize-s{bottom:0}
.chat-resize-e,.chat-resize-w{width:7px;top:12px;bottom:12px}.chat-resize-e{right:0}.chat-resize-w{left:0}
.chat-resize-ne,.chat-resize-nw,.chat-resize-se,.chat-resize-sw{width:12px;height:12px;inset:auto}.chat-resize-ne{right:0;top:0}.chat-resize-nw{left:0;top:0}.chat-resize-se{right:0;bottom:0}.chat-resize-sw{left:0;bottom:0}
.floating-comments>img{max-height:38px;flex-shrink:0;background:transparent}.floating-comments .zoom-surface{background:transparent;min-height:0}.floating-comments #chatImage{object-fit:cover;object-position:top center}

/* Visible corner targets, overlaid without a border or loss of chat space. */
.chat-resize-ne,.chat-resize-nw,.chat-resize-se,.chat-resize-sw{width:24px;height:24px}
.chat-resize-ne::after,.chat-resize-nw::after,.chat-resize-se::after,.chat-resize-sw::after{display:block;content:'';width:13px;height:13px;left:auto;top:auto;right:auto;bottom:auto;border:0;border-radius:0;background:transparent;opacity:1;filter:drop-shadow(0 0 2px #07121b)}
.chat-resize-ne::after{right:3px;top:3px;border-top:2px solid #70dbc7;border-right:2px solid #70dbc7}
.chat-resize-nw::after{left:3px;top:3px;border-top:2px solid #70dbc7;border-left:2px solid #70dbc7}
.chat-resize-se::after{right:3px;bottom:3px;border-bottom:2px solid #70dbc7;border-right:2px solid #70dbc7}
.chat-resize-sw::after{left:3px;bottom:3px;border-bottom:2px solid #70dbc7;border-left:2px solid #70dbc7}

/* Top middle moves the whole window; side and bottom grips resize. */
.chat-resize-e,.chat-resize-w{width:14px;top:24px;bottom:24px}.chat-resize-s{height:14px;left:24px;right:24px}
.chat-resize-m{left:24px;right:24px;top:0;height:22px;cursor:move}
.chat-resize-m::after{display:block;width:36px;height:3px;left:calc(50% - 18px);top:6px;background:#70dbc7;border:0;filter:drop-shadow(0 0 2px #07121b)}
.chat-resize-e::after,.chat-resize-w::after{display:block;left:4px;top:calc(50% - 12px);width:3px;height:24px;background:#70dbc7;border:0;filter:drop-shadow(0 0 2px #07121b)}
.chat-resize-e::after{left:auto;right:4px}.chat-resize-s::after{display:block;top:auto;bottom:3px;width:24px;height:3px;left:calc(50% - 12px);background:#70dbc7;border:0;filter:drop-shadow(0 0 2px #07121b)}

/* Chat stays above the video and below every preview control. */
.floating-comments{z-index:1}.preview-badge{z-index:8}.preview-modal>.close{z-index:9}

.preview-meter{position:absolute;left:max(8px,env(safe-area-inset-left));top:calc(var(--badge-bottom) + 14px);z-index:5;width:36px;height:clamp(100px,28dvh,150px);display:flex;flex-direction:column;align-items:center;gap:4px;padding:5px 7px;border-radius:8px;background:#101826cc;color:#fff;font-size:10px;pointer-events:none}
.preview-meter-track{flex:1;min-height:0;width:100%;background:#303a49;border-radius:3px;overflow:hidden}
.preview-meter-track>div{height:100%;background:linear-gradient(to top,#34e289 0% 80%,#ffd053 80% 95%,#ff525d 95%);transform:scaleY(0);transform-origin:bottom}
.preview-warning{position:absolute;top:calc(var(--badge-bottom) + 4px);left:50%;transform:translateX(-50%);z-index:6;width:max-content;max-width:calc(100% - 36px);padding:5px 9px;border:1px solid #ff8b80;border-radius:7px;background:#ad222c;color:#fff;font-size:clamp(9px,2.7vw,13px);font-weight:800;text-align:center;pointer-events:none;animation:record-warning-pulse 1.6s ease-in-out infinite alternate}
@keyframes record-warning-pulse{from{background:#ad222c}to{background:#e63b44}}
.preview-modal:has(.preview-warning:not([hidden])) .preview-meter,.preview-modal:has(.preview-warning:not([hidden])) .preview-scenes{top:calc(var(--badge-bottom) + 38px)}
.preview-scenes{width:74px;max-width:24vw;overflow:hidden}
.preview-camera-list{display:flex;flex-direction:column;gap:4px;overflow-y:auto;min-height:0;scrollbar-width:none}
.preview-tv{flex:none}.preview-tv:empty{display:none}
.preview-quick .quick-media{grid-template-columns:repeat(3,minmax(0,1fr))}
.preview-quick #previewSound{padding-inline:4px}
.source-vu{color:var(--muted);margin-top:7px}
.source-vu.on-air{color:var(--green)}
.source-vu-track{height:6px;margin-top:4px;background:var(--field);border-radius:3px;overflow:hidden}
.source-vu-track i{display:block;height:100%;width:0;background:#aab0bb}
.source-vu.on-air .source-vu-track i{background:var(--green)}
@media(orientation:landscape) and (max-height:600px){
 .preview-footer{right:calc(96px + env(safe-area-inset-right))}
 .preview-scenes{bottom:calc(var(--quick-height) + 16px + env(safe-area-inset-bottom))}
}

/* S22 reference: 50% width, 716/1544 height, 668/1544 top; no reserved frame. */
#liveHeaderZoom{flex:0 0 10.614525%;height:10.614525%;min-height:0;background:transparent}
#liveHeaderZoom #liveHeader{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain}
.floating-comments #chatZoom{display:block}.floating-comments #chatImage{position:absolute;left:0;top:0;width:100%;height:auto;max-width:none;object-fit:fill}

.floating-comments{min-height:160px}

.app-site-chat{position:absolute;left:max(8px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));z-index:6;width:min(56vw,290px);height:min(50dvh,360px);display:flex;flex-direction:column;background:#0f1622d9;border:1px solid #2e405b;border-radius:10px;overflow:hidden;color:#eef3ff}
.app-site-chat[hidden]{display:none!important}
.app-site-chat-head{display:flex;align-items:center;gap:6px;padding:5px 8px;background:#162234eb;border-bottom:1px solid #293b55;font-size:.74rem;font-weight:700}
.app-site-chat-head span{flex:1}
.app-site-chat-head b{padding:1px 6px;border-radius:99px;background:#d62d50;color:#fff;font-size:.66rem}
.app-site-chat-head button{min-width:24px;min-height:24px;padding:0;background:transparent;border:0;color:#c9d6ea;font-size:1rem;line-height:1}
.app-site-messages{flex:1;min-height:0;overflow-y:auto;list-style:none;margin:0;padding:6px;display:flex;flex-direction:column;gap:5px;font-size:.76rem;line-height:1.25}
.app-site-messages li{padding:4px 6px;border-radius:6px;background:#1a2536c9;word-break:break-word}
.app-site-messages li.chat-admin{background:#332c20e0;border-left:3px solid #f5c451}
.app-site-messages li.chat-crowned,.app-site-messages li.chat-mod{background:#2d2412d9;border-left:3px solid #f5c451}
.app-site-messages li.chat-mod:not(.chat-crowned){background:#142436d9;border-left-color:#3b9cff}
.app-site-messages li strong{display:inline;font-weight:700;color:#9fd3ff}
.app-site-messages li.chat-admin strong{color:#ffd86b}
.app-site-messages li time{margin-left:5px;color:#aebad0;font-size:.72em}
.app-site-messages li>span:last-of-type{display:block;margin-top:2px;color:#eef3ff}
.app-site-messages .df-crown,.app-site-messages .df-mod{display:inline-flex;align-items:center;margin:0 0 0 4px;padding:0 4px;border-radius:4px;font-size:.62em;font-weight:900;line-height:1.3;vertical-align:middle}
.app-site-messages .df-mod{background:linear-gradient(135deg,#4ea8ff,#2067d8);border:1px solid #7ec2ff;color:#fff}
.app-site-messages .df-crown-0{background:linear-gradient(135deg,#ffe588,#d4941a);border:1px solid #ffd257;color:#241702}
.app-site-messages .df-crown-1{background:linear-gradient(135deg,#6ef3a5,#19a354);border:1px solid #8bffba;color:#042411}
.app-site-messages .df-crown-2{background:linear-gradient(135deg,#7ef2ff,#149bc4);border:1px solid #9ff6ff;color:#03202b}
.app-site-messages .df-crown-3{background:linear-gradient(135deg,#ff8ad4,#c92a8e);border:1px solid #ffaae0;color:#29041b}
.app-site-messages .df-crown-4{background:linear-gradient(135deg,#c9a2ff,#783be0);border:1px solid #dbc2ff;color:#170733}
.app-site-messages .df-crown-5{background:linear-gradient(135deg,#ffb87a,#d96018);border:1px solid #ffcca0;color:#2b1002}
.app-site-mod-row{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px}
.app-site-mod-row button{padding:2px 5px;font-size:.66rem;min-height:22px;background:#132032;color:#dce8fa;border:1px solid #355075;border-radius:4px}
.app-site-form{display:flex;gap:4px;padding:5px;background:#121b29;border-top:1px solid #293b55}
.app-site-form input{flex:1;min-width:0;min-height:30px;padding:4px 7px;border-radius:6px;border:1px solid #344a68;background:#0c131d;color:#fff;font-size:.76rem}
.app-site-form button{min-height:30px;padding:0 10px;border-radius:6px;border:0;background:#23b59c;color:#06211c;font-weight:700;font-size:.74rem}
