:root {
    --bg: #080808;
    --sidebar: #0c0c0c;
    --panel: #101010;
    --panel-2: #151515;
    --panel-3: #1b1b1b;
    --line: #262626;
    --line-strong: #333333;
    --text: #f5f5f5;
    --muted: #8b8b90;
    --muted-2: #66666b;
    --pink: #ef4f86;
    --pink-2: #ff5d92;
    --pink-soft: rgba(239, 79, 134, .12);
    --pink-border: rgba(239, 79, 134, .34);
    --shadow: 0 30px 90px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    background: var(--bg);
    font-family: "DM Sans", sans-serif;
}

body.subscription-open { overflow: hidden; }

button,
textarea { font: inherit; }

button { color: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    width: min(1280px, calc(100% - 44px));
    height: min(860px, calc(100vh - 44px));
    height: min(860px, calc(100dvh - 44px));
    min-height: 0;
    margin: 22px auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

/* SIDEBAR */

.sidebar {
    display: flex;
    position: relative;
    z-index: 30;
    flex-direction: column;
    min-height: 0;
    padding: 34px 28px 28px;
    border-right: 1px solid var(--line);
    background: var(--sidebar);
}

.brand {
    display: inline-flex;
    width: fit-content;
    color: white;
    text-decoration: none;
    font: 800 21px/1 "Manrope", sans-serif;
    letter-spacing: -.04em;
}

.brand span:last-child {
    color: var(--pink);
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close,
.history-button {
    display: none;
}

.sidebar-main {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    margin-top: 34px;
}

.eyebrow {
    color: var(--pink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.new-conversation {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--pink-border);
    border-radius: 12px;
    color: white;
    background: var(--pink-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: .18s ease;
}

.new-conversation:hover {
    border-color: var(--pink);
    background: rgba(239, 79, 134, .18);
}

.new-conversation span {
    color: var(--pink);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.sidebar-main .conversation-label {
    margin: 28px 4px 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
}

.conversation-list {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.conversation-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 10px;
    transition: background .16s ease;
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--panel-2);
}

.conversation-item.active {
    box-shadow: inset 2px 0 var(--pink);
}

.conversation-open,
.conversation-archive {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.conversation-open {
    display: grid;
    min-width: 0;
    gap: 3px;
    padding: 10px 8px 10px 12px;
    color: #dedee0;
    text-align: left;
}

.conversation-open span {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-open small {
    color: var(--muted-2);
    font-size: 9px;
}

.conversation-archive {
    width: 30px;
    height: 30px;
    margin-right: 3px;
    border-radius: 8px;
    color: var(--muted-2);
    font-size: 18px;
    opacity: 0;
    transition: .16s ease;
}

.conversation-item:hover .conversation-archive,
.conversation-archive:focus-visible {
    opacity: 1;
}

.conversation-archive:hover {
    color: var(--pink-2);
    background: var(--pink-soft);
}

@media (hover: none) {
    .conversation-archive { opacity: 1; }
}

.conversation-empty {
    margin: 8px 4px;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.5;
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.quota-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.quota-card.is-empty { border-color: var(--pink-border); }

.quota-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
}

.quota-heading span { color: var(--muted); }
.quota-heading strong { color: white; }

.quota-track {
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: #292929;
}

.quota-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--pink);
    transition: width .25s ease;
}

.quota-card small {
    color: var(--muted-2);
    font-size: 9px;
}

.quota-upgrade,
.quota-manage {
    display: block;
    width: fit-content;
    padding: 0;
    border: 0;
    color: var(--pink-2);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.quota-upgrade:hover,
.quota-manage:hover { color: white; }

.subscription-modal {
    display: grid;
    position: fixed;
    z-index: 80;
    inset: 0;
    place-items: center;
    padding: 24px;
}

.subscription-modal[hidden] { display: none; }

.subscription-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, .72);
    cursor: pointer;
}

.subscription-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    padding: 30px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: #141414;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
}

.subscription-close {
    display: grid;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--muted);
    background: var(--panel-2);
    cursor: pointer;
    font-size: 20px;
}

.subscription-close:hover { color: white; border-color: var(--pink-border); }

.subscription-dialog h2 {
    margin: 10px 0 6px;
    font: 800 clamp(24px, 4vw, 32px)/1.1 "Manrope", sans-serif;
    letter-spacing: -.04em;
}

.subscription-intro { margin: 0; color: var(--muted); font-size: 13px; }

.subscription-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.subscription-option {
    display: grid;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--line-strong);
    border-radius: 15px;
    background: var(--panel-2);
}

