:root {
    /* ---- Design tokens: color ---- */
    --color-bg: #FFF6E6;
    --color-bg-elevated: #FFFFFF;
    --color-surface: rgba(255, 255, 255, 0.78);
    --color-surface-hover: rgba(224, 120, 42, 0.09);
    --color-primary: #E0782A;
    --color-primary-2: #C8341A;
    --color-gold: #F0A64A;
    --color-maroon: #5B0E0E;
    --color-primary-soft: rgba(224, 120, 42, 0.12);
    --color-primary-line: rgba(224, 120, 42, 0.55);
    --color-text: #3F1F14;
    --color-text-dim: #7A5444;
    --color-text-faint: #A0806E;
    --color-border: rgba(91, 14, 14, 0.10);
    --color-border-strong: rgba(91, 14, 14, 0.18);

    /* ---- Design tokens: gradients ---- */
    --gradient-primary: linear-gradient(135deg, #E0782A 0%, #C8341A 100%);
    --gradient-bg:
        radial-gradient(560px circle at 14% -6%, rgba(255, 210, 125, 0.45), transparent 60%),
        radial-gradient(480px circle at 92% 10%, rgba(224, 120, 42, 0.12), transparent 55%),
        radial-gradient(640px circle at 50% 108%, rgba(255, 210, 125, 0.35), transparent 60%);

    /* ---- Design tokens: radius ---- */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* ---- Design tokens: spacing (8pt grid) ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 40px;

    /* ---- Design tokens: shadow / glow ---- */
    --shadow-sm: 0 2px 10px rgba(91, 14, 14, 0.06);
    --shadow-md: 0 10px 28px rgba(91, 14, 14, 0.10);
    --shadow-lg: 0 18px 52px rgba(91, 14, 14, 0.16);
    --shadow-glow: 0 10px 26px rgba(224, 120, 42, 0.28);
    --shadow-glow-strong: 0 0 0 1px rgba(224, 120, 42, 0.5), 0 12px 34px rgba(224, 120, 42, 0.4);

    /* ---- Design tokens: motion ---- */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur-fast: 180ms;
    --dur: 260ms;

    /* ---- Layout ---- */
    --header-h: 72px;
    --progress-h: 4px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* ---- Backward-compatible aliases (kept so existing rules below stay short) ---- */
    --bg: var(--color-bg);
    --bg-alt: var(--color-bg-elevated);
    --surface: var(--color-surface);
    --surface-alt: var(--color-surface-hover);
    --accent: var(--color-primary);
    --accent-soft: var(--color-primary-soft);
    --accent-line: var(--color-primary-line);
    --text: var(--color-text);
    --text-dim: var(--color-text-dim);
    --text-faint: var(--color-text-faint);
    --border: var(--color-border);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

body {
    background-image: var(--gradient-bg);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.app {
    /* Exactly the visible screen (dvh excludes the mobile browser bars), so
       the page itself never scrolls and pinned buttons are always in view;
       only each step's own content area scrolls when it must. */
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ---------- HEADER ---------- */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    background: rgba(255, 246, 230, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.logo {
    height: 46px;
    width: auto;
    max-width: calc(100% - 120px);
    object-fit: contain;
    display: block;
    filter: none;
}

.icon-btn {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.icon-btn:active { transform: scale(0.92); }
.icon-btn:hover { border-color: var(--color-border-strong); }

.back-btn {
    position: absolute;
    left: 16px;
    top: calc(50% + var(--safe-top) / 2);
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
}

.history-btn {
    position: absolute;
    right: 16px;
    top: calc(50% + var(--safe-top) / 2);
    transform: translateY(-50%);
}

.back-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- PROGRESS BAR ---------- */
.progress-bar {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    z-index: 90;
}

.progress-seg {
    flex: 1;
    height: 5px;
    border-radius: var(--radius-full);
    background: var(--color-border-strong);
    overflow: hidden;
    position: relative;
}

.progress-seg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms var(--ease);
}

.progress-seg.done::after,
.progress-seg.active::after {
    transform: scaleX(1);
}

/* ---------- STEPS ---------- */
.steps {
    flex: 1;
    position: relative;
    padding-top: calc(var(--header-h) + var(--safe-top) + 40px);
    overflow: hidden;
}

.step {
    position: absolute;
    inset: 0;
    top: calc(var(--header-h) + var(--safe-top) + 40px);
    display: flex;
    flex-direction: column;
    padding: var(--space-2) var(--space-4) calc(var(--space-4) + var(--safe-bottom));
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
    transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}

.step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.step.leaving-back {
    transform: translateX(24px);
}

.step.prev {
    transform: translateX(-24px);
    opacity: 0;
}

.step-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.step-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.step-header-text {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 4px 0 8px;
}

.step-sub {
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--text-dim);
    margin: 0 0 var(--space-5);
}

.step-header-text .step-sub {
    margin: 0;
}

.step-illustration {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 42%, rgba(224, 120, 42, 0.35), rgba(224, 120, 42, 0.04) 72%);
    border: 1px solid var(--color-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.step-illustration--img {
    background: radial-gradient(circle at 50% 42%, #FFFFFF, rgba(255, 236, 200, 0.9) 72%);
}

.step-illustration img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(91, 14, 14, 0.15));
}

.step-illustration svg {
    width: 32px;
    height: 32px;
}

.step-illustration::before,
.step-illustration::after {
    content: "";
    position: absolute;
    background: var(--color-gold);
    clip-path: polygon(50% 0%, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0% 50%, 37% 37%);
    opacity: 0.85;
}

.step-illustration::before {
    top: 0;
    left: 8px;
    width: 9px;
    height: 9px;
}

.step-illustration::after {
    bottom: 6px;
    right: -2px;
    width: 6px;
    height: 6px;
    background: var(--color-primary-2);
}

/* ---------- GENDER CARDS ---------- */
.gender-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.gender-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    min-height: 84px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.gender-card:active { transform: scale(0.98); }

.gender-card.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(224, 120, 42, 0.16), rgba(200, 52, 26, 0.08));
}

.gender-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-dim);
    flex-shrink: 0;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.gender-card.selected .gender-icon {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(224, 120, 42, 0.45);
}

.gender-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gender-label {
    font-size: 17px;
    font-weight: 700;
}

.gender-subtitle {
    font-size: 13.5px;
    color: var(--text-dim);
}

.gender-check {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--color-border-strong);
    background: transparent;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.gender-card.selected .gender-check {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
}

.privacy-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.privacy-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

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

.privacy-sub {
    font-size: 13px;
    color: var(--text-dim);
}

.privacy-sub strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* ---------- BUTTONS ---------- */
.next-btn {
    margin-top: auto;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.next-btn svg { flex-shrink: 0; }

.next-btn:active { transform: scale(0.97); }

.next-btn:disabled {
    opacity: 0.35;
    box-shadow: none;
    cursor: not-allowed;
}

.next-btn-spaced {
    margin-top: var(--space-4);
}

/* ---------- TEXT FIELD ---------- */
.text-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 var(--space-3);
    height: 56px;
    margin-bottom: var(--space-4);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.text-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.field-icon { color: var(--text-dim); flex-shrink: 0; }

.text-field input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 17px;
    height: 100%;
    min-width: 0;
}

.text-field input::placeholder { color: var(--text-faint); }

/* ---------- WHEEL PICKER ---------- */
.picker-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-2);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
}

