/* ============================================
   AstroBot — Refined Light Theme
   ============================================ */

/* Google Fonts: DM Sans (UI) + Cormorant Garamond (display) — must be first */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* Steliara UI kit — shared flat components (.ui-*). See css/design-kit.css + /styleguide.html */
@import 'design-kit.css';

@font-face {
    font-family: 'Astronomicon Local';
    src: url('../fonts/Astronomicon.subset.woff2') format('woff2'),
         url('../fonts/Astronomicon.ttf') format('truetype');
    font-display: block;
}

body.quick-open-active {
    overflow: hidden;
}

.quick-open-popover.hidden {
    display: none;
}

.quick-open-popover {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.quick-open-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 22, 20, 0.35);
}

.quick-open-dialog {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    max-height: min(640px, calc(100vh - 44px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}

.quick-open-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: start;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.quick-open-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
}

.quick-open-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.quick-open-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.quick-open-close:hover {
    background: var(--gold-pale);
    color: var(--text-primary);
}

.quick-open-list {
    display: grid;
    gap: 8px;
    min-height: 120px;
    overflow: auto;
    padding: 12px;
}

.quick-open-list--busy {
    pointer-events: none;
    opacity: 0.58;
}

.quick-open-status,
.quick-open-empty {
    padding: 28px 18px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.quick-open-empty--error {
    color: var(--error);
}

.quick-open-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px 12px;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 10px;
    background: rgba(249, 247, 242, 0.48);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.quick-open-item:hover {
    border-color: rgba(184, 147, 90, 0.36);
    background: #fff;
    transform: translateY(-1px);
}

.quick-open-item:focus-visible,
.quick-open-close:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.14);
}

.quick-open-item-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.quick-open-item-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.quick-open-item-meta {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.quick-open-item-action {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.chart-picker-search-row {
    padding: 12px 18px 6px;
}

.chart-picker-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
}

.chart-picker-search:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.14);
}

.chart-picker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 8px;
}

.chart-picker-tags[hidden] {
    display: none;
}

.chart-picker-tag {
    padding: 4px 10px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 999px;
    background: rgba(249, 247, 242, 0.6);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.chart-picker-tag:hover {
    border-color: rgba(184, 147, 90, 0.36);
    color: var(--text-primary);
}

.chart-picker-tag.is-active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 520px) {
    .quick-open-popover {
        align-items: flex-end;
        padding: 10px;
    }

    .quick-open-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .quick-open-title {
        font-size: 24px;
    }

    .quick-open-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-open-item-action {
        justify-self: start;
    }
}

@font-face {
    font-family: 'Noto Sans Symbols Local';
    src: url('../fonts/NotoSansSymbols.subset.woff2') format('woff2'),
         url('../fonts/NotoSansSymbols.ttf') format('truetype');
    font-display: block;
}

@font-face {
    font-family: 'Noto Sans Symbols 2 Local';
    src: url('../fonts/NotoSansSymbols2.subset.woff2') format('woff2'),
         url('../fonts/NotoSansSymbols2.ttf') format('truetype');
    font-display: block;
}

:root {
    /* Backgrounds — warm parchment tones */
    --bg-primary:    #F9F7F2;
    --bg-secondary:  #FFFFFF;
    --bg-tertiary:   #F0EDE4;
    --bg-hover:      #EDE9E0;

    /* Text — warm near-black scale */
    --text-primary:   #1A1614;
    --text-secondary: #5C554E;
    --text-muted:     #7A6F63; /* darkened from #9B9289 → 4.58:1 on --bg-primary (WCAG AA) */

    /* Accent — deep navy (replaces indigo) */
    --accent:         #1E3A5F;
    --accent-hover:   #2E4E7A;
    --accent-light:   #EBF0F7;

    /* Gold — secondary accent for premium feel */
    --gold:           #B8935A;
    --gold-hover:     #C9A46A;
    --gold-pale:      #F5EDDF;

    /* Semantic colors */
    --success:  #2B7A4B;
    --warning:  #B07D10;
    --error:    #B83232;

    /* Borders */
    --border:       #E0DDD7;
    --border-focus: #1E3A5F;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26,22,20,0.05), 0 1px 2px rgba(26,22,20,0.03);
    --shadow-md: 0 4px 16px rgba(26,22,20,0.08), 0 2px 6px rgba(26,22,20,0.04);
    --shadow-lg: 0 12px 32px rgba(26,22,20,0.10), 0 4px 12px rgba(26,22,20,0.06);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Spacing scale — 4px base (design-system-foundation.md). Use these for
       page-level margins/padding/gaps; --density-* below stays for compact in-app controls. */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Type scale — 6 steps. Cormorant (--font-display) only pairs with h2/h1;
       h3 and below use --font-ui (DM Sans), including small UI labels. */
    --font-size-caption: 12px; /* captions, meta, table headers */
    --font-size-label:   14px; /* UI labels, controls, buttons */
    --font-size-body:    16px; /* body copy */
    --font-size-h3:      20px;
    --font-size-h2:      28px; /* display serif from here up */
    --font-size-h1:      40px;

    /* Compact workspace density */
    --density-space-1: 4px;
    --density-space-2: 6px;
    --density-space-3: 8px;
    --density-space-4: 10px;
    --density-space-5: 12px;
    --density-control-height: 32px;
    --density-touch-target: 40px;
    --density-radius: 10px;
    --density-surface-padding: 12px;
    --density-row-padding: 7px 10px;
    --density-surface-shadow: 0 1px 3px rgba(26, 22, 20, 0.045);

    /* Transition */
    --transition: 0.2s ease;
    --transition-soft: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    --motion-soft: cubic-bezier(0.22, 1, 0.36, 1);

    /* Fonts */
    --font-ui:      'DM Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-symbol:  'Astronomicon Local', 'Noto Sans Symbols Local', 'Noto Sans Symbols 2 Local', 'Segoe UI Symbol', 'Apple Symbols', sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Множитель видимого размера астро-глифов вне колеса (таблицы/фильтры/легенды) */
    --glyph-scale: 1.2;
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::selection {
    background: rgba(184, 147, 90, 0.24);
}

/* ============ COMPACT WORKSPACE SYSTEM ============ */
.workspace-compact {
    --workspace-gap: var(--density-space-4);
    --workspace-surface-radius: var(--density-radius);
    --workspace-surface-padding: var(--density-surface-padding);
    --workspace-control-height: var(--density-control-height);
}

.workspace-compact .btn-new,
.workspace-compact .btn-logout,
.workspace-compact .btn-call,
.workspace-compact .btn-ghost {
    min-height: var(--workspace-control-height);
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12px;
    gap: 6px;
}

.workspace-compact .btn-new {
    box-shadow: 0 6px 14px rgba(30, 58, 95, 0.14);
}

.workspace-compact .btn-new:hover {
    box-shadow: 0 8px 18px rgba(30, 58, 95, 0.18);
}

.workspace-compact .clients-header {
    gap: 14px;
    margin-bottom: var(--workspace-gap);
}

.workspace-compact .header-account-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 6px 9px;
    border-radius: var(--workspace-surface-radius);
    box-shadow: var(--density-surface-shadow);
}

.workspace-compact .header-account-label {
    font-size: 9px;
    letter-spacing: 0.1em;
}

.workspace-compact .header-account-value {
    font-size: 12px;
    line-height: 1.25;
}

.workspace-compact .header-plan-status {
    min-height: 20px;
    padding: 0 7px;
    font-size: 9px;
}

.workspace-compact .clients-dialog {
    padding: 14px;
}

.workspace-compact .clients-dialog-card {
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.workspace-compact .clients-dialog-header {
    gap: 12px;
    margin-bottom: 12px;
}

.workspace-compact .clients-dialog-kicker {
    margin-bottom: 3px;
    font-size: 9px;
}

.workspace-compact .clients-dialog-title {
    margin-bottom: 4px;
    font-size: 24px;
    line-height: 1;
}

.workspace-compact .clients-dialog-copy {
    font-size: 12px;
    line-height: 1.4;
}

.workspace-compact .clients-dialog-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
}

