/* ------------------------------
   Global reset
------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background-start: #fffaf7;
    --background-middle: #ffeaf1;
    --background-end: #fff1d9;

    --primary: #c83f74;
    --primary-dark: #a93462;
    --primary-hover: #b62f67;

    --text-main: #4c3040;
    --text-soft: #765665;

    --glass-background: rgba(255, 255, 255, 0.48);
    --glass-border: rgba(255, 255, 255, 0.78);

    --panel-shadow: 0 25px 70px rgba(126, 50, 83, 0.18);

    --input-background: rgba(255, 255, 255, 0.72);

    --transition-speed: 0.35s;
}

body.dark-mode {
    --background-start: #130f17;
    --background-middle: #21111d;
    --background-end: #2a1718;

    --primary: #ff6f9f;
    --primary-dark: #ff8db3;
    --primary-hover: #ff5a91;

    --text-main: #fff4f8;
    --text-soft: #d6bdc8;

    --glass-background: rgba(35, 24, 35, 0.68);
    --glass-border: rgba(255, 255, 255, 0.13);

    --panel-shadow: 0 25px 80px rgba(0, 0, 0, 0.38);

    --input-background: rgba(255, 255, 255, 0.08);
}

html {
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    overflow-x: hidden;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    color: var(--text-main);
    background: var(--background-start);

    transition:
        color var(--transition-speed) ease,
        background var(--transition-speed) ease;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* ------------------------------
   Video intro
------------------------------ */

#intro {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100vw;
    height: 100vh;

    overflow: hidden;
    background: #000;

    opacity: 1;

    transition:
        opacity 1s ease,
        visibility 1s ease;
}

#intro.intro-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#bgVideo {
    position: absolute;
    inset: 0;

    width: 110%;
    height: 110%;

    object-fit: cover;

    filter: blur(35px);
    opacity: 0.65;

    transform: scale(1.1);
}

#introVideo {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

/* ------------------------------
   Main website background
------------------------------ */

#website {
    position: relative;

    min-height: 100vh;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(255, 142, 183, 0.36),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 85%,
            rgba(255, 200, 123, 0.34),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            var(--background-start),
            var(--background-middle),
            var(--background-end)
        );

    transition: background var(--transition-speed) ease;
}

/* ------------------------------
   Navigation
------------------------------ */

.navbar {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1000;

    width: min(calc(100% - 32px), 1120px);
    min-height: 66px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 16px 10px 20px;

    background: var(--glass-background);

    border: 1px solid var(--glass-border);
    border-radius: 22px;

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow: 0 14px 40px rgba(80, 30, 55, 0.12);

    transform: translateX(-50%);

    transition:
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--primary-dark);
    text-decoration: none;

    font-size: 1.08rem;
    font-weight: 800;
}

.brand-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border-radius: 13px;

    background: linear-gradient(135deg, #ffd599, #ff9fbd);

    box-shadow: 0 7px 18px rgba(200, 63, 116, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 10px 16px;

    border: 0;
    border-radius: 14px;

    color: var(--text-soft);
    background: transparent;

    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        color 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.08);

    transform: translateY(-1px);
}

.nav-link.active {
    color: #fff;
    background: var(--primary);

    box-shadow: 0 8px 18px rgba(200, 63, 116, 0.25);
}

.theme-toggle {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border: 1px solid var(--glass-border);
    border-radius: 15px;

    color: var(--text-main);
    background: rgba(255, 255, 255, 0.22);

    font-size: 1.15rem;

    cursor: pointer;

    transition:
        transform 0.3s ease,
        background 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(12deg) scale(1.08);
}

.app-back-navigation {
    position: fixed;
    top: 102px;
    left: max(
        16px,
        calc((100vw - 1120px) / 2)
    );
    z-index: 900;
}

.app-back-button,
.app-back-button:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 42px;

    padding: 9px 15px 9px 12px;

    border:
        1px solid
        var(--glass-border);
    border-radius: 15px;

    color: var(--text-main);
    background:
        var(--glass-background);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow:
        0 10px 28px
        rgba(80, 30, 55, 0.11);

    font-size: 0.9rem;
    font-weight: 780;
    text-decoration: none;

    transition:
        color 0.22s ease,
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;

    animation:
        appBackEntrance 0.42s ease both;
}

.app-back-button:hover {
    color: var(--primary-dark);

    box-shadow:
        0 14px 34px
        rgba(126, 50, 83, 0.17);

    transform: translateY(-2px);
}

.app-back-button:focus-visible {
    outline: 3px solid
        rgba(200, 63, 116, 0.28);
    outline-offset: 3px;
}

.app-back-arrow {
    display: inline-block;

    color: var(--primary);

    font-size: 1.08rem;
    line-height: 1;

    transition:
        transform 0.22s ease;
}

.app-back-button:hover
    .app-back-arrow {
    transform: translateX(-2px);
}

