@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos/GolosText-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: "Abril Fatface";
  src: url("../fonts/abril_fatface/AbrilFatface-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  --bg-deep: #0b0c12;
  --panel: #12131a;
  --panel-2: #171822;
  --panel-3: #1c1e28;
  --input: #22242f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-mute: rgba(255, 255, 255, 0.4);
  --accent: #876aff;
  --accent-2: #9d8dff;
  --accent-soft: rgba(135, 106, 255, 0.22);
  --online: #3ddc84;
  --progress: #7ec8ff;
  --star: #f5c518;
  --font-ui: "Golos Text", sans-serif;
  --font-display: "Abril Fatface", "Golos Text", sans-serif;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar-w: 92px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  /* Shared page system */
  --zen-page-bg:
    radial-gradient(900px 520px at 50% 32%, rgba(135, 106, 255, 0.14) 0%, transparent 62%),
    linear-gradient(180deg, #12131a 0%, #0b0c12 100%);
  --zen-surface: rgba(15, 17, 23, 0.96);
  --zen-surface-border: var(--border);
  --zen-title-size: 22px;
  --zen-title-weight: 600;
  --zen-subtitle-size: 13px;
  --zen-field-height: 52px;
  --zen-field-radius: 10px;
  --zen-field-bg: var(--input);
  --zen-field-border: var(--border-strong);
  --zen-field-focus: rgba(157, 141, 255, 0.55);
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 22px;
  --icon-xl: 34px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-deep);
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

#setup {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--zen-page-bg);
}

/* ── Zen shared pages (splash, setup, profiles, overlays) ── */
.zen-page {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--zen-page-bg);
}

.zen-page__inner {
  text-align: center;
  padding: 28px 24px;
  width: min(920px, 100%);
  animation: splash-rise 0.6s ease both;
}

.zen-page__inner--narrow {
  width: min(360px, calc(100% - 40px));
}

.zen-page__logo {
  width: 128px;
  height: 128px;
  margin: 0 auto 26px;
  display: block;
}

.zen-page__logo--md {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
}

.zen-page__title,
.zen-page h1 {
  font-family: var(--font-ui);
  font-size: var(--zen-title-size);
  font-weight: var(--zen-title-weight);
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.95);
}

.zen-page__subtitle {
  font-size: var(--zen-subtitle-size);
  color: var(--text-dim);
}

.zen-back,
.settings-back {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.zen-back {
  position: absolute;
  top: 22px;
  left: 22px;
}

.zen-back:hover,
.settings-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.zen-back .icon,
.zen-back .lucide,
.settings-back .icon,
.settings-back .lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.zen-surface {
  width: min(560px, 100%);
  background: var(--zen-surface);
  border: 1px solid var(--zen-surface-border);
  border-radius: var(--radius-lg);
  padding: 28px 30px 30px;
  box-shadow: var(--shadow);
}

.zen-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--zen-field-height);
  padding: 0 14px;
  margin-bottom: 12px;
  border: 1px solid var(--zen-field-border);
  border-radius: var(--zen-field-radius);
  background: var(--zen-field-bg);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 15px;
  text-align: left;
}

.zen-field .icon,
.zen-field .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.75);
}

.zen-field input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  outline: none;
  min-width: 0;
}

.zen-field input::placeholder {
  color: var(--text-mute);
}

.zen-field:focus-within {
  border-color: var(--zen-field-focus);
}

.zen-field-btn {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.zen-field-btn:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(24, 26, 36, 0.8);
}

.zen-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.zen-link-btn .icon,
.zen-link-btn .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
}

.zen-link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.zen-btn-wide {
  width: 100%;
  justify-content: center;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(135, 106, 255, 0.35) 0%, transparent 70%);
  filter: blur(8px);
  animation: splash-pulse 2.4s ease-in-out infinite;
}

.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: splash-rise 0.7s ease both;
}

.splash-logo {
  width: 88px;
  height: 88px;
  animation: splash-logo 1.8s ease-in-out infinite;
}

.splash-name {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.splash-tagline {
  font-size: var(--zen-subtitle-size);
  font-weight: 500;
  color: var(--text-dim);
  margin-top: -4px;
}

.splash-loader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.splash-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: splash-dot 1s ease-in-out infinite;
}

.splash-loader span:nth-child(2) {
  animation-delay: 0.15s;
}

.splash-loader span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-logo {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes splash-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes splash-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.icon,
.lucide {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  pointer-events: none;
  color: inherit;
  stroke: currentColor;
  fill: none;
}

.star-on {
  fill: var(--star);
  stroke: var(--star);
}

.star-off {
  stroke: var(--star);
  fill: none;
  opacity: 0.35;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

#setup.hidden {
  display: none;
}

.setup-wrap {
  width: min(560px, 100%);
}

.app-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid var(--border);
}

