:root {
    --bg: #0e0f13;
    --side: #09090c;
    --surface: #17181e;
    --surface-2: #20222a;
    --hover: rgba(255, 255, 255, .06);
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #ededf1;
    --dim: #8d8f9b;
    --faint: #5d5f6b;
    --accent: #8f7dff;
    --accent-2: #4fd1ff;
    --accent-soft: rgba(143, 125, 255, .16);
    --danger: #ff6b7a;
    --cta-bg: #f4f4f6;
    --cta-fg: #0e0f13;
    --code-bg: #0a0a0e;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 50px -12px rgba(0, 0, 0, .65);
    --pop-shadow: 0 20px 60px -10px rgba(0, 0, 0, .7), 0 0 0 1px var(--line);
    --t-c: #6b7083; --t-s: #9ad9a0; --t-n: #f2b880; --t-k: #b3a4ff; --t-f: #7cc7ff; --t-v: #f08fb4;
    --side-w: 268px;
    --col-w: 760px;
    --font: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
    --bg: #ffffff;
    --side: #f6f6f8;
    --surface: #ffffff;
    --surface-2: #f1f1f5;
    --hover: rgba(15, 15, 30, .05);
    --line: rgba(15, 15, 30, .09);
    --line-strong: rgba(15, 15, 30, .2);
    --text: #15161b;
    --dim: #6a6c79;
    --faint: #a0a2ae;
    --accent: #6a56f0;
    --accent-2: #1aa5d8;
    --accent-soft: rgba(106, 86, 240, .12);
    --danger: #d9364a;
    --cta-bg: #15161b;
    --cta-fg: #ffffff;
    --code-bg: #f7f7fa;
    --shadow: 0 12px 40px -12px rgba(20, 20, 50, .18), 0 2px 6px rgba(20, 20, 50, .04);
    --pop-shadow: 0 18px 50px -10px rgba(20, 20, 50, .22), 0 0 0 1px var(--line);
    --t-c: #9a9cab; --t-s: #2f8a47; --t-n: #b5651d; --t-k: #6a45e0; --t-f: #1672c4; --t-v: #c2356f;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font: 15.5px/1.65 var(--font);
    letter-spacing: -.006em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Каркас ---------- */

.app { display: flex; height: 100dvh; }

.sidebar {
    width: var(--side-w); flex: none;
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px;
    background: var(--side);
    border-right: 1px solid var(--line);
    transition: margin-left .28s var(--ease), transform .28s var(--ease);
}
.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--side-w)); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.backdrop { display: none; }

/* ---------- Боковая панель ---------- */

.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 10px 6px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand-mark {
    width: 24px; height: 24px; border-radius: 8px; position: relative;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 4px 14px -2px var(--accent-soft);
}
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--side); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px;
    color: var(--dim);
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.new-chat {
    display: flex; align-items: center; gap: 10px;
    width: 100%; height: 40px; padding: 0 12px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 14px; font-weight: 500;
    transition: border-color .15s, background .15s;
}
.new-chat:hover { border-color: var(--line-strong); background: var(--surface-2); }
.new-chat svg { width: 16px; height: 16px; }
.new-chat kbd { margin-left: auto; font: 500 11px var(--font); color: var(--faint); }

.search {
    display: flex; align-items: center; gap: 9px;
    margin-top: 4px; padding: 0 12px; height: 38px; border-radius: 12px;
    color: var(--faint);
    transition: background .15s;
}
.search:hover, .search:focus-within { background: var(--hover); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14px; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }

.chat-list { flex: 1; overflow-y: auto; margin: 4px -6px 0; padding: 0 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.group-title { padding: 16px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

.chat-item { position: relative; display: flex; align-items: center; border-radius: 10px; font-size: 14px; color: var(--dim); transition: background .12s, color .12s; }
.chat-item:hover { background: var(--hover); color: var(--text); }
.chat-item.active { background: var(--surface-2); color: var(--text); }
.chat-open { flex: 1; min-width: 0; padding: 8px 10px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tools { display: none; padding-right: 4px; }
.chat-item:hover .chat-tools, .chat-item:focus-within .chat-tools { display: flex; }
.chat-tools button { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--dim); }
.chat-tools button:hover { background: var(--hover); color: var(--text); }
.chat-tools button[data-act="delete"]:hover { color: var(--danger); }
.chat-tools svg { width: 14px; height: 14px; }
.chat-rename { flex: 1; min-width: 0; margin: 3px; padding: 5px 7px; border-radius: 7px; background: var(--bg); border: 1px solid var(--accent); outline: 0; font-size: 14px; color: var(--text); }

.empty-list { padding: 28px 10px; font-size: 13.5px; line-height: 1.5; color: var(--faint); text-align: center; }

.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
.lang-picker { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 10px; color: var(--dim); cursor: pointer; transition: background .15s, color .15s; }
.lang-picker:hover, .lang-picker:focus-within { background: var(--hover); color: var(--text); }
.lang-picker svg { width: 16px; height: 16px; }
.lang-picker select { appearance: none; -webkit-appearance: none; background: none; border: 0; outline: 0; padding: 0; font: 500 13px var(--font); color: inherit; cursor: pointer; }
.lang-picker select option { background: var(--surface); color: var(--text); }
.sidebar-bottom .tools { display: flex; gap: 2px; }
#clearAll:hover { color: var(--danger); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* ---------- Шапка ---------- */

.topbar {
    position: absolute; inset: 0 0 auto 0; z-index: 5;
    display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 12px;
    background: linear-gradient(var(--bg) 55%, transparent);
    pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar-title { flex: 1; min-width: 0; padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#openSidebar, #newChatTop { display: none; }
.sidebar-collapsed #openSidebar, .sidebar-collapsed #newChatTop { display: inline-grid; }

/* ---------- Лента ---------- */

.scroll { flex: 1; overflow-y: auto; padding-top: 56px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.welcome { display: none; text-align: center; padding: 0 20px 30px; }
.welcome h1 {
    margin: 0; font-size: clamp(30px, 4.6vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -.035em;
    background: linear-gradient(100deg, var(--text) 30%, var(--accent) 75%, var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.welcome p { margin: 12px 0 0; font-size: 17px; color: var(--dim); }

.messages { width: 100%; max-width: var(--col-w); margin: 0 auto; padding: 8px 20px 36px; }

.msg { display: flex; flex-direction: column; margin: 22px 0; }
.msg.enter { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.msg.user { align-items: flex-end; }
.bubble {
    max-width: min(82%, 580px);
    padding: 10px 18px; border-radius: 22px 22px 6px 22px;
    background: var(--surface-2);
    white-space: pre-wrap; overflow-wrap: anywhere;
}

.msg-actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions, .msg.assistant:last-child .msg-actions { opacity: 1; }
.msg.assistant .msg-actions { margin-left: -8px; }
.msg-actions .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.msg-actions svg { width: 15px; height: 15px; }
.msg.streaming .msg-actions { visibility: hidden; }

.error-box {
    display: flex; gap: 10px; padding: 12px 16px; border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    background: color-mix(in srgb, var(--danger) 9%, transparent);
    color: var(--danger); font-size: 14.5px; overflow-wrap: anywhere;
}

.typing { display: inline-block; width: 12px; height: 12px; margin: 7px 0; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .55; } 50% { transform: scale(1.1); opacity: 1; } }

/* ---------- Markdown ---------- */

.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 28px 0 10px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; }
.md h1 { font-size: 1.5em; } .md h2 { font-size: 1.28em; } .md h3 { font-size: 1.12em; }
.md h4, .md h5, .md h6 { font-size: 1em; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 24px; }
.md li { margin: 5px 0; padding-left: 2px; }
.md li::marker { color: var(--faint); }
.md li > ul, .md li > ol { margin: 5px 0; }
.md strong { font-weight: 600; }
.md a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); transition: border-color .15s; }
.md a:hover { border-color: var(--accent); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); color: var(--dim); }
.md code { font-family: var(--mono); font-size: .86em; padding: .16em .42em; border-radius: 6px; background: var(--surface-2); }

.md .code { margin: 4px 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--code-bg); overflow: hidden; }
.md .code-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 8px 0 16px; font: 500 12px var(--mono); color: var(--dim); border-bottom: 1px solid var(--line); }
.md .copy-code { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 7px; font: 500 12px var(--font); color: var(--dim); }
.md .copy-code:hover { background: var(--hover); color: var(--text); }
.md .copy-code svg { width: 13px; height: 13px; }
.md pre { margin: 0; padding: 14px 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.md pre code { padding: 0; background: none; font-size: 13px; line-height: 1.65; white-space: pre; }
.t-c { color: var(--t-c); font-style: italic; } .t-s { color: var(--t-s); } .t-n { color: var(--t-n); }
.t-k { color: var(--t-k); } .t-f { color: var(--t-f); } .t-v { color: var(--t-v); }

.md .table-wrap { overflow-x: auto; margin: 4px 0 18px; border: 1px solid var(--line); border-radius: 14px; }
.md table { border-collapse: collapse; min-width: 100%; font-size: 14.5px; }
.md th, .md td { padding: 10px 16px; text-align: left; vertical-align: top; }
.md th { font-size: 12.5px; font-weight: 600; color: var(--dim); white-space: nowrap; background: var(--hover); }
.md td { border-top: 1px solid var(--line); }

/* ---------- Поле ввода ---------- */

.composer-wrap { flex: none; padding: 0 20px 12px; position: relative; z-index: 2; }

.composer {
    max-width: var(--col-w); margin: 0 auto;
    padding: 14px 12px 10px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }

.composer textarea {
    display: block; width: 100%; resize: none;
    max-height: 220px; padding: 2px 6px 2px 0;
    background: none; border: 0; outline: 0;
    font-size: 16px; line-height: 1.55; scrollbar-width: thin;
}
.composer textarea::placeholder { color: var(--dim); }

.composer-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 0 -8px; }
.composer-row .spacer { flex: 1; }
.kbd-hint { font-size: 12px; color: var(--faint); }

.model-picker { position: relative; }
.model-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 10px 0 10px; border-radius: 999px;
    font-size: 13.5px; font-weight: 500; color: var(--dim);
    transition: background .15s, color .15s;
}
.model-btn:hover, .model-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.model-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.model-btn svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.model-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.model-menu {
    position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
    width: 280px; padding: 6px; border-radius: 16px;
    background: var(--surface); box-shadow: var(--pop-shadow);
    animation: pop .18s var(--ease) both; transform-origin: bottom left;
}
.model-menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.model-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; }
.model-opt:hover { background: var(--hover); }
.model-opt b { display: block; font-size: 14px; font-weight: 500; }
.model-opt small { display: block; font-size: 12.5px; line-height: 1.4; color: var(--dim); }
.model-opt svg { margin-left: auto; width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.model-opt[aria-selected="true"] svg { visibility: visible; }

.send {
    width: 36px; height: 36px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--cta-bg); color: var(--cta-fg);
    transition: opacity .15s, transform .2s var(--ease), background .15s;
}
.send:hover:not(:disabled) { transform: scale(1.07); }
.send:active:not(:disabled) { transform: scale(.95); }
.send:disabled { background: var(--surface-2); color: var(--faint); cursor: default; }
.send svg { stroke-width: 2.2; }

