/* ═══════════════════════════════════════════════════════════
   Cosmic Tea — /sky
   Design tokens match the landing page / design system.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:             #0A0A1A;
  --space-mid:      #12122A;
  --space-card:     #1A1A35;
  --space-elev:     #22223F;
  --text:           #F0F0FF;
  --text-muted:     rgba(240,240,255,.55);
  --text-dim:       rgba(240,240,255,.30);

  --pink:           #E040FB;
  --purple:         #7C4DFF;
  --cyan:           #00E5FF;
  --gold:           #FFD740;
  --ember:          #FF7043;

  --aspect-conj:    #FFD740;
  --aspect-opp:     #FF7043;
  --aspect-trine:   #00E5FF;
  --aspect-square:  #E040FB;
  --aspect-sextile: #7C4DFF;

  --card-flip-duration: 600ms;
  --card-easing:        cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

/* `display:flex` on .state-* and .card-overlay would otherwise beat the
   `hidden` attribute; make hidden always win. */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ═══════ Backdrops ═══════ */

.stars { position:fixed; inset:0; pointer-events:none; z-index:0; }
.stars span {
  position:absolute;
  width:2px; height:2px;
  background:#fff;
  border-radius:50%;
  opacity:0;
  animation: twinkle var(--d, 4s) ease-in-out infinite alternate;
}
@keyframes twinkle {
  0%   { opacity:0;          transform:scale(.5); }
  100% { opacity:var(--o,.7); transform:scale(1); }
}

canvas#sky-3d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 600ms ease;
}
canvas#sky-3d.active    { opacity: 1; }
canvas#sky-3d.dimmed    { opacity: 0.22; }

/* ═══════ Shimmer ═══════ */

@keyframes shimmer {
  0%   { background-position:  200% center; }
  100% { background-position: -200% center; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--cyan), var(--purple), var(--pink));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ═══════ Top nav ═══════ */

.sky-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  max-width: 960px;
  margin: 0 auto;
}
.sky-nav-home {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.sky-nav-home img { width: 28px; height: 28px; }
.sky-nav-home span {
  font-family: 'Monoton', cursive;
  font-size: 16px;
  letter-spacing: 2px;
}
.sky-nav-waitlist {
  font-family: 'Lilita One', cursive;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(240,240,255,.15);
  transition: border-color .2s, background .2s;
}
.sky-nav-waitlist:hover {
  border-color: var(--pink);
  background: rgba(224,64,251,.08);
}

/* ═══════ App container ═══════ */

.sky-app {
  position: relative;
  z-index: 5;
}

.state { animation: fade-up .5s ease forwards; }
@keyframes fade-up { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

/* ═══════ State A — Entry ═══════ */

.state-entry {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100dvh - 80px);
  padding: 32px 20px 80px;
}
.entry-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 28px 28px;
  background: linear-gradient(180deg, rgba(26,26,53,.7), rgba(18,18,42,.55));
  border: 1px solid rgba(124,77,255,.25);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 40px rgba(124,77,255,.12);
}
.section-label {
  font-family: 'Lilita One', cursive;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 10px;
}
.entry-title {
  font-family: 'Lilita One', cursive;
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.2;
  margin-bottom: 14px;
  font-weight: 400;
}
.entry-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.entry-form { display:flex; flex-direction:column; gap: 14px; }
.field { display:flex; flex-direction:column; gap:6px; position:relative; }
.field-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input {
  width: 100%;
  padding: 14px 16px;
  background: var(--space-card);
  border: 1px solid rgba(240,240,255,.15);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  color-scheme: dark;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--text-dim); }
.field input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,77,255,.15);
}

.check { display:flex; gap:10px; align-items:center; cursor:pointer; font-size:14px; color:var(--text-muted); margin-top: 2px; }
.check input { accent-color: var(--purple); width:16px; height:16px; cursor:pointer; }
.field-help { font-size: 12px; color: var(--text-dim); line-height: 1.5; display:none; }
.check.show-help ~ .field-help,
body.unknown-time .field-help { display: block; }
body.unknown-time #field-time { display: none; }

/* autocomplete dropdown */
.city-results {
  position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: var(--space-elev);
  border: 1px solid rgba(124,77,255,.4);
  border-radius: 12px;
  overflow: hidden;
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.city-result {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.city-result:hover,
.city-result.active { background: rgba(124,77,255,.2); }
.city-result:last-child { border-bottom: none; }
.city-result .muted { color: var(--text-dim); font-size: 12px; margin-left: 6px; }

/* CTA */
.cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: 'Lilita One', cursive;
  font-size: 16px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .25s;
  letter-spacing: .3px;
}
.cta-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(224,64,251,.35); }
.cta-primary:active { transform: translateY(0); }
.cta-primary:disabled { opacity: .55; cursor: wait; }
.cta-arrow { font-size: 18px; }

