/* ==========================================================================
   SEFIROX DESIGN SYSTEM — EXACT 1:1 TESLA / CONNECTED CAR UI STYLESHEET
   ========================================================================== */

:root,
[data-theme="dark"] {
  --sfx-bg: #090710;
  --sfx-bg-2: #0f0b1b;
  --sfx-bg-3: #17122a;
  --sfx-card: #120e1f;
  --sfx-card-2: #1e1738;
  --sfx-line: rgba(200, 175, 255, 0.08);
  --sfx-line-strong: rgba(215, 185, 255, 0.22);
  --sfx-text: #f6f2ff;
  --sfx-muted: #9b90b8;
  --sfx-dim: #5d5377;
  --sfx-red: #ff3568;
  --sfx-violet: #c060ff;
  --sfx-pink: #ff60a8;
  --sfx-grad: linear-gradient(100deg, #ff3568, #c060ff);
  --sfx-gold: #f5c451;
  --sfx-online: #3fca82;
  --sfx-topbar-bg: rgba(9, 7, 16, 0.82);
  --sfx-fade: rgba(9, 7, 16, 0.96);
  --sfx-fade-mid: rgba(9, 7, 16, 0.78);
  --sfx-panel-top: rgba(30, 22, 56, 0.85);
  --sfx-panel-bot: rgba(15, 11, 27, 0.92);
  --sfx-chip-bg: rgba(255, 255, 255, 0.025);
  --sfx-chip-hover: rgba(255, 255, 255, 0.06);
  --sfx-input-bg: rgba(18, 14, 31, 0.88);
  --sfx-shadow: rgba(0, 0, 0, 0.55);
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --sfx-bg: #faf7ff;
  --sfx-bg-2: #f2ecff;
  --sfx-bg-3: #e7ddff;
  --sfx-card: #ffffff;
  --sfx-card-2: #f4eeff;
  --sfx-line: rgba(110, 60, 190, 0.12);
  --sfx-line-strong: rgba(140, 70, 220, 0.28);
  --sfx-text: #1a1033;
  --sfx-muted: #64548a;
  --sfx-dim: #9889bd;
  --sfx-red: #e81f58;
  --sfx-violet: #9333ea;
  --sfx-pink: #db2777;
  --sfx-grad: linear-gradient(100deg, #e81f58, #9333ea);
  --sfx-gold: #d97706;
  --sfx-online: #10b981;
  --sfx-topbar-bg: rgba(250, 247, 255, 0.85);
  --sfx-fade: rgba(26, 16, 51, 0.92);
  --sfx-fade-mid: rgba(26, 16, 51, 0.68);
  --sfx-panel-top: rgba(255, 255, 255, 0.95);
  --sfx-panel-bot: rgba(242, 236, 255, 0.95);
  --sfx-chip-bg: rgba(120, 60, 210, 0.05);
  --sfx-chip-hover: rgba(120, 60, 210, 0.11);
  --sfx-input-bg: rgba(255, 255, 255, 0.92);
  --sfx-shadow: rgba(90, 40, 160, 0.15);
}

[data-theme="oled"] {
  --sfx-bg: #000000;
  --sfx-bg-2: #050508;
  --sfx-bg-3: #0c0a12;
  --sfx-card: #07060c;
  --sfx-card-2: #120e1e;
  --sfx-topbar-bg: rgba(0, 0, 0, 0.92);
  --sfx-fade: rgba(0, 0, 0, 0.98);
  --sfx-fade-mid: rgba(0, 0, 0, 0.82);
}

[data-theme="graphite"] {
  --sfx-bg: #121316;
  --sfx-bg-2: #181a1f;
  --sfx-bg-3: #20232a;
  --sfx-card: #181a20;
  --sfx-card-2: #232730;
  --sfx-line: rgba(255, 255, 255, 0.08);
  --sfx-line-strong: rgba(255, 255, 255, 0.2);
  --sfx-red: #3b82f6;
  --sfx-violet: #60a5fa;
  --sfx-pink: #38bdf8;
  --sfx-grad: linear-gradient(100deg, #2563eb, #38bdf8);
  --sfx-topbar-bg: rgba(18, 19, 22, 0.88);
  --sfx-fade: rgba(18, 19, 22, 0.96);
  --sfx-fade-mid: rgba(18, 19, 22, 0.78);
  --sfx-panel-top: rgba(35, 39, 48, 0.9);
  --sfx-panel-bot: rgba(24, 26, 32, 0.95);
  --sfx-input-bg: rgba(24, 26, 32, 0.92);
}

[data-theme="ember"] {
  --sfx-bg: #0f0806;
  --sfx-bg-2: #180d0a;
  --sfx-bg-3: #24130e;
  --sfx-card: #160c09;
  --sfx-card-2: #281510;
  --sfx-red: #f97316;
  --sfx-violet: #ef4444;
  --sfx-pink: #fb923c;
  --sfx-grad: linear-gradient(100deg, #ef4444, #f59e0b);
  --sfx-topbar-bg: rgba(15, 8, 6, 0.88);
  --sfx-fade: rgba(15, 8, 6, 0.96);
  --sfx-fade-mid: rgba(15, 8, 6, 0.78);
  --sfx-panel-top: rgba(40, 21, 16, 0.9);
  --sfx-panel-bot: rgba(22, 12, 9, 0.95);
}

[data-theme="aurora"] {
  --sfx-bg: #050d10;
  --sfx-bg-2: #08161b;
  --sfx-bg-3: #0d2229;
  --sfx-card: #09181e;
  --sfx-card-2: #102a34;
  --sfx-red: #10b981;
  --sfx-violet: #06b6d4;
  --sfx-pink: #34d399;
  --sfx-grad: linear-gradient(100deg, #10b981, #06b6d4);
  --sfx-topbar-bg: rgba(5, 13, 16, 0.88);
  --sfx-fade: rgba(5, 13, 16, 0.96);
  --sfx-fade-mid: rgba(5, 13, 16, 0.78);
  --sfx-panel-top: rgba(16, 42, 52, 0.9);
  --sfx-panel-bot: rgba(9, 24, 30, 0.95);
}

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

html, body {
  min-height: 100%;
  background: var(--sfx-bg);
  color: var(--sfx-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ==========================================================================
   AMBIENT BACKGROUND & BEAMS
   ========================================================================== */
.sfx-root {
  background: var(--sfx-bg);
  color: var(--sfx-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

.sfx-beam {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 42% at 15% -6%, rgba(255, 53, 104, 0.26), transparent 62%),
    radial-gradient(ellipse 55% 45% at 88% 4%, rgba(196, 100, 255, 0.28), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 105%, rgba(140, 60, 255, 0.14), transparent 65%);
}

[data-theme="light"] .sfx-beam {
  background:
    radial-gradient(ellipse 60% 40% at 15% -6%, rgba(232, 31, 88, 0.10), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 4%, rgba(147, 51, 234, 0.12), transparent 60%);
}

[data-theme="oled"] .sfx-beam {
  opacity: 0.35;
}

.sfx-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--sfx-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--sfx-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 18%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 18%, #000 25%, transparent 75%);
  opacity: 0.5;
}

.sfx-wrap {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.sfx-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: var(--sfx-topbar-bg);
  border-bottom: 1px solid var(--sfx-line);
}

.sfx-topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

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

.sfx-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff3568 0%, #d946ef 55%, #8b5cf6 100%);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 28px rgba(217, 70, 239, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.sfx-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  background: var(--sfx-bg);
}

.sfx-mark svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
}

.sfx-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sfx-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--sfx-pink);
  padding: 3px 7px;
  border: 1px solid rgba(217, 70, 239, 0.38);
  border-radius: 4px;
  background: rgba(217, 70, 239, 0.1);
}

.sfx-telem {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--sfx-muted);
}

.sfx-telem-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sfx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sfx-online);
  box-shadow: 0 0 10px var(--sfx-online);
  animation: sfxPulse 2s ease-in-out infinite;
}