.workspace-compact .clients-dialog-grid {
    gap: 0 12px;
}

.workspace-compact .clients-dialog-actions {
    gap: 8px;
    margin-top: 4px;
}

.workspace-compact .clients-dialog-cancel,
.workspace-compact .clients-dialog-submit {
    min-width: 0;
}

.workspace-compact .form-group {
    gap: 4px;
    margin-bottom: 12px;
}

.workspace-compact .form-label {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.workspace-compact .form-group input,
.workspace-compact .form-group select,
.workspace-compact .form-group textarea {
    min-height: var(--workspace-control-height);
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 13px;
}

.workspace-compact .profile-icon-btn,
.workspace-compact .compact-icon-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
}

.compact-icon-btn {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.compact-icon-btn:hover,
.compact-icon-btn:focus-visible {
    color: var(--text-primary);
    border-color: rgba(30, 58, 95, 0.2);
    background: rgba(30, 58, 95, 0.045);
}

.compact-icon-btn--danger:hover,
.compact-icon-btn--danger:focus-visible {
    color: var(--error);
    border-color: rgba(184, 50, 50, 0.24);
    background: rgba(184, 50, 50, 0.06);
}

.workspace-compact .footer {
    margin-top: 16px;
    font-size: 11px;
}

@media (max-width: 720px) {
    .workspace-compact {
        --workspace-control-height: var(--density-touch-target);
    }

    .workspace-compact .profile-icon-btn,
    .workspace-compact .compact-icon-btn {
        width: var(--density-touch-target);
        height: var(--density-touch-target);
        min-width: var(--density-touch-target);
        min-height: var(--density-touch-target);
    }
}

/* ============ SOFT PAGE ARRIVAL ============ */
.container,
.login-shell,
.clients-shell,
.calendar-shell,
.profile-shell,
.account-settings-shell,
.chart-header-compact,
.chart-layout,
.forecast-header,
.forecast-toolbar,
.forecast-summary,
.natal-header,
.natal-content,
.forecast-new-header,
.forecast-new-layout:not(.hidden),
.synastry-header,
.synastry-layout:not(.hidden),
.call-shell:not([hidden]),
.join-lobby:not([hidden]) {
    animation: page-arrive 0.56s var(--motion-soft) both;
}

.birth-form,
.form-section,
.form-summary-card,
.advanced-fields,
.data-panel,
.chart-wheel-container,
.workspace-main,
.workspace-panel,
.workspace-card,
.clients-table-wrap,
.profile-main:not(.hidden),
.profile-card,
.account-settings-card,
.natal-section,
.forecast-summary-card,
.forecast-table-container,
.solar-container,
.biwheel-container,
.timeline-container,
.forecast-new-panel,
.forecast-new-wheel-shell,
.synastry-panel,
.call-panel,
.join-lobby-box,
.story-panel,
.auth-card {
    animation: element-arrive 0.48s var(--motion-soft) both;
}

.client-inline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.client-inline-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid rgba(30, 58, 95, .1);
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.client-inline-chip:hover {
    border-color: rgba(30, 58, 95, .22);
    background: #fff;
}

.client-inline-chip.is-active {
    border-color: rgba(184, 147, 90, .42);
    background: var(--gold-pale);
    color: var(--text-primary);
}

.profile-card,
.account-settings-section,
.natal-section,
.forecast-summary-card,
.forecast-new-panel,
.synastry-panel {
    animation-delay: 0.04s;
}

@keyframes page-arrive {
    from {
        opacity: 0;
        transform: translateY(14px);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes element-arrive {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.992);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============ ASTRO SYMBOLS ============ */
.astro-symbol,
.planet-symbol,
.planet-symbol-text,
.sign-symbol-text,
.aspect-symbol-text,
.symbol-cell,
.planet-icon {
    font-family: var(--font-symbol);
    font-variant-ligatures: none;
    text-rendering: geometricPrecision;
}

.planet-symbol-svg {
    overflow: visible;
    transform-origin: center center;
    transition: transform 0.15s ease, filter 0.15s ease;
}

/* Глифы вне колеса крупнее цифр на --glyph-scale */
.astro-symbol,
.planet-icon {
    font-size: calc(1em * var(--glyph-scale));
    line-height: 1;
    vertical-align: middle;
}

/* SVG-иконки планет в инлайн-контекстах (таблицы/фильтры/чипы):
   увеличиваем рисунок без изменения бокса, чтобы не ломать узкие ячейки */
.planet-icon-svg svg {
    transform: scale(var(--glyph-scale));
    transform-origin: center;
}

/* ============ LAYOUT ============ */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ HEADER / LOGO ============ */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.subtitle {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-muted);
}

.index-header-links {
    margin-top: 12px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.index-header-link {
    min-height: 34px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.index-header-link:hover {
    border-color: rgba(184, 147, 90, 0.42);
    background: rgba(255, 255, 255, 0.94);
    transform: translateY(-1px);
}

/* ============ FORM CONTAINER ============ */
.form-container {
    flex: 1;
}

.birth-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-section + .form-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(30, 58, 95, 0.08);
}

.form-section-heading {
    margin-bottom: 16px;
}

.form-section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.form-section-copy {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.02em;
}

/* Name inputs */
.name-inputs {
    display: flex;
    gap: 8px;
}

.name-inputs input {
    flex: 1;
    min-width: 0;
}

/* Date inputs */
.date-inputs, .time-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-inputs input, .date-inputs select,
.time-inputs input {
    flex: 1;
    min-width: 0;
}

.time-separator {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Place autocomplete */
.place-autocomplete-wrapper {
    position: relative;
}

.place-suggestions {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    z-index: 120;
    display: none;
    box-shadow: var(--shadow-md);
}

.place-suggestions.active {
    display: block;
}

.place-suggestion {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.place-suggestion:last-child {
    border-bottom: none;
}

.place-suggestion:hover {
    background: var(--gold-pale);
}

/* ============ INPUTS & SELECTS ============ */
input, select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-ui);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}

/* Shared interaction baseline: keyboard focus stays unmistakable, while users
   who request less motion are never forced through decorative transitions. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (pointer: coarse) {
    button,
    [role="button"],
    [role="tab"],
    input[type="checkbox"],
    input[type="radio"] {
        touch-action: manipulation;
    }
}

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

input[type="number"] {
    font-family: var(--font-mono);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* Coords display */
.coords-display {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.coords-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coords-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.coords-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coord-input-group {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.coord-num {
    width: 36px;
    padding: 6px 4px;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-secondary);
}

.coord-num.coord-sec {
    width: 52px;
}

.coord-dir {
    padding: 6px 4px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-secondary);
    margin-left: 4px;
}

.coord-num:focus, .coord-dir:focus {
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.08);
}

/* ============ UTILITY ============ */
.hidden {
    display: none !important;
}

/* ============ PAGE LOADER ============ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at 50% 38%, rgba(184, 147, 90, 0.18), transparent 26%),
        radial-gradient(circle at 50% 62%, rgba(30, 58, 95, 0.08), transparent 32%),
        var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.46s var(--motion-soft),
        visibility 0.46s step-end,
        filter 0.46s var(--motion-soft);
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    filter: blur(10px);
    pointer-events: none;
}

.page-loader .pl-spinner {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(184, 147, 90, 0.22);
    border-top-color: rgba(30, 58, 95, 0.72);
    border-right-color: rgba(184, 147, 90, 0.62);
    border-radius: 50%;
    box-shadow:
        0 0 0 8px rgba(184, 147, 90, 0.06),
        0 16px 36px rgba(26, 22, 20, 0.08);
    animation: pl-spin 1.05s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.page-loader .pl-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    animation: loader-text-breathe 1.8s ease-in-out infinite;
}

@keyframes pl-spin {
    to { transform: rotate(360deg); }
}

@keyframes loader-text-breathe {
    0%, 100% { opacity: 0.56; transform: translateY(0); }
    50% { opacity: 0.9; transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============ HINTS ============ */
.hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.advanced-fields {
    margin: 8px 0 18px;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: var(--radius-md);
    background: rgba(240, 237, 228, 0.46);
    overflow: hidden;
}

.advanced-fields summary {
    list-style: none;
}

.advanced-fields summary::-webkit-details-marker {
    display: none;
}

.advanced-fields-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
}

.advanced-fields-summary-copy {
    display: grid;
    gap: 3px;
}

.advanced-fields-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.advanced-fields-copy {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.advanced-fields-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(30, 58, 95, 0.08);
    color: var(--accent);
    font-size: 18px;
    line-height: 1;
    transition: transform var(--transition);
}

.advanced-fields[open] .advanced-fields-chevron {
    transform: rotate(45deg);
}

.advanced-fields-content {
    padding: 0 18px 18px;
}

.advanced-fields-content .coords-display {
    margin-top: 0;
    margin-bottom: 16px;
}

.advanced-fields-content .form-group:last-child {
    margin-bottom: 0;
}

.form-summary-card {
    margin: 6px 0 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(235, 240, 247, 0.72), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(30, 58, 95, 0.08);
}

.form-summary-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(30, 58, 95, 0.72);
}

