/* Vedic Astrology — UI design system */
/* Fonts load from header.php (preconnect + non-blocking) to avoid CSS @import delay */

:root {
    /* Matched to logo: sun gold, ray saffron, teal disc, pearl plate */
    color-scheme: light;
    --bg-deep: #eef5f5;
    --bg-panel: #fffcf8;
    --bg-elevated: #f3ebe1;
    --bg-input: #ffffff;
    --border: rgba(20, 55, 58, 0.12);
    --border-strong: rgba(20, 55, 58, 0.22);
    --border-gold: rgba(245, 179, 32, 0.32);
    --text: #14202b;
    --text-muted: #3a4a56;
    --text-dim: #5a6874;
    /* Logo sun gold — titles, eyebrows, active nav */
    --gold: #f5b320;
    --gold-soft: rgba(245, 179, 32, 0.14);
    /* Logo ray orange — CTAs only */
    --saffron: #e8880c;
    --saffron-soft: rgba(232, 136, 12, 0.15);
    /* Logo teal disc — links, focus, secondary actions */
    --accent: #008080;
    --accent-soft: rgba(0, 128, 128, 0.12);
    --accent-deep: #006666;
    --success: #1b7340;
    --danger: #b83434;
    --warning: #a34b08;
    --ink-on-gold: #1a1208;
    --header-bg: rgba(255, 252, 248, 0.95);
    --drawer-bg: #fffcf8;
    --toolbar-bg: rgba(255, 252, 248, 0.97);
    --overlay-scrim: rgba(12, 40, 44, 0.4);
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(20, 55, 58, 0.04), 0 3px 10px rgba(20, 55, 58, 0.04);
    --shadow: 0 2px 4px rgba(20, 55, 58, 0.035), 0 12px 28px rgba(20, 55, 58, 0.07);
    --shadow-lg: 0 4px 10px rgba(20, 55, 58, 0.045), 0 18px 40px rgba(20, 55, 58, 0.08);
    --ring-gold: 0 0 0 3px rgba(245, 179, 32, 0.2);
    --ring-accent: 0 0 0 3px rgba(0, 128, 128, 0.22);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-ui: 'Outfit', system-ui, sans-serif;
    --nav-width: 220px;
    --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 8rem);
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 85% 50% at 10% -8%, rgba(245, 179, 32, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 45% at 94% 0%, rgba(0, 128, 128, 0.14), transparent 52%),
        linear-gradient(180deg, #f7fbfb 0%, #eef5f5 48%, #e8f0f0 100%);
    min-height: 100vh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 0.18em; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 200;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--saffron), #d07008);
    color: var(--ink-on-gold);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.75rem;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    border-bottom: 1px solid var(--border);
    box-shadow:
        0 1px 0 rgba(255, 252, 247, 0.85) inset,
        0 10px 28px rgba(42, 58, 72, 0.045);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 4%, rgba(245, 179, 32, 0.45) 28%, rgba(0, 128, 128, 0.36) 72%, transparent 96%);
    pointer-events: none;
}

.header-inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-back-link {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(0, 77, 77, 0.72);
    text-decoration: none;
    white-space: nowrap;
}

.site-back-link:hover {
    color: var(--teal, #008080);
    text-decoration: none;
}

/* Chart output — keep header compact; only tab bar sticks (not the full toolbar card) */
body.page-chart-results .site-header {
    box-shadow:
        0 1px 0 rgba(255, 252, 247, 0.85) inset,
        0 6px 18px rgba(42, 58, 72, 0.04);
}

body.page-chart-results .brand-sub {
    display: none;
}

@media (min-width: 901px) and (max-width: 1180px) {
    body.page-chart-results .primary-nav .nav-cluster-label {
        display: none;
    }

    body.page-chart-results .nav-link {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    padding: 0.2rem 0;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1.5px rgba(0, 128, 128, 0.35), 0 2px 10px rgba(245, 179, 32, 0.2);
    transition: transform 0.25s var(--ease-out);
}

.brand:hover .brand-mark {
    transform: scale(1.04);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.05;
    color: var(--text);
}

.brand-sub {
    font-family: var(--font-ui);
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.nav-cluster-label {
    display: none;
}

.nav-cluster--drawer-only {
    display: none;
}

.nav-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 0;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    transition: color 0.18s var(--ease-out);
}

.nav-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    opacity: 0.88;
    color: currentColor;
}

.nav-link:hover .nav-icon,
.nav-link:focus-visible .nav-icon,
.nav-link[aria-current="page"] .nav-icon,
.nav-link.is-current .nav-icon {
    opacity: 1;
}

.nav-link-text {
    line-height: 1.2;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text);
    text-decoration: none;
    outline: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.35rem;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.18s var(--ease-out);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    background: rgba(245, 179, 32, 0.35);
}

.nav-link[aria-current="page"],
.nav-link.is-current {
    color: var(--gold);
}

.nav-link[aria-current="page"]::after,
.nav-link.is-current::after {
    background: var(--gold);
}

.nav-item--dropdown {
    position: relative;
}

.nav-dropdown-trigger .nav-chevron {
    transition: transform 0.2s var(--ease-out);
    opacity: 0.7;
}

.nav-item--dropdown.is-open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 15.5rem;
    padding: 0.45rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 120;
    display: grid;
    gap: 0.15rem;
}

.nav-dropdown[hidden] {
    display: none !important;
}

.nav-dropdown a {
    display: grid;
    grid-template-columns: 1.35rem 1fr;
    gap: 0.55rem 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    min-height: 44px;
    align-items: center;
}

.nav-dd-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--gold);
    opacity: 0.9;
}

.nav-dd-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
    background: var(--gold-soft);
    text-decoration: none;
    outline: none;
}

.nav-dropdown a:hover .nav-dd-icon,
.nav-dropdown a:focus-visible .nav-dd-icon,
.nav-dropdown a[aria-current="page"] .nav-dd-icon {
    opacity: 1;
    color: var(--accent);
}

.nav-dropdown a[aria-current="page"] {
    background: var(--accent-soft);
}

.nav-dd-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.nav-dd-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.3;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.header-cta-full { display: inline; }
.header-cta-short { display: none; }

.header-cta--home {
    /* Always available on home for scroll to form */
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    min-height: 44px;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent), var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
    display: none;
}

body.nav-open {
    overflow: hidden;
}

/* ── Layout ── */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
}

.home-start {
    --home-pad: clamp(0.75rem, 2vw, 1.15rem);
    position: relative;
    max-width: none;
    width: 100%;
    margin: 0 0 2.5rem;
    padding: 0;
    overflow: visible;
    animation: home-enter 0.5s ease-out both;
}

.home-start::before {
    content: "";
    position: absolute;
    inset: -8% -4% auto;
    width: auto;
    height: min(460px, 72vh);
    background:
        radial-gradient(ellipse 55% 70% at 18% 40%, rgba(245, 179, 32, 0.12), transparent 70%),
        radial-gradient(ellipse 45% 55% at 88% 30%, rgba(0, 128, 128, 0.1), transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.home-start-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: clamp(1.25rem, 3.5vw, 2.5rem);
    align-items: stretch;
    padding: clamp(1.25rem, 3vw, 1.9rem);
    background:
        linear-gradient(145deg, rgba(245, 179, 32, 0.08), transparent 42%),
        linear-gradient(325deg, rgba(0, 128, 128, 0.06), transparent 40%),
        var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.home-start-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.home-start-panel::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    right: -90px;
    top: -100px;
    border-radius: 50%;
    border: 1px solid rgba(166, 111, 18, 0.1);
    box-shadow: 0 0 0 12px rgba(166, 111, 18, 0.03);
    pointer-events: none;
    opacity: 0.85;
}

.home-start-brand-col {
    text-align: left;
    padding: 0.35rem 0.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: home-enter 0.6s ease-out 0.05s both;
}

.home-start-mark {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.4), 0 0 0 5px rgba(245, 179, 32, 0.18), 0 10px 24px rgba(0, 128, 128, 0.16);
}

