/* =========================================
   IPTV Player - Design System
   ========================================= */
:root {
  --bg:        #08090e;
  --bg2:       #0d0f1a;
  --panel:     #111422;
  --panel2:    #161928;
  --card:      #141726;
  --card-h:    #1b1f33;
  --line:      rgba(255,255,255,0.09);
  --line2:     rgba(255,255,255,0.05);
  --text:      #f0f2ff;
  --text-soft: #c5cbdf;
  --muted:     #8891b0;
  --accent:    #FF6B35;
  --accent2:   #E91E8C;
  --accent-g:  linear-gradient(135deg, #FF6B35, #E91E8C);
  --blue:      #4F8EF7;
  --gold:      #F5C542;
  --green:     #3ECF8E;
  --red:       #F85149;
  --shadow:    0 8px 40px rgba(0,0,0,0.5);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.3);
  --r-xl:  24px;
  --r-lg:  18px;
  --r-md:  12px;
  --r-sm:  8px;
}

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

html, body {
  min-height: 100%;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(255,107,53,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 100%, rgba(233,30,140,0.06) 0%, transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* =========================================
   APP SHELL
   ========================================= */
.app-shell {
  max-width: 1700px;
  margin: 0 auto;
  padding: 16px;
}

/* =========================================
   TOPBAR
   ========================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.brand-copy h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-accent {
  background: var(--accent-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-nav {
  display: flex;
  gap: 6px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.nav-btn:hover {
  background: var(--card-h);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.nav-btn.active {
  background: var(--accent-g);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

/* =========================================
   TAB SYSTEM
   ========================================= */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* =========================================
   LAYOUT
   ========================================= */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 400px;
  gap: 16px;
  align-items: start;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================
   PANEL BASE
   ========================================= */
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line2);
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* =========================================
   PLAYER PANEL
   ========================================= */
.player-panel {
  overflow: hidden;
}

.player-wrap {
  position: relative;
  background: #000;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
  min-height: 280px;
}

video {
  width: 100%;
  display: block;
  background: #000;
  max-height: 68vh;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px;
  background: linear-gradient(180deg, rgba(8,9,14,0.6), rgba(8,9,14,0.85));
}

.empty-icon {
  color: var(--muted);
  opacity: 0.5;
  margin-bottom: 4px;
}

.player-empty h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.player-empty p {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 420px;
}

.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.player-wrap:hover .player-top-bar {
  opacity: 1;
  pointer-events: all;
}

.channel-logo-overlay {
  display: flex;
  align-items: center;
}

.channel-logo-overlay img {
  height: 32px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
  border-radius: 4px;
}

.player-top-actions {
  display: flex;
  gap: 6px;
}

.overlay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  color: #fff;
  backdrop-filter: blur(8px);
  transition: 0.15s ease;
}

.overlay-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* Theater mode */
.theater-mode .layout {
  grid-template-columns: 1fr;
}
.theater-mode .sidebar {
  display: none;
}
.theater-mode video {
  max-height: 80vh;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.channel-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.channel-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.channel-logo-placeholder {
  font-size: 1.6rem;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.player-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 4px;
}

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

/* =========================================
   DETAILS PANEL
   ========================================= */
.details-panel {
  padding: 0;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  overflow: hidden;
}

.detail-item {
  background: var(--panel);
  padding: 14px 18px;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  word-break: break-all;
}

/* =========================================
   RECENT PANEL
   ========================================= */
.recent-panel {
  padding: 0;
}

.recent-list {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.recent-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.15s ease;
  width: 180px;
}

.recent-card:hover {
  background: var(--card-h);
  border-color: rgba(255,255,255,0.15);
}

.recent-card-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.recent-card-info {
  min-width: 0;
}

.recent-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-card-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   SIDEBAR / CHANNEL LIST
   ========================================= */
.sidebar { min-width: 0; }

.sidebar-panel {
  padding: 0;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--accent-g);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--panel2);
  border: 1px solid var(--line);
  transition: 0.15s ease;
}

.search-wrap:focus-within {
  border-color: rgba(255,107,53,0.5);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 11px 0;
  font-size: 0.9rem;
  outline: none;
}

.search-wrap input::placeholder { color: var(--muted); }

.search-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  transition: 0.15s;
}

.search-clear:hover { color: var(--text); }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 10px;
}