.form-summary-list {
    display: grid;
    gap: 10px;
}

.form-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-summary-item.is-complete {
    color: var(--text-primary);
}

.form-summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.2);
    box-shadow: 0 0 0 5px rgba(30, 58, 95, 0.05);
    flex-shrink: 0;
}

.form-summary-item.is-complete .form-summary-dot {
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(43, 122, 75, 0.1);
}

.submit-note {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ============ SUBMIT BUTTON ============ */
.submit-btn {
    width: 100%;
    padding: 13px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.25);
}

.submit-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============ COMPACT INDEX FORM ============ */
.index-page .container {
    padding: 12px 14px;
}

.index-page .header {
    margin-bottom: 14px;
}

.index-page .subtitle {
    max-width: 340px;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.35;
}

.index-page .index-header-links {
    margin-top: 10px;
}

.index-page .birth-form {
    padding: 22px 22px 24px;
}

.index-page .form-section + .form-section {
    margin-top: 18px;
    padding-top: 16px;
}

.index-page .form-section-heading {
    margin-bottom: 10px;
}

.index-page .form-section-title {
    font-size: 23px;
    line-height: 1;
}

.index-page .form-group {
    margin-bottom: 14px;
}

.index-page .form-label {
    margin-bottom: 6px;
}

.index-page input,
.index-page select {
    min-height: 44px;
    padding: 9px 14px;
}

.index-page .hint {
    font-size: 11.5px;
}

.index-page .advanced-fields {
    margin: 2px 0 14px;
}

.index-page .advanced-fields-summary {
    min-height: 46px;
    padding: 9px 14px;
}

.index-page .advanced-fields-title {
    font-size: 13px;
}

.index-page .advanced-fields-chevron {
    width: 26px;
    height: 26px;
}

.index-page .submit-btn {
    min-height: 48px;
    padding: 12px 22px;
    margin-top: 2px;
}

/* ============ INDEX LANDING ============ */
.index-page {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76) 0%, rgba(249, 247, 242, 0) 520px),
        linear-gradient(90deg, rgba(30, 58, 95, 0.035) 0 1px, transparent 1px 100%),
        var(--bg-primary);
    background-size: auto, 72px 72px, auto;
}

.index-page .landing-shell {
    max-width: 1220px;
    padding: 18px 22px 34px;
    gap: 0;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin: 0 -6px 42px;
    padding: 10px 12px;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 18px;
    background: rgba(249, 247, 242, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 34px rgba(26, 22, 20, 0.06);
    text-align: left;
}

.landing-logo {
    margin: 0;
    color: var(--text-primary);
    text-decoration: none;
    justify-content: flex-start;
    font-size: 26px;
}

.landing-nav,
.landing-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.landing-nav a {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.landing-nav a:hover {
    background: rgba(30, 58, 95, 0.06);
    color: var(--text-primary);
}

.index-page .landing-header-actions {
    margin-top: 0;
    justify-content: flex-end;
}

.index-header-link-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.index-header-link-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.landing-auth-link {
    background: rgba(255, 255, 255, 0.64);
}

.landing-auth-link-primary {
    border-color: rgba(184, 147, 90, 0.32);
    background: var(--gold-pale);
    color: var(--text-primary);
}

.landing-auth-link-primary:hover {
    border-color: rgba(184, 147, 90, 0.48);
    background: rgba(255, 255, 255, 0.96);
}

.landing-main {
    display: grid;
    gap: clamp(54px, 7vw, 78px);
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(410px, 0.82fr);
    gap: clamp(32px, 5vw, 68px);
    align-items: center;
    min-height: min(620px, calc(100svh - 188px));
}

.landing-hero-copy {
    max-width: 690px;
}

.landing-kicker {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.3;
    text-transform: uppercase;
}

.landing-hero-title,
.landing-section h2,
.landing-final-cta h2 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0;
}

.landing-hero-title {
    max-width: 760px;
    font-size: clamp(58px, 8vw, 104px);
    line-height: 0.88;
}

.landing-hero-text {
    max-width: 650px;
    margin: 24px 0 0;
    color: var(--text-secondary);
    font-size: 19px;
    line-height: 1.58;
}

.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.landing-primary-cta,
.landing-secondary-cta {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.landing-primary-cta {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 28px rgba(30, 58, 95, 0.2);
}

.landing-primary-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(30, 58, 95, 0.22);
}

.landing-secondary-cta {
    border: 1px solid rgba(30, 58, 95, 0.14);
    background: rgba(255, 255, 255, 0.74);
    color: var(--text-primary);
}

.landing-secondary-cta:hover {
    border-color: rgba(184, 147, 90, 0.4);
    background: #fff;
    transform: translateY(-1px);
}

.landing-proof-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.landing-proof-strip span,
.landing-social-proof-grid span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.landing-proof-strip span::before,
.landing-social-proof-grid span::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(184, 147, 90, 0.12);
    flex: 0 0 auto;
}

.landing-hero-panel {
    min-width: 0;
}

.landing-preview-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 243, 235, 0.94)),
        #fff;
    box-shadow: 0 24px 70px rgba(26, 22, 20, 0.13);
}

.landing-preview-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: 3px solid rgba(184, 147, 90, 0.44);
    pointer-events: none;
}

.landing-preview-head,
.landing-preview-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.landing-preview-head span,
.landing-preview-grid span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-preview-head strong {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(43, 122, 75, 0.1);
    color: var(--success);
    font-size: 12px;
}

.landing-preview-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 16px;
    padding: 4px;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 12px;
    background: rgba(30, 58, 95, 0.04);
}

.landing-preview-tab {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

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

.landing-preview-tab.is-active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 6px 16px rgba(26, 22, 20, 0.08);
}

.landing-preview-stage {
    min-height: 406px;
    display: grid;
    margin-top: 16px;
}

.landing-preview-pane {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    animation: preview-pane-in 0.34s var(--motion-soft) both;
}

.landing-preview-pane[hidden] {
    display: none;
}

@keyframes preview-pane-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-product-frame {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 230px;
    overflow: hidden;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 14px;
    background: #fff;
}

.landing-product-sidebar {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px 12px;
    background: var(--accent);
}

.landing-product-sidebar span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
}

.landing-product-sidebar span:first-child {
    background: rgba(255, 255, 255, 0.92);
}

.landing-product-main {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 16px;
}

.landing-product-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
}

.landing-product-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, rgba(30, 58, 95, 0.92), rgba(47, 93, 91, 0.82)),
        var(--accent);
    box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.22);
}

.landing-product-person span,
.landing-product-context span,
.landing-timeline-preview span,
.landing-chat-bubble span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.landing-product-person strong {
    display: block;
    margin-top: 3px;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.16;
}

.landing-product-context {
    display: grid;
    gap: 10px;
}

.landing-product-context div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(30, 58, 95, 0.07);
}