.sidebar .logo {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
}

.nav-btn {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn .icon, .nav-btn .lucide {
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar .spacer {
  flex: 1;
}

.main {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 22px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.source-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18);
}

.source-pill .swap {
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
}

.source-pill .swap .icon,
.source-pill .swap .lucide {
  font-size: 15px;
  width: 15px;
  height: 15px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.section {
  margin-top: 26px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

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

.poster {
  flex: 0 0 auto;
  width: 148px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--panel-3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.poster:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(135, 106, 255, 0.28), transparent 42%),
    linear-gradient(145deg, #272a3a, #11131e);
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.card-h {
  flex: 0 0 auto;
  width: 260px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--panel-3);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.card-h:hover {
  transform: translateY(-3px);
}

.card-h img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-h .title,
.poster .title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.card-media .card-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 10px;
  background: linear-gradient(180deg, transparent 30%, rgba(8, 9, 14, 0.78) 62%, rgba(8, 9, 14, 0.96) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card-media:hover .card-hover {
  opacity: 1;
}

.card-media:hover .title {
  opacity: 0;
}

.card-hover-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-h .card-hover-title {
  font-size: 14px;
}

/* Keep movie and series cards on one consistent poster grid. */
#view-movies .row > .card-media,
#view-series .row > .card-media,
#view-search .row > .card-media {
  width: 148px;
  aspect-ratio: 2 / 3;
}

.card-hover-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(220, 224, 236, 0.9);
}

.card-hover-dot {
  opacity: 0.55;
}

.card-hover-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-hover-star {
  width: 12px;
  height: 12px;
  fill: #f5a623;
  stroke: #f5a623;
}

.card-hover-star svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 3;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--progress);
}

/* Detail views */
.detail-view {
  padding: 0 !important;
  position: relative;
}

.detail-hero {
  height: 100%;
  min-height: 100%;
  background-size: cover;
  background-position: center top;
  position: relative;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 9, 14, 0.94) 0%,
    rgba(8, 9, 14, 0.78) 42%,
    rgba(8, 9, 14, 0.35) 70%,
    rgba(8, 9, 14, 0.55) 100%
  );
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(8, 9, 14, 0.95) 100%);
}

.detail-content {
  position: relative;
  z-index: 1;
  padding: 28px 36px 40px;
  max-width: 920px;
}

#view-series-detail .detail-content {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#view-series-detail .season-tabs {
  margin-top: 0;
}

#view-movie-detail .detail-content {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#movie-recommendations-label {
  margin-top: 0;
}

.back-btn {
  position: absolute;
  top: 28px;
  left: 36px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-bottom: 22px;
  font-size: 22px;
}

.back-btn .icon, .back-btn .lucide {
  width: 22px;
  height: 22px;
}

.detail-title {
  font-family: var(--font-ui);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--star);
}

