/* ============================================================================
   AsiaStream UI System — Light-First Asian Minimal + Elephant Mascot Accent
   Inspired by sakuga-vfx (MIT): crisp ink borders, tactile spring press,
   charcoal contrast blocks (#0f172a), zero heavy laser/neon clutter.
   ============================================================================ */
:root {
  --as-bg: #f8fafc;
  --as-surface: #ffffff;
  --as-surface-2: #f1f5f9;
  --as-dark-block: #0f172a;
  --as-ink: #0f172a;
  --as-ink-muted: #475569;
  --as-border: #e2e8f0;
  --as-border-strong: #0f172a;
  --as-accent: #f97316;       /* Elephant Orange-Gold */
  --as-accent-2: #c026d3;     /* Elephant Magenta-Purple */
  --as-ok: #10b981;
  --as-err: #ef4444;
  --as-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --as-shadow-crisp: 3px 3px 0 #0f172a;
  --as-shadow-accent: 3px 3px 0 #f97316;
}

/* Crisp Sakuga-inspired Tactile Button */
.as-btn-sakuga {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  border: 2px solid #0f172a;
  box-shadow: 3px 3px 0 #0f172a;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 140ms cubic-bezier(0.22, 1, 0.36, 1), background-color 140ms ease;
  cursor: pointer;
}
.as-btn-sakuga:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #0f172a;
}
.as-btn-sakuga:active {
  transform: translate(2px, 2px) scale(0.98);
  box-shadow: 1px 1px 0 #0f172a;
}

/* Crisp Sakuga Pill / Badge (1080p, 480p, 18+, .MP4) */
.as-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.35;
  border: 1.5px solid #0f172a;
  box-shadow: 1.5px 1.5px 0 #0f172a;
  white-space: nowrap;
  transition: transform 120ms ease;
}
.as-badge-ext {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #9333ea;
  box-shadow: 1.5px 1.5px 0 #9333ea;
}
.as-badge-adult {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #dc2626;
  box-shadow: 1.5px 1.5px 0 #dc2626;
}
.as-badge-hd {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #0284c7;
  box-shadow: 1.5px 1.5px 0 #0284c7;
}
.as-badge-opt {
  background: #dcfce7;
  color: #15803d;
  border-color: #16a34a;
  box-shadow: 1.5px 1.5px 0 #16a34a;
}

/* Sakuga-style Toast */
.as-sakuga-toast {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #0f172a;
  box-shadow: 4px 4px 0 #0f172a;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: asToastPop 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.as-sakuga-toast.is-ok { border-color: #16a34a; box-shadow: 4px 4px 0 #16a34a; }
.as-sakuga-toast.is-err { border-color: #dc2626; box-shadow: 4px 4px 0 #dc2626; }
.as-sakuga-toast.is-warn { border-color: #ea580c; box-shadow: 4px 4px 0 #ea580c; }

@keyframes asToastPop {
  0% { opacity: 0; transform: translateY(-8px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sakuga-style Progress Bar */
.as-progress-track {
  width: 100%;
  height: 12px;
  background: #f1f5f9;
  border: 2px solid #0f172a;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 2px 2px 0 #0f172a;
}
.as-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #ec4899);
  border-right: 2px solid #0f172a;
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Harmonized Dark Contrast Block on White Canvas */
.as-contrast-block {
  background: #0f172a;
  color: #f8fafc;
  border: 2px solid #0f172a;
  border-radius: 18px;
  box-shadow: 0 18px 40px -15px rgba(15, 23, 42, 0.28);
}

/* Auth Modal (#authModal): Crisp Light-Sakuga Inputs, Close Button & Action Buttons */
#authModal > div {
  border: 2.5px solid #0f172a !important;
  box-shadow: 6px 6px 0 #0f172a !important;
}
#authModal input[type="text"],
#authModal input[type="email"],
#authModal input[type="password"],
#authModal input[type="number"] {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}
#authModal input:focus {
  background: #ffffff !important;
  border-color: #f97316 !important;
  box-shadow: 2px 2px 0 #f97316 !important;
}
#authModal input::placeholder { color: #64748b !important; }
#authModal button[onclick*="closeAuth"],
#authModal button[onclick*="authModal"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* Section Eyebrow Pills (e.g. POLICY & TERMS OF SERVICE, SUPERIOR ADVANTAGES, FAQ) */
body.light-theme main div.inline-flex.rounded-full[class*="bg-red-"],
body.light-theme main span.inline-flex.rounded-full[class*="bg-red-"],
body.light-theme main div.inline-block.rounded-full[class*="bg-red-"] {
  background: #fff7ed !important;
  color: #ea580c !important;
  border: 1.5px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* === Unified Light-Sakuga Auth Modal (#authModal / #modalLogin / #modalRegister / #modalForgot) === */
#authModal > div,
#modalLogin,
#modalRegister,
#modalForgot {
  border: 2.5px solid #0f172a !important;
  box-shadow: 6px 6px 0 #0f172a !important;
}
#authModal label,
#modalLogin label,
#modalRegister label,
#modalForgot label {
  color: #0f172a !important;
  font-weight: 700 !important;
}
#authModal input[type="text"],
#authModal input[type="email"],
#authModal input[type="password"],
#authModal input[type="number"],
#modalLogin input,
#modalRegister input,
#modalForgot input {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}
#authModal input::placeholder,
#modalLogin input::placeholder,
#modalRegister input::placeholder,
#modalForgot input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
#authModal button[onclick*="switchAuthView"] {
  background: #fff7ed !important;
  color: #c2410c !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
#authModal button[onclick*="switchAuthView"]:hover {
  background: #ffedd5 !important;
}
#btnLoginGetOtp,
#btnRegGetOtp {
  color: #ea580c !important;
  font-weight: 800 !important;
}
#authModal .text-amber-300,
#modalLogin .text-amber-300,
#modalRegister .text-amber-300,
#modalForgot .text-amber-300 {
  color: #b45309 !important;
  font-weight: 700 !important;
}
#authModal .bg-amber-500\/10,
#modalLogin .bg-amber-500\/10,
#modalRegister .bg-amber-500\/10,
#modalForgot .bg-amber-500\/10 {
  background: #fef3c7 !important;
  border: 2px solid #f59e0b !important;
}
#authModal .bg-\[\#0d1117\],
#modalLogin .bg-\[\#0d1117\],
#modalRegister .bg-\[\#0d1117\],
#modalForgot .bg-\[\#0d1117\] {
  background: #f8fafc !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
  color: #0f172a !important;
}
#authModal .bg-\[\#0d1117\] .text-white,
#authModal .bg-\[\#0d1117\] .text-gray-200,
#authModal .bg-\[\#0d1117\] .text-gray-300,
#modalRegister .bg-\[\#0d1117\] .text-white,
#modalRegister .bg-\[\#0d1117\] .text-gray-200,
#modalRegister .bg-\[\#0d1117\] .text-gray-300,
#modalForgot .bg-\[\#0d1117\] .text-white,
#modalForgot .bg-\[\#0d1117\] .text-gray-200,
#modalForgot .bg-\[\#0d1117\] .text-gray-300 {
  color: #0f172a !important;
  font-weight: 700 !important;
}
#authModal .bg-\[\#0d1117\] .text-gray-400,
#authModal .bg-\[\#0d1117\] .text-gray-500,
#modalRegister .bg-\[\#0d1117\] .text-gray-400,
#modalRegister .bg-\[\#0d1117\] .text-gray-500,
#modalForgot .bg-\[\#0d1117\] .text-gray-400,
#modalForgot .bg-\[\#0d1117\] .text-gray-500 {
  color: #475569 !important;
}

