:root{
  --bg:#07111f;
  --bg-soft:#0d1728;
  --panel:#121d30;
  --panel-2:#17243a;
  --panel-3:#1d2c46;
  --text:#f5f7fb;
  --muted:#97a3bd;
  --muted-2:#7f8aa4;
  --border:rgba(255,255,255,.08);
  --border-2:rgba(255,255,255,.12);
  --accent:#ff0a62;
  --accent-2:#ff2f7d;
  --accent-soft:rgba(255,10,98,.12);
  --danger:#ff5d73;
  --shadow:0 20px 40px rgba(0,0,0,.28);
  --shadow-sm:0 12px 28px rgba(0,0,0,.20);
  --radius:18px;
  --radius-lg:26px;
  --radius-sm:12px;
  --topbar-h:76px;
  --font:Inter, Arial, Helvetica, sans-serif;
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  min-height:100%;
  height:100%;
  background:
    radial-gradient(circle at top right, rgba(255,10,98,.08), transparent 24%),
    radial-gradient(circle at top left, rgba(40,130,255,.08), transparent 18%),
    linear-gradient(180deg,#07111f 0%, #0c1525 100%);
  color:var(--text);
  font-family:var(--font);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

body{
  overflow-x:hidden;
  overflow-y:auto;
}

img{ max-width:100%; display:block; }
button,input{ font:inherit; }
button{ cursor:pointer; }
.hidden{ display:none !important; }

/* generic */
.screen{
  display:none;
  min-height:100vh;
  min-height:100dvh;
}
.screen.active{ display:block; }

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  z-index:2000;
  max-width:min(92vw,520px);
  min-width:220px;
  padding:14px 18px;
  border-radius:16px;
  background:rgba(8,12,20,.92);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:var(--shadow);
  text-align:center;
  backdrop-filter:blur(10px);
}

.spinner{
  width:34px;
  height:34px;
  margin:20px auto;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.10);
  border-top-color:var(--accent);
  animation:spin .9s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.empty{
  padding:18px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px dashed rgba(255,255,255,.14);
  color:var(--muted);
  text-align:center;
}

/* rotate overlay */
.rotate-device{
  position:fixed;
  inset:0;
  z-index:3000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at top right, rgba(255,10,98,.12), transparent 28%),
    radial-gradient(circle at top left, rgba(80,120,255,.10), transparent 24%),
    linear-gradient(180deg,#070b14 0%, #0d1322 100%);
}

.rotate-card{
  width:min(100%,420px);
  padding:28px 24px;
  border-radius:28px;
  text-align:center;
  background:linear-gradient(180deg, rgba(19,29,51,.96) 0%, rgba(13,21,39,.98) 100%);
  border:1px solid var(--border);
  box-shadow:0 24px 60px rgba(0,0,0,.32);
}

.rotate-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-bottom:20px;
}

.rotate-logo{
  width:52px;
  height:52px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:22px;
  overflow:hidden;
}

.rotate-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:8px;
}

.rotate-brand-text strong{
  display:block;
  font-size:16px;
}

.rotate-brand-text span{
  display:block;
  font-size:12px;
  color:var(--muted);
}

.rotate-phone{
  display:flex;
  justify-content:center;
  margin-bottom:18px;
}

.rotate-phone-inner{
  width:78px;
  height:78px;
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:34px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  box-shadow:0 12px 32px rgba(255,10,98,.24);
  animation:rotateHint 1.6s ease-in-out infinite;
}

.rotate-card h2{
  margin:0 0 8px;
  font-size:24px;
}

.rotate-card p{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}

@keyframes rotateHint{
  0%,100%{ transform:rotate(0deg); }
  50%{ transform:rotate(90deg); }
}

/* auth background */
.auth-bg{
  position:absolute;
  inset:0;
  z-index:0;
  overflow:hidden;
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
}

#screen-setup,
#screen-login{
  position:relative;
  overflow:hidden;
}

.auth-bg::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at top right, rgba(255,10,98,.10), transparent 28%),
    radial-gradient(circle at top left, rgba(80,120,255,.08), transparent 24%),
    linear-gradient(180deg, rgba(7,11,20,.34) 0%, rgba(7,11,20,.60) 100%);
  pointer-events:none;
}