.stars .icon, .stars .lucide {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.quality {
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.quality span {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}

.synopsis-label {
  font-weight: 700;
  margin-bottom: 8px;
}

.synopsis {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  font-size: 14px;
  max-width: 640px;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #9d8dff, #876aff 55%, #6f57ef);
  color: #fff;
  box-shadow: 0 8px 24px rgba(135, 106, 255, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1.5px solid rgba(157, 141, 255, 0.55);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-ghost.is-in-list {
  color: var(--online);
  border-color: rgba(61, 220, 132, 0.45);
  background: rgba(61, 220, 132, 0.08);
}

.btn-white {
  background: linear-gradient(180deg, #ffffff 0%, #e8ecf4 100%);
  color: #12131a;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.12);
}

.btn-white:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.cast-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  margin-bottom: 28px;
  scrollbar-width: none;
}

.cast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.cast-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.cast-item .name {
  font-size: 13px;
  font-weight: 600;
}

.cast-item .role {
  font-size: 12px;
  color: var(--text-dim);
}

.season-tabs {
  display: flex;
  gap: 18px;
  margin: 8px 0 16px;
}

.season-tabs button {
  border: 0;
  background: transparent;
  color: var(--text-mute);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}

.season-tabs button.active {
  color: #fff;
  border-bottom-color: #fff;
}

.episode {
  flex: 0 0 auto;
  width: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  cursor: pointer;
}

.episode img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.episode .ep-meta {
  padding: 10px 12px 12px;
}

.episode .ep-title {
  font-size: 13px;
  font-weight: 700;
}

.episode .ep-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.search-bar .icon, .search-bar .lucide {
  font-size: 18px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
}

.filter-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: var(--panel-3);
  color: var(--text-dim);
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.result-item img {
  width: 54px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
}

.result-item .media-fallback {
  flex: 0 0 54px;
  width: 54px;
  height: 80px;
  border-radius: 10px;
}

.result-item .rtitle {
  font-weight: 600;
  font-size: 15px;
}

/* Profiles / Synchro */
.centered-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
  gap: 18px;
}

.centered-page h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.centered-page p {
  color: rgba(255, 255, 255, 0.8);
  margin-top: -8px;
}

.glass-card {
  width: min(720px, 100%);
  text-align: left;
  background: rgba(18, 19, 26, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
  box-shadow: var(--shadow);
}

.glass-card h3 {
  font-size: 16px;
  margin-bottom: 14px;
}

.profiles {
  display: flex;
  gap: 22px;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  background: transparent;
  border: 0;
  font: inherit;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  border: 2px solid transparent;
}

.avatar.pink {
  background: #f4b4a8;
  color: #5a2d28;
  border-color: var(--accent-2);
}

.avatar.blue {
  background: #9fd8ef;
  color: #1d4454;
}

.avatar.new {
  background: #2a2c38;
  color: #fff;
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.avatar.new .icon,
.avatar.new .lucide {
  font-size: 22px;
  width: 22px;
  height: 22px;
}

.avatar.green {
  background: #a8e6cf;
  color: #1d4a38;
}

.avatar.purple {
  background: #c4b5fd;
  color: #3b2f6b;
}

.avatar.orange {
  background: #fbbf8a;
  color: #5a3a1a;
}

.avatar.active-profile {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(135, 106, 255, 0.25);
}

/* Profile picker */
.profile-picker {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
}

.profile-picker.hidden {
  display: none;
}

.profile-picker-inner {
  margin-bottom: 0;
}

.profile-picker-inner h1 {
  margin-bottom: 42px;
}

.profile-picker-logo {
  width: 128px;
  height: 128px;
  margin: 0 auto 26px;
  display: block;
}

.profile-picker-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 36px;
  margin-bottom: 48px;
}

.profile-picker-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 96px;
}

.profile-picker-item {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-ui);
}

.profile-picker-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #3a3d4a;
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-picker-item:hover .profile-picker-circle,
.profile-picker-item.is-selected .profile-picker-circle,
.profile-picker-item.is-focused .profile-picker-circle {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.profile-picker-item:hover .profile-picker-circle {
  transform: scale(1.04);
}

.profile-picker-circle-add {
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.34);
}

.profile-picker-circle-add .icon,
.profile-picker-circle-add .lucide {
  width: 34px;
  height: 34px;
  stroke-width: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.profile-picker-item:hover .profile-picker-circle-add {
  border-color: rgba(255, 255, 255, 0.55);
  transform: none;
}

.profile-picker-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(210, 214, 230, 0.78);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-picker-remove {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.profile-picker-remove .icon,
.profile-picker-remove .lucide {
  width: 16px;
  height: 16px;
}

.profile-picker-remove:hover {
  color: #fff;
  transform: scale(1.1);
}

/* Create profile */
.create-profile {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: grid;
  place-items: center;
}

.create-profile.hidden {
  display: none;
}

.create-profile-inner {
  text-align: center;
  animation: splash-rise 0.55s ease both;
}

.create-profile-inner h1 {
  margin-bottom: 34px;
}

.create-profile-avatar-wrap {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  margin: 0 auto 10px;
  display: block;
}

.create-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.create-profile-avatar.neutral {
  background: #3f434f;
  color: transparent;
}

.create-profile-avatar-wrap:hover .create-profile-avatar {
  border-color: rgba(255, 255, 255, 0.2);
}

.create-profile-avatar-label {
  font-size: var(--zen-subtitle-size);
  color: var(--text-dim);
  margin-bottom: 28px;
}

.create-profile-avatar-picker {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: -14px 0 22px;
}

.create-profile-avatar-picker.hidden {
  display: none;
}

.create-profile-avatar-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.create-profile-avatar-option:hover {
  transform: scale(1.08);
}

.create-profile-avatar-option.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.create-profile-lang-text {
  flex: 1;
}

.create-profile-lang-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 14px;
}

.create-profile-lang-value .icon,
.create-profile-lang-value .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.create-profile-kids {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 28px;
  padding: 0 2px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.create-profile-lang-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, 0.72);
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 20px;
}

.create-profile-lang-overlay.hidden {
  display: none;
}

.create-profile-lang-sheet {
  width: min(420px, 100%);
  max-height: min(70vh, 520px);
  background: var(--zen-surface);
  border: 1px solid var(--zen-surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.create-profile-lang-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.create-profile-lang-header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.create-profile-lang-header h2 {
  font-family: var(--font-ui);
  font-size: var(--zen-title-size);
  font-weight: var(--zen-title-weight);
}

.create-profile-lang-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.btn .icon, .btn .lucide {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Setup / Add source — card uses .zen-surface */

.setup-brand {
  text-align: center;
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.setup-brand img {
  width: 28px;
  height: 28px;
}

.setup-shell h2 {
  font-family: var(--font-ui);
  font-size: var(--zen-title-size);
  font-weight: var(--zen-title-weight);
  margin-bottom: 18px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.field input {
  width: 100%;
  border: 1px solid var(--zen-field-border);
  background: var(--zen-field-bg);
  color: #fff;
  border-radius: var(--zen-field-radius);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

.field input:focus {
  border-color: var(--zen-field-focus);
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setup-shell .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.setup-shell .btn-ghost {
  margin-top: 10px;
}

.setup-hero {
  text-align: center;
  margin-bottom: 22px;
}

.setup-hero h1 {
  font-family: var(--font-ui);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.setup-hero p {
  font-size: var(--zen-subtitle-size);
  color: var(--text-dim);
  margin-top: 6px;
}

/* Live TV */
#view-live {
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  flex-direction: column;
}

#view-live.active {
  display: flex;
}

.live-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.live-header .segmented {
  margin: 0;
}

.live-epg-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.live-epg-meta .icon,
.live-epg-meta .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.live-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 190px 1fr;
  grid-template-rows: 1fr;
}

.live-shell.epg-mode {
  grid-template-columns: 190px 1fr;
}

.live-shell.epg-mode .live-main {
  display: none;
}

.live-shell.epg-mode .live-epg {
  display: block;
}

.live-main {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  min-height: 0;
  min-width: 0;
}

.live-epg {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  background: var(--bg-deep);
  border-left: 1px solid var(--border);
}

.live-epg.hidden {
  display: none;
}

.epg-scroll {
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.epg-grid {
  --epg-slot-w: 140px;
  --epg-row-h: 72px;
  min-width: max-content;
}

.epg-times {
  display: grid;
  grid-template-columns: 168px repeat(var(--epg-cols), var(--epg-slot-w));
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(11, 12, 18, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.epg-times .epg-corner {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-right: 1px solid var(--border);
}

.epg-time {
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

.epg-time.is-now {
  color: var(--accent-2);
}

.epg-now-line {
  position: absolute;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(135, 106, 255, 0.45);
}

.epg-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: var(--epg-row-h);
}

.epg-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.epg-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  position: sticky;
  left: 0;
  z-index: 1;
}

.epg-ch-code {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.epg-ch-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.epg-track {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: var(--epg-row-h);
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(var(--epg-slot-w) - 1px),
    rgba(255, 255, 255, 0.04) calc(var(--epg-slot-w) - 1px),
    rgba(255, 255, 255, 0.04) var(--epg-slot-w)
  );
}

.epg-prog {
  flex-shrink: 0;
  align-self: center;
  height: 52px;
  margin: 0 2px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(36, 38, 52, 0.95) 0%, rgba(22, 24, 34, 0.98) 100%);
  color: #fff;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.epg-prog:hover {
  border-color: rgba(157, 141, 255, 0.45);
  transform: translateY(-1px);
}

.epg-prog.is-now {
  border-color: rgba(135, 106, 255, 0.55);
  background: linear-gradient(180deg, rgba(58, 52, 92, 0.85) 0%, rgba(28, 26, 44, 0.98) 100%);
  box-shadow: inset 0 0 0 1px rgba(135, 106, 255, 0.15);
}

.epg-prog.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.epg-prog-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-prog-time {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.live-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.22);
}

.live-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: left;
  transition: 0.15s ease;
}

.live-cat img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.live-cat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}

.live-cat span {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-cat:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

.live-cat.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.live-cat.active img {
  width: 36px;
  height: 36px;
}

.live-cat-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-cat-meta strong {
  font-size: 14px;
  font-weight: 700;
}

.live-cat-meta small {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.38);
}

.live-channels {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px 28px;
  overflow: auto;
  min-height: 0;
  background: #0b0c12;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 90%, transparent 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.live-channels::-webkit-scrollbar {
  width: 5px;
}

.live-channels::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.live-load-more {
  align-self: center;
  min-width: 220px;
  margin: 4px 0 10px;
  padding: 11px 16px;
  border: 1px solid rgba(165, 151, 255, 0.28);
  border-radius: 999px;
  background: rgba(48, 45, 76, 0.88);
  color: rgba(255, 255, 255, 0.9);
  font: 700 13px var(--font-ui);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.live-load-more span {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.54);
  font-weight: 500;
}

.live-load-more:hover,
.live-load-more:focus-visible {
  border-color: rgba(199, 190, 255, 0.72);
  background: rgba(70, 64, 112, 0.96);
  transform: translateY(-1px);
}

.live-channel {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(165, 151, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(53, 51, 82, 0.98), rgba(25, 27, 42, 0.99));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(135, 106, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: left;
  color: #fff;
  font-family: var(--font-ui);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  flex: 0 0 auto;
}

.live-channel:hover {
  border-color: rgba(185, 174, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(58, 56, 88, 0.98), rgba(29, 30, 49, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(135, 106, 255, 0.12);
  transform: translateY(-2px);
}

.live-channel.active {
  border-color: rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(66, 62, 101, 0.98), rgba(31, 31, 53, 0.98));
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 24px rgba(135, 106, 255, 0.16);
}

.live-channel.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.live-channel-logo {
  width: 78px;
  height: 54px;
  border-radius: 10px;
  background: linear-gradient(145deg, #171925, #0b0d15);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 5px 12px rgba(0, 0, 0, 0.22);
}

.live-channel-logo img {
  width: 70%;
  height: 100%;
  object-fit: cover;
}

.live-channel-body {
  min-width: 0;
}

.live-channel-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-channel-views {
  font-size: 12px;
  color: rgba(180, 188, 210, 0.62);
  margin-bottom: 6px;
}

.live-channel-epg {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.live-channel-epg-label {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(135, 106, 255, 0.2);
  color: #c9beff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.live-channel-epg-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-channel-epg-time {
  flex: 0 0 auto;
  color: rgba(180, 188, 210, 0.62);
  font-variant-numeric: tabular-nums;
}

.live-channel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.live-fav {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: #ff9f43;
  font-size: 16px;
  opacity: 0;
}

.live-fav.star-on {
  fill: #ff9f43;
  stroke: #ff9f43;
}

.live-action-fav.is-on .icon,
.live-action-fav.is-on .lucide {
  fill: #ff9f43;
  stroke: #ff9f43;
}

.live-channel.active .live-fav {
  opacity: 1;
}

.live-preview {
  position: relative;
  overflow: hidden;
  min-height: 0;
  z-index: 1;
  border-left: 0;
  box-shadow:
    -18px 0 34px rgba(0, 0, 0, 0.34),
    inset 1px 0 0 rgba(135, 106, 255, 0.08);
  cursor: pointer;
}

.live-preview-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
  transform: scale(1.02);
}

.live-preview-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #080a12;
}

.live-preview-fade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      90deg,
      #0b0c12 0%,
      rgba(11, 12, 18, 0.92) 8%,
      rgba(11, 12, 18, 0.55) 22%,
      rgba(11, 12, 18, 0.18) 40%,
      transparent 62%
    ),
    linear-gradient(
      180deg,
      rgba(11, 12, 18, 0.12) 0%,
      transparent 28%,
      rgba(11, 12, 18, 0.28) 58%,
      rgba(11, 12, 18, 0.9) 100%
    );
  pointer-events: none;
}

.live-preview-state {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(8, 10, 18, 0.76);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.live-now {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 3;
  font-family: var(--font-ui);
  max-width: 520px;
}

.live-now-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.live-now-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.live-now-desc {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(210, 214, 230, 0.72);
  margin-bottom: 18px;
  max-width: 460px;
}

.live-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-progress-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.live-progress-bar > span {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: inherit;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

.live-progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

/* Live fullscreen player */
.live-player {
  position: absolute;
  inset: 0;
  z-index: 40;
  border-radius: inherit;
  overflow: hidden;
  font-family: var(--font-ui);
  color: #fff;
}

.live-player.hidden {
  display: none;
}

.live-player-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.live-player-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080a12;
}

.live-player-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(8, 10, 18, 0.45) 0%, transparent 28%, transparent 55%, rgba(8, 10, 18, 0.82) 100%),
    linear-gradient(90deg, rgba(8, 10, 18, 0.35) 0%, transparent 40%);
  pointer-events: none;
}

.live-player-state {
  position: absolute;
  left: 50%;
  top: 64%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(8, 10, 18, 0.78);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}

.live-player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 22px 28px;
}

.live-watching-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
}

.live-player-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.live-player-logo-mark {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #f5c518;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f5c518;
}

.live-player-brand strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.live-player-country {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.live-player-country img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.live-player-controls {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 28px;
}

.live-ctrl {
  border: 0;
  background: transparent;
  color: #fff;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 28px;
  opacity: 0.9;
}

.live-ctrl-main {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(20, 22, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  font-size: 34px;
}

.live-player-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  padding: 24px 28px 28px;
}

.live-player-info {
  max-width: 420px;
}

.live-badge-live {
  display: inline-block;
  background: #e03131;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.live-player-info h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.live-player-channel {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 8px;
}

.live-player-time {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.live-player-collapse {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  margin-bottom: 8px;
  opacity: 0.85;
}

.live-player-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 6px;
}

.live-action {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.live-action .icon,
.live-action .lucide,
.live-action svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.live-action-fav {
  color: #fff;
}

.live-action-fav.is-on {
  color: #ff9f43;
}

.live-action-fav.is-on .icon,
.live-action-fav.is-on .lucide,
.live-action-fav.is-on svg {
  fill: #ff9f43;
  stroke: #ff9f43;
}

#view-settings {
  padding: 18px 22px 22px;
  background: #0d0f16;
}

.settings-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 18px;
  min-height: 0;
}

.settings-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

.settings-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.settings-section-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 2px;
}

.settings-cards {
  display: grid;
  gap: 12px;
}

.settings-cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #171a24 0%, #13151e 100%);
  color: #fff;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.settings-card:hover {
  border-color: rgba(135, 106, 255, 0.35);
  background: linear-gradient(180deg, #1c2030 0%, #161925 100%);
  transform: translateY(-1px);
}

.settings-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(135, 106, 255, 0.16);
  color: var(--accent-2);
  flex-shrink: 0;
}

