/* =========================================================
   Star Gaze Vedic Astrology Design System
   Celestial Midnight & Royal Gold Theme
   ========================================================= */

:root {
    --bg-void: #060912;
    --bg-surface: #0c1324;
    --bg-card: #121c33;
    --bg-card-hover: #182542;
    --border-subtle: #223252;
    --border-gold: #c99738;
    --gold-primary: #e5a93b;
    --gold-glow: rgba(229, 169, 59, 0.25);
    --gold-bright: #fcd34d;
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #38bdf8;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-void);
    background-image: 
        radial-gradient(at 0% 0%, rgba(229, 169, 59, 0.07) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, .font-serif {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.03em;
}

h4, h5, .font-display {
    font-family: 'Outfit', sans-serif;
}

/* App Header */
.app-header {
    background: rgba(12, 19, 36, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    display: block;
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 0 10px var(--gold-glow));
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 40%, var(--gold-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

/* Toggle Buttons */
.style-toggle-group {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-btn.active {
    background: var(--gold-primary);
    color: #000;
    box-shadow: 0 2px 8px var(--gold-glow);
}

/* Main Container */
.main-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
}

/* Glass Card */
.glass-panel {
    background: rgba(18, 28, 51, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(201, 151, 56, 0.4);
}

/* Birth Data Form Grid */
.form-title {
    font-size: 1.15rem;
    color: var(--gold-bright);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.birth-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;   /* a select is as wide as its longest option; let the column shrink it */
}

.form-field label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-control {
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px var(--gold-glow);
}

/* City search and timezone lookup */
.city-field {
    position: relative;
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 4px;
    padding: 4px 0;
    list-style: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    max-height: 300px;
    overflow-y: auto;
}

.city-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 12px;
    font-size: 0.86rem;
    color: var(--text-primary);
    cursor: pointer;
}

.city-suggestion.active,
.city-suggestion:hover {
    background: rgba(229, 169, 59, 0.12);
}

.city-suggestion-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.city-suggestion.empty {
    color: var(--text-muted);
    cursor: default;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--gold-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:disabled {
    opacity: 0.5;
    cursor: wait;
}

.tz-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -0.35rem;
}

.tz-note:empty {
    display: none;
}

.tz-note.warning {
    color: var(--gold-bright);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-primary) 100%);
    color: #080c16;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--gold-glow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(229, 169, 59, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(229, 169, 59, 0.1);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--gold-bright);
    border-bottom-color: var(--gold-primary);
    text-shadow: 0 0 12px var(--gold-glow);
}

/* Tab Panels */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Charts Dual Display */
.charts-dual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.chart-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chart-title {
    font-size: 1.1rem;
    color: var(--gold-primary);
    font-weight: 700;
}

.chart-badge {
    background: rgba(229, 169, 59, 0.15);
    color: var(--gold-bright);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.chart-svg-container {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-svg-container svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
}

/* One line under the North Indian charts: how to read the numbers */
.chart-caption {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    margin: 1rem auto 1.5rem;
    max-width: 60ch;
}

/* The overview's chart grid already leaves 1.5rem below it */
.charts-dual-grid + .chart-caption {
    margin-top: -0.5rem;
}

/* Panchanga Strip */
.panchanga-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    background: rgba(12, 19, 36, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.panch-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.panch-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panch-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-bright);
}

/* Table Styling */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.astro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
    background: var(--bg-card);
}

.astro-table th {
    background: rgba(8, 12, 22, 0.9);
    color: var(--gold-primary);
    padding: 12px 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.astro-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.astro-table tr:hover td {
    background: rgba(229, 169, 59, 0.04);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-exalted { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.badge-debilitated { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }
.badge-neutral { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); border: 1px solid rgba(148, 163, 184, 0.35); }
.badge-moolatrikona { background: rgba(229, 169, 59, 0.2); color: #fcd34d; border: 1px solid #e5a93b; }
.badge-own { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid #38bdf8; }
.badge-friend { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge-enemy { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.badge-retro { background: rgba(239, 68, 68, 0.25); color: #ff6b6b; font-weight: 700; margin-left: 4px; }
.badge-combust { background: rgba(234, 88, 12, 0.25); color: #fdba74; font-weight: 700; margin-left: 4px; }

/* Graha Drishti (planetary aspects) */
.aspect-sign {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.aspect-none {
    color: var(--text-muted);
}

.aspects-mutual {
    margin-top: 0.9rem;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.aspects-subtitle {
    margin: 1.25rem 0 0.6rem;
    font-size: 0.95rem;
    color: var(--gold-primary);
}

.aspects-house-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);  /* 12 houses in two even rows */
    gap: 8px;
}

@media (max-width: 900px) {
    .aspects-house-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
    .aspects-house-grid { grid-template-columns: repeat(2, 1fr); }
}

.aspect-house-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.82rem;
}

.aspect-house-card.empty {
    opacity: 0.6;
}

.aspect-house-title {
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 2px;
}

/* Shodashavarga Grid */
.vargas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1.25rem;
}

.varga-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.varga-tile:hover {
    transform: translateY(-3px);
    border-color: var(--gold-primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.varga-tile-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 2px;
}

.varga-tile-sig {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

/* Birth panel: saved-chart note, New chart and sample buttons */
.birth-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.saved-chart-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.saved-charts {
    max-width: min(16rem, 100%);
    padding: 7px 10px;
}

/* The place the chart will use (under the city field) */
.place-confirm {
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold-primary);
    background: rgba(229, 169, 59, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: grid;
    gap: 2px;
}

.place-confirm.warning {
    border-color: var(--accent-red);
    border-left-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

.place-confirm-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.place-confirm-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-bright);
    overflow-wrap: anywhere;
}

.place-confirm-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.place-confirm-warning {
    font-size: 0.85rem;
    color: var(--accent-red);
    font-weight: 600;
}

/* Whose chart and where, above the tabs */
.chart-identity {
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--gold-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 10px 14px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.chart-identity strong {
    color: var(--text-primary);
}

/* The customer's downloads, under the chart line */
.download-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: -0.5rem 0 1rem;
}

.download-bar button {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.download-bar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Account bar in the header */
.account-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.account-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.account-bar .btn-link {
    font-size: 0.8rem;
}

/* Welcome panel and the log-in / sign-up form */
.welcome-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
    gap: 1.5rem 2.5rem;
    align-items: start;
}

.welcome-text {
    display: grid;
    gap: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 0.9rem;
    max-width: 24rem;
    width: 100%;
}

.auth-switch {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
}

.auth-switch .toggle-btn {
    flex: 1;
    justify-content: center;
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-error {
    font-size: 0.85rem;
    color: var(--accent-red);
    white-space: pre-line;
}

.auth-error:empty {
    display: none;
}

.auth-error.ok {
    color: var(--accent-green);
}

/* Admin panel and account page */
.page-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.5rem 0 1rem;
}

/* Privacy and Terms pages, the site footer and the signup consent line (2026-10-22) */
.legal-page .glass-panel { max-width: 760px; }
.legal-heading {
    color: var(--gold-bright);
    font-size: 1rem;
    margin: 1.25rem 0 0.25rem;
}
.legal-list {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.25rem 0 1rem 1.25rem;
}
.legal-list li { margin-bottom: 0.35rem; }
.legal-updated { color: var(--text-muted); font-size: 0.8rem; margin-top: 0; }
.legal-disclaimer { border-left: 3px solid var(--border-gold); padding-left: 0.75rem; color: var(--text-primary); }
.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    padding: 1.5rem 16px 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}
.site-footer a, .auth-legal a { color: var(--text-secondary); }
.auth-legal { color: var(--text-muted); font-size: 0.75rem; line-height: 1.5; margin: 0.5rem 0 0; }

.account-page {
    max-width: 44rem;
}

.admin-table td {
    vertical-align: top;
}

.admin-email {
    min-width: 14rem;
    overflow-wrap: anywhere;
}

.admin-table td:nth-child(2),
.admin-table td:nth-child(3) {
    white-space: nowrap;
}

.admin-charts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.btn-secondary.danger {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Dasha Tree View */
.dasha-cycle-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.dasha-cycle-note {
    color: var(--text-muted);
}

.dasha-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dasha-row {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.dasha-row.active {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px var(--gold-glow);
}

.dasha-header {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;   /* on a phone the dates go under the lord */
    gap: 4px 12px;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.dasha-header:hover {
    background: rgba(229, 169, 59, 0.05);
}

.dasha-lord-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dasha-dates {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dasha-dates span {
    white-space: nowrap;   /* never break inside a date */
}

.sub-dasha-container {
    padding: 0 16px 12px 36px;
    overflow-x: auto;   /* the Pratyantardasha table is wider than a phone */
    display: none;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.dasha-row.expanded .sub-dasha-container {
    display: block;
}

.ad-row.has-pds {
    cursor: pointer;
}

.ad-caret {
    display: inline-block;
    width: 1em;
    color: var(--text-muted);
    transition: var(--transition);
}

.ad-row.open .ad-caret {
    transform: rotate(90deg);
}

.pd-row > td {
    padding: 4px 0 12px 24px;
}

.pd-table {
    font-size: 0.8rem;
}

.pd-table th,
.pd-table td {
    padding: 6px 10px;
}

/* Ashtakavarga Matrix */
.matrix-container {
    margin-top: 1.5rem;
}

.matrix-cell-high {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    font-weight: 700;
}

.matrix-cell-low {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* Modal for Chart Zoom */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    padding: 2rem;
    max-width: 540px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 1rem;
    }
    .main-wrapper {
        padding: 1rem;
    }
    .birth-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   Astrologer Comprehensive Report & Remedies Styles
   ========================================================= */

/* Keep the hidden attribute working on elements that set their own display */
[hidden] {
    display: none !important;
}

.report-document {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Brand line above the report title; it also marks the printed report */
.report-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--gold-primary);
}

.report-error {
    border-color: var(--accent-red);
    line-height: 1.6;
}

.report-section-title {
    font-size: 1.15rem;
    color: var(--gold-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Yogas Grid */
.yogas-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

.yoga-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.yoga-item-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.yoga-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yoga-card-title {
    font-weight: 700;
    color: var(--gold-primary);
    font-size: 0.95rem;
}

.yoga-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Heading above a domain's divisional-chart notes */
.looking-ahead p {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.looking-ahead p strong {
    color: var(--text-primary);
}

.looking-ahead-gap {
    font-style: italic;
}

.looking-ahead-window {
    margin-bottom: 14px;
}

.looking-ahead-window p {
    margin-bottom: 4px;
}

.looking-ahead .looking-ahead-plain {
    color: var(--text-primary);
    font-weight: 600;
}

.looking-ahead-lead {
    font-style: italic;
}

/* The rules behind a window, after its prose (citations are kept out of the sentences) */
.looking-ahead-sources {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.varga-notes-title {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Verse-by-verse indications under a life-domain narrative */
.domain-indications {
    margin-top: 10px;
}

/* Gemstone section extras */
.remedy-day {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.gem-caution {
    color: var(--accent-red);
}

.gem-avoid {
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
}

/* A planet to propitiate now (BPHS 84) */
.remedy-now-card .yoga-compact-note,
.remedy-source-note {
    font-size: 0.8rem;
}

.remedy-now-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 10px 0;
}

/* Saturn's transit block in the report's timeline section */
.saturn-transit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 1.25rem;
}

.saturn-transit-card:empty {
    display: none;
}

.turning-points li .yoga-compact-note {
    display: block;
}

.sade-sati-past {
    color: var(--text-muted);
}

.sade-sati-now {
    font-weight: 600;
}

/* Milder / non-forming combinations: one line each, spanning the whole grid row */
.yoga-compact-card {
    grid-column: 1 / -1;
}

.yoga-compact-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.yoga-compact-note {
    color: var(--text-muted);
}

.yoga-compact-list li + li {
    margin-top: 4px;
}

/* An adverse yoga inside a mixed group (e.g. Kemadruma among the Moon yogas) */
.yoga-adverse-mark {
    color: var(--accent-red);
    font-size: 0.75em;
}

/* Penury yogas: flag the card as adverse */
.yoga-compact-adverse {
    border-color: rgba(239, 68, 68, 0.45);
}

.yoga-compact-adverse .yoga-card-title {
    color: var(--accent-red);
}

/* Domains Grid */
.report-domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    gap: 1.5rem;
}

.report-domain-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.domain-title {
    font-size: 1.05rem;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.domain-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.domain-narrative {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-primary);
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dasha Timeline */
.dasha-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dasha-timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.dasha-timeline-card.active {
    border-color: var(--gold-primary);
    box-shadow: 0 0 16px var(--gold-glow);
    background: linear-gradient(135deg, rgba(229,169,59,0.06) 0%, var(--bg-card) 100%);
}

.dasha-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dasha-timeline-lord {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.dasha-timeline-dates {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dasha-timeline-text {
    font-size: 0.86rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.dasha-sub-spotlight {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.12);
    border-left: 3px solid #10b981;
    font-size: 0.82rem;
    color: #34d399;
    font-weight: 600;
}

/* Remedies */
.remedy-gem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.remedy-gem-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.remedy-gem-type {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}

.remedy-gem-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 6px;
}

.remedy-gem-details {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.daan-item {
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--gold-primary);
    margin-bottom: 8px;
    font-size: 0.84rem;
    border-radius: 0 4px 4px 0;
}

/* =========================================================
   Print Stylesheet (@media print)
   Generates Publication-Grade PDF
   ========================================================= */

/* Cover page and chart page appear only in the printed / PDF report */
.print-only {
    display: none;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.export-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.astrologer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.astrologer-toggle[hidden],
.astrologer-only[hidden] {
    display: none;
}

.astrologer-only {
    border-color: var(--border-red, rgba(220, 80, 80, 0.5));
}

/* The astrologer's notes under each report section */
.astrologer-notes {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--border-red, rgba(220, 80, 80, 0.5));
    border-radius: var(--radius-sm);
    background: rgba(220, 80, 80, 0.05);
}

.astrologer-notes-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f0a0a0;
    margin-bottom: 4px;
}

.astrologer-notes-topic {
    font-size: 0.85rem;
    color: var(--gold-bright);
    margin: 8px 0 2px;
}

@media print {
    .site-footer,
    .astrologer-only,
    .astrologer-toggle {
        display: none !important;
    }

    @page {
        size: A4;
        margin: 14mm 12mm;
    }

    /* The admin's copy only (body.astrologer-copy, User, 2026-10-19): the notes are printed, and every
       page carries the red banner. The text matches app.main.ASTROLOGER_COPY_BANNER. */
    body.astrologer-copy {
        page: astrologer-copy;
    }

    @page astrologer-copy {
        size: A4;
        margin: 20mm 12mm 14mm;

        @top-center {
            content: "ASTROLOGER'S COPY: NOT FOR THE CUSTOMER";
            width: 100%;
            height: 9mm;
            margin-top: 6mm;
            background: #b91c1c;
            color: #ffffff;
            font-family: Inter, sans-serif;
            font-size: 11pt;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-align: center;
            vertical-align: middle;
        }
    }

    body.astrologer-copy .astrologer-notes:not([hidden]) {
        display: block !important;
        border: 1.5px solid #b91c1c;
        background: #fef2f2;
        page-break-inside: auto;
    }

    body.astrologer-copy .astrologer-notes-label {
        color: #b91c1c;
    }

    body.astrologer-copy .astrologer-notes-topic {
        color: #111827;
    }

    .print-only {
        display: block;
    }

    .print-cover {
        page-break-after: always;
        min-height: 255mm;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
        color: #111827;
    }

    .print-cover .cover-logo {
        width: 120px;
        height: 120px;
    }

    .print-cover .cover-brand {
        font-family: 'Cinzel', serif;
        font-size: 30pt;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: #92400e;
    }

    .print-cover .cover-title {
        font-family: 'Cinzel', serif;
        font-size: 16pt;
        color: #b45309;
        margin-bottom: 18px;
    }

    .print-cover .cover-name {
        font-size: 20pt;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .print-cover .cover-details {
        font-size: 11pt;
        line-height: 1.7;
        color: #374151;
    }

    .print-cover .cover-footer {
        margin-top: 36px;
        font-size: 8.5pt;
        color: #6b7280;
        max-width: 140mm;
    }

    .print-charts {
        page-break-after: always;
        color: #111827;
    }

    .print-charts h2 {
        font-family: 'Cinzel', serif;
        color: #92400e;
        font-size: 15pt;
        margin: 0 0 8px;
    }

    .print-charts .chart-pair {
        display: flex;
        justify-content: space-around;
        gap: 12px;
        margin: 10px 0 14px;
        text-align: center;
        font-weight: 700;
        color: #b45309;
    }

    .print-charts .chart-caption {
        color: #4b5563;
        font-size: 8.5pt;
        margin: -4px auto 12px;
    }

    .print-charts table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    .print-charts th,
    .print-charts td {
        border-bottom: 1px solid #e5e7eb;
        padding: 4px 6px;
        text-align: left;
    }

    .print-charts th {
        color: #92400e;
    }

    .print-charts .panchanga-line {
        margin-top: 10px;
        font-size: 9pt;
        color: #374151;
    }

    /* Paper versions of the theme colours: the screen greys and golds are too faint on white */
    :root {
        --bg-card: #f9fafb;
        --border-subtle: #e5e7eb;
        --border-gold: #d6a55a;
        --gold-primary: #b45309;
        --gold-bright: #92400e;
        --text-primary: #111827;
        --text-secondary: #374151;
        --text-muted: #4b5563;
        --accent-red: #b91c1c;
    }

    body {
        background: #ffffff !important;
        color: #111827 !important;
        background-image: none !important;
        font-size: 11pt !important;
    }

    .app-header,
    .nav-tabs,
    #welcomePanel,
    #chartIdentity,
    #downloadBar,
    #birthPanel,
    #panchangaStrip, 
    .style-toggle-group, 
    .btn-primary, 
    .btn-secondary, 
    .modal-overlay,
    .tab-content:not(#tab-report) {
        display: none !important;
    }

    #tab-report {
        display: block !important;
        animation: none !important;
    }

    .main-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .glass-panel {
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        color: #111827 !important;
        padding: 12pt !important;
        margin-bottom: 12pt !important;
        /* Long sections may run across pages; only the small cards inside them stay whole */
        page-break-inside: auto;
    }

    .report-actions-bar {
        display: none !important;
    }

    /* Chrome paginates grid and flex rows badly (a card that cannot split pushes the whole row to a
       new page), so in print the domain and dasha cards stack as plain blocks */
    .report-domains-grid,
    .dasha-timeline-list {
        display: block !important;
    }

    .report-domain-card,
    .dasha-timeline-card {
        margin-bottom: 10pt !important;
    }

    .report-section-title {
        page-break-after: avoid;
    }

    .remedy-now-card,
    .saturn-transit-card li,
    .yoga-compact-list li {
        page-break-inside: avoid;
    }

    .report-section-title, .domain-title {
        color: #b45309 !important;
        border-bottom-color: #e5e7eb !important;
    }

    .yoga-item-card, .report-domain-card, .dasha-timeline-card, .remedy-gem-card {
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
        color: #1f2937 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .domain-narrative, .dasha-timeline-text {
        color: #111827 !important;
    }

    .badge {
        border: 1px solid #d1d5db !important;
        background: #f3f4f6 !important;
        color: #374151 !important;
    }

    /* Keep auspicious / inauspicious badges distinguishable on paper */
    .badge-exalted { color: #065f46 !important; border-color: #10b981 !important; background: #ecfdf5 !important; }
    .badge-debilitated { color: #991b1b !important; border-color: #ef4444 !important; background: #fef2f2 !important; }
    .badge-moolatrikona { color: #92400e !important; border-color: #e5a93b !important; background: #fffbeb !important; }
    .badge-own { color: #075985 !important; border-color: #38bdf8 !important; background: #f0f9ff !important; }

    .dasha-sub-spotlight {
        color: #065f46 !important;
        background: #ecfdf5 !important;
    }

    /* The pale gold logo is faint on white paper */
    .report-brand img {
        filter: brightness(0.7) saturate(1.5);
    }

    /* Light planet colours (the Moon is near-white) need an outline to show on paper */
    .planet-dot {
        -webkit-text-stroke: 0.6px #6b7280;
    }

    .daan-item {
        background: #f3f4f6 !important;
        border-left-color: #b45309 !important;
        color: #111827 !important;
    }
}