@keyframes sfxPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.sfx-nav-act {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sfx-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--sfx-line-strong);
  background: var(--sfx-chip-bg);
  color: var(--sfx-text);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
}

.sfx-btn:hover {
  background: var(--sfx-chip-hover);
  border-color: rgba(217, 70, 239, 0.45);
  transform: translateY(-1px);
}

.sfx-btn-primary {
  background: var(--sfx-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 24px rgba(217, 70, 239, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sfx-btn-primary:hover {
  box-shadow: 0 8px 30px rgba(217, 70, 239, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  background: var(--sfx-grad);
}

.sfx-btn-iptv {
  background: rgba(63, 202, 130, 0.14);
  border-color: rgba(63, 202, 130, 0.45);
  color: #3fca82;
}

.sfx-btn-iptv:hover {
  background: rgba(63, 202, 130, 0.24);
  border-color: #3fca82;
}

.sfx-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 9px;
  position: relative;
}

/* ==========================================================================
   HERO & TELEMETRY PANEL (EXACT SEFIROX LAYOUT)
   ========================================================================== */
.sfx-hero {
  padding: 36px 0 24px;
}

.sfx-hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: center;
}

.sfx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sfx-muted);
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--sfx-line-strong);
  border-radius: 999px;
  background: var(--sfx-chip-bg);
  margin-bottom: 18px;
}

