/* JyotishAI — Cosmic Theme */
/* Self-host fonts in assets/fonts/ — see SETUP.md. Falls back to system fonts until added. */
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/cormorant-garamond-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.woff2') format('woff2');
}

:root {
    --bg: #FFFBF5;
    --surface: #FFFFFF;
    --saffron: #ff4500;
    --saffron-dark: #e03e00;
    --saffron-light: #FFEDE8;
    --burgundy: #8B1A4A;
    --text: #2C2416;
    --text-secondary: #6B5E4F;
    --divider: #E8E0D4;
    --danger: #C0392B;
    --success: #1E8449;
    --radius: 16px;
    --max-width: 1100px;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'Courier New', monospace;
    /* legacy alias */
    --gold: var(--saffron);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.cosmic-bg,
.page-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 69, 0, 0.07), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 69, 0, 0.05), transparent),
        url('../img/zodiac-wheel.svg?v=2') center 8% / 420px no-repeat,
        var(--bg);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem 7rem;
}

.page-form .container {
    max-width: 520px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero-symbol {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid rgba(255, 69, 0, 0.18);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(44, 36, 22, 0.04);
}

.form-card {
    padding: 1.5rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--saffron-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--saffron);
    margin-bottom: 0.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.required { color: var(--gold); }
.optional { color: var(--text-secondary); font-weight: 400; }

input[type="text"],
input[type="date"],
input[type="time"],
input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--gold);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.35rem;
    min-height: 1rem;
}

#formError:empty {
    display: none;
}

#formError {
    text-align: center;
    margin: 0.5rem 0 0;
}

.time-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.time-row input[type="time"],
.time-row input[type="text"]#tob {
    flex: 1 1 auto;
    min-width: 0;
}

.ampm-toggle {
    display: flex;
    flex: 0 0 auto;
    flex-shrink: 0;
    border: 1px solid var(--divider);
    border-radius: 10px;
    overflow: hidden;
}

.ampm-btn {
    padding: 0.75rem 0.7rem;
    min-width: 2.6rem;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg);
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.ampm-btn.active {
    background: var(--saffron);
    color: #fff;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
}

.checkbox-label input {
    accent-color: var(--gold);
    width: 1rem;
    height: 1rem;
}

.warning-banner {
    background: var(--saffron-light);
    border: 1px solid rgba(255, 69, 0, 0.35);
    border-radius: 10px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--saffron-dark);
}

.warning-banner.hidden { display: none; }

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
}

.radio-label input {
    accent-color: var(--gold);
}

/* Place autocomplete */
.place-group {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 10px;
    list-style: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.autocomplete-list.hidden { display: none; }

.autocomplete-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--divider);
}

.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover,
.autocomplete-list li.active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 69, 0, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--saffron);
    border-radius: 10px;
    color: var(--saffron-dark);
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
}

.form-footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Result page */
.result-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.result-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.result-meta span + span::before {
    content: ' ';
}

.lagna-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--divider);
}

.lagna-symbol {
    font-size: 2.5rem;
}

.lagna-display strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--saffron-dark);
}

.text-secondary {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Numerology grid */
.num-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.num-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--divider);
}

.num-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.num-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    color: var(--gold);
    font-weight: bold;
}

.num-planet {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.num-hindi {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.folk-label {
    font-size: 0.75rem;
    color: var(--burgundy);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.phone-num-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.masked-phone {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Kundali SVG */
.kundali-wrapper {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.kundali-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.chart-outer {
    fill: none;
    stroke: rgba(201, 168, 76, 0.3);
    stroke-width: 1.5;
}

.chart-inner {
    fill: none;
    stroke: rgba(201, 168, 76, 0.15);
    stroke-width: 1;
}

.house-segment {
    fill: none;
    stroke: rgba(201, 168, 76, 0.2);
    stroke-width: 0.5;
}

.house-label {
    fill: var(--text-secondary);
    font-size: 9px;
    text-anchor: middle;
    dominant-baseline: middle;
}

.planet-glyph-chart {
    fill: var(--gold);
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.planet-glyph-chart.visible {
    opacity: 1;
}

/* Planet table */
.table-scroll {
    overflow-x: auto;
}

.planet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.planet-table th,
.planet-table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--divider);
}

.planet-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.planet-glyph {
    margin-right: 0.25rem;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Info grid */
.info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.95rem;
}

/* Dasha */
.dasha-current {
    background: var(--bg);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--divider);
}

.dasha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}

.dasha-row + .dasha-row {
    border-top: 1px solid var(--divider);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.dasha-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    min-width: 90px;
}

.dasha-lord {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--saffron-dark);
}

.dasha-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Reading blocks */
.reading-block {
    margin-bottom: 1.25rem;
}

.reading-block:last-child {
    margin-bottom: 0;
}

.reading-block h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--saffron-dark);
    margin-bottom: 0.5rem;
}