/* auth */
.auth-shell{
  position:relative;
  z-index:1;
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.auth-card{
  width:min(100%,460px);
  padding:24px;
  border-radius:28px;
  background:linear-gradient(180deg, rgba(19,29,51,.96) 0%, rgba(13,21,39,.98) 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}

.auth-brand{
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:22px;
}

.auth-logo{
  width:64px;
  height:64px;
  border-radius:20px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:900;
  box-shadow:0 12px 26px rgba(255,10,98,.24);
  overflow:hidden;
  flex:0 0 auto;
}

.auth-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:10px;
}

.auth-title{
  margin:0 0 4px;
  font-size:28px;
  line-height:1.1;
}

.auth-subtitle{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.auth-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:8px;
}

.field-label{
  font-size:13px;
  font-weight:700;
  color:var(--muted);
}

.field-input{
  width:100%;
  min-height:48px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:#fff;
  outline:none;
}

.field-input:focus{
  border-color:rgba(255,10,98,.55);
  box-shadow:0 0 0 3px rgba(255,10,98,.12);
}

.field-error{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,93,115,.12);
  border:1px solid rgba(255,93,115,.24);
  color:#ffd9df;
  font-size:13px;
}

.check-row,
.radio-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.btn{
  min-height:46px;
  padding:0 16px;
  border:none;
  border-radius:14px;
  font-weight:800;
  transition:.18s ease;
}

.btn:active{ transform:scale(.985); }

.btn-primary{
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  color:#fff;
  box-shadow:0 10px 22px rgba(255,10,98,.22);
}

.btn-ghost{
  background:rgba(255,255,255,.05);
  border:1px solid var(--border);
  color:#fff;
}

.btn-danger{
  background:rgba(255,93,115,.14);
  border:1px solid rgba(255,93,115,.28);
  color:#fff;
}

.icon-btn{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

/* simple login */
.simple-login-shell{
  position:relative;
  z-index:1;
  min-height:100vh;
  min-height:100dvh;
  width:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:32px 18px;
}

.simple-login-logo-wrap{
  margin-bottom:26px;
  display:flex;
  justify-content:center;
  align-items:center;
}

.simple-login-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  width:auto !important;
  height:auto !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:0 !important;
  border-radius:0 !important;
  color:#fff;
  font-size:72px;
  font-weight:800;
  line-height:1;
}

.simple-login-logo img,
.simple-login-logo picture,
.simple-login-logo svg{
  display:block;
  max-width:320px;
  max-height:130px;
  width:auto;
  height:auto;
  object-fit:contain;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  filter:drop-shadow(0 12px 28px rgba(0,0,0,.24));
}

.simple-login-card{
  width:100%;
  max-width:420px;
  padding:28px 22px 22px;
  border-radius:22px;
  background:rgba(10,16,30,.68);
  backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 20px 50px rgba(0,0,0,.30);
}

.simple-login-title{
  font-size:34px;
  line-height:1.05;
  font-weight:800;
  color:#fff;
  margin:0 0 10px;
  text-align:center;
}

.simple-login-subtitle{
  font-size:15px;
  line-height:1.6;
  color:rgba(255,255,255,.72);
  margin:0 0 22px;
  text-align:center;
}

.simple-check-row{
  margin:10px 0 18px;
}

.auth-actions-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.btn-xl{
  min-height:50px;
  font-size:17px;
  border-radius:14px;
}

/* app shell */
#screen-app{
  min-height:100vh;
  min-height:100dvh;
}