.settings-ico .icon, .settings-ico .lucide {
  font-size: 22px;
  color: var(--accent-2);
}

.settings-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.settings-card-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.settings-card-text small {
  font-size: 12px;
  font-weight: 400;
  color: rgba(180, 188, 210, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-chevron {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.35);
}

.settings-brand {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #12131a;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-brand-media {
  flex: 1.15;
  min-height: 180px;
  background:
    linear-gradient(180deg, rgba(20, 12, 40, 0.15) 0%, rgba(12, 10, 24, 0.55) 70%, #12131a 100%),
    url("https://images.unsplash.com/photo-1510798831972-504808c5f5d4?auto=format&fit=crop&w=800&q=80")
      center / cover no-repeat;
}

.settings-brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 16px 20px;
  font-family: var(--font-ui);
}

.settings-brand-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}

.settings-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.settings-brand-tag {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(210, 214, 230, 0.78);
  max-width: 180px;
  margin-bottom: auto;
}

.settings-brand-version {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 980px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-brand {
    min-height: 280px;
  }
  .settings-cards-3 {
    grid-template-columns: 1fr;
  }
  .settings-cards-2 {
    grid-template-columns: 1fr;
  }
  .ms-options {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }
}

.live-action.is-on .icon,
.live-action.is-on .lucide {
  fill: var(--star);
  stroke: var(--star);
}

