/* ==========================================================================
   JYOTISHYA — Mobile-First Redesign
   Cosmic glassmorphism theme. Universal appeal. WCAG AA accessible.
   ========================================================================== */

/* Design Tokens ---------------------------------------------------------------- */
:root {
    /* Cosmic palette — universal, gender-neutral, accessible */
    --bg-deep: #07071a;
    --bg-mid: #110d2e;
    --bg-soft: #1a1138;

    /* Surfaces */
    --card-bg: rgba(28, 22, 56, 0.55);
    --card-bg-strong: rgba(28, 22, 56, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.16);

    /* Text — WCAG AAA on dark backgrounds */
    --text-primary: #ffffff;
    --text-secondary: #c8c8e0;
    --text-tertiary: #8888a8;

    /* Brand accents */
    --gold: #f6d365;
    --gold-hot: #fda085;
    --gold-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --purple: #c084fc;
    --purple-strong: #a855f7;
    --pink: #f472b6;
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;

    /* Glow orbs (ambient depth) */
    --glow-1: rgba(168, 85, 247, 0.18);
    --glow-2: rgba(246, 211, 101, 0.15);
    --glow-3: rgba(244, 114, 182, 0.13);

    /* Sizing */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    /* Layout */
    --max-width: 1440px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-10: 56px;

    /* Type scale (modular, mobile-first) */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 1.875rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 2.75rem;
    --fs-hero: 3rem;

    /* Effects */
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --shadow-elevated: 0 16px 48px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 30px rgba(246, 211, 101, 0.25);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Safe areas for mobile */
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 768px) {
    :root {
        --fs-hero: 4rem;
        --fs-4xl: 3.25rem;
        --fs-3xl: 2.75rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --fs-hero: 4.75rem;
    }
}

