/* Kepler Insights — Reusable Components */

/* ── PORTAL LOGO ── */
.portal-logo {
  position: fixed; top: 20px; left: 32px; z-index: 200;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  opacity: 1; transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.portal-logo.logo-hidden {
  opacity: 0; transform: translateY(-12px); pointer-events: none;
}
.portal-logo img { height: 88px; width: auto; display: block; }
.portal-logo-sub {
  font-family: var(--font);
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-lt);
  padding-left: 3px; margin-top: -4px;
}

/* ── FLOATING NAV ── */
.float-nav {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; background: var(--glass);
  backdrop-filter: blur(16px); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 8px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 4px 28px var(--shadow-color), 0 1px 4px rgba(0,0,0,0.06);
}
.nav-btn {
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--ink-mid); background: none; border: none;
  padding: 8px 20px; border-radius: 99px; cursor: pointer;
  letter-spacing: 0.03em; transition: all 0.18s ease; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: var(--bg); color: var(--navy); }
.nav-btn.active { background: var(--navy); color: var(--white); }
.nav-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-divider { width: 1px; height: 20px; background: var(--border); }

/* ── COLLAPSED NAV (non-fullscreen) ── */
.nav-collapsed {
  display: none; /* hidden on fullscreen — shown via media query */
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 201; background: var(--glass);
  backdrop-filter: blur(16px); border: 1px solid var(--border);
  border-radius: 99px; padding: 8px 18px 8px 14px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--ink-mid); cursor: pointer;
  align-items: center; gap: 7px;
  box-shadow: 0 4px 28px var(--shadow-color), 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.18s ease;
}
.nav-collapsed:hover { background: var(--bg); color: var(--navy); }
.nav-collapsed-icon { width: 16px; height: 16px; flex-shrink: 0; }
body.dark .nav-collapsed {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--ink-mid);
  box-shadow: 0 4px 24px var(--shadow-color), 0 0 0 1px var(--shadow-accent);
}
body.dark .nav-collapsed:hover { background: rgba(124,58,237,0.14); color: var(--navy); }

/* ── NAV DROPDOWN ── */
.nav-dropdown {
  display: none; /* toggled via JS */
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 201; background: var(--glass);
  backdrop-filter: blur(16px); border: 1px solid var(--border);
  border-radius: 16px; padding: 8px;
  min-width: 200px;
  box-shadow: 0 12px 48px var(--shadow-color), 0 2px 8px rgba(0,0,0,0.08);
  flex-direction: column; gap: 2px;
}
.nav-dropdown.open { display: flex; }
.nav-dd-btn {
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--ink-mid); background: none; border: none;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.15s ease; text-align: left; width: 100%;
}
.nav-dd-btn:hover { background: var(--bg); color: var(--navy); }
.nav-dd-btn.active { background: var(--navy); color: var(--white); }
.nav-dd-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-dd-divider { height: 1px; background: var(--border); margin: 4px 8px; }
body.dark .nav-dropdown {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: 0 12px 40px var(--shadow-color), 0 0 0 1px var(--shadow-accent);
}
body.dark .nav-dd-btn { color: var(--ink-mid); }
body.dark .nav-dd-btn:hover { background: rgba(124,58,237,0.14); color: var(--navy); }
body.dark .nav-dd-btn.active { background: rgba(124,58,237,0.28); color: var(--navy); }
body.dark .nav-dd-divider { background: var(--glass-border); }

/* ── RESPONSIVE: collapse nav below 1024px ── */
@media (max-width: 1024px) {
  .float-nav { display: none !important; }
  .nav-collapsed { display: flex; }
}

/* ── PAGE WRAPPER ── */
.page-wrap {
  min-height: 100vh; padding: 100px 24px 60px;
  display: flex; align-items: flex-start; justify-content: center;
}

/* ── VIEWS ── */
.view { display: none; width: 100%; max-width: 640px; animation: fadeUp 0.4s ease forwards; }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BUTTONS ── */
.gate-btn, .launch-btn, .empty-btn {
  width: 100%; font-family: var(--font); font-size: 15px; font-weight: 600;
  color: var(--white); background: var(--navy);
  border: none; padding: 14px; border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease; letter-spacing: 0.03em;
}
.gate-btn:hover { background: var(--navy-deep); }

