/* =========================================================================
   96Astro · Astrology Hub — master stylesheet entry.

   This file is intentionally a thin orchestrator. The system is split
   into focused modules under css/{components,layout,modules}. Edit those
   files, not this one.

       Tokens         → variables & dark-mode overrides
       Base           → resets, scrollbars, layout primitives, utilities
       Typography     → display, eyebrow, lede, verse, source tags
       Components     → buttons, cards, tables, forms, pills, accordion,
                        tabs, chart-frame, score, skeleton, overlay
       Layout         → shell, sidebar, topbar, page
       Modules        → dasha, panchang (more added in later phases)

   Cache-bust by bumping ?v= in master.blade.php when shipping changes.
   Brand colour is strictly #1701AC (see _tokens.css → --ah-indigo).
   ========================================================================= */

@import url('./_tokens.css');
@import url('./_base.css');
@import url('./_typography.css');

@import url('./components/_buttons.css');
@import url('./components/_cards.css');
@import url('./components/_tables.css');
@import url('./components/_forms.css');
@import url('./components/_pills.css');
@import url('./components/_accordion.css');
@import url('./components/_tabs.css');
@import url('./components/_chart-frame.css');
@import url('./components/_score.css');
@import url('./components/_skeleton.css');
@import url('./components/_overlay.css');

@import url('./layout/_shell.css');
@import url('./layout/_sidebar.css');
@import url('./layout/_topbar.css');
@import url('./layout/_page.css');

@import url('./modules/_dasha.css');
@import url('./modules/_panchang.css');
@import url('./modules/_dashboard.css');
@import url('./modules/_form-page.css');
@import url('./modules/_tool-page.css');
@import url('./modules/_report.css');
@import url('./basic-details.css');
@import url('./friendship.css');
@import url('./chart-views.css');
@import url('./match.css');
@import url('./reports.css');
@import url('./specialty.css');
@import url('./numero-pakshi.css');
@import url('./narrative.css');
@import url('./muhurta.css');
@import url('./tarot.css');
@import url('./papasamya.css');
@import url('./jyotish-grid.css');
@import url('./planetary-position.css');
@import url('./gem-details.css');
@import url('./rudraksh.css');
@import url('./nakshatra-vastu.css');
@import url('./biorhythm.css');
@import url('./gochara.css');
@import url('./western-natal.css');
@import url('./western-extended.css');
@import url('./astro-utilities.css');
@import url('./vedic-transit.css');
@import url('./sarvatobhadra-chakra.css');
@import url('./year-tool.css');
@import url('./dosh-extended.css');
@import url('./lunar.css');

@import url('./print.css');

/* Cache-busted shell overrides. Imported module files can be retained by the
   browser independently, so critical chrome fixes also live here. */
.ah-topbar__theme {
    display: inline-grid;
    background: #FFFFFF;
    color: var(--ah-indigo);
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.45);
}
.ah-topbar__theme:hover {
    background: #F8F6FF;
    color: var(--ah-indigo-700);
    border-color: var(--ah-indigo-300);
}

/* ── Backdrop — fully transparent, no dim, no blur ────────────────────
   The drawer backdrop is kept ONLY as an invisible click-catcher so a
   tap outside the open drawer still closes it. No dim, no blur — the
   page behind stays at its original full colour.
   These rules sit after every @import so they win without !important. */
.ah-backdrop {
    background: transparent;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
}

/* ── Mobile off-canvas sidebar ────────────────────────────────────────
   MUST live here, not in the @import-ed _sidebar.css: browsers cache
   @import-ed files independently of the ?v= bust on dashboard.css, so a
   fix in _sidebar.css may never reach the user. Two bugs this fixes:
     1. Sidebar stayed `position: sticky` → in document flow → reserved a
        100vh empty block at the top of the page on phones.
     2. With z-index:auto it sat *behind* the .ah-backdrop, so the drawer
        scrim covered the sidebar itself.
   `position: fixed` + an explicit z-index above the backdrop fixes both. */
