/* RorologIA — interface principale (v24, one-screen étendu à l'index) */
:root {
  --bg: #07070a;
  --bg-soft: #0b0b10;
  --panel: #121218;
  --panel-soft: #16161e;
  --panel-hover: #1c1c26;
  --line: #26262f;
  --line-soft: #1d1d26;
  --text: #f5f5f7;
  --muted: #8b8b98;
  --muted-dark: #5f5f6c;
  --pink: #ed3f7b;
  --pink-2: #ff6f9c;
  --pink-soft: rgba(237, 63, 123, .48);
  --violet: #7c5cff;
  --green: #56c98c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, .45);
  --shadow-glow: 0 0 0 1px rgba(237, 63, 123, .08), 0 18px 50px rgba(237, 63, 123, .12);
  --grad-brand: linear-gradient(135deg, var(--pink) 0%, var(--violet) 100%);
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #fbfbfe;
  --panel: #ffffff;
  --panel-soft: #f0f1f7;
  --panel-hover: #eceef5;
  --line: #dfe2eb;
  --line-soft: #e9eaf1;
  --text: #20212a;
  --muted: #686b7a;
  --muted-dark: #8b8e9c;
  --shadow-soft: 0 20px 60px rgba(40, 43, 70, .14);
  --shadow-glow: 0 0 0 1px rgba(237, 63, 123, .08), 0 18px 50px rgba(124, 92, 255, .10);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; color: var(--text); background: var(--bg); font-family: "DM Sans", Arial, sans-serif; -webkit-font-smoothing: antialiased; transition: color .2s ease, background .2s ease; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: rgba(237, 63, 123, .35); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 20px; background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-dark); }

.theme-toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--panel-soft);
  font-size: 15px; line-height: 1; transition: .18s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--pink-soft); transform: translateY(-1px); }
