        html, body { max-width: 100%; overflow-x: clip; }
        /* Form uses flex-wrap, no scrolling needed */
        #rva-software-form { overflow: visible; }
        #rva-panchang-bar { overflow: hidden; }
        #main-content, #rva-results { overflow-x: clip; }
        /* Ensure form dropdowns overlay panchang bar and other content */
        #birth-data-form [data-popover] { z-index: 200; }
        /* Stepper +/- buttons: accent hover */
        .rva-stepper-btn:hover { background: var(--accent, #f1defa) !important; }
        .rva-stepper-btn:active { background: var(--purple-40, #c084fc) !important; color: #fff !important; }

        /* ─── South Indian Chart Grid (exact match /rva-softwares/ rc-chart style) ─── */
        .rc-chart {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            grid-template-rows: repeat(4, 1fr);
            border: 3px solid #333333;
            aspect-ratio: 1/1;
            max-width: 460px;
            margin: 0 auto;
            background: #fefddc;
        }
        [data-theme="dark"] .rc-chart { background: #000000; border-color: #2a2a2a; }
        .rc-chart-cell {
            border: 2px solid #333333;
            padding: 3px;
            font-size: 11px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        [data-theme="dark"] .rc-chart-cell { border-color: #2a2a2a; }
        [data-theme="dark"] #rva-advanced-panel .border-border { border-color: #1a1a1a; }
        .rc-chart-cell.rc-asc { background: var(--yellow-10, #fef9c3); }
        [data-theme="dark"] .rc-chart-cell.rc-asc { background: rgba(254, 194, 30, 0.1); }
        .rc-chart-sign { font-weight: 600; color: var(--purple-60, #7c3aed); font-size: 10px; margin-bottom: 1px; }
        [data-theme="dark"] .rc-chart-sign { color: var(--purple-40, #a78bfa); }
        .rc-chart-house { position: absolute; top: 1px; right: 3px; font-size: 8px; color: var(--grey-40, #9ca3af); }
        .rc-chart-cusp { color: var(--red-60, #dc2626); font-size: 10px; line-height: 1.3; }
        .rc-chart-planet { color: var(--grey-90, #1f2937); font-size: 10px; line-height: 1.3; }
        [data-theme="dark"] .rc-chart-planet { color: var(--grey-10, #e5e7eb); }
        .retro-year-select {
            padding: 4px 8px; border: 1px solid var(--border, #d1d5db); border-radius: 6px;
            font-size: 0.875rem; background: var(--background, #fff); color: var(--foreground, #1f2937);
        }
        [data-theme="dark"] .retro-year-select { background: #000000; color: var(--foreground, #fbfbfb); border-color: #2a2a2a; }

        /* ─── Planet + house cusp hover effect on SVG chart (pink) ─── */
        svg .planet-text,
        svg .house-element,
        svg .house-text { transition: fill 0.15s ease; cursor: pointer; }
        svg .planet-text:hover,
        svg .house-element:hover,
        svg .house-text:hover { fill: #ec4899 !important; }
        /* Dark mode: global.css recolors these glyphs via [data-theme="dark"] svg text[...]
           with !important at specificity 0,2,2 — we need a higher-specificity override so
           the hover actually wins. html[data-theme="dark"] + svg + .class + :hover = 0,3,2. */
        html[data-theme="dark"] svg .planet-text:hover,
        html[data-theme="dark"] svg .house-element:hover,
        html[data-theme="dark"] svg .house-text:hover { fill: #ec4899 !important; }

        /* ─── Dasha Bars ─── */
        .dasha-bar-container { display: flex; flex-direction: column; gap: 6px; }
        .dasha-bar-row { display: flex; align-items: center; gap: 8px; }
        .dasha-bar-label { width: 60px; font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; }
        .dasha-bar-track { flex: 1; height: 22px; background: #f3f4f6; border-radius: 4px; overflow: hidden; position: relative; }
        [data-theme="dark"] .dasha-bar-track { background: #111111; }
        .dasha-bar-fill { height: 100%; display: flex; align-items: center; padding: 0 6px; font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap; border-radius: 4px; }
        .dasha-bar-years { width: 90px; font-size: 11px; color: #6b7280; flex-shrink: 0; }

        /* ─── Prevent scroll anchoring on dynamic sections ─── */
        #rva-prog-mount, #rva-transit-mount, #rva-dasha-mount, #rva-results { overflow-anchor: none; }

        /* ─── Compact Dasha Overrides ─── */
        #rva-dasha-mount .antara-container { min-height: 60px; }
        #rva-dasha-mount .antara-period { padding: 10px 8px 8px; min-width: 70px; }
        #rva-dasha-mount .antara-planet { display: flex; align-items: center; font-size: 12px; gap: 4px; margin-bottom: 2px; width: 100%; }
        #rva-dasha-mount .antara-planet-symbol { font-size: 14px; }
        #rva-dasha-mount .antara-duration { font-size: 10px; margin-top: 2px; }
        #rva-dasha-mount .dasha-header { padding: 6px 12px; border-radius: 10px 10px 0 0; }
        #rva-dasha-mount .dasha-header-content { display: flex; align-items: center; }
        #rva-dasha-mount .dasha-header-left { display: flex; align-items: center; flex-wrap: wrap; row-gap: 2px; }
        #rva-dasha-mount .dasha-nav-buttons { display: flex; align-items: center; gap: 3px; }
        #rva-dasha-mount .dasha-planet-icon { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; background: var(--background, #fff); flex-shrink: 0; }
        #rva-dasha-mount .dasha-timeline { padding: 5px 12px 7px; border-radius: 0 0 10px 10px; }
        #rva-dasha-mount .dasha-timeline-border { width: 100%; border-top: 1px solid var(--border, #e5e7eb); padding-top: 5px; }
        #rva-dasha-mount .dasha-timeline-years { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; color: var(--muted-foreground, #6b7280); font-variant-numeric: tabular-nums; }
        #rva-dasha-mount .dasha-timeline-years span:hover { color: #2563eb; font-weight: 600; }
        #rva-dasha-mount .antara-period.current { background: #f0fdf4 !important; box-shadow: inset 0 -3px 0 0 #16a34a; }
        #rva-dasha-mount .antara-period.current .antara-planet-symbol { color: #16a34a; }
        [data-theme="dark"] #rva-dasha-mount .antara-period.current { background: #052e16 !important; box-shadow: inset 0 -3px 0 0 #4ade80; }
        [data-theme="dark"] #rva-dasha-mount .antara-period.current .antara-planet-symbol { color: #4ade80; }

        /* ─── Vimshottari Dasha Tree ─── uses global.css styles */

        /* ─── Aspects ─── */
        .aspect-red { color: #ef4444; font-weight: 600; }
        .aspect-black { color: #1f2937; }
        [data-theme="dark"] .aspect-black { color: #e5e7eb; }

        /* ─── Capacity Table ─── */
        .cap-table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .cap-table th { background: #f3f4f6; padding: 6px 8px; text-align: left; font-weight: 600; border-bottom: 2px solid #d1d5db; }
        [data-theme="dark"] .cap-table th { background: #111111; border-color: #2a2a2a; }
        .cap-table td { padding: 5px 8px; border-bottom: 1px solid #e5e7eb; }
        [data-theme="dark"] .cap-table td { border-color: #1a1a1a; }
        .cap-table tr:hover td { background: #f9fafb; }
        [data-theme="dark"] .cap-table tr:hover td { background: #111111; }

        /* ─── Score colors (matches /rva-softwares/ score-* gradient style) ─── */
        .sc-100 { color: #059669; font-weight: 700; }
        .sc-80 { color: #16a34a; font-weight: 600; }
        .sc-60 { color: #d97706; font-weight: 600; }
        .sc-low { color: #dc2626; font-weight: 600; }

        /* ─── Section Cards ─── */
        .rva-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 1.25rem; margin-bottom: 1.5rem; }
        [data-theme="dark"] .rva-section { background: #000000; border-color: #2a2a2a; }
        .rva-section h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 1rem 0; padding-bottom: 0.5rem; border-bottom: 2px solid #e5e7eb; }
        [data-theme="dark"] .rva-section h2 { border-color: #2a2a2a; }

        /* ─── Loading placeholder (hidden by default, no spinners) ─── */
        .rva-loading { display: none; }

        /* ─── Skeleton chart pulse (matches /rva-softwares-wasm/ style) ─── */
        .skeleton-chart { animation: skeleton-pulse 1.5s ease-in-out infinite; }
        @keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        [data-theme="dark"] .skeleton-chart svg rect,
        [data-theme="dark"] .skeleton-chart svg line { stroke: #2a2a2a; }
        [data-theme="dark"] .skeleton-chart svg text { fill: #444; }

        /* ─── Layout ─── */
        .rva-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
        @media (max-width: 768px) {
            .rva-grid-2 { grid-template-columns: 1fr; }
            .rc-chart { max-width: 100%; }
            #rva-charts-display { flex-direction: column; align-items: stretch; gap: 0; }
            #rva-charts-display .chart-section { width: 100%; max-width: 100% !important; min-width: 0; margin-bottom: 12px; }
            /* Dasha bars tighter */
            .dasha-bar-label { width: 40px; font-size: 10px; }
            .dasha-bar-years { width: 70px; font-size: 10px; }
            /* Planet/House tables side-by-side → stack */
            #rva-kp-tables .grid { grid-template-columns: 1fr !important; }
            /* Ashtakavarga controls wrap */
            #rva-ashtakavarga .flex { flex-wrap: wrap; }
        }
        @media (max-width: 480px) {
            #main-content, #rva-results { padding-left: 0.5rem; padding-right: 0.5rem; }
            #birth-data-form { padding: 0.3rem; }
            .dasha-bar-label { width: 32px; font-size: 9px; }
            .dasha-bar-years { width: 60px; font-size: 9px; }
            .dasha-bar-track { height: 18px; }
            .dasha-bar-fill { font-size: 8px; }
        }

        .rva-hidden { display: none; }

        /* Planet toggle checkboxes under charts */
        .rva-planet-toggles { display:flex; flex-wrap:nowrap; justify-content:space-evenly; align-items:center; padding:3px 0; margin-top:0; margin-bottom:12px; border:1px solid #e5e5e5; border-top:0; }
        [data-theme="dark"] .rva-planet-toggles { border-color:#2a2a2a; }
        .rva-planet-toggles label { display:flex; align-items:center; gap:1px; font-size:9px; color:var(--muted-foreground,#6b7280); cursor:pointer; user-select:none; white-space:nowrap; }
        .rva-planet-toggles input { width:11px; height:11px; accent-color:#6366f1; }
        .rva-planet-toggles .rva-sep { font-size:9px; margin:0; color:var(--border,#d1d5db); line-height:1; }
        [data-theme="dark"] .rva-planet-toggles .rva-sep { color:#2a2a2a; }

        /* Shimmer uses .skeleton-shimmer from UI library (ui.css) */

        /* KP Tables — scroll container. Explicit overflow-x: auto + visible scrollbar so users can
           horizontal-scroll when the table doesn't fit. Do not set overflow-y (setting both axes blocks swipe on iOS).
           touch-action: pan-x pan-y explicitly allows horizontal swipe inside the table while preserving
           vertical page scroll outside it. */
        #rva-kp-tables .overflow-x-auto {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-x pan-y;
        }
        #rva-kp-tables .overflow-x-auto::-webkit-scrollbar { height: 10px; background: #f1f5f9; }
        #rva-kp-tables .overflow-x-auto::-webkit-scrollbar-thumb { background: #64748b; border-radius: 4px; }
        [data-theme="dark"] #rva-kp-tables .overflow-x-auto::-webkit-scrollbar { background: #1f2937; }

        /* Freeze Planet/House column on horizontal scroll. Solid background so scrolled-under
           text doesn't bleed through. No box-shadow divider — the column blends with the rest. */
        .kp-sticky-table { border-collapse: separate; border-spacing: 0; }
        .kp-sticky-table th:first-child,
        .kp-sticky-table td:first-child {
            position: sticky;
            left: 0;
            z-index: 5;
            background: #ffffff;
        }
        .kp-sticky-table thead th:first-child {
            background: #f8fafc;
            z-index: 6;
        }
        /* Override the row-hover background on the frozen first cell so scrolled text never shows through */
        .kp-sticky-table tbody tr:hover td:first-child { background: #f8fafc; }
        [data-theme="dark"] .kp-sticky-table th:first-child,
        [data-theme="dark"] .kp-sticky-table td:first-child {
            background: #111827;
        }
        [data-theme="dark"] .kp-sticky-table thead th:first-child { background: #1f2937; }
        [data-theme="dark"] .kp-sticky-table tbody tr:hover td:first-child { background: #1f2937; }

        /* Mobile: keep the desktop font size (text-xs / 12px — same as Significators table).
           Keep the 2-line 'Sign<br/>Lord' headers so the Lord columns stay narrow.
           Let the Star cell wrap 'U. Bhadrapada (4)' into two lines so the column doesn't stretch.
           Force a min-width so horizontal scroll reliably activates — this is what makes the
           sticky first column useful. Without min-width, the table tries to fit the card,
           browsers over-squeeze columns, and scroll never kicks in. */
        @media (max-width: 1023.98px) {
            /* Size the table to its content (overrides Tailwind 'w-full' = 100%).
               Without this, w-full + min-width forces the table wider than content needs,
               and the browser distributes the extra width to columns — producing the big
               empty gaps user reported (especially the Star column on House Cusps). */
            .kp-sticky-table { width: auto !important; min-width: 0; }
            .kp-sticky-table th, .kp-sticky-table td { white-space: nowrap; padding: 6px 4px !important; }
            /* Star column: wrap long nakshatras across two lines instead of stretching */
            .kp-sticky-table td.kp-star-cell { white-space: normal; line-height: 1.2; }
            /* Top-align headers so 2-line 'Sign / Lord' stacks cleanly */
            .kp-sticky-table thead th { vertical-align: top; line-height: 1.15; }
        }
