/* ═══════════════════════════════════════════════════════════
   APP LAYOUT SYSTEM — vibrationalidentity.com
   Bottom nav SPA shell, auth splash, profile cards, sections
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Auth Splash Screen ───────────────────────────────────── */
#auth-splash {
  position: fixed; inset: 0; z-index: 9000;
  background: radial-gradient(ellipse at 30% 20%, #2a0a5e 0%, #0e0228 40%, #060114 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px 60px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
}
#auth-splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-disabled #auth-splash,
.auth-disabled #auth-overlay { display: none !important; }

/* Splash background orbs */
.splash-orb {
  position: absolute; border-radius: 50%; pointer-events: none; filter: blur(80px);
}
.splash-orb-1 {
  width: 500px; height: 500px; top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(135,22,217,0.35) 0%, transparent 70%);
  animation: sOrb 8s ease-in-out infinite;
}
.splash-orb-2 {
  width: 400px; height: 400px; bottom: -100px; right: -80px;
  background: radial-gradient(circle, rgba(56,22,180,0.3) 0%, transparent 70%);
  animation: sOrb 10s ease-in-out infinite reverse;
}
@keyframes sOrb { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px, -20px) scale(1.05); } }

/* Splash logo */
.splash-logo-ring {
  width: 90px; height: 90px; border-radius: 50%;
  border: 2px solid rgba(135,22,217,0.5);
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-bottom: 24px;
  box-shadow: 0 0 40px rgba(135,22,217,0.3), inset 0 0 20px rgba(135,22,217,0.1);
}
.splash-logo-ring::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(135,22,217,0.2);
  animation: rotateSlow 12s linear infinite;
}
@keyframes rotateSlow { to { transform: rotate(360deg); } }
.splash-logo-icon { font-size: 36px; line-height: 1; }

/* Splash text */
.splash-brand { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; color: #fff; text-align: center; margin-bottom: 10px; letter-spacing: -0.02em; }
.splash-tagline { font-size: 14px; color: rgba(255,255,255,0.45); text-align: center; line-height: 1.6; max-width: 280px; margin-bottom: 48px; }

/* Splash CTAs */
.splash-cta-group { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; }
.splash-btn-primary {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #8716d9 0%, #5a2da0 100%);
  border: none; border-radius: 16px; color: #fff;
  font-size: 16px; font-weight: 700; font-family: 'Outfit', sans-serif;
  cursor: pointer; transition: all 0.25s ease;
  box-shadow: 0 8px 30px rgba(135,22,217,0.45);
  letter-spacing: 0.01em;
}
.splash-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(135,22,217,0.55); }
.splash-btn-secondary {
  width: 100%; padding: 15px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 16px; color: #fff;
  font-size: 16px; font-weight: 600; font-family: 'Outfit', sans-serif;
  cursor: pointer; transition: all 0.2s ease;
}
.splash-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.splash-guest-link {
  background: none; border: none; color: rgba(255,255,255,0.3);
  font-size: 13px; cursor: pointer; margin-top: 16px; transition: color 0.2s;
  font-family: inherit; padding: 8px; text-decoration: underline;
}
.splash-guest-link:hover { color: rgba(255,255,255,0.55); }

/* ── App Shell ────────────────────────────────────────────── */
#app-shell {
  display: flex; flex-direction: column; min-height: 100vh;
  padding-bottom: 80px; /* space for bottom nav */
}

/* ── Tab Panels ───────────────────────────────────────────── */
.tab-panel { display: none; min-height: calc(100vh - 80px); }
.tab-panel.active { display: block; }

/* ── Bottom Navigation ────────────────────────────────────── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 80px;
  background: rgba(10, 3, 24, 0.97);
  border-top: 1px solid rgba(135,22,217,0.2);
  backdrop-filter: blur(20px);
  display: flex; align-items: center;
  z-index: 900; padding: 0 4px 8px;
}
/* Tab groups equalize space so + is truly centered */
.nav-left-group, .nav-right-group {
  display: flex; align-items: center; justify-content: space-around;
  flex: 1; height: 100%;
}
.nav-tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; flex: 1; padding: 8px 4px; border: none; background: none;
  color: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.2s ease;
  font-family: 'Inter', sans-serif; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab-btn:hover { color: rgba(255,255,255,0.7); }