.landing-product-context div:last-child {
    border-bottom: 0;
}

.landing-product-context strong {
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
}

.landing-preview-wheel {
    position: relative;
    width: min(276px, 66vw);
    aspect-ratio: 1;
    margin: 6px auto 2px;
    border: 1px solid rgba(30, 58, 95, 0.18);
    border-radius: 50%;
    background:
        repeating-conic-gradient(from -8deg, rgba(30, 58, 95, 0.12) 0deg 1deg, transparent 1deg 30deg),
        conic-gradient(from 22deg, rgba(184, 147, 90, 0.18), transparent 18%, rgba(47, 93, 91, 0.13), transparent 44%, rgba(30, 58, 95, 0.12), transparent 72%, rgba(184, 147, 90, 0.18)),
        radial-gradient(circle, transparent 0 31%, rgba(184, 147, 90, 0.18) 31.5% 32.5%, transparent 33% 52%, rgba(30, 58, 95, 0.14) 52.5% 53.5%, transparent 54%);
    animation: landing-wheel-drift 34s linear infinite;
}

@keyframes landing-wheel-drift {
    to { transform: rotate(360deg); }
}

.landing-preview-wheel::before,
.landing-preview-wheel::after,
.landing-preview-wheel span {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.landing-preview-wheel::before {
    inset: 16%;
    border: 1px dashed rgba(184, 147, 90, 0.42);
}

.landing-preview-wheel::after {
    inset: 47%;
    background: var(--accent);
}

.landing-preview-wheel span {
    width: 10px;
    height: 10px;
    background: var(--gold);
    box-shadow: 0 0 0 5px rgba(184, 147, 90, 0.12);
}

.landing-preview-wheel span:nth-child(1) { top: 10%; left: 48%; }
.landing-preview-wheel span:nth-child(2) { right: 16%; top: 32%; }
.landing-preview-wheel span:nth-child(3) { left: 24%; bottom: 18%; }
.landing-preview-wheel span:nth-child(4) { right: 28%; bottom: 13%; background: #2F5D5B; }

.landing-preview-note {
    padding: 16px;
    border: 1px solid rgba(184, 147, 90, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
}

.landing-preview-note strong {
    color: var(--text-primary);
    font-size: 14px;
}

.landing-preview-note p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.landing-preview-grid {
    margin-top: 14px;
}

.landing-preview-grid div {
    flex: 1;
    padding: 12px 0 0;
    border-top: 1px solid rgba(30, 58, 95, 0.08);
}

.landing-preview-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 16px;
}

.landing-timeline-preview {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(30, 58, 95, 0.09);
    border-radius: 14px;
    background: rgba(30, 58, 95, 0.08);
}

.landing-timeline-preview div {
    position: relative;
    display: grid;
    gap: 5px;
    padding: 13px 14px 13px 34px;
    background: rgba(255, 255, 255, 0.86);
}

.landing-timeline-preview div::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(184, 147, 90, 0.13);
}

.landing-timeline-preview strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.35;
}

.landing-chat-preview {
    display: grid;
    gap: 12px;
    min-height: 374px;
    align-content: center;
    padding: 16px;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(235, 240, 247, 0.72), rgba(255, 255, 255, 0.84)),
        #fff;
}

.landing-chat-bubble {
    max-width: 86%;
    padding: 14px 15px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.landing-chat-bubble-user {
    justify-self: end;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 22px rgba(30, 58, 95, 0.16);
}

.landing-chat-bubble-assistant {
    justify-self: start;
    border: 1px solid rgba(30, 58, 95, 0.1);
    background: #fff;
    color: var(--text-secondary);
}

.landing-chat-bubble strong {
    display: block;
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.landing-chat-bubble p {
    margin: 6px 0 0;
}

.landing-social-proof {
    display: grid;
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 22px 0;
    border-top: 1px solid rgba(30, 58, 95, 0.08);
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
}

.landing-social-proof p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
}

.landing-social-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.landing-section {
    display: grid;
    gap: 28px;
}

.landing-section-intro {
    max-width: 760px;
}

.landing-section h2,
.landing-final-cta h2 {
    font-size: clamp(38px, 5vw, 62px);
    line-height: 0.94;
}

.landing-section-intro > p:not(.landing-kicker),
.landing-final-cta > p:not(.landing-kicker) {
    margin: 16px 0 0;
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.62;
}

.landing-card-grid {
    display: grid;
    gap: 14px;
}

.landing-card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-card-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* The landing header is sticky, so an in-page anchor (#craft, #consultations, #faq)
   would otherwise scroll its heading underneath the bar. Offset the jump target. */
.landing-main > section[id] {
    scroll-margin-top: 88px;
}

/* "бета" chip next to a pillar/section label — flags a first-iteration feature
   so the page never over-promises what is still being built. */
.landing-badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--font-size-caption);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 1px var(--space-2);
    vertical-align: middle;
}

.landing-section-note {
    font-size: var(--font-size-label);
    color: var(--text-muted);
}

.landing-card,
.landing-quote {
    padding: 20px;
    border: 1px solid rgba(30, 58, 95, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 28px rgba(26, 22, 20, 0.05);
}

.landing-card h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.25;
}

.landing-card p,
.landing-quote p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.58;
}

.landing-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 18px;
    background: rgba(30, 58, 95, 0.1);
}

.landing-workflow div {
    min-height: 230px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.82);
}

.landing-workflow span {
    display: inline-flex;
    margin-bottom: 42px;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
}

.landing-workflow h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.18;
}

.landing-workflow p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.landing-feature-list {
    display: grid;
    border-top: 1px solid rgba(30, 58, 95, 0.1);
}

.landing-feature-list div {
    display: grid;
    grid-template-columns: minmax(210px, 0.32fr) minmax(0, 1fr);
    gap: 28px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(30, 58, 95, 0.1);
}

.landing-feature-list strong {
    color: var(--text-primary);
    font-size: 16px;
}

.landing-feature-list span {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.58;
}

.landing-quote {
    margin: 0;
}

.landing-quote p {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.landing-quote cite {
    display: block;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
}

.landing-form-section {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 520px);
    gap: clamp(24px, 4vw, 56px);
    align-items: start;
    padding: 36px;
    border: 1px solid rgba(30, 58, 95, 0.09);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(235, 240, 247, 0.72), rgba(255, 255, 255, 0.78) 45%, rgba(245, 237, 223, 0.5));
}

.landing-form-section .landing-section-intro {
    position: sticky;
    top: 112px;
}

.index-page .landing-form-section .birth-form {
    padding: 22px 22px 24px;
}

.landing-faq-list {
    display: grid;
    gap: 8px;
}

.landing-faq-list details {
    border: 1px solid rgba(30, 58, 95, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
}

.landing-faq-list summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 16px 18px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.landing-faq-list p {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.62;
}

.landing-final-cta {
    display: grid;
    justify-items: center;
    padding: clamp(42px, 7vw, 72px) 24px;
    border-radius: 24px;
    background: var(--accent);
    color: #fff;
    text-align: center;
}

.landing-final-cta .landing-kicker,
.landing-final-cta h2,
.landing-final-cta p {
    color: #fff;
}

.landing-final-cta .landing-kicker {
    opacity: 0.72;
}

.landing-final-cta p {
    max-width: 640px;
}

/* The final CTA sits on the navy fill, but `.landing-final-cta > p:not(.landing-kicker)`
   above carries higher specificity (0,2,1) than the white `.landing-final-cta p` (0,1,1),
   so the body copy was rendering in dark ink on navy. Match that specificity here (and
   win on order) so every paragraph on the navy block stays legible. */
.landing-final-cta > p:not(.landing-kicker) {
    color: rgba(255, 255, 255, 0.88);
}

.landing-final-cta > p.landing-hero-trial:not(.landing-kicker) {
    color: rgba(255, 255, 255, 0.72);
    margin-top: 14px;
}

.landing-final-cta .landing-primary-cta {
    margin-top: 24px;
    background: #fff;
    color: var(--accent);
}

/* ============ ERROR MESSAGE ============ */
.error-message {
    margin-top: 14px;
    padding: 12px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 13.5px;
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 24px 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   CHART PAGE STYLES
   ============================================ */

.chart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font-ui);
}