.sfx-eyebrow .pill {
  background: var(--sfx-grad);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
}

.sfx-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.sfx-h1 .accent {
  background: linear-gradient(95deg, #ff3568 0%, #ff60a8 45%, #c060ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sfx-sub {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--sfx-muted);
  max-width: 56ch;
  margin: 0 0 22px;
}

.sfx-hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sfx-panel {
  position: relative;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(160deg, var(--sfx-panel-top), var(--sfx-panel-bot));
  border: 1px solid var(--sfx-line-strong);
  box-shadow: 0 24px 70px var(--sfx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sfx-panel::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(196, 100, 255, 0.25), transparent 65%);
  pointer-events: none;
}

.sfx-cnr {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--sfx-violet);
  opacity: 0.7;
}
.sfx-cnr.tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.sfx-cnr.tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.sfx-cnr.bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.sfx-cnr.br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

.sfx-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--sfx-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sfx-line);
  margin-bottom: 16px;
}

.sfx-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--sfx-line);
  position: relative;
}

.sfx-readout:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sfx-readout .lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--sfx-muted);
  text-transform: uppercase;
}

.sfx-readout .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.sfx-readout .val.grad {
  background: var(--sfx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   QUICK IPTV / M3U LINK BAR (ALWAYS ACCESSIBLE ON LANDING & DASHBOARD)
   ========================================================================== */
.sfx-iptv-quickbar {
  margin: 8px 0 20px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(30, 22, 56, 0.9), rgba(15, 11, 27, 0.95));
  border: 1px solid rgba(192, 96, 255, 0.32);
  box-shadow: 0 14px 40px var(--sfx-shadow);
}

.sfx-iptv-quickbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sfx-iptv-quickbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.sfx-iptv-quickbar-title .badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(63, 202, 130, 0.15);
  color: #3fca82;
  border: 1px solid rgba(63, 202, 130, 0.35);
  letter-spacing: 0.08em;
}

.sfx-iptv-quickbar-row {
  display: grid;
  grid-template-columns: 200px 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.sfx-iptv-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--sfx-line-strong);
  background: var(--sfx-input-bg);
  color: var(--sfx-text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sfx-iptv-input:focus {
  border-color: var(--sfx-violet);
  box-shadow: 0 0 0 3px rgba(196, 100, 255, 0.16);
}

.sfx-iptv-hint {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--sfx-muted);
}

/* ==========================================================================
   TOOLBAR, SEARCH & CATEGORY CHIPS
   ========================================================================== */
.sfx-toolbar {
  padding: 16px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sfx-toolbar-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sfx-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 11px;
  background: var(--sfx-chip-bg);
  border: 1px solid var(--sfx-line);
  flex-wrap: wrap;
  gap: 2px;
}

.sfx-tab {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--sfx-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sfx-tab.active {
  background: var(--sfx-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 70, 239, 0.35);
}

.sfx-tab .cnt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.sfx-search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

.sfx-search input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border-radius: 11px;
  border: 1px solid var(--sfx-line-strong);
  background: var(--sfx-input-bg);
  color: var(--sfx-text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.18s ease;
}

.sfx-search input::placeholder {
  color: var(--sfx-dim);
}

.sfx-search input:focus {
  border-color: var(--sfx-violet);
  box-shadow: 0 0 0 3px rgba(196, 100, 255, 0.15);
}

.sfx-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--sfx-dim);
  pointer-events: none;
}

.sfx-cats {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.sfx-cats::-webkit-scrollbar {
  display: none;
}

.sfx-cat {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--sfx-line);
  background: var(--sfx-chip-bg);
  color: var(--sfx-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.sfx-cat:hover {
  color: var(--sfx-text);
  border-color: var(--sfx-line-strong);
}

.sfx-cat.active {
  background: rgba(217, 70, 239, 0.16);
  color: var(--sfx-text);
  border-color: var(--sfx-violet);
  box-shadow: inset 0 0 16px rgba(196, 100, 255, 0.2);
}

/* ==========================================================================
   SECTION HEADER & 1:1 SQUARE CHANNEL CARDS (EXACT SEFIROX DESIGN)
   ========================================================================== */
.sfx-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sfx-line);
}

