.neo-hero { display: none; }

:root[data-people-style="neo"] {
    --bg: #fff;
    --neo-accent: #6744d9;
    --neo-card: #fdfcff;
    --neo-card-border: #ded6f4;
    --neo-card-ink: #29243c;
    --neo-card-shadow: 0 12px 34px color-mix(in srgb, var(--neo-accent) 13%, transparent);
    --neo-input-chip: #eeeaf6;
    --neo-output-chip: #2563c5;
    --neo-gradient: linear-gradient(105deg, #306bdd, #7938df 60%, #b5159d);
}

:root[data-people-style="neo"][data-theme="dark"] {
    --bg: #000;
    --neo-accent: #b5a0ff;
    --neo-card: #232034;
    --neo-card-border: #494064;
    --neo-card-ink: #f4efff;
    --neo-input-chip: #39314d;
    --neo-output-chip: #326cc4;
    --neo-gradient: linear-gradient(105deg, #82aeff, #bc94ff 60%, #ff8bea);
}

:root[data-people-style="neo"]:not(:has(body.ask-globe)),
:root[data-people-style="neo"] :is(body:not(.ask-globe), #ask-app) {
    background-color: var(--bg);
}

:root[data-people-style="neo"]:has(body.ask-globe),
:root[data-people-style="neo"] body.ask-globe {
    background-color: transparent;
}

.neo-style-toggle[aria-pressed="true"] {
    background: var(--neo-accent);
    border-color: var(--neo-accent);
    color: var(--bg, white);
    box-shadow: none;
}

:root[data-people-style="neo"] :is(.front-mochi, .front-mochi-home, .mochi-processing-tracker) {
    display: none;
}

:root[data-people-style="neo"] #frontStart > :is(.hero-person, .model-cloud, .globe-particles),
:root[data-people-style="neo"] .character-scene > :is(.bot-person, .ask-duo, .tree-companion) {
    visibility: hidden;
    pointer-events: none;
}

:root[data-people-style="neo"] :is(#frontStart, .character-scene) > .neo-hero { display: grid; }
:root[data-people-style="neo"] .character-scene { position: relative; }

.neo-hero {
    position: absolute;
    inset: 0;
    z-index: 3;
    grid-template-columns: minmax(0, 1fr);
    place-content: center;
    justify-items: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
}

.neo-orb {
    position: relative;
    width: min(91vw, 580px, 70svh);
    aspect-ratio: 1.65;
    display: grid;
    place-items: center;
    pointer-events: auto;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
}

.neo-orb[data-dragging] { cursor: grabbing; }
.neo-orb:focus-visible { outline: 2px solid var(--neo-accent); outline-offset: 3px; border-radius: 16px; }
.neo-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.neo-headline {
    font-family: system-ui, sans-serif;
    font-weight: 750;
    letter-spacing: -.062em;
}

.neo-headline { margin: 0; color: var(--ink); font-size: clamp(28px, 5vw, 58px); line-height: 1; }
.neo-headline strong {
    color: var(--neo-accent);
    background: var(--neo-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#frontStart .neo-headline > span { display: block; }

@media (min-width: 1000px) {
    #frontStart > .neo-hero:not([data-phase]) > .neo-orb {
        grid-area: 1 / 1;
        width: min(48cqw, 580px, 70svh);
    }
    #frontStart > .neo-hero:not([data-phase]) .neo-orb canvas {
        left: 50%;
        right: auto;
        width: 100cqw;
        translate: -50% 0;
    }
    #frontStart > .neo-hero:not([data-phase]) > .neo-headline {
        grid-area: 1 / 1;
        align-self: stretch;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-inline: clamp(12px, 2cqw, 30px);
        font-size: clamp(30px, 4.05cqw, 58px);
        text-align: left;
    }
    #frontStart .neo-headline > :is(span, strong) { max-width: 26%; }
    #frontStart .neo-headline > strong { text-align: right; }
}

.character-scene > .neo-hero { gap: 0; }
.character-scene .neo-orb { width: min(91vw, 535px, 60svh); }
.character-scene .neo-headline { font-size: clamp(25px, 4vw, 43px); }

@media (max-width: 600px) {
    #ask-app .character-scene > .neo-hero { bottom: 95px; }
    #ask-app .neo-orb { width: min(91vw, 480px, 53svh); }
}

.neo-suggestions {
    position: relative;
    margin-top: 10px;
    color: var(--dim);
    font: 500 13px system-ui, sans-serif;
    pointer-events: auto;
}

.neo-suggestions summary { cursor: pointer; padding: 8px; }
.neo-suggestions ul {
    position: absolute;
    bottom: 100%;
    left: 50%;
    translate: -50% 0;
    width: min(320px, 85vw);
    max-height: min(260px, 40vh);
    overflow: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    text-align: left;
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.neo-suggestions button {
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.neo-suggestions button:hover, .neo-suggestions button:focus-visible {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}


.neo-question, .neo-stage, .neo-result-copy { display: none; }
.neo-hero[data-phase] :is(.neo-headline, .neo-suggestions) { display: none; }
.neo-hero[data-phase="working"] :is(.neo-question, .neo-stage):not(:empty) { display: block; }

.neo-question {
    grid-row: 1;
    max-width: min(90vw, 360px);
    margin: 0;
    max-height: min(35svh, 280px);
    overflow: auto;
    padding: 4px;
    pointer-events: auto;
    color: var(--neo-card-ink);
    font: 500 clamp(13px, 1.3vw, 17px)/1.35 ui-monospace, monospace;
    overflow-wrap: anywhere;
    animation: neo-question-arrive 420ms ease-out both;
}

.neo-stage {
    max-width: min(90vw, 340px);
    margin: 0;
    color: var(--neo-accent);
    font: 600 clamp(13px, 1.2vw, 17px)/1.4 system-ui, sans-serif;
    overflow-wrap: anywhere;
}

:root[data-people-style="neo"] :is(.globe-result, :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active > .phone-result) {
    background: var(--neo-card);
    border: 1px solid var(--neo-card-border);
    border-radius: 20px;
    color: var(--neo-card-ink);
    box-shadow: var(--neo-card-shadow);
    animation: neo-answer-arrive 460ms ease-out both;
}

:root[data-people-style="neo"] :is(.globe-result > strong, :is(#ask-app, body.ask-with-tree) .phone-result .phone-result-verdict) {
    color: var(--neo-accent);
}

:root[data-people-style="neo"] :is(.globe-result > button:last-child, .phone-result .phone-result-done, .phone-result .answer-details-toggle) {
    border-color: var(--neo-card-border);
    color: var(--neo-accent);
}

:root[data-people-style="neo"] .globe-result .neo-result-copy { display: inline; }
:root[data-people-style="neo"] .globe-result > button:last-child > span:first-child,
:root[data-people-style="neo"] .phone-result > .phone-result-presenter,
:root[data-people-style="neo"] .character-scene.phone-result-active > :is(.bot-person, .ask-duo, .tree-companion, .decision-tree),
:root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree):has(.phone-result-active) #ask-form {
    display: none;
}

:root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

:root[data-people-style="neo"] .character-scene.phone-result-active > .phone-result:not([hidden]) {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    min-height: 0;
    text-align: left;
    isolation: isolate;
}

:root[data-people-style="neo"] [data-neo-tokens] .neo-word {
    --app-font: ui-monospace, SFMono-Regular, Consolas, monospace;
    display: inline-block;
    max-width: 100%;
    margin-block: 2px;
    padding: 2px 6px;
    border-radius: 5px;
    overflow-wrap: anywhere;
    font-family: var(--app-font);
}

:root[data-people-style="neo"] [data-neo-tokens="question"] .neo-word {
    background: var(--neo-input-chip);
    animation: neo-question-arrive 340ms ease-out var(--neo-word-delay) both;
}

:root[data-people-style="neo"] [data-neo-tokens="answer"] .neo-word {
    background: var(--neo-output-chip);
    color: white;
    animation: neo-answer-arrive 380ms ease-out calc(110ms + var(--neo-word-delay)) both;
}

@keyframes neo-question-arrive {
    from { opacity: 0; translate: -24px 0; }
}
@keyframes neo-answer-arrive {
    from { opacity: 0; translate: -22px 0; }
    to { opacity: 1; translate: 0 0; }
}

@media (min-width: 601px) {
    :root[data-people-style="neo"] #frontStart.has-answer > .neo-hero { right: 43%; }
    :root[data-people-style="neo"] #frontStart.has-answer .neo-orb { width: min(44vw, 500px, 70svh); }
    :root[data-people-style="neo"] #frontStart .globe-result {
        left: auto;
        right: 3%;
        top: 50%;
        width: min(40%, 402px);
        transform: translateY(-50%);
    }
    :root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active {
        justify-content: flex-end;
        min-height: min(510px, 70svh);
    }
    :root[data-people-style="neo"] .character-scene.phone-result-active > .neo-hero { right: 43%; }
    :root[data-people-style="neo"] .character-scene.phone-result-active > .neo-hero .neo-orb { width: min(43vw, 460px, 60svh); }
    :root[data-people-style="neo"] .character-scene.phone-result-active > .phone-result {
        width: min(43%, 430px);
        margin: 0 2% 0 0;
        padding: 20px;
    }
    :root[data-people-style="neo"] .phone-result .phone-result-verdict { font-size: clamp(30px, 5vw, 66px); }
    :root[data-people-style="neo"] .phone-result[data-comparison] .phone-result-verdict { font-size: clamp(24px, 3vw, 38px); }
}

@media (min-width: 1100px) {
    .neo-hero[data-phase] .neo-orb { width: min(37%, 475px, 64svh); }
    .neo-hero[data-phase] .neo-question {
        position: absolute;
        grid-row: auto;
        top: 50%;
        left: 2%;
        width: min(23%, 285px);
        transform: translateY(-50%);
        text-align: left;
    }
    .neo-hero[data-phase="complete"] .neo-question { display: block; animation: none; }
    :root[data-people-style="neo"] :is(.globe-result-question, .phone-result-question) { display: none; }
    :root[data-people-style="neo"] :is(#frontStart.has-answer, .character-scene.phone-result-active) > .neo-hero { right: 0; }
    :root[data-people-style="neo"] :is(#frontStart.has-answer, .character-scene.phone-result-active) > .neo-hero .neo-orb {
        width: min(37%, 460px, 64svh);
    }
    :root[data-people-style="neo"] :is(#frontStart .globe-result, .character-scene.phone-result-active > .phone-result) {
        width: min(29%, 400px);
    }
    :root[data-people-style="neo"] .character-scene.has-tree:not(.phone-result-active) > .neo-hero {
        position: relative;
        grid-area: 1 / 1;
    }
    :root[data-people-style="neo"] .character-scene.has-tree:not(.phone-result-active) .neo-orb { width: 100%; }
    :root[data-people-style="neo"] .character-scene.has-tree:not(.phone-result-active) .neo-question {
        position: static;
        width: 100%;
        transform: none;
    }
}

@media (max-width: 600px) {
    :root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active {
        flex-direction: column;
        gap: 6px;
        padding: 0;
    }
    :root[data-people-style="neo"] .character-scene.phone-result-active > .neo-hero {
        position: relative;
        flex: 0 0 auto;
        inset: auto !important;
    }
    :root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active .neo-orb { width: min(42vw, 26svh, 166px); }
    :root[data-people-style="neo"] :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active > .phone-result {
        flex: 0 1 auto;
        min-height: 0;
        max-height: min(100%, 540px);
        margin: 0 auto;
    }
    :root[data-people-style="neo"] #ask-app .character-scene > .neo-hero[data-phase="working"] { bottom: 32px; }
    :root[data-people-style="neo"] #ask-app #result-error { bottom: 102px; }
    :root[data-people-style="neo"] body.phone-result-page nocap-face-tracker {
        --face-toggle-top: calc(var(--phone-header-height, 72px) + 10px);
        --face-toggle-bottom: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .neo-question,
    :root[data-people-style="neo"] [data-neo-tokens] .neo-word,
    :root[data-people-style="neo"] :is(.globe-result, :is(#ask-app, body.ask-with-tree) .character-scene.phone-result-active > .phone-result) { animation: none; }
}
