/* ═══════════════════════════════════════════════════════════════
   IGBOKAL V2 — Unuchi.org Palette + Swiss Minimalism
   Full responsive design: mobile-first with viewport awareness
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  --unuchi-dark: #3d2e1f;
  --unuchi-forest: #3d6b2e;
  --unuchi-forest-light: #4f8a3a;
  --unuchi-gold: #b5a45a;
  --unuchi-cream: #f0e8d8;
  --unuchi-cream-dim: rgba(61,46,31,0.7);
  --eke-fire: #d4652a;
  --orie-water: #2d6da5;
  --afo-earth: #6b4e38;
  --nkwo-air: #8ca0ad;
  --chi-sun: #d4a832;
  --ekwensu-threshold: #9b2d2d;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.25);
  --font-display: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--unuchi-cream);
  color: var(--unuchi-dark);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING OVERLAY (replaces password gate)
   ═══════════════════════════════════════════════════════════════ */
#onboardingOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--unuchi-cream);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.6s ease;
}
#onboardingOverlay.hidden {
  opacity: 0; pointer-events: none;
}

.slide {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: min(420px, 90vw);
  padding: 24px 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.slide.active {
  display: flex;
  opacity: 1;
}

.slide-icon {
  font-size: 4rem;
  color: var(--unuchi-gold);
  margin-bottom: 16px;
  line-height: 1;
}
.onboarding-logo {
  width: 100px;
  height: auto;
  margin-bottom: 16px;
  border-radius: 12px;
}

.slide h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  color: var(--unuchi-gold);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.slide p {
  font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  color: var(--unuchi-cream-dim);
  line-height: 1.65;
  margin-bottom: 8px;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0 16px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(181,164,90,0.25);
  transition: background 0.3s, transform 0.3s;
}
.dot.active {
  background: var(--unuchi-gold);
  transform: scale(1.25);
}

.onboard-btn {
  padding: 12px 28px;
  background: var(--unuchi-forest);
  border: 1px solid rgba(181,164,90,0.3);
  border-radius: var(--radius);
  color: #faf7f0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  min-width: 44px;
}
.onboard-btn:hover, .onboard-btn:active {
  background: var(--unuchi-forest-light);
}
.onboard-btn.primary {
  border-color: var(--unuchi-gold);
}

.onboard-noshow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: rgba(74,55,40,0.35);
  margin-top: 16px;
  cursor: pointer;
}
.onboard-noshow input[type="checkbox"] {
  accent-color: var(--unuchi-gold);
  width: 14px; height: 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════════ */
main {
  max-width: 560px; margin: 0 auto; padding: 20px 16px 40px;
  display: block; width: 100%;
}
main.visible { display: block; }

/* ── Header ── */
.header { text-align: center; padding: 16px 0; }
.header h1 { font-family: var(--font-display); font-size: clamp(1rem, 4vw, 1.3rem); color: var(--unuchi-gold); letter-spacing: 0.1em; }
.header .subtitle { font-size: clamp(0.72rem, 2.5vw, 0.85rem); color: var(--unuchi-cream-dim); margin-top: 4px; }

/* ── Header Actions ── */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.header-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(181,164,90,0.35);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--unuchi-gold);
  cursor: pointer;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-btn:hover, .header-btn:active {
  background: rgba(61,107,46,0.25);
  border-color: var(--unuchi-gold);
}
#authBtn.logged-in {
  background: rgba(61,107,46,0.2);
  border-color: var(--unuchi-gold);
  color: var(--unuchi-dark);
}

/* Open access banner */
.open-access-banner {
  background: linear-gradient(90deg, rgba(212,168,50,0.12), rgba(212,168,50,0.04));
  border: 1px solid rgba(212,168,50,0.25);
  border-radius: 6px;
  padding: 8px 16px;
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--unuchi-cream-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.open-access-banner .header-btn {
  font-size: 0.78rem;
  padding: 3px 10px;
}

/* ── Anchor Badge ── */
.anchor-badge {
  display: inline-block; padding: 4px 12px;
  background: rgba(61,107,46,0.25); border: 1px solid rgba(181,164,90,0.3);
  border-radius: 20px; font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--unuchi-gold); cursor: pointer; margin-top: 8px;
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
}
.anchor-badge:hover, .anchor-badge:active { background: rgba(61,107,46,0.4); }