/* VOD fullscreen player */
.vod-player {
  position: absolute;
  inset: 0;
  z-index: 41;
  border-radius: inherit;
  overflow: hidden;
  font-family: var(--font-ui);
  color: #fff;
}

.vod-player.hidden {
  display: none;
}

.vod-player-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.vod-player-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.vod-player-video.has-source {
  opacity: 1;
}

.vod-media-state {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: min(420px, calc(100% - 40px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(10, 11, 17, 0.72);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}

.vod-media-state.hidden {
  display: none;
}

.vod-media-state[data-state="error"] {
  color: #ffb4bd;
  border-color: rgba(255, 120, 140, 0.35);
}

.vod-player-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 18, 0.72) 0%, transparent 24%, transparent 52%, rgba(8, 10, 18, 0.9) 100%),
    linear-gradient(90deg, rgba(8, 10, 18, 0.45) 0%, transparent 42%);
  pointer-events: none;
}

.vod-player-top,
.vod-player-controls,
.vod-player-bottom {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vod-player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px;
}

.vod-player-back {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.vod-player-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.vod-player-back .icon,
.vod-player-back .lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.vod-player-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.vod-player-meta h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.vod-player-meta p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

.vod-player-controls {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 28px;
}

.vod-ctrl {
  border: 0;
  background: transparent;
  color: #fff;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.9;
}

.vod-ctrl .icon,
.vod-ctrl .lucide {
  width: 28px;
  height: 28px;
}

.vod-ctrl-main {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(20, 22, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.vod-ctrl-main .icon,
.vod-ctrl-main .lucide {
  width: 34px;
  height: 34px;
}

.vod-player-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  padding: 20px 28px 28px;
}

.vod-player-progress-block {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.vod-player-progress {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  margin-bottom: 8px;
}

.vod-player-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--progress);
  transition: width 0.25s linear;
}

.vod-player-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: left 0.25s linear;
}