.app-shell{
  min-height:100vh;
  min-height:100dvh;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* generic topbar */
.topbar{
  min-height:var(--topbar-h);
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:16px;
  padding:12px 18px;
  border-radius:22px;
  background:rgba(10,16,28,.76);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:var(--shadow-sm);
  position:sticky;
  top:14px;
  z-index:80;
  backdrop-filter:blur(14px);
  flex:0 0 auto;
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.topbar-right{
  justify-content:flex-end;
}

.brand-pill{
  display:flex;
  align-items:center;
  gap:12px;
  border:none;
  background:none;
  color:#fff;
  padding:0;
  min-width:0;
}

.brand-logo{
  width:52px;
  height:52px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:900;
  box-shadow:0 10px 24px rgba(255,10,98,.18);
  overflow:hidden;
  flex:0 0 auto;
}

.brand-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:8px;
}

.brand-meta{
  min-width:0;
}

.brand-meta strong{
  display:block;
  font-size:15px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.brand-meta span{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.brand-pill .brand-meta{
  max-width:180px;
}

.topnav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.topnav-item{
  min-height:40px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  color:#fff;
  font-weight:800;
}

.topnav-item.active{
  background:rgba(255,10,98,.10);
  border-color:rgba(255,10,98,.26);
  box-shadow:0 8px 18px rgba(255,10,98,.08);
}

.topbar-search-wrap{
  width:min(340px, 24vw);
}

.topbar-search{
  width:100%;
  min-height:40px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:#fff;
  outline:none;
}

.compact-user{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:6px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
}

.user-avatar{
  width:36px;
  height:36px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-2) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  flex:0 0 auto;
  overflow:hidden;
}

.user-avatar img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:6px;
}

.user-meta{
  min-width:0;
}

.user-name{
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.user-sub{
  font-size:11px;
  color:var(--muted);
}

.topbar-clock{
  min-width:56px;
  text-align:right;
  color:#dbe2f2;
  font-weight:700;
  letter-spacing:.3px;
}

/* topbar v2 */
.topbar-v2{
  min-height:68px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:20px;
  align-items:center;
  padding:10px 18px;
  border-radius:20px;
  background:rgba(7,13,24,.78);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:0 16px 32px rgba(0,0,0,.18);
  backdrop-filter:blur(16px);
}

.topbar-brand-area,
.topbar-tools{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.topbar-tools{
  justify-content:flex-end;
}

.brand-pill-v2{
  gap:10px;
}

.brand-pill-v2 .brand-logo{
  width:48px;
  height:48px;
  border-radius:14px;
  box-shadow:0 8px 18px rgba(255,10,98,.16);
}

.brand-pill-v2 .brand-meta strong{
  font-size:15px;
}

.brand-pill-v2 .brand-meta span{
  font-size:12px;
}

.topnav-v2{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
}

.topnav-v2::-webkit-scrollbar{
  display:none;
}

.topnav-v2 .topnav-item{
  min-height:38px;
  padding:0 16px;
  border-radius:12px;
  font-size:15px;
  font-weight:800;
  color:#eef2fb;
  white-space:nowrap;
  background:transparent;
  border:1px solid transparent;
}

.topnav-v2 .topnav-item.active{
  background:rgba(255,10,98,.10);
  border:1px solid rgba(255,10,98,.22);
  box-shadow:none;
}

.topbar-search-wrap-v2{
  width:min(360px, 24vw);
}

.topbar-search-wrap-v2 .topbar-search{
  min-height:40px;
  border-radius:14px;
  background:rgba(255,255,255,.045);
}

.topbar-icon-btn{
  width:40px;
  height:40px;
  border-radius:12px;
}

.compact-user-v2{
  padding:5px 10px;
  border-radius:14px;
  background:rgba(255,255,255,.035);
}

.topbar-clock-v2{
  min-width:50px;
  font-size:13px;
  font-weight:700;
  color:#dbe2f2;
  opacity:.9;
}

/* sections */
.section{
  display:none;
}
.section.active{
  display:block;
}

/* page head generic */
.page-head{
  padding:16px 18px;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(19,29,51,.82) 0%, rgba(13,21,39,.92) 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  margin-bottom:14px;
}

.page-head h2{
  margin:0;
  font-size:28px;
}

/* hide section headers inside internal views */
#section-live .page-head,
#section-movies .page-head,
#section-series .page-head,
#section-epg .page-head,
#section-settings .page-head{
  display:none;
}

/* home */
.home-layout{
  display:flex;
  flex-direction:column;
  gap:18px;
  overflow:auto;
  padding-right:4px;
}

/* hero home */
.hero-banner-home{
  position:relative;
  min-height:300px;
  border-radius:28px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  background:#09111d;
}

.hero-banner-bg{
  position:absolute;
  inset:0;
}

.hero-banner-image{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center center;
  display:block;
  transform:scale(1.01);
}

.hero-banner-shade{
  position:absolute;
  inset:0;
  background:
    linear-gradient(90deg, rgba(5,10,18,.94) 0%, rgba(5,10,18,.82) 28%, rgba(5,10,18,.52) 56%, rgba(5,10,18,.24) 100%),
    linear-gradient(180deg, rgba(5,10,18,.04) 0%, rgba(5,10,18,.20) 55%, rgba(5,10,18,.46) 100%);
}

.hero-banner-glow{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 22% 50%, rgba(60,130,255,.16), transparent 24%),
    radial-gradient(circle at 78% 40%, rgba(255,10,98,.13), transparent 18%);
  pointer-events:none;
}

.hero-content{
  position:relative;
  z-index:2;
  max-width:560px;
  padding:34px 34px 30px;
}

.hero-content-home{
  position:relative;
  z-index:2;
  max-width:620px;
  padding:36px 36px 32px;
}

.hero-title{
  font-size:42px;
  line-height:1.02;
  margin:0 0 10px;
}

.hero-subtitle{
  margin:0;
  font-size:16px;
  color:var(--muted);
  line-height:1.6;
}

.hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:22px;
}

