/* KP Horary - Styles (RVA v3 Design) */
/* Light Theme (default) + Dark Theme */

/* Palette anchored on /guidelines/color/ — Grey column for surfaces,
   Purple-60 brand accent, status colors from Red/Green/Orange columns. */
:root {
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --bg-primary: #f5f5f5;       /* grey-10 */
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #fbfbfb;        /* grey-5 */
    --bg-table-header: #f5f5f5;  /* grey-10 */
    --bg-table-row-alt: #fbfbfb; /* grey-5 */
    --bg-highlight: #f0f0f2;     /* grey-20 */
    --bg-kp-preview: #fbfbfb;    /* grey-5 */

    --text-primary: #232129;     /* grey-90 */
    --text-secondary: #48434f;   /* grey-70 */
    --text-muted: #78757a;       /* grey-50 */
    --text-header: #232129;      /* grey-90 */
    --text-label: #48434f;       /* grey-70 */
    --text-accent: #663399;      /* purple-60 */

    --border-color: #d9d7e0;     /* grey-30 */
    --border-input: #b7b5bd;     /* grey-40 */
    --border-focus: #663399;     /* purple-60 */

    --btn-primary-bg: #663399;   /* purple-60 brand */
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #542c85;/* purple-70 */
    --btn-small-bg: #f0f0f2;     /* grey-20 */
    --btn-small-text: #48434f;   /* grey-70 */

    --shadow-card: 0 1px 3px rgba(54, 32, 102, 0.06), 0 1px 2px rgba(54, 32, 102, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(54, 32, 102, 0.08);

    --retrograde-color: #da0013; /* red-70 */
    --house-num-color: #232129;  /* grey-90 */
    --sig-color: #1d9520;        /* green-70 */

    --radius: 8px;
    --radius-sm: 6px;
    --radius-xl: 12px;
}

html.dark {
    --bg-primary: #232129;       /* grey-90 */
    --bg-card: #36313d;          /* grey-80 */
    --bg-input: #48434f;         /* grey-70 */
    --bg-header: #232129;
    --bg-footer: #232129;
    --bg-table-header: #36313d;  /* grey-80 */
    --bg-table-row-alt: #2c2933; /* between grey-80/90 */
    --bg-highlight: #48434f;     /* grey-70 */
    --bg-kp-preview: #36313d;    /* grey-80 */

    --text-primary: #fbfbfb;     /* grey-5 */
    --text-secondary: #d9d7e0;   /* grey-30 */
    --text-muted: #b7b5bd;       /* grey-40 */
    --text-header: #fbfbfb;
    --text-label: #d9d7e0;       /* grey-30 */
    --text-accent: #d9bae8;      /* purple-30 */

    --border-color: #635e69;     /* grey-60 */
    --border-input: #78757a;     /* grey-50 */
    --border-focus: #d9bae8;     /* purple-30 */

    --btn-primary-bg: #d9bae8;   /* purple-30 */
    --btn-primary-text: #362066; /* purple-90 */
    --btn-primary-hover: #b17acc;/* purple-40 */
    --btn-small-bg: #48434f;     /* grey-70 */
    --btn-small-text: #d9d7e0;   /* grey-30 */

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.4);

    --retrograde-color: #ff8885; /* red-30 */
    --house-num-color: #fbfbfb;  /* grey-5 */
    --sig-color: #79cd75;        /* green-30 */
}

/* Smooth theme transition */
*,
*::before,
*::after {
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

.status-ok {
    color: var(--sig-color);
    font-size: 0.78rem;
}

.status-error {
    color: var(--retrograde-color);
    font-size: 0.78rem;
}

/* Main */
.app-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Input Section */
.input-section {
    margin-bottom: 24px;
}

/* Settings Panel */
.settings-panel {
    margin-top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.settings-section {
    margin-bottom: 4px;
}

.settings-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.settings-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-group label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
}

.settings-input {
    height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

html.dark .settings-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.settings-input::placeholder {
    color: var(--text-muted);
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.settings-info {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: inline-block;
    margin-right: 12px;
}

/* Gear icon active state */
#settings-btn.active {
    background: var(--bg-highlight);
    color: var(--text-primary);
    border-color: var(--border-input);
}

#settings-btn svg {
    transition: transform 0.3s ease;
}

#settings-btn.active svg {
    transform: rotate(90deg);
}

.btn-small {
    padding: 6px 10px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--btn-small-bg);
    color: var(--btn-small-text);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
    white-space: nowrap;
    height: 44px;
}

.btn-small:hover {
    background: var(--bg-highlight);
}

/* Timezone & Ayanamsa Info */
.tz-info {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-right: 12px;
}

.settings-panel .tz-info {
    color: var(--text-muted);
}