@keyframes appBackEntrance {
    from {
        opacity: 0;
        transform: translateX(6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.has-app-back-navigation
    .page-section {
    padding-top: 166px;
}

.has-app-back-navigation
    .legacy-section,
.has-app-back-navigation
    .legacy-dashboard-section {
    padding-top: 166px;
}

@media (max-width: 680px) {
    .app-back-navigation {
        top: 94px;
        left: 14px;
    }

    .has-app-back-navigation
        .page-section,
    .has-app-back-navigation
        .legacy-section,
    .has-app-back-navigation
        .legacy-dashboard-section {
        padding-top: 154px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-back-button {
        animation: none;
    }
}

/* Memory Review */
.memory-review-section {
    min-height: calc(100vh - 82px);
    padding: 7rem clamp(1rem, 4vw, 4rem) 4rem;
}

.memory-review-shell {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.memory-review-header {
    max-width: 720px;
    margin-bottom: 2rem;
}

.memory-review-header h1 {
    margin: 0.35rem 0 0.7rem;
    color: var(--pink, #ff6f91);
    font-size: clamp(2.1rem, 5vw, 3.8rem);
}

.memory-review-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.memory-filter,
.memory-review-filters select {
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    padding: 0.65rem 1rem;
    font: inherit;
}

.memory-filter {
    cursor: pointer;
}

.memory-filter.is-active,
.memory-filter:hover {
    border-color: rgba(255, 111, 145, 0.65);
    background: rgba(255, 111, 145, 0.16);
}

.memory-review-filters label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.82rem;
}

.memory-review-status {
    padding: 1.2rem 0;
    color: var(--text-secondary, #d8cfdf);
}

.memory-review-list {
    display: grid;
    gap: 1.25rem;
}

.memory-review-card {
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.14);
    animation: fadeInUp 0.35s ease both;
}

.memory-review-card[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

.memory-card-heading h2 {
    margin: 0.8rem 0 0.5rem;
    color: var(--pink, #ff6f91);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.memory-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.memory-review-badge {
    display: inline-flex;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 700;
}

.memory-review-badge-pending {
    color: #ffd2dd;
    border-color: rgba(255, 111, 145, 0.45);
}

.memory-review-badge-warning {
    color: #ffe7ad;
    border-color: rgba(255, 201, 92, 0.5);
}

.memory-review-badge-related {
    color: #d8caff;
    border-color: rgba(174, 139, 255, 0.5);
}

.memory-card-summary {
    font-size: 1.08rem;
    line-height: 1.7;
}

.memory-uncertainty,
.memory-importance {
    margin: 0.55rem 0;
    color: var(--text-secondary, #d8cfdf);
}

.memory-card-details {
    margin-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
}

.memory-card-details > summary {
    cursor: pointer;
    color: var(--pink, #ff8faa);
    font-weight: 700;
}

.memory-provenance-list {
    display: grid;
    gap: 0.75rem;
    padding: 0;
    list-style: none;
}

.memory-provenance-item,
.memory-related-item {
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.055);
}

.memory-provenance-item blockquote {
    margin: 0.65rem 0;
    padding-left: 0.9rem;
    border-left: 2px solid rgba(255, 111, 145, 0.55);
    line-height: 1.55;
}

.memory-related-item {
    margin-top: 0.85rem;
}

.memory-related-item h4 {
    margin: 0.65rem 0 0.3rem;
}

.memory-related-note {
    color: var(--text-secondary, #d8cfdf);
    font-size: 0.9rem;
}

.memory-card-actions,
.memory-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.memory-reject-button {
    border: 1px solid rgba(255, 123, 123, 0.42);
    border-radius: 999px;
    background: transparent;
    color: #ffb3b3;
    padding: 0.7rem 1.15rem;
    cursor: pointer;
}

.danger-button {
    border: 1px solid rgba(255, 110, 110, 0.62);
    border-radius: 999px;
    background: linear-gradient(135deg, #c8455d, #9f3049);
    color: #fff;
    padding: 0.72rem 1.2rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(159, 48, 73, 0.28);
}

.danger-button:hover,
.danger-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(159, 48, 73, 0.36);
}

.story-completion-status {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 111, 145, 0.25);
    border-radius: 18px;
    background: rgba(255, 111, 145, 0.08);
}

.story-completion-status p {
    margin: 0;
    line-height: 1.55;
}

.story-completion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

@media (max-width: 640px) {
    .story-completion-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .story-completion-actions > * {
        width: 100%;
        text-align: center;
    }
}

.memory-review-dialog {
    width: min(620px, calc(100% - 2rem));
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
}

.memory-review-dialog::backdrop {
    background: rgba(12, 7, 20, 0.72);
    backdrop-filter: blur(7px);
}

.memory-review-dialog-card {
    display: grid;
    gap: 1rem;
    max-height: min(86vh, 760px);
    overflow-y: auto;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.memory-review-dialog-card label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
}

.memory-review-dialog-card input,
.memory-review-dialog-card textarea,
.memory-review-dialog-card select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    padding: 0.8rem;
    font: inherit;
}

.form-error {
    min-height: 1.3rem;
    color: #ffb3b3;
}

@media (max-width: 640px) {
    .memory-review-section {
        padding: 6.5rem 1rem 2.5rem;
    }

    .memory-review-filters,
    .memory-card-actions,
    .memory-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .memory-filter,
    .memory-card-actions button,
    .memory-dialog-actions button {
        width: 100%;
    }
}

/* ------------------------------
   Page sections
------------------------------ */

.page-section {
    position: relative;
    z-index: 2;

    display: none;

    min-height: 100vh;

    padding:
        112px
        20px
        32px;

    animation: sectionAppear 0.65s ease;
}

.page-section.active-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes sectionAppear {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------
   Hero section
------------------------------ */

.hero {
    width: 100%;
    max-width: 860px;

    display: flex;
    justify-content: center;

    text-align: center;
}

.glass-card,
.glass-panel {
    background: var(--glass-background);

    border: 1px solid var(--glass-border);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    box-shadow:
        var(--panel-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);

    transition:
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease;
}

.hero-card {
    position: relative;

    width: min(94%, 720px);

    margin-top: 95px;
    padding:
        285px
        36px
        32px;

    overflow: visible;

    border-radius: 34px;

    animation: heroCardEntrance 1s ease;
}

@keyframes heroCardEntrance {
    from {
        opacity: 0;
        transform: translateY(35px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mascot overlaps the card */
#mascot {
    position: absolute;
    top: -170px;
    left: 50%;
    z-index: 3;

    width: clamp(290px, 25vw, 360px);
    max-height: 440px;

    object-fit: contain;

    user-select: none;
    -webkit-user-drag: none;

    filter:
        drop-shadow(0 25px 45px rgba(255, 105, 180, 0.26));

    transform: translateX(-50%);

    animation:
        mascotEntrance 1.25s cubic-bezier(0.18, 0.89, 0.32, 1.28),
        mascotFloat 5s ease-in-out 1.25s infinite;

    transition:
        filter 0.4s ease,
        scale 0.4s ease;
}

#mascot:hover {
    scale: 1.04;

    filter:
        drop-shadow(0 32px 55px rgba(255, 105, 180, 0.42));
}

@keyframes mascotEntrance {
    0% {
        opacity: 0;
        transform:
            translateX(-50%)
            translateY(-180px)
            rotate(-8deg)
            scale(0.82);
    }

    65% {
        opacity: 1;
        transform:
            translateX(-50%)
            translateY(12px)
            rotate(3deg)
            scale(1.04);
    }

    82% {
        transform:
            translateX(-50%)
            translateY(-6px)
            rotate(-1deg)
            scale(0.99);
    }

    100% {
        opacity: 1;
        transform:
            translateX(-50%)
            translateY(0)
            rotate(0)
            scale(1);
    }
}

@keyframes mascotFloat {
    0%,
    100% {
        transform:
            translateX(-50%)
            translateY(0)
            rotate(-1deg);
    }

    50% {
        transform:
            translateX(-50%)
            translateY(-13px)
            rotate(1deg);
    }
}

/* Glass shine */
.card-shine {
    position: absolute;
    inset: 0;

    overflow: hidden;

    border-radius: inherit;

    pointer-events: none;
}

.card-shine::before {
    content: "";

    position: absolute;
    top: -45%;
    left: -70%;

    width: 45%;
    height: 190%;

    background:
        linear-gradient(
            100deg,
            transparent,
            rgba(255, 255, 255, 0.48),
            transparent
        );

    transform: rotate(18deg);

    animation: glassShine 6.5s ease-in-out infinite;
}

@keyframes glassShine {
    0%,
    35% {
        left: -70%;
    }

    60%,
    100% {
        left: 140%;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.eyebrow {
    margin-bottom: 9px;

    color: var(--primary);

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 {
    min-height: 1.08em;
    margin-bottom: 11px;

    color: var(--primary-dark);

    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.hero-description {
    min-height: 3.2em;
    max-width: 620px;

    margin: 0 auto 20px;

    color: var(--text-soft);

    font-size: 1.18rem;
    line-height: 1.5;
}

/* Typing cursor */
#typedHeading::after,
#typedDescription.typing-active::after {
    content: "|";

    margin-left: 3px;

    color: var(--primary);

    animation: cursorBlink 0.75s infinite;
}

@keyframes cursorBlink {
    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ------------------------------
   Buttons
------------------------------ */

.primary-button,
.secondary-button,
.icon-button,
.input-icon-button,
.send-button {
    border: none;
    cursor: pointer;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-width: 170px;

    padding: 14px 25px;

    border-radius: 999px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #e7588b
        );

    font-size: 1rem;
    font-weight: 800;

    box-shadow:
        0 13px 28px rgba(200, 63, 116, 0.28),
        0 0 25px rgba(255, 105, 180, 0.18);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        opacity 0.5s ease;
}

.primary-button:hover {
    transform: translateY(-4px) scale(1.035);

    box-shadow:
        0 19px 38px rgba(200, 63, 116, 0.38),
        0 0 34px rgba(255, 105, 180, 0.28);
}

.primary-button:active {
    transform: translateY(-1px) scale(1.01);
}

.button-arrow {
    display: inline-block;

    transition: transform 0.3s ease;
}

.primary-button:hover .button-arrow {
    transform: translateX(7px);
}

.hidden-action {
    opacity: 0;
    visibility: hidden;

    transform: translateY(12px);
}

.hidden-action.show-action {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

/* ------------------------------
   Floating background particles
------------------------------ */

.particles {
    position: fixed;
    inset: 0;
    z-index: 1;

    overflow: hidden;

    pointer-events: none;
}

.particle {
    position: absolute;

    color: rgba(218, 77, 130, 0.32);

    font-size: 1.2rem;

    animation:
        particleFloat 12s ease-in-out infinite,
        particleGlow 3s ease-in-out infinite;
}

.particle-1 {
    top: 18%;
    left: 8%;
    animation-delay: 0s;
}

.particle-2 {
    top: 68%;
    left: 13%;
    animation-delay: -3s;
}

.particle-3 {
    top: 34%;
    left: 90%;
    animation-delay: -6s;
}

.particle-4 {
    top: 82%;
    left: 82%;
    animation-delay: -1s;
}

.particle-5 {
    top: 15%;
    left: 76%;
    animation-delay: -7s;
}

.particle-6 {
    top: 55%;
    left: 5%;
    animation-delay: -5s;
}

.particle-7 {
    top: 76%;
    left: 54%;
    animation-delay: -8s;
}

.particle-8 {
    top: 25%;
    left: 35%;
    animation-delay: -2s;
}

@keyframes particleFloat {
    0%,
    100% {
        transform:
            translateY(0)
            rotate(0deg)
            scale(1);
    }

    50% {
        transform:
            translateY(-45px)
            rotate(20deg)
            scale(1.15);
    }
}

@keyframes particleGlow {
    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.8;
    }
}

/* ------------------------------
   Chat layout
------------------------------ */

.chat-layout {
    width: min(100%, 1120px);
    min-height: 680px;

    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
}

.assistant-panel,
.chat-window {
    border-radius: 28px;
}

.assistant-panel {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 28px 24px;

    text-align: center;
}

.chat-mascot {
    width: 210px;
    max-width: 100%;

    margin-bottom: 10px;

    filter:
        drop-shadow(0 18px 30px rgba(200, 63, 116, 0.2));

    animation: smallMascotFloat 4.5s ease-in-out infinite;
}

@keyframes smallMascotFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-9px);
    }
}

.assistant-panel h2 {
    margin-bottom: 8px;

    color: var(--primary-dark);

    font-size: 1.8rem;
}

.assistant-panel p {
    margin-bottom: 18px;

    color: var(--text-soft);

    line-height: 1.5;
}

.assistant-status {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: auto;
    padding: 8px 13px;

    border-radius: 999px;

    color: var(--text-soft);
    background: rgba(75, 202, 128, 0.11);

    font-size: 0.88rem;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #45c87a;

    box-shadow: 0 0 12px rgba(69, 200, 122, 0.8);
}

.secondary-button {
    width: 100%;

    margin-top: 24px;
    padding: 12px 16px;

    border: 1px solid var(--glass-border);
    border-radius: 15px;

    color: var(--text-main);
    background: rgba(255, 255, 255, 0.16);

    font-weight: 700;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.secondary-button:hover {
    background: rgba(200, 63, 116, 0.11);
    transform: translateY(-2px);
}

.chat-window {
    min-width: 0;
    height: 680px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 22px 24px;

    border-bottom: 1px solid var(--glass-border);
}

.chat-header h2 {
    margin-bottom: 5px;

    color: var(--primary-dark);
}

.chat-header p {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.icon-button {
    width: 42px;
    height: 42px;

    border-radius: 14px;

    background: rgba(200, 63, 116, 0.09);

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.icon-button:hover {
    background: rgba(200, 63, 116, 0.16);
    transform: scale(1.06);
}

.chat-messages {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 24px;

    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: rgba(200, 63, 116, 0.4) transparent;
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;

    animation: messageAppear 0.35s ease;
}

.berry-row .message {
    max-width: min(
        calc(75% - 48px),
        620px
    );
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-row {
    justify-content: flex-end;
}

.message-avatar {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.5);
}

.message {
    max-width: min(75%, 620px);

    padding: 13px 16px;

    border-radius: 19px;

    line-height: 1.5;
}

.berry-message {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.48);

    border-bottom-left-radius: 5px;
}

.user-message {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #e8588d
        );

    border-bottom-right-radius: 5px;

    box-shadow: 0 8px 18px rgba(200, 63, 116, 0.2);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;

    width: fit-content;

    padding: 10px 14px;

    border-radius: 16px;

    background: rgba(255, 255, 255, 0.4);
}

.typing-companion-label {
    margin-right: 3px;

    color: var(--text-soft);

    font-size: 0.8rem;
    font-weight: 750;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-dots i {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--primary);

    animation: typingBounce 1.1s infinite;
}

.typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.chat-input-area {
    display: grid;
    grid-template-columns: 44px 1fr 48px;
    align-items: center;
    gap: 10px;

    padding: 16px 18px;

    border-top: 1px solid var(--glass-border);
}

.chat-input-area input {
    width: 100%;

    padding: 14px 18px;

    border: 1px solid transparent;
    border-radius: 999px;
    outline: none;

    color: var(--text-main);
    background: var(--input-background);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.chat-input-area input::placeholder {
    color: var(--text-soft);
}

.chat-input-area input:focus {
    border-color: rgba(200, 63, 116, 0.4);

    box-shadow: 0 0 0 4px rgba(200, 63, 116, 0.1);
}

.input-icon-button,
.send-button {
    display: grid;
    place-items: center;

    border-radius: 50%;
}

.input-icon-button {
    width: 42px;
    height: 42px;

    color: var(--text-main);
    background: rgba(255, 255, 255, 0.2);

    font-size: 1.4rem;
}

.send-button {
    width: 46px;
    height: 46px;

    color: #fff;
    background: var(--primary);

    box-shadow: 0 8px 18px rgba(200, 63, 116, 0.28);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.send-button:hover {
    transform: translateY(-2px) scale(1.05);

    box-shadow: 0 12px 24px rgba(200, 63, 116, 0.38);
}

/* ------------------------------
   Mission section
------------------------------ */

.mission-card {
    width: min(100%, 780px);

    padding: 48px;

    border-radius: 32px;

    text-align: center;
}

.mission-card h2 {
    margin-bottom: 20px;

    color: var(--primary-dark);

    font-size: clamp(2.4rem, 6vw, 4.5rem);
    line-height: 1.05;
}

.mission-card p {
    max-width: 670px;

    margin: 0 auto 17px;

    color: var(--text-soft);

    font-size: 1.08rem;
    line-height: 1.7;
}

.mission-card .primary-button {
    margin-top: 12px;
}

/* ------------------------------
   Responsive tablet
------------------------------ */

@media (max-width: 900px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .assistant-panel {
        display: none;
    }

    .chat-window {
        height: calc(100vh - 145px);
        min-height: 590px;
    }

    .hero-card {
        width: min(96%, 690px);
    }
}

/* ------------------------------
   Responsive mobile
------------------------------ */

@media (max-width: 650px) {
    .navbar {
        top: 10px;

        width: calc(100% - 18px);
        min-height: 58px;

        padding: 8px 10px 8px 12px;

        border-radius: 18px;
    }

    .brand-text {
        display: none;
    }

    .nav-links {
        gap: 2px;
    }

    .nav-link {
        padding: 9px 10px;
        font-size: 0.82rem;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .page-section {
        padding:
            92px
            10px
            18px;
    }

    .hero-card {
        width: 100%;

        margin-top: 50px;
        padding:
        285px
        36px
        32px;

        border-radius: 26px;
    }

    #mascot {
        top: -130px;

        width: min(86vw, 330px);
        max-height: 350px;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 12vw, 3.5rem);
    }

    .hero-description {
        font-size: 1rem;
    }

    .primary-button {
        width: 100%;
        max-width: 260px;
    }

    .chat-window {
        height: calc(100vh - 112px);
        min-height: 560px;

        border-radius: 22px;
    }

    .chat-header {
        padding: 17px 16px;
    }

    .chat-header h2 {
        font-size: 1.15rem;
    }

    .chat-header p {
        display: none;
    }

    .chat-messages {
        padding: 16px 12px;
    }

    .message {
        max-width: 90%;
        font-size: 0.95rem;
    }

    .berry-row .message {
        max-width: calc(90% - 42px);
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-input-area {
        grid-template-columns: 38px 1fr 43px;

        gap: 7px;
        padding: 12px 10px;
    }

    .input-icon-button {
        width: 38px;
        height: 38px;
    }

    .send-button {
        width: 42px;
        height: 42px;
    }

    .mission-card {
        padding: 32px 20px;

        border-radius: 25px;
    }

    .mission-card p {
        font-size: 1rem;
    }
}

/* ------------------------------
   My Legacy overview
------------------------------ */

.legacy-overview-page {
    min-height: 100vh;
}

.legacy-overview-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    padding: 126px 22px 56px;
}

.legacy-overview-shell {
    width: min(100%, 1120px);

    margin: 0 auto;

    animation: sectionAppear 0.65s ease;
}

.legacy-overview-state {
    min-height: 390px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 42px 24px;

    border-radius: 30px;

    text-align: center;
}

.legacy-overview-state[hidden],
.legacy-overview-content[hidden],
#legacyOverviewContent[hidden] {
    display: none !important;
}

.legacy-overview-state h1 {
    margin: 18px 0 10px;

    color: var(--primary-dark);

    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.legacy-overview-state p {
    max-width: 520px;

    color: var(--text-soft);

    line-height: 1.6;
}

.legacy-overview-spinner {
    width: 46px;
    height: 46px;

    border: 4px solid rgba(200, 63, 116, 0.14);
    border-top-color: var(--primary);
    border-radius: 50%;

    animation: legacyOverviewSpin 0.8s linear infinite;
}

.legacy-overview-state-icon {
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    border-radius: 19px;

    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.1);

    font-size: 1.55rem;
}

.legacy-overview-state-actions {
    display: flex;
    justify-content: center;
    gap: 12px;

    margin-top: 24px;
}

.legacy-overview-state-actions .secondary-button {
    text-decoration: none;
}

.legacy-overview-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;

    margin-bottom: 28px;
}

.legacy-overview-hero h1 {
    margin: 3px 0 15px;

    color: var(--primary-dark);

    font-size: clamp(2.8rem, 7vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}

.legacy-overview-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 14px;

    color: var(--text-soft);

    font-size: 0.92rem;
    font-weight: 700;
}

.legacy-overview-meta > * + *::before {
    content: "•";

    margin-right: 14px;

    color: rgba(126, 50, 83, 0.42);
}

.legacy-overview-status {
    color: var(--primary-dark);
}

.legacy-overview-approved {
    flex: 0 0 auto;

    padding: 11px 16px;

    border: 1px solid rgba(126, 50, 83, 0.14);
    border-radius: 999px;

    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.4);

    font-size: 0.82rem;
    font-weight: 800;
}

.legacy-overview-approved.has-approved {
    color: #47714f;
    background: rgba(115, 173, 112, 0.14);
    border-color: rgba(71, 113, 79, 0.18);
}

.legacy-overview-hero-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 10px;
}

.legacy-settings-entry {
    min-height: 42px;

    padding: 10px 16px;

    font-size: 0.82rem;
}

.legacy-settings-page {
    min-height: 100vh;
}

.legacy-settings-section {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 118px 22px 48px;
}

.legacy-settings-shell {
    width: min(100%, 680px);
}

.legacy-settings-heading {
    margin-bottom: 22px;
}

.legacy-settings-heading h1 {
    margin: 4px 0 8px;

    color: var(--primary-dark);

    font-size: clamp(2rem, 6vw, 3.25rem);
    letter-spacing: -0.035em;
}

.legacy-settings-heading > p:last-child,
.legacy-settings-help {
    color: var(--text-soft);

    line-height: 1.55;
}

.legacy-settings-form,
.legacy-settings-state {
    padding: clamp(24px, 5vw, 38px);

    border-radius: 28px;
}

.legacy-settings-state {
    text-align: center;
}

.legacy-settings-state p {
    margin: 9px 0 20px;

    color: var(--text-soft);
}

.legacy-settings-field + .legacy-settings-field {
    margin-top: 22px;
}

.legacy-settings-field label {
    display: block;

    margin-bottom: 8px;

    color: var(--text-main);

    font-weight: 800;
}

.legacy-settings-field input {
    width: 100%;
    min-height: 50px;

    padding: 12px 14px;

    border: 1px solid rgba(126, 50, 83, 0.2);
    border-radius: 14px;
    outline: none;

    color: var(--text-main);
    background: var(--input-background);
}

.legacy-settings-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 63, 116, 0.14);
}

.legacy-settings-field input[aria-invalid="true"] {
    border-color: #b3344c;
}

.legacy-settings-help,
.legacy-settings-field-error {
    margin-top: 7px;

    font-size: 0.82rem;
}

.legacy-settings-field-error {
    min-height: 1.25em;

    color: #a72c43;

    font-weight: 700;
}

body.dark-mode .legacy-settings-field-error {
    color: #ff9caf;
}

.legacy-settings-feedback {
    min-height: 1.5em;

    margin-top: 20px;

    color: var(--primary-dark);

    font-weight: 750;
}

.legacy-settings-reload {
    min-height: 44px;

    margin-top: 8px;
}

.legacy-settings-reload[hidden] {
    display: none;
}

.legacy-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 18px;
}

.legacy-settings-actions .primary-button,
.legacy-settings-actions .secondary-button {
    min-height: 48px;
}

@media (max-width: 600px) {
    .legacy-overview-hero-actions {
        align-items: flex-start;
    }

    .legacy-settings-section {
        align-items: start;

        padding: 104px 14px 34px;
    }

    .legacy-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .legacy-settings-actions .primary-button,
    .legacy-settings-actions .secondary-button {
        width: 100%;
    }
}

.legacy-overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;

    margin-bottom: 22px;
}

.legacy-overview-stat {
    min-height: 142px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 23px;

    border-radius: 24px;
}

.legacy-overview-stat strong {
    color: var(--primary-dark);

    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.legacy-overview-stat span {
    color: var(--text-soft);

    font-size: 0.88rem;
    font-weight: 750;
}

.legacy-overview-empty-note {
    margin-bottom: 22px;
    padding: 18px 21px;

    border-radius: 20px;

    color: var(--text-soft);

    line-height: 1.55;
}

.legacy-progress-section {
    margin: 36px 0 22px;
}

.legacy-progress-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 18px;
}

.legacy-progress-heading h2 {
    color: var(--primary-dark);

    font-size: clamp(1.7rem, 4vw, 2.35rem);
    letter-spacing: -0.025em;
}

.legacy-progress-heading > p {
    max-width: 480px;

    color: var(--text-soft);

    font-size: 0.9rem;
    line-height: 1.55;
}

.legacy-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.legacy-progress-card {
    min-width: 0;

    padding: 23px;

    border-radius: 26px;
}

.legacy-progress-card-heading {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 24px;
}

.legacy-progress-card-icon {
    width: 45px;
    height: 45px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 15px;

    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.1);

    font-size: 1.1rem;
}

.legacy-progress-card-heading .eyebrow {
    margin-bottom: 3px;

    font-size: 0.65rem;
}

.legacy-progress-card h3 {
    color: var(--text-main);

    font-size: 1.08rem;
}

.legacy-progress-copy {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;
}

.legacy-progress-copy strong {
    color: var(--primary-dark);

    font-size: clamp(2rem, 5vw, 2.7rem);
    line-height: 1;
}

.legacy-progress-copy span {
    max-width: 125px;

    color: var(--text-soft);

    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
}

.legacy-progress-track {
    height: 9px;

    margin-bottom: 17px;

    border-radius: 999px;

    background: rgba(126, 50, 83, 0.1);
    overflow: hidden;
}

.legacy-progress-track > span {
    height: 100%;

    display: block;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            #e98c72
        );

    transition: width 0.55s ease;
}

.legacy-progress-memory
    .legacy-progress-track > span {
    background:
        linear-gradient(
            90deg,
            #c83f74,
            #df819e
        );
}

.legacy-progress-extraction
    .legacy-progress-track > span {
    background:
        linear-gradient(
            90deg,
            #b46f43,
            #e6a86f
        );
}

.legacy-story-categories {
    margin-top: 30px;
}

.legacy-story-categories-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 16px;
}

