/**
 * Exodus-inspired app shell — Portfolio + Thermocool operations
 * Distinct from SpaceX IR marketing site chrome.
 */
:root {
  --exodus-bg: #0c0c0f;
  --exodus-bg-elevated: #121218;
  --exodus-card: #16161d;
  --exodus-card-hover: #1c1c24;
  --exodus-line: rgba(255, 255, 255, 0.08);
  --exodus-line-strong: rgba(255, 255, 255, 0.14);
  --exodus-text: #f4f4f8;
  --exodus-muted: rgba(244, 244, 248, 0.55);
  --exodus-accent: #8b7cff;
  --exodus-accent-soft: rgba(139, 124, 255, 0.18);
  --exodus-green: #3dd68c;
  --exodus-red: #f87171;
  --exodus-radius: 16px;
  --exodus-radius-sm: 10px;
  --exodus-tab-h: calc(3.65rem + env(safe-area-inset-bottom, 0px));
  --exodus-top-h: calc(3.25rem + env(safe-area-inset-top, 0px));
}

/* Post-login investor home: hero only — hide scroll content below hero via CSS (not JS) */
body.investor-home-ready #root section.min-h-screen ~ section:not(.ir-spa-block),
body.investor-authenticated.investor-home-ready #root section.min-h-screen ~ section:not(.ir-spa-block) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.investor-home-ready #root section.min-h-screen,
body.investor-home-ready #root section.ir-investor-hero {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: min(70dvh, 100vh) !important;
}

body.investor-home-ready #root section.min-h-screen .ir-reveal,
body.investor-home-ready #root section.ir-investor-hero .ir-reveal,
body.investor-home-ready #root section.min-h-screen h1,
body.investor-home-ready #root section.min-h-screen h2,
body.investor-home-ready #root section.min-h-screen p,
body.investor-home-ready #root section.min-h-screen .aspect-video,
body.investor-home-ready #root section.min-h-screen video {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Post-login investor home: hero video only — no injected IR marketing blocks */
html.access-granted #mandate-ir-investors,
html.access-granted #mandate-ir-resources,
body.investor-authenticated #mandate-ir-investors,
body.investor-authenticated #mandate-ir-resources {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Hide IR footer for authenticated investors */
html.access-granted #root footer,
body.investor-authenticated #root footer {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.access-checking #root footer {
  display: none !important;
  visibility: hidden !important;
}

/* ========== Hide IR chrome inside portfolio app ========== */
body.ir-route-dashboard-only #spcx-ticker-bar,
body.ir-route-dashboard-only .ir-mobile-nav-root,
body.ir-route-dashboard-only #ir-nav-drawer,
body.ir-route-dashboard-only #ir-nav-overlay,
body.ir-route-dashboard-only #root nav.fixed {
  display: none !important;
}

body.ir-route-dashboard-only #mandate-investor-dashboard,
body.ir-route-dashboard-only #mandate-investor-dashboard.ir-spa-block {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top: 0 !important;
}

body.ir-route-dashboard-only .inv-dash-section {
  padding: 0;
  background: var(--exodus-bg);
}

body.ir-route-dashboard-only {
  background: var(--exodus-bg);
}

body.ir-route-dashboard-only #spcx-ir-dash-host,
body.ir-route-dashboard-only #mandate-investor-dashboard {
  padding-top: 0 !important;
  min-height: 100dvh;
  background: var(--exodus-bg);
}

/* ========== Portfolio Exodus app ========== */
.exodus-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--exodus-bg);
  color: var(--exodus-text);
}

.exodus-app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--exodus-top-h);
  padding: env(safe-area-inset-top, 0px) max(0.85rem, env(safe-area-inset-right, 0px)) 0 max(0.85rem, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--exodus-line);
  background: rgba(12, 12, 15, 0.92);
  backdrop-filter: blur(18px);
}

.exodus-app-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--exodus-line);
  background: var(--exodus-bg-elevated);
  color: var(--exodus-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.exodus-app-back:hover {
  color: var(--exodus-text);
  border-color: var(--exodus-line-strong);
  background: var(--exodus-card);
}

.exodus-app-brand {
  justify-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--exodus-text);
}