.tz-auto {
    color: var(--sig-color);
}

.tz-estimated {
    color: #d97706;
}

/* ============================== */
/* RESULTS SECTION - RVA V3 Style */
/* ============================== */

.results-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s;
    margin-top: 10px;
}

.card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============== */
/* PANCHANG - Word-based layout */
/* ============== */

.panchang-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    font-size: 0.82rem;
    color: var(--text-primary);
    overflow-x: auto;
}

.panchang-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
}

.panchang-item:last-child {
    border-right: none;
}

.pan-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.pan-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.72rem;
}

.pan-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.pan-sunrise {
    color: #f59e0b;
}

.pan-sunset {
    color: #ef4444;
}

.panchang-divider {
    display: none;
}

[data-theme="dark"] .pan-sunrise,
html.dark .pan-sunrise {
    color: #fbbf24;
}

[data-theme="dark"] .pan-sunset,
html.dark .pan-sunset {
    color: #f87171;
}

/* ============== */
/* SECTION HEADER */
/* ============== */

.section-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-card);
    margin: 0;
    margin-top: 10px;
    border-bottom: none;
}

/* Connect section header to its content cards below */
.section-header+.two-col-layout {
    margin-top: -11px;
}

.section-header+.two-col-layout>.result-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Significators (second two-col-layout, not connected to section-header) */
.two-col-layout+.two-col-layout {
    margin-top: 10px;
}

/* Dasha section spacing */
.dasha-section {
    margin-top: 10px;
}

/* Aspects section spacing */
.aspects-header-card {
    margin-top: 10px;
}

/* ============== */
/* TWO COLUMN LAYOUT */
/* ============== */

.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============== */
/* CHARTS ROW */
/* ============== */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 280px;
    gap: 16px;
    margin-top: 10px;
}