.legacy-story-categories-heading h3 {
    color: var(--primary-dark);

    font-size: clamp(1.3rem, 3vw, 1.65rem);
}

.legacy-story-categories-heading > p {
    max-width: 430px;

    color: var(--text-soft);

    font-size: 0.86rem;
    line-height: 1.5;
}

.legacy-story-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.legacy-story-categories-grid[hidden],
.legacy-story-categories-empty[hidden] {
    display: none;
}

.legacy-story-category-card {
    min-width: 0;

    padding: 20px 22px;

    border-radius: 22px;
}

.legacy-story-category-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.legacy-story-category-heading h4 {
    color: var(--text-main);

    font-size: 1rem;
}

.legacy-story-category-heading strong {
    color: var(--primary-dark);

    font-size: 1.05rem;
}

.legacy-story-category-track {
    margin: 12px 0 10px;
}

.legacy-story-category-card > p,
.legacy-story-categories-empty {
    color: var(--text-soft);

    font-size: 0.82rem;
}

.legacy-story-categories-empty {
    padding: 20px 22px;

    border-radius: 22px;
}

.legacy-progress-state-list > div {
    padding: 8px 1px;
}

.legacy-progress-state-list span {
    font-size: 0.82rem;
}

.legacy-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    margin-bottom: 18px;
}

.legacy-health-panel,
.legacy-activity-panel {
    padding: 25px;

    border-radius: 26px;
}

.legacy-health-list {
    display: grid;
    gap: 12px;
}

.legacy-health-list > div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 15px;

    padding: 11px 13px;

    border-radius: 14px;

    background: rgba(200, 63, 116, 0.07);
}

.legacy-health-list strong {
    color: var(--primary-dark);

    font-size: 0.86rem;
}

.legacy-health-list span {
    color: var(--text-soft);

    font-size: 0.86rem;
    line-height: 1.4;
}

.legacy-activity-panel > p {
    margin: -5px 0 14px;

    color: var(--text-soft);

    font-size: 0.9rem;
}

.legacy-activity-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.legacy-activity-list li {
    padding: 12px 14px;

    border: 1px solid rgba(126, 50, 83, 0.1);
    border-radius: 14px;

    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.2);

    font-size: 0.9rem;
}

.legacy-activity-list strong {
    color: var(--primary-dark);

    font-size: 1.05rem;
}

.legacy-overview-dates {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legacy-overview-dates time {
    color: var(--text-soft);

    font-size: 0.78rem;
    font-weight: 650;
}

.legacy-overview-dates time::before {
    content: "·";

    margin-right: 8px;
}

.legacy-overview-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.legacy-overview-panel {
    padding: 25px;

    border-radius: 26px;
}

.legacy-overview-detail-grid
    .legacy-overview-panel:only-child {
    grid-column: 1 / -1;
}

.legacy-overview-panel-heading {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 20px;
}

.legacy-overview-panel-heading > span {
    width: 45px;
    height: 45px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 15px;

    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.1);

    font-size: 1.1rem;
}

.legacy-overview-panel-heading .eyebrow {
    margin-bottom: 3px;

    font-size: 0.68rem;
}

.legacy-overview-panel h2 {
    color: var(--text-main);

    font-size: 1.25rem;
}

.legacy-state-list {
    display: grid;
    gap: 3px;
}

.legacy-state-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 11px 2px;

    border-bottom: 1px solid rgba(126, 50, 83, 0.1);
}

.legacy-state-list > div:last-child {
    border-bottom: 0;
}

.legacy-state-list span {
    color: var(--text-soft);

    font-size: 0.9rem;
    font-weight: 700;
}

.legacy-state-list strong {
    min-width: 34px;

    color: var(--primary-dark);

    font-size: 1rem;
    text-align: right;
}

body.dark-mode .legacy-overview-approved {
    background: rgba(35, 24, 35, 0.58);
}

body.dark-mode .legacy-overview-approved.has-approved {
    color: #a8d5aa;
    background: rgba(83, 139, 88, 0.16);
}

body.dark-mode .legacy-health-list > div,
body.dark-mode .legacy-activity-list li {
    background: rgba(35, 24, 35, 0.42);
}

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

@media (max-width: 760px) {
    .legacy-overview-section {
        padding: 112px 14px 34px;
    }

    .legacy-overview-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .legacy-overview-approved {
        align-self: flex-start;
    }

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

    .legacy-overview-detail-grid {
        grid-template-columns: 1fr;
    }

    .legacy-progress-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

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

    .legacy-progress-extraction {
        grid-column: 1 / -1;
    }

    .legacy-story-categories-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .legacy-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .legacy-overview-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .legacy-overview-dates {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .legacy-overview-dates time::before {
        display: none;
    }

    .legacy-overview-meta > * + *::before {
        display: none;
    }

    .legacy-overview-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .legacy-overview-stat {
        min-height: 112px;
    }

    .legacy-overview-state-actions {
        width: 100%;

        align-items: stretch;
        flex-direction: column;
    }

    .legacy-overview-state-actions > * {
        width: 100%;
    }

    .legacy-progress-grid {
        grid-template-columns: 1fr;
    }

    .legacy-progress-extraction {
        grid-column: auto;
    }

    .legacy-story-categories-grid {
        grid-template-columns: 1fr;
    }

    .legacy-health-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legacy-overview-shell,
    .legacy-overview-spinner {
        animation: none;
    }

    .legacy-progress-track > span {
        transition: none;
    }
}

/* ------------------------------
   Begin a Legacy
------------------------------ */

.legacy-page {
    min-height: 100vh;
}

.legacy-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    display: flex;
    justify-content: center;

    padding: 122px 20px 48px;
}