.hero-kicker,
.panel-kicker{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.18em;
  color:#7e89a5;
  margin-bottom:4px;
}

.hero-banner-home .hero-kicker{
  margin-bottom:10px;
  color:#8f9ab5;
}

.hero-banner-home .hero-title{
  max-width:560px;
  font-size:56px;
  line-height:.96;
  margin:0 0 12px;
  text-shadow:0 4px 18px rgba(0,0,0,.32);
}

.hero-banner-home .hero-subtitle{
  max-width:520px;
  font-size:17px;
  line-height:1.58;
  color:#d7deef;
  text-shadow:0 2px 10px rgba(0,0,0,.28);
}

.hero-banner-home .hero-actions{
  margin-top:22px;
}

.hero-brand-dynamic{
  position:absolute;
  top:26px;
  right:28px;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  max-width:240px;
  pointer-events:none;
}

.hero-brand-dynamic img{
  display:block;
  max-width:220px;
  max-height:64px;
  width:auto;
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 8px 24px rgba(0,0,0,.38));
  opacity:.96;
}

/* home cards */
.home-quick-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
}

.home-quick-grid-4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
}

.home-quick-card{
  position:relative;
  min-height:182px;
  padding:0;
  border-radius:24px;
  overflow:hidden;
  border:1px solid var(--border);
  background:#111827;
  color:#fff;
  text-align:left;
  box-shadow:var(--shadow-sm);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-quick-card:hover{
  transform:translateY(-3px);
  box-shadow:0 18px 34px rgba(0,0,0,.22);
  border-color:rgba(255,255,255,.14);
}

.home-quick-card-bg{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  transform:scale(1.01);
}

.home-quick-card-overlay{
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(8,12,20,.03) 0%, rgba(8,12,20,.18) 32%, rgba(8,12,20,.56) 62%, rgba(8,12,20,.94) 100%),
    linear-gradient(90deg, rgba(8,12,20,.20) 0%, rgba(8,12,20,.06) 48%, rgba(8,12,20,.16) 100%);
}

.home-quick-card-content{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:2;
  padding:22px 20px 20px;
}

.home-quick-card .home-quick-copy{
  max-width:84%;
}

.home-quick-card .home-quick-copy strong{
  display:block;
  margin:0 0 8px;
  font-size:24px;
  line-height:1.02;
  font-weight:900;
  color:#fff;
  text-shadow:0 2px 12px rgba(0,0,0,.48);
}

.home-quick-card .home-quick-copy span{
  display:block;
  font-size:13px;
  line-height:1.4;
  color:rgba(255,255,255,.88);
  text-shadow:0 2px 8px rgba(0,0,0,.34);
}

.home-quick-card[data-section="live"] .home-quick-copy{
  max-width:72%;
}

.home-quick-card[data-section="movies"] .home-quick-copy{
  max-width:76%;
}