.nav-tab-btn.active { color: #a855f7; }
.nav-tab-btn .tab-icon { font-size: 22px; line-height: 1; transition: transform 0.2s; }
.nav-tab-btn.active .tab-icon { transform: scale(1.15); }
.nav-tab-btn .tab-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
/* Active indicator dot */
.nav-tab-btn.active::after {
  content: ''; display: block; width: 4px; height: 4px; border-radius: 50%;
  background: #a855f7; position: absolute; bottom: 6px;
}
.nav-tab-btn { position: relative; }

/* Center + button */
#add-person-nav-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: 3px solid rgba(10,3,24,0.96);
  box-shadow: 0 4px 20px rgba(135,22,217,0.55);
  display: flex; align-items: center; justify-content: center;
  flex: none; cursor: pointer; transition: all 0.25s ease;
  margin-bottom: 12px; margin-top: -22px;
  position: relative; z-index: 901;
}
#add-person-nav-btn:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 8px 28px rgba(135,22,217,0.65); }
#add-person-nav-btn svg { width: 26px; height: 26px; color: #fff; }

/* ── HOME PANEL ───────────────────────────────────────────── */
#home-panel { padding: 0; }

.profile-hero-header {
  position: relative;
  z-index: 10;
  padding: 24px 20px 10px;
}

.profile-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(135,22,217,0.22), rgba(18,8,64,0.72));
  border: 1px solid rgba(135,22,217,0.24);
  box-shadow: 0 18px 50px rgba(9, 3, 24, 0.35);
  overflow: hidden;
}

.profile-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 28%, rgba(0,191,255,0.18), transparent 32%),
    radial-gradient(circle at 84% 16%, rgba(135,22,217,0.24), transparent 30%);
  pointer-events: none;
}

.profile-hero-avatar {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00bfff, #8716d9);
  border: 2px solid rgba(255,255,255,0.16);
  box-shadow: 0 8px 24px rgba(0, 191, 255, 0.18);
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}

.profile-hero-avatar-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

.profile-hero-info {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.profile-hero-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.profile-hero-sub {
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255,255,255,0.56);
}

.profile-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.82);
  text-transform: uppercase;
}

.profile-badge--secondary {
  color: rgba(110, 231, 160, 0.95);
  border-color: rgba(110, 231, 160, 0.22);
  background: rgba(110, 231, 160, 0.08);
}

.profile-hero-actions {
  position: relative;
  z-index: 1;
}

.profile-hero-edit-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.profile-hero-edit-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.home-dashboard-strip {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: stretch;
}

.home-summary-card,
.home-explore-panel {
  position: relative;
  padding: 22px 22px 20px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(18,4,48,0.92), rgba(14,2,40,0.78));
  border: 1px solid rgba(135,22,217,0.22);
  box-shadow: 0 16px 42px rgba(5, 1, 15, 0.26);
  overflow: hidden;
}

.home-summary-card::before,
.home-explore-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), transparent 38%);
  pointer-events: none;
}

.home-summary-eyebrow,
.home-explore-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,191,255,0.82);
}

.home-summary-title,
.home-explore-title {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.06;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.home-summary-sub {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.62);
}

.home-summary-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.home-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

.home-summary-cta,
.home-explore-link {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(135,22,217,0.28);
  background: linear-gradient(135deg, rgba(135,22,217,0.92), rgba(90,45,160,0.86));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.home-summary-cta:hover,
.home-explore-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(135,22,217,0.24);
}

.home-explore-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.home-explore-title {
  margin-top: 8px;
  font-size: 20px;
}

.home-explore-link {
  margin-top: 0;
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.72);
  font-family: inherit;
}

.home-explore-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-explore-option {
  min-height: 88px;
}

.home-explore-option--pending {
  border-color: rgba(0,191,255,0.22);
}