.legacy-shell {
    width: min(100%, 940px);

    display: flex;
    flex-direction: column;
    gap: 24px;

    animation: sectionAppear 0.65s ease;
}

.legacy-welcome {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
}

.legacy-berry-avatar {
    position: relative;
    z-index: 3;

    width: 220px;
    max-height: 245px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 20px 35px
            rgba(255, 105, 180, 0.24)
        );

    transform: translateX(14px);

    animation: smallMascotFloat 4.5s ease-in-out infinite;
}

.legacy-welcome-message {
    min-height: 220px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 30px 34px 30px 58px;

    border-radius: 30px;
}

.legacy-welcome-message h1 {
    margin-bottom: 12px;

    color: var(--primary-dark);

    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.legacy-welcome-message > p:not(.eyebrow) {
    max-width: 620px;

    color: var(--text-soft);

    font-size: 1.02rem;
    line-height: 1.65;
}

.legacy-welcome-message .legacy-welcome-closing {
    margin-top: 8px;

    color: var(--primary-dark);

    font-weight: 800;
}

.legacy-form {
    padding: 34px;

    border-radius: 30px;
}

.legacy-step {
    min-width: 0;

    border: 0;
}

.legacy-step legend,
.legacy-name-step h2 {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 22px;

    color: var(--text-main);

    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
    line-height: 1.35;
}

.legacy-step-number {
    width: 34px;
    height: 34px;

    display: inline-grid;
    flex: 0 0 34px;
    place-items: center;

    border-radius: 12px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #e7588b
        );

    box-shadow:
        0 8px 18px
        rgba(200, 63, 116, 0.24);

    font-size: 0.9rem;
}

.relationship-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.relationship-option {
    position: relative;

    min-width: 0;
}

.relationship-option input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.relationship-option span {
    min-height: 74px;

    display: grid;
    place-items: center;

    padding: 14px 10px;

    border:
        1px solid
        var(--glass-border);
    border-radius: 18px;

    color: var(--text-main);
    background:
        rgba(255, 255, 255, 0.2);

    font-size: 0.94rem;
    font-weight: 750;
    text-align: center;

    cursor: pointer;

    transition:
        color 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.relationship-option:hover span {
    border-color:
        rgba(200, 63, 116, 0.28);
    background:
        rgba(255, 255, 255, 0.34);

    transform: translateY(-3px);
}

.relationship-option input:focus-visible + span {
    outline:
        3px solid
        rgba(200, 63, 116, 0.22);
    outline-offset: 3px;
}

.relationship-option input:checked + span {
    border-color:
        rgba(200, 63, 116, 0.52);

    color: var(--primary-dark);
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 226, 0.72),
            rgba(255, 235, 208, 0.58)
        );

    box-shadow:
        0 12px 25px
        rgba(200, 63, 116, 0.16);

    transform: translateY(-3px);
}

.legacy-name-step {
    margin-top: 30px;
    padding-top: 28px;

    border-top:
        1px solid
        rgba(200, 63, 116, 0.14);

    opacity: 0;
    transform: translateY(14px);

    transition:
        opacity 0.42s ease,
        transform 0.42s ease;
}

.legacy-name-step-visible {
    opacity: 1;
    transform: translateY(0);
}

.legacy-name-label {
    display: block;

    margin-bottom: 8px;

    color: var(--text-soft);

    font-size: 0.82rem;
    font-weight: 800;
}

.legacy-name-input {
    width: 100%;

    padding: 15px 18px;

    border:
        1px solid
        rgba(90, 60, 75, 0.14);
    border-radius: 16px;
    outline: none;

    color: var(--text-main);
    background: var(--input-background);

    font: inherit;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.legacy-name-input::placeholder {
    color: var(--text-soft);
    opacity: 0.72;
}

.legacy-name-input:focus {
    border-color:
        rgba(200, 63, 116, 0.42);
    box-shadow:
        0 0 0 4px
        rgba(200, 63, 116, 0.1);
}

.legacy-preview {
    margin-top: 13px;
    padding: 13px 16px;

    border:
        1px solid
        rgba(200, 63, 116, 0.14);
    border-radius: 14px;

    color: var(--primary-dark);
    background:
        rgba(255, 255, 255, 0.16);

    font-size: 0.94rem;
    font-weight: 700;
}

.legacy-continue {
    display: flex;

    margin: 30px 0 0 auto;
}

.legacy-continue:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.legacy-continue:disabled:hover {
    transform: none;
    box-shadow:
        0 13px 28px
        rgba(200, 63, 116, 0.28);
}

.legacy-placeholder-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 118px 20px 38px;
}

.legacy-placeholder-card {
    width: min(100%, 620px);

    padding: 38px;

    border-radius: 30px;

    animation:
        heroCardEntrance 0.7s ease;
}

.legacy-placeholder-card h1 {
    margin-bottom: 26px;

    color: var(--primary-dark);

    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.legacy-summary {
    display: grid;
    gap: 12px;
}

.legacy-summary > div {
    padding: 18px;

    border:
        1px solid
        var(--glass-border);
    border-radius: 17px;

    background:
        rgba(255, 255, 255, 0.18);
}

.legacy-summary dt {
    margin-bottom: 5px;

    color: var(--text-soft);

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legacy-summary dd {
    color: var(--text-main);

    font-size: 1.15rem;
    font-weight: 800;
}

.legacy-placeholder-note {
    margin: 20px 0;

    color: var(--text-soft);

    line-height: 1.55;
}

.legacy-back-button,
.legacy-back-button:visited,
.legacy-back-button:hover,
.legacy-back-button:focus,
.legacy-back-button:active {
    text-decoration: none;
}

@media (max-width: 760px) {
    .legacy-section {
        padding:
            112px
            14px
            30px;
    }

    .legacy-welcome {
        grid-template-columns: 1fr;

        text-align: center;
    }

    .legacy-berry-avatar {
        width: 180px;

        margin: 0 auto -34px;

        transform: none;
    }

    .legacy-welcome-message {
        min-height: 0;
        padding: 48px 24px 26px;
    }

    .legacy-form {
        padding: 25px;
    }

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

@media (max-width: 440px) {
    .legacy-step legend,
    .legacy-name-step h2 {
        align-items: flex-start;

        font-size: 1.15rem;
    }

    .relationship-option span {
        min-height: 64px;

        font-size: 0.88rem;
    }

    .legacy-placeholder-card {
        padding: 27px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legacy-shell,
    .legacy-berry-avatar,
    .legacy-placeholder-card {
        animation: none;
    }

    .legacy-name-step {
        transition: none;
    }
}

/* ------------------------------
   Companion transition
------------------------------ */

.companion-transition-page {
    min-height: 100vh;
}

.companion-transition-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 28px 20px;
}

.companion-transition-shell {
    width: min(100%, 720px);

    display: flex;
    flex-direction: column;
    align-items: center;
}

.companion-transition-mascot {
    position: relative;
    z-index: 3;

    width: clamp(190px, 28vw, 255px);
    max-height: 270px;

    margin-bottom: -72px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 24px 42px
            rgba(255, 105, 180, 0.28)
        );

    animation:
        smallMascotFloat
        4.5s
        ease-in-out
        infinite;
}

.companion-transition-card {
    position: relative;

    width: 100%;
    min-height: 510px;

    padding: 106px 48px 40px;
    overflow: hidden;

    border-radius: 34px;

    text-align: center;

    animation:
        heroCardEntrance
        0.75s
        ease;
}

.companion-transition-copy {
    position: relative;
    z-index: 2;
}

.companion-transition-copy h1 {
    margin-bottom: 14px;

    color: var(--primary-dark);

    font-size: clamp(2.3rem, 6vw, 4rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.companion-transition-message {
    min-height: 3em;
    max-width: 540px;

    margin: 0 auto;

    color: var(--text-soft);

    font-size: clamp(1rem, 2.4vw, 1.18rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.companion-progress {
    position: relative;
    z-index: 2;

    width: min(100%, 410px);

    display: grid;
    gap: 11px;

    margin: 28px auto 0;

    list-style: none;
    text-align: left;
}

.companion-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 14px;

    border:
        1px solid
        transparent;
    border-radius: 14px;

    color: var(--text-soft);
    background: transparent;

    font-size: 0.94rem;
    font-weight: 750;

    opacity: 0;
    transform: translateY(10px);

    transition:
        opacity 0.42s ease,
        transform 0.42s ease,
        border-color 0.42s ease,
        background 0.42s ease;
}

.companion-progress-item-visible {
    border-color:
        rgba(200, 63, 116, 0.13);
    background:
        rgba(255, 255, 255, 0.16);

    opacity: 1;
    transform: translateY(0);
}

.companion-progress-check {
    width: 26px;
    height: 26px;

    display: grid;
    flex: 0 0 26px;
    place-items: center;

    border-radius: 9px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #e98c72
        );

    box-shadow:
        0 6px 14px
        rgba(200, 63, 116, 0.2);

    font-size: 0.77rem;
    font-weight: 900;
}

@media (max-width: 600px) {
    .companion-transition-section {
        align-items: center;

        padding: 20px 14px;
    }

    .companion-transition-mascot {
        width: 180px;

        margin-bottom: -54px;
    }

    .companion-transition-card {
        min-height: 500px;

        padding: 82px 22px 28px;

        border-radius: 28px;
    }

    .companion-progress {
        margin-top: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .companion-transition-card,
    .companion-transition-mascot {
        animation: none;
    }

    .companion-progress-item {
        transition: none;
    }
}

/* ------------------------------
   Companion home
------------------------------ */

.companion-home-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 166px 22px 52px;
}

.companion-home-shell {
    position: relative;

    width: min(100%, 1080px);
    margin: 0 auto;
    animation: sectionAppear 0.65s ease;
}

.companion-home-welcome {
    display: block;
    margin-bottom: 12px;
    padding: 0;
    text-align: center;
}

.companion-home-welcome h1 {
    margin-bottom: 0;
    color: var(--primary-dark);
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.companion-home-question {
    color: var(--primary-dark);
    font-size: clamp(2.2rem, 5vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.companion-feature-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.companion-feature-card,
.companion-feature-card:visited {
    position: relative;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
    overflow: hidden;
    border-radius: 28px;
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
    animation:
        experienceCardEntrance
        0.58s
        ease
        both;
    transition:
        transform 0.28s ease,
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow 0.28s ease;
}

.companion-feature-card:nth-child(2) {
    animation-delay: 0.07s;
}

.companion-feature-card:hover {
    transform: translateY(-7px);
    box-shadow:
        0 30px 70px rgba(126, 50, 83, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.companion-feature-card:focus-visible {
    outline: 3px solid rgba(200, 63, 116, 0.28);
    outline-offset: 4px;
}

.companion-feature-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 38px;
    border: 1px solid rgba(200, 63, 116, 0.18);
    border-radius: 19px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.72),
            rgba(255, 159, 189, 0.62)
        );
    box-shadow:
        0 12px 24px rgba(200, 63, 116, 0.13);
    font-size: 1.45rem;
}

.companion-feature-copy {
    display: grid;
    gap: 12px;
}

.companion-feature-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--primary-dark);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.companion-feature-copy strong {
    color: var(--primary-dark);
    font-size: 1.55rem;
    letter-spacing: -0.025em;
}

.companion-feature-copy > span {
    color: var(--text-soft);
    line-height: 1.58;
}

.companion-feature-arrow {
    margin-top: auto;
    padding-top: 26px;
    color: var(--primary);
    font-size: 1.3rem;
    transition: transform 0.22s ease;
}

.companion-feature-card:hover
    .companion-feature-arrow {
    transform: translateX(4px);
}

.companion-home-settings {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
}

.companion-settings-trigger {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-soft);
    background: var(--glass-background);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 10px 25px rgba(80, 30, 55, 0.1);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    transition:
        color 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.companion-settings-trigger:hover,
.companion-settings-trigger[
    aria-expanded="true"
] {
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow:
        0 14px 30px rgba(126, 50, 83, 0.16);
}

.companion-settings-trigger:focus-visible {
    outline: 3px solid rgba(200, 63, 116, 0.25);
    outline-offset: 3px;
}

.companion-settings-menu {
    top: calc(100% + 9px);
}

.companion-placeholder-dialog {
    width: min(92vw, 470px);
    padding: 0;
    border: 0;
    color: var(--text-main);
    background: transparent;
    overflow: visible;
    animation:
        legacyDialogEntrance 0.28s ease both;
}

.companion-placeholder-dialog::backdrop {
    background: rgba(47, 23, 34, 0.42);
    backdrop-filter: blur(7px);
    animation:
        legacyBackdropEntrance 0.25s ease both;
}

.companion-placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 30px 30px;
    border-radius: 28px;
    text-align: center;
}

.companion-placeholder-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border: 1px solid rgba(200, 63, 116, 0.18);
    border-radius: 17px;
    color: var(--primary);
    background: rgba(200, 63, 116, 0.09);
}

.companion-placeholder-card h2 {
    max-width: 360px;
    margin-bottom: 26px;
    color: var(--primary-dark);
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    line-height: 1.25;
}

@media (max-width: 860px) {
    .companion-feature-grid {
        grid-template-columns: 1fr;
    }

    .companion-feature-card {
        min-height: 220px;
    }

    .companion-feature-icon {
        margin-bottom: 24px;
    }
}

@media (max-width: 600px) {
    .companion-home-section {
        padding: 154px 14px 32px;
    }

    .companion-home-welcome {
        margin-bottom: 24px;
        padding-top: 2px;
    }

    .companion-home-welcome h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .companion-feature-card {
        min-height: 210px;
        padding: 24px;
    }

    .companion-placeholder-card {
        padding: 30px 20px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .companion-home-shell,
    .companion-feature-card,
    .companion-placeholder-dialog,
    .companion-placeholder-dialog::backdrop {
        animation: none;
    }
}

/* ------------------------------
   Voice and presence preview
------------------------------ */

.voice-presence-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 166px 22px 52px;
}

.voice-presence-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    animation: sectionAppear 0.6s ease both;
}

.voice-presence-header {
    max-width: 760px;
    margin-bottom: 34px;
}

.coming-soon-badge,
.voice-card-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(200, 63, 116, 0.18);
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.09);
    font-weight: 850;
}