.home-start-brand {
    margin: 0 0 0.45rem;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.4rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--gold);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.home-start-title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.8vw, 1.9rem);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
}

.home-start-lead {
    margin: 0 0 1.5rem;
    max-width: 22rem;
    color: var(--text-muted);
    font-size: 1.04rem;
    line-height: 1.6;
}

.home-start-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.home-start-more > span[aria-hidden="true"] {
    display: none;
}

.home-start-more a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 128, 128, 0.28);
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.home-start-more a:hover {
    color: #fff;
    border-color: transparent;
    background: var(--accent);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 128, 128, 0.28);
}

.home-start .form-card.form-hero {
    margin: 0;
    margin-bottom: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    animation: home-enter 0.65s ease-out 0.1s both;
}

@media (min-width: 901px) {
    .home-start .form-card.form-hero {
        padding-left: clamp(1rem, 2.5vw, 1.5rem);
        border-left: 1px solid var(--border);
    }
}

.form-hero-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.form-hero-heading {
    margin: 0 0 0.55rem !important;
    font-size: 1.5rem !important;
    letter-spacing: 0.01em;
}

.form-hero .form-hint {
    margin: 0 0 1.15rem;
}

.location-details {
    margin-top: 0.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-tint, rgba(176, 122, 31, 0.06));
}

.location-details > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
}

.location-details > summary::-webkit-details-marker {
    display: none;
}

.location-details > summary::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-right: 1.5px solid var(--text-dim);
    border-bottom: 1.5px solid var(--text-dim);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.location-details[open] > summary::before {
    transform: rotate(45deg);
}

.location-details-hint {
    color: var(--text-dim);
    font-weight: 400;
}

.location-details-grid {
    padding: 0 0.9rem 0.9rem;
}

.matching-block {
    display: grid;
    gap: 0.85rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

@keyframes home-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-start,
    .home-start-brand-col,
    .home-start .form-hero {
        animation: none;
    }
}

@media (max-width: 900px) {
    .home-start-panel {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        padding: 1.15rem 1rem 1.25rem;
        border-radius: var(--radius);
    }

    .home-start-brand-col {
        text-align: center;
        padding: 0.15rem 0 0.35rem;
    }

    .home-start-mark {
        margin-left: auto;
        margin-right: auto;
    }

    .home-start-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .home-start-more {
        justify-content: center;
    }

    .home-start .form-card.form-hero {
        margin-bottom: 0;
        padding: 1rem 0 0;
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
}
.page-hero {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 1.75rem;
    padding: 0.5rem 0 0.25rem;
}

.page-hero .eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.page-hero h1 {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 600;
}

.page-hero-lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.panchang-grid .stat-soft {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.25rem;
}

/* Current page styling lives on .nav-link[aria-current] */

/* ── Month Panchang (Drik-inspired) ── */
.panchang-page { max-width: 1400px; }

.panchang-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1.25rem;
    align-items: start;
    margin-top: 0.5rem;
}

.panchang-day {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem 1.5rem;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    box-shadow: var(--shadow-sm);
}

.panchang-day-head h2 {
    margin: 0.15rem 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.65rem;
}

.panchang-sunmoon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin: 1rem 0;
}

.panchang-sunmoon div {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.65rem;
}

.panchang-sunmoon span {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.panchang-sunmoon strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.panchang-dl {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.45rem;
}

.panchang-dl > div {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.panchang-dl dt {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.panchang-dl dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
}

.panchang-dl .until {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--gold);
}

.panchang-subhead {
    margin: 0.5rem 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
}

.panchang-footnote {
    margin: 0.75rem 0 1rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.45;
}

.panchang-month {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem 1.25rem;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.month-nav-title {
    text-align: center;
    min-width: 0;
    flex: 1;
}

.month-nav-title h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3.5vw, 1.45rem);
    line-height: 1.2;
}

.month-nav-title p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--gold);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
}

.month-head,
.month-dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.35rem 0;
}

.month-cell {
    display: block;
    text-decoration: none;
    color: inherit;
    min-height: 108px;
    padding: 0.45rem 0.4rem 0.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent), var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.month-cell:hover {
    border-color: var(--border-gold);
    text-decoration: none;
    background: var(--gold-soft);
    box-shadow: var(--shadow-sm);
}

.month-cell.selected,
.month-cell.is-selected {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px rgba(166, 111, 18, 0.35), var(--shadow-sm);
    background: var(--gold-soft);
}

.month-cell.today .cell-num,
.month-cell.today .month-daynum,
.month-cell.is-today .cell-num,
.month-cell.is-today .month-daynum {
    color: var(--accent);
}

.month-cell.empty,
.month-cell.is-empty {
    background: transparent;
    border: 0;
    min-height: 0;
    pointer-events: none;
}