/* Chart */
.chart-card {
    display: flex;
    flex-direction: column;
    padding: 10px 6px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.chart-container {
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 1;
}

/* Ruling Planets Card */
.rp-card {
    min-width: 260px;
    max-width: 320px;
}

.rp-location {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.rp-daylord {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 4px 0;
}

.rp-casting-title {
    margin-top: 10px;
}

.rp-casting-fields {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.rp-field {
    height: 30px;
    font-size: 0.72rem;
    padding: 4px 8px;
}

.casting-place-wrapper {
    flex: 1;
    position: relative;
}

.casting-loc-dropdown {
    min-width: 200px;
    max-width: 350px;
    right: 0;
}

/* ============== */
/* TABLES - RVA V3 STYLE */
/* ============== */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.data-table thead {
    background: var(--bg-table-header);
    position: sticky;
    top: 0;
}

.data-table th {
    padding: 8px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--bg-highlight);
    transition: background 0.15s;
}

.highlight-row {
    background: var(--bg-highlight) !important;
    font-weight: 600;
}

.degree-cell {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}

.house-num {
    font-weight: 700;
    color: var(--house-num-color);
    text-align: center;
}

.planet-cell {
    font-weight: 600;
}

.retrograde {
    color: var(--retrograde-color) !important;
}

/* KP Lord column colors (matching RVA v3) */
td.lord-sign,
th.lord-sign {
    color: #2563eb;
    font-weight: 600;
}

td.lord-star,
th.lord-star {
    color: #7c3aed;
    font-weight: 600;
}

td.lord-sub,
th.lord-sub {
    color: #ea580c;
    font-weight: 600;
}

td.lord-ss,
th.lord-ss {
    color: #db2777;
    font-weight: 600;
}

td.lord-sss,
th.lord-sss {
    color: #0d9488;
    font-weight: 600;
}

html.dark td.lord-sign,
html.dark th.lord-sign {
    color: #60a5fa;
}

html.dark td.lord-star,
html.dark th.lord-star {
    color: #a78bfa;
}

html.dark td.lord-sub,
html.dark th.lord-sub {
    color: #fb923c;
}

html.dark td.lord-ss,
html.dark th.lord-ss {
    color: #f472b6;
}

html.dark td.lord-sss,
html.dark th.lord-sss {
    color: #2dd4bf;
}

/* Lord cell hover - interactive */
td[data-planet] {
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s, transform 0.15s;
}

td[data-planet]:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(1.08);
}

html.dark td[data-planet]:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Highlight matched lord cells across tables */
td[data-planet].lord-highlight {
    background: rgba(37, 99, 235, 0.12);
    box-shadow: inset 0 0 0 1.5px rgba(37, 99, 235, 0.35);
    border-radius: 3px;
}

html.dark td[data-planet].lord-highlight {
    background: rgba(96, 165, 250, 0.15);
    box-shadow: inset 0 0 0 1.5px rgba(96, 165, 250, 0.35);
}

/* Significator legend */
.sig-legend {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 8px 6px 0;
    line-height: 1.5;
}

.sig-list {
    font-weight: 500;
    color: var(--sig-color);
}

.rp-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================ */
/* ASPECTS ANALYSIS - Header with tabs (RVA V3) */
/* ============================================ */

.aspects-header-card {
    padding: 12px 20px !important;
}

.aspects-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.aspects-main-title {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    white-space: nowrap;
}

.aspects-tabs {
    display: flex;
    gap: 6px;
}

.aspects-tab {
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--btn-small-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
    white-space: nowrap;
}

.aspects-tab:hover {
    background: var(--bg-highlight);
    color: var(--text-primary);
}

.aspects-tab.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.aspects-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-aspects-filter {
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid var(--retrograde-color);
    border-radius: var(--radius);
    background: transparent;
    color: var(--retrograde-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
    white-space: nowrap;
}

.btn-aspects-filter:hover {
    background: rgba(220, 38, 38, 0.08);
}

.btn-aspects-filter.active {
    background: var(--retrograde-color);
    color: #fff;
}

.btn-aspects-recalc {
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
    white-space: nowrap;
}

.btn-aspects-recalc:hover {
    opacity: 0.85;
}

/* Aspects grid table cells */
.aspects-grid-table {
    table-layout: fixed;
}

.aspects-grid-table th {
    text-align: center;
    min-width: 70px;
}

.aspects-grid-table th:first-child {
    min-width: 50px;
    text-align: left;
}

.aspect-grid-cell {
    text-align: center;
    font-size: 0.7rem;
    padding: 4px 3px !important;
    vertical-align: middle;
    line-height: 1.3;
}

.aspect-red {
    color: var(--retrograde-color);
    font-weight: 600;
}

.aspect-black {
    color: var(--text-primary);
}

.aspect-deg {
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-top: 1px;
}

.aspect-dash {
    color: var(--border-color);
}

/* Aspects table (Western list) */
.aspect-cell {
    font-weight: 600;
}

.aspect-hard {
    color: var(--retrograde-color);
}

.aspect-soft {
    color: var(--sig-color);
}

.aspect-applying {
    color: var(--text-primary);
    font-weight: 600;
}

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

/* ================================== */
/* VIMSHOTTARI DASHA TREE (RVA V3)    */
/* ================================== */

.dasha-section {
    padding: 16px 20px !important;
}

.dasha-layout {
    display: flex;
    gap: 0;
    min-height: 300px;
}

.dasha-tree-wrapper {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--border-color);
    max-height: 480px;
    overflow-y: auto;
}

.dasha-breadcrumb-wrapper {
    flex: 1;
    min-width: 0;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.dasha-tree {
    font-size: 0.84rem;
}

.dasha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: default;
    transition: background 0.15s;
}

.dasha-row:hover {
    background: var(--bg-highlight);
}

.dasha-row-expanded {
    background: var(--bg-table-row-alt);
}

.dasha-row-leaf {
    background: var(--bg-highlight);
}

.dasha-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    background: var(--bg-card);
    transition: all 0.15s;
    line-height: 1;
}

