.media-overlay{position:fixed;inset:0;background:#10283866;z-index:1000;display:flex;justify-content:flex-end;padding:12px;box-sizing:border-box}
.media-drawer{width:min(820px,80vw);height:100%;background:#fff;display:flex;flex-direction:column;box-shadow:-8px 0 30px #122a3826;overflow:hidden;border-radius:8px}
.media-header{display:flex;align-items:center;gap:8px;background:#0c2439;color:#fff;padding:10px 16px;flex-shrink:0}
.media-header>div{display:flex;align-items:center;gap:16px;min-width:0;flex:1}
.media-header h2{margin:0 0 2px;font-size:18px;overflow-wrap:anywhere;color:#fff}.media-header span{color:#b9cbd8;font-size:11px}
.media-header svg{width:22px;height:22px;flex-shrink:0}.media-header button{color:#fff;background:transparent;border-color:#496271;display:flex;align-items:center;gap:6px;padding:7px 10px;font-size:13px}
.media-icon{width:40px;height:40px;padding:0!important;display:inline-flex;align-items:center;justify-content:center;font-size:24px;flex-shrink:0}
.media-tabs{display:flex;gap:6px;padding:5px 16px;border-bottom:1px solid #d8e5ec;flex-shrink:0}
.media-tabs button{display:flex;align-items:center;gap:8px;background:transparent;border:0;color:#476376;padding:8px 12px;border-radius:6px;font-weight:700;font-size:13px}.media-tabs button[aria-selected=true]{background:#0d8f96;color:white}.media-tabs svg{width:18px;height:18px}
.media-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:14px 26px;border-bottom:1px solid #d8e5ec}.media-toolbar label{display:flex;align-items:center;gap:10px;font-size:13px}.media-toolbar input{width:155px;margin:0}.media-toolbar>span{margin-left:auto;color:#597082;font-size:13px}
.media-body{flex:1;min-height:0;overflow:auto;padding:16px 20px;background:#f3f7fa}.media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.media-tile{position:relative;aspect-ratio:16/10;min-width:0;padding:0;border:1px solid #c7d7df;border-radius:6px;overflow:hidden;background:#152e40;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.media-tile:hover,.media-tile:focus-visible{outline:3px solid #10aeb5;outline-offset:1px}.media-tile img{width:100%;height:100%;object-fit:contain}.media-caption{position:absolute;bottom:0;left:0;right:0;background:#071e30df;padding:9px 5px;font-size:12px;text-align:center}
.media-missing{font-size:13px}.media-video-poster{display:flex;align-items:center;gap:10px}.media-video-poster svg{width:36px;height:36px}.media-video-poster span{font-size:13px}
.media-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #d8e5ec;padding:14px 26px}.media-footer span{font-size:13px;color:#597082}
.media-viewer{display:flex;flex-direction:column;gap:16px;min-height:100%}.media-view-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:13px}.media-view-tools select{width:auto;max-width:100%;margin:0}.media-view-tools a{padding:10px 12px;border:1px solid #d1e0e7;border-radius:6px;text-decoration:none;color:#0a5264;background:white}
.media-stage{background:#091b28;display:flex;align-items:center;justify-content:center;flex:1;min-height:240px}.media-stage img,.media-stage video{width:100%;height:auto;max-height:65vh;object-fit:contain}.media-empty{display:grid;place-items:center;min-height:240px;color:#597082}
[data-camera-open]{cursor:pointer}[data-camera-open]:hover td{background:#edfafa}[data-camera-open]:focus-visible{outline:2px solid #0aa9b1;outline-offset:-2px}
.media-toolbar,.media-footer{padding:6px 16px;flex-shrink:0}
.media-toolbar button,.media-footer button{font-size:13px;padding:7px 10px;min-height:36px}
.media-toolbar input{font-size:13px;padding:7px 9px;min-height:36px}
.media-header .media-icon,.media-toolbar .media-icon{width:32px;height:32px;font-size:20px}
@media(max-width:700px){.media-overlay{padding:0}.media-drawer{width:100vw;border-radius:0}.media-header,.media-toolbar,.media-tabs,.media-footer{padding:10px 12px}.media-body{padding:12px}.media-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.media-header h2{font-size:18px}.media-header>div>svg{display:none}.media-caption{font-size:10px}.media-toolbar>span{margin-left:0}}
.media-header button:hover,.media-header button:focus-visible{background:#1e4860;color:#fff}
.media-header button[aria-pressed=true]{background:#0d8f96;color:#fff;border-color:#0d8f96}

/* ---------- redesigned viewer (mx) ---------- */
.media-overlay{background:rgba(7,22,36,.55);padding:14px}
.media-drawer.mx{width:min(1180px,94vw);border-radius:14px;box-shadow:0 30px 80px rgba(0,15,30,.35);background:#fff}
.mx-head{background:#fff!important;color:var(--navy,#082945)!important;padding:16px 20px!important;border-bottom:1px solid #e3edf2;gap:10px!important}
.mx-id{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.mx-ico{width:42px;height:42px;border-radius:11px;background:#e8f5f7;color:#0f6f84;display:grid;place-items:center;flex-shrink:0}
.mx-ico svg{width:22px;height:22px}
.mx-head h2{color:#082945!important;font-size:19px!important;margin:0 0 3px!important;font-weight:800}
.mx-head #mediaCameraInfo{color:#5d7387!important;font-size:12.5px!important;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.mx-dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:#c2ced6}.mx-dot.on{background:#20a879;box-shadow:0 0 0 3px #20a87922}.mx-dot.off{background:#d0405c}
.media-header button.mx-live{background:#0f6f84!important;color:#fff!important;border:0!important;height:40px;padding:0 16px!important;border-radius:9px;font-weight:700;font-size:14px!important;gap:7px}
.media-header button.mx-live:hover{background:#0b5c6e!important}
.media-header button.mx-live[aria-pressed=true]{background:#20a879!important}
.media-header button.mx-x{color:#082945!important;border:1px solid #c9dbe3!important;background:#fff!important;width:40px!important;height:40px!important;border-radius:9px}
.media-header button.mx-x:hover{background:#f3f8fa!important}
.mx-tabs{gap:4px!important;padding:0 20px!important;border-bottom:1px solid #e3edf2}
.mx-tabs button{border-radius:0!important;background:transparent!important;color:#4d6478!important;padding:13px 12px 11px!important;font-size:14px!important;font-weight:700;border-bottom:3px solid transparent!important}
.mx-tabs button:hover{color:#082945!important}
.mx-tabs button[aria-selected=true]{color:#0f6f84!important;border-bottom-color:#0f6f84!important;background:transparent!important}
.mx-bar{padding:10px 20px!important;gap:8px!important;border-bottom:1px solid #edf3f6}
.mx-date{display:flex;align-items:center;border:1px solid #c9dbe3;border-radius:9px;overflow:hidden;background:#fff}
.mx-date .media-icon{border:0!important;border-radius:0!important;width:36px!important;height:36px!important;background:#fff;color:#082945}
.mx-date .media-icon:hover{background:#eef6f8}
.mx-date input{border:0!important;border-left:1px solid #e3edf2!important;border-right:1px solid #e3edf2!important;border-radius:0!important;height:36px;min-height:36px!important;width:150px!important;margin:0;box-shadow:none}
.mx-chip{height:36px;padding:0 14px!important;border:1px solid #c9dbe3;border-radius:20px;background:#fff;color:#082945;font-weight:700;font-size:13px}
.mx-chip.on{background:#082945;border-color:#082945;color:#fff}
.mx-bar>.media-icon{border:1px solid #c9dbe3!important;border-radius:9px;color:#082945}
.mx-bar #mediaCount{margin-left:auto;font-weight:700;color:#3f5668;font-size:13px}
.mx-hours{padding:10px 20px 8px;border-bottom:1px solid #edf3f6;background:#fbfdfe;flex-shrink:0}
.mx-hours-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:#5d7387;margin-bottom:6px}
.mx-hours-head b{color:#082945;font-size:12.5px}
.mx-hours-head span{display:flex;align-items:center;gap:6px}
.mx-k{width:10px;height:10px;border-radius:3px;display:inline-block;margin-left:6px}.mx-k.pic{background:#5fb8c4}.mx-k.sd{background:#0f6f84}.mx-k.gap{background:#f3c6cf}
.mx-hbs{display:grid;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;height:58px}
.mx-hb{position:relative;border:0;padding:0 0 14px;background:transparent;display:flex;flex-direction:column;justify-content:flex-end;cursor:pointer;min-width:0}
.mx-hb .fill{display:flex;flex-direction:column;justify-content:flex-end;width:100%;background:#5fb8c4;border-radius:3px 3px 1px 1px;overflow:hidden}
.mx-hb .sd{width:100%;background:#0f6f84}
.mx-hb:hover:not(:disabled) .fill{background:#3fa1af}
.mx-hb.cur .fill{outline:2px solid #082945;outline-offset:1px}
.mx-hb.gap:before{content:"";position:absolute;left:0;right:0;bottom:14px;height:6px;background:#f3c6cf;border-radius:2px}
.mx-hb.fut{opacity:.35}
.mx-hb:disabled{cursor:default}
.mx-hb small{position:absolute;bottom:0;left:0;font-size:10px;color:#6b8194;line-height:12px}
.mx-group{display:flex;align-items:baseline;gap:10px;margin:4px 0 10px;scroll-margin-top:8px}
.mx-group:not(:first-child){margin-top:20px}
.mx-group b{font-size:14px;color:#082945}.mx-group span{font-size:14px;font-weight:700;color:#0f6f84}.mx-group small{font-size:12px;color:#6b8194;margin-left:auto}
.media-body{background:#f5f8fa!important;padding:16px 20px!important}
.mx-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))!important;gap:12px!important}
.mx-tile{border:0!important;border-radius:10px!important;aspect-ratio:16/9!important;box-shadow:0 1px 2px rgba(8,41,69,.08);transition:transform .12s,box-shadow .12s}
.mx-tile:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(8,41,69,.18);outline:none!important}
.mx-tile:focus-visible{outline:3px solid #10aeb5!important}
.mx-tile img{object-fit:cover!important}
.mx-cap{position:absolute;left:8px;bottom:8px;display:flex;align-items:center;gap:6px;max-width:calc(100% - 16px);padding:3px 8px;border-radius:6px;background:rgba(7,22,36,.78);font-size:12px;color:#fff}
.mx-cap b{font-variant-numeric:tabular-nums;font-weight:700}.mx-cap span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d6e6ee}
.mx-sd{position:absolute;right:8px;top:8px;padding:2px 7px;border-radius:6px;background:#0f6f84;color:#fff;font-size:10.5px;font-weight:800;letter-spacing:.04em}
.mx-empty{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}
.mx-empty b{color:#082945;font-size:15px}
.mx-foot{padding:10px 20px!important}
.mx-foot button{display:inline-flex;align-items:center;gap:4px;font-weight:700;border-radius:9px}
.mx-foot #mediaPage{display:flex;align-items:center;gap:8px;font-weight:600;color:#3f5668}
.mx-pg{width:80px!important;height:34px;min-height:34px;margin:0;text-align:center;font-size:13px;padding:0 6px}
.mx-viewer{gap:12px!important}
.mx-vbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:#3f5668}
.mx-vbar button{display:inline-flex;align-items:center;gap:6px;font-weight:700;border-radius:9px;font-size:13px}
.mx-vbar select{width:auto;margin:0;height:36px;min-height:36px;font-size:13px}
.mx-when b{font-size:16px;color:#082945;margin-right:4px;font-variant-numeric:tabular-nums}
.mx-tag{padding:3px 9px;border-radius:20px;background:#e8f5f7;color:#0f6f84;font-weight:700;font-size:12px}
.mx-sp{flex:1}
.mx-dl{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:9px;background:#0f6f84;color:#fff!important;text-decoration:none;font-weight:700}
.mx-dl:hover{background:#0b5c6e}
.mx-live-st{display:inline-flex;align-items:center;gap:8px;font-weight:700;color:#082945}
.mx-stage{position:relative;border-radius:12px;overflow:hidden;min-height:300px}
.mx-stage img,.mx-stage video{max-height:62vh!important}
.mx-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;border:0;background:rgba(255,255,255,.9);color:#082945;display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.3)}
.mx-nav.l{left:12px}.mx-nav.r{right:12px}
.mx-nav:hover:not(:disabled){background:#fff}
.mx-nav:disabled{opacity:.3;cursor:default}
.mx-strip{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px}
.mx-strip button{position:relative;flex:0 0 112px;aspect-ratio:16/9;padding:0;border:2px solid transparent;border-radius:8px;overflow:hidden;background:#152e40;cursor:pointer;opacity:.75}
.mx-strip button:hover{opacity:1}
.mx-strip button.cur{border-color:#0f6f84;opacity:1}
.mx-strip img{width:100%;height:100%;object-fit:cover;display:block}
.mx-strip small{position:absolute;left:4px;bottom:3px;font-size:10px;color:#fff;background:rgba(7,22,36,.75);padding:1px 4px;border-radius:4px}
@media(max-width:700px){.media-drawer.mx{width:100vw;border-radius:0}.mx-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.mx-hbs small{display:none}.mx-bar #mediaCount{margin-left:0}}

.mx-head span{color:inherit}
.mx-head .mx-ico{color:#0f6f84!important}
.mx-head #mediaCameraInfo span{color:#3f5668!important;font-size:12.5px}
.mx.viewing .mx-hours,.mx.viewing .mx-foot{display:none!important}
.mx.viewing .mx-stage img,.mx.viewing .mx-stage video{max-height:calc(100vh - 380px)!important}
.mx-stage{min-height:200px}
/* compact sizing */
.media-drawer.mx{width:min(1020px,90vw);height:min(860px,100%);margin:auto 0 auto auto}
.media-overlay:has(.mx){align-items:center}
.mx-head{padding:12px 16px!important}
.mx-ico{width:36px;height:36px;border-radius:9px}.mx-ico svg{width:19px;height:19px}
.mx-head h2{font-size:17px!important}
.media-header button.mx-live{height:36px;padding:0 14px!important;font-size:13px!important}
.media-header button.mx-x{width:36px!important;height:36px!important}
.mx-tabs{padding:0 16px!important}.mx-tabs button{padding:10px 10px 8px!important;font-size:13px!important}
.mx-bar{padding:8px 16px!important}
.mx-date .media-icon,.mx-chip,.mx-bar>.media-icon{height:32px!important;min-height:32px!important}
.mx-date .media-icon{width:32px!important}.mx-bar>.media-icon{width:32px!important}
.mx-date input{height:32px!important;min-height:32px!important;width:136px!important;font-size:12.5px}
.mx-chip{padding:0 12px!important;font-size:12.5px}
.mx-hours{padding:8px 16px 6px}.mx-hbs{height:46px}
.media-body{padding:12px 16px!important}
.mx-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))!important;gap:10px!important}
.mx-group{margin:2px 0 8px}.mx-group:not(:first-child){margin-top:14px}
.mx-group b,.mx-group span{font-size:13px}
.mx-cap{left:6px;bottom:6px;padding:2px 6px;font-size:11px}
.mx-sd{right:6px;top:6px;font-size:10px;padding:1px 6px}
.mx-foot{padding:8px 16px!important}.mx-foot button{min-height:32px!important;padding:4px 10px!important;font-size:12.5px!important}
.mx-pg{height:30px!important;min-height:30px!important;width:70px!important}
.mx-vbar{font-size:12.5px}.mx-when b{font-size:14px}
.mx-dl,.mx-vbar select,.mx-vbar button{height:32px!important;min-height:32px!important}
.mx-strip button{flex-basis:92px}
.mx.viewing .mx-stage img,.mx.viewing .mx-stage video{max-height:calc(min(860px,100vh) - 330px)!important}
.mx-vbar select{padding:0 28px 0 10px!important;line-height:30px;font-size:12.5px!important}
/* ---------- live view ---------- */
.mx-live-wrap{display:flex;flex-direction:column;gap:10px;height:100%}
.mx-lstage{position:relative;flex:1;min-height:260px;background:#06121c;border-radius:12px;overflow:hidden;display:flex;align-items:center;justify-content:center}
.mx-lstage video{width:100%;height:100%;max-height:calc(min(860px,100vh) - 300px);object-fit:contain;display:block;background:#06121c}
.mx-lstage:fullscreen video{max-height:100vh}
.mx-ltop{position:absolute;left:12px;top:12px;right:12px;display:flex;align-items:center;gap:10px;pointer-events:none}
.mx-lbadge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:6px;background:rgba(6,18,28,.72);color:#fff;font-size:12px;font-weight:800;letter-spacing:.06em}
.mx-lbadge i{width:8px;height:8px;border-radius:50%;background:#9aa9b4}
.mx-lbadge[data-kind=playing] i{background:#ff3b4e;box-shadow:0 0 0 0 #ff3b4e88;animation:mxpulse 1.6s infinite}
.mx-lbadge[data-kind=buffering] i,.mx-lbadge[data-kind=connecting] i{background:#f0b429}
@keyframes mxpulse{0%{box-shadow:0 0 0 0 #ff3b4e88}70%{box-shadow:0 0 0 7px #ff3b4e00}100%{box-shadow:0 0 0 0 #ff3b4e00}}
.mx-linfo{padding:4px 9px;border-radius:6px;background:rgba(6,18,28,.6);color:#d6e6ee;font-size:11.5px;font-variant-numeric:tabular-nums}
.mx-linfo:empty{display:none}
.mx-lov{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#fff;background:rgba(6,18,28,.55);text-align:center;padding:20px}
.mx-lov[hidden]{display:none}
.mx-lov[data-kind=buffering]{background:transparent}
.mx-lov[data-kind=buffering] b{font-size:12.5px;padding:4px 10px;border-radius:6px;background:rgba(6,18,28,.7)}
.mx-lov b{font-size:14px;font-weight:700;max-width:420px}
.mx-lov[data-kind=error] .mx-spin,.mx-lov[data-kind=stopped] .mx-spin{display:none}
.mx-spin{width:34px;height:34px;border-radius:50%;border:3px solid rgba(255,255,255,.25);border-top-color:#fff;animation:mxspin .8s linear infinite}
@keyframes mxspin{to{transform:rotate(360deg)}}
.mx-lctl{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:8px;padding:28px 12px 12px;background:linear-gradient(transparent,rgba(6,18,28,.75));opacity:0;transition:opacity .2s}
.mx-lstage:hover .mx-lctl,.mx-lstage:focus-within .mx-lctl,.mx-lov:not([hidden])~.mx-lctl{opacity:1}
.mx-lbtn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:8px;border:1px solid rgba(255,255,255,.28);background:rgba(6,18,28,.55);color:#fff;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer}
.mx-lbtn:hover{background:rgba(255,255,255,.16)}
.mx-lbtn.pri{background:#0f6f84;border-color:#0f6f84}
.mx-q{position:relative}
.mx-qmenu{position:absolute;left:0;bottom:calc(100% + 8px);min-width:230px;background:#fff;border-radius:10px;padding:6px;box-shadow:0 14px 40px rgba(0,0,0,.35);display:flex;flex-direction:column}
.mx-qmenu[hidden]{display:none}
.mx-qmenu button{display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:0;background:transparent;padding:8px 10px;border-radius:7px;text-align:left;font:inherit;cursor:pointer;color:#082945}
.mx-qmenu button:hover{background:#eef6f8}
.mx-qmenu button[aria-checked=true]{background:#e8f5f7}
.mx-qmenu button[aria-checked=true] b:after{content:" ✓";color:#0f6f84}
.mx-qmenu b{font-size:13px}.mx-qmenu small{font-size:11.5px;color:#5d7387}