.home-explore-option--pending .rc-option-desc {
  color: rgba(0,191,255,0.78);
}

.panel-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 16px;
}

.panel-topbar--split {
  justify-content: space-between;
}

.panel-topbar-copy {
  min-width: 0;
  flex: 1;
}

.panel-topbar-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.panel-topbar-sub {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.46);
}

.panel-topbar-meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(168,85,247,0.82);
  text-transform: uppercase;
}

.panel-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: all 0.2s ease;
}

.panel-back-btn:hover {
  background: rgba(255,255,255,0.12);
}

/* Home header strip */
.home-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.home-greeting { font-size: 13px; color: rgba(255,255,255,0.45); }
.home-user-name { font-size: 20px; font-weight: 700; color: #fff; font-family: 'Outfit', sans-serif; }
.home-avatar-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: 2px solid rgba(135,22,217,0.4); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.home-avatar-btn:hover { transform: scale(1.05); }

/* ── PROFILES PANEL ───────────────────────────────────────── */
#profiles-panel { padding: 0; }

.profiles-header {
  padding: 24px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.profiles-title { font-size: 22px; font-weight: 800; color: #fff; font-family: 'Outfit', sans-serif; }
.profiles-count { font-size: 13px; color: rgba(255,255,255,0.4); }

/* Profile card grid */
.profiles-grid {
  padding: 4px 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.profile-card {
  background: rgba(135,22,217,0.07);
  border: 1px solid rgba(135,22,217,0.18);
  border-radius: 18px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-card:hover { background: rgba(135,22,217,0.14); border-color: rgba(135,22,217,0.35); transform: translateY(-1px); }
.profile-card-avatar {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(135,22,217,0.5), rgba(90,45,160,0.5));
  border: 2px solid rgba(135,22,217,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
}
.profile-card-info { flex: 1; min-width: 0; }
.profile-card-name { font-size: 16px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card-meta { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.profile-card-py {
  font-size: 28px; font-weight: 800; color: #a855f7;
  font-family: 'Outfit', sans-serif; flex-shrink: 0;
}
.profile-card-actions { display: flex; gap: 6px; align-items: center; }
.profile-card-delete-btn {
  background: none; border: none; color: rgba(255,255,255,0.2);
  cursor: pointer; padding: 6px; border-radius: 8px; transition: all 0.2s; font-size: 15px;
}
.profile-card-delete-btn:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

/* Empty profiles state */
.profiles-empty {
  text-align: center; padding: 60px 24px;
}
.profiles-empty-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.profiles-empty-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; font-family: 'Outfit', sans-serif; }
.profiles-empty-sub { font-size: 14px; color: rgba(255,255,255,0.4); line-height: 1.6; margin-bottom: 24px; }
.profiles-empty-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: none; border-radius: 14px; color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(135,22,217,0.35);
}
.profiles-empty-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(135,22,217,0.5); }

.ai-panel-topbar {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 4px 16px;
  align-items: flex-start;
}

.ai-context-switch-btn,
.ai-pill-btn,
.ai-toolbar-btn,
.ai-send-btn,
.ai-empty-secondary-btn {
  font-family: inherit;
}

#ai-panel {
  padding: 0 16px 28px;
}

.ai-context-switch-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.ai-advisor-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.15fr);
  grid-template-areas:
    "context thread"
    "quick thread"
    "composer thread";
  gap: 18px;
  align-items: start;
}

.ai-advisor-context-card,
.ai-advisor-quick-row,
.ai-advisor-thread-wrap,
.ai-advisor-composer-card {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(18,4,48,0.94), rgba(12,2,34,0.82));
  border: 1px solid rgba(135,22,217,0.22);
  box-shadow: 0 16px 42px rgba(5, 1, 15, 0.26);
  overflow: hidden;
}

.ai-advisor-context-card::before,
.ai-advisor-quick-row::before,
.ai-advisor-thread-wrap::before,
.ai-advisor-composer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), transparent 42%);
  pointer-events: none;
}

