  /* =====================================================================
     Brahmanda Kundli, the science of your sky
     A cinematic and interactive Vedic birth chart visualizer
     Visual language inspired by editorial astronomy essays
     ===================================================================== */

  :root {
    --paper:      #F2EADF;
    --paper-dim:  rgba(var(--paper-rgb), 0.55);
    --paper-faint:rgba(var(--paper-rgb), 0.18);
    --ink-deep:   #0A0C1C;
    --ink-warm:   #181426;
    --copper:     #B4612A;
    --copper-dp:  #8A4519;
    --copper-lt:  #D08147;
    --gold:       #C99645;
    --gold-bright:#E0B062;
    --crimson:    #7A1B2E;
    --crimson-lt: #A83A4A;
    --rule:       rgba(var(--paper-rgb), 0.18);
    --rule-soft:  rgba(var(--paper-rgb), 0.10);

    --f-display: 'Fraunces', Georgia, serif;
    --f-body:    'Newsreader', Georgia, serif;
    --f-deva:    'Tiro Devanagari Sanskrit', serif;
    --f-mono:    'JetBrains Mono', ui-monospace, monospace;

    /* RGB triplets so translucent surfaces follow the active theme */
    --paper-rgb:   242, 234, 223;
    --ink-rgb:     10, 12, 28;
    --gold-rgb:    201, 150, 69;
    --copper-rgb:  180, 97, 42;
    --crimson-rgb: 122, 27, 46;
    color-scheme: dark;
  }

  /* =====================================================================
     LIGHT THEME — warm editorial parchment. The cosmos viewport itself
     stays deep-space dark (space is dark in any theme); all UI chrome,
     forms, readings and tables flip to ink-on-paper.
     ===================================================================== */
  html[data-theme="light"] {
    --paper:      #271E12;
    --paper-dim:  rgba(39, 30, 18, 0.64);
    --paper-faint:rgba(39, 30, 18, 0.24);
    --ink-deep:   #F4EDE2;
    --ink-warm:   #ECE1CF;
    --copper:     #A4541F;
    --copper-dp:  #7C3E12;
    --copper-lt:  #9C5B28;
    --gold:       #96690A;
    --gold-bright:#7E570D;
    --crimson:    #8A2236;
    --crimson-lt: #963140;
    --rule:       rgba(39, 30, 18, 0.22);
    --rule-soft:  rgba(39, 30, 18, 0.11);
    --paper-rgb:   39, 30, 18;
    --ink-rgb:     244, 237, 226;
    --gold-rgb:    150, 105, 10;
    --copper-rgb:  164, 84, 31;
    --crimson-rgb: 138, 34, 54;
    color-scheme: light;
  }
  /* Space stays space: anything rendering the sky keeps the dark palette */
  html[data-theme="light"] .stage-space {
    background:
      radial-gradient(ellipse 70% 55% at 50% 40%, #11142a 0%, #0A0C1C 70%);
  }
  html[data-theme="light"] .stage-space .cosmos-svg { color: #F2EADF; }
  html[data-theme="light"] .bg-starfield { display: none; }
  html[data-theme="light"] .bg-grain { opacity: 0.18; }
  html[data-theme="light"] .bg-vignette { opacity: 0.25; }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    background: var(--ink-deep);
    color: var(--paper);
    min-height: 100vh;
    font-family: var(--f-body);
    overflow: hidden;
  }
  #root { width: 100vw; height: 100vh; position: relative; }

  /* Page background, layered to feel like deep space with a touch of warmth */
  .bg-layer {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
  }
  .bg-warm {
    background:
      radial-gradient(ellipse 60% 45% at 12% 8%, rgba(var(--copper-rgb),0.10), transparent 60%),
      radial-gradient(ellipse 50% 40% at 90% 95%, rgba(var(--crimson-rgb),0.07), transparent 60%),
      radial-gradient(ellipse 80% 60% at 50% 50%, rgba(var(--gold-rgb),0.03), transparent 70%);
  }
  .bg-grain {
    opacity: 0.32;
    mix-blend-mode: overlay;
  }
  .bg-vignette {
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
  }

  /* Frame border, kept as opt-in via .show-frame on body */
  .frame-border {
    position: fixed; inset: 28px; border: 1px solid var(--rule);
    pointer-events: none; z-index: 100;
    display: none;
  }
  body.show-frame .frame-border { display: block; }

  /* Chrome elements at corners */
  .corner-mark {
    position: fixed; z-index: 200; pointer-events: none;
    font-family: var(--f-mono); font-size: 13px;
    color: var(--paper-dim); letter-spacing: 0.28em; text-transform: uppercase;
  }
  .corner-tl { top: 50px; left: 60px; }
  .corner-tr { top: 50px; right: 60px; text-align: right; }
  .corner-bl { bottom: 50px; left: 60px; }
  .corner-br {
    bottom: 24px; right: 28px; text-align: right; color: var(--copper-lt);
    font-size: 11px; opacity: 0.6;
  }

  .brand-mark {
    position: fixed; top: 11px; left: 24px; z-index: 220;
    font-family: var(--f-deva); font-size: 22px; color: var(--copper);
    letter-spacing: 0.04em; pointer-events: none;
    text-shadow: 0 0 12px rgba(var(--copper-rgb), 0.3);
    opacity: 0.85;
  }

  /* ============= FLOATING PANELS (draggable, collapsible) ============= */
  .fp {
    position: absolute;
    background: rgba(var(--ink-rgb), 0.86);
    border: 1px solid var(--rule);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 55;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.25s ease;
    user-select: none;
  }
  .fp:hover { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); }
  .fp.dragging { cursor: grabbing; }
  .fp-head {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px 8px 14px;
    border-bottom: 1px solid rgba(var(--copper-rgb), 0.18);
    cursor: grab;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
  }
  .fp.dragging .fp-head { cursor: grabbing; }
  .fp-head:hover { background: rgba(var(--gold-rgb), 0.04); }
  .fp-head-title { flex: 1; }
  .fp-head-deva {
    font-family: var(--f-deva); font-size: 14px;
    color: var(--gold); letter-spacing: 0.02em; text-transform: none;
  }
  .fp-actions { display: flex; gap: 4px; }
  .fp-action {
    width: 22px; height: 22px;
    background: transparent; border: 1px solid var(--rule);
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; padding: 0;
    transition: all 0.2s ease;
  }
  .fp-action:hover {
    color: var(--gold); border-color: var(--gold);
    background: rgba(var(--gold-rgb), 0.1);
  }
  .fp-body {
    padding: 14px;
    overflow-y: auto; overflow-x: hidden;
    /* Cap to viewport so panels without an explicit height (Dasha, MiniKundli,
       Native) scroll instead of growing past the screen. Panels WITH explicit
       height (cosmos) get the calc-based cap below. */
    max-height: calc(100vh - 140px);
  }
  /* When the floating panel HAS an explicit height (cosmos), respect it */
  .fp[style*="height"] .fp-body { max-height: calc(100% - 44px); }
  /* Cosmos panel body should not scroll (SVG fills it) */
  .fp.fp-cosmos .fp-body { overflow: hidden; max-height: calc(100% - 44px); }
  .fp.collapsed .fp-body { display: none; }
  .fp.collapsed .fp-resize { display: none; }
  .fp.collapsed {
    background: rgba(var(--ink-rgb), 0.92);
  }
  .fp.collapsed .fp-head { border-bottom: none; }
  .fp-resize {
    position: absolute; right: 0; bottom: 0;
    width: 14px; height: 14px; cursor: nwse-resize;
    background:
      linear-gradient(135deg, transparent 50%, var(--copper-lt) 50%, var(--copper-lt) 60%, transparent 60%,
        transparent 70%, var(--copper-lt) 70%, var(--copper-lt) 80%, transparent 80%);
    opacity: 0.5;
  }
  .fp-resize:hover { opacity: 1; }

  /* ============= SETTINGS GEAR ============= */
  .settings-fab {
    position: fixed; top: 4px; right: 12px; z-index: 230;
    width: 36px; height: 36px;
    background: rgba(var(--ink-rgb), 0.7);
    border: 1px solid var(--rule);
    border-radius: 50%;
    color: var(--paper-dim);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s ease;
    backdrop-filter: blur(8px);
  }
  .settings-fab:hover {
    color: var(--gold); border-color: var(--gold);
    transform: rotate(60deg);
  }
  .settings-popup {
    position: fixed; top: 50px; right: 12px;
    width: 280px;
    background: rgba(var(--ink-rgb), 0.94);
    border: 1px solid var(--rule);
    backdrop-filter: blur(12px);
    padding: 18px;
    z-index: 225;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .settings-popup-head {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.42em; text-transform: uppercase;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
    display: flex; justify-content: space-between; align-items: center;
  }
  .settings-popup-deva {
    font-family: var(--f-deva); font-size: 14px;
    color: var(--gold); letter-spacing: 0; text-transform: none;
  }
  .settings-section { margin-bottom: 14px; }
  .settings-label {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.28em; text-transform: uppercase;
    margin-bottom: 6px;
  }
  .settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 0;
    font-family: var(--f-body); font-size: 13px;
    color: var(--paper);
  }
  .settings-toggle {
    width: 36px; height: 18px; border-radius: 10px;
    background: var(--rule); position: relative; cursor: pointer;
    transition: background 0.25s ease; border: none; padding: 0;
  }
  .settings-toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--paper-dim); transition: all 0.25s ease;
  }
  .settings-toggle.on { background: rgba(var(--gold-rgb), 0.4); }
  .settings-toggle.on::after { left: 20px; background: var(--gold); }
  .settings-mini-btn {
    background: transparent; border: 1px solid var(--rule);
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.22em; text-transform: uppercase;
    padding: 4px 10px;
    transition: all 0.2s ease;
  }
  .settings-mini-btn:hover { color: var(--gold); border-color: var(--gold); }
  .settings-mini-btn.on {
    background: rgba(var(--gold-rgb), 0.15);
    color: var(--gold); border-color: var(--gold);
  }
  .settings-reset {
    width: 100%; padding: 8px; margin-top: 6px;
    background: transparent; border: 1px solid var(--rule);
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.28em; text-transform: uppercase;
    transition: all 0.25s ease;
  }
  .settings-reset:hover {
    color: var(--gold); border-color: var(--gold);
  }

  /* ============= WELCOME ============= */
  .welcome {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 10; padding: 0 80px;
  }
  .welcome-eyebrow {
    font-family: var(--f-display); font-style: italic;
    font-size: 18px; letter-spacing: 0.42em; text-transform: uppercase;
    color: var(--copper-lt); margin-bottom: 28px;
    animation: fadeInUp 1.2s 0.3s both;
  }
  .welcome-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: clamp(64px, 9vw, 144px);
    line-height: 0.94; letter-spacing: -0.035em;
    text-align: center; color: var(--paper);
    font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 1;
    animation: fadeInUp 1.4s 0.6s both;
  }
  .welcome-title em {
    font-style: italic; color: var(--gold);
    font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  }
  .welcome-deva {
    font-family: var(--f-deva); font-size: 36px;
    color: var(--copper-lt); margin-top: 24px;
    letter-spacing: 0.02em;
    animation: fadeInUp 1.2s 1.0s both;
  }
  .welcome-sub {
    font-family: var(--f-body); font-style: italic;
    font-size: 22px; line-height: 1.55;
    color: var(--paper-dim); max-width: 720px;
    text-align: center; margin-top: 40px;
    animation: fadeInUp 1.2s 1.4s both;
  }
  .welcome-begin {
    margin-top: 60px;
    font-family: var(--f-mono); font-size: 14px;
    color: var(--gold); letter-spacing: 0.42em; text-transform: uppercase;
    background: transparent; border: 1px solid var(--gold);
    padding: 18px 38px; cursor: pointer;
    transition: all 0.4s ease;
    animation: fadeInUp 1.2s 1.8s both;
  }
  .welcome-begin:hover {
    background: rgba(var(--gold-rgb), 0.1);
    letter-spacing: 0.5em;
    box-shadow: 0 0 30px rgba(var(--gold-rgb), 0.2);
  }

  /* Welcome ambient ring */
  .welcome-ambient {
    position: absolute; top: 50%; left: 50%;
    width: 800px; height: 800px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--rule); border-radius: 50%;
    pointer-events: none;
    animation: ambient-rotate 60s linear infinite;
  }
  .welcome-ambient::before, .welcome-ambient::after {
    content: ''; position: absolute; inset: 80px;
    border: 1px solid var(--rule-soft); border-radius: 50%;
  }
  .welcome-ambient::after { inset: 160px; }

  @keyframes ambient-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
  }

  /* ============= FORM ============= */
  .form-wrap {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 10; padding: 80px;
  }
  .form-card {
    width: 100%; max-width: 560px;
    padding: 56px 56px;
    background: rgba(var(--ink-rgb), 0.7);
    border: 1px solid var(--rule);
    backdrop-filter: blur(10px);
  }
  .form-eyebrow {
    font-family: var(--f-mono); font-size: 13px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 14px;
  }
  .form-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: 48px; line-height: 1.0; color: var(--paper);
    letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 96, 'SOFT' 50, 'WONK' 1;
    margin-bottom: 8px;
  }
  .form-title em { font-style: italic; color: var(--gold);
    font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1; }
  .form-deva {
    font-family: var(--f-deva); font-size: 22px; color: var(--copper-lt);
    letter-spacing: 0.02em; margin-bottom: 42px;
  }
  .form-field { margin-bottom: 26px; }
  .form-label {
    display: block; font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 10px;
  }
  .form-input {
    width: 100%; padding: 12px 0 14px 0;
    background: transparent; border: none;
    border-bottom: 1px solid var(--rule);
    color: var(--paper);
    font-family: var(--f-display); font-size: 22px;
    letter-spacing: -0.01em;
    transition: border-color 0.3s ease;
    outline: none;
  }
  .form-input:focus { border-bottom-color: var(--gold); }
  .form-input::placeholder { color: var(--paper-dim); font-style: italic; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

  /* Geocoding feedback line beneath the place input */
  .form-geo-line {
    margin-top: 8px;
    min-height: 18px;
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.12em;
    line-height: 1.4;
  }
  .form-geo { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .form-geo.loading { color: var(--paper-dim); font-style: italic; }
  .form-geo.ok      { color: var(--gold); }
  .form-geo.warn    { color: var(--crimson-lt); font-style: italic; }
  .form-geo-pin     { color: #7CFFB8; font-size: 14px; line-height: 1; }
  .form-geo-resolved {
    color: var(--paper-dim);
    font-family: var(--f-body); font-style: italic;
    text-transform: none; letter-spacing: 0;
  }
  .form-submit:disabled {
    opacity: 0.55; cursor: progress;
  }

  .form-submit {
    width: 100%; margin-top: 14px;
    padding: 18px;
    font-family: var(--f-mono); font-size: 14px;
    background: var(--gold); color: var(--ink-deep);
    border: none; cursor: pointer;
    letter-spacing: 0.42em; text-transform: uppercase; font-weight: 500;
    transition: all 0.4s ease;
  }
  .form-submit:hover {
    background: var(--gold-bright);
    letter-spacing: 0.5em;
  }

  /* ============= STAGE ============= */
  .stage {
    position: absolute; inset: 0;
    overflow: hidden;
  }
  .stage-svg { width: 100%; height: 100%; display: block; }

  /* Chapter timeline */
  .chapter-bar {
    display: flex; gap: 4px;
    padding: 8px 12px;
    background: rgba(var(--ink-rgb), 0.75);
    border: 1px solid var(--rule);
    backdrop-filter: blur(8px);
  }
  .chapter-bar.standalone {
    position: absolute; left: 50%; bottom: 60px;
    transform: translateX(-50%);
    z-index: 50;
  }
  .chapter-bar.standalone.tl-bottom { bottom: 208px; }
  .chapter-bar.in-panel {
    background: transparent; border: none;
    backdrop-filter: none; padding: 0;
    width: 100%; flex-wrap: wrap;
  }
  .chapter-chip {
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.28em; text-transform: uppercase;
    padding: 10px 14px; cursor: pointer;
    color: var(--paper-dim);
    background: transparent; border: 1px solid transparent;
    transition: all 0.3s ease;
    display: flex; align-items: center; gap: 8px;
  }
  .chapter-chip:hover {
    color: var(--copper-lt);
    background: rgba(208, 129, 71, 0.08);
  }
  .chapter-chip.active {
    color: var(--gold); border-color: var(--rule);
    background: rgba(var(--gold-rgb), 0.08);
  }
  .chapter-chip-num {
    font-size: 11px; color: var(--copper-lt); opacity: 0.7;
  }
  .chapter-chip.active .chapter-chip-num { color: var(--gold); opacity: 1; }

  /* Top-right phase indicator */
  .phase-indicator {
    position: absolute; top: 100px; right: 60px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    text-align: right; z-index: 50;
    line-height: 1.6;
  }
  .phase-indicator-deva {
    font-family: var(--f-deva); font-size: 18px;
    color: var(--paper); margin-top: 4px; letter-spacing: 0.02em;
  }

  /* Native readout (top-left under brand mark) */
  .native-readout {
    position: absolute; top: 100px; left: 60px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim); letter-spacing: 0.28em; text-transform: uppercase;
    line-height: 1.8; z-index: 50;
  }
  .native-readout-value {
    color: var(--paper); font-family: var(--f-body); font-style: italic;
    font-size: 14px; letter-spacing: 0; text-transform: none;
    margin-left: 8px;
  }

  /* Inspector panel */
  .inspector {
    position: absolute; right: 60px; top: 200px;
    width: 360px;
    padding: 26px 28px;
    background: rgba(var(--ink-rgb), 0.88);
    border: 1px solid var(--rule);
    backdrop-filter: blur(8px);
    z-index: 60;
    transition: opacity 280ms ease, transform 280ms ease;
  }
  .inspector.hidden { opacity: 0; pointer-events: none; transform: translateX(24px); }
  .inspector-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
  }
  .inspector-close {
    background: transparent; border: none; cursor: pointer;
    color: var(--copper-lt); font-family: var(--f-mono); font-size: 14px;
    letter-spacing: 0.2em; padding: 0;
  }
  .inspector-glyph {
    display: flex; align-items: baseline; gap: 16px; margin-bottom: 4px;
  }
  .inspector-symbol {
    font-family: var(--f-display); font-size: 56px;
    line-height: 1;
  }
  .inspector-name {
    font-family: var(--f-display); font-size: 34px; color: var(--paper);
    font-variation-settings: 'opsz' 36, 'WONK' 1;
    line-height: 1.0; margin-bottom: 4px;
  }
  .inspector-deva {
    font-family: var(--f-deva); font-size: 22px;
    letter-spacing: 0.02em;
  }
  .inspector-grid {
    display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--rule);
  }
  .inspector-grid-label {
    font-family: var(--f-mono); font-size: 12px; color: var(--copper-lt);
    letter-spacing: 0.28em; text-transform: uppercase;
  }
  .inspector-grid-value {
    font-family: var(--f-mono); font-size: 13px; color: var(--paper);
    text-align: right;
  }
  .inspector-prediction {
    font-family: var(--f-body); font-style: italic;
    font-size: 15px; line-height: 1.6;
    color: rgba(var(--paper-rgb), 0.82);
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--rule);
  }
  .inspector-house-meaning {
    font-family: var(--f-body); font-size: 13px;
    color: var(--paper-dim);
    margin-top: 10px;
  }
  .inspector-house-meaning b {
    color: var(--copper-lt); font-weight: normal; font-style: italic;
  }
  .inspector-pinhint {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.32em; text-transform: uppercase;
    margin-top: 14px;
  }

  /* ============= READING CHAPTER ============= */
  /* Wrapper that allows Reading/Kundli content to scroll inside the cosmos panel */
  .cosmos-content-wrap {
    position: absolute; inset: 0;
    overflow-y: auto; overflow-x: hidden;
  }
  .cosmos-content-wrap .reading,
  .cosmos-content-wrap .kundli-page {
    position: static;
    inset: auto;
  }
  .cosmos-content-wrap .reading {
    padding: 40px 56px 80px;
    background: transparent;
  }

  /* ============= READING CHAPTER (Step 02) =============
     Refined editorial typography. Tighter spacing, stronger hierarchy,
     reduced empty space, narrower measure for prose readability. */
  .reading {
    position: absolute; inset: 0;
    overflow-y: auto;
    z-index: 30;
    padding: 64px 56px 140px;
    background: radial-gradient(ellipse at top,
      rgba(20, 24, 48, 0.5) 0%,
      rgba(var(--ink-rgb), 0.92) 60%,
      rgba(var(--ink-rgb), 0.98) 100%);
  }
  .reading-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  /* Eyebrow: small caps marker above title */
  .reading-eyebrow {
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
    padding-left: 2px;
  }
  /* Title: large display serif, restrained leading */
  .reading-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--paper);
    font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 1;
    margin-bottom: 18px;
    max-width: 16ch;
  }
  .reading-title em {
    font-style: italic;
    color: var(--gold);
    font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  }
  /* Intro paragraph: italic body, narrower measure, calmer color */
  .reading-intro {
    font-family: var(--f-body); font-style: italic;
    font-size: 19px;
    line-height: 1.6;
    max-width: 64ch;
    color: var(--paper-dim);
    margin: 0 0 56px;
  }

  /* Sections: more compact bottom-spacing, sharper divider */
  .reading-section {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .reading-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  /* Section head: aligned baseline, narrower gap */
  .reading-section-head {
    display: flex; align-items: baseline; gap: 22px;
    margin-bottom: 22px;
    flex-wrap: wrap;
  }
  .reading-section-num {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .reading-section-title {
    font-family: var(--f-display); font-weight: 330;
    font-size: clamp(28px, 3.4vw, 38px);
    line-height: 1.05;
    color: var(--paper);
    letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 96, 'SOFT' 50, 'WONK' 1;
    margin: 0;
  }
  .reading-section-title em {
    font-style: italic; color: var(--gold);
  }
  .reading-section-deva {
    font-family: var(--f-deva); font-size: 18px;
    color: var(--copper-lt); letter-spacing: 0.02em;
    margin-left: auto;
  }

  /* Body: narrow measure (60-70ch is ideal for reading prose), calmer color */
  .reading-body {
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.72;
    color: rgba(var(--paper-rgb), 0.86);
    max-width: 66ch;
  }
  .reading-body em {
    font-style: italic;
    color: var(--gold);
  }
  .reading-body strong {
    font-weight: 500;
    color: var(--paper);
  }
  .reading-body p { margin: 0 0 16px; }
  .reading-body p:last-child { margin-bottom: 0; }

  /* Graha grid in reading: tighter cards, side-by-side */
  .graha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
  }
  .graha-card {
    padding: 20px 22px;
    border: 1px solid var(--rule-soft);
    background: rgba(15, 18, 38, 0.45);
    border-left-width: 3px;
    border-radius: 3px;
    transition: border-color 0.2s ease, background 0.2s ease;
  }
  .graha-card:hover {
    border-color: var(--rule);
    background: rgba(15, 18, 38, 0.6);
  }
  .graha-card-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
  }
  .graha-card-symbol {
    font-family: var(--f-display); font-size: 26px; line-height: 1;
    flex-shrink: 0;
  }
  .graha-card-house {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.28em; text-transform: uppercase;
    text-align: right;
  }
  .graha-card-name {
    font-family: var(--f-display); font-size: 19px;
    color: var(--paper);
    font-style: italic;
    font-variation-settings: 'opsz' 36, 'WONK' 1; line-height: 1.05;
    margin-bottom: 2px;
  }
  .graha-card-deva {
    font-family: var(--f-deva); font-size: 14px;
    color: var(--copper-lt); letter-spacing: 0.02em;
    margin-bottom: 12px;
  }
  .graha-card-detail {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.2em; text-transform: uppercase;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .graha-card-text {
    font-family: var(--f-body); font-style: italic;
    font-size: 13.5px; line-height: 1.6;
    color: rgba(var(--paper-rgb), 0.78);
  }

  /* ============= KUNDLI SQUARE (North Indian, traditional) ============= */

  /* ============= NIRYAN SPASHT GRAHA TABLE ============= */
  /* Editorial table styling for the planetary positions reference.
     Used in step 02 (Reading) and step 03 (Save Kundli). */
  .nsg-wrap {
    background: rgba(15, 18, 38, 0.55);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    padding: 20px 24px 16px;
    margin: 16px 0;
  }
  .nsg-title {
    font-family: var(--f-display); font-style: italic;
    font-size: 19px; color: var(--gold);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--rule-soft);
    padding-bottom: 10px;
  }
  .nsg-title-sub {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim); font-style: normal;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-left: 8px;
  }
  .nsg-table {
    width: 100%; border-collapse: collapse;
    font-family: var(--f-mono); font-size: 13px;
    color: var(--paper);
    letter-spacing: 0.06em;
  }
  .nsg-table thead th {
    text-align: left;
    padding: 8px 10px;
    background: rgba(var(--gold-rgb), 0.08);
    border-bottom: 1px solid var(--gold);
    color: var(--gold);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .nsg-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(var(--paper-rgb), 0.06);
    vertical-align: middle;
  }
  .nsg-table tbody tr:hover {
    background: rgba(var(--gold-rgb), 0.04);
  }
  .nsg-row-lagna {
    background: rgba(var(--gold-rgb), 0.06);
  }
  .nsg-row-lagna td {
    border-bottom-color: rgba(var(--gold-rgb), 0.28) !important;
    border-bottom-width: 1px !important;
    color: var(--gold);
  }
  .nsg-rashi    { color: var(--paper); font-weight: 500; }
  .nsg-degree   { color: var(--paper-dim); font-size: 12px; margin-left: 4px; }
  .nsg-nak      { color: var(--paper); }
  .nsg-pada     { color: var(--gold); font-weight: 600; margin-left: 6px; }
  .nsg-avastha  { font-style: italic; color: var(--copper-lt); }
  .nsg-retro {
    color: var(--crimson-lt);
    font-family: var(--f-deva);
    font-size: 13px;
    margin-left: 4px;
    font-weight: 600;
  }
  .nsg-deva     {
    font-family: var(--f-deva); font-style: normal;
    font-size: 13px; letter-spacing: 0;
  }
  .nsg-footnote {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); font-style: italic;
    letter-spacing: 0.14em; margin-top: 10px;
    border-top: 1px solid var(--rule-soft);
    padding-top: 8px;
  }

  /* ============= NORTH INDIAN KUNDLI (new component) ============= */
  .nik-wrap {
    background: rgba(15, 18, 38, 0.55);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
    padding: 20px;
    margin: 16px 0;
    max-width: 640px;
  }
  .nik-title {
    font-family: var(--f-display); font-style: italic;
    font-size: 19px; color: var(--gold);
    margin-bottom: 12px;
    text-align: center;
  }
  .nik-svg {
    width: 100%; height: auto;
    display: block;
    background: rgba(var(--ink-rgb), 0.4);
  }
  .nik-svg text {
    user-select: none;
  }
  .nik-svg rect, .nik-svg line, .nik-svg polygon {
    stroke: var(--gold);
  }

  /* Lagna template overlay (Step 01: cosmos phase) */
  .lagna-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 6, 14, 0.85);
    backdrop-filter: blur(8px);
    z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
    animation: lagna-fade 0.3s ease-out;
  }
  @keyframes lagna-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .lagna-overlay-card {
    background: var(--ink-deep);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 32px;
    max-width: 920px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  }
  .lagna-overlay-close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px;
    background: rgba(var(--gold-rgb), 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--f-display); font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
  }
  .lagna-overlay-close:hover {
    background: var(--gold);
    color: var(--ink-deep);
  }
  /* Lagna button styled as a header dropdown button */
  .header-dd.header-dd-btn {
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .header-dd.header-dd-btn:hover {
    background: rgba(var(--gold-rgb), 0.2);
    border-color: var(--gold);
  }

  /* Reading-page template wrapper (NSG table + Kundli at top of Reading) */
  .reading-template {
    margin: 32px 0 48px;
    padding: 24px;
    background: rgba(15, 18, 38, 0.35);
    border: 1px solid var(--rule-soft);
    border-radius: 4px;
  }
  .reading-template-row {
    display: flex; justify-content: center;
    margin-top: 12px;
  }
  .reading-template-row .nik-wrap {
    margin: 0 auto;
    max-width: 540px;
  }

  /* Birth-coordinates strip displayed below the kundli (matches image footer) */
  .kundli-coords-strip {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim);
    letter-spacing: 0.14em;
    text-align: center;
    padding: 10px 14px;
    border-top: 1px solid var(--rule-soft);
    margin-top: 12px;
    background: rgba(15, 18, 38, 0.4);
  }

  .kundli-page {
    position: absolute; inset: 0;
    overflow-y: auto; z-index: 30;
    padding: 80px 80px 120px;
    background: var(--ink-deep);
  }
  .kundli-inner {
    max-width: 1100px; margin: 0 auto;
  }
  .kundli-header {
    text-align: center; margin-bottom: 48px;
  }
  .kundli-header-deva {
    font-family: var(--f-deva); font-size: 22px;
    color: var(--copper-lt); letter-spacing: 0.02em;
  }
  .kundli-header-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: 56px; color: var(--paper);
    font-variation-settings: 'opsz' 96, 'SOFT' 60, 'WONK' 1;
    letter-spacing: -0.02em; margin-top: 8px;
  }
  .kundli-header-title em { font-style: italic; color: var(--gold); }
  .kundli-grid {
    display: grid; grid-template-columns: 1fr 1.2fr;
    gap: 56px; align-items: start;
  }
  .kundli-side {
    border: 1px solid var(--rule); padding: 32px;
    background: rgba(var(--ink-rgb), 0.5);
  }
  .kundli-side-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 8px;
  }
  .kundli-side-title {
    font-family: var(--f-display); font-size: 28px;
    color: var(--paper); margin-bottom: 24px;
    font-variation-settings: 'opsz' 36, 'WONK' 1;
  }
  .stat-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .stat-row:last-child { border-bottom: none; }
  .stat-label {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim); letter-spacing: 0.28em; text-transform: uppercase;
  }
  .stat-value {
    font-family: var(--f-display); font-size: 16px;
    color: var(--paper);
    font-variation-settings: 'opsz' 36, 'WONK' 1;
  }
  .stat-value-sk {
    font-family: var(--f-deva); font-size: 13px;
    color: var(--copper-lt); margin-left: 10px;
  }
  /* Square North Indian chart */
  .nichart-wrap {
    aspect-ratio: 1 / 1; width: 100%;
    position: relative;
  }
  .nichart-svg { width: 100%; height: 100%; }

  /* Save controls */
  .save-controls {
    position: absolute; top: 100px; right: 60px;
    display: flex; flex-direction: column; gap: 12px;
    z-index: 60;
  }
  .save-btn {
    font-family: var(--f-mono); font-size: 13px;
    color: var(--gold); letter-spacing: 0.32em; text-transform: uppercase;
    background: rgba(var(--ink-rgb), 0.7); border: 1px solid var(--gold);
    padding: 14px 20px; cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
  }
  .save-btn:hover {
    background: var(--gold); color: var(--ink-deep);
  }
  .save-btn.secondary {
    color: var(--copper-lt); border-color: var(--copper-lt);
  }
  .save-btn.secondary:hover {
    background: var(--copper); color: var(--paper);
    border-color: var(--copper);
  }

  /* ============= Skip button (during cinematic intro) ============= */
  .skip-btn {
    position: absolute; top: 100px; right: 60px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim); letter-spacing: 0.32em; text-transform: uppercase;
    background: transparent; border: 1px solid var(--rule);
    padding: 12px 18px; cursor: pointer;
    transition: all 0.3s ease; z-index: 70;
  }
  .skip-btn:hover {
    color: var(--paper); border-color: var(--paper-dim);
  }

  /* ============= Intro caption ============= */
  .intro-caption {
    position: absolute; left: 60px; bottom: 140px;
    max-width: 480px; z-index: 50;
    pointer-events: none;
  }
  .intro-caption-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--gold); letter-spacing: 0.42em; text-transform: uppercase;
    margin-bottom: 14px;
  }
  .intro-caption-head {
    font-family: var(--f-display); font-weight: 330;
    font-size: 42px; line-height: 1.0;
    color: var(--paper); letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 96, 'SOFT' 50, 'WONK' 1;
    margin-bottom: 14px;
  }
  .intro-caption-head em { font-style: italic; color: var(--gold);
    font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1; }
  .intro-caption-body {
    font-family: var(--f-body); font-style: italic;
    font-size: 17px; line-height: 1.55;
    color: rgba(var(--paper-rgb), 0.78);
  }

  /* Generic animations */
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .fade-in { animation: fadeIn 0.8s ease both; }
  .fade-in-up { animation: fadeInUp 1.0s ease both; }

  /* Sound toggle and motion toggle (top-right secondary chrome) */
  .ctrl-row {
    position: absolute; top: 50px; right: 200px;
    display: flex; gap: 10px; z-index: 200;
  }
  .ctrl-chip {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.32em; text-transform: uppercase;
    padding: 6px 10px; background: transparent;
    border: 1px solid var(--rule); cursor: pointer;
    transition: all 0.3s ease;
  }
  .ctrl-chip:hover { color: var(--paper); border-color: var(--paper-dim); }
  .ctrl-chip.on { color: var(--gold); border-color: var(--gold); }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--rule); }
  ::-webkit-scrollbar-thumb:hover { background: var(--paper-dim); }

  /* ============= TIMELINE (contents only, panel handles positioning) ============= */
  .timeline-wrap {
    width: 100%;
  }

  /* ============= DASHA JOURNEY BAR (unified life-journey timeline) ============= */
  /* Replaces the basic slider with the full Vimshottari dasha journey, Saturn
     transit (Sade Sati) track, year markers, and player controls - all driving
     currentDays which in turn updates the cosmos visualization. */
  .djb {
    position: fixed;
    left: 16px; right: 16px;
    height: 168px;
    background: rgba(var(--ink-rgb), 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--copper-rgb), 0.22);
    border-radius: 6px;
    z-index: 190;
    padding: 10px 16px 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    display: flex; flex-direction: column;
    gap: 6px;
    user-select: none;
  }
  .djb.pos-top    { top: 56px; }
  .djb.pos-bottom { bottom: 14px; }

  /* Header row: title + player controls */
  .djb-head {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--paper-dim);
    height: 28px;
    flex-shrink: 0;
  }
  .djb-today-label {
    color: var(--paper);
    border-right: 1px solid rgba(var(--copper-rgb),0.28);
    padding-right: 12px;
    font-weight: 600;
  }
  .djb-title {
    color: var(--gold);
    letter-spacing: 0.32em;
    font-weight: 500;
  }
  .djb-deva {
    font-family: var(--f-deva); font-size: 14px;
    color: var(--copper-lt);
    letter-spacing: 0;
  }
  .djb-head-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 4px;
  }
  .djb-btn {
    width: 28px; height: 28px;
    background: transparent; border: none;
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 13px;
    border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.18s ease;
  }
  .djb-btn:hover { color: var(--gold); background: rgba(var(--gold-rgb),0.10); }
  .djb-btn.djb-btn-play {
    background: rgba(var(--gold-rgb),0.14);
    color: var(--gold);
    border: 1px solid rgba(var(--gold-rgb),0.4);
    width: 32px; height: 28px;
  }
  .djb-btn.djb-btn-play:hover {
    background: var(--gold);
    color: var(--ink-deep);
  }
  .djb-select {
    background: transparent;
    border: 1px solid rgba(var(--copper-rgb),0.22);
    color: var(--paper-dim);
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.14em;
    padding: 4px 8px;
    cursor: pointer;
    height: 26px;
    border-radius: 3px;
    text-transform: uppercase;
  }
  .djb-select:hover { color: var(--gold); border-color: var(--gold); }
  .djb-readout {
    display: inline-flex; align-items: baseline; gap: 8px;
    margin-left: 8px; padding-left: 12px;
    border-left: 1px solid rgba(var(--copper-rgb),0.18);
  }
  .djb-readout-age {
    font-family: var(--f-display); font-style: italic;
    font-size: 14px; color: var(--paper);
    letter-spacing: 0.06em;
  }
  .djb-readout-date {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.16em;
  }
  .djb-readout-time {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--gold); letter-spacing: 0.16em;
    /* tabular-nums keeps the HH:MM:SS columns aligned as digits tick */
    font-variant-numeric: tabular-nums;
    padding: 1px 6px;
    border: 1px solid rgba(var(--gold-rgb), 0.28);
    border-radius: 2px;
    margin-left: 2px;
  }
  .djb-close {
    background: transparent; border: none;
    color: var(--paper-dim); cursor: pointer;
    font-size: 18px; padding: 0 4px;
    margin-left: 6px;
  }
  .djb-close:hover { color: var(--gold); }

  /* Main dasha track */
  .djb-track {
    position: relative;
    height: 56px;
    background: rgba(0,0,0,0.32);
    border: 1px solid rgba(var(--copper-rgb),0.32);
    cursor: ew-resize;
    overflow: visible;
    flex-shrink: 0;
  }
  .djb-block {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(15, 18, 38, 0.55);
    border: none;
    border-left: 1px solid rgba(var(--copper-rgb),0.32);
    border-right: 1px solid rgba(var(--copper-rgb),0.32);
    color: var(--paper);
    cursor: pointer;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 1px;
    padding: 4px 2px;
    overflow: hidden;
    transition: background 0.2s ease;
    min-width: 0;
  }
  .djb-block:hover {
    background: rgba(var(--gold-rgb),0.08);
  }
  .djb-block.active {
    background: rgba(var(--gold-rgb),0.16);
    box-shadow: inset 0 0 24px rgba(var(--gold-rgb),0.22);
  }
  .djb-block-deva {
    font-family: var(--f-deva); font-style: normal;
    font-size: 17px;
    line-height: 1;
    white-space: nowrap;
  }
  .djb-block-en {
    font-family: var(--f-display); font-style: italic;
    font-size: 13px;
    color: var(--paper);
    line-height: 1.1;
    white-space: nowrap;
  }
  .djb-block-yrs {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim);
    letter-spacing: 0.08em;
    line-height: 1;
    white-space: nowrap;
  }
  /* TODAY cursor on the dasha track */
  .djb-cursor {
    position: absolute;
    top: -8px; bottom: -8px;
    width: 0;
    pointer-events: none;
    z-index: 5;
  }
  .djb-cursor-line {
    position: absolute; left: -1px;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
  }
  .djb-cursor-dot {
    position: absolute; left: -5px; top: -2px;
    width: 10px; height: 10px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold);
  }

  /* Year markers */
  .djb-years {
    position: relative;
    height: 14px;
    flex-shrink: 0;
  }
  .djb-year {
    position: absolute;
    transform: translateX(-50%);
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim);
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  /* Sade Sati header + track */
  .djb-sade-head {
    display: flex; align-items: baseline; gap: 8px;
    font-family: var(--f-mono); font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--paper-dim);
    text-transform: uppercase;
    margin-top: 4px;
    flex-shrink: 0;
  }
  .djb-sade-deva {
    font-family: var(--f-deva); font-style: normal;
    font-size: 14px;
    color: var(--copper-lt);
    letter-spacing: 0;
    text-transform: none;
  }
  .djb-sade-toggle {
    color: var(--gold);
    font-size: 12px;
    transition: transform 0.15s ease;
  }
  .djb-sade-count {
    margin-left: auto;
    color: var(--paper-dim);
    font-style: italic;
    font-family: var(--f-display);
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 12px;
  }
  .djb-sade-head:hover .djb-sade-toggle { color: var(--gold-bright); }
  .djb-sade-track {
    position: relative;
    height: 14px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(60, 80, 110, 0.32);
    flex-shrink: 0;
  }
  .djb-sade-block {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(120, 140, 180, 0.32);
    border-left: 1px solid rgba(140, 160, 200, 0.4);
    border-right: 1px solid rgba(140, 160, 200, 0.4);
    cursor: help;
    transition: background 0.2s ease;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  .djb-sade-block:hover {
    background: rgba(140, 160, 200, 0.48);
  }
  .djb-sade-block-label {
    font-family: var(--f-mono); font-size: 10.5px;
    color: rgba(220, 230, 245, 0.85);
    letter-spacing: 0.06em;
    white-space: nowrap;
    pointer-events: none;
  }
  .djb-sade-cursor {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 2px;
    margin-left: -1px;
    background: var(--gold);
    opacity: 0.7;
    pointer-events: none;
  }

  /* ============= SLICK PINNED TIMELINE BAR (media-player style) ============= */
  .tl-bar {
    position: fixed;
    left: 60px; right: 60px;
    height: 52px;
    background: rgba(var(--ink-rgb), 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--copper-rgb), 0.20);
    border-radius: 6px;
    z-index: 190;
    display: flex; align-items: center;
    gap: 14px;
    padding: 0 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  }
  .tl-bar.pos-top    { top: 56px; }     /* native strip is 44px, then 12px gap */
  .tl-bar.pos-bottom { bottom: 14px; }
  .tl-bar-transport {
    display: flex; align-items: center; gap: 2px;
    border-right: 1px solid rgba(var(--copper-rgb),0.18);
    padding-right: 12px;
  }
  .tl-icon-btn {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 12px;
    transition: all 0.18s ease;
    border-radius: 4px;
  }
  .tl-icon-btn:hover { color: var(--gold); background: rgba(var(--gold-rgb),0.08); }
  .tl-icon-btn.play {
    color: var(--gold);
    background: rgba(var(--gold-rgb),0.16);
    width: 34px; height: 34px; margin: 0 4px;
  }
  .tl-icon-btn.play:hover { background: rgba(var(--gold-rgb),0.28); }
  .tl-bar-selects { display: flex; gap: 8px; }
  .tl-bar-select {
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--paper);
    padding: 4px 8px;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.18em; text-transform: uppercase;
    cursor: pointer; outline: none;
    height: 26px;
    transition: all 0.2s ease;
  }
  .tl-bar-select:hover, .tl-bar-select:focus {
    border-color: var(--gold); color: var(--gold);
  }
  .tl-bar-select option {
    background: var(--ink-deep); color: var(--paper);
  }
  .tl-bar-slider-wrap {
    flex: 1;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 200px;
  }
  .tl-bar-slider {
    width: 100%;
    -webkit-appearance: none; appearance: none;
    background: transparent;
    height: 18px;
    cursor: pointer;
    outline: none;
  }
  .tl-bar-slider::-webkit-slider-runnable-track {
    height: 3px;
    background: linear-gradient(to right,
      var(--gold) 0%,
      var(--gold) var(--p, 0%),
      rgba(var(--copper-rgb),0.18) var(--p, 0%),
      rgba(var(--copper-rgb),0.18) 100%);
    border-radius: 2px;
  }
  .tl-bar-slider::-moz-range-track {
    height: 3px;
    background: rgba(var(--copper-rgb),0.18);
    border-radius: 2px;
  }
  .tl-bar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--ink-deep);
    box-shadow: 0 0 8px rgba(var(--gold-rgb),0.6);
    cursor: grab;
  }
  .tl-bar-slider::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--ink-deep);
  }
  .tl-bar-readout {
    display: flex; gap: 14px;
    border-left: 1px solid rgba(var(--copper-rgb),0.18);
    padding-left: 12px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper); letter-spacing: 0.16em;
    white-space: nowrap;
  }
  .tl-bar-readout-age {
    color: var(--gold);
    font-family: var(--f-display); font-style: italic; font-size: 14px;
    letter-spacing: 0.06em;
  }
  .tl-bar-readout-date { color: var(--paper-dim); }
  .tl-bar-close {
    background: transparent; border: none;
    color: var(--paper-dim); cursor: pointer;
    font-size: 16px; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s ease;
  }
  .tl-bar-close:hover { color: var(--gold); }

  /* Mini hanging widget (when timeline is hidden) */
  .tl-mini {
    position: fixed;
    bottom: 18px; right: 18px;
    height: 36px;
    background: rgba(var(--ink-rgb), 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--copper-rgb),0.32);
    border-radius: 22px;
    z-index: 190;
    display: flex; align-items: center;
    gap: 8px;
    padding: 0 6px 0 4px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
    transition: border-color 0.2s ease;
  }
  .tl-mini:hover { border-color: var(--gold); }
  .tl-mini-play {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gold); color: var(--ink-deep);
    border: none; cursor: pointer;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease;
  }
  .tl-mini-play:hover { transform: scale(1.08); }
  .tl-mini-speed {
    background: transparent; border: none;
    color: var(--paper);
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.18em; text-transform: uppercase;
    cursor: pointer; outline: none;
    padding: 0 4px;
  }
  .tl-mini-speed option { background: var(--ink-deep); color: var(--paper); }
  .tl-mini-expand {
    background: transparent; border: none;
    color: var(--paper-dim); cursor: pointer;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.22em; text-transform: uppercase;
    padding: 0 8px 0 4px;
    border-left: 1px solid rgba(var(--copper-rgb),0.22);
    height: 22px;
    transition: color 0.2s ease;
  }
  .tl-mini-expand:hover { color: var(--gold); }
  .tl-mini-age {
    font-family: var(--f-display); font-style: italic; font-size: 14px;
    color: var(--gold);
    padding: 0 6px;
  }

  .timeline-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.28em; text-transform: uppercase;
    flex-wrap: wrap;
  }
  .timeline-head-age {
    font-family: var(--f-display); font-style: italic;
    font-size: 20px; color: var(--gold);
    letter-spacing: -0.01em; text-transform: none;
    font-variation-settings: '"opsz" 36, "WONK" 1';
  }
  .timeline-head-date {
    color: var(--paper); font-family: var(--f-body);
    font-style: italic; font-size: 13px;
    letter-spacing: 0; text-transform: none;
  }
  .timeline-head-time {
    color: var(--paper-dim); font-family: var(--f-mono);
    font-size: 12px; letter-spacing: 0.18em;
  }
  .timeline-controls {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 8px; flex-wrap: wrap;
  }
  .tl-btn {
    background: transparent; border: 1px solid var(--rule);
    color: var(--paper-dim); padding: 5px 8px;
    cursor: pointer; font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.14em;
    transition: all 0.25s ease;
    min-width: 28px;
  }
  .tl-btn:hover {
    color: var(--paper); border-color: var(--paper-dim);
    background: rgba(var(--paper-rgb), 0.05);
  }
  .tl-btn.play {
    color: var(--gold); border-color: var(--gold);
    padding: 5px 12px;
  }
  .tl-btn.play:hover {
    background: var(--gold); color: var(--ink-deep);
  }
  .tl-selects {
    display: flex; gap: 8px; margin-bottom: 10px;
    align-items: center; flex-wrap: wrap;
  }
  .tl-select-group { display: flex; flex-direction: column; gap: 2px; }
  .tl-select-label {
    font-family: var(--f-mono); font-size: 9px;
    color: var(--paper-dim); letter-spacing: 0.32em; text-transform: uppercase;
  }
  .tl-select {
    background: rgba(var(--ink-rgb), 0.6);
    border: 1px solid var(--rule);
    color: var(--paper); padding: 4px 7px;
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.14em;
    cursor: pointer; outline: none;
    transition: all 0.2s ease;
  }
  .tl-select:hover, .tl-select:focus { border-color: var(--gold); color: var(--gold); }
  .tl-slider-wrap {
    position: relative;
    padding: 8px 0 2px 0;
  }
  .tl-slider {
    width: 100%; height: 2px;
    -webkit-appearance: none; appearance: none;
    background: var(--rule);
    outline: none; cursor: pointer;
  }
  .tl-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.6);
    cursor: pointer;
  }
  .tl-slider::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--gold); border: none;
    box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.6);
    cursor: pointer;
  }
  .tl-ticks {
    position: relative; height: 18px; margin-top: 6px;
  }
  .tl-tick {
    position: absolute; top: 0; transform: translateX(-50%);
    font-family: var(--f-mono); font-size: 10px;
    color: var(--paper-dim); letter-spacing: 0.14em;
  }
  .tl-tick.major { color: var(--copper-lt); }
  .tl-tick.now {
    color: var(--gold);
    font-weight: 500;
  }
  .tl-tick.now::before {
    content: ''; position: absolute; top: -10px; left: 50%;
    width: 1px; height: 6px; background: var(--gold);
    transform: translateX(-50%);
  }

  /* ============= MINI KUNDLI (contents only, panel handles positioning) ============= */
  .mini-kundli {
    width: 100%;
    display: flex; flex-direction: column;
    gap: 8px;
  }
  .mini-kundli-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
  }
  .mini-kundli-select {
    flex: 1;
    background: rgba(15, 18, 38, 0.7);
    border: 1px solid rgba(var(--gold-rgb), 0.3);
    color: var(--paper);
    font-family: var(--f-display); font-style: italic;
    font-size: 14px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 0.04em;
    transition: border-color 0.18s ease;
  }
  .mini-kundli-select:hover { border-color: var(--gold); }
  .mini-kundli-select:focus { outline: none; border-color: var(--gold); }
  .mini-kundli-svg-wrap {
    aspect-ratio: 1 / 1; width: 100%;
    position: relative;
  }
  /* HTML overlay grid for planet labels positioned at house centroids.
     Sits on top of the SVG (which only renders frame + house labels + rashis). */
  .mini-kundli-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
  }
  .mk-house-planets {
    position: absolute;
    transform: translate(-50%, 0);   /* anchor at horizontal centre, top below H-num + rashi */
    /* Center cluster vertically below the rashi glyph by nudging up */
    margin-top: 4px;
    display: flex; flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
    width: 22%;
    pointer-events: auto;
    line-height: 1;
  }
  .mk-planet {
    font-family: var(--f-deva);
    font-size: 13px;
    line-height: 1.05;
    white-space: nowrap;
    cursor: help;
    transition: opacity 0.15s ease;
  }
  .mk-planet:hover { opacity: 0.7; }
  .mk-planet-r {
    font-family: var(--f-mono); font-size: 9px;
    color: var(--crimson-lt);
    margin-left: 1px;
    font-weight: 600;
    vertical-align: super;
    letter-spacing: 0;
  }
  .mk-planet-dot {
    color: var(--gold); font-size: 12px;
    margin-left: 1px; vertical-align: top;
  }
  /* When English short labels (Sun/Moon/Mer/Ven) are used, give them mono font */
  .mini-kundli .mk-planet:not(:lang(hi)) {
    /* Cannot easily detect lang here; fallback: rely on showDeva to swap */
  }
  .mini-kundli-foot {
    margin-top: 10px;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.18em; text-transform: uppercase;
    display: flex; justify-content: space-between;
    align-items: baseline;
  }
  .mini-kundli-foot-deva {
    font-family: var(--f-deva); font-size: 13px;
    letter-spacing: 0.02em; text-transform: none;
    color: var(--copper-lt);
  }

  /* ============= DASHA PANEL ============= */
  .dasha-panel { width: 100%; }
  .dasha-section { margin-bottom: 16px; }
  .dasha-section:last-child { margin-bottom: 0; }
  .dasha-section-label {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 8px;
    display: flex; justify-content: space-between;
  }
  .dasha-section-deva {
    font-family: var(--f-deva); font-size: 13px;
    color: var(--gold); letter-spacing: 0.02em; text-transform: none;
  }
  .dasha-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; margin: 2px 0;
    background: rgba(var(--paper-rgb), 0.02);
    border-left: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: default;
  }
  .dasha-row.past { opacity: 0.45; }
  .dasha-row.current {
    background: rgba(var(--gold-rgb), 0.10);
    border-left-color: var(--gold);
  }
  .dasha-row.future { opacity: 0.7; }
  .dasha-row-glyph {
    font-family: var(--f-display); font-size: 18px;
    width: 22px; text-align: center;
  }
  .dasha-row-body { flex: 1; min-width: 0; }
  .dasha-row-name {
    font-family: var(--f-body); font-size: 13px;
    color: var(--paper); line-height: 1.2;
  }
  .dasha-row-deva {
    font-family: var(--f-deva); font-size: 14px;
    color: var(--copper-lt); margin-left: 4px;
  }
  .dasha-row-meta {
    font-family: var(--f-mono); font-size: 11.5px;
    color: var(--paper); letter-spacing: 0.10em;
    margin-top: 4px;
  }
  .dasha-row-meta-sub {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.12em;
    margin-top: 2px;
  }
  .dasha-row-arrow {
    color: var(--copper-lt);
    margin: 0 4px;
    font-weight: 400;
  }
  .dasha-row-elapsed {
    color: var(--gold);
    font-style: italic;
  }
  .dasha-row-progress {
    width: 100%; height: 2px; margin-top: 5px;
    background: var(--rule); position: relative;
  }
  .dasha-row-progress-fill {
    height: 100%; background: var(--gold);
  }
  .nak-card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px; background: rgba(var(--gold-rgb), 0.06);
    border-left: 2px solid var(--gold);
  }
  .nak-card-deva {
    font-family: var(--f-deva); font-size: 18px;
    color: var(--gold); line-height: 1.1;
    max-width: 100px;
    flex-shrink: 0;
  }
  .nak-card-name {
    font-family: var(--f-body); font-size: 14px;
    color: var(--paper); font-style: italic;
  }
  .nak-card-meta {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.18em;
    margin-top: 4px;
  }
  .nak-card-pada {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.18em;
    margin-top: 6px;
  }

  /* ============= NATIVE TOP STRIP (single line, full width, thin) ============= */
  .native-strip {
    position: fixed; top: 0; left: 0; right: 0;
    height: 44px;
    background: rgba(var(--ink-rgb), 0.78);
    border-bottom: 1px solid rgba(var(--copper-rgb), 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    display: flex; align-items: center;
    /* 104px right padding keeps strip content clear of the fixed theme +
       settings buttons */
    padding: 0 104px 0 56px;
    gap: 20px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--paper-dim); letter-spacing: 0.22em; text-transform: uppercase;
    overflow: hidden;
  }
  .native-strip-item {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
  }
  .native-strip-label {
    color: rgba(var(--paper-rgb), 0.42);
    font-size: 11px;
  }
  .native-strip-value {
    color: var(--paper);
    font-family: var(--f-body); font-style: italic; font-size: 14px;
    letter-spacing: 0; text-transform: none;
  }
  .native-strip-deva {
    color: var(--copper-lt);
    font-family: var(--f-deva); font-style: normal; font-size: 13px;
    letter-spacing: 0; text-transform: none;
  }
  .native-strip-coords {
    color: var(--gold);
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.14em;
    padding: 2px 6px;
    border: 1px solid rgba(var(--gold-rgb), 0.28);
    border-radius: 3px;
    margin-left: 4px;
  }
  .native-strip-sep {
    width: 1px; height: 22px; background: rgba(var(--copper-rgb), 0.18);
    margin: 0 4px;
  }
  .native-strip-spacer-top { height: 44px; pointer-events: none; }

  /* Header dropdowns (View + Chapter) */
  .header-dd {
    background: rgba(var(--ink-rgb), 0.6);
    border: 1px solid var(--rule);
    color: var(--paper);
    padding: 4px 8px;
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.18em; text-transform: uppercase;
    cursor: pointer; outline: none;
    transition: all 0.2s ease;
    height: 28px;
  }
  .header-dd:hover, .header-dd:focus {
    border-color: var(--gold); color: var(--gold);
  }
  .header-dd option {
    background: var(--ink-deep);
    color: var(--paper);
    font-family: var(--f-mono); font-size: 13px;
  }
  .native-strip-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 10px;
    /* Never spill under the fixed theme/settings buttons */
    flex-shrink: 1; min-width: 0; overflow: hidden;
  }

  /* ============= INTRO SUBTITLE (tiny top-left during cinematic) ============= */
  .intro-subtitle {
    position: fixed; top: 56px; left: 28px; z-index: 60;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.42em; text-transform: uppercase;
    pointer-events: none; opacity: 0.7;
  }

  /* ============= CHAPTER DROPDOWN ============= */
  .chapter-dd {
    width: 100%;
    background: rgba(var(--ink-rgb), 0.6);
    border: 1px solid var(--rule);
    color: var(--paper);
    padding: 8px 12px;
    font-family: var(--f-mono); font-size: 13px;
    letter-spacing: 0.22em; text-transform: uppercase;
    cursor: pointer; outline: none;
    transition: all 0.2s ease;
  }
  .chapter-dd:hover, .chapter-dd:focus {
    border-color: var(--gold); color: var(--gold);
  }
  .chapter-dd option {
    background: var(--ink-deep);
    color: var(--paper);
    font-family: var(--f-mono); font-size: 13px;
    padding: 6px;
  }

  /* ============= DASHA NESTED COLLAPSIBLES ============= */
  .dasha-section-head {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; user-select: none;
    padding: 3px 0;
    transition: color 0.2s ease;
  }
  .dasha-section-head:hover { color: var(--gold); }
  .dasha-section-head-icon {
    width: 12px; text-align: center;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt);
    transition: transform 0.25s ease;
  }
  .dasha-section-head.open .dasha-section-head-icon { transform: rotate(0deg); }
  .dasha-section-head.closed .dasha-section-head-icon { transform: rotate(-90deg); }
  .dasha-section-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .dasha-section-body.open { max-height: 1200px; }
  .dasha-section-body.closed { max-height: 0; }
  .viewmode-toggle {
    display: flex; gap: 2px;
    background: rgba(var(--ink-rgb), 0.75);
    border: 1px solid var(--rule);
    backdrop-filter: blur(8px);
    padding: 3px;
  }
  .viewmode-toggle.in-panel {
    background: transparent; border: none;
    backdrop-filter: none; padding: 0;
    justify-content: space-between; width: 100%;
  }
  .vm-btn {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.24em; text-transform: uppercase;
    padding: 7px 12px; background: transparent; border: none;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    flex: 1;
  }
  .vm-btn-sub {
    font-family: var(--f-deva); font-size: 13px;
    color: var(--copper-lt); letter-spacing: 0.02em; text-transform: none;
    opacity: 0.7;
  }
  .vm-btn:hover {
    color: var(--paper);
    background: rgba(var(--paper-rgb), 0.04);
  }
  .vm-btn.active {
    color: var(--gold);
    background: rgba(var(--gold-rgb), 0.12);
  }
  .vm-btn.active .vm-btn-sub { color: var(--gold); opacity: 1; }

  /* ============= COSMOS CONTAINER PANEL (transparent, thin chrome) ============= */
  .fp.fp-cosmos {
    background: rgba(var(--ink-rgb), 0.12);
    border: 1px solid var(--rule);
    box-shadow: none;
    z-index: 30;
  }
  .fp.fp-cosmos.intro-mode {
    border-color: transparent;
    /* During the cinematic intro, blow the cosmos panel up to fill the entire
       viewport so the rewinding-universe sequence has room to breathe. */
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    transform: none !important;
    background: #05060e !important;
    box-shadow: none !important;
    z-index: 60 !important;
  }
  .fp.fp-cosmos.intro-mode .fp-head {
    opacity: 0;
    pointer-events: none;
    background: transparent;
    border-bottom: none;
    height: 0;
  }
  .fp.fp-cosmos.intro-mode .fp-body {
    max-height: 100% !important;
    height: 100% !important;
    padding: 0 !important;
  }
  .fp.fp-cosmos.intro-mode .fp-resize { display: none; }

  /* Reading + Kundli are PAGES, not panels. When the cosmos panel hosts
     them it expands to the full viewport below the native strip — no drag,
     no resize, no cramped square. The chapter bar stays for navigation. */
  .fp.fp-cosmos.page-mode {
    position: fixed !important;
    left: 0 !important; top: 44px !important;
    width: 100vw !important;
    height: calc(100vh - 44px) !important;
    transform: none !important;
    border-color: transparent;
    background: rgba(var(--ink-rgb), 0.92);
    z-index: 45 !important;
    cursor: default;
  }
  .fp.fp-cosmos.page-mode .fp-head { display: none; }
  .fp.fp-cosmos.page-mode .fp-body,
  .fp.fp-cosmos.page-mode > .stage {
    max-height: 100% !important;
    height: 100% !important;
  }
  .fp.fp-cosmos.page-mode .fp-resize { display: none; }
  /* Leave room at the bottom so prose never hides behind the chapter bar */
  .fp.fp-cosmos.page-mode .cosmos-content-wrap { padding-bottom: 96px; }
  .fp.fp-cosmos:hover { box-shadow: 0 0 30px rgba(var(--copper-rgb), 0.08); }
  .fp.fp-cosmos .fp-head {
    background: transparent;
    border-bottom: 1px solid rgba(var(--copper-rgb), 0.18);
  }
  .fp.fp-cosmos .fp-body {
    padding: 0; overflow: hidden;
    position: relative;
    width: 100%; height: 100%;
  }
  .fp.fp-cosmos .fp-resize {
    background: linear-gradient(135deg, transparent 60%, var(--gold) 60%, var(--gold) 70%,
      transparent 70%, transparent 80%, var(--gold) 80%, var(--gold) 90%, transparent 90%);
    opacity: 0.8; width: 16px; height: 16px;
  }
  .cosmos-svg {
    width: 100%; height: 100%; display: block;
  }

  /* Repositioned chrome for frameless layout */
  .ctrl-row { top: 72px !important; right: 80px !important; }
  .phase-indicator {
    position: fixed !important; top: 120px !important; right: 28px !important;
    text-align: right; z-index: 60;
    pointer-events: none;
  }

  /* ============= EARTH POV (planetarium strip) ============= */
  .pov-meta {
    position: absolute; left: 60px; top: 200px;
    z-index: 50; pointer-events: none;
    max-width: 380px;
  }
  .pov-meta-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--gold); letter-spacing: 0.42em; text-transform: uppercase;
    margin-bottom: 12px;
  }
  .pov-meta-head {
    font-family: var(--f-display); font-style: italic;
    font-size: 32px; line-height: 1.0;
    color: var(--paper); letter-spacing: -0.02em;
    font-variation-settings: '"opsz" 96, "SOFT" 80, "WONK" 1';
    margin-bottom: 12px;
  }
  .pov-meta-body {
    font-family: var(--f-body); font-style: italic;
    font-size: 14px; line-height: 1.55;
    color: rgba(var(--paper-rgb), 0.7);
  }
  .pov-meta-coord {
    margin-top: 18px;
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.18em;
  }

  /* ============= PRINT STYLES ============= */
  @media print {
    body { background: white; color: #1a1a1a; overflow: visible; }
    .frame-border, .corner-mark, .brand-mark, .save-controls,
    .chapter-bar, .ctrl-row, .skip-btn, .bg-layer,
    .timeline-wrap, .mini-kundli, .viewmode-toggle, .pov-meta,
    .fp, .settings-fab, .settings-popup { display: none !important; }
    .kundli-page { position: static; padding: 24px; background: white; }
    .kundli-side { background: #fafafa; border-color: #ddd; }
    .kundli-side-eyebrow, .kundli-side-title, .stat-label, .stat-value,
    .kundli-header-deva, .kundli-header-title, .reading-eyebrow,
    .reading-title, .reading-intro, .reading-section-title,
    .reading-section-num, .reading-section-deva, .reading-body,
    .graha-card-name, .graha-card-deva, .graha-card-detail, .graha-card-text,
    .graha-card-house, .stat-value-sk {
      color: #1a1a1a !important;
    }
    .stat-label, .reading-section-num, .graha-card-house, .kundli-side-eyebrow,
    .reading-eyebrow, .reading-section-deva, .graha-card-deva, .stat-value-sk,
    .kundli-header-deva {
      color: #8a4519 !important;
    }
    .kundli-header-title em, .reading-title em, .reading-body em {
      color: #b4612a !important;
    }
    .reading { position: static; background: white; padding: 24px; color: #1a1a1a; }
    .reading-section { border-color: #ddd; }
    .graha-card { background: #fafafa; border-color: #ddd; }
    .graha-card-detail { border-color: #eee; }
    .stat-row { border-color: #eee; }
    .kundli-page, .reading { page-break-after: always; }
  }

  /* =====================================================================
     Cinematic planet viewport — fullscreen modal shown when a graha is
     clicked. Houses the textured sphere at hero scale plus a "UHD CAMERA
     VIEWPORT" control with four camera modes.
     ===================================================================== */
  .cv-backdrop {
    position: fixed; inset: 0; z-index: 400;
    /* The whole backdrop now sits over a starry universe layer (cv-universe)
       so the Milky Way is visible THROUGH every translucent panel. The
       former dark fill is replaced by a soft warm vignette only. */
    background:
      radial-gradient(ellipse 70% 50% at 50% 40%, rgba(var(--copper-rgb),0.10), transparent 70%),
      rgba(5, 6, 14, 0.18);
    animation: cvFade 0.45s ease both;
    display: grid;
    grid-template-columns: 360px 1fr 320px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "head head head"
      "lore stage hud"
      "foot foot foot";
    gap: 24px;
    padding: 32px 40px;
  }
  /* Full-bleed Milky Way panorama, ken-burns slow zoom + drift so the
     universe feels alive while you observe a single body. */
  .cv-universe {
    position: absolute; inset: -8%;
    background: #05060e;
    background-size: cover;
    background-position: center;
    z-index: -1;
    animation: cvBgDrift 60s ease-in-out infinite alternate;
  }
  .cv-universe::after {
    content: "";
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 50% 50%, transparent 30%, rgba(5,6,14,0.55) 100%),
      radial-gradient(ellipse 60% 40% at 50% 50%, rgba(var(--copper-rgb),0.06), transparent 70%);
    pointer-events: none;
  }
  @keyframes cvBgDrift {
    0%   { transform: scale(1.04) translate(-1.5%,  1%); }
    100% { transform: scale(1.10) translate( 1.5%, -1%); }
  }
  @keyframes cvFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes cvRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes cvScale { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

  .cv-head {
    grid-area: head;
    display: flex; align-items: flex-start; justify-content: space-between;
    animation: cvRise 0.6s 0.05s ease both;
  }
  .cv-head-l {
    display: flex; flex-direction: column; gap: 6px;
  }
  .cv-eyebrow {
    font-family: var(--f-mono); font-size: 13px;
    color: var(--copper-lt); letter-spacing: 0.42em; text-transform: uppercase;
    display: flex; align-items: center; gap: 12px;
  }
  .cv-eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: cvPulse 1.8s ease-in-out infinite; }
  @keyframes cvPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
  .cv-name {
    font-family: var(--f-display); font-weight: 320;
    font-size: 72px; line-height: 0.94; color: var(--paper);
    letter-spacing: -0.025em;
    font-variation-settings: 'opsz' 96, 'SOFT' 50, 'WONK' 1;
  }
  .cv-deva {
    font-family: var(--f-deva); font-size: 32px;
    color: var(--copper-lt); margin-top: 4px;
  }
  .cv-close {
    background: rgba(var(--ink-rgb), 0.7); border: 1px solid var(--rule);
    color: var(--copper-lt); cursor: pointer;
    width: 52px; height: 52px; border-radius: 50%;
    font-family: var(--f-mono); font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
  }
  .cv-close:hover { border-color: var(--gold); color: var(--gold); background: rgba(var(--copper-rgb),0.12); }

  .cv-stage {
    grid-area: stage;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    perspective: 1400px;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 4px;
    /* No fill — the stage itself stays transparent so the universe layer
       behind the modal is visible through it, framed by the corner brackets. */
    background:
      radial-gradient(ellipse 60% 40% at 50% 50%, rgba(var(--copper-rgb),0.04), transparent 70%);
    animation: cvScale 0.7s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .cv-stage-frame {
    position: absolute; inset: 16px;
    border: 1px solid rgba(var(--gold-rgb), 0.15);
    pointer-events: none;
  }
  .cv-stage-corner {
    position: absolute; width: 28px; height: 28px;
    border: 1px solid var(--gold);
    pointer-events: none;
  }
  .cv-stage-corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
  .cv-stage-corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
  .cv-stage-corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
  .cv-stage-corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
  .cv-stage-readout {
    position: absolute; left: 28px; bottom: 28px;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    line-height: 1.8;
    pointer-events: none;
  }
  .cv-stage-readout .val {
    color: var(--paper); margin-left: 8px; font-family: var(--f-body); font-style: italic;
    letter-spacing: 0; text-transform: none;
  }
  .cv-stage-rec {
    position: absolute; right: 28px; bottom: 28px;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--crimson-lt); letter-spacing: 0.32em; text-transform: uppercase;
    display: flex; align-items: center; gap: 10px;
    pointer-events: none;
  }
  .cv-stage-rec-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--crimson-lt);
    box-shadow: 0 0 14px var(--crimson-lt);
    animation: cvPulse 1.4s ease-in-out infinite;
  }
  .cv-tilt-wrap {
    transform-style: preserve-3d;
    transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
  }
  .cv-drift-wrap {
    animation: cvDrift 14s linear infinite;
  }
  @keyframes cvDrift {
    0%   { transform: translateX(-12%) scale(0.96); }
    50%  { transform: translateX(12%) scale(1.04); }
    100% { transform: translateX(-12%) scale(0.96); }
  }

  /* Left lore column */
  .cv-lore {
    grid-area: lore;
    display: flex; flex-direction: column; gap: 18px;
    animation: cvRise 0.7s 0.18s ease both;
    align-self: start;
  }
  .cv-card {
    /* Half-transparent + backdrop-blur so the Milky Way bleeds through, the
       way the reference image asked for. */
    background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.55), rgba(var(--ink-rgb), 0.42));
    border: 1px solid var(--rule);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 22px 22px 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  }
  .cv-card-title {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.42em; text-transform: uppercase;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .cv-role {
    font-family: var(--f-display); font-style: italic;
    font-size: 22px; line-height: 1.25; color: var(--gold);
    margin-bottom: 10px;
  }
  .cv-note {
    font-family: var(--f-body); font-style: italic;
    font-size: 16px; line-height: 1.6;
    color: rgba(var(--paper-rgb), 0.82);
  }
  .cv-stats { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
  .cv-stat-label {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.22em; text-transform: uppercase;
  }
  .cv-stat-value {
    font-family: var(--f-display); font-size: 17px;
    color: var(--paper); text-align: right;
    font-variation-settings: 'opsz' 36;
  }

  /* Right HUD column */
  .cv-hud {
    grid-area: hud;
    display: flex; flex-direction: column; gap: 18px;
    animation: cvRise 0.7s 0.24s ease both;
    align-self: start;
  }

  /* The UHD CAMERA VIEWPORT panel */
  .cv-cam {
    background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.58), rgba(var(--ink-rgb), 0.42));
    border: 1px solid rgba(var(--gold-rgb), 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  }
  .cv-cam-head {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--f-mono); font-size: 13px;
    color: var(--gold); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 16px;
  }
  .cv-cam-icon {
    width: 18px; height: 14px; flex-shrink: 0;
    color: var(--gold);
  }
  .cv-cam-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  }
  .cv-cam-btn {
    font-family: var(--f-mono); font-size: 13px;
    letter-spacing: 0.22em; text-transform: uppercase;
    padding: 14px 8px; border-radius: 6px;
    background: rgba(var(--ink-rgb), 0.5);
    border: 1px solid rgba(var(--gold-rgb), 0.32);
    color: var(--copper-lt);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
  }
  .cv-cam-btn:hover { border-color: var(--gold); color: var(--gold); }
  .cv-cam-btn.active {
    background: var(--gold);
    color: var(--ink-deep);
    border-color: var(--gold);
    box-shadow: 0 0 24px rgba(var(--gold-rgb), 0.45);
    font-weight: 600;
  }
  .cv-cam-meta {
    margin-top: 14px;
    font-family: var(--f-body); font-style: italic;
    font-size: 14px; line-height: 1.55;
    color: var(--paper-dim);
  }
  .cv-cta {
    margin-top: 6px;
    background: transparent; border: 1px solid var(--gold);
    color: var(--gold); cursor: pointer;
    font-family: var(--f-mono); font-size: 13px;
    letter-spacing: 0.32em; text-transform: uppercase;
    padding: 16px;
    transition: all 0.25s ease;
  }
  .cv-cta:hover {
    background: var(--gold); color: var(--ink-deep);
  }

  .cv-foot {
    grid-area: foot;
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.32em; text-transform: uppercase;
    animation: cvRise 0.7s 0.3s ease both;
  }
  .cv-foot a { color: var(--copper-lt); text-decoration: none; border-bottom: 1px dotted rgba(var(--copper-rgb),0.4); }
  .cv-foot a:hover { color: var(--gold); border-bottom-color: var(--gold); }

  /* =====================================================================
     3D cosmos HUD — keystroke hints overlay shown when viewMode==='3d'
     ===================================================================== */
  .cosmos3d-mount canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
  }
  .cosmos3d-hud {
    position: absolute; left: 14px; bottom: 14px;
    display: flex; flex-direction: column; gap: 4px;
    pointer-events: none;
    font-family: var(--f-mono); font-size: 11px;
    color: var(--paper-dim); letter-spacing: 0.22em; text-transform: uppercase;
    background: rgba(var(--ink-rgb), 0.55);
    border: 1px solid var(--rule-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 12px;
    z-index: 5;
  }
  .cosmos3d-hud-row { display: flex; gap: 10px; align-items: center; }
  .cosmos3d-hud-key {
    font-weight: 600; color: var(--gold);
    min-width: 48px;
  }

  /* =====================================================================
     IntroFlightSceneMount — full-bleed Three.js POV flight portal
     ===================================================================== */
  .intro-flight-mount {
    position: fixed; inset: 0;
    z-index: 80;
    background: #000;
    overflow: hidden;
    animation: ifMountIn 0.5s ease both;
  }
  @keyframes ifMountIn { from { opacity: 0; } to { opacity: 1; } }
  .intro-flight-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }
  .intro-flight-canvas canvas {
    display: block; width: 100% !important; height: 100% !important;
  }
  /* Subtle 'spacecraft viewport' frame around the edges */
  .intro-flight-frame {
    position: absolute; inset: 24px;
    border: 1px solid rgba(var(--gold-rgb), 0.18);
    pointer-events: none;
  }
  .intro-flight-corner {
    position: absolute; width: 26px; height: 26px;
    border: 1px solid var(--gold);
  }
  .intro-flight-corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
  .intro-flight-corner.tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
  .intro-flight-corner.bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
  .intro-flight-corner.br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }

  /* Top-left flight HUD */
  .intro-flight-hud {
    position: absolute; top: 56px; left: 56px;
    display: flex; flex-direction: column; gap: 6px;
    font-family: var(--f-mono); font-size: 13px;
    letter-spacing: 0.32em; text-transform: uppercase;
    background: rgba(var(--ink-rgb), 0.45);
    border: 1px solid rgba(var(--gold-rgb), 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 18px;
    transition: opacity 0.4s ease;
    pointer-events: none;
  }
  .intro-flight-hud-row { display: flex; gap: 16px; align-items: baseline; }
  .intro-flight-hud-key {
    color: var(--gold); font-weight: 600; min-width: 60px;
  }
  .intro-flight-hud-val { color: var(--paper); font-style: italic; letter-spacing: 0.18em; }

  /* Bottom-center landing card */
  .intro-flight-card {
    position: absolute; left: 50%; bottom: 9%;
    transform: translateX(-50%);
    text-align: center;
    transition: opacity 0.6s ease;
    pointer-events: none;
    text-shadow: 0 4px 30px rgba(0,0,0,0.8);
  }
  .intro-flight-eyebrow {
    font-family: var(--f-mono); font-size: 13px;
    color: var(--gold); letter-spacing: 0.42em; text-transform: uppercase;
    margin-bottom: 14px;
  }
  .intro-flight-place {
    font-family: var(--f-display); font-style: italic;
    font-size: 92px; line-height: 1.0; color: var(--paper);
    font-variation-settings: 'opsz' 144, 'SOFT' 80, 'WONK' 1;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
  }
  .intro-flight-coords {
    font-family: var(--f-mono); font-size: 16px;
    color: rgba(var(--paper-rgb),0.78); letter-spacing: 0.32em;
  }

  @media (max-width: 1280px) {
    .cv-backdrop {
      grid-template-columns: 1fr;
      grid-template-areas: "head" "stage" "lore" "hud" "foot";
      padding: 20px;
    }
    .cv-stage { min-height: 60vh; }
  }
  /* ============= THEME TOGGLE (always available) ============= */
  .theme-fab {
    position: fixed; top: 4px; right: 56px; z-index: 230;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(var(--ink-rgb), 0.55); border: 1px solid var(--rule);
    border-radius: 50%; color: var(--paper-dim); cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(8px);
  }
  .theme-fab:hover { color: var(--gold); border-color: var(--gold); transform: rotate(15deg); }
  .theme-fab.solo { right: 12px; }

  /* ============= PLACE OF BIRTH: actions, suggestions, map ============= */
  .pob-suggest-wrap { position: relative; }
  .pob-actions { display: flex; gap: 8px; margin-top: 10px; }
  .pob-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    padding: 11px 12px; min-height: 40px;
    background: rgba(var(--gold-rgb), 0.06);
    border: 1px solid var(--rule); color: var(--paper-dim);
    cursor: pointer; transition: all 0.25s ease;
  }
  .pob-btn:hover { border-color: var(--gold); color: var(--gold); }
  .pob-btn:disabled { opacity: 0.5; cursor: wait; }
  .pob-suggest {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    background: rgba(var(--ink-rgb), 0.97);
    border: 1px solid var(--rule);
    backdrop-filter: blur(10px);
    max-height: 226px; overflow-y: auto;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  }
  .pob-suggest-item {
    display: flex; flex-direction: column; gap: 2px;
    width: 100%; text-align: left; padding: 10px 14px;
    background: none; border: none; border-bottom: 1px solid var(--rule-soft);
    color: var(--paper); font-family: var(--f-body); font-size: 15px;
    cursor: pointer; transition: background 0.15s ease;
  }
  .pob-suggest-item:last-child { border-bottom: none; }
  .pob-suggest-item:hover, .pob-suggest-item.active {
    background: rgba(var(--gold-rgb), 0.10); color: var(--gold);
  }
  .pob-suggest-sub {
    font-family: var(--f-mono); font-size: 10px;
    color: var(--paper-dim); letter-spacing: 0.06em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .map-modal {
    position: fixed; inset: 0; z-index: 400;
    display: flex; align-items: center; justify-content: center;
    background: rgba(4, 5, 12, 0.55); backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease both;
  }
  .map-card {
    width: min(760px, calc(100vw - 40px));
    background: var(--ink-deep);
    border: 1px solid var(--rule);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column;
  }
  .map-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--rule);
  }
  .map-title {
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold);
  }
  .map-close {
    background: none; border: none; color: var(--paper-dim);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px;
  }
  .map-close:hover { color: var(--paper); }
  .map-search {
    position: relative;
    padding: 10px 18px;
    border-bottom: 1px solid var(--rule);
    display: flex; align-items: center; gap: 10px;
  }
  .map-search-input {
    flex: 1; padding: 10px 12px;
    background: rgba(var(--paper-rgb), 0.05);
    border: 1px solid var(--rule); color: var(--paper);
    font-family: var(--f-body); font-size: 15px;
    outline: none; transition: border-color 0.25s ease;
  }
  .map-search-input:focus { border-color: var(--gold); }
  .map-search-input::placeholder { color: var(--paper-dim); font-style: italic; }
  .map-search-state {
    font-family: var(--f-mono); font-size: 14px; color: var(--paper-dim);
  }
  .map-search-results {
    top: calc(100% - 4px); left: 18px; right: 18px;
    z-index: 1200;
  }
  .map-body { height: min(420px, 52vh); position: relative; }
  .map-body .leaflet-container { width: 100%; height: 100%; background: #0d0f1f; font-family: var(--f-mono); }
  .map-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.2em;
    color: var(--paper-dim); text-transform: uppercase;
  }
  .map-foot {
    display: flex; gap: 14px; align-items: center;
    padding: 12px 18px; border-top: 1px solid var(--rule);
  }
  .map-readout {
    flex: 1; min-width: 0;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.08em; color: var(--paper-dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .map-readout strong { color: var(--gold); font-weight: 500; }
  .map-confirm {
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.2em; text-transform: uppercase;
    padding: 11px 22px; cursor: pointer;
    background: rgba(var(--gold-rgb), 0.12);
    border: 1px solid var(--gold); color: var(--gold);
    transition: all 0.25s ease;
  }
  .map-confirm:hover:not(:disabled) { background: var(--gold); color: var(--ink-deep); }
  .map-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ============= ASK THE COSMOS (AI) ============= */
  .ask-cosmos {
    margin-top: 72px; padding-top: 44px;
    border-top: 1px solid var(--rule);
  }
  .ask-cosmos-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    letter-spacing: 0.42em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 12px;
  }
  .ask-cosmos-title {
    font-family: var(--f-display); font-weight: 330;
    font-size: 34px; line-height: 1.05; margin-bottom: 10px;
  }
  .ask-cosmos-title em { font-style: italic; color: var(--gold); }
  .ask-cosmos-sub {
    font-family: var(--f-body); font-style: italic; font-size: 16px;
    color: var(--paper-dim); max-width: 560px; margin-bottom: 22px;
  }
  .ask-cosmos-row { display: flex; gap: 10px; align-items: stretch; }
  .ask-cosmos-input {
    flex: 1; padding: 14px 16px;
    background: rgba(var(--paper-rgb), 0.04);
    border: 1px solid var(--rule); color: var(--paper);
    font-family: var(--f-body); font-size: 16px;
    outline: none; transition: border-color 0.25s ease;
  }
  .ask-cosmos-input:focus { border-color: var(--gold); }
  .ask-cosmos-btn {
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.2em; text-transform: uppercase;
    padding: 0 24px; cursor: pointer;
    background: rgba(var(--gold-rgb), 0.12);
    border: 1px solid var(--gold); color: var(--gold);
    transition: all 0.25s ease; white-space: nowrap;
  }
  .ask-cosmos-btn:hover:not(:disabled) { background: var(--gold); color: var(--ink-deep); }
  .ask-cosmos-btn:disabled { opacity: 0.45; cursor: wait; }
  .ask-cosmos-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .ask-cosmos-chip {
    font-family: var(--f-mono); font-size: 10.5px;
    letter-spacing: 0.1em; padding: 7px 14px;
    background: none; border: 1px solid var(--rule-soft);
    color: var(--paper-dim); cursor: pointer; border-radius: 99px;
    transition: all 0.2s ease;
  }
  .ask-cosmos-chip:hover { border-color: var(--gold); color: var(--gold); }
  .ask-cosmos-answer {
    margin-top: 26px; padding: 24px 26px;
    border-left: 2px solid var(--gold);
    background: rgba(var(--gold-rgb), 0.05);
    font-family: var(--f-body); font-size: 17px; line-height: 1.7;
    color: var(--paper); white-space: pre-wrap;
  }
  .ask-cosmos-answer.thinking { font-style: italic; color: var(--paper-dim); }
  .ask-cosmos-note {
    margin-top: 12px; font-family: var(--f-mono); font-size: 10px;
    letter-spacing: 0.1em; color: var(--paper-faint);
  }

  /* =====================================================================
     LANDING — combined hero + birth form. One screen, no splash, fully
     responsive: editorial hero left, form right; stacks on small screens.
     ===================================================================== */

  /* =====================================================================
     AUTH — sign in / sign up / verify / forgot / welcome. Split layout:
     a cosmic hero on the left (over the global starfield), the form pane
     on the right. Mobile-first: stacks to a compact cosmic banner + form.
     ===================================================================== */
  .auth {
    position: absolute; inset: 0; z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.92fr);
    align-items: stretch;
    height: 100vh; height: 100dvh;
    overflow-x: hidden; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .auth-hero {
    position: relative;
    display: flex; flex-direction: column; justify-content: center;
    gap: 22px;
    padding: clamp(28px, 5vh, 84px) clamp(28px, 4.5vw, 88px);
    border-right: 1px solid var(--rule);
  }
  .auth-hero-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.42em; text-transform: uppercase;
    animation: fadeInUp 0.9s 0.05s both;
  }
  .auth-hero-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: clamp(40px, min(5.6vw, 9vh), 88px); line-height: 0.98;
    color: var(--paper); letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 1;
    margin: 0; text-wrap: balance;
    animation: fadeInUp 0.9s 0.15s both;
  }
  .auth-hero-title em {
    font-style: italic; color: var(--gold);
    font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  }
  .auth-hero-deva {
    font-family: var(--f-deva); font-size: clamp(20px, 2.4vw, 30px);
    color: var(--copper-lt); letter-spacing: 0.02em;
    animation: fadeInUp 0.9s 0.22s both;
  }
  .auth-hero-sub {
    font-family: var(--f-body); font-style: italic;
    font-size: clamp(15px, 1.5vw, 19px); line-height: 1.6;
    color: var(--paper-dim); max-width: 46ch; margin: 0;
    text-wrap: pretty;
    animation: fadeInUp 0.9s 0.3s both;
  }
  .auth-hero-quote {
    margin: 8px 0 0; padding-left: 18px;
    border-left: 1px solid var(--copper);
    font-family: var(--f-body); font-style: italic;
    font-size: clamp(15px, 1.5vw, 18px); line-height: 1.55;
    color: rgba(var(--paper-rgb), 0.9); max-width: 34ch;
    animation: fadeInUp 0.9s 0.38s both;
  }
  .auth-hero-quote em { color: var(--gold); }
  .auth-hero-quote-src {
    display: block; margin-top: 12px;
    font-family: var(--f-mono); font-style: normal;
    font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--copper-lt);
  }
  .auth-pane {
    display: flex; align-items: center; justify-content: center;
    padding: clamp(28px, 5vh, 72px) clamp(22px, 3.6vw, 64px);
  }
  .auth-card {
    width: 100%; max-width: 420px;
    animation: fadeInUp 0.9s 0.2s both;
  }
  .auth-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.32em; text-transform: uppercase;
    margin-bottom: 12px;
  }
  .auth-title {
    font-family: var(--f-display); font-weight: 330;
    font-size: clamp(28px, 4vw, 40px); line-height: 1.06;
    color: var(--paper); letter-spacing: -0.015em; margin: 0 0 10px;
  }
  .auth-title em { font-style: italic; color: var(--gold); }
  .auth-subtitle {
    font-family: var(--f-body); font-size: 15px; line-height: 1.6;
    color: var(--paper-dim); margin: 0 0 26px;
  }
  .auth-subtitle strong { color: var(--paper); font-weight: 500; }
  .auth-sso { display: flex; flex-direction: column; gap: 9px; }
  .auth-sso-btn {
    display: flex; align-items: center; gap: 14px; width: 100%;
    cursor: pointer; text-align: left;
    background: rgba(var(--ink-rgb), 0.18); border: 1px solid var(--rule);
    padding: 11px 14px;
    font-family: var(--f-body); font-size: 15px; color: var(--paper);
    transition: border-color var(--motion-snappy, 0.18s) ease, transform var(--motion-snappy, 0.18s) ease;
  }
  .auth-sso-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
  .auth-sso-mark {
    flex-shrink: 0; width: 26px; height: 26px;
    display: grid; place-content: center;
    font-family: var(--f-display); font-weight: 560; font-size: 15px;
    color: var(--gold); border: 1px solid var(--rule); border-radius: 50%;
  }
  .auth-or {
    display: flex; align-items: center; gap: 14px; margin: 22px 0;
    font-family: var(--f-mono); font-size: 10px;
    letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-dim);
  }
  .auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
  .auth-field { margin-bottom: 18px; }
  .auth-field-desc {
    margin-top: 6px; font-family: var(--f-body); font-style: italic;
    font-size: 12.5px; color: var(--paper-dim);
  }
  .auth-row-between {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: -4px 0 22px;
  }
  .auth-check {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: var(--f-body); font-size: 13.5px; color: var(--paper-dim);
  }
  .auth-check input { accent-color: var(--gold); width: 15px; height: 15px; }
  .auth-link {
    background: none; border: 0; padding: 0; cursor: pointer;
    font-family: var(--f-body); font-size: 13.5px; font-style: italic;
    color: var(--gold);
  }
  .auth-link:hover { color: var(--gold-bright); text-decoration: underline; }
  .auth-foot {
    font-family: var(--f-body); font-size: 14px; color: var(--paper-dim);
    margin: 22px 0 0;
  }
  .auth-fine {
    font-family: var(--f-body); font-size: 12px; font-style: italic;
    line-height: 1.5; color: var(--paper-dim); margin: 16px 0 0;
  }
  .auth-guest {
    margin-top: 18px; text-align: center;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.18em; text-transform: uppercase;
  }
  .auth-otp { display: flex; gap: 8px; margin-bottom: 22px; }
  .auth-otp-cell {
    width: 100%; max-width: 52px; aspect-ratio: 4 / 5; text-align: center;
    font-family: var(--f-mono); font-size: 20px; color: var(--paper);
    background: rgba(var(--ink-rgb), 0.22); border: 1px solid var(--rule);
    outline: none; transition: border-color var(--motion-snappy, 0.18s) ease;
  }
  .auth-otp-cell:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.18); }
  .auth-mono-mark {
    display: inline-block; font-family: var(--f-deva);
    font-size: 46px; color: var(--gold); margin-bottom: 14px;
  }
  /* Auth responsiveness: cosmic banner on top, form below */
  @media (max-width: 880px) {
    .auth { grid-template-columns: minmax(0, 1fr); align-content: start; }
    .auth-hero {
      border-right: none; border-bottom: 1px solid var(--rule);
      padding: clamp(40px, 8vh, 72px) 24px clamp(20px, 4vh, 32px);
      gap: 14px;
    }
    .auth-hero-sub, .auth-hero-quote { display: none; }
    .auth-pane { padding: 28px 22px 44px; }
    .auth-card { max-width: none; }
  }
  @media (max-height: 720px) and (max-width: 880px) {
    .auth-hero-deva { display: none; }
    .auth-hero { padding-top: 56px; }
  }

  /* =====================================================================
     LANDING — combined hero + birth form. One screen, no splash, fully
     responsive: editorial hero left, form right; stacks on small screens.
     ===================================================================== */
  .landing {
    position: absolute; inset: 0; z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(20px, 3.5vw, 64px);
    align-items: center;
    height: 100vh; height: 100dvh;
    /* Designed to FIT one viewport — but if a device is too short, the
       form must always remain reachable, so vertical scroll engages
       exactly when content overflows (invisible otherwise). */
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: clamp(14px, 3vh, 56px) clamp(20px, 4vw, 72px);
    max-width: 1480px; margin: 0 auto;
  }
  .landing-hero { min-width: 0; }
  .landing-eyebrow {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.34em; text-transform: uppercase;
    margin-bottom: 18px;
    animation: fadeInUp 0.9s 0.05s both;
  }
  .landing-title {
    font-family: var(--f-display); font-weight: 320;
    font-size: clamp(40px, min(6.5vw, 11vh), 104px); line-height: 0.98;
    color: var(--paper); letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 1;
    margin: 0 0 clamp(10px, 2vh, 22px);
    text-wrap: balance;
    animation: fadeInUp 0.9s 0.15s both;
  }
  .landing-title em {
    font-style: italic; color: var(--gold);
    font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  }
  .landing-sub {
    font-family: var(--f-body); font-style: italic;
    font-size: clamp(15px, min(1.6vw, 2.4vh), 20px); line-height: 1.55;
    color: var(--paper-dim); max-width: 46ch;
    margin: 0 0 clamp(14px, 3vh, 40px);
    text-wrap: pretty;
    animation: fadeInUp 0.9s 0.25s both;
  }
  .landing-features {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: clamp(8px, 1.8vh, 18px);
    animation: fadeInUp 0.9s 0.35s both;
  }
  .landing-feature {
    display: flex; gap: 18px; align-items: baseline;
    padding-top: clamp(8px, 1.6vh, 18px);
    border-top: 1px solid var(--rule-soft);
  }
  .landing-feature-k {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--copper-lt); letter-spacing: 0.3em;
    flex-shrink: 0; min-width: 34px;
  }
  .landing-feature-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .landing-feature-t {
    font-family: var(--f-display); font-weight: 380;
    font-size: 19px; color: var(--paper); letter-spacing: -0.01em;
  }
  .landing-feature-s {
    font-family: var(--f-body); font-style: italic;
    font-size: 14.5px; line-height: 1.5; color: var(--paper-dim);
  }
  .landing-form { min-width: 0; display: flex; justify-content: center; min-height: 0; }
  .landing .form-card {
    max-width: 520px;
    padding: clamp(18px, 3.2vh, 44px) clamp(20px, 2.6vw, 48px);
    animation: fadeInUp 0.9s 0.2s both;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  }
  /* Compress the form vertically so the whole landing always fits one
     viewport — every vertical measure scales with vh. */
  .landing .form-card .form-field { margin-bottom: clamp(10px, 2vh, 24px); }
  .landing .form-card .form-title { font-size: clamp(26px, 4.8vh, 44px); }
  .landing .form-card .form-deva { margin-bottom: clamp(14px, 2.6vh, 34px); }
  .landing .form-card .form-eyebrow { margin-bottom: clamp(6px, 1.2vh, 14px); }
  .landing .form-card .form-input {
    font-size: clamp(16px, 2.4vh, 22px);
    padding: clamp(6px, 1vh, 12px) 0 clamp(8px, 1.3vh, 14px) 0;
  }
  .landing .form-card .form-label {
    margin-bottom: clamp(5px, 1vh, 10px);
    font-size: clamp(10px, 1.3vh, 12px);
  }
  .landing .form-card .form-submit {
    margin-top: clamp(8px, 1.4vh, 14px);
    padding: clamp(12px, 1.9vh, 18px);
  }
  .landing .form-card .pob-actions { margin-top: clamp(6px, 1.2vh, 10px); }
  .landing .form-card .pob-btn {
    min-height: clamp(34px, 4.6vh, 42px);
    padding: clamp(7px, 1.2vh, 11px) 12px;
  }
  .landing .form-card .form-geo-line { margin-top: 4px; min-height: 16px; }
  .form-opt {
    font-size: 10px; letter-spacing: 0.18em;
    color: var(--paper-faint); text-transform: none;
    margin-left: 8px;
  }
  /* Compact timezone disclosure — keeps the form short on small screens */
  .tz-summary {
    display: flex; align-items: baseline; gap: 12px;
    width: 100%; padding: 10px 0 12px;
    background: transparent; border: none;
    border-bottom: 1px solid var(--rule);
    cursor: pointer; text-align: left;
    transition: border-color var(--motion-snappy, 0.18s) ease;
  }
  .tz-summary:hover { border-bottom-color: var(--gold); }
  .tz-summary-label {
    font-family: var(--f-mono); font-size: 12px;
    color: var(--copper-lt); letter-spacing: 0.28em; text-transform: uppercase;
    flex-shrink: 0;
  }
  .tz-summary-value {
    font-family: var(--f-display); font-size: clamp(16px, 2.2vh, 20px);
    color: var(--paper); flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .tz-summary-edit {
    font-family: var(--f-mono); font-size: 11px;
    color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase;
    flex-shrink: 0;
  }

  /* Landing responsiveness: stack hero above form — still one viewport */
  @media (max-width: 1020px) {
    .landing {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto minmax(0, 1fr);
      align-items: start; align-content: start;
      gap: clamp(12px, 2.5vh, 28px);
      padding-top: clamp(44px, 7vh, 72px);
    }
    .landing-hero { text-align: left; }
    .landing-title { font-size: clamp(30px, min(9vw, 6.5vh), 54px); }
    .landing-sub { margin-bottom: clamp(8px, 1.6vh, 20px); }
    .landing-features { display: none; }  /* keep the fold tight on mobile */
    .landing-form { justify-content: stretch; align-self: start; }
    .landing .form-card { max-width: none; width: 100%; }
  }
  /* Short windows: drop secondary hero content so the form never scrolls */
  @media (max-height: 700px) {
    .landing-features { display: none; }
  }
  /* Very short viewports (landscape phones, tiny windows): top-align so
     centered overflow cannot clip the top of the form. */
  @media (max-height: 600px) {
    .landing { align-items: start; }
  }
  @media (max-width: 1020px) and (max-height: 800px) {
    .landing-sub { display: none; }
    .landing-title { margin-bottom: clamp(6px, 1.2vh, 14px); }
  }
  @media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }
    .form-input { font-size: clamp(15px, 2.2vh, 19px); }
    .pob-actions { flex-direction: row; }
    .form-submit { letter-spacing: 0.3em; }
    .form-submit:hover { letter-spacing: 0.34em; }
  }

  /* =====================================================================
     RESPONSIVE PASS — reading, kundli, map modal, chrome
     ===================================================================== */
  @media (max-width: 880px) {
    .cosmos-content-wrap .reading { padding: 28px 20px 64px; }
    .reading-inner { max-width: 100%; }
    .kundli-grid { grid-template-columns: 1fr !important; gap: 32px; }
    .map-card { width: calc(100vw - 24px); }
    .map-body { height: min(380px, 56vh); }
    .map-foot { flex-wrap: wrap; }
    .map-confirm { width: 100%; }
    .graha-grid { grid-template-columns: 1fr !important; }
    .ask-cosmos-row { flex-direction: column; }
    .ask-cosmos-btn { padding: 14px; }
  }

  /* Compact cosmos chrome — phones / small tablets */
  @media (max-width: 760px) {
    .native-strip {
      overflow-x: auto; overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-right: 96px; /* keep last item clear of the fixed fabs */
    }
    .native-strip::-webkit-scrollbar { display: none; }
    .phase-indicator { display: none; }
    .ctrl-row { top: auto !important; bottom: 120px; right: 12px !important; }
    .skip-btn { top: 64px; right: 16px; }
    .intro-caption { left: 20px; right: 20px; bottom: 110px; max-width: none; }
    .intro-caption-head { font-size: 30px; }
    .chapter-bar.standalone {
      bottom: 10px;
      max-width: calc(100vw - 12px);
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .chapter-bar.standalone::-webkit-scrollbar { display: none; }
    .chapter-bar.standalone.tl-bottom { bottom: 196px; }
    .inspector {
      left: 8px !important; right: 8px !important;
      width: auto !important; max-width: none !important;
      top: auto !important; bottom: 64px !important;
      max-height: 46vh; overflow-y: auto;
    }
    .save-controls { bottom: 64px; right: 12px; }
    .intro-flight-place { font-size: 48px; }
    .intro-flight-hud { top: 64px; left: 20px; }
  }

  /* =====================================================================
     THREE-SPAN COSMOS THEME — transparency, slim journey bar, insight
     tabs, and enlarged chart/dasha type. Kept late in the sheet so these
     override the component defaults above.
     ===================================================================== */

  /* Panels reveal the universe behind them — hairline borders define the
     surfaces; the sky stays crisp (no heavy blur, no dark wash). */
  .fp {
    background: rgba(var(--ink-rgb), 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .form-card {
    background: rgba(var(--ink-rgb), 0.16);
    backdrop-filter: none;
  }
  .native-strip {
    background: rgba(var(--ink-rgb), 0.32);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .inspector { background: rgba(var(--ink-rgb), 0.35); }
  .djb {
    background: rgba(var(--ink-rgb), 0.20);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    height: auto;            /* hug content — shorter with Sade Sati collapsed */
  }
  /* The dimming overlays are retired in dark theme — the user should see
     the universe, not a vignette. (Light theme keeps its soft grain.) */
  .bg-grain { opacity: 0.10; }
  .bg-vignette { opacity: 0.30; }
  /* The cosmos stage no longer paints its own opaque sky — the global
     starfield shows through every panel, including this one. */
  .stage-space {
    background:
      radial-gradient(ellipse 70% 55% at 50% 40%, rgba(17, 20, 42, 0.45) 0%, rgba(10, 12, 28, 0.15) 70%, transparent 100%) !important;
  }
  html[data-theme="light"] .stage-space {
    background:
      radial-gradient(ellipse 70% 55% at 50% 40%, #11142a 0%, #0A0C1C 70%) !important;
  }
  .nsg-wrap, .nik-wrap { background: rgba(15, 18, 38, 0.30); }
  .graha-card { background: rgba(15, 18, 38, 0.26); }
  .kundli-side { background: rgba(var(--ink-rgb), 0.30); }
  .reading-template { background: rgba(15, 18, 38, 0.20); }
  .fp.fp-cosmos.page-mode { background: rgba(var(--ink-rgb), 0.55); }

  /* Slim dasha journey bar, pinned low */
  .djb { padding: 6px 14px 8px; gap: 4px; }
  .djb.pos-bottom { bottom: 10px; }
  .djb-head { height: 24px; }
  .djb-track { height: 38px; }
  .djb-sade-track { height: 10px; }
  .djb-block-deva { display: none; }
  .djb-block-en { font-size: 13px; }
  .djb-block-yrs { font-size: 10.5px; }

  /* Insight tabs (right span): Reading | Dasha */
  .itabs { display: flex; flex-direction: column; min-height: 0; }
  .itabs-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-shrink: 0; }
  .itab {
    flex: 1; padding: 10px 12px; cursor: pointer;
    font-family: var(--f-mono); font-size: clamp(11px, 0.8vw, 13px);
    letter-spacing: 0.22em; text-transform: uppercase;
    background: transparent; border: 1px solid var(--rule);
    color: var(--paper-dim);
    transition: all 0.25s ease;
  }
  .itab:hover { color: var(--gold); border-color: var(--gold); }
  .itab.active {
    background: rgba(var(--gold-rgb), 0.12);
    color: var(--gold);
    border-color: rgba(var(--gold-rgb), 0.5);
  }
  .itabs-body {
    overflow-y: auto; overflow-x: hidden;
    max-height: calc(100vh - 310px);
    padding-right: 4px;
    min-height: 0;
  }
  /* The Reading, re-fitted to a column */
  .itabs-body .reading {
    position: static; inset: auto;
    background: transparent;
    padding: 0 2px 24px;
    overflow: visible;
    z-index: auto;
  }
  .itabs-body .reading-inner { max-width: none; }
  /* In the three-pane column the reference template (Sidereal positions
     table + Lagna Kundli square) is hidden — it belongs to the full
     Reading page, where there is room for it. */
  .itabs-body .reading-template { display: none; }
  .itabs-body .reading-title { font-size: clamp(26px, 2vw, 36px); max-width: none; }
  .itabs-body .reading-intro { font-size: 15px; margin-bottom: 28px; }
  .itabs-body .reading-template { padding: 12px; margin: 16px 0 28px; }
  .itabs-body .nsg-wrap { overflow-x: auto; padding: 12px; }
  .itabs-body .nsg-table { min-width: 520px; }
  .itabs-body .graha-grid { grid-template-columns: 1fr; }
  .itabs-body .reading-section { margin-bottom: 36px; padding-bottom: 24px; }
  .itabs-body .reading-section-title { font-size: clamp(20px, 1.5vw, 26px); }

  /* Bigger, clearer chart + dasha type (left and right spans) */
  .mk-planet { font-size: 16px; }
  .mk-planet-r { font-size: 11px; }
  .mk-planet-dot { font-size: 14px; }
  .dasha-row-name { font-size: 15px; }
  .dasha-row-deva { font-size: 16px; }
  .dasha-row-meta { font-size: 13px; }
  .dasha-row-meta-sub { font-size: 12.5px; }
  .dasha-section-label { font-size: 12.5px; }
  .dasha-row-glyph { font-size: 20px; }

  /* Fluid chrome type — scales gently with the viewport */
  .fp-head { font-size: clamp(11px, 0.85vw, 14px); }
  .native-strip-value { font-size: clamp(14px, 1.05vw, 18px); }
  .native-strip-label { font-size: clamp(11px, 0.8vw, 13px); }


  /* ── Frappe wiring: auth errors + engine save CTA ─────────────────── */
  .auth-error {
    margin: 12px 0 2px;
    padding: 10px 14px;
    border: 1px solid rgba(122, 27, 46, 0.55);
    border-left: 3px solid var(--crimson);
    background: rgba(122, 27, 46, 0.12);
    color: var(--paper);
    font-family: var(--f-body);
    font-size: 14px;
    line-height: 1.45;
    border-radius: 6px;
  }
  [data-theme="light"] .auth-error {
    color: var(--ink-deep);
    background: rgba(122, 27, 46, 0.08);
  }
  .engine-save { margin-top: 18px; }
  .engine-save a { color: var(--copper-lt); }
  [data-theme="light"] .engine-save a { color: var(--copper-dp); }

  /* ── PWA install chip (mobile-first, safe-area aware) ─────────────── */
  .install-chip {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 320;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(92vw, 480px);
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: rgba(10, 12, 28, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--paper);
    font-family: var(--f-body);
    font-size: 13.5px;
    line-height: 1.35;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  }
  [data-theme="light"] .install-chip {
    background: rgba(244, 237, 226, 0.92);
    color: var(--ink-deep);
  }
  .install-text { flex: 1 1 auto; }
  .install-btn {
    flex: 0 0 auto;
    padding: 7px 16px;
    border: 1px solid var(--copper);
    border-radius: 999px;
    background: var(--copper);
    color: #fff;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .install-btn:hover { background: var(--copper-dp); border-color: var(--copper-dp); }
  .install-x {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.65;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  .install-x:hover { opacity: 1; }
  @media (max-width: 480px) {
    .install-chip { font-size: 12.5px; padding: 9px 10px 9px 14px; }
  }