.sfx-sec-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sfx-sec-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--sfx-grad);
}

.sfx-sec-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--sfx-dim);
  text-transform: uppercase;
}

.sfx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  padding-bottom: 64px;
}

.sfx-card,
.sfx-dcard {
  group: card;
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, var(--sfx-card-2), var(--sfx-card) 72%);
  border: 1px solid var(--sfx-line);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.24s ease, box-shadow 0.24s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}

.sfx-card::before,
.sfx-dcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 53, 104, 0.14), transparent 45%, rgba(196, 100, 255, 0.14));
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.sfx-card:hover,
.sfx-dcard:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 70, 239, 0.5);
  box-shadow: 0 18px 40px var(--sfx-shadow), 0 0 28px rgba(196, 100, 255, 0.18);
}

.sfx-card:hover::before,
.sfx-dcard:hover::before {
  opacity: 1;
}

.sfx-glyph,
.sfx-dcard-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.3rem;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, rgba(246, 242, 255, 0.14), rgba(196, 100, 255, 0.05));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sfx-logo,
.sfx-dcard-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18% 16% 34%;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
  z-index: 1;
}

.sfx-card:hover .sfx-logo,
.sfx-dcard:hover .sfx-dcard-logo {
  transform: scale(1.06);
}

.sfx-badge,
.sfx-dcard-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(9, 7, 16, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f6f2ff;
}

.sfx-badge .d,
.sfx-dcard-badge .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sfx-online);
  box-shadow: 0 0 6px var(--sfx-online);
}

.sfx-fav,
.sfx-dcard-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 7, 16, 0.72);
  backdrop-filter: blur(8px);
  color: var(--sfx-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sfx-fav:hover,
.sfx-dcard-fav:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

.sfx-fav.on,
.sfx-dcard-fav.on {
  color: var(--sfx-gold);
  border-color: rgba(245, 196, 81, 0.45);
  background: rgba(245, 196, 81, 0.14);
}

.sfx-info,
.sfx-dcard-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 28px 11px 10px;
  background: linear-gradient(180deg, transparent, var(--sfx-fade-mid) 42%, var(--sfx-fade));
}

.sfx-info h3,
.sfx-dcard-info h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: #f6f2ff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sfx-info .epg-title,
.sfx-dcard-info .epg-title {
  font-size: 0.7rem;
  color: var(--sfx-online);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-weight: 500;
}

.sfx-info .cat-lbl,
.sfx-dcard-info .cat-lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: #9b90b8;
  text-transform: uppercase;
  margin-top: 2px;
}