.exodus-app-topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exodus-app-signout {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--exodus-line);
  background: transparent;
  color: var(--exodus-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.exodus-app-signout:hover {
  color: var(--exodus-text);
  border-color: var(--exodus-line-strong);
}

.exodus-app-content {
  flex: 1;
  padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(var(--exodus-tab-h) + 1rem) max(1rem, env(safe-area-inset-left, 0px));
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 900px) {
  .exodus-app-content {
    max-width: 52rem;
    padding-bottom: 2rem;
  }
}

.exodus-app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0.15rem;
  min-height: var(--exodus-tab-h);
  padding: 0.35rem max(0.5rem, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(0.5rem, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--exodus-line);
  background: rgba(12, 12, 15, 0.96);
  backdrop-filter: blur(20px);
}

@media (min-width: 900px) {
  .exodus-app-tabbar {
    position: sticky;
    bottom: 0;
    max-width: 52rem;
    margin: 0 auto;
    border: 1px solid var(--exodus-line);
    border-radius: var(--exodus-radius);
    margin-bottom: 1rem;
  }
}

.exodus-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.25rem;
  border-radius: var(--exodus-radius-sm);
  text-decoration: none;
  color: var(--exodus-muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}

.exodus-tab svg {
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.72;
}

.exodus-tab.active,
.exodus-tab[aria-current="page"] {
  color: var(--exodus-accent);
  background: var(--exodus-accent-soft);
}

.exodus-tab.active svg,
.exodus-tab[aria-current="page"] svg {
  opacity: 1;
}

.exodus-wallet-hero {
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: var(--exodus-radius);
  background: linear-gradient(145deg, rgba(139, 124, 255, 0.22) 0%, rgba(22, 22, 29, 0.95) 55%, var(--exodus-card) 100%);
  border: 1px solid var(--exodus-line-strong);
  margin-bottom: 1rem;
}

.exodus-wallet-label {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--exodus-muted);
}

.exodus-app .inv-portfolio-hero-value,
.exodus-wallet-value {
  margin: 0;
  font-size: clamp(1.85rem, 6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.exodus-wallet-meta {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--exodus-muted);
}

.exodus-card {
  border: 1px solid var(--exodus-line);
  border-radius: var(--exodus-radius);
  background: var(--exodus-card);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

.exodus-card-title {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--exodus-muted);
}

.exodus-more-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exodus-more-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: var(--exodus-radius-sm);
  border: 1px solid var(--exodus-line);
  background: var(--exodus-bg-elevated);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.exodus-more-link:hover {
  border-color: var(--exodus-line-strong);
  background: var(--exodus-card-hover);
}

.exodus-more-link-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exodus-more-link-desc {
  font-size: 0.74rem;
  color: var(--exodus-muted);
  line-height: 1.35;
}

.exodus-app .inv-dash-subnav {
  display: none;
}

.exodus-app .inv-app-page-head {
  border: 0;
  padding: 0 0 0.75rem;
  margin: 0 0 0.5rem;
}

.exodus-app .inv-app-page-head .ir-display-sm {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

.exodus-app .inv-portfolio-overview,
.exodus-app .inv-dash-panel,
.exodus-app .inv-dash-chart-panel {
  border-color: var(--exodus-line);
  border-radius: var(--exodus-radius);
  background: var(--exodus-card);
}

.exodus-app .inv-portfolio-hero {
  background: transparent;
  padding: 0;
}

.exodus-app .inv-dash-tab.active {
  background: var(--exodus-accent-soft);
  color: var(--exodus-accent);
}

.exodus-app-notice {
  margin: 0 1rem 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--exodus-radius-sm);
  border: 1px solid rgba(139, 124, 255, 0.35);
  background: rgba(139, 124, 255, 0.1);
  font-size: 0.82rem;
}

/* Wallet-style asset cards */
.exodus-app .inv-asset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  padding: 0 0 0.15rem;
}

@media (min-width: 640px) {
  .exodus-app .inv-asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.exodus-app .inv-asset-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--exodus-line);
  border-radius: var(--exodus-radius-sm);
  background: rgba(12, 12, 15, 0.55);
}

.exodus-app .inv-asset-card:last-child {
  border-right: 1px solid var(--exodus-line);
}

.exodus-app .inv-portfolio-hero-change.up {
  color: var(--exodus-green);
}

.exodus-app .inv-portfolio-hero-change.down {
  color: var(--exodus-red);
}