.suggestions { display: none; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: var(--col-w); margin: 18px auto 0; }
.suggestion {
    height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--line); font-size: 13.5px; color: var(--dim);
    transition: background .15s, border-color .15s, color .15s, transform .2s var(--ease);
}
.suggestion:hover { background: var(--hover); border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }

.hint { max-width: var(--col-w); margin: 10px auto 0; text-align: center; font-size: 12px; color: var(--faint); }

.to-bottom {
    position: absolute; left: 50%; bottom: 150px; z-index: 3; transform: translateX(-50%);
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); box-shadow: var(--pop-shadow);
}
.to-bottom[hidden] { display: none; }
.to-bottom svg { width: 16px; height: 16px; }

/* ---------- Стартовый экран: всё по центру ---------- */

.main.empty { justify-content: center; padding-bottom: 9vh; }
.main.empty::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: 42%;
    width: min(760px, 92%); height: 380px; transform: translate(-50%, -50%);
    background:
        radial-gradient(closest-side at 35% 50%, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
        radial-gradient(closest-side at 70% 55%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent);
    filter: blur(40px); pointer-events: none;
}
.main.empty .scroll { flex: none; overflow: visible; padding-top: 0; }
.main.empty .welcome { display: block; }
.main.empty .messages { display: none; }
.main.empty .suggestions { display: flex; }
.main.empty .composer-wrap { position: static; }
.main.empty .hint { position: absolute; left: 0; right: 0; bottom: 12px; max-width: none; }
.main.empty .to-bottom { display: none; }
.main.empty .welcome, .main.empty .composer, .main.empty .suggestions { animation: rise .5s var(--ease) both; }
.main.empty .composer { animation-delay: .05s; }
.main.empty .suggestions { animation-delay: .1s; }

/* ---------- Мобильная версия ---------- */