.ai-advisor-context-card {
  grid-area: context;
  padding: 22px;
}

.ai-advisor-context-eyebrow,
.ai-advisor-quick-label,
.ai-composer-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(0,191,255,0.86);
}

.ai-advisor-context-title {
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.08;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.ai-advisor-context-sub {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.62);
}

.ai-advisor-context-actions,
.ai-composer-toolbar,
.ai-advisor-quick-list,
.ai-related-context-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-advisor-context-actions {
  margin-top: 18px;
}

.ai-pill-btn,
.ai-toolbar-btn,
.ai-empty-secondary-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ai-pill-btn:hover,
.ai-toolbar-btn:hover,
.ai-empty-secondary-btn:hover,
.ai-context-switch-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.18);
}

.ai-pill-btn--secondary,
.ai-toolbar-btn--secondary {
  color: rgba(0,191,255,0.9);
  border-color: rgba(0,191,255,0.2);
  background: rgba(0,191,255,0.08);
}

.ai-advisor-quick-row {
  grid-area: quick;
  padding: 18px 20px 20px;
}

.ai-advisor-quick-list {
  margin-top: 14px;
}

.ai-quick-prompt-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(135,22,217,0.24);
  background: rgba(135,22,217,0.09);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ai-quick-prompt-btn:hover {
  transform: translateY(-1px);
  background: rgba(135,22,217,0.16);
  border-color: rgba(135,22,217,0.38);
}

.ai-advisor-thread-wrap {
  grid-area: thread;
  min-height: 640px;
  padding: 18px;
}

.ai-thread {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 604px;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 6px;
}

.ai-thread::-webkit-scrollbar {
  width: 6px;
}

.ai-thread::-webkit-scrollbar-thumb {
  background: rgba(135,22,217,0.28);
  border-radius: 999px;
}

.ai-message {
  max-width: min(92%, 680px);
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.ai-message--assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);
}

.ai-message--user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(135,22,217,0.95), rgba(90,45,160,0.88));
  color: #fff;
  box-shadow: 0 10px 26px rgba(135,22,217,0.22);
}

.ai-message--error {
  border-color: rgba(255,107,107,0.24);
  background: rgba(255,107,107,0.08);
}

.ai-message-role {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(255,255,255,0.7);
}

.ai-message-body {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
  color: inherit;
  text-align: left;
}

.ai-inline-mention,
.ai-related-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,191,255,0.18);
  background: rgba(0,191,255,0.08);
  color: rgba(0,191,255,0.92);
  font-size: 12px;
  font-weight: 700;
}

.ai-related-context-bar {
  min-height: 0;
  margin-bottom: 0;
}

.ai-related-context-bar.visible {
  min-height: 30px;
  margin-bottom: 14px;
}

.ai-message-meta-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.ai-message-meta-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(0,191,255,0.84);
}

.ai-message-meta-line,
.ai-message-follow-up,
.ai-composer-hint,
.ai-empty-sub,
.ai-empty-tip {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.62);
  text-align: left;
}

.ai-message-follow-up {
  margin-top: 12px;
  color: rgba(255,255,255,0.76);
}

.ai-advisor-composer-card {
  grid-area: composer;
  padding: 20px;
  position: sticky;
  bottom: 92px;
}

.ai-composer-stack {
  position: relative;
  z-index: 1;
  margin-top: 14px;
}

.ai-message-input,
.ai-profile-picker-search {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  min-height: 132px;
}

.ai-message-input:focus,
.ai-profile-picker-search:focus {
  outline: none;
  border-color: rgba(0,191,255,0.34);
  box-shadow: 0 0 0 3px rgba(0,191,255,0.12);
}

.ai-message-input::placeholder,
.ai-profile-picker-search::placeholder {
  color: rgba(255,255,255,0.3);
}

.ai-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  max-height: 240px;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(135,22,217,0.22);
  background: rgba(10, 3, 24, 0.98);
  box-shadow: 0 20px 46px rgba(0,0,0,0.34);
  padding: 8px;
  z-index: 6;
}

