/* ═══════════════════════════════════════════════════════
   BIRTH ALIGNMENT — Celestial Birth Sky Calculator
   Full-screen Three.js experience with glass input form
   and floating result panels
   ═══════════════════════════════════════════════════════ */

/* iPhone safe-area: deep star-violet bleed into the bezel —
   the birth-sky purple-black extending past the page frame. */
body.ba-page {
    --magna-edge-top-paint: linear-gradient(180deg, #100820 0%, var(--th-bg-void, #08090c) 100%);
    --magna-edge-bottom-paint: linear-gradient(0deg, #0a0518 0%, var(--th-bg-void, #08090c) 100%);
}

:root {
    /* Observatory-grade palette. Pale steel primary + very muted
       aurora green. No rainbow gradient, no saturated violet/teal combo.
       Think Hubble calibration plate: mostly grayscale, one subtle metallic
       accent, one whisper of cool color. */
    --ba-steel: #c8d4e6;              /* primary accent — pale steel */
    --ba-steel-2: #8fa3c4;             /* mid metallic for borders */
    --ba-aurora: #6ba89a;              /* faint aurora green, used sparingly */
    --ba-deep: #1a2338;
    --ba-accent: var(--ba-steel);
    --ba-accent-dim: rgba(200, 212, 230, 0.32);
    --ba-accent-glow: rgba(200, 212, 230, 0.10);
    /* Legacy alias — anywhere old CSS/JS referenced gold now gets steel. */
    --ba-gold: var(--ba-accent);
    --ba-gold-dim: var(--ba-accent-dim);
    --ba-gold-glow: var(--ba-accent-glow);
    --ba-blue: #64b4ff;
    --ba-blue-dim: rgba(100, 180, 255, 0.4);
    --ba-red: #ff6464;
    --ba-bg: #04070f;
    --ba-glass: rgba(10, 14, 24, 0.6);
    --ba-glass-border: rgba(200, 212, 230, 0.08);
    --ba-glass-border-hover: rgba(200, 212, 230, 0.22);
    --ba-text: #e4e6ed;
    --ba-text-muted: rgba(228, 230, 237, 0.48);
    --ba-serif: 'Cormorant Garamond', 'Georgia', serif;
    --ba-display: 'Cinzel', serif;
    --ba-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --ba-nav-h: 44px;
    /* Height contract for the result-phase bottom bar. JS may subtract this
       from the Three.js renderer height to keep objects clear of the HUD.
       Mobile tall-bar state raises this to 88px at <=560px. */
    --ba-bar-h: 56px;
    --ba-safe-bottom: env(safe-area-inset-bottom, 0px);
    /* Apple HIG minimum tap target */
    --ba-tap: 44px;
}

/* ═══ PAGE CLASS ═══ */
.ba-page {
    background: var(--ba-bg);
    color: var(--ba-text);
}

/* ═══ PHASE CONTAINER ═══ */
.ba-phase {
    position: fixed;
    inset: 0;
    z-index: 10;
}

/* ═══ BASE RESET ═══ */
html, body {
    margin: 0;
    padding: 0;
    background: var(--ba-bg);
    color: var(--ba-text);
    font-family: var(--ba-serif);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* Hide footer — full-screen canvas */
.magna-footer, #magna-site-footer, footer,
.magna-footer--collapsed, .magna-footer__collapsed-bar {
    display: none !important;
}

/* ═══ THREE.JS CANVAS ═══ */
#ba-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
}
#ba-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* iPad/iOS: stop Safari from stealing drag/zoom gestures from OrbitControls */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ═══ INPUT PHASE ═══ */
#ba-input-phase {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 16px calc(24px + var(--ba-safe-bottom));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 1.2s ease, transform 1.2s ease;
}
#ba-input-phase.ba-hidden {
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
    pointer-events: none;
}

.ba-input-inner {
    text-align: center;
    max-width: 480px;
    width: 90%;
}

.ba-input-eyebrow {
    font-family: var(--ba-mono);
    font-size: 0.56rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--ba-steel-2);
    margin-bottom: 10px;
    opacity: 0;
    animation: ba-fade-in 1.5s ease 0.3s forwards;
}

.ba-input-title {
    font-family: var(--ba-display);
    font-size: clamp(1.1rem, 3vw, 1.85rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.3;
    color: var(--ba-text);
    text-shadow: 0 0 24px rgba(200, 212, 230, 0.12);
    margin-bottom: 10px;
    text-align: center;
    opacity: 0;
    animation: ba-fade-in 2s ease 0.5s forwards;
}

.ba-input-sub {
    font-size: 0.78rem;
    color: var(--ba-text-muted);
    margin-bottom: 22px;
    opacity: 0;
    animation: ba-fade-in 2s ease 0.8s forwards;
}

@keyframes ba-fade-in {
    to { opacity: 1; }
}

.ba-form {
    /* Liquid Glass family — matches splash + dashboard cards.
       Three layers: illumination (backdrop blur+saturate), highlight
       (top-edge specular), shadow (outer drop). */
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    padding: 24px 28px;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    max-width: 380px;
    width: 92%;
    opacity: 0;
    animation: ba-fade-in 2s ease 1s forwards;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 -1px 0 rgba(0, 0, 0, 0.18) inset,
        0 14px 32px rgba(0, 0, 0, 0.32),
        0 3px 8px rgba(0, 0, 0, 0.20);
    isolation: isolate;
}
.ba-form::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius: 17px 17px 40% 40% / 17px 17px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    opacity: 0.85;
    z-index: -1;
}

.ba-field {
    margin-bottom: 14px;
}
.ba-field:last-of-type {
    margin-bottom: 18px;
}

.ba-label {
    display: block;
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    text-align: left;
}
.ba-optional {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
}

.ba-form-row {
    margin-bottom: 24px;
}
.ba-form-row:last-child {
    margin-bottom: 0;
}

.ba-form-label {
    display: block;
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ba-input-field, .ba-form-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    /* Min 44px tall tap target, 16px font to prevent iOS auto-zoom on focus. */
    min-height: var(--ba-tap);
    padding: 11px 16px;
    color: var(--ba-text);
    font-family: var(--ba-serif);
    font-size: 16px;
    line-height: 1.3;
    outline: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 -1px 0 rgba(0, 0, 0, 0.14) inset;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}
/* Desktop can shrink the input type a touch for density without triggering
   iOS auto-zoom (zoom only fires on the device itself). */
@media (min-width: 768px) {
    .ba-input-field, .ba-form-input {
        font-size: 0.95rem;
    }
}
.ba-input-field:focus,
.ba-form-input:focus {
    border-color: rgba(255, 232, 168, 0.45);
    background: rgba(255, 255, 255, 0.07);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.20) inset,
        0 -1px 0 rgba(0, 0, 0, 0.14) inset,
        0 0 22px rgba(255, 210, 140, 0.18);
    outline: none;
}
.ba-input-field::placeholder,
.ba-form-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Date/time row side by side */
.ba-form-row-split {
    display: flex;
    gap: 16px;
}
.ba-form-row-split .ba-form-row {
    flex: 1;
}

/* City autocomplete */
.ba-city-wrapper {
    position: relative;
}
.ba-city-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(12, 14, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    backdrop-filter: blur(20px);
}
.ba-city-dropdown.ba-visible {
    display: block;
}
.ba-city-option {
    padding: 12px 16px;
    min-height: var(--ba-tap);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: var(--ba-serif);
    font-size: 16px;
    color: var(--ba-text);
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
@media (min-width: 768px) {
    .ba-city-option { font-size: 0.95rem; }
}
.ba-city-option:hover,
.ba-city-option.ba-active {
    background: rgba(200, 212, 230, 0.1);
}
.ba-city-option .ba-city-country {
    color: var(--ba-text-muted);
    font-size: 0.8rem;
    margin-left: 8px;
}

/* Compute button — single metallic line, no gradients. Observatory-grade. */
.ba-compute-btn {
    /* Liquid Glass primary CTA — gold-tinted, matches splash Begin button.
       Three layers: tinted glass body, top specular highlight, soft drop. */
    position: relative;
    display: block;
    width: 100%;
    min-height: var(--ba-tap);
    padding: 14px 22px;
    margin-top: 18px;
    background: linear-gradient(180deg,
        rgba(255, 228, 150, 0.22) 0%,
        rgba(232, 200, 121, 0.14) 100%);
    border: 1px solid rgba(255, 232, 168, 0.45);
    border-radius: 16px;
    color: rgba(255, 250, 232, 1);
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-size: 1.12rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    text-shadow: 0 1px 14px rgba(255, 210, 140, 0.35);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.45) inset,
        0 -1px 0 rgba(80, 50, 20, 0.30) inset,
        0 0 0 1px rgba(255, 232, 168, 0.10) inset,
        0 14px 32px rgba(0, 0, 0, 0.38),
        0 3px 8px rgba(0, 0, 0, 0.25),
        0 0 20px rgba(255, 210, 140, 0.12);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    isolation: isolate;
}
.ba-compute-btn::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius: 15px 15px 40% 40% / 15px 15px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 245, 210, 0.22) 0%,
        rgba(255, 228, 150, 0.04) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: -1;
}
.ba-compute-btn::after {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -3px;
    height: 10px;
    background: radial-gradient(ellipse at center,
        rgba(255, 210, 140, 0.45) 0%,
        rgba(255, 180, 90, 0.18) 40%,
        transparent 75%);
    filter: blur(6px);
    opacity: 0.7;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -2;
}
.ba-compute-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(180deg,
        rgba(255, 238, 180, 0.32) 0%,
        rgba(232, 200, 121, 0.22) 100%);
    border-color: rgba(255, 245, 200, 0.65);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.55) inset,
        0 -1px 0 rgba(80, 50, 20, 0.30) inset,
        0 0 0 1px rgba(255, 232, 168, 0.15) inset,
        0 18px 38px rgba(0, 0, 0, 0.42),
        0 4px 10px rgba(0, 0, 0, 0.30),
        0 0 28px rgba(255, 210, 140, 0.22);
}
.ba-compute-btn:hover:not(:disabled)::after {
    opacity: 1;
    bottom: -5px;
    left: 8%; right: 8%;
    height: 14px;
}
.ba-compute-btn:active {
    transform: translateY(0);
}
.ba-compute-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Time optional hint */
.ba-time-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 4px;
    font-family: var(--ba-mono);
}

