:root {
  --bg-body: #070b14;
  --bg-surface: #0f172a;
  --bg-surface-2: #162038;
  --bg-surface-3: #1e293b;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --live: #ef4444;
  --live-soft: rgba(239, 68, 68, 0.16);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --purple: #8b5cf6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #60a5fa;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.mono {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--bg-surface-3);
  border-color: var(--border-strong);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-success {
  background: var(--success);
  border-color: transparent;
  color: #042f2e;
}
.btn-success:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}
.btn-warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-icon {
  padding: 6px 9px;
  min-width: 34px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-live {
  background: var(--live-soft);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}
.badge-live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseLive 1.6s infinite;
}
.badge-success {
  background: var(--success-soft);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
.badge-warning {
  background: var(--warning-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}
.badge-accent {
  background: var(--accent-soft);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ---------- Cards & Inputs ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #080e1c;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
}
.textarea {
  min-height: 76px;
  resize: vertical;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

/* ---------- Top Navbar (Public) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.84);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #ef4444);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}
.brand p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Public Web TV Layout ---------- */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}
.tv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}
.tv-grid.theater {
  grid-template-columns: 1fr;
}
@media (max-width: 1024px) {
  .tv-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Player Stage ---------- */
.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}
.player-overlay-top {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}
.player-status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.94));
  text-align: center;
  padding: 24px;
  z-index: 6;
}
.player-status-overlay.hidden {
  display: none;
}
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.92), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 7;
  transition: opacity 0.2s;
}
.player-btn {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.player-btn:hover {
  background: rgba(59, 130, 246, 0.65);
}
.volume-slider {
  width: 82px;
  accent-color: var(--accent);
}

/* ---------- Channel Sidebar ---------- */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
}
.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  width: 100%;
}
.channel-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface-3);
}
.channel-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(15, 23, 42, 0.9));
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}
.ch-logo-box {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background: #080e1c;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 800;
  color: #93c5fd;
}
.ch-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* ---------- Now Playing & EPG ---------- */
.now-bar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .now-bar {
    grid-template-columns: 1fr;
  }
}
.progress-track {
  height: 7px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #ef4444);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.epg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
}
.epg-row {
  display: grid;
  grid-template-columns: 112px 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
}
.epg-row.live {
  border-color: rgba(239, 68, 68, 0.55);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(15, 23, 42, 0.9));
}
.epg-thumb {
  width: 72px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  background: #080e1c;
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .epg-row {
    grid-template-columns: 90px 1fr;
  }
  .epg-thumb {
    display: none;
  }
}

/* ---------- Admin Layout ---------- */
.admin-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
}
.admin-sidebar {
  background: #0a1020;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
.admin-main {
  padding: 22px 26px;
  max-width: 1400px;
  width: 100%;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.kpi-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- 24-Hour Meter & Timeline ---------- */
.meter-box {
  background: linear-gradient(135deg, #0f172a, #111c33);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.meter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.meter-stat {
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.timeline-24h {
  position: relative;
  height: 44px;
  background: #060a13;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  direction: ltr;
}
.timeline-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 11px;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  z-index: 4;
}
.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  direction: ltr;
  font-family: var(--font-mono);
}

/* ---------- Scheduler Builder ---------- */
.scheduler-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1060px) {
  .scheduler-grid {
    grid-template-columns: 1fr;
  }
}
.slot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  margin-bottom: 8px;
}
.slot-item.dragging {
  opacity: 0.45;
  border-style: dashed;
}
.slot-item.exceeds {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

/* ---------- Logo Watermark Live Preview ---------- */
.watermark-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #1e3a5f, #090f1e);
  border: 1px solid var(--border-strong);
}
.watermark-preview-logo {
  position: absolute;
  pointer-events: none;
  max-height: 45%;
  object-fit: contain;
}

/* ---------- Upload Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  transition: all 0.16s;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Video Library Grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #060a13;
}
.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-dur-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(2, 6, 23, 0.85);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Modals & Toasts ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop.hidden {
  display: none;
}
.modal {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 390px;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.toast.ok {
  border-color: rgba(16, 185, 129, 0.55);
  color: #a7f3d0;
}
.toast.err {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

/* ---------- Login Screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 45%), var(--bg-body);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.code-box {
  background: #060a13;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  direction: ltr;
  overflow-x: auto;
  color: #93c5fd;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-console {
  background: #050811;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  direction: ltr;
  max-height: 360px;
  overflow-y: auto;
  color: #cbd5e1;
}

.hidden {
  display: none !important;
}

/* ---------- English LTR Public Channel Overrides ---------- */
html[dir="ltr"], html[dir="ltr"] body {
  direction: ltr;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
html[dir="ltr"] .channel-card {
  text-align: left;
}
html[dir="ltr"] .epg-row {
  grid-template-columns: 112px 72px 1fr auto;
}

/* ---------- Broadcast "UP NEXT" Lower-Right PiP Overlay ---------- */
.upnext-card {
  position: absolute;
  right: 20px;
  bottom: 64px;
  z-index: 12;
  width: min(440px, calc(100% - 28px));
  direction: ltr;
  text-align: left;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(10, 17, 34, 0.94), rgba(6, 10, 22, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.38);
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 28px rgba(59, 130, 246, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translate3d(28px, 18px, 0) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}
.upnext-card.visible {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.upnext-accent-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ef4444);
}
.upnext-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 6px;
}
.upnext-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.upnext-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulseLive 1.5s infinite;
}
.upnext-timing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  font-family: var(--font-mono);
}
.upnext-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
}
.upnext-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.upnext-body {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 11px;
  padding: 4px 12px 10px;
  align-items: stretch;
}
.upnext-body.no-poster {
  grid-template-columns: 1fr;
}
.upnext-poster-box {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #060a13;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  aspect-ratio: 2 / 3;
}
.upnext-poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upnext-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.upnext-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.upnext-preview-wrap img,
.upnext-preview-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upnext-preview-wrap video {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.upnext-preview-wrap video.playing {
  opacity: 1;
}
.upnext-preview-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.78);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.upnext-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.upnext-meta {
  font-size: 11px;
  color: #93c5fd;
  font-weight: 600;
}
.upnext-caption {
  padding: 8px 12px 10px;
  background: rgba(15, 23, 42, 0.78);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
}
.upnext-timer-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
}
.upnext-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  transform-origin: left center;
}
@media (max-width: 600px) {
  .upnext-card {
    right: 10px;
    bottom: 54px;
    width: calc(100% - 20px);
  }
  .upnext-body {
    grid-template-columns: 68px minmax(0, 1fr);
  }
}