.reading-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}

/* Gemstone */
.gem-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--divider);
}

.gem-section h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.gem-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.gem-details {
    list-style: none;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.gem-details li {
    padding: 0.2rem 0;
}

.crystal-alt {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.avoid-list {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.avoid-list h3 {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.avoid-list ul {
    list-style: none;
    font-size: 0.85rem;
}

.avoid-list li::before {
    content: '✕ ';
    color: var(--danger);
}

.conflict-msg {
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.conflict-ok {
    background: rgba(30, 132, 73, 0.08);
    border: 1px solid rgba(30, 132, 73, 0.25);
    color: var(--success);
}

.basis-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Disclaimer */
.disclaimer-card {
    font-size: 0.85rem;
}

.disclaimer-block p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.disclaimer-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Share / bottom bar — New Reading + Share side by side */
.share-bar,
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 69, 0, 0.2);
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    align-items: stretch;
    max-width: 100%;
}

.bottom-bar .btn-bar-action {
    flex: 1;
    max-width: 260px;
    margin: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.95rem;
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    line-height: 1.2;
}

.btn-share {
    background: var(--saffron);
    border: none;
    color: #fff;
    cursor: pointer;
}

.bottom-bar .btn-secondary.btn-bar-action {
    background: var(--surface);
    border: 1px solid var(--divider);
    color: var(--text);
}

.page-result .container {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

/* PDF export (share) — mirror print layout on screen */
body.is-pdf-export .no-print,
body.is-pdf-export .screen-only,
body.is-pdf-export .lang-bar,
body.is-pdf-export .bottom-bar {
    display: none !important;
}

body.is-pdf-export .print-only {
    display: block !important;
}

body.is-pdf-export .reveal-card {
    opacity: 1 !important;
    transform: none !important;
}

body.is-pdf-export #printArea {
    background: #fff;
}

/* Language toggle */
.lang-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 251, 245, 0.95);
    border-bottom: 1px solid var(--divider);
}

.lang-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--divider);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--saffron);
    border-color: var(--saffron);
    color: #fff;
    font-weight: 600;
}

/* Bilingual content */
.t-hi { display: none; }
body.lang-hi .t-en { display: none !important; }
body.lang-hi .t-hi { display: inline; }
body.lang-hi .reading-text .t-hi,
body.lang-hi .crystal-benefits .t-hi,
body.lang-hi .crystal-context .t-hi,
body.lang-hi .mulank-note .t-hi { display: block; }
body.lang-hi .card-title .t-hi { display: inline; }

/* Result grid — mobile: single column */
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.result-grid .card {
    margin-bottom: 1rem;
}

.col-full {
    width: 100%;
}

/* Crystal hero — main product */
.crystal-hero {
    background: linear-gradient(180deg, #FFEDE6 0%, var(--surface) 100%);
    border: 2px solid rgba(255, 69, 0, 0.35);
}

.crystal-hero-sub {
    color: var(--saffron-dark);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.crystal-context {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    padding: 0.85rem;
    background: var(--saffron-light);
    border-radius: 10px;
    border-left: 4px solid var(--saffron);
}

.crystal-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.crystal-card {
    background: var(--surface);
    border: 1px solid rgba(255, 69, 0, 0.25);
    border-radius: 14px;
    padding: 1.15rem;
    box-shadow: 0 4px 16px rgba(255, 69, 0, 0.08);
}

.crystal-card-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.crystal-priority {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--saffron);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.9rem;
}

.crystal-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--saffron-dark);
    font-weight: 600;
    line-height: 1.2;
}

.crystal-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.crystal-benefits {
    background: var(--saffron-light);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
}

.crystal-benefits strong {
    display: block;
    color: var(--saffron-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.crystal-benefits p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
}

.crystal-use {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.gem-ref-subtle {
    padding: 0.75rem;
    border-top: 1px dashed var(--divider);
    margin-top: 0.5rem;
}

.gem-ref-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.gem-ref-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mulank-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--divider);
}