/* Reset & globals -------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at top, var(--bg-mid) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, var(--bg-soft) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-deep) 0%, #050514 100%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--fs-base);
    padding-bottom: var(--safe-bottom);
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Utility --------------------------------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 10000;
    background: var(--gold);
    color: var(--bg-deep);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 8px;
}

.hidden { display: none !important; }

/* Cosmic background ----------------------------------------------------------- */
.cosmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.cosmos-stars {
    position: absolute;
    inset: -50%;
    background-image:
        radial-gradient(1px 1px at 25px 5px, #fff, transparent),
        radial-gradient(1px 1px at 50px 25px, #fff, transparent),
        radial-gradient(1px 1px at 125px 20px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 50px 75px, #ffd, transparent),
        radial-gradient(1px 1px at 15px 125px, #fff, transparent),
        radial-gradient(2px 2px at 110px 80px, #fff, transparent),
        radial-gradient(1px 1px at 200px 100px, #fff, transparent);
    background-repeat: repeat;
    background-size: 250px 200px;
    opacity: 0.5;
    animation: starDrift 240s linear infinite;
}

@keyframes starDrift {
    from { transform: translate(0, 0); }
    to { transform: translate(-250px, -200px); }
}

.cosmos-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.7;
    will-change: transform;
}

.cosmos-orb-1 {
    width: 380px; height: 380px;
    background: var(--glow-1);
    top: -10%; left: -10%;
    animation: orbFloat 22s ease-in-out infinite;
}
.cosmos-orb-2 {
    width: 460px; height: 460px;
    background: var(--glow-2);
    bottom: -15%; right: -15%;
    animation: orbFloat 28s ease-in-out infinite reverse;
}
.cosmos-orb-3 {
    width: 320px; height: 320px;
    background: var(--glow-3);
    top: 40%; right: 20%;
    animation: orbFloat 26s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .cosmos-stars,
    .cosmos-orb {
        animation: none !important;
    }
}

/* TOP NAVIGATION -------------------------------------------------------------- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(7, 7, 26, 0.7);
    border-bottom: 1px solid var(--card-border);
    padding-top: var(--safe-top);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.logo-mark {
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(246, 211, 101, 0.4));
}

.logo-text {
    font-size: var(--fs-lg);
    letter-spacing: 0.5px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.status-pill.online {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.status-pill.offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    position: relative;
}

.status-pill.online .status-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.8); opacity: 0; }
}

.lang-select-wrap {
    position: relative;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 8px 32px 8px 12px;
    border-radius: 100px;
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.lang-select option {
    background-color: var(--bg-mid);
    color: var(--text-primary);
}

/* TRUST BANNER ---------------------------------------------------------------- */
.trust-banner {
    background: linear-gradient(90deg,
        rgba(246, 211, 101, 0.08),
        rgba(168, 85, 247, 0.08),
        rgba(246, 211, 101, 0.08));
    border-bottom: 1px solid var(--card-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.trust-banner::-webkit-scrollbar { display: none; }

.trust-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    white-space: nowrap;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.trust-item svg {
    color: var(--success);
    flex-shrink: 0;
}

.trust-divider {
    width: 1px;
    height: 14px;
    background: var(--card-border);
}

@media (max-width: 480px) {
    .trust-banner-inner {
        gap: var(--space-3);
        font-size: var(--fs-xs);
    }
}

/* MAIN LAYOUT ----------------------------------------------------------------- */
.page {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-4);
    padding-bottom: 120px;
}

/* HERO SECTION ---------------------------------------------------------------- */
.hero {
    padding: var(--space-7) 0 var(--space-8);
    text-align: center;
    animation: fadeInUp 0.7s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-hero);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: var(--space-4);
}

.hero-title-line1 {
    display: block;
    color: var(--text-primary);
}

.hero-title-line2 {
    display: block;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 4px 20px rgba(246, 211, 101, 0.3));
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: var(--fs-md);
    max-width: 600px;
    margin: 0 auto var(--space-7);
    line-height: 1.6;
}

.hero-cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

@media (min-width: 480px) {
    .hero-cta-group {
        flex-direction: row;
        justify-content: center;
    }
}

/* Buttons --------------------------------------------------------------------- */
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border-radius: 100px;
    transition: all var(--transition);
    text-decoration: none;
    min-height: 48px;
    padding: 14px 28px;
    font-size: var(--fs-base);
}

.btn-primary {
    background: var(--gold-gradient);
    color: #1a0b20;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(246, 211, 101, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-xl {
    font-size: var(--fs-lg);
    padding: 18px 40px;
    min-height: 56px;
}

.btn-block {
    width: 100%;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
}

.btn-sm {
    font-size: var(--fs-sm);
    padding: 10px 18px;
    min-height: 40px;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: scale(1.05);
}

.btn-icon { flex-shrink: 0; }

.btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hero stats ------------------------------------------------------------------ */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-7);
    margin-bottom: var(--space-7);
    flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-3xl);
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero examples (animated prompts) -------------------------------------------- */
.hero-examples { margin-top: var(--space-7); }

.hero-examples-label {
    color: var(--text-tertiary);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--space-3);
}

.hero-examples-track {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-3);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hero-examples-track::-webkit-scrollbar { display: none; }

.example-chip {
    flex-shrink: 0;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    animation: slideIn 0.4s ease-out backwards;
}

.example-chip:nth-child(2) { animation-delay: 0.1s; }
.example-chip:nth-child(3) { animation-delay: 0.2s; }
.example-chip:nth-child(4) { animation-delay: 0.3s; }
.example-chip:nth-child(5) { animation-delay: 0.4s; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* APP SHELL ------------------------------------------------------------------- */
.app-shell {
    padding-top: var(--space-5);
    animation: fadeInUp 0.5s ease-out;
}

/* Stepper (mobile only) ------------------------------------------------------ */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--space-5);
    padding: 0 var(--space-4);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
    transition: color var(--transition);
}

.step.active, .step.completed {
    color: var(--gold);
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-sm);
    transition: all var(--transition);
}

.step.active .step-num {
    background: var(--gold-gradient);
    color: var(--bg-deep);
    border-color: transparent;
    transform: scale(1.1);
}