.back-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: rgba(26,22,20,0.2);
}

.birth-info {
    text-align: center;
}

.birth-info h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 4px;
}

.birth-info p {
    font-size: 13.5px;
    color: var(--text-muted);
}

/* Chart layout */
.chart-main {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
    min-height: calc(100vh - 100px);
}

@media (max-width: 1024px) {
    .chart-main {
        grid-template-columns: 1fr;
    }
}

/* Chart wheel */
.chart-wheel-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    position: relative;
}

.chart-wheel-wrapper {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    overflow: hidden;
    box-sizing: border-box;
    padding-block: 16px;
    cursor: grab;
    border-radius: var(--radius-sm);
}

.chart-wheel-wrapper:active {
    cursor: grabbing;
}

#chartWheel {
    width: 100%;
    height: 100%;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
}

/* Zoom controls */
.zoom-controls {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.zoom-controls-float {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    padding: 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.zoom-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.zoom-btn:active {
    transform: scale(0.92);
}

/* Data panel */
.data-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.tab-btn {
    flex: 1;
    padding: 10px 6px;
    background: none;
    border: none;
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--font-ui);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

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

.tab-btn.active {
    color: var(--accent);
    background: var(--bg-secondary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

/* Tab content */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Section titles */
.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th,
.data-table td {
    padding: 9px 11px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-tertiary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.data-table tr.active-row {
    background: rgba(30, 58, 95, 0.08);
    border-left: 3px solid var(--accent);
}

.data-table tr[data-planet] {
    cursor: pointer;
}

.data-table .mono {
    font-family: var(--font-mono);
    font-size: 12.5px;
}

/* Planet row */
.planet-icon {
    font-size: 17px;
    margin-right: 5px;
}

/* Retro badge */
.retro-badge {
    display: inline-block;
    padding: 1px 5px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

.retro-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05em;
    height: 1.05em;
    margin-left: 4px;
    padding: 0 0.28em;
    border-radius: 999px;
    background: #FEE2E2;
    color: #991B1B;
    font-size: 10px;
    font-family: var(--font-ui);
    line-height: 1;
    font-weight: 600;
    vertical-align: middle;
}

.retro-indicator--small {
    font-size: 9px;
    min-width: 0.95em;
    height: 0.95em;
}

.retro-indicator--micro {
    font-size: 8px;
    min-width: 0.9em;
    height: 0.9em;
    margin-left: 2px;
    padding: 0 0.2em;
}

.planet-symbol-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.planet-status-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-ui);
}

.planet-status-group .retro-indicator {
    margin-left: 0;
}

.planet-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05em;
    height: 1.05em;
    padding: 0 0.28em;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-ui);
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    vertical-align: middle;
}

.planet-status-badge--small {
    font-size: 9px;
    min-width: 0.95em;
    height: 0.95em;
}

.planet-status-badge--stationary {
    background: rgba(212, 192, 132, 0.22);
    color: var(--accent);
    border-color: rgba(184, 147, 90, 0.18);
}

.planet-status-badge--dignity {
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Sun-relation badges (cazimi / combust / under rays). */
.planet-status-badge--sun-relation {
    letter-spacing: 0.01em;
}

.planet-status-badge--cazimi {
    background: rgba(212, 175, 55, 0.22);
    color: #8a6d12;
    border-color: rgba(212, 175, 55, 0.35);
}

.planet-status-badge--combust {
    background: rgba(184, 50, 50, 0.1);
    color: #8f2f2f;
    border-color: rgba(184, 50, 50, 0.16);
}

.planet-status-badge--under_rays {
    background: rgba(184, 147, 90, 0.12);
    color: #866231;
    border-color: rgba(184, 147, 90, 0.18);
}

/* Solar-phase badges (oriental / occidental). */
.planet-status-badge--solar-phase {
    letter-spacing: 0.01em;
}

/* Out-of-bounds badge (declination beyond the Sun's). */
.planet-status-badge--oob {
    background: rgba(184, 50, 50, 0.12);
    color: #8f2f2f;
    border-color: rgba(184, 50, 50, 0.2);
    letter-spacing: 0.01em;
}

.planet-status-badge--oriental {
    background: rgba(30, 58, 95, 0.08);
    color: var(--accent);
    border-color: rgba(30, 58, 95, 0.14);
}

.planet-status-badge--occidental {
    background: rgba(90, 70, 120, 0.1);
    color: #5a4678;
    border-color: rgba(90, 70, 120, 0.16);
}

/* Out-of-bounds badge (|declination| > obliquity of the ecliptic). */
.planet-status-badge--out-of-bounds {
    background: rgba(160, 82, 45, 0.12);
    color: #a0522d;
    border-color: rgba(160, 82, 45, 0.2);
    letter-spacing: 0.01em;
}

.planet-status-badge--domicile {
    background: rgba(43, 122, 75, 0.1);
    color: #1f5d39;
    border-color: rgba(43, 122, 75, 0.16);
}

.planet-status-badge--exaltation {
    background: rgba(30, 58, 95, 0.1);
    color: var(--accent);
    border-color: rgba(30, 58, 95, 0.16);
}

.planet-status-badge--detriment {
    background: rgba(184, 50, 50, 0.08);
    color: #8f2f2f;
    border-color: rgba(184, 50, 50, 0.14);
}

.planet-status-badge--fall {
    background: rgba(184, 147, 90, 0.14);
    color: #866231;
    border-color: rgba(184, 147, 90, 0.2);
}

.planet-position-main {
    white-space: nowrap;
}

.planet-position-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.planet-meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(230, 224, 212, 0.8);
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.planet-meta-chip--stationary {
    background: rgba(212, 192, 132, 0.22);
    color: var(--accent);
}

.planet-meta-chip--speed-slow {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.planet-meta-chip--speed-fast {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}

.planet-speed-col,
.planet-speed-cell {
    width: 72px;
    text-align: center;
    white-space: nowrap;
}

.planets-table--speed-hidden .planet-speed-col,
.planets-table--speed-hidden .planet-speed-cell {
    display: none;
}

/* Angular houses */
.house-angular td {
    font-weight: 600;
    color: var(--accent);
}

/* Aspect colors */
.aspect-harmonious { color: var(--success); }
.aspect-tense      { color: var(--error);   }
.aspect-neutral    { color: var(--text-secondary); }

/* Balance bars */
.balance-subtabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 16px;
    background: rgba(240, 237, 228, 0.72);
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 999px;
}

.balance-subtab-btn {
    min-height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.balance-subtab-btn.active {
    background: var(--bg-secondary);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.balance-subtab-panel {
    display: none;
}

.balance-subtab-panel.active {
    display: block;
}

.balance-section {
    margin-bottom: 24px;
}

.balance-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.balance-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 3ch;
    grid-template-areas: "label bar value";
    align-items: center;
    column-gap: 10px;
    margin-bottom: 8px;
    min-width: 0;
}

.balance-label {
    grid-area: label;
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 0;
    overflow-wrap: anywhere;
}

.balance-bar-container {
    grid-area: bar;
    height: 7px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.balance-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.balance-value {
    grid-area: value;
    font-size: 12.5px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
    justify-self: end;
    white-space: nowrap;
}

/* Element colors */
.bar-fire  { background: linear-gradient(90deg, #F97316, #EA580C); }
.bar-earth { background: linear-gradient(90deg, #84CC16, #65A30D); }
.bar-air   { background: linear-gradient(90deg, #06B6D4, #0891B2); }
.bar-water { background: linear-gradient(90deg, #3B82F6, #2563EB); }

/* Configuration cards */
.config-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.config-card h4 {
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.config-card p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.config-planets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.planet-tag {
    padding: 3px 9px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* ============================================
   ASPECT GRID (Triangular Matrix)
   ============================================ */

.aspect-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 8px;
}

.aspect-grid th,
.aspect-grid td {
    width: 20px;
    height: 20px;
    min-width: 20px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--border);
    font-size: 11px;
    padding: 2px;
}

.aspect-grid th {
    background: var(--bg-tertiary);
    font-weight: 500;
    font-size: 10px;
    color: var(--text-muted);
}

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

.aspect-grid .grid-harmonious {
    background: rgba(43, 122, 75, 0.12);
    color: #1A6638;
    font-weight: 600;
}

.aspect-grid .grid-tense {
    background: rgba(184, 50, 50, 0.12);
    color: #A02020;
    font-weight: 600;
}

.aspect-grid .grid-neutral {
    background: rgba(176, 125, 16, 0.12);
    color: #8A6010;
    font-weight: 600;
}

.aspect-grid td.grid-hover {
    box-shadow: inset 0 0 0 2px var(--accent);
    background: rgba(30, 58, 95, 0.14);
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   DIGNITIES TABLE
   ============================================ */

.dignities-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
}

.dignity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.dignity-planet { font-weight: 500; }
.dignity-label  { font-size: 12px; }

.dignity-domicile   { background: rgba(43, 122, 75, 0.10); border-left: 3px solid #2B7A4B; }
.dignity-exaltation { background: rgba(30,  58, 95, 0.10); border-left: 3px solid #1E3A5F; }
.dignity-detriment  { background: rgba(184, 50, 50, 0.10); border-left: 3px solid #B83232; }
.dignity-fall       { background: rgba(184,147, 90, 0.12); border-left: 3px solid #B8935A; }

/* ============================================
   JONES + DISPOSITOR CHAINS
   ============================================ */

.dispositor-panel {
    display: grid;
    gap: 14px;
}

.dispositor-panel--tabs {
    gap: 12px;
}

.dispositor-tabs {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 420px);
    padding: 3px;
    border: 1px solid rgba(30, 58, 95, 0.10);
    border-radius: 10px;
    background: rgba(240, 237, 228, 0.72);
}

.dispositor-tab {
    appearance: none;
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 10px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.dispositor-tab:hover {
    color: var(--accent);
}

.dispositor-tab.active {
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent);
    box-shadow: 0 6px 14px rgba(26, 22, 20, 0.06);
}

.dispositor-tab-panel {
    display: none;
}

.dispositor-tab-panel.active {
    display: block;
}

.dispositor-jones-card,
.dispositor-section {
    border: 1px solid rgba(30, 58, 95, 0.10);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 231, 0.78));
    padding: 14px;
    box-shadow: 0 10px 24px rgba(26, 22, 20, 0.05);
}

.dispositor-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: rgba(30, 58, 95, 0.68);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dispositor-jones-card h4,
.dispositor-section h4 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-display, serif);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.05;
}

.dispositor-jones-card p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.dispositor-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dispositor-options {
    position: relative;
    flex: 0 0 auto;
}

.dispositor-options-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    max-width: 132px;
    border: 1px solid rgba(30, 58, 95, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--accent);
    cursor: pointer;
    padding: 6px 8px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.dispositor-options-toggle:hover,
.dispositor-options-toggle[aria-expanded="true"] {
    background: #fff;
    border-color: rgba(30, 58, 95, 0.28);
    box-shadow: 0 6px 16px rgba(26, 22, 20, 0.06);
}

.dispositor-options-toggle span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dispositor-options-chevron {
    color: rgba(30, 58, 95, 0.58);
    font-size: 12px;
    line-height: 1;
}

.dispositor-options-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    width: min(238px, calc(100vw - 34px));
    overflow: hidden;
    border: 1px solid rgba(30, 58, 95, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(26, 22, 20, 0.16);
}

.dispositor-options-group {
    display: grid;
}

.dispositor-options-divider {
    height: 1px;
    background: rgba(30, 58, 95, 0.10);
}

.dispositor-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
}

.dispositor-option-row:last-child {
    border-bottom: 0;
}

.dispositor-option-row:hover {
    background: rgba(30, 58, 95, 0.05);
}

.dispositor-option-row input {
    appearance: auto;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    accent-color: var(--accent);
}

.dispositor-mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: -2px 0 12px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.10);
}

.dispositor-mode-tab {
    position: relative;
    appearance: none;
    border: 0;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 9px 6px 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    transition: color var(--transition), background var(--transition);
}

.dispositor-mode-tab::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: transparent;
}

.dispositor-mode-tab:hover,
.dispositor-mode-tab.active {
    color: var(--accent);
    background: rgba(30, 58, 95, 0.05);
}

.dispositor-mode-tab.active::after {
    background: #4a90e2;
}

.dispositor-main-rulers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dispositor-main-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(184, 147, 90, 0.24);
    border-radius: 999px;
    background: rgba(184, 147, 90, 0.10);
    color: var(--text-primary);
    padding: 6px 7px;
    font-size: 12px;
    font-weight: 600;
}

.dispositor-main-chip b {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.12);
    color: var(--accent);
    font-size: 11px;
}

.dispositor-compact-diagram {
    display: grid;
    gap: 8px;
}

.dispositor-compact-group {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 6px;
    scrollbar-width: thin;
}

.dispositor-compact-graph {
    position: relative;
    width: max(100%, var(--graph-width));
    min-width: var(--graph-width);
    height: var(--graph-height);
}

.dispositor-compact-lines {
    position: absolute;
    inset: 0;
    width: var(--graph-width);
    height: var(--graph-height);
    overflow: visible;
    pointer-events: none;
}

.dispositor-compact-lines path {
    fill: none;
    stroke: rgba(26, 22, 20, 0.90);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dispositor-compact-lines marker path {
    fill: none;
    stroke: rgba(26, 22, 20, 0.90);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dispositor-compact-mutual {
    stroke-width: 2;
}

.dispositor-compact-node {
    position: absolute;
    z-index: 2;
    display: grid;
    grid-template-rows: 34px 18px;
    align-items: start;
    justify-items: center;
    width: 42px;
    min-height: 56px;
    color: var(--text-primary);
}

.dispositor-compact-node--static {
    position: relative;
    left: auto;
    top: auto;
    flex: 0 0 42px;
}

.dispositor-compact-symbol {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 34px;
    color: var(--text-primary);
    line-height: 1;
}

.dispositor-compact-node--main .dispositor-compact-symbol {
    color: var(--text-primary);
    filter: drop-shadow(0 1px 0 rgba(26, 22, 20, 0.10));
}

.dispositor-compact-node--repeat {
    opacity: 0.72;
}

.dispositor-cycle-table {
    display: grid;
    gap: 9px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 6px;
    scrollbar-width: thin;
}

.dispositor-cycle-row,
.dispositor-cycle-branch-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    min-width: max-content;
}

.dispositor-cycle-row {
    padding-bottom: 4px;
}

.dispositor-cycle-branches {
    display: grid;
    gap: 5px;
}

.dispositor-cycle-arrow {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-top: 1px;
    color: rgba(26, 22, 20, 0.90);
}

.dispositor-cycle-arrow path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dispositor-house-label {
    display: block;
    max-width: 74px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
}

.dispositor-open-modal-btn {
    width: 100%;
    margin-top: 14px;
    border: 1px solid rgba(30, 58, 95, 0.18);
    border-radius: 12px;
    background: rgba(30, 58, 95, 0.08);
    color: var(--accent);
    cursor: pointer;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.dispositor-open-modal-btn:hover {
    background: rgba(30, 58, 95, 0.12);
    border-color: rgba(30, 58, 95, 0.28);
    transform: translateY(-1px);
}

.dispositor-modal-open {
    overflow: hidden;
}

.dispositor-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 22, 20, 0.35);
    padding: var(--space-4);
}

.dispositor-modal {
    width: min(960px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
}

.dispositor-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.12);
}

.dispositor-modal-head h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-display, serif);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 600;
    line-height: 1;
}

.dispositor-modal-close {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(30, 58, 95, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.dispositor-modal-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.dispositor-diagram {
    display: grid;
    gap: 18px;
}

.dispositor-diagram-group {
    border: 1px solid rgba(30, 58, 95, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    padding: 14px;
}

.dispositor-diagram-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.dispositor-diagram-group-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 20px;
}

.dispositor-cycle-mark {
    color: rgba(30, 58, 95, 0.42);
    font-size: 13px;
}

.dispositor-diagram-count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.10);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.dispositor-chain-list {
    display: grid;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.dispositor-graph {
    position: relative;
    width: var(--graph-width);
    min-width: 100%;
    height: var(--graph-height);
    overflow: visible;
}

.dispositor-graph-lines {
    position: absolute;
    inset: 0;
    width: var(--graph-width);
    height: var(--graph-height);
    overflow: visible;
    pointer-events: none;
}

.dispositor-graph-lines path {
    fill: none;
    stroke: rgba(30, 58, 95, 0.44);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dispositor-graph-lines marker path {
    fill: rgba(30, 58, 95, 0.48);
    stroke: none;
}

.dispositor-chain-row {
    width: max-content;
    min-width: 100%;
}

.dispositor-chain-path {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 42px;
}

.dispositor-chain-node {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(30, 58, 95, 0.16);
    border-radius: 10px;
    background: rgba(248, 247, 243, 0.92);
    color: var(--text-primary);
    box-shadow: 0 6px 16px rgba(26, 22, 20, 0.06);
    font-size: 18px;
    z-index: 2;
}

.dispositor-modal .dispositor-chain-node {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
}

.dispositor-node-retro {
    position: absolute;
    right: 6px;
    bottom: 4px;
    color: #d94b4b;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.dispositor-chain-node--main {
    border-color: rgba(74, 144, 226, 0.82);
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.28), 0 8px 18px rgba(30, 58, 95, 0.08);
}

.dispositor-chain-node--external {
    border-style: dashed;
}

.dispositor-chain-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: rgba(30, 58, 95, 0.48);
    font-size: 18px;
    font-weight: 600;
}

.dispositor-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 680px) {
    .dispositor-modal-overlay {
        align-items: stretch;
        padding: 10px;
    }

    .dispositor-modal {
        max-height: calc(100vh - 20px);
        border-radius: 18px;
        padding: 16px;
    }

    .dispositor-mode-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================
   ENHANCED INTERACTIVITY
   ============================================ */

.data-table tr[data-planet],
.data-table tr[data-aspect] {
    cursor: pointer;
}

.data-table tr[data-planet]:hover td,
.data-table tr[data-aspect]:hover td {
    background: var(--bg-hover);
}

.data-table tr.active-row {
    background: rgba(30, 58, 95, 0.10) !important;
    border-left: 3px solid var(--accent);
}

.data-table tr.aspect-hover-row {
    background: rgba(30, 58, 95, 0.08);
    border-left: 3px solid var(--accent);
}

.planet-group:hover .planet-symbol-text,
.planet-group:hover .planet-symbol-svg,
.planet-symbol-svg.is-active {
    filter: drop-shadow(0 0 4px rgba(30, 58, 95, 0.4));
}

.aspect-line {
    cursor: pointer;
    transition: opacity 0.15s, stroke-width 0.15s;
}

.body-action-menu,
.forecast-new-body-action-menu {
    position: fixed;
    z-index: 35;
    min-width: 92px;
    padding: 8px;
    border: 1px solid rgba(30, 58, 95, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 36px rgba(30, 58, 95, 0.16);
    backdrop-filter: blur(12px);
}

.body-action-menu-title,
.forecast-new-body-action-menu-title {
    margin: 0 0 6px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.body-action-menu-controls,
.forecast-new-body-action-menu-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.body-action-toggle,
.forecast-new-body-action-toggle {
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    font-weight: 600;
    color: var(--text-muted);
}

.forecast-new-body-action-menu .settings-check-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    border: 1px solid rgba(212, 201, 181, 0.6);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
}

.forecast-new-body-action-menu .settings-check-option-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1;
}

.forecast-new-body-action-menu .settings-check-option--icon-only {
    min-width: 30px;
    padding-inline: 0;
}

.forecast-new-body-action-menu[data-menu-scope="natal"] .settings-check-option--pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 32px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}

.forecast-new-body-action-menu[data-menu-scope="natal"] .forecast-new-body-action-toggle {
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    font-weight: 600;
    color: var(--text-muted);
}

.forecast-new-body-action-menu[data-menu-scope="natal"] .settings-check-option-glyph {
    font-size: 15px;
}

.forecast-new-body-action-menu[data-menu-scope="natal"] .settings-check-option--pill[aria-pressed="true"] {
    border-color: rgba(30, 58, 95, 0.34);
    background: var(--accent-light);
    color: var(--accent);
}

.settings-check-option--pill[aria-pressed="true"] {
    border-color: rgba(30, 58, 95, 0.34);
    background: var(--accent-light);
    color: var(--accent);
}

.body-action-toggle[aria-pressed="true"],
.forecast-new-body-action-toggle[aria-pressed="true"],
.forecast-new-body-action-menu .settings-check-option[aria-pressed="true"] {
    border-color: rgba(30, 58, 95, 0.34);
    background: var(--accent-light);
    color: var(--accent);
}

.chart-layout .planet-group.matrix-hidden,
.chart-layout .aspect-line.matrix-hidden,
.chart-layout .aspect-symbol-group.matrix-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

/* ============================================
   TEXT UTILITIES
   ============================================ */

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

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

.chart-tooltip {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: none;
    box-sizing: border-box;
    width: max-content;
    min-width: max-content;
    max-width: min(420px, calc(100vw - 24px));
    white-space: normal;
    overflow-wrap: anywhere;
}

.chart-tooltip strong {
    font-size: 14px;
    color: var(--text-primary);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.subsection-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */

.settings-panel {
    position: absolute;
    top: 50px;
    right: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel h4 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

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

.settings-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.settings-select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    cursor: pointer;
    font-family: var(--font-ui);
}

.settings-select:focus {
    outline: none;
    border-color: var(--border-focus);
}

.settings-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-size-control input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.settings-size-control span {
    min-width: 44px;
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
}

.planet-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.planet-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid var(--border);
}

.planet-toggle:hover {
    background: var(--bg-secondary);
}

.planet-toggle input {
    margin: 0;
    accent-color: var(--accent);
}

.planet-toggle--icon-only {
    justify-content: center;
    min-width: 42px;
    min-height: 34px;
    padding: 4px 6px;
}

.planet-toggle-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    line-height: 1;
    color: var(--text-primary);
}

.planet-toggle.disabled {
    opacity: 0.5;
    background: var(--bg-tertiary);
}

.btn-apply {
    width: 100%;
    padding: 9px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-apply:hover {
    background: var(--accent-hover);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: var(--text-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 11px 16px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    max-width: 360px;
    font-family: var(--font-ui);
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* ============================================
   LOCALE SWITCHER
   ============================================ */

.locale-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.locale-switcher--inline {
    position: static;
    z-index: auto;
    margin-left: 8px;
    flex-shrink: 0;
}

.locale-switcher--floating {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 12000;
    box-shadow: var(--shadow-md);
}

.locale-switcher-label {
    font-size: 12px;
    line-height: 1;
    color: var(--text-muted);
}

.locale-switcher-select {
    width: auto;
    min-width: 84px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 12px) calc(50% - 1px),
        calc(100% - 7px) calc(50% - 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 22px 4px 8px;
    font-family: var(--font-ui);
    box-shadow: none;
}

.header .locale-switcher--inline {
    display: inline-flex;
    margin: 10px auto 0;
}

.chart-header-compact .locale-switcher--inline,
.forecast-header .locale-switcher--inline,
.header-content .locale-switcher--inline {
    margin-left: 6px;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
    .birth-form,
    .clients-dialog-card,
    .chart-dialog-card {
        padding: 24px 18px 20px;
    }

    .name-inputs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .date-inputs {
        display: grid;
        grid-template-columns: minmax(72px, 0.85fr) minmax(0, 1.45fr) minmax(92px, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    .time-inputs {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }

    .time-separator {
        justify-self: center;
        align-self: center;
    }

    input,
    select {
        min-height: 46px;
    }

    .place-suggestion {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 12px 14px;
        line-height: 1.35;
    }

    .form-section + .form-section {
        margin-top: 22px;
        padding-top: 20px;
    }

    .form-section-title {
        font-size: 24px;
    }

    .index-page .birth-form {
        padding: 20px 18px 22px;
    }

    .index-page .name-inputs {
        display: flex;
        gap: 8px;
    }

    .index-page .date-inputs,
    .index-page .time-inputs {
        gap: 8px;
    }

    .index-page input,
    .index-page select {
        min-height: 44px;
    }

    .index-page .form-section + .form-section {
        margin-top: 16px;
        padding-top: 14px;
    }

    .index-page .form-section-title {
        font-size: 22px;
    }

    .coords-display {
        padding: 13px;
    }

    .coords-inputs {
        gap: 10px;
    }

    .coord-input-group {
        gap: 4px;
    }

    .coord-num,
    .coord-dir {
        min-height: 38px;
    }

    .chart-wheel-wrapper {
        width: 100vw;
        height: 100vw;
        max-height: 90vh;
        touch-action: pinch-zoom pan-x pan-y;
    }

    .chart-layout {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        max-height: none;
        min-height: 0;
        overflow: hidden;
    }

    .aspect-grid th,
    .aspect-grid td {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .data-table.compact td,
    .data-table.compact th {
        padding: 6px 8px;
        font-size: 12px;
    }

    .settings-panel {
        left: 10px;
        right: 10px;
        min-width: auto;
    }

    .locale-switcher--floating {
        top: 8px;
        right: 8px;
        padding: 5px 6px;
    }

    .locale-switcher-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 14px 12px 18px;
    }

    .birth-form {
        padding: 22px 16px 18px;
        border-radius: 18px;
    }

    .form-section + .form-section {
        margin-top: 20px;
        padding-top: 18px;
    }

    .form-section-heading {
        margin-bottom: 14px;
    }

    .form-section-title {
        font-size: 22px;
    }

    .form-section-copy {
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        margin-bottom: 8px;
    }

    .date-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-inputs select {
        grid-column: 1 / -1;
        order: -1;
    }

    .time-inputs {
        grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
        gap: 8px;
    }

    .time-separator {
        font-size: 18px;
    }

    .coords-display {
        padding: 12px;
    }

    .advanced-fields-summary {
        padding: 14px 14px 14px 15px;
        gap: 10px;
    }

    .advanced-fields-content {
        padding: 0 14px 14px;
    }

    .advanced-fields-title {
        font-size: 13px;
    }

    .index-page .container {
        padding: 10px 12px 16px;
    }

    .index-page .birth-form {
        padding: 18px 16px 18px;
        border-radius: 16px;
    }

    .index-page .form-section + .form-section {
        margin-top: 15px;
        padding-top: 13px;
    }

    .index-page .form-section-heading {
        margin-bottom: 9px;
    }

    .index-page .form-section-title {
        font-size: 21px;
    }

    .index-page .form-group {
        margin-bottom: 13px;
    }

    .index-page .form-label {
        margin-bottom: 6px;
    }

    .index-page .advanced-fields-summary {
        padding: 9px 12px 9px 13px;
    }

    .index-page .advanced-fields-title {
        font-size: 12.5px;
    }

    .advanced-fields-copy,
    .submit-note {
        font-size: 11.5px;
    }

    .form-summary-card {
        padding: 14px 15px;
    }

    .coord-input-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .coord-num {
        width: 44px;
        padding: 8px 4px;
    }

    .coord-num.coord-sec {
        width: 66px;
    }

    .coord-dir {
        min-width: 52px;
        margin-left: 0;
        padding: 8px 4px;
    }

    #balances-list {
        padding-right: 18px;
    }

    .balance-subtabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .balance-subtab-btn {
        width: 100%;
    }

    .balance-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label label"
            "bar value";
        row-gap: 6px;
        column-gap: 12px;
    }

    .balance-label,
    .balance-value {
        font-size: 12px;
    }

    .balance-value {
        min-width: 3ch;
    }
}

/* Chart configuration presets — save current settings as a named config + reapply later */
.chart-presets-row {
    position: relative;
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.chart-presets-row .preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
}
.chart-presets-picker-btn {
    padding: 5px 8px !important;
}
.chart-presets-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.chart-presets-popover {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 60;
    min-width: 220px;
    max-width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 8px;
}
.chart-presets-popover.hidden { display: none; }
.chart-presets-popover-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, var(--text-secondary));
    padding: 2px 6px 8px;
}
.chart-presets-popover-empty {
    padding: 6px 6px 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.chart-presets-popover-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}
.chart-presets-popover-item {
    display: flex;
    align-items: stretch;
    gap: 4px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.chart-presets-popover-item:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.04)); }