/* ═══ COMPUTING TRANSITION ═══ */
#ba-computing {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}
#ba-computing.ba-active {
    opacity: 1;
}
.ba-computing-inner {
    text-align: center;
}
.ba-computing-ring {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(200, 212, 230, 0.15);
    border-top-color: var(--ba-accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: ba-spin 1.2s linear infinite;
}
@keyframes ba-spin {
    to { transform: rotate(360deg); }
}
.ba-computing-text {
    font-family: var(--ba-mono);
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    color: var(--ba-gold);
    animation: ba-pulse 1.5s ease-in-out infinite;
}
@keyframes ba-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ═══ RESULT PHASE ═══ */
#ba-result-phase {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}
#ba-result-phase.ba-active {
    opacity: 1;
    /* Keep the phase wrapper click-through so OrbitControls receives mouse
       events on the canvas underneath. UI children (panels, bars, modals,
       buttons) explicitly re-enable pointer-events themselves. */
    pointer-events: none;
}
/* Re-enable pointer events on actual UI surfaces inside the result phase.
   .ba-info-modal and .ba-synastry-panel manage their own pointer-events
   via .ba-active / .open — DO NOT force them to auto here, that breaks
   the canvas underneath when the modal isn't open. */
#ba-result-phase.ba-active .ba-bottom-bar,
#ba-result-phase.ba-active .ba-report-panel,
#ba-result-phase.ba-active .ba-sky-info,
#ba-result-phase.ba-active .ba-hud,
#ba-result-phase.ba-active button,
#ba-result-phase.ba-active a,
#ba-result-phase.ba-active input,
#ba-result-phase.ba-active select,
#ba-result-phase.ba-active textarea {
    pointer-events: auto;
}

/* Result header */
.ba-result-header {
    text-align: center;
    margin-bottom: 32px;
    opacity: 0;
    animation: ba-slide-up 1.2s ease 0.3s forwards;
}
.ba-result-date {
    font-family: var(--ba-display);
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--ba-text);
    text-shadow: 0 0 30px rgba(200, 212, 230, 0.3);
}
.ba-result-location {
    font-family: var(--ba-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--ba-text-muted);
    margin-top: 6px;
}

@keyframes ba-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Result cards container */
.ba-result-cards {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    flex-wrap: wrap;
}

.ba-result-card {
    /* Liquid Glass result card — same family as splash Step-2 cards */
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 16px 20px;
    text-align: center;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 -1px 0 rgba(0, 0, 0, 0.18) inset,
        0 12px 28px rgba(0, 0, 0, 0.32),
        0 2px 6px rgba(0, 0, 0, 0.20);
    min-width: 140px;
    max-width: 180px;
    opacity: 0;
    animation: ba-card-in 0.8s ease forwards;
    isolation: isolate;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ba-result-card::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius: 15px 15px 40% 40% / 15px 15px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    opacity: 0.7;
    z-index: -1;
}
.ba-result-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.22);
}
.ba-result-card:nth-child(1) { animation-delay: 0.5s; }
.ba-result-card:nth-child(2) { animation-delay: 0.7s; }
.ba-result-card:nth-child(3) { animation-delay: 0.9s; }
.ba-result-card:nth-child(4) { animation-delay: 1.1s; }
.ba-result-card:nth-child(5) { animation-delay: 1.3s; }
.ba-result-card:nth-child(6) { animation-delay: 1.5s; }
.ba-result-card:nth-child(7) { animation-delay: 1.7s; }

@keyframes ba-card-in {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.ba-card-label {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.ba-card-value {
    font-family: var(--ba-display);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.2;
}
.ba-card-sub {
    font-size: 0.7rem;
    color: var(--ba-text-muted);
    margin-top: 4px;
    font-family: var(--ba-serif);
}

/* Card color variants */
.ba-result-card[data-type="sun"] { border-color: rgba(255, 200, 100, 0.15); }
.ba-result-card[data-type="sun"] .ba-card-value { color: #ffc864; }

.ba-result-card[data-type="moon"] { border-color: rgba(200, 210, 230, 0.15); }
.ba-result-card[data-type="moon"] .ba-card-value { color: #c8d2e6; }

.ba-result-card[data-type="rising"] { border-color: rgba(200, 212, 230, 0.15); }
.ba-result-card[data-type="rising"] .ba-card-value { color: var(--ba-gold); }

.ba-result-card[data-type="pleiades"] { border-color: rgba(100, 180, 255, 0.15); }
.ba-result-card[data-type="pleiades"] .ba-card-value { color: var(--ba-blue); }

.ba-result-card[data-type="orion"] { border-color: rgba(255, 100, 100, 0.15); }
.ba-result-card[data-type="orion"] .ba-card-value { color: var(--ba-red); }

.ba-result-card[data-type="lifepath"] { border-color: rgba(168, 112, 208, 0.15); }
.ba-result-card[data-type="lifepath"] .ba-card-value { color: var(--ba-violet); }

.ba-result-card[data-type="guide"] { border-color: rgba(200, 212, 230, 0.2); }
.ba-result-card[data-type="guide"] .ba-card-value { color: var(--ba-gold); }

/* Entity guide section (larger, prominent) */
.ba-guide-section {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    opacity: 0;
    animation: ba-slide-up 1.2s ease 2s forwards;
}
.ba-guide-number {
    font-family: var(--ba-display);
    font-size: 5rem;
    font-weight: 100;
    color: rgba(200, 212, 230, 0.12);
    line-height: 1;
}
.ba-guide-name {
    font-family: var(--ba-display);
    font-size: 1.2rem;
    letter-spacing: 0.25em;
    color: var(--ba-gold);
    margin-top: 4px;
}
.ba-guide-role {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--ba-text-muted);
    margin-top: 4px;
}
.ba-guide-cta {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 20px;
    border: 1px solid var(--ba-gold-dim);
    border-radius: 20px;
    color: var(--ba-gold);
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-decoration: none;
    transition: all 0.3s ease;
}
.ba-guide-cta:hover {
    background: rgba(200, 212, 230, 0.1);
    box-shadow: 0 0 20px var(--ba-gold-glow);
}

/* Precessional position (left side) */
.ba-precession-section {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    text-align: left;
    opacity: 0;
    animation: ba-slide-up 1.2s ease 1.8s forwards;
}
.ba-precession-label {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
}
.ba-precession-value {
    font-family: var(--ba-display);
    font-size: 2rem;
    color: var(--ba-teal);
    margin-top: 4px;
}
.ba-precession-sub {
    font-size: 0.7rem;
    color: var(--ba-text-muted);
    margin-top: 2px;
    max-width: 180px;
}

/* Grid resonance (left side, below precession) */
.ba-grid-section {
    position: absolute;
    left: 24px;
    bottom: 200px;
    text-align: left;
    opacity: 0;
    animation: ba-slide-up 1.2s ease 2.2s forwards;
}
.ba-grid-label {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
}
.ba-grid-name {
    font-family: var(--ba-serif);
    font-size: 1rem;
    color: var(--ba-gold);
    margin-top: 4px;
}
.ba-grid-distance {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: var(--ba-text-muted);
    margin-top: 2px;
}

/* ═══ RESULT ACTIONS (top right) ═══ */
.ba-result-actions {
    position: absolute;
    top: 60px;
    right: 24px;
    display: flex;
    gap: 10px;
    opacity: 0;
    animation: ba-fade-in 1s ease 2.5s forwards;
}
.ba-action-btn {
    padding: 8px 18px;
    background: var(--ba-glass);
    border: 1px solid var(--ba-glass-border);
    border-radius: 20px;
    color: var(--ba-text-muted);
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
}
.ba-action-btn:hover {
    border-color: var(--ba-gold-dim);
    color: var(--ba-gold);
}

/* ═══ SHARE OVERLAY (old rules — kept for ID specificity, z-index unified) ═══ */
#ba-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
#ba-share-overlay.ba-active {
    opacity: 1;
    pointer-events: auto;
}
#ba-share-canvas {
    border-radius: 8px;
    max-width: 90vw;
    max-height: 70vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.ba-share-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.ba-share-btn {
    padding: 12px 28px;
    border-radius: 24px;
    font-family: var(--ba-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}
.ba-share-btn-primary {
    background: var(--ba-gold);
    border: none;
    color: #000;
}
.ba-share-btn-primary:hover {
    box-shadow: 0 0 30px rgba(200, 212, 230, 0.4);
}
.ba-share-btn-secondary {
    background: transparent;
    border: 1px solid var(--ba-glass-border);
    color: var(--ba-text-muted);
}
.ba-share-btn-secondary:hover {
    border-color: var(--ba-gold-dim);
    color: var(--ba-gold);
}
.ba-share-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--ba-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .ba-guide-section {
        right: 16px;
    }
    .ba-guide-number {
        font-size: 3.5rem;
    }
    .ba-precession-section,
    .ba-grid-section {
        left: 16px;
    }
}

@media (max-width: 768px) {
    .ba-form {
        padding: 28px 24px;
    }
    .ba-form-row-split {
        flex-direction: column;
        gap: 0;
    }
    .ba-result-cards {
        gap: 8px;
        padding: 0 8px;
        bottom: 16px;
    }
    .ba-result-card {
        min-width: 100px;
        max-width: 130px;
        padding: 12px 14px;
    }
    .ba-card-value {
        font-size: 1rem;
    }
    .ba-guide-section {
        position: absolute;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 200px;
        transform: translateX(-50%);
        text-align: center;
    }
    .ba-guide-number {
        font-size: 3rem;
    }
    .ba-precession-section {
        top: 120px;
        transform: none;
    }
    .ba-grid-section {
        bottom: auto;
        top: 200px;
    }
    .ba-result-header {
        margin-bottom: 24px;
    }
    .ba-result-actions {
        top: auto;
        bottom: 250px;
        right: 50%;
        transform: translateX(50%);
    }
}

@media (max-width: 480px) {
    .ba-result-cards {
        gap: 6px;
        padding: 0 6px;
        bottom: 10px;
    }
    .ba-result-card {
        min-width: 85px;
        max-width: 110px;
        padding: 10px 10px;
    }
    .ba-card-value {
        font-size: 0.85rem;
    }
    .ba-card-label {
        font-size: 0.5rem;
    }
    .ba-guide-section {
        bottom: 170px;
    }
    .ba-guide-number {
        font-size: 2.5rem;
    }
    .ba-guide-name {
        font-size: 0.9rem;
    }
    .ba-precession-section {
        display: none;
    }
    .ba-grid-section {
        display: none;
    }
    .ba-input-title {
        letter-spacing: 0.2em;
    }
}

/* ═══════════════════════════════════════════════════════
   RESULT SCROLL MODE — scrollable result panels over the sky
   (overrides the original fixed-position layout to support
    Hebrew profile + Omer + expanded data)
   ═══════════════════════════════════════════════════════ */

.ba-result-scroll {
    position: relative;
    z-index: 15;
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 24px 60px;
}

.ba-section {
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(24px);
    animation: ba-section-in 0.7s ease forwards;
}
.ba-section:nth-child(1) { animation-delay: 0.3s; }
.ba-section:nth-child(2) { animation-delay: 0.6s; }
.ba-section:nth-child(3) { animation-delay: 0.9s; }
.ba-section:nth-child(4) { animation-delay: 1.2s; }
@keyframes ba-section-in {
    to { opacity: 1; transform: translateY(0); }
}

.ba-section-label {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--ba-gold);
    margin-bottom: 16px;
}

.ba-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Override old fixed positioning when in scroll mode */
.ba-result-scroll .ba-result-card {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    transform: none;
    max-width: none;
    min-width: auto;
    opacity: 1;
}

/* ═══ HEBREW PROFILE SECTION ═══ */
.ba-hebrew-grid {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.ba-hebrew-letter-display {
    flex-shrink: 0;
    text-align: center;
    min-width: 90px;
}

.ba-hebrew-char {
    font-size: 4rem;
    color: var(--ba-gold);
    line-height: 1;
    text-shadow: 0 0 30px var(--ba-gold-glow);
    margin-bottom: 8px;
}

.ba-hebrew-letter-name {
    font-family: var(--ba-mono);
    font-size: 0.7rem;
    color: var(--ba-text-muted);
    letter-spacing: 0.1em;
}

.ba-hebrew-details {
    flex: 1;
}

.ba-hebrew-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ba-hebrew-row:last-child { border-bottom: none; }

.ba-hebrew-label {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}

.ba-hebrew-value {
    font-size: 0.85rem;
    color: var(--ba-text);
}

/* ═══ OMER SECTION ═══ */
.ba-omer {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--ba-glass);
    border: 1px solid var(--ba-glass-border);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ba-omer-label {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ba-gold);
    margin-bottom: 8px;
}

.ba-omer-day {
    font-family: var(--ba-display);
    font-size: 1.1rem;
    color: var(--ba-text);
    margin-bottom: 4px;
}

.ba-omer-combo {
    font-size: 0.8rem;
    color: var(--ba-text-muted);
    font-style: italic;
}

/* ═══ GUIDE CARD (in scroll mode) ═══ */
.ba-result-scroll .ba-guide-section {
    position: relative;
    inset: auto;
    transform: none;
    text-align: left;
}

.ba-guide-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--ba-glass);
    border: 1px solid rgba(200, 212, 230, 0.12);
    border-radius: 12px;
    padding: 20px 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ba-result-scroll .ba-guide-number {
    font-family: var(--ba-display);
    font-size: 2.5rem;
    color: var(--ba-gold);
    position: static;
    text-shadow: 0 0 20px var(--ba-gold-glow);
}