.cta-ghost {
  padding: 12px 20px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(240,240,255,.25);
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.cta-ghost:hover { border-color: var(--pink); background: rgba(224,64,251,.06); }

.form-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
}
.entry-micro {
  font-family: 'Lilita One', cursive;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 18px;
  letter-spacing: .5px;
}
.entry-newbie {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}
.entry-newbie a {
  color: #FF4081;
  text-decoration: none;
  font-weight: 700;
  transition: opacity .2s;
}
.entry-newbie a:hover { opacity: .8; text-decoration: underline; }

/* ═══════ State B — Ceremony ═══════ */

.state-ceremony {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.ceremony-caption {
  position: fixed;
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Lilita One', cursive;
  font-size: clamp(16px, 4vw, 22px);
  color: var(--text);
  text-align: center;
  max-width: 80vw;
  text-shadow: 0 0 18px rgba(10,10,26,.85);
  letter-spacing: .5px;
  opacity: 0;
  transition: opacity .6s ease;
  z-index: 6;
}
.ceremony-caption.show { opacity: 1; }
.ceremony-chart {
  width: min(92vw, 92vh, 720px);
  height: min(92vw, 92vh, 720px);
  opacity: 0;
  transition: opacity 1.1s ease;
}
.ceremony-chart.show { opacity: 1; }

/* ═══════ State C — Sandbox ═══════ */

.state-sandbox {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 70px);
}

/* ── sandbox header (title + edit chip) ── */
.sandbox-header {
  position: relative;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 22px 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sandbox-title {
  font-family: 'Monoton', cursive;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1.1;
  text-align: center;
  margin: 0;
  padding: 0 110px;
}

/* ── sandbox toolbar (edit-birth chip) ── */
.sandbox-toolbar {
  position: absolute;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
}
.edit-birth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: rgba(26,26,53,.7);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.edit-birth:hover { color: var(--pink); border-color: var(--pink); }

/* ── side-by-side grid ── */
.sky-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 12px 22px 0;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(26,26,53,.55), rgba(18,18,42,.4));
  border: 1px solid rgba(124,77,255,.18);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 64vh;
}
.panel-label {
  position: absolute;
  top: 12px;
  left: 16px;
  font-family: 'Lilita One', cursive;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
}
.panel-label em {
  color: var(--text-muted);
  font-style: normal;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: none;
  font-weight: 700;
}

.panel-chart .sky-chart {
  width: 92%;
  height: 92%;
  /* tap-only — `manipulation` lets the browser scroll/zoom the page while
     keeping taps responsive (no 300ms double-tap delay). */
  touch-action: manipulation;
  user-select: none;
}
.panel-solar canvas {
  width: 100%;
  height: 100%;
  display: block;
  /* `pan-y` lets the page scroll on vertical drags, while horizontal/diagonal
     drags still drive Three.js OrbitControls rotation. Pinch-zoom on the
     canvas is sacrificed in exchange for working page scroll on phones. */
  touch-action: pan-y;
  cursor: grab;
}
.panel-solar canvas:active { cursor: grabbing; }
.solar-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 700;
  pointer-events: none;
  text-transform: uppercase;
}

/* mobile / narrow: stack vertically */
@media (max-width: 900px) {
  .sky-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 10px 16px 0;
  }
  .panel {
    aspect-ratio: 1 / 1;
    max-height: none;
  }
  /* Pin the action bar to the viewport bottom so chips/CTA are always
     reachable, even though the panels are taller than the viewport.
     z-index sits ABOVE the card-overlay (z-index 40) so tour controls
     are never hidden by the dim modal backdrop. */
  .bottom-sheet {
    position: sticky;
    bottom: 0;
    z-index: 41;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(10,10,26,0) 0%, rgba(10,10,26,.92) 22%, rgba(10,10,26,.98) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  /* While a tour runs, leave room for the sticky tour-row at the bottom
     so the centered modal card doesn't visually overlap the controls. */
  body.tour-active .info-card {
    max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));
  }
  /* Tour navigation lives inline in the action bar on mobile, replacing
     the chips/CTA while a tour is running. */
  body.tour-active .caption-bar,
  body.tour-active .mode-chips,
  body.tour-active .actions,
  body.tour-active .actions-note { display: none; }
  body.tour-active .tour-row { display: flex; }
  .tour-row {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .tour-row .tour-arrow {
    position: static;
    width: 44px;
    height: 44px;
    margin: 0;
    font-size: 24px;
  }
  .tour-row .tour-step-counter {
    position: static;
    transform: none;
    flex: 1;
    text-align: center;
  }
}