.subscription-option.is-featured { border-color: var(--pink-border); background: linear-gradient(145deg, rgba(239,79,134,.12), var(--panel-2) 55%); }
.subscription-option-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.subscription-option h3 { margin: 0; font: 700 16px "Manrope", sans-serif; }
.subscription-option-heading strong { color: white; white-space: nowrap; font-size: 14px; }
.subscription-option-heading small { color: var(--muted); font-size: 10px; font-weight: 400; }
.subscription-option ul { display: grid; gap: 8px; margin: 0; padding-left: 17px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.subscription-badge { width: fit-content; padding: 4px 8px; border-radius: 99px; color: white; background: var(--pink); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.subscription-cta { display: block; margin-top: auto; padding: 11px 12px; border-radius: 10px; color: white; background: var(--pink); font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; }
.subscription-cta:hover { background: var(--pink-2); }
.subscription-cta.is-disabled { color: var(--muted-2); background: var(--line); cursor: not-allowed; }

@media (max-width: 600px) {
    .subscription-modal { align-items: end; padding: 12px; }
    .subscription-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px 18px 18px; border-radius: 17px; }
    .subscription-options { grid-template-columns: 1fr; }
}

.account-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.account-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--pink-border);
    border-radius: 10px;
    background: #1b1115;
    font: 700 12px "Manrope", sans-serif;
}

.account-summary > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.account-summary strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-summary small {
    color: var(--muted);
    font-size: 10px;
}

.logout-button {
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    text-align: left;
}

.logout-button:hover { color: var(--pink); }

.assistant-identity small i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 0 3px var(--pink-soft);
}

.sidebar-backdrop { display: none; }

/* CHAT SHELL */

.chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #0b0b0b;
}

.chat-header {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: #111111;
}

.assistant-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.assistant-identity > span:last-child {
    display: grid;
    gap: 4px;
}

.assistant-identity strong {
    font: 700 14px "Manrope", sans-serif;
}

.assistant-identity small {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
}

.avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--pink-border);
    border-radius: 50%;
    background: #1b1115;
}

.maria-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--panel-2);
    cursor: pointer;
    transition: .18s ease;
}

.icon-button:hover {
    border-color: var(--pink-border);
    background: var(--pink-soft);
}

.icon-button svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-button {
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--text);
    background: var(--panel-2);
    cursor: pointer;
}

.history-button svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.7;
}

/* MESSAGES */

.messages {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    padding: 34px clamp(24px, 4vw, 58px);
    background:
        linear-gradient(180deg, rgba(255,255,255,.012), transparent 22%),
        #0b0b0b;
}

.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: #323232;
    background-clip: padding-box;
}

/* WELCOME */

.welcome {
    max-width: 580px;
    margin: clamp(24px, 8vh, 82px) auto 0;
    text-align: center;
}

.welcome-symbol {
    display: grid;
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--pink-border);
    border-radius: 50%;
    background: #1b1115;
}

.welcome h2 {
    margin: 0 0 9px;
    font: 700 clamp(24px, 3vw, 30px)/1.2 "Manrope", sans-serif;
    letter-spacing: -.03em;
}