.ba-guide-info { flex: 1; }

.ba-result-scroll .ba-guide-name {
    font-family: var(--ba-display);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: var(--ba-text);
    position: static;
    margin-bottom: 4px;
}

.ba-result-scroll .ba-guide-role {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: var(--ba-text-muted);
    position: static;
}

.ba-result-scroll .ba-guide-cta {
    position: static;
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ba-gold);
    border: 1px solid var(--ba-gold-dim);
    border-radius: 4px;
    padding: 8px 16px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.ba-result-scroll .ba-guide-cta:hover {
    background: rgba(200, 212, 230, 0.08);
    border-color: var(--ba-gold);
}

/* ═══ PRECESSION (in scroll mode) ═══ */
.ba-precession {
    text-align: center;
    margin-bottom: 20px;
}
.ba-result-scroll .ba-precession-value {
    font-family: var(--ba-display);
    font-size: 2rem;
    color: var(--ba-gold);
    position: static;
}
.ba-result-scroll .ba-precession-sub {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: var(--ba-text-muted);
    position: static;
    margin-top: 4px;
}

.ba-grid-resonance {
    text-align: center;
    padding: 12px;
    background: var(--ba-glass);
    border: 1px solid var(--ba-glass-border);
    border-radius: 8px;
}
.ba-grid-label {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 6px;
}
.ba-grid-name {
    font-size: 0.9rem;
    color: var(--ba-text);
}
.ba-grid-distance {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: var(--ba-text-muted);
    margin-top: 4px;
}

/* ═══ ACTIONS ═══ */
.ba-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-bottom: 40px;
    opacity: 0;
    animation: ba-section-in 0.7s ease 1.5s forwards;
}

/* Liquid Glass family — secondary buttons (gold-tinted glass primary,
   neutral glass secondary, low-emphasis glass tertiary) */
.ba-starmap-btn,
.ba-share-btn,
.ba-reset-btn,
.ba-couples-toggle {
    position: relative;
    font-family: var(--ba-mono);
    font-size: 0.66rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    border-radius: 14px;
    padding: 13px 28px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    isolation: isolate;
}
.ba-starmap-btn::before,
.ba-share-btn::before,
.ba-couples-toggle::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius: 13px 13px 40% 40% / 13px 13px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    opacity: 0.7;
    z-index: -1;
}

/* Primary star-map / share — gold-tinted glass */
.ba-starmap-btn,
.ba-share-btn {
    background: linear-gradient(180deg,
        rgba(255, 228, 150, 0.20) 0%,
        rgba(232, 200, 121, 0.12) 100%);
    border: 1px solid rgba(255, 232, 168, 0.40);
    color: rgba(255, 250, 232, 1);
    overflow: visible;
    text-shadow: 0 1px 12px rgba(255, 210, 140, 0.30);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.35) inset,
        0 -1px 0 rgba(80, 50, 20, 0.25) inset,
        0 10px 22px rgba(0, 0, 0, 0.32),
        0 2px 6px rgba(0, 0, 0, 0.20),
        0 0 18px rgba(255, 210, 140, 0.10);
}
.ba-starmap-btn:hover:not(:disabled),
.ba-share-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg,
        rgba(255, 238, 180, 0.30) 0%,
        rgba(232, 200, 121, 0.20) 100%);
    border-color: rgba(255, 245, 200, 0.65);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.50) inset,
        0 -1px 0 rgba(80, 50, 20, 0.25) inset,
        0 14px 30px rgba(0, 0, 0, 0.38),
        0 3px 8px rgba(0, 0, 0, 0.25),
        0 0 24px rgba(255, 210, 140, 0.20);
}
.ba-starmap-btn:disabled {
    opacity: 0.45;
    cursor: wait;
}

/* Reset — low-emphasis neutral glass */
.ba-reset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(220, 212, 196, 0.65);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 -1px 0 rgba(0, 0, 0, 0.14) inset,
        0 6px 14px rgba(0, 0, 0, 0.22);
}
.ba-reset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(248, 240, 222, 0.95);
}

/* ═══ COUPLES SECTION ═══ */
.ba-couples-toggle {
    display: block;
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 232, 168, 0.20);
    color: rgba(232, 200, 121, 0.85);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.10) inset,
        0 -1px 0 rgba(0, 0, 0, 0.14) inset,
        0 8px 18px rgba(0, 0, 0, 0.24);
}
.ba-couples-toggle:hover {
    background: rgba(255, 232, 168, 0.08);
    border-color: rgba(255, 232, 168, 0.45);
    color: rgba(255, 250, 232, 1);
    transform: translateY(-1px);
}
.ba-couples-form {
    margin-top: 16px;
    padding: 20px;
    background: var(--ba-glass);
    border: 1px solid var(--ba-glass-border);
    border-radius: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ═══ PURCHASE MODAL TIERS ═══ */
.ba-purchase-tiers {
    display: flex;
    gap: 10px;
    margin: 20px 0 16px;
    justify-content: center;
}
.ba-purchase-tier {
    flex: 1;
    max-width: 160px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.ba-purchase-tier:hover {
    border-color: var(--ba-gold-dim);
    background: rgba(200, 212, 230, 0.04);
}
.ba-purchase-tier.featured {
    border-color: rgba(200, 212, 230, 0.25);
    background: rgba(200, 212, 230, 0.04);
}
.ba-purchase-tier-name {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: var(--ba-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.ba-purchase-tier-price {
    font-family: var(--ba-display);
    font-size: 1.3rem;
    color: var(--ba-gold);
    margin-bottom: 4px;
}
.ba-purchase-tier-desc {
    font-family: var(--ba-mono);
    font-size: 0.45rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
}
.ba-purchase-or {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    color: var(--ba-text-muted);
    text-align: center;
    margin-bottom: 16px;
}
.ba-purchase-sheet {
    max-width: 560px;
}
@media (max-width: 480px) {
    .ba-purchase-tiers {
        flex-direction: column;
        align-items: center;
    }
    .ba-purchase-tier {
        max-width: 100%;
        width: 100%;
    }
}

.ba-gates-link {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ba-gold);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.ba-gates-link:hover { opacity: 1; }

/* ═══ SCROLL MODE OVERRIDES FOR RESULT PHASE ═══ */
#ba-result-phase.ba-active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#ba-result-phase.ba-active::-webkit-scrollbar {
    display: none;
}

/* ═══ MICRO BURNING STARS — Info triggers ═══ */
.ba-info-star {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 2;
    will-change: transform, box-shadow;
    /* Blue-white star (131Å default) */
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.95),
        0 0 5px 2px rgba(160, 212, 255, 0.7),
        0 0 10px 3px rgba(100, 180, 255, 0.35),
        0 0 18px 5px rgba(100, 180, 255, 0.15);
    animation: ba-star-burn-blue 4s ease-in-out infinite;
}
/* Gold star (193Å) — every 2nd card */
.ba-result-card:nth-child(2n) .ba-info-star {
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.95),
        0 0 5px 2px rgba(200, 212, 230, 0.7),
        0 0 10px 3px rgba(200, 212, 230, 0.35),
        0 0 18px 5px rgba(200, 212, 230, 0.15);
    animation-name: ba-star-burn-gold;
}
/* White-hot star — every 3rd card */
.ba-result-card:nth-child(3n) .ba-info-star {
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.95),
        0 0 5px 2px rgba(220, 230, 255, 0.7),
        0 0 10px 3px rgba(200, 215, 240, 0.4),
        0 0 18px 5px rgba(200, 215, 240, 0.18);
    animation-name: ba-star-burn-white;
}
/* Stagger so they don't pulse in sync */
.ba-result-card:nth-child(1) .ba-info-star { animation-delay: 0s; }
.ba-result-card:nth-child(2) .ba-info-star { animation-delay: 0.7s; }
.ba-result-card:nth-child(3) .ba-info-star { animation-delay: 1.4s; }
.ba-result-card:nth-child(4) .ba-info-star { animation-delay: 0.3s; }
.ba-result-card:nth-child(5) .ba-info-star { animation-delay: 1.1s; }
.ba-result-card:nth-child(6) .ba-info-star { animation-delay: 1.8s; }