/* ── Input Section ── */
.input-section { margin: 20px 0; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input[type="date"] {
  flex: 1; padding: 10px 12px; min-width: 0;
  background: rgba(74,55,40,0.06);
  border: 1px solid rgba(181,164,90,0.25);
  border-radius: var(--radius); color: var(--unuchi-dark);
  font-family: var(--font-mono); font-size: 0.9rem;
}
.convert-btn {
  padding: 10px 20px; background: var(--unuchi-forest);
  border: 1px solid var(--unuchi-gold); border-radius: var(--radius);
  color: #faf7f0; font-family: var(--font-display);
  font-size: 0.85rem; cursor: pointer; transition: all 0.3s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.convert-btn:hover, .convert-btn:active { background: var(--unuchi-forest-light); }

/* ═══════════════════════════════════════════════════════════════
   MARKET BANNER
   ═══════════════════════════════════════════════════════════════ */
.market-banner {
  padding: 16px; border-radius: var(--radius);
  text-align: center; margin: 16px 0;
  border: 1px solid rgba(181,164,90,0.2);
}
.market-banner .market-day-name { font-family: var(--font-display); font-size: clamp(1.2rem, 5vw, 1.6rem); }
.market-banner .market-element { font-size: 0.85rem; opacity: 0.7; margin-top: 4px; }
.market-eke { background: rgba(212,101,42,0.15); color: var(--eke-fire); }
.market-orie { background: rgba(45,109,165,0.15); color: var(--orie-water); }
.market-afo { background: rgba(107,78,56,0.15); color: var(--afo-earth); }
.market-nkwo { background: rgba(140,160,173,0.15); color: var(--nkwo-air); }

/* ═══════════════════════════════════════════════════════════════
   RESULT GRID
   ═══════════════════════════════════════════════════════════════ */
.result-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: rgba(181,164,90,0.1);
  border: 1px solid rgba(181,164,90,0.15);
  border-radius: var(--radius); overflow: hidden; margin: 16px 0;
}
.result-cell { background: rgba(74,55,40,0.06); padding: 10px 12px; }
.result-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(74,55,40,0.4); }
.result-value { font-family: var(--font-mono); font-size: clamp(0.75rem, 2.8vw, 0.95rem); margin-top: 2px; word-break: break-word; }

/* ── Summary ── */
.summary-line {
  text-align: center; padding: 12px;
  font-size: clamp(0.75rem, 2.5vw, 0.85rem); color: var(--unuchi-cream-dim);
  border: 1px solid rgba(181,164,90,0.1);
  border-radius: var(--radius); margin: 12px 0;
}

/* ═══════════════════════════════════════════════════════════════
   EKWENSU STYLING
   ═══════════════════════════════════════════════════════════════ */
.ekwensu-banner {
  background: rgba(155,45,45,0.18);
  border: 1px solid rgba(155,45,45,0.3);
  padding: 20px; border-radius: var(--radius);
  text-align: center; margin: 16px 0;
}
.ekwensu-banner .ekwensu-title { font-family: var(--font-display); font-size: clamp(1rem, 4vw, 1.4rem); color: var(--ekwensu-threshold); }
.ekwensu-banner .ekwensu-desc { font-size: 0.85rem; color: rgba(74,55,40,0.6); margin-top: 8px; }

