/* ===== Клон интерфейса smotrim.org (ТВ онлайн) ===== */
html.pl-theme-smotrim {
  --sm-bg: #0b0f17;
  --sm-bg2: #0a0c12;
  --sm-panel: #111726;
  --sm-border: rgba(255,255,255,.08);
  --sm-text: #e6e9ef;
  --sm-muted: #8b93a7;
  --sm-accent: #2f7dff;
  --sm-live: #e84a5f;
}
html.pl-theme-smotrim,
html.pl-theme-smotrim body,
body.pl-theme-smotrim {
  margin: 0 !important;
  font-family: Inter, Segoe UI, Arial, sans-serif !important;
  color: var(--sm-text) !important;
  background: linear-gradient(180deg, var(--sm-bg), var(--sm-bg2)) !important;
  background-attachment: scroll !important;
  min-height: 100vh !important;
}

/* Спрятать чужие темы / лишнее в шапке StreamLive */
html.pl-theme-smotrim .site-header .nav-links a:not(.pl-mode-switch a),
html.pl-theme-smotrim .top-nav-extra { opacity: .9; }

/* Brand в шапке */
html.pl-theme-smotrim .sm-org-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sm-border);
}
html.pl-theme-smotrim .sm-org-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}
html.pl-theme-smotrim .sm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--sm-text) !important;
}
html.pl-theme-smotrim .sm-brand__logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f75ff, #2f7dff);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(47,125,255,.35);
}
html.pl-theme-smotrim .sm-brand__title { font-weight: 700; font-size: 16px; }

/* Оболочка: sidebar | main | epg */
html.pl-theme-smotrim .sm-org-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}
html.pl-theme-smotrim.sm-has-epg .sm-org-shell,
html.pl-theme-smotrim body.sm-has-epg .sm-org-shell {
  grid-template-columns: 260px 1fr 300px;
}
@media (max-width: 1100px) {
  html.pl-theme-smotrim .sm-org-shell { grid-template-columns: 220px 1fr; }
  html.pl-theme-smotrim.sm-has-epg .sm-org-shell { grid-template-columns: 220px 1fr; }
  html.pl-theme-smotrim .sm-org-epg { order: 3; }
}
@media (max-width: 820px) {
  html.pl-theme-smotrim .sm-org-shell {
    display: flex !important;
    flex-direction: column;
  }
  html.pl-theme-smotrim .sm-org-main { order: 1; }
  html.pl-theme-smotrim .sm-org-epg { order: 2; }
  html.pl-theme-smotrim .sm-org-sidebar { order: 3; max-height: 40vh; }
}

/* Sidebar каналов — как на smotrim.org */
html.pl-theme-smotrim .sm-org-sidebar {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--sm-border);
  border-radius: 16px;
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
}
html.pl-theme-smotrim .sm-org-sidebar h2 {
  margin: 0;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--sm-border);
  font-size: 15px;
  font-weight: 700;
}
html.pl-theme-smotrim .sm-org-sidebar .sm-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sm-border);
}
html.pl-theme-smotrim .sm-org-sidebar .sm-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--sm-border);
  background: rgba(255,255,255,.05) !important;
  color: var(--sm-text) !important;
  outline: none;
}
html.pl-theme-smotrim .sm-channel-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  flex: 1;
}
html.pl-theme-smotrim .sm-channel-list li { border-radius: 12px; }
html.pl-theme-smotrim .sm-channel-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--sm-text) !important;
  text-decoration: none !important;
  border: 1px solid transparent;
  border-radius: 12px;
}
html.pl-theme-smotrim .sm-channel-list a:hover {
  background: rgba(255,255,255,.05);
}
html.pl-theme-smotrim .sm-channel-list li.active a,
html.pl-theme-smotrim .sm-channel-list a.active {
  outline: 1px solid var(--sm-accent);
  background: rgba(47,125,255,.1);
}
html.pl-theme-smotrim .sm-channel-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1a2235;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--sm-muted);
}
html.pl-theme-smotrim .sm-channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
html.pl-theme-smotrim .sm-channel-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
html.pl-theme-smotrim .sm-channel-cat {
  font-size: 12px;
  color: var(--sm-muted);
}
html.pl-theme-smotrim .sm-cat-title {
  padding: 10px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sm-muted);
  font-weight: 700;
}