.sfx-info .epg-bar,
.sfx-dcard-info .epg-bar {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sfx-info .epg-bar .track,
.sfx-dcard-info .epg-bar .track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.sfx-info .epg-bar .fill,
.sfx-dcard-info .epg-bar .fill {
  height: 100%;
  background: var(--sfx-grad);
  border-radius: 99px;
}

.sfx-info .epg-bar .t,
.sfx-dcard-info .epg-bar .t {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: #9b90b8;
  flex-shrink: 0;
}

/* ==========================================================================
   EMPTY STATE & ANNOUNCEMENT BANNER
   ========================================================================== */
.sfx-announce {
  margin-top: 16px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(192, 96, 255, 0.1);
  border: 1px solid rgba(192, 96, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}

.sfx-empty {
  text-align: center;
  padding: 48px 24px;
  border-radius: 18px;
  border: 1px dashed var(--sfx-line-strong);
  background: var(--sfx-chip-bg);
  margin-bottom: 48px;
}

.sfx-empty h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.sfx-empty p {
  color: var(--sfx-muted);
  max-width: 46ch;
  margin: 0 auto 20px;
  font-size: 0.92rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.sfx-foot {
  border-top: 1px solid var(--sfx-line);
  padding: 26px 0 36px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--sfx-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   DASHBOARD (/dashboard) & SOURCES (/dashboard/sources)
   ========================================================================== */
.sfx-dash {
  min-height: 100vh;
  background: var(--sfx-bg);
  color: var(--sfx-text);
  position: relative;
}

.sfx-dtop {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: var(--sfx-topbar-bg);
  border-bottom: 1px solid var(--sfx-line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sfx-dtop-l,
.sfx-dtop-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sfx-dtabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--sfx-chip-bg);
  border: 1px solid var(--sfx-line);
  gap: 3px;
  overflow-x: auto;
  max-width: 100%;
}

.sfx-dtab {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 8px 13px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--sfx-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sfx-dtab:hover {
  color: var(--sfx-text);
}

.sfx-dtab.active {
  background: var(--sfx-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 70, 239, 0.35);
}

.sfx-dtab.active-yt { background: linear-gradient(100deg, #ef4444, #dc2626); color: #fff; }
.sfx-dtab.active-tw { background: linear-gradient(100deg, #9333ea, #7e22ce); color: #fff; }
.sfx-dtab.active-kk { background: linear-gradient(100deg, #16a34a, #15803d); color: #fff; }
.sfx-dtab.active-nv { background: linear-gradient(100deg, #2563eb, #06b6d4); color: #fff; }

.sfx-dbody {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.sfx-dlayout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.sfx-dside {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--sfx-panel-top), var(--sfx-panel-bot));
  border: 1px solid var(--sfx-line);
  border-radius: 16px;
  padding: 12px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 86px;
}

.sfx-dside-h {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sfx-dim);
  padding: 6px 10px 10px;
}

.sfx-dcat {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sfx-muted);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.sfx-dcat:hover {
  background: var(--sfx-chip-hover);
  color: var(--sfx-text);
}

.sfx-dcat.active {
  background: rgba(217, 70, 239, 0.16);
  color: var(--sfx-text);
  border-color: var(--sfx-violet);
  font-weight: 600;
}

.sfx-dmain {
  flex: 1;
  min-width: 0;
}

.sfx-dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

/* ==========================================================================
   SOURCES & SETTINGS PAGE (/dashboard/sources) — 2-COLUMN SIDE-BY-SIDE FORMS
   ========================================================================== */
.sfx-sources-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 72px;
  position: relative;
  z-index: 1;
}

.sfx-sources-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 24px;
  align-items: start;
}

.sfx-addforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
}

.sfx-scard {
  background: linear-gradient(160deg, var(--sfx-panel-top), var(--sfx-panel-bot));
  border: 1px solid var(--sfx-line-strong);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 50px var(--sfx-shadow);
}

.sfx-scard h2,
.sfx-scard h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.sfx-field {
  margin-bottom: 12px;
}

.sfx-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sfx-muted);
  margin-bottom: 6px;
}

.sfx-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--sfx-line-strong);
  background: var(--sfx-input-bg);
  color: var(--sfx-text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sfx-input:focus {
  border-color: var(--sfx-violet);
  box-shadow: 0 0 0 3px rgba(196, 100, 255, 0.15);
}

.sfx-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--sfx-chip-bg);
  border: 1px solid var(--sfx-line);
  margin-bottom: 10px;
}

.sfx-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}

.sfx-theme-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--sfx-line);
  background: var(--sfx-chip-bg);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  color: var(--sfx-text);
}

.sfx-theme-card.active {
  border-color: var(--sfx-violet);
  background: rgba(192, 96, 255, 0.15);
  box-shadow: 0 0 20px rgba(192, 96, 255, 0.2);
}

/* ==========================================================================
   WATCH PLAYER (/watch/:id)
   ========================================================================== */
.sfx-watch {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sfx-watch-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sfx-watch-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.sfx-watch-stage video,
.sfx-watch-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sfx-watch-drawer {
  position: absolute;
  top: 72px;
  right: 20px;
  bottom: 24px;
  width: 330px;
  background: rgba(15, 11, 27, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid var(--sfx-line-strong);
  border-radius: 16px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   UI STYLE MODES (kull1: Dock, kull2: Split, kull3: Minimal)
   ========================================================================== */
.sfx-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(15, 11, 27, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--sfx-line-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   PIP NAVIGATION WIDGET
   ========================================================================== */
.sfx-pip-nav {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sfx-card);
  border: 1px solid var(--sfx-line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  z-index: 80;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.sfx-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(18, 14, 31, 0.95);
  border: 1px solid var(--sfx-violet);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .sfx-hero-grid {
    grid-template-columns: 1fr;
  }
  .sfx-telem {
    display: none;
  }
  .sfx-addforms,
  .sfx-sources-grid {
    grid-template-columns: 1fr;
  }
  .sfx-iptv-quickbar-row {
    grid-template-columns: 1fr;
  }
  .sfx-dlayout {
    flex-direction: column;
  }
  .sfx-dside {
    width: 100%;
    max-height: none;
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
  }
  .sfx-dside-h {
    display: none;
  }
  .sfx-dcat {
    width: auto;
    white-space: nowrap;
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .sfx-wrap {
    padding: 0 16px;
  }
  .sfx-grid,
  .sfx-dgrid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .sfx-wordmark .sfx-tag {
    display: none;
  }
}