.month-nav-btn {
    flex-shrink: 0;
    min-width: 5.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.month-nav-btn:hover {
    text-decoration: none;
}

.cell-day {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.3rem;
}

.cell-num {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}

.cell-sun,
.cell-set {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.cell-tithi {
    font-size: 0.72rem;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 0.15rem;
}

.cell-moon,
.cell-nak {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.cell-fest {
    margin-top: 0.25rem;
    font-size: 0.65rem;
    line-height: 1.25;
    color: var(--gold);
    font-weight: 500;
}

.festival-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.festival-list li {
    padding: 0.5rem 0.65rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.festival-type {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-soft);
}

.festival-strip {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.festival-strip h3 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold);
}

.festival-strip ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.festival-strip a {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid transparent;
}

.festival-strip a:hover {
    border-color: var(--border-strong);
    text-decoration: none;
}

.strip-day {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--gold);
    min-width: 1.75rem;
}

.strip-names {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.muted { color: var(--text-dim); font-size: 0.85em; }

@media (max-width: 1100px) {
    .panchang-layout {
        grid-template-columns: 1fr;
    }

    .panchang-day {
        position: static;
    }
}

@media (max-width: 720px) {
    .month-grid {
        gap: 0.25rem;
    }

    .month-cell {
        min-height: 78px;
        padding: 0.3rem 0.22rem;
    }

    .cell-num,
    .month-daynum {
        font-size: 0.95rem;
    }

    .cell-moon,
    .cell-sun,
    .cell-set {
        display: none;
    }

    .cell-tithi,
    .cell-nak,
    .cell-fest,
    .transit-cell-line {
        font-size: 0.58rem;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .transit-month-grid .transit-cell {
        min-height: 4.2rem;
        gap: 0.12rem;
    }

    .month-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .month-nav-btn {
        min-width: 4.5rem;
        min-height: 44px;
        padding: 0.4rem 0.55rem;
    }

    .month-nav-title {
        order: -1;
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .panchang-month {
        padding: 0.75rem 0.55rem 1rem;
    }

    .month-grid {
        gap: 0.35rem;
        min-width: 32rem;
    }

    .month-cell {
        min-height: 72px;
        padding: 0.35rem 0.3rem;
        border-radius: 6px;
    }

    .month-head,
    .month-dow {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
        padding: 0.25rem 0;
    }

    .cell-num,
    .month-daynum {
        font-size: 1rem;
    }

    .cell-fest,
    .transit-cell-line:nth-of-type(n+2),
    .transit-ingress-tag {
        display: none;
    }

    .cell-tithi,
    .transit-cell-line {
        font-size: 0.68rem;
        white-space: normal;
    }

    .panchang-dl > div {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .transit-month-embed-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0.75rem 0 1.25rem;
    }

    .transit-month-embed-wrap .month-grid {
        min-width: 32rem;
    }
}

/* ── Form card ── */
.form-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-card.form-hero {
    border-color: var(--border-gold);
    background:
        linear-gradient(180deg, rgba(166, 111, 18, 0.08), transparent 36%),
        var(--bg-panel);
    box-shadow: var(--shadow);
}

.form-card h2, .form-card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text);
}

.form-card h3 {
    font-size: 1.15rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
}

.form-card h3:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

#chart-form {
    display: grid;
    gap: 1rem;
}

#birth-form {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 1280px) {
    .nav-link {
        padding: 0.45rem 0.7rem;
        font-size: 0.86rem;
    }

    .nav-link::after {
        left: 0.7rem;
        right: 0.7rem;
    }

    .header-inner {
        gap: 1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }

    .page-wrap {
        padding: 1rem 0.85rem;
        padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    }

    .form-card {
        padding: 1.15rem;
    }

    .coords-pair {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .brand-sub { display: none; }
}

@media (max-width: 1100px) {
    .nav-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }

    .btn-ghost.header-cta-ghost {
        display: none !important;
    }

    .brand-sub { display: none; }

    .header-actions {
        margin-left: auto;
        gap: 0.4rem;
        max-width: min(100%, calc(100vw - 7.5rem));
    }

    .header-cta-full { display: none; }
    .header-cta-short { display: inline; }

    .header-cta {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .primary-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        margin: 0;
        padding: 1rem 1.1rem 1.5rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
        flex-direction: column;
        align-items: stretch;
        gap: 1.15rem;
        background: var(--drawer-bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.22s ease, opacity 0.22s ease;
        z-index: 99;
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
    }

    body.nav-open .primary-nav {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-cluster {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }

    .nav-cluster-label {
        display: block;
        margin: 0 0 0.15rem;
        padding: 0 0.35rem;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-dim);
    }

    .nav-cluster--drawer-only {
        display: flex;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.85rem 0.9rem;
        border-radius: var(--radius-sm);
        font-size: 1.02rem;
        background: transparent;
        gap: 0.65rem;
    }

    .nav-dropdown-trigger .nav-chevron {
        margin-left: auto;
    }

    .nav-link .nav-icon {
        width: 1.2rem;
        height: 1.2rem;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link[aria-current="page"],
    .nav-link.is-current {
        background: var(--gold-soft);
        color: var(--gold);
    }

    .nav-item--dropdown {
        width: 100%;
    }

    .nav-dropdown {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 0.25rem;
        box-shadow: none;
        border-color: var(--border);
        background: rgba(245, 179, 32, 0.04);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--header-h) 0 0;
        background: var(--overlay-scrim);
        z-index: 98;
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    .nav-backdrop[hidden] { display: none; }
}

label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    min-width: 0;
}

.grid-2 > * {
    min-width: 0;
}

input[type=text],
input[type=number],
input[type=date],
input[type=datetime-local],
select,
textarea {
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
    box-shadow: 0 1px 2px rgba(42, 58, 72, 0.04);
    transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.45;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(166, 111, 18, 0.35);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring-accent);
    background: #fff;
}

.form-hint {
    margin: -0.15rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.field-hint,
.optional {
    margin-left: 0.35rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.coords-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tool-form-card {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.panel-form,
#tool-form,
#panchang-lookup,
#transit-lookup {
    display: grid;
    gap: 1rem;
}

.tool-result-next {
    margin-top: 1.25rem;
}

.coords-readonly {
    background: var(--bg-elevated);
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    padding: 0.8rem 1rem;
    min-height: 48px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent), var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.toggle-row:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-sm);
}

.toggle-row input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    accent-color: var(--saffron);
}

.partner-fields {
    display: none;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    gap: 1rem;
}

form.matching-on .partner-fields { display: grid; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.55rem;
    font: inherit;
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    color: var(--ink-on-gold);
    background: linear-gradient(145deg, #ffc300 0%, var(--saffron) 48%, #d07008 100%);
    border: 1px solid rgba(208, 112, 8, 0.25);
    border-radius: var(--radius-sm);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.3) inset,
        0 6px 18px rgba(232, 136, 12, 0.34);
    transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), filter 0.18s var(--ease-out);
    margin-top: 0.65rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.34) inset,
        0 10px 26px rgba(232, 136, 12, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.results-tab:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 44px;
    transition: color 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

.btn-ghost:hover {
    color: var(--accent-deep);
    border-color: rgba(0, 128, 128, 0.4);
    background: var(--accent-soft);
}

/* Place autocomplete */
.place-wrap { position: relative; }

.place-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    max-height: 260px;
    overflow: auto;
    display: none;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    box-shadow: var(--shadow);
}

.place-suggestions li {
    padding: 0.7rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    min-height: 44px;
    overflow-wrap: anywhere;
}

.place-suggestions li strong {
    overflow-wrap: anywhere;
}

.place-suggestions li:hover,
.place-suggestions li.active {
    background: var(--accent-soft);
}

.place-suggestions li.place-empty {
    cursor: default;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.place-suggestions li.place-empty:hover {
    background: transparent;
}

.place-suggestions .meta {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

/* ── Results workspace (tabbed) ── */
.results-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.results-toolbar {
    position: relative;
    z-index: 40;
    background: var(--toolbar-bg);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.05rem 0.8rem;
    box-shadow: var(--shadow);
}

.results-toolbar-stick {
    position: sticky;
    top: var(--header-h);
    z-index: 41;
    margin: 0 -1.05rem -0.8rem;
    padding: 0.55rem 1.05rem 0.75rem;
    background: var(--toolbar-bg);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border-top: 1px solid var(--border);
}

.results-toolbar-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.results-toolbar-brand {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    margin-top: 0.15rem;
}

.results-toolbar-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(245, 179, 32, 0.16));
}

.results-toolbar-text {
    min-width: 0;
}

.results-toolbar-copy .eyebrow {
    margin: 0 0 0.15rem;
}

.results-toolbar-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.results-toolbar-meta {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.results-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin: 0 -0.15rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.25rem), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.25rem), transparent);
}

.results-tabs:focus-within,
.results-tabs:hover {
    mask-image: none;
    -webkit-mask-image: none;
}

.results-tabs::-webkit-scrollbar {
    height: 4px;
}