/* Main */
html.pl-theme-smotrim .sm-org-main {
  min-width: 0;
}
html.pl-theme-smotrim .sm-org-main .container {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Player — 16:9 card */
html.pl-theme-smotrim .player-wrap,
html.pl-theme-smotrim #player-wrap,
html.pl-theme-smotrim .video-player,
html.pl-theme-smotrim .sm-player {
  background: #000 !important;
  border-radius: 16px !important;
  border: 1px solid var(--sm-border) !important;
  overflow: hidden !important;
  aspect-ratio: 16/9;
}
html.pl-theme-smotrim .live-badge {
  background: var(--sm-live) !important;
  color: #fff !important;
}

/* Карточки / плитки каталога как tiles */
html.pl-theme-smotrim .card,
html.pl-theme-smotrim .channel-card,
html.pl-theme-smotrim .video-card,
html.pl-theme-smotrim .catalog-item {
  background: rgba(255,255,255,.04) !important;
  border: 1px solid var(--sm-border) !important;
  border-radius: 14px !important;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
html.pl-theme-smotrim .card:hover,
html.pl-theme-smotrim .channel-card:hover {
  border-color: rgba(47,125,255,.45) !important;
  transform: translateY(-2px);
}

/* Сетка плиток на каталоге */
html.pl-theme-smotrim .sm-tiles,
html.pl-theme-smotrim .channels-grid,
html.pl-theme-smotrim .catalog-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 14px !important;
}
html.pl-theme-smotrim .sm-tile {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--sm-border);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html.pl-theme-smotrim .sm-tile:hover {
  border-color: var(--sm-accent);
}
html.pl-theme-smotrim .sm-tile-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #1a2235;
}
html.pl-theme-smotrim .sm-tile-name { font-weight: 700; font-size: 14px; }
html.pl-theme-smotrim .sm-tile-cat { font-size: 12px; color: var(--sm-muted); }

/* EPG column */
html.pl-theme-smotrim .sm-org-epg {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--sm-border);
  border-radius: 16px;
  overflow: hidden;
  max-height: 70vh;
  position: sticky;
  top: 64px;
}
html.pl-theme-smotrim .sm-org-epg h2 {
  margin: 0;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--sm-border);
  font-size: 15px;
}
html.pl-theme-smotrim .sm-org-epg .sm-epg-body {
  padding: 8px;
  overflow: auto;
  max-height: calc(70vh - 48px);
}
html.pl-theme-smotrim .sm-dual-epg {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
html.pl-theme-smotrim .sm-dual-epg .sm-epg-tabs button {
  background: transparent;
  border: 1px solid var(--sm-border);
  color: var(--sm-text);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  margin: 0 4px 8px 0;
}
html.pl-theme-smotrim .sm-dual-epg .sm-epg-tabs button.active {
  background: var(--sm-accent);
  border-color: var(--sm-accent);
  color: #fff;
}
html.pl-theme-smotrim .epg-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  font-size: 13px;
}
html.pl-theme-smotrim .epg-item:hover { background: rgba(255,255,255,.05); }
html.pl-theme-smotrim .epg-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sm-muted); }
html.pl-theme-smotrim .epg-item.now {
  outline: 1px solid var(--sm-accent);
  background: rgba(47,125,255,.08);
}

/* Таблицы / формы */
html.pl-theme-smotrim .schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
html.pl-theme-smotrim .schedule-table th,
html.pl-theme-smotrim .schedule-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--sm-border);
  text-align: left;
}
html.pl-theme-smotrim input,
html.pl-theme-smotrim textarea,
html.pl-theme-smotrim select {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--sm-border) !important;
  color: var(--sm-text) !important;
  border-radius: 10px !important;
}
html.pl-theme-smotrim .btn-primary,
html.pl-theme-smotrim a.btn-primary {
  background: var(--sm-accent) !important;
  border-color: var(--sm-accent) !important;
  color: #fff !important;
  border-radius: 10px !important;
}
html.pl-theme-smotrim a { color: #93c5fd !important; }

/* Mode switcher on-sm */
.pl-mode-switch a.on-sm {
  background: #2f7dff !important;
  color: #fff !important;
}

/* Скрыть старый огромный контейнер padding conflict */
html.pl-theme-smotrim body > .container:not(.sm-org-shell *) {
  /* content moved into shell by JS */
}