.wheel-picker {
    position: relative;
    display: flex;
    height: 220px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%);
}

.wheel-highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
    background: var(--accent-soft);
    border-top: 1px solid var(--accent-line);
    border-bottom: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    pointer-events: none;
    z-index: 1;
}

.wheel-col {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-y;
    position: relative;
}

.wheel-col::-webkit-scrollbar { display: none; }

.wheel-col.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.wheel-col-inner {
    padding: 88px 0;
}

.wheel-item {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: 19px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform, opacity;
}

.wheel-item.near {
    color: var(--text-dim);
}

.wheel-item.active {
    color: var(--text);
    font-weight: 600;
    font-size: 21px;
}

.wheel-picker.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ---------- HELPER NOTE CARDS ---------- */
.helper-note {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    padding: var(--space-3);
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}

.helper-note-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.helper-note-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 2px;
}

.helper-note-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-dim);
    margin: 0;
}

/* ---------- UNKNOWN TIME TOGGLE ---------- */
.unknown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
    cursor: pointer;
}

.unknown-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 46px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.unknown-toggle input:checked + .toggle-track {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
}

.unknown-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
    background: #fff;
}

.toggle-label {
    font-size: 14.5px;
    color: var(--text);
    font-weight: 500;
}

/* ---------- STEP FOOTER (pinned) ---------- */
.step-inner-scrollable {
    min-height: 0;
}

.step-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 132px;
}

.step-scroll-flush {
    padding-bottom: 24px;
}