.planet-hi {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.5rem 0;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    width: auto;
    min-width: 160px;
    margin-top: 0;
}

.btn-print {
    border: none;
}

.conflict-warning {
    background: var(--saffron-light);
    border: 1px solid rgba(255, 69, 0, 0.35);
    color: var(--saffron-dark);
}

/* Tablet+ — two columns side by side */
@media (min-width: 768px) {
    .container {
        padding: 2rem 1.5rem 7rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .card {
        padding: 1.5rem;
    }

    .result-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }

    .result-grid .card {
        margin-bottom: 0;
        height: 100%;
    }

    .result-grid .col-full {
        grid-column: 1 / -1;
    }

    .crystal-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .crystal-card:first-child {
        grid-column: 1 / -1;
    }
}

@media print {
    .no-print, .bottom-bar, .lang-bar, .page-bg, .astro-wheel-deco { display: none !important; }

    @page {
        size: A4;
        margin: 10mm 12mm 10mm 12mm;
    }

    html, body {
        background: white !important;
        color: #1a1a1a;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .container {
        max-width: 100%;
        padding: 0 !important;
        margin: 0;
    }

    .reveal-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .print-only { display: block !important; }
    .screen-only { display: none !important; }

    .print-doc-header {
        text-align: center;
        padding: 0 0 6px;
        margin-bottom: 6px;
        border-bottom: 2px solid #ff4500;
    }

    .print-doc-header .brand {
        font-family: var(--font-display);
        font-size: 1.1rem;
        color: #ff4500;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .print-doc-contact {
        font-size: 9pt;
        color: #333 !important;
        margin: 3px 0;
    }

    .print-doc-tagline {
        font-size: 8pt;
        color: #666 !important;
    }

    .print-doc-footer {
        text-align: center;
        font-size: 9pt;
        color: #333 !important;
        margin-top: 8px;
        padding-top: 6px;
        border-top: 1px solid #ddd;
    }

    .lo-shu-section {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 8px !important;
        padding: 8px !important;
    }

    .lo-shu-grid {
        max-width: 200px !important;
        gap: 3px !important;
    }

    .lo-shu-cell {
        padding: 3px !important;
    }

    .lo-shu-digits {
        font-size: 10pt !important;
    }

    .lo-shu-remedy-card {
        padding: 5px 8px !important;
        break-inside: avoid;
    }

    .header-card {
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        border: 1px solid #ff4500;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        align-items: start;
        break-after: avoid;
        page-break-after: avoid;
    }

    .header-card .card-badge { margin-bottom: 2px; font-size: 7pt; }
    .header-card .result-name { font-size: 1.15rem; margin-bottom: 2px; }
    .header-card .result-meta { font-size: 8pt; margin-bottom: 4px; }
    .header-card .lagna-display { padding-top: 4px; border-top: none; }
    .header-card .lagna-symbol { font-size: 1.5rem; }

    .header-num-compact {
        background: #fff8f5;
        border: 1px solid #ffd4c2;
        border-radius: 8px;
        padding: 6px 8px;
        margin-top: 6px;
    }

    .header-num-compact .header-num-title {
        font-size: 8pt;
        color: #ff4500;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 4px;
    }

    .header-num-compact .num-grid {
        gap: 4px;
    }

    .header-num-compact .num-item {
        padding: 4px 2px;
    }

    .header-num-compact .num-value {
        font-size: 1.1rem;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    .card-title {
        font-size: 11pt;
        margin-bottom: 6px;
        color: #ff4500;
    }

    .crystal-hero {
        background: #fffaf8 !important;
        padding: 8px 10px !important;
        break-before: avoid;
        page-break-before: avoid;
    }

    .crystal-hero-sub,
    .crystal-use,
    .gem-ref-subtle { font-size: 8pt; }

    .crystal-context {
        padding: 6px 8px;
        margin-bottom: 6px;
        font-size: 8.5pt;
    }

    .crystal-cards {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .crystal-card {
        padding: 6px 8px !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
        box-shadow: none;
    }

    .crystal-card:first-child {
        grid-column: 1 / -1;
    }

    .crystal-name { font-size: 11pt; }
    .crystal-benefits { padding: 5px 6px; }
    .crystal-benefits p { font-size: 8.5pt; line-height: 1.4; }

    .result-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .result-grid .card {
        margin-bottom: 0 !important;
        height: auto !important;
    }

    .result-grid .col-full {
        grid-column: 1 / -1;
    }

    .result-grid > .card:first-child {
        display: none !important;
    }

    .reading-text,
    .planet-table { font-size: 8.5pt; line-height: 1.45; }

    .planet-table th,
    .planet-table td { padding: 3px 4px; }

    .num-grid .num-item { padding: 4px; }
    .num-value { font-size: 1.2rem; }

    .t-hi { display: none !important; }
    body.lang-hi .t-en { display: none !important; }
    body.lang-hi .t-hi { display: block !important; }
}

/* Astro decorative graphics */
.astro-wheel-deco {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 140px;
    height: 140px;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.astro-wheel-deco img,
.astro-wheel-deco svg {
    width: 100%;
    height: 100%;
}

.astro-border {
    position: relative;
    overflow: hidden;
}

.astro-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff4500, transparent);
    opacity: 0.6;
}

.astro-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    opacity: 0.2;
    pointer-events: none;
    color: #ff4500;
    font-size: 1.5rem;
    line-height: 1;
}