.results-tab {
    flex: 0 0 auto;
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.results-tab:hover,
.results-tab:focus-visible {
    color: var(--text);
    background: var(--bg-elevated);
    outline: none;
}

.results-tab.is-active,
.results-tab[aria-selected="true"] {
    color: var(--ink-on-gold);
    background: linear-gradient(135deg, #f5b320, var(--saffron));
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(224, 138, 18, 0.32);
}

.results-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
}

.results-subnav:empty,
.results-subnav[hidden] {
    display: none;
}

.results-subnav a {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    min-height: 40px;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.results-subnav a:hover,
.results-subnav a:focus-visible,
.results-subnav a.is-active {
    color: var(--accent);
    border-color: rgba(0, 128, 128, 0.35);
    background: var(--accent-soft);
    text-decoration: none;
}

.results-main {
    min-width: 0;
}

.results-main > [data-results-tab] {
    display: none;
}

.results-main > [data-results-tab].is-tab-visible {
    display: block;
}

@media (max-width: 900px) {
    .results-toolbar-stick {
        top: var(--header-h);
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .results-toolbar {
        padding: 0.75rem;
        border-radius: var(--radius-sm);
    }
    .results-tab {
        font-size: 0.78rem;
        padding: 0.45rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .results-toolbar {
        padding: 0.55rem 0.65rem 0.5rem;
    }

    .results-toolbar-copy {
        margin-bottom: 0.35rem;
    }

    .results-toolbar-copy .eyebrow {
        display: none;
    }

    .results-toolbar-title {
        font-size: 1.15rem;
    }

    .results-toolbar-meta {
        font-size: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .results-tab {
        min-height: 44px;
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
    }

    .results-subnav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 0.4rem;
        padding-top: 0.4rem;
        gap: 0.3rem;
        scrollbar-width: thin;
    }

    .results-subnav a {
        min-height: 40px;
        padding: 0.4rem 0.7rem;
        white-space: nowrap;
    }

    .section {
        padding: 1rem 0.85rem;
        scroll-margin-top: calc(var(--header-h) + 5.5rem);
    }

    html {
        scroll-padding-top: calc(var(--header-h) + 5.25rem);
    }
}

.section-nav {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
}

@media (max-width: 900px) {
    .section-nav {
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0.65rem;
    }
    .section-nav a {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.75rem !important;
    }
}

.section-nav-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.35rem 0.5rem 0.5rem;
}

.section-nav a {
    display: block;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.section-nav a:hover,
.section-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}

/* Grouped chart nav (legacy / unused in tab workspace) */
.section-nav-grouped .nav-group {
    margin-bottom: 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}

.section-nav-grouped .nav-group:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0.15rem 0 0.35rem;
    padding: 0 0.35rem;
}

/* ── Sections ── */
.section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.55rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: calc(var(--header-h) + 9.5rem);
}

.section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 1.1em;
    background: linear-gradient(180deg, var(--gold), var(--saffron));
    border-radius: 2px;
    flex-shrink: 0;
}

.section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 1.25rem 0 0.65rem;
    color: var(--text-muted);
}

.note {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0.75rem 0 0;
}

/* Summary cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent), var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
    transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.stat-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.section-subhead {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.35rem 0 0.75rem;
}

.stat-value.gold { color: var(--gold); }

.stat-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.matching-score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--gold-soft);
    color: var(--gold);
    border: 1px solid rgba(176, 122, 31, 0.3);
    margin: 0.15rem 0.25rem 0.15rem 0;
}

.badge-accent {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(15, 107, 109, 0.28);
}

.badge-danger {
    background: rgba(194, 59, 59, 0.1);
    color: var(--danger);
    border-color: rgba(194, 59, 59, 0.28);
}

.badge-success {
    background: rgba(31, 122, 69, 0.1);
    color: var(--success);
    border-color: rgba(31, 122, 69, 0.28);
}

.dasha-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Chart tabs */
.chart-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-tab {
    padding: 0.45rem 0.9rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.chart-tab:hover { color: var(--text); border-color: var(--border-strong); }

.chart-tab.active {
    color: var(--ink-on-gold);
    background: linear-gradient(135deg, #f5b320, var(--saffron));
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(224, 138, 18, 0.3);
}

.chart-panel { display: none; }
.chart-panel.active { display: block; }

.chart-wrap {
    background: #fffaf3;
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    overflow: visible;
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-width: min(100%, 520px);
    margin: 0 auto;
    box-sizing: border-box;
}

.chart-wrap svg.kundli-svg,
.chart-wrap svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    overflow: visible;
    font-size: 20px;
}

/* Chart gallery — D1 / D9 / Moon / Transit */
.chart-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chart-gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.chart-gallery-hint {
    margin: 0;
    font-size: 0.85rem;
}

.chart-font-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-font-control select {
    font: inherit;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.55rem;
    min-height: 44px;
}

.chart-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 900px) {
    .chart-gallery-grid {
        grid-template-columns: 1fr;
    }
}

.chart-tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem 1rem;
    min-width: 0;
}

.chart-tile-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.chart-tile-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.chart-tile-tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold);
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-tile .chart-wrap {
    max-width: min(100%, 320px);
}

.chart-extra {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    background: var(--bg-panel);
}

.chart-extra summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.chart-extra-wrap {
    margin-top: 0.75rem;
}

.chart-extra-wrap .chart-wrap {
    max-width: min(100%, 300px);
}

/* Font scale for kundli labels */
.chart-gallery[data-font-scale="sm"] .kundli-svg { font-size: 16px; }
.chart-gallery[data-font-scale="md"] .kundli-svg { font-size: 20px; }
.chart-gallery[data-font-scale="lg"] .kundli-svg { font-size: 24px; }
.chart-gallery[data-font-scale="xl"] .kundli-svg { font-size: 28px; }

.chart-gallery .kundli-svg .chart-planet {
    font-weight: 700;
}

.chart-gallery .kundli-svg .chart-rashi {
    font-weight: 800;
}

@media (max-width: 768px) {
    .chart-gallery[data-font-scale="sm"] .kundli-svg { font-size: 17px; }
    .chart-gallery[data-font-scale="md"] .kundli-svg { font-size: 20px; }
    .chart-gallery[data-font-scale="lg"] .kundli-svg { font-size: 23px; }
    .chart-gallery[data-font-scale="xl"] .kundli-svg { font-size: 26px; }
}

@media (max-width: 480px) {
    .chart-gallery[data-font-scale="sm"] .kundli-svg { font-size: 16px; }
    .chart-gallery[data-font-scale="md"] .kundli-svg { font-size: 18px; }
    .chart-gallery[data-font-scale="lg"] .kundli-svg,
    .chart-gallery[data-font-scale="xl"] .kundli-svg { font-size: 21px; }
}

#sec-charts .chart-wrap {
    max-width: min(100%, 320px);
}

.chart-wrap-sm {
    padding: 0.5rem;
    max-width: min(100%, 240px);
}

@media (max-width: 600px) {
    .chart-tile .chart-wrap,
    #sec-charts .chart-wrap {
        max-width: min(100%, 300px);
    }
}

/* Interactive chart houses / planets */
.chart-interactive .chart-house {
    cursor: pointer;
}

.chart-interactive .chart-house:hover polygon,
.chart-interactive .chart-house:hover > rect,
.chart-interactive .chart-house:focus-visible polygon,
.chart-interactive .chart-house:focus-visible > rect,
.chart-interactive .chart-house.is-active polygon,
.chart-interactive .chart-house.is-active > rect {
    fill: #f3e4c8 !important;
    stroke: #b45309 !important;
}

.chart-interactive .chart-planet {
    cursor: pointer;
    paint-order: stroke fill;
}

.chart-interactive .chart-planet:hover,
.chart-interactive .chart-planet:focus-visible,
.chart-interactive .chart-planet.is-active {
    fill: #9a3412 !important;
    stroke: #fbbf24;
    stroke-width: 3px;
    font-weight: 700;
}

.chart-context-menu {
    position: fixed;
    z-index: 1200;
    min-width: 220px;
    max-width: min(90vw, 300px);
    padding: 0.75rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.chart-context-menu[hidden] {
    display: none !important;
}

.ccm-head {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold);
    margin: 0 0 0.55rem;
}

.ccm-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}

.ccm-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ccm-value {
    color: var(--text);
    font-weight: 500;
}

.ccm-link {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    text-decoration: none;
}

.ccm-link:hover {
    text-decoration: underline;
}

/* Tables */
.table-scroll {
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg-elevated);
    white-space: nowrap;
}

tbody tr:hover td { background: rgba(176, 122, 31, 0.05); }