.step-scroll > .next-btn {
    margin-bottom: var(--space-4);
}

.step-scroll > .chat-widget {
    margin-top: 0;
    margin-bottom: var(--space-4);
}

.step-static {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
}

/* let the static block (not the page) absorb any overflow */
.step-inner:has(> .step-static) { min-height: 0; }

.step-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + var(--safe-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(255, 246, 230, 0));
    z-index: 5;
}

.step-footer-inner {
    width: 100%;
    max-width: 420px;
}

.step-footer .next-btn {
    margin-top: 0;
}

/* ---------- TOPIC OPTIONS (step 5) ---------- */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: var(--space-3);
}

.topic-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
                transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

/* Staggered slide in each time the step opens */
.step.active .topic-card {
    animation: topic-in 520ms cubic-bezier(.2, .8, .2, 1) backwards;
}
.step.active .topic-card:nth-child(1) { animation-delay: 80ms; }
.step.active .topic-card:nth-child(2) { animation-delay: 170ms; }
.step.active .topic-card:nth-child(3) { animation-delay: 260ms; }

@keyframes topic-in {
    from { opacity: 0; transform: translateX(-18px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* Soft shine that sweeps across the selected card */
.topic-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 50%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
    transform: skewX(-18deg);
    opacity: 0;
    pointer-events: none;
}
.topic-card.selected::after { animation: topic-shine 900ms ease-out; }
@keyframes topic-shine {
    0%   { left: -60%; opacity: 1; }
    100% { left: 130%; opacity: 0; }
}

@media (hover: hover) {
    .topic-card:hover {
        border-color: var(--color-primary-line);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}
.topic-card:active { transform: scale(0.98); }

.topic-icon {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-2);
    background: linear-gradient(135deg, rgba(255, 210, 125, 0.5), rgba(224, 120, 42, 0.16));
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.topic-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.topic-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-maroon);
    line-height: 1.25;
}

.topic-desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-dim);
}

.topic-check {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--color-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.topic-check svg {
    transform: scale(0);
    transition: transform 320ms cubic-bezier(.3, 1.6, .5, 1);
}

.topic-card.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(255, 236, 200, 0.95), rgba(224, 120, 42, 0.12));
    box-shadow: var(--shadow-glow);
}
.topic-card.selected .topic-icon {
    background: var(--gradient-primary);
    color: #fff;
    animation: topic-pop 420ms cubic-bezier(.3, 1.6, .5, 1);
}
.topic-card.selected .topic-check {
    background: var(--gradient-primary);
    border-color: transparent;
}
.topic-card.selected .topic-check svg { transform: scale(1); }

@keyframes topic-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.14) rotate(-6deg); }
    100% { transform: scale(1); }
}

.topic-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Question box slides open under the list */
.question-panel {
    animation: panel-in 380ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .step.active .topic-card,
    .topic-card.selected::after,
    .topic-card.selected .topic-icon,
    .question-panel { animation: none; }
}

.question-panel[hidden] { display: none; }

.question-panel-label {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

/* ---------- QUESTION SUGGESTIONS (step 5) ---------- */
.suggestion-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-3);
}

.suggestion-chip {
    padding: 12px 18px;
    border-radius: var(--radius-full);
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.suggestion-chip:active { transform: scale(0.96); }

.suggestion-chip.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(224, 120, 42, 0.18), rgba(200, 52, 26, 0.1));
}

.textarea-field {
    width: 100%;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.textarea-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}
.textarea-field::placeholder { color: var(--text-faint); }

.legal-note {
    font-size: 12.5px;
    color: var(--text-faint);
    text-align: center;
    line-height: 1.5;
    margin: var(--space-3) 0 0;
}

.legal-note a {
    color: var(--text-dim);
    text-decoration: underline;
}

.legal-note a:active,
.legal-note a:hover {
    color: var(--color-primary);
}

/* ---------- REPORT SUMMARY (LOCKED PREVIEW) ---------- */
.report-preview {
    display: flex;
    flex-direction: column;
}

.preview-visible {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.preview-locked-wrap {
    position: relative;
    margin-top: var(--space-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.preview-locked {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    filter: blur(3px);
    opacity: 0.92;
    user-select: none;
    pointer-events: none;
}

.preview-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 246, 230, 0) 0%, rgba(255, 246, 230, 0.55) 45%, rgba(255, 246, 230, 0.92) 100%);
    pointer-events: none;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 13px 16px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.summary-label {
    font-size: 14px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.summary-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-lock-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-strong);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.insight-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 4px 0 0;
}