.coming-soon-badge {
    margin-bottom: 16px;
    padding: 7px 11px;
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.voice-presence-header h1 {
    margin-bottom: 14px;
    color: var(--primary-dark);
    font-size: clamp(2.5rem, 7vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.voice-presence-header p {
    color: var(--text-soft);
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    line-height: 1.65;
}

.voice-preview-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.voice-preview-card {
    position: relative;
    min-height: 275px;
    padding: 25px;
    overflow: hidden;
    border-radius: 26px;
    cursor: not-allowed;
    opacity: 0.78;
    filter: saturate(0.78);
    animation:
        experienceCardEntrance
        0.5s
        ease
        both;
    transition:
        opacity 0.24s ease,
        transform 0.24s ease,
        box-shadow 0.24s ease;
}

.voice-preview-card:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow:
        0 20px 45px rgba(126, 50, 83, 0.14);
}

.voice-preview-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 27px;
    border: 1px solid rgba(200, 63, 116, 0.15);
    border-radius: 18px;
    color: var(--primary-dark);
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.46),
            rgba(255, 159, 189, 0.4)
        );
    font-size: 1.35rem;
}

.voice-card-badge {
    position: absolute;
    top: 24px;
    right: 22px;
    padding: 5px 8px;
    font-size: 0.65rem;
}

.voice-preview-card h2 {
    margin-bottom: 11px;
    color: var(--primary-dark);
    font-size: 1.32rem;
    letter-spacing: -0.02em;
}

.voice-preview-card p {
    color: var(--text-soft);
    line-height: 1.58;
}

.voice-consent-notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: 20px;
    color: var(--text-soft);
}

.voice-consent-notice > span {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 1.1rem;
}

.voice-consent-notice p {
    max-width: 900px;
    font-size: 0.82rem;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .voice-preview-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .voice-presence-section {
        padding: 154px 14px 34px;
    }

    .voice-presence-header {
        margin-bottom: 25px;
    }

    .voice-preview-grid {
        grid-template-columns: 1fr;
    }

    .voice-preview-card {
        min-height: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .voice-presence-shell,
    .voice-preview-card {
        animation: none;
    }
}

/* ------------------------------
   Legacy studio
------------------------------ */

.legacy-studio-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 166px 22px 52px;
}

.legacy-studio-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    animation: sectionAppear 0.58s ease both;
}

.legacy-studio-header {
    max-width: 800px;
    margin-bottom: 32px;
}

.legacy-studio-header h1 {
    margin-bottom: 14px;
    color: var(--primary-dark);
    font-size: clamp(2.5rem, 7vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.legacy-studio-header > p:last-child {
    color: var(--text-soft);
    font-size: clamp(1rem, 2.2vw, 1.18rem);
    line-height: 1.65;
}

.legacy-studio-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.legacy-studio-card,
.legacy-studio-card:visited {
    position: relative;
    min-height: 285px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
    overflow: hidden;
    border-radius: 27px;
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
    animation:
        experienceCardEntrance
        0.52s
        ease
        both;
    transition:
        transform 0.27s ease,
        box-shadow 0.27s ease,
        opacity 0.27s ease;
}

.legacy-studio-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 27px 62px rgba(126, 50, 83, 0.2);
}

.legacy-studio-card:focus-visible {
    outline: 3px solid rgba(200, 63, 116, 0.26);
    outline-offset: 3px;
}

.legacy-studio-icon {
    width: 57px;
    height: 57px;
    display: grid;
    place-items: center;
    margin-bottom: 31px;
    border: 1px solid rgba(200, 63, 116, 0.17);
    border-radius: 19px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.68),
            rgba(255, 159, 189, 0.56)
        );
    font-size: 1.4rem;
}

.legacy-studio-card-copy {
    display: grid;
    gap: 11px;
}

.legacy-studio-card-copy strong {
    color: var(--primary-dark);
    font-size: 1.42rem;
    letter-spacing: -0.025em;
}

.legacy-studio-card-copy > span {
    color: var(--text-soft);
    line-height: 1.58;
}

.legacy-studio-arrow {
    margin-top: auto;
    padding-top: 24px;
    color: var(--primary);
    font-size: 1.25rem;
    transition: transform 0.22s ease;
}

.legacy-studio-card:hover
    .legacy-studio-arrow {
    transform: translateX(4px);
}

.legacy-studio-badge {
    position: absolute;
    top: 25px;
    right: 22px;
    padding: 6px 9px;
    border: 1px solid rgba(200, 63, 116, 0.18);
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.09);
    font-size: 0.65rem;
    font-weight: 850;
}

.legacy-studio-card-coming {
    opacity: 0.72;
    filter: saturate(0.72);
}

.legacy-studio-card-coming:hover {
    opacity: 0.86;
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .legacy-studio-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .legacy-studio-section {
        padding: 154px 14px 34px;
    }

    .legacy-studio-grid {
        grid-template-columns: 1fr;
    }

    .legacy-studio-card {
        min-height: 235px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legacy-studio-shell,
    .legacy-studio-card {
        animation: none;
    }
}

/* ------------------------------
   Guided stories
------------------------------ */

.guided-stories-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 166px 22px 52px;
}

.guided-stories-shell {
    width: min(100%, 1040px);
    margin: 0 auto;
}

.guided-screen[hidden] {
    display: none !important;
}

.guided-screen {
    animation: sectionAppear 0.5s ease both;
}

.guided-welcome {
    min-height: calc(100vh - 218px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.guided-berry-avatar {
    position: relative;
    z-index: 3;
    width: clamp(180px, 25vw, 235px);
    max-height: 250px;
    margin-bottom: -62px;
    object-fit: contain;
    filter:
        drop-shadow(
            0 22px 38px
            rgba(255, 105, 180, 0.26)
        );
    animation:
        smallMascotFloat
        4.5s
        ease-in-out
        infinite;
}

.guided-welcome-card {
    width: min(100%, 680px);
    padding: 92px 46px 38px;
    border-radius: 32px;
    text-align: center;
}

.guided-welcome-card h1,
.guided-chapters-header h1,
.guided-chapter-panel h1 {
    color: var(--primary-dark);
    letter-spacing: -0.04em;
}

.guided-welcome-card h1 {
    margin-bottom: 18px;
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    line-height: 1.08;
}

.guided-welcome-card > p:not(
    .eyebrow,
    .guided-pause-note
) {
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.55;
}

.guided-primary-action {
    margin: 26px auto 0;
}

.guided-pause-note {
    margin-top: 20px;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.55;
}

.guided-chapters-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.guided-chapters-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2.3rem, 6vw, 4rem);
}

.guided-chapters-header > div > p:last-child {
    color: var(--text-soft);
}

.guided-overall-progress {
    flex: 0 0 auto;
    padding: 12px 17px;
    border-radius: 16px;
    color: var(--primary-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.guided-chapter-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.guided-chapter-card,
.guided-chapter-card:visited,
.guided-chapter-card:hover,
.guided-chapter-card:focus,
.guided-chapter-card:active {
    min-height: 150px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border-radius: 24px;
    cursor: pointer;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    text-decoration: none;
    border-bottom: 0;
    outline: none;
    animation:
        experienceCardEntrance
        0.48s
        ease
        both;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.guided-chapter-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 24px 55px
        rgba(126, 50, 83, 0.18);
}

.guided-chapter-card:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(200, 63, 116, 0.22),
        0 24px 55px rgba(126, 50, 83, 0.18);
}

.guided-chapter-card-icon,
.guided-chapter-icon {
    display: grid;
    place-items: center;
    border: 1px solid rgba(200, 63, 116, 0.17);
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.7),
            rgba(255, 159, 189, 0.58)
        );
}

.guided-chapter-card-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 19px;
    font-size: 1.45rem;
}

.guided-chapter-card-copy {
    display: grid;
    gap: 12px;
}

.guided-chapter-card-copy strong {
    color: var(--primary-dark);
    font-size: 1.14rem;
    text-decoration: none;
    border-bottom: 0;
}

.guided-chapter-status {
    width: fit-content;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--text-soft);
    background: rgba(118, 86, 101, 0.08);
    font-size: 0.72rem;
    font-weight: 800;
}

.guided-chapter-card[
    data-status="in-progress"
] .guided-chapter-status {
    color: #9a5c1e;
    background: rgba(233, 153, 72, 0.14);
}

.guided-chapter-card[
    data-status="completed"
] .guided-chapter-status {
    color: #38715d;
    background: rgba(70, 147, 117, 0.14);
}

.guided-chapter-panel {
    width: min(100%, 780px);
    margin: 0 auto;
    padding: 36px 42px 40px;
    border-radius: 32px;
}

.guided-inline-back,
.guided-text-button {
    border: 0;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.guided-inline-back {
    margin-bottom: 28px;
}

.guided-inline-back:hover {
    color: var(--primary-dark);
    transform: translateX(-2px);
}

.guided-chapter-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
    border-radius: 20px;
    font-size: 1.55rem;
}