select {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238891b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select:focus {
  border-color: rgba(255,107,53,0.5);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 10px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.check-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.channel-list::-webkit-scrollbar { width: 4px; }
.channel-list::-webkit-scrollbar-track { background: transparent; }
.channel-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 0.14s ease;
  position: relative;
}

.channel-card:hover {
  background: var(--card-h);
}

.channel-card.active {
  background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(233,30,140,0.1));
  border: 1px solid rgba(255,107,53,0.3);
}

.channel-card.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-g);
}

.ch-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line2);
}

.ch-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.ch-info {
  flex: 1;
  min-width: 0;
}

.ch-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ch-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.ch-fav {
  font-size: 0.9rem;
  color: var(--gold);
  line-height: 1;
}

.ch-format {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(79,142,247,0.15);
  color: var(--blue);
  letter-spacing: 0.04em;
}

.ch-format.hls { background: rgba(62,207,142,0.15); color: var(--green); }
.ch-format.mp4 { background: rgba(79,142,247,0.15); color: var(--blue); }

.empty-list {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

.loading-indicator {
  text-align: center;
  color: var(--muted);
  padding: 30px;
  font-size: 0.88rem;
}

.loading-indicator::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--card-h);
  border-color: rgba(255,255,255,0.15);
}

.btn-primary {
  background: var(--accent-g);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.btn-primary:hover {
  opacity: 0.9;
  background: var(--accent-g);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: var(--card-h);
}

.btn-fav {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-fav.is-fav {
  background: rgba(245,197,66,0.12);
  border-color: rgba(245,197,66,0.4);
  color: var(--gold);
}

.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: 0.15s;
}

.text-btn:hover {
  color: var(--text);
  background: var(--card-h);
}

/* =========================================
   SOURCES PAGE
   ========================================= */
.sources-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.sources-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.sources-header p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Quick sources */
.quick-panel .panel-header {
  border-bottom: 1px solid var(--line2);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 16px 20px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.15s ease;
}

.quick-card:hover {
  background: var(--card-h);
  border-color: rgba(255,107,53,0.3);
  transform: translateY(-1px);
}

.quick-card.added {
  border-color: rgba(62,207,142,0.4);
  background: rgba(62,207,142,0.06);
  cursor: default;
  opacity: 0.7;
}

.quick-card-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.quick-card-info {
  min-width: 0;
}

.quick-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sources list */
.sources-main-panel .panel-header {
  border-bottom: 1px solid var(--line2);
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  transition: 0.14s ease;
  border-bottom: 1px solid var(--line2);
}

.source-item:last-child { border-bottom: none; }

.source-item:hover {
  background: rgba(255,255,255,0.02);
}

.source-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.source-status-dot.active {
  background: var(--green);
  box-shadow: 0 0 6px rgba(62,207,142,0.5);
}

.source-main {
  flex: 1;
  min-width: 0;
}

.source-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.source-meta {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-group-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(79,142,247,0.12);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.source-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.source-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.14s ease;
}

.source-action-btn:hover {
  background: var(--card-h);
  color: var(--text);
}

.source-action-btn.danger:hover {
  background: rgba(248,81,73,0.15);
  border-color: rgba(248,81,73,0.3);
  color: var(--red);
}

/* =========================================
   MODAL
   ========================================= */
dialog {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
}

dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.modal-inner {
  width: min(520px, 95vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line2);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.modal-close:hover {
  background: var(--card-h);
  color: var(--text);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
}

.form-label input,
.form-label select {
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: 0.15s;
  width: 100%;
}

.form-label input:focus,
.form-label select:focus {
  border-color: rgba(255,107,53,0.5);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.toggle-label input { display: none; }

.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  position: relative;
  transition: 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.2s;
}

.toggle-label input:checked + .toggle-track {
  background: linear-gradient(135deg, rgba(255,107,53,0.3), rgba(233,30,140,0.3));
  border-color: rgba(255,107,53,0.5);
}

.toggle-label input:checked + .toggle-track .toggle-thumb {
  background: var(--accent);
  left: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-color: rgba(62,207,142,0.4); }
.toast.error { border-color: rgba(248,81,73,0.4); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar-panel {
    position: static;
    max-height: none;
  }
  .channel-list {
    max-height: 50vh;
  }
}

@media (max-width: 600px) {
  .app-shell { padding: 10px; }
  .topbar { padding: 10px 14px; }
  .nav-btn span { display: none; }
  .nav-btn { padding: 9px 12px; }
  .brand-copy h1 { font-size: 1.1rem; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .player-meta { flex-direction: column; align-items: flex-start; }
  .form-two-col { grid-template-columns: 1fr; }
}
