/* ---------- Шрифты ----------
   Inter — весь интерфейс: текст пользователя, названия чатов, модели, кнопки.
   Georgia — русский текст приветствий и ответов модели (системный).
   PT Sans — английский текст приветствий и ответов; если не загрузился — Georgia. */
@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face { font-family: 'PT Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/pt-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'PT Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/pt-sans-latin-700-normal.woff2') format('woff2'); }

/* ---------- Токены ---------- */
:root {
  color-scheme: dark;
  --bg: #161615;
  --side: #1c1b1a;
  --surface: #211f1e;
  --surface-2: #2a2826;
  --hover: rgba(255, 255, 255, .06);
  --line: #34312e;
  --text: #ece9e2;
  --muted: #9b968b;
  --accent: #d56f51;
  --accent-text: #e8896c;
  --on-accent: #1d1210;
  --danger: #e5706a;
  --ok: #7fbf8f;
  --code-bg: #1a1918;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ru: Georgia, 'Times New Roman', serif;
  --en: 'PT Sans', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #faf9f5;
  --side: #f1eee6;
  --surface: #ffffff;
  --surface-2: #ece8dd;
  --hover: rgba(40, 30, 20, .06);
  --line: #e2ddd0;
  --text: #201e1c;
  --muted: #6d685e;
  --accent: #d56f51;
  --accent-text: #b4553a;
  --on-accent: #ffffff;
  --danger: #c4453e;
  --ok: #2f7d4a;
  --code-bg: #f3f0e7;
  --shadow: 0 8px 30px rgba(60, 40, 20, .14);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #faf9f5;
    --side: #f1eee6;
    --surface: #ffffff;
    --surface-2: #ece8dd;
    --hover: rgba(40, 30, 20, .06);
    --line: #e2ddd0;
    --text: #201e1c;
    --muted: #6d685e;
    --accent-text: #b4553a;
    --on-accent: #ffffff;
    --danger: #c4453e;
    --ok: #2f7d4a;
    --code-bg: #f3f0e7;
    --shadow: 0 8px 30px rgba(60, 40, 20, .14);
  }
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* Серифные тексты: язык определяется по самому тексту, а не по языку интерфейса */
[data-s='ru'] { font-family: var(--ru); }
[data-s='en'] { font-family: var(--en); }

/* ---------- Раскладка ---------- */
.app { height: 100dvh; display: grid; grid-template-columns: 284px minmax(0, 1fr); }
.app.panel-open { grid-template-columns: 284px minmax(0, 1fr) minmax(0, 580px); }

.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-top { padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 22px/1 var(--ru); letter-spacing: -.01em; padding: 2px 6px; }
.brand img { width: 24px; height: 24px; }
.btn-new {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; font-weight: 500;
  color: var(--accent-text);
}
.btn-new:hover { background: var(--hover); }
.btn-new .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }

.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 0; }
.chat-group { padding: 14px 10px 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.chat-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.chat-item:hover, .chat-item.active { background: var(--hover); }
.chat-item.active { background: var(--surface-2); }
.chat-item .title { flex: 1; min-width: 0; text-align: left; padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .acts { display: none; gap: 2px; padding-right: 4px; }
.chat-item:hover .acts, .chat-item:focus-within .acts { display: flex; }
.chat-item .acts button { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.chat-item .acts button:hover { background: var(--hover); color: var(--text); }
.chat-item input { flex: 1; min-width: 0; margin: 3px 6px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--accent); background: var(--bg); outline: none; }
.empty-list { padding: 14px 12px; color: var(--muted); }

.side-foot { padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan-name { font-weight: 600; }
.plan-sub { color: var(--muted); font-size: 12.5px; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s; }
.meter.warn > i { background: var(--danger); }
.btn-buy { padding: 8px 12px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-align: center; }
.btn-buy:hover { filter: brightness(1.07); }
.btn-ghost { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); text-align: center; }
.btn-ghost:hover { background: var(--hover); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; width: 100%; text-align: left; }
.user-row:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; color: var(--accent-text); flex: none; }
.user-row .uname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Основная область ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: none; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.topbar .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.thread { flex: 1; overflow-y: auto; min-height: 0; padding: 28px 20px 8px; scroll-behavior: auto; }
.thread-in { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.hello { display: none; align-items: center; justify-content: center; gap: 16px; padding: 0 20px 28px; text-align: center; }
.hello img { width: 38px; height: 38px; flex: none; }
.hello h1 { margin: 0; font-weight: 400; font-size: clamp(28px, 4.4vw, 42px); line-height: 1.15; letter-spacing: -.005em; }
.main.empty .stage { justify-content: center; }
.main.empty .thread { display: none; }
.main.empty .hello { display: flex; }
.main.empty .stage > .composer-wrap { padding-bottom: 8vh; }

.msg.user { align-self: flex-end; max-width: min(85%, 640px); background: var(--surface-2); padding: 10px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.55; }
.msg.ai { font-size: 17px; line-height: 1.72; overflow-wrap: anywhere; position: relative; }
.msg.ai > :first-child { margin-top: 0; }
.msg.ai > :last-child { margin-bottom: 0; }
.msg.ai p { margin: 0 0 .85em; }
.msg.ai h1, .msg.ai h2, .msg.ai h3, .msg.ai h4 { margin: 1.3em 0 .5em; line-height: 1.3; font-weight: 700; }
.msg.ai h1 { font-size: 1.45em; } .msg.ai h2 { font-size: 1.28em; } .msg.ai h3 { font-size: 1.12em; } .msg.ai h4 { font-size: 1em; }
.msg.ai ul, .msg.ai ol { margin: 0 0 .85em; padding-left: 1.5em; }
.msg.ai li { margin: .25em 0; }
.msg.ai li > ul, .msg.ai li > ol { margin: .25em 0 0; }
.msg.ai blockquote { margin: 0 0 .85em; padding: .1em 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.msg.ai hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.msg.ai code { font: .86em var(--mono); background: var(--surface-2); padding: .12em .38em; border-radius: 6px; }
.msg.ai .tbl { overflow-x: auto; margin: 0 0 .9em; }
.msg.ai table { border-collapse: collapse; font-size: .92em; min-width: 50%; }
.msg.ai th, .msg.ai td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.msg.ai th { background: var(--surface); font-weight: 700; }
.msg.ai .code { margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); overflow: hidden; font-family: var(--sans); }
.msg.ai .code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--line); font: 12.5px var(--sans); color: var(--muted); }
.msg.ai .code-head button { padding: 3px 8px; border-radius: 7px; color: var(--muted); }
.msg.ai .code-head button:hover { background: var(--hover); color: var(--text); }
.msg.ai pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13.5px/1.6 var(--mono); tab-size: 2; }
.msg.ai pre code { background: none; padding: 0; font: inherit; }
.msg.ai.streaming > :last-child::after { content: ''; display: inline-block; width: .5em; height: .5em; margin-left: .25em; border-radius: 50%; background: var(--accent); vertical-align: baseline; animation: pulse 1s ease-in-out infinite; }
.msg.ai.streaming pre::after, .msg.ai.streaming .code::after, .msg.ai.streaming .tbl::after { content: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.msg-tools { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg.ai:hover .msg-tools, .msg.ai:focus-within .msg-tools { opacity: 1; }
.msg-tools button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.msg-tools button:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .msg-tools { opacity: 1; } }

.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 14px var(--sans); }
.thinking img { width: 18px; height: 18px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.activity { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.activity .ic { width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.activity .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity.fail { color: var(--danger); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.artifact { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 460px; padding: 11px 14px 11px 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; text-decoration: none; color: inherit; transition: border-color .15s, background .15s; }
.artifact:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: var(--surface-2); }
.artifact.active { border-color: var(--accent); }
.artifact .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.artifact:hover .ico { background: var(--bg); }
.artifact .meta { flex: 1; min-width: 0; }
.artifact .nm { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact .sub { color: var(--muted); font-size: 12.5px; }
.artifact .go { color: var(--muted); flex: none; }

.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.src { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.src:hover { color: var(--text); background: var(--hover); }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; max-width: 560px; }
.notice.err { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.notice p { margin: 0; }
.notice .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Ввод ---------- */
.composer-wrap { padding: 8px 20px max(16px, env(safe-area-inset-bottom)); }
.composer { container-type: inline-size; max-width: 760px; margin: 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 24px; padding: 14px 14px 10px 18px; box-shadow: 0 2px 14px rgba(0, 0, 0, .12); transition: border-color .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; background: none; resize: none; font-size: 16px; line-height: 1.5; min-height: 26px; max-height: 240px; padding: 0 4px 0 0; }
.composer textarea::placeholder { color: var(--muted); }
.tools { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: nowrap; }
.tool { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.tool:hover, .tool[aria-expanded='true'] { background: var(--hover); color: var(--text); }
.tool b { font-weight: 500; color: var(--text); }
.tool.agent[aria-pressed='true'] { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tool .box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.tool.agent[aria-pressed='true'] .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tool .box svg { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.tool.agent[aria-pressed='true'] .box svg { opacity: 1; }
.tool .box svg.lock { opacity: 1; width: 14px; height: 14px; stroke-width: 1.8; }
.spacer { flex: 1; }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: opacity .15s, transform .15s; }
.send:disabled { opacity: .35; }
.send:not(:disabled):hover { transform: scale(1.06); }
.foot-note { max-width: 760px; margin: 8px auto 0; text-align: center; color: var(--muted); font-size: 12px; }

@container (max-width: 500px) { .tool .lbl-hide { display: none; } .tool { padding: 6px 8px; } }

/* ---------- Всплывающее ---------- */
.pop { position: fixed; z-index: 80; min-width: 230px; max-width: min(340px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.pop .it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; }
.pop .it:hover:not(:disabled) { background: var(--hover); }
.pop .it:disabled { opacity: .55; }
.pop .it .tx { flex: 1; min-width: 0; }
.pop .it .sub { color: var(--muted); font-size: 12.5px; }
.pop .it .tag { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); font-weight: 600; }
.pop .it .ck { width: 18px; color: var(--accent-text); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pop .it.danger { color: var(--danger); }

.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.modal h2 { margin: 0; font: 400 24px/1.25 var(--ru); }
.modal p { margin: 0; color: var(--muted); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.input:focus { border-color: var(--accent); }
.key-input { text-align: center; font: 600 22px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.err-text { color: var(--danger); font-size: 13.5px; min-height: 1.2em; }
.ok-text { color: var(--ok); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; animation: fade .2s; max-width: calc(100vw - 32px); }

/* ---------- Панель артефактов ---------- */
.panel { display: none; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); border-left: 1px solid var(--line); }
.app.panel-open .panel { display: flex; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-head .ttl { flex: 1; min-width: 0; }
.panel-head .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .sub { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg button { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.seg button[aria-selected='true'] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.panel-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.panel-body pre { margin: 0; padding: 16px 18px; font: 13px/1.65 var(--mono); tab-size: 2; white-space: pre; min-width: max-content; }
.panel-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.panel-body .md { padding: 20px 24px; font-size: 16px; line-height: 1.7; }
.panel-body .md.msg { align-self: auto; }
.panel-load { padding: 24px; color: var(--muted); }

/* ---------- Авторизация ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; }
.auth-top { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 14px; font: 700 40px/1 var(--ru); letter-spacing: -.01em; }
.auth-brand img { width: 40px; height: 40px; }
.auth-tag { text-align: center; font-size: 17px; margin: -4px 0 4px; color: var(--muted); }
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.auth-box .seg { align-self: stretch; }
.auth-box .seg button { flex: 1; padding: 8px; }
.big-code { text-align: center; font: 700 30px/1.2 var(--mono); letter-spacing: .08em; padding: 18px 10px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--accent); user-select: all; overflow-wrap: anywhere; }
.steps { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.steps b { color: var(--text); font-weight: 600; }
.link-btn { color: var(--accent-text); text-align: center; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Адаптив ---------- */
.scrim { display: none; }
@media (max-width: 1099px) {
  .app.panel-open { grid-template-columns: 284px minmax(0, 1fr); }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); z-index: 60; box-shadow: var(--shadow); }
}
@media (max-width: 820px) {
  .app, .app.panel-open { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); z-index: 70; transform: translateX(-102%); transition: transform .22s; }
  .app.menu-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .5); }
  .topbar { display: flex; }
  .thread { padding: 18px 14px 6px; }
  .composer-wrap { padding: 6px 10px max(10px, env(safe-area-inset-bottom)); }
  .main.empty .stage > .composer-wrap { padding-bottom: 4vh; }
  .hello { flex-direction: column; gap: 10px; }
  .msg.ai { font-size: 16.5px; }
  .tool .lbl-hide { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
