/* Shared responsive layer. Loaded after page styles; screen-only to preserve PDF layouts.
   !important is limited to legacy inline styles and earlier mobile overrides. */
:root {
    --font-sans: var(--font-body, 'Inter', system-ui, sans-serif);
    --mobile-header: calc(68px + env(safe-area-inset-top, 0px));
    --mobile-gutter: clamp(16px, 4.5vw, 24px);
}
.mobile-brand { display: none; }
.mobile-nav-cart, .mobile-nav-home { display: none; }
#namingForm .reset-btn { display: flex; }
.site-shell a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 2px solid var(--gold, #e8a838);
    outline-offset: 4px;
}
.site-shell .logo { min-width: 0; }
.site-shell .header-actions { flex-shrink: 0; }
.site-shell .nav { overscroll-behavior: contain; }
.cart-drawer-overlay:not(.active), .founder-modal-overlay:not(.active),
.checkout-modal-overlay:not(.active) { visibility: hidden; }
.cart-drawer-overlay.active, .founder-modal-overlay.active,
.checkout-modal-overlay.active { visibility: visible; }
.cart-item-details { min-width: 0; overflow-wrap: anywhere; }
.cart-drawer-items { min-height: 0; overscroll-behavior: contain; }
.cart-drawer-header, .cart-drawer-footer { flex-shrink: 0; }
.astro-toast { pointer-events: none; max-width: calc(100vw - 32px); }