.step.completed .step-num {
    background: var(--success);
    color: white;
    border-color: transparent;
}

.step-label {
    font-size: var(--fs-xs);
    font-weight: 600;
}

.step-line {
    flex: 0 1 60px;
    height: 2px;
    background: var(--card-border);
    margin: 0 -8px 24px -8px;
    position: relative;
    overflow: hidden;
}

.step-line.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold-gradient);
}

@media (min-width: 1024px) {
    .stepper { display: none; }
}

/* Shell grid (responsive) ----------------------------------------------------- */
.shell-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .shell-grid {
        grid-template-columns: 1fr 1fr;
    }
    .shell-col-chat {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .shell-grid {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) minmax(320px, 420px);
        gap: var(--space-5);
    }
    .shell-col-chat {
        grid-column: auto;
        position: sticky;
        top: calc(72px + var(--safe-top));
        align-self: start;
        max-height: calc(100vh - 88px - var(--safe-top));
    }
}

.shell-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

/* GLASS CARD ------------------------------------------------------------------ */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition);
}

.glass-card:hover {
    border-color: var(--card-border-hover);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: -0.3px;
}

.card-title svg {
    color: var(--gold);
    flex-shrink: 0;
}

.card-subtitle {
    color: var(--text-tertiary);
    font-size: var(--fs-sm);
    margin-top: 4px;
}

/* FORM ------------------------------------------------------------------------ */
.birth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

@media (max-width: 380px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: var(--fs-base);
    transition: all var(--transition);
    min-height: 48px;
    width: 100%;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 40px;
}

.form-group select option {
    background-color: var(--bg-mid);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(246, 211, 101, 0.15);
    outline: none;
}

/* Date input dark theme */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Advanced toggle */
.advanced-toggle {
    border-radius: var(--radius);
    overflow: hidden;
}

.advanced-toggle summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--fs-sm);
    list-style: none;
    user-select: none;
}

.advanced-toggle summary::-webkit-details-marker { display: none; }

.advanced-toggle summary:hover {
    color: var(--text-primary);
}

.advanced-toggle summary svg {
    transition: transform var(--transition);
}

.advanced-toggle[open] summary svg {
    transform: rotate(45deg);
}

.advanced-body {
    padding: var(--space-3) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-top: 1px solid var(--card-border);
    animation: fadeInUp 0.3s ease-out;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.checkbox-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    cursor: pointer;
}

.custom-coords-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    border: 1px dashed var(--card-border);
}

/* DASHA CARD ------------------------------------------------------------------ */
.dasha-display {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
}

.dasha-period {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dasha-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 1.2px;
}

.dasha-lord {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-2xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.dasha-dates {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
}

.dasha-remaining {
    font-size: var(--fs-xs);
    color: var(--gold);
    font-weight: 600;
}

.dasha-divider {
    width: 1px;
    height: 50px;
    background: linear-gradient(180deg, transparent, var(--card-border-hover), transparent);
}

@media (max-width: 480px) {
    .dasha-display {
        flex-direction: column;
        gap: var(--space-3);
    }
    .dasha-divider {
        width: 100%;
        height: 1px;
    }
}

/* CHART CARDS ----------------------------------------------------------------- */
.charts-card {
    overflow: hidden;
}

.share-row {
    display: flex;
    gap: var(--space-2);
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
    .charts-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-5);
    }
}

.chart-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-header {
    font-family: 'Outfit', sans-serif;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* South Indian Chart Grid */
.south-indian-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.12);
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.chart-cell {
    background: rgba(8, 8, 22, 0.85);
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
    min-height: 70px;
    box-sizing: border-box;
}

.sign-label {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.cell-planets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    width: 100%;
    margin-top: auto;
}

.planet-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    white-space: nowrap;
}