.retro { color: var(--warning); font-weight: 700; }

/* Dosha list */
.dosha-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.dosha-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.dosha-list strong {
    color: var(--text);
    min-width: 120px;
}

/* Yoga list */
.yoga-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.yoga-list li {
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.yoga-list strong { color: var(--gold); display: block; margin-bottom: 0.2rem; }

/* Varga grid — readable kundli + graha table */
.varga-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.35rem;
    margin-top: 0.75rem;
}

@media (min-width: 1100px) {
    .varga-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.varga-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.05rem 1.15rem;
    min-width: 0;
}

.varga-card:hover { border-color: var(--border-strong); }

.varga-card h3 {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.7rem;
}

.varga-card-sub {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.varga-body {
    display: grid;
    gap: 1rem;
    align-items: start;
}

@media (min-width: 640px) {
    .varga-body {
        grid-template-columns: minmax(0, 1.2fr) minmax(11.5rem, 0.8fr);
    }
}

.varga-chart {
    max-width: min(100%, 480px) !important;
    margin: 0;
    padding: 0.45rem;
}

.varga-card .kundli-svg {
    font-size: 26px;
}

.varga-legend {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
}

.varga-legend table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0;
}

.varga-legend th,
.varga-legend td {
    padding: 0.5rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    line-height: 1.35;
}

.varga-legend th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(245, 179, 32, 0.06);
}

.varga-legend tr:last-child td { border-bottom: 0; }

@media (max-width: 639px) {
    .varga-card .kundli-svg {
        font-size: 22px;
    }
}

/* Collapsible */
details.collapsible {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: visible;
}

details.collapsible summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--bg-elevated);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    gap: 0.5rem;
}

details.collapsible summary::-webkit-details-marker { display: none; }

details.collapsible summary::after {
    content: '+';
    font-size: 1.1rem;
    color: var(--text-dim);
}

details.collapsible[open] summary::after { content: '−'; }

details.collapsible pre {
    margin: 0;
    border-radius: 0;
    max-height: 400px;
}

.form-collapsible { border: none; background: transparent; overflow: visible; }
.form-collapsible summary {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold);
    padding: 0 0 0.75rem;
    background: transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.form-collapsible-body {
    padding-top: 0.5rem;
    overflow: visible;
}

pre {
    background: var(--bg-elevated);
    padding: 1rem;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(194, 59, 59, 0.08);
    border: 1px solid rgba(194, 59, 59, 0.28);
    border-radius: var(--radius);
    color: var(--danger);
}

.error-banner strong { display: block; margin-bottom: 0.15rem; }

.site-footer {
    margin-top: 3.5rem;
    border-top: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.35), transparent 28%),
        linear-gradient(180deg, transparent, rgba(0, 128, 128, 0.07));
    color: var(--text-dim);
    font-size: 0.85rem;
    position: relative;
}

.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(245, 179, 32, 0.45), rgba(0, 128, 128, 0.3), transparent);
    pointer-events: none;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2.25rem;
    display: grid;
    grid-template-columns: minmax(240px, 0.95fr) 2.2fr;
    gap: 2.75rem;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.9rem;
}

.footer-brand-link:hover { text-decoration: none; }

.footer-mark {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1.5px rgba(0, 128, 128, 0.35), 0 2px 12px rgba(245, 179, 32, 0.18);
}

.footer-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
}

.footer-tagline {
    display: block;
    font-size: 0.78rem;
    color: var(--gold);
    margin-top: 0.15rem;
}

.footer-blurb {
    margin: 0 0 0.85rem;
    max-width: 30ch;
    line-height: 1.55;
    color: var(--text-muted);
}

.footer-sanskrit {
    margin: 0 0 1.1rem;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--gold);
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-gold);
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
}

.footer-cta:hover {
    background: rgba(245, 179, 32, 0.16);
    text-decoration: none;
    color: var(--gold);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.35rem 1.5rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-col h3 {
    margin: 0 0 0.45rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0.2rem 0;
}

.footer-col a:hover {
    color: var(--gold);
    text-decoration: none;
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.78rem;
}

.footer-bottom p { margin: 0; }

.footer-bottom a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* Content sections (Explore / Meaning) */
.content-section {
    margin: 2.75rem 0 1rem;
    padding: 2.25rem 0 0.5rem;
    position: relative;
}

.content-section::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.section-intro {
    max-width: 560px;
    margin-bottom: 1.65rem;
}

.section-intro .eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.section-intro h2 {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 3vw, 2.05rem);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.section-intro p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.section-intro em { color: var(--text); font-style: italic; }

.meaning-section {
    position: relative;
    padding-top: 2.75rem;
    margin-top: 3.25rem;
    border-top: none;
    background-image: linear-gradient(90deg, transparent, var(--border-gold), transparent);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top center;
}

.meaning-intro {
    max-width: 42rem;
}

.meaning-intro p {
    font-size: 1.05rem;
    line-height: 1.65;
}

.meaning-story {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: stretch;
    margin: 0 0 1.5rem;
}

.meaning-story-main h3 {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
}

.meaning-story-main p {
    margin: 0 0 0.9rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.meaning-story-main p:last-child {
    margin-bottom: 0;
}

.meaning-story-main strong {
    color: var(--gold);
    font-weight: 600;
}

.meaning-story-main [lang="sa"] {
    color: var(--text);
    font-family: var(--font-display);
    font-style: italic;
}

.meaning-vision {
    padding: 1.45rem 1.5rem;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius);
    background:
        linear-gradient(160deg, rgba(166, 111, 18, 0.12), transparent 55%),
        var(--bg-panel);
    box-shadow: var(--shadow-sm);
}

.meaning-vision-label {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.meaning-vision-text {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text);
}

.explore-grid,
.meaning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.05rem;
}

.explore-card,
.meaning-card {
    position: relative;
    padding: 1.25rem 1.25rem 1.3rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 42%),
        var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.explore-card::before,
.meaning-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--saffron), var(--accent));
    opacity: 0.85;
}

.explore-card:hover,
.meaning-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.explore-card h3,
.meaning-card h3 {
    margin: 0.15rem 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
}

.explore-card p,
.meaning-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.58;
}

.meaning-card em {
    color: var(--text);
    font-style: italic;
}

.meaning-quote {
    margin: 1.85rem 0 0;
    padding: 1.45rem 1.55rem;
    border-left: 3px solid var(--gold);
    background:
        linear-gradient(90deg, rgba(166, 111, 18, 0.08), transparent 55%),
        var(--bg-panel);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-sm);
}

.meaning-quote p {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
    color: var(--gold);
    letter-spacing: 0.04em;
}

.meaning-quote cite {
    display: block;
    font-style: normal;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.55rem;
}