.insight-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.insight-line {
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
}

/* ---------- BUTTON LOADING STATE ---------- */
.next-btn.loading {
    opacity: 0.85;
    cursor: wait;
    position: relative;
    color: transparent;
}

.next-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ---------- CELEBRATION ---------- */
.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 250;
}

/* ---------- PRICING MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(63, 31, 20, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease);
}

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

.modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-strong);
    border-radius: 24px 24px 0 0;
    padding: var(--space-4) var(--space-4) calc(var(--space-4) + var(--safe-bottom));
    box-shadow: var(--shadow-lg);
    transform: translateY(24px);
    transition: transform var(--dur) var(--ease);
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

.modal-sub {
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.pricing-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.pricing-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.pricing-option.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(224, 120, 42, 0.16), rgba(200, 52, 26, 0.08));
}

.pricing-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--color-border-strong);
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: border-color var(--dur) var(--ease);
}

.pricing-option.selected .pricing-radio {
    border-color: var(--color-primary);
}

.pricing-radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--gradient-primary);
    transform: scale(0);
    transition: transform var(--dur) var(--ease);
}

.pricing-option.selected .pricing-radio::after {
    transform: scale(1);
}

.pricing-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pricing-price {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
}

.pricing-desc {
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text-dim);
}

.modal-card .next-btn {
    margin-top: 0;
}

.modal-error {
    font-size: 13px;
    color: #B42318;
    text-align: center;
    margin: 0 0 var(--space-3);
}

.modal-upi-note {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    margin: var(--space-2) 0 0;
}

/* ---------- HISTORY MODAL ---------- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-height: 55vh;
    overflow-y: auto;
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-3);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.history-item:active { transform: scale(0.98); }

.history-item:hover {
    border-color: var(--color-primary-line);
}

.history-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.history-question {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-plan-badge {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.history-meta {
    font-size: 12.5px;
    color: var(--text-dim);
}

.history-empty {
    font-size: 14px;
    color: var(--text-dim);
    text-align: center;
    padding: var(--space-5) 0;
    margin: 0;
}

/* ---------- FULL REPORT (step 7) ---------- */
.glance-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    margin: 0 0 10px;
}

.glance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.glance-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(224, 120, 42, 0.14), rgba(200, 52, 26, 0.06));
    border: 1px solid var(--color-primary-line);
    border-radius: var(--radius-md);
}

.glance-title {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-dim);
}

.glance-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.full-report-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.report-body {
    display: flex;
    flex-direction: column;
}

.report-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: var(--space-4) 0 var(--space-2);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.report-body h3:first-child {
    margin-top: 0;
}

.report-body p {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-dim);
    margin: 0 0 var(--space-3);
}

.report-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-3);
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
}

.report-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--color-border-strong);
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
}

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

.ai-disclaimer {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--text-faint);
    text-align: center;
    margin: var(--space-4) 0 0;
}

/* ---------- UPSELL CALLOUT ---------- */
.upsell-callout {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(224, 120, 42, 0.16), rgba(255, 210, 125, 0.08));
    border: 1px solid var(--color-primary-line);
    border-radius: var(--radius-md);
}

.upsell-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upsell-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

/* ---------- CHAT WIDGET (extended plan follow-ups) ---------- */
.chat-widget {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.chat-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 var(--space-3);
}

.chat-log {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.chat-log:empty {
    display: none;
}

.chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

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

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    align-self: flex-start;
    background: var(--surface-alt);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-bubble.pending {
    align-self: flex-start;
    background: var(--surface-alt);
    color: var(--text-dim);
    font-style: italic;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    height: 46px;
    padding: 0 14px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text);
    font-size: 14.5px;
    outline: none;
    transition: border-color var(--dur) var(--ease);
}

.chat-input:focus { border-color: var(--color-primary); }
.chat-input::placeholder { color: var(--text-faint); }
.chat-input:disabled { opacity: 0.5; }

.chat-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}

.chat-send:active { transform: scale(0.94); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-limit-note {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    margin: var(--space-2) 0 0;
}

@media (min-width: 481px) {
    .app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ---------- DETAILED REPORT DOCUMENT (web) ---------- */
.ad-doc {
    position: relative;
    margin-top: var(--space-3);
    isolation: isolate;
}

/* Faint "AstroTalky" watermark tiled over the whole report */
.ad-doc::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='200'%3E%3Ctext x='130' y='110' transform='rotate(-30 130 100)' text-anchor='middle' font-family='Georgia,serif' font-size='34' font-weight='bold' fill='%23C8341A' fill-opacity='0.06'%3EAstroTalky%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}

.ad-break { display: none; }

.ad-h {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-maroon);
    margin: var(--space-4) 0 var(--space-2);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}