.skip-tour {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 14px;
  background: rgba(26,26,53,.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 7;
}
.skip-tour:hover { border-color: var(--pink); }

.bottom-sheet {
  padding: 18px 22px 32px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(10,10,26,0) 0%, rgba(10,10,26,.7) 22%, rgba(10,10,26,.9) 100%);
  backdrop-filter: blur(2px);
}
.caption-bar {
  text-align: center;
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(26,26,53,.55);
  border: 1px solid rgba(124,77,255,.2);
  font-family: 'Lilita One', cursive;
  font-size: 14px;
  letter-spacing: .4px;
  color: var(--text);
}
.big-three { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.big-three .btk { display: inline-flex; gap: 5px; align-items: baseline; white-space: nowrap; }
.big-three .gly { font-size: 16px; color: var(--gold); }

.mode-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.chip {
  padding: 8px 16px;
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  border: 1px solid rgba(240,240,255,.1);
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--purple); color: var(--text); }
.chip.chip-active {
  background: rgba(124,77,255,.18);
  color: var(--text);
  border-color: var(--purple);
  box-shadow: 0 0 14px rgba(124,77,255,.25);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.actions .cta-primary { flex: 1; margin-top: 0; }
.actions .cta-ghost   { flex: 0 0 auto; }
.actions-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: .3px;
}

/* ═══════ Chart SVG — visuals ═══════ */