.meaning-quote span {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.meaning-close {
    margin: 1.35rem 0 0;
    max-width: 36rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

@media (max-width: 800px) {
    .meaning-story {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1rem 1.5rem;
    }

    .footer-nav {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        padding: 1rem 1rem 1.35rem;
        padding-bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 520px) {
    .footer-nav { grid-template-columns: 1fr; }
}

/* Dasha hierarchical trees */
.dasha-current {
    margin: 0.5rem 0 0.85rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 600;
}

.dasha-tree {
    max-height: 34rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    padding: 0.35rem 0.25rem;
}

.dasha-level {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dasha-level .dasha-level {
    padding-left: 0.85rem;
    border-left: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    margin-left: 0.55rem;
}

.dasha-node {
    margin: 0;
}

.dasha-row-item {
    display: grid;
    grid-template-columns: 1.1rem auto minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
    gap: 0.45rem 0.55rem;
    align-items: center;
    padding: 0.4rem 0.55rem;
    border-radius: var(--radius-sm);
    cursor: default;
    font-size: 0.86rem;
}

.dasha-node.has-children > .dasha-row-item {
    cursor: pointer;
}

.dasha-row-item:hover {
    background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
}

.dasha-node.is-active > .dasha-row-item {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    box-shadow: inset 2px 0 0 var(--gold);
}

.dasha-caret {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    justify-self: center;
}

.dasha-node.is-open > .dasha-row-item .dasha-caret {
    transform: rotate(45deg);
}

.dasha-caret-leaf {
    opacity: 0.25;
    transform: none;
    border: 0;
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 50%;
    background: var(--text-dim);
}

.dasha-level-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    min-width: 1.5rem;
}

.dasha-lord {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dasha-dates {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dasha-dur {
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .dasha-row-item {
        grid-template-columns: 1rem auto 1fr;
        grid-template-rows: auto auto;
    }
    .dasha-dates,
    .dasha-dur {
        grid-column: 3 / -1;
        font-size: 0.78rem;
    }
    .dasha-dur { justify-self: start; }
}

/* Transit calendar cells */
.transit-month-grid .transit-cell {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 5.2rem;
}

.transit-cell-line {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.transit-ingress-tag {
    display: inline-block;
    margin-top: auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold);
}

.transit-month-embed {
    margin: 0;
}

.transit-month-embed-wrap {
    margin: 0.75rem 0 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.transit-page .muted {
    color: var(--text-dim);
    font-size: 0.85em;
}

/* -- Tools hub -- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 1rem;
}

.tool-card {
    display: block;
    position: relative;
    padding: 1.2rem 1.3rem 1.3rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 40%),
        var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.tool-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--accent));
    opacity: 0.7;
}

.tool-card:hover,
.tool-card:focus-visible {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.tool-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--text);
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.tool-panel .panel-form {
    display: grid;
    gap: 0.85rem;
    max-width: 36rem;
}

.tool-panel textarea {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
}

.text-link {
    color: var(--accent);
    text-decoration: none;
}

.text-link:hover { color: #006666; text-decoration: underline; }

.json-block {
    max-height: 28rem;
    overflow: auto;
    font-size: 0.8rem;
    background: var(--bg-elevated);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Lo Shu */
.lo-shu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(3.5rem, 4.5rem));
    gap: 0.4rem;
    margin: 0.75rem 0 1rem;
}

.lo-shu-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.lo-shu-cell.is-missing {
    opacity: 0.45;
    border-style: dashed;
}

.lo-shu-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
}

.lo-shu-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Biorhythm bars */
.bio-bars {
    display: grid;
    gap: 0.85rem;
    max-width: 40rem;
}

.bio-row {
    display: grid;
    grid-template-columns: 7.5rem 1fr auto;
    gap: 0.65rem;
    align-items: center;
}

@media (max-width: 600px) {
    .bio-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.bio-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.bio-track {
    position: relative;
    height: 0.65rem;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.bio-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 999px;
    min-width: 2px;
}

.bio-zero {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.35);
}

.bio-pct {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.plain-list {
    margin: 0.5rem 0 1rem;
    padding-left: 1.2rem;
}

.plain-list li {
    margin-bottom: 0.35rem;
    line-height: 1.45;
}

.tools-group .section-intro h2 {
    margin-bottom: 0.75rem;
}

/* ── UI icons & brand graphics ── */
.ui-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.ui-icon {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.ui-icon.nav-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.ui-icon.nav-dd-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.ui-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.ui-icon-badge .ui-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.ui-icon-badge--gold {
    color: var(--gold);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 55%),
        linear-gradient(145deg, #fff8ee, #f2e3cf);
    border: 1px solid rgba(245, 179, 32, 0.22);
}

.ui-icon-badge--teal {
    color: var(--accent);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 55%),
        linear-gradient(145deg, #eef8f8, #d7ebea);
    border: 1px solid rgba(0, 128, 128, 0.2);
}

.ui-icon-badge--saffron {
    color: #b86a0c;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 55%),
        linear-gradient(145deg, #fff6eb, #f5e0c4);
    border: 1px solid rgba(224, 138, 18, 0.28);
}

.explore-card:hover .ui-icon-badge,
.meaning-card:hover .ui-icon-badge,
.tool-card:hover .ui-icon-badge {
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow);
}

.brand-mark,
.footer-mark,
.home-start-mark,
.results-toolbar-mark {
    filter: none;
}

.results-toolbar-mark {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1.5px rgba(245, 179, 32, 0.55), 0 2px 8px rgba(0, 128, 128, 0.12);
}

.home-start-mark-wrap {
    position: relative;
    width: 7.5rem;
    height: 7.5rem;
    margin: 0 0 1rem;
    display: grid;
    place-items: center;
}

.home-start-mark {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    margin: 0;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(245, 179, 32, 0.5), 0 10px 24px rgba(0, 128, 128, 0.14);
}

@media (max-width: 900px) {
    .home-start-mark-wrap {
        margin-left: auto;
        margin-right: auto;
    }
}

.page-hero-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: fit-content;
    margin: 0 auto 0.65rem;
}

.page-hero-icon .ui-icon-badge {
    width: 3.15rem;
    height: 3.15rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.page-hero-icon .ui-icon {
    width: 1.45rem;
    height: 1.45rem;
}

.section-intro--cta .ui-icon-badge {
    margin-bottom: 0.75rem;
}

.tool-card {
    padding-top: 1.15rem;
}

.tool-card .ui-icon-badge {
    margin-bottom: 0.7rem;
}

.explore-card,
.meaning-card {
    padding-top: 1.35rem;
}

.explore-card h3,
.meaning-card h3 {
    margin-top: 0;
}

/* Soft mandala wash behind content sections */
.content-section {
    position: relative;
}

.content-section#explore::before,
.meaning-section::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -1.5rem;
    width: min(28rem, 90vw);
    height: 14rem;
    transform: translateX(-50%);
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 40%, rgba(245, 179, 32, 0.07), transparent 58%),
        radial-gradient(circle at 50% 55%, rgba(0, 128, 128, 0.06), transparent 62%);
    z-index: 0;
}

.content-section#explore > *,
.meaning-section > * {
    position: relative;
    z-index: 1;
}

/* Defer layout/paint for below-fold blocks */
.content-section#explore,
.meaning-section,
.site-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 640px;
}

.footer-brand-link .footer-mark {
    transition: transform 0.25s var(--ease-out);
}

.footer-brand-link:hover .footer-mark {
    transform: rotate(-6deg) scale(1.04);
}

/* Field captions + results chrome */
.field-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.field-icon {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--gold);
    opacity: 0.88;
    flex-shrink: 0;
}

.results-tab .tab-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.results-tab.is-active .tab-icon,
.results-tab[aria-selected="true"] .tab-icon {
    opacity: 1;
}

.section h2 .section-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--gold);
    flex-shrink: 0;
    opacity: 0.92;
}

.section h2:has(.section-icon)::before {
    display: none;
}

@media (max-width: 720px) {
    .results-tab .tab-icon {
        display: none;
    }

    .results-toolbar-brand {
        width: 2rem;
        height: 2rem;
    }
}

/* ── Lightweight graphics + motion (transform/opacity only) ── */
.deco {
    display: block;
    color: var(--gold);
    pointer-events: none;
    flex-shrink: 0;
}

.deco--teal { color: var(--accent); }
.deco--gold { color: var(--gold); }
.deco--saffron { color: var(--saffron); }