@media (max-width: 1024px) {
    .ah-shell .ah-sidebar,
    .ah-shell.is-collapsed .ah-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 286px;
        max-width: 86vw;
        transform: translateX(-100%);
        transition: transform var(--ah-d-slow) var(--ah-ease);
        z-index: var(--ah-z-modal);          /* 60 — above backdrop (40) */
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.45);
    }
    .ah-shell.is-drawer-open .ah-sidebar {
        transform: translateX(0);
    }
    /* The backdrop must stay below the drawer so its blur never touches it. */
    .ah-backdrop {
        z-index: var(--ah-z-overlay);         /* 50 — under drawer, over page */
    }
    /* `is-collapsed` is desktop-only — keep the mobile drawer full + labelled. */
    .ah-shell.is-collapsed .ah-sidebar__brand__name,
    .ah-shell.is-collapsed .ah-sidebar__brand__sub,
    .ah-shell.is-collapsed .ah-nav__item__text,
    .ah-shell.is-collapsed .ah-nav__item__tag,
    .ah-shell.is-collapsed .ah-sidebar__foot__who {
        display: revert;
    }
    .ah-shell.is-collapsed .ah-nav__item,
    .ah-shell.is-collapsed .ah-sidebar__brand,
    .ah-shell.is-collapsed .ah-sidebar__foot,
    .ah-shell.is-collapsed .ah-nav__group__head {
        justify-content: flex-start;
    }
    .ah-shell.is-collapsed .ah-nav__item    { padding: 8px 12px; margin: 1px 4px; }
    .ah-shell.is-collapsed .ah-sidebar__brand { padding: 14px 16px; }
}

/* =========================================================================
   TOPBAR  (.ah-tb)  — professional header
   Lives here (cache-busted entry file) so the redesign always reaches the
   browser; the old @import-ed _topbar.css `.ah-topbar` rules are now inert.
   ========================================================================= */
.ah-tb {
    position: sticky;
    top: 0;
    z-index: var(--ah-z-sticky);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    padding: 0 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--ah-line);
}

/* hamburger — mobile only */
.ah-tb__burger {
    display: none;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--ah-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ah-ink-2);
    cursor: pointer;
}
.ah-tb__burger svg { width: 20px; height: 20px; }
.ah-tb__burger:hover { background: var(--ah-bg-2); color: var(--ah-ink); }
@media (max-width: 1024px) { .ah-tb__burger { display: inline-flex; } }

/* sidebar-collapse toggle — desktop only (mobile uses the hamburger drawer).
   The arrow inside the icon rotates 180° when the sidebar is collapsed so
   the visual cue matches the "expand to the right" direction. */
.ah-tb__collapse {
    display: inline-flex;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--ah-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ah-ink-2);
    cursor: pointer;
    transition: background var(--ah-d-fast) var(--ah-ease), color var(--ah-d-fast) var(--ah-ease);
}
.ah-tb__collapse svg { width: 20px; height: 20px; }
.ah-tb__collapse:hover { background: var(--ah-bg-2); color: var(--ah-indigo); }
.ah-tb__collapse__arrow {
    transition: transform var(--ah-d-mid) var(--ah-ease);
    transform-origin: 13px 12px;
}
.ah-shell.is-collapsed .ah-tb__collapse__arrow { transform: rotate(180deg); }
@media (max-width: 1024px) { .ah-tb__collapse { display: none; } }

/* breadcrumb */
.ah-tb__crumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--ah-ink-3);
    white-space: nowrap; min-width: 0;
}
.ah-tb__crumb a { color: var(--ah-ink-3); text-decoration: none; }
.ah-tb__crumb a:hover { color: var(--ah-indigo); }
.ah-tb__crumb svg { width: 13px; height: 13px; color: var(--ah-ink-4); flex-shrink: 0; }
.ah-tb__crumb__here { color: var(--ah-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ── search ──────────────────────────────────────────────────────────── */
.ah-tb__search-wrap {
    position: relative;
    flex: 1;
    max-width: 440px;
}
.ah-tb__search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    width: 100%;
    padding: 0 12px;
    background: var(--ah-bg-2);
    border: 1px solid var(--ah-line);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ah-tb__search:focus-within {
    background: #fff;
    border-color: var(--ah-indigo);
    box-shadow: 0 0 0 3px rgba(23, 1, 172, 0.10);
}
.ah-tb__search__icon { width: 17px; height: 17px; color: var(--ah-ink-4); flex-shrink: 0; }
.ah-tb__search:focus-within .ah-tb__search__icon { color: var(--ah-indigo); }
.ah-tb__search__input {
    flex: 1; min-width: 0;
    border: 0; outline: 0; background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ah-ink);
}
.ah-tb__search__input::placeholder { color: var(--ah-ink-4); }
.ah-tb__kbd {
    flex-shrink: 0;
    font-family: var(--ah-font-mono);
    font-size: 11px;
    color: var(--ah-ink-3);
    background: #fff;
    border: 1px solid var(--ah-line);
    border-radius: 6px;
    padding: 2px 7px;
}

/* ── search results dropdown ─────────────────────────────────────────── */
.ah-tb__sr {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    display: none;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ah-line);
    border-radius: 12px;
    box-shadow: 0 18px 44px -16px rgba(13, 9, 40, 0.32), 0 2px 8px rgba(13, 9, 40, 0.08);
    max-height: 380px;
    overflow-y: auto;
}
.ah-tb__sr.is-open { display: block; }
.ah-tb__sr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ah-ink);
}
.ah-tb__sr-item svg { width: 14px; height: 14px; color: var(--ah-ink-4); flex-shrink: 0; }
.ah-tb__sr-item:hover,
.ah-tb__sr-item.is-active {
    background: var(--ah-indigo-50);
}
.ah-tb__sr-item:hover svg,
.ah-tb__sr-item.is-active svg { color: var(--ah-indigo); }
.ah-tb__sr-label {
    flex: 1; min-width: 0;
    font-size: 13.5px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ah-tb__sr-label mark {
    background: rgba(245, 196, 83, 0.4);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
    font-weight: 700;
}
.ah-tb__sr-group {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--ah-ink-4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ah-tb__sr-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--ah-ink-3);
}