.sky-chart .ring-bg    { fill: rgba(26,26,53,.55); stroke: rgba(255,255,255,.08); stroke-width: 1; }
.sky-chart .ring-gold  { fill: none; stroke: rgba(255,215,64,.35); stroke-width: 1.5; }
.sky-chart .ring-inner { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 1; }
.sky-chart .spoke      { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.sky-chart .house-wedge { fill: transparent; stroke: rgba(255,255,255,.04); stroke-width: 1; cursor: pointer; transition: fill .2s; }
.sky-chart .house-wedge:hover,
.sky-chart .house-wedge.selected { fill: rgba(224,64,251,.08); stroke: var(--pink); }
.sky-chart .zodiac-wedge { fill: transparent; cursor: pointer; }
.sky-chart .zodiac-glyph { fill: var(--gold); font-family: 'Nunito', sans-serif; font-size: 32px; font-weight: 800; dominant-baseline: central; text-anchor: middle; pointer-events: none; }
.sky-chart .zodiac-label { fill: rgba(255,215,64,.65); font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: 1.2px; dominant-baseline: central; text-anchor: middle; pointer-events: none; }
.sky-chart .house-num    { fill: rgba(240,240,255,.7); font-family: 'Lilita One', cursive; font-size: 26px; font-weight: 400; dominant-baseline: central; text-anchor: middle; pointer-events: none; }
.sky-chart .planet-group { cursor: pointer; }
.sky-chart .planet-glyph {
  font-family: 'Nunito', sans-serif;
  font-size: 44px;
  font-weight: 800;
  dominant-baseline: central;
  text-anchor: middle;
  pointer-events: none;
}
.sky-chart .planet-hit   { fill: rgba(255,255,255,0.001); r: 36; }
.sky-chart .planet-hit:hover + .planet-glow { opacity: 1; }
.sky-chart .planet-glow  { opacity: 0; transition: opacity .25s; pointer-events: none; }
.sky-chart .planet-group.selected .planet-glow { opacity: 1; }
.sky-chart .aspect-line  { stroke-linecap: round; opacity: .7; mix-blend-mode: screen; pointer-events: stroke; cursor: pointer; }
.sky-chart .aspect-line:hover { opacity: 1; }
.sky-chart .asc-beam     { stroke: var(--pink); stroke-width: 2; opacity: .85; filter: drop-shadow(0 0 6px rgba(224,64,251,.8)); pointer-events: none; }
.sky-chart .center-logo  { fill: rgba(255,255,255,.16); font-family: 'Monoton', cursive; font-size: 16px; letter-spacing: 1.5px; text-anchor: middle; dominant-baseline: central; }

.sky-chart .plot-anim   { animation: sky-plot .7s var(--card-easing) backwards; }
.sky-chart .aspect-anim { animation: sky-aspect-draw .7s ease-out backwards; }
.sky-chart .ring-anim   { animation: sky-ring-draw 1s ease-out forwards; stroke-dasharray: 3000; stroke-dashoffset: 3000; }
.sky-chart .asc-anim    { stroke-dasharray: 450; stroke-dashoffset: 450; animation: sky-aspect-draw .7s ease-out forwards; }

@keyframes sky-plot {
  0%   { opacity:0; transform: scale(0) rotate(-20deg); transform-origin: center; }
  70%  { opacity:1; transform: scale(1.25) rotate(0deg); }
  100% { opacity:1; transform: scale(1) rotate(0); }
}
@keyframes sky-aspect-draw {
  from { stroke-dashoffset: 100%; }
  to   { stroke-dashoffset: 0; }
}
@keyframes sky-ring-draw {
  to   { stroke-dashoffset: 0; }
}

/* Aspect colors */
.sky-chart .aspect-conjunction { stroke: var(--aspect-conj);    stroke-width: 1.6; }
.sky-chart .aspect-opposition  { stroke: var(--aspect-opp);     stroke-width: 1.4; }
.sky-chart .aspect-trine       { stroke: var(--aspect-trine);   stroke-width: 1.3; }
.sky-chart .aspect-square      { stroke: var(--aspect-square);  stroke-width: 1.3; }
.sky-chart .aspect-sextile     { stroke: var(--aspect-sextile); stroke-width: 1.1; }
.sky-chart.aspects-hidden .aspect-line { display: none; }

/* ═══════ Flip card ═══════ */

.card-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(10,10,26,.75);
  backdrop-filter: blur(10px);
  animation: fade-up .25s ease forwards;
}
.info-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  /* Card auto-sizes to its content — no scrollbar — and is bounded by the
     viewport so it never spills offscreen. The inner scroll fallback below
     hides its scrollbar in the rare case content still overflows. */
  max-height: calc(100dvh - 32px);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(26,26,53,.98), rgba(18,18,42,.98));
  border: 1.5px solid rgba(124,77,255,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(224,64,251,.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.info-card-scroll {
  padding: 28px 26px 24px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
  /* Hide scrollbar — keeps the card looking finished even if content
     overflows on very short viewports. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.info-card-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

.card-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(124,77,255,.15);
  border: 1.5px solid rgba(124,77,255,.45);
  color: var(--text);
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  z-index: 42;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .2s, border-color .2s;
}
.card-close:hover {
  background: rgba(224,64,251,.25);
  border-color: var(--pink);
  color: var(--pink);
  transform: rotate(90deg);
}
.card-close span { display: inline-block; line-height: 1; transform: translateY(-2px); }

/* ── Side-card: card over the chart, solar view stays visible & interactive.
   Used in both Tour and Explore (planet click) so the experience matches. ── */
@media (min-width: 900px) {
  .card-overlay.side-card,
  .card-overlay.tour-mode {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: block;
    padding: 0;
    pointer-events: none;            /* clicks pass through to chart/solar */
  }
  .card-overlay.side-card .info-card,
  .card-overlay.tour-mode .info-card {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    left: 25vw;                      /* horizontal centre of the chart half */
    transform: translate(-50%, -50%);
    max-width: min(440px, 38vw);
    max-height: calc(100dvh - 24px);
    box-shadow: 0 20px 70px rgba(0,0,0,.6), 0 0 50px rgba(224,64,251,.22);
  }
  /* Tour controls live in the bottom-sheet DOM; on desktop we project the
     arrows to fixed viewport coordinates flanking the chart half. */
  body.tour-active .tour-row {
    display: contents;               /* row container disappears; children float */
  }
  body.tour-active .tour-row .tour-arrow {
    pointer-events: auto;
    position: fixed !important;
    top: 50%;
    margin: 0 !important;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    font-size: 32px;
  }
  body.tour-active .tour-row .tour-arrow-prev { left: 18px; }
  body.tour-active .tour-row .tour-arrow-next { left: calc(50vw - 28px); }
  body.tour-active .tour-row .tour-step-counter {
    position: fixed;
    top: 88px;                       /* below sky-nav, above the chart panel */
    left: 25vw;
    transform: translateX(-50%);
    z-index: 41;
  }
}

/* ── Tour navigation ── */
.tour-arrow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(26,26,53,.85);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(124,77,255,.4);
  color: var(--text);
  font-family: 'Lilita One', cursive;
  font-size: 32px;
  font-weight: 400;
  cursor: pointer;
  z-index: 42;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, border-color .2s, background .2s;
  flex-shrink: 0;
}
.tour-arrow:hover {
  border-color: var(--pink);
  background: rgba(124,77,255,.18);
  transform: scale(1.07);
}
.tour-arrow:disabled,
.tour-arrow[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}
.tour-arrow:disabled:hover {
  transform: none;
  border-color: rgba(124,77,255,.4);
  background: rgba(26,26,53,.85);
}
.tour-arrow-prev { margin-right: 14px; }
.tour-arrow-next { margin-left: 14px; }

.tour-step-counter {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  background: rgba(26,26,53,.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(124,77,255,.3);
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  z-index: 41;
}
.tour-step-counter .label-name { color: var(--pink); margin-left: 4px; }

/* ── card header (planet) ── */
.card-header { text-align: center; padding-right: 36px; /* room for close button */ }
.card-body   { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.card-body p { margin-bottom: 10px; }
.card-body p:last-child { margin-bottom: 0; }
.card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,77,255,.4), transparent);
  margin: 14px 0;
}

.pc-glyph {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 12px currentColor);
}
.pc-name {
  font-family: 'Monoton', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  margin-bottom: 8px;
  color: var(--text);
}
.pc-sign {
  font-family: 'Lilita One', cursive;
  font-size: 22px;
  color: var(--text);
}
.pc-sign .pc-degree {
  color: var(--text-muted);
  font-size: 15px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  margin-left: 4px;
}
.pc-house {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: .3px;
}
.pc-house strong { color: var(--text); font-weight: 700; }
.pc-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.pc-kw {
  padding: 5px 11px;
  background: rgba(124,77,255,.15);
  border: 1px solid rgba(124,77,255,.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text);
}

