*{box-sizing:border-box}html,body{margin:0;padding:0}body{font-family:Inter,Arial,sans-serif;background:#08111f;color:#edf3ff;display:grid;grid-template-columns:300px minmax(0,1fr);min-height:100vh}
.sidebar{background:#0d1829;border-right:1px solid rgba(255,255,255,.08);padding:22px;display:flex;flex-direction:column;gap:16px}
.brand{display:flex;gap:14px;align-items:center}.app-icon{width:56px;height:56px;border-radius:14px}
.brand h1{margin:0;font-size:22px}.brand p{margin:4px 0 0;color:#99afd0;font-size:13px}
.nav-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.nav-btn{padding:12px;border-radius:14px;border:1px solid rgba(255,255,255,.08);background:#14253f;color:#fff;cursor:pointer;font-weight:700}
.nav-btn.active,.nav-btn:hover{background:linear-gradient(135deg,#3a6cff,#6d49ff)}
.panel,.card,.hero-box{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:22px;box-shadow:0 10px 30px rgba(0,0,0,.22)}
.panel{padding:16px}.panel h3,.card h3,.hero-copy h3{margin:0 0 12px}
label{display:block;margin:0 0 6px;font-size:12px;color:#95abd0}
input{width:100%;padding:12px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:#101c31;color:#fff;outline:none}
.row{display:flex;gap:10px;margin-top:10px}
.btn{border:none;border-radius:12px;padding:12px 16px;background:#1b2d4e;color:#fff;cursor:pointer;font-weight:700}
.btn.primary{background:linear-gradient(135deg,#3a6cff,#6d49ff)}
.btn.tiny{padding:8px 12px;font-size:12px}
.muted{color:#99afd0;font-size:12px;line-height:1.6}
.main{padding:24px}
.topbar{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.tags{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.tag,.mini-badge,.hero-badge{display:inline-block;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.08);font-size:12px}
.stats{display:grid;grid-template-columns:repeat(3,120px);gap:12px}
.stat{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:14px;text-align:center}
.stat strong{display:block;font-size:22px}.stat span{font-size:12px;color:#99afd0}
.hero{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;margin-top:20px}
.hero-copy{background:linear-gradient(135deg,rgba(58,108,255,.18),rgba(109,73,255,.14));border:1px solid rgba(255,255,255,.08);border-radius:24px;padding:24px}
.hero-copy p{line-height:1.6;color:#c9d6eb}
.hero-box{padding:24px;display:flex;gap:16px;align-items:center}.hero-icon{width:88px;height:88px;border-radius:20px}
.workspace{display:grid;grid-template-columns:1.05fr .95fr;gap:20px;margin-top:20px}
.player-column,.browser-column{display:grid;gap:20px}
.card{padding:18px}.card-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px}
.inline-badges,.chip-wrap{display:flex;gap:8px;flex-wrap:wrap}
video{width:100%;aspect-ratio:16/9;background:#000;border-radius:18px}
.meta h4{margin:0 0 6px;font-size:20px}.meta p{margin:0;color:#9db2d4;word-break:break-all}
.meta-row{display:flex;gap:14px;align-items:center;margin-top:14px}
.active-logo{width:58px;height:58px;border-radius:12px;object-fit:contain;background:#fff;padding:6px}
.player-actions{display:flex;gap:12px;align-items:center;margin-top:14px}.hint{font-size:12px;color:#99afd0}
.epg-grid-small{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.epg-card{padding:14px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.epg-kicker{display:inline-block;padding:6px 10px;border-radius:999px;background:rgba(109,73,255,.18);font-size:12px;margin-bottom:8px}
.hidden{display:none!important}
.protected-box{padding:20px;border-radius:18px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08)}
.protected-badge{display:inline-block;padding:7px 10px;border-radius:999px;background:rgba(255,162,0,.18);border:1px solid rgba(255,255,255,.08);font-size:12px;margin-bottom:10px}
.protected-box h4{margin:4px 0 8px;font-size:20px}.protected-box p{margin:0;color:#c9d6eb;line-height:1.6}
.probe-grid{display:grid;grid-template-columns:.86fr 1.14fr;gap:14px}
.probe-box,.preview,.log-box,.epg-grid-table{background:#0c1524;border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:14px}
.probe-row{display:grid;grid-template-columns:98px 1fr;gap:12px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.probe-row:last-child{border-bottom:none}
.probe-row span{color:#95abd0}.probe-row strong{word-break:break-all}
.preview,.log-box{white-space:pre-wrap;overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:#bfd0ff}
.preview{min-height:220px;max-height:320px}.log-box{margin-top:14px;min-height:150px;max-height:260px}
.channel-list{display:grid;gap:10px;max-height:860px;overflow:auto}
.chip{padding:8px 12px;border-radius:999px;background:#16284a;border:1px solid rgba(255,255,255,.08);cursor:pointer;font-size:12px}
.chip.active{background:linear-gradient(135deg,#3a6cff,#6d49ff)}
.channel-item{padding:14px;border-radius:18px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);cursor:pointer;outline:none}
.channel-item:hover,.channel-item.active,.channel-item.focused{background:rgba(109,73,255,.18);border-color:rgba(255,255,255,.22);box-shadow:0 0 0 2px rgba(58,108,255,.35)}
.channel-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.channel-main{display:flex;gap:12px;align-items:flex-start;min-width:0}
.channel-logo{width:52px;height:52px;border-radius:12px;object-fit:contain;background:#fff;padding:4px;flex-shrink:0}
.channel-logo-placeholder{width:52px;height:52px;border-radius:12px;background:linear-gradient(135deg,#20395d,#2f4e7e);display:grid;place-items:center;color:#dce7ff;font-size:11px;font-weight:700;flex-shrink:0}
.channel-item strong{display:block;font-size:15px}.channel-item p{margin:4px 0 0;color:#99afd0;font-size:13px}
.flags{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.flag{font-size:11px;padding:6px 8px;border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.08)}
.flag.hls{background:rgba(70,160,110,.18)}.flag.dash{background:rgba(70,120,255,.18)}.flag.drm{background:rgba(255,162,0,.18)}
.notes{margin:0;padding-left:18px;color:#c9d6eb;line-height:1.6}
.epg-grid-table{overflow:auto;max-height:520px}
.epg-header,.epg-row{display:grid;grid-template-columns:200px repeat(4, minmax(180px,1fr));gap:10px}
.epg-header{position:sticky;top:0;background:#0c1524;padding-bottom:10px;margin-bottom:10px;z-index:1}
.epg-hcell,.epg-cell,.epg-channel{border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:12px;background:rgba(255,255,255,.03)}
.epg-channel{display:flex;gap:10px;align-items:center}
.epg-channel img{width:38px;height:38px;object-fit:contain;background:#fff;border-radius:10px;padding:4px}
.epg-cell strong{display:block;font-size:13px;margin-bottom:6px}
.epg-cell span{font-size:12px;color:#9db2d4}
@media (max-width:1200px){body{grid-template-columns:1fr}.sidebar{border-right:none;border-bottom:1px solid rgba(255,255,255,.08)}.hero,.workspace,.probe-grid,.epg-grid-small{grid-template-columns:1fr}.stats{grid-template-columns:repeat(3,1fr)}.main{max-width:none;padding:16px}.channel-list{max-height:none}.epg-grid-table{max-height:none}}
@media (max-width:900px){.nav-grid{grid-template-columns:1fr 1fr}.hero-box{padding:18px}.probe-row{grid-template-columns:82px 1fr}.epg-header,.epg-row{grid-template-columns:150px repeat(4,minmax(120px,1fr))}}
@media (max-width:700px){.sidebar{padding:14px}.main{padding:12px}.card,.panel{padding:14px}.stats{grid-template-columns:1fr}.meta-row{align-items:flex-start}.channel-main{gap:10px}.channel-logo,.channel-logo-placeholder{width:44px;height:44px}.epg-header,.epg-row{grid-template-columns:130px repeat(4,minmax(110px,1fr))}}
.player-column,.browser-column,.workspace,.hero,.probe-grid{min-width:0}
.card-head h3{margin:0}


/* ===== Design V2 polish ===== */
:root{
  --bg-deep:#07101c;
  --bg-soft:#0d1829;
  --panel:#0f1d31;
  --panel-2:#13233b;
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.14);
  --text:#edf3ff;
  --muted:#9fb2d3;
  --accent-1:#4d7dff;
  --accent-2:#7b4dff;
  --glow:0 14px 40px rgba(0,0,0,.28);
}

body{
  background:
    radial-gradient(circle at top right, rgba(77,125,255,.15), transparent 28%),
    radial-gradient(circle at top left, rgba(123,77,255,.10), transparent 22%),
    linear-gradient(180deg, #08111f 0%, #07101c 100%);
}

.sidebar{
  background:linear-gradient(180deg, rgba(15,29,49,.98), rgba(10,22,38,.98));
  backdrop-filter: blur(10px);
}

.brand{
  padding:6px 4px 2px;
}

.app-icon{
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}

.panel,.card,.hero-box,.stat{
  background:linear-gradient(180deg, rgba(19,35,59,.82), rgba(12,24,40,.86));
  border:1px solid var(--line);
  box-shadow: var(--glow);
}

.panel:hover,.card:hover{
  border-color: var(--line-strong);
  transition:.2s ease;
}

.nav-btn{
  text-align:left;
  position:relative;
  overflow:hidden;
}
.nav-btn::after{
  content:"";
  position:absolute;
  inset:auto auto 0 0;
  height:2px;
  width:0;
  background:linear-gradient(90deg,var(--accent-1),var(--accent-2));
  transition:width .2s ease;
}
.nav-btn:hover::after,.nav-btn.active::after{
  width:100%;
}

input{
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
input:focus{
  border-color:rgba(77,125,255,.5);
  box-shadow:0 0 0 4px rgba(77,125,255,.12);
  transform:translateY(-1px);
}

.btn{
  box-shadow:0 6px 18px rgba(0,0,0,.18);
  transition:transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(0,0,0,.25);
}
.btn:active{
  transform:translateY(0);
}

.topbar h2{
  margin:0 0 8px;
  font-size:30px;
  letter-spacing:-.02em;
}
.topbar p{
  max-width:760px;
  line-height:1.55;
}

.hero-copy{
  box-shadow: var(--glow);
}
.hero-copy h3{
  font-size:34px;
  line-height:1.08;
  letter-spacing:-.03em;
  margin-bottom:10px;
}
.hero-box{
  min-height:100%;
}

.stat{
  padding:16px 14px;
}
.stat strong{
  font-size:24px;
  letter-spacing:-.03em;
}

.card-head{
  border-bottom:1px solid rgba(255,255,255,.06);
  padding-bottom:10px;
}

video{
  border:1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.meta-row{
  padding-top:4px;
}
.active-logo{
  box-shadow:0 8px 20px rgba(0,0,0,.2);
}

.channel-list{
  padding-right:4px;
}

.channel-item{
  transition:transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.channel-item:hover,
.channel-item.active,
.channel-item.focused{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}
.channel-item strong{
  letter-spacing:-.01em;
}
.channel-item p{
  line-height:1.45;
}

.channel-logo,
.channel-logo-placeholder{
  box-shadow:0 8px 18px rgba(0,0,0,.16);
}

.flags .flag{
  font-weight:600;
}

.chip,
.tag,
.mini-badge,
.hero-badge,
.epg-kicker{
  backdrop-filter: blur(10px);
}

.protected-box{
  background:linear-gradient(180deg, rgba(255,162,0,.08), rgba(255,255,255,.02));
}

.preview,.log-box,.probe-box,.epg-grid-table{
  background:linear-gradient(180deg, #0b1524, #0a1320);
}

.log-box{
  line-height:1.45;
}

.epg-grid-table{
  border-radius:20px;
}

.epg-hcell{
  background:rgba(255,255,255,.04);
  font-weight:700;
  position:sticky;
  top:0;
}
.epg-cell,
.epg-channel{
  transition:background .15s ease, border-color .15s ease;
}
.epg-cell:hover,
.epg-channel:hover{
  background:rgba(77,125,255,.08);
  border-color:rgba(255,255,255,.16);
}

.notes li{
  margin-bottom:8px;
}

@media (max-width:900px){
  .topbar h2{font-size:25px}
  .hero-copy h3{font-size:28px}
}
@media (max-width:700px){
  .hero-copy h3{font-size:24px}
  .topbar h2{font-size:22px}
  .channel-item{padding:12px}
}


/* ===== Responsive player fit patch ===== */
.player-column,
.browser-column,
.workspace,
.main,
.card,
.meta,
.probe-grid{
  min-width: 0;
}

.player-column{
  width: 100%;
}

.card video,
video{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  max-height:min(250vh, 500px);
  aspect-ratio:16 / 9;
  object-fit:contain;
  margin:0 auto;
}

.card{
  overflow:hidden;
}

.meta{
  max-width:100%;
}

#playerSection,
.player-card{
  width:100%;
  max-width:100%;
}

.workspace{
  grid-template-columns:minmax(0, 1fr) minmax(320px, 420px);
  align-items:start;
}

.hero{
  grid-template-columns:minmax(0, 1fr) minmax(260px, 380px);
}

.probe-grid{
  grid-template-columns:minmax(220px, .8fr) minmax(0, 1.2fr);
}

.preview{
  max-width:100%;
}

@media (max-width: 1100px){
  .workspace{
    grid-template-columns:1fr;
  }

  .browser-column{
    order:2;
  }

  .player-column{
    order:1;
  }

  .card video,
  video{
    max-height:min(42vh, 360px);
  }
}

@media (max-width: 820px){
  .main{
    padding:12px;
  }

  .hero{
    grid-template-columns:1fr;
  }

  .probe-grid{
    grid-template-columns:1fr;
  }

  .card video,
  video{
    max-height:min(38vh, 300px);
    border-radius:14px;
  }

  .meta-row{
    align-items:flex-start;
  }
}

@media (max-width: 560px){
  .card video,
  video{
    max-height:240px;
  }

  .stats{
    grid-template-columns:1fr;
  }

  .inline-badges{
    width:100%;
  }
}


/* Live badge update */
.live-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.live-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(255,77,109,.16);
  border:1px solid rgba(255,255,255,.08);
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}
.live-badge::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#ff4d6d;
  box-shadow:0 0 12px rgba(255,77,109,.85);
}


/* Hide provider playlist URL by default */
.label-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.masked-input{
  letter-spacing:.08em;
}


/* Admin provider lock upgrade */
.admin-panel{
  border:1px solid rgba(255,255,255,.08);
}
#adminUnlockedView.hidden,
#adminLockedView.hidden{
  display:none !important;
}
.admin-panel input{
  width:100%;
}


/* Channel next/previous controls */
.channel-nav-row{
  display:flex;
  gap:10px;
  margin-top:14px;
  margin-bottom:4px;
  flex-wrap:wrap;
}
.channel-nav-row .btn{
  min-width:140px;
}
@media (max-width:700px){
  .channel-nav-row{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .channel-nav-row .btn{
    min-width:0;
    width:100%;
  }
}


/* ===== StreamNovaTV V2 PRO ===== */
:root{
  --sn-accent:#5a7cff;
  --sn-accent-2:#7c4dff;
  --sn-accent-3:#21d4fd;
  --sn-panel:rgba(16,28,46,.84);
  --sn-line:rgba(255,255,255,.08);
  --sn-muted:#a9bddf;
}

body{
  background:
    radial-gradient(circle at 15% 10%, rgba(90,124,255,.18), transparent 22%),
    radial-gradient(circle at 88% 14%, rgba(124,77,255,.14), transparent 20%),
    linear-gradient(180deg, #07111d 0%, #06101b 100%);
}

.topbar h2{
  font-size:34px;
  margin-bottom:10px;
}
.topbar p{
  color:#b7c8e6;
  line-height:1.6;
}

.hero-copy h3{
  font-size:36px;
  line-height:1.05;
  letter-spacing:-.03em;
}
.hero-copy p{
  max-width:760px;
}

.pro-dashboard{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr);
  gap:16px;
  margin-top:18px;
  margin-bottom:18px;
}

.pro-card,
.rail-card{
  background:linear-gradient(180deg, rgba(19,35,59,.86), rgba(11,21,35,.92));
  border:1px solid rgba(255,255,255,.08);
  border-radius:24px;
  box-shadow:0 16px 40px rgba(0,0,0,.26);
}
.spotlight-card{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) 280px;
  gap:16px;
  padding:22px;
}
.spotlight-kicker,
.rail-kicker{
  display:inline-block;
  margin-bottom:10px;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  font-size:12px;
}
.spotlight-copy h3{
  margin:0 0 12px;
  font-size:31px;
  line-height:1.05;
  letter-spacing:-.03em;
}
.spotlight-copy p{
  margin:0;
  color:var(--sn-muted);
  line-height:1.7;
}
.spotlight-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
}
.spotlight-stats{
  display:grid;
  gap:12px;
  align-content:start;
}
.mini-stat{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:20px;
  padding:16px;
}
.mini-stat strong{
  display:block;
  font-size:24px;
}
.mini-stat span{
  color:var(--sn-muted);
  font-size:12px;
}
.quick-rails{
  display:grid;
  gap:16px;
}
.rail-card{
  padding:18px;
}
.rail-card h4{
  margin:0 0 8px;
  font-size:20px;
}
.rail-card p{
  margin:0;
  color:var(--sn-muted);
  line-height:1.6;
}
.rail-tags{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}
.soft-tag{
  display:inline-flex;
  align-items:center;
  padding:9px 12px;
  border-radius:999px;
  background:rgba(90,124,255,.12);
  border:1px solid rgba(255,255,255,.08);
  font-size:12px;
  font-weight:700;
}
.quality-badge{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(77,125,255,.16);
  border:1px solid rgba(255,255,255,.08);
  color:#fff;
  font-size:12px;
  font-weight:700;
}
.channel-description{
  margin-top:10px !important;
  line-height:1.65;
  color:#c6d4eb !important;
  max-width:720px;
}
.footer{
  margin-top:28px;
  padding:18px 10px 8px;
  text-align:center;
  color:var(--sn-muted);
  font-size:13px;
}
@media (max-width:1100px){
  .pro-dashboard{
    grid-template-columns:1fr;
  }
  .spotlight-card{
    grid-template-columns:1fr;
  }
}
@media (max-width:700px){
  .hero-copy h3{
    font-size:26px;
  }
  .topbar h2{
    font-size:26px;
  }
}