.guided-chapter-panel h1 {
    margin-bottom: 10px;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.guided-chapter-introduction {
    margin-bottom: 28px;
    color: var(--text-soft);
    font-size: 1.04rem;
    line-height: 1.55;
}

.guided-prompt-label {
    display: block;
    margin-bottom: 9px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.guided-story-prompt {
    margin-bottom: 18px;
    color: var(--text-main);
    font-size: clamp(1.15rem, 2.5vw, 1.42rem);
    font-weight: 750;
    line-height: 1.45;
}

.guided-story-text {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    padding: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    outline: none;
    color: var(--text-main);
    background: var(--input-background);
    font: inherit;
    font-size: 1rem;
    line-height: 1.6;
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background var(--transition-speed) ease;
}

.guided-story-text:focus {
    border-color: rgba(200, 63, 116, 0.48);
    box-shadow:
        0 0 0 4px rgba(200, 63, 116, 0.1);
}

.guided-story-text::placeholder {
    color: var(--text-soft);
    opacity: 0.72;
}

.guided-chapter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.guided-chapter-actions
    .primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.guided-text-button {
    margin-left: auto;
}

.guided-text-button:hover {
    color: var(--primary-dark);
}

@media (max-width: 700px) {
    .guided-stories-section {
        padding: 154px 14px 34px;
    }

    .guided-welcome {
        min-height: calc(100vh - 188px);
    }

    .guided-welcome-card {
        padding: 82px 22px 30px;
    }

    .guided-chapters-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .guided-chapter-grid {
        grid-template-columns: 1fr;
    }

    .guided-chapter-panel {
        padding: 26px 20px 28px;
    }

    .guided-chapter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .guided-chapter-actions
        .primary-button,
    .guided-chapter-actions
        .secondary-button {
        width: 100%;
        max-width: none;
    }

    .guided-text-button {
        margin: 5px auto 0;
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guided-screen,
    .guided-berry-avatar,
    .guided-chapter-card {
        animation: none;
    }
}

/* ------------------------------
   Story session
------------------------------ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.story-session-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 154px 20px 34px;
}

.story-session-shell {
    width: min(100%, 850px);
    height: min(720px, calc(100vh - 188px));
    min-height: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 30px;
    animation: sectionAppear 0.55s ease both;
}

.story-session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--glass-border);
}

.story-session-header h1 {
    color: var(--primary-dark);
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    letter-spacing: -0.03em;
}

.story-session-progress {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-soft);
    background: rgba(200, 63, 116, 0.09);
    font-size: 0.75rem;
    font-weight: 800;
}

.story-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color:
        rgba(200, 63, 116, 0.35)
        transparent;
}

.story-conversation .message {
    white-space: pre-wrap;
}

.story-message-speaker,
.story-prompt-label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 850;
}

.story-prompt-label {
    margin-top: 3px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.story-composer {
    display: grid;
    gap: 12px;
    padding: 16px 20px 18px;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
}

.story-composer[hidden] {
    display: none !important;
}

.story-composer textarea {
    width: 100%;
    min-height: 92px;
    max-height: 210px;
    resize: vertical;
    padding: 15px 17px;
    border: 1px solid transparent;
    border-radius: 18px;
    outline: none;
    color: var(--text-main);
    background: var(--input-background);
    font: inherit;
    line-height: 1.55;
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.story-composer textarea:focus {
    border-color: rgba(200, 63, 116, 0.42);
    box-shadow:
        0 0 0 4px rgba(200, 63, 116, 0.09);
}

.story-composer textarea::placeholder {
    color: var(--text-soft);
}

.story-composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.story-composer-actions
    .primary-button,
.story-composer-actions
    .secondary-button {
    min-width: 130px;
}

.story-composer-actions
    .primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.guided-return-note {
    width: fit-content;
    margin: 0 0 22px;
    padding: 11px 16px;
    border-radius: 15px;
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 750;
    animation: legacyEmptyEntrance 0.4s ease both;
}

@media (max-width: 650px) {
    .story-session-section {
        display: block;
        padding: 150px 12px 18px;
    }

    .story-session-shell {
        height: calc(100vh - 168px);
        min-height: 540px;
        border-radius: 24px;
    }

    .story-session-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 18px;
    }

    .story-conversation {
        padding: 18px 14px;
    }

    .story-conversation .message {
        max-width: 86%;
    }

    .story-composer {
        padding: 13px;
    }

    .story-composer-actions {
        flex-direction: row;
    }

    .story-composer-actions
        .primary-button,
    .story-composer-actions
        .secondary-button {
        width: 50%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-session-shell,
    .guided-return-note {
        animation: none;
    }

    .story-conversation {
        scroll-behavior: auto;
    }
}

/* ------------------------------
   Legacy Dashboard
------------------------------ */

.legacy-dashboard-page {
    min-height: 100vh;
}

.legacy-dashboard-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    padding: 126px 22px 48px;
}

.legacy-dashboard-shell {
    width: min(100%, 1080px);

    margin: 0 auto;

    animation: sectionAppear 0.65s ease;
}

.legacy-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;

    margin-bottom: 28px;
}

.legacy-dashboard-header h1 {
    margin-bottom: 12px;

    color: var(--primary-dark);

    font-size: clamp(2.7rem, 6vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.legacy-dashboard-header > div > p:last-child {
    max-width: 650px;

    color: var(--text-soft);

    font-size: 1.08rem;
    line-height: 1.6;
}

.legacy-dashboard-primary,
.legacy-dashboard-primary:visited,
.legacy-dashboard-primary:hover,
.legacy-dashboard-primary:focus,
.legacy-dashboard-primary:active {
    flex: 0 0 auto;

    text-decoration: none;
}

.legacy-begin-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;

    margin-bottom: 42px;
    padding: 24px 26px;

    border-radius: 25px;

    color: var(--text-main);
    text-decoration: none;

    transition:
        transform 0.3s ease,
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow 0.3s ease;
}

.legacy-begin-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 30px 72px rgba(126, 50, 83, 0.23),
        inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.legacy-begin-icon,
.legacy-empty-icon {
    width: 56px;
    height: 56px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    color: var(--primary-dark);
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.78),
            rgba(255, 159, 189, 0.7)
        );

    box-shadow:
        0 10px 24px rgba(200, 63, 116, 0.17);

    font-size: 1.25rem;
}

.legacy-begin-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legacy-begin-copy strong {
    color: var(--primary-dark);

    font-size: 1.22rem;
}

.legacy-begin-copy > span {
    color: var(--text-soft);

    line-height: 1.5;
}

.legacy-begin-arrow {
    color: var(--primary);

    font-size: 1.55rem;

    transition: transform 0.3s ease;
}

.legacy-begin-card:hover .legacy-begin-arrow {
    transform: translateX(6px);
}

.legacy-collection-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.legacy-collection-heading h2 {
    color: var(--text-main);

    font-size: 1.45rem;
}

.legacy-management-tabs {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 18px;
    padding: 5px;
    border: 1px solid rgba(200, 63, 116, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
}

.legacy-management-tab {
    padding: 9px 19px;
    border: 0;
    border-radius: 999px;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
}

.legacy-management-tab[aria-selected="true"] {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #dc7969);
    box-shadow: 0 8px 20px rgba(200, 63, 116, 0.2);
}

.legacy-management-tab:focus-visible {
    outline: 3px solid rgba(200, 63, 116, 0.28);
    outline-offset: 2px;
}

.legacy-management-feedback {
    min-height: 24px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.legacy-management-feedback.is-error {
    color: #9b3246;
}

.legacy-management-state {
    padding: 25px;
    border-radius: 20px;
    color: var(--text-soft);
    text-align: center;
}

.legacy-management-state[hidden] {
    display: none;
}

.legacy-count {
    color: var(--text-soft);

    font-size: 0.84rem;
    font-weight: 750;
}

.legacy-card-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.legacy-card-grid[hidden],
.legacy-empty-state[hidden] {
    display: none !important;
}

.legacy-dashboard-card {
    position: relative;

    min-height: 330px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 25px;

    border-radius: 26px;
    cursor: default;

    animation: experienceCardEntrance 0.55s ease both;

    transition:
        transform 0.28s ease,
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow 0.28s ease;
}

.legacy-card-primary {
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.legacy-card-primary:focus-visible {
    outline: 3px solid rgba(200, 63, 116, 0.32);
    outline-offset: 5px;
    border-radius: 18px;
}

.legacy-dashboard-card:focus-visible {
    outline: 3px solid
        rgba(200, 63, 116, 0.32);
    outline-offset: 4px;
}

.legacy-dashboard-card:hover {
    transform: translateY(-7px);

    box-shadow:
        0 30px 70px rgba(126, 50, 83, 0.23),
        inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.legacy-card-menu {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 4;
}

.legacy-menu-trigger {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    padding: 0 0 5px;

    border:
        1px solid
        rgba(200, 63, 116, 0.14);
    border-radius: 13px;

    color: var(--text-soft);
    background:
        rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(14px);

    box-shadow:
        0 8px 22px rgba(126, 50, 83, 0.08);

    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.legacy-menu-trigger:hover,
.legacy-menu-trigger[aria-expanded="true"] {
    color: var(--primary-dark);
    background:
        rgba(255, 255, 255, 0.72);
    border-color:
        rgba(200, 63, 116, 0.24);
    transform: translateY(-1px);
}

.legacy-menu-trigger:focus-visible {
    outline: 3px solid
        rgba(200, 63, 116, 0.25);
    outline-offset: 2px;
}

.legacy-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    width: 178px;

    padding: 7px;

    border:
        1px solid
        rgba(200, 63, 116, 0.18);
    border-radius: 16px;

    background:
        rgba(255, 250, 249, 0.92);
    backdrop-filter: blur(24px);

    box-shadow:
        0 20px 48px rgba(126, 50, 83, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);

    animation:
        legacyMenuEntrance 0.2s ease both;
}

.legacy-menu-popover[hidden] {
    display: none;
}

.legacy-menu-item,
.legacy-menu-item:visited {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 10px 11px;

    border: 0;
    border-radius: 10px;

    color: var(--text-main);
    background: transparent;

    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    text-align: left;
    text-decoration: none;

    transition:
        color 0.18s ease,
        background 0.18s ease;
}

.legacy-menu-item:hover,
.legacy-menu-item:focus-visible {
    color: var(--primary-dark);
    background:
        rgba(200, 63, 116, 0.09);
    outline: none;
}

.legacy-menu-divider {
    height: 1px;

    margin: 6px 7px;

    background:
        rgba(126, 50, 83, 0.12);
}

.legacy-menu-delete {
    color: #a4384b;
}

.legacy-menu-delete:hover,
.legacy-menu-delete:focus-visible {
    color: #8e2639;
    background:
        rgba(176, 51, 70, 0.1);
}

body.dark-mode .legacy-menu-trigger {
    background:
        rgba(35, 24, 35, 0.64);
}

body.dark-mode
    .legacy-menu-trigger:hover,
body.dark-mode
    .legacy-menu-trigger[
        aria-expanded="true"
    ] {
    background:
        rgba(54, 37, 53, 0.9);
}

body.dark-mode .legacy-menu-popover {
    background:
        rgba(35, 24, 35, 0.94);
}

.legacy-card-initial {
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    margin-bottom: 25px;

    border:
        1px solid
        rgba(200, 63, 116, 0.19);
    border-radius: 19px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #e98c72
        );

    box-shadow:
        0 12px 25px rgba(200, 63, 116, 0.22);

    font-size: 1.35rem;
    font-weight: 850;
}

.legacy-dashboard-card-copy {
    margin-bottom: 24px;
}

.legacy-dashboard-card-copy h3 {
    margin-bottom: 7px;

    color: var(--primary-dark);

    font-size: 1.65rem;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.legacy-dashboard-card-copy p {
    margin-bottom: 12px;

    color: var(--text-main);

    font-weight: 750;
}

.legacy-dashboard-card-copy time {
    color: var(--text-soft);

    font-size: 0.8rem;
    font-weight: 650;
}

.legacy-lifecycle-badge {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #31704c;
    background: rgba(74, 158, 104, 0.13);
    font-size: 0.74rem;
    font-weight: 850;
}

.legacy-lifecycle-badge.is-archived {
    color: #765d68;
    background: rgba(118, 93, 104, 0.13);
}

.legacy-card-actions {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;

    margin-top: auto;
}

.legacy-card-actions > .legacy-card-continue,
.legacy-card-actions > .legacy-card-dashboard {
    min-width: 0;
    min-height: 44px;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 16px;
    line-height: 1.2;
    text-align: center;
}

.legacy-card-continue,
.legacy-card-continue:visited,
.legacy-card-continue:hover,
.legacy-card-continue:focus,
.legacy-card-continue:active {
    min-width: 0;
    padding: 11px 18px;

    font-size: 0.88rem;
    text-decoration: none;
}

.legacy-card-view,
.legacy-card-view:visited {
    padding: 10px 8px;

    color: var(--text-soft);

    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.legacy-card-view:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.legacy-empty-state {
    min-height: 330px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 38px 24px;

    border-radius: 28px;

    text-align: center;

    animation:
        legacyEmptyEntrance 0.42s ease both;
}

.legacy-empty-icon {
    margin-bottom: 20px;

    font-size: 1.5rem;
}

.legacy-empty-state h3 {
    margin-bottom: 9px;

    color: var(--primary-dark);

    font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.legacy-empty-state p {
    max-width: 500px;

    margin-bottom: 23px;

    color: var(--text-soft);

    line-height: 1.6;
}

.legacy-empty-action,
.legacy-empty-action:visited,
.legacy-empty-action:hover,
.legacy-empty-action:focus,
.legacy-empty-action:active {
    text-decoration: none;
}

.legacy-delete-dialog {
    width: min(92vw, 520px);

    padding: 0;

    border: 0;

    color: var(--text-main);
    background: transparent;

    overflow: visible;

    animation:
        legacyDialogEntrance 0.28s ease both;
}

.legacy-delete-dialog::backdrop {
    background:
        rgba(47, 23, 34, 0.42);
    backdrop-filter: blur(7px);

    animation:
        legacyBackdropEntrance 0.25s ease both;
}

.legacy-delete-dialog-card {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 34px;

    border-radius: 28px;

    text-align: center;
}

.legacy-delete-dialog-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-bottom: 18px;

    border:
        1px solid
        rgba(176, 51, 70, 0.2);
    border-radius: 16px;

    color: #a4384b;
    background:
        rgba(176, 51, 70, 0.1);

    font-weight: 850;
}

.legacy-delete-dialog h2 {
    margin-bottom: 14px;

    color: var(--primary-dark);

    font-size: clamp(1.55rem, 4vw, 2rem);
}

.legacy-delete-dialog p {
    max-width: 430px;

    margin-bottom: 10px;

    color: var(--text-soft);

    line-height: 1.55;
}

.legacy-delete-dialog
    .legacy-delete-warning {
    margin-top: 5px;
    margin-bottom: 25px;

    color: #9b3246;

    font-weight: 750;
}

.legacy-delete-confirmation-label {
    width: 100%;
    margin: 10px 0 7px;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 800;
    text-align: left;
}

.legacy-delete-confirmation-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(176, 51, 70, 0.25);
    border-radius: 13px;
    color: var(--text-main);
    background: var(--input-background);
    font: inherit;
}

.legacy-delete-confirmation-input:focus {
    border-color: #b73e53;
    outline: 3px solid rgba(183, 62, 83, 0.15);
}

.legacy-delete-dialog .legacy-delete-confirmation-hint {
    width: 100%;
    margin: 7px 0 22px;
    font-size: 0.78rem;
    text-align: left;
}

.legacy-delete-dialog-actions {
    width: 100%;

    display: flex;
    justify-content: center;
    gap: 12px;
}

.legacy-delete-dialog-actions
    .secondary-button,
.legacy-destructive-button {
    min-width: 145px;
}

.legacy-destructive-button {
    padding: 12px 20px;

    border:
        1px solid
        rgba(118, 25, 44, 0.28);
    border-radius: 999px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            #b73e53,
            #8f293c
        );

    box-shadow:
        0 12px 25px rgba(143, 41, 60, 0.24);

    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        filter 0.22s ease;
}

.legacy-destructive-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 30px rgba(143, 41, 60, 0.3);
    filter: saturate(1.06);
}

.legacy-destructive-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.35);
    opacity: 0.48;
    transform: none;
    box-shadow: none;
}