/* ── right action cluster ────────────────────────────────────────────── */
.ah-tb__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* icon button (bell, help) */
.ah-tb__icon {
    position: relative;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ah-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ah-ink-2);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ah-tb__icon svg { width: 18px; height: 18px; }
.ah-tb__icon:hover {
    background: var(--ah-indigo-50);
    border-color: var(--ah-indigo-300);
    color: var(--ah-indigo);
}
.ah-tb__icon__dot {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #FF2E5E;
    border: 2px solid #fff;
}

/* ── language switcher — custom dropdown ─────────────────────────────── */
.ah-tb__lang { position: relative; }
.ah-tb__lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--ah-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ah-ink-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.ah-tb__lang__btn:hover { background: var(--ah-bg-2); border-color: var(--ah-line-2); }
.ah-tb__lang__globe { width: 16px; height: 16px; flex-shrink: 0; color: var(--ah-ink-3); }
.ah-tb__lang__label { min-width: 26px; }
.ah-tb__lang__chev {
    width: 12px; height: 12px;
    color: var(--ah-ink-4);
    transition: transform .18s ease;
}
.ah-tb__lang__btn[aria-expanded="true"] { border-color: var(--ah-indigo); }
.ah-tb__lang__btn[aria-expanded="true"] .ah-tb__lang__chev { transform: rotate(180deg); }

.ah-tb__lang__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: none;
    min-width: 184px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ah-line);
    border-radius: 12px;
    box-shadow: 0 18px 44px -16px rgba(13, 9, 40, 0.32), 0 2px 8px rgba(13, 9, 40, 0.08);
}
.ah-tb__lang__menu.is-open { display: block; }
.ah-tb__lang__menu__head {
    padding: 5px 10px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ah-ink-4);
}
.ah-tb__lang__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ah-ink);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.ah-tb__lang__opt:hover { background: var(--ah-indigo-50); }
.ah-tb__lang__opt.is-active { color: var(--ah-indigo); font-weight: 600; }
.ah-tb__lang__check {
    width: 15px; height: 15px;
    flex-shrink: 0;
    color: var(--ah-indigo);
    opacity: 0;
}
.ah-tb__lang__opt.is-active .ah-tb__lang__check { opacity: 1; }

/* Hidden host for the Google Translate <select> — kept renderable
   (off-screen, not display:none) so the engine still functions. */
.ah-gt-host {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    left: -9999px; top: 0;
}