.chart-presets-popover-apply {
    flex: 1 1 auto;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 7px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chart-presets-popover-delete {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.chart-presets-popover-delete:hover {
    color: var(--danger, #d04848);
    background: rgba(208, 72, 72, 0.08);
}
.chart-presets-popover-delete svg {
    width: 12px;
    height: 12px;
}

@media (max-width: 980px) {
    .landing-header {
        grid-template-columns: 1fr auto;
    }

    .landing-nav {
        display: none;
    }

    .landing-hero,
    .landing-social-proof,
    .landing-form-section {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: 0;
    }

    .landing-card-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-social-proof-grid {
        justify-content: flex-start;
    }

    .landing-form-section .landing-section-intro {
        position: static;
    }
}

@media (max-width: 760px) {
    .index-page .landing-shell {
        padding: 12px 14px 24px;
    }

    .landing-header {
        position: static;
        grid-template-columns: 1fr;
        margin: 0 0 34px;
    }

    .landing-logo,
    .index-page .landing-header-actions {
        justify-content: center;
    }

    .landing-main {
        gap: 54px;
    }

    .landing-hero-title {
        font-size: 48px;
    }

    .landing-hero-text {
        font-size: 17px;
    }

    .landing-preview-card {
        padding: 16px;
    }

    .landing-preview-stage {
        min-height: auto;
    }

    .landing-preview-wheel {
        width: min(250px, 76vw);
        margin: 20px auto;
    }

    .landing-card-grid-3,
    .landing-card-grid-4,
    .landing-workflow {
        grid-template-columns: 1fr;
    }

    .landing-workflow {
        gap: 1px;
    }

    .landing-workflow div {
        min-height: 0;
    }

    .landing-workflow span {
        margin-bottom: 28px;
    }

    .landing-feature-list div {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .landing-form-section {
        padding: 22px 16px;
        border-radius: 18px;
    }
}

@media (max-width: 520px) {
    .index-page .landing-shell {
        padding-inline: 12px;
    }

    .landing-header-actions {
        width: 100%;
    }

    .index-page .landing-header-actions .index-header-link {
        flex: 1;
        min-width: calc(50% - 4px);
        padding-inline: 10px;
        text-align: center;
    }

    .landing-hero-title {
        font-size: 42px;
    }

    .landing-hero-actions {
        display: grid;
    }

    .landing-primary-cta,
    .landing-secondary-cta {
        width: 100%;
    }

    .landing-preview-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .landing-product-frame {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .landing-product-sidebar {
        padding: 12px 8px;
    }

    .landing-product-sidebar span {
        width: 28px;
        height: 28px;
    }

    .landing-product-context div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .landing-product-context strong {
        white-space: normal;
    }

    .landing-chat-preview {
        min-height: 320px;
        padding: 12px;
    }

    .landing-chat-bubble {
        max-width: 100%;
    }

    .landing-section h2,
    .landing-final-cta h2 {
        font-size: 36px;
    }

    .landing-card,
    .landing-quote {
        padding: 18px;
    }
}