/* (Compass styles moved to Three.js section below) */
/* Tooltip overlay */
.compass-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(74,55,40,0.92); border: 1px solid var(--unuchi-gold);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: #faf7f0; white-space: nowrap;
  transform: translate(-50%, -100%); margin-top: -8px;
  opacity: 0; transition: opacity 0.2s; z-index: 10;
}
.compass-tooltip.visible { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   GROUNDING CHORD SECTION
   ═══════════════════════════════════════════════════════════════ */
.chord-section { margin: 20px 0; }
.chord-title {
  font-family: var(--font-display); font-size: 0.9rem;
  color: var(--unuchi-gold); padding: 8px 0;
}
.chord-tones { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.tone-pip {
  flex: 1 1 calc(20% - 4px); min-width: 55px; padding: 8px 4px;
  border-radius: var(--radius); text-align: center;
  font-family: var(--font-mono); font-size: 0.65rem;
  background: rgba(74,55,40,0.04);
  border: 1px solid rgba(74,55,40,0.1);
  cursor: pointer; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tone-pip:hover, .tone-pip:active {
  background: rgba(74,55,40,0.1);
  transform: translateY(-1px);
}
.tone-pip.active {
  border-color: var(--unuchi-gold) !important;
  background: rgba(141,113,43,0.15);
  box-shadow: 0 0 8px rgba(141,113,43,0.3);
}
.tone-pip .tone-name { font-weight: 600; margin-bottom: 2px; }
.tone-pip .tone-freq { opacity: 0.7; }
/* Tone hover tooltip */
.tone-pip .tone-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: rgba(74,55,40,0.92); border: 1px solid var(--unuchi-gold);
  border-radius: 4px; padding: 6px 10px;
  font-size: 0.6rem; color: #faf7f0; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  z-index: 5;
}
.tone-pip:hover .tone-tooltip { opacity: 1; }

.chord-controls { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chord-btn {
  flex: 1; min-width: 70px; padding: 8px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.75rem;
  cursor: pointer; border: 1px solid rgba(181,164,90,0.3);
  background: rgba(61,107,46,0.2); color: var(--unuchi-dark);
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
}
.chord-btn:hover, .chord-btn:active { background: rgba(61,107,46,0.4); }

/* ═══════════════════════════════════════════════════════════════
   CHI PHASE
   ═══════════════════════════════════════════════════════════════ */
.chi-phase-section {
  text-align: center; margin: 20px 0; display: none;
  padding: 16px; border: 1px solid rgba(212,168,50,0.15);
  border-radius: var(--radius); background: rgba(212,168,50,0.04);
}
.chi-phase-value { font-family: var(--font-mono); font-size: clamp(1.6rem, 6vw, 2rem); color: var(--chi-sun); }
.chi-phase-desc { font-size: 0.8rem; color: var(--unuchi-cream-dim); margin-top: 4px; }
.chi-return-alert { color: var(--chi-sun); font-style: italic; display: none; margin-top: 8px; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════
   CHI DAY POPUP
   ═══════════════════════════════════════════════════════════════ */
.chi-day-box {
  padding: 24px 20px;
  border: 1px solid var(--chi-sun);
  border-radius: var(--radius);
  background: rgba(212,168,50,0.06);
  text-align: center;
  margin: 16px 0;
  box-shadow: 0 0 20px rgba(212,168,50,0.15), inset 0 0 20px rgba(212,168,50,0.05);
}
.chi-day-icon {
  font-size: 3rem;
  color: var(--chi-sun);
  display: block;
  text-align: center;
  margin-bottom: 12px;
  animation: pulse-chi-day 2.5s ease-in-out infinite;
}
@keyframes pulse-chi-day {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ── Origin Input ── */
.origin-section { margin: 12px 0; }
.origin-label { font-size: 0.75rem; color: rgba(74,55,40,0.5); margin-bottom: 4px; }
.origin-section input[type="date"] {
  width: 100%; padding: 8px 12px;
  background: rgba(74,55,40,0.04);
  border: 1px solid rgba(181,164,90,0.15);
  border-radius: var(--radius); color: var(--unuchi-dark);
  font-family: var(--font-mono); font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY (PDF email gate, OTP, class registration)
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.7); display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--unuchi-cream); border: 1px solid var(--unuchi-gold);
  border-radius: var(--radius); padding: 28px 24px; width: min(380px, 90vw);
  text-align: center;
}
.modal-box h3 {
  font-family: var(--font-display); color: var(--unuchi-gold);
  font-size: 1rem; margin-bottom: 4px;
}
.modal-box p { font-size: 0.8rem; color: var(--unuchi-cream-dim); margin-bottom: 16px; }
.modal-box input {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  background: rgba(74,55,40,0.06);
  border: 1px solid rgba(181,164,90,0.25);
  border-radius: var(--radius); color: var(--unuchi-dark);
  font-family: var(--font-mono); font-size: 0.85rem; outline: none;
}
.modal-box input:focus { border-color: var(--unuchi-gold); }
.modal-box .modal-btn {
  width: 100%; padding: 12px; margin-top: 4px;
  background: var(--unuchi-forest); border: 1px solid var(--unuchi-gold);
  border-radius: var(--radius); color: #faf7f0;
  font-family: var(--font-display); font-size: 0.85rem;
  cursor: pointer; transition: all 0.3s;
  min-height: 44px;
}
.modal-box .modal-btn:hover { background: var(--unuchi-forest-light); }
.modal-box .modal-cancel {
  background: transparent; border: 1px solid rgba(74,55,40,0.15);
  margin-top: 8px;
}
.modal-box .modal-cancel:hover { background: rgba(74,55,40,0.05); }
.modal-error { color: var(--eke-fire); font-size: 0.7rem; margin-top: 4px; display: none; }

/* ── Turnstile / CAPTCHA container (OTP modal) ── */
.turnstile-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}

/* ── Modal Select (class registration) ── */
.modal-select {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  background: rgba(74,55,40,0.06);
  border: 1px solid rgba(181,164,90,0.25);
  border-radius: var(--radius); color: var(--unuchi-dark);
  font-family: var(--font-mono); font-size: 0.85rem;
  outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b5a45a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.modal-select:focus { border-color: var(--unuchi-gold); }
.modal-select option {
  background: var(--unuchi-cream);
  color: var(--unuchi-dark);
}

/* ── Class registration confirm icon ── */
.class-confirm-icon {
  font-size: 3rem;
  color: var(--unuchi-forest-light);
  display: block;
  text-align: center;
  margin-bottom: 12px;
}

/* Obia Akademii brand in class modal */
.class-brand {
  text-align: center;
  margin: 0 0 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(212,168,50,0.2);
}
.class-brand-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--unuchi-gold);
  letter-spacing: 0.05em;
}
.class-brand-tagline {
  font-size: 0.75rem;
  color: var(--unuchi-cream-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(74,55,40,0.92);
  border: 1px solid var(--unuchi-gold);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: #faf7f0;
  max-width: 320px;
  box-shadow: var(--shadow);
  animation: toast-slide-in 0.35s ease-out forwards, toast-fade-out 0.4s ease 3.6s forwards;
}
.toast.success {
  border-color: var(--unuchi-forest-light);
  border-left: 3px solid var(--unuchi-forest-light);
}
.toast.error {
  border-color: var(--ekwensu-threshold);
  border-left: 3px solid var(--ekwensu-threshold);
}

@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

/* ═══════════════════════════════════════════════════════════════
   LOCKED SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.locked-section {
  position: relative;
}
.locked-section:not(.unlocked) .section-body,
.locked-section:not(.unlocked) .chord-tones,
.locked-section:not(.unlocked) .chord-controls,
.locked-section:not(.unlocked) .brainwave-panel {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
.section-lock-badge {
  display: none;
}
.locked-section:not(.unlocked) .section-lock-badge {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  background: rgba(240,232,216,0.85);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--unuchi-gold);
  letter-spacing: 0.05em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.locked-section.unlocked .section-lock-badge {
  display: none;
}

/* Per-section share button */
.section-share-btn {
  background: transparent;
  border: 1px solid rgba(212,168,50,0.3);
  color: var(--unuchi-gold);
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  float: right;
  margin-top: -2px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.section-share-btn:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   BRAINWAVE MODULE
   ═══════════════════════════════════════════════════════════════ */
.brainwave-section {
  margin: 20px 0;
}
.brainwave-panel {
  padding: 16px;
  border: 1px solid rgba(181,164,90,0.2);
  border-radius: var(--radius);
  background: rgba(74,55,40,0.04);
}
.brainwave-display {
  text-align: center;
  padding: 16px 0 12px;
}
.bw-freq {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--chi-sun);
  font-weight: 400;
  line-height: 1.2;
}
.bw-band {
  font-size: 0.75rem;
  color: var(--unuchi-cream-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.brainwave-presets {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}
.bw-preset {
  flex: 1;
  padding: 12px 4px;
  border: 1px solid rgba(181,164,90,0.2);
  border-radius: var(--radius);
  background: rgba(74,55,40,0.03);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--unuchi-dark);
}
.bw-preset:hover, .bw-preset:active {
  background: rgba(74,55,40,0.08);
}
.bw-preset.active {
  border-color: var(--unuchi-gold);
  background: rgba(141,113,43,0.12);
}
.bw-preset span {
  font-size: 0.6rem;
  color: rgba(74,55,40,0.45);
  margin-top: 2px;
}

.brainwave-controls {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.brainwave-controls .chord-btn {
  flex: 1;
  min-width: 70px;
}

.bw-slider-row {
  width: 100%;
  margin: 10px 0 4px;
}
.bw-slider-row .tempo-slider {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   CURRICULUM SECTION
   ═══════════════════════════════════════════════════════════════ */
.curriculum-section {
  margin: 24px 0; padding: 20px;
  border: 1px solid rgba(181,164,90,0.2);
  border-radius: var(--radius);
  background: rgba(61,107,46,0.06);
  text-align: center;
}
.curriculum-section h3 {
  font-family: var(--font-display); color: var(--unuchi-gold);
  font-size: 0.95rem; margin-bottom: 8px;
}
.curriculum-section p { font-size: 0.8rem; color: var(--unuchi-cream-dim); margin-bottom: 12px; line-height: 1.6; }
.curriculum-topics { text-align: left; margin: 12px 0; padding-left: 20px; }
.curriculum-topics li {
  font-size: 0.78rem; color: var(--unuchi-cream-dim);
  margin-bottom: 4px; list-style: none; position: relative; padding-left: 16px;
}
.curriculum-topics li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; background: var(--unuchi-gold); border-radius: 50%; }
.curriculum-btn {
  display: inline-block; padding: 10px 24px;
  background: var(--unuchi-forest); border: 1px solid var(--unuchi-gold);
  border-radius: var(--radius); color: #faf7f0;
  font-family: var(--font-display); font-size: 0.85rem;
  cursor: pointer; transition: all 0.3s; margin-top: 8px;
}
.curriculum-btn:hover { background: var(--unuchi-forest-light); }

/* ── Actions ── */
.actions-row { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.action-btn {
  flex: 1; min-width: 120px; padding: 10px; border-radius: var(--radius);
  background: rgba(74,55,40,0.05); border: 1px solid rgba(181,164,90,0.2);
  color: var(--unuchi-dark); font-family: var(--font-display);
  font-size: 0.8rem; cursor: pointer; transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover, .action-btn:active { background: rgba(74,55,40,0.1); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  text-align: center; padding: 20px 0;
  border-top: 1px solid rgba(181,164,90,0.1);
  margin-top: 30px;
}
.footer-unuchi { font-family: var(--font-display); font-size: 0.8rem; color: var(--unuchi-gold); }
.footer-obia {
  font-size: 0.72rem;
  color: var(--unuchi-cream-dim);
  opacity: 0.6;
  margin-top: 2px;
}
.footer-anchor-note { font-size: 0.7rem; color: rgba(74,55,40,0.35); margin-top: 4px; }
.footer-dumele { font-size: 0.7rem; color: rgba(74,55,40,0.25); margin-top: 8px; }

/* ── Loading state ── */
.loading { opacity: 0.5; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════
   SECTION TOGGLE / COLLAPSIBLE SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.compass-section, .tone-scale-section, .chord-section {
  margin: 20px 0;
}
.section-toggle {
  font-family: var(--font-display); font-size: 0.9rem;
  color: var(--unuchi-gold); padding: 10px 0;
  cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s;
}
.section-toggle:hover { color: var(--unuchi-forest); }
.section-toggle::after { content: ' ▾'; font-size: 0.7rem; }
.section-toggle.collapsed::after { content: ' ▸'; }
.section-body { transition: max-height 0.4s ease, opacity 0.3s ease; overflow: hidden; }
.section-body.collapsed { max-height: 0 !important; opacity: 0; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════
   THREE.JS 3D COMPASS
   ═══════════════════════════════════════════════════════════════ */
.compass-container {
  margin: 12px 0; text-align: center;
  position: relative;
}
.compass-container canvas {
  display: block; margin: 0 auto;
  max-width: 360px; width: 100%; height: auto;
  border-radius: var(--radius);
  touch-action: none;
}
.compass-controls {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 8px;
}
.compass-fullscreen {
  position: fixed !important; inset: 0; z-index: 7000;
  background: var(--unuchi-cream);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0;
}
.compass-fullscreen canvas {
  max-width: none; width: auto; height: auto;
}
.close-fs {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(74,55,40,0.1);
  border: 1px solid var(--unuchi-gold);
  color: var(--unuchi-dark); font-size: 1.2rem;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  z-index: 7001; transition: background 0.3s;
}
.close-fs:hover { background: rgba(74,55,40,0.15); }

/* ═══════════════════════════════════════════════════════════════
   13-TONE SCALE RING
   ═══════════════════════════════════════════════════════════════ */
.tone-scale-section { margin: 24px 0; }
.tone-scale-ring {
  position: relative;
  width: min(320px, 85vw); height: min(320px, 85vw);
  margin: 16px auto;
}
.tone-scale-node {
  position: absolute; width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid var(--unuchi-gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s;
  transform: translate(-50%, -50%);
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.tone-scale-node:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 12px rgba(181,164,90,0.5);
  z-index: 5;
}
.tone-scale-node.active {
  box-shadow: 0 0 8px rgba(181,164,90,0.3);
}
.tone-scale-node .tsn-num { pointer-events: none; }
.tone-scale-node .tsn-tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  background: rgba(74,55,40,0.92); border: 1px solid var(--unuchi-gold);
  border-radius: 4px; padding: 8px 12px;
  font-size: 0.6rem; font-weight: 400;
  color: #faf7f0; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s; z-index: 10;
  line-height: 1.5;
}
.tone-scale-node:hover .tsn-tooltip { opacity: 1; }
.tsn-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.tsn-base {
  font-family: var(--font-mono); font-size: clamp(1.1rem, 4vw, 1.4rem);
  color: var(--unuchi-gold); font-weight: 600;
}
.tsn-label {
  font-family: var(--font-display); font-size: 0.65rem;
  color: rgba(74,55,40,0.4); margin-top: 2px;
}

/* ── Tone dot (in 8-tone pips) ── */
.tone-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 4px;
  vertical-align: middle;
}

/* ── Tooltip sub-elements ── */
.tt-label { font-weight: 600; margin-bottom: 2px; }
.tt-eigen { opacity: 0.7; }
.tt-desc { opacity: 0.5; font-style: italic; }

/* ── Chord mode label ── */
.chord-mode-label {
  text-align: center; font-size: 0.7rem;
  color: rgba(74,55,40,0.4); margin-top: 6px;
  font-family: var(--font-mono);
}

/* ── Chi indicator ── */
.chi-indicator {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--chi-sun);
  vertical-align: middle; margin-left: 4px;
  animation: pulse-chi 2s ease-in-out infinite;
}
@keyframes pulse-chi {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════════
   CHI DRONE SLIDER
   ═══════════════════════════════════════════════════════════════ */
.drone-slider-section {
  margin: 12px 0; padding: 12px;
  border: 1px solid rgba(212,168,50,0.15);
  border-radius: var(--radius);
  background: rgba(212,168,50,0.04);
}
.tempo-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(74,55,40,0.12);
  outline: none; margin: 10px 0;
}
.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--chi-sun); cursor: pointer;
  border: 2px solid var(--unuchi-dark);
  box-shadow: 0 0 6px rgba(212,168,50,0.4);
}
.tempo-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--chi-sun); cursor: pointer;
  border: 2px solid var(--unuchi-dark);
}
.tempo-label {
  text-align: center; font-family: var(--font-mono);
  font-size: 0.7rem; color: rgba(74,55,40,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   PLAYING ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
.tone-pip.playing {
  background: rgba(181,164,90,0.2) !important;
  animation: pulse-tone 0.8s ease-out;
}
.tone-scale-node.playing {
  animation: pulse-tone 0.8s ease-out;
  box-shadow: 0 0 16px rgba(181,164,90,0.6);
}
@keyframes pulse-tone {
  0% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.3); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
/* Pulse animation for 8-tone pips (no translate) */
.tone-pip.playing {
  animation: pulse-tone-pip 0.8s ease-out;
}
@keyframes pulse-tone-pip {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-2px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   NSIBIDI GLYPH TOOLTIPS — hover/tap data-tip system
   ═══════════════════════════════════════════════════════════════ */
.nsibidi-icon {
  width: 56px;
  height: 56px;
  color: var(--unuchi-gold);
  transition: transform 0.3s, filter 0.3s;
  cursor: help;
}
.nsibidi-icon:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(212,168,50,0.4));
}

[data-tip] {
  position: relative;
  cursor: help;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74,55,40,0.94);
  border: 1px solid var(--unuchi-gold);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #faf7f0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 20;
  max-width: 260px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
[data-tip]:hover::after,
[data-tip].tip-active::after {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   SOCIAL SHARE MODAL
   ═══════════════════════════════════════════════════════════════ */
.share-icons-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
}
.share-icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(181,164,90,0.3);
  background: rgba(74,55,40,0.06);
  color: var(--unuchi-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.share-icon-btn:hover, .share-icon-btn:active {
  background: rgba(61,107,46,0.2);
  border-color: var(--unuchi-gold);
  color: var(--unuchi-gold);
  transform: scale(1.1);
}
.share-icon-btn svg {
  width: 22px;
  height: 22px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════ */

/* Tiny phones (< 320px) */
@media (max-width: 319px) {
  .slide { padding: 16px 10px; }
  .slide-icon { font-size: 3rem; }
  .onboard-btn { padding: 10px 20px; font-size: 0.78rem; }
  .header-actions { gap: 4px; }
  .header-btn { font-size: 0.65rem; padding: 6px 10px; }
  .toast { max-width: 260px; font-size: 0.75rem; }
  .bw-preset { padding: 10px 2px; font-size: 0.65rem; }
  .bw-freq { font-size: 1.6rem; }
  .brainwave-presets { flex-wrap: wrap; }
  .bw-preset { flex: 1 1 calc(50% - 4px); }
}

/* Small phones (< 360px) */
@media (max-width: 359px) {
  main { padding: 12px 10px 30px; }
  .result-grid { grid-template-columns: 1fr; }
  .tone-pip { flex: 1 1 calc(50% - 4px); min-width: 50px; }
  .chord-controls { flex-direction: column; }
  .actions-row { flex-direction: column; }
  .chi-phase-value { font-size: 1.4rem; }
  .tone-scale-ring { width: 260px; height: 260px; }
  .tone-scale-node { width: 30px; height: 30px; font-size: 0.6rem; }
  .brainwave-controls { flex-direction: column; }
}

/* Standard phones (360-480px) */
@media (min-width: 360px) and (max-width: 480px) {
  .tone-pip { flex: 1 1 calc(25% - 4px); min-width: 55px; }
  .tone-scale-ring { width: 290px; height: 290px; }
  .tone-scale-node { width: 34px; height: 34px; }
}

/* Mid-size phones (375px+) */
@media (min-width: 375px) {
  .slide { max-width: 360px; }
  .toast-container { bottom: 24px; right: 24px; }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) {
  main { max-width: 680px; padding: 30px 24px 50px; }
  .header h1 { font-size: 1.5rem; }
  .header .subtitle { font-size: 0.9rem; }
  .result-value { font-size: 1rem; }
  .result-label { font-size: 0.7rem; }

  /* Result grid: 4 columns on tablet */
  .result-grid { grid-template-columns: repeat(4, 1fr); }

  /* Compass */
  .compass-container canvas { max-width: 420px; }

  /* Tone scale ring: larger */
  .tone-scale-ring { width: 380px; height: 380px; }
  .tone-scale-node { width: 40px; height: 40px; font-size: 0.75rem; }

  /* Chord controls: inline row */
  .chord-controls {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }
  .chord-btn { min-width: 90px; }

  /* Actions row: horizontal with more spacing */
  .actions-row {
    flex-direction: row;
    gap: 12px;
    justify-content: center;
  }
  .action-btn { min-width: 140px; flex: 0 1 auto; }

  /* Brainwave presets: inline row */
  .brainwave-presets {
    flex-direction: row;
    gap: 8px;
    justify-content: center;
  }
  .bw-preset { flex: 1; min-width: 0; padding: 14px 8px; font-size: 0.78rem; }
  .bw-freq { font-size: 2.4rem; }

  /* Brainwave controls: inline */
  .brainwave-controls {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
  }

  /* Onboarding */
  .slide { max-width: 480px; padding: 32px 24px; }
  .slide-icon { font-size: 5rem; }
  .slide h2 { font-size: 1.5rem; }
  .slide p { font-size: 1rem; }

  /* Header actions */
  .header-btn { font-size: 0.72rem; padding: 6px 16px; }

  /* Toast */
  .toast { max-width: 380px; }

  /* Curriculum */
  .curriculum-section { padding: 24px 32px; }
  .curriculum-section h3 { font-size: 1.05rem; }
  .curriculum-section p { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP (1024px+) — wider layout, 4-column grid, larger ring
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  main { max-width: 800px; padding: 40px 32px 60px; }

  /* Header */
  .header h1 { font-size: 1.6rem; letter-spacing: 0.12em; }
  .header .subtitle { font-size: 0.95rem; }

  /* Result grid: 4 columns */
  .result-grid { grid-template-columns: repeat(4, 1fr); }
  .result-cell { padding: 14px 16px; }
  .result-label { font-size: 0.72rem; }
  .result-value { font-size: 1.05rem; }

  /* Market banner: larger */
  .market-banner { padding: 20px; }
  .market-banner .market-day-name { font-size: 1.8rem; }
  .market-banner .market-element { font-size: 0.9rem; }

  /* Summary */
  .summary-line { font-size: 0.9rem; padding: 14px 20px; }

  /* Chord section */
  .chord-tones { gap: 6px; }
  .tone-pip { flex: 1 1 calc(14% - 6px); min-width: 60px; padding: 10px 6px; font-size: 0.7rem; }

  /* Chord controls: horizontal row, centered */
  .chord-controls {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .chord-btn { min-width: 100px; padding: 10px 16px; font-size: 0.8rem; }

  /* Tone scale ring: larger on desktop */
  .tone-scale-ring { width: 420px; height: 420px; }
  .tone-scale-node { width: 44px; height: 44px; font-size: 0.8rem; }
  .tsn-base { font-size: 1.5rem; }

  /* Compass */
  .compass-container canvas { max-width: 480px; }

  /* Chi phase */
  .chi-phase-value { font-size: 2.2rem; }
  .chi-phase-desc { font-size: 0.85rem; }

  /* Actions row: horizontal with generous spacing */
  .actions-row {
    flex-direction: row;
    gap: 16px;
    justify-content: center;
  }
  .action-btn { min-width: 160px; flex: 0 1 auto; padding: 12px 20px; font-size: 0.85rem; }

  /* Brainwave: larger display */
  .bw-freq { font-size: 2.8rem; }
  .bw-band { font-size: 0.8rem; }
  .brainwave-presets {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
  }
  .bw-preset { padding: 16px 12px; font-size: 0.82rem; }
  .bw-preset span { font-size: 0.65rem; }
  .brainwave-controls {
    flex-direction: row;
    gap: 12px;
    justify-content: center;
  }
  .brainwave-controls .chord-btn { min-width: 100px; }

  /* Brainwave panel */
  .brainwave-panel { padding: 20px 24px; }

  /* Curriculum: two-column topic list */
  .curriculum-section { padding: 28px 36px; }
  .curriculum-section h3 { font-size: 1.1rem; }
  .curriculum-section p { font-size: 0.88rem; }
  .curriculum-topics {
    columns: 2;
    column-gap: 32px;
  }
  .curriculum-topics li {
    break-inside: avoid;
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  /* Drone slider: wider padding */
  .drone-slider-section { padding: 16px 20px; }

  /* Ekwensu banner */
  .ekwensu-banner { padding: 24px; }
  .ekwensu-banner .ekwensu-title { font-size: 1.5rem; }
  .ekwensu-banner .ekwensu-desc { font-size: 0.9rem; }

  /* Footer */
  .footer { padding: 28px 0; }
  .footer-unuchi { font-size: 0.85rem; }

  /* Modal box: slightly larger */
  .modal-box { width: min(440px, 80vw); padding: 32px 28px; }

  /* Onboarding: larger slides */
  .slide { max-width: 520px; padding: 36px 28px; }
  .slide-icon { font-size: 5.5rem; }
  .slide h2 { font-size: 1.6rem; }
  .slide p { font-size: 1.05rem; }

  /* Header actions */
  .header-actions { gap: 12px; }
  .header-btn { font-size: 0.75rem; padding: 8px 18px; }

  /* Desktop: header as flex row with account top-right */
  .header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .header h1 { flex: 0 0 100%; text-align: center; }
  .header .subtitle { flex: 0 0 100%; text-align: center; }
  .header-actions {
    position: absolute;
    top: 16px;
    right: 0;
    margin-top: 0;
  }
  #authBtn {
    order: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LARGE DESKTOP (1440px+) — extra breathing room
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1440px) {
  main { max-width: 1100px; }
  .tone-scale-ring { width: 460px; height: 460px; }
  .tone-scale-node { width: 48px; height: 48px; font-size: 0.85rem; }
  .compass-container canvas { max-width: 520px; }

  /* Side-by-side for chord and brainwave sections */
  .dual-section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* ── Safe area for notched phones ── */
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