.ad-doc > .ad-h:first-child { margin-top: 0; }

.ad-intro,
.ad-muted {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0 0 var(--space-2);
}

.ad-note {
    margin: var(--space-2) 0 0;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-dim);
    background: rgba(255, 210, 125, 0.25);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
}

.ad-kv,
.ad-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 13.5px;
}
.ad-kv td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ad-kv tr:last-child td { border-bottom: 0; }
.ad-kv-k { width: 44%; color: var(--text-dim); }
.ad-kv-v { font-weight: 600; color: var(--text); }

.ad-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.ad-table { font-size: 12.5px; }
.ad-table th {
    background: var(--color-maroon);
    color: #FFF7E0;
    text-align: left;
    font-weight: 600;
    padding: 9px 10px;
    white-space: nowrap;
}
.ad-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ad-table tr:nth-child(even) td { background: rgba(255, 246, 230, 0.7); }
.ad-table tr.ad-current td { background: rgba(253, 227, 196, 0.9); font-weight: 600; }
.ad-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    background: var(--gradient-primary);
}

.ad-charts { width: 100%; border-collapse: collapse; }
.ad-charts td { width: 50%; padding: 4px; text-align: center; vertical-align: top; }
.ad-chart-img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}
.ad-cap { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }

@media (max-width: 380px) {
    .ad-charts, .ad-charts tbody, .ad-charts tr, .ad-charts td { display: block; width: 100%; }
    .ad-charts td + td { margin-top: var(--space-3); }
}

.ad-center { text-align: center; }
.ad-strength-img { width: 100%; max-width: 520px; height: auto; }