@keyframes ba-star-burn-blue {
    0%, 100% {
        box-shadow:
            0 0 2px 1px rgba(255, 255, 255, 0.95),
            0 0 5px 2px rgba(160, 212, 255, 0.7),
            0 0 10px 3px rgba(100, 180, 255, 0.35),
            0 0 18px 5px rgba(100, 180, 255, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 3px 1px rgba(255, 255, 255, 1),
            0 0 7px 3px rgba(160, 212, 255, 0.85),
            0 0 14px 4px rgba(100, 180, 255, 0.45),
            0 0 24px 6px rgba(100, 180, 255, 0.2);
        transform: scale(1.15);
    }
}
@keyframes ba-star-burn-gold {
    0%, 100% {
        box-shadow:
            0 0 2px 1px rgba(255, 255, 255, 0.95),
            0 0 5px 2px rgba(200, 212, 230, 0.7),
            0 0 10px 3px rgba(200, 212, 230, 0.35),
            0 0 18px 5px rgba(200, 212, 230, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 3px 1px rgba(255, 255, 255, 1),
            0 0 7px 3px rgba(200, 212, 230, 0.85),
            0 0 14px 4px rgba(200, 212, 230, 0.45),
            0 0 24px 6px rgba(200, 212, 230, 0.2);
        transform: scale(1.15);
    }
}
@keyframes ba-star-burn-white {
    0%, 100% {
        box-shadow:
            0 0 2px 1px rgba(255, 255, 255, 0.95),
            0 0 5px 2px rgba(220, 230, 255, 0.7),
            0 0 10px 3px rgba(200, 215, 240, 0.4),
            0 0 18px 5px rgba(200, 215, 240, 0.18);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 3px 1px rgba(255, 255, 255, 1),
            0 0 7px 3px rgba(220, 230, 255, 0.85),
            0 0 14px 4px rgba(200, 215, 240, 0.5),
            0 0 24px 6px rgba(200, 215, 240, 0.25);
        transform: scale(1.15);
    }
}

.ba-info-star:hover {
    transform: scale(1.6) !important;
    box-shadow:
        0 0 3px 2px rgba(255, 255, 255, 1),
        0 0 8px 3px rgba(160, 212, 255, 0.9),
        0 0 16px 5px rgba(100, 180, 255, 0.5),
        0 0 28px 8px rgba(100, 180, 255, 0.25) !important;
}
.ba-result-card:nth-child(2n) .ba-info-star:hover {
    box-shadow:
        0 0 3px 2px rgba(255, 255, 255, 1),
        0 0 8px 3px rgba(200, 212, 230, 0.9),
        0 0 16px 5px rgba(200, 212, 230, 0.5),
        0 0 28px 8px rgba(200, 212, 230, 0.25) !important;
}

/* Inline star variant — smaller, next to labels */
.ba-info-star-inline {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.9),
        0 0 4px 2px rgba(200, 212, 230, 0.6),
        0 0 8px 2px rgba(200, 212, 230, 0.25);
    animation: ba-star-burn-gold 5s ease-in-out infinite;
}
.ba-info-star-inline:nth-of-type(2n) {
    animation-name: ba-star-burn-blue;
    animation-delay: 0.5s;
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.9),
        0 0 4px 2px rgba(100, 180, 255, 0.6),
        0 0 8px 2px rgba(100, 180, 255, 0.25);
}

.ba-result-card {
    position: relative;
}