.home-quick-card[data-section="series"] .home-quick-copy{
  max-width:78%;
}

.home-quick-card[data-section="epg"] .home-quick-copy{
  max-width:82%;
}

.home-quick-card:focus-visible{
  outline:none;
  border-color:rgba(255,10,98,.45);
  box-shadow:0 0 0 3px rgba(255,10,98,.14), 0 18px 34px rgba(0,0,0,.24);
}

/* panels */
.panel{
  padding:16px;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(19,29,51,.82) 0%, rgba(13,21,39,.92) 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
}

.panel-fill{
  min-height:0;
}

.panel-player{
  display:flex;
  flex-direction:column;
  min-height:0;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
  flex:0 0 auto;
}

.panel-head h3{
  margin:0;
  font-size:18px;
  font-weight:800;
}

.panel-subhead{
  margin:14px 0 10px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:#8f9ab5;
  flex:0 0 auto;
}

/* live layout */
.live-layout{
  display:grid;
  grid-template-columns:260px minmax(0,1fr) 38%;
  gap:18px;
  align-items:start;
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
}

.live-sidebar,
.live-content,
.live-player-col{
  min-width:0;
}

.live-sidebar{
  position:sticky;
  top:108px;
  align-self:start;
}

.live-player-col{
  position:sticky;
  top:108px;
  align-self:start;
}

.live-sidebar .panel,
.live-player-col .panel{
  max-height:calc(100vh - 140px);
  max-height:calc(100dvh - 140px);
}

.live-content .panel{
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
}

.cat-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:calc(100vh - 220px);
  max-height:calc(100dvh - 220px);
  overflow:auto;
  padding-right:4px;
}

.cat-item{
  min-height:42px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:rgba(255,255,255,.03);
  color:#fff;
  display:flex;
  align-items:center;
  cursor:pointer;
  transition:.18s ease;
}

.cat-item:hover{
  border-color:var(--border);
  background:rgba(255,255,255,.05);
}

.cat-item.active{
  background:linear-gradient(135deg, rgba(255,10,98,.16) 0%, rgba(255,47,125,.08) 100%);
  border-color:rgba(255,10,98,.28);
}

.ch-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:calc(100vh - 280px);
  max-height:calc(100dvh - 280px);
  overflow:auto;
  padding-right:4px;
}

.ch-item{
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:14px;
  align-items:start;
  min-height:88px;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.03);
  border:1px solid transparent;
  cursor:pointer;
  transition:.18s ease;
  text-align:left;
}

.ch-item:hover{
  background:rgba(255,255,255,.05);
  border-color:var(--border);
}

.ch-item.active{
  background:linear-gradient(135deg, rgba(0,194,255,.08) 0%, rgba(255,10,98,.10) 100%);
  border-color:rgba(0,194,255,.25);
}

.ch-logo{
  width:64px;
  height:64px;
  border-radius:16px;
  overflow:hidden;
  background:rgba(255,255,255,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.ch-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:8px;
  display:block;
}

.ch-fb{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#27344f 0%,#1a253d 100%);
  font-weight:900;
  font-size:18px;
}

.ch-body{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding-top:2px;
}

.ch-name{
  font-weight:800;
  font-size:15px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ch-epg{
  margin-top:6px;
  font-size:13px;
  color:#8fdcff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ch-epg-dim{
  color:var(--muted);
}

.ch-progress{
  margin-top:8px;
  width:100%;
  height:6px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
}

.ch-progress-bar{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--accent) 0%,var(--accent-2) 100%);
}

/* player area */
.player-box{
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  border-radius:20px;
  overflow:hidden;
  background:#000;
  border:1px solid rgba(255,255,255,.06);
  flex:0 0 auto;
}

.player-placeholder{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:var(--muted);
  background:
    radial-gradient(circle at center, rgba(255,255,255,.03), transparent 46%),
    #05070d;
}

.player-placeholder-ico{
  font-size:34px;
}

.player-placeholder-text{
  font-size:14px;
}

.player-meta{
  padding:14px 2px 10px;
  flex:0 0 auto;
}

.np-name{
  font-size:22px;
  font-weight:900;
  line-height:1.2;
}