/* === Portal Light-Sakuga Comprehensive Contrast & Surface Fixes === */
body.light-theme {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* Override residual dark Tailwind surfaces in light-theme (keep map canvas dark) */
body.light-theme .bg-\[\#0b0f19\]:not(#networkMap):not(.network-map-container),
body.light-theme .bg-\[\#0d1117\]:not(#networkMap):not(.network-map-container),
body.light-theme .bg-\[\#161b22\]:not(#networkMap):not(.network-map-container),
body.light-theme .bg-gray-900:not(#networkMap):not(.network-map-container),
body.light-theme .bg-gray-950:not(#networkMap):not(.network-map-container),
body.light-theme .bg-slate-900:not(#networkMap):not(.network-map-container),
body.light-theme .bg-slate-950:not(#networkMap):not(.network-map-container) {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #0f172a !important;
  border-color: #0f172a !important;
}

/* High-contrast text overrides for faint pastel classes on light surfaces */
body.light-theme .text-amber-200,
body.light-theme .text-amber-300,
body.light-theme .text-yellow-200,
body.light-theme .text-yellow-300 {
  color: #b45309 !important;
}
body.light-theme .text-blue-200,
body.light-theme .text-blue-300,
body.light-theme .text-sky-200,
body.light-theme .text-sky-300,
body.light-theme .text-cyan-300 {
  color: #1d4ed8 !important;
}
body.light-theme .text-emerald-300,
body.light-theme .text-emerald-400,
body.light-theme .text-green-300 {
  color: #047857 !important;
}
body.light-theme .text-pink-200,
body.light-theme .text-pink-300,
body.light-theme .text-rose-200,
body.light-theme .text-rose-300 {
  color: #be185d !important;
}

/* Keep CSKH 24/7 Support Widget header text crisp white on red/orange gradient */
body.light-theme #cskhWidget .bg-gradient-to-r,
body.light-theme #cskhWidget [class*="from-red-"],
body.light-theme #supportWidgetHeader {
  color: #ffffff !important;
}
body.light-theme #cskhWidget .bg-gradient-to-r *,
body.light-theme #cskhWidget [class*="from-red-"] *,
body.light-theme #supportWidgetHeader * {
  color: #ffffff !important;
}

/* Prevent awkward wrapping in File Manager table headers & action buttons */
body.light-theme table th {
  white-space: nowrap !important;
}
body.light-theme table td button,
body.light-theme table td a {
  white-space: nowrap !important;
}

/* Fix #batchActionBar (.cyber-toolbar-card) in Light-Sakuga */
body.light-theme #batchActionBar,
body.light-theme .cyber-toolbar-card {
  background: #ffffff !important;
  background-image: none !important;
  border: 2px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme #batchActionBar .text-gray-300,
body.light-theme .cyber-toolbar-card .text-gray-300 {
  color: #0f172a !important;
}

/* Sakuga Upgrade for Quick Batch Action Buttons */
body.light-theme #batchActionBar .cyber-action-btn,
body.light-theme #batchActionBar #btnToggleToolbar {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 700 !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease !important;
}
body.light-theme #batchActionBar .cyber-action-btn:hover,
body.light-theme #batchActionBar #btnToggleToolbar:hover {
  background: #fff7ed !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme #batchActionBar .cyber-action-btn:active,
body.light-theme #batchActionBar #btnToggleToolbar:active {
  transform: translate(1px, 1px) !important;
  box-shadow: 1px 1px 0 #0f172a !important;
}

/* Sakuga Upgrade for Copy Iframe & Watch Buttons in Table */
body.light-theme table td button[onclick*="copyIframe"],
body.light-theme table td button[onclick*="Copy"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}
body.light-theme table td a[href*="/e/"],
body.light-theme table td button[onclick*="watch"],
body.light-theme table td button[onclick*="preview"] {
  background: #f97316 !important;
  color: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}

/* Unified Light-Sakuga Toast Notifications */
body.light-theme #toast,
body.light-theme #cyberToast,
body.light-theme .cyber-toast {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  font-weight: 700 !important;
}

/* Smooth continuous rotation for 24/7 Support ring */
@keyframes cskhSpinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.cskh-spin-ring {
  animation: cskhSpinRing 12s linear infinite !important;
  transform-origin: center center !important;
}

/* Light-Sakuga border & shadow for 24/7 Support Widget */
body.light-theme #liveChatBox {
  border: 2.5px solid #0f172a !important;
  box-shadow: 6px 6px 0 #0f172a !important;
}
body.light-theme #liveChatBox .rounded-2xl,
body.light-theme #liveChatBox .rounded-xl {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}

/* === Guides & Telegram Community Light-Sakuga Upgrade === */
body.light-theme #tab-guides .bg-gradient-to-r,
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%) !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 5px 5px 0 #0f172a !important;
}
body.light-theme #tab-guides a[href*="t.me"],
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) a,
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) button {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  font-weight: 800 !important;
}
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) a:first-child {
  background: #2563eb !important;
  color: #ffffff !important;
}
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) button,
body.light-theme div:has(> div > div > [data-i18n="guideHeroTitle"]) a:last-child:not(:first-child) {
  background: #ffffff !important;
  color: #0f172a !important;
}
body.light-theme #tab-guides .w-10.h-10,
body.light-theme #tab-guides .w-9.h-9,
body.light-theme #tab-guides .w-8.h-8 {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 900 !important;
}
body.light-theme #tab-guides code,
body.light-theme #tab-guides pre,
body.light-theme #tab-guides .font-mono.bg-black\/50,
body.light-theme #tab-guides .font-mono.bg-gray-900\/80,
body.light-theme #tab-guides .bg-black\/40 {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}

/* Force CSKH ring rotation even in lite-perf-mode & brighten CSKH button */
body.lite-perf-mode .cskh-spin-ring,
body.light-theme.lite-perf-mode .cskh-spin-ring {
  animation: cskhSpinRing 12s linear infinite !important;
}
body.light-theme #btnOpenLiveChat {
  background: linear-gradient(135deg, #f97316, #c026d3) !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme #btnOpenLiveChat img,
body.light-theme #btnOpenLiveChat .rounded-full {
  background-color: #ffffff !important;
}