/* ═══ ZODIAC SVG SYMBOLS ═══ */
.ba-zodiac-svg {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.12em;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══ INFO MODAL — Flies in from deep space ═══ */
.ba-info-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.ba-info-modal.ba-active {
    pointer-events: auto;
    opacity: 1;
}
.ba-info-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.35) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ba-info-sheet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transform-origin: center center;
    max-width: 520px;
    width: calc(100% - 32px);
    max-height: calc(100dvh - 32px - var(--ba-safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(8, 10, 20, 0.96);
    border: 1px solid rgba(200, 212, 230, 0.1);
    border-radius: 12px;
    padding: 24px 20px 22px;
    opacity: 0;
    transition:
        transform 0.55s cubic-bezier(0.16, 1.11, 0.36, 1),
        opacity 0.35s ease;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 40px rgba(100, 180, 255, 0.06),
        0 0 80px rgba(0, 0, 0, 0.4),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
}
@media (min-width: 768px) {
    .ba-info-sheet {
        width: calc(100% - 48px);
        padding: 32px 32px 28px;
    }
}
.ba-info-modal.ba-active .ba-info-sheet {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
/* Tiny star at top center of modal — like the star that spawned it */
.ba-info-sheet::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 0 3px 1px rgba(255, 255, 255, 0.9),
        0 0 8px 2px rgba(200, 212, 230, 0.6),
        0 0 16px 4px rgba(200, 212, 230, 0.2);
}
.ba-info-title {
    font-family: var(--ba-display);
    font-size: 1.05rem;
    letter-spacing: 0.18em;
    color: var(--ba-gold);
    margin-bottom: 14px;
    text-shadow: 0 0 24px rgba(200, 212, 230, 0.35);
    text-align: center;
}
.ba-info-body {
    font-family: var(--ba-serif);
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}
.ba-info-close {
    display: block;
    margin: 24px auto 0;
    min-height: var(--ba-tap);
    padding: 10px 28px;
    background: transparent;
    border: 1px solid rgba(200, 212, 230, 0.15);
    border-radius: 4px;
    color: rgba(200, 212, 230, 0.6);
    font-family: var(--ba-mono);
    font-size: 0.62rem;
    letter-spacing: 0.3em;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ba-info-close:hover {
    border-color: var(--ba-gold);
    color: var(--ba-gold);
    box-shadow: 0 0 16px rgba(200, 212, 230, 0.15);
}
@media (max-width: 480px) {
    .ba-info-sheet {
        width: calc(100% - 32px);
        padding: 24px 20px 22px;
    }
    .ba-info-body {
        font-size: 0.85rem;
    }
}

/* ═══ RESPONSIVE — SCROLL MODE ═══ */
@media (max-width: 768px) {
    .ba-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ba-hebrew-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .ba-hebrew-row {
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }
    .ba-guide-card {
        flex-direction: column;
        text-align: center;
    }
    .ba-result-scroll .ba-guide-cta {
        align-self: center;
    }
    .ba-result-scroll {
        padding: 100px 16px 40px;
    }
}

@media (max-width: 480px) {
    .ba-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .ba-hebrew-char {
        font-size: 3rem;
    }
    .ba-result-scroll {
        padding: 90px 12px 32px;
    }
}

/* ═══ SHARE OVERLAY ═══ */
.ba-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.ba-share-overlay.ba-active {
    opacity: 1;
    pointer-events: all;
}
.ba-share-inner {
    text-align: center;
    max-width: 90vw;
}
#ba-share-canvas {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.ba-share-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.ba-share-action-btn {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--ba-text);
    min-height: var(--ba-tap);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ba-share-action-btn:hover {
    border-color: var(--ba-gold);
    color: var(--ba-gold);
}
.ba-share-close {
    color: var(--ba-text-muted);
}
/* Share overlay mobile layout — buttons stack, canvas respects safe area */
@media (max-width: 560px) {
    .ba-share-inner {
        max-width: 100vw;
        padding: 16px;
        box-sizing: border-box;
    }
    #ba-share-canvas {
        max-height: 60vh;
    }
    .ba-share-actions {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: var(--ba-safe-bottom);
    }
    .ba-share-action-btn {
        flex: 1 1 40%;
        padding: 10px 14px;
    }
}

/* ═══ SCROLLBAR (for autocomplete dropdown) ═══ */
.ba-city-dropdown::-webkit-scrollbar {
    width: 4px;
}
.ba-city-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.ba-city-dropdown::-webkit-scrollbar-thumb {
    background: rgba(200, 212, 230, 0.2);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════
   PLANETARIUM HUD — glass panels at screen edges
   ═══════════════════════════════════════════════════════ */
.ba-hud {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}
#ba-result-phase.ba-active .ba-hud {
    opacity: 1;
}

.ba-hud-panel {
    position: absolute;
    background: rgba(8, 10, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    pointer-events: auto;
    z-index: 21;
}
.ba-hud-tl { top: 56px; left: 14px; }
.ba-hud-tr { top: 56px; right: 14px; text-align: right; }
.ba-hud-bl { bottom: 64px; left: 14px; }
.ba-hud-br { bottom: 64px; right: 14px; display: flex; gap: 8px; }

.ba-hud-date {
    font-family: var(--ba-display);
    font-size: 0.7rem;
    color: rgba(200, 212, 230, 0.7);
    letter-spacing: 0.12em;
}
.ba-hud-location {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    color: var(--ba-text-muted);
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.ba-hud-item {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: rgba(228, 220, 200, 0.7);
    line-height: 1.6;
}
.ba-hud-symbol {
    font-size: 0.85rem;
    margin-right: 4px;
}

.ba-hud-guide-num {
    font-family: var(--ba-display);
    font-size: 1.4rem;
    color: var(--ba-gold);
    line-height: 1;
    text-shadow: 0 0 16px rgba(200, 212, 230, 0.3);
}
.ba-hud-guide-name {
    font-family: var(--ba-display);
    font-size: 0.6rem;
    color: rgba(200, 212, 230, 0.5);
    letter-spacing: 0.18em;
    margin-top: 2px;
}

/* HUD Buttons */
.ba-hud-btn {
    background: rgba(200, 212, 230, 0.06);
    border: 1px solid rgba(200, 212, 230, 0.15);
    border-radius: 6px;
    color: rgba(200, 212, 230, 0.6);
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.ba-hud-btn:hover {
    background: rgba(200, 212, 230, 0.12);
    color: var(--ba-gold);
    border-color: rgba(200, 212, 230, 0.3);
}

/* ═══ Layer Toggle Controls ═══ */
.ba-hud-controls {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}
.ba-ctrl {
    min-width: 72px;
    height: 36px;
    padding: 0 12px;
    background: rgba(20, 22, 32, 0.8);
    border: 1px solid rgba(200, 212, 230, 0.35);
    border-radius: 18px;
    color: rgba(228, 220, 200, 0.75);
    font-family: var(--ba-mono, 'JetBrains Mono', monospace);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}
.ba-ctrl .ba-ctrl-label {
    display: inline-block;
    text-transform: uppercase;
}
.ba-ctrl svg {
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.15s;
}
.ba-ctrl.active {
    color: #f5e8b8;
    border-color: rgba(200, 212, 230, 0.9);
    background: rgba(200, 212, 230, 0.18);
    box-shadow: 0 0 12px rgba(200, 212, 230, 0.35), inset 0 0 8px rgba(200, 212, 230, 0.1);
}
.ba-ctrl.active svg {
    opacity: 1;
    color: #f5e8b8;
}
.ba-ctrl:hover {
    border-color: rgba(200, 212, 230, 0.7);
    background: rgba(200, 212, 230, 0.1);
    color: #f5e8b8;
}
.ba-ctrl:hover svg {
    opacity: 0.9;
}

/* ═══ SKY INFO PANEL (click-to-inspect) ═══ */
.ba-sky-info {
    position: fixed;
    z-index: 25;
    background: rgba(8, 10, 18, 0.85);
    border: 1px solid rgba(200, 212, 230, 0.15);
    border-left: 3px solid rgba(200, 212, 230, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 160px;
    max-width: 240px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s, transform 0.2s;
}
.ba-sky-info.visible {
    opacity: 1;
    transform: scale(1);
}
.ba-sky-info-name {
    font-family: var(--ba-display);
    font-size: 0.75rem;
    color: var(--ba-gold);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.ba-sky-info-body {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    color: rgba(228, 220, 200, 0.6);
    line-height: 1.6;
}

/* ═══ REPORT PANEL (slide-in sidebar) ═══ */
.ba-report-panel {
    position: fixed;
    top: 0;
    right: -400px;
    bottom: 0;
    width: 380px;
    background: rgba(8, 10, 18, 0.94);
    border-left: 1px solid rgba(200, 212, 230, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 30;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    pointer-events: auto;
    scrollbar-width: none;
}
.ba-report-panel::-webkit-scrollbar { display: none; }
.ba-report-panel.open {
    right: 0;
}
.ba-report-close {
    position: sticky;
    top: 8px;
    float: right;
    margin: 8px 12px 0 0;
    width: var(--ba-tap);
    height: var(--ba-tap);
    background: none;
    border: none;
    color: rgba(200, 212, 230, 0.4);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 31;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ba-report-close:hover { color: var(--ba-gold); }

/* Override result-scroll inside report panel */
.ba-report-panel .ba-result-scroll {
    position: relative;
    max-width: 100%;
    padding: 48px 20px calc(40px + var(--ba-safe-bottom));
    overflow: visible;
}

/* ═══ TABLET + LAPTOP: refined single-row bottom bar ═══ */
@media (max-width: 1280px) {
    .ba-hud-panel { padding: 8px 12px; }

    /* Top-right trio — clear of page-orb (which sits at right:14 width:64) */
    .ba-hud-tr {
        top: 58px;
        right: 90px;
        background: rgba(8, 10, 18, 0.88);
        border: 1px solid rgba(200, 212, 230, 0.18);
        padding: 10px 14px;
        min-width: 140px;
        max-width: 180px;
        white-space: nowrap;
    }
    .ba-hud-item {
        font-size: 0.58rem;
        letter-spacing: 0.08em;
        color: rgba(232, 220, 184, 0.82);
        line-height: 1.75;
        white-space: nowrap;
    }
    .ba-hud-symbol { color: var(--ba-gold); opacity: 0.95; }

    /* BL guide — refined gold pill */
    .ba-hud-bl {
        bottom: 70px;
        left: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: rgba(8, 10, 18, 0.88);
        border: 1px solid rgba(200, 212, 230, 0.18);
    }
    .ba-hud-guide-num {
        font-size: 1.35rem;
        line-height: 1;
        text-shadow: 0 0 14px rgba(200, 212, 230, 0.35);
    }
    .ba-hud-guide-name {
        font-size: 0.52rem;
        margin-top: 0;
        letter-spacing: 0.22em;
        color: rgba(200, 212, 230, 0.7);
    }

    /* BR action pills — clear of page-orb */
    .ba-hud-br {
        bottom: 70px;
        right: 110px;
        padding: 0;
        gap: 5px;
        background: transparent;
        border: none;
        flex-wrap: nowrap;
        max-width: none;
    }
    .ba-hud-btn {
        font-size: 0.45rem;
        padding: 6px 7px;
        letter-spacing: 0.06em;
        background: rgba(8, 10, 18, 0.88);
        border: 1px solid rgba(200, 212, 230, 0.22);
        color: rgba(200, 212, 230, 0.75);
        white-space: nowrap;
        transition: all 0.2s ease;
    }
    .ba-hud-btn:hover {
        background: rgba(200, 212, 230, 0.12);
        border-color: rgba(200, 212, 230, 0.45);
        color: var(--ba-gold);
    }

    /* Layer toggles — refined with gold accent, no blur */
    .ba-hud-controls { bottom: 70px; gap: 5px; }
    .ba-ctrl {
        width: 32px;
        height: 32px;
        background: rgba(8, 10, 18, 0.88);
        border: 1px solid rgba(200, 212, 230, 0.15);
        color: rgba(200, 212, 230, 0.5);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .ba-ctrl.active {
        color: var(--ba-gold);
        border-color: rgba(200, 212, 230, 0.5);
        background: rgba(200, 212, 230, 0.1);
        box-shadow: 0 0 10px rgba(200, 212, 230, 0.2);
    }
    .ba-ctrl:hover {
        border-color: rgba(200, 212, 230, 0.4);
        color: rgba(200, 212, 230, 0.8);
    }
}

/* ═══ NARROW TABLET / PORTRAIT (≤900px) — stack controls above HUD row ═══ */
@media (max-width: 900px) {
    /* Trio moves to TOP-LEFT below date panel to avoid collision */
    .ba-hud-tr {
        top: 115px;
        right: auto;
        left: 16px;
        text-align: left;
    }
    /* Layer toggles sit ABOVE the BR pills on a separate row */
    .ba-hud-controls { bottom: 110px; }
    /* Shift action pills back to right:16 since no page-orb on this page */
    .ba-hud-br { right: 16px; }
}

/* ═══ MOBILE HUD ADJUSTMENTS ═══ */
@media (max-width: 640px) {
    .ba-hud-tl, .ba-hud-tr { top: 48px; }
    .ba-hud-date { font-size: 0.6rem; }
    .ba-hud-item { font-size: 0.58rem; }
    .ba-hud-btn { font-size: 0.48rem; padding: 4px 7px; }
    .ba-ctrl { width: 30px; height: 30px; font-size: 0.7rem; }

    /* Stack: controls center, BL left, BR right — all at bottom:10 */
    .ba-hud-bl { bottom: 10px; left: 10px; }
    .ba-hud-br { bottom: 10px; right: 10px; }
    .ba-hud-controls { bottom: 10px; }

    .ba-report-panel { width: 100%; right: -100%; }
    .ba-report-panel .ba-result-scroll { padding: 48px 14px 32px; }
}
@media (max-width: 380px) {
    .ba-hud-tr { display: none; }
    .ba-hud-br .ba-hud-btn:not(:first-child):not(:last-child) { display: none; }
}

/* ═══════════════════════════════════════════════════════
   INVITE LANDING OVERLAY
   ═══════════════════════════════════════════════════════ */
.ba-invite-overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.ba-invite-overlay.ba-active {
    pointer-events: auto;
    opacity: 1;
}

.ba-invite-card {
    background: rgba(8, 10, 18, 0.8);
    border: 1px solid rgba(200, 212, 230, 0.12);
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(200, 212, 230, 0.03);
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.16, 1.11, 0.36, 1);
}
.ba-invite-overlay.ba-active .ba-invite-card {
    transform: scale(1);
}

.ba-invite-header {
    font-family: var(--ba-display);
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    color: var(--ba-gold);
    letter-spacing: 0.06em;
    line-height: 1.4;
    margin-bottom: 8px;
}

.ba-invite-info {
    font-family: var(--ba-mono);
    font-size: 0.65rem;
    color: var(--ba-text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.ba-invite-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 212, 230, 0.3), transparent);
    margin: 0 auto 16px;
}

.ba-invite-prompt {
    font-family: var(--ba-serif);
    font-size: 1rem;
    color: var(--ba-text);
    margin-bottom: 20px;
    font-style: italic;
}

.ba-invite-form .ba-field {
    margin-bottom: 12px;
    text-align: left;
}
.ba-invite-form .ba-input-field {
    font-size: 16px; /* Prevent iOS zoom */
}

/* ═══════════════════════════════════════════════════════
   SYNASTRY SUMMARY PANEL (bottom sheet)
   ═══════════════════════════════════════════════════════ */
.ba-synastry-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 55vh;
    background: rgba(8, 10, 18, 0.94);
    border-top: 1px solid rgba(200, 212, 230, 0.08);
    border-radius: 16px 16px 0 0;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 28;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px calc(32px + var(--ba-safe-bottom));
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    scrollbar-width: none;
    pointer-events: none;
}
.ba-synastry-panel::-webkit-scrollbar { display: none; }
.ba-synastry-panel.open {
    transform: translateY(0);
    pointer-events: auto;
}

.ba-synastry-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: var(--ba-tap);
    height: var(--ba-tap);
    background: none;
    border: none;
    color: rgba(200, 212, 230, 0.4);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 29;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Harmony score */
.ba-syn-score {
    text-align: center;
    margin-bottom: 20px;
}
.ba-syn-score-num {
    font-family: var(--ba-display);
    font-size: 2.5rem;
    color: var(--ba-gold);
    text-shadow: 0 0 24px rgba(200, 212, 230, 0.3);
    line-height: 1;
}
.ba-syn-score-label {
    font-family: var(--ba-display);
    font-size: 0.7rem;
    color: rgba(200, 212, 230, 0.6);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 4px;
}
.ba-syn-score-detail {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    color: var(--ba-text-muted);
    margin-top: 6px;
}

/* Aspect list */
.ba-syn-aspects {
    margin-bottom: 20px;
}
.ba-syn-aspect {
    margin-bottom: 14px;
}
.ba-syn-aspect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--ba-gold);
    padding-left: 10px;
    margin-bottom: 4px;
}
.ba-syn-aspect-bodies {
    font-family: var(--ba-display);
    font-size: 0.75rem;
    color: var(--ba-text);
    letter-spacing: 0.06em;
}
.ba-syn-aspect-orb {
    font-family: var(--ba-mono);
    font-size: 0.55rem;
    color: var(--ba-text-muted);
}
.ba-syn-aspect-text {
    font-size: 0.75rem;
    color: rgba(224, 216, 200, 0.55);
    line-height: 1.6;
    padding-left: 13px;
}

/* Element balance */
.ba-syn-elements {
    margin-bottom: 16px;
}
.ba-syn-elements-title {
    font-family: var(--ba-display);
    font-size: 0.6rem;
    color: rgba(200, 212, 230, 0.5);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.ba-syn-el-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ba-syn-el-name {
    font-family: var(--ba-mono);
    font-size: 0.6rem;
    width: 40px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ba-syn-el-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ba-syn-el-bar {
    height: 4px;
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* Partner HUD items (rose) */
.ba-hud-partner {
    color: rgba(232, 140, 165, 0.8) !important;
}
.ba-hud-divider {
    width: 100%;
    height: 1px;
    background: rgba(200, 212, 230, 0.1);
    margin: 4px 0;
}

@media (max-width: 640px) {
    .ba-invite-card { padding: 28px 20px; }
    .ba-synastry-panel { max-height: 65vh; padding: 20px 16px 24px; }
    .ba-syn-score-num { font-size: 2rem; }
}

/* ═══════════════════════════════════════════════
   SKY RESONANCE PANEL — "Your Sky Tonight"
   ═══════════════════════════════════════════════ */
.ba-resonance-panel {
    position: fixed;
    right: -380px;
    top: 0;
    width: 360px;
    height: 100vh;
    background: rgba(4, 6, 12, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(200, 212, 230, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 90;
    padding: 24px 20px 40px;
    transition: right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 212, 230,0.15) transparent;
}
.ba-resonance-panel.open {
    right: 0;
}
.ba-resonance-panel::-webkit-scrollbar { width: 4px; }
.ba-resonance-panel::-webkit-scrollbar-thumb { background: rgba(200, 212, 230,0.15); border-radius: 2px; }

.ba-res-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 8px;
}
.ba-res-title {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: rgba(200, 212, 230, 0.6);
    margin-bottom: 6px;
}
.ba-res-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(228, 230, 237, 0.35);
    letter-spacing: 0.03em;
}

/* Score ring */
.ba-res-score {
    text-align: center;
    margin-bottom: 24px;
}
.ba-res-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 8px;
    display: block;
}
.ba-res-label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(228, 230, 237, 0.5);
    text-transform: uppercase;
}

/* Breakdown bars */
.ba-res-breakdown {
    margin-bottom: 24px;
    padding: 0 4px;
}
.ba-res-body {
    display: grid;
    grid-template-columns: 60px 1fr 36px;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    position: relative;
}
.ba-res-body-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.ba-res-body-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}
.ba-res-body-fill {
    height: 100%;
    border-radius: 2px;
    opacity: 0.65;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ba-res-body-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    color: rgba(228, 230, 237, 0.4);
    text-align: right;
}
.ba-res-body-tag {
    position: absolute;
    right: -4px;
    top: -2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.4rem;
    letter-spacing: 0.15em;
    color: #c8d4e6;
    background: rgba(200, 212, 230, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(200, 212, 230, 0.15);
}

/* Translation cards */
.ba-res-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.ba-res-card {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.015);
    border-left: 2px solid rgba(200, 212, 230, 0.3);
    border-radius: 0 6px 6px 0;
}
.ba-res-card-head {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    color: rgba(228, 230, 237, 0.85);
    margin-bottom: 4px;
    line-height: 1.3;
}
.ba-res-card-body {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: rgba(228, 230, 237, 0.4);
    line-height: 1.5;
}

/* Upcoming events */
.ba-res-upcoming {
    margin-bottom: 20px;
}
.ba-res-upcoming-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    color: rgba(200, 212, 230, 0.35);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(200, 212, 230, 0.06);
}
.ba-res-event {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    align-items: baseline;
}
.ba-res-event-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    min-width: 50px;
}
.ba-res-event-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    color: rgba(228, 230, 237, 0.55);
    line-height: 1.3;
}