.exodus-app .ir-btn {
  border-radius: 999px;
  border: 1px solid var(--exodus-line-strong);
  background: var(--exodus-accent-soft);
  color: var(--exodus-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exodus-app .ir-btn:hover {
  border-color: rgba(139, 124, 255, 0.55);
  background: rgba(139, 124, 255, 0.28);
}

.exodus-app .ir-btn-ghost {
  background: transparent;
  color: var(--exodus-muted);
}

.exodus-app .inv-dash-panel-title {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--exodus-muted);
}

.exodus-app .inv-dash-summary dt {
  color: var(--exodus-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exodus-app .inv-dash-summary dd {
  color: var(--exodus-text);
}

/* IR drawer — single portfolio entry */
.ir-drawer-portfolio-entry {
  list-style: none;
  margin: 0.85rem 0 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(240, 240, 250, 0.1);
}

.ir-drawer-portfolio-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 124, 255, 0.35);
  background: linear-gradient(135deg, rgba(139, 124, 255, 0.14), rgba(12, 12, 15, 0.9));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.ir-drawer-portfolio-btn:hover {
  border-color: rgba(139, 124, 255, 0.55);
  transform: translateY(-1px);
}

.ir-drawer-portfolio-btn-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(139, 124, 255, 0.2);
  color: #b4a8ff;
}

.ir-drawer-portfolio-btn-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.ir-drawer-portfolio-btn-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ir-drawer-portfolio-btn-desc {
  font-size: 0.74rem;
  color: rgba(240, 240, 250, 0.55);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

/* Hide legacy portfolio fold */
.ir-drawer-portfolio,
.ir-drawer-portfolio-links,
.ir-drawer-portfolio-toggle {
  display: none !important;
}

/* ========== Thermocool Exodus app ========== */
body.thermocool-authenticated.thermocool-exodus-app {
  background: var(--exodus-bg);
}

body.thermocool-exodus-app .ir-site-header {
  border-bottom: 1px solid var(--exodus-line);
  background: rgba(12, 12, 15, 0.94);
}

body.thermocool-exodus-app .ir-brand,
body.thermocool-exodus-app .admin-header-actions {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.thermocool-exodus-app .admin-app {
  background: var(--exodus-bg);
}

body.thermocool-exodus-app .admin-sidebar {
  background: var(--exodus-bg-elevated);
  border-right-color: var(--exodus-line);
}

body.thermocool-exodus-app .admin-sidebar-link.active {
  background: var(--exodus-accent-soft);
  border-color: rgba(139, 124, 255, 0.35);
  color: var(--exodus-accent);
}

body.thermocool-exodus-app .admin-content {
  padding-bottom: calc(var(--exodus-tab-h) + 1.5rem);
}

body.thermocool-exodus-app .admin-panel-stack > .admin-panel,
body.thermocool-exodus-app .admin-panel-stack > section,
body.thermocool-exodus-app .admin-panel-stack > .admin-panel-block,
body.thermocool-exodus-app .admin-stat-card,
body.thermocool-exodus-app .admin-dashboard-card,
body.thermocool-exodus-app .accounts-sidebar,
body.thermocool-exodus-app .accounts-detail-panel,
body.thermocool-exodus-app .admin-support-desk {
  border-color: var(--exodus-line);
  border-radius: var(--exodus-radius);
  background: var(--exodus-card);
}

.thermocool-exodus-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: none;
  align-items: stretch;
  justify-content: space-around;
  min-height: var(--exodus-tab-h);
  padding: 0.35rem 0.5rem env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--exodus-line);
  background: rgba(12, 12, 15, 0.96);
  backdrop-filter: blur(20px);
}

@media (max-width: 899px) {
  body.thermocool-exodus-app .thermocool-exodus-tabbar {
    display: flex;
  }

  body.thermocool-exodus-app .admin-sidebar {
    transform: translateX(-108%);
  }

  body.thermocool-exodus-app.admin-nav-open .admin-sidebar {
    transform: translateX(0);
  }
}

.thermocool-exodus-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.3rem;
  border: 0;
  background: transparent;
  color: var(--exodus-muted);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.thermocool-exodus-tab.active {
  color: var(--exodus-accent);
}

.thermocool-exodus-tab svg {
  width: 1.1rem;
  height: 1.1rem;
}