.legacy-archived-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 17px;
    border: 1px solid rgba(126, 93, 107, 0.2);
    border-radius: 16px;
    color: var(--text-main);
    background: rgba(126, 93, 107, 0.09);
}

.legacy-archived-banner[hidden] {
    display: none;
}

.legacy-archived-banner span {
    color: var(--text-soft);
}

body.dark-mode .legacy-management-tabs {
    background: rgba(35, 24, 35, 0.58);
}

.legacy-destructive-button:focus-visible {
    outline: 3px solid
        rgba(183, 62, 83, 0.28);
    outline-offset: 3px;
}

.legacy-dashboard-card-removing {
    animation:
        legacyCardRemoval
        0.26s
        ease
        forwards;
    pointer-events: none;
}

@keyframes legacyMenuEntrance {
    from {
        opacity: 0;
        transform:
            translateY(-5px)
            scale(0.98);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes legacyDialogEntrance {
    from {
        opacity: 0;
        transform:
            translateY(10px)
            scale(0.98);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes legacyBackdropEntrance {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes legacyCardRemoval {
    to {
        opacity: 0;
        transform:
            translateY(8px)
            scale(0.96);
    }
}

@keyframes legacyEmptyEntrance {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .legacy-card-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .legacy-dashboard-section {
        padding:
            112px
            14px
            30px;
    }

    .legacy-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .legacy-dashboard-primary {
        width: 100%;
    }

    .legacy-begin-card {
        grid-template-columns: auto minmax(0, 1fr);

        padding: 20px;
    }

    .legacy-begin-arrow {
        display: none;
    }

    .legacy-card-grid {
        grid-template-columns: 1fr;
    }

    .legacy-dashboard-card {
        min-height: 290px;
    }

    .legacy-delete-dialog-card {
        padding: 28px 20px;
    }

    .legacy-archived-banner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .legacy-begin-card {
        align-items: flex-start;

        gap: 14px;
    }

    .legacy-begin-icon {
        width: 46px;
        height: 46px;

        border-radius: 15px;
    }

    .legacy-begin-copy strong {
        font-size: 1.06rem;
    }

    .legacy-begin-copy > span {
        font-size: 0.88rem;
    }

    .legacy-delete-dialog-actions {
        flex-direction: column-reverse;
    }

    .legacy-delete-dialog-actions
        .secondary-button,
    .legacy-destructive-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legacy-dashboard-shell,
    .legacy-dashboard-card,
    .legacy-empty-state,
    .legacy-menu-popover,
    .legacy-delete-dialog,
    .legacy-delete-dialog::backdrop {
        animation: none;
    }

    .legacy-dashboard-card-removing {
        opacity: 0;
    }
}

/* ------------------------------
   Experience selection
------------------------------ */

.experience-page {
    display: flex;
    flex-direction: column;
}

.experience-section {
    position: relative;
    z-index: 2;

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 122px 24px 42px;

    animation: sectionAppear 0.65s ease;
}

.experience-content {
    width: min(100%, 1040px);

    text-align: center;
}

.experience-heading {
    max-width: 720px;

    margin: 0 auto 38px;
}

.experience-heading h1 {
    margin-bottom: 14px;

    color: var(--primary-dark);

    font-size: clamp(2.5rem, 6vw, 4.65rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.experience-heading > p:last-child {
    color: var(--text-soft);

    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
}

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

.experience-card {
    position: relative;

    min-height: 340px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 32px;
    overflow: hidden;

    border-radius: 30px;

    text-align: left;

    animation: experienceCardEntrance 0.75s ease both;

    transition:
        transform 0.3s ease,
        background var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow 0.3s ease;
}

.experience-card:nth-child(2) {
    animation-delay: 0.08s;
}

.experience-card:not(.experience-card-disabled):hover {
    transform: translateY(-8px);

    box-shadow:
        0 32px 78px rgba(126, 50, 83, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.experience-card-icon {
    width: 54px;
    height: 54px;

    display: grid;
    place-items: center;

    margin-bottom: 34px;

    border: 1px solid rgba(200, 63, 116, 0.18);
    border-radius: 18px;

    color: var(--primary-dark);
    background:
        linear-gradient(
            135deg,
            rgba(255, 213, 153, 0.72),
            rgba(255, 159, 189, 0.62)
        );

    box-shadow: 0 10px 25px rgba(200, 63, 116, 0.15);

    font-size: 1.3rem;
}

.experience-card-copy {
    position: relative;
    z-index: 2;

    margin-bottom: 28px;
}

.experience-card-copy h2 {
    margin-bottom: 12px;

    color: var(--primary-dark);

    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: -0.025em;
}

.experience-card-copy p {
    max-width: 390px;

    color: var(--text-soft);

    font-size: 1rem;
    line-height: 1.65;
}

.experience-open,
.experience-open:visited,
.experience-open:hover,
.experience-open:focus,
.experience-open:active {
    position: relative;
    z-index: 2;

    margin-top: auto;

    text-decoration: none;
}

.experience-card-disabled {
    opacity: 0.66;
    filter: saturate(0.68);

    cursor: default;
}

.experience-card-disabled:hover {
    transform: translateY(-3px);
}

.coming-soon-badge {
    position: relative;
    z-index: 2;

    margin-top: auto;
    padding: 12px 18px;

    border: 1px solid var(--glass-border);
    border-radius: 999px;

    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.2);

    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@keyframes experienceCardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 760px) {
    .experience-section {
        align-items: flex-start;

        padding:
            114px
            16px
            30px;
    }

    .experience-heading {
        margin-bottom: 28px;
    }

    .experience-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .experience-card {
        min-height: 290px;
        padding: 26px;
        border-radius: 25px;
    }

    .experience-card-icon {
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .experience-navbar {
        min-height: 60px;
        padding: 8px 10px 8px 14px;
    }

    .experience-navbar .brand-text {
        font-size: 0.94rem;
    }

    .experience-heading h1 {
        font-size: clamp(2.25rem, 12vw, 3rem);
    }

    .experience-card {
        min-height: 270px;
        padding: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .experience-card {
        animation: none;
    }
}

/* ------------------------------
   Short laptop screens
------------------------------ */

@media (max-height: 780px) and (min-width: 651px) {
    .page-section {
        padding-top: 96px;
        padding-bottom: 16px;
    }

    .hero-card {
        margin-top: 50px;

        padding-top: 175px;
        padding-bottom: 20px;
    }

    #mascot {
        top: -135px;
    
        width: clamp(280px, 23vw, 340px);
        max-height: 300px;
    }
    .hero h1 {
        font-size: clamp(2.6rem, 5vw, 4rem);
    }

    .hero-description {
        margin-bottom: 15px;
        font-size: 1.05rem;
    }
}

/* ------------------------------
   Reduced motion accessibility
------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}
/* Keep the full chat interface visible without scrolling */
#chatSection {
    height: 100vh;
    min-height: 100vh;
    padding-top: 96px;
    padding-bottom: 14px;
    overflow: hidden;
}

.chat-layout {
    height: calc(100vh - 110px);
    min-height: 0;
}

.assistant-panel,
.chat-window {
    height: 100%;
    min-height: 0;
}

.chat-window {
    max-height: none;
}

.chat-messages {
    min-height: 0;
}

.chat-mascot {
    width: 175px;
}

.assistant-panel {
    padding: 20px;
}

.chat-header {
    padding: 16px 22px;
}

.chat-input-area {
    padding: 12px 18px;
}
/* ==================================================
   LOGIN AND AUTHENTICATION SCREEN
================================================== */

#authScreen {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100vw;
    min-height: 100vh;

    padding: 24px;

    overflow-y: auto;

    background: #100b10;

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.8s ease,
        visibility 0.8s ease;
}

#authScreen.auth-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#authBackgroundVideo {
    position: fixed;
    inset: -5%;

    width: 110%;
    height: 110%;

    object-fit: cover;

    filter: blur(38px);
    opacity: 0.75;

    transform: scale(1.1);
}

#authMainVideo {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 0.66;
}

.auth-overlay {
    position: fixed;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(17, 7, 14, 0.74),
            rgba(30, 12, 25, 0.35),
            rgba(17, 7, 14, 0.62)
        );
}

.auth-card {
    position: relative;
    z-index: 3;

    width: min(100%, 445px);

    padding: 30px;

    color: #4b3040;
    background: rgba(255, 249, 251, 0.88);

    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    animation: authCardEntrance 0.9s ease;
}

@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 25px;
}

.auth-brand-icon {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    flex-shrink: 0;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #ffd293,
            #ff9bbb
        );

    box-shadow:
        0 9px 22px rgba(200, 63, 116, 0.22);
}

.auth-brand h1 {
    color: #ad3263;

    font-size: 1.3rem;
    line-height: 1.2;
}

.auth-brand p {
    margin-top: 3px;

    color: #8a6675;

    font-size: 0.78rem;
}

.auth-heading {
    margin-bottom: 21px;
}

.auth-heading h2 {
    margin-bottom: 7px;

    color: #8f2854;

    font-size: 2rem;
}

.auth-heading p {
    color: #765766;

    font-size: 0.94rem;
    line-height: 1.5;
}

.social-login-button {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;

    margin-bottom: 11px;
    padding: 13px 18px;

    border: 1px solid rgba(115, 77, 94, 0.18);
    border-radius: 15px;

    color: #49313d;
    background: rgba(255, 255, 255, 0.7);

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.social-login-button:hover {
    background: #fff;

    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(78, 33, 55, 0.12);
}



.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 11px;

    margin: 19px 0;
}

.auth-divider span {
    height: 1px;

    background: rgba(104, 65, 84, 0.18);
}

.auth-divider p {
    color: #987887;

    font-size: 0.76rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #5f3d4d;

    font-size: 0.86rem;
    font-weight: 750;
}

.form-group input {
    width: 100%;

    padding: 13px 15px;

    border: 1px solid rgba(99, 61, 79, 0.18);
    border-radius: 14px;
    outline: none;

    color: #49313e;
    background: rgba(255, 255, 255, 0.73);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.form-group input:focus {
    border-color: rgba(200, 63, 116, 0.58);
    background: #fff;

    box-shadow:
        0 0 0 4px rgba(200, 63, 116, 0.1);
}

.password-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password {
    margin-bottom: 7px;

    border: none;

    color: #c83f74;
    background: transparent;

    font-size: 0.78rem;
    font-weight: 750;

    cursor: pointer;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;

    width: 37px;
    height: 37px;

    border: none;
    border-radius: 11px;

    background: transparent;

    cursor: pointer;

    transform: translateY(-50%);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 9px;

    width: fit-content;

    margin-bottom: 19px;

    color: #6e4d5d;

    font-size: 0.85rem;

    cursor: pointer;
}

.remember-row input {
    width: 16px;
    height: 16px;

    accent-color: #c83f74;
}

.login-button {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;

    padding: 14px 20px;

    border: none;
    border-radius: 999px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            #c83f74,
            #eb5b8f
        );

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 13px 28px rgba(200, 63, 116, 0.3);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.login-button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 18px 37px rgba(200, 63, 116, 0.4);
}

.login-button:hover .login-arrow {
    transform: translateX(6px);
}

.login-arrow {
    transition: transform 0.3s ease;
}

.signup-message {
    margin-top: 20px;

    color: #765766;

    text-align: center;
    font-size: 0.84rem;
}

.signup-message button {
    border: none;

    color: #c83f74;
    background: transparent;

    font-weight: 800;

    cursor: pointer;
}

.login-message {
    min-height: 19px;

    margin-top: 11px;

    color: #b42e61;

    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.website-locked {
    display: none;
}

#website.website-unlocked {
    display: block;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-button {
    padding: 10px 14px;

    border: 1px solid var(--glass-border);
    border-radius: 14px;

    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.16);

    font-size: 0.82rem;
    font-weight: 750;

    cursor: pointer;

    transition:
        color 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}

.logout-button:hover {
    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.1);

    transform: translateY(-1px);
}

/* Mobile login */
@media (max-width: 600px) {
    #authScreen {
        align-items: flex-start;

        padding: 18px 12px;
    }

    #authMainVideo {
        object-fit: cover;
    }

    .auth-card {
        margin: auto 0;

        padding: 23px 18px;

        border-radius: 24px;
    }

    .auth-heading h2 {
        font-size: 1.7rem;
    }

    .logout-button {
        display: none;
    }
}
/* FINAL FIX: Google and Apple sign-in buttons */