.dasha-toggle:hover {
    background: var(--bg-highlight);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.dasha-toggle-leaf {
    opacity: 0.4;
    cursor: default;
}

.dasha-toggle-leaf:hover {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.dasha-label {
    font-weight: 500;
    white-space: nowrap;
}

/* Dasha Breadcrumb */
.dasha-bc-item {
    font-size: 0.84rem;
    font-weight: 500;
    text-align: center;
    padding: 4px 0;
}

@media (max-width: 768px) {
    .dasha-layout {
        flex-direction: column;
    }

    .dasha-tree-wrapper {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 360px;
    }

    .dasha-breadcrumb-wrapper {
        padding: 12px;
    }
}

/* Ruling planets table */
.ruling-table td:first-child {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* Move House Badge */
.move-house-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--retrograde-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

/* ============== */
/* RESPONSIVE     */
/* ============== */

@media (max-width: 768px) {
    .status-ok,
    .status-error {
        font-size: 0.68rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-main {
        padding: 12px 10px;
    }

    .btn-small {
        height: 40px;
    }

    .settings-panel {
        padding: 16px;
    }

    .settings-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .results-section {
        gap: 12px;
    }

    .charts-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-left: -10px;
        margin-right: -10px;
    }

    .chart-card {
        padding: 6px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .chart-card .card-title {
        padding: 0 10px 6px;
    }

    .chart-container {
        max-width: 100%;
        margin: 0;
    }

    .rp-card {
        max-width: 100%;
    }

    .two-col-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-card {
        padding: 12px 14px;
    }

    .data-table {
        font-size: 0.73rem;
    }

    .data-table th {
        padding: 8px 6px;
        font-size: 0.65rem;
    }

    .data-table td {
        padding: 7px 6px;
    }

    .degree-cell {
        font-size: 0.68rem;
    }

    .chart-container {
        max-width: 100%;
    }

    .card-title {
        font-size: 0.78rem;
        margin-bottom: 8px;
    }

    .section-header {
        font-size: 0.95rem;
        padding: 12px 14px;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .section-header+.two-col-layout {
        margin-top: -7px;
    }

    /* Panchang responsive */
    .panchang-item {
        padding: 10px 12px;
    }

    /* Aspects responsive */
    .aspects-header {
        gap: 8px;
    }

    .aspects-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .aspects-tab {
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    .aspects-actions {
        margin-left: 0;
    }

    .aspects-grid-table th {
        min-width: 55px;
        font-size: 0.58rem;
    }

    .aspect-grid-cell {
        font-size: 0.62rem;
    }

    .aspect-deg {
        font-size: 0.52rem;
    }
}

@media (max-width: 480px) {
    .status-ok,
    .status-error {
        max-width: 90px;
        font-size: 0.62rem;
    }

    .app-main {
        padding: 8px;
    }

    .settings-panel {
        padding: 12px;
    }

    .settings-grid,
    .settings-grid-3 {
        grid-template-columns: 1fr;
    }

    .settings-input {
        height: 38px;
        font-size: 0.8rem;
    }

    .results-section {
        gap: 10px;
    }

    .result-card {
        padding: 12px;
        border-radius: 10px;
    }

    .data-table {
        font-size: 0.72rem;
    }

    .data-table th {
        padding: 8px 6px;
        font-size: 0.64rem;
    }

    .data-table td {
        padding: 7px 6px;
    }

    .degree-cell {
        font-size: 0.66rem;
    }

    .chart-card {
        padding: 4px 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        margin-top: 0;
    }

    .chart-card .card-title {
        padding: 0 8px 6px;
        font-size: 0.75rem;
    }

    .chart-container {
        max-width: 100%;
        width: 100%;
        margin: 0;
    }

    .charts-row {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-left: -8px;
        margin-right: -8px;
    }

    .rp-card {
        max-width: 100%;
    }

    .two-col-layout {
        gap: 10px;
    }

    .card-title {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .section-header {
        font-size: 0.88rem;
        padding: 10px 12px;
        border-radius: 10px 10px 0 0;
    }

    .section-header+.two-col-layout {
        margin-top: -5px;
    }

    .section-header+.two-col-layout>.result-card {
        border-radius: 10px;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .sig-list {
        font-size: 0.62rem;
    }

    /* Panchang responsive - small */
    .panchang-bar {
        border-radius: 10px;
        font-size: 0.75rem;
    }

    .panchang-item {
        padding: 8px 10px;
        gap: 4px;
    }

    .pan-label {
        font-size: 0.65rem;
    }

    .pan-value {
        font-size: 0.72rem;
    }

    /* Aspects responsive - small screens */
    .aspects-header-card {
        padding: 10px 12px !important;
    }

    .aspects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .aspects-main-title {
        font-size: 0.88rem !important;
    }

    .aspects-tabs {
        width: 100%;
    }

    .aspects-tab {
        flex: 1;
        text-align: center;
        padding: 6px 8px;
        font-size: 0.68rem;
    }

    .aspects-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .aspects-grid-table th {
        min-width: 46px;
        font-size: 0.52rem;
        padding: 4px 2px;
    }

    .aspect-grid-cell {
        font-size: 0.58rem;
        padding: 2px 1px !important;
    }

    .aspect-deg {
        font-size: 0.5rem;
    }

    /* Dasha responsive - small screens */
    .dasha-tree {
        font-size: 0.76rem;
    }

    .dasha-bc-item {
        font-size: 0.76rem;
    }

    .dasha-row {
        padding: 6px 8px;
    }

    .dasha-toggle {
        width: 20px;
        height: 20px;
        font-size: 0.78rem;
    }
}

/* ============== */
/* CHART TOOLTIP  */
/* ============== */

.chart-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    line-height: 1.4;
    white-space: nowrap;
    background: #1f2937;
    color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chart-tooltip.visible {
    opacity: 1;
}

html.dark .chart-tooltip {
    background: #f3f4f6;
    color: #111827;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== PWA INSTALL BANNER ==================== */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: pwaSlideUp 0.3s ease;
}

@keyframes pwaSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.pwa-install-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pwa-install-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    height: 36px;
    padding: 0 20px;
    font-size: 0.8rem;
    cursor: pointer;
}

.pwa-dismiss-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pwa-dismiss-btn:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
}

@media (max-width: 480px) {
    .pwa-install-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .pwa-install-text {
        font-size: 0.78rem;
    }
}