/* ── Apple Sign In ── */
.gate-or {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 0;
}
.gate-or::before, .gate-or::after {
  content: ''; flex: 1; height: 1px;
  background: var(--ink); opacity: 0.1;
}
.gate-or span {
  font-family: var(--font); font-size: 13px; color: var(--ink-mid);
}
.apple-signin-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 8px; font-family: var(--font); font-size: 15px; font-weight: 600;
  color: #fff; background: #000; border: none; padding: 14px;
  border-radius: 10px; cursor: pointer; transition: all 0.15s ease;
  letter-spacing: 0.03em; margin-top: 12px;
}
.apple-signin-btn:hover { background: #1a1a1a; }
.apple-signin-btn svg { flex-shrink: 0; }
body.dark .apple-signin-btn {
  background: #fff; color: #000;
}
body.dark .apple-signin-btn:hover { background: #e8e8e8; }
body.dark .apple-signin-btn svg { color: #000; }

/* ── WALKTHROUGH OVERLAY ── */
.wt-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  animation: wtFadeIn 0.4s ease;
}
@keyframes wtFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wt-skip {
  position: absolute; top: 28px; right: 32px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--ink-mid); background: none; border: none;
  cursor: pointer; padding: 8px 16px; border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.wt-skip:hover { color: var(--ink); background: rgba(0,0,0,0.04); }

.wt-slides {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 440px; padding: 0 32px;
}

.wt-slide {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; animation: wtSlideIn 0.35s ease;
}
@keyframes wtSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wt-icon-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(27, 58, 107, 0.06);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); margin-bottom: 32px;
}
.wt-logo-circle { background: none; }
.wt-logo { height: 80px; width: auto; }

.wt-title {
  font-family: var(--font); font-size: 26px; font-weight: 700;
  color: var(--ink); margin: 0 0 12px; letter-spacing: -0.3px;
}
.wt-desc {
  font-family: var(--font); font-size: 15px; font-weight: 400;
  color: var(--ink-mid); line-height: 1.6; margin: 0;
  max-width: 360px;
}

.wt-footer {
  padding: 0 32px 48px; display: flex; flex-direction: column;
  align-items: center; gap: 24px; width: 100%; max-width: 440px;
}
.wt-dots {
  display: flex; gap: 8px;
}
.wt-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); opacity: 0.12;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.wt-dot.active {
  opacity: 1; background: var(--navy);
  transform: scale(1.25);
}
.wt-next {
  width: 100%; font-family: var(--font); font-size: 15px; font-weight: 600;
  color: #fff; background: var(--navy); border: none;
  padding: 14px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s ease; letter-spacing: 0.03em;
}
.wt-next:hover { background: var(--navy-deep); }

