:root {
  /* Updated palette for neural/glassmorphism look */
  --bg: #000000;
  --panel: rgba(255, 255, 255, 0.05);
  --muted: #b9b4c9;
  --text: #f3eaff;
  --accent: #e0a3ff;
  --accent-2: #ff69b4;
  --border: rgba(224, 163, 255, 0.2);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(15, 8, 25, 0.6);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(224, 163, 255, 0.2);
}
.top-nav .spacer { display: none; }
.top-nav .brand { font-weight: 800; letter-spacing: .02em; }
.nav-toggle { display: none; }
.nav-toggle { background: transparent; border: 1px solid rgba(224,163,255,0.3); border-radius: 10px; padding: 8px; color: var(--text); position: relative; width: 42px; height: 38px; align-items: center; justify-content: center; }
.nav-toggle .bar { position: absolute; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle .bar:nth-child(1) { transform: translateY(-6px); }
.nav-toggle .bar:nth-child(2) { transform: translateY(0); }
.nav-toggle .bar:nth-child(3) { transform: translateY(6px); }
.nav-toggle.open .bar:nth-child(1) { transform: rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: rotate(-45deg); }
.nav-menu { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dataset-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(224,163,255,0.6);
  background: linear-gradient(135deg, rgba(224, 163, 255, 0.18), rgba(255, 105, 180, 0.14));
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.06em;
}
#nav-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(224,163,255,0.6);
  background: linear-gradient(135deg, rgba(224, 163, 255, 0.18), rgba(255, 105, 180, 0.14));
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.06em;
}
#nav-user.has-avatar {
  border-color: rgba(224,163,255,0.35);
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
#nav-user.has-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(224, 163, 255, 0.25);
  background: linear-gradient(135deg, rgba(224, 163, 255, 0.12), rgba(255, 105, 180, 0.1));
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover { border-color: rgba(224, 163, 255, 0.6); background: linear-gradient(135deg, rgba(224,163,255,0.22), rgba(255,105,180,0.16)); }
.nav-link.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(224,163,255,0.25) inset; }
.nav-right { margin-left: auto; }

/* Mobile tweaks */
@media (max-width: 720px) {
  .top-nav { grid-template-columns: auto auto 1fr; grid-template-areas: 'brand toggle user' 'menu menu menu'; row-gap: 8px; }
  .top-nav .brand { grid-area: brand; }
  .nav-toggle { grid-area: toggle; display: inline-flex; align-items: center; justify-content: center; }
  #nav-user { grid-area: user; justify-self: end; height: 32px; min-width: 32px; padding: 0 10px; font-size: 13px; }
  .nav-menu { grid-area: menu; display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
  .nav-menu.open { max-height: 70vh; }
  .nav-menu .nav-link, .nav-menu .btn { margin-top: 8px; }
  .nav-link { width: 100%; justify-content: center; padding: 10px 12px; font-size: 14px; }
  .btn { padding: 10px 14px; }
  .btn.sm { padding: 8px 10px; }
  .app-main { padding: 12px; gap: 12px; }
}

/* Static image-based backdrop with cross-fade */
.image-background { position: fixed; inset: 0; z-index: -3; pointer-events: none; }
.image-background .bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.image-background .bg1 { background-image: url('/assets/background1.webp'); opacity: 1; }
.image-background .bg2 { background-image: url('/assets/background2.webp'); opacity: 0; animation: bg2fade 12s ease-in-out infinite; }

@keyframes bg2fade {
  0% { opacity: 0; }
  30% { opacity: 0; }
  45% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* Non‑PRO: overlay dark gray over the image background (only when body has .nonpro) */
body.nonpro .image-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #1e1e1e;
}

/* Glass helpers */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.glass-strong {
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
}

.app-header {
  padding: 18px 20px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
  margin: 12px auto 4px auto;
  max-width: 1400px;
  text-align: center;
}
.app-header h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, #9370db 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: modernGradient 8s ease infinite;
}
.pro .app-header h1 {
  text-shadow: 0 0 12px rgba(234, 192, 255, 0.338), 0 0 24px rgba(182, 160, 228, 0.209);
  filter: drop-shadow(0 0 10px rgba(224,163,255,0.35));
}
.brand-sub { color: var(--muted); margin-top: 6px; }

@keyframes modernGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.app-header p {
  margin: 0;
  color: var(--muted);
}

.app-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.app-footer { max-width: 1400px; margin: 0 auto; padding: 12px 16px 24px 16px; color: var(--muted); text-align: center; }
.app-footer a { color: var(--accent); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

/* Shared buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(224, 163, 255, 0.35);
  background: linear-gradient(135deg, rgba(224, 163, 255, 0.18), rgba(255, 105, 180, 0.14));
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn.xs { padding: 6px 10px; border-radius: 999px; font-size: 13px; }
.btn.sm { padding: 8px 12px; border-radius: 999px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not([disabled]) { border-color: rgba(224, 163, 255, 0.6); background: linear-gradient(135deg, rgba(224, 163, 255, 0.28), rgba(255, 105, 180, 0.2)); box-shadow: 0 8px 28px rgba(224, 163, 255, 0.22); }
.btn:active { transform: translateY(1px); }

/* Hide scrollbar (keep scrolling) */
html { scrollbar-width: none; }
body { -ms-overflow-style: none; }
::-webkit-scrollbar { width: 0 !important; height: 0 !important; }
::-webkit-scrollbar-thumb { background: transparent; }
::-webkit-scrollbar-track { background: transparent; }