/* Neutralise Google Translate's injected page chrome (banner / tooltip) */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover { display: none !important; }
.skiptranslate iframe { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
body { top: 0 !important; }

/* divider */
.ah-tb__divider {
    width: 1px; height: 26px;
    background: var(--ah-line);
    margin: 0 2px;
}

/* refer & earn pill */
.ah-tb__refer {
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #F8CF6A 0%, #E0A500 100%);
    border: 1px solid #C9920A;
    color: #2A1A00;
    font-size: 12.5px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 4px 12px -6px rgba(224, 165, 0, 0.8);
    transition: transform .1s ease, box-shadow .15s ease;
}
.ah-tb__refer svg { width: 16px; height: 16px; }
.ah-tb__refer strong { font-weight: 800; }
.ah-tb__refer:hover {
    background: linear-gradient(135deg, #FFDD86 0%, #F0B815 100%);
    border-color: #B8850A;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(224, 165, 0, 0.95);
}

/* primary CTA */
.ah-tb__cta {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, #2A12C8 0%, var(--ah-indigo) 100%);
    border: 1px solid var(--ah-indigo-700);
    color: #fff;
    font-size: 13px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 6px 14px -6px rgba(23, 1, 172, 0.6);
    transition: transform .1s ease, box-shadow .15s ease;
}
.ah-tb__cta svg { width: 16px; height: 16px; }
.ah-tb__cta:hover {
    background: linear-gradient(180deg, #3D2BE3 0%, #2614C0 100%);
    border-color: #1A0A8C;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -6px rgba(23, 1, 172, 0.85);
}

/* ── account dropdown ────────────────────────────────────────────────── */
.ah-tb__user { position: relative; flex-shrink: 0; }
.ah-tb__user__btn {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
}
.ah-tb__user__avatar {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ah-indigo) 0%, #5A47DC 100%);
    color: #fff;
    font-family: var(--ah-font-display);
    font-weight: 700; font-size: 15px;
    box-shadow: 0 0 0 1px var(--ah-line), 0 2px 6px rgba(23, 1, 172, 0.25);
    transition: box-shadow .15s ease;
}
.ah-tb__user__btn:hover .ah-tb__user__avatar,
.ah-tb__user__btn[aria-expanded="true"] .ah-tb__user__avatar {
    box-shadow: 0 0 0 2px var(--ah-indigo-300), 0 4px 10px rgba(23, 1, 172, 0.35);
}

.ah-tb__user__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: none;
    width: 250px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ah-line);
    border-radius: 14px;
    box-shadow: 0 18px 44px -16px rgba(13, 9, 40, 0.34), 0 2px 8px rgba(13, 9, 40, 0.08);
}
.ah-tb__user__menu.is-open { display: block; }

