:root {
    --bg: #fff8f6;
    --bg-soft: #ffe9e4;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 251, 250, 0.98);
    --line: rgba(197, 50, 50, 0.14);
    --line-strong: rgba(197, 50, 50, 0.28);
    --text: #7d1212;
    --muted: #b06464;
    --accent: #e13b3b;
    --accent-strong: #b11414;
    --danger: #d74a4a;
    --success: #c35f74;
    --shadow: 0 24px 80px rgba(170, 54, 54, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 140, 140, 0.34), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(255, 186, 186, 0.36), transparent 22%),
        linear-gradient(180deg, #fffdfc 0%, #fff1ee 45%, #ffe7e1 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    opacity: 0.28;
}

.page-shell {
    width: min(100% - 20px, 1240px);
    margin: 0 auto;
    padding: 10px 0 28px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
    padding: 6px 0 12px;
}

.auth-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

.auth-toolbar-text {
    font-size: 0.9rem;
    color: var(--success);
}

.toolbar-logout-button {
    border: 1px solid var(--line-strong);
    background: rgba(225, 59, 59, 0.08);
    color: var(--accent-strong);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.hero-copy {
    max-width: 680px;
    animation: rise-in 700ms ease-out both;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--accent-strong);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.hero h1,
.section-heading h2 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero h1 {
    font-size: clamp(2rem, 10vw, 4.6rem);
    line-height: 0.96;
    max-width: 12ch;
}

.hero-text {
    margin: 12px 0 0;
    max-width: 36ch;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.hero-orbit {
    position: relative;
    order: -1;
    height: 140px;
    display: grid;
    place-items: center;
    animation: fade-in 1100ms ease-out both;
}

.orbit-ring,
.orbit-core {
    position: absolute;
    border-radius: 50%;
}

.orbit-ring {
    border: 1px solid var(--line-strong);
}

.orbit-ring-a {
    width: 140px;
    height: 140px;
    animation: spin 18s linear infinite;
}

.orbit-ring-b {
    width: 92px;
    height: 92px;
    border-style: dashed;
    animation: spin-reverse 12s linear infinite;
}

.orbit-core {
    width: 54px;
    height: 54px;
    background:
        radial-gradient(circle at 30% 30%, #f7e8be, #d5ae69 48%, rgba(213, 174, 105, 0.16) 72%, transparent 74%);
    box-shadow: 0 0 90px rgba(225, 59, 59, 0.2);
}

.workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.input-panel,
.results-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.input-panel {
    position: static;
    padding: 18px;
}

.results-panel {
    padding: 18px;
}

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

.section-heading h2 {
    font-size: clamp(1.7rem, 7vw, 2.8rem);
}

.lifetime-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(140, 216, 186, 0.45);
    background: rgba(140, 216, 186, 0.16);
    color: #bff2dd;
    font-family: "Manrope", sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.table-hint {
    margin: -2px 0 16px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.kp-form {
    display: grid;
    gap: 14px;
}

.profile-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(214, 184, 122, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.profile-state {
    margin: -4px 0 16px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.profile-state.is-success {
    color: #79d39e;
}

.profile-state.is-error {
    color: var(--danger);
}

.profile-picker {
    display: grid;
    gap: 8px;
}

.profile-new-button {
    width: 100%;
    text-align: center;
}

.city-search-field {
    position: relative;
}

.city-suggestions {
    position: relative;
    margin-top: 6px;
    display: grid;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.city-suggestion {
    width: 100%;
    text-align: left;
    background: rgba(255, 250, 249, 0.96);
    color: var(--text);
    border: 1px solid rgba(214, 184, 122, 0.22);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: none;
}

.city-suggestion:hover,
.city-suggestion:focus-visible {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
}

.city-suggestion-title {
    display: block;
    font-weight: 700;
    color: var(--text);
}

.city-suggestion-meta {
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
    color: var(--muted);
}

label {
    display: grid;
    gap: 8px;
}

label span {
    font-size: 0.92rem;
    color: var(--muted);
}

input {
    width: 100%;
    border: 1px solid rgba(197, 50, 50, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    border-radius: 16px;
    padding: 15px 16px;
    outline: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

input::placeholder {
    color: rgba(125, 18, 18, 0.42);
}

select {
    width: 100%;
    border: 1px solid rgba(197, 50, 50, 0.12);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text);
    border-radius: 16px;
    padding: 15px 16px;
    padding-right: 42px;
    outline: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent-strong) 50%),
        linear-gradient(135deg, var(--accent-strong) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

select option {
    color: #f5f1e8;
    background: #0c1627;
}

select option:checked,
select option:hover {
    color: #f5f1e8;
    background: #15253d;
}

input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

input[readonly] {
    border-color: rgba(214, 184, 122, 0.24);
    background: rgba(214, 184, 122, 0.08);
    color: #e8dcc2;
    cursor: default;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.time-input-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.time-slot {
    display: grid;
    gap: 6px;
}

.time-slot span {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.time-input-group input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 12px 10px;
    border-color: rgba(240, 213, 154, 0.28);
    background: rgba(10, 21, 36, 0.92);
    color: #fff8eb;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
}

#time-meridiem {
    text-transform: uppercase;
}

.time-input-group input::placeholder {
    color: rgba(255, 248, 235, 0.6);
}

.time-input-group input:focus {
    border-color: var(--accent-strong);
    background: rgba(14, 28, 47, 0.98);
    box-shadow: 0 0 0 1px rgba(240, 213, 154, 0.24);
}

.time-input-group input::-webkit-outer-spin-button,
.time-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input-group input[type="text"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.time-helper {
    font-size: 0.84rem;
    color: var(--muted);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}

button {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #efd7a3 100%);
    color: #1f1404;
    font-weight: 700;
    padding: 15px 20px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
    box-shadow: 0 16px 32px rgba(214, 184, 122, 0.22);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.ghost-button {
    background: transparent;
    color: var(--accent-strong);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.status-text {
    margin: 0;
    color: var(--muted);
    min-height: 1.4em;
}

.status-text.is-error {
    color: var(--danger);
}

.status-text.is-success {
    color: var(--success);
}

.derived-panel {
    margin-top: 4px;
}

.prediction-copy {
    margin: 0;
    color: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prediction-loading {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(240, 213, 154, 0.24);
    border-top-color: var(--accent-strong);
    animation: spin 0.8s linear infinite;
}

.prediction-loading-hero {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.prediction-loading-orbit {
    position: relative;
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(225, 59, 59, 0.14), transparent 42%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96), rgba(255, 240, 238, 1) 72%);
    border: 1px solid rgba(225, 59, 59, 0.16);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 18px 36px rgba(225, 59, 59, 0.12);
    overflow: hidden;
}

.prediction-loading-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(225, 59, 59, 0.2);
}

.prediction-loading-ring-outer {
    inset: 10px;
    animation: loading-orbit 10s linear infinite;
}

.prediction-loading-ring-inner {
    inset: 28px;
    border-style: dashed;
    border-color: rgba(225, 59, 59, 0.26);
    animation: loading-orbit-reverse 14s linear infinite;
}

.prediction-loading-core {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #fff6dc 0%, #ffc6c6 38%, #ef6c6c 70%, #ba1f1f 100%);
    box-shadow:
        0 0 0 10px rgba(225, 59, 59, 0.08),
        0 0 22px rgba(225, 59, 59, 0.24);
    animation: loading-pulse 2.8s ease-in-out infinite;
}

.prediction-loading-copy-block {
    min-width: 0;
}

.prediction-loading-kicker {
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.prediction-loading-countdown {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text);
}

.prediction-loading-countdown strong {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 0.95;
    color: var(--accent-strong);
}

.prediction-loading-countdown span {
    color: var(--muted);
    font-size: 0.92rem;
}

.prediction-loading-copy {
    margin: 0 0 6px;
    color: var(--text);
    font-weight: 600;
}

.prediction-loading-subcopy {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.prediction-loading-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(225, 59, 59, 0.06);
    border: 1px solid rgba(225, 59, 59, 0.12);
    overflow: hidden;
}

.prediction-loading-bar {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffb1b1 0%, #f46a6a 45%, #d91d1d 100%);
    box-shadow: 0 0 18px rgba(225, 59, 59, 0.26);
    transition: width 900ms linear;
}

.prediction-loading-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.results-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.64fr) minmax(420px, 0.96fr);
    gap: 16px;
    align-items: start;
}

.results-column {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.result-card {
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 242, 0.96));
    padding: 16px;
}

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

.result-card-head h3 {
    margin: 0;
    color: var(--text);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.35rem, 1.9vw, 1.9rem);
    line-height: 1;
}

.data-slab {
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 244, 0.98));
}

.data-slab.is-empty,
.cusp-significator-table.is-empty {
    padding: 18px;
    color: var(--muted);
}

.table-scroll {
    overflow: auto;
}

.astro-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
    color: var(--text);
}

.astro-table th,
.astro-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(225, 59, 59, 0.1);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.astro-table thead th {
    background: rgba(255, 228, 228, 0.98);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 1;
}

.astro-table tbody tr:last-child td {
    border-bottom: 0;
}

.astro-table-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.planet-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(225, 59, 59, 0.35);
    box-shadow: 0 0 0 3px rgba(225, 59, 59, 0.08);
    flex: 0 0 auto;
}

.planet-dot.sun { background: #d94f4f; }
.planet-dot.moon { background: #d77777; }
.planet-dot.mars { background: #ff6a6a; }
.planet-dot.mercury { background: #c16a6a; }
.planet-dot.jupiter { background: #cf7f6a; }
.planet-dot.venus { background: #d76a9b; }
.planet-dot.saturn { background: #8e5d5d; }
.planet-dot.rahu { background: #a83e82; }
.planet-dot.ketu { background: #7b57c6; }
.planet-dot.ascendant { background: #d98b4f; }

.chart-views {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.chart-panel {
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 242, 0.96));
    padding: 16px;
}

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

.chart-panel h3 {
    margin: 0;
    color: var(--text);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.4rem, 2.1vw, 2rem);
    line-height: 1;
}

.chart-panel-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(225, 59, 59, 0.08);
    border: 1px solid rgba(225, 59, 59, 0.16);
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lagna-chart-view,
.kp-chart-view {
    min-height: 320px;
}

.lagna-chart-view.is-empty,
.kp-chart-view.is-empty {
    display: grid;
    place-items: center;
    padding: 28px 18px;
    color: var(--muted);
    border: 1px dashed rgba(225, 59, 59, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.lagna-chart-svg {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(225, 59, 59, 0.14);
}

.lagna-chart-svg svg {
    width: 100%;
    height: auto;
    display: block;
}

.chart-fallback-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.kp-chart-stack {
    display: grid;
    gap: 16px;
}

.kp-chart-svg-shell {
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(225, 59, 59, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 242, 0.96));
    border: 1px solid rgba(225, 59, 59, 0.14);
}

.kp-north-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.kp-chart-outline,
.kp-chart-diamond,
.kp-chart-split {
    fill: none;
    stroke: rgba(185, 33, 33, 0.84);
    stroke-width: 2.2;
    vector-effect: non-scaling-stroke;
}

.kp-chart-center-disc {
    fill: rgba(255, 249, 248, 0.96);
    stroke: rgba(225, 59, 59, 0.14);
    stroke-width: 1.2;
}

.kp-chart-center-overline {
    fill: var(--accent-strong);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.kp-chart-center-title {
    fill: var(--accent-strong);
    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
    font-weight: 700;
}

.kp-house-id {
    fill: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.kp-house-sign {
    fill: rgba(117, 34, 34, 0.82);
    font-size: 13px;
    font-weight: 700;
}

.kp-house-planets {
    fill: rgba(38, 30, 30, 0.92);
    font-size: 12px;
    font-weight: 700;
}

.kp-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.planet-placement-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.house-placement-card {
    border: 1px solid rgba(225, 59, 59, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 244, 0.96));
    padding: 12px;
    display: grid;
    gap: 10px;
    min-height: 126px;
}

.house-placement-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
}

.house-placement-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.98rem;
    font-weight: 700;
}

.house-placement-sign {
    color: var(--muted);
    font-size: 0.86rem;
}

.house-placement-planets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.planet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
}

.planet-chip small {
    opacity: 0.78;
    font-size: 0.7rem;
}

.planet-chip.sun { background: rgba(255, 198, 198, 0.18); border-color: rgba(225, 59, 59, 0.2); color: #b11414; }
.planet-chip.moon { background: rgba(255, 224, 224, 0.9); border-color: rgba(225, 59, 59, 0.16); color: #a02a2a; }
.planet-chip.mars { background: rgba(255, 214, 214, 0.86); border-color: rgba(225, 59, 59, 0.18); color: #c21d1d; }
.planet-chip.mercury { background: rgba(255, 237, 237, 0.9); border-color: rgba(225, 59, 59, 0.14); color: #8e2c2c; }
.planet-chip.jupiter { background: rgba(255, 232, 225, 0.92); border-color: rgba(225, 59, 59, 0.14); color: #aa3b3b; }
.planet-chip.venus { background: rgba(255, 241, 245, 0.92); border-color: rgba(225, 59, 59, 0.14); color: #b12d56; }
.planet-chip.saturn { background: rgba(255, 236, 236, 0.92); border-color: rgba(225, 59, 59, 0.12); color: #7b3c3c; }
.planet-chip.rahu { background: rgba(255, 228, 239, 0.92); border-color: rgba(225, 59, 59, 0.14); color: #ad246d; }
.planet-chip.ketu { background: rgba(248, 235, 255, 0.94); border-color: rgba(225, 59, 59, 0.14); color: #7e3db1; }
.planet-chip.ascendant { background: rgba(255, 239, 232, 0.95); border-color: rgba(225, 59, 59, 0.16); color: #b14f14; }

.planet-placement-card {
    border: 1px solid rgba(225, 59, 59, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 242, 0.98));
    padding: 14px;
    display: grid;
    gap: 10px;
}

.planet-placement-card h4 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text);
}

.planet-placement-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
}

.planet-placement-meta strong {
    color: var(--text);
}

.planet-placement-chipline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.planet-placement-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(225, 59, 59, 0.07);
    border: 1px solid rgba(225, 59, 59, 0.14);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.significator-cell.role-csl .significator-code {
    background: rgba(214, 184, 122, 0.12);
    border-color: rgba(214, 184, 122, 0.22);
    color: var(--accent-strong);
}

.significator-cell.role-nl .significator-code {
    background: rgba(127, 182, 255, 0.12);
    border-color: rgba(127, 182, 255, 0.22);
    color: #dbe8ff;
}

.significator-cell.role-sl .significator-code {
    background: rgba(255, 137, 184, 0.12);
    border-color: rgba(255, 137, 184, 0.22);
    color: #ffd3e7;
}

.cusp-significator-table {
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    overflow: visible;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 244, 0.98));
}

.cusp-significator-table.is-empty {
    padding: 18px;
    color: var(--muted);
}

.desktop-cusp-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.desktop-cusp-table th,
.desktop-cusp-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.desktop-cusp-table th {
    color: var(--accent-strong);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(225, 59, 59, 0.04);
}

.desktop-cusp-table tr:last-child td {
    border-bottom: 0;
}

.cusp-house-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--accent-strong);
    background: rgba(225, 59, 59, 0.08);
    border: 1px solid rgba(225, 59, 59, 0.18);
    font-weight: 700;
}

.cusp-life-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    position: relative;
}

.desktop-cusp-table {
    display: none;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 6px;
}

.mobile-cusp-results {
    display: block;
}

.mobile-cusp-list {
    display: grid;
    gap: 12px;
}

.mobile-cusp-card {
    padding: 14px;
    border-bottom: 1px solid rgba(225, 59, 59, 0.08);
}

.mobile-cusp-card:last-child {
    border-bottom: 0;
}

.mobile-cusp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-cusp-caption {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.mobile-cusp-areas {
    margin-bottom: 12px;
}

.mobile-role-grid {
    display: grid;
    gap: 10px;
}

.mobile-role-card {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(225, 59, 59, 0.1);
}

.mobile-role-label {
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-role-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
}

.life-area-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(225, 59, 59, 0.08);
    border: 1px solid rgba(225, 59, 59, 0.16);
    color: #a51919;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    box-shadow: none;
}

.life-area-badge:hover,
.life-area-badge:focus-visible,
.life-area-badge.is-active {
    transform: translateY(-1px);
    border-color: rgba(225, 59, 59, 0.3);
    background: rgba(225, 59, 59, 0.14);
}

.prediction-popup {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    z-index: 20;
    width: min(560px, calc(100vw - 24px));
    max-height: min(78vh, 640px);
    padding: 16px 18px 18px;
    border-radius: 18px;
    border: 1px solid rgba(225, 59, 59, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 245, 244, 0.98));
    box-shadow: 0 24px 50px rgba(225, 59, 59, 0.16);
    color: var(--text);
    animation: prediction-pop-in 180ms ease-out both;
}

.prediction-popup.is-closing {
    animation: prediction-pop-out 180ms ease-in both;
}

.prediction-popup.is-mobile-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(94vw, 440px);
    max-width: 440px;
    max-height: 82vh;
    transform: translate(-50%, -50%);
    z-index: 1100;
    box-shadow:
        0 0 0 100vmax rgba(225, 59, 59, 0.14),
        0 24px 50px rgba(225, 59, 59, 0.16);
}

.prediction-popup.is-mobile-modal::after {
    display: none;
}

.prediction-popup.is-mobile-modal .prediction-popup-body {
    max-height: 60vh;
    overscroll-behavior: contain;
}

.prediction-popup.align-right {
    left: auto;
    right: 0;
}

.prediction-popup.align-left {
    left: 0;
    right: auto;
}

.prediction-popup.place-below {
    top: calc(100% + 12px);
    bottom: auto;
}

.prediction-popup::after {
    content: "";
    position: absolute;
    left: 20px;
    top: 100%;
    width: 12px;
    height: 12px;
    background: rgba(255, 250, 249, 0.98);
    border-right: 1px solid rgba(225, 59, 59, 0.18);
    border-bottom: 1px solid rgba(225, 59, 59, 0.18);
    transform: rotate(45deg) translateY(-6px);
}

.prediction-popup.align-right::after {
    left: auto;
    right: 20px;
}

.prediction-popup.place-below::after {
    top: auto;
    bottom: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid rgba(225, 59, 59, 0.18);
    border-top: 1px solid rgba(225, 59, 59, 0.18);
    transform: rotate(45deg) translateY(6px);
}

.prediction-popup-title {
    margin: 0 28px 8px 0;
    color: var(--accent-strong);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.prediction-popup-body {
    color: var(--text);
    line-height: 1.7;
    max-height: min(62vh, 500px);
    overflow-y: auto;
    padding-right: 14px;
    padding-bottom: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.prediction-popup-body::-webkit-scrollbar {
    width: 8px;
}

.prediction-popup-body::-webkit-scrollbar-thumb {
    background: rgba(225, 59, 59, 0.28);
    border-radius: 999px;
}

.prediction-section + .prediction-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(225, 59, 59, 0.12);
}

.prediction-section h4 {
    margin: 0 0 6px;
    color: var(--accent-strong);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prediction-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(225, 59, 59, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-strong);
    box-shadow: none;
    font-size: 1rem;
    line-height: 1;
}

.prediction-popup.is-error .prediction-popup-body {
    color: var(--danger);
}

.prediction-popup.is-loading .prediction-popup-body {
    color: var(--text);
}

.prediction-popup .prediction-copy,
.prediction-popup .prediction-loading-copy,
.prediction-popup .prediction-loading-subcopy,
.prediction-popup .prediction-loading-countdown span,
.prediction-popup .prediction-loading-meta,
.chart-panel,
.cusp-significator-table,
.planet-placement-card,
.house-placement-card,
.mobile-role-card {
    color: var(--text);
}

@keyframes loading-orbit {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes loading-orbit-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes loading-pulse {
    0%,
    100% {
        transform: scale(0.96);
    }
    50% {
        transform: scale(1.04);
    }
}

.significator-cell {
    display: grid;
    gap: 8px;
}

.significator-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.significator-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(214, 184, 122, 0.12);
    border: 1px solid rgba(214, 184, 122, 0.24);
    color: var(--accent-strong);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.significator-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
}

.significator-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(122, 164, 214, 0.12);
    border: 1px solid rgba(122, 164, 214, 0.22);
    color: #dbe8ff;
    font-size: 0.86rem;
    font-weight: 700;
}

.significator-badge:only-child {
    min-width: 36px;
}

.significator-numbers:empty::before {
    content: "-";
    color: var(--muted);
    font-size: 0.9rem;
}

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

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

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes prediction-pop-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes prediction-pop-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
}

@media (min-width: 981px) {
    .hero {
        grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 42svh;
        gap: 28px;
        padding: 28px 0 20px;
    }

    .hero-orbit {
        order: 0;
        height: 420px;
    }

    .orbit-ring-a {
        width: 320px;
        height: 320px;
    }

    .orbit-ring-b {
        width: 220px;
        height: 220px;
    }

    .input-panel {
        position: static;
        top: auto;
        padding: 26px;
    }

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

    .page-shell {
        width: min(1520px, calc(100% - 32px));
        padding: 32px 0 48px;
    }

    .results-panel {
        padding: 26px;
    }

    .hero h1 {
        font-size: clamp(3rem, 6vw, 5.4rem);
        line-height: 0.92;
        max-width: 10ch;
    }

    .hero-text {
        margin-top: 20px;
        max-width: 54ch;
        font-size: 1.02rem;
    }

    .time-input-group {
        grid-template-columns: repeat(4, minmax(68px, 1fr));
        gap: 10px;
    }

    .desktop-cusp-table {
        display: block;
    }

    .mobile-cusp-results {
        display: none;
    }

    .cusp-life-areas {
        min-width: 210px;
    }

    .profile-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .profile-new-button {
        width: auto;
        white-space: nowrap;
    }
}

@media (max-width: 1180px) {
    .page-shell {
        width: min(100% - 16px, 1040px);
    }

    .workspace {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .input-panel {
        position: static;
        top: auto;
    }

    .desktop-cusp-table {
        display: none !important;
    }

    .mobile-cusp-results {
        display: block !important;
    }

    .chart-views {
        grid-template-columns: 1fr;
    }

    .chart-fallback-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .results-dashboard {
        grid-auto-flow: column;
        grid-auto-columns: minmax(calc(100% - 20px), 1fr);
        grid-template-columns: none;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
    }

    .results-column {
        scroll-snap-align: start;
    }

    .result-card,
    .chart-panel {
        min-height: 100%;
    }
}

@media (max-width: 720px) {
    .eyebrow,
    .section-kicker {
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .input-panel,
    .results-panel {
        border-radius: 18px;
        padding: 14px;
    }

    .page-shell {
        width: calc(100% - 12px);
        padding: 8px 0 18px;
    }

    .workspace {
        gap: 10px;
    }

    .hero-copy {
        max-width: 100%;
    }

    .section-heading h2 {
        font-size: clamp(1.5rem, 8vw, 2.1rem);
    }

    .field-grid {
        gap: 10px;
    }

    .city-suggestion {
        border-radius: 16px;
    }

    .status-text {
        font-size: 0.88rem;
    }

    .mobile-cusp-card {
        padding: 12px 0;
    }

    .chart-panel {
        padding: 14px;
    }

    .chart-panel-head {
        margin-bottom: 12px;
    }

    .chart-fallback-board {
        grid-template-columns: 1fr;
    }

    .results-dashboard {
        grid-auto-columns: calc(100% - 8px);
    }

    .result-card {
        padding: 14px;
    }

    .astro-table {
        min-width: 560px;
    }

    .planet-placement-card {
        padding: 12px;
    }

    .lagna-chart-view,
    .kp-chart-view {
        min-height: auto;
    }

    .prediction-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: min(94vw, 440px);
        max-width: 420px;
        max-height: 76vh;
        padding-bottom: 16px;
        transform: translate(-50%, -50%);
        box-shadow:
            0 0 0 100vmax rgba(225, 59, 59, 0.14),
            0 24px 50px rgba(225, 59, 59, 0.16);
        animation: prediction-pop-in-mobile 220ms ease-out both;
    }

    .prediction-popup.is-closing {
        animation: prediction-pop-out-mobile 180ms ease-in both;
    }

    .prediction-popup.align-left,
    .prediction-popup.align-right,
    .prediction-popup.place-below {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
    }

    .prediction-popup::after {
        display: none;
    }

    .prediction-popup-body {
        max-height: 60vh;
        overscroll-behavior: contain;
    }

    .prediction-loading-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .prediction-loading-orbit {
        width: 112px;
        height: 112px;
    }

    .prediction-loading-meta {
        font-size: 0.8rem;
    }

    .time-input-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@keyframes prediction-pop-in-mobile {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 12px)) scale(0.96);
        box-shadow:
            0 0 0 100vmax rgba(225, 59, 59, 0),
            0 24px 50px rgba(225, 59, 59, 0.12);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 0 100vmax rgba(225, 59, 59, 0.14),
            0 24px 50px rgba(225, 59, 59, 0.16);
    }
}

@keyframes prediction-pop-out-mobile {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 0 100vmax rgba(225, 59, 59, 0.14),
            0 24px 50px rgba(225, 59, 59, 0.16);
    }
    to {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 12px)) scale(0.96);
        box-shadow:
            0 0 0 100vmax rgba(225, 59, 59, 0),
            0 24px 50px rgba(225, 59, 59, 0.12);
    }
}