.welcome > p {
    max-width: 440px;
    margin: 0 auto 26px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.suggestions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.suggestions button {
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
    color: #dedee0;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: .18s ease;
}

.suggestions button:hover {
    border-color: var(--pink-border);
    background: #1a1316;
    transform: translateY(-1px);
}

/* BUBBLES */

.message {
    display: flex;
    gap: 11px;
    max-width: 78%;
    margin-bottom: 22px;
    animation: appear .2s ease both;
}

.message.user {
    justify-content: flex-end;
    margin-left: auto;
}

.message.assistant {
    margin-right: auto;
}

.message-avatar {
    display: grid;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    place-items: center;
    overflow: hidden;
    margin-top: 3px;
    border: 1px solid var(--pink-border);
    border-radius: 50%;
    background: #1b1115;
}

.bubble {
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 8px 18px 18px 18px;
    background: #151515;
    color: #ededee;
    font-size: 14px;
    line-height: 1.66;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message.assistant .bubble {
    white-space: normal;
}

.message.assistant .bubble > :first-child { margin-top: 0; }
.message.assistant .bubble > :last-child { margin-bottom: 0; }

.message.assistant .bubble p {
    margin: 0 0 1em;
}

.message.assistant .bubble h3,
.message.assistant .bubble h4,
.message.assistant .bubble h5,
.message.assistant .bubble h6 {
    margin: 1.15em 0 .55em;
    color: white;
    font-family: "Manrope", sans-serif;
    line-height: 1.3;
}

.message.assistant .bubble h3 { font-size: 1.22em; }
.message.assistant .bubble h4 { font-size: 1.12em; }
.message.assistant .bubble h5,
.message.assistant .bubble h6 { font-size: 1em; }

.message.assistant .bubble ul,
.message.assistant .bubble ol {
    margin: .6em 0 1em;
    padding-left: 1.4em;
}

.message.assistant .bubble li {
    margin: .35em 0;
    padding-left: .15em;
}

.message.assistant .bubble strong {
    color: white;
    font-weight: 700;
}

.message.assistant .bubble a {
    color: var(--pink-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.message.assistant .bubble code {
    padding: .12em .38em;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: #0c0c0c;
    font: .9em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.message.assistant .bubble pre {
    max-width: 100%;
    margin: .8em 0 1em;
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #0c0c0c;
    white-space: pre;
}

.message.assistant .bubble pre code {
    padding: 0;
    border: 0;
    background: transparent;
}

.message.assistant .bubble blockquote {
    margin: .8em 0 1em;
    padding: .2em 0 .2em 1em;
    border-left: 3px solid var(--pink);
    color: var(--muted);
}

.message.user .bubble {
    border-color: transparent;
    border-radius: 18px 8px 18px 18px;
    color: white;
    background: linear-gradient(135deg, #d93f74, var(--pink-2));
    box-shadow: 0 10px 25px rgba(239,79,134,.12);
    white-space: pre-wrap;
}

.message.error .bubble {
    color: #ffd6d6;
    border-color: rgba(255,98,98,.25);
    background: #2b1515;
}

/* TYPING */

.typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 58px;
    min-height: 45px;
}

.typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8d8d8f;
    animation: bounce 1.2s infinite;
}

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

/* COMPOSER */

.composer-wrap {
    position: relative;
    z-index: 2;
    padding: 16px 28px 20px;
    border-top: 1px solid var(--line);
    background: #111111;
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 8px 8px 17px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #171717;
    transition: border .2s, box-shadow .2s;
}

.composer:focus-within {
    border-color: var(--pink-border);
    box-shadow: 0 0 0 3px var(--pink-soft);
}

.composer textarea {
    width: 100%;
    max-height: 130px;
    padding: 9px 0;
    resize: none;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
}

.composer textarea::placeholder { color: #6f6f73; }

.send-button {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--pink);
    cursor: pointer;
    transition: .18s ease;
}

.send-button:hover:not(:disabled) {
    background: var(--pink-2);
    transform: translateY(-1px);
}

.send-button:disabled {
    opacity: .3;
    cursor: default;
}

.send-button svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.disclaimer {
    margin: 9px 0 0;
    color: var(--muted-2);
    font-size: 10px;
    text-align: center;
}

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

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* TABLETTE : le chat utilise toute la surface disponible. */
@media (max-width: 900px) {
    body { background: var(--bg); }

    .app-shell {
        grid-template-columns: 1fr;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 88vw);
        padding-top: max(28px, env(safe-area-inset-top));
        transform: translateX(-102%);
        box-shadow: 24px 0 70px rgba(0, 0, 0, .55);
        transition: transform .22s ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 0;
        border-radius: 9px;
        color: var(--muted);
        background: var(--panel-2);
        cursor: pointer;
        font-size: 22px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 25;
        inset: 0;
        border: 0;
        background: rgba(0, 0, 0, .58);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    .sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .history-button { display: grid; }

    .chat-panel { height: 100%; }

    .composer-wrap {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* TABLETTE EN PAYSAGE ET ÉCRANS PEU HAUTS. */
@media (min-width: 901px) and (max-height: 700px) {
    .app-shell {
        width: min(1280px, calc(100% - 24px));
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        margin: 12px auto;
    }

    .sidebar {
        padding: 24px 24px 20px;
    }

    .sidebar-main {
        margin-top: 22px;
    }

    .chat-header {
        min-height: 68px;
    }

    .messages {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .welcome {
        margin-top: 8px;
    }

    .welcome-symbol {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }

    .welcome > p {
        margin-bottom: 18px;
    }

    .suggestions button {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .composer-wrap {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

@media (max-width: 760px) {

    .chat-header {
        min-height: 72px;
        padding: 0 16px;
    }

    .assistant-identity {
        gap: 9px;
    }

    .assistant-identity strong {
        font-size: 12px;
    }

    .avatar {
        width: 36px;
        height: 36px;
    }

    .messages {
        padding: 24px 14px;
    }

    .welcome {
        margin-top: 28px;
    }

    .welcome > p {
        padding: 0 8px;
    }

    .suggestions button {
        font-size: 12px;
    }

    .message {
        max-width: 94%;
    }

    .composer-wrap {
        padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    }

    .disclaimer {
        display: none;
    }
}

/* AUTHENTIFICATION */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(239, 79, 134, .12), transparent 35%),
        var(--bg);
}

.auth-shell {
    width: min(440px, 100%);
    margin: clamp(28px, 9vh, 90px) auto;
    padding: clamp(26px, 5vw, 42px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.auth-heading {
    margin: 52px 0 32px;
}

.auth-heading h1 {
    margin: 10px 0 8px;
    font: 700 clamp(25px, 6vw, 32px)/1.15 "Manrope", sans-serif;
    letter-spacing: -.04em;
}

.auth-error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 98, 98, .25);
    border-radius: 11px;
    color: #ffd6d6;
    background: #2b1515;
    font-size: 12px;
    line-height: 1.45;
}

.auth-success {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(82, 196, 130, .28);
    border-radius: 11px;
    color: #c9f5dc;
    background: rgba(38, 108, 68, .2);
    font-size: 12px;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 9px;
}

.auth-form label {
    margin-top: 5px;
    color: #d7d7d9;
    font-size: 12px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: #171717;
    font: inherit;
    font-size: 14px;
}

.auth-form input:focus {
    border-color: var(--pink-border);
    box-shadow: 0 0 0 3px var(--pink-soft);
}

.auth-form button {
    margin-top: 13px;
    padding: 13px 16px;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--pink);
    cursor: pointer;
    font-weight: 700;
}

.auth-form button:hover { background: var(--pink-2); }

.auth-hint {
    margin-top: -5px;
    color: var(--muted-2);
    font-size: 10px;
}

.auth-resend {
    margin-top: 12px;
}

.auth-resend button {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    color: var(--muted);
    background: var(--panel-2);
    cursor: pointer;
    font-size: 11px;
}

.auth-resend button:hover {
    border-color: var(--pink-border);
    color: white;
}

.auth-primary-link {
    display: block;
    margin-top: 18px;
    padding: 13px 16px;
    border-radius: 12px;
    color: white;
    background: var(--pink);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-primary-link:hover { background: var(--pink-2); }

.auth-links {
    display: grid;
    justify-items: center;
    gap: 9px;
    margin: 22px 0 0;
    font-size: 11px;
    text-align: center;
}

.auth-links a {
    color: var(--pink);
    text-decoration: none;
}

.auth-links a:hover { color: var(--pink-2); }

.auth-links > a {
    color: var(--muted);
}

.auth-links p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 520px) {
    .auth-page { padding: 0; }

    .auth-shell {
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}


/* EXPORT CONVERSATION */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-panel {
    position: relative;
}

.export-menu {
    position: absolute;
    z-index: 20;
    top: 70px;
    right: 28px;
    width: 245px;
    padding: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #171717;
    box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.export-menu[hidden] { display: none; }

.export-menu button {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.export-menu button:hover { background: var(--pink-soft); }

.export-menu strong {
    font-size: 13px;
    font-weight: 600;
}

.export-menu span {
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 760px) {
    .export-menu {
        top: 64px;
        right: 12px;
        width: min(245px, calc(100vw - 24px));
    }
}