/* Dark mode */
body.dark .wt-overlay { background: var(--white); }
body.dark .wt-icon-circle { background: rgba(255,255,255,0.06); color: #818cf8; }
body.dark .wt-logo { filter: brightness(0) invert(1); opacity: 0.9; }
body.dark .wt-next {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 14px rgba(109,40,217,0.35);
}

/* ── GALAXY LAUNCH BUTTON ── */
.launch-btn {
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  background:
    radial-gradient(1.5px 1.5px at 8% 18%,  rgba(255,255,255,0.90) 0%, transparent 100%),
    radial-gradient(1px   1px   at 90% 12%,  rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(2px   2px   at 38% 62%,  rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px   1px   at 74% 80%,  rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px   1px   at 22% 78%,  rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1px   1px   at 94% 52%,  rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px   1px   at 54% 22%,  rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 6%  58%,  rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px   1px   at 66% 44%,  rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px   1px   at 30% 33%,  rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px   1px   at 82% 28%,  rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px   1px   at 16% 46%,  rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(2px   2px   at 48% 88%,  rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1px   1px   at 97% 30%,  rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px   1px   at 2%  84%,  rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px   1px   at 42% 10%,  rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px   1px   at 60% 70%,  rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px   1px   at 76% 56%,  rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(ellipse 80% 55% at 28% 48%, rgba(46,109,180,0.32) 0%, transparent 70%),
    radial-gradient(ellipse 55% 75% at 78% 32%, rgba(27,58,107,0.28) 0%, transparent 60%),
    #080e1c;
}
.launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(8,14,28,0.55), 0 0 22px rgba(46,109,180,0.22);
  filter: brightness(1.18);
}
.launch-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.empty-btn { width: auto; padding: 11px 24px; font-size: 14px; }
.empty-btn:hover { background: var(--navy-deep); }

/* ── INPUTS ── */
.gate-input, .form-input {
  width: 100%; font-family: var(--font); font-size: 15px;
  color: var(--ink); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 13px 16px; outline: none; margin-bottom: 12px;
  transition: border-color 0.15s ease;
}
.form-input { font-size: 14px; border-radius: 9px; padding: 11px 14px; margin-bottom: 0; }
/* Prevent iOS Safari from zooming in on input focus (requires ≥16px font) */
@media (max-width: 767px) {
  .gate-input, .form-input { font-size: 16px; }
}
.gate-input:focus, .form-input:focus { border-color: var(--navy); }
.gate-input::placeholder, .form-input::placeholder { color: var(--ink-lt); }

.form-select {
  width: 100%; font-family: var(--font); font-size: 14px;
  color: var(--ink); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 9px;
  padding: 11px 14px; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color 0.15s ease;
}
.form-select:focus { border-color: var(--navy); }

/* ── CARDS ── */
.gate-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 44px;
  box-shadow: 0 2px 10px var(--shadow-accent), 0 16px 48px var(--shadow-accent);
  text-align: center;
}
.form-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 18px; padding: 36px;
  box-shadow: 0 2px 10px var(--shadow-accent), 0 16px 48px var(--shadow-accent);
}

/* ── TYPEAHEAD ── */
.typeahead-wrap { position: relative; }
.typeahead-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 32px var(--shadow-accent);
  z-index: 50; max-height: 200px; overflow-y: auto; display: none;
}
.typeahead-dropdown.open { display: block; }
.ta-item {
  padding: 10px 14px; font-size: 14px; color: var(--ink-mid);
  cursor: pointer; transition: background 0.12s ease;
  display: flex; align-items: center; gap: 10px;
}
.ta-item:hover, .ta-item.selected { background: var(--blue-lt); color: var(--navy); }
.ta-item-name { font-weight: 500; }
.ta-item-meta { font-size: 12px; color: var(--ink-lt); margin-left: auto; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.45);
  backdrop-filter: blur(3px); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: 20px; width: 100%; max-width: 520px;
  box-shadow: 0 24px 80px var(--shadow-color);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 28px 28px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-bucket-name { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -0.3px; }