.np-prog{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.mini-epg{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:220px;
  overflow:auto;
  padding-right:4px;
}

.epg-mini{
  display:grid;
  grid-template-columns:56px minmax(0,1fr);
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid transparent;
}

.epg-mini.current{
  background:rgba(255,10,98,.08);
  border-color:rgba(255,10,98,.20);
}

.epg-mini-time{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.epg-mini-title{
  font-size:13px;
  line-height:1.35;
}

/* catalog */
.catalog-layout{
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  gap:18px;
  align-items:start;
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
}

.catalog-sidebar,
.catalog-main{
  min-width:0;
}

.catalog-sidebar{
  position:sticky;
  top:108px;
  align-self:start;
}

.catalog-sidebar .panel{
  max-height:calc(100vh - 140px);
  max-height:calc(100dvh - 140px);
  overflow:hidden;
}

.catalog-sidebar .cat-list{
  height:auto;
  max-height:calc(100vh - 220px);
  max-height:calc(100dvh - 220px);
  overflow:auto;
  padding-right:4px;
}

.catalog-main .panel{
  display:flex;
  flex-direction:column;
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
  overflow:hidden;
}

.catalog-main-scroll{
  flex:1;
  min-height:0;
  overflow:auto;
  padding-right:4px;
}

.vod-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(145px, 1fr));
  gap:12px;
}

.vod-card{
  position:relative;
  overflow:hidden;
  border-radius:16px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.vod-card:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,.14);
  box-shadow:0 18px 34px rgba(0,0,0,.22);
}

.vod-poster,
.vod-ph{
  width:100%;
  aspect-ratio:2 / 3;
  background:#09101d;
  object-fit:cover;
}

.vod-ph{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#202c47 0%,#121c2e 100%);
}

.vod-ph-ico{
  font-size:30px;
}

.vod-rating{
  position:absolute;
  top:10px;
  right:10px;
  z-index:2;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(8,12,20,.84);
  border:1px solid rgba(255,255,255,.08);
  font-size:11px;
  font-weight:800;
}

.vod-info{
  padding:10px;
}

.vod-name{
  font-size:13px;
  font-weight:800;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.5em;
}

.vod-meta{
  margin-top:4px;
  font-size:11px;
  color:var(--muted);
}

.more-wrap{
  display:flex;
  justify-content:center;
  padding-top:14px;
}

/* epg */
.single-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
}

.single-layout .panel{
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
  overflow:auto;
}

.epg-toolbar{
  margin-bottom:12px;
}

.epg-days{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scrollbar-width:none;
}

.epg-days::-webkit-scrollbar{ display:none; }

.epg-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.epg-row{
  display:flex;
  gap:12px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid transparent;
}

/* settings */
.settings-shell{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:18px;
  min-height:calc(100vh - 128px);
  min-height:calc(100dvh - 128px);
}

.settings-shell .panel{
  overflow:auto;
}