.vod-player-times {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
}

.vod-player-collapse {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  margin-bottom: 8px;
  opacity: 0.85;
}

.vod-player-collapse .icon,
.vod-player-collapse .lucide {
  width: 28px;
  height: 28px;
}

.vod-player-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vod-player.is-playing:not(.controls-visible) .vod-player-top,
.vod-player.is-playing:not(.controls-visible) .vod-player-controls,
.vod-player.is-playing:not(.controls-visible) .vod-player-bottom,
.vod-player.is-playing:not(.controls-visible) .vod-player-actions {
  opacity: 0;
  pointer-events: none;
}

.vod-player.is-playing:not(.controls-visible) .vod-player-top {
  transform: translateY(-8px);
}

.vod-player.is-playing:not(.controls-visible) .vod-player-controls {
  transform: translate(-50%, calc(-50% + 8px));
}

.vod-player.is-playing:not(.controls-visible) .vod-player-bottom {
  transform: translateY(8px);
}

.vod-player.is-playing.controls-visible .vod-player-top,
.vod-player.is-playing.controls-visible .vod-player-controls,
.vod-player.is-playing.controls-visible .vod-player-bottom,
.vod-player.is-playing.controls-visible .vod-player-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.vod-player.is-playing.controls-visible .vod-player-controls {
  transform: translate(-50%, -50%);
}