.planet-tag.lagna {
    background: rgba(246, 211, 101, 0.18);
    color: var(--gold);
    border: 1px solid rgba(246, 211, 101, 0.4);
}
.planet-tag.nodes {
    background: rgba(192, 132, 252, 0.18);
    color: var(--purple);
}

.chart-cell.center-cell {
    grid-row: 2 / 4;
    grid-column: 2 / 4;
    background: radial-gradient(circle, rgba(28, 22, 56, 0.95), rgba(8, 8, 22, 0.98));
    border: 1px solid rgba(246, 211, 101, 0.15);
    justify-content: center;
}

.center-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
    text-align: center;
}

.center-info {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    text-align: center;
}

/* Legend */
.legend-card {
    margin: var(--space-4) 0;
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
}

.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.legend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.legend-icon.lagna { background: rgba(246, 211, 101, 0.18); color: var(--gold); }
.legend-icon.sun { background: rgba(253, 150, 68, 0.18); color: #fd9644; }
.legend-icon.moon { background: rgba(96, 165, 250, 0.18); color: #60a5fa; }
.legend-icon.mars { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.legend-icon.mercury { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.legend-icon.jupiter { background: rgba(250, 204, 21, 0.18); color: #fbbf24; }
.legend-icon.venus { background: rgba(236, 72, 153, 0.18); color: #f472b6; }
.legend-icon.saturn { background: rgba(168, 85, 247, 0.18); color: var(--purple); }
.legend-icon.nodes { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }

/* Planetary table */
.placements-details {
    margin-top: var(--space-3);
    border-top: 1px solid var(--card-border);
    padding-top: var(--space-3);
}

.placements-details summary {
    cursor: pointer;
    padding: var(--space-2) 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--fs-sm);
    list-style: none;
    user-select: none;
}

.placements-details summary::-webkit-details-marker { display: none; }
.placements-details summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform var(--transition);
}
.placements-details[open] summary::before {
    transform: rotate(90deg);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: var(--space-3);
    border-radius: var(--radius);
}

.planetary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.planetary-table th {
    padding: 10px 12px;
    text-align: left;
    background: rgba(168, 85, 247, 0.1);
    color: var(--purple);
    font-weight: 700;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.planetary-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.planetary-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* CHAT CARD ------------------------------------------------------------------- */
.chat-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(192, 132, 252, 0.18) !important;
    background: linear-gradient(180deg,
        rgba(28, 22, 56, 0.55) 0%,
        rgba(28, 22, 56, 0.7) 100%);
    overflow: hidden;
}

.chat-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(192, 132, 252, 0.15);
    font-size: var(--fs-xs);
    color: var(--purple);
    font-weight: 600;
}

.counter-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 320px;
    max-height: 50vh;
    scroll-behavior: smooth;
}

@media (min-width: 1024px) {
    .chat-messages {
        min-height: 380px;
        max-height: calc(100vh - 480px);
    }
}

@media (max-width: 1023px) {
    .chat-messages {
        min-height: 240px;
        max-height: 360px;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Message bubbles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 92%;
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: var(--fs-sm);
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
}

.message-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding: 0 6px;
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    padding: 0 6px;
    opacity: 0;
    transition: opacity var(--transition);
}

.message:hover .message-actions,
.message.assistant:focus-within .message-actions {
    opacity: 1;
}

.message-actions button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.message-actions button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.message-actions button.copied {
    color: var(--success);
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 16px;
    margin: 0 var(--space-3) var(--space-2);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    align-self: flex-start;
    max-width: 92%;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: bounceDot 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: -0.32s; }

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-text {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    font-style: italic;
}

/* Quick prompt chips with category tabs */
.quick-prompts {
    padding: var(--space-3);
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
}

.prompt-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
}
.prompt-tabs::-webkit-scrollbar { display: none; }

.prompt-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.prompt-tab.active {
    background: rgba(246, 211, 101, 0.12);
    color: var(--gold);
    border-color: rgba(246, 211, 101, 0.3);
}

.prompt-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.prompt-chip {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    line-height: 1.3;
}

.prompt-chip:hover {
    background: rgba(168, 85, 247, 0.12);
    color: var(--text-primary);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

/* Chat form */
.chat-form {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 100px;
    font-size: var(--fs-sm);
    resize: none;
    transition: all var(--transition);
    min-height: 44px;
    max-height: 120px;
    width: 100%;
    line-height: 1.5;
    font-family: inherit;
}

#chat-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(246, 211, 101, 0.12);
}

#chat-input::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    flex-shrink: 0;
    background: var(--gold-gradient);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(246, 211, 101, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(246, 211, 101, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-disclaimer {
    text-align: center;
    padding: var(--space-2) var(--space-3) var(--space-3);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.2);
}

/* FAB (Floating Action Buttons) ---------------------------------------------- */
.fab {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    right: 16px;
    z-index: 90;
    background: var(--gold-gradient);
    color: var(--bg-deep);
    padding: 14px 22px;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(246, 211, 101, 0.4);
    transition: all var(--transition);
    animation: fabSlide 0.4s ease-out;
}

@keyframes fabSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 32px rgba(246, 211, 101, 0.5);
}

.fab-secondary {
    background: var(--card-bg-strong);
    color: var(--gold);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(246, 211, 101, 0.3);
    padding: 14px;
    width: 56px;
    height: 56px;
    justify-content: center;
}

.fab-secondary span {
    display: none;
}

#mobile-ask-fab {
    left: 16px;
    right: auto;
}

