:root {
  color-scheme: light;
  /* 2026 calm-precision (Linear/Vercel): tinted neutrals, single warm accent */
  --bg: #FAFAFA;
  --txt: #18181B;
  --muted: #71717A;
  --sub: #52525B;
  --line: #E3E8E6;
  --a1: #0E8C7E;
  --a2: #12A596;
  --accent: #0E8C7E;
  --accent-ink: #0B6B60;
  --accent-warn: #B45309;
  --accent-tint: rgba(14, 140, 126, 0.10);
  --accent-tint-2: rgba(14, 140, 126, 0.14);
  --ok: #22C55E;
  --err: #EF4444;
  --glass: #FFFFFF;
  --glass-strong: #FFFFFF;
  --glass-soft: #FAFAFA;
  --field: #FAFAFA;
  --field-focus: #FFFFFF;
  --edge: #E3E8E6;
  --fill: #F1F6F4;
  --hover: #E7F1EE;
  --ink6: rgba(24, 24, 27, 0.04);
  --ink16: rgba(24, 24, 27, 0.08);
  --ink28: rgba(24, 24, 27, 0.14);
  --pre: #F1F6F4;
  --dash: #C5D1CD;
  --knob: #fff;
  --gloss: transparent;
  --hi: none;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --glow: none;
  --blur: none;
  --blob1: transparent;
  --blob2: transparent;
  --blob3: transparent;
  --blob4: transparent;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Golos Text', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;
  --display: 'Manrope', 'Golos Text', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --card: 10px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090B;
  --txt: #FAFAFA;
  --muted: #71717A;
  --sub: #A1A1AA;
  --line: #222827;
  --a1: #4FB2A6;
  --a2: #6FC9BD;
  --accent: #4FB2A6;
  --accent-ink: #80D6CA;
  --accent-warn: #E6B45C;
  --accent-tint: rgba(79, 178, 166, 0.13);
  --accent-tint-2: rgba(79, 178, 166, 0.18);
  --glass: #0D1211;
  --glass-strong: #141A18;
  --glass-soft: #0D1211;
  --field: #141A18;
  --field-focus: #222827;
  --edge: #222827;
  --fill: #141A18;
  --hover: #222827;
  --ink6: rgba(255, 255, 255, 0.04);
  --ink16: rgba(255, 255, 255, 0.08);
  --ink28: rgba(255, 255, 255, 0.14);
  --pre: #141A18;
  --dash: #39413E;
  --gloss: transparent;
  --hi: none;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --glow: none;
  --blur: none;
  --blob1: transparent;
  --blob2: transparent;
  --blob3: transparent;
  --blob4: transparent;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  font-family: var(--font);
  color: var(--txt);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  transition: background .5s var(--ease), color .35s var(--ease);
}
/* фоновая сетка убрана по просьбе владельца — чистый фон как у Google AI */
body::before { content: none; }
/* один кинематографичный тёплый ambient-glow (акцент, очень мягко) */
body::after { content: ""; position: fixed; top: -18%; right: -8%; width: 52%; height: 62%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(79, 178, 166, .06) 0%, transparent 70%); }
@keyframes drift { 0%, 100% { transform: none; } }

button { font: inherit; cursor: pointer; border: none; color: inherit; background: none; -webkit-appearance: none; appearance: none; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 1.15em; height: 1.15em; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink16); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink28); }

/* стеклянная поверхность-миксин */
.glass-card {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: var(--shadow), var(--hi);
}

/* ---------- login ---------- */
#login { display: grid; place-items: center; height: 100vh; height: 100dvh; padding: 18px; }
.login-card {
  width: min(380px, 92vw);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); border-radius: 26px; padding: 34px 30px; box-shadow: var(--shadow), var(--hi);
  animation: pop .5s var(--spring) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); box-shadow: none; display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-word { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.03em; color: var(--txt); }
