/* Conversation start */
.conversation-launcher {
    flex: 1;
    padding: 2.5rem 1rem;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
}

.is-hidden {
    display: none !important;
}

.launcher-stack {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
    position: relative;
    z-index: 2;
    padding-top: 220px;
    transition: padding-top 0.6s ease;
}

.launcher-stack.is-settled {
    padding-top: 0;
}

.launch-block {
    opacity: 0;
    transform: translateY(90px);
    filter: blur(6px);
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

.launch-block.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.intro-hero {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 960px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.intro-hero.is-active {
    opacity: 1;
}

.intro-hero.is-done {
    opacity: 0;
}

.intro-line {
    margin: 0;
    opacity: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.intro-line--primary {
    font-size: 3rem;
}

.intro-line--secondary {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.intro-hero.is-active .intro-line--primary {
    animation: introPrimary 2.2s ease forwards;
}

.intro-hero.is-active .intro-line--secondary {
    animation: introSecondary 2.2s ease forwards;
}

@keyframes introPrimary {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    30% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.98);
    }
}

@keyframes introSecondary {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    15% {
        opacity: 0;
        transform: translateY(40px);
    }
    40% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

.language-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.language-btn {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-btn.active {
    background: linear-gradient(135deg, #ff7a17, #ffae5a);
    color: #1e1207;
    box-shadow: 0 15px 25px rgba(255, 122, 23, 0.35);
}

.question-marquee__title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.question-marquee {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.marquee-row {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    padding: 0.4rem 0;
}

.marquee-row.reverse {
    transform: scaleX(-1);
}

.marquee-row.reverse .question-btn {
    transform: scaleX(-1);
}

.marquee-track {
    display: flex;
    gap: 1rem;
    will-change: transform;
}

.question-btn {
    border: none;
    padding: 1.5rem 2rem;
    border-radius: 999px;
    text-align: center;
    background: rgba(12, 17, 32, 0.9);
    color: var(--text-primary);
    cursor: pointer;
    min-height: 140px;
    height: 140px;
    min-width: 300px;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    font-size: 1.2rem;
    white-space: normal;
    overflow-wrap: break-word;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.question-btn:hover,
.question-btn.glow {
    border-color: rgba(255, 189, 105, 0.8);
    box-shadow: 0 0 14px rgba(255, 189, 105, 0.35);
    background: rgba(35, 25, 8, 0.95);
    color: #ffe8c8;
}

.prompt-block__title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.prompt-block__form-panel {
    background: rgba(13, 17, 31, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 2rem;
}

.prompt-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.prompt-form .btn {
    align-self: flex-start;
}

.prompt-form__field {
    margin-bottom: 0;
}

.prompt-form__field--hidden {
    display: none;
}

.prompt-form__label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

.prompt-form__help {
    color: var(--text-muted);
    display: block;
    margin-top: 0.35rem;
}

.prompt-form__error {
    color: #ff8f8f;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.prompt-block .form-error {
    margin: 0 0 0.75rem;
    color: #ff8f8f;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.prompt-block .form-error.is-visible {
    opacity: 1;
}

@media (max-width: 768px) {
    .intro-line--primary {
        font-size: 2.1rem;
    }

    .intro-line--secondary {
        font-size: 1rem;
    }

    .launcher-stack {
        padding-top: 180px;
    }

    .launcher-stack.is-settled {
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .intro-line,
    .launch-block {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .intro-hero {
        position: static;
        opacity: 1;
        transform: none;
        min-height: auto;
    }

    .conversation-launcher {
        min-height: auto;
    }
}

/* Conversation detail */
.conversation-shell {
    flex: 1;
    padding: clamp(1rem, 3vw, 3rem);
    max-width: 960px;
    margin: 0 auto;
}

.conversation-main {
    background: rgba(7, 11, 27, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 28px;
    padding: clamp(1rem, 4vw, 2.75rem);
    box-shadow: 0 45px 90px rgba(3, 5, 15, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.conversation-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2.75rem);
    letter-spacing: -0.02em;
}

.conversation-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chip.status[data-active="true"] {
    background: rgba(255, 138, 76, 0.2);
    border-color: rgba(255, 190, 150, 0.5);
    color: #ffc7a2;
}

.claim-form {
    margin: 0;
}

.claim-button {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff6b00 0%, #ff8f3f 45%, #ffd2a4 100%);
    color: #1e1207;
    box-shadow: 0 12px 24px rgba(255, 115, 48, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.claim-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(255, 115, 48, 0.45);
}

.claim-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.message-stage {
    min-height: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.message-card {
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, rgba(9, 14, 34, 0.95), rgba(6, 8, 20, 0.95));
    box-shadow: 0 22px 40px rgba(2, 4, 12, 0.55);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-card.is-layered {
    position: absolute;
    inset: 0;
}

.message-user {
    border-color: rgba(255, 175, 120, 0.35);
    background: linear-gradient(135deg, rgba(34, 13, 6, 0.85), rgba(9, 7, 16, 0.95));
}

.message-assistant {
    border-color: rgba(120, 173, 255, 0.35);
    background: linear-gradient(135deg, rgba(6, 18, 56, 0.85), rgba(5, 9, 20, 0.95));
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.message-role {
    color: rgba(255, 255, 255, 0.75);
}

.message-content {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.9;
    white-space: pre-wrap;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 1rem;
}

.thinking-indicator[data-active="false"] {
    display: none;
}

.thinking-indicator p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

.thinking-indicator .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffaf73;
    border-radius: 999px;
    animation: spin 1s linear infinite;
}

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

.message-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-form textarea {
    width: 100%;
    min-height: 160px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(7, 10, 21, 0.85);
    padding: 1rem;
    color: #fff;
    font-size: 1.05rem;
    font-family: inherit;
    resize: vertical;
}

.message-form textarea:focus {
    outline: none;
    border-color: rgba(255, 160, 101, 0.85);
    box-shadow: 0 0 0 3px rgba(255, 160, 101, 0.2);
}

.form-error {
    color: #ff8a8a;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.form-error.is-visible {
    opacity: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.85rem 1.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.save-button:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
}

.send-button {
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ff7c32 0%, #ffb774 60%, #ffe6c7 100%);
    color: #2a0f03;
    box-shadow: 0 14px 28px rgba(255, 152, 89, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.send-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(255, 152, 89, 0.45);
}

.end-button {
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.end-button:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.end-button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.message-card.animate-exit {
    animation: slideUpFade 0.35s forwards;
}

.message-card.animate-enter {
    animation: slideInFade 0.4s forwards;
}

@keyframes slideUpFade {
    to {
        transform: translateY(-35px);
        opacity: 0;
    }
}

@keyframes slideInFade {
    from {
        transform: translateY(35px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confetti-container {
    pointer-events: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 120;
}

.confetti-piece {
    position: absolute;
    top: 0;
    width: 8px;
    height: 18px;
    border-radius: 4px;
    opacity: 0;
    background: var(--confetti-color, #ffd18a);
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translate3d(0, -15vh, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translate3d(0, var(--confetti-translate, 70vh), 0) rotate(360deg);
        opacity: 0;
    }
}

/* Conversation summary */
.conversation-summary-shell {
    flex: 1;
    padding: clamp(1rem, 3vw, 3rem);
    max-width: 840px;
    margin: 0 auto;
}

.summary-card {
    background: rgba(7, 11, 27, 0.92);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: clamp(1.25rem, 4vw, 3rem);
    box-shadow: 0 40px 80px rgba(3, 5, 15, 0.45);
}

.summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.summary-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.8vw, 2.6rem);
}

.summary-description {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.6;
}

.summary-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.summary-actions a {
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: #fff;
}

.summary-actions a:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.summary-resummarize-form {
    margin: 0;
}

.summary-resummarize-button {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.45rem 1.4rem;
}

.followups {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.followups li {
    padding: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
    line-height: 1.6;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.followups li:hover,
.followups li:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.followups button {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: none;
    background: transparent;
    background-color: transparent;
    color: inherit;
    text-align: left;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font: inherit;
    border-radius: inherit;
    display: block;
    transition: background 0.2s ease;
}

.followups button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 3px;
}

.followups-empty {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
}

/* Transcript */
.transcript-shell {
    flex: 1;
    padding: clamp(1rem, 4vw, 3rem);
    display: flex;
    justify-content: center;
}

.transcript-card {
    width: min(960px, 100%);
    background: rgba(7, 11, 27, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 0 40px 70px rgba(1, 2, 8, 0.6);
}

.transcript-header {
    margin-bottom: 1.5rem;
}

.transcript-header h1 {
    margin: 0.25rem 0 0.5rem;
    font-size: clamp(1.5rem, 2.5vw, 2.8rem);
}

.transcript-summary {
    margin: 0.25rem 0 1rem;
    color: rgba(255, 255, 255, 0.75);
}

.transcript-meta {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.55);
}

.transcript-back {
    display: inline-flex;
    margin-top: 1rem;
    font-weight: 600;
    color: #ffb384;
}

.transcript-back:hover {
    text-decoration: underline;
}

.transcript-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.transcript-item {
    padding: 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 15, 34, 0.9);
}

.transcript-item--user {
    border-color: rgba(255, 175, 120, 0.35);
}

.transcript-item--assistant {
    border-color: rgba(120, 173, 255, 0.35);
}

.transcript-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.75rem;
}

.transcript-role {
    font-weight: 600;
}

.transcript-content {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.7;
}

.transcript-empty {
    margin: 2rem 0 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Save states */
body.conversation-save-page {
    background: radial-gradient(circle at top, #1a1f3b 0%, #070a15 65%, #05060b 100%);
}

body.conversation-save-complete-page {
    background: radial-gradient(circle at top, #081127 0%, #040610 70%, #010208 100%);
}

.save-flow {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    position: relative;
}

.save-card {
    width: min(640px, 100%);
    background: rgba(10, 13, 28, 0.85);
    padding: 3rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    text-align: center;
    color: #fff;
    position: relative;
}

.save-card::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.save-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1rem;
}

.save-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 1rem;
}

.save-copy {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.save-instructions {
    font-weight: 600;
    color: #ffe0c2;
    margin-bottom: 1.25rem;
}

.save-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.save-cta a {
    min-width: 180px;
    padding: 0.95rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.save-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.save-cta__login {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
}

.save-cta__signup {
    background: linear-gradient(135deg, #ff7c32 0%, #ffb774 60%, #ffe6c7 100%);
    color: #2a0f03;
}

.save-footnote {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
}

.save-complete {
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
}

.save-complete__card {
    width: min(560px, 100%);
    background: rgba(7, 10, 21, 0.9);
    border-radius: 28px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    color: #fff;
    text-align: center;
}

.save-complete__title {
    font-size: clamp(2.1rem, 4vw, 2.6rem);
    margin-bottom: 0.75rem;
}

.save-complete__copy {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.save-complete__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.save-complete__actions a {
    min-width: 200px;
    padding: 0.95rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.save-complete__actions a:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.save-complete__actions a:first-child {
    background: linear-gradient(135deg, #ff7c32 0%, #ffb774 60%, #ffe6c7 100%);
    color: #2a0f03;
}

.save-complete__actions a:last-child {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
}