.theme-toggle-login { position: fixed; z-index: 5; top: 18px; right: 20px; opacity: .8; }
.theme-toggle-account { flex: 0 0 32px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Animation d'entrée "chaotique" pour la page login/landing */
@keyframes chaosIn { 0% { opacity: 0; transform: translate3d(var(--tx, 0), var(--ty, 18px), 0) rotate(var(--rot, -3deg)) scale(.94); filter: blur(3px); } 55% { opacity: 1; transform: translate3d(calc(var(--tx, 0) * -.15), calc(var(--ty, 18px) * -.2), 0) rotate(calc(var(--rot, -3deg) * -.3)) scale(1.015); filter: blur(0); } 100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); filter: blur(0); } }
.enter-chaos { --tx: 0px; --ty: 18px; --rot: -3deg; opacity: 0; animation: chaosIn .72s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.auth-intro .enter-chaos:nth-child(1), #auth-intro-title.enter-chaos { --tx: -14px; --ty: -22px; --rot: -5deg; }
.auth-intro p.enter-chaos { --tx: 18px; --ty: 14px; --rot: 3deg; }
.auth-card.enter-chaos { --tx: 26px; --ty: -16px; --rot: 4deg; }
.brand.enter-chaos { --tx: -10px; --ty: -14px; --rot: -6deg; }
@media (prefers-reduced-motion: reduce) { .enter-chaos, .enter-up, .enter-down { animation: none; opacity: 1; } }
@keyframes fadeInUpSoft { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDownSoft { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
.enter-up { opacity: 0; animation: fadeInUpSoft .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.enter-down { opacity: 0; animation: fadeInDownSoft .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }

/* Interface principale */
.app-shell { display: flex; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: radial-gradient(900px 500px at 100% -10%, rgba(124, 92, 255, .10), transparent 55%), radial-gradient(700px 460px at -10% 100%, rgba(237, 63, 123, .10), transparent 55%), var(--bg); }
.sidebar { display: flex; flex: 0 0 284px; flex-direction: column; width: 284px; height: 100%; padding: 24px 18px 18px; border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-soft) 0%, var(--bg) 100%); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--text); font: 800 21px/1 "Manrope", Arial, sans-serif; letter-spacing: -.07em; text-decoration: none; }
.brand span:last-child { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar-close { display: none; border: 0; color: var(--muted); background: none; font-size: 25px; }
.sidebar-main { flex: 1; padding-top: 36px; overflow: hidden; display: flex; flex-direction: column; }
.new-conversation { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--pink-soft); border-radius: var(--radius-sm); color: var(--text); background: linear-gradient(135deg, rgba(237, 63, 123, .16), rgba(124, 92, 255, .12)); font-size: 13px; font-weight: 600; text-align: left; transition: .18s ease; box-shadow: 0 8px 24px rgba(237, 63, 123, .08); }
.new-conversation:hover { background: linear-gradient(135deg, rgba(237, 63, 123, .26), rgba(124, 92, 255, .2)); transform: translateY(-1px); }
.new-conversation span { color: var(--pink-2); font-size: 19px; font-weight: 400; }
.conversation-label { margin: 28px 8px 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.conversation-list { display: grid; gap: 5px; overflow-y: auto; padding-right: 2px; }
.conversation-item { display: flex; align-items: stretch; width: 100%; min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; transition: .15s ease; }
.conversation-item:hover, .conversation-item.is-active, .conversation-item.active { border-color: var(--line); background: var(--panel-hover); }
.conversation-open { display: block; min-width: 0; flex: 1; padding: 9px 10px; border: 0; color: var(--muted); background: transparent; font-size: 12px; line-height: 1.3; text-align: left; }
.conversation-open:hover, .conversation-open:focus-visible { color: var(--text); outline: 0; }
.conversation-open span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-open small { display: block; margin-top: 3px; color: var(--muted-dark); font-size: 9px; }
.conversation-archive { width: 28px; flex: 0 0 28px; border: 0; color: var(--muted); background: transparent; font-size: 16px; opacity: 0; transition: .15s ease; }
.conversation-item:hover .conversation-archive, .conversation-item:focus-within .conversation-archive { opacity: 1; }
.conversation-archive:hover { color: var(--text); background: var(--panel-hover); }
.conversation-empty { margin: 10px 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.sidebar-footer { display: grid; gap: 15px; padding-top: 14px; }
.quota-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
.quota-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.quota-heading strong { color: var(--text); }
.quota-track { height: 6px; margin: 10px 0 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.quota-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width .4s ease; }
.quota-card small { color: var(--muted); font-size: 10px; }
.quota-upgrade, .quota-manage { display: block; margin-top: 10px; padding: 0; border: 0; color: var(--pink-2); background: none; font-size: 11px; text-decoration: none; font-weight: 600; }
.quota-upgrade:hover, .quota-manage:hover { color: var(--text); }
.account-summary { display: flex; align-items: center; gap: 10px; }
.account-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: var(--radius-sm); color: #fff; background: var(--grad-brand); font-weight: 700; box-shadow: 0 6px 16px rgba(237, 63, 123, .25); }
.account-summary strong, .account-summary small { display: block; }
.account-summary strong { font-size: 12px; }
.account-summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-button { padding: 0; border: 0; color: var(--muted); background: none; font-size: 11px; transition: .15s ease; }
.logout-button:hover { color: var(--pink-2); }

.chat-panel { position: relative; display: flex; flex: 1; min-width: 0; height: 100%; flex-direction: column; background: var(--bg-soft); }
.chat-header { display: flex; align-items: center; justify-content: space-between; height: 78px; flex: 0 0 78px; padding: 14px 28px; border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(6px); background: color-mix(in srgb, var(--bg-soft) 82%, transparent); }
.assistant-identity { display: flex; align-items: center; gap: 11px; }
.assistant-identity > span:last-child { display: grid; gap: 3px; }
.assistant-identity strong { color: var(--text); font-size: 14px; }
.assistant-identity small { color: var(--muted); font-size: 11px; }
.assistant-identity small i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.avatar, .welcome-symbol, .message-avatar { display: grid; overflow: hidden; place-items: center; border-radius: 50%; background: var(--panel-hover); }
.avatar { width: 38px; height: 38px; border: 2px solid rgba(237, 63, 123, .35); }
.maria-photo { width: 100%; height: 100%; object-fit: cover; }
.history-button, .icon-button { display: grid; place-items: center; border: 0; color: var(--muted); background: none; }
.history-button { display: none; width: 34px; height: 34px; }
.history-button svg, .icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-soft); transition: .15s ease; }
.icon-button:hover { color: var(--text); border-color: var(--muted-dark); background: var(--panel-hover); transform: translateY(-1px); }
.messages { flex: 1; min-height: 0; width: min(820px, 100%); margin: 0 auto; padding: 48px 26px 150px; overflow-y: auto; }
.welcome { display: grid; justify-items: center; padding-top: 11vh; text-align: center; animation: fadeUp .5s ease; }
.welcome[hidden] { display: none; }
.welcome-symbol { width: 76px; height: 76px; margin-bottom: 22px; box-shadow: 0 0 0 4px rgba(237, 63, 123, .12), 0 20px 40px rgba(0,0,0,.4); }
.welcome h2 { margin: 0 0 10px; color: var(--text); font: 700 28px/1.2 "Manrope", Arial, sans-serif; letter-spacing: -.04em; }
.welcome p { margin: 0; color: var(--muted); font-size: 13px; }
.suggestions { display: grid; gap: 9px; width: min(520px, 100%); margin-top: 30px; }
.suggestions button { display: block; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--muted); background: var(--panel); font-size: 12px; text-align: left; transition: .18s ease; }
.suggestions button:hover { border-color: var(--pink-soft); color: var(--text); background: var(--panel-hover); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.message { display: flex; gap: 10px; width: min(820px, 100%); margin: 14px auto; animation: fadeUp .35s ease; }
.message-avatar { width: 30px; height: 30px; flex: 0 0 30px; }
.message .bubble { max-width: 78%; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); color: var(--text); font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.message.user { justify-content: flex-end; }
.message.user .bubble { max-width: 72%; border-color: var(--pink-soft); border-radius: 18px 18px 5px 18px; background: linear-gradient(135deg, #ec3f7b, #ff6f9c); color: #fff; box-shadow: 0 12px 28px rgba(237, 63, 123, .22); }
.message.user .bubble img, .message-attachment { max-width: 240px; margin-bottom: 6px; border-radius: 10px; }
.message .bubble p { margin: 0 0 10px; }
.message .bubble p:last-child { margin-bottom: 0; }
.message .bubble h3, .message .bubble h4 { margin: 10px 0 6px; }
.message .bubble ul, .message .bubble ol { margin: 6px 0; padding-left: 20px; }
.message .bubble blockquote { margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--pink); color: var(--muted); }
.message .bubble pre { overflow: auto; padding: 10px; border-radius: 8px; background: var(--panel-soft); white-space: pre-wrap; }
.message .bubble code { padding: 1px 4px; border-radius: 4px; background: var(--panel-hover); }
.message .meta { margin-top: 4px; color: var(--muted-dark); font-size: 10px; }
.message.error .bubble { border-color: #6b2942; color: #ffc1d1; }
.typing { display: flex; gap: 4px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { to { opacity: .25; transform: translateY(-2px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.composer-wrap { position: absolute; right: 0; bottom: 0; left: 0; padding: 18px 26px 22px; background: linear-gradient(transparent, var(--bg-soft) 30%); }
.composer { display: flex; align-items: end; gap: 8px; width: min(820px, 100%); margin: 0 auto; padding: 10px 12px 10px 16px; border: 1px solid var(--pink-soft); border-radius: 19px; background: var(--panel); box-shadow: 0 0 0 3px rgba(237, 63, 123, .06), 0 16px 40px rgba(0,0,0,.12); transition: .18s ease; }
.composer:focus-within { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(237, 63, 123, .12), 0 16px 40px rgba(0,0,0,.16); }
.composer textarea { flex: 1; min-height: 24px; max-height: 140px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; }
.composer textarea::placeholder { color: var(--muted); }
.image-button, .send-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; transition: .15s ease; }
.image-button svg, .send-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.send-button { color: #fff; background: var(--grad-brand); box-shadow: 0 8px 20px rgba(237, 63, 123, .3); }
.send-button:hover:not(:disabled) { transform: translateY(-1px) scale(1.03); }
.send-button:disabled { color: var(--muted-dark); background: var(--line); box-shadow: none; }
.image-button:hover { color: var(--text); background: var(--panel-hover); }
.image-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--panel-hover); color: var(--muted); font-size: 11px; }
.image-status[hidden], .image-preview[hidden], .export-menu[hidden], .subscription-modal[hidden] { display: none; }
.image-preview { position: relative; display: inline-block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.image-preview img { display: block; width: 56px; height: 56px; object-fit: cover; }
.image-preview button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; color: #fff; background: #000a; font-size: 14px; line-height: 1; }
.image-preview button:hover { background: var(--pink); }
.disclaimer { width: min(820px, 100%); margin: 9px auto 0; color: var(--muted); font-size: 10px; text-align: center; }
.sidebar-backdrop { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.export-menu { position: absolute; top: 62px; right: 25px; z-index: 10; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: var(--shadow-soft); animation: fadeUp .18s ease; }
.export-menu button { display: grid; gap: 3px; width: 190px; padding: 10px; border: 0; color: var(--text); background: none; text-align: left; border-radius: 8px; transition: .12s ease; }
.export-menu button:hover { background: var(--panel-hover); }
.export-menu span { color: var(--muted); font-size: 10px; }
.subscription-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; }
.subscription-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 4, 8, .55); backdrop-filter: blur(3px); }
.subscription-dialog { position: relative; width: min(720px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow-soft); animation: fadeUp .25s ease; }
.subscription-close { position: absolute; top: 12px; right: 15px; border: 0; color: var(--muted); background: none; font-size: 24px; }
.eyebrow { color: var(--pink-2); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.subscription-dialog h2 { margin: 8px 0; font: 700 26px "Manrope", Arial, sans-serif; }
.subscription-intro { color: var(--muted); font-size: 13px; }
.subscription-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
.subscription-option { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-soft); transition: .18s ease; }
.subscription-option:hover { border-color: var(--muted-dark); transform: translateY(-2px); }
.subscription-option.is-featured { border-color: var(--pink-soft); background: linear-gradient(160deg, rgba(237,63,123,.08), transparent); }
.subscription-option-heading { display: flex; justify-content: space-between; gap: 8px; }
.subscription-option h3 { margin: 0; font-size: 15px; }
.subscription-option ul { min-height: 48px; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.subscription-cta { display: block; padding: 12px; border-radius: var(--radius-sm); color: #fff; background: var(--grad-brand); font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; box-shadow: 0 8px 20px rgba(237,63,123,.25); transition: .15s ease; }
.subscription-cta:hover { transform: translateY(-1px); }
.subscription-badge { color: var(--pink-2); font-size: 10px; font-weight: 700; }
.subscription-cta.is-disabled { opacity: .5; box-shadow: none; }

/* Connexion / landing */
.auth-page { overflow-y: auto; overflow-x: hidden; height: 100vh; height: 100dvh; color: var(--text); background: radial-gradient(1100px 620px at 15% -10%, rgba(237, 63, 123, .16) 0%, transparent 45%), radial-gradient(900px 620px at 90% 105%, rgba(124, 92, 255, .16) 0%, transparent 45%), var(--bg); }
.auth-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); grid-template-rows: auto 1fr auto; column-gap: clamp(32px, 6vw, 110px); align-items: start; width: min(1040px, 100%); height: 100vh; height: 100dvh; margin: 0 auto; padding: clamp(16px, 3vh, 32px) clamp(18px, 3vw, 24px) clamp(14px, 2.5vh, 28px); }
.auth-shell .brand { grid-column: 1 / -1; justify-self: start; margin-bottom: clamp(10px, 2.4vh, 24px); font-size: clamp(18px, 2.2vw, 22px); flex: 0 0 auto; }
.auth-intro { grid-column: 1; grid-row: 2; display: grid; gap: clamp(10px, 1.8vh, 18px); width: min(500px, 100%); max-width: 500px; align-self: center; justify-self: center; }
.auth-intro h1 { margin: 0; color: var(--text); font: 700 clamp(24px, 3.2vw, 36px)/1.15 "Manrope", Arial, sans-serif; letter-spacing: -.03em; }
.auth-intro h1 span { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-intro p { margin: 0; color: var(--muted); font-size: clamp(13px, 1.3vw, 15px); line-height: 1.55; }
.auth-card { grid-column: 2; grid-row: 2; display: grid; gap: clamp(10px, 1.6vh, 18px); width: 100%; justify-self: stretch; align-self: center; padding: clamp(18px, 2.6vh, 30px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--panel) 0%, var(--panel-soft) 100%); box-shadow: var(--shadow-soft), var(--shadow-glow); max-height: 100%; overflow-y: auto; }
.auth-heading { display: grid; gap: 4px; }
.auth-step { margin: 0; color: var(--pink-2); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h2 { margin: 0; color: var(--text); font: 700 clamp(18px, 2vw, 22px)/1.2 "Manrope", Arial, sans-serif; }
.auth-form { display: grid; gap: clamp(5px, 1vh, 8px); }
.auth-form label { margin-top: 3px; color: var(--muted); font-size: 12px; }
.auth-form input { width: 100%; padding: clamp(10px, 1.6vh, 13px) 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: var(--bg); font-size: 14px; transition: .15s ease; }
.auth-form input:focus { outline: 0; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(237, 63, 123, .16); }
.auth-form input::placeholder { color: var(--muted-dark); }
.auth-form button { margin-top: 8px; padding: clamp(10px, 1.6vh, 13px) 16px; border: 0; border-radius: var(--radius-sm); color: #fff; background: var(--grad-brand); font-size: 14px; font-weight: 700; box-shadow: 0 10px 24px rgba(237, 63, 123, .28); transition: .18s ease; }
.auth-form button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(237, 63, 123, .36); }
.auth-resend button { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: transparent; font-size: 12px; transition: .15s ease; }
.auth-resend button:hover { border-color: var(--pink-soft); background: var(--panel-hover); }
.auth-error, .auth-success { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12px; line-height: 1.4; }
.auth-error { border: 1px solid #6b2942; color: #ffb6c8; background: #2a0f1a; }
.auth-success { border: 1px solid #34724c; color: #b9efcf; background: #0f2419; }
.auth-links { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.auth-links a { color: var(--text); text-decoration: none; }
.auth-links a:hover { color: var(--pink-2); }
.auth-register-link { color: var(--pink-2) !important; font-weight: 700; }

@media (max-width: 760px) {
  .theme-toggle-login { top: 14px; right: 14px; }
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open, .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .history-button { display: grid; }
  .sidebar-backdrop { position: fixed; z-index: 15; inset: 0; border: 0; background: #0009; }
  .sidebar-backdrop[hidden] { display: none; }
  .sidebar-open .sidebar-backdrop { display: block; }
  .chat-header { height: 64px; flex-basis: 64px; padding: 12px 16px; }
  .messages { padding-right: 16px; padding-left: 16px; }
  .composer-wrap { padding-right: 16px; padding-left: 16px; }
  .message .bubble, .message.user .bubble { max-width: 88%; }
  .subscription-options { grid-template-columns: 1fr; }
  .auth-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 3.4vh, 30px); height: auto; min-height: 100vh; min-height: 100dvh; padding: clamp(16px, 3vh, 22px) 16px clamp(24px, 4vh, 40px); }
  .auth-shell .brand { margin-bottom: 2px; align-self: center; }
  .auth-intro, .auth-card { width: 100%; max-width: none; }
  .auth-intro { justify-self: stretch; align-self: auto; gap: 10px; text-align: center; justify-items: center; }
  .auth-card { align-self: stretch; max-height: none; }
}

@media (max-width: 520px) {
  .welcome h2 { font-size: 23px; }
  .welcome-symbol { width: 62px; height: 62px; }
  .composer { padding-left: 12px; }
  .app-shell { height: 100dvh; }
  .sidebar { width: min(280px, 88vw); }
  .auth-shell { padding: clamp(14px, 3vh, 20px) 14px clamp(20px, 4vh, 32px); }
  .auth-intro h1 { font-size: clamp(20px, 6.5vw, 24px); }
  .auth-card { padding: 18px; }
}

@media (max-height: 700px) and (min-width: 761px) { .auth-shell { grid-template-rows: auto 1fr auto; padding-top: 14px; padding-bottom: 14px; } .auth-shell .brand { margin-bottom: 8px; } }