.astro-corner--tl { top: 8px; left: 10px; }
.astro-corner--br { bottom: 8px; right: 10px; transform: rotate(180deg); }

.header-card,
.crystal-hero,
.form-card {
    position: relative;
}

.header-main {
    position: relative;
    z-index: 1;
}

.hero-astro-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.5rem;
    opacity: 0.7;
}

.hero-astro-ring img {
    width: 100%;
    height: 100%;
}

.lagna-symbol-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff5f0, #ffe8dc);
    border: 2px solid rgba(255, 69, 0, 0.35);
    box-shadow: 0 4px 16px rgba(255, 69, 0, 0.12);
    flex-shrink: 0;
}

.lagna-symbol-wrap .lagna-symbol {
    font-size: 1.75rem;
}

.planet-orbit-deco {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.5rem 0 0.25rem;
    opacity: 0.45;
    font-size: 0.85rem;
}

/* Lo Shu numerology grid */
.lo-shu-section {
    margin-bottom: 1rem;
}

.lo-shu-summary {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.header-num-compact {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
}

.header-num-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0 0 0.65rem;
    text-align: center;
}

.lo-shu-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.lo-shu-meta strong {
    color: var(--saffron-dark);
    font-size: 1.1rem;
}

.lo-shu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 320px;
    margin: 0 auto 1.25rem;
}

.lo-shu-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2px solid var(--divider);
    background: var(--bg);
    padding: 0.5rem;
    text-align: center;
}

.lo-shu-cell.is-present {
    border-color: rgba(255, 69, 0, 0.45);
    background: #fff8f5;
}

.lo-shu-cell.is-missing {
    border-color: #ccc;
    background: #f5f5f5;
    border-style: dashed;
}

.lo-shu-pos {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.lo-shu-digits {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--saffron-dark);
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.lo-shu-empty {
    font-size: 1.25rem;
    color: #bbb;
}

.lo-shu-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.lo-shu-cell.is-missing .lo-shu-status {
    color: #c62828;
}

.lo-shu-distinct {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    font-style: italic;
}

.crystal-source {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--saffron-dark);
    margin: 0.15rem 0 0.35rem;
}

.lo-shu-remedies-title {
    font-size: 1rem;
    color: var(--saffron-dark);
    margin: 1rem 0 0.75rem;
}

.lo-shu-remedy-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lo-shu-remedy-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--saffron-light);
    border-radius: 12px;
    border-left: 4px solid var(--saffron);
}

.lo-shu-remedy-num {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--saffron);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 1rem;
}

.lo-shu-remedy-crystal {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--saffron-dark);
    margin-bottom: 0.25rem;
}

.lo-shu-remedy-issue,
.lo-shu-remedy-reason {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text);
    margin: 0.15rem 0;
}

.lo-shu-remedy-issue {
    color: var(--text-secondary);
}

.lo-shu-bonus {
    margin-top: 0.85rem;
    padding: 0.75rem;
    background: #fff8f5;
    border-radius: 10px;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 69, 0, 0.2);
}

@media (min-width: 640px) {
    .lo-shu-grid {
        max-width: 360px;
    }

    .lo-shu-remedy-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

.print-doc-contact {
    font-size: 9pt;
    color: #444;
    margin: 2px 0;
    letter-spacing: 0.02em;
}

.print-doc-tagline {
    font-size: 8pt;
    color: #888;
}

.print-only { display: none; }
.screen-only { display: block; }

.print-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Scroll reveal */
.reveal-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}