.section-deco-line {
    width: min(11rem, 55%);
    height: auto;
    margin: 0.55rem 0 0.85rem;
    opacity: 0.72;
}

.page-hero .section-deco-line {
    margin-left: auto;
    margin-right: auto;
}

.home-start-orbit {
    position: absolute;
    inset: -28%;
    display: grid;
    place-items: center;
    color: rgba(245, 179, 32, 0.28);
    z-index: 0;
    animation: deco-orbit-a 80s linear infinite;
    animation-play-state: paused;
}

[data-motion-loop].is-looping .home-start-orbit {
    animation-play-state: running;
}

.home-start-orbit .deco {
    width: 100%;
    height: 100%;
}

.home-start-orbit .deco-ring {
    opacity: 0.78;
}

.home-start-orbit .deco-node {
    opacity: 0.9;
}

/* Reveal-on-view (one-shot). Only hide when JS is present to avoid FOUC/noscript blank. */
html.js [data-motion] {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition:
        opacity 0.5s var(--ease-out),
        transform 0.5s var(--ease-out);
}

html.js [data-motion].is-inview {
    opacity: 1;
    transform: none;
}

/* Above-fold stays painted for LCP */
html.js .page-hero[data-motion],
html.js .home-start[data-motion] {
    opacity: 1;
    transform: none;
}

html.js .motion-stagger > * {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition:
        opacity 0.4s var(--ease-out),
        transform 0.4s var(--ease-out);
}

html.js [data-motion].is-inview.motion-stagger > *:nth-child(1),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(1) { transition-delay: 0.03s; }
html.js [data-motion].is-inview.motion-stagger > *:nth-child(2),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(2) { transition-delay: 0.08s; }
html.js [data-motion].is-inview.motion-stagger > *:nth-child(3),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(3) { transition-delay: 0.13s; }
html.js [data-motion].is-inview.motion-stagger > *:nth-child(4),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(4) { transition-delay: 0.18s; }
html.js [data-motion].is-inview.motion-stagger > *:nth-child(5),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(5) { transition-delay: 0.22s; }
html.js [data-motion].is-inview.motion-stagger > *:nth-child(n+6),
html.js [data-motion].is-inview .motion-stagger > *:nth-child(n+6) { transition-delay: 0.26s; }

html.js [data-motion].is-inview.motion-stagger > *,
html.js [data-motion].is-inview .motion-stagger > * {
    opacity: 1;
    transform: none;
}

.section-deco-line .deco-line {
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
}

html.js [data-motion].is-inview .section-deco-line .deco-line {
    animation: deco-draw 0.85s var(--ease-out) 0.08s forwards;
}

.section-deco-line .deco-dot {
    opacity: 0;
    transform-origin: center;
}

html.js [data-motion].is-inview .section-deco-line .deco-dot {
    animation: deco-dot-in 0.3s var(--ease-out) 0.48s forwards;
}

.results-tab.is-active,
.results-tab[aria-selected="true"] {
    transform: translateY(-1px);
}

.results-workspace {
    animation: home-enter 0.4s var(--ease-out) both;
}

@keyframes deco-orbit-a {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes deco-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes deco-dot-in {
    from { opacity: 0; transform: scale(0.45); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    html.js [data-motion],
    html.js .motion-stagger > *,
    .results-workspace {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .home-start-orbit,
    .section-deco-line .deco-line,
    .section-deco-line .deco-dot {
        animation: none !important;
    }

    .section-deco-line .deco-line { stroke-dashoffset: 0; }
    .section-deco-line .deco-dot { opacity: 1; }

    .results-tab.is-active {
        transform: none;
    }
}

/* Share bar removed */

/* Feature pages: muhurta / varshaphal / festivals */
.rank-list {
    display: grid;
    gap: 0.85rem;
}

.rank-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--border-strong);
}

.rank-card.band-good { border-left-color: var(--success); }
.rank-card.band-fair { border-left-color: var(--saffron); }
.rank-card.band-cautious { border-left-color: var(--danger); }

.rank-card-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.rank-card-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.rank-num {
    font-weight: 700;
    color: var(--gold);
    min-width: 1.75rem;
}

.rank-score {
    margin-left: auto;
    text-align: right;
}

.rank-score strong {
    display: block;
    font-size: 1.35rem;
    color: var(--accent);
}

.rank-score span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rank-notes {
    margin: 0.55rem 0 0.35rem;
    font-size: 0.9rem;
}

.muhurta-windows {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
}

.muhurta-windows em {
    font-style: normal;
    color: var(--text);
    font-weight: 600;
    margin-right: 0.25rem;
}

.lead-line {
    font-size: 1.1rem;
    line-height: 1.45;
    margin: 0.75rem 0;
}

.fest-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.fest-nav h2 {
    margin: 0;
    flex: 1;
}

.festival-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.festival-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.festival-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
}

/* FAQ */
.faq-page {
    max-width: 820px;
}

.faq-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin: 0 0 2rem;
}

.faq-toc a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-panel);
}

.faq-toc a:hover {
    border-color: rgba(245, 179, 32, 0.45);
    color: var(--gold);
}

.faq-group h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin: 0 0 0.85rem;
}

.faq-list {
    display: grid;
    gap: 0.55rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    overflow: hidden;
}

.faq-item summary {
    padding: 0.9rem 1.05rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gold);
    line-height: 1;
}

.faq-item[open] summary::after { content: '−'; }

.faq-item[open] summary {
    border-bottom: 1px solid var(--border);
}

.faq-answer {
    padding: 0.85rem 1.05rem 1.05rem;
}

.faq-answer p {
    margin: 0 0 0.7rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.faq-answer p:last-child { margin-bottom: 0; }

.faq-more a {
    font-weight: 600;
    font-size: 0.9rem;
}

.faq-teaser-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.faq-teaser-list a {
    display: block;
    padding: 0.8rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
}

.faq-teaser-list a:hover {
    border-color: rgba(245, 179, 32, 0.4);
    color: var(--gold);
}

.faq-teaser-more {
    margin: 0;
}

/* —— Eight-feature wave: timing, matching, names, i18n, PWA —— */

.timing-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.timing-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.05rem 1.05rem;
}

.timing-panel h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.timing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.timing-table th,
.timing-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.timing-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.timing-table.compact td,
.timing-table.compact th {
    padding: 0.35rem 0.4rem;
}

