html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0e1230;
    color: #eaeaff;
}

a { color: #b4a8ff; }
a:hover { color: #fff; }

h1, h2, h3 { color: #fff; letter-spacing: -0.01em; }

/* ---- Layout ---- */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0e1230 0%, #1d1845 60%, #2a1d4a 100%);
    color: #eaeaff;
}
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(10, 12, 32, 0.7);
    backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: #fff; font-weight: 600; letter-spacing: 0.5px; }
.brand-mark { font-size: 1.6rem; color: #ffd166; }
.brand-name { font-size: 1.2rem; }
.app-nav { display: flex; gap: 1.2rem; }
.nav-link { color: #c9c9e6; text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0.6rem; border-radius: 6px; }
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-main { flex: 1; padding: 2rem 1.5rem 3rem; max-width: 1200px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.app-footer { text-align: center; font-size: 0.8rem; color: rgba(234, 234, 255, 0.5); padding: 1rem; border-top: 1px solid rgba(255,255,255,0.06); }
.app-footer a { color: rgba(234, 234, 255, 0.7); }

/* ---- Forms ---- */
.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: #ffd166;
    box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.18);
}
.form-control::placeholder { color: rgba(234, 234, 255, 0.42); }

.label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(234, 234, 255, 0.7);
    margin: 0 0 0.35rem 0.05rem;
}

.btn-primary {
    background: linear-gradient(90deg, #ff6b9d 0%, #c84bd3 60%, #6a4bff 100%);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(106, 75, 255, 0.35);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(106, 75, 255, 0.45); color: white; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    background: transparent;
    color: #c8c0ff;
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s ease;
    font-family: inherit;
    display: inline-block;
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); color: #fff; }

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
}

.field { margin-bottom: 0.9rem; }
.field.row { display: flex; gap: 0.75rem; }
.coords { font-size: 0.78rem; font-family: 'JetBrains Mono', ui-monospace, monospace; color: rgba(234, 234, 255, 0.55); margin-top: 0.4rem; }

.validation { color: #ff8aa8; font-size: 0.9rem; margin: 1rem 0; }

/* ---- Place autocomplete (vanilla JS island) ---- */
.place-autocomplete { position: relative; }
.place-autocomplete .suggestions {
    position: absolute; top: 100%; left: 0; right: 0; margin: 2px 0 0; padding: 0;
    list-style: none; background: white; border: 1px solid #ccc; border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); max-height: 240px; overflow-y: auto;
    z-index: 1000;
}
.place-autocomplete .suggestions li { padding: 8px 12px; cursor: pointer; font-size: 0.92rem; color: #222; }
.place-autocomplete .suggestions li:hover, .place-autocomplete .suggestions li.active { background: #f3f4f6; }

/* ---- Person form cards ---- */
.people-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 800px) { .people-grid { grid-template-columns: 1fr; } }
.person-card { border-top: 3px solid var(--accent, #ffd166); }
.person-card h2 { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 600; letter-spacing: 0.02em; }

.hero { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.hero h1 { font-size: 2.4rem; margin: 0 0 0.8rem; line-height: 1.15; }
.lede { color: rgba(234, 234, 255, 0.75); font-size: 1.05rem; line-height: 1.55; margin: 0; }
.compute-row { text-align: center; padding: 1rem 0 2rem; }

/* ---- Result page ---- */
.headline { text-align: center; margin-bottom: 2.5rem; }
.names { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.amp { color: #ffd166; margin: 0 0.4rem; font-weight: 400; }
.locations { color: rgba(234, 234, 255, 0.55); font-size: 0.9rem; margin-bottom: 0.4rem; }
.coords-verify { display: flex; gap: 1.5rem; justify-content: center; font-size: 0.72rem; color: rgba(234, 234, 255, 0.4); margin-bottom: 1.6rem; flex-wrap: wrap; }
.coords-verify code { color: rgba(234, 234, 255, 0.6); background: rgba(255,255,255,0.04); padding: 1px 5px; border-radius: 3px; }

.score-block { display: flex; gap: 2.5rem; justify-content: center; align-items: baseline; margin: 2rem 0; flex-wrap: wrap; }
.score-main .score-value { font-size: 4.2rem; font-weight: 700; line-height: 1; background: linear-gradient(90deg, #ff6b9d, #6a4bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-aux .score-value { font-size: 2.2rem; font-weight: 600; line-height: 1; color: #fff; }
.score-aux .score-value.pos { color: #80f0b8; }
.score-aux .score-value.neg { color: #ff8aa8; }
.score-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(234, 234, 255, 0.55); margin-top: 0.35rem; text-align: center; }
.pct-sym { font-size: 1.3rem; opacity: 0.6; }

.bars { max-width: 600px; margin: 1.5rem auto 0; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(255,255,255,0.05); }
.bar-fill.harm { background: #80f0b8; }
.bar-fill.chal { background: #ff8aa8; }
.bar-fill.neut { background: #ffd166; }
.bar-legend { display: flex; justify-content: center; gap: 1.4rem; margin-top: 0.6rem; font-size: 0.82rem; color: rgba(234, 234, 255, 0.7); flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4rem; vertical-align: -1px; }
.dot.harm { background: #80f0b8; } .dot.chal { background: #ff8aa8; } .dot.neut { background: #ffd166; }

.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .grid-two { grid-template-columns: 1fr; } }
.muted { color: rgba(234, 234, 255, 0.55); font-size: 0.85rem; margin-top: -0.3rem; }

/* ---- Results page: summaries-first progressive disclosure (docs/ux/results-page-spec.md) ---- */
.compat-card { margin-bottom: 1.5rem; }
.ai-line { font-size: 1.08rem; line-height: 1.6; color: #efefff; margin: 1.1rem 0; }
.ai-cursor {
    display: inline-block; width: 0.5em; height: 1em; margin-left: 2px;
    background: #ffd166; vertical-align: text-bottom;
    animation: ai-blink 0.9s step-end infinite;
}
@keyframes ai-blink { 50% { opacity: 0; } }
.ai-note { display: block; margin-top: 0.5rem; font-size: 0.78rem; color: rgba(234,234,255,0.5); font-style: italic; }
[data-ai-state="loading"] { opacity: 0.6; }

.category-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0; }
.chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); color: #eaeaff;
}
.chip.harm { border-color: rgba(128,240,184,0.4); color: #80f0b8; }
.chip.chal { border-color: rgba(255,138,168,0.4); color: #ff8aa8; }
.chip.mixed { border-color: rgba(255,209,102,0.4); color: #ffd166; }
.chip b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; }

.top-highlights { margin-top: 1.3rem; }
.top-highlights-label { margin: 0 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(234,234,255,0.55); }
.mini-list { list-style: none; margin: 0 0 0.7rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.mini a { color: #eaeaff; text-decoration: none; font-size: 0.94rem; }
.mini a:hover { text-decoration: underline; }
.mini.harm a { color: #80f0b8; }
.mini.chal a { color: #ff8aa8; }
.mini.neut a { color: #ffd166; }
.see-all-link { color: rgba(234,234,255,0.65); font-size: 0.85rem; text-decoration: none; }
.see-all-link:hover { color: #fff; text-decoration: underline; }

.hd-summary-card { margin-bottom: 1.5rem; }
.hd-summary-line { font-size: 1rem; line-height: 1.6; color: #efefff; margin: 0.9rem 0; }

.drilldown { margin-top: 0.5rem; }
.drilldown-heading { font-size: 1.3rem; margin: 0 0 1rem; }
code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 3px; font-size: 0.85em; }

.actions { display: flex; gap: 1rem; justify-content: center; padding: 2rem 0; flex-wrap: wrap; }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.chart-head h2 { margin: 0; font-size: 1.15rem; }
.horoscope-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid currentColor;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.horoscope-btn.pink   { color: #ff6b9d; }
.horoscope-btn.purple { color: #a48cff; }
.horoscope-btn:hover { background: rgba(255,255,255,0.08); }

/* ---- Natal table ---- */
table.natal { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.natal th { text-align: left; font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.12); color: rgba(234, 234, 255, 0.7); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.natal td { padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.natal td.body { font-weight: 600; color: #fff; }
table.natal td.sign { color: #ffd166; }
table.natal td.pos { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86rem; color: rgba(234, 234, 255, 0.85); }
table.natal td.house { text-align: right; color: rgba(234, 234, 255, 0.55); }

/* ---- Aspects table (tier-grouped, collapsible) ---- */
.aspects { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0 1.2rem; }

/* Tier headers */
.tier-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0.45rem 0.2rem 0.35rem; margin-top: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
    cursor: default;
}
.tier-head .tier-name { font-weight: 700; color: #fff; }
.tier-head .tier-count { color: rgba(234,234,255,0.45); font-weight: 500; }
.major-head .tier-name { color: #ffd166; }
.moderate-head .tier-name { color: #c8b8ff; }
.minor-head .tier-name { color: rgba(234,234,255,0.65); }
.minor-head { cursor: pointer; }
.minor-head:hover { background: rgba(255,255,255,0.03); }
.tier-collapse { margin-top: 1rem; }
.tier-collapse[open] > .minor-head .tier-count::after { content: ' \25BC'; opacity: 0.5; }
.tier-collapse:not([open]) > .minor-head .tier-count::after { content: ' \25B6'; opacity: 0.5; }
.minor-list { margin-top: 0.4rem; }

/* Aspect rows are now <details> so default browser disclosure arrow appears - hide it
   in favor of the row's own affordance (we only render description if there is one). */
details.aspect-row { padding: 0; border-radius: 8px; background: rgba(255,255,255,0.03); border-left: 3px solid rgba(255,255,255,0.2); list-style: none; }
details.aspect-row.harm { border-left-color: #80f0b8; }
details.aspect-row.chal { border-left-color: #ff8aa8; }
details.aspect-row.neut { border-left-color: #ffd166; }
details.aspect-row > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
details.aspect-row > summary::-webkit-details-marker { display: none; }
details.aspect-row > summary:hover { background: rgba(255,255,255,0.02); border-radius: 8px; }
details.aspect-row:target { outline: 2px solid rgba(255,209,102,0.5); outline-offset: 2px; }

.aspect-summary {
    display: flex; align-items: baseline; gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    flex-wrap: nowrap;
}
.aspect-headline { flex: 1; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; min-width: 0; font-size: 0.95rem; }
.aspect-meta { display: flex; gap: 0.5rem; align-items: baseline; flex-shrink: 0; }

.valence-pill {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 700; font-size: 0.95rem;
    min-width: 1rem; text-align: center; flex-shrink: 0;
}
details.aspect-row.harm .valence-pill { color: #80f0b8; }
details.aspect-row.chal .valence-pill { color: #ff8aa8; }
details.aspect-row.neut .valence-pill { color: #ffd166; }

.aspect-body { font-weight: 600; color: #fff; }
.aspect-sign { color: rgba(234, 234, 255, 0.5); font-size: 0.78rem; }
.aspect-rel { font-weight: 600; color: #c8b8ff; }
.aspect-orb { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.74rem; color: rgba(234, 234, 255, 0.45); }
.aspect-power { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86rem; color: rgba(234, 234, 255, 0.85); font-weight: 600; min-width: 2rem; text-align: right; }

.aspect-desc {
    padding: 0 0.85rem 0.75rem 1.5rem;
    color: rgba(234, 234, 255, 0.85); font-size: 0.92rem; line-height: 1.55;
}

/* Minor tier reads quieter to de-emphasize background noise */
.minor-list details.aspect-row { background: rgba(255,255,255,0.015); }
.minor-list .aspect-summary { padding: 0.45rem 0.85rem; font-size: 0.88rem; }
.minor-list .aspect-power { font-size: 0.76rem; color: rgba(234, 234, 255, 0.55); }

@media (max-width: 600px) {
    .aspect-summary { padding: 0.55rem 0.7rem; gap: 0.35rem; }
    .aspect-headline { font-size: 0.88rem; gap: 0.25rem; }
    .aspect-sign { display: none; } /* signs hidden on mobile to keep headline single-line-ish */
    .aspect-orb { display: none; }   /* orb hidden on mobile, revealed in description block */
    .aspect-desc { padding-left: 0.85rem; font-size: 0.88rem; }

    /* Tabs wrap to multiple rows on mobile so the new HD tab is discoverable without
       horizontal swiping. Tighter padding + smaller text so the row count stays reasonable. */
    .tab-headers { flex-wrap: wrap; gap: 0.2rem; }
    .tab-headers label { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
}

/* "Birth time unknown" checkbox below each person's time field. */
.field.approximate-time { margin-top: -0.4rem; }
.field.approximate-time label { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; padding: 0.35rem 0; color: rgba(234,234,255,0.7); font-size: 0.85rem; }
.field.approximate-time input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: #ffd166; cursor: pointer; margin: 0; }
.field.approximate-time label:hover { color: rgba(234,234,255,0.95); }

/* ---- Tabs (pure-CSS via radio + :checked) ---- */
.tabs { margin-bottom: 1.5rem; }
.tabs > input[type="radio"] { display: none; }
.tab-headers {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1.2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-headers label {
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    color: rgba(234,234,255,0.55);
    font-size: 0.92rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-headers label:hover { color: rgba(234,234,255,0.85); }
.tab-body { display: none; }

#tab-wheel:checked   ~ .tab-headers label[for="tab-wheel"],
#tab-charts:checked  ~ .tab-headers label[for="tab-charts"],
#tab-aspects:checked ~ .tab-headers label[for="tab-aspects"],
#tab-natal:checked     ~ .tab-headers label[for="tab-natal"],
#tab-placements:checked ~ .tab-headers label[for="tab-placements"],
#tab-natalwheel:checked ~ .tab-headers label[for="tab-natalwheel"],
#tab-ai:checked        ~ .tab-headers label[for="tab-ai"],
#tab-natalasp:checked  ~ .tab-headers label[for="tab-natalasp"],
#tab-astrologcmp:checked ~ .tab-headers label[for="tab-astrologcmp"],
#tab-humandesign:checked ~ .tab-headers label[for="tab-humandesign"],
#tab-sphere3d:checked  ~ .tab-headers label[for="tab-sphere3d"] {
    color: #ffd166;
    border-bottom-color: #ffd166;
}

#tab-wheel:checked    ~ .tab-body[data-tab="wheel"],
#tab-charts:checked   ~ .tab-body[data-tab="charts"],
#tab-aspects:checked  ~ .tab-body[data-tab="aspects"],
#tab-natal:checked    ~ .tab-body[data-tab="natal"],
#tab-placements:checked ~ .tab-body[data-tab="placements"],
#tab-natalwheel:checked ~ .tab-body[data-tab="natalwheel"],
#tab-ai:checked       ~ .tab-body[data-tab="ai"],
#tab-natalasp:checked ~ .tab-body[data-tab="natalasp"],
#tab-astrologcmp:checked ~ .tab-body[data-tab="astrologcmp"],
#tab-humandesign:checked ~ .tab-body[data-tab="humandesign"],
#tab-sphere3d:checked ~ .tab-body[data-tab="sphere3d"] { display: block; }

.cmp-iframe {
    width: 100%;
    min-height: 800px;
    border: none;
    background: transparent;
    margin-top: 0.6rem;
}

/* ---- Chart wheel SVG ---- */
.wheel-card { padding: 1.2rem; }
.wheel-frame { display: flex; justify-content: center; padding: 0.8rem 0; }
.wheel { width: 100%; max-width: 520px; height: auto; }

/* ---- 3D chart sphere (WebGL via three.js) ---- */
.sphere-frame {
    width: 100%;
    min-height: 520px;
    display: flex; justify-content: center;
    background: radial-gradient(circle at center, rgba(26, 21, 56, 0.4) 0%, transparent 70%);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.6rem;
    touch-action: none; /* allow rotate gesture on mobile without page-scroll fighting */
}
.sphere-frame canvas { display: block; cursor: grab; }
.sphere-frame canvas:active { cursor: grabbing; }

/* ---- Big three (Sun / Moon / Rising) summary line ---- */
.big-three {
    display: flex; align-items: baseline; flex-wrap: wrap;
    gap: 0.5rem; margin-top: 0.6rem;
    font-size: 0.95rem; color: rgba(234, 234, 255, 0.85);
}
.big-three .b3 { display: inline-flex; align-items: baseline; gap: 0.35rem; }
.big-three .b3-glyph { color: #ffd166; font-size: 1.15rem; line-height: 1; }
.big-three .b3-label { color: rgba(234, 234, 255, 0.55); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.big-three .b3-sign { color: #fff; font-weight: 600; }
.big-three .b3-sep { color: rgba(234, 234, 255, 0.3); padding: 0 0.1rem; }
/* compact mode (used in chart cards on the synastry result page): no labels, tighter */
.big-three.compact { font-size: 0.85rem; margin-bottom: 0.8rem; gap: 0.8rem; }
.big-three.compact .b3-label { display: none; }

/* ---- Horoscope page ---- */
.head { margin-bottom: 1.5rem; }
.back-link { color: rgba(234, 234, 255, 0.6); font-size: 0.85rem; text-decoration: none; }
.back-link:hover { color: #fff; }
.head h1 { font-size: 2rem; margin: 0.5rem 0 0.3rem; }
.location { color: rgba(234, 234, 255, 0.55); font-size: 0.9rem; }
.grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.ai-card { display: flex; flex-direction: column; }
.ai-text { line-height: 1.65; font-size: 1.05rem; color: #efefff; flex: 1; white-space: pre-wrap; }