@media (min-width: 1024px) {
    #mobile-ask-fab { display: none !important; }
}

@media (min-width: 768px) {
    #share-fab { padding: 14px 24px; }
}

/* TOAST ------------------------------------------------------------------------ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 1000;
    background: var(--card-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border-hover);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 100px;
    font-size: var(--fs-sm);
    font-weight: 500;
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - 32px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--success); color: #34d399; }
.toast.error { border-color: var(--danger); color: #f87171; }

/* MODAL ------------------------------------------------------------------------ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: var(--space-5);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-4);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}

@media (max-width: 380px) {
    .share-options { grid-template-columns: repeat(2, 1fr); }
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: var(--fs-xs);
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
}

.share-btn svg {
    color: var(--gold);
}

/* FOOTER ----------------------------------------------------------------------- */
.footer {
    margin-top: var(--space-10);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--text-primary);
}

.footer-tagline {
    color: var(--text-tertiary);
    font-size: var(--fs-sm);
}

.footer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
}

.footer-pill {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-radius: 100px;
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ACCESSIBILITY ENHANCEMENTS -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --card-border: rgba(255, 255, 255, 0.25);
        --text-secondary: #e0e0f0;
        --text-tertiary: #b8b8d0;
    }
}

/* Forced colors (Windows High Contrast) */
@media (forced-colors: active) {
    .glass-card { border: 1px solid CanvasText; }
    .btn-primary { border: 2px solid CanvasText; }
}

/* Tablet (768px - 1023px) refinements */
@media (min-width: 768px) and (max-width: 1023px) {
    .shell-grid {
        grid-template-columns: 380px 1fr;
    }
    .shell-col-chat {
        grid-column: 1 / -1;
        order: 3;
    }
}

/* Desktop chat column sticky behavior ---------------------------------------- */
@media (min-width: 1024px) {
    .shell-col-chat {
        max-height: calc(100vh - 88px - var(--safe-top));
        overflow-y: auto;
    }
    .shell-col-chat .glass-card {
        position: sticky;
        top: calc(72px + var(--safe-top));
    }
}

/* Large screens (1440px+) */
@media (min-width: 1440px) {
    .shell-grid {
        gap: var(--space-6);
    }
}

/* Very small screens (< 360px) */
@media (max-width: 360px) {
    :root {
        --fs-hero: 2.4rem;
        --fs-3xl: 1.7rem;
    }
    .btn-xl { padding: 14px 28px; font-size: var(--fs-base); }
    .glass-card { padding: var(--space-4); }
}