/* === Video Player & Playlist Tab Light-Sakuga Upgrade === */
body.light-theme [id*="player"] .rounded-2xl:not(.aspect-video),
body.light-theme [id*="player"] .rounded-3xl:not(.aspect-video),
body.light-theme div:has(> div > div > [onclick*="refreshPreviewPlaylist"]) {
  background: #ffffff !important;
  background-image: none !important;
  border: 2px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme [id*="player"] .rounded-xl:not(.aspect-video):not(button):not(a):not(input):not(select) {
  background: #f8fafc !important;
  background-image: none !important;
  border: 2px solid #0f172a !important;
  color: #0f172a !important;
}
body.light-theme [id*="player"] .text-white:not(button):not(button *),
body.light-theme [id*="player"] .text-gray-200,
body.light-theme [id*="player"] .text-gray-300 {
  color: #0f172a !important;
}
body.light-theme [id*="player"] .text-gray-400,
body.light-theme [id*="player"] .text-gray-500 {
  color: #475569 !important;
}
body.light-theme [id*="player"] button,
body.light-theme [id*="player"] a {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* Fix Playlist sidebar card, Open New Tab button, and Cinema Frame in Video Player & Playlist */
body.light-theme div:has(> div > #playlistSearchInput),
body.light-theme div:has(> #playlistSearchInput) {
  background: #ffffff !important;
  background-image: none !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme div:has(> div > #playlistSearchInput) .text-white,
body.light-theme div:has(> #playlistSearchInput) .text-white,
body.light-theme div:has(> #playlistSearchInput) .text-gray-200,
body.light-theme div:has(> #playlistSearchInput) .text-gray-300 {
  color: #0f172a !important;
}
body.light-theme a[target="_blank"]:has([data-feather="external-link"]),
body.light-theme button:has([data-feather="external-link"]) {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}
body.light-theme .aspect-video {
  border: 2.5px solid #0f172a !important;
  box-shadow: 5px 5px 0 #0f172a !important;
}

/* Final contrast polish for Playlist header, item titles, and Open New Tab button */
body.light-theme [id*="player"] .bg-\[\#111622\],
body.light-theme [id*="player"] .bg-\[\#0d1117\]\/90,
body.light-theme [id*="player"] .bg-\[\#161b22\]\/90,
body.light-theme [id*="player"] .bg-gray-800,
body.light-theme [id*="player"] .bg-slate-800 {
  background: #ffffff !important;
  background-image: none !important;
  color: #0f172a !important;
}
body.light-theme [id*="player"] .text-gray-100,
body.light-theme [id*="player"] .text-slate-100,
body.light-theme [id*="player"] .text-slate-200,
body.light-theme [id*="player"] .text-slate-300 {
  color: #0f172a !important;
}
body.light-theme [id*="player"] a[target="_blank"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* === Edge Gateways & Benchmark Map Light-Sakuga Upgrade === */
body.light-theme #networkMap,
body.light-theme .network-map-container {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%) !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 5px 5px 0 #0f172a !important;
}
body.light-theme #networkMap svg path[fill]:not([fill="none"]),
body.light-theme .network-map-container svg path[fill]:not([fill="none"]) {
  fill: #dbeafe !important;
  stroke: #93c5fd !important;
}
body.light-theme #networkMap .backdrop-blur-md,
body.light-theme .network-map-container .backdrop-blur-md {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme #networkMap .backdrop-blur-md *,
body.light-theme .network-map-container .backdrop-blur-md * {
  color: #0f172a !important;
}

/* Target exact Portal Edge Map container via #portalTooltipSpeed */
body.light-theme div:has(> div > div > #portalTooltipSpeed),
body.light-theme div:has(> div > #portalTooltipSpeed) {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%) !important;
  border: 2.5px solid #0f172a !important;
  box-shadow: 5px 5px 0 #0f172a !important;
}
body.light-theme div:has(> div > div > #portalTooltipSpeed) svg path[fill]:not([fill="none"]) {
  fill: #dbeafe !important;
  stroke: #93c5fd !important;
}
body.light-theme div:has(> #portalTooltipSpeed) {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme div:has(> #portalTooltipSpeed) * {
  color: #0f172a !important;
}

/* Fix dark continent SVG paths & Live Network Mesh pill in Portal Edge Map */
body.light-theme svg path[fill="#1e293b"],
body.light-theme svg path[fill="#0f172a"],
body.light-theme svg path[fill="#111827"],
body.light-theme svg path[fill="#0d1117"],
body.light-theme svg path[fill="#161b22"] {
  fill: #dbeafe !important;
  stroke: #64748b !important;
  stroke-width: 1.5 !important;
}
body.light-theme div:has(> #portalTooltipSpeed) ~ div,
body.light-theme div:has(> div > #portalTooltipSpeed) .bg-\[\#0b0f19\]\/90,
body.light-theme div:has(> div > #portalTooltipSpeed) .bg-\[\#0d1117\]\/90 {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme div:has(> #portalTooltipSpeed) ~ div * {
  color: #0f172a !important;
}

/* Sakuga Button Style for Select This Gateway */
body.light-theme button[onclick*="selectGateway"],
body.light-theme button[onclick*="Gateway"] {
  background: #fff7ed !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  border-radius: 0.75rem !important;
  font-weight: 800 !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease !important;
}
body.light-theme button[onclick*="selectGateway"]:hover,
body.light-theme button[onclick*="Gateway"]:hover {
  background: #ffedd5 !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}

/* Fix Live Network Mesh pill at bottom-right of Portal Edge Map */
body.light-theme div:has(> .bg-emerald-400.animate-ping) {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  color: #0f172a !important;
}
body.light-theme div:has(> .bg-emerald-400.animate-ping) * {
  color: #0f172a !important;
}

/* Fix Guides Step 3 iframe code box */
body.light-theme div:has(> [data-i18n="guideStep3Embed"]) .font-mono,
body.light-theme [data-i18n="guideStep3Embed"] ~ .font-mono,
body.light-theme [data-i18n="guideStep3Embed"] + div {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}

/* Sakuga Upgrade for Premium & Bandwidth Tab */
body.light-theme [id*="premium"] .rounded-2xl,
body.light-theme [id*="premium"] .rounded-xl:not(button):not(a) {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme [id*="premium"] button {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 700 !important;
}

/* Sakuga Upgrade for Remote Upload Tab */
body.light-theme [id*="remote"] .rounded-2xl,
body.light-theme [id*="remote"] .rounded-xl:not(button):not(a):not(input):not(select):not(textarea) {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme [id*="remote"] textarea,
body.light-theme [id*="remote"] select,
body.light-theme [id*="remote"] input {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}
body.light-theme [id*="remote"] button,
body.light-theme [id*="remote"] a[download] {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}

/* Sakuga Upgrade for Revenue Reports & Dashboard Analytics Tabs */
body.light-theme [id*="report"] .rounded-2xl,
body.light-theme [id*="report"] .rounded-xl:not(button):not(a):not(input):not(select),
body.light-theme [id*="dashboard"] .rounded-2xl,
body.light-theme [id*="dashboard"] .rounded-xl:not(button):not(a):not(input):not(select) {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme [id*="report"] button,
body.light-theme [id*="report"] input,
body.light-theme [id*="dashboard"] button,
body.light-theme [id*="dashboard"] input {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* Universal Light-Sakuga Card Borders & Hover Lift across all Portal <main> tabs */
body.light-theme main .rounded-2xl:not(.aspect-video) {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}
body.light-theme main .rounded-2xl:not(.aspect-video):hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 4px 4px 0 #0f172a !important;
}

/* Fix dark checkbox rows in Settings -> Default Video Quality & Compression */
body.light-theme main label.rounded-xl,
body.light-theme main label.rounded-lg {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}
body.light-theme main label.rounded-xl span,
body.light-theme main label.rounded-lg span {
  color: #0f172a !important;
}

/* Portal Edge Map continents (<g class="map-continents" fill="#111a2e">) -> light */
body.light-theme .map-continents,
body.light-theme .map-continents path {
  fill: #dbeafe !important;
  stroke: #94a3b8 !important;
  opacity: 1 !important;
}

/* ===== Global Light-Sakuga Scrollbar (all pages, all scroll containers) ===== */
html {
  scrollbar-color: #f97316 #f1f5f9;
  scrollbar-width: auto;
}
* { scrollbar-color: #f97316 #f1f5f9; }
::-webkit-scrollbar,
body.light-theme ::-webkit-scrollbar {
  width: 12px !important;
  height: 12px !important;
}
::-webkit-scrollbar-track,
body.light-theme ::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-left: 2px solid #0f172a !important;
}
::-webkit-scrollbar-thumb,
body.light-theme ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f97316 0%, #c026d3 100%) !important;
  border: 2px solid #0f172a !important;
  border-radius: 999px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35) !important;
}
::-webkit-scrollbar-thumb:hover,
body.light-theme ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ea580c 0%, #a21caf 100%) !important;
}
::-webkit-scrollbar-thumb:active,
body.light-theme ::-webkit-scrollbar-thumb:active {
  background: #0f172a !important;
}
::-webkit-scrollbar-corner { background: #f1f5f9 !important; }
/* Thinner scrollbars for inner panels (tables, lists, modals) */
main *::-webkit-scrollbar,
aside *::-webkit-scrollbar,
[role="dialog"] *::-webkit-scrollbar,
.table-scroll-wrap::-webkit-scrollbar,
.file-table-viewport::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}
main *::-webkit-scrollbar-track,
aside *::-webkit-scrollbar-track,
.table-scroll-wrap::-webkit-scrollbar-track,
.file-table-viewport::-webkit-scrollbar-track {
  border-left: 0 !important;
  border-radius: 999px !important;
}
main *::-webkit-scrollbar-thumb,
aside *::-webkit-scrollbar-thumb,
.table-scroll-wrap::-webkit-scrollbar-thumb,
.file-table-viewport::-webkit-scrollbar-thumb {
  border-width: 1.5px !important;
}

/* Reading progress bar (top) */
#asScrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #f97316, #c026d3);
  z-index: 2147482000; pointer-events: none;
  box-shadow: 0 1px 0 #0f172a;
  transition: width 80ms linear;
}

/* ===== Light-only: hide every theme switch button ===== */
#btnThemeToggleMain,
#themeToggleBtn,
.theme-toggle-btn,
#landingThemeToggle,
#btnLandingTheme,
button[onclick*="toggleTheme"],
button[onclick*="toggleLandingTheme"] {
  display: none !important;
}

/* ===== Breadcrumb (Root Library / folders) ===== */
body.light-theme #breadcrumbContainer { gap: 6px !important; margin-top: 2px; }
body.light-theme #breadcrumbContainer > span:not(.text-gray-600) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  border-radius: 999px !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease !important;
}
body.light-theme #breadcrumbContainer > span:first-child {
  background: #fff7ed !important;
  color: #c2410c !important;
}
body.light-theme #breadcrumbContainer > span[onclick]:hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  background: #ffedd5 !important;
}
body.light-theme #breadcrumbContainer > span:last-child:not(:first-child) {
  background: #0f172a !important;
  color: #ffffff !important;
}
body.light-theme #breadcrumbContainer > span:last-child:not(:first-child) * { color: #ffffff !important; }
body.light-theme #breadcrumbContainer > .text-gray-600 { color: #0f172a !important; font-weight: 900 !important; }

/* ===== All Portal modals (subtitle, get links, clone, folder, move...) ===== */
body.light-theme .fixed.inset-0[id$="Modal"] {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(4px) !important;
}
body.light-theme .fixed.inset-0[id$="Modal"] > div {
  background: #ffffff !important;
  border: 2.5px solid #0f172a !important;
  border-radius: 20px !important;
  box-shadow: 7px 7px 0 #0f172a !important;
  backdrop-filter: none !important;
  color: #0f172a !important;
}
/* Semi-transparent dark surfaces inside modals (bg-[#xxx]/80 etc.) */
body.light-theme [id$="Modal"] [class*="bg-[#0d1117]"],
body.light-theme [id$="Modal"] [class*="bg-[#161b22]"],
body.light-theme [id$="Modal"] [class*="bg-[#0b0f19]"],
body.light-theme [id$="Modal"] [class*="bg-[#131926]"],
body.light-theme [id$="Modal"] [class*="bg-gray-900"],
body.light-theme [id$="Modal"] [class*="bg-gray-800"] {
  background: #f8fafc !important;
  background-image: none !important;
  color: #0f172a !important;
}
/* Modal header & footer bars */
body.light-theme .fixed.inset-0[id$="Modal"] > div > div:first-child {
  background: linear-gradient(90deg, #fff7ed 0%, #faf5ff 100%) !important;
  border-bottom: 2px solid #0f172a !important;
}
body.light-theme .fixed.inset-0[id$="Modal"] > div > div:last-child:not(:first-child) {
  background: #ffffff !important;
  border-top: 2px solid #0f172a !important;
}
body.light-theme [id$="Modal"] h3,
body.light-theme [id$="Modal"] .text-white:not(button):not(button *),
body.light-theme [id$="Modal"] .text-gray-200,
body.light-theme [id$="Modal"] .text-gray-300 {
  color: #0f172a !important;
}
body.light-theme [id$="Modal"] .text-gray-400,
body.light-theme [id$="Modal"] .text-gray-500 { color: #475569 !important; }
body.light-theme [id$="Modal"] .text-indigo-200\/80,
body.light-theme [id$="Modal"] .text-indigo-200,
body.light-theme [id$="Modal"] .text-indigo-300,
body.light-theme [id$="Modal"] .text-indigo-400 {
  color: #4338ca !important;
}
/* Info / tip boxes inside modals */
body.light-theme [id$="Modal"] [class*="bg-indigo-500/10"],
body.light-theme [id$="Modal"] [class*="bg-blue-500/10"],
body.light-theme [id$="Modal"] [class*="bg-emerald-500/10"],
body.light-theme [id$="Modal"] [class*="bg-amber-500/10"] {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
body.light-theme [id$="Modal"] [class*="bg-indigo-500/10"] { background: #eef2ff !important; }
/* Drop zones */
body.light-theme [id$="Modal"] .border-dashed {
  background: #ffffff !important;
  border: 2px dashed #0f172a !important;
}
body.light-theme [id$="Modal"] .border-dashed:hover { background: #fff7ed !important; }
/* Inputs & selects inside modals */
body.light-theme [id$="Modal"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.light-theme [id$="Modal"] select,
body.light-theme [id$="Modal"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  border-radius: 12px !important;
  box-shadow: 2px 2px 0 #e2e8f0 !important;
}
/* Buttons inside modals */
body.light-theme [id$="Modal"] button:not([onclick*="closeModal"]):not(.as-toast-x),
body.light-theme [id$="Modal"] a[class*="rounded"] {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
  transition: transform .12s ease, box-shadow .12s ease !important;
}
body.light-theme [id$="Modal"] button:not([onclick*="closeModal"]):hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
/* Footer "Cancel" style buttons in modals */
body.light-theme [id$="Modal"] button.bg-gray-800 {
  background: #ffffff !important;
  color: #0f172a !important;
}
/* Close (X) buttons */
body.light-theme [id$="Modal"] button[onclick*="closeModal"]:not([data-i18n]) {
  width: 32px; height: 32px;
  display: inline-flex !important; align-items: center; justify-content: center;
  background: #ffffff !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; border-radius: 10px !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
body.light-theme [id$="Modal"] button[onclick*="closeModal"]:not([data-i18n]):hover {
  background: #0f172a !important; color: #ffffff !important;
}

/* ===== Modal detail fixes: thumbnail, audio, move ===== */
/* Dark tinted gradient boxes (from-red-950/30 ...) */
body.light-theme [id$="Modal"] [class*="from-red-950"],
body.light-theme [id$="Modal"] [class*="from-orange-950"],
body.light-theme [id$="Modal"] [class*="from-indigo-950"],
body.light-theme [id$="Modal"] [class*="from-slate-900"],
body.light-theme [id$="Modal"] [class*="from-gray-900"] {
  background: #fff7ed !important;
  background-image: none !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme [id$="Modal"] .text-orange-300,
body.light-theme [id$="Modal"] .text-orange-400 { color: #c2410c !important; }
body.light-theme [id$="Modal"] .text-amber-200\/80,
body.light-theme [id$="Modal"] .text-amber-200,
body.light-theme [id$="Modal"] .text-amber-300 { color: #92400e !important; }
body.light-theme [id$="Modal"] .text-cyan-300,
body.light-theme [id$="Modal"] .text-cyan-400 { color: #0e7490 !important; }
body.light-theme [id$="Modal"] .text-yellow-400 { color: #ca8a04 !important; }
/* Amber tip box */
body.light-theme [id$="Modal"] [class*="bg-amber-500/10"] { background: #fffbeb !important; }
/* Inline code chips */
body.light-theme [id$="Modal"] code,
body.light-theme main code {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1.5px solid #0f172a !important;
  border-radius: 6px !important;
  padding: 1px 6px !important;
}
/* Secondary dark buttons (#21262d, gray-700) */
body.light-theme [id$="Modal"] [class*="bg-[#21262d]"],
body.light-theme [id$="Modal"] button.bg-gray-700,
body.light-theme [id$="Modal"] button.bg-gray-600 {
  background: #ffffff !important;
  color: #0f172a !important;
}
body.light-theme [id$="Modal"] [class*="bg-[#21262d]"]:hover,
body.light-theme [id$="Modal"] button.bg-gray-700:hover { background: #fff7ed !important; }
/* Toggle chip "Open Video Player" */
body.light-theme [id$="Modal"] [class*="bg-orange-600/20"] {
  background: #fff7ed !important;
  color: #c2410c !important;
}
/* Audio / any dashed drop zone text */
body.light-theme [id$="Modal"] .border-dashed .text-white,
body.light-theme [id$="Modal"] .border-dashed p { color: #0f172a !important; }
/* Video frame inside modal */
body.light-theme [id$="Modal"] .aspect-video {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
/* Move modal folder tree */
body.light-theme #moveTree > * {
  border-radius: 12px !important;
  border: 2px solid transparent !important;
  color: #0f172a !important;
  opacity: 1 !important;
  transition: background-color .12s ease, border-color .12s ease, transform .12s ease !important;
}
body.light-theme #moveTree > *:hover {
  background: #fff7ed !important;
  border-color: #0f172a !important;
  transform: translateX(2px) !important;
}
body.light-theme #moveTree [class*="bg-yellow-500/"],
body.light-theme #moveTree [class*="bg-amber-500/"],
body.light-theme #moveTree .selected,
body.light-theme #moveTree [aria-selected="true"] {
  background: #fef3c7 !important;
  border-color: #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
body.light-theme #moveTree .opacity-40,
body.light-theme #moveTree .opacity-50,
body.light-theme #moveTree .text-gray-500,
body.light-theme #moveTree .text-gray-600 {
  opacity: 1 !important;
  color: #64748b !important;
}

/* ===== Remaining custom dark hex surfaces anywhere in Portal main / modals ===== */
body.light-theme main [class*="bg-[#121722]"],
body.light-theme main [class*="bg-[#161c2a]"],
body.light-theme main [class*="bg-[#1c2333]"],
body.light-theme main [class*="bg-[#252f45]"],
body.light-theme main [class*="bg-[#0b0f17]"],
body.light-theme main [class*="bg-[#090c12]"],
body.light-theme main [class*="bg-[#111622]"],
body.light-theme main [class*="bg-[#11151e]"],
body.light-theme main [class*="bg-[#131926]"],
body.light-theme main [class*="bg-[#21262d]"],
body.light-theme main [class*="bg-[#30363d]"],
body.light-theme main [class*="bg-[#0d1424]"]:not(#portalMapTooltip),
body.light-theme main [class*="bg-[#1e293b]"],
body.light-theme main [class*="bg-[#161b22]"],
body.light-theme main [class*="bg-[#0d1117]"],
body.light-theme main [class*="bg-[#0b0f19]"] {
  background: #ffffff !important;
  background-image: none !important;
  color: #0f172a !important;
  border-color: #0f172a !important;
}
/* inner rows/cards inside those panels get soft fill */
body.light-theme main [class*="bg-[#0b0f17]"],
body.light-theme main [class*="bg-[#090c12]"],
body.light-theme main [class*="bg-[#161c2a]"] {
  background: #f8fafc !important;
}

/* ===== Video Player & Playlist specifics ===== */
body.light-theme #btnPreviewOpenTab {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}
body.light-theme #btnPreviewOpenTab:hover { background: #fff7ed !important; }
body.light-theme #btnPreviewOpenTab svg { color: #0e7490 !important; }
body.light-theme #btnPreviewCopyIframe {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}
body.light-theme [data-i18n="playerPlaylistTitle"] { color: #0f172a !important; }
body.light-theme #previewPlaylistCountBadge {
  background: #ffe4e6 !important;
  color: #be123c !important;
  border: 2px solid #0f172a !important;
}
body.light-theme #previewMetaExt {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1.5px solid #0f172a !important;
}
body.light-theme #previewVideoTitle,
body.light-theme #previewMetaSize,
body.light-theme #previewMetaDate { color: #0f172a !important; }
body.light-theme #previewMetaViews { color: #047857 !important; }
body.light-theme #previewEmbedUrlInput {
  background: #f8fafc !important;
  color: #1d4ed8 !important;
  border: 2px solid #0f172a !important;
}
body.light-theme button[onclick="copyCurrentPreviewUrl()"] {
  padding: 3px 10px !important;
  background: #ecfeff !important;
  color: #0e7490 !important;
  border: 2px solid #0f172a !important;
  border-radius: 999px !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
}
/* playlist number squares (bg-[#161c2a] text-gray-400) */
body.light-theme main .w-9.h-9.rounded-lg.font-mono {
  border: 2px solid #0f172a !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}
body.light-theme main .w-9.h-9.rounded-lg.font-mono.bg-rose-600 {
  background: #e11d48 !important;
  color: #ffffff !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}

/* =====================================================================
   API Integration (#section-api) — Sakuga-VFX docs styling
   ===================================================================== */
body.light-theme #section-api { background: #f8fafc !important; }
body.light-theme #section-api > div:first-child {
  background: #ffffff !important;
  border-bottom: 2.5px solid #0f172a !important;
}
body.light-theme #section-api h2 { color: #0f172a !important; font-weight: 900 !important; }
body.light-theme #section-api h2 + p,
body.light-theme #section-api [data-i18n="apiHeaderSub"] { color: #475569 !important; }
/* { } badge + v1.0 Live */
body.light-theme #section-api > div:first-child .w-10.h-10 {
  background: #f3e8ff !important; color: #7e22ce !important;
  border: 2px solid #0f172a !important; box-shadow: 2px 2px 0 #0f172a !important;
}
body.light-theme #section-api h2 > span {
  background: #dcfce7 !important; color: #15803d !important;
  border: 2px solid #0f172a !important; font-weight: 800 !important;
}
/* API key pill */
body.light-theme #section-api > div:first-child > div:last-child {
  background: #fffbeb !important;
  border: 2px solid #0f172a !important;
  border-radius: 14px !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme #section-api > div:first-child > div:last-child > span { color: #0f172a !important; font-weight: 800 !important; }
body.light-theme #headerApiKeyBadge {
  background: #ffffff !important; color: #047857 !important;
  border: 1.5px solid #0f172a !important; border-radius: 8px !important; padding: 2px 8px !important;
}
body.light-theme button[onclick="copyUserApiKey()"] {
  background: #f97316 !important; color: #ffffff !important;
  border: 2px solid #0f172a !important; border-radius: 10px !important;
  box-shadow: 2px 2px 0 #0f172a !important; font-weight: 800 !important;
}
body.light-theme button[onclick="copyUserApiKey()"]:hover { transform: translate(-1px,-1px) !important; box-shadow: 3px 3px 0 #0f172a !important; }

/* Left docs nav */
body.light-theme #section-api nav {
  background: #ffffff !important;
  border-right: 2.5px solid #0f172a !important;
}
body.light-theme #section-api nav [data-i18n^="apiNav"]:not(span) {
  color: #0f172a !important; font-weight: 900 !important; letter-spacing: .08em !important;
  display: inline-block !important; padding: 2px 8px !important; margin-left: 4px !important;
  background: #fff7ed !important; border: 1.5px solid #0f172a !important; border-radius: 6px !important;
}
body.light-theme #section-api nav a {
  color: #334155 !important;
  border: 2px solid transparent !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, box-shadow .12s ease !important;
}
body.light-theme #section-api nav a:hover {
  color: #0f172a !important;
  background: #fff7ed !important;
  border-color: #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  transform: translateX(2px) !important;
}
body.light-theme #section-api nav a.as-api-active,
body.light-theme #section-api nav a[href="#api-intro"]:not(.as-api-off) {
  color: #ffffff !important;
  background: #f97316 !important;
  border-color: #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
body.light-theme #section-api nav a.as-api-active *,
body.light-theme #section-api nav a[href="#api-intro"]:not(.as-api-off) * { color: #ffffff !important; }

/* Docs content */
body.light-theme #section-api section { border-top-color: #0f172a !important; border-top-width: 2px !important; border-top-style: dashed !important; }
body.light-theme #section-api section#api-intro { border-top: 0 !important; }
body.light-theme #section-api h3,
body.light-theme #section-api h4 { color: #0f172a !important; font-weight: 900 !important; }
body.light-theme #section-api h3 {
  display: inline-block !important;
  background: linear-gradient(transparent 62%, #fed7aa 62%) !important;
}
body.light-theme #section-api section p,
body.light-theme #section-api .text-gray-300,
body.light-theme #section-api .text-gray-400 { color: #334155 !important; }
body.light-theme #section-api .rounded-xl {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme #section-api .text-white:not(button):not(button *) { color: #0f172a !important; }
body.light-theme #section-api .text-cyan-300 { color: #1d4ed8 !important; font-weight: 700 !important; }
body.light-theme #section-api .text-green-400 { color: #047857 !important; }
body.light-theme #section-api .text-amber-300,
body.light-theme #section-api .text-amber-400 { color: #b45309 !important; }
body.light-theme #section-api .text-red-400 { color: #dc2626 !important; }
body.light-theme #section-api .text-purple-400 { color: #7e22ce !important; }

/* HTTP method badges GET / POST / DELETE */
body.light-theme #section-api section span.font-mono.rounded {
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 900 !important;
  padding: 2px 8px !important;
}
body.light-theme #section-api section span[class*="bg-green-500/"] { background: #22c55e !important; color: #ffffff !important; }
body.light-theme #section-api section span[class*="bg-blue-500/"] { background: #3b82f6 !important; color: #ffffff !important; }
body.light-theme #section-api section span[class*="bg-amber-500/"],
body.light-theme #section-api section span[class*="bg-yellow-500/"] { background: #f59e0b !important; color: #0f172a !important; }
body.light-theme #section-api section span[class*="bg-red-500/"] { background: #ef4444 !important; color: #ffffff !important; }

/* Copy buttons in endpoint bars */
body.light-theme #section-api section button {
  background: #ffffff !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; border-radius: 8px !important;
  box-shadow: 2px 2px 0 #0f172a !important; font-weight: 800 !important;
}
body.light-theme #section-api section button:hover { background: #fff7ed !important; transform: translate(-1px,-1px) !important; }

/* Parameter tables */
body.light-theme #section-api table thead {
  background: #fff7ed !important;
  color: #0f172a !important;
  border-bottom: 2px solid #0f172a !important;
}
body.light-theme #section-api table th { color: #0f172a !important; font-weight: 900 !important; }
body.light-theme #section-api table tbody tr { border-color: #e2e8f0 !important; }
body.light-theme #section-api table tbody tr:hover { background: #fffbeb !important; }
body.light-theme #section-api .border.border-gray-800:has(> table) {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  border-radius: 12px !important;
}

/* Code blocks: light terminal window with dots */
body.light-theme #section-api pre {
  position: relative !important;
  background: #fdfdfb !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 1px #fff !important;
  padding-top: 30px !important;
  background-image: linear-gradient(#f1f5f9, #f1f5f9) !important;
  background-size: 100% 22px !important;
  background-repeat: no-repeat !important;
}
body.light-theme #section-api pre::before {
  content: "";
  position: absolute; top: 7px; left: 10px;
  width: 8px; height: 8px; border-radius: 999px;
  background: #ef4444;
  box-shadow: 13px 0 0 #f59e0b, 26px 0 0 #22c55e;
  border: 1px solid #0f172a;
}
body.light-theme #section-api pre.text-green-400 { color: #065f46 !important; }
body.light-theme #section-api pre.text-amber-300 { color: #92400e !important; }
body.light-theme #section-api pre.text-red-400 { color: #b91c1c !important; }

/* =====================================================================
   Sakuga icon tiles (dashboard stats, section headers, card icons)
   ===================================================================== */
@keyframes asIconPop {
  0%   { transform: rotate(0) scale(1); }
  35%  { transform: rotate(-9deg) scale(1.14); }
  65%  { transform: rotate(5deg) scale(0.96); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes asIconSmear {
  0%, 100% { box-shadow: 3px 3px 0 #0f172a; }
  40% { box-shadow: 5px 5px 0 #0f172a, 8px 8px 0 rgba(249,115,22,.35); }
}
body.light-theme .cyber-stat-icon,
body.light-theme main h2 > span.w-8.h-8,
body.light-theme main h2 > span.w-10.h-10,
body.light-theme main h3 > span.w-8.h-8,
body.light-theme main .w-10.h-10.rounded-xl:has(> svg),
body.light-theme main .w-11.h-11.rounded-xl:has(> svg),
body.light-theme main .w-12.h-12.rounded-xl:has(> svg),
body.light-theme main .w-9.h-9.rounded-xl:has(> svg),
body.light-theme main .w-8.h-8.rounded-lg:has(> svg),
body.light-theme main .w-8.h-8.rounded-xl:has(> svg) {
  border: 2px solid #0f172a !important;
  border-radius: 12px !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  transition: transform .18s cubic-bezier(.22,1,.36,1) !important;
}
/* pastel fills per hue, darker glyphs */
body.light-theme .cyber-stat-icon[class*="cyan"],   body.light-theme main [class*="from-cyan-"]:has(> svg)   { background: #cffafe !important; color: #0e7490 !important; }
body.light-theme .cyber-stat-icon[class*="emerald"],body.light-theme .cyber-stat-icon[class*="green"]           { background: #d1fae5 !important; color: #047857 !important; }
body.light-theme .cyber-stat-icon[class*="amber"],  body.light-theme .cyber-stat-icon[class*="yellow"],
body.light-theme .cyber-stat-icon[class*="orange"]                                                           { background: #fef3c7 !important; color: #b45309 !important; }
body.light-theme .cyber-stat-icon[class*="red"],    body.light-theme .cyber-stat-icon[class*="rose"],
body.light-theme .cyber-stat-icon[class*="pink"]                                                             { background: #ffe4e6 !important; color: #be123c !important; }
body.light-theme .cyber-stat-icon[class*="purple"], body.light-theme .cyber-stat-icon[class*="violet"],
body.light-theme .cyber-stat-icon[class*="indigo"]                                                           { background: #f3e8ff !important; color: #7e22ce !important; }
body.light-theme .cyber-stat-icon[class*="blue"]:not([class*="cyan"])                                        { background: #dbeafe !important; color: #1d4ed8 !important; }
body.light-theme .cyber-stat-icon svg { stroke-width: 2.4 !important; }
/* section header icon (red gradient square) -> solid orange tile */
body.light-theme main h2 > span.w-8.h-8[class*="from-red"],
body.light-theme main h2 > span.w-8.h-8[class*="from-rose"],
body.light-theme main h2 > span.w-8.h-8[class*="bg-gradient"] {
  background: linear-gradient(135deg, #f97316, #c026d3) !important;
  color: #ffffff !important;
}
body.light-theme main h2 > span.w-8.h-8 svg { color: #ffffff !important; stroke-width: 2.6 !important; }
/* hover: Sakuga pop + smear on parent card */
body.light-theme main .rounded-2xl:hover .cyber-stat-icon,
body.light-theme main .rounded-2xl:hover .w-10.h-10.rounded-xl:has(> svg),
body.light-theme main .rounded-2xl:hover .w-12.h-12.rounded-xl:has(> svg),
body.light-theme main h2:hover > span.w-8.h-8 {
  animation: asIconPop .5s cubic-bezier(.22,1,.36,1), asIconSmear .5s ease;
}
/* stat value & label legibility on dashboard */
body.light-theme main .stat-label { color: #475569 !important; font-weight: 800 !important; }
/* bottom KPI strip numbers (TOTAL VIDEOS / VIEWS / CPM / FOLDERS) */
body.light-theme main .text-blue-400  { color: #1d4ed8 !important; }
body.light-theme main .text-green-400,
body.light-theme main .text-emerald-400 { color: #047857 !important; }
body.light-theme main .text-yellow-400,
body.light-theme main .text-amber-400 { color: #b45309 !important; }
body.light-theme main .text-purple-400 { color: #7e22ce !important; }
body.light-theme main .text-cyan-400  { color: #0e7490 !important; }
/* Sidebar nav icons: BARE icons per SYSTEM_BRAIN "Bare Icons" rule (no box, no border, no shadow) */
@media (prefers-reduced-motion: reduce) {
  body.light-theme main .rounded-2xl:hover .cyber-stat-icon,
  body.light-theme main h2:hover > span.w-8.h-8 { animation: none !important; }
}

/* =====================================================================
   PUBLIC PAGES polish (home, blog, earn-money, premium, terms, advertise)
   ===================================================================== */
/* --- Header: never overlap, smooth responsive nav --- */
body.light-theme header.sticky {
  gap: 16px !important;
  flex-wrap: nowrap !important;
}
body.light-theme header.sticky > a:first-child { flex: 0 0 auto !important; min-width: max-content !important; }
body.light-theme header.sticky > div:last-child {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
  gap: clamp(8px, 1.15vw, 22px) !important;
}
body.light-theme header.sticky > div:last-child > a,
body.light-theme header.sticky > div:last-child > button { white-space: nowrap !important; flex-shrink: 0 !important; }
body.light-theme header.sticky > div:last-child > a:not([class*="bg-"]) {
  position: relative;
  padding: 6px 2px !important;
  color: #334155 !important;
  font-weight: 700 !important;
  transition: color .15s ease !important;
}
body.light-theme header.sticky > div:last-child > a:not([class*="bg-"])::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px;
  background: linear-gradient(90deg, #f97316, #c026d3);
  border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}
body.light-theme header.sticky > div:last-child > a:not([class*="bg-"]):hover { color: #0f172a !important; }
body.light-theme header.sticky > div:last-child > a:not([class*="bg-"]):hover::after { transform: scaleX(1); }
body.light-theme header.sticky > div:last-child > a.text-red-500 { color: #ea580c !important; }
body.light-theme header.sticky > div:last-child > a.text-red-500::after { transform: scaleX(1); }
@media (max-width: 1360px) {
  body.light-theme header.sticky { padding-left: 20px !important; padding-right: 20px !important; }
  body.light-theme header.sticky > div:last-child { font-size: 11.5px !important; }
  body.light-theme header.sticky .logo-brand-text { font-size: 18px !important; }
}
@media (max-width: 1180px) {
  body.light-theme header.sticky > div:last-child {
    overflow-x: auto !important; scrollbar-width: none !important;
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    padding: 4px 6px !important;
  }
  body.light-theme header.sticky > div:last-child::-webkit-scrollbar { display: none !important; }
  body.light-theme header.sticky > div:last-child > div.h-4 { display: none !important; }
  /* dropdown panels must escape the scrolling nav */
  body.light-theme header.sticky #langDropdown,
  body.light-theme header.sticky #newsBellPanel { position: fixed !important; top: 64px !important; right: 16px !important; }
}

/* --- Saturated buttons/badges keep crisp WHITE text + Sakuga ink --- */
html body.light-theme :is(a, button)[class*="from-red-6"],
html body.light-theme :is(a, button)[class*="from-rose-6"],
html body.light-theme :is(a, button)[class*="from-blue-6"],
html body.light-theme :is(a, button)[class*="from-indigo-6"],
html body.light-theme :is(a, button)[class*="from-purple-6"],
html body.light-theme :is(a, button)[class*="from-emerald-6"],
html body.light-theme :is(a, button)[class~="bg-red-600"],
html body.light-theme :is(a, button)[class~="bg-red-500"],
html body.light-theme :is(a, button)[class~="bg-rose-600"],
html body.light-theme :is(a, button)[class~="bg-blue-600"],
html body.light-theme :is(a, button)[class~="bg-indigo-600"],
html body.light-theme :is(a, button)[class~="bg-emerald-600"],
html body.light-theme :is(a, button)[class~="bg-purple-600"] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html body.light-theme :is(a, button)[class*="from-red-6"] *,
html body.light-theme :is(a, button)[class*="from-rose-6"] *,
html body.light-theme :is(a, button)[class*="from-blue-6"] *,
html body.light-theme :is(a, button)[class*="from-indigo-6"] *,
html body.light-theme :is(a, button)[class*="from-purple-6"] *,
html body.light-theme :is(a, button)[class*="from-emerald-6"] *,
html body.light-theme :is(a, button)[class~="bg-red-600"] *,
html body.light-theme :is(a, button)[class~="bg-blue-600"] *,
html body.light-theme :is(a, button)[class~="bg-rose-600"] *,
html body.light-theme :is(a, button)[class~="bg-emerald-600"] * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html body.light-theme :is(a, button)[class*="from-red-6"],
html body.light-theme :is(a, button)[class*="from-rose-6"],
html body.light-theme :is(a, button)[class*="from-blue-6"],
html body.light-theme :is(a, button)[class*="from-indigo-6"],
html body.light-theme :is(a, button)[class*="from-purple-6"],
html body.light-theme :is(a, button)[class*="from-emerald-6"],
html body.light-theme :is(a, button)[class*="from-amber-5"],
html body.light-theme :is(a, button)[class*="from-orange-5"] {
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  text-shadow: none !important;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .14s ease !important;
}
html body.light-theme :is(a, button)[class*="from-"][class*="to-"]:hover {
  transform: translate(-1px, -2px) !important;
  box-shadow: 4px 5px 0 #0f172a !important;
}
html body.light-theme :is(a, button)[class*="from-"][class*="to-"]:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 1px 1px 0 #0f172a !important;
}
/* amber/orange buttons: dark ink text is correct */
html body.light-theme :is(a, button)[class*="from-amber-5"],
html body.light-theme :is(a, button)[class*="from-orange-5"] { color: #0f172a !important; }

/* --- Home: "All news" ticker button --- */
body.light-theme .hero-ticker__all {
  background: #f97316 !important;
  color: #ffffff !important;
  border: 2px solid #0f172a !important;
  border-radius: 999px !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 900 !important;
}
body.light-theme .hero-ticker__all * { color: #ffffff !important; }
body.light-theme .hero-ticker__all:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 #0f172a !important; }

/* --- Dark tinted pills / boxes on public pages --- */
body.light-theme [class*="bg-red-950"],
body.light-theme [class*="bg-rose-950"] {
  background: #fff1f2 !important;
  border: 2px solid #0f172a !important;
  color: #b91c1c !important;
}
body.light-theme [class*="bg-red-950"] *:not(.bg-red-500) { color: #b91c1c !important; }
body.light-theme :is(div, code, pre, p)[class*="bg-black/"]:not(.fixed):not(.absolute):not(.inset-0):not([id$="Modal"]):not(.aspect-video) {
  background: #fffbeb !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
body.light-theme #articleShareUrl {
  background: #ffffff !important;
  color: #1d4ed8 !important;
  border: 1.5px solid #0f172a !important;
}
body.light-theme .text-red-300, body.light-theme .text-red-400 { color: #b91c1c !important; }

/* --- Earn Money tiers --- */
body.light-theme .tier-laser-shimmer,
body.light-theme .tier-price-banner::after { display: none !important; }
body.light-theme .tier-price-banner {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 2px 2px 0 #0f172a !important;
  border-top: 2px solid #0f172a !important;
  box-shadow: none !important;
  letter-spacing: .02em;
}
body.light-theme .tier-header-badge span.bg-red-600 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1.5px solid #0f172a !important;
}
body.light-theme .tier-cyber-card {
  border: 2px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .16s ease !important;
}
body.light-theme .tier-cyber-card:hover { transform: translate(-2px,-3px) !important; box-shadow: 6px 7px 0 #0f172a !important; }

/* --- Footer brand never clipped --- */
body.light-theme footer .logo-brand-text,
body.light-theme footer a:has(img) { overflow: visible !important; white-space: nowrap !important; }

/* =====================================================================
   PORTAL layout robustness (1280px & below) + toolbar buttons
   ===================================================================== */
/* Primary actions: Upload Video + New Folder */
body.light-theme .btn-lector-primary {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  font-weight: 900 !important;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .14s ease !important;
}
body.light-theme .btn-lector-primary * { color: #ffffff !important; }
body.light-theme .btn-lector-primary:hover { transform: translate(-1px,-2px) !important; box-shadow: 4px 5px 0 #0f172a !important; }
body.light-theme .btn-lector-primary:active { transform: translate(2px,2px) !important; box-shadow: 1px 1px 0 #0f172a !important; }
body.light-theme button[onclick="openFolderModal()"] {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  font-weight: 900 !important;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .14s ease !important;
}
body.light-theme button[onclick="openFolderModal()"]:hover { transform: translate(-1px,-2px) !important; box-shadow: 4px 5px 0 #0f172a !important; }
/* Clone Video button (was dark amber glass) */
body.light-theme #batchActionBar button[onclick="openCloneModal()"] {
  background: #fef3c7 !important;
  color: #92400e !important;
}
body.light-theme #batchActionBar button[onclick="openCloneModal()"] svg { color: #d97706 !important; }
/* Stray decorative laser line behind quick actions */
body.light-theme #batchActionBar .cyber-table-laser-line,
body.light-theme #batchActionBar [class*="laser"] { display: none !important; }

/* Let flex/grid children shrink instead of pushing content off-screen */
body.light-theme main .flex > *,
body.light-theme main .grid > * { min-width: 0; }
body.light-theme main { min-width: 0 !important; }
/* Tables scroll horizontally inside their card instead of clipping */
body.light-theme .file-table-viewport,
body.light-theme main :is(.rounded-2xl, .rounded-xl, .border):has(> table) {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
body.light-theme main table { min-width: 100%; }
/* Long filenames truncate cleanly */
body.light-theme main td .truncate,
body.light-theme main li .truncate { min-width: 0; }
/* Big KPI numbers scale with the card */
body.light-theme main .grid .rounded-2xl :is(.text-2xl, .text-3xl) {
  font-size: clamp(18px, 1.55vw, 26px) !important;
  white-space: nowrap;
}
/* Top Performing Videos rows: pill never overlaps text */
body.light-theme main .rounded-2xl li,
body.light-theme main .rounded-2xl [class*="justify-between"] { gap: 8px; }
body.light-theme main .rounded-2xl [class*="justify-between"] > :last-child { flex-shrink: 0; }
/* API 429 / rate-limit cards: wrap long code */
body.light-theme #section-api pre { white-space: pre-wrap !important; word-break: break-word !important; }
@media (max-width: 1360px) {
  body.light-theme #section-api .grid-cols-2 { grid-template-columns: 1fr !important; }
}

/* Fix: elements whose gradient bg is overridden to white must keep dark text */
html body.light-theme .faq-item,
html body.light-theme .faq-item * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html body.light-theme .faq-item [id^="faq-num-"] { color: #ea580c !important; -webkit-text-fill-color: #ea580c !important; }
/* Header "Webmaster Portal" CTA: restore Sakuga gradient + white text */
html body.light-theme header a.auth-logged-only[href="/portal/"] {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
html body.light-theme header a.auth-logged-only[href="/portal/"] * { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }

/* ===== Final QA fixes ===== */
/* Dark tinted gradients (from-*-950 / via-[#1a2130] / to-[#0f172a]) on any page */
html body.light-theme [class*="from-red-950"],
html body.light-theme [class*="from-amber-950"],
html body.light-theme [class*="from-emerald-950"],
html body.light-theme [class*="from-purple-950"],
html body.light-theme [class*="from-indigo-950"],
html body.light-theme [class*="via-[#1a2130]"],
html body.light-theme [class*="to-[#0f172a]"],
html body.light-theme [class*="from-[#161b22]"] {
  background: #fff7ed !important;
  background-image: none !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  color: #0f172a !important;
}
html body.light-theme [class*="from-emerald-950"] { background: #ecfdf5 !important; }
html body.light-theme [class*="from-[#161b22]"] { background: #ffffff !important; }
html body.light-theme :is([class*="from-red-950"], [class*="via-[#1a2130]"], [class*="from-emerald-950"], [class*="from-[#161b22]"]) :is(.text-white, .text-gray-200, .text-gray-300) { color: #0f172a !important; }
html body.light-theme :is([class*="from-red-950"], [class*="via-[#1a2130]"]) :is(.text-red-400, .text-amber-400, .text-orange-400) { color: #c2410c !important; }
html body.light-theme [class*="from-emerald-950"] :is(.text-emerald-300, .text-emerald-400) { color: #047857 !important; }

/* Portal Quick Batch: AI Subtitles + Delete keep white text on solid fills */
html body.light-theme #batchActionBar button[onclick^="openAiTranslateModal"] {
  background: linear-gradient(135deg, #6366f1, #a855f7) !important;
  color: #ffffff !important;
}
html body.light-theme #batchActionBar button[onclick^="openAiTranslateModal"] * { color: #ffffff !important; }
html body.light-theme #batchActionBar button[onclick="actDelete()"] { background: #ef4444 !important; color: #ffffff !important; }
html body.light-theme #batchActionBar button[onclick="actDelete()"] * { color: #ffffff !important; }
html body.light-theme #batchActionBar button[onclick="openCleanerModal()"] { background: #f3e8ff !important; color: #6b21a8 !important; }

/* Pastel icon tiles for Revenue Reports, DMCA & any dark icon squares in Portal */
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14).rounded-xl:is([class*="bg-[#"], [class*="bg-gray-9"], [class*="bg-slate-9"], [class*="bg-black"], [class*="-950"]),
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14).rounded-2xl:is([class*="bg-[#"], [class*="bg-gray-9"], [class*="bg-slate-9"], [class*="bg-black"], [class*="-950"]) {
  background: #fff7ed !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  color: #c2410c !important;
}
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="blue"] { background: #dbeafe !important; color: #1d4ed8 !important; }
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="emerald"],
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="green"] { background: #d1fae5 !important; color: #047857 !important; }
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="amber"],
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="yellow"] { background: #fef3c7 !important; color: #b45309 !important; }
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="red"],
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="rose"] { background: #ffe4e6 !important; color: #be123c !important; }
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="purple"],
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl)[class*="indigo"] { background: #f3e8ff !important; color: #7e22ce !important; }
html body.light-theme main :is(.w-10, .w-11, .w-12, .w-14):is(.rounded-xl, .rounded-2xl) svg { color: inherit !important; }

/* File Manager table at 1280px: compact columns so everything fits */
@media (max-width: 1440px) {
  html body.light-theme .file-table-viewport table th,
  html body.light-theme .file-table-viewport table td { padding-left: 8px !important; padding-right: 8px !important; }
  html body.light-theme .file-table-viewport table td button { padding: 4px 8px !important; font-size: 11px !important; }
}

/* Home: CDN pill + ticker clipping */
html body.light-theme span.rounded-full.font-mono { white-space: nowrap !important; display: inline-flex !important; }
html body.light-theme .hero-ticker__track,
html body.light-theme .hero-ticker [class*="track"] { padding-left: 8px !important; }

/* Language label never truncates */
html body.light-theme #currentLangName { white-space: nowrap !important; }

/* =====================================================================
   BLOG (index + every article page) & shared footer
   ===================================================================== */
/* Header CTA (any /portal href) */
html body.light-theme header a.auth-logged-only[href^="/portal"] {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
  border: 2px solid #0f172a !important; box-shadow: 3px 3px 0 #0f172a !important;
}
html body.light-theme header a.auth-logged-only[href^="/portal"] * { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }

/* Category chips (bg-*-950/60) -> pastel ink pills */
html body.light-theme span[class*="-950/"] {
  border: 1.5px solid #0f172a !important;
  border-radius: 999px !important;
  padding: 2px 9px !important;
  font-weight: 900 !important;
  letter-spacing: .04em;
}
html body.light-theme span[class*="bg-emerald-950"] { background: #d1fae5 !important; color: #047857 !important; }
html body.light-theme span[class*="bg-amber-950"]   { background: #fef3c7 !important; color: #92400e !important; }
html body.light-theme span[class*="bg-rose-950"],
html body.light-theme span[class*="bg-red-950"]     { background: #ffe4e6 !important; color: #be123c !important; }
html body.light-theme span[class*="bg-blue-950"]    { background: #dbeafe !important; color: #1d4ed8 !important; }
html body.light-theme span[class*="bg-purple-950"],
html body.light-theme span[class*="bg-indigo-950"]  { background: #f3e8ff !important; color: #7e22ce !important; }
html body.light-theme span[class*="bg-cyan-950"]    { background: #cffafe !important; color: #0e7490 !important; }

/* "Views : 8.4k" spacing: chip left, views text stays together on the right */
html body.light-theme article .justify-between:has(> [data-i18n="viewsCount"]) { justify-content: flex-start !important; gap: 4px !important; }
html body.light-theme article .justify-between:has(> [data-i18n="viewsCount"]) > span:first-child { margin-right: auto !important; }
html body.light-theme article .justify-between:has(> [data-i18n="viewsCount"]) { color: #475569 !important; font-weight: 700; }

/* Blog cards hover */
html body.light-theme article.cyber-card {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 4px 4px 0 #0f172a !important;
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .16s ease !important;
}
html body.light-theme article.cyber-card:hover { transform: translate(-2px, -3px) !important; box-shadow: 6px 7px 0 #0f172a !important; }
html body.light-theme article.cyber-card h4 { color: #0f172a !important; }
html body.light-theme article.cyber-card:hover h4 { color: #ea580c !important; }
html body.light-theme article.cyber-card p { color: #475569 !important; }

/* CTA secondary button (bg-white/5) */
html body.light-theme a[class*="bg-white/5"],
html body.light-theme button[class*="bg-white/5"] {
  background: #ffffff !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; box-shadow: 3px 3px 0 #0f172a !important;
}
html body.light-theme a[class*="bg-white/5"]:hover { background: #fff7ed !important; transform: translate(-1px,-2px); }

/* Article reader modal + article content */
html body.light-theme #articleModal { background: rgba(15, 23, 42, .5) !important; }
html body.light-theme #articleModal > div {
  background: #ffffff !important; color: #0f172a !important;
  border: 2.5px solid #0f172a !important; border-radius: 22px !important;
  box-shadow: 8px 8px 0 #0f172a !important;
}
html body.light-theme #articleModal :is(h1, h2, h3, h4, strong, b) { color: #0f172a !important; }
html body.light-theme #articleModal :is(p, li, .text-gray-200, .text-gray-300, .text-gray-400) { color: #334155 !important; }
html body.light-theme #articleModal a:not([class*="bg-"]) { color: #c2410c !important; font-weight: 700; }
html body.light-theme #articleModal :is(pre, code) { background: #f8fafc !important; color: #0f172a !important; border: 1.5px solid #0f172a !important; }
html body.light-theme #articleModal blockquote { border-left: 4px solid #f97316 !important; background: #fff7ed !important; color: #0f172a !important; }
html body.light-theme #articleModal [class*="bg-[#"],
html body.light-theme #articleModal [class*="bg-gray-9"],
html body.light-theme #articleModal [class*="bg-slate-9"] {
  background: #f8fafc !important; color: #0f172a !important; border-color: #0f172a !important;
}
html body.light-theme #modalViews { color: #047857 !important; }

/* Footer (dark bg-[#070a10] on every page) */
html body.light-theme footer[class*="bg-[#0"],
html body.light-theme footer[class*="bg-black"],
html body.light-theme footer {
  background: #ffffff !important;
  border-top: 2.5px solid #0f172a !important;
  color: #334155 !important;
}
html body.light-theme footer :is(.text-gray-400, .text-gray-500, .text-gray-600) { color: #475569 !important; }
html body.light-theme footer a { color: #334155 !important; font-weight: 700; transition: color .15s ease; }
html body.light-theme footer a:hover { color: #ea580c !important; }
html body.light-theme footer a.text-red-500,
html body.light-theme footer a[class*="text-red"] { color: #ea580c !important; }
html body.light-theme footer [class*="rounded-full"][class*="border"],
html body.light-theme footer [class*="rounded-lg"][class*="border"] {
  background: #ffffff !important; border: 1.5px solid #0f172a !important; color: #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
html body.light-theme footer [class*="text-emerald"] { color: #047857 !important; }
html body.light-theme footer [class*="text-amber"] { color: #b45309 !important; }

/* Article reader modal: restore CTA gradients (generic modal rules turned them white) */
html body.light-theme #articleModal :is(a, button)[class*="from-red-6"],
html body.light-theme #articleModal :is(a, button)[class*="from-rose-6"] {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
}
html body.light-theme #articleModal :is(a, button)[class*="from-red-6"] *,
html body.light-theme #articleModal :is(a, button)[class*="from-rose-6"] * { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }
html body.light-theme #articleModal :is(a, button)[class*="from-amber-5"],
html body.light-theme #articleModal :is(a, button)[class*="from-orange-5"] {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%) !important;
  color: #0f172a !important; -webkit-text-fill-color: #0f172a !important;
}
/* Code blocks: no per-line borders on <code> inside <pre> */
html body.light-theme pre code,
html body.light-theme #articleModal pre code,
html body.light-theme main pre code {
  border: 0 !important; background: transparent !important; padding: 0 !important;
  box-shadow: none !important; border-radius: 0 !important; text-decoration: none !important;
}
/* Feather fallback when icons were not replaced */
html body.light-theme i[data-feather]:empty { display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 900; line-height: 1; }
html body.light-theme i[data-feather="x"]:empty::before { content: "\2715"; }
html body.light-theme i[data-feather="copy"]:empty::before { content: "\29C9"; }
html body.light-theme i[data-feather="check"]:empty::before { content: "\2713"; }
html body.light-theme i[data-feather="arrow-right"]:empty::before { content: "\2192"; }
html body.light-theme i[data-feather="external-link"]:empty::before { content: "\2197"; }

/* =====================================================================
   Sakuga controls: squash/overshoot springs (CSS only, GPU transforms)
   ===================================================================== */
@keyframes asSpringPop { 0% { transform: scale(1); } 30% { transform: scale(1.35, .8); } 55% { transform: scale(.88, 1.15); } 80% { transform: scale(1.06, .96); } 100% { transform: scale(1); } }
@keyframes asFocusPop { 0% { box-shadow: 0 0 0 0 rgba(249,115,22,.0); } 40% { box-shadow: 4px 4px 0 #f97316; } 100% { box-shadow: 3px 3px 0 #f97316; } }
html body.light-theme input[type="checkbox"],
html body.light-theme input[type="radio"] { accent-color: #f97316; transition: transform .15s ease; }
html body.light-theme input[type="checkbox"]:checked,
html body.light-theme input[type="radio"]:checked { animation: asSpringPop .42s cubic-bezier(.22,1,.36,1); }
html body.light-theme input[type="checkbox"]:active,
html body.light-theme input[type="radio"]:active { transform: scale(.82); }
html body.light-theme input[type="range"] { accent-color: #f97316; }
html body.light-theme :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), textarea, select):focus {
  outline: none !important;
  border-color: #f97316 !important;
  animation: asFocusPop .32s cubic-bezier(.22,1,.36,1) forwards;
}
/* Tabs: little stretch when becoming active (sidebar stays flat per Bare Icons / 0ms rule) */
html body.light-theme [role="tab"][aria-selected="true"] { animation: asSpringPop .36s cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) {
  html body.light-theme input:checked,
  html body.light-theme :is(input, textarea, select):focus,
  html body.light-theme .sidebar-nav-btn.active { animation: none !important; }
}

/* Ensure File Manager status/compression pills always hug their text cleanly */
#fileListBody .as-badge,
#fileListBody span[class*="rounded-full"],
#fileListBody button[class*="rounded-full"] {
  width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
}