.ad-cards { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.ad-cards, .ad-cards tbody, .ad-cards tr, .ad-cards td { display: block; width: 100%; }
.ad-cards td { padding-bottom: 10px; }
.ad-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.ad-card-title { font-weight: 700; color: var(--text); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ad-card-text { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.ad-pill { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.ad-pill-warn { color: #B42318; background: #FEF3F2; }
.ad-pill-ok { color: #127A3D; background: #ECFDF3; }
.ad-box {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 251, 243, 0.9);
}
.ad-box-title { font-weight: 700; color: var(--color-maroon); margin-bottom: 6px; }
.ad-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-dim); }
.ad-list li { margin-bottom: 4px; }
.ad-list strong { color: var(--text); }

.ad-reading-banner {
    margin: var(--space-5) 0 var(--space-3);
    padding: 18px 16px;
    text-align: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #5B0E0E, #8A2418 60%, #C8341A);
    box-shadow: var(--shadow-md);
}
.ad-reading-kicker { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: #FFD27D; }
.ad-reading-title { margin-top: 4px; font-size: 20px; font-weight: 700; color: #fff; }

.ad-reading h3 {
    color: var(--color-maroon);
    padding: 8px 12px;
    border: 0;
    border-left: 4px solid var(--color-primary);
    border-radius: 6px;
    background: rgba(255, 210, 125, 0.22);
}
.ad-reading p { color: var(--text); }
.ad-reading strong { color: var(--color-maroon); }
.ad-reading ul { margin: 0 0 var(--space-3); padding-left: 20px; color: var(--text); font-size: 14.5px; line-height: 1.7; }
.ad-reading .report-disclaimer { text-align: center; font-size: 12.5px; color: var(--text-faint); }
.ad-method { margin-top: var(--space-3); text-align: center; font-size: 11.5px; color: var(--text-faint); }

.pricing-option[hidden] { display: none; }

/* ---------- GENERATE REPORT LOADER ---------- */
body.gen-loading { overflow: hidden; }

.gen-loader {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 210, 125, 0.55), transparent 70%),
        rgba(255, 246, 230, 0.97);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 380ms ease;
}
.gen-loader[hidden] { display: none; }
.gen-loader.open { opacity: 1; }
.gen-loader.leaving { opacity: 0; }

.gen-loader-inner {
    width: 100%;
    max-width: 340px;
    text-align: center;
    transform: translateY(12px) scale(.97);
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
}
.gen-loader.open .gen-loader-inner { transform: none; }

.gen-orbit {
    position: relative;
    width: min(64vw, 230px);
    aspect-ratio: 1;
    margin: 0 auto 26px;
}

.gen-wheel,
.gen-lotus {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.gen-wheel { color: rgba(200, 52, 26, 0.45); animation: gen-spin 24s linear infinite; }
.gen-lotus { color: rgba(224, 120, 42, 0.35); inset: 18%; width: 64%; height: 64%; animation: gen-spin 36s linear infinite reverse; }

.gen-ring {
    position: absolute;
    border: 1px dashed rgba(224, 120, 42, 0.35);
    border-radius: 50%;
    animation: gen-spin linear infinite;
}
.gen-ring-1 { inset: 8%;  animation-duration: 5.5s; }
.gen-ring-2 { inset: 20%; animation-duration: 7.5s; animation-direction: reverse; }
.gen-ring-3 { inset: 31%; animation-duration: 4.2s; }

.gen-planet {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 14px var(--c);
}
.gen-ring-3 .gen-planet { width: 9px; height: 9px; margin-left: -4.5px; top: -4.5px; }

.gen-core {
    position: absolute;
    inset: 36%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #FFFFFF, #FFE7C2);
    box-shadow: 0 0 0 6px rgba(255, 210, 125, 0.35), 0 10px 30px rgba(224, 120, 42, 0.35);
    animation: gen-pulse 2.6s ease-in-out infinite;
}
.gen-core img { width: 58%; height: 58%; object-fit: contain; }

@keyframes gen-spin { to { transform: rotate(360deg); } }
@keyframes gen-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 6px rgba(255, 210, 125, 0.35), 0 10px 30px rgba(224, 120, 42, 0.35); }
    50%      { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(255, 210, 125, 0.12), 0 10px 34px rgba(224, 120, 42, 0.45); }
}

.gen-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: var(--color-maroon);
}

.gen-status {
    min-height: 22px;
    margin: 0 0 18px;
    font-size: 14.5px;
    color: var(--text-dim);
    opacity: 0;
    transform: translateY(6px);
}
.gen-status.show { animation: gen-status-in 600ms ease-out forwards; }
@keyframes gen-status-in { to { opacity: 1; transform: none; } }

.gen-progress {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(91, 14, 14, 0.08);
    overflow: hidden;
}
.gen-progress span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px rgba(224, 120, 42, 0.6);
}
.gen-progress span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: gen-shimmer 1.2s linear infinite;
}
@keyframes gen-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.gen-percent {
    margin: 8px 0 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-primary-2);
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .gen-wheel, .gen-lotus, .gen-ring, .gen-core, .gen-progress span::after { animation: none; }
}

/* ---------- Fit the "What do you want to know?" and "Report is ready" steps
   on one screen: tighter spacing on shorter phones ---------- */
.step[data-step="5"] .step-scroll { padding-bottom: 150px; }

@media (max-height: 820px) {
    .step[data-step="5"] .step-header-row,
    .step[data-step="6"] .step-header-row { margin-bottom: var(--space-3); }
    .step[data-step="5"] .step-title,
    .step[data-step="6"] .step-title { font-size: 25px; margin-bottom: 4px; }
    .step[data-step="5"] .step-illustration,
    .step[data-step="6"] .step-illustration { width: 72px; height: 72px; }
    .step[data-step="5"] .step-illustration img,
    .step[data-step="6"] .step-illustration img { width: 44px; height: 44px; }
    .step[data-step="5"] .topic-list { gap: 10px; }
    .step[data-step="5"] .topic-card { padding: 12px 14px; }
    .step[data-step="5"] .topic-icon { width: 44px; height: 44px; }
    .step[data-step="6"] .summary-row { padding: 10px 14px; }
    .step[data-step="6"] .insight-line { padding: 10px 14px; }
    .step-footer { padding-top: var(--space-2); }
    .step-footer .legal-note { margin-top: 8px; font-size: 11.5px; }
}

@media (max-height: 700px) {
    .step[data-step="5"] .step-sub,
    .step[data-step="6"] .step-sub { font-size: 14px; }
    .step[data-step="5"] .topic-desc { font-size: 12px; }
    .step[data-step="6"] .summary-row { padding: 8px 12px; }
    .step[data-step="6"] .summary-label,
    .step[data-step="6"] .summary-value { font-size: 13.5px; }
    .step-footer .next-btn { height: 52px; }
}

/* the [hidden] attribute must win over display:flex */
.report-loading[hidden],
.gen-error[hidden] { display: none !important; }
