/* ---------- темы ---------- */
html[data-theme="darkai"] {
  --bg:#0b0b0c; --surface:rgba(255,255,255,.07); --side:rgba(255,255,255,.04); --surface2:rgba(255,255,255,.1);
  --border:rgba(255,255,255,.16); --text:#ededed; --muted:#9d9da3; --accent:#e9e9eb; --accent-on:#111113;
  --user:rgba(255,255,255,.12); --danger:#ff8a80; --shadow:0 14px 44px rgba(0,0,0,.4);
  --radius:28px;
}
html[data-theme="claude"] {
  --bg:#f5f4ee; --surface:#ffffff; --side:#efeee8; --surface2:#ebe9e1;
  --border:#dedbd0; --text:#1f1e1d; --muted:#6b6a64; --accent:#c15f3c; --accent-on:#ffffff;
  --user:#ebe9e1; --danger:#b3261e; --shadow:0 2px 8px rgba(0,0,0,.06); --radius:18px;
}
html[data-theme="gemini"] {
  --bg:#131314; --surface:#1e1f20; --side:#1e1f20; --surface2:#2a2b2d;
  --border:#3c4043; --text:#e3e3e3; --muted:#9aa0a6; --accent:#a8c7fa; --accent-on:#062e6f;
  --user:#282a2c; --danger:#f28b82; --shadow:none; --radius:24px;
}
html[data-theme="chatgpt"] {
  --bg:#212121; --surface:#2f2f2f; --side:#171717; --surface2:#2f2f2f;
  --border:#424242; --text:#ececec; --muted:#b4b4b4; --accent:#ececec; --accent-on:#212121;
  --user:#2f2f2f; --danger:#ff8a80; --shadow:none; --radius:20px;
}
html[data-theme="minimal"] {
  --bg:#ffffff; --surface:#f4f4f5; --side:#fafafa; --surface2:#ececef;
  --border:#e4e4e7; --text:#18181b; --muted:#71717a; --accent:#18181b; --accent-on:#ffffff;
  --user:#f0f0f2; --danger:#c00000; --shadow:none; --radius:16px;
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs, 16px);
}
.hidden { display: none !important; }
.logo { font-weight: 600; letter-spacing: .12em; }
.subtle { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 14px; }