.modal-bucket-sub { font-size: 12px; color: var(--ink-lt); margin-top: 4px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border); background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink-lt); font-size: 18px; flex-shrink: 0; transition: all 0.15s ease;
}
.modal-close:hover { background: var(--bg); border-color: var(--ink-lt); }
.modal-body { padding: 24px 28px 28px; }
.modal-section-label {
  font-size: 10px; font-weight: 600; color: var(--ink-lt);
  text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 14px;
}
.modal-category {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
}
.modal-cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-cat-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.modal-status {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 3px 9px; border-radius: 99px;
}
.modal-status.elite { color: #15803D; background: #DCFCE7; }
.modal-status.exceptional { color: #0F766E; background: #CCFBF1; }
.modal-status.strong { color: #1B3A6B; background: #DBEAFE; }
.modal-status.solid { color: #2E6DB4; background: #EFF6FF; }
.modal-status.promising { color: #0369A1; background: #E0F2FE; }
.modal-status.emerging { color: #B45309; background: #FEF3C7; }
.modal-status.developing { color: #92400E; background: #FFF7ED; }
.modal-status.early-stage { color: #B91C1C; background: #FEE2E2; }
.modal-status.pre-traction { color: #7F1D1D; background: #FECACA; }
.modal-status.moderate { color: var(--amber); background: var(--amber-lt); }
.modal-status.needs-attention { color: var(--red); background: var(--red-lt); }

/* Dark mode: modal status badges */
body.dark .modal-status.elite { background: rgba(74,222,128,0.15); color: #4ade80; }
body.dark .modal-status.exceptional { background: rgba(45,212,191,0.15); color: #2dd4bf; }
body.dark .modal-status.strong { background: rgba(129,140,248,0.15); color: #a5b4fc; }
body.dark .modal-status.solid { background: rgba(96,165,250,0.15); color: #93c5fd; }
body.dark .modal-status.promising { background: rgba(56,189,248,0.15); color: #38bdf8; }
body.dark .modal-status.emerging { background: rgba(251,191,36,0.15); color: #fbbf24; }
body.dark .modal-status.developing { background: rgba(251,146,60,0.15); color: #fb923c; }
body.dark .modal-status.early-stage { background: rgba(248,113,113,0.15); color: #f87171; }
body.dark .modal-status.pre-traction { background: rgba(248,113,113,0.12); color: #fca5a5; }

.modal-cat-insight { font-size: 13px; color: var(--ink-mid); line-height: 1.65; }
.improvement-box {
  background: var(--blue-lt); border: 1px solid var(--tag-border);
  border-radius: 12px; padding: 18px 20px; margin-top: 16px;
}
body.dark .improvement-box { border-color: var(--border); }
.improvement-title { font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.improvement-text { font-size: 14px; color: var(--ink-mid); line-height: 1.7; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 80px 48px;
  max-width: 560px; margin: 40px auto; width: 100%;
}
.empty-state.ki-bumper {
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.75) 40%, rgba(255,255,255,0) 100%);
  border: none; border-radius: 0; box-shadow: none;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--blue-lt); border: 1px solid var(--tag-border);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.empty-icon svg { width: 24px; height: 24px; stroke: var(--navy); fill: none; stroke-width: 1.6; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.empty-sub { font-size: 15px; color: var(--ink-mid); margin-bottom: 24px; line-height: 1.6; }

/* ── MISC ── */
.limitation-notice {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px; margin-bottom: 20px;
  font-size: 13px; color: var(--ink-mid); text-align: center;
}

/* ── RESPONSIVE — TABLET (squeezed) ── */
@media (max-width: 1024px) {
  .portal-logo { position: static; padding: 16px 16px 0; align-items: flex-start; }
  .portal-logo img { height: 64px; }
  .portal-logo-sub { font-size: 9px; }
}

/* ── RESPONSIVE — MOBILE ── */
@media (max-width: 600px) {
  .portal-logo { padding: 14px 16px 0; }
  .portal-logo img { height: 48px; }
  .nav-collapsed { top: 16px; }
  .nav-dropdown { top: 56px; }
  .page-wrap { padding: 20px 16px 40px; }
  .gate-card { padding: 36px 24px; }
  .form-card { padding: 24px; }
}

/* ── MOBILE BANNER ── */
.mobile-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  z-index: 400; display: flex; align-items: flex-start; gap: 12px;
  background: var(--navy); color: var(--white);
  border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 8px 32px var(--shadow-color);
  max-width: calc(100vw - 32px); width: 340px;
  opacity: 0; pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
.mobile-banner.visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: all; }
.mobile-banner > svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; opacity: 0.7; }
.mobile-banner-body { flex: 1; min-width: 0; }
.mobile-banner-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.mobile-banner-msg { font-size: 12px; opacity: 0.75; line-height: 1.55; }
.mobile-banner-close {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none; color: var(--white);
  cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  margin-top: -2px; transition: background 0.15s;
}
.mobile-banner-close:hover { background: rgba(255,255,255,0.25); }
@media (min-width: 768px) { .mobile-banner { display: none; } }

/* ── RESPONSIVE — DESKTOP ── */
@media (min-width: 1025px) {
  .portal-logo { position: fixed; top: 20px; left: 32px; padding: 0; }
  .portal-logo img { height: 88px; }
  .portal-logo-sub { font-size: 10px; }
  .page-wrap {
    padding: 120px 64px 80px;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .view { max-width: 960px; }
  .gate-card { padding: 56px 52px; }
}

/* ── RESPONSIVE — 13" LAPTOP (narrow desktop) ──
   Fixed-position logo overlaps the centered .view on viewports ≤1440.
   Shrink the logo (88px→56px) so the centered gate-card clears it without
   shifting the card off the nav-bar center line. */
@media (min-width: 1025px) and (max-width: 1440px) {
  .portal-logo img { height: 56px; }
  .portal-logo-sub { font-size: 9px; }
  .view { max-width: 880px; }
  .gate-card { padding: 48px 44px; }
}

/* ── ERROR TOAST ── */
.error-toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(120px);
  z-index: 500; display: flex; align-items: flex-start; gap: 14px;
  background: var(--white); border: 1.5px solid var(--red-border);
  border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 8px 32px rgba(185,28,28,0.10), 0 2px 8px var(--shadow-accent);
  min-width: 300px; max-width: 420px; width: max-content;
  opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
}
.error-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: all;
}
.error-toast-icon {
  flex-shrink: 0; width: 36px; height: 36px;
  background: var(--red-lt); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
}
.error-toast-icon svg { width: 18px; height: 18px; }
.error-toast-body { flex: 1; min-width: 0; }
.error-toast-title {
  font-family: var(--font); font-size: 14px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.1px; margin-bottom: 3px;
}
.error-toast-msg {
  font-family: var(--font); font-size: 13px; color: var(--ink-lt);
  line-height: 1.55;
}
.error-toast-close {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: none; border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink-lt); transition: all 0.15s ease; margin-top: -2px;
}
.error-toast-close:hover { background: var(--bg); color: var(--ink); }
.error-toast-close svg { width: 13px; height: 13px; }

/* ── UPGRADE WALL ── */
.upgrade-wall {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 32px; gap: 12px;
  border: 1.5px dashed var(--border); border-radius: 14px;
  background: var(--bg);
}
.upgrade-wall-icon { color: var(--navy); opacity: 0.5; margin-bottom: 4px; }
.upgrade-wall-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.upgrade-wall-desc { font-size: 14px; color: var(--ink-lt); max-width: 340px; line-height: 1.55; }
.upgrade-wall-btn {
  margin-top: 8px; display: inline-block; padding: 11px 24px;
  background: var(--navy); color: var(--white); border-radius: 8px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.upgrade-wall-btn:hover { background: var(--navy-deep); transform: translateY(-1px); }

/* ── ONBOARDING WELCOME ── */
.onboarding-welcome {
  max-width: 620px; margin: 0 auto 32px;
}
.onboarding-welcome-inner {
  background: linear-gradient(135deg, #0d0520 0%, #1B3A6B 100%);
  border-radius: 16px; padding: 36px 40px; text-align: center; color: var(--white);
}
.onboarding-star { font-size: 28px; margin-bottom: 12px; opacity: 0.8; }
.onboarding-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.onboarding-sub { font-size: 14px; opacity: 0.8; line-height: 1.6; max-width: 440px; margin: 0 auto 24px; }
.onboarding-steps { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.onboarding-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; opacity: 0.9;
  background: rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 14px;
}
.onboarding-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES — Galaxy theme
   ══════════════════════════════════════════════════════════════════════════════ */

/* Nav */
body.dark .float-nav {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: 0 4px 24px var(--shadow-color), 0 0 0 1px var(--shadow-accent);
}
body.dark .nav-btn { color: var(--ink-mid); }
body.dark .nav-btn:hover { background: rgba(124,58,237,0.14); color: var(--navy); }
body.dark .nav-btn.active { background: rgba(124,58,237,0.28); color: var(--navy); }
body.dark .nav-divider { background: var(--glass-border); }

/* Theme toggle button highlight */
.nav-btn--theme { transition: all 0.18s ease; }
body.dark .nav-btn--theme { color: #c4b5fd; }
body.dark .nav-btn--theme:hover { background: rgba(124,58,237,0.18); }

/* Portal logo */
body.dark .portal-logo img  { filter: brightness(0) invert(1); }
body.dark .portal-logo-sub  { color: var(--ink-lt); }
body.dark .gate-logo img    { filter: brightness(0) invert(1); }

/* ── NOTIFICATION CENTER ─────────────────────────────────────────────────── */
.notif-btn {
  position: fixed; bottom: 24px; left: 24px; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px var(--shadow-color);
  transition: all 0.18s ease;
}
.notif-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px var(--shadow-color); }
.notif-btn svg { width: 18px; height: 18px; stroke: #fff; fill: none; }
body.dark .notif-btn svg { stroke: #fff; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center; color: #fff;
  background: #ef4444; border: 2px solid var(--navy);
  box-sizing: border-box;
  display: none; pointer-events: none;
}
.notif-badge.visible { display: inline-block; }
body.dark .notif-badge { border-color: #0d1330; }
body.dark .notif-btn {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: 0 4px 24px var(--shadow-color), 0 0 0 1px var(--shadow-accent);
}
body.dark .notif-btn:hover { box-shadow: 0 6px 32px var(--shadow-accent), 0 0 0 1px var(--shadow-accent); }

.notif-panel {
  position: fixed; bottom: 80px; left: 24px; z-index: 501;
  width: 360px; max-height: 480px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 56px var(--shadow-color);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.notif-panel.open {
  opacity: 1; pointer-events: all;
  transform: translateY(0) scale(1);
}
body.dark .notif-panel {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: 0 16px 48px var(--shadow-color), 0 0 0 1px var(--shadow-accent);
}

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--border);
}
.notif-panel-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.2px;
}
.notif-header-actions { display: flex; align-items: center; gap: 10px; }
.notif-mark-read {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--navy); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: all 0.15s ease;
}
.notif-mark-read:hover { background: var(--bg); }
body.dark .notif-mark-read { color: #818cf8; }
body.dark .notif-mark-read:hover { background: rgba(124,58,237,0.12); }
.notif-panel-close {
  background: none; border: none; font-size: 20px; color: var(--ink-lt);
  cursor: pointer; padding: 0; line-height: 1;
}
.notif-panel-close:hover { color: var(--ink); }

.notif-panel-tabs {
  display: flex; gap: 2px; padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
}
.notif-tab {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--ink-lt); background: none; border: none;
  padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.notif-tab:hover { color: var(--ink); }
.notif-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
body.dark .notif-tab.active { color: #818cf8; border-bottom-color: #818cf8; }

.notif-panel-body { flex: 1; overflow-y: auto; }
.notif-section { display: none; padding: 20px 18px; }
.notif-section.active { display: block; }

.notif-card {
  padding: 14px 0; border-bottom: 1px solid var(--border);
  position: relative; transition: opacity 0.2s ease;
}
.notif-dismiss {
  background: none; border: none; font-size: 16px; line-height: 1;
  color: var(--ink-lt); cursor: pointer; padding: 0 2px;
  opacity: 0; transition: opacity 0.15s ease, color 0.15s ease;
}
.notif-card:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { color: var(--ink); }

.notif-clear-row {
  display: flex; justify-content: flex-end;
  padding: 8px 0 4px;
}
.notif-clear-btn {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--ink-lt); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: all 0.15s ease;
}
.notif-clear-btn:hover { color: var(--red); background: rgba(239,68,68,0.08); }
body.dark .notif-clear-btn:hover { background: rgba(239,68,68,0.15); }

.notif-empty { text-align: center; padding: 24px 0; }
.notif-empty-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.notif-empty-icon svg { width: 20px; height: 20px; color: var(--ink-lt); }
.notif-empty-text { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.notif-empty-sub { font-size: 13px; color: var(--ink-lt); line-height: 1.55; }

@media (max-width: 600px) {
  .notif-btn { bottom: 16px; left: 16px; width: 40px; height: 40px; }
  .notif-panel { left: 12px; right: 12px; width: auto; bottom: 68px; max-height: 60vh; }
}

/* ── ADMIN BADGE ─────────────────────────────────────────────────────────── */
.admin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #f97316;
  background: rgba(249,115,22,0.10);
  border: 1px solid rgba(249,115,22,0.35);
  border-radius: 99px; padding: 2px 8px; margin-top: 4px;
  box-shadow: 0 0 8px rgba(249,115,22,0.35);
  transition: box-shadow 0.3s ease, color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  cursor: pointer; user-select: none;
}
body.dark .admin-badge {
  background: rgba(249,115,22,0.12);
  box-shadow: 0 0 12px rgba(249,115,22,0.55), 0 0 28px rgba(249,115,22,0.18);
}

/* Admin badge disabled state (click-toggle) */
.admin-badge.admin-badge--off {
  color: var(--ink-lt);
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
}
body.dark .admin-badge.admin-badge--off {
  color: var(--ink-lt);
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
}

/* ── ADMIN NAV BUTTONS ───────────────────────────────────────────────────── */
.nav-btn--admin { color: #f97316 !important; }
.nav-btn--admin:hover { background: rgba(249,115,22,0.12) !important; color: #fb923c !important; }
.nav-btn--admin.active { background: rgba(249,115,22,0.18) !important; color: #f97316 !important; }
body.dark .nav-btn--admin { color: #fb923c !important; }
body.dark .nav-btn--admin:hover { background: rgba(249,115,22,0.16) !important; }
.nav-dd-btn--admin { color: #f97316 !important; }
.nav-dd-btn--admin:hover { background: rgba(249,115,22,0.12) !important; color: #fb923c !important; }
body.dark .nav-dd-btn--admin { color: #fb923c !important; }

/* Gate / form cards */
body.dark .gate-card,
body.dark .form-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.40);
}
body.dark .gate-input {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--ink);
}
body.dark .gate-input::placeholder { color: var(--ink-lt); }
body.dark .gate-input:focus { border-color: var(--blue); background: rgba(99,102,241,0.06); }
body.dark .gate-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 14px rgba(109,40,217,0.35);
}
body.dark .gate-btn:hover { filter: brightness(1.12); }
/* Launch button: --white is remapped to dark navy in dark mode, so force true white text */
body.dark .launch-btn { color: #ffffff; }
body.dark .launch-sub { color: var(--ink-mid); }

/* Modals */
body.dark .modal {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
}
body.dark .modal-overlay { background: rgba(4,7,20,0.65); }

/* Account overlay */
body.dark .account-overlay { background: rgba(4,7,20,0.60); }
body.dark .account-overlay-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
}

/* Cards & tiles */
body.dark .form-card,
body.dark .history-card,
body.dark .rival-card {
  background: var(--white);
  border-color: var(--border);
}
body.dark .rival-card:hover { border-color: rgba(124,58,237,0.40); }
body.dark .rival-history-toggle { background: var(--bg); border-color: var(--border); }
body.dark .rival-intel-toggle { background: var(--blue-lt); }

/* Scorecard */
body.dark .scorecard {
  background: var(--white);
  border-color: var(--border);
}

/* Error toast */
body.dark .error-toast {
  background: var(--white);
  border-color: rgba(248,113,113,0.30);
  box-shadow: 0 8px 32px rgba(0,0,0,0.40);
}

/* KI banner */
body.dark .ki-banner {
  background: var(--white);
  border-color: var(--border);
}
body.dark .ki-banner--success { border-left-color: var(--green); }
body.dark .ki-banner--error   { border-left-color: var(--red);   }
body.dark .ki-banner--info    { border-left-color: var(--blue);  }

/* Loading view */
body.dark .loading-wrap { color: var(--ink); }
body.dark .loading-bar-track { background: rgba(124,58,237,0.15); }
body.dark .loading-bar-fill  { background: linear-gradient(90deg, #4f46e5, #7c3aed); }

/* Method strip */
body.dark .method-strip {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.20);
}

/* Upgrade wall */
body.dark .upgrade-wall { background: rgba(99,102,241,0.06); border-color: var(--border); }

/* ── Profile badge (Established vs Growth) — mirrors pv-primitives ─────── */
.profile-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-family: var(--mono, 'DM Mono', monospace); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: #a0a0a8; vertical-align: middle; cursor: help;
}
.profile-badge::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.profile-badge--established { color: #C9A54A; border-color: rgba(201,165,74,0.35); background: rgba(201,165,74,0.08); }
.profile-badge--growth      { color: #4A9EC9; border-color: rgba(74,158,201,0.35); background: rgba(74,158,201,0.08); }
body:not(.dark) .profile-badge--established { color: #8A6F1F; background: rgba(201,165,74,0.12); }
body:not(.dark) .profile-badge--growth      { color: #2A6E8E; background: rgba(74,158,201,0.12); }
