@font-face{font-family:Vazirmatn;src:local("Vazirmatn"),url("fonts/Vazirmatn-Regular.woff2") format("woff2");font-weight:100 900;font-display:swap}
:root{--bg:#0b0b0b;--s1:#161616;--s2:#232323;--tx:#f3f3f3;--mu:#9a9a9a;--ac:#10b981;--ac2:#34d399}
[data-theme=light]{--bg:#f6f7f6;--s1:#fff;--s2:#e8ebe9;--tx:#111;--mu:#666;--ac:#059669;--ac2:#047857}
*{box-sizing:border-box;margin:0;-webkit-tap-highlight-color:transparent}
body{background:var(--bg);color:var(--tx);font-family:Vazirmatn,Tahoma,system-ui,sans-serif;display:grid;grid-template-columns:220px 1fr;height:100dvh;overflow:hidden}
button{font:inherit;color:inherit;background:var(--s2);border:0;border-radius:20px;padding:8px 14px;cursor:pointer}button:hover{filter:brightness(1.15)}
.pri{background:var(--ac);color:#04130d;font-weight:700}.ib{background:none;padding:6px 10px}.ghost{background:none;color:var(--mu)}
input,select{font:inherit;color:inherit;background:var(--s2);border:0;border-radius:20px;padding:9px 14px}
#side{background:#000;padding:18px 10px;overflow:auto}#side h1{color:var(--ac2);font-size:26px;padding:0 10px 16px}#side small{display:block;font-size:10px;color:var(--mu);letter-spacing:1px}
#nav button{display:block;width:100%;text-align:right;background:none;border-radius:10px;padding:11px 12px;color:var(--mu)}#nav .on{background:var(--s2);color:var(--tx)}
main{display:flex;flex-direction:column;min-width:0;height:100dvh}header{display:flex;gap:8px;padding:12px 14px;position:sticky;top:0}header input{flex:1;min-width:0}
#view{flex:1;overflow:auto;padding:6px 14px 150px}
.row{display:flex;align-items:center;gap:10px;padding:6px;border-radius:10px;cursor:pointer}.row:hover,.row.cur{background:var(--s1)}.row.cur b{color:var(--ac2)}
.m{flex:1;min-width:0;display:flex;flex-direction:column}.m b,.m span,.card b,.card span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m span,.card span,.d{color:var(--mu);font-size:12px}
.cv{width:48px;height:48px;border-radius:8px;object-fit:cover;flex:none;background:var(--s2);display:grid;place-items:center;color:var(--mu)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:14px}.card{background:var(--s1);padding:10px;border-radius:14px;cursor:pointer;display:flex;flex-direction:column;gap:4px}.card .cv{width:100%;height:auto;aspect-ratio:1;border-radius:10px}
.card.ar .cv{border-radius:50%}.chips{display:flex;gap:6px;overflow:auto;padding:4px 0 10px}.chips button{white-space:nowrap}.chips .on{background:var(--ac);color:#04130d}
.bar{display:flex;gap:8px;align-items:center;margin:6px 0 10px;flex-wrap:wrap}.more{width:100%;margin:10px 0}h2,h3{margin:14px 0 8px}
.hero{display:flex;gap:16px;align-items:center;margin:8px 0 14px}.hero .cv{width:120px;height:120px;border-radius:14px}.hero.ar .cv{border-radius:50%}
.bw{background:var(--s2);border-radius:6px;height:10px}.bw i{display:block;height:100%;background:var(--ac);border-radius:6px}.st{display:grid;grid-template-columns:110px 1fr 50px;gap:8px;align-items:center;margin:6px 0}
#mini{position:fixed;inset:auto 0 0 220px;background:var(--s1);display:flex;align-items:center;gap:8px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--s2)}
#mc .cv{width:44px;height:44px}#mp{position:absolute;top:0;right:0;height:2px;background:var(--ac);width:0}
#np{position:fixed;inset:0;background:var(--bg);z-index:5;overflow:auto;padding:20px;text-align:center}#np[hidden]{display:none}#nc .cv{width:min(70vw,340px);height:min(70vw,340px);margin:auto;border-radius:16px}
#np h2{margin:14px 0 2px}#np p{color:var(--mu)}#seek,#vol{width:100%;accent-color:var(--ac);padding:0}.tm{display:flex;justify-content:space-between;color:var(--mu);font-size:12px}
.ctl{display:flex;gap:8px;justify-content:center;align-items:center;margin:10px 0}.big{font-size:22px;padding:12px 22px}.act{color:var(--ac2)}
#qu .row{text-align:right}dialog{border:0;border-radius:18px;background:var(--s1);color:var(--tx);padding:16px;width:min(92vw,380px);margin:auto}dialog::backdrop{background:#0009}
dialog button{display:block;width:100%;margin:6px 0;text-align:right}#toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);background:var(--ac);color:#04130d;padding:8px 16px;border-radius:20px;opacity:0;transition:.3s;pointer-events:none;z-index:9}#toast.on{opacity:1}
.eq{display:flex;gap:6px;justify-content:space-around;margin:10px 0}.eq label{display:flex;flex-direction:column;align-items:center;font-size:11px;gap:4px}.eq input{writing-mode:vertical-lr;direction:rtl;width:30px;height:120px;padding:0;accent-color:var(--ac)}
@media(max-width:760px){body{grid-template-columns:1fr}#side{position:fixed;bottom:0;inset-inline:0;z-index:4;padding:0;display:block;background:var(--s1)}#side h1{display:none}#nav{display:flex;overflow:auto}#nav button{width:auto;white-space:nowrap;padding:12px 10px;font-size:12px}#mini{inset:auto 0 46px 0}#view{padding-bottom:170px}}

.cv.ph{background:linear-gradient(135deg,hsl(var(--h,160) 55% 24%),#0b0b0b);color:hsl(var(--h,160) 70% 70%);font-size:20px;font-weight:700}
.card .cv.ph{font-size:34px}.hero .cv.ph{font-size:40px}
button,.row,.card,input[type=range]{touch-action:manipulation;user-select:none}button{min-height:40px}.ib{min-width:40px}
header{background:var(--bg);z-index:3}textarea{font:inherit;color:inherit;background:var(--s2);border:0;border-radius:12px;padding:8px}
dialog{max-height:88dvh;overflow:auto}
@media(max-width:760px){header{padding-top:max(12px,env(safe-area-inset-top))}.hero{flex-direction:column;text-align:center}}
#np>.ib{position:absolute;top:8px;left:8px;z-index:2}

#side h1 .logo{display:block;width:72px;height:72px;margin:0 auto 8px;border-radius:50%}#side h1{text-align:center}

/* تلویزیون اینترنتی v2.2.8 — سه بخش مستقل: پخش (ثابت) / جست‌وجو و دسته‌ها (ثابت) / فهرست (تنها بخش اسکرول‌شونده) */
#tvpage{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:0 14px calc(66px + env(safe-area-inset-bottom))}
#tvpage[hidden],#videoPage[hidden]{display:none!important}body.tvmode #view{display:none}
.tvplayer{flex:none}
.tvbox{position:relative;background:#000;border-radius:14px;overflow:hidden}
.tvbox video{display:block;width:100%;aspect-ratio:16/9;max-height:30dvh;background:#000;object-fit:contain}.tvbox video[hidden]{display:none}
.tvph{display:grid;place-content:center;gap:4px;text-align:center;aspect-ratio:16/9;max-height:30dvh;background:var(--s1);color:var(--mu);padding:8px}.tvph[hidden]{display:none}.tvph small{font-size:11px}
.tvnow{display:flex;align-items:center;gap:6px;padding:6px 2px 2px}.tvnow .m b{font-size:14px}.tvnow button{min-width:44px;padding:6px 10px}.tvnow button:disabled{opacity:.4}
.tvstatus{margin:0;padding:0 2px 4px;color:var(--mu);font-size:12px}.tvstatus:empty{display:none}
.tvbrowse{flex:1;min-height:0;display:flex;flex-direction:column}
.tvhead{flex:none;display:flex;align-items:center;gap:8px;padding:2px 0 6px}.tvhead b{font-size:15px}.tvhead .d{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tvhead button{padding:6px 12px;min-height:36px}
.tvmsg{flex:none;margin:0 0 6px;font-size:12px}.tvmsg[hidden]{display:none}.tverror{color:#ef7777;background:var(--s1);padding:8px 10px;border-radius:10px}
.iptv-search-wrap{flex:none;margin:0 0 8px}
.iptv-search{display:block!important;box-sizing:border-box;width:100%!important;min-height:42px;border:1px solid var(--ac)!important;border-radius:12px!important;background:var(--s1)!important;color:var(--tx)!important;padding:10px 14px!important;font-size:16px!important;direction:rtl;user-select:text!important}.iptv-search::placeholder{color:var(--mu);opacity:1}.iptv-search:focus{outline:2px solid var(--ac)}
.tvbrowse .chips button{min-height:34px;padding:5px 12px}.tvbrowse .chips{flex:none;padding:0 0 8px;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.tvlist{position:relative;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));grid-auto-rows:min-content;align-content:start;gap:5px}
.tvrow{display:flex;align-items:center;gap:9px;padding:7px;min-height:58px;border-radius:10px;background:var(--s1);min-width:0;cursor:pointer;content-visibility:auto;contain-intrinsic-size:auto 58px}
.tvrow.on{background:var(--s2);outline:2px solid var(--ac)}.tvrow.on b{color:var(--ac2)}
.tvrow img,.tvlogo{width:42px;height:42px;object-fit:contain;border-radius:7px;background:var(--s2);flex:none}.tvlogo{display:grid;place-items:center}.tvrow .m b{font-size:13px}.tvempty{grid-column:1/-1;padding:14px 4px}
.tvbox.tvfull{position:fixed;inset:0;z-index:20;border-radius:0}.tvbox.tvfull video{width:100%;height:100dvh;max-height:none;aspect-ratio:auto}
.tvbox:fullscreen{border-radius:0}.tvbox:fullscreen video{width:100%;height:100%;max-height:none;aspect-ratio:auto}.tvbox:-webkit-full-screen video{width:100%;height:100%;max-height:none;aspect-ratio:auto}
.tvfsx{position:absolute;top:max(8px,env(safe-area-inset-top));left:8px;z-index:2;background:#000a;color:#fff;min-width:44px}.tvfsx[hidden]{display:none}
@media(max-width:760px){#tvpage{padding-bottom:calc(112px + env(safe-area-inset-bottom));padding-top:max(8px,env(safe-area-inset-top))}body.tvmode header{display:none}}
/* دسکتاپ/تبلت و گوشی افقی: پخش کنار فهرست (دو ستون)، فهرست تمام ارتفاع */
@media(min-width:900px),(orientation:landscape) and (max-height:520px){#tvpage{flex-direction:row;gap:14px;padding-bottom:calc(66px + env(safe-area-inset-bottom))}.tvplayer{flex:0 0 46%;min-width:0;overflow:hidden}.tvbox video,.tvph{max-height:60dvh}.tvbrowse{min-width:0}.tvlist{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}}
@media(orientation:landscape) and (max-height:520px){body.tvmode header{display:none}.tvbox video,.tvph{max-height:52dvh}.tvlist{grid-template-columns:1fr}}
@media(orientation:landscape) and (max-height:520px) and (max-width:760px){#tvpage{padding-bottom:calc(112px + env(safe-area-inset-bottom))}}



/* --- Naghme Native Player Overlay (Final) --- */
body.native-player-active #iptvVideo,
body.native-player-active #iptvStatus {
    opacity: 0 !important;
    pointer-events: none !important;
}
body.native-player-active #iptvResults {
    /* وقتی Native پلیر باز است، لیست زیر آن اسکرول شود */
    margin-top: 0 !important;
}

/* Video library: fixed player area, independently scrollable library */
#videoPage{display:flex;flex:1;min-height:0;height:100%;overflow:hidden}
#videoContent{display:flex;flex:1;min-height:0;overflow:hidden}
.video-page{display:flex;height:100%;min-height:0;flex:1;flex-direction:column;overflow:hidden;padding:4px 0 0}
.video-top{flex:none}
.video-stage{flex:none;max-height:30dvh;aspect-ratio:16/9}
.video-tools{flex:none;max-height:none}
.video-now{flex:none}
.video-library-head{flex:none}
.video-list{display:grid;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;align-content:start;padding-bottom:12px}
.video-note{flex:none}
/* Video library */
.video-page{padding:4px 0 130px}.video-top,.video-library-head,.video-now{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.video-top .bar{margin:0}.video-stage{position:relative;background:#000;border-radius:16px;overflow:hidden;margin:12px 0 8px;aspect-ratio:16/9;max-height:58vh}.video-stage video{width:100%;height:100%;display:block;object-fit:contain;background:#000}.video-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#aaa;font-size:42px;pointer-events:none}.video-empty span{font-size:14px}.video-empty[hidden]{display:none}.video-tools{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;margin:10px 0}.video-tools button{font-size:13px}.video-tools label{display:flex;align-items:center;gap:6px;font-size:13px}.video-tools select{padding:7px}.video-now{padding:8px 2px;border-bottom:1px solid var(--s2)}.video-library-head{margin:14px 0 8px}.video-library-head input{flex:1;min-width:160px}.video-list{display:grid;gap:6px}.video-item{display:flex;align-items:center;gap:8px;padding:7px;background:var(--s1);border-radius:12px}.video-item.playing{outline:1px solid var(--ac)}.video-item-main{display:flex;align-items:center;gap:10px;text-align:right;flex:1;min-width:0;background:none;padding:2px}.video-item-main>span:last-child{display:flex;flex-direction:column;min-width:0}.video-item-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.video-item-main small{color:var(--mu);font-size:11px}.video-thumb{width:52px;height:42px;display:grid;place-items:center;border-radius:8px;background:#000;color:var(--ac2);flex:none}.video-empty-list{padding:24px;text-align:center}.video-note{margin:14px 0;line-height:1.9}
@media(max-width:700px){body{grid-template-columns:1fr}#mini{left:0}header{padding:8px}#view{padding:6px 10px 130px}.video-stage{max-height:42vh}.video-tools{gap:5px}.video-tools button{padding:7px 10px}}

/* Compact player controls: keep the area below the monitor for the video name and scrolling library */
.video-page{padding:4px 0 0!important}
.video-tools{display:none!important}
.video-stage{margin:6px 0 4px!important;max-height:30dvh!important}
.video-now{flex:none;min-height:48px;margin:0!important;padding:5px 2px!important;gap:8px}
.video-now #videoNow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.video-gear{flex:none;min-width:44px;min-height:40px;border:1px solid var(--ac);border-radius:12px;font-size:19px;padding:5px 10px}
.video-library-head{flex:none;margin:6px 0!important;gap:8px}
.video-list{flex:1;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.video-note{display:none}

/* ابزارهای ویدئو: دکمهٔ سه‌نقطهٔ واقعی و قابل لمس */
.video-now .video-more{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:none!important;width:44px!important;min-width:44px!important;height:42px!important;min-height:42px!important;padding:0!important;border:1px solid var(--ac)!important;border-radius:12px!important;background:var(--s1)!important;color:var(--tx)!important;font-size:28px!important;font-weight:700!important;line-height:1!important;letter-spacing:2px!important;z-index:5!important;position:relative!important}
.video-now .video-gear{display:none!important}

/* کنترل‌های مستقیم زیر مانیتور؛ بدون منوی شناور */
.video-tools.video-tools-inline{display:flex!important;flex:none!important;justify-content:flex-start!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;margin:5px 0 8px!important;padding:7px!important;background:var(--s1)!important;border:1px solid var(--s2)!important;border-radius:12px!important;max-height:none!important;overflow:visible!important}
.video-tools-inline button{min-height:38px!important;padding:7px 11px!important;border-radius:10px!important;font-size:12px!important;white-space:nowrap}
.video-tools-inline label{display:flex;align-items:center;gap:5px;font-size:12px;white-space:nowrap}
.video-tools-inline select{min-height:36px;padding:5px 8px;border-radius:9px}
.video-now .video-gear{display:none!important}
.video-tools-inline #videoLock{border:1px solid var(--ac)!important;font-weight:700!important}
@media(max-width:700px){.video-tools.video-tools-inline{gap:5px!important;padding:6px!important}.video-tools-inline button{font-size:11px!important;padding:6px 9px!important}}

/* Final visibility fix: keep floating menu and touch-lock control visible */
.video-now .video-more{display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
.video-tools.video-tools-inline #videoLock{display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
.video-now .video-gear{display:none!important}


/* Naghme: isolated mode selector and section layouts */
#modeBar{flex:none;display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--s1);border-bottom:1px solid var(--s2);min-height:52px}
#modeBar[hidden],#modeHome[hidden],#side[hidden],#mini[hidden],#tvpage[hidden],#videoPage[hidden],header[hidden]{display:none!important}
#modeBar button{border-radius:10px;min-height:38px}
#modeTitle{font-size:15px}
#modeHome{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px;padding:24px;overflow:auto}
.mode-welcome{text-align:center}
.mode-welcome img{width:88px;height:88px;border-radius:24px;object-fit:cover}
.mode-welcome h1{font-size:30px;color:var(--ac2);margin:8px 0 2px}
.mode-welcome p{color:var(--mu);font-size:14px}
.mode-cards{width:min(100%,760px);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.mode-cards button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:170px;padding:18px 10px;border:1px solid var(--s2);border-radius:18px;background:var(--s1)}
.mode-cards button:active{border-color:var(--ac);transform:scale(.99)}
.mode-cards button>span{font-size:38px;line-height:1.2}
.mode-cards button>b{font-size:18px}
.mode-cards button>small{font-size:11px;color:var(--mu);font-weight:400}
body.mode-home{display:block}
body.mode-home main{height:100dvh}
body.mode-home #side,body.mode-home main>header,body.mode-home #view,body.mode-home #tvpage,body.mode-home #videoPage,body.mode-home #mini,body.mode-home #np{display:none!important}
body.mode-music{grid-template-columns:220px 1fr}
body.mode-music #tvpage,body.mode-music #videoPage{display:none!important}
body.mode-music #nav [data-v="iptv"],body.mode-music #nav [data-v="video"]{display:none!important}
body.mode-video,body.mode-tv{display:block}
body.mode-video #side,body.mode-tv #side{display:none!important}
body.mode-video main,body.mode-tv main{height:100dvh}
body.mode-video main>header,body.mode-tv main>header{display:none!important}
body.mode-video #view,body.mode-tv #view{display:none!important}
body.mode-video #mini,body.mode-tv #mini,body.mode-video #np,body.mode-tv #np{display:none!important}
body.mode-video #videoPage,body.mode-tv #tvpage{flex:1;min-height:0}
body.mode-tv #tvpage{padding-top:8px}
@media(max-width:760px){
 .mode-cards{grid-template-columns:1fr;max-width:420px;gap:10px}
 .mode-cards button{min-height:104px;display:grid;grid-template-columns:56px 1fr;grid-template-rows:auto auto;justify-items:start;text-align:right;padding:14px 18px;column-gap:12px}
 .mode-cards button>span{grid-row:1/3;font-size:34px;align-self:center}
 .mode-cards button>b{align-self:end}
 .mode-cards button>small{align-self:start}
 #modeHome{gap:18px;padding:18px}
 body.mode-music{grid-template-columns:1fr}
}

/* Native IPTV: local playlist import button */
.tvhead{flex-wrap:wrap}
.tvhead #iptvFileBtn{max-width:100%;min-height:36px;padding:5px 9px;border:1px solid var(--ac);background:var(--s1);color:var(--tx);font-size:11px;line-height:1.5;white-space:nowrap}
.tvhead #iptvFileBtn[hidden]{display:none!important}


/* IPTV UI refresh — flex-first responsive layout; no playback logic changes */
.btn-sm{height:36px;min-height:36px;padding:0 10px;font-size:13px;border-radius:8px;background:#1a1a1a;border:1px solid #333;color:#ddd;display:inline-flex;align-items:center;justify-content:center;gap:4px;flex-shrink:0;white-space:nowrap}
.btn-sm.active{background:#10b981;color:#fff}
body.mode-tv{grid-template-columns:minmax(0,1fr);height:100vh;height:100dvh;overflow:hidden}
body.mode-tv main{grid-column:1/-1;width:100%;height:100vh;height:100dvh;max-height:100dvh;min-height:0;overflow:hidden}
body.mode-tv header{display:none!important}
body.mode-tv #tvpage{display:flex;flex:1 1 auto;flex-direction:column;width:100%;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;min-height:0;overflow:hidden;gap:0;padding:env(safe-area-inset-top) 12px calc(64px + env(safe-area-inset-bottom));direction:rtl}
body.mode-tv #tvpage[hidden]{display:none!important}
body.mode-tv .tv-topbar{height:48px;min-height:48px;flex:0 0 48px;display:flex;align-items:center;gap:12px;padding:4px 2px;margin:0 0 6px;border-bottom:1px solid #262626;box-shadow:0 3px 9px #0008;background:var(--bg);z-index:4}
body.mode-tv .tv-topbar strong{flex:1;min-width:0;text-align:center;font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.mode-tv .tv-topbar button{min-width:36px}
body.mode-tv .tvplayer{display:flex;flex:0 0 auto;flex-direction:column;min-width:0;min-height:0;gap:0;overflow:visible}
body.mode-tv .tvbox{position:relative;display:block;width:min(100%,calc(35dvh * 16 / 9));height:auto;max-height:35dvh;aspect-ratio:16/9;flex:none;margin:0 auto;background:#000;border-radius:10px;overflow:hidden;order:1}
body.mode-tv .tvbox video,body.mode-tv .tvph{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:contain}
body.mode-tv .tvbox video[hidden],body.mode-tv .tvph[hidden]{display:none!important}
body.mode-tv .tvph{display:grid;place-content:center;text-align:center;gap:4px;padding:8px;background:#000;color:#aaa}
body.mode-tv .tvph small{font-size:11px}
body.mode-tv #naghmeIptvTools{order:2;display:flex!important;flex:0 0 36px;flex-wrap:nowrap!important;align-items:center;gap:8px;width:100%;max-width:100%;margin:0!important;padding:2px 0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
body.mode-tv #naghmeIptvTools::-webkit-scrollbar,body.mode-tv .tvbrowse .chips::-webkit-scrollbar{display:none}
body.mode-tv #naghmeIptvTools>*{flex:0 0 auto;white-space:nowrap}
body.mode-tv #naghmeIptvTools button,body.mode-tv #naghmeIptvTools select{height:36px!important;min-height:36px!important;padding:0 10px!important;border:1px solid #333!important;border-radius:8px!important;background:#1a1a1a!important;color:#ddd!important;font:13px Vazirmatn,Tahoma,sans-serif!important}
body.mode-tv #naghmeIptvTools label{display:inline-flex!important;align-items:center;gap:5px;flex:0 0 auto;white-space:nowrap}
body.mode-tv .tvnow{order:3;display:flex;flex:0 0 40px;align-items:center;gap:6px;height:40px;min-height:40px;padding:2px 0;margin:0;border-bottom:1px solid #252525;overflow:hidden}
body.mode-tv .tvnow .m{display:flex;flex:1;min-width:0;flex-direction:row;align-items:center;gap:8px;white-space:nowrap}
body.mode-tv .tvnow .m b{max-width:58%;font-size:13px;font-weight:600}
body.mode-tv .tvnow .m span{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--mu)}
body.mode-tv .tvnow button{width:32px;height:32px;min-width:32px;min-height:32px;padding:0}
body.mode-tv #iptvStatus{order:4;flex:0 0 auto;max-height:20px;margin:0;padding:0 2px;overflow:hidden;font-size:11px;line-height:18px}
body.mode-tv #iptvStatus:empty{display:none}
body.mode-tv .tvbrowse{display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;overflow:hidden;gap:0;padding:0}
body.mode-tv .tvhead{display:flex;flex:0 0 40px;align-items:center;gap:8px;height:40px;min-height:40px;padding:2px 0;margin:0;overflow-x:auto;overflow-y:hidden}
body.mode-tv .tvhead .d{flex:1 1 auto;min-width:0;white-space:nowrap;font-size:11px}
body.mode-tv .tvhead .btn-sm{height:36px;min-height:36px}
body.mode-tv .tvmsg{flex:0 0 auto;max-height:34px;margin:0;padding:2px 0;font-size:11px;overflow:hidden}
body.mode-tv .tvmsg[hidden]{display:none!important}
body.mode-tv .iptv-search-wrap{flex:0 0 40px;height:40px;min-height:40px;margin:0;padding:2px 0}
body.mode-tv .iptv-search{width:100%!important;height:36px;min-height:36px!important;padding:5px 12px!important;border:1px solid #333!important;border-radius:9px!important;background:var(--s1)!important;font-size:14px!important}
body.mode-tv .tvbrowse .chips{display:flex;flex:0 0 40px;align-items:center;gap:8px;width:100%;height:40px;min-height:40px;padding:2px 0 4px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
body.mode-tv .tvbrowse .chips button{height:36px;min-height:36px;padding:0 12px;border-radius:9px;flex:0 0 auto;white-space:nowrap;background:#1a1a1a;color:#ddd;border:1px solid #333}
body.mode-tv .tvbrowse .chips button.on{background:#10b981;color:#fff;border-color:#10b981}
body.mode-tv #iptvResults{position:relative;display:grid;flex:1 1 auto;min-width:0;min-height:0;width:100%;grid-template-columns:1fr;grid-auto-rows:min-content;align-content:start;gap:6px;overflow-y:auto;overflow-x:hidden;padding:2px 0 80px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
body.mode-tv .tvrow{display:flex;align-items:center;gap:9px;width:100%;height:64px;min-height:64px;padding:7px 9px;border-radius:10px;background:var(--s1);contain:content}
body.mode-tv .tvrow img,body.mode-tv .tvrow .tvlogo{width:40px;height:40px;min-width:40px;flex:0 0 40px;object-fit:contain;border-radius:8px}
body.mode-tv .tvrow .m{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center;gap:2px}
body.mode-tv .tvrow .m b{font-size:14px;font-weight:600;line-height:1.35}
body.mode-tv .tvrow .m span{font-size:12px;line-height:1.3;color:var(--mu)}
body.mode-tv .tvrow .ib{width:32px;height:32px;min-width:32px;min-height:32px;flex:0 0 32px;padding:0;border-radius:8px}
body.mode-tv #mini,body.mode-tv #mini[hidden]{display:flex!important;position:fixed;inset:auto 0 0 0;z-index:100;width:100%;height:calc(64px + env(safe-area-inset-bottom));min-height:64px;align-items:center;gap:7px;padding:6px 10px calc(6px + env(safe-area-inset-bottom));border-top:1px solid #333;background:var(--s1)}
body.mode-tv #mini #mc .cv{width:42px;height:42px}
body.mode-tv #mini .m{min-width:0}
body.mode-tv #mini button{width:36px;height:36px;min-width:36px;min-height:36px;padding:0}
@media(max-height:600px){
 body.mode-tv .tvbox{width:min(100%,calc(25dvh * 16 / 9));max-height:25dvh}
 body.mode-tv #naghmeIptvTools{flex-basis:34px}
}
@media(max-width:360px){
 body.mode-tv{font-size:13px}
 body.mode-tv .btn-sm,body.mode-tv .tvnow button,body.mode-tv #naghmeIptvTools button,body.mode-tv #naghmeIptvTools select{height:32px!important;min-height:32px!important;padding:0 8px!important;font-size:12px!important}
 body.mode-tv .tvhead{gap:5px}
 body.mode-tv .tvbrowse .chips button{height:32px;min-height:32px;padding:0 10px}
}
@media(orientation:landscape){
 body.mode-tv #tvpage{display:grid;grid-template-columns:minmax(0,44%) minmax(0,56%);grid-template-rows:48px minmax(0,1fr);column-gap:10px;row-gap:6px;direction:ltr;padding:env(safe-area-inset-top) 12px calc(64px + env(safe-area-inset-bottom))}
 body.mode-tv .tv-topbar{grid-column:1/-1;grid-row:1;direction:rtl;margin:0}
 body.mode-tv .tvplayer{grid-column:1;grid-row:2;direction:rtl;align-self:start;width:100%;min-width:0}
 body.mode-tv .tvbrowse{grid-column:2;grid-row:2;direction:rtl}
 body.mode-tv .tvbox{width:min(100%,calc(35dvh * 16 / 9));max-height:35dvh}
 body.mode-tv #iptvResults{grid-template-columns:1fr}
}
@media(orientation:landscape) and (max-height:600px){
 body.mode-tv .tvbox{width:min(100%,calc(25dvh * 16 / 9));max-height:25dvh}
}


/* IPTV follow-up: compact native toolbar + reliable narrow-screen list sizing */
body.mode-tv #tvpage{height:100dvh!important;max-height:100dvh!important;min-height:0!important;overflow:hidden!important}
body.mode-tv main{display:flex!important;flex-direction:column!important;min-height:0!important}
body.mode-tv .tvplayer{display:flex!important;flex:0 0 auto!important;flex-direction:column!important;min-height:0!important;overflow:visible!important}
body.mode-tv .tvbox{flex:0 0 auto!important;width:min(100%,calc(35dvh * 16 / 9))!important;aspect-ratio:16/9!important;height:auto!important;max-height:35dvh!important;margin-inline:auto!important}
body.mode-tv .tvnow{order:3!important;flex:0 0 40px!important;min-height:40px!important;height:40px!important;padding:2px 0!important}
body.mode-tv #naghmeIptvTools{display:flex!important;order:2!important;flex:0 0 38px!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;width:100%!important;max-width:100%!important;min-width:0!important;height:38px!important;min-height:38px!important;margin:0!important;padding:1px 0!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;scrollbar-width:none!important;direction:rtl!important}
body.mode-tv #naghmeIptvTools>*{display:inline-flex!important;flex:0 0 auto!important;align-items:center!important;white-space:nowrap!important;max-width:none!important}
body.mode-tv #naghmeIptvTools button{height:32px!important;min-height:32px!important;padding:0 8px!important;font-size:11px!important;line-height:1!important;border-radius:8px!important}
body.mode-tv #naghmeIptvTools label{height:32px!important;min-height:32px!important;gap:3px!important;font-size:11px!important}
body.mode-tv #naghmeIptvTools select{width:auto!important;max-width:64px!important;height:30px!important;min-height:30px!important;padding:0 4px!important;font-size:11px!important}
body.mode-tv .tvbrowse{display:flex!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
body.mode-tv .tvhead{flex-wrap:nowrap!important;flex:0 0 40px!important;min-height:40px!important;height:40px!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;gap:6px!important}
body.mode-tv .tvhead .d{display:none!important}
body.mode-tv .tvhead .btn-sm{flex:1 1 0!important;min-width:0!important;justify-content:center!important;padding:0 5px!important;font-size:11px!important}
body.mode-tv .tvhead #iptvFileBtn[hidden]{display:none!important}
body.mode-tv .iptv-search-wrap{flex:0 0 40px!important;min-height:40px!important;height:40px!important;margin:0!important}
body.mode-tv .tvbrowse .chips{flex:0 0 40px!important;min-height:40px!important;height:40px!important;flex-wrap:nowrap!important}
body.mode-tv .tvbrowse .chips button{height:32px!important;min-height:32px!important;padding:0 10px!important;flex:0 0 auto!important}
body.mode-tv #iptvResults{display:flex!important;flex:1 1 0!important;flex-direction:column!important;min-height:0!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;gap:6px!important;padding:2px 0 80px!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
body.mode-tv #iptvResults .tvrow{flex:0 0 64px!important;height:64px!important;min-height:64px!important}
body.mode-tv #iptvResults .tvempty{flex:0 0 auto!important}
body.mode-tv #mini[hidden]{display:none!important}
body.mode-tv #mini:not([hidden]){display:flex!important;position:fixed!important;inset:auto 0 0 0!important;z-index:100!important;height:calc(64px + env(safe-area-inset-bottom))!important;min-height:64px!important;padding:6px 10px calc(6px + env(safe-area-inset-bottom))!important}
@media(max-width:360px){
 body.mode-tv .tvbox{width:min(100%,calc(32dvh * 16 / 9))!important;max-height:32dvh!important}
 body.mode-tv #naghmeIptvTools{gap:4px!important}
 body.mode-tv #naghmeIptvTools button{padding:0 6px!important;font-size:10px!important}
 body.mode-tv .tvhead .btn-sm{font-size:10px!important}
}
@media(max-height:600px){body.mode-tv .tvbox{width:min(100%,calc(25dvh * 16 / 9))!important;max-height:25dvh!important}}
@media(orientation:landscape){
 body.mode-tv #tvpage{display:grid!important;grid-template-columns:minmax(0,44%) minmax(0,56%)!important;grid-template-rows:48px minmax(0,1fr)!important;gap:6px 10px!important;direction:ltr!important}
 body.mode-tv .tv-topbar{grid-column:1/-1!important;grid-row:1!important}
 body.mode-tv .tvplayer{grid-column:1!important;grid-row:2!important;width:100%!important}
 body.mode-tv .tvbrowse{grid-column:2!important;grid-row:2!important}
}


/* Global mode navigation: reachable from music, video and IPTV at all times */
.mode-switchbar{display:flex;flex:0 0 46px;min-height:46px;height:46px;align-items:center;gap:8px;padding:4px 10px;background:var(--s1);border-bottom:1px solid var(--s2);box-shadow:0 2px 8px #0005;z-index:30;direction:rtl}
.mode-switchbar[hidden]{display:none!important}
.mode-switchbar>strong{flex:1;min-width:0;text-align:center;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mode-switchbar .mode-home-btn{height:36px;min-height:36px;padding:0 10px;font-size:12px}
.mode-switch-actions{display:flex;flex:0 0 auto;gap:5px;align-items:center}
.mode-switch-actions .btn-sm{width:36px;height:36px;min-width:36px;min-height:36px;padding:0;font-size:17px}
.mode-switch-actions .btn-sm.active{background:#10b981;color:#fff;border-color:#10b981}
body.mode-music main,body.mode-video main,body.mode-tv main{display:flex!important;flex-direction:column!important;min-height:0!important;height:100dvh!important;overflow:hidden!important}
body.mode-music #modeBar,body.mode-video #modeBar,body.mode-tv #modeBar{display:flex!important}
body.mode-music #modeHome,body.mode-video #modeHome,body.mode-tv #modeHome{display:none!important}
body.mode-music #view{flex:1 1 auto;min-height:0;overflow:auto}
body.mode-video #videoPage{display:flex!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:auto!important}
body.mode-tv #tvpage{display:flex!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:hidden!important;padding-top:0!important}
body.mode-tv .tv-topbar{display:none!important}
body.mode-tv #tvpage[hidden],body.mode-video #videoPage[hidden]{display:none!important}
@media(max-width:360px){
 .mode-switchbar{gap:5px;padding-inline:7px}
 .mode-switchbar>strong{font-size:12px}
 .mode-switchbar .mode-home-btn{padding:0 7px;font-size:11px}
 .mode-switch-actions{gap:3px}
 .mode-switch-actions .btn-sm{width:32px;height:32px;min-width:32px;min-height:32px}
}


/* --- Video player: clean mobile-first layout (2026-11-13) --- */
body.mode-video #videoPage{
 display:flex!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;
 overflow:hidden!important;padding:0!important;
}
body.mode-video #videoContent{display:flex!important;flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;width:100%}
body.mode-video .video-page{
 display:flex!important;flex:1 1 auto!important;flex-direction:column!important;
 width:100%;height:100%!important;min-height:0!important;overflow:hidden!important;
 gap:0!important;padding:8px 12px 8px!important;
}
body.mode-video .video-top{
 flex:none!important;display:flex!important;align-items:center!important;
 justify-content:space-between!important;gap:8px!important;flex-wrap:wrap!important;
 margin:0!important;padding:0 0 6px!important;
}
body.mode-video .video-top h2{font-size:17px!important;line-height:1.4!important;margin:0!important}
body.mode-video .video-top p{display:none!important}
body.mode-video .video-top .bar{
 display:flex!important;flex:1 1 100%!important;gap:7px!important;
 flex-wrap:nowrap!important;margin:0!important;
}
body.mode-video .video-top .bar button{
 flex:1 1 0!important;min-width:0!important;min-height:38px!important;
 height:38px!important;padding:0 8px!important;border-radius:10px!important;
 font-size:12px!important;white-space:nowrap!important;
}
body.mode-video .video-stage{
 position:relative!important;flex:none!important;align-self:center!important;
 width:100%!important;max-width:min(100%,calc(31dvh * 16 / 9))!important;
 aspect-ratio:16/9!important;height:auto!important;max-height:31dvh!important;
 margin:5px auto 4px!important;border-radius:12px!important;background:#000!important;
}
body.mode-video .video-stage video{
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important;
}
body.mode-video .video-empty{font-size:32px!important;gap:7px!important}
body.mode-video .video-empty span{font-size:13px!important}
body.mode-video .video-now{
 display:flex!important;flex:none!important;align-items:center!important;
 min-height:42px!important;margin:0!important;padding:4px 2px!important;
 gap:8px!important;flex-wrap:nowrap!important;border-bottom:1px solid var(--s2)!important;
}
body.mode-video .video-now #videoNow{
 flex:1 1 auto!important;min-width:0!important;font-size:13px!important;
 overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
body.mode-video .video-now #videoTime{flex:none!important;font-size:11px!important}
body.mode-video .video-now .video-more{
 flex:none!important;width:40px!important;min-width:40px!important;
 height:38px!important;min-height:38px!important;padding:0!important;
 border-radius:10px!important;font-size:25px!important;
}
body.mode-video .video-tools.video-tools-inline{display:none!important}
body.mode-video .video-library-head{
 display:flex!important;flex:none!important;align-items:center!important;
 gap:8px!important;margin:6px 0!important;padding:0!important;
}
body.mode-video .video-library-head input{
 flex:1 1 auto!important;min-width:0!important;width:100%!important;
 min-height:40px!important;height:40px!important;border-radius:10px!important;
}
body.mode-video .video-list{
 display:grid!important;grid-template-columns:1fr!important;grid-auto-rows:min-content!important;
 flex:1 1 auto!important;min-height:0!important;max-height:none!important;
 overflow-y:auto!important;overflow-x:hidden!important;align-content:start!important;
 gap:6px!important;padding:2px 1px 16px!important;
 -webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;
}
body.mode-video .video-item{
 min-height:62px!important;padding:6px 8px!important;border-radius:11px!important;
}
body.mode-video .video-thumb{width:44px!important;height:44px!important;flex:none!important}
body.mode-video .video-item-main{min-height:48px!important;padding:2px!important}
body.mode-video .video-item-main b{font-size:13px!important}
body.mode-video .video-item-main small{font-size:11px!important}
body.mode-video .video-note{display:none!important}

/* Player tools popup: consistent spacing, readable two-column controls */
#naghmePlayerSettings{direction:rtl!important}
#naghmePlayerSettings>section{
 position:relative!important;top:auto!important;left:auto!important;right:auto!important;width:auto!important;
 max-width:520px!important;max-height:none!important;height:auto!important;
 overflow:visible!important;padding:14px!important;border-radius:16px!important;
 box-shadow:0 14px 40px #000c!important;
}
#naghmePlayerSettings>section>div:first-child{gap:10px!important;margin-bottom:4px!important}
#naghmePlayerSettings>section>div:first-child h2{font-size:17px!important}
#naghmePlayerSettings #naghmeVideoToolGrid{
 grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;
}
#naghmePlayerSettings #naghmeVideoToolGrid button{
 display:flex!important;align-items:center!important;justify-content:center!important;
 min-width:0!important;min-height:42px!important;height:auto!important;
 padding:8px 7px!important;border:1px solid var(--s2)!important;
 border-radius:10px!important;background:var(--s2)!important;
 color:var(--tx)!important;font-size:12px!important;line-height:1.5!important;
 white-space:normal!important;text-align:center!important;
}
#naghmePlayerSettings #naghmeVideoToolGrid label{
 min-height:42px!important;padding:4px 8px!important;
 border:1px solid var(--s2)!important;border-radius:10px!important;
 background:var(--s2)!important;font-size:12px!important;
}
#naghmePlayerSettings #naghmeVideoToolGrid select,
#naghmePlayerSettings>section>label select{
 min-height:36px!important;padding:5px 8px!important;
 border-radius:8px!important;background:var(--bg)!important;
}
#naghmePlayerSettings>section>div:last-child{gap:8px!important}
#naghmePlayerSettings>section>div:last-child button{min-height:40px!important;border-radius:10px!important}

@media(max-width:380px){
 body.mode-video .video-page{padding-inline:8px!important}
 body.mode-video .video-top .bar{gap:5px!important}
 body.mode-video .video-top .bar button{font-size:11px!important;padding-inline:5px!important}
 body.mode-video .video-now #videoTime{font-size:10px!important}
 #naghmePlayerSettings #naghmeVideoToolGrid{gap:6px!important}
 #naghmePlayerSettings #naghmeVideoToolGrid button{font-size:11px!important;padding:7px 5px!important}
}
@media(orientation:landscape) and (max-height:520px){
 body.mode-video .video-page{
  display:grid!important;grid-template-columns:minmax(0,46%) minmax(0,54%)!important;
  grid-template-rows:auto auto auto minmax(0,1fr)!important;
  gap:5px 10px!important;align-content:stretch!important;
 }
 body.mode-video .video-top{grid-column:1/-1!important;grid-row:1!important}
 body.mode-video .video-top .bar{flex:0 0 auto!important}
 body.mode-video .video-stage{
  grid-column:1!important;grid-row:2!important;width:100%!important;
  max-width:100%!important;max-height:48dvh!important;margin:0!important;
 }
 body.mode-video .video-now{grid-column:1!important;grid-row:3!important}
 body.mode-video .video-library-head{grid-column:2!important;grid-row:2!important;margin:0!important}
 body.mode-video .video-list{grid-column:2!important;grid-row:3/5!important}
}

/* Video tools: compact bottom sheet with a dedicated, reliable scroll region */
#naghmePlayerSettings{display:flex!important;align-items:flex-end!important;justify-content:center!important;background:rgba(0,0,0,.58)!important;padding:12px 10px calc(10px + env(safe-area-inset-bottom))!important;overflow:hidden!important;box-sizing:border-box!important;touch-action:auto!important}
#naghmePlayerSettings>section{position:relative!important;inset:auto!important;display:flex!important;flex-direction:column!important;width:min(460px,100%)!important;max-width:460px!important;max-height:78dvh!important;height:auto!important;min-height:0!important;padding:0!important;overflow:hidden!important;border-radius:20px!important}
#naghmePlayerSettings .naghme-tools-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;border-bottom:1px solid var(--s2);flex:0 0 auto}
#naghmePlayerSettings .naghme-tools-head h2{margin:0;font-size:16px}
#naghmePlayerSettings .naghme-tools-head p{margin:4px 0 0;color:var(--mu);font-size:11px}
#naghmePlayerSettings .naghme-tools-head button{width:34px;height:34px;border-radius:50%;background:var(--s2);color:var(--tx);font-size:18px}
#naghmePlayerSettings .naghme-tools-scroll{min-height:0;flex:1 1 auto;overflow-y:auto!important;overflow-x:hidden!important;padding:12px 14px;overscroll-behavior:contain;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important}
#naghmePlayerSettings .naghme-tools-group{margin:0 0 14px}
#naghmePlayerSettings .naghme-tools-group h3{font-size:12px;color:var(--mu);font-weight:600;margin:0 0 8px}
#naghmePlayerSettings #naghmeVideoToolGrid,#naghmePlayerSettings #naghmeVideoExtraGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#naghmePlayerSettings #naghmeVideoToolGrid button,#naghmePlayerSettings #naghmeVideoExtraGrid button{min-width:0;min-height:42px;padding:8px 6px;border:1px solid var(--s2);border-radius:11px;background:var(--s2);color:var(--tx);font-size:12px;line-height:1.35;white-space:normal}
#naghmePlayerSettings .naghme-tools-speed{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px;padding:8px 10px;border-radius:11px;background:var(--s2);font-size:12px}
#naghmePlayerSettings select{min-height:34px;padding:4px 9px;border-radius:8px;background:var(--bg);color:var(--tx);border:1px solid var(--s2)}
#naghmePlayerSettings .naghme-tools-prefs{border:1px solid var(--s2);border-radius:12px;padding:10px;margin:0 0 4px}
#naghmePlayerSettings .naghme-tools-prefs summary{font-size:12px;font-weight:600;cursor:pointer;padding:2px}
#naghmePlayerSettings .naghme-tools-prefs>label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;font-size:12px}
#naghmePlayerSettings .naghme-tools-checks{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;font-size:11px}
#naghmePlayerSettings .naghme-tools-foot{display:flex;gap:8px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--s2);background:var(--s1);flex:0 0 auto}
#naghmePlayerSettings .naghme-tools-foot button{min-height:40px;border-radius:10px;padding:8px 14px;background:var(--s2);color:var(--tx)}
#naghmePlayerSettings .naghme-tools-foot button:last-child{flex:1;background:var(--ac,#10b981);color:#07140e;font-weight:700}
@media(max-width:380px){#naghmePlayerSettings>section{max-height:76dvh!important}#naghmePlayerSettings .naghme-tools-scroll{padding:10px 12px}}

/* Compact video tools sheet: keep the player visible and scroll only the controls */
#naghmePlayerSettings>section{
 height:54dvh!important;
 max-height:54dvh!important;
 min-height:0!important;
}
#naghmePlayerSettings .naghme-tools-scroll{
 flex:1 1 0!important;
 min-height:0!important;
 max-height:none!important;
 overflow-y:auto!important;
 overscroll-behavior:contain!important;
 touch-action:pan-y!important;
 -webkit-overflow-scrolling:touch!important;
}
@media(max-height:700px){
 #naghmePlayerSettings>section{height:52dvh!important;max-height:52dvh!important}
}


/* Unified player fullscreen behavior: rotation-driven TV and video */
body.tv-fullscreen #modeBar,
body.tv-fullscreen .tv-topbar,
body.tv-fullscreen .tvbrowse,
body.tv-fullscreen .tvnow,
body.tv-fullscreen #iptvStatus,
body.tv-fullscreen #mini{display:none!important}
body.tv-fullscreen #tvpage{padding:0!important;overflow:visible!important}
body.tv-fullscreen .tvplayer{display:block!important;position:static!important;overflow:visible!important}
body.tv-fullscreen .tvbox,
body.tv-fullscreen .tvbox.tvfull{position:fixed!important;inset:0!important;z-index:10000!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;border-radius:0!important}
body.tv-fullscreen .tvbox video,
body.tv-fullscreen .tvbox video[hidden]{width:100%!important;height:100%!important;max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important}
body.tv-fullscreen .tvfsx{z-index:10002!important}
.video-fullscreen-exit{display:none;position:absolute;top:max(10px,env(safe-area-inset-top));left:10px;z-index:10003;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;background:#000b;color:#fff;font-size:22px;border:1px solid #ffffff55}
body.video-fullscreen #modeBar,
body.video-fullscreen .video-top,
body.video-fullscreen .video-now,
body.video-fullscreen .video-tools,
body.video-fullscreen .video-library-head,
body.video-fullscreen .video-list,
body.video-fullscreen .video-note,
body.video-fullscreen #mini{display:none!important}
body.video-fullscreen #videoPage,
body.video-fullscreen #videoContent,
body.video-fullscreen .video-page{position:static!important;display:block!important;width:100%!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:visible!important;padding:0!important;margin:0!important}
body.video-fullscreen .video-stage{position:fixed!important;inset:0!important;z-index:10000!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;padding:0!important;border-radius:0!important;background:#000!important}
body.video-fullscreen .video-stage video{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important}
body.video-fullscreen .video-fullscreen-exit{display:block!important}

/* IPTV country browser */
.iptv-country-panel{flex:none;background:var(--s1);border:1px solid var(--s2);border-radius:12px;padding:8px;margin:0 0 8px;min-height:0}
.iptv-country-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;margin-bottom:6px}
.iptv-country-head strong{font-weight:700;color:var(--ac)}.iptv-country-head span{margin-inline-start:auto;color:var(--mu);font-size:11px}
.iptv-country-search{width:100%;box-sizing:border-box;background:var(--bg);border:1px solid var(--s2);border-radius:9px;padding:8px 10px;color:var(--tx);font:inherit;font-size:13px;margin-bottom:6px}
.iptv-countries{display:flex;gap:6px;flex-wrap:wrap;max-height:82px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:1px}
.iptv-countries button{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;font-size:11px;padding:5px 8px;border:1px solid var(--s2);border-radius:8px;background:var(--bg);color:var(--tx)}
.iptv-countries button.on{background:var(--ac);color:#04130d;border-color:var(--ac)}.iptv-countries button small{font-size:10px;opacity:.8}
@media(max-width:420px){.iptv-country-head{gap:5px}.iptv-country-head span{width:100%;margin:0}.iptv-countries{max-height:76px}}

.iptv-quality-label{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-size:11px;color:var(--mu)}.iptv-quality-label select{max-width:88px;padding:6px 5px;border-radius:8px;border:1px solid var(--s2);background:var(--s1);color:var(--tx);font:inherit;font-size:12px}

/* Compact IPTV country picker */
.iptv-country-panel{padding:5px 8px;margin:0 0 6px;border-radius:9px}
.iptv-country-head{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin:0;font-size:12px}
.iptv-country-head strong{margin-inline-start:auto;white-space:nowrap;font-size:11px}
.iptv-country-head select{min-width:0;max-width:58%;padding:5px 9px;border:1px solid var(--s2);border-radius:8px;background:var(--bg);color:var(--tx);font:inherit;font-size:12px;flex:1}
@media(max-width:420px){.iptv-country-head{gap:5px}.iptv-country-head strong{font-size:10px}.iptv-country-head select{max-width:52%;font-size:11px}}
