/* ===== Theme tokens ===== */
:root{
  --bg:#ffffff;
  --text:#0b1220;
  --card:#ffffff;
  --muted:#5b6475;
  --border:#e6e8ee;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --nav:#0f172a;
  --navText:#e7e9ff;
  --link:#1d4ed8;
  --chipBg: rgba(255,255,255,.08);
  --chipBgHover: rgba(255,255,255,.14);
}
html.dark{
  --bg:#0b1220;
  --text:#e9eefc;
  --card:#0f172a;
  --muted:#b5bfd6;
  --border:#1f2a44;
  --shadow: 0 14px 35px rgba(0,0,0,.35);
  --nav:#060a14;
  --navText:#e7e9ff;
  --link:#93c5fd;
  --chipBg: rgba(255,255,255,.10);
  --chipBgHover: rgba(255,255,255,.18);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.65;
}
a{ color:var(--link); }

/* ===== Kill any legacy overlays/sidebars ===== */
.overlay, .sidebar, .drawer, .mobile-menu, .menu-overlay, .nav-overlay{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
body.menu-open{ overflow:auto !important; }

/* ===== Header ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:999;
  background:var(--nav);
  color:var(--navText);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.header-inner{
  max-width:1100px;
  margin:0 auto;
  padding:14px 16px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--navText);
  font-weight:800;
  letter-spacing:.2px;
}
.brand-mark{
  width:14px;
  height:28px;
  border-radius:999px;
  background:linear-gradient(180deg, #4f46e5, #22c55e);
}
.brand-text{ font-size:18px; }

.theme-toggle{
  cursor:pointer;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.06);
  color:var(--navText);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  white-space:nowrap;
}
.theme-toggle:active{ transform:translateY(1px); }

/* ===== Top nav (no overlay). On mobile: horizontal scroll chips ===== */
.top-nav{
  max-width:1100px;
  margin:0 auto;
  padding:0 12px 12px;
  display:flex;
  gap:10px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.top-nav::-webkit-scrollbar{ display:none; }

.nav-link{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  background:var(--chipBg);
  color:var(--navText);
  text-decoration:none;
  font-weight:750;
  font-size:14px;
  white-space:nowrap;
}
.nav-link:hover{ background:var(--chipBgHover); }

@media (min-width: 900px){
  .top-nav{
    overflow-x:visible;
    flex-wrap:wrap;
    padding-bottom:14px;
  }
}

/* ===== Layout / cards ===== */
.container{
  max-width:1100px;
  margin:26px auto;
  padding:0 16px;
}
.card, .content-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px;
  box-shadow:var(--shadow);
  margin-bottom:22px;
}
.muted, .meta, .small{ color:var(--muted); }

/* Ad placeholder blocks */
.ad{
  border:2px dashed rgba(100,116,139,.5);
  border-radius:14px;
  padding:22px;
  text-align:center;
  margin:18px 0;
  color:var(--muted);
}

/* ===== Footer with bottom nav ===== */
.site-footer{
  margin-top:28px;
  background:var(--nav);
  color:var(--navText);
  border-top:1px solid rgba(255,255,255,.08);
}
.footer-inner{
  max-width:1100px;
  margin:0 auto;
  padding:18px 16px 22px;
}
.footer-title{ font-weight:900; font-size:16px; }
.footer-sub{ color:rgba(231,233,255,.78); margin-top:4px; font-size:13px; }

.bottom-nav{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px 12px;
}
.footer-link{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  background:var(--chipBg);
  color:var(--navText);
  text-decoration:none;
  font-weight:750;
  font-size:14px;
}
.footer-link:hover{ background:var(--chipBgHover); }

@media (min-width: 700px){
  .bottom-nav{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px){
  .bottom-nav{ grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.footer-copy{
  margin-top:14px;
  color:rgba(231,233,255,.70);
  font-size:12px;
}

/* ===== Force-neutralize any legacy header/menu blocks ===== */
.menu, .nav{
  position:static !important;
  inset:auto !important;
  transform:none !important;
  background:transparent !important;
  box-shadow:none !important;
}
.menu a, .nav a{ color:inherit; }

/* Raptive-optimized ad styles */
.ad{border:2px dashed rgba(100,116,139,.5);border-radius:14px;padding:22px;text-align:center;margin:18px 0;color:var(--muted);} 
.ad-display{min-height:160px;}
.ad-video{min-height:220px;}