.ai-mention-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
}

.ai-mention-option:hover {
  background: rgba(135,22,217,0.14);
}

.ai-mention-option-name {
  font-size: 14px;
  font-weight: 700;
}

.ai-mention-option-meta,
.ai-profile-picker-option-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.46);
}

.ai-composer-footer {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.ai-composer-hint {
  margin-top: 0;
  flex: 1;
}

.ai-send-btn {
  min-width: 118px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(135,22,217,0.95), rgba(0,191,255,0.8));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(135,22,217,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(135,22,217,0.34);
}

.ai-send-btn:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.ai-empty-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 26px;
  border-radius: 20px;
  border: 1px dashed rgba(135,22,217,0.24);
  background: rgba(255,255,255,0.03);
}

.ai-empty-state--loading {
  align-items: center;
  text-align: center;
}

.ai-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,191,255,0.18), rgba(135,22,217,0.26));
  border: 1px solid rgba(0,191,255,0.18);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.ai-empty-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.ai-empty-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-empty-tip {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.ai-loading-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,191,255,0.92), rgba(135,22,217,0.7) 58%, rgba(10,3,24,0) 70%);
  box-shadow: 0 0 28px rgba(135,22,217,0.28);
  animation: aiPulse 1.2s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

#ai-profile-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.64);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#ai-profile-picker-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.ai-profile-picker-sheet {
  width: 100%;
  max-width: 520px;
  padding: 22px 22px 26px;
  border-radius: 28px 28px 22px 22px;
  background: linear-gradient(160deg, #120430 0%, #1e0a44 100%);
  border: 1px solid rgba(135,22,217,0.26);
  transform: translateY(30px);
  transition: transform 0.35s ease;
}

#ai-profile-picker-overlay.visible .ai-profile-picker-sheet {
  transform: translateY(0);
}

.ai-profile-picker-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  margin: 0 auto 20px;
  background: rgba(255,255,255,0.16);
}

.ai-profile-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.ai-profile-picker-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.ai-profile-picker-sub {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
}

.ai-profile-picker-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.76);
}

.ai-profile-picker-search {
  min-height: 0;
  margin-bottom: 14px;
}

.ai-profile-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 48vh;
  overflow-y: auto;
}

.ai-profile-picker-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(135,22,217,0.16);
  background: rgba(135,22,217,0.08);
  color: #fff;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ai-profile-picker-option:hover,
.ai-profile-picker-option.active {
  transform: translateY(-1px);
  border-color: rgba(0,191,255,0.22);
  background: rgba(0,191,255,0.1);
}

.ai-profile-picker-option-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.ai-profile-picker-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.54);
  font-size: 13px;
  line-height: 1.6;
}

/* ── PROFILE DETAIL VIEW ──────────────────────────────────── */
#profile-detail-panel {
  display: none; position: fixed; inset: 0; z-index: 800;
  background: #060114;
  flex-direction: column; overflow: hidden;
}
#profile-detail-panel.open { display: flex; }