.social-login-button {
    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin-bottom: 11px;
    padding: 12px 18px;

    border: 1px solid rgba(80, 55, 68, 0.16);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.88);
    color: #3f2d36;

    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;
}

.social-login-button:hover {
    background: #ffffff;
    transform: translateY(-2px);

    box-shadow: 0 8px 20px rgba(60, 30, 45, 0.12);
}

/* Force brand icons to remain small */
.social-login-button svg,
.social-logo {
    display: block;

    width: 21px !important;
    height: 21px !important;

    min-width: 21px !important;
    max-width: 21px !important;

    min-height: 21px !important;
    max-height: 21px !important;

    flex: 0 0 21px;
}

/* Apple button */
.apple-login-button {
    background: #000000;
    color: #ffffff;

    border-color: #000000;
}

.apple-login-button:hover {
    background: #1c1c1c;
    color: #ffffff;
}

/* Keep the text aligned */
.social-login-button span {
    line-height: 1;
}

/* Disabled social sign-in options */
.social-login-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.social-login-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.social-login-button:disabled .social-logo {
    filter: grayscale(1);
}

.social-button-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.social-button-text small {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.75;
}


/* Link underline reset for navigation and account actions */
.nav-link,
.nav-link:visited,
.nav-link:hover,
.nav-link:focus,
.nav-link:active,
#startChatButton,
#startChatButton:visited,
#startChatButton:hover,
#startChatButton:focus,
#startChatButton:active,
.logout-button,
.logout-button:visited,
.logout-button:hover,
.logout-button:focus,
.logout-button:active {
    text-decoration: none;
}


/* Button-style link underline reset */
.secondary-button,
.secondary-button:visited,
.secondary-button:hover,
.secondary-button:focus,
.secondary-button:active,
#missionChatButton,
#missionChatButton:visited,
#missionChatButton:hover,
#missionChatButton:focus,
#missionChatButton:active {
    text-decoration: none;
}


/* Phase 4.6 backend integration states */

.assistant-panel {
    padding: 18px 20px;
}

.assistant-panel .chat-mascot {
    width: 135px;

    margin-bottom: 4px;
}

.assistant-panel > h2 {
    margin-bottom: 4px;

    font-size: 1.6rem;
}

.assistant-panel > p {
    margin-bottom: 10px;

    line-height: 1.35;
}

.assistant-status {
    gap: 6px;

    margin-bottom: 0;
    padding: 6px 11px;
}

.new-chat-button {
    flex-shrink: 0;

    margin-top: 12px;
}

.conversation-sidebar {
    width: 100%;
    min-height: 0;

    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    margin-top: 12px;

    text-align: left;
}

.conversation-sidebar-label {
    flex-shrink: 0;

    margin: 0 4px 8px;

    color: var(--text-soft);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.conversation-list {
    min-height: 0;

    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;

    padding-right: 4px;

    overflow-x: hidden;
    overflow-y: auto;
}

.assistant-panel > .secondary-button:last-child {
    flex-shrink: 0;

    margin-top: 14px;
}

.conversation-list-item {
    width: 100%;

    flex: 0 0 auto;

    padding: 10px 12px;

    overflow: hidden;

    border: 1px solid transparent;
    border-radius: 12px;

    color: var(--text-main);
    background: rgba(255, 255, 255, 0.15);

    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.conversation-list-item:hover {
    background: rgba(200, 63, 116, 0.1);
    transform: translateY(-1px);
}

.conversation-list-item.active {
    border-color: rgba(200, 63, 116, 0.3);

    color: var(--primary-dark);
    background: rgba(200, 63, 116, 0.16);
}

.chat-state {
    min-height: 90px;

    display: grid;
    place-items: center;
    gap: 10px;

    margin: auto;
    padding: 18px;

    color: var(--text-soft);

    text-align: center;
}

.conversation-list .chat-state {
    min-height: 70px;
    padding: 10px 4px;

    font-size: 0.82rem;
}

.error-state {
    color: #a22f5b;
}

.loading-state {
    opacity: 0.75;
}

.state-retry-button {
    padding: 8px 13px;

    border: 1px solid var(--glass-border);
    border-radius: 10px;

    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.25);

    font-weight: 700;
    cursor: pointer;
}

.message {
    overflow-wrap: anywhere;
    word-break: normal;
}

.user-message {
    white-space: pre-wrap;
}

.berry-message {
    white-space: normal;
}

.streaming-message {
    white-space: pre-wrap;
}

.berry-message > :first-child {
    margin-top: 0;
}

.berry-message > :last-child {
    margin-bottom: 0;
}

.berry-message p,
.berry-message ul,
.berry-message ol,
.berry-message pre,
.berry-message blockquote {
    margin: 0 0 0.8em;
}

.berry-message ul,
.berry-message ol {
    padding-left: 1.35em;
}

.berry-message li + li {
    margin-top: 0.3em;
}

.berry-message h1,
.berry-message h2,
.berry-message h3,
.berry-message h4,
.berry-message h5,
.berry-message h6 {
    margin: 0.9em 0 0.45em;
    color: var(--primary-dark);
    font-size: 1.08em;
    line-height: 1.3;
}

.berry-message a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.berry-message code {
    padding: 0.14em 0.35em;
    border-radius: 6px;
    background: rgba(87, 51, 70, 0.1);
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.berry-message pre {
    max-width: 100%;
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid rgba(87, 51, 70, 0.12);
    border-radius: 11px;
    background: rgba(45, 29, 38, 0.08);
    white-space: pre;
}

.berry-message pre code {
    padding: 0;
    background: transparent;
    overflow-wrap: normal;
}

.inline-error-message {
    border: 1px solid rgba(162, 47, 91, 0.2);
    color: #8d2b51;
    background: rgba(255, 240, 246, 0.76);
}

.typing-row {
    animation-duration: 0.2s;
}

.typing-row .typing-indicator {
    min-height: 38px;
}

.chat-input-area textarea {
    width: 100%;
    min-height: 48px;
    max-height: 120px;

    padding: 13px 18px;

    border: 1px solid transparent;
    border-radius: 24px;
    outline: none;

    resize: vertical;

    color: var(--text-main);
    background: var(--input-background);

    font: inherit;
    line-height: 1.4;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.chat-input-area textarea::placeholder {
    color: var(--text-soft);
}

.chat-input-area textarea:focus {
    border-color: rgba(200, 63, 116, 0.4);
    box-shadow: 0 0 0 4px rgba(200, 63, 116, 0.1);
}

button:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.login-button:disabled:hover,
.send-button:disabled:hover,
.icon-button:disabled:hover,
.secondary-button:disabled:hover {
    transform: none;
}

.app-status-message {
    position: fixed;
    z-index: 100;
    right: 18px;
    bottom: 18px;

    max-width: min(390px, calc(100% - 36px));

    padding: 12px 16px;

    border: 1px solid rgba(200, 63, 116, 0.25);
    border-radius: 14px;

    background: var(--surface);

    box-shadow: 0 12px 30px rgba(60, 30, 45, 0.18);
}

@media (max-width: 900px) {
    .chat-layout {
        min-height: 0;
    }

    .assistant-panel {
        display: flex;
        align-items: stretch;

        padding: 16px;
    }

    .assistant-panel .chat-mascot,
    .assistant-panel > h2,
    .assistant-panel > p,
    .assistant-status {
        display: none;
    }

    .conversation-sidebar {
        margin-top: 12px;
    }

    .conversation-list {
        min-height: 0;
    }

    .assistant-panel > .secondary-button:last-child {
        margin-top: 12px;
    }
}

@media (max-width: 650px) {
    .chat-header #chatStatus {
        display: block;

        max-width: 230px;

        overflow: hidden;

        font-size: 0.78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
/* Focused Legacy journey repair */
.companion-selected-legacy {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 34rem;
    margin: 0 auto 1.5rem;
    padding: 1.25rem;
}

.companion-selected-legacy h2,
.companion-selected-legacy p {
    margin: 0;
}

.companion-feature-card.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.legacy-dashboard-help-button {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-background);
    color: var(--text-main);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.legacy-dashboard-help-button:focus-visible,
.legacy-dashboard-help-close:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.legacy-dashboard-help-dialog {
    width: min(46rem, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-main);
}

.legacy-dashboard-help-dialog::backdrop {
    background: rgba(16, 13, 30, 0.68);
}

.legacy-dashboard-help-card {
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.5rem;
}

.legacy-dashboard-help-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.legacy-dashboard-help-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.8rem;
    cursor: pointer;
}

.legacy-dashboard-help-card dl {
    display: grid;
    gap: 0.8rem;
    margin: 1.25rem 0 0;
}

.legacy-dashboard-help-card dl div {
    padding: 0.9rem;
    border-radius: 0.85rem;
    background: var(--input-background);
}

.legacy-dashboard-help-card dt {
    font-weight: 800;
}

.legacy-dashboard-help-card dd {
    margin: 0.3rem 0 0;
    line-height: 1.55;
}

@media (max-width: 680px) {
    .legacy-card-actions,
    .legacy-overview-hero-actions {
        width: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .legacy-card-actions > *,
    .legacy-overview-hero-actions > * {
        width: 100%;
        justify-content: center;
    }

    .legacy-progress-heading {
        align-items: flex-start;
    }
}