.pc-essence {
  font-family: 'Lilita One', cursive;
  font-size: 17px;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text);
}

/* color-tinted callouts for personal/generational/house notes */
.pc-note {
  margin-top: 10px;
  padding: 10px 13px;
  background: rgba(124,77,255,.10);
  border-left: 3px solid rgba(124,77,255,.6);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  line-height: 1.5;
}
.pc-note strong { color: var(--text); font-weight: 800; }
.pc-note-personal {
  background: rgba(255,128,171,.10);
  border-left-color: rgba(255,128,171,.7);
}
.pc-note-generational {
  background: rgba(124,77,255,.08);
  border-left-color: rgba(124,77,255,.5);
  color: var(--text-muted);
  font-style: italic;
}
.pc-note-house {
  background: rgba(255,215,64,.08);
  border-left-color: rgba(255,215,64,.5);
}

/* ── card header (house) ── */
.hc-num {
  font-family: 'Monoton', cursive;
  font-size: 64px;
  line-height: 1;
  color: var(--pink);
  margin-bottom: 4px;
  letter-spacing: 2px;
}
.hc-label {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
}
.hc-title {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  font-style: italic;
}
.hc-inhabitants {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.hc-inhabitants .inh {
  padding: 5px 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

/* ═══════ Aspect tooltip ═══════ */

.aspect-tooltip {
  position: fixed;
  z-index: 30;
  padding: 10px 14px;
  background: rgba(26,26,53,.95);
  border: 1px solid var(--purple);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  max-width: 260px;
  line-height: 1.5;
  backdrop-filter: blur(6px);
  animation: fade-up .2s ease forwards;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

/* ═══════ Footer ═══════ */

.sky-footer {
  text-align: center;
  padding: 28px 20px 40px;
  font-size: 12px;
  color: var(--text-dim);
}
.sky-footer a { color: var(--text-muted); text-decoration: none; }
.sky-footer a:hover { color: var(--pink); }

/* share offscreen */
.share-target {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1080px;
  height: 1920px;
  pointer-events: none;
}

/* ═══════ Responsive ═══════ */

@media (max-width: 480px) {
  .sky-nav { padding: 14px 16px; }
  .sky-nav-home span { font-size: 14px; }
  .sandbox-header { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 16px 0; min-height: 0; }
  .sandbox-title { padding: 0; }
  .sandbox-toolbar { position: static; transform: none; display: flex; justify-content: flex-end; }
  .entry-card { padding: 24px 20px; border-radius: 20px; }
  .actions { flex-direction: column; }
  .actions .cta-ghost { width: 100%; }
  .info-card { max-width: 92vw; max-height: calc(100dvh - 24px); }
  .info-card-scroll { padding: 22px 18px 20px; }
  .pc-glyph { font-size: 48px; }
  .hc-num { font-size: 56px; }
  .card-close { width: 40px; height: 40px; font-size: 24px; top: 10px; right: 10px; }
  .card-header { padding-right: 32px; }
}

/* ═══════ Reduced motion ═══════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  canvas#sky-3d { display: none; }
  .stars span { animation: none; opacity: .5; }
}