@media screen and (min-width: 901px) and (max-width: 1100px) {
    .hero-premium-container { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
    .hero-premium-image-area { width: 100%; min-width: 0; }
    .founder-portrait { max-width: 100%; transform: none; object-fit: contain; }
}

@media screen and (max-width: 1100px) {
    /* A single navigation pattern on phones and tablets, including landscape. */
    .site-shell.header {
        padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)) !important;
        height: var(--mobile-header);
        background: #10121bf7;
        border-bottom: 1px solid #e8a83820;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        z-index: 1000;
    }
    .site-shell .header-inner {
        display: flex !important;
        flex-flow: row nowrap !important;
        justify-content: space-between !important;
        height: 68px;
        gap: 8px !important;
        padding: 0 !important;
    }
    .site-shell .logo > :not(.premium-brand) { display: none !important; }
    .site-shell .mobile-center-pill { display: none !important; }
    .site-shell .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #f2e5c9;
        font-family: var(--font-sans);
        font-size: 15px;
        font-weight: 600;
        letter-spacing: -.3px;
        line-height: 1.2;
        white-space: nowrap;
    }
    .mobile-brand > svg { color: #e4bc75; flex-shrink: 0; }
    .mobile-brand small {
        display: block;
        font-size: 9px;
        letter-spacing: 1.25px;
        color: #aaa79f;
        margin-top: 4px;
        font-weight: 400;
        text-transform: uppercase;
    }
    .site-shell .header-actions { gap: 6px !important; align-items: center; display: flex; }
    .site-shell :is(.lang-toggle, #authHeaderBtn, #authProfilePic, .mobile-menu-btn) {
        min-height: 44px;
        min-width: 44px;
        flex-shrink: 0;
    }
    .site-shell .lang-toggle { padding: 0 8px; gap: 4px; font-size: 11px; }
    .site-shell #authHeaderBtn { padding: 0 10px !important; font-size: 12px !important; white-space: nowrap; }
    .site-shell #authProfilePic { width: 44px !important; height: 44px !important; object-fit: cover; }
    .site-shell .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid #ffffff1a;
        background: #ffffff06;
        color: #eee8dc;
        cursor: pointer;
        z-index: 1200;
    }
    .site-shell .nav-overlay {
        display: block;
        position: fixed;
        inset: var(--mobile-header) 0 0;
        background: #05070bc9;
        backdrop-filter: blur(6px);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s;
    }
    .site-shell .nav-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
    .site-shell .nav {
        position: fixed !important;
        display: flex !important;
        flex-direction: column !important;
        top: calc(var(--mobile-header) + 10px) !important;
        right: max(12px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        bottom: auto;
        width: min(360px, calc(100vw - 24px)) !important;
        height: auto !important;
        max-height: calc(100dvh - var(--mobile-header) - 30px);
        padding: 20px 16px max(16px, env(safe-area-inset-bottom, 0px)) !important;
        margin: 0;
        gap: 6px !important;
        background: linear-gradient(145deg, #20222e, #151720) !important;
        border: 1px solid #e4bc7533;
        border-radius: 22px;
        box-shadow: 0 24px 70px #0009;
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px) !important;
        transition: opacity .2s, transform .2s, visibility .2s;
        z-index: 1100;
    }
    .site-shell .nav::before {
        content: 'EXPLORE COSMIC TOOLS';
        color: #b5a68d;
        font: 600 10px var(--font-sans);
        letter-spacing: 2px;
        padding: 4px 12px 12px;
    }
    html[lang="hi"] .site-shell .nav::before { content: 'हमारी सेवाएँ'; }
    .site-shell .nav.open { visibility: visible; opacity: 1; pointer-events: auto; transform: none !important; }
    .site-shell .nav-link {
        width: 100%;
        flex: 0 0 auto;
        font-size: 15px !important;
        padding: 13px 14px !important;
        line-height: 1.5;
        text-align: left;
        border: 1px solid transparent;
        border-radius: 12px;
        color: #d8d6d1;
        white-space: normal;
    }
    .site-shell .nav-link.active { border-color: #e8a83830; background: #e8a8380d; color: #ebc882; }
    .site-shell .nav-link.active::after { display: none; }
    .site-shell .mobile-nav-cart { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #ffffff06; font-family: inherit; cursor: pointer; }
    .site-shell .mobile-nav-home { display: block; }
    .mobile-nav-cart .cart-badge-count { position: static; flex-shrink: 0; }
    .site-shell #authMenu { max-width: calc(100vw - 32px); }
    .site-shell #authMenu :is(a, button, [onclick]) { min-height: 44px; }
}

@media screen and (max-width: 900px) {
    html { scroll-padding-top: calc(var(--mobile-header) + 20px); -webkit-text-size-adjust: 100%; }
    body { line-height: 1.65; }
    :is(button, a, input, select, textarea, summary) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
    :is(input, select, textarea):not([type="radio"]):not([type="checkbox"]) {
        font-size: 16px !important; /* Prevent automatic iOS input zoom. */
        min-width: 0;
        max-width: 100%;
        min-height: 50px;
        color-scheme: dark;
    }
    input[type="date"], input[type="time"] { display: block; appearance: none; -webkit-appearance: none; }
    input::-webkit-date-and-time-value { text-align: left; }
    :is(.form-group, .calc-form-area, .calculator-container, .dashboard-content, .product-info, .item-details) { min-width: 0; }
    :is(.calc-btn, .premium-btn, .reset-btn, .add-cart-btn, .featured-detail-btn, .glowing-btn, .kp-button) {
        min-height: 48px;
        white-space: normal;
        line-height: 1.5;
        text-align: center;
    }
    .section { padding: 48px var(--mobile-gutter); }
    .section-title { font-size: clamp(1.5rem, 5.5vw, 2rem) !important; line-height: 1.3; text-wrap: balance; }
    .section-desc { font-size: .94rem !important; line-height: 1.7; }
    .hero-title { font-size: clamp(1.85rem, 7.5vw, 2.75rem) !important; line-height: 1.18 !important; text-wrap: balance; }
    .hero-subtitle { font-size: .96rem !important; line-height: 1.7 !important; }

    /* Home: clear hierarchy, one primary action, full uncropped portrait. */
    .hero-premium { padding: calc(var(--mobile-header) + 30px) var(--mobile-gutter) 32px !important; height: auto !important; min-height: 0 !important; }
    .hero-premium-container { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; width: 100% !important; padding: 0 !important; }
    .hero-premium-content { display: contents !important; }
    .hero-premium-badge {
        grid-column: 1 !important; grid-row: 1 !important; display: block !important;
        font-size: 10px !important; letter-spacing: 1.5px !important;
        text-align: center !important; margin: 0 0 20px !important; line-height: 1.7;
    }
    .hero-premium-title {
        grid-column: 1 !important; grid-row: 2 !important; max-width: 100% !important;
        font-family: var(--font-display) !important; font-size: clamp(2.15rem, 8.8vw, 3.5rem) !important;
        line-height: 1.13 !important; letter-spacing: -1.2px !important; text-align: center !important;
        margin: 0 0 18px !important; padding: 0 !important; text-wrap: balance;
    }
    .hero-premium-desc {
        grid-column: 1 !important; grid-row: 3 !important; max-width: 520px !important;
        font-size: .96rem !important; line-height: 1.75 !important; text-align: center !important;
        color: #bbbcc5 !important; margin: 0 auto 22px !important; padding: 0 !important; text-shadow: none !important;
    }
    .hero-premium-btn {
        display: flex !important; grid-column: 1; grid-row: 4; align-items: center; justify-content: center;
        width: 100%; max-width: 420px; min-height: 54px; margin: 0 auto !important;
        padding: 14px 18px !important; border-radius: 14px !important;
        background: linear-gradient(115deg, #f0cf8d, #dca449); color: #201b12;
        font-size: 15px; font-weight: 700; box-shadow: 0 8px 28px #c18a2820;
    }
    .hero-premium-signature { display: block !important; grid-column: 1; grid-row: 5; text-align: center; font: 11px var(--font-body) !important; margin: 12px 0 0 !important; color: #a9a49a; }
    .hero-premium-features, .mobile-extra-buttons { display: none !important; }
    .hero-premium-image-area {
        grid-column: 1 !important; grid-row: 6 !important; position: relative !important;
        width: min(100%, 400px) !important; height: 290px !important; min-height: 0 !important;
        margin: 24px auto 0 !important; display: flex !important; align-items: flex-end !important;
        justify-content: center !important; transform: none !important; right: auto !important; bottom: auto !important;
        overflow: hidden !important; border-radius: 24px; background: radial-gradient(ellipse at 50% 65%, #b8873325, transparent 65%);
    }
    .founder-portrait {
        position: relative !important; width: 100% !important; height: 100% !important;
        object-fit: contain !important; object-position: center bottom !important; transform: none !important;
        mask-image: linear-gradient(#000 78%, transparent 100%) !important;
        -webkit-mask-image: linear-gradient(#000 78%, transparent 100%) !important;
    }
    .hero-premium-image-area .orbit-system { width: 260px !important; height: 260px !important; top: 48% !important; left: 50% !important; transform: translate(-50%, -50%) !important; opacity: .5 !important; }
    .founder-name-plate {
        display: flex !important; position: absolute !important; bottom: 0 !important; left: 0 !important;
        transform: none !important; width: 100% !important; max-width: none !important; margin: 0 !important;
        padding: 12px 14px !important; justify-content: center; gap: 12px !important;
        background: #171922ee !important; border: 1px solid #e8a83826; border-radius: 14px !important;
        backdrop-filter: blur(12px); z-index: 10;
    }
    .plate-name-hi { font-size: 15px !important; }
    .plate-name-en { font-size: 10px !important; }
    .plate-role, .plate-exp { font-size: 10px !important; white-space: normal; }
    .mobile-premium-cards-grid { display: grid !important; grid-column: 1 !important; grid-row: 7 !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; padding: 0 !important; margin: 28px 0 0 !important; }
    .premium-card { min-height: 0 !important; padding: 18px 16px !important; border-radius: 18px !important; text-align: left !important; box-shadow: none !important; }
    .premium-card .card-title { font-family: var(--font-display) !important; font-size: 17px !important; letter-spacing: 0 !important; }
    .premium-card .card-desc { font-size: 12px !important; line-height: 1.65 !important; margin-bottom: 12px !important; }
    .premium-card .card-icon { width: 36px !important; height: 36px !important; margin-bottom: 12px !important; }
    .premium-card .card-icon svg { width: 22px; height: 22px; }
    .premium-card .card-arrow { border: none !important; }
    .about-grid { gap: 14px; }
    .about-card { padding: 22px !important; border-radius: 18px; background: linear-gradient(145deg, #1c1f2d, #151823); }
    .about-card p { font-size: .9rem; line-height: 1.75; }

    /* Input-first calculator; decorative dial no longer consumes a screen. */
    .section.calc-section { padding: calc(var(--mobile-header) + 24px) var(--mobile-gutter) 48px; }
    .calculator-split-layout { padding: 0; gap: 0; grid-template-columns: minmax(0, 1fr); overflow: hidden; border-radius: 22px; }
    .calc-graphic-area { min-height: 0; padding: 18px 20px; display: flex; flex-direction: row; gap: 16px; justify-content: flex-start; border-bottom: 1px solid #ffffff0d; }
    .calc-graphic-area .cosmic-clock { width: 64px !important; height: 64px !important; flex-shrink: 0; margin: 0; }
    .calc-graphic-area .clock-node { display: none; }
    .calc-graphic-area .clock-center { width: 26px; height: 26px; }
    .calc-dial-label { margin: 0; text-align: left; }
    .calc-dial-label .dial-label-title { font-size: 11px !important; letter-spacing: 1.2px; }
    .calc-dial-label .dial-label-subtitle { font-size: 10px !important; letter-spacing: .2px; }
    .calc-form-panel { padding: 24px 20px; border: 0; background: transparent; box-shadow: none; }
    .form-header h3 { font-size: 1.6rem !important; line-height: 1.3; }
    .form-header p { font-size: .94rem; }
    .form-eyebrow { font-size: 10px; letter-spacing: 1.8px; }
    .form-label { font-size: .8rem; letter-spacing: .4px; }
    .form-hint { font-size: .76rem; line-height: 1.7; color: #a6a4ab; }
    .form-input { border-radius: 12px; }
    .calc-form label:has(input[type="radio"]) { flex: 1; min-height: 48px; padding: 10px 12px; border: 1px solid #ffffff20; border-radius: 12px; }
    .calc-form label:has(input[type="radio"]:checked) { border-color: #e8a83890; background: #e8a8380b; }
    .form-benefit-strip { gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 11px; letter-spacing: 0; }
    .form-benefit-strip span { white-space: nowrap; }

    /* Report overview and all five report panes. */
    .dashboard-body .dashboard-main { padding: calc(var(--mobile-header) + 20px) 0 48px; }
    .dashboard-split-layout { grid-template-columns: minmax(0, 1fr); padding: 0 var(--mobile-gutter); gap: 20px; }
    .dashboard-sidebar { position: static; height: auto; overflow: visible; padding: 18px; }
    .sidebar-profile { margin: 0 0 16px; padding: 0 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .profile-header { margin: 0; justify-content: space-between; flex: 1; min-width: 0; }
    .sidebar-name { font-size: 1.5rem; overflow-wrap: anywhere; }
    .sidebar-dob { font-size: .78rem; margin: 0; letter-spacing: .3px; }
    .sidebar-badge { flex-shrink: 0; width: 58px; height: 58px; margin: 0; }
    .sidebar-badge .badge-number { font-size: 1.6rem; }
    .sidebar-badge .badge-label { font-size: 8px; letter-spacing: .5px; }
    .profile-dropdown-btn { min-width: 44px; min-height: 44px; }
    .sidebar-nav-heading { display: none; }
    .sidebar-nav { display: flex; flex-direction: row; overflow-x: auto; gap: 8px; padding: 0 0 12px; margin-bottom: 12px; scroll-snap-type: x proximity; }
    .side-nav-link { width: auto; min-height: 44px; flex-shrink: 0; padding: 10px 14px; font-size: 12px; border-radius: 12px; scroll-snap-align: start; }
    .sidebar-actions { padding: 0; }
    .sidebar-action-btn { min-height: 44px; justify-content: center; }
    .dashboard-content { min-height: 0; }
    .dashboard-body .dashboard-main::before { width: 100%; left: 50%; }
    .overview-top-row { flex-direction: column !important; gap: 16px !important; }
    .overview-top-row > div { flex: auto !important; min-width: 0; }
    .hero-archetype-banner { padding: 24px 20px; margin: 0; min-height: 240px; }
    .hero-archetype-content { max-width: 100%; width: 100%; }
    .hero-archetype-title { font-size: 1.65rem; }
    .hero-archetype-desc { font-size: .95rem; }
    .hero-cosmic-animation { opacity: .18; }
    .hero-daily-vibe { flex-wrap: wrap; gap: 4px 8px; }
    .overview-cta-banner { padding: 22px; gap: 18px; }
    .overview-extra-grid, .insight-cards, .summary-cards, .core-numbers-2x2 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .pane-title { font-size: 1.75rem; line-height: 1.35; }
    .pane-subtitle, .core-card-desc { color: #b8b7c0; line-height: 1.75; }
    .core-card { padding: 24px; }
    .core-card-title { color: #adaab5; letter-spacing: 1px; }
    .core-explore-btn { min-height: 44px; padding: 10px 0; }
    .extra-card, .insight-card { padding: 20px; border-radius: 18px; }
    .ai-master-panel { padding: 26px 18px; }
    .ai-master-panel h2 { font-size: 1.6rem; }
    .ai-features { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 16px; }
    .ai-badge { font-size: 10px; letter-spacing: 1.5px; }
    .tab-nav { overflow-x: auto; flex-wrap: nowrap; }
    .tab-btn { min-height: 44px; flex-shrink: 0; }

    /* Naming, booking and Kundli. */
    body:has(#namingForm) .hero { padding: calc(var(--mobile-header) + 28px) var(--mobile-gutter) 40px !important; min-height: 0 !important; }
    body:has(#namingForm) .hero-badge { padding: 8px 12px !important; font-size: 10px !important; letter-spacing: .5px !important; }
    body:has(#namingForm) .hero-subtitle { margin-bottom: 22px !important; }
    body:has(#namingForm) .glass-container { width: 100% !important; padding: 24px 18px !important; border-radius: 20px !important; background: #131721ed; }
    #namingForm { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 20px 16px !important; text-align: left; }
    #namingForm .btn-row { display: flex; flex-direction: column; gap: 10px; }
    #namingForm .calc-btn { padding: 14px 16px !important; width: 100% !important; border-radius: 14px !important; }
    #namingForm .reset-btn { width: 100%; }
    .booking-hero { padding: calc(var(--mobile-header) + 28px) var(--mobile-gutter) 24px; }
    .booking-hero .hero-subtitle { margin-bottom: 0 !important; }
    .calendar-placeholder { padding: 26px 20px !important; min-height: 0; }
    .calendar-placeholder h3 { font-size: 1.5rem !important; }
    .kp-main { padding-top: calc(var(--mobile-header) + 30px); width: calc(100% - 2 * var(--mobile-gutter)); }
    .kp-hero h1 { font-size: clamp(1.7rem, 6.5vw, 2.75rem); }
    .kp-note { font-size: .8rem; }
    .kp-chart-row, .kp-offer-layout { grid-template-columns: minmax(0, 1fr); }
    .kp-section-heading { flex-wrap: wrap; }
    .kp-faq summary, .kp-method summary { min-height: 44px; }

    /* Shop, product detail, checkout and account. */
    #main-menu-view > .shop-hero { padding: calc(var(--mobile-header) + 28px) var(--mobile-gutter) 0 !important; }
    body:has(#main-menu-view) { background: radial-gradient(ellipse at 50% 0, #30231c, transparent 650px), #0f1117 !important; }
    .shop-hero > div { gap: 16px !important; }
    .shop-hero > div:has(> div > div > [data-en="Lab Certified"]) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
    .shop-hero > div > div { min-width: 0; }
    .shop-hero > div > div > div:first-child { flex-shrink: 0; }
    .shop-hero > div [data-en] { font-size: 12px !important; }
    .category-cards-container { grid-template-columns: minmax(0, 1fr) !important; padding: 0 var(--mobile-gutter) !important; gap: 18px !important; margin-top: 26px !important; }
    .category-card { height: auto !important; min-height: 0; }
    .category-card > div:nth-child(2) { height: 175px !important; }
    #main-menu-view > div:last-child { gap: 20px !important; padding: 24px var(--mobile-gutter) !important; }
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 var(--mobile-gutter); gap: 16px; }
    .product-card { padding: 18px; min-width: 0; }
    .product-footer, .featured-footer { flex-wrap: wrap; gap: 14px; }
    .featured-btns { flex-wrap: wrap; width: 100%; }
    .featured-btns > * { flex: 1; }
    .featured-product { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 20px; }
    .product-card img { object-fit: contain !important; }
    .shop-controls { top: var(--mobile-header); }
    .product-container { margin: calc(var(--mobile-header) + 24px) auto 48px; padding: 0 var(--mobile-gutter); grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .product-image-box { padding: 24px; aspect-ratio: 1; max-height: 420px; }
    .product-image-box img { width: 100% !important; height: 100% !important; max-height: 340px; object-fit: contain !important; }
    .product-visuals > div { position: static !important; margin-top: 0 !important; }
    .product-visuals img { width: 100%; max-height: 380px; object-fit: contain; }
    .p-title { font-size: 1.85rem; }
    .product-info { gap: 18px; }
    .checkout-container { margin: calc(var(--mobile-header) + 24px) auto 40px; padding: 0 var(--mobile-gutter); grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .checkout-section, .summary-box { padding: 22px 18px; border-radius: 18px; position: static; }
    .summary-item { gap: 12px; }
    .summary-item > div:first-child { min-width: 0; }
    .summary-item img { flex-shrink: 0; }
    .summary-item-title { overflow-wrap: anywhere; }
    .summary-item-price { flex-shrink: 0; }
    #checkoutAuthPrompt, #authPrompt { padding: calc(var(--mobile-header) + 28px) 24px 40px !important; min-height: 100svh; height: auto; overflow-y: auto; }
    #authPrompt { z-index: 90; }
    .dashboard-layout { margin: calc(var(--mobile-header) + 24px) auto 48px; padding: 0 var(--mobile-gutter); grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .profile-sidebar { padding: 24px; }
    .profile-avatar { width: 72px; height: 72px; margin-bottom: 16px; }
    .profile-email, .order-id, .order-item { overflow-wrap: anywhere; }
    .order-card { padding: 20px; }
    .order-header, .order-footer { flex-wrap: wrap; gap: 14px; }
    .order-item { align-items: flex-start; }
    .item-icon { flex-shrink: 0; }
    .empty-cosmic { padding: 28px 20px; }
    .upsell-grid { margin-top: 24px; gap: 14px; }
    .conf-container { margin: calc(var(--mobile-header) + 24px) var(--mobile-gutter) 40px; padding: 28px 20px; }
    .conf-title { font-size: 1.8rem; }
    .conf-container .order-id { max-width: 100%; }
    .conf-container .order-id span { font-size: 1rem; letter-spacing: .5px; }
    .conf-container > div:last-child { flex-wrap: wrap; gap: 12px !important; }
    .legal-container { margin-top: calc(var(--mobile-header) + 32px); padding: 0 var(--mobile-gutter); }
    .legal-title { font-size: 2rem; line-height: 1.3; }
    .legal-container ul { padding-left: 20px; }
    .legal-container p, .legal-container li { font-size: .95rem; overflow-wrap: anywhere; }
    .footer-inner { padding: 28px var(--mobile-gutter) 80px !important; }
    .footer a { display: inline-flex; align-items: center; min-height: 44px; }

    /* Reachable cart actions with browser chrome, keyboard and safe areas. */
    .floating-cart-btn { width: 52px !important; height: 52px !important; bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important; right: max(16px, env(safe-area-inset-right, 0px)) !important; }
    /* These flows open the cart from their CTA or the shared menu, without a floating obstruction. */
    body:has(#calcForm, #namingForm, #bookDate, #astroForm, .dashboard-split-layout, .product-container, .hero-premium) .floating-cart-btn { display: none; }
    body:has(input:focus, textarea:focus, select:focus) .floating-cart-btn { visibility: hidden; }
    .cart-drawer { width: min(100vw, 420px) !important; max-width: 100%; height: 100dvh; border-radius: 22px 0 0 22px; }
    .cart-drawer-header { padding: max(20px, env(safe-area-inset-top, 0px)) 18px 16px; }
    .cart-drawer-title { font-size: 1.05rem; }
    .cart-drawer-close { flex-shrink: 0; min-width: 44px; min-height: 44px; }
    .cart-drawer-items { padding: 8px 18px; }
    .cart-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; padding: 18px 0; }
    .cart-item-icon { grid-column: 1; grid-row: 1; }
    .cart-item-details { grid-column: 2; grid-row: 1; }
    .cart-item-remove { grid-column: 3; grid-row: 1; min-height: 44px; min-width: 44px; }
    .cart-qty-controls { grid-column: 2; justify-self: start; gap: 12px; padding: 0; }
    .cart-qty-controls button { min-height: 44px; min-width: 44px; }
    .cart-drawer-footer { padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .cart-checkout-btn { font-size: .9rem; letter-spacing: .2px; border-radius: 14px; min-height: 52px; }
    .astro-toast { bottom: calc(94px + env(safe-area-inset-bottom, 0px)); font-size: 12px; border-radius: 14px; }
    .founder-modal-card, .checkout-modal-card { width: calc(100% - 24px) !important; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px 20px !important; }
}

@media screen and (max-width: 560px) {
    #namingForm, .shop-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .kp-fields { grid-template-columns: minmax(0, 1fr); }
    .kp-place-search { flex-direction: column; }
    .kp-form-actions > button { width: 100%; }
}
@media screen and (max-width: 359px) {
    .site-shell .mobile-brand { font-size: 13px; gap: 5px; }
    .mobile-brand > svg { width: 20px; }
    .mobile-brand small { font-size: 8px; letter-spacing: .8px; }
    .site-shell .header-actions { gap: 4px !important; }
    .site-shell #authHeaderBtn { padding: 0 8px !important; }
    .hero-premium-title { letter-spacing: -.8px !important; }
    .premium-card { padding: 16px 12px !important; }
    .founder-name-plate { gap: 8px !important; padding: 12px 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   COSMIC TOOLS SHARED PREMIUM TOP BAR
   One header language, rhythm and responsive behavior for every public page.
   This is intentionally last so legacy page-specific header styles cannot
   change the top bar from screen to screen.
   ========================================================================== */
header.header {
    position: fixed !important;
    inset: 0 0 auto !important;
    z-index: 1000 !important;
    height: 78px !important;
    min-height: 78px !important;
    box-sizing: border-box !important;
    padding: 0 28px !important;
    background: linear-gradient(180deg, rgba(10, 12, 18, .98), rgba(15, 17, 24, .91)) !important;
    border-bottom: 1px solid rgba(232, 168, 56, .17) !important;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .17) !important;
    backdrop-filter: blur(18px) saturate(125%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
}
header.header::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -1px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(232, 168, 56, .44), transparent);
}
header.header .header-inner {
    width: min(1320px, 100%) !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: minmax(205px, auto) minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 28px !important;
    padding: 0 !important;
}
header.header .premium-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 11px !important;
    min-width: 0 !important;
    color: #f2ead9 !important;
    text-decoration: none !important;
}
header.header .premium-brand-mark {
    display: grid !important;
    flex: 0 0 auto !important;
    place-items: center !important;
    width: 34px !important;
    height: 34px !important;
    border: 1px solid rgba(232, 168, 56, .64) !important;
    border-radius: 50% !important;
    color: #f0c66f !important;
    background: radial-gradient(circle, rgba(232, 168, 56, .18), rgba(232, 168, 56, .03) 67%, transparent 68%) !important;
    box-shadow: inset 0 0 0 4px rgba(232, 168, 56, .04), 0 0 20px rgba(232, 168, 56, .09) !important;
    font-size: 16px !important;
    line-height: 1 !important;
}
header.header .premium-brand-copy {
    display: flex !important;
    min-width: 0 !important;
    flex-direction: column !important;
    gap: 4px !important;
    line-height: 1 !important;
}
header.header .premium-brand-copy > span {
    overflow: hidden !important;
    color: #f3ecdc !important;
    font-family: var(--font-display, 'Outfit', sans-serif) !important;
    font-size: 1.03rem !important;
    font-weight: 700 !important;
    letter-spacing: .01em !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
header.header .premium-brand-copy small {
    color: #bca979 !important;
    font-family: var(--font-sans, 'Inter', sans-serif) !important;
    font-size: .48rem !important;
    font-weight: 600 !important;
    letter-spacing: .18em !important;
    white-space: nowrap !important;
}
header.header .nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
}
header.header .nav-link {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: #a9a9a5 !important;
    font-family: var(--font-sans, 'Inter', sans-serif) !important;
    font-size: .68rem !important;
    font-weight: 600 !important;
    letter-spacing: .045em !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease !important;
}
header.header .nav-link:hover,
header.header .nav-link[aria-current="page"],
header.header .nav-link.active {
    border-color: rgba(232, 168, 56, .2) !important;
    color: #f0ca77 !important;
    background: rgba(232, 168, 56, .08) !important;
}
header.header .nav-link:hover { transform: translateY(-1px) !important; }
header.header .mobile-nav-cart { display: none !important; }
header.header .nav-link.active::after,
header.header .nav-link[aria-current="page"]::after {
    content: '' !important;
    position: absolute !important;
    right: 14px !important;
    bottom: 4px !important;
    left: 14px !important;
    width: auto !important;
    height: 1px !important;
    border-radius: 1px !important;
    background: linear-gradient(90deg, transparent, #e8a838, transparent) !important;
    transform: none !important;
}
header.header .header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    min-width: max-content !important;
}
header.header .lang-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 66px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid rgba(232, 168, 56, .2) !important;
    border-radius: 999px !important;
    color: #b9b6ad !important;
    background: rgba(255, 255, 255, .025) !important;
    font-family: var(--font-sans, 'Inter', sans-serif) !important;
    font-size: .65rem !important;
    font-weight: 700 !important;
    letter-spacing: .06em !important;
}
header.header .lang-toggle:hover { border-color: rgba(232, 168, 56, .6) !important; color: #f0ca77 !important; }
header.header .lang-toggle .active-lang { color: #f0ca77 !important; }
header.header #profileContainer { position: relative !important; }
header.header:not(.auth-signed-in):not(.auth-signed-out) :is(#authHeaderBtn, #authProfilePic) { visibility: hidden !important; pointer-events: none !important; }
header.header.auth-loading #authHeaderBtn { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
header.header.auth-loading #authProfilePic { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
header.header.auth-signed-in #authHeaderBtn { display: none !important; }
header.header.auth-signed-in #authProfilePic { display: inline-block !important; }
header.header.auth-signed-out #authHeaderBtn { display: inline-flex !important; }
header.header.auth-signed-out #authProfilePic { display: none !important; }
header.header #authHeaderBtn {
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    min-width: 82px !important;
    min-height: 36px !important;
    padding: 0 15px !important;
    border: 1px solid rgba(232, 168, 56, .48) !important;
    border-radius: 999px !important;
    color: #f0ca77 !important;
    background: rgba(232, 168, 56, .04) !important;
    font-family: var(--font-sans, 'Inter', sans-serif) !important;
    font-size: .68rem !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;
    white-space: nowrap !important;
}
header.header #authHeaderBtn:hover { color: #16120b !important; background: #e8a838 !important; }
header.header #authProfilePic { width: 36px !important; height: 36px !important; border: 1px solid rgba(232, 168, 56, .7) !important; object-fit: cover !important; }
header.header #authMenu { top: calc(100% + 12px) !important; }
header.header .mobile-menu-btn { display: none !important; }

@media screen and (max-width: 1100px) {
    header.header {
        height: var(--mobile-header) !important;
        min-height: var(--mobile-header) !important;
        padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)) !important;
        background: rgba(12, 14, 21, .96) !important;
        backdrop-filter: blur(18px) saturate(125%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
    }
    header.header .header-inner {
        display: flex !important;
        flex-flow: row nowrap !important;
        justify-content: space-between !important;
        gap: 10px !important;
        height: 68px !important;
    }
    header.header .premium-brand { flex: 1 1 auto !important; min-width: 0 !important; gap: 8px !important; }
    header.header .premium-brand-mark { width: 30px !important; height: 30px !important; font-size: 14px !important; }
    header.header .premium-brand-copy > span { font-size: .9rem !important; }
    header.header .premium-brand-copy small { font-size: .42rem !important; letter-spacing: .14em !important; }
    header.header .header-actions { flex: 0 0 auto !important; gap: 6px !important; }
    header.header .lang-toggle,
    header.header #authHeaderBtn,
    header.header #authProfilePic,
    header.header .mobile-menu-btn { min-width: 42px !important; min-height: 42px !important; }
    header.header .lang-toggle { padding: 0 7px !important; font-size: .62rem !important; }
    header.header #authHeaderBtn { min-width: 75px !important; padding: 0 9px !important; font-size: .62rem !important; }
    header.header #authProfilePic { width: 42px !important; height: 42px !important; }
    header.header .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid rgba(232, 168, 56, .25) !important;
        border-radius: 12px !important;
        color: #efe2c7 !important;
        background: rgba(255, 255, 255, .035) !important;
    }
    header.header .nav {
        position: fixed !important;
        top: calc(var(--mobile-header) + 10px) !important;
        right: max(14px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: min(360px, calc(100vw - 28px)) !important;
        max-height: calc(100dvh - var(--mobile-header) - 28px) !important;
        padding: 20px 14px max(14px, env(safe-area-inset-bottom, 0px)) !important;
        gap: 5px !important;
        border: 1px solid rgba(232, 168, 56, .28) !important;
        border-radius: 20px !important;
        background: linear-gradient(145deg, rgba(31, 33, 45, .99), rgba(15, 17, 25, .99)) !important;
        box-shadow: 0 24px 70px rgba(0, 0, 0, .62) !important;
    }
    header.header .nav::before { padding: 1px 12px 12px !important; color: #bda975 !important; }
    header.header .nav-link {
        justify-content: flex-start !important;
        min-height: 46px !important;
        padding: 12px 14px !important;
        border-color: transparent !important;
        border-radius: 12px !important;
        font-size: .78rem !important;
        letter-spacing: .07em !important;
        text-transform: uppercase !important;
    }
    header.header .nav-link.active::after,
    header.header .nav-link[aria-current="page"]::after { display: none !important; }
    header.header .mobile-nav-cart { display: flex !important; }
}

@media screen and (max-width: 380px) {
    header.header .premium-brand-copy > span { font-size: .82rem !important; }
    header.header .premium-brand-copy small { font-size: .38rem !important; }
    header.header .header-actions { gap: 4px !important; }
    header.header #authHeaderBtn { min-width: 42px !important; width: 42px !important; padding: 0 !important; font-size: 0 !important; }
    header.header #authHeaderBtn::before { content: '↗'; font-size: 1rem !important; }
}

/* Keep account controls in one stable slot during asynchronous session restore. */
header.header #profileContainer {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 82px !important;
    width: 82px !important;
    min-height: 36px;
}
header.header:not(.auth-signed-in):not(.auth-signed-out) #profileContainer::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 1px solid #dfc28a25;
    border-radius: 50%;
    background: linear-gradient(100deg, #dfc28a09 25%, #dfc28a1b 50%, #dfc28a09 75%);
    background-size: 200% 100%;
    animation: auth-skeleton-shimmer 1.6s ease-in-out infinite;
    pointer-events: none;
}
.auth-gate[hidden], .auth-checkout-loading[hidden] { display: none !important; }
.auth-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.auth-skeleton {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    background: linear-gradient(100deg, #ffffff05 25%, #ffffff0a 50%, #ffffff05 75%);
    background-size: 200% 100%;
    animation: auth-skeleton-shimmer 1.6s ease-in-out infinite;
}
@keyframes auth-skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.checkout-container.auth-checkout-loading { position: relative; margin-top: 110px; }
.auth-checkout-loading-form, .auth-checkout-loading-summary { padding: 28px; border: 1px solid #ffffff0d; border-radius: 18px; background: #171b22; }
.auth-checkout-loading-title { width: 55%; height: 24px; margin-bottom: 28px; }
.auth-checkout-loading-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.auth-checkout-loading-fields > span { height: 64px; }
.auth-checkout-loading-action { height: 52px; margin-top: 28px; }
.auth-checkout-loading-summary > span:not(:first-child) { height: 48px; margin-top: 24px; }
@media screen and (max-width: 1100px) {
    header.header #profileContainer { flex-basis: 75px !important; width: 75px !important; min-height: 42px; }
    header.header:not(.auth-signed-in):not(.auth-signed-out) #profileContainer::before { width: 42px; height: 42px; }
    .checkout-container.auth-checkout-loading { margin-top: calc(var(--mobile-header) + 24px); }
}
@media screen and (max-width: 560px) {
    .auth-checkout-loading-form, .auth-checkout-loading-summary { padding: 22px; }
    .auth-checkout-loading-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media screen and (max-width: 380px) {
    header.header #profileContainer { flex-basis: 42px !important; width: 42px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-skeleton, header.header #profileContainer::before { animation: none; }
}