.brand .ic { color: var(--a2); }
.login-card p { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.field { width: 100%; padding: 13px 15px; margin-bottom: 12px; background: var(--field);
  border: 1px solid var(--line); border-radius: 14px; outline: none; box-shadow: var(--hi); }
.field:focus { border-color: var(--a1); background: var(--field-focus); }
.pass-wrap { position: relative; }
.pass-wrap .field { padding-right: 46px; }
.eye { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 10px; background: none; opacity: .55; display: grid; place-items: center; }
.eye:hover, .eye.on { opacity: 1; }
.btn-primary { width: 100%; padding: 13px; border-radius: 14px; font-weight: 700; background: var(--accent); color: #fff; box-shadow: var(--glow), var(--hi); }
.btn-primary:active { transform: translateY(1px); }
.err-msg { color: var(--err); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- app shell: плавающие стеклянные карточки ---------- */
#app { display: grid; grid-template-columns: 258px minmax(0,1fr) 320px; gap: 12px; padding: 12px; height: 100vh; height: 100dvh; }
@media (min-width: 901px) and (max-width: 1200px) {
  #app { grid-template-columns: 216px minmax(0,1fr) 288px; gap: 10px; padding: 10px; }
  .rail-tab { font-size: 11px; letter-spacing: -.03em; padding: 12px 1px; }
  .side-btn { font-size: 11px; padding: 9px 2px; }
}
.col { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sidebar, .rail, main.col {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); border-radius: var(--card); box-shadow: var(--shadow), var(--hi);
  overflow: hidden; animation: rise .5s var(--ease) both;
}
main.col { animation-delay: .05s; position: relative; } .rail { animation-delay: .1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.row { display: flex; align-items: center; gap: 8px; }

.side-head { padding: 16px 14px; }
.side-head .brand { font-size: 22px; }
.ws-row { display: flex; gap: 8px; margin-top: 12px; }
.ws-select { flex: 1; padding: 9px 10px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); color: var(--txt); outline: none; font-weight: 600; box-shadow: var(--hi); }
.ws-select:focus { border-color: var(--a1); }
.new-chat { width: 100%; margin-top: 10px; padding: 12px; border-radius: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; box-shadow: var(--glow), var(--hi); transition: transform .2s var(--ease), box-shadow .25s var(--ease); }
.new-chat:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.new-chat:active { transform: translateY(0); }
.icon-btn.on { background: var(--accent); color: #fff; }
.icon-btn.rec { background: var(--err); color: #fff; animation: pulse 1s infinite; }
.icon-btn.busy { opacity: .6; pointer-events: none; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.preview-frame { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.preview-img { max-width: 100%; border-radius: 12px; }
.chats { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.chat-item { padding: 10px 12px; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; align-items: center; color: var(--txt); }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--accent-tint); box-shadow: var(--hi); }
.chat-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
/* Секция служебных ⏰-диалогов (автопостинги/радары) — отделены от живых, сворачиваемая */
.chat-sec { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; margin-top: 8px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; border-top: 1px solid var(--border, rgba(128,128,128,.15)); user-select: none; }
.chat-sec:hover { color: var(--txt); }
.chat-sec .cs-caret { font-size: 11px; opacity: .7; }
.chat-sec-body .chat-item { opacity: .78; }
.chat-sec-body .chat-item:hover { opacity: 1; }
/* Массовое удаление: панель выбора + чекбоксы */
.chat-tools { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; margin-bottom: 2px; flex-wrap: wrap; }
.chat-tools.on { border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.chat-tools .ct-count { font-size: 12px; font-weight: 700; color: var(--txt); }
.chat-tools .ct-sp { flex: 1; }
.chat-tool-btn { font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); color: var(--txt); cursor: pointer; white-space: nowrap; }
.chat-tool-btn:hover { background: var(--hover); border-color: var(--a1); }
.chat-tool-btn.danger { background: #e5484d; border-color: #e5484d; color: #fff; }
.chat-tool-btn.danger:hover { filter: brightness(1.08); }
.chat-tool-btn:disabled { opacity: .45; cursor: default; filter: none; }
.chat-item .chat-cb { flex: none; width: 17px; height: 17px; accent-color: var(--a1); cursor: pointer; margin-right: 2px; }
.chat-item.sel { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--a1); }
/* Иконки действий скрыты по умолчанию — чистый список; проявляются при наведении на диалог (как в Linear/Telegram) */
.chat-item .x, .chat-item .rn { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); opacity: 0; transform: scale(.82); transition: opacity .15s var(--ease), transform .15s var(--ease), color .15s var(--ease), background .15s var(--ease); }
.chat-item .x svg, .chat-item .rn svg { width: 15px; height: 15px; }
.chat-item:hover .x, .chat-item:hover .rn,
.chat-item.active .x, .chat-item.active .rn { opacity: .6; transform: scale(1); }
.chat-item .rn:hover { opacity: 1; color: var(--a2); background: var(--accent-tint); }
.chat-item .x:hover { opacity: 1; color: var(--err); background: color-mix(in srgb, var(--err) 15%, transparent); }
/* На тач-устройствах hover нет — показываем иконки всегда, но тускло */
@media (hover: none) { .chat-item .x, .chat-item .rn { opacity: .5; transform: scale(1); } }
.side-tools { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.side-btn { flex: 1 1 0; min-width: 0; padding: 9px 4px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; justify-content: center; gap: 5px; box-shadow: var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.side-btn:hover { border-color: var(--a1); background: var(--hover); box-shadow: var(--shadow); }
.side-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.side-foot .u { font-size: 13px; color: var(--muted); }
.link { color: var(--muted); font-size: 13px; background: none; }
.link:hover { color: var(--a2); }

/* ---------- chat ---------- */
.topbar { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.topbar .grp { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 🚦 Светофор статуса агента в шапке: 🔴 думаю/ищу → 🟡 пишу → 🟢 готово → ⚪ жду */
.agent-state { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: -.01em; line-height: 1; background: var(--field); border: 1px solid var(--line); color: var(--muted); transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease); white-space: nowrap; }
.agent-state .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 0 0 currentColor; }
.agent-state.idle    { color: var(--muted); }
.agent-state.busy    { color: var(--err); background: color-mix(in srgb, var(--err) 12%, var(--field)); border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.agent-state.writing { color: #D97706; background: color-mix(in srgb, #F59E0B 14%, var(--field)); border-color: color-mix(in srgb, #F59E0B 40%, var(--line)); }
.agent-state.done    { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--field)); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
/* пульс, пока агент занят (красный/жёлтый); в idle/done — ровно, без анимации */
.agent-state.busy .dot, .agent-state.writing .dot { animation: agentPulse 1.15s ease-out infinite; }
@keyframes agentPulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .agent-state .dot { animation: none !important; } }

/* точка «работает» у диалога в списке (в т.ч. фоновые прогоны) */
.chat-item .run-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--a2); flex: none; box-shadow: 0 0 6px color-mix(in srgb, var(--a2) 60%, transparent); animation: agentPulse 1.15s ease-out infinite; }
.meter { font-size: 12px; color: var(--muted); white-space: nowrap; }
.meter b { color: var(--a2); font-family: var(--display); font-weight: 700; }
.sysload { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sysload b { color: var(--a2); font-weight: 700; }
@media (max-width: 760px) { .sysload { font-size: 10px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; } }
.sys-panel { position: fixed; z-index: 1000; width: 280px; max-width: 92vw; padding: 14px; border-radius: 14px;
  background: var(--panel, #16161e); border: 1px solid var(--line, #2a2a35); box-shadow: 0 12px 40px rgba(0,0,0,.45);
  font-size: 12px; color: var(--fg, #e8e8ef); animation: spIn .14s ease; }
@keyframes spIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sys-panel .sp-h { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.sys-panel .sp-metric { margin-bottom: 12px; }
.sys-panel .sp-lbl { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.sys-panel .sp-lbl b { font-size: 14px; }
.sys-panel .sp-sub { color: var(--muted, #8a8a99); font-size: 11px; }
.sys-panel .sp-spark { border-radius: 6px; overflow: hidden; background: var(--bg, #0e0e14); padding: 2px; }
.sys-panel .sp-h2 { font-weight: 600; margin: 4px 0 6px; padding-top: 8px; border-top: 1px solid var(--line, #2a2a35); }
.sys-panel .sp-jobs { max-height: 128px; overflow-y: auto; }
.sys-panel .sp-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-panel .sp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok, #3bbf6b); flex: none; animation: spPulse 1.4s infinite; }
@keyframes spPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.sys-panel .sp-empty { color: var(--muted, #8a8a99); padding: 3px 0; }
.sys-panel .sp-foot { margin-top: 10px; color: var(--muted, #8a8a99); font-size: 10.5px; line-height: 1.4; }
/* переключатель темы */
.theme-btn { position: relative; overflow: hidden; }
.theme-btn .ic { transition: transform .5s var(--spring), opacity .3s var(--ease); }
.stream { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.empty { margin: auto; text-align: center; color: var(--muted); max-width: 380px; }
.empty h2 { color: var(--txt); font-size: 22px; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }

.msg { display: flex; gap: 12px; max-width: 860px; width: 100%; margin: 0 auto; animation: msgIn .42s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.avatar { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; box-shadow: var(--hi); }
.msg.user .avatar { background: var(--ink6); color: var(--muted); }
.msg.assistant .avatar { background: var(--accent); color: #fff; box-shadow: none; }
.bubble { min-width: 0; flex: 1; border-radius: 12px; padding: 13px 16px; }
.msg.user .bubble { background: var(--accent-tint); border: 1px solid var(--accent-tint-2); box-shadow: none; border-top-right-radius: 4px; }
.msg.assistant .bubble { background: var(--glass-soft); border: 1px solid var(--line); box-shadow: var(--shadow); border-top-left-radius: 4px; }
html[data-theme="dark"] .msg.assistant .bubble { box-shadow: var(--shadow); }
.bubble p { margin: 0 0 8px; line-height: 1.55; }
.bubble p:last-child { margin-bottom: 0; }
.bubble .md-live > :last-child { margin-bottom: 0; }
.bubble code.inline { background: var(--accent-tint); color: var(--accent-ink); padding: 1px 6px; border-radius: 6px; font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--accent-tint-2); }
.bubble pre { background: var(--pre); border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow-x: auto; box-shadow: var(--hi); }
.bubble pre code { font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.fade { animation: softIn .55s var(--ease) both; }
@keyframes softIn { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }

/* --- богатый markdown --- */
.bubble .mdh { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; margin: 14px 0 8px; line-height: 1.3; }
.bubble .mdh:first-child { margin-top: 0; }
.bubble .mdh1 { font-size: 19px; } .bubble .mdh2 { font-size: 16.5px; } .bubble .mdh3 { font-size: 15px; } .bubble .mdh4 { font-size: 13.5px; color: var(--muted); font-family: var(--font); font-weight: 800; }
.bubble .mdhr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.bubble .md-list { margin: 6px 0 10px; padding-left: 22px; line-height: 1.55; }
.bubble .md-list li { margin: 3px 0; }
.bubble .md-list .md-list { margin: 3px 0; }
.bubble .md-quote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--a1); background: var(--ink6); border-radius: 0 10px 10px 0; color: var(--sub); }
.bubble a { color: var(--a2); text-decoration: none; border-bottom: 1px solid var(--accent-tint-2); }
.bubble a:hover { border-bottom-color: var(--a2); }
.bubble del { opacity: .6; }
.table-wrap { overflow-x: auto; margin: 10px 0; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--hi); }
.md-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md-table th, .md-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md-table th { background: var(--fill); font-weight: 700; }
.md-table tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover, .md-table tbody tr:hover { background: var(--hover); }

/* --- код-блок с копированием и подсветкой --- */
.codeblock { margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--pre); box-shadow: var(--hi); }
.cb-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--line); background: var(--fill); }
.cb-lang { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cb-copy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: none; padding: 4px 9px; border-radius: 9px; }
.cb-copy:hover { color: var(--a2); background: var(--hover); }
.cb-copy.ok { color: var(--ok); }
.cb-copy .ic svg { width: 14px; height: 14px; }
.codeblock pre { margin: 0; background: none; border: none; border-radius: 0; padding: 12px 14px; overflow-x: auto; box-shadow: none; }
.codeblock pre code { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.tk-str { color: #1a9e5f; } .tk-com { color: var(--muted); font-style: italic; } .tk-num { color: #c26a1a; } .tk-kw { color: #d1477a; font-weight: 600; }
html[data-theme="dark"] .tk-str { color: #5fd39a; } html[data-theme="dark"] .tk-num { color: #ffb267; } html[data-theme="dark"] .tk-kw { color: #ff7eb0; }

/* --- действия с сообщением --- */
.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .2s var(--ease); }
.msg:hover .msg-actions, .msg.user .msg-actions { opacity: .55; }
.msg .msg-actions:hover { opacity: 1; }
.act { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); background: none; padding: 4px 9px; border-radius: 9px; }
.act:hover { color: var(--a2); background: var(--hover); }
.act.ok { color: var(--ok); }
.act .ic svg { width: 14px; height: 14px; }
@media (max-width: 900px) { .msg-actions { opacity: .5; } }
.edit-box textarea { width: 100%; background: var(--field); border: 1px solid var(--a1); border-radius: 14px; padding: 11px 13px; outline: none; resize: none; line-height: 1.5; max-height: 260px; color: var(--txt); box-shadow: var(--hi); font-family: var(--font); }
.edit-bar { display: flex; gap: 8px; margin-top: 8px; }
.edit-bar .btn-primary { width: auto; padding: 9px 16px; }
.edit-bar .sec { width: auto; padding: 9px 16px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-weight: 600; }
.edit-bar .sec:hover { border-color: var(--a1); }

/* --- навигация по диалогу: стрелки вверх/вниз --- */
.navfab { position: absolute; right: 22px; bottom: 120px; z-index: 5; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.navbtn { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); box-shadow: var(--shadow), var(--hi); display: grid; place-items: center; color: var(--txt); animation: pop .3s var(--spring) both; transition: transform .2s var(--ease), box-shadow .28s var(--ease), opacity .2s var(--ease); }
.navbtn:hover { transform: translateY(-2px); color: var(--a2); }
.navbtn.to-top svg { transform: rotate(180deg); }
.navbtn.hidden { display: none; }

/* --- стартовые чипы --- */
.starter { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.starter-chip { font-size: 13px; padding: 9px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); color: var(--txt); box-shadow: var(--hi); font-weight: 500; transition: transform .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.starter-chip:hover { transform: translateY(-2px); border-color: var(--a1); color: var(--a2); }

/* генерация картинок — пикер */
.imggen textarea { min-height: 60px; font-family: var(--font); font-size: 14px; }
.ig-lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.imggen .chips { gap: 7px; }
.imggen .chip { font-size: 13px; padding: 7px 12px; cursor: pointer; }
.ig-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ig-num { width: 90px; margin: 0; text-align: center; padding: 9px 8px; }
.ig-x { color: var(--muted); font-weight: 600; }
.imggen .btn-primary { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.imggen .btn-primary .ic svg { width: 17px; height: 17px; }

/* Deep Research modal — переиспользует .ig-lbl / .chips / .chip / .field */
.dresearch textarea { min-height: 66px; font-family: var(--font); font-size: 14px; width: 100%; padding: 12px 14px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--txt); resize: vertical; }
.dresearch textarea:focus { border-color: var(--a1); }
.dresearch .chips { gap: 7px; }
.dresearch .chip { font-size: 13px; padding: 7px 12px; cursor: pointer; }
.dresearch .field { margin-bottom: 8px; }
.dresearch .btn-primary { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
/* бейдж режима Deep Research в шапке диалога */
.dr-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), #b45309); color: #fff; letter-spacing: .02em; margin-left: 8px; }
.dr-badge.censor-badge { background: linear-gradient(135deg, #7c3aed, #4c1d95); }

/* tool cards */
.tool { border: 1px solid var(--line); border-radius: 14px; margin: 8px 0; background: var(--fill); overflow: hidden; box-shadow: var(--hi); animation: msgIn .3s var(--ease) both; }
.tool-head { display: flex; align-items: center; gap: 8px; padding: 8px 11px; cursor: pointer; font-size: 13px; }
.tool-head .nm { font-family: var(--mono); font-weight: 700; }
.tool-head .arg { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-family: var(--mono); }
.tool-body { border-top: 1px solid var(--line); padding: 10px; display: none; }
.tool.open .tool-body { display: block; }
.tool-body pre { margin: 0; background: transparent; border: none; padding: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; color: var(--sub); max-height: 320px; overflow: auto; }
.shot-badge { margin-left: auto; font-size: 12px; opacity: .8; flex: none; }
.shot-thumb { display: block; margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--edge); box-shadow: var(--hi); max-width: 280px; line-height: 0; transition: transform .2s var(--ease), box-shadow .28s var(--ease); }
.shot-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow), var(--hi); }
.shot-thumb img { max-width: 100%; max-height: 360px; object-fit: contain; display: block; background: #0a0a0a; }
.tool .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.tool.done .dot { background: var(--ok); } .tool.error .dot { background: var(--err); }
/* 🤝 Видимая команда: карточка делегирования лидом профильному спецу */
.team-card { border-color: var(--accent); background: var(--accent-tint-2); box-shadow: var(--hi); }
.team-card .tool-head { font-size: 13.5px; }
.team-card .tm-emo { display: inline-flex; align-items: center; flex: none; }
.team-card .tm-emo svg { width: 16px; height: 16px; }
.team-card .tm-tt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-ink); }
.team-card .tm-tt b { font-weight: 800; }
.team-card .tm-desc { color: var(--muted); font-weight: 500; }
.team-card .tm-state { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.team-card.done .tm-state { color: var(--ok); }
.team-card.error .tm-state { color: var(--err); }
.team-card:not(.done) .tm-state::after { content: ""; }
.team-card .tm-task { font-family: var(--mono); font-size: 12px; color: var(--sub); white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.team-card .tm-result { font-size: 13px; color: var(--txt); line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.agent-head { font-weight: 800; font-size: 13px; margin: 14px 0 6px; padding: 5px 12px; border-radius: 12px; display: inline-flex; align-items: center; gap: 7px; background: var(--accent-tint-2); color: var(--accent-ink); box-shadow: var(--hi); animation: msgIn .3s var(--ease) both; }
.team-bar { border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px; background: var(--fill); box-shadow: var(--hi); }
.team-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.team-hint { font-size: 11px; color: var(--accent-warn); margin: 8px 0; }
.teamtog { font-size: 11px; padding: 5px 11px; border-radius: 20px; background: var(--field); border: 1px solid var(--line); color: var(--muted); flex: none; display: inline-flex; align-items: center; gap: 5px; }
.teamtog:hover { border-color: var(--a1); color: var(--txt); }
.teamtog.on { background: var(--accent); color: #fff; border-color: transparent; }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--a2); animation: blink 1s steps(2) infinite; vertical-align: text-bottom; border-radius: 2px; box-shadow: 0 0 10px var(--a1); }
@keyframes blink { 50% { opacity: 0; } }

/* индикатор активности */
.status { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; margin-bottom: 11px; border-radius: 16px; background: var(--accent-tint); border: 1px solid var(--accent-tint-2); color: var(--accent-ink); font-size: 13px; font-weight: 600; position: relative; overflow: hidden; box-shadow: var(--hi); animation: msgIn .3s var(--ease) both; }
.status::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 32%, var(--gloss) 50%, transparent 68%); transform: translateX(-120%); animation: shimmer 1.8s infinite; }
@keyframes shimmer { to { transform: translateX(120%); } }
.status .ic { color: var(--accent-ink); }
.dots { display: inline-flex; gap: 4px; z-index: 1; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--a2); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .16s; } .dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.stx { z-index: 1; }

/* composer */
.composer { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
.composer-box { position: relative; max-width: 860px; margin: 0 auto; background: var(--glass-strong); border: 1px solid var(--edge); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); transition: box-shadow .15s var(--ease), border-color .15s var(--ease); }
/* командная палитра композера: "/" команды+профессии, "@" файлы */
.cmd-pop { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 8px); max-height: 300px; overflow: auto; background: var(--glass-strong); border: 1px solid var(--edge); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 60; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: pop .14s var(--spring) both; }
.cmd-pop[hidden] { display: none; }
.cmd-hint-row { font-size: 11px; color: var(--muted); padding: 4px 10px 6px; font-family: var(--mono); }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.cmd-item .ic { color: var(--muted); display: grid; place-items: center; } .cmd-item .ic svg { width: 16px; height: 16px; }
.cmd-item .lb { font-size: 13px; font-weight: 600; color: var(--txt); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item .ht { font-size: 11px; color: var(--muted); flex: none; }
.cmd-item.sel, .cmd-item:hover { background: var(--accent-tint); }
/* ⚙︎ поповер настроек диалога (роль/команда/стиль убраны из строки) */
.more-wrap { position: relative; display: inline-flex; }
.settings-pop { position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 230px; background: var(--glass-strong); border: 1px solid var(--edge); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; z-index: 60; display: flex; flex-direction: column; gap: 8px; animation: pop .14s var(--spring) both; }
.settings-pop[hidden] { display: none; }
.settings-pop .sp-row { display: flex; flex-direction: column; gap: 4px; }
.settings-pop .sp-row > span { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.settings-pop .sp-row .mdl { width: 100%; }
.settings-pop .sp-row.hidden { display: none; }
.sp-adv-toggle { margin-top: 2px; padding: 6px 2px; background: none; border: none; border-top: 1px solid var(--line); color: var(--sub); font-size: 11px; text-align: left; cursor: pointer; }
.sp-adv-toggle:hover { color: var(--txt); }
.sp-adv[hidden] { display: none; }
.sp-adv { display: flex; flex-direction: column; gap: 8px; }
.sp-adv-note { font-size: 10.5px; color: var(--muted); line-height: 1.4; background: var(--fill); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; }
.composer-box:focus-within { border-color: var(--a1); box-shadow: 0 0 0 3px var(--accent-tint); }
/* превью прикреплённых фото в композере */
.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 2px 8px; }
.upload-prog { display: none; align-items: center; gap: 9px; margin: 0 0 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--fill); font-size: 12px; animation: msgIn .2s var(--ease) both; }
.upload-prog.show { display: flex; }
.up-lbl { flex: 0 1 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); font-weight: 600; }
.up-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--ink6); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--a1); border-radius: 4px; transition: width .2s ease; }
.up-pct { flex: 0 0 auto; font-family: var(--mono); color: var(--sub); font-size: 11px; min-width: 32px; text-align: right; }
.enh-card { margin: 0 0 10px; padding: 12px; border: 1px solid var(--a1); border-radius: 14px; background: var(--fill); box-shadow: var(--hi); animation: msgIn .22s var(--ease) both; max-height: 50vh; overflow-y: auto; }
.enh-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.enh-head span { flex: 1; }
.enh-x { width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); color: var(--muted); }
.enh-x:hover { border-color: var(--err); color: var(--err); }
.enh-q { margin-bottom: 11px; }
.enh-qt { font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--txt); }
.enh-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.enh-opt { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); font-size: 12.5px; color: var(--txt); transition: border-color .15s, background .15s; }
.enh-opt:hover { border-color: var(--a1); }
.enh-opt.sel { background: var(--accent-tint); border-color: var(--a1); color: var(--a2); font-weight: 600; }
.enh-free { width: 100%; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); font: inherit; font-size: 12.5px; }
.enh-free:focus { border-color: var(--a1); outline: none; }
.enh-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.enh-go { padding: 8px 14px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.enh-go:disabled { opacity: .6; }
.enh-skip { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--sub); font-size: 12px; }
.enh-skip:hover { color: var(--txt); border-color: var(--a1); }
.convo-start { width: 100%; margin-bottom: 4px; }
body.convo-on #btn-mic { color: var(--a1); animation: convoPulse 1.3s ease-in-out infinite; }
@keyframes convoPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(79,178,166,.5); } 50% { box-shadow: 0 0 0 6px rgba(79,178,166,0); } }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--edge); box-shadow: var(--hi); animation: pop .3s var(--spring) both; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .tx { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(10,12,22,.6); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.thumb .tx:hover { background: var(--err); }
.thumb .tx .ic svg { width: 12px; height: 12px; stroke-width: 2.4; }
/* миниатюры фото внутри сообщения */
.bubble .imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bubble .imgs:last-child { margin-bottom: 0; }
.imw { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--edge); box-shadow: var(--hi); max-width: 240px; line-height: 0; transition: transform .2s var(--ease), box-shadow .28s var(--ease); }
.imw:hover { transform: translateY(-2px); box-shadow: var(--shadow), var(--hi); }
.imw img { max-width: 100%; max-height: 320px; object-fit: cover; display: block; }
/* файлы, созданные агентом — превью + скачивание прямо в панели */
.out-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.out-title .ic svg { width: 14px; height: 14px; }
.outs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.out { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); box-shadow: var(--hi); }
.out-thumb { flex: none; width: 44px; height: 44px; border-radius: 9px; overflow: hidden; border: 1px solid var(--edge); line-height: 0; }
.out-thumb img { width: 100%; height: 100%; object-fit: cover; }
.out-ic { flex: none; width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center; background: var(--ink6); color: var(--muted); }
.out-ic svg { width: 20px; height: 20px; }
.out-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.out-nm { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-sz { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.out-dl { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--a2); background: var(--accent-tint); border: 1px solid transparent; transition: transform .2s var(--ease), background .2s var(--ease); }
.out-dl:hover { transform: translateY(-1px); background: var(--accent-tint-2); }
.out-dl svg { width: 17px; height: 17px; }
.composer textarea { width: 100%; background: none; border: none; outline: none; resize: none; max-height: 200px; line-height: 1.5; padding: 6px 0; color: var(--txt); }
.composer textarea::placeholder { color: var(--muted); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.mdl { background: var(--field); border: 1px solid var(--line); border-radius: 11px; padding: 6px 9px; font-size: 12px; color: var(--txt); box-shadow: var(--hi); }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; background: var(--field); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--hi); color: var(--txt); }
.icon-btn:hover { border-color: var(--a1); }
.send { background: var(--accent); color: #fff; border-color: transparent; box-shadow: none; }
.send.stop { background: var(--err); border-color: transparent; box-shadow: var(--shadow); }
/* скрепка — первая слева и визуально выделенная (главный способ прикрепить файл) */
.composer-bar #btn-attach { order: -1; color: var(--a2); background: var(--accent-tint); border-color: transparent; }
.composer-bar #btn-attach:hover { background: var(--accent-tint-2); }
/* чип прикреплённого документа: иконка-тип + имя + размер */
.fchip .fcmeta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fchip .fcsz { font-size: 10px; color: var(--muted); font-family: var(--mono); }
/* полноэкранный приёмник drag&drop — видимый фидбэк «отпусти файл сюда» */
.drop-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(9,9,11,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.drop-overlay.on { display: grid; }
.drop-overlay .dz { padding: 40px 56px; border: 2px dashed var(--a1); border-radius: 20px; background: var(--glass-strong); color: var(--txt); font-weight: 700; font-family: var(--display); font-size: 18px; box-shadow: var(--shadow); animation: pop .2s var(--spring) both; }

/* ---------- right rail ---------- */
.rail-tabs { display: flex; justify-content: space-between; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.rail-tab { position: relative; flex: 0 1 auto; padding: 12px 2px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: -.02em; color: var(--muted); background: none; white-space: nowrap; transition: color .2s var(--ease); }
.rail-tab:hover { color: var(--sub); }
.rail-tab.active { color: var(--a2); }
.rail-tab.active::before { display: none; }
.rail-tab.active::after { content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); width: 20px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); box-shadow: none; }
.rail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.search { width: 100%; padding: 9px 12px; margin-bottom: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; outline: none; box-shadow: var(--hi); }
.search:focus { border-color: var(--a1); }
.skill { border: 1px solid var(--line); border-radius: 15px; padding: 12px; margin-bottom: 9px; background: var(--fill); box-shadow: var(--hi); animation: msgIn .3s var(--ease) both; }
.skill:hover { border-color: var(--a1); }
.skill.on { border-color: var(--a1); background: var(--accent-tint); }
.skill .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.skill .h .grow { flex: 1; display: flex; align-items: center; gap: 8px; }
.skill .h .ic { color: var(--a2); }
.skill .d { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.45; cursor: pointer; }
.skill .use { font-size: 12px; color: var(--a2); background: none; margin-top: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip { font-size: 12px; padding: 5px 11px; border-radius: 20px; background: var(--field); border: 1px solid var(--line); color: var(--muted); }
.chip:hover { border-color: var(--a1); color: var(--txt); }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }
.tgl { width: 40px; height: 23px; border-radius: 20px; background: var(--ink16); position: relative; flex: none; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--knob); transition: left .2s var(--spring); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tgl.on { background: var(--accent); }
.tgl.on::after { left: 20px; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.badge.on { background: rgba(23,184,119,.16); color: var(--ok); }
.badge.off { background: var(--ink6); color: var(--muted); }
.tool-install { margin-top: 9px; display: flex; gap: 8px; align-items: center; }
.tool-install button { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 10px; background: var(--accent); color: #fff; }
.tool-install button:disabled { opacity: .5; }
.tool-install a { font-size: 12px; color: var(--muted); }
.tool-install a:hover { color: var(--a2); }
.tool-note { font-size: 11px; color: var(--accent-warn); margin-top: 6px; line-height: 1.4; }
.tool-log { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; white-space: pre-wrap; max-height: 120px; overflow: auto; }

.proc { border: 1px solid var(--line); border-radius: 14px; margin: 8px 0; background: var(--glass-soft); overflow: hidden; box-shadow: var(--hi); }
.proc-head { padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); user-select: none; display: flex; align-items: center; gap: 7px; }
.proc-head:hover { color: var(--txt); }
.proc-body { display: none; border-top: 1px solid var(--line); padding: 10px 12px; }
.proc.open .proc-body { display: block; }
.proc-body .agent-head { margin-top: 10px; }
.proc-body p { margin: 0 0 6px; line-height: 1.5; font-size: 13px; color: var(--sub); }
.proc-status { font-size: 12px; color: var(--muted); padding: 2px 0; }
/* складной блок «подробный ход работы» (:::detail) — каретка + акцент */
.detail-block .proc-head .lbl { flex: 1; }
.detail-block .proc-caret { display: inline-flex; transition: transform .2s var(--ease); color: var(--muted); }
.detail-block .proc-caret svg { width: 15px; height: 15px; }
.detail-block.open .proc-caret { transform: rotate(180deg); }
.detail-block .proc-body p { color: var(--txt); font-size: 14px; }
/* авто-сворачивание длинного ответа: свёрнуто — клип с мягким затуханием */
.foldwrap.clamped { max-height: 46vh; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.foldmore { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--a2); background: var(--glass-soft); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease); }
.foldmore:hover { transform: translateY(-1px); border-color: var(--edge); }
.foldmore svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.foldmore.up svg { transform: rotate(180deg); }

.drop { border: 1px dashed var(--dash); border-radius: 14px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.drop.over { border-color: var(--a1); color: var(--a2); background: var(--accent-tint); }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.crumbs a { color: var(--a2); cursor: pointer; }
.file { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 10px; font-size: 13px; }
.file:hover { background: var(--hover); }
.file .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.file .sz { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.file .del { opacity: .5; color: var(--muted); display: grid; place-items: center; padding: 3px; }
.file:hover .del, .file .del:hover { opacity: 1; }
.file .ic { color: var(--muted); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(10, 12, 22, 0.36); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(560px, 96vw); max-height: 88vh; overflow: auto; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--edge); border-radius: 24px; padding: 18px; box-shadow: 0 34px 74px rgba(0,0,0,0.4), var(--hi); animation: pop .4s var(--spring) both; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 17px; margin-bottom: 14px; gap: 10px; }
.modal-head span { display: flex; align-items: center; gap: 8px; }
.modal textarea { width: 100%; min-height: 260px; background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 12px; outline: none; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--txt); }
.modal textarea:focus, .modal .field:focus, .modal select:focus { border-color: var(--a1); }
.modal .field, .modal select { width: 100%; padding: 10px 12px; margin-bottom: 10px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--txt); }
.modal .btn-primary { margin-top: 12px; }
.modal .row2 { display: flex; gap: 10px; }
.modal .row2 > * { flex: 1; }
.modal .vrow { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; font-size: 15px; }
.modal .vrow input { width: 18px; height: 18px; accent-color: var(--a2); }
.modal button.sec { width: 100%; padding: 10px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-weight: 600; margin-bottom: 8px; }
.modal button.sec:hover { border-color: var(--a1); }
.sched { border: 1px solid var(--line); border-radius: 14px; padding: 11px; margin-bottom: 9px; background: var(--fill); }
.sched .h { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.sched .meta { color: var(--muted); font-size: 12px; margin-top: 4px; font-family: var(--mono); }
.sched .acts { display: flex; gap: 8px; margin-top: 8px; }
.sched .acts button { font-size: 12px; padding: 5px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.sched .acts .run { background: var(--accent); color: #fff; border-color: transparent; }

/* ---------- премиум: плавность, блеск ---------- */
.new-chat, .btn-primary, .send, .side-btn, .icon-btn, .chip, .teamtog, .skill, .chat-item, .rail-tab, .mdl, .ws-select, .modal button, .file, .tool-head, .proc-head, .badge, .eye {
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease), color .15s var(--ease);
}
.new-chat:hover, .btn-primary:hover, .send:hover { filter: brightness(1.04); box-shadow: var(--shadow); }
.new-chat:active, .btn-primary:active, .send:active, .icon-btn:active { transform: scale(.97); }
.skill:hover, .side-btn:hover, .icon-btn:hover, .chip:hover, .teamtog:hover { border-color: var(--a1); }

/* mobile */
.mobile-toggle { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  /* чат на весь экран — диалог всегда виден */
  #app { grid-template-columns: 1fr; padding: 0; gap: 0; height: 100dvh; }
  main.col { border-radius: 0; border: none; box-shadow: none; animation: none; }
  main.col::before { display: none; }

  /* боковые панели = выезжающие drawer'ы (за краем по умолчанию).
     ВАЖНО: animation:none — иначе финал rise (transform:none) перебивает translateX */
  .sidebar, .rail {
    position: fixed; top: 0; bottom: 0; height: 100dvh; width: min(87vw, 344px);
    z-index: 40; border-radius: 0; animation: none;
    transition: transform .33s var(--spring); will-change: transform;
  }
  .sidebar::before, .rail::before { display: none; }
  .sidebar { left: 0; border-right: 1px solid var(--edge); transform: translateX(-102%); }
  .rail    { right: 0; border-left: 1px solid var(--edge);  transform: translateX(102%); }
  #app.nav-left .sidebar { transform: none; }
  #app.nav-right .rail   { transform: none; }

  /* затемнение под drawer'ом — тап закрывает */
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8,10,20,.46);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  #app.nav-left .scrim, #app.nav-right .scrim { opacity: 1; pointer-events: auto; }

  .mobile-toggle { display: grid; width: 40px; height: 40px; }
  .topbar { padding: 10px 12px; }
  .topbar .title { font-size: 15px; }
  .agent-state { padding: 4px; gap: 0; } /* на телефоне — только точка, без подписи (экономим ширину шапки) */
  .agent-state .lbl { display: none; }
  .meter { font-size: 10px; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; }
  .stream { padding: 16px 12px; gap: 14px; }
  .msg { gap: 8px; }
  .bubble p, .bubble li { font-size: 15px; }
  .composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .composer-box { border-radius: 18px; }
  /* на телефоне: селекты (роль/модель) — первый ряд поровну, кнопки+отправка — второй ряд */
  .composer-bar { gap: 8px 6px; row-gap: 8px; }
  .composer-bar .mdl { flex: 1 1 44%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mdl { padding: 8px 8px; }
  .icon-btn { width: 42px; height: 42px; flex: none; }
  .composer .send { margin-left: auto; } /* отправка всегда справа, оранжевая */
  .composer-box, .navbtn { -webkit-backdrop-filter: none; backdrop-filter: none; } /* не грей GPU на мобиле */
  .navfab { bottom: 96px; right: 14px; }
  /* крупнее тап-таргеты действий/чипов */
  .act, .cb-copy { padding: 7px 11px; }
  .chat-item { padding: 12px 12px; }
  .rail-tab { padding: 13px 3px; font-size: 11.5px; }
  /* узкие панели: усадить сетку телеметрии и действия примерочной, чтобы не вылезали */
  .usage-row { grid-template-columns: minmax(70px,1.2fr) 1.6fr auto; }
  .usage-when { display: none; }
  .bench-actions { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .new-chat::after, .btn-primary::after, .send::after, .status::after { animation: none; }
}

/* реестр ключей/сервисов */
.svc-box { margin-bottom: 12px; }
.svc { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; margin-bottom: 8px; background: var(--fill); box-shadow: var(--hi); }
.svc.expiring { border-color: var(--accent-warn); }
.svc.expired { border-color: var(--err); opacity: .8; }
.svc-h { display: flex; align-items: center; gap: 8px; }
.svc-nm { font-weight: 700; font-size: 14px; flex: 1; }
.svc-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.svc-badge.active { background: rgba(23,184,119,.16); color: var(--ok); }
.svc-badge.expiring { background: rgba(255,150,30,.18); color: var(--accent-warn); }
.svc-badge.expired { background: rgba(255,77,99,.16); color: var(--err); }
.svc-meta { font-size: 12px; color: var(--muted); margin-top: 5px; font-family: var(--mono); word-break: break-all; }
.svc-del { position: absolute; top: 9px; right: 9px; opacity: 0; color: var(--muted); background: none; display: grid; place-items: center; padding: 3px; }
.svc:hover .svc-del { opacity: .5; } .svc-del:hover { opacity: 1 !important; color: var(--err); }
.svc-del svg { width: 15px; height: 15px; }

/* почта бота — входящие */
.inbox-box { margin-bottom: 14px; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; }
.inbox-refr { width: 30px; height: 30px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.inbox-refr:hover { color: var(--a2); border-color: var(--a1); }
.inbox-refr svg { width: 15px; height: 15px; }
.mail { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: var(--fill); box-shadow: var(--hi); }
.mail-h { display: flex; align-items: baseline; gap: 8px; }
.mail-from { font-weight: 700; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 11px; color: var(--muted); font-family: var(--mono); flex: none; }
.mail-subj { font-size: 13px; margin-top: 3px; }
.mail-to { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.mail-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.code-chip { font-family: var(--mono); font-weight: 800; font-size: 15px; letter-spacing: 1px; padding: 5px 12px; border-radius: 10px; background: var(--accent-tint); color: var(--a2); border: 1px solid var(--a1); }
.code-chip:hover { background: var(--accent-tint-2); }
.code-chip.ok { background: rgba(23,184,119,.16); color: var(--ok); border-color: var(--ok); }
.mail-links { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.mail-link { font-size: 12px; color: var(--a2); font-family: var(--mono); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-link:hover { text-decoration: underline; }
.mail-tog { font-size: 12px; color: var(--muted); background: none; margin-top: 8px; padding: 0; }
.mail-tog:hover { color: var(--txt); }
.mail-body { display: none; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--sub); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; padding: 8px; background: var(--pre); border-radius: 10px; }
.mail-body.open { display: block; }

/* тост-уведомление */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); z-index: 60;
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: var(--shadow), var(--hi); color: var(--txt);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--spring); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--err); color: var(--err); }

/* file-input: НЕ display:none (iOS тогда не отдаёт файл), а визуально скрыт но «живой» */
.vhide { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; margin: -1px; }

/* чип файла в полоске прикрепления (документы) */
.fchip { display: flex; align-items: center; gap: 6px; max-width: 220px; padding: 8px 10px; border-radius: 12px; background: var(--field); border: 1px solid var(--edge); box-shadow: var(--hi); animation: pop .3s var(--spring) both; }
.fchip .fci { color: var(--muted); display: grid; place-items: center; } .fchip .fci svg { width: 16px; height: 16px; }
.fchip .fcn { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip .tx { position: static; width: 20px; height: 20px; flex: none; }
/* прикреплённые файлы внутри сообщения */
.bubble .attf { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.attf-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); box-shadow: var(--hi); max-width: 280px; }
.attf-ic { color: var(--muted); display: grid; place-items: center; } .attf-ic svg { width: 18px; height: 18px; }
.attf-nm { font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attf-b { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--a2); background: var(--accent-tint); border: 1px solid transparent; }
.attf-b:hover { background: var(--accent-tint-2); } .attf-b svg { width: 15px; height: 15px; }
.out-pv { color: var(--a2); }

/* Artifacts — живой предпросмотр страницы в сообщении */
.artifact { margin: 10px 0; border: 1px solid var(--edge); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow), var(--hi); background: var(--fill); }
.artifact-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--glass-strong); }
.artifact-t { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.artifact-t .ic { color: var(--a2); } .artifact-t svg { width: 15px; height: 15px; }
.artifact-open { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); padding: 6px 12px; border-radius: 10px; box-shadow: var(--glow); text-decoration: none; }
.artifact-open svg { width: 14px; height: 14px; }
.artifact-frame { width: 100%; height: min(60vh, 520px); border: none; background: #fff; display: block; }
/* панель над предпросмотром сайта в модалке */
.preview-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.preview-open { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--a2); text-decoration: none; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); }
.preview-open svg { width: 15px; height: 15px; }

/* ---- Аккаунты площадок (vault монетизированных профессий) ---- */
.acc-head{margin-bottom:12px}
.acc-title{font-weight:700;font-size:15px}
.acc-sub{font-size:12px;color:var(--sub);margin-top:3px;line-height:1.4}
.acc-add{width:100%;padding:11px;border:none;border-radius:12px;background:var(--a2);color:#fff;font-weight:600;cursor:pointer;margin-bottom:12px;transition:filter .15s}
.acc-add:hover{filter:brightness(1.06)}
.acc-list{display:flex;flex-direction:column;gap:8px}
.acc-empty{font-size:12.5px;color:var(--sub);line-height:1.5;padding:8px 2px}
.acc-item{display:flex;flex-direction:column;gap:2px;padding:9px 11px;border-radius:11px;background:var(--fill)}
.acc-ic{font-size:17px;flex:0 0 auto}
.acc-nm{font-weight:600;font-size:13px}
.acc-dt{color:var(--sub);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.acc-ok{color:#2e9e5b;font-size:11.5px;font-weight:600;flex:0 0 auto}
.acc-warn{color:#e08a2e;font-size:11.5px;font-weight:600;flex:0 0 auto}
.acc-saved{color:var(--sub);font-size:11.5px;font-weight:600;flex:0 0 auto}
.acc-rm{border:none;background:transparent;color:var(--sub);cursor:pointer;font-size:14px;flex:0 0 auto;padding:2px 5px;border-radius:7px}
.acc-rm:hover{background:var(--hover);color:#d24}
/* визард в модалке */
.acc-wiz{display:flex;flex-direction:column;gap:11px;min-width:280px}
.acc-wh{font-weight:700;font-size:16px}
.acc-hint{font-size:12.5px;color:var(--sub);line-height:1.45;margin-top:-4px}
.acc-plat{display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--ink6);border-radius:12px;background:var(--fill);cursor:pointer;text-align:left;transition:background .15s,border-color .15s}
.acc-plat:hover{background:var(--hover);border-color:var(--a2)}
.acc-pl{display:flex;flex-direction:column;gap:2px}
.acc-pl b{font-size:14px}
.acc-pl i{font-style:normal;font-size:11.5px;color:var(--sub);line-height:1.35}
.acc-field{display:flex;flex-direction:column;gap:4px}
.acc-lbl{font-size:12px;color:var(--sub);font-weight:600}
.acc-field input{padding:10px 12px;border:1px solid var(--ink16);border-radius:10px;background:var(--bg);color:var(--txt);font-size:14px;outline:none;transition:border-color .15s}
.acc-field input:focus{border-color:var(--a2)}
.acc-err{color:#d24;font-size:12.5px;min-height:1px}
.acc-go{padding:11px;border:none;border-radius:11px;background:var(--a2);color:#fff;font-weight:700;cursor:pointer;transition:filter .15s}
.acc-go:hover{filter:brightness(1.06)}
.acc-go:disabled{opacity:.55;cursor:default}
.acc-cancel{padding:8px;border:none;border-radius:10px;background:transparent;color:var(--sub);cursor:pointer;font-size:13px}
.acc-cancel:hover{background:var(--hover)}

/* ---- Индикатор прогресса задачи (бар + таймер + план-чеклист) ---- */
.pbar{height:3px;border-radius:3px;overflow:hidden;background:var(--ink6);margin:2px 0 8px;position:relative}
.pbar>i{position:absolute;left:0;top:0;height:100%;width:40%;border-radius:3px;
  background:linear-gradient(90deg,transparent,var(--a2),transparent);animation:pbarmove 1.15s ease-in-out infinite}
@keyframes pbarmove{0%{left:-40%}100%{left:100%}}
.status .pmeta{margin-left:auto;font-size:11.5px;color:var(--sub);font-variant-numeric:tabular-nums;white-space:nowrap}
.status{gap:7px}
/* план-чеклист (TodoWrite) = настоящий прогресс */
.todos{background:var(--fill);border:1px solid var(--ink6);border-radius:12px;padding:11px 13px;margin:6px 0 10px;font-size:13px}
.td-head{font-weight:700;font-size:12.5px;color:var(--txt);margin-bottom:9px;display:flex;align-items:center;gap:10px}
.td-bar{flex:1;height:6px;border-radius:6px;background:var(--ink6);overflow:hidden}
.td-bar>i{display:block;height:100%;background:var(--a2);border-radius:6px;transition:width .4s ease}
.td{display:flex;align-items:flex-start;gap:8px;padding:3px 0;color:var(--sub);line-height:1.4}
.td-ic{flex:0 0 auto;font-size:13px}
.td.td-done{color:var(--sub);text-decoration:line-through;opacity:.7}
.td.td-now{color:var(--txt);font-weight:600}

/* время сообщения/ответа */
.msg-time{margin-left:auto;font-size:11px;color:var(--sub);opacity:.75;font-variant-numeric:tabular-nums;align-self:center}
.msg-actions{display:flex;align-items:center;gap:8px}

/* «показать более ранние» — ленивая подгрузка старых сообщений */
.load-older{display:block;margin:6px auto 14px;padding:8px 18px;border:1px solid var(--ink16);border-radius:100px;background:var(--fill);color:var(--sub);font-size:12.5px;font-weight:600;cursor:pointer;transition:background .15s}
.load-older:hover{background:var(--hover);color:var(--txt)}

/* Авто-роутер: пометка выбора модели */
.route-note{font-size:12px;color:var(--muted);background:var(--panel2,rgba(255,255,255,.04));border:1px solid var(--line);border-radius:8px;padding:4px 9px;margin:4px 0;display:inline-block}
.route-note b{color:var(--fg)}

/* Ответ прервался (краш/рестарт до финала) — честная плашка + «Дописать» */
.interrupted{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px;padding:8px 11px;font-size:13px;
  color:var(--warn,#e8a13a);background:rgba(232,161,58,.09);border:1px solid rgba(232,161,58,.28);border-radius:10px}
.interrupted .cont-btn{display:inline-flex;align-items:center;gap:5px;cursor:pointer;font:inherit;font-weight:600;
  color:var(--fg);background:var(--panel2,rgba(255,255,255,.06));border:1px solid var(--line);border-radius:8px;padding:4px 11px;transition:all .15s var(--ease)}
.interrupted .cont-btn:hover{background:var(--accent,#e8853a);color:#fff;border-color:transparent}
.interrupted .cont-btn svg{width:14px;height:14px}

/* #8 — структурная память диалога в модале */
.ctx-mem{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}
.ctx-body{margin:6px 0}
.ctx-h{font-weight:600;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin:8px 0 3px}
.ctx-list{margin:0 0 4px;padding-left:18px;font-size:13px;line-height:1.5}
.ctx-list li{margin:2px 0}
.ctx-src{color:var(--muted);font-size:11px}
.ctx-raw{background:var(--panel2,rgba(255,255,255,.04));border-radius:8px;padding:8px;font-size:12px;overflow:auto;max-height:200px}
.ctx-star{color:#f5c451}
.ctx-warn{color:var(--warn,#e0a24a);font-size:11px}

/* Аккаунты: описание «как работает» + строка-шапка */
.acc-top{display:flex;align-items:center;gap:8px}
.acc-about{font-size:12px;color:var(--muted);line-height:1.45;margin:5px 0 2px 26px}

/* Аккаунты: произвольные — метаданные, раскрытие секрета, кнопки */
.acc-btns{display:flex;gap:8px;margin:8px 0}
.acc-add2{flex:0 0 auto;padding:8px 12px;border-radius:9px;background:var(--fill);border:1px solid var(--line);color:var(--txt);cursor:pointer;font-size:13px}
.acc-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0 0 26px}
.acc-by{font-size:11px;color:var(--muted)}
.acc-chat,.acc-reveal,.acc-ed{font-size:11px;padding:3px 8px;border-radius:7px;background:var(--fill);border:1px solid var(--line);color:var(--txt);cursor:pointer}
.acc-reveal.acc-shown{font-family:var(--mono);background:var(--pre);word-break:break-all;max-width:100%}
.acc-chat:hover,.acc-reveal:hover,.acc-ed:hover{border-color:var(--a1)}

/* Версия + чат обновлений */
.ver-badge{margin-left:6px;padding:2px 7px;border-radius:999px;font-size:11px;font-weight:700;background:var(--accent-tint);color:var(--accent-ink);border:1px solid var(--line);cursor:pointer;vertical-align:middle}
.ver-badge:hover{background:var(--accent-tint-2)}
.chlog-feed{margin:10px 0;max-height:46vh;overflow:auto;display:flex;flex-direction:column;gap:8px}
.chlog-h{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin:8px 0 2px}
.chlog-up{background:var(--fill);border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.chlog-ut{font-size:14px}
.chlog-v{font-size:11px;color:var(--accent-ink);background:var(--accent-tint);padding:1px 6px;border-radius:999px;margin-left:4px}
.chlog-ub{font-size:13px;color:var(--sub);line-height:1.5;margin-top:4px}
.chlog-ud{font-size:11px;color:var(--muted);margin-top:5px}
.chlog-wi{position:relative;background:var(--fill);border:1px solid var(--line);border-radius:12px;padding:9px 30px 9px 12px}
.chlog-wt{font-size:13px}
.chlog-ws{font-size:11px;color:var(--muted);margin-top:3px}
.chlog-x{position:absolute;right:8px;top:8px;background:none;color:var(--muted);font-size:12px}
.chlog-wish{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px;margin-top:6px}
.chlog-wish textarea{width:100%;padding:10px;border-radius:10px;background:var(--field);border:1px solid var(--line);resize:vertical}

/* ===== Энергосбережение для мобильных (не трогает десктоп) =====
   Причина нагрева/разряда на телефоне: вечная фоновая анимация с filter:blur(60px)
   и полноэкранные backdrop-filter (стекло) — GPU композитит их каждый кадр 24/7.
   На узких экранах: 1) фон-анимация по умолчанию на паузе, оживает только пока
   работает агент (body.busy); 2) блюр фонового слоя резко облегчён;
   3) backdrop-filter выключен, стекло заменено плотным полупрозрачным фоном —
   визуально почти идентично, но GPU разгружен в разы. */
@media (max-width: 900px) {
  /* фон уже плоский (сетка + мягкий glow), стекла нет — просто чуть облегчаем сетку и глушим glow ради энергии */
  body::before { background-size: 40px 40px; opacity: .25; }
  body::after { display: none; } /* ambient-glow не рендерим на телефоне (энергия) */
  .thumb .tx, .modal { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .modal { background: rgba(9, 9, 11, 0.6); }
}

/* ---------------- 🛰 Примерочная инструментов ---------------- */
.bench-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.bench-item{gap:6px;padding:11px 12px}
.bench-item .acc-top{flex-wrap:wrap}
.bench-cat{font-size:10px;padding:1px 7px;border-radius:20px;background:var(--accent-tint);color:var(--accent-ink);font-weight:600}
.bench-stars{font-size:11px;color:var(--sub)}
.bench-badge{font-size:10px;padding:2px 8px;border-radius:20px;font-weight:700;margin-left:auto;white-space:nowrap}
.bench-found{background:var(--ink6);color:var(--sub)}
.bench-testing{background:var(--accent-tint-2);color:var(--accent-ink)}
.bench-demo{background:rgba(34,197,94,.16);color:var(--ok)}
.bench-kept{background:var(--accent);color:#fff}
.bench-removed{background:var(--ink6);color:var(--muted);text-decoration:line-through}
.bench-pitch{font-size:12px;line-height:1.45;color:var(--sub)}
.bench-src{font-size:11px;color:var(--a2);text-decoration:none;opacity:.85;word-break:break-all}
.bench-src:hover{text-decoration:underline}
.bench-notes,.bench-verdict{font-size:11px;line-height:1.4;color:var(--sub);background:var(--ink6);padding:5px 8px;border-radius:8px}
.bench-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px}
.bench-apply{font-size:12px;font-weight:700;padding:6px 13px;border:none;border-radius:9px;background:var(--accent);color:#fff;cursor:pointer;transition:filter .15s}
.bench-apply:hover{filter:brightness(1.07)}
.bench-apply:disabled{opacity:.6;cursor:default}
.bench-keep{font-size:11px;font-weight:700;padding:5px 11px;border:none;border-radius:9px;background:rgba(23,184,119,.16);color:#0c8f5c;cursor:pointer}
.bench-keep:hover{background:rgba(23,184,119,.28)}
.bench-drop{font-size:11px;font-weight:600;padding:5px 11px;border:1px solid var(--line);border-radius:9px;background:var(--fill);color:var(--sub);cursor:pointer}
.bench-drop:hover{border-color:var(--err);color:var(--err)}
.bench-open,.bench-demo-link{font-size:11px;padding:5px 10px;border-radius:9px;background:var(--fill);border:1px solid var(--line);color:var(--txt);cursor:pointer;text-decoration:none}
.bench-demo-link{background:rgba(23,184,119,.12);border-color:rgba(23,184,119,.3);color:#0c8f5c;font-weight:600}
.bench-open:hover,.bench-demo-link:hover{filter:brightness(1.05)}
/* прогресс обучения профессий (радар профессий) */
.pro-learn{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:7px}
.pro-learn-badge{font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:8px;background:var(--accent-tint);color:var(--accent-ink);white-space:nowrap}
.pro-learn-last{font-size:11px;color:var(--sub);line-height:1.35;flex:1 1 100%;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pro-learn-empty{font-size:10.5px;color:var(--sub);opacity:.7}
/* телеметрия инструментов (что реально используется) */
.usage-box{margin-bottom:12px}
.usage-list{display:flex;flex-direction:column;gap:5px}
.usage-row{display:grid;grid-template-columns:minmax(90px,1.4fr) 2fr auto auto;align-items:center;gap:8px;font-size:11.5px}
.usage-name{font-weight:600;color:var(--txt);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.usage-bar{height:6px;border-radius:4px;background:var(--fill);overflow:hidden}
.usage-bar>i{display:block;height:100%;background:linear-gradient(90deg,var(--a1),var(--a2));border-radius:4px}
.usage-count{font-weight:700;color:var(--accent-ink);min-width:26px;text-align:right}
.usage-when{color:var(--sub);font-size:10px;min-width:38px;text-align:right}
/* свежесть арсенала */
.health-box{margin-bottom:14px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--fill);box-shadow:var(--hi)}
.health-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.health-title{font-weight:700;font-size:13px;flex:1}
.health-summary{font-size:11px;font-weight:700;padding:3px 9px;border-radius:20px}
.health-summary.ok{background:rgba(23,184,119,.16);color:var(--ok)}
.health-summary.warn{background:rgba(255,150,30,.18);color:var(--accent-warn)}
.health-summary.bad{background:rgba(255,77,99,.16);color:var(--err)}
.health-refresh{width:28px;height:28px;border-radius:9px;border:1px solid var(--line);background:var(--field);color:var(--txt);font-size:14px;display:grid;place-items:center}
.health-refresh:hover{border-color:var(--a1)}
.health-group{margin-bottom:11px}
.health-group-name{font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--sub);margin:0 0 6px 2px}
.health-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.health-card{border:1px solid var(--line);border-radius:11px;padding:8px 10px;background:var(--bg);transition:border-color .2s,background .2s}
.health-card.up{border-left:3px solid var(--ok)}
.health-card.slow{border-left:3px solid var(--accent-warn)}
.health-card.down{border-left:3px solid var(--err);background:rgba(255,77,99,.05)}
.health-card-top{display:flex;align-items:center;gap:6px}
.health-dot{font-size:9px;line-height:1}
.health-name{font-weight:600;font-size:12px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.health-ms{font-size:9.5px;color:var(--sub);font-family:var(--mono)}
.health-detail{font-size:10.5px;color:var(--muted);margin-top:4px;line-height:1.35}
.health-foot{font-size:10px;color:var(--sub);margin-top:4px;padding-top:8px;border-top:1px solid var(--line)}
@media(max-width:560px){.health-grid{grid-template-columns:1fr}}
.fresh-box{margin-bottom:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--fill)}
.fresh-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.fresh-dot{font-size:13px}
.fresh-label{font-weight:600;font-size:12px;color:var(--txt);flex:1;min-width:120px}
.fresh-when{color:var(--sub);font-size:10px}
.fresh-btn{padding:5px 10px;border-radius:9px;border:1px solid var(--line);background:var(--field);font-size:11px;font-weight:600;color:var(--txt);white-space:nowrap}
.fresh-btn:hover{border-color:var(--a1)}
.fresh-btn:disabled{opacity:.6}
.fresh-list{display:flex;flex-direction:column;gap:4px;margin-top:9px;padding-top:9px;border-top:1px solid var(--line)}
.fresh-row{display:flex;align-items:center;gap:7px;font-size:11.5px}
.fresh-row b{color:var(--txt);font-weight:600}
.fresh-ver{color:var(--sub);font-size:10.5px;font-family:var(--mono)}

/* ── Провайдеры LLM ── */
.prov{display:flex;flex-direction:column;gap:14px}
.prov-h{font-size:12px;font-weight:700;color:var(--txt);letter-spacing:.02em;margin-bottom:8px;text-transform:uppercase;opacity:.72}
.prov-status,.prov-toggle,.prov-keys{border-top:1px solid var(--line);padding-top:12px}
.prov-ch{display:flex;align-items:flex-start;gap:10px;padding:9px 10px;border-radius:10px;border:1px solid var(--line);margin-bottom:7px;background:var(--glass-soft)}
.prov-ch.active{border-color:var(--accent);background:var(--accent-tint)}
.prov-dot{width:9px;height:9px;border-radius:50%;margin-top:5px;flex:0 0 auto}
.prov-dot.up{background:#22C55E;box-shadow:0 0 0 3px rgba(34,197,94,.15)}
.prov-dot.down{background:#EF4444;box-shadow:0 0 0 3px rgba(239,68,68,.15)}
.prov-ch-name{font-size:13px;font-weight:600;color:var(--txt)}
.prov-ch-note{font-size:11.5px;color:var(--sub);margin-top:2px}
.prov-seg{display:flex;gap:8px}
.prov-segbtn{flex:1;display:flex;flex-direction:column;gap:2px;align-items:flex-start;padding:11px 12px;border-radius:11px;border:1.5px solid var(--line);background:var(--glass);cursor:pointer;transition:.15s;text-align:left}
.prov-segbtn:hover{border-color:var(--accent-ink)}
.prov-segbtn.on{border-color:var(--accent);background:var(--accent-tint)}
.prov-segbtn:disabled{opacity:.6;cursor:default}
.prov-segt{font-size:13.5px;font-weight:700;color:var(--txt)}
.prov-segs{font-size:11px;color:var(--sub)}
.prov-hint{font-size:11.5px;color:var(--sub);margin-top:9px;line-height:1.45}
.prov-key{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);margin-bottom:6px;background:var(--glass-soft)}
.prov-key-info{flex:1;min-width:0}
.prov-key-name{font-size:13px;font-weight:600;color:var(--txt)}
.prov-key-meta{font-size:11px;color:var(--sub);font-family:var(--mono);margin-top:1px}
.prov-key-del{flex:0 0 auto;width:26px;height:26px;border-radius:7px;border:1px solid var(--line);background:transparent;color:var(--sub);cursor:pointer;font-size:13px;line-height:1}
.prov-key-del:hover{border-color:#EF4444;color:#EF4444}
.prov-add{margin-top:12px;padding-top:12px;border-top:1px dashed var(--line);display:flex;flex-direction:column;gap:8px}
.prov-add .field{width:100%}

/* ---- Интерактивные варианты-кнопки (ask_options) ---- */
.ask-card{margin:10px 0;padding:14px;border:1px solid var(--accent);border-radius:14px;background:var(--accent-tint);display:flex;flex-direction:column;gap:14px}
.ask-card.answered{border-color:var(--line);background:var(--glass-soft);opacity:.92}
.ask-q{display:flex;flex-direction:column;gap:8px}
.ask-chip{align-self:flex-start;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--accent-ink);background:var(--accent-tint-2);padding:2px 8px;border-radius:999px}
.ask-question{font-size:15px;font-weight:600;color:var(--txt);line-height:1.35}
.ask-opts{display:flex;flex-direction:column;gap:8px}
.ask-opt{display:flex;flex-direction:column;gap:2px;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--glass);color:var(--txt);cursor:pointer;transition:border-color .12s,background .12s;font:inherit}
.ask-opt:hover{border-color:var(--accent);background:var(--accent-tint)}
.ask-opt.sel{border-color:var(--accent);background:var(--accent-tint-2);box-shadow:inset 0 0 0 1px var(--accent)}
.ask-lbl{font-size:14px;font-weight:600}
.ask-desc{font-size:12px;color:var(--sub);line-height:1.35}
.ask-own{display:flex;gap:6px;align-items:center}
.ask-input{flex:1;padding:9px 11px;border:1px dashed var(--line);border-radius:10px;background:var(--glass);color:var(--txt);font:inherit;font-size:14px}
.ask-input:focus{outline:none;border-style:solid;border-color:var(--accent)}
.ask-input.sel-own{border-style:solid;border-color:var(--accent);background:var(--accent-tint)}
.ask-send{flex:0 0 auto;width:38px;height:38px;border:1px solid var(--accent);border-radius:10px;background:var(--accent);color:#fff;cursor:pointer;font-size:16px;line-height:1}
.ask-send:hover{filter:brightness(1.05)}
.ask-submit{align-self:flex-start;padding:9px 18px;border:none;border-radius:10px;background:var(--accent);color:#fff;font-weight:600;cursor:pointer;font-size:14px}
.ask-submit:hover{filter:brightness(1.05)}
.ask-picked{font-size:13px;font-weight:600;color:var(--accent-ink);padding-top:4px;border-top:1px dashed var(--line)}
.ask-card button:disabled,.ask-card input:disabled{opacity:.55;cursor:default}

/* ── 🔐 Плашка кода аутентификации (прямой канал воркер⇄владелец) ── */
#authcode-plate{margin:0 0 10px;padding:12px 14px;border:1px solid var(--accent);border-radius:14px;
  background:linear-gradient(180deg,var(--accent-tint-2),var(--accent-tint));box-shadow:0 10px 30px rgba(0,0,0,.18),inset 0 0 0 1px var(--accent-tint);
  display:flex;flex-direction:column;gap:10px;animation:acPop .22s var(--ease)}
@keyframes acPop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.ac-head{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--txt);font-size:14px}
.ac-ico{display:inline-flex;color:var(--accent-ink,var(--accent))}
.ac-ico svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ac-label{flex:0 1 auto;letter-spacing:-.01em}
.ac-kind{font:600 10px/1 var(--mono);text-transform:uppercase;letter-spacing:.08em;color:var(--accent-ink,var(--accent));
  background:var(--glass);border:1px solid var(--accent);border-radius:999px;padding:4px 8px}
.ac-timer{margin-left:auto;font:600 12px/1 var(--mono);color:var(--muted);font-variant-numeric:tabular-nums}
.ac-note{font-size:12.5px;color:var(--sub);line-height:1.45;margin-top:-2px}
.ac-body{display:flex;gap:8px;align-items:stretch}
.ac-input{flex:1 1 auto;min-width:0;height:46px;padding:0 14px;border:1px solid var(--edge);border-radius:11px;
  background:var(--field);color:var(--txt);font:700 20px/1 var(--mono);letter-spacing:.32em;text-align:center;
  transition:border-color .12s,box-shadow .12s}
.ac-input::placeholder{letter-spacing:.32em;color:var(--dash);font-weight:600}
.ac-input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-tint)}
.ac-send{flex:0 0 auto;height:46px;padding:0 18px;border:0;border-radius:11px;background:var(--accent);color:#fff;
  font:700 14px/1 var(--font);cursor:pointer;transition:filter .12s,opacity .12s}
.ac-send:hover{filter:brightness(1.06)}
.ac-send:disabled{opacity:.5;cursor:default}
.ac-state{min-height:16px;font-size:12.5px;color:var(--muted)}
.ac-state.ok{color:var(--ok)}
.ac-state.err{color:var(--err)}
@media(max-width:520px){.ac-body{flex-direction:column}.ac-send{height:44px}.ac-input{letter-spacing:.28em}}

/* ── Живая панель состояния (🩺 Состояние) ── */
#rail-infra .muted,.muted{color:var(--ink-dim,#8a93a6)}
.infra-head{display:flex;align-items:center;gap:8px;padding:6px 4px 10px}
.mini-btn{font-size:12px;padding:4px 10px;border-radius:8px;border:1px solid var(--line,#2a2f3a);background:transparent;color:inherit;cursor:pointer}
.mini-btn:hover{background:var(--line,#2a2f3a)}
.isec{border:1px solid var(--line,#2a2f3a);border-radius:12px;padding:8px 10px;margin-bottom:8px;background:var(--card,rgba(255,255,255,.02))}
.isec .ihdr{font-weight:700;font-size:12.5px;margin-bottom:6px;letter-spacing:.2px}
.isec .irow{display:flex;align-items:flex-start;gap:7px;font-size:12.5px;padding:2px 0;line-height:1.35;flex-wrap:wrap;word-break:break-word;overflow-wrap:anywhere}
.isec .irow.sub{font-size:11.5px;padding:1px 0}
.isec .irow .ib{font-weight:600}
.isec .irow>.muted{min-width:0;word-break:break-word;overflow-wrap:anywhere}
.isec .icol{flex:1 1 0;min-width:0}
.isec .iln{word-break:break-word}
.isec .inote{color:var(--ink-dim,#8a93a6);font-size:11px;line-height:1.3;margin-top:1px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;overflow-wrap:anywhere}
.isec .itag{margin-left:auto;font-size:10.5px;padding:1px 7px;border-radius:999px;background:var(--line,#2a2f3a);color:var(--ink-dim,#9aa3b4);white-space:nowrap}
.isec .irow.sub .itag{margin-left:0}
.idot{width:9px;height:9px;border-radius:50%;flex:0 0 9px;margin-top:3px;display:inline-block;background:var(--muted);opacity:.5;box-shadow:0 0 0 2px rgba(0,0,0,.15) inset}
.idot.ok{background:#2ecc71;box-shadow:0 0 6px #2ecc7188}
.idot.bad{background:#e74c3c;box-shadow:0 0 6px #e74c3c88}
.idot.warn{background:#f1c40f;box-shadow:0 0 6px #f1c40f88}
.isec .ihdr2{font-size:11px;font-weight:600;color:var(--ink-dim,#8a93a6);margin:8px 0 3px;letter-spacing:.3px;text-transform:uppercase}
.ibar{margin:5px 0}
.ibar-top{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;line-height:1.3;margin-bottom:3px;gap:8px}
.ibar-top span{min-width:0;word-break:break-word;overflow-wrap:anywhere}
.ibar-top b{font-variant-numeric:tabular-nums;flex:0 0 auto}
.ibar-track{height:6px;border-radius:999px;background:var(--line,#2a2f3a);overflow:hidden}
.ibar-fill{display:block;height:100%;border-radius:999px;transition:width var(--dur-2,.18s) var(--ease-out,ease)}
.ibar-fill.ok{background:linear-gradient(90deg,#1FBCA9,#2ecc71)}
.ibar-fill.warn{background:linear-gradient(90deg,#f1c40f,#f39c12)}
.ibar-fill.bad{background:linear-gradient(90deg,#f39c12,#e74c3c)}
.isec .iacts{display:flex;gap:4px;flex:0 0 auto;margin-left:4px}
.iact{font-size:11px;line-height:1;padding:3px 7px;border-radius:7px;border:1px solid var(--line,#2a2f3a);background:transparent;color:var(--ink-dim,#9aa3b4);cursor:pointer}
.iact:hover{background:var(--line,#2a2f3a);color:#e7ebf0}
.iact:disabled{opacity:.5;cursor:default}

.acc-sel{width:100%;padding:8px 10px;border-radius:9px;border:1px solid var(--line,#2a2f3a);background:var(--card,#161a22);color:inherit;font:inherit}

/* Плавный скролл боковых панелей на мобиле (инерция + без «протягивания» страницы) */
.rail-body, .chats, #infra-host { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (max-width: 900px){
  .rail-body{ padding-bottom: calc(18px + env(safe-area-inset-bottom,0px)); }
  .chats{ padding-bottom: calc(10px + env(safe-area-inset-bottom,0px)); }
}

/* Видимость фоновой работы (2026-10-07, запрос владельца): «длинная операция» + явный финал */
.status .pmeta.quiet{color:var(--warn,#e8b04b);font-weight:600}
.run-done{display:inline-flex;align-items:center;gap:6px;margin:6px 0 2px;padding:5px 11px;border-radius:999px;font-size:12px;font-weight:600;color:var(--ok,#46d19e);background:rgba(70,209,158,.1);border:1px solid rgba(70,209,158,.3);font-variant-numeric:tabular-nums}
.math-block { overflow-x: auto; overflow-y: hidden; margin: 12px 0; padding: 2px 0; }
.bubble .katex { font-size: 1.05em; }
.bubble .katex-display { margin: 6px 0; }
/* Follow-up чипсы (предложения продолжения) */
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; }
.fu-chip { background: var(--fill); border: 1px solid var(--line); color: var(--sub); border-radius: 999px; padding: 7px 14px; font-size: 13px; line-height: 1.2; cursor: pointer; transition: border-color .15s, color .15s, background .15s; text-align: left; }
.fu-chip:hover { border-color: var(--a2); color: var(--a2); background: var(--accent-tint); }
/* Переключатель версий ответа ‹k/n› */
.variant-nav { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 3px 4px; background: var(--fill); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; }
.vn-btn { border: none; background: none; color: var(--sub); cursor: pointer; font-size: 16px; line-height: 1; width: 22px; height: 22px; border-radius: 50%; }
.vn-btn:hover:not(:disabled) { background: var(--hover); color: var(--a2); }
.vn-btn:disabled { opacity: .3; cursor: default; }
.vn-lbl { color: var(--muted); min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