.profile-detail-header {
  padding: 20px 20px 0;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.profile-detail-back {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background 0.2s; flex-shrink: 0;
}
.profile-detail-back:hover { background: rgba(255,255,255,0.12); }
.profile-detail-title { flex: 1; }
.profile-detail-name { font-size: 18px; font-weight: 700; color: #fff; font-family: 'Outfit', sans-serif; }
.profile-detail-dob { font-size: 12px; color: rgba(255,255,255,0.4); }

/* Profile detail hero */
.profile-detail-hero {
  padding: 20px 20px 0;
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}
.profile-detail-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: 3px solid rgba(135,22,217,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.profile-detail-stats { flex: 1; }
.profile-detail-py-label { font-size: 11px; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; }
.profile-detail-py-num { font-size: 42px; font-weight: 800; color: #a855f7; font-family: 'Outfit', sans-serif; line-height: 1; }
.profile-detail-py-title { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Section pill tabs */
.section-tabs {
  display: flex; gap: 8px;
  padding: 16px 20px 0; overflow-x: auto;
  scrollbar-width: none; flex-shrink: 0;
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab-pill {
  padding: 8px 16px; border-radius: 20px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  font-family: inherit;
}
.section-tab-pill:hover { color: rgba(255,255,255,0.8); border-color: rgba(135,22,217,0.3); }
.section-tab-pill.active {
  background: rgba(135,22,217,0.25); border-color: rgba(135,22,217,0.5);
  color: #c084fc;
}

/* Section content area */
.section-content-area { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.section-content-area::-webkit-scrollbar { width: 4px; }
.section-content-area::-webkit-scrollbar-thumb { background: rgba(135,22,217,0.3); border-radius: 2px; }

.section-pane { display: none; }
.section-pane.active { display: block; }

/* Section dividers */
.section-card {
  background: rgba(135,22,217,0.07); border: 1px solid rgba(135,22,217,0.18);
  border-radius: 16px; padding: 18px; margin-bottom: 14px;
}
.section-card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(135,22,217,0.8); margin-bottom: 10px; }
.section-card-text { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.7; }

/* ── ADD PERSON MODAL ─────────────────────────────────────── */
#add-person-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  padding: 20px;
}
#add-person-overlay.visible { opacity: 1; pointer-events: all; }

.add-person-sheet {
  background: linear-gradient(160deg, #120430 0%, #1e0a44 100%);
  border: 1px solid rgba(135,22,217,0.3);
  border-radius: 28px 28px 24px 24px; padding: 32px 28px 36px;
  width: 100%; max-width: 500px;
  transform: translateY(40px); transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  position: relative;
}
#add-person-overlay.visible .add-person-sheet { transform: translateY(0); }

.add-person-handle {
  width: 40px; height: 4px; background: rgba(255,255,255,0.15);
  border-radius: 2px; margin: 0 auto 24px;
}
.add-person-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; font-family: 'Outfit', sans-serif; }
.add-person-sub { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 24px; line-height: 1.5; }

.add-person-close {
  position: absolute; top: 20px; right: 20px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.add-person-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Name row for add person */
.add-person-name-row { display: flex; gap: 10px; margin-bottom: 14px; }
.add-person-field { flex: 1; }
.add-person-field.flex-2 { flex: 2; }
.add-person-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.45); margin-bottom: 7px; }
.add-person-input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; color: #fff; font-size: 14px; font-family: inherit;
  transition: all 0.2s; box-sizing: border-box;
}
.add-person-input:focus { outline: none; border-color: rgba(135,22,217,0.6); background: rgba(135,22,217,0.08); box-shadow: 0 0 0 3px rgba(135,22,217,0.12); }
.add-person-input::placeholder { color: rgba(255,255,255,0.2); }

.add-person-submit {
  display: block; width: 100%; padding: 15px; margin-top: 8px;
  background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: none; border-radius: 14px; color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.25s; font-family: 'Outfit', sans-serif;
  box-shadow: 0 8px 24px rgba(135,22,217,0.4);
}
.add-person-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(135,22,217,0.5); }
.add-person-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.add-person-error { font-size: 13px; color: #ff8080; margin-top: 8px; min-height: 18px; text-align: center; }

/* ── FORENSICS PANEL ──────────────────────────────────────── */
#forensics-panel { padding: 0; }

.forensics-header {
  padding: 24px 20px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.forensics-title { font-size: 22px; font-weight: 800; color: #fff; font-family: 'Outfit', sans-serif; margin-bottom: 4px; }
.forensics-sub { font-size: 13px; color: rgba(255,255,255,0.4); }

.forensics-section-label {
  padding: 6px 20px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(135,22,217,0.7);
}
.forensics-cards { padding: 0 16px 24px; display: flex; flex-direction: column; gap: 14px; }

.forensics-card {
  background: rgba(135,22,217,0.07); border: 1px solid rgba(135,22,217,0.2);
  border-radius: 20px; padding: 22px; cursor: pointer;
  transition: all 0.2s ease; display: flex; align-items: center; gap: 16px;
  text-decoration: none;
}
.forensics-card:hover { background: rgba(135,22,217,0.14); border-color: rgba(135,22,217,0.4); transform: translateY(-2px); }
.forensics-card-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.forensics-card-icon.death { background: linear-gradient(135deg, rgba(180,22,22,0.3), rgba(100,10,10,0.3)); border: 1px solid rgba(200,40,40,0.25); }
.forensics-card-icon.chart { background: linear-gradient(135deg, rgba(135,22,217,0.3), rgba(60,18,130,0.3)); border: 1px solid rgba(135,22,217,0.25); }
.forensics-card-text { flex: 1; }
.forensics-card-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.forensics-card-desc { font-size: 13px; color: rgba(255,255,255,0.45); line-height: 1.5; }
.forensics-card-arrow { color: rgba(255,255,255,0.3); font-size: 18px; flex-shrink: 0; }

/* Forensics warning badge */
.forensics-warning {
  margin: 0 16px 16px;
  background: rgba(200,40,40,0.08); border: 1px solid rgba(200,40,40,0.2);
  border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.forensics-warning-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.forensics-warning-text { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.6; }

/* ── Unlock required state in panels ──────────────────────── */
.unlock-required-card {
  margin: 16px; background: rgba(135,22,217,0.07);
  border: 1px dashed rgba(135,22,217,0.3); border-radius: 20px;
  padding: 32px 24px; text-align: center;
}
.unlock-required-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.unlock-required-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.unlock-required-sub { font-size: 13px; color: rgba(255,255,255,0.4); line-height: 1.6; margin-bottom: 20px; }
.unlock-required-btn {
  padding: 11px 28px; background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: none; border-radius: 12px; color: #fff; font-size: 14px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(135,22,217,0.4); transition: all 0.2s;
}
.unlock-required-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(135,22,217,0.5); }

/* ── Account sheet (tapping avatar) ───────────────────────── */
#account-sheet-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  display: flex; align-items: flex-end; justify-content: center; padding: 20px;
}
#account-sheet-overlay.visible { opacity: 1; pointer-events: all; }
.account-sheet {
  background: linear-gradient(160deg, #120430 0%, #1e0a44 100%);
  border: 1px solid rgba(135,22,217,0.25); border-radius: 28px 28px 24px 24px;
  padding: 28px 24px 32px; width: 100%; max-width: 460px;
  transform: translateY(30px); transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}
#account-sheet-overlay.visible .account-sheet { transform: translateY(0); }
.account-sheet-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; margin: 0 auto 22px; }
.account-sheet-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.account-sheet-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #8716d9, #5a2da0); border: 2px solid rgba(135,22,217,0.4); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; flex-shrink: 0; }
.account-sheet-name { font-size: 17px; font-weight: 700; color: #fff; }
.account-sheet-email { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.account-sheet-unlocked { display: inline-flex; align-items: center; gap: 4px; background: rgba(50,200,100,0.1); border: 1px solid rgba(50,200,100,0.25); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 600; color: #6ee7a0; margin-top: 4px; }
.account-sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.account-sheet-action-btn {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
  display: flex; align-items: center; gap: 10px;
}
.account-sheet-action-btn.unlock-btn {
  background: rgba(135,22,217,0.15); border: 1px solid rgba(135,22,217,0.3); color: #c084fc;
}
.account-sheet-action-btn.unlock-btn:hover { background: rgba(135,22,217,0.25); }
.account-sheet-action-btn.logout-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.55);
}
.account-sheet-action-btn.logout-btn:hover { background: rgba(255,80,80,0.1); border-color: rgba(255,80,80,0.2); color: #ff8080; }

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Section PY badge (large) ─────────────────────────────── */
.section-py-badge-lg {
  font-size: 64px; font-weight: 900; color: #a855f7;
  font-family: 'Outfit', sans-serif; line-height: 1;
  text-align: center; margin: 10px 0 14px;
  text-shadow: 0 0 40px rgba(168,85,247,0.5);
}

/* ── Results Choice Overlay ───────────────────────────────── */
#results-choice-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(12px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#results-choice-overlay.visible { opacity: 1; pointer-events: all; }

.results-choice-sheet {
  background: linear-gradient(160deg, #0e0228 0%, #180840 50%, #0e0228 100%);
  border: 1px solid rgba(135,22,217,0.3);
  border-radius: 28px 28px 0 0;
  padding: 20px 24px 40px;
  width: 100%; max-width: 560px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 -20px 60px rgba(135,22,217,0.25);
}
#results-choice-overlay.visible .results-choice-sheet { transform: translateY(0); }

.results-choice-handle {
  width: 44px; height: 4px; background: rgba(255,255,255,0.15);
  border-radius: 2px; margin: 0 auto 20px;
}
.results-choice-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.results-choice-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #8716d9, #5a2da0);
  border: 2px solid rgba(135,22,217,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}
.results-choice-greeting { font-size: 13px; color: rgba(255,255,255,0.5); }
.results-choice-greeting span { color: #fff; font-weight: 700; }
.results-choice-py { font-size: 18px; font-weight: 800; color: #a855f7; font-family: 'Outfit', sans-serif; margin-top: 2px; }
.results-choice-py span { font-size: 28px; }
.results-choice-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(168,85,247,0.7); margin-bottom: 12px;
}
.results-choice-grid { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }

.rc-option {
  width: 100%; display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 16px;
  background: rgba(135,22,217,0.08); border: 1px solid rgba(135,22,217,0.18);
  cursor: pointer; transition: all 0.2s ease; text-align: left;
  font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
}
.rc-option:hover {
  background: rgba(135,22,217,0.18); border-color: rgba(135,22,217,0.4);
  transform: translateY(-1px);
}
.rc-option:active { transform: scale(0.98); }
.rc-option-icon { font-size: 24px; line-height: 1; flex-shrink: 0; width: 34px; text-align: center; }
.rc-option-text { flex: 1; }
.rc-option-title { font-size: 15px; font-weight: 700; color: #fff; }
.rc-option-desc { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 1px; }
.rc-option-arrow { font-size: 22px; color: rgba(135,22,217,0.6); flex-shrink: 0; transition: transform 0.2s; }
.rc-option:hover .rc-option-arrow { transform: translateX(4px); color: #a855f7; }

.rc-close-btn {
  display: block; width: 100%; padding: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; color: rgba(255,255,255,0.45);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.rc-close-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }

/* ── Save profile button saved state ─────────────────────── */
#save-profile-btn.saved {
  background: rgba(50,200,100,0.1);
  border-color: rgba(50,200,100,0.3);
  color: #6ee7a0;
}

@media (max-width: 960px) {
  .home-dashboard-strip {
    grid-template-columns: 1fr;
  }

  .ai-advisor-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "context"
      "quick"
      "thread"
      "composer";
  }

  .ai-advisor-thread-wrap {
    min-height: 0;
  }

  .ai-thread {
    min-height: 420px;
    max-height: none;
  }

  .ai-advisor-composer-card {
    position: relative;
    bottom: auto;
  }
}

@media (max-width: 720px) {
  .profile-hero-content {
    padding: 16px;
    border-radius: 20px;
  }

  .profile-hero-name {
    font-size: 18px;
  }

  .home-summary-title {
    font-size: 22px;
  }

  .home-explore-grid {
    grid-template-columns: 1fr;
  }

  .panel-topbar-meta {
    display: none;
  }

  #ai-panel {
    padding-inline: 12px;
  }

  .ai-panel-topbar {
    padding-inline: 2px;
    gap: 12px;
  }

  .ai-context-switch-btn {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 11px;
  }

  .ai-advisor-context-title,
  .ai-empty-title {
    font-size: 22px;
  }

  .ai-advisor-thread-wrap,
  .ai-advisor-context-card,
  .ai-advisor-quick-row,
  .ai-advisor-composer-card {
    border-radius: 20px;
  }

  .ai-composer-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-send-btn {
    width: 100%;
  }

  .ai-thread {
    min-height: 360px;
  }
}