.ah-tb__user__head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 10px 12px;
}
.ah-tb__user__head__avatar {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ah-indigo) 0%, #5A47DC 100%);
    color: #fff;
    font-family: var(--ah-font-display);
    font-weight: 700; font-size: 17px;
    flex-shrink: 0;
}
.ah-tb__user__head__info { min-width: 0; }
.ah-tb__user__head__name {
    display: block;
    font-size: 14px; font-weight: 600;
    color: var(--ah-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ah-tb__user__head__email {
    display: block;
    font-size: 12px;
    color: var(--ah-ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ah-tb__user__sep {
    height: 1px;
    background: var(--ah-line);
    margin: 4px 6px;
}
.ah-tb__user__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ah-ink-2);
    text-decoration: none;
}
.ah-tb__user__item svg { width: 17px; height: 17px; color: var(--ah-ink-4); flex-shrink: 0; }
.ah-tb__user__item:hover { background: var(--ah-indigo-50); color: var(--ah-indigo); }
.ah-tb__user__item:hover svg { color: var(--ah-indigo); }
.ah-tb__user__item--danger { color: #C0392B; }
.ah-tb__user__item--danger svg { color: #C0392B; }
.ah-tb__user__item--danger:hover { background: #FDECEA; color: #A6231D; }
.ah-tb__user__item--danger:hover svg { color: #A6231D; }

/* active-chart chip */
.ah-tb__chart {
    display: inline-flex; align-items: center; gap: 7px;
    height: 34px; padding: 0 7px 0 11px;
    border: 1px solid var(--ah-line);
    border-radius: 999px;
    text-decoration: none; color: var(--ah-ink);
    font-size: 13px; white-space: nowrap;
}
.ah-tb__chart:hover { border-color: var(--ah-line-2); }
.ah-tb__chart__dot { width: 7px; height: 7px; border-radius: 50%; background: #E85D04; }
.ah-tb__chart__name { font-weight: 600; }
.ah-tb__chart__id {
    font-family: var(--ah-font-mono); font-size: 11px;
    color: var(--ah-ink-3); background: var(--ah-bg-2);
    padding: 2px 7px; border-radius: 999px;
}

/* ── topbar responsive ───────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .ah-tb__refer span { display: none; }
    .ah-tb__refer { padding: 0 11px; }
}
@media (max-width: 1024px) {
    .ah-tb { height: 58px; padding: 0 14px; gap: 8px; }
    .ah-tb__search { max-width: none; }
}
@media (max-width: 760px) {
    .ah-tb__crumb,
    .ah-tb__lang,
    .ah-tb__divider { display: none; }
    .ah-tb__cta span { display: none; }
    .ah-tb__cta { padding: 0 11px; }
    .ah-tb__kbd { display: none; }
}
@media (max-width: 460px) {
    .ah-tb__icon { display: none; }
    .ah-tb__search__input { font-size: 13px; }
}

/* =========================================================================
   SHARED PAGE BACKGROUND
   The subtle "mandala" wash (two faint radial glows on a near-white base)
   must be IDENTICAL on every Astrology Hub page — dashboard, tools, forms,
   results — not just the dashboard. It's painted on the shell columns and
   anchored to the viewport (background-attachment: fixed) so it reads as
   one continuous backdrop regardless of page length.

   `!important` is required: the @import-ed _dashboard.css forces
   `.ah-content { background: var(--bg) !important }` on the dashboard,
   which would otherwise wipe the gradient. Equal-specificity selectors
   here load after that import and win.
   ========================================================================= */
/* Light-mode only — flat single color (no gradient wash) so the page is
   perfectly uniform top-to-bottom and left-to-right. Dark themes use the
   slate/navy --ah-bg tokens cascading via _tokens.css. */
html.ah-light body.ah-app .ah-main,
html.ah-light body.ah-app[data-page] .ah-content {
    background-color: #FAFAFE !important;
    background-image: none !important;
}

/* Inner page wrappers stay transparent so the shared wash shows through
   (otherwise a centred max-width column would paint a solid panel over it). */
body.ah-app[data-page] .ah-page,
body.ah-app[data-page] .mandala-bg {
    background: transparent !important;
}

/* =========================================================================
   ANCHOR-BUTTON HOVER COLOUR FIX
   _base.css ships a global `a:hover { color: var(--ah-indigo-700) }` meant
   for prose links. Any element styled as a button but built on <a> inherited
   that recolour on hover — white text on an indigo button turned invisible.
   Buttons must keep their own text colour through hover / focus / active.
   Each `:hover`/`:focus` selector below out-specifies the global `a:hover`.
   ========================================================================= */

/* white-on-dark buttons — text stays white */
.ah-tb__cta, .ah-tb__cta:hover, .ah-tb__cta:focus, .ah-tb__cta:active,
.hero__cta--ghost:hover, .hero__cta--ghost:focus,
.btn-primary:hover, .btn-primary:focus {
    color: #ffffff;
}

/* dark-on-gold buttons — text stays near-black */
.ah-tb__refer, .ah-tb__refer:hover, .ah-tb__refer:focus, .ah-tb__refer:active,
.hero__cta--primary:hover, .hero__cta--primary:focus,
.btn-gold:hover, .btn-gold:focus {
    color: #2A1A00;
}

/* gold link on the dark Live-Today card — stays gold */
.ah-today__cta:hover, .ah-today__cta:focus {
    color: #F5C453;
}

/* search-result rows — dark ink text on the light indigo hover row */
.ah-tb__sr-item:hover, .ah-tb__sr-item:focus, .ah-tb__sr-item.is-active {
    color: var(--ah-ink);
}

/* topbar icon links + breadcrumb keep their intended hover hue */
.ah-tb__icon:hover, .ah-tb__icon:focus { color: var(--ah-indigo); }
.ah-tb__crumb a:hover, .ah-tb__crumb a:focus { color: var(--ah-indigo); }

/* =========================================================================
   DASHA TREE  (.ah-dtree)  — expandable period chart
   Vimshottari / Yogini / Ashtottari etc. — 4-column drill-down tree.
   ========================================================================= */
.ah-dtree { width: 100%; font-size: 13px; }

.ah-dtree__head {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--ah-bg-2);
    border-bottom: 1px solid var(--ah-line);
}
.ah-dtree__h {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ah-ink-3);
}
.ah-dtree__h--name { flex: 1; }
.ah-dtree__h--dur  { width: 104px; text-align: center; }
.ah-dtree__h--dt   { width: 104px; text-align: center; }

.ah-dtree__empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--ah-ink-3);
}

/* a group wraps one row + its (collapsed) children */
.ah-dtree__kids { display: none; }
.ah-dtree__group.is-open > .ah-dtree__kids { display: block; }

.ah-dtree__row {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    border-bottom: 1px solid var(--ah-line-2);
    border-left: 3px solid var(--dot, transparent);
    transition: background var(--ah-d-fast) var(--ah-ease);
}
.ah-dtree__row.has-kids { cursor: pointer; }
.ah-dtree__row.has-kids:hover { background: var(--ah-indigo-50); }

/* level shading + indentation */
.ah-dtree__row--l1 { background: #fff; }
.ah-dtree__row--l2 { background: #FAFAFE; padding-left: 34px; }
.ah-dtree__row--l3 { background: #F5F4FC; padding-left: 52px; }
.ah-dtree__row--l4 { background: #F0EFFA; padding-left: 70px; }
.ah-dtree__row--l5 { background: #ECEAF7; padding-left: 88px; }

/* currently-running period */
.ah-dtree__row.is-now {
    background: var(--ah-gold-50, #FFF6DA);
}
.ah-dtree__row.is-now:hover { background: #FCEFC0; }

.ah-dtree__c--name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 600;
    color: var(--ah-ink);
}
.ah-dtree__c--dur,
.ah-dtree__c--dt {
    width: 104px;
    text-align: center;
    font-family: var(--ah-font-mono);
    font-size: 12px;
    color: var(--ah-ink-2);
    flex-shrink: 0;
}
.ah-dtree__c--dur { color: var(--ah-ink-3); }

.ah-dtree__chev {
    width: 14px;
    flex-shrink: 0;
    text-align: center;
    font-size: 15px;
    color: var(--ah-ink-4);
    transition: transform var(--ah-d-fast) var(--ah-ease);
}
.ah-dtree__group.is-open > .ah-dtree__row > .ah-dtree__c--name .ah-dtree__chev {
    transform: rotate(90deg);
    color: var(--ah-indigo);
}
.ah-dtree__dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--dot, #8a8a9a);
    flex-shrink: 0;
}
.ah-dtree__lord {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ah-dtree__now {
    flex-shrink: 0;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: var(--ah-gold);
    color: #5a3a00;
    padding: 2px 7px;
    border-radius: 7px;
}

@media (max-width: 560px) {
    .ah-dtree__h--dur, .ah-dtree__c--dur { display: none; }
    .ah-dtree__h--dt,  .ah-dtree__c--dt  { width: 78px; font-size: 11px; }
}

/* =========================================================================
   TOOL PAGE — collapsed input form
   When a tool is opened for a saved chart it auto-computes; the birth form
   collapses to just its header bar (an "Edit inputs" toggle re-opens it).
   ========================================================================= */
form[data-ah-tool-form].is-collapsed .ah-card__body,
form[data-ah-tool-form].is-collapsed .ah-card__foot {
    display: none;
}
form[data-ah-tool-form].is-collapsed {
    margin-bottom: 16px;
}
form[data-ah-tool-form].is-collapsed .ah-card__head {
    border-bottom: 0;
}

/* =========================================================================
   SIDEBAR — context hint
   Shown in the (dark) sidebar when no chart is open, explaining that the
   tool groups appear once a chart/report is opened.
   ========================================================================= */
.ah-nav__hint {
    margin: 14px 10px 6px;
    padding: 16px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}
.ah-nav__hint__icon {
    width: 38px; height: 38px;
    margin: 0 auto 9px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(245, 196, 83, 0.12);
    color: #F5C453;
}
.ah-nav__hint__title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.ah-nav__hint__text {
    margin: 5px 0 12px;
    font-size: 11.5px;
    line-height: 1.55;
    color: rgba(231, 227, 255, 0.62);
}
.ah-nav__hint__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    background: linear-gradient(180deg, #F8CF6A 0%, #E0A500 100%);
    border: 1px solid #C9920A;
    color: #2A1A00;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .1s ease, box-shadow .15s ease;
}
.ah-nav__hint__btn svg { width: 13px; height: 13px; }
.ah-nav__hint__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -6px rgba(224, 165, 0, 0.7);
    color: #2A1A00;
}

/* =========================================================================
   BUTTON HOVER — visible colour shift
   A hover that only lifts + shadows reads as "nothing happened". Every
   button now also shifts its background to a clearly lighter/brighter
   shade on hover, while the text colour stays fixed (handled above).
   The hero selectors carry the body[data-page] prefix so they out-specify
   the @import-ed _dashboard.css base rules.
   ========================================================================= */
body.ah-app[data-page] .hero__cta--primary:hover,
body.ah-app[data-page] .hero__cta--primary:focus {
    background: linear-gradient(180deg, #FFDD86 0%, #F0B815 100%);
    box-shadow: 0 12px 24px -8px rgba(224, 165, 0, 0.9);
}
body.ah-app[data-page] .hero__cta--ghost:hover,
body.ah-app[data-page] .hero__cta--ghost:focus {
    background: rgba(255, 255, 255, 0.17);
    border-color: rgba(255, 255, 255, 0.42);
}

/* =========================================================================
 * Planetary Details — 17-column table. Tighten cell padding and lock to
 * monospace digits so horizontal scrolling stays minimal; the wrapping
 * .ah-table-scroll handles overflow when the viewport is still narrower
 * than the table's intrinsic width.
 * =======================================================================*/
.ah-pd-table { font-size: 13px; min-width: 1200px; }
.ah-pd-table th,
.ah-pd-table td {
    padding: 7px 10px;
    white-space: nowrap;
}
.ah-pd-table th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ah-ink-3);
    background: var(--ah-surface-2);
    border-bottom: 1px solid var(--ah-line);
}
.ah-pd-table td {
    font-family: var(--ah-font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
    font-variant-numeric: tabular-nums;
}
.ah-pd-table tbody tr:nth-child(even) { background: var(--ah-surface-2); }
.ah-pd-table tbody tr:hover { background: color-mix(in srgb, var(--ah-indigo, #1701AC) 4%, transparent); }

/* =========================================================================
 * Astro API hero — chart header card with gradient background, avatar
 * initial, eyebrow / title / meta stack and right-aligned action buttons.
 * Replaces the plain `.ah-card` header on the astro-api result page.
 * =======================================================================*/
.ah-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #f4f0ff 0%, #fffefa 60%, #fff7e8 100%);
    border: 1px solid color-mix(in srgb, var(--ah-indigo, #1701AC) 12%, var(--ah-line, #ebe9f0));
    box-shadow: 0 12px 32px -22px rgba(23, 1, 172, 0.25),
                0 2px 8px -4px rgba(13, 9, 40, 0.08);
}
.ah-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 92% -10%, rgba(212, 175, 55, 0.28), transparent 55%),
        radial-gradient(circle at -8% 110%, rgba(23, 1, 172, 0.18), transparent 50%);
    z-index: 0;
}
.ah-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px 26px;
}
.ah-hero__avatar {
    flex: 0 0 64px;
    width: 64px; height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ah-indigo, #1701AC), color-mix(in srgb, var(--ah-indigo, #1701AC) 70%, #d4af37));
    color: #fff;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px -8px rgba(23, 1, 172, 0.55);
}
.ah-hero__text {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ah-hero__eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ah-indigo, #1701AC);
}
.ah-hero__title {
    margin: 2px 0 0;
    font-family: var(--ah-font-serif, "Cormorant Garamond", "Playfair Display", serif);
    font-size: clamp(24px, 3.4vw, 32px);
    font-weight: 700;
    color: var(--ah-ink, #1a1830);
    line-height: 1.15;
}
.ah-hero__meta {
    margin-top: 4px;
    font-size: var(--ah-fs-sm, 13px);
    color: var(--ah-ink-2, #4a4866);
    font-family: var(--ah-font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
}
.ah-hero__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.ah-hero__actions .ah-btn { gap: 6px; }

@media (max-width: 720px) {
    .ah-hero__inner { padding: 18px 20px; }
    .ah-hero__avatar { width: 52px; height: 52px; font-size: 22px; flex-basis: 52px; }
    .ah-hero__actions { width: 100%; }
}

/* =========================================================================
 * Modern key-value GRID — for summary cards (Birth Details, Chart
 * Attributes, …). Each row renders as a tile with an icon, small caps
 * label and a strong value. Replaces the dense bordered kvTable look.
 * =======================================================================*/
.ah-kvg {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px 14px;
}
.ah-kvg__tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--ah-surface, #fff);
    border: 1px solid var(--ah-line, #ebe9f0);
    border-radius: 12px;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.ah-kvg__tile:hover {
    border-color: color-mix(in srgb, var(--ah-indigo, #1701AC) 24%, var(--ah-line, #ebe9f0));
    box-shadow: 0 4px 14px -8px rgba(23, 1, 172, 0.16);
    transform: translateY(-1px);
}
.ah-kvg__icon {
    flex: 0 0 36px;
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ah-indigo, #1701AC) 10%, transparent);
    color: var(--ah-indigo, #1701AC);
    font-size: 16px;
    line-height: 1;
}
.ah-kvg__body {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ah-kvg__lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ah-text-soft, #6c6b7c);
}
.ah-kvg__val {
    font-size: 14px;
    font-weight: 600;
    color: var(--ah-text, #1a1830);
    font-family: var(--ah-font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Gold tone — used by Chart Attributes so the two summary cards have a
 * visually distinct accent without breaking the design system. */
.ah-kvg--gold .ah-kvg__icon {
    background: color-mix(in srgb, #d4af37 14%, transparent);
    color: #b45309;
}
.ah-kvg--gold .ah-kvg__tile:hover {
    border-color: color-mix(in srgb, #d4af37 32%, var(--ah-line, #ebe9f0));
    box-shadow: 0 4px 14px -8px rgba(180, 130, 0, 0.18);
}

/* Two-column tiles on wider summary cards so we fit 8-10 fields without
 * the card growing very tall. Falls back to single column on narrow. */
@media (min-width: 520px) {
    .ah-kvg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .ah-kvg { grid-template-columns: 1fr; }
}

/* =========================================================================
   TOPBAR — mobile compaction
   The default header packs hamburger + breadcrumb + chart chip + search +
   language + notifications + help + refer + New Kundli + avatar. On
   phones that wraps badly and pushes the page content far below the fold.
   Hide the secondary items on narrow viewports — only essentials stay:
     ≤1024px : hide refer-pill label, hide language label, hide divider
     ≤ 720px : hide refer pill, language switcher, notifications, help,
               breadcrumb base path, active-chart name (keep dot+id)
     ≤ 480px : collapse New Kundli to icon-only, hide chart chip entirely
   ========================================================================= */
@media (max-width: 1024px) {
    .ah-tb { padding: 0 14px; gap: 8px; }
    .ah-tb__refer span { display: none; }
    .ah-tb__lang__label,
    .ah-tb__lang__chev { display: none; }
    .ah-tb__lang__btn { padding: 7px 9px; }
    .ah-tb__search-wrap { max-width: 280px; }
}
@media (max-width: 720px) {
    .ah-tb { height: 56px; padding: 0 12px; gap: 6px; }
    .ah-tb__refer,
    .ah-tb__lang,
    .ah-tb__divider { display: none; }
    .ah-tb__icon[data-coming-soon],          /* help icon */
    .ah-tb__icon[data-ah-notifications] {    /* notifications */
        display: none;
    }
    .ah-tb__chart__name { display: none; }   /* keep dot + #id only */
    .ah-tb__crumb a { display: none; }       /* hide base "Astrology Hub" */
    .ah-tb__crumb svg:first-of-type { display: none; }
    .ah-tb__search-wrap { display: none; }   /* search hidden on phones — accessible via sidebar */
}
@media (max-width: 480px) {
    .ah-tb__cta span { display: none; }      /* "+ New Kundli" → just "+" */
    .ah-tb__cta { padding: 8px 10px; }
    .ah-tb__chart { display: none; }         /* chart chip too — name lives on the page itself */
    .ah-tb__crumb__here { font-size: 13px; max-width: 50vw; }
}

/* Sidebar drawer — make sure the drawer body shape stays clean when open
 * (no overflow gutters that look "hanging"), and pin the user-foot to the
 * bottom of the drawer so it doesn't sit awkwardly mid-scroll. */
@media (max-width: 1024px) {
    .ah-sidebar { display: flex; flex-direction: column; }
    .ah-sidebar .ah-nav { flex: 1 1 auto; overflow-y: auto; }
    .ah-sidebar__foot { margin-top: auto; }
    .ah-sidebar__close { display: inline-flex; }
}

/* =========================================================================
   FOOTER — mobile compaction
   Default footer renders: 96Astro · © 2026 All rights reserved · Privacy ·
   Terms · spacer · v2026.06.01.30 · backend: 96astroapifastapi. Way too
   busy on phones — keep only what users actually need (legal links).
   ========================================================================= */
.ah-footer { flex-wrap: wrap; row-gap: 6px; }

@media (max-width: 1024px) {
    .ah-footer { padding: 14px 14px; }
    /* Drop the version/backend meta — tech-only info, useless on phones */
    .ah-footer .ah-mono { display: none; }
    .ah-footer__brand { display: none; }       /* brand already in topbar */
}
@media (max-width: 720px) {
    .ah-footer { padding: 12px 14px; gap: 6px; font-size: 11px; justify-content: center; text-align: center; }
    /* Hide every separator on phones — clean inline list with bullet-less spacing */
    .ah-footer__sep { display: none; }
    .ah-footer > span:nth-child(4),            /* "© 2026 All rights reserved" — full string is long */
    .ah-footer a { padding: 0 4px; }
}