.timing-table tr.quality-excellent td:first-child { border-left: 3px solid #2d7a4f; }
.timing-table tr.quality-good td:first-child { border-left: 3px solid var(--gold); }
.timing-table tr.quality-caution td:first-child { border-left: 3px solid #c47a12; }
.timing-table tr.quality-avoid td:first-child { border-left: 3px solid #b33a3a; }

.section-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.sky-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.sky-event-list li {
    padding: 0.75rem 0.9rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

.matching-readiness {
    margin: 0.5rem 0 0.85rem;
    padding: 0.65rem 0.85rem;
    background: rgba(245, 179, 32, 0.06);
    border: 1px solid rgba(245, 179, 32, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.matching-manglik-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    margin: 0 0 1rem;
}

.matching-manglik-grid .mini-card {
    margin: 0;
}

.matching-notes-wrap {
    display: block;
    margin: 0 0 1rem;
}

.matching-notes-wrap textarea {
    width: 100%;
    margin-top: 0.35rem;
    resize: vertical;
    min-height: 4.5rem;
}

.alert-banner {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    background: rgba(179, 58, 58, 0.08);
    border: 1px solid rgba(179, 58, 58, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
}

.matching-score tr.row-warn {
    background: rgba(179, 58, 58, 0.06);
}

.matching-score tr.row-warn td {
    font-weight: 600;
}

.names-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.names-card {
    padding: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.names-card.is-active {
    border-color: rgba(245, 179, 32, 0.45);
    box-shadow: 0 0 0 1px rgba(245, 179, 32, 0.12);
}

.names-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
}

.lang-link {
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
}

.lang-link:hover {
    color: var(--gold);
    background: rgba(245, 179, 32, 0.06);
}

.results-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.15rem;
}

.footer-cta--ghost {
    margin-top: 0.45rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
}

.footer-cta--ghost:hover {
    border-color: rgba(245, 179, 32, 0.35);
    color: var(--gold);
}

@media (max-width: 640px) {
    .timing-table {
        font-size: 0.85rem;
    }

    .results-toolbar-actions {
        width: 100%;
    }

    .results-toolbar-actions .btn-ghost {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Legal pages */
.legal-page .legal-prose {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.78;
}

.legal-prose h2 {
    margin: 2rem 0 0.6rem;
    font-size: 1.25rem;
    font-family: var(--font-display);
}

.legal-prose p,
.legal-prose li {
    color: var(--text-muted);
}

.legal-prose ul {
    padding-left: 1.3rem;
    margin: 0.5rem 0 1rem;
}

.legal-prose li {
    margin-bottom: 0.4rem;
}

.legal-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.15rem;
    justify-content: center;
    margin: 0.5rem auto 1.5rem;
    max-width: 800px;
}

.legal-toc a {
    padding: 0.3rem 0.65rem;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
}

.legal-toc a:hover,
.legal-toc a[aria-current="page"] {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.footer-legal {
    display: flex;
    gap: 0.65rem;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.footer-legal a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* PWA install card */
.pwa-install-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
}

.pwa-install-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-install-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-install-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.pwa-install-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pwa-install-btn {
    margin-left: auto;
    margin-top: 0;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    font-size: 0.88rem;
}

.pwa-install-hint {
    font-size: 0.82rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}


/* -- Claim strip, share, learn, density, compare, social -- */
.claim-strip {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 128, 128, 0.22);
    background: linear-gradient(135deg, rgba(0, 128, 128, 0.06), rgba(245, 179, 32, 0.08));
    font-size: 0.9rem;
    line-height: 1.45;
}
.claim-strip-lead,
.claim-strip-aside { margin: 0; color: var(--text); }
.claim-strip a { color: var(--teal, #008080); font-weight: 600; }

.error-next {
    margin: 0.55rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.empty-state {
    margin: 1rem 0 1.5rem;
    padding: 1.25rem 1.35rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface, #fffcf8);
}
.empty-state strong { display: block; margin-bottom: 0.35rem; }

.density-toggle {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0 0 0.65rem;
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.55);
}
.density-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
}
.density-btn.is-active {
    background: var(--teal, #008080);
    color: #fff;
}
[data-density="simple"] .results-tab[data-tab="strength"],
[data-density="simple"] .results-tab[data-tab="yogas"],
[data-density="simple"] .results-tab[data-tab="systems"],
[data-density="simple"] .results-tab[data-tab="wellness"],
[data-density="simple"] .results-tab[data-tab="remedies"],
[data-density="simple"] .density-advanced,
[data-density="simple"] [data-results-tab="strength"],
[data-density="simple"] [data-results-tab="yogas"],
[data-density="simple"] [data-results-tab="systems"],
[data-density="simple"] [data-results-tab="wellness"],
[data-density="simple"] [data-results-tab="remedies"] {
    display: none !important;
}

.chart-walkthrough {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 179, 32, 0.35);
    background: rgba(245, 179, 32, 0.08);
}
.walkthrough-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.walkthrough-dismiss {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}
.walkthrough-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.walkthrough-card {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 252, 248, 0.85);
    border: 1px solid var(--border);
}
.walkthrough-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}
.walkthrough-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.walkthrough-card p + p { margin-top: 0.4rem; }

.share-page .share-card {
    margin: 0 0 1.25rem;
    padding: 1.25rem 1.35rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface, #fffcf8);
    box-shadow: var(--shadow);
}
.share-card-head {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.share-card-mark { border-radius: 50%; }
.share-facts {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}
.share-facts li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: rgba(0, 128, 128, 0.06);
}
.share-facts span { color: var(--text-muted); font-size: 0.88rem; }
.share-chart { max-width: 420px; margin: 0 auto 0.75rem; }
.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.learn-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.learn-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface, #fffcf8);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.learn-card:hover {
    border-color: rgba(0, 128, 128, 0.45);
    transform: translateY(-2px);
}
.learn-card h2 { margin: 0; font-size: 1.2rem; }
.learn-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.45; flex: 1; }
.learn-card-cta { font-weight: 600; color: var(--teal, #008080); font-size: 0.9rem; }
.learn-article .legal-prose { max-width: 42rem; }
.embed-snippet {
    overflow-x: auto;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: #14202b;
    color: #f3ebe1;
    font-size: 0.82rem;
    line-height: 1.45;
}

.compare-panel {
    margin: 0 0 1.5rem;
    padding: 1.1rem 1.2rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 128, 128, 0.04);
}
.compare-head h2 { margin: 0 0 0.35rem; }
.compare-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 0.85rem;
}
.compare-card {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: var(--surface, #fffcf8);
    border: 1px solid var(--border);
}
.compare-card h3 { margin: 0.15rem 0 0.55rem; }
.compare-card h4 { margin: 0.75rem 0 0.4rem; font-size: 0.95rem; }

.social-card-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin: 1rem 0;
}
.social-card { margin: 0; }
.social-card-inner {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    padding: 1.35rem 1.4rem;
    color: #fffcf8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
}
.social-card-brand {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
}
.social-card-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.9;
}
.social-card-title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2.4rem;
    line-height: 1.15;
    font-weight: 700;
}
.social-card-meta {
    margin: 0.75rem 0 0;
    font-size: 0.88rem;
    line-height: 1.4;
    opacity: 0.92;
}
.social-card figcaption {
    margin-top: 0.65rem;
    text-align: center;
}

.results-toolbar-stick .density-toggle {
    margin-bottom: 0.45rem;
}

@media (max-width: 720px) {
    .share-actions { flex-direction: column; }
    .share-actions .btn-primary,
    .share-actions .btn-ghost { width: 100%; text-align: center; }
}

/* Responsive UX — forms, header, charts, touch targets */
@media (max-width: 768px) {
    .header-inner {
        gap: 0.65rem;
        padding: 0 0.85rem;
    }

    .chart-gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .chart-font-control {
        width: 100%;
        justify-content: space-between;
    }

    input,
    select,
    textarea,
    button {
        touch-action: manipulation;
    }

    .form-card input,
    .form-card select,
    .form-card textarea,
    .form-card button {
        max-width: 100%;
    }

    .btn,
    .btn-primary,
    .btn-ghost,
    .header-cta,
    .nav-link {
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .site-back-link {
        max-width: 6.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.74rem;
    }

    .brand-text {
        font-size: 1.12rem;
    }

    .header-cta {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
        font-size: 0.72rem;
    }

    .page-wrap {
        padding: 1rem 0.75rem;
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .form-card {
        padding: 1rem 0.85rem;
    }

    .home-start-panel {
        padding: 1rem 0.85rem 1.1rem;
    }

    .panchang-month {
        padding: 0.75rem 0.55rem 1rem;
    }

    .dasha-row-item {
        grid-template-columns: 1.1rem minmax(0, 1fr);
        gap: 0.35rem 0.45rem;
    }

    .dasha-row-item .dasha-range,
    .dasha-row-item .dasha-meta {
        grid-column: 2;
    }
}