.vod-action {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 22, 32, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.vod-action .icon,
.vod-action .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
}

.vod-action.is-on .icon,
.vod-action.is-on .lucide {
  color: var(--accent-2);
}

/* Settings subpages */
#view-multiscreens,
#view-player,
#view-parental,
#view-support,
#view-legal,
#view-language {
  padding: 0;
  background: var(--panel);
}

.settings-subpage {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 28px;
  font-family: var(--font-ui);
  min-height: 0;
}

.settings-sub-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.settings-sub-titles h1 {
  font-family: var(--font-ui);
  font-size: var(--zen-title-size);
  font-weight: var(--zen-title-weight);
  color: #fff;
  line-height: 1.2;
}

.settings-sub-titles p {
  font-size: var(--zen-subtitle-size);
  color: var(--text-dim);
  margin-top: 2px;
}

.ms-options {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: center;
  min-height: 0;
}

#view-multiscreens .ms-options {
  flex: 0 0 auto;
}

.multiscreen-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  min-height: 0;
}

.multiscreen-live-pane {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #090b13;
}

.multiscreen-live-video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  background: #090b13;
}

.multiscreen-live-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(5, 7, 13, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.multiscreen-live-pane[data-state="error"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "Stream unavailable";
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.multiscreen-live-pane:nth-child(3):last-child {
  grid-column: 1 / -1;
}

.ms-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(36, 38, 52, 0.95) 0%, rgba(20, 22, 32, 0.98) 100%);
  color: #fff;
  font-family: var(--font-ui);
  cursor: pointer;
  min-height: 280px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ms-card:hover {
  border-color: rgba(135, 106, 255, 0.35);
  transform: translateY(-2px);
}

.ms-card.selected {
  border-color: rgba(157, 141, 255, 0.45);
  background: linear-gradient(180deg, rgba(58, 52, 92, 0.75) 0%, rgba(24, 26, 40, 0.98) 100%);
  box-shadow: 0 14px 36px rgba(135, 106, 255, 0.18);
}

.ms-grid {
  flex: 1;
  display: grid;
  gap: 10px;
  min-height: 200px;
}

.ms-grid-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.ms-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.ms-grid-3 .ms-pane:nth-child(3) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 50%;
}

.ms-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.ms-pane {
  background: rgba(10, 12, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  display: grid;
  place-items: center;
  min-height: 72px;
}

.ms-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
}

.ms-play .icon, .ms-play .lucide {
  margin-left: 2px;
}

.ms-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.settings-card.pulse {
  border-color: rgba(135, 106, 255, 0.55);
}

#view-playlist-type,
#view-player,
#view-support,
#view-legal,
#view-parental,
#view-language {
  padding: 0;
  background: #0d0f16;
}

.settings-sub-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  padding-top: 18px;
}

.settings-sub-footer.end {
  justify-content: flex-end;
}

.settings-action-btn {
  min-width: 132px;
  height: 42px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.settings-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.playlist-type-options {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 0;
}

.playlist-type-card {
  width: 168px;
  height: 168px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(42, 44, 58, 0.95) 0%, rgba(24, 26, 36, 0.98) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  font-family: var(--font-ui);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.playlist-type-card:hover {
  transform: scale(1.04);
}

.playlist-type-card.selected {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.playlist-type-card.selected::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

.playlist-type-ico {
  font-size: 42px;
  color: #fff;
  line-height: 1;
}

.playlist-type-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.settings-rows-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 96px;
  width: 100%;
  padding: 0 6px;
  align-content: center;
}

.settings-list-page .settings-sub-header {
  margin-bottom: 36px;
}

.settings-list-page .settings-rows-grid {
  max-width: 1040px;
  padding-left: 10px;
}

.settings-rows-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.parental-page {
  max-width: 560px;
}

.parental-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
}

.parental-list {
  width: 100%;
  max-width: 520px;
  gap: 0;
}

.settings-row-plain {
  grid-template-columns: 30px minmax(0, 1fr);
}

.age-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.settings-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button.settings-row:hover {
  opacity: 0.88;
}

.settings-row-ico {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.settings-row-label {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
}

.settings-row-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(170, 178, 198, 0.82);
  white-space: nowrap;
  margin-left: auto;
}

.settings-row-value > span {
  color: rgba(170, 178, 198, 0.82);
}

.settings-row-value .icon, .settings-row-value .lucide {
  font-size: 14px;
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.45);
}