.settings-group{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.settings-kv{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
}

.settings-kv strong{
  color:#fff;
  max-width:60%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* modal */
.modal{
  position:fixed;
  inset:0;
  z-index:1400;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.modal.hidden{
  display:none !important;
}

.modal-bg{
  position:absolute;
  inset:0;
  background:rgba(4,7,13,.82);
  backdrop-filter:blur(8px);
}

.modal-box{
  position:relative;
  z-index:1;
  width:min(100%, 860px);
  height:min(86vh, 760px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(19,27,42,.98) 0%, rgba(13,19,31,.99) 100%);
  border:1px solid var(--border-2);
  box-shadow:var(--shadow);
}

.modal-box-vod{
  display:flex;
  flex-direction:column;
}

.modal-x,
.fs-x{
  position:absolute;
  top:12px;
  right:12px;
  width:40px;
  height:40px;
  border:none;
  border-radius:12px;
  background:rgba(0,0,0,.55);
  color:#fff;
  z-index:8;
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal-hero{
  position:relative;
  flex:0 0 42%;
  min-height:180px;
  max-height:320px;
  background:#09101c;
  overflow:hidden;
}

.modal-body,
.modal-body-vod{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:16px 16px 20px;
}

.modal-topbar{
  position:sticky;
  top:0;
  z-index:3;
  background:linear-gradient(180deg, rgba(19,27,42,.98) 0%, rgba(19,27,42,.94) 100%);
  padding-bottom:12px;
  margin-bottom:12px;
}

.modal-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}

.tag{
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  font-size:12px;
  color:#fff;
}

.tag.accent{
  background:rgba(255,10,98,.12);
  border-color:rgba(255,10,98,.26);
}

.modal-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.modal-desc{
  color:#d8deed;
  line-height:1.65;
  font-size:14px;
}

.modal-seasons{
  margin-top:16px;
}

.modal-seasons.hidden{
  display:none !important;
}

.season-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.season-tab{
  min-height:36px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:#fff;
}

.season-tab.active{
  background:rgba(255,10,98,.12);
  border-color:rgba(255,10,98,.26);
}

.ep-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ep-item{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto auto;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid transparent;
  cursor:pointer;
}

.ep-item:hover{
  border-color:var(--border);
  background:rgba(255,255,255,.05);
}

.ep-num{
  width:38px;
  height:38px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.06);
  font-weight:800;
}

.ep-title{
  min-width:0;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ep-dur{
  color:var(--muted);
  font-size:12px;
}

.ep-play{
  font-weight:900;
}

/* fullscreen */
.fs-wrap{
  position:relative;
  z-index:1;
  width:min(100%,1180px);
  height:min(88vh,860px);
  border-radius:24px;
  overflow:hidden;
  background:#000;
  border:1px solid rgba(255,255,255,.10);
  box-shadow:var(--shadow);
}

.fs-player-el{
  width:100%;
  height:100%;
  display:block;
  background:#000;
}

body.ui-modal-open{
  overflow:hidden;
}

.ui-under-modal{
  pointer-events:none;
  user-select:none;
}

/* responsive */
@media (max-width: 1280px){
  .home-quick-grid,
  .home-quick-grid-4{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .live-layout{
    grid-template-columns:220px minmax(0,1fr) 36%;
  }
}

@media (max-width: 1024px){
  .topbar{
    grid-template-columns:minmax(0,1fr);
    gap:12px;
  }

  .topbar-left,
  .topbar-right{
    width:100%;
    justify-content:space-between;
  }

  .topnav{
    width:100%;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-bottom:2px;
    scrollbar-width:none;
  }

  .topnav::-webkit-scrollbar{
    display:none;
  }

  .topnav-item{
    flex:0 0 auto;
    white-space:nowrap;
  }

  .topbar-search-wrap{
    width:100%;
    max-width:none;
  }

  .topbar-v2{
    grid-template-columns:1fr;
    gap:12px;
  }

  .topbar-brand-area,
  .topbar-tools{
    width:100%;
  }

  .topbar-tools{
    justify-content:space-between;
  }

  .topnav-v2{
    justify-content:flex-start;
  }

  .topbar-search-wrap-v2{
    width:100%;
    max-width:none;
  }

  .hero-banner-home{
    min-height:280px;
  }

  .hero-content-home{
    max-width:560px;
    padding:30px 26px 26px;
  }

  .hero-banner-home .hero-title{
    font-size:46px;
  }

  .live-layout,
  .catalog-layout,
  .settings-shell{
    grid-template-columns:1fr;
    min-height:auto;
  }

  .single-layout{
    min-height:auto;
  }

  .panel-fill{
    min-height:auto;
    height:auto;
  }

  .catalog-sidebar,
  .live-sidebar,
  .live-player-col{
    position:static;
  }

  .catalog-sidebar .panel,
  .live-sidebar .panel,
  .live-player-col .panel{
    max-height:none;
  }

  .catalog-main .panel{
    min-height:auto;
    overflow:visible;
  }

  .catalog-main-scroll{
    overflow:visible;
  }

  .cat-list,
  .ch-list,
  .mini-epg{
    max-height:none;
  }
}

@media (max-width: 768px){
  .auth-shell{
    padding:18px;
  }

  .auth-card{
    padding:20px;
    border-radius:24px;
  }

  .auth-title{
    font-size:24px;
  }

  .simple-login-shell{
    padding:24px 14px;
  }

  .simple-login-logo{
    font-size:56px;
  }

  .simple-login-logo img,
  .simple-login-logo picture,
  .simple-login-logo svg{
    max-width:240px;
    max-height:100px;
  }

  .simple-login-card{
    max-width:100%;
    padding:22px 16px 18px;
    border-radius:18px;
  }

  .simple-login-title{
    font-size:28px;
  }

  .simple-login-subtitle{
    font-size:14px;
    margin-bottom:18px;
  }

  .app-shell{
    padding:10px;
    gap:10px;
  }

  .topbar{
    top:10px;
    padding:12px;
    border-radius:20px;
  }

  .topbar-v2{
    padding:12px;
    border-radius:18px;
  }

  .brand-pill-v2 .brand-logo{
    width:44px;
    height:44px;
    border-radius:12px;
  }

  .compact-user,
  .topbar-clock{
    display:none;
  }

  .hero-banner-home{
    min-height:230px;
    border-radius:22px;
  }

  .hero-banner-image{
    object-position:center;
  }

  .hero-content{
    padding:24px;
  }

  .hero-content-home{
    padding:24px 20px 20px;
    max-width:100%;
  }

  .hero-title{
    font-size:32px;
  }

  .hero-banner-home .hero-title{
    font-size:34px;
    line-height:1.02;
    margin-bottom:10px;
  }

  .hero-banner-home .hero-subtitle{
    font-size:15px;
    line-height:1.5;
    max-width:95%;
  }

  .hero-banner-home .hero-actions{
    margin-top:18px;
  }

  .hero-brand-dynamic{
    top:16px;
    right:16px;
    max-width:140px;
  }

  .hero-brand-dynamic img{
    max-width:120px;
    max-height:38px;
  }

  .home-quick-grid,
  .home-quick-grid-4{
    grid-template-columns:1fr;
  }

  .home-quick-card{
    min-height:160px;
    border-radius:22px;
  }

  .home-quick-card-content{
    padding:18px 16px 16px;
  }

  .home-quick-card .home-quick-copy{
    max-width:88%;
  }

  .home-quick-card .home-quick-copy strong{
    font-size:20px;
    margin-bottom:6px;
  }

  .home-quick-card .home-quick-copy span{
    font-size:12px;
  }

  .modal{
    padding:0;
    align-items:flex-end;
  }

  .modal-box{
    width:100%;
    max-width:100%;
    height:92dvh;
    max-height:92dvh;
    border-radius:22px 22px 0 0;
    border-left:none;
    border-right:none;
    border-bottom:none;
  }

  .modal-hero{
    flex:0 0 190px;
    min-height:190px;
    max-height:190px;
  }

  .fs-wrap{
    width:100vw;
    height:100dvh;
    border-radius:0;
    border:none;
  }
}

@media (max-width: 420px){
  .brand-logo{
    width:46px;
    height:46px;
    border-radius:14px;
    font-size:20px;
  }

  .brand-logo img{
    padding:7px;
  }

  .auth-logo{
    width:58px;
    height:58px;
    border-radius:18px;
  }

  .auth-logo img{
    padding:9px;
  }

  .rotate-logo{
    width:46px;
    height:46px;
    border-radius:14px;
  }

  .rotate-logo img{
    padding:7px;
  }

  .brand-pill .brand-meta{
    max-width:120px;
  }

  .brand-meta strong{
    font-size:14px;
  }

  .panel,
  .page-head{
    padding:12px;
    border-radius:18px;
  }

  .hero-content{
    padding:20px;
  }

  .hero-title{
    font-size:28px;
  }

  .home-quick-card{
    min-height:140px;
  }

  .ch-item{
    grid-template-columns:56px minmax(0,1fr);
    min-height:78px;
    padding:10px 12px;
    gap:12px;
  }

  .ch-logo{
    width:56px;
    height:56px;
    border-radius:14px;
  }

  .ch-logo img{
    padding:7px;
  }

  .ch-name{
    font-size:14px;
  }

  .ch-epg{
    font-size:12px;
  }

  .vod-grid{
    gap:8px;
  }

  .vod-info{
    padding:10px;
  }

  .vod-name{
    font-size:13px;
  }
}