/* AeroBook visual polish — NASA-aligned brand language without using
 * NASA's protected insignia/wordmark.
 *
 * Per NASA Brand Guidelines (https://www.nasa.gov/nasa-brand-center/):
 *   - NASA fonts: Inter (display), Public Sans (body), DM Mono (mono)
 *   - NASA Blue: #0078D4
 *   - NASA imagery: permitted for educational/informational use
 *   - NASA insignia/wordmark: NOT permitted as branding for non-NASA work
 *
 * We use NASA's color palette and fonts (public guidelines) plus public
 * domain NASA aero photography (educational use), but all branding is
 * the AeroBook wordmark — never the NASA meatball or worm.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Public+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&family=IBM+Plex+Serif:wght@400;500;600;700&display=swap');

:root {
  --aero-bg-deep: #050810;
  --aero-bg-panel: #0E1421;
  --aero-bg-elevated: #161E2F;
  --aero-border: #1F2A42;
  --aero-text-primary: #F4F6FB;
  --aero-text-secondary: #8B95AB;
  --aero-text-muted: #5A6478;

  /* NASA brand palette */
  --nasa-blue: #0078D4;
  --nasa-blue-light: #2E9BFF;
  --nasa-blue-dark: #005A9E;
  --nasa-red: #FC3D21;

  /* Accents derived from NASA blue */
  --aero-accent: #2E9BFF;
  --aero-accent-glow: rgba(46, 155, 255, 0.18);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Typography (NASA digital font stack)
 * ───────────────────────────────────────────────────────────────────────── */

html, body, #root {
  font-family: 'Public Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.005em;
  background: var(--aero-bg-deep) !important;
  color: var(--aero-text-primary) !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif !important;
  letter-spacing: -0.015em;
  color: var(--aero-text-primary);
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

code, pre, .code, .number {
  font-family: 'DM Mono', 'IBM Plex Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 0.9em;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Login page — first impression for NASA stakeholders
 * Hero photo behind a glassmorphism login card.
 * ───────────────────────────────────────────────────────────────────────── */

.MuiContainer-root,
[class*="login"], [class*="Login"] {
  position: relative;
}

body:has(form[action*="login"])::before,
.MuiContainer-root:has(form)::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(5, 8, 16, 0.85) 0%, rgba(5, 8, 16, 0.6) 50%, rgba(0, 120, 212, 0.35) 100%),
    url('/public/images/x-15-hero-v6.jpg');
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.MuiContainer-root form {
  background: rgba(14, 20, 33, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(46, 155, 255, 0.2) !important;
  border-radius: 16px !important;
  padding: 2.5rem !important;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(0, 120, 212, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  max-width: clamp(320px, 36vw, 520px) !important;
}

.MuiInputBase-root {
  background: rgba(22, 30, 47, 0.6) !important;
  border-radius: 8px !important;
  font-family: 'Public Sans', sans-serif !important;
}

.MuiInputBase-input {
  color: var(--aero-text-primary) !important;
}

.MuiOutlinedInput-notchedOutline {
  border-color: var(--aero-border) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: var(--nasa-blue) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--nasa-blue-light) !important;
  border-width: 1px !important;
}

.MuiFormLabel-root {
  color: var(--aero-text-secondary) !important;
  font-family: 'Public Sans', sans-serif !important;
}

.MuiButton-contained {
  background: linear-gradient(135deg, var(--nasa-blue) 0%, var(--nasa-blue-dark) 100%) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  text-transform: none !important;
  font-family: 'Inter', sans-serif !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35) !important;
  border-radius: 8px !important;
  padding: 0.75rem 1.5rem !important;
}

.MuiButton-contained:hover {
  background: linear-gradient(135deg, var(--nasa-blue-light) 0%, var(--nasa-blue) 100%) !important;
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.5) !important;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Header / sidebar
 * ───────────────────────────────────────────────────────────────────────── */

header, [class*="header"] {
  background: rgba(5, 8, 16, 0.75) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--aero-border) !important;
}

[class*="sidebar"], aside {
  background: var(--aero-bg-panel) !important;
  border-right: 1px solid var(--aero-border) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Welcome screen — hero image background + book cover grid
 * ───────────────────────────────────────────────────────────────────────── */

#root {
  position: relative;
  overflow-x: hidden;
}

/* Full-screen hero: uncropped, runway visible, image is the whole background */
#root::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(180deg,
      rgba(5, 8, 16, 0.15) 0%,
      rgba(5, 8, 16, 0.0) 35%,
      rgba(5, 8, 16, 0.0) 100%),
    url('/public/images/x-15-hero-v6.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: var(--aero-bg-deep);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

#root::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 155, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 155, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 1;
}

main, [class*="main"], [class*="chat"] {
  position: relative;
  z-index: 10;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Four-zone welcome layout (requires unsafe_allow_html = true)
 *
 * Zone 1 — .aero-title:  top center, fixed, stays during chat
 * Zone 2 — .aero-stats:  top-left over silver plane, fixed, stays during chat
 * Zone 3 — .aero-try:    lower-right under blue plane (hides when chat starts)
 * Starters               lower-right, below Zone 3  (hides when chat starts)
 * Zone 4 — chat bubbles: left column, glass scrim, appears when user chats
 * ───────────────────────────────────────────────────────────────────────── */

/* Make the welcome .step invisible as a bubble — its children escape
   via position: fixed. We do NOT use :only-of-type here; zones 1 & 2
   must persist after the user starts chatting. */
.step:first-of-type {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.step:first-of-type .ai-message > span:first-child,
.step:first-of-type [class*="avatar"] {
  display: none !important;
}

.step:first-of-type .prose {
  background: transparent !important;
  padding: 0 !important;
  max-width: none !important;
  border: none !important;
}

/* Zone 1 — Title + tagline top center */
.aero-title {
  position: fixed !important;
  top: 1.5vh !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  text-align: center !important;
  z-index: 1 !important;
  pointer-events: none;
  padding: 0.75rem 1.75rem;
  white-space: nowrap !important;
  max-width: none !important;
  width: auto !important;
}

/* Chainlit rewrites our HTML:
   <p>  → <div role="article">     (with class "leading-7 ...")
   <em> → <span class="italic">
   so target the rewritten elements, not raw p/em. */

.aero-title h1 {
  margin: 0 !important;
  font-size: clamp(2.75rem, 4.5vw, 4.25rem) !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  letter-spacing: -0.02em;
  line-height: 1 !important;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.9);
}

.aero-title > div,
.aero-title [role="article"],
.aero-title span.italic,
.aero-title span {
  margin: 0.4rem 0 0 0 !important;
  color: #FFFFFF !important;
  font-size: clamp(1rem, 1.25vw, 1.5rem) !important;
  font-weight: 500 !important;
  font-style: italic !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.95);
}