@media (max-width: 820px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 30;
        width: min(86vw, 320px); margin-left: 0 !important;
        transform: translateX(-100%);
        padding-top: max(12px, env(safe-area-inset-top));
    }
    .sidebar-open .sidebar { transform: none; }
    .backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .28s; }
    .sidebar-open .backdrop { opacity: 1; pointer-events: auto; }
    #openSidebar, #newChatTop { display: inline-grid !important; }
    .chat-tools { display: flex; }
    .new-chat kbd, .kbd-hint { display: none; }
    .messages { padding: 4px 16px 28px; }
    .composer-wrap { padding: 0 10px max(8px, env(safe-area-inset-bottom)); }
    .composer { border-radius: 22px; padding: 12px 10px 8px 16px; }
    .msg-actions { opacity: 1; }
    .suggestions { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -10px; padding-inline: 10px; scrollbar-width: none; }
    .suggestion { flex: none; }
    .main.empty { padding-bottom: 6vh; }
    .model-menu { width: min(280px, calc(100vw - 40px)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ссылки на документы и страница legal.php ---------- */

.hint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.hint a:hover { color: var(--text); }

.legal-body { overflow: auto; }
.legal-top {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 24px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.legal-top .brand { color: var(--text); text-decoration: none; }
.legal-nav { display: flex; gap: 4px; flex: 1; }
.legal-nav a, .legal-langs a { padding: 6px 12px; border-radius: 9px; color: var(--dim); text-decoration: none; font-size: 14px; }
.legal-nav a:hover, .legal-langs a:hover { color: var(--text); background: var(--hover); }
.legal-nav a[aria-current], .legal-langs a[aria-current] { color: var(--text); background: var(--surface-2); }
.legal-langs { display: flex; gap: 2px; }
.legal-langs a { padding: 6px 9px; font-size: 12.5px; font-weight: 600; }

.legal { max-width: 760px; margin: 0 auto; padding: 36px 24px 80px; }
.legal-back { color: var(--dim); text-decoration: none; font-size: 14px; }
.legal-back:hover { color: var(--text); }
.legal h1 { margin: 18px 0 6px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.03em; font-weight: 600; }
.legal-date { margin: 0 0 32px; color: var(--dim); font-size: 14px; }
.legal-text h2 { margin: 34px 0 10px; font-size: 1.15em; }
.legal-text p, .legal-text li { color: color-mix(in srgb, var(--text) 88%, var(--dim)); }

@media (max-width: 640px) {
    .legal-top { gap: 10px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
    .legal-top .brand span:last-child { display: none; }
    .legal-nav { order: 3; flex-basis: 100%; margin: 0 -8px; }
    .legal-langs { margin-left: auto; }
    .legal { padding: 24px 18px 60px; }
}

/* Название бренда: «IA» выделено градиентом (ChatIAGratis) */
.brand-name { letter-spacing: -.02em; }
.brand-ia {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 700;
}

/* ---------- Картинки ---------- */

.mode-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
    font-size: 13.5px; font-weight: 500; color: var(--dim);
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.mode-btn svg { width: 16px; height: 16px; }
.mode-btn:hover { background: var(--hover); color: var(--text); }
.mode-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.composer.image-mode { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.composer.image-mode .model-picker { display: none; }

.bubble-image svg { width: 15px; height: 15px; margin: 0 7px -2px 0; color: var(--accent); }

.suggestion-image { display: inline-flex; align-items: center; gap: 7px; color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.suggestion-image svg { width: 15px; height: 15px; color: var(--accent); }

.img-card {
    position: relative; width: min(100%, 440px); aspect-ratio: 1;
    border-radius: 18px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--line);
}
.img-card a, .img-card img { display: block; width: 100%; height: 100%; }
.img-card img { object-fit: cover; animation: img-in .5s var(--ease) both; }
@keyframes img-in { from { opacity: 0; transform: scale(1.02); filter: blur(8px); } }

.img-card.loading { display: grid; place-items: center; }
.img-shimmer {
    position: absolute; inset: 0;
    background:
        radial-gradient(60% 60% at 30% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent),
        radial-gradient(50% 50% at 75% 70%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent);
    filter: blur(20px);
    animation: img-breathe 3.2s ease-in-out infinite alternate;
}
@keyframes img-breathe { from { transform: scale(1) rotate(0deg); opacity: .6; } to { transform: scale(1.25) rotate(25deg); opacity: 1; } }
.img-status { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(6px); }
.img-status svg { width: 16px; height: 16px; color: var(--accent); animation: pulse 1.4s ease-in-out infinite; }

.msg-actions a.icon-btn { text-decoration: none; }

@media (max-width: 820px) {
    .mode-btn span { display: none; }
    .mode-btn { padding: 0 9px; }
}
