
    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: #080b12;
      color: #fff;
      overflow: hidden;
      touch-action: manipulation;
    }

    .app {
      width: 100vw;
      height: 100vh;
      display: flex;
      flex-direction: column;
      background: radial-gradient(circle at top left, #1b2440, #080b12 55%);
    }

    .mobile-topbar {
      display: none;
      height: 58px;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      background: rgba(8,11,18,0.96);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .mobile-brand {
      font-size: 18px;
      font-weight: 800;
    }

    .mobile-menu-btn {
      border: 2px solid rgba(255,255,255,0.14);
      background: rgba(255,255,255,0.1);
      color: #fff;
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 20px;
      font-weight: 800;
    }

    .bottom-nav {
      display: none;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      height: 66px;
      background: rgba(8,11,18,0.98);
      border-top: 1px solid rgba(255,255,255,0.1);
      z-index: 15;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
      padding: 7px;
    }

    .bottom-nav-btn {
      border: 2px solid transparent;
      border-radius: 14px;
      background: rgba(255,255,255,0.08);
      color: #fff;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
    }

    .bottom-nav-btn.active {
      background: rgba(67,117,255,0.45);
      border-color: rgba(255,255,255,0.16);
    }

    header {
      height: 76px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 32px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .brand {
      font-size: 28px;
      font-weight: 800;
      letter-spacing: .5px;
    }

    .notice {
      font-size: 14px;
      color: #aeb7cc;
      max-width: 620px;
      text-align: right;
    }

    main {
      flex: 1;
      display: grid;
      grid-template-columns: 260px 1fr;
      min-height: 0;
    }

    .sidebar {
      padding: 22px;
      border-right: 1px solid rgba(255,255,255,0.08);
      background: rgba(0,0,0,0.18);
    }

    .nav-btn,
    .category-btn,
    .action-btn {
      width: 100%;
      padding: 18px 18px;
      margin-bottom: 12px;
      border: 2px solid transparent;
      border-radius: 16px;
      background: rgba(255,255,255,0.08);
      color: #fff;
      font-size: 20px;
      text-align: left;
      cursor: pointer;
    }

    .nav-btn.active,
    .category-btn.active {
      background: rgba(67,117,255,0.35);
    }

    button:focus,
    input:focus,
    select:focus,
    .focus {
      outline: none;
      border-color: #ffd166 !important;
      box-shadow: 0 0 0 4px rgba(255,209,102,0.18);
    }

    .content {
      padding: 24px;
      min-width: 0;
      min-height: 0;
      overflow: hidden;
    }

    .screen {
      display: none;
      height: 100%;
    }

    .screen.active {
      display: flex;
      flex-direction: column;
    }

    .toolbar {
      display: flex;
      gap: 14px;
      margin-bottom: 18px;
      align-items: center;
    }

    input,
    select {
      background: rgba(255,255,255,0.1);
      color: #fff;
      border: 2px solid rgba(255,255,255,0.14);
      border-radius: 14px;
      padding: 16px;
      font-size: 18px;
    }

    input { flex: 1; }

    .grid {
      display: grid;
      grid-template-columns: 260px 1fr;
      gap: 18px;
      min-height: 0;
      flex: 1;
    }

    .categories,
    .items {
      overflow: auto;
      padding-right: 8px;
    }

    .item-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 12px;
      padding-bottom: 30px;
    }

    .item-card {
      min-height: 118px;
      border: 2px solid transparent;
      border-radius: 18px;
      background: rgba(255,255,255,0.08);
      padding: 12px;
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
      cursor: pointer;
    }

    .item-card img {
      width: 54px;
      height: 54px;
      object-fit: contain;
      border-radius: 12px;
      background: rgba(255,255,255,0.08);
    }

    .item-info {
      min-width: 0;
    }

    .item-title {
      font-size: 13px;
      font-weight: 700;
      line-height: 1.15;
      height: 31px;
      overflow: hidden;
      word-break: break-word;
    }

    .item-meta {
      font-size: 11px;
      color: #aeb7cc;
      margin-top: 5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .progress-line {
      height: 5px;
      background: rgba(255,255,255,0.14);
      border-radius: 999px;
      overflow: hidden;
      margin-top: 7px;
    }

    .progress-fill {
      height: 100%;
      background: #ffd166;
      width: 0%;
    }

    .item-actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-top: 8px;
    }

    .mini-btn {
      border: 2px solid rgba(255,255,255,0.14);
      border-radius: 9px;
      background: rgba(255,255,255,0.12);
      color: #fff;
      padding: 6px 5px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .mini-btn:hover,
    .mini-btn:focus {
      border-color: #ffd166;
      background: rgba(67,117,255,0.45);
    }

    .home-card {
      min-height: 96px;
      border: 2px solid transparent;
      border-radius: 18px;
      background: rgba(255,255,255,0.08);
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      cursor: pointer;
    }

    .home-title {
      font-size: 18px;
      font-weight: 800;
      line-height: 1.1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .home-meta {
      font-size: 12px;
      color: #aeb7cc;
      margin-top: 8px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .home-card:hover,
    .home-card:focus {
      border-color: #ffd166;
      background: rgba(67,117,255,0.35);
    }

    .setup-box {
      max-width: 900px;
      margin: auto;
      width: 100%;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 24px;
      padding: 32px;
    }

    .setup-box h1 {
      margin-top: 0;
      font-size: 38px;
    }

    .setup-box p {
      color: #c6cede;
      font-size: 18px;
      line-height: 1.5;
    }

    .row {
      display: flex;
      gap: 12px;
      margin-top: 18px;
    }

    .action-btn {
      text-align: center;
      background: #315dff;
      font-weight: 700;
    }

    .secondary {
      background: rgba(255,255,255,0.1);
    }

    .player-screen {
      position: fixed;
      inset: 0;
      background: #000;
      display: none;
      z-index: 20;
    }

    .player-screen.active {
      display: block;
    }

    .preview-screen {
      background: rgba(0,0,0,0.86);
      padding: 40px;
    }

    .preview-box {
      width: min(1100px, 94vw);
      height: min(620px, 86vh);
      margin: 0 auto;
      background: #080b12;
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 24px;
      overflow: hidden;
      display: grid;
      grid-template-columns: 1.5fr 1fr;
      box-shadow: 0 20px 80px rgba(0,0,0,0.55);
    }

    .preview-box video {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #000;
    }

    .preview-info {
      padding: 28px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .preview-info h2 {
      font-size: 32px;
      margin: 0 0 10px;
    }

    video {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #000;
    }

    .player-overlay {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      padding: 24px 32px;
      background: linear-gradient(transparent, rgba(0,0,0,.82));
      font-size: 22px;
    }

    .small {
      color: #aeb7cc;
      font-size: 14px;
    }

    .player-actions {
      display: flex;
      gap: 12px;
      margin: 14px 0 8px;
      flex-wrap: wrap;
    }

    .player-btn {
      border: 2px solid rgba(255,255,255,0.18);
      border-radius: 14px;
      background: rgba(255,255,255,0.14);
      color: #fff;
      padding: 13px 18px;
      font-size: 18px;
      font-weight: 700;
      cursor: pointer;
    }

    .player-btn:focus,
    .player-btn:hover {
      border-color: #ffd166;
      background: rgba(67,117,255,0.45);
    }

    .empty {
      color: #aeb7cc;
      font-size: 22px;
      padding: 30px;
      border: 1px dashed rgba(255,255,255,0.18);
      border-radius: 18px;
    }

    @media (max-width: 800px) {
      body { overflow: auto; }

      .app {
        min-height: 100vh;
        height: auto;
        padding-bottom: 74px;
      }

      .mobile-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 16;
      }

      header { display: none; }

      main {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 132px);
      }

      .sidebar {
        display: none;
        position: fixed;
        left: 12px;
        right: 12px;
        top: 68px;
        z-index: 30;
        max-height: 72vh;
        overflow: auto;
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 20px;
        background: rgba(8,11,18,0.98);
        box-shadow: 0 20px 70px rgba(0,0,0,0.55);
      }

      .sidebar.mobile-open { display: block; }

      .nav-btn {
        font-size: 16px;
        padding: 15px;
        margin-bottom: 8px;
      }

      .bottom-nav { display: grid; }

      .content {
        padding: 14px;
        overflow: visible;
      }

      .setup-box {
        padding: 18px;
        border-radius: 18px;
      }

      .setup-box h1 { font-size: 26px; }
      .setup-box p { font-size: 14px; }

      .row {
        flex-direction: column;
        gap: 10px;
      }

      input,
      select {
        width: 100%;
        font-size: 15px;
        padding: 13px;
      }

      .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }

      .grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .categories {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 6px;
      }

      .category-btn {
        min-width: 150px;
        font-size: 14px;
        padding: 12px;
      }

      .items { overflow: visible; }

      .item-list {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .item-card {
        min-height: 104px;
        grid-template-columns: 48px minmax(0,1fr);
        padding: 10px;
      }

      .item-card img {
        width: 48px;
        height: 48px;
      }

      .item-title {
        font-size: 13px;
        height: 31px;
      }

      .item-meta { font-size: 10px; }

      .mini-btn {
        font-size: 10px;
        padding: 7px 4px;
      }

      .home-title { font-size: 16px; }

      .home-card {
        min-height: 82px;
        padding: 15px;
      }

      .player-screen { overflow: auto; }

      video { height: 58vh; }

      .player-overlay {
        position: fixed;
        bottom: 66px;
        padding: 14px;
        font-size: 16px;
      }

      .player-actions { gap: 8px; }

      .player-btn {
        font-size: 13px;
        padding: 10px 12px;
      }

      .preview-screen { padding: 12px; }

      .preview-box {
        width: 100%;
        height: auto;
        min-height: calc(100vh - 100px);
        grid-template-columns: 1fr;
      }

      .preview-box video { height: 42vh; }

      .preview-info {
        padding: 18px;
        justify-content: flex-start;
      }

      .preview-info h2 { font-size: 22px; }
    }
    .settings-section {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ffffff;
}

.settings-section p {
  color: #cbd5e1;
  font-size: 14px;
  word-break: break-word;
  margin: 8px 0;
}

.settings-section button {
  margin: 8px 8px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1f2937;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.settings-section button:hover {
  background: #374151;
}

    /* =========================
   LICENSE ACTIVATION SCREEN
========================= */

.hidden {
    display: none !important;
}

.activation-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at top, rgba(52, 91, 255, 0.22), transparent 35%),
        #070b16;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.activation-card {
    width: 100%;
    max-width: 460px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    color: #ffffff;
}

.activation-card h1 {
    font-size: 30px;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.activation-subtitle {
    margin: 0 0 24px;
    color: #b9c2d3;
    font-size: 15px;
}

.activation-card label {
    display: block;
    margin-bottom: 8px;
    color: #d8deea;
    font-weight: 600;
    font-size: 14px;
}

.activation-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #0b1020;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    margin-bottom: 16px;
}

.activation-card input:focus {
    border-color: #315cff;
    box-shadow: 0 0 0 3px rgba(49, 92, 255, 0.2);
}

.primary-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 15px 18px;
    background: #315cff;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.license-message {
    margin-top: 16px;
    min-height: 22px;
    font-size: 14px;
    line-height: 1.4;
}

.license-message.success {
    color: #4ade80;
}

.license-message.error {
    color: #fb7185;
}

.license-message.info {
    color: #93c5fd;
}

.activation-note {
    margin-top: 22px;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.5;
}

/* Mobile */
@media (max-width: 600px) {
    .activation-screen {
        padding: 16px;
    }

    .activation-card {
        padding: 22px;
        border-radius: 20px;
    }

    .activation-card h1 {
        font-size: 24px;
    }

    .activation-card input,
    .primary-btn {
        font-size: 15px;
    }
}

    .settings-section {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ffffff;
}

.settings-section p {
  color: #cbd5e1;
  font-size: 14px;
  word-break: break-word;
  margin: 8px 0;
}

.settings-section button:hover {
  background: #374151;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.secondary-btn {
  width: auto;
  min-width: 150px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

.app-shell,
.app-layout,
.main-content,
.content,
.screen,
#settingsScreen {
  min-height: 0;
}

.main-content,
.content {
  overflow-y: auto;
  max-height: calc(100vh - 96px);
  padding-bottom: 80px;
}
main {
  overflow-y: auto;
  max-height: calc(100vh - 96px);
  padding-bottom: 100px;
}

#settingsScreen {
  padding-top: 24px !important;
}

#settingsScreen .settings-card,
#settingsScreen .card,
.settings-card {
  margin-top: 0 !important;
}

.settings-actions {
  display: flex !important;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.settings-actions button,
.settings-actions .secondary-btn {
  width: auto !important;
  min-width: 150px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.settings-actions button:hover,
.settings-actions .secondary-btn:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
}
/* Update 3 final settings fixes */

#settingsScreen {
  display: block;
  padding: 24px 28px 120px;
  overflow-y: auto;
}

.content {
  overflow-y: auto;
  max-height: calc(100vh - 96px);
  padding-bottom: 120px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.secondary-btn {
  width: auto !important;
  min-width: 150px;
  max-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
}
/* =========================
   FINAL DESKTOP SCROLL FIX
========================= */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

.sidebar {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 40px;
}

.content {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 24px 24px 140px;
}

.screen {
  display: none;
  min-height: 100%;
}

.screen.active {
  display: block;
}

#settingsScreen {
  min-height: 100%;
  overflow: visible;
  padding-bottom: 160px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.settings-actions button,
.settings-actions .secondary-btn,
.secondary-btn {
  width: auto !important;
  min-width: 150px;
  max-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 800px) {
  html,
  body {
    overflow-y: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding-bottom: 74px;
  }

  main {
    display: block;
    height: auto;
    min-height: calc(100vh - 132px);
    overflow: visible;
  }

  .content {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 14px 14px 100px;
  }

  .screen.active {
    display: block;
  }

  #settingsScreen {
    padding-bottom: 140px;
  }
}

.xtream-progress {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.xtream-progress-text {
  font-size: 14px;
  margin-bottom: 8px;
  color: #fff;
}

.xtream-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.15);
}

.xtream-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #315cf6;
  transition: width 0.25s ease;
}
}