/* Verify link */
.ba-res-verify {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.ba-res-verify-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    color: rgba(200, 212, 230, 0.3);
    text-decoration: none;
    letter-spacing: 0.08em;
    transition: color 0.2s;
}
.ba-res-verify-link:hover {
    color: rgba(200, 212, 230, 0.6);
}

/* Mobile resonance panel */
@media (max-width: 768px) {
    .ba-resonance-panel {
        width: 100%;
        right: -100%;
        max-height: 80vh;
        top: auto;
        bottom: 0;
        height: auto;
        border-left: none;
        border-top: 1px solid rgba(200, 212, 230, 0.08);
        border-radius: 16px 16px 0 0;
        padding: 20px 16px 32px;
    }
    .ba-resonance-panel.open {
        right: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CINEMATIC READING — 7-act ritual overlay + unified bottom bar
   ═══════════════════════════════════════════════════════════════ */

/* Reading stage — full viewport overlay, vignette, stars bleed through.
   z-index sits above unified-nav (10000) so SKIP isn't clipped by the navbar. */
.ba-reading-stage {
    position: fixed;
    inset: 0;
    z-index: 10100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.78) 70%,
        rgba(0, 0, 0, 0.92) 100%);
    transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

/* While the ritual plays, fade the unified nav out of the way so
   the experience is fullscreen and SKIP is never clipped. */
body.ba-cinematic-playing #unified-nav,
body.ba-cinematic-playing .unified-nav {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease;
}
.ba-reading-stage.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.8s ease, visibility 0s linear 0s;
}
/* When dimmed (post-ritual backdrop only), let clicks through to the
   canvas underneath. The cardbox + skip button explicitly take their own
   pointer-events back via specific rules. */
.ba-reading-stage.active.dimmed {
    pointer-events: none;
}
.ba-reading-stage.active.dimmed .ba-reading-cardbox,
.ba-reading-stage.active.dimmed .ba-reading-skip,
.ba-reading-stage.active.dimmed button,
.ba-reading-stage.active.dimmed a {
    pointer-events: auto;
}
.ba-reading-stage.dimmed {
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.55) 70%,
        rgba(0, 0, 0, 0.8) 100%);
}

/* Skip button — always visible in top-right during cinematic */
.ba-reading-skip {
    position: absolute;
    top: clamp(14px, 3vw, 28px);
    right: clamp(14px, 3vw, 28px);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(200, 212, 230, 0.25);
    color: rgba(232, 220, 200, 0.7);
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    z-index: 2;
}
.ba-reading-skip:hover {
    color: rgba(232, 220, 200, 1);
    border-color: rgba(200, 212, 230, 0.6);
    background: rgba(0, 0, 0, 0.7);
}

/* Card container — flex center, one card at a time */
.ba-reading-cardbox {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: clamp(20px, 4vw, 48px);
    text-align: center;
    z-index: 1;
}

/* Reading card — fades in with translateY, holds, fades out */
.ba-reading-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    max-width: min(880px, 92vw);
    color: rgba(232, 220, 200, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
}
.ba-reading-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.ba-reading-card.leaving {
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Typography system — Cinzel for authority, Cormorant for breath */
.reading-name {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.4rem, 6.5vw, 5rem);
    letter-spacing: 0.3em;
    color: rgba(232, 220, 200, 1);
    font-weight: 500;
    text-shadow: 0 0 40px rgba(200, 212, 230, 0.15);
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
}
.reading-date {
    font-family: 'Cinzel', serif;
    font-size: clamp(1rem, 2.2vw, 1.6rem);
    letter-spacing: 0.4em;
    color: rgba(232, 220, 200, 0.75);
    text-transform: uppercase;
    font-weight: 400;
    margin: 0;
}
.reading-location {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.8rem, 1.6vw, 1.15rem);
    letter-spacing: 0.3em;
    color: rgba(232, 220, 200, 0.55);
    text-transform: uppercase;
    font-weight: 400;
    margin: 0;
}
.reading-symbol {
    font-size: clamp(3rem, 8vw, 6rem);
    color: #c8d4e6;
    text-shadow: 0 0 40px rgba(200, 212, 230, 0.5), 0 0 80px rgba(200, 212, 230, 0.2);
    line-height: 1;
    margin: 0;
}
/* SVG-glyph variant — refined hand-tuned strokes, NOT the unicode font.
   Ignore the font-size from .reading-symbol; SVG handles its own sizing. */