/* Zone 2 — Stats + description, top-left over silver plane */
.aero-stats {
  position: fixed !important;
  top: 20vh !important;
  left: 3vw !important;
  max-width: 360px !important;
  text-align: left !important;
  z-index: 1 !important;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(5, 8, 16, 0.72) 0%, rgba(5, 8, 16, 0.48) 100%);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(46, 155, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.aero-stats p,
.aero-stats > div,
.aero-stats [role="article"] {
  margin: 0 0 0.75rem 0 !important;
  color: #F4F6FB !important;
  font-size: clamp(0.88rem, 1vw, 1.05rem) !important;
  line-height: 1.55 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.aero-stats > div:last-child,
.aero-stats [role="article"]:last-child { margin-bottom: 0 !important; }

.aero-stats strong {
  color: var(--nasa-blue-light) !important;
  font-weight: 700 !important;
}

/* Zone 3 — "Try one of these" heading, lower-right under blue plane */
.aero-try {
  position: fixed !important;
  bottom: calc(5vh + 4 * (2.4rem + 0.6rem) + 0.6rem) !important;
  right: 1vw !important;
  text-align: center !important;
  z-index: 1 !important;
  pointer-events: none;
  width: clamp(320px, 36vw, 520px) !important;
  max-width: clamp(320px, 36vw, 520px) !important;
}

.aero-try h3,
.aero-try > * {
  margin: 0 !important;
  color: #FFFFFF !important;
  font-size: clamp(1.25rem, 1.8vw, 1.9rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-text-stroke: 0 !important;
  text-shadow:
    0 0 12px rgba(0, 0, 0, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.95);
}

/* Starter action buttons — real parent is .flex.items-center.flex-wrap
   (sibling of .message-content, child of the inner ai-message column).
   Pin to lower-right, right-aligned, stacked vertically, below .aero-try. */
.step:first-of-type .flex.items-center.flex-wrap {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  bottom: 5vh !important;
  right: 1vw !important;
  width: clamp(320px, 36vw, 520px) !important;
  max-width: clamp(320px, 36vw, 520px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 0.55rem !important;
  z-index: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* All action chips (starters on welcome AND follow-ups after answers) —
   strong opaque dark backdrop so they're legible against the hero OR
   inside the chat column. */
.step .flex.items-center.flex-wrap > button {
  text-align: left !important;
  justify-content: flex-start !important;
  background: rgba(5, 8, 16, 0.88) !important;
  backdrop-filter: blur(12px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
  border: 1px solid rgba(46, 155, 255, 0.35) !important;
  border-radius: 10px !important;
  color: #F4F6FB !important;
  padding: 0.7rem 1rem !important;
  font-family: 'Public Sans', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: all 0.15s ease !important;
}

.step .flex.items-center.flex-wrap > button:hover {
  background: rgba(0, 120, 212, 0.82) !important;
  border-color: var(--nasa-blue-light) !important;
  transform: translateX(3px);
  box-shadow: 0 10px 30px rgba(0, 120, 212, 0.5) !important;
}

/* Welcome starters only — full width of their fixed column */
.step:first-of-type .flex.items-center.flex-wrap > button {
  width: 100% !important;
  max-width: clamp(320px, 36vw, 520px) !important;
}

/* When the welcome is no longer the only step (user has chatted), hide
   Zone 3 + starter buttons. Zones 1 & 2 stay visible. */
body:has(.step ~ .step) .aero-try,
body:has(.step ~ .step) .step:first-of-type .flex.items-center.flex-wrap {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Zone 4 — Chat messages scrim (when user actually chats)
 * Every .step after the welcome gets a dark opaque panel so text is
 * legible over the hero, and the chat column shifts left.
 * ───────────────────────────────────────────────────────────────────────── */

.step:not(:first-of-type) {
  max-width: 48rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  position: relative !important;
  z-index: 15 !important;
}

.step:not(:first-of-type) > div {
  max-width: 48rem !important;
}

/* First user/assistant exchange must clear the fixed AeroBook title +
   stats panel, otherwise answers render behind them. */
.step:nth-of-type(2) {
  margin-top: 24vh !important;
}

.step:not(:first-of-type) > div {
  max-width: 720px !important;
}

.step:not(:first-of-type) .prose,
.step:not(:first-of-type) .message-content {
  background: rgba(5, 8, 16, 0.82) !important;
  backdrop-filter: blur(14px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
  border: 1px solid rgba(46, 155, 255, 0.22) !important;
  border-radius: 12px !important;
  padding: 1rem 1.25rem !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
  color: #F4F6FB !important;
}

.step:not(:first-of-type) .prose p,
.step:not(:first-of-type) .prose li {
  color: #F4F6FB !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * (legacy selectors retained below — harmless no-ops on current Chainlit)
 * Welcome panel — legacy upper-left attempt, no-op now,
 * leaving the blue plane and runway clean on the right.
 * Only applies when the thread is empty (no messages yet).
 * ───────────────────────────────────────────────────────────────────────── */

#welcome-screen,
[class*="welcome-screen"],
[class*="WelcomeScreen"],
[class*="empty-thread"],
[class*="EmptyThread"] {
  position: absolute !important;
  top: 6vh !important;
  left: 4vw !important;
  right: auto !important;
  max-width: 520px !important;
  text-align: left !important;
  padding: 1.75rem 2rem !important;
  background: linear-gradient(135deg, rgba(5, 8, 16, 0.72) 0%, rgba(5, 8, 16, 0.55) 100%) !important;
  backdrop-filter: blur(14px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
  border: 1px solid rgba(46, 155, 255, 0.28) !important;
  border-radius: 14px !important;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset !important;
  z-index: 5 !important;
}

#welcome-screen h1,
#welcome-screen h2,
#welcome-screen h3,
[class*="welcome-screen"] h1,
[class*="welcome-screen"] h2,
[class*="welcome-screen"] h3,
[class*="WelcomeScreen"] h1,
[class*="WelcomeScreen"] h2,
[class*="WelcomeScreen"] h3 {
  text-align: left !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  margin-left: 0 !important;
}

#welcome-screen p,
[class*="welcome-screen"] p,
[class*="WelcomeScreen"] p {
  text-align: left !important;
  color: var(--aero-text-primary) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Starter chips: align to the left under the welcome panel */
#starters-container,
[class*="starter"] {
  justify-content: flex-start !important;
  margin-left: 4vw !important;
  max-width: 560px !important;
}

/* Override the duplicate #root::after definition above —
   moved to body::after to make room for the grid pattern */

/* ─────────────────────────────────────────────────────────────────────────
 * Chat messages
 * ───────────────────────────────────────────────────────────────────────── */

.message-container, [class*="MessageContainer"] {
  padding: 1.25rem 0;
}

[class*="assistant-message"], [class*="AssistantMessage"] {
  background: rgba(14, 20, 33, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--aero-border);
  border-left: 3px solid var(--nasa-blue);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* Inline citation chips [1], [2] */
a[href*="source"], .markdown-body a[href^="#"] {
  display: inline-block;
  padding: 0.05em 0.45em;
  margin: 0 0.1em;
  background: var(--aero-accent-glow);
  color: var(--aero-accent) !important;
  border-radius: 4px;
  font-size: 0.78em;
  font-weight: 600;
  text-decoration: none !important;
  vertical-align: super;
  line-height: 1;
  border: 1px solid rgba(46, 155, 255, 0.3);
  transition: all 0.15s ease;
  font-family: 'DM Mono', monospace;
}

a[href*="source"]:hover, .markdown-body a[href^="#"]:hover {
  background: var(--nasa-blue);
  color: #FFFFFF !important;
  border-color: var(--nasa-blue-light);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Side panel citations
 * ───────────────────────────────────────────────────────────────────────── */

[class*="ElementSideView"], [class*="element-side"] {
  background: var(--aero-bg-panel) !important;
  border-left: 1px solid var(--aero-border) !important;
  max-width: 440px !important;
}

/* Citation drawer (Chainlit 2.x renders it as <aside> containing
   #side-view-title) must sit above the fixed welcome overlays. */
aside:has(#side-view-title) {
  position: relative;
  z-index: 30 !important;
}

/* Chainlit's sidebar/transition wrapper has Tailwind `transform`,
   which creates a stacking context that traps the aside's z-index
   below our welcome overlays. Force the wrapper's stacking root above
   the welcome overlays so its descendants (including the citation
   drawer) render on top of them. */
div.transform.transition-transform,
div[class*="transition-transform"][class*="translate-x"] {
  z-index: 25 !important;
  position: relative !important;
}

[class*="ElementSideView"] h2,
[class*="ElementSideView"] h3 {
  font-family: 'Inter', sans-serif !important;
  color: var(--aero-accent) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Action buttons (starters / followups)
 * Need to be highly readable against the hero photo background.
 * Aggressive selector list because Chainlit's class names vary by build.
 * ───────────────────────────────────────────────────────────────────────── */

button[class*="action"],
button[class*="Action"],
[class*="Action"] button,
[id*="action"] button,
[data-testid*="action"],
.cl-action,
button.cl-action,
.MuiButton-root[id*="action"],
button[id^="starter"],
button[id^="followup"] {
  background: rgba(5, 8, 16, 0.92) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  border: 1.5px solid var(--nasa-blue) !important;
  color: #FFFFFF !important;
  border-radius: 999px !important;
  padding: 0.65rem 1.25rem !important;
  font-family: 'Public Sans', 'Inter', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  transition: all 0.18s ease !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(46, 155, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  letter-spacing: 0.01em;
}

button[class*="action"] *,
button[class*="Action"] *,
[class*="Action"] button *,
button[id^="starter"] *,
button[id^="followup"] * {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

button[class*="action"]:hover,
button[class*="Action"]:hover,
[class*="Action"] button:hover,
button[id^="starter"]:hover,
button[id^="followup"]:hover {
  border-color: var(--nasa-blue-light) !important;
  background: rgba(0, 120, 212, 0.85) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 120, 212, 0.45),
    0 0 0 1px var(--nasa-blue-light);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Input area
 * ───────────────────────────────────────────────────────────────────────── */

[class*="input-container"], .MuiInputBase-root.input-area {
  background: rgba(14, 20, 33, 0.85) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--aero-border) !important;
  border-radius: 12px !important;
  transition: border-color 0.15s ease;
}

[class*="input-container"]:focus-within {
  border-color: var(--nasa-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Image embeds in messages — used for the welcome book grid
 * ───────────────────────────────────────────────────────────────────────── */

img.book-cover {
  border-radius: 4px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(46, 155, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

img.book-cover:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--nasa-blue);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Hide Chainlit watermark
 * ───────────────────────────────────────────────────────────────────────── */

[class*="watermark"], .watermark {
  display: none !important;
}

/* Hide copy-to-clipboard button on messages (Chainlit 2.x uses a
   lucide-copy SVG with no aria-label, so target by the SVG child) */
button:has(svg.lucide-copy),
button:has(svg.lucide-clipboard),
button:has(svg.lucide-check) {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * NASA attribution mark — fixed bottom-right corner
 *
 * Per NASA brand guidelines, the meatball cannot be used as a "branding
 * device" for non-NASA work. We use it here as an ATTRIBUTION mark,
 * paired with descriptive text, exactly as educational materials cite
 * NASA imagery. AeroBook wordmark stays our own.
 * ───────────────────────────────────────────────────────────────────────── */

body::after {
  content: '';
  position: fixed;
  bottom: 2vh;
  left: 1.5vw;
  right: auto;
  z-index: 1000;
  width: clamp(44px, 4vw, 64px);
  height: clamp(38px, 3.4vw, 55px);
  background: transparent;
  border: none;
  background-image: url('/public/images/nasa-meatball.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

/* ─────────────────────────────────────────────────────────────────────────
 * Responsive — prevent overlap of starters / NASA pill / chat input
 * at smaller viewports. The hero + welcome copy remain visible; the
 * decorative starter chips drop out below 1200px so the input bar and
 * the NASA attribution pill have breathing room.
 * ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .aero-try,
  .step:first-of-type .flex.items-center.flex-wrap {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  .aero-stats {
    top: 24vh !important;
    max-width: 300px !important;
  }
  body::after {
    font-size: 0.6rem;
    padding: 0.5em 0.9em 0.5em 2.6em;
    background-size: 1.6em 1.4em;
    background-position: 0.6em center;
  }
}

@media (max-width: 860px) {
  .aero-stats {
    top: auto !important;
    bottom: 14vh !important;
    left: 3vw !important;
    max-width: min(90vw, 360px) !important;
  }
  .aero-title {
    top: 1vh !important;
  }
  body::after {
    bottom: 1vh;
    left: 1vw;
  }
}

@media (max-width: 720px) {
  body::after {
    bottom: 1vh;
    left: 1vw;
    right: auto;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
 * Scrollbars
 * ───────────────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--aero-bg-deep); }
::-webkit-scrollbar-thumb { background: var(--aero-border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--nasa-blue); }

/* ─────────────────────────────────────────────────────────────────────────
 * Spinners
 * ───────────────────────────────────────────────────────────────────────── */

.MuiCircularProgress-circle, [class*="spinner"] {
  color: var(--nasa-blue) !important;
  stroke: var(--nasa-blue) !important;
}