.settings-row:not(button) {
  cursor: default;
}

.zen-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  display: inline-block;
  flex-shrink: 0;
  cursor: pointer;
  margin-left: auto;
}

.zen-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.zen-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease;
}

.zen-toggle span::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.zen-toggle input:checked + span {
  background: rgba(255, 255, 255, 0.22);
}

.zen-toggle input:checked + span::before {
  transform: translateX(18px);
}

.legal-page {
  max-width: 560px;
}

.legal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
}

.legal-block {
  margin: 0 0 64px;
}

.legal-block h2 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.legal-version {
  font-size: 14px;
  font-weight: 400;
  color: rgba(188, 194, 210, 0.78);
  margin-bottom: 18px;
}

.legal-copy {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(148, 156, 176, 0.72);
  max-width: 480px;
}

.legal-links {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.legal-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.legal-link:hover {
  opacity: 0.82;
}

.language-page {
  padding-top: 24px;
}

.language-header {
  margin-bottom: 28px;
  padding-left: 10px;
}

.language-header .settings-sub-titles h1 {
  font-size: 22px;
  font-weight: 700;
}

.language-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  padding: 0 10px;
  overflow: auto;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(8, auto);
  grid-auto-flow: column;
  gap: 4px 80px;
  width: 100%;
  max-width: 1020px;
}

.language-item,
.create-profile-lang-item {
  border: 0;
  background: transparent;
  color: rgba(230, 232, 240, 0.9);
  font-family: var(--font-ui);
  font-size: 14px;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--zen-field-radius);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.language-item:hover:not(.selected),
.create-profile-lang-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.language-item.selected,
.create-profile-lang-item.selected {
  background: var(--accent-soft);
  color: #fff;
  font-weight: 600;
}

.language-item.is-disabled {
  color: rgba(230, 232, 240, 0.42);
  cursor: not-allowed;
}

.language-footer {
  padding: 24px 10px 4px;
}

.language-page .settings-action-btn {
  min-width: 148px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none !important;
}

/* Compact/tablet layout */
@media (max-width: 1200px) {
  .live-header {
    display: none;
  }
}

/* Mobile-ish */
@media (max-width: 900px) {
  #app {
    padding: 0;
  }
  .app-shell {
    width: 100%;
    height: 100%;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .sidebar {
    order: 2;
    flex-direction: row;
    justify-content: space-around;
    padding: 8px 10px;
    border-right: 0;
    border-top: 1px solid var(--border);
  }
  .sidebar .logo,
  .sidebar .spacer,
  .nav-btn[data-nav="replay"],
  .profile-switch-wrap {
    display: none;
  }
  .nav-btn[data-nav="settings"] {
    display: grid;
  }
  .nav-btn[data-nav="profiles"] {
    display: none;
  }
  .nav-btn {
    width: 48px;
    height: 48px;
  }
  .live-header {
    display: none;
  }
  .live-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }
  .live-shell.epg-mode {
    grid-template-columns: 1fr;
  }
  .live-cats {
    grid-column: 1;
    grid-row: 1;
  }
  .live-main {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .live-epg {
    grid-column: 1;
    grid-row: 2;
  }
  .live-cats {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .live-channels {
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    flex: 1 1 auto;
  }
  .live-preview {
    min-height: 300px;
    height: 300px;
    flex: 0 0 300px;
    order: 0;
    border-top: 0;
    border-left: 0;
    z-index: 2;
    box-shadow:
      0 -28px 48px rgba(5, 6, 12, 0.9),
      inset 0 18px 24px rgba(5, 6, 12, 0.58),
      inset 0 1px 0 rgba(135, 106, 255, 0.08);
  }
  .live-preview::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 78px;
    background: linear-gradient(
      180deg,
      rgba(5, 6, 12, 0.92) 0%,
      rgba(5, 6, 12, 0.58) 34%,
      rgba(5, 6, 12, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
  }
  .live-now-title {
    font-size: 24px;
  }
  .live-player-info h2 {
    font-size: 20px;
  }
  .live-player-bottom {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .live-player-actions {
    justify-self: center;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}