.reading-symbol.reading-glyph {
    font-size: 0;            /* nuke any text whitespace from the parent */
    line-height: 0;
    color: rgba(212, 175, 55, 0.92);
    text-shadow: none;
    margin: 0 0 0.2em 0;
    display: flex;
    justify-content: center;
}
.reading-glyph .ba-zodiac-glyph {
    width: clamp(48px, 6.5vw, 72px);
    height: clamp(48px, 6.5vw, 72px);
    filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.35))
            drop-shadow(0 0 36px rgba(212, 175, 55, 0.18));
}
.reading-position {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.4rem, 3.6vw, 2.8rem);
    letter-spacing: 0.2em;
    color: rgba(232, 220, 200, 0.95);
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
}
.reading-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(0.95rem, 1.7vw, 1.3rem);
    color: rgba(232, 220, 200, 0.72);
    max-width: 620px;
    line-height: 1.55;
    font-weight: 400;
    margin: 0;
}
.reading-whisper {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(0.85rem, 1.3vw, 1.05rem);
    color: rgba(232, 220, 200, 0.55);
    letter-spacing: 0.05em;
    max-width: 520px;
    line-height: 1.5;
    margin: 0;
}
.reading-large-num {
    font-family: 'Cinzel', serif;
    font-size: clamp(4.5rem, 12vw, 8.5rem);
    color: #c8d4e6;
    font-weight: 600;
    line-height: 1;
    text-shadow: 0 0 60px rgba(200, 212, 230, 0.4), 0 0 120px rgba(200, 212, 230, 0.15);
    margin: 0;
}
.reading-entity {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.1rem, 2.4vw, 2rem);
    letter-spacing: 0.35em;
    color: rgba(232, 220, 200, 0.9);
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
}
.reading-hebrew-char {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-size: clamp(4rem, 10vw, 7rem);
    color: #c8d4e6;
    line-height: 1;
    text-shadow: 0 0 60px rgba(200, 212, 230, 0.35);
    direction: rtl;
    margin: 0;
}
.reading-monuments {
    display: flex;
    gap: clamp(16px, 4vw, 48px);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}
.reading-monument {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.7rem, 1.3vw, 1rem);
    letter-spacing: 0.2em;
    color: rgba(232, 220, 200, 0.8);
    text-transform: uppercase;
    padding: 10px 16px;
    border-top: 1px solid rgba(200, 212, 230, 0.25);
    border-bottom: 1px solid rgba(200, 212, 230, 0.25);
}

/* Act-specific vignettes / tints */
.ba-reading-stage[data-act="invocation"] { background: rgba(0, 0, 0, 0.95); }
.ba-reading-stage[data-act="sky-opens"] {
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 80%);
}
.ba-reading-stage[data-act="luminaries"],
.ba-reading-stage[data-act="stellar-axis"] {
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.72) 80%);
}
.ba-reading-stage[data-act="guide"] {
    background: radial-gradient(ellipse at center,
        rgba(30, 20, 50, 0.5) 0%, rgba(0, 0, 0, 0.9) 80%);
}

/* Reduced motion — instant fades, no camera pan (JS-gated) */
@media (prefers-reduced-motion: reduce) {
    .ba-reading-card,
    .ba-reading-stage {
        transition: opacity 0.2s linear !important;
    }
    .ba-reading-card { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   PLANETARIUM DOCK — Liquid Glass result-phase HUD chrome
   ───────────────────────────────────────────────────────────────
   Three independent floating clusters at the bottom of the sky map:

     LAYER CLUSTER        ┌─ MAIN DOCK ──────────────────────────┐
     (.ba-bar-center)     │  date · guide │ Sky Reading │ ··· … │
     bottom-left          └──────────────────────────────────────┘
                          (.ba-bottom-bar — centered, fixed width)

   Vocabulary copied from /js/onboarding.js .ob-btn / .ob-skip-fixed:
     • backdrop-filter: blur(20px) saturate(1.5)   — glass material
     • ::before specular w/ 17px 17px 40% 40% / 17px 17px 100% 100%
       border-radius — the "lens" curve along the upper rim
     • inset 1px highlights + outer drop shadow for depth separation
     • gold underglow (::after) ONLY on the primary CTA

   No tactical corners. No clip-paths. No monospace caps in primary
   buttons. Single dominant gold story = the Sky Reading button.
   ═══════════════════════════════════════════════════════════════ */

/* Local custom-property scope so themes can tune the dock without
   leaking into the rest of the page. */
:root {
    /* Slightly more opaque than the splash because the result-phase
       canvas can be very dark — we still want the dock readable. */
    --dock-glass-bg:       rgba(18, 22, 34, 0.62);
    --dock-glass-bg-hover: rgba(28, 34, 48, 0.72);
    --dock-glass-border:   rgba(232, 220, 200, 0.22);
    --dock-glass-border-hover: rgba(232, 220, 200, 0.42);
    --dock-text:           rgba(238, 232, 218, 0.92);
    --dock-text-dim:       rgba(220, 212, 196, 0.62);
    --dock-text-faint:     rgba(200, 194, 180, 0.42);
    --dock-gold:           rgba(232, 200, 121, 0.95);
    --dock-gold-bright:    rgba(255, 245, 210, 1);
    --dock-gold-tint:      rgba(232, 200, 121, 0.14);
    --dock-gold-tint-h:    rgba(232, 200, 121, 0.22);
    --dock-gold-edge:      rgba(255, 232, 168, 0.45);
    --dock-radius:         18px;
    --dock-pill-radius:    14px;
    --dock-ease:           cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ MAIN DOCK ═══════════════════════════════════════════════════ */
/* The central planetarium console. One Liquid Glass slab, single row,
   centered, never wider than 760px. */
.ba-bottom-bar {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(10px);
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    padding: 8px 14px 8px 18px;
    /* inline-flex hugs its content. max-width caps the dock so long
       guide names can't push the right edge past the viewport. */
    max-width: min(820px, calc(100vw - 32px));

    background: var(--dock-glass-bg);
    border: 1px solid var(--dock-glass-border);
    border-radius: var(--dock-radius);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 -1px 0 rgba(0, 0, 0, 0.22) inset,
        0 14px 32px rgba(0, 0, 0, 0.42),
        0 3px 8px rgba(0, 0, 0, 0.28);

    color: var(--dock-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    z-index: 30;
    isolation: isolate;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s var(--dock-ease);
    pointer-events: none;
}
@supports (padding: max(0px)) {
    .ba-bottom-bar {
        bottom: max(22px, calc(18px + var(--ba-safe-bottom)));
    }
}
.ba-bottom-bar.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Top-edge specular highlight — the Liquid Glass "lens" curve */
.ba-bottom-bar::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius:
        17px 17px 40% 40% / 17px 17px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: -1;
}

/* ═══ LEFT SIDE — date pill + guide chip ═══ */
.ba-bar-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-weight: 400;
    color: var(--dock-text);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
}

/* Date + location: clickable edit button with engraved feel.
   Sentence case via Cormorant — but the JS hands us monospace caps,
   so we tame the letter-spacing and rely on the serif glyphs. */
.ba-bar-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--dock-text);
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s var(--dock-ease);
    min-height: 30px;
    -webkit-tap-highlight-color: transparent;
}
.ba-bar-edit-text {
    /* JS sends "JUNE 15, 1980 · NEW YORK, US" in caps. We re-cast it as
       small-caps — the serif voice — so it reads like a museum label,
       not a stock-ticker. */
    text-transform: lowercase;
    font-variant: small-caps;
    font-feature-settings: "smcp" 1, "c2sc" 1;
    letter-spacing: 0.06em;
}
.ba-bar-edit-icon {
    color: var(--dock-text-faint);
    font-size: 0.78em;
    transition: color 0.3s var(--dock-ease);
}
.ba-bar-edit:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--dock-glass-border-hover);
    color: var(--dock-gold-bright);
}
.ba-bar-edit:hover .ba-bar-edit-icon {
    color: var(--dock-gold);
}

/* Separator between date pill and guide chip */
.ba-bar-left .ba-bar-sep {
    color: var(--dock-text-faint);
    font-size: 0.7rem;
    user-select: none;
}

/* GUIDE chip — slightly recessed, gold-toned text */
.ba-bar-left .ba-bar-guide {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border: 1px solid rgba(232, 200, 121, 0.22);
    border-radius: 999px;
    background: rgba(232, 200, 121, 0.06);
    color: var(--dock-gold);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
}

/* Vertical hairline between the left cluster and the actions cluster */
.ba-bottom-bar > .ba-bar-left::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 22px;
    margin-left: 14px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--dock-glass-border) 50%,
        transparent 100%);
    align-self: center;
}

/* ═══ RIGHT SIDE — Sky Reading primary + secondary actions ═══ */
.ba-bar-right {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

/* PRIMARY — the Sky Reading CTA (always the .replay button, first child).
   This is the gold story. Liquid Glass with warm tint, top specular,
   underglow. Sentence-case Cormorant serif — never monospace caps. */
.ba-bar-right .ba-bar-btn.replay,
#ba-bar-replay {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 9px 18px;
    margin-right: 6px;
    border: 1px solid var(--dock-gold-edge);
    border-radius: var(--dock-pill-radius);
    background: linear-gradient(180deg,
        rgba(255, 228, 150, 0.20) 0%,
        rgba(232, 200, 121, 0.12) 100%);
    color: var(--dock-gold-bright);
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 1px 12px rgba(255, 210, 140, 0.32);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.40) inset,
        0 -1px 0 rgba(80, 50, 20, 0.30) inset,
        0 0 0 1px rgba(255, 232, 168, 0.08) inset,
        0 8px 22px rgba(0, 0, 0, 0.40),
        0 2px 6px rgba(0, 0, 0, 0.25),
        0 0 18px rgba(255, 210, 140, 0.10);
    transition: all 0.3s var(--dock-ease);
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
}
/* Top-edge specular highlight on the Sky Reading CTA */
.ba-bar-right .ba-bar-btn.replay::before,
#ba-bar-replay::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius:
        13px 13px 40% 40% / 13px 13px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 245, 210, 0.22) 0%,
        rgba(255, 228, 150, 0.04) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: -1;
}
/* Bottom-edge underglow on the Sky Reading CTA */
.ba-bar-right .ba-bar-btn.replay::after,
#ba-bar-replay::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -3px;
    height: 9px;
    background: radial-gradient(ellipse at center,
        rgba(255, 210, 140, 0.42) 0%,
        rgba(255, 180, 90, 0.16) 40%,
        transparent 75%);
    filter: blur(5px);
    opacity: 0.65;
    pointer-events: none;
    transition: all 0.4s var(--dock-ease);
    z-index: -2;
}
.ba-bar-right .ba-bar-btn.replay:hover:not(:disabled),
#ba-bar-replay:hover:not(:disabled) {
    background: linear-gradient(180deg,
        rgba(255, 238, 180, 0.30) 0%,
        rgba(232, 200, 121, 0.20) 100%);
    border-color: rgba(255, 245, 200, 0.65);
    color: rgba(255, 250, 238, 1);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 250, 228, 0.55) inset,
        0 -1px 0 rgba(80, 50, 20, 0.30) inset,
        0 0 0 1px rgba(255, 232, 168, 0.15) inset,
        0 12px 30px rgba(0, 0, 0, 0.46),
        0 3px 8px rgba(0, 0, 0, 0.28),
        0 0 26px rgba(255, 210, 140, 0.20);
}
.ba-bar-right .ba-bar-btn.replay:hover:not(:disabled)::after,
#ba-bar-replay:hover:not(:disabled)::after {
    opacity: 1;
    bottom: -5px;
    left: 6%; right: 6%;
    height: 12px;
}
.ba-bar-right .ba-bar-btn.replay:disabled,
#ba-bar-replay:disabled {
    cursor: default;
    opacity: 0.86;
}
/* Pulse the icon when generation is in progress */
#ba-bar-replay[data-state="loading"],
#ba-bar-replay[data-state="pending"] {
    color: rgba(255, 245, 210, 0.85);
}
#ba-bar-replay .ba-replay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1em;
    font-size: 0.92em;
    color: rgba(255, 232, 168, 0.92);
    transform: translateY(-1px);
}
#ba-bar-replay .ba-replay-label {
    /* JS may still send caps for legacy states — soften with kerning */
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    color: inherit;
}