/* блики «жидкого стекла» только в теме DARKAI */
html[data-theme="darkai"] body::before, html[data-theme="darkai"] body::after {
  content: ""; position: fixed; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(100px); opacity: .35; z-index: -1; pointer-events: none;
  animation: drift 28s ease-in-out infinite alternate;
}
html[data-theme="darkai"] body::before { background: radial-gradient(circle, #6a6a74, transparent 70%); top: -20vmax; left: -20vmax; }
html[data-theme="darkai"] body::after  { background: radial-gradient(circle, #44444c, transparent 70%); bottom: -25vmax; right: -20vmax; animation-delay: -10s; }
@keyframes drift { to { transform: translate(10vw, 8vh) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { html[data-theme="darkai"] body::before, html[data-theme="darkai"] body::after { animation: none; } }

.glass {
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
html[data-theme="darkai"] .glass {
  backdrop-filter: blur(var(--blur, 24px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur, 24px)) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), var(--shadow);
}

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 16px; padding: 13px 15px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--muted); }
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }

button { font: inherit; cursor: pointer; border: none; color: inherit; }
.btn-primary { background: var(--accent); color: var(--accent-on); border-radius: 999px; padding: 13px 18px; font-weight: 500; }
.btn-ghost { background: transparent; color: var(--muted); border-radius: 999px; padding: 10px 14px; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.danger { color: var(--danger) !important; }
.icon-btn {
  background: var(--surface2); color: var(--text); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; border: 1px solid var(--border);
}
.icon-btn.small { width: 28px; height: 28px; font-size: 12px; background: transparent; border: none; color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.35); }
.card { width: min(92vw, 380px); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.captcha { display: flex; align-items: center; gap: 8px; }
.captcha #captchaImg svg { display: block; border-radius: 14px; }

/* ---------- layout ---------- */
#app {
  height: 100%; display: grid; grid-template-columns: 280px 1fr; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
}
#sidebar { background: var(--side); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; padding: 16px; gap: 12px; }
html[data-theme="darkai"] #sidebar { background: var(--surface); }
.side-top { display: flex; flex-direction: column; gap: 10px; }
#sidebar input { width: 100%; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.chat-item { display: flex; align-items: center; border-radius: 14px; }
.chat-item:hover { background: var(--surface2); }
.chat-item.active { background: var(--surface2); }
.chat-name {
  flex: 1; min-width: 0; background: none; text-align: left; color: var(--text);
  padding: 10px 10px; border-radius: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pin-on { color: var(--accent) !important; }
.side-bottom { display: flex; justify-content: space-between; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }

#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 24px; }
.topbar select { flex: 1; min-width: 0; border-radius: 999px; padding: 9px 14px; }
#menuBtn { display: none; }

#chat {
  flex: 1; overflow-y: auto; min-height: 0; width: 100%; max-width: 820px; margin: 0 auto;
  padding: 24px 8px; display: flex; flex-direction: column; gap: 16px;
}
.empty { margin: auto; text-align: center; }
.empty-title { color: var(--muted); font-size: 24px; margin-bottom: 18px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggest button {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px; text-align: left; color: var(--text); font-size: 14px;
}
.suggest button:hover { background: var(--surface2); }
@media (max-width: 600px) { .suggest { grid-template-columns: 1fr; } }

.msg.user { align-self: flex-end; max-width: 82%; }
.msg.user .body { background: var(--user); border: 1px solid var(--border); padding: 12px 16px; border-radius: 22px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: stretch; }
.msg.bot .body { line-height: 1.6; word-wrap: break-word; padding: 4px; }
.body h3, .body h4, .body h5 { margin: 12px 0 6px; font-weight: 600; }
.body p { margin: 6px 0; }
.body ul, .body ol { margin: 6px 0; padding-left: 22px; }
.body code { font-family: "JetBrains Mono", Consolas, monospace; font-size: .9em; background: var(--surface2); padding: 1px 5px; border-radius: 6px; }
.body pre { position: relative; background: var(--surface); border: 1px solid var(--border); padding: 12px; border-radius: 14px; overflow-x: auto; margin: 10px 0; }
.body pre code { background: none; padding: 0; font-size: 14px; }
.code-copy {
  position: absolute; top: 6px; right: 6px; font-size: 12px; padding: 4px 8px;
  border-radius: 8px; background: var(--surface2); color: var(--muted);
}
.actions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.actions button { font-size: 13px; padding: 5px 9px; border-radius: 999px; background: transparent; color: var(--muted); }
.actions button:hover { background: var(--surface2); color: var(--text); }

.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

footer { padding: 8px 6px 4px; }
.composer { max-width: 820px; margin: 0 auto; border-radius: 30px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.composer textarea { background: transparent; border: none; resize: none; max-height: 200px; padding: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.send {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
  font-size: 20px; display: grid; place-items: center; transition: background .2s, color .2s;
}
.send.working { background: #ffffff; color: #000; border-color: #ffffff; }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9; }

.modal { border-radius: var(--radius); padding: 24px; width: min(92vw, 420px); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.modal h2 { margin: 0; font-weight: 500; }
.modal label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.modal label.row { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.modal select { width: 100%; }
.modal .btn-ghost, .modal .btn-primary { align-self: stretch; text-align: center; }

@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; padding: 8px; }
  #menuBtn { display: grid; }
  #sidebar {
    position: fixed; top: 8px; bottom: 8px; left: 8px; width: min(82vw, 300px);
    transform: translateX(-120%); transition: transform .25s ease; z-index: 10;
  }
  #sidebar.open { transform: translateX(0); }
}

/* ---------- v3: сообщения, код, панели ---------- */
.mlabel { font-size: 12px; color: var(--muted); margin: 0 0 4px 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pair .msg { min-width: 0; }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; } }
.msg.alt .body { border-left: 2px solid var(--accent); padding-left: 12px; }
.body blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--border); color: var(--muted); }
.body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.body a { color: var(--accent); }
.body mark { background: rgba(255, 213, 79, .45); color: inherit; border-radius: 4px; padding: 0 2px; }
.body del { opacity: .7; }
.body table { border-collapse: collapse; margin: 10px 0; display: block; overflow-x: auto; max-width: 100%; }
.body th, .body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.body th { background: var(--surface2); }
.codeblock { margin: 10px 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.codeblock pre { margin: 0; border: none; border-radius: 0; }
.cb-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.cb-head span { flex: 1; }
.cb-head button { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--surface2); color: var(--muted); }
.cb-head button:hover { color: var(--text); }
.react.on { color: var(--accent) !important; background: var(--surface2) !important; }
.selbar { position: fixed; z-index: 15; display: flex; gap: 2px; padding: 4px; border-radius: 14px; }
.selbar button { background: transparent; color: var(--text); padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.selbar button:hover { background: var(--surface2); }
.fmtbar { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 4px; }
.fmtbar button { background: var(--surface2); color: var(--text); padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.composer { position: relative; }
.tplmenu {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; border-radius: 16px; padding: 6px;
  display: flex; flex-direction: column; min-width: 240px; max-height: 300px; overflow-y: auto; z-index: 5;
}
.tplmenu button { text-align: left; background: transparent; color: var(--text); padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.tplmenu button:hover { background: var(--surface2); }
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.icon-btn.tool { width: 34px; height: 34px; font-size: 14px; }
.icon-btn.on { background: var(--accent); color: var(--accent-on); }
.canvas { border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.canvas-head { display: flex; align-items: center; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); }
.canvas-title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; }
#preview { flex: 1; border: none; background: #fff; min-height: 0; width: 100%; }
.codeview { flex: 1; overflow: auto; padding: 10px 0; font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; background: var(--surface2); min-height: 0; }
.codeview .ln { display: flex; white-space: pre; padding-right: 12px; }
.codeview .n { width: 48px; text-align: right; padding-right: 12px; color: var(--muted); user-select: none; flex-shrink: 0; }
#app.canvas-open { grid-template-columns: 280px minmax(0, 1fr) minmax(0, 44%); }
#model2 { border-radius: 999px; padding: 8px 12px; }
@media (max-width: 800px) {
  #app.canvas-open { grid-template-columns: 1fr; }
  #canvas { position: fixed; inset: 8px; z-index: 12; }
}

/* ---------- v4: 10 новых стилей ---------- */
html[data-theme="ocean"]{--bg:#0b1622;--surface:#112133;--side:#0e1b2b;--surface2:#17304a;--border:#24466a;--text:#e6f1ff;--muted:#8aa4bf;--accent:#4cc9f0;--accent-on:#04121c;--user:#17304a;--danger:#ff8080;--shadow:none;--radius:22px}
html[data-theme="forest"]{--bg:#0d1a12;--surface:#15271b;--side:#112016;--surface2:#1d3324;--border:#2d4d37;--text:#e4f2e8;--muted:#8fb29a;--accent:#6fcf97;--accent-on:#072313;--user:#1d3324;--danger:#ff8a80;--shadow:none;--radius:22px}
html[data-theme="sunset"]{--bg:#1d1118;--surface:#2a1822;--side:#241520;--surface2:#3a2230;--border:#55304a;--text:#fbe9ef;--muted:#c99aaf;--accent:#ff8a5b;--accent-on:#2a0f05;--user:#3a2230;--danger:#ff8a80;--shadow:none;--radius:22px}
html[data-theme="rose"]{--bg:#faf1f4;--surface:#ffffff;--side:#f6e6ec;--surface2:#f1dbe3;--border:#e8c5d1;--text:#3b1f2a;--muted:#8c5c6e;--accent:#c2185b;--accent-on:#ffffff;--user:#f6e1e9;--danger:#b3261e;--shadow:0 2px 8px rgba(0,0,0,.06);--radius:18px}
html[data-theme="mono"]{--bg:#111111;--surface:#181818;--side:#141414;--surface2:#222222;--border:#333333;--text:#eeeeee;--muted:#888888;--accent:#ffffff;--accent-on:#000000;--user:#222222;--danger:#ff8a80;--shadow:none;--radius:14px}
html[data-theme="paper"]{--bg:#fbf8f1;--surface:#fffdf7;--side:#f5f0e3;--surface2:#efe8d6;--border:#ddd3bd;--text:#2b2a26;--muted:#7a7566;--accent:#3d5a80;--accent-on:#ffffff;--user:#efe8d6;--danger:#b3261e;--shadow:0 2px 8px rgba(0,0,0,.05);--radius:16px}
html[data-theme="midnight"]{--bg:#05060f;--surface:#0c0e1f;--side:#090b1a;--surface2:#141733;--border:#222652;--text:#dfe3ff;--muted:#7d84b8;--accent:#7c8cff;--accent-on:#05061a;--user:#141733;--danger:#ff8a80;--shadow:none;--radius:24px}
html[data-theme="neon"]{--bg:#07070a;--surface:#101016;--side:#0b0b10;--surface2:#17171f;--border:#1f2a33;--text:#d6fff0;--muted:#5fa890;--accent:#00ffa3;--accent-on:#00120b;--user:#17171f;--danger:#ff5577;--shadow:0 0 24px rgba(0,255,163,.08);--radius:20px}
html[data-theme="solar"]{--bg:#fdf6e3;--surface:#fffaf0;--side:#f3ecd6;--surface2:#eee6cc;--border:#d9cfae;--text:#586e75;--muted:#93a1a1;--accent:#b58900;--accent-on:#ffffff;--user:#eee6cc;--danger:#dc322f;--shadow:none;--radius:18px}
html[data-theme="terminal"]{--bg:#0a0f0a;--surface:#0f170f;--side:#0c130c;--surface2:#14201a;--border:#1f3a25;--text:#7dff9e;--muted:#3f9c5a;--accent:#7dff9e;--accent-on:#051a0b;--user:#14201a;--danger:#ff7a7a;--shadow:none;--radius:10px}

/* ---------- v4: шрифт, плотность, счётчик ---------- */
body { font-family: var(--font, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif); }
html[data-density="compact"] #chat { gap: 8px; padding-top: 12px; }
html[data-density="compact"] .msg.bot .body { line-height: 1.45; }
.counter { font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; align-self: center; }

/* ---------- v4: устройства ---------- */
html[data-device="phone"] #app { grid-template-columns: 1fr; padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); }
html[data-device="phone"] #app.canvas-open { grid-template-columns: 1fr; }
html[data-device="phone"] #sidebar { position: fixed; top: 8px; bottom: 8px; left: 8px; width: min(82vw, 300px); transform: translateX(-120%); transition: transform .25s ease; z-index: 10; }
html[data-device="phone"] #sidebar.open { transform: translateX(0); }
html[data-device="phone"] #menuBtn { display: grid; }
html[data-device="phone"] #canvas { position: fixed; inset: 8px; z-index: 12; }
html[data-device="phone"] input, html[data-device="phone"] textarea, html[data-device="phone"] select { font-size: 16px; }
html[data-device="phone"] .suggest { grid-template-columns: 1fr; }
html[data-device="phone"] .pair { grid-template-columns: 1fr; }
html[data-device="phone"] .msg.user { max-width: 92%; }
html[data-device="phone"] .counter { display: none; }
html[data-device="tablet"] #app { grid-template-columns: 240px minmax(0, 1fr); }
html[data-device="tablet"] #app.canvas-open { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 42%); }
html[data-ios="1"] body { height: -webkit-fill-available; }
html[data-ios="1"] footer { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- v5: скрытие элементов из чата (доступны в настройках) ---------- */
html.hide-counter #counter { display: none !important; }
html.hide-fmt #fmtBtn { display: none !important; }
html.hide-tpl #tplBtn { display: none !important; }
html.hide-mic #micBtn { display: none !important; }
html.hide-export #exportBtn { display: none !important; }
html.hide-attach #attachBtn { display: none !important; }
html.hide-cmp #cmpBtn { display: none !important; }
html.hide-canvas #canvasBtn { display: none !important; }
html.hide-react .act-react { display: none !important; }
html.hide-speak .act-speak { display: none !important; }
.sec { margin: 10px 0 2px; font-weight: 600; color: var(--text); }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tools-grid button {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; font-size: 14px;
}
.tools-grid button:disabled { opacity: .4; }

/* ---------- v6: запуск кода, сохранённые ответы, поиск ---------- */
html.hide-run .cb-run { display: none !important; }
html.hide-save .act-save { display: none !important; }
.cb-run { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--accent); color: var(--accent-on); }
.msg .body.hit { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
.sv-item { border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sv-text { white-space: pre-wrap; font-size: 14px; max-height: 120px; overflow: auto; }
.modal p { margin: 4px 0; color: var(--text); }

/* ---------- v7: иконки и кнопки ---------- */
.icon-btn {
  background: var(--surface2); color: var(--text); width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; border: 1px solid var(--border); padding: 0;
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--border); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { display: block; }
.icon-btn.tool { width: 36px; height: 36px; border-radius: 11px; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.on { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }

.modal {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  width: min(92vw, 440px); gap: 12px;
}
.modal h2 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.modal .sec {
  margin: 14px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.modal label { gap: 6px; font-size: 14px; }
.modal select, .modal input[type=text], .modal textarea {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; font-size: 15px;
}
.modal label.row {
  background: var(--surface2); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  border: 1px solid transparent;
}
.modal label.row:hover { border-color: var(--border); }
.modal label.row span { font-size: 14px; color: var(--text); }
.modal input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; }
.modal textarea { resize: vertical; }

.modal .btn-primary {
  background: var(--accent); color: var(--accent-on); border-radius: 14px;
  min-height: 46px; font-weight: 600; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.modal .btn-ghost {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; min-height: 44px; font-size: 15px; font-weight: 500;
}
.modal .btn-ghost:hover { background: var(--border); }
.modal .danger { color: var(--danger) !important; }

.tools-grid { gap: 8px; }
.tools-grid button {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 10px; font-size: 14px; font-weight: 500;
  text-align: center; min-height: 48px; line-height: 1.2;
  transition: background .15s;
}
.tools-grid button:hover { background: var(--border); }
.tools-grid button:disabled { opacity: .4; }

.send { border-radius: 14px; width: 42px; height: 42px; }
.send svg { display: block; }
.send.working { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }

.chip { border-radius: 10px; padding: 6px 11px; font-size: 13px; font-weight: 500; }
.chip[aria-pressed="true"] { box-shadow: 0 4px 12px rgba(0,0,0,.15); }

.sv-item { border-radius: 14px; }
.sv-item input { width: 100%; font-size: 13px; }