/* SECONDARY ACTIONS — Invite · Report · Share · New
   Smaller neutral glass pills, lower emphasis. */
.ba-bar-right .ba-hud-btn,
.ba-bar-right .ba-bar-btn:not(.replay) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    margin: 0;
    min-width: 0;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--dock-text-dim);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s var(--dock-ease);
    -webkit-tap-highlight-color: transparent;
}
.ba-bar-right .ba-hud-btn:hover,
.ba-bar-right .ba-bar-btn:not(.replay):hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--dock-glass-border-hover);
    color: var(--dock-text);
}

/* ═══ LAYER CLUSTER ═══════════════════════════════════════════════ */
/* The Stars / Names / Zodiac / Horizon toggles. Lifted out of the
   main dock and re-anchored bottom-LEFT as their own small Liquid
   Glass pill — they are layer toggles, not actions, so they earn
   their own physical group. */
.ba-bar-center {
    position: fixed;
    left: 22px;
    bottom: 22px;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 5px;

    background: var(--dock-glass-bg);
    border: 1px solid var(--dock-glass-border);
    border-radius: 999px;
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 -1px 0 rgba(0, 0, 0, 0.20) inset,
        0 8px 22px rgba(0, 0, 0, 0.34),
        0 2px 5px rgba(0, 0, 0, 0.22);

    z-index: 29;
    isolation: isolate;
    /* Match the dock's reveal animation */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease 0.05s, transform 0.7s var(--dock-ease) 0.05s;
    pointer-events: none;
}
@supports (padding: max(0px)) {
    .ba-bar-center {
        bottom: max(22px, calc(18px + var(--ba-safe-bottom)));
        left: max(22px, env(safe-area-inset-left, 22px));
    }
}
.ba-bottom-bar.visible ~ .ba-bar-center,
.ba-bar-center.visible {
    /* JS toggles `.visible` on the dock; we mirror it via sibling combinator
       when layouts allow, plus an explicit class as a belt-and-suspenders. */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
/* Belt-and-suspenders: when the dock's visible class lands, also reveal
   the layer cluster regardless of DOM order. */
.ba-bottom-bar.visible + * .ba-bar-center,
body:has(.ba-bottom-bar.visible) .ba-bar-center {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Top-edge specular on the layer cluster */
.ba-bar-center::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 60%;
    border-radius: 999px 999px 40% 40% / 999px 999px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: -1;
}

/* Individual toggle chip — icon-only (smaller "satellite" cluster).
   The user reads this group as instrument switches, not buttons —
   icons are enough, with full names exposed via the title tooltip. */
.ba-bar-center .ba-ctrl {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--dock-text-dim);
    cursor: pointer;
    transition: all 0.25s var(--dock-ease);
    -webkit-tap-highlight-color: transparent;
}
.ba-bar-center .ba-ctrl svg {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}
.ba-bar-center .ba-ctrl .ba-ctrl-label {
    /* Hidden by default — exposed as a tooltip on hover via ::after */
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Hover tooltip — pulled from the label text via JS-set title attr is
   already present on each .ba-ctrl, so we lean on that for accessibility
   while the visual toggle stays a small dot. */
.ba-bar-center .ba-ctrl:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--dock-glass-border-hover);
    color: var(--dock-text);
}
.ba-bar-center .ba-ctrl.active {
    background: rgba(232, 200, 121, 0.10);
    border-color: rgba(232, 200, 121, 0.32);
    color: var(--dock-gold);
}
.ba-bar-center .ba-ctrl.active svg {
    color: var(--dock-gold);
}

/* (Layer chips are icon-only at all viewports — no special mobile rule
    needed; titles carry meaning for screen readers and hover tooltips.) */

/* ═══ MOBILE (≤640px) — stack: dock above, layer cluster centered ═══ */
@media (max-width: 640px) {
    .ba-bottom-bar {
        left: 12px;
        right: 12px;
        bottom: 16px;
        transform: translateX(0) translateY(10px);
        width: auto;
        max-width: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 16px;
    }
    .ba-bottom-bar.visible {
        transform: translateX(0) translateY(0);
    }
    .ba-bar-left {
        order: 1;
        flex: 1 1 100%;
        justify-content: center;
        gap: 8px;
        white-space: normal;
    }
    /* Hide the inline hairline divider on mobile — the wrap handles separation */
    .ba-bottom-bar > .ba-bar-left::after {
        display: none;
    }
    .ba-bar-edit {
        font-size: 0.84rem;
        padding: 5px 10px;
    }
    .ba-bar-left .ba-bar-guide {
        font-size: 0.56rem;
        padding: 4px 9px;
        letter-spacing: 0.16em;
    }
    .ba-bar-left .ba-bar-sep { display: none; }

    .ba-bar-right {
        order: 2;
        flex: 0 0 100%;
        justify-content: center;
        gap: 4px;
    }
    .ba-bar-right .ba-bar-btn.replay,
    #ba-bar-replay {
        font-size: 0.92rem;
        padding: 8px 14px;
        margin-right: 0;
    }
    .ba-bar-right .ba-hud-btn,
    .ba-bar-right .ba-bar-btn:not(.replay) {
        font-size: 0.66rem;
        padding: 6px 10px;
        min-height: 30px;
    }

    /* Layer cluster moves to bottom-center, ABOVE the dock so it doesn't
       crowd the home indicator on iPhones. */
    .ba-bar-center {
        left: 50%;
        right: auto;
        bottom: auto;
        top: max(60px, calc(var(--ba-nav-h, 44px) + 12px));
        transform: translateX(-50%) translateY(0);
        padding: 4px;
    }
    .ba-bottom-bar.visible ~ .ba-bar-center,
    .ba-bar-center.visible,
    body:has(.ba-bottom-bar.visible) .ba-bar-center {
        transform: translateX(-50%) translateY(0);
    }
}

/* ═══ ULTRA-NARROW (≤380px) — collapse secondary action labels ═══ */
@media (max-width: 380px) {
    /* Keep the Sky Reading CTA full, but tighten secondary buttons */
    .ba-bar-right .ba-hud-btn,
    .ba-bar-right .ba-bar-btn:not(.replay) {
        padding: 6px 8px;
        font-size: 0.62rem;
    }
}

/* ═══ HIDE THE LEGACY 4-CORNER HUD ═══
   Once cinematic finishes, .ba-hud--retired hides the original panels.
   Keep this rule explicit so the legacy markup stays inert. */
.ba-hud.ba-hud--retired {
    display: none !important;
}

/* ═══ CINEMATIC SKIP BUTTON — Liquid Glass match for splash ob-skip-fixed ═══
   Reading-stage skip pill, top-right of viewport. Mirrors onboarding.js
   .ob-skip-fixed for visual continuity. */
.ba-reading-skip {
    position: fixed;
    top: clamp(14px, 3vw, 28px);
    right: clamp(14px, 3vw, 28px);
    z-index: 1002;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 232, 168, 0.16);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    color: rgba(248, 240, 222, 0.7);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;

    cursor: pointer;
    transition: all 0.35s var(--dock-ease);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 -1px 0 rgba(0, 0, 0, 0.18) inset,
        0 6px 14px rgba(0, 0, 0, 0.28),
        0 1px 3px rgba(0, 0, 0, 0.18);
    isolation: isolate;
}
.ba-reading-skip::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 50%;
    border-radius: 13px 13px 40% 40% / 13px 13px 100% 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.35s ease;
    z-index: -1;
}
.ba-reading-skip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 232, 168, 0.38);
    color: rgba(255, 250, 232, 0.98);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.24) inset,
        0 -1px 0 rgba(0, 0, 0, 0.18) inset,
        0 10px 22px rgba(0, 0, 0, 0.34),
        0 2px 5px rgba(0, 0, 0, 0.22),
        0 0 18px rgba(255, 210, 140, 0.10);
}
.ba-reading-skip:hover::before { opacity: 1; }

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    .ba-bottom-bar,
    .ba-bar-center,
    .ba-reading-skip {
        transition: opacity 0.2s linear !important;
        transform: translateX(-50%) !important;
    }
    .ba-bottom-bar.visible {
        transform: translateX(-50%) !important;
    }
    @media (max-width: 640px) {
        .ba-bottom-bar,
        .ba-bottom-bar.visible {
            transform: none !important;
        }
        .ba-bar-center,
        .ba-bar-center.visible {
            transform: translateX(-50%) !important;
        }
    }
}

/* ═══ JS-driven REPLAY-BUTTON state styles ═══
   compass-cinematic.js injects a small <style> tag with #ba-bar-replay
   data-state animations. We add a fallback mirror here so the dock
   never goes unstyled if that injection fails. */
@keyframes baDockReplaySpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes baDockReplayPulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}
#ba-bar-replay[data-state="loading"] .ba-replay-icon,
#ba-bar-replay[data-state="pending"] .ba-replay-icon {
    animation: baDockReplaySpin 1.2s linear infinite;
}
#ba-bar-replay[data-state="playing"] .ba-replay-icon {
    animation: baDockReplayPulse 2.4s ease-in-out infinite;
}
