/* ===================================================================
   QuantexAI — дизайн-система. Светлый премиум (Claude-каркас).
   Тёплая бумага, serif-заголовки, спокойный бирюзовый акцент.
   Тёмная тема — тёплый charcoal. Переключение через data-theme.
   =================================================================== */

:root {
  /* Поверхности */
  --bg:        #faf7f2;
  --bg-soft:   #ffffff;
  --surface:   #ffffff;
  --card:      #ffffff;
  --card-2:    #f4efe7;
  --raised:    #fffdfa;

  /* Границы */
  --border:        #e9e2d6;
  --border-strong: #ddd4c4;
  --border-faint:  #f0ebe2;

  /* Текст */
  --text:     #1f1d1a;
  --text-2:   #4a463f;
  --text-dim: #6f6a60;
  --muted:    #9b9488;

  /* Акцент — спокойная бирюза + тёплая хвоя как вторичный */
  --accent:       #0f8a86;
  --accent-ink:   #0a6e6a;
  --accent-soft:  #def2f1;
  --accent-faint: #eef8f7;
  --pine:         #2f5547;

  /* Статусы (оплата и т.п.) */
  --accent-2:     #0f8a86;
  --success:      #1f8a5c;
  --danger:       #c0392b;

  /* Прочее */
  --shadow-sm: 0 1px 2px rgba(40, 30, 20, .04);
  --shadow:    0 8px 30px -12px rgba(60, 45, 30, .18);
  --shadow-lg: 0 30px 70px -30px rgba(60, 45, 30, .30);
  --radius:    16px;
  --radius-sm: 11px;
  --radius-lg: 26px;

  --font-serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  --maxw: 1120px;
}

[data-theme="dark"] {
  --bg:        #18150f;
  --bg-soft:   #1f1b15;
  --surface:   #1f1b15;
  --card:      #211d16;
  --card-2:    #2a251d;
  --raised:    #242019;

  --border:        #332d23;
  --border-strong: #423a2d;
  --border-faint:  #2a251d;

  --text:     #f4efe6;
  --text-2:   #d8d1c4;
  --text-dim: #a79f90;
  --muted:    #807866;

  --accent:       #2bb3ad;
  --accent-ink:   #4cc7c1;
  --accent-soft:  #10302e;
  --accent-faint: #0e211f;
  --pine:         #7fa896;

  --accent-2:     #2bb3ad;
  --success:      #4cc78f;
  --danger:       #e07a6a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 10px 34px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* Убираем синюю рамку-обводку при тапе/фокусе на кнопках и ссылках (mobile).
   Доступность сохраняем: видимая обводка только при навигации с клавиатуры. */
button, a, .btn, [role="button"], textarea, input, select { outline: none; }
button:focus, a:focus, .btn:focus, [role="button"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
.container { width: min(var(--maxw), 90%); margin: 0 auto; }

/* Тонкая бумажная зернистость поверх всего фона */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-family: var(--font-sans);
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .2s, border-color .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); border-color: var(--text-dim); }
.btn-soft { background: var(--card-2); color: var(--text); }
.btn-soft:hover { background: var(--border); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Логотип ===== */
.logo { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-serif); font-weight: 500; font-size: 21px; letter-spacing: -0.02em; color: var(--text); }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg);
  display: grid; place-items: center; font-family: var(--font-serif); font-weight: 600; font-size: 17px;
  flex: 0 0 auto;
}

/* ===== Шапка ===== */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--border-faint);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a.link { color: var(--text-dim); font-size: 15px; font-weight: 450; transition: color .2s; }
.nav-links a.link:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; margin-right: 10px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 15px;
  color: var(--text-dim); transition: background .2s, border-color .2s;
}
.theme-toggle:hover { background: var(--card-2); border-color: var(--border-strong); }

/* ===== Бейдж / eyebrow ===== */
.badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text-dim); font-size: 13px; font-weight: 450; box-shadow: var(--shadow-sm);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.badge-short { display: none; }   /* короткий вариант — только на мобиле */
.eyebrow { color: var(--accent-ink); font-weight: 500; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-sans); }

/* ===== Hero ===== */
.hero { position: relative; padding: 96px 0 56px; overflow: hidden; }
.hero-grain { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 80% at 50% -10%, var(--accent-faint), transparent 55%); }
.hero .container { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: clamp(40px, 7.2vw, 78px); line-height: 1.02; margin: 26px auto 0;
  max-width: 16ch; font-weight: 480;
}
.hero h1 em { font-style: italic; color: var(--accent-ink); }
.hero .lead {
  font-size: clamp(17px, 2.2vw, 21px); color: var(--text-dim); max-width: 60ch;
  margin: 26px auto 0; line-height: 1.55; font-weight: 400;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 36px; }
.hero-trust { margin-top: 26px; color: var(--muted); font-size: 14px; }

/* Мокап продукта — окно приложения со скриншот-перспективой */
.mockup-frame { margin: 72px auto 0; max-width: 980px; perspective: 1800px; }
.mockup {
  border-radius: 18px; border: 1px solid var(--border); background: var(--bg-soft);
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left;
  transform: rotateX(4deg); transform-origin: center top; transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.mockup-frame:hover .mockup { transform: rotateX(0deg); }
.mockup-bar { display: flex; align-items: center; gap: 7px; padding: 13px 18px; border-bottom: 1px solid var(--border-faint); background: var(--card-2); }
.mockup-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.mockup-bar .mtitle { margin-left: 12px; font-size: 12.5px; color: var(--muted); }
.mockup-grid { display: grid; grid-template-columns: 200px 1fr; min-height: 360px; }
.mk-side { border-right: 1px solid var(--border-faint); padding: 16px 14px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 7px; }
.mk-newchat { font-size: 13px; font-weight: 500; color: var(--text-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.mk-conv { font-size: 13px; color: var(--text-dim); padding: 8px 11px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-conv.active { background: var(--card-2); color: var(--text); }
.mk-chat { padding: 24px 26px; display: grid; gap: 18px; align-content: start; }
.mk-msg { display: flex; gap: 13px; align-items: flex-start; }
.mk-av { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.mk-av.u { background: var(--card-2); color: var(--text-2); }
.mk-av.a { background: var(--accent); color: #fff; font-family: var(--font-serif); }
.mk-txt { font-size: 14.5px; color: var(--text-2); line-height: 1.62; }
.mk-txt .nm { font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.mk-pill { display:inline-block; margin-top:6px; font-size:11.5px; color:var(--accent-ink); background:var(--accent-soft); padding:3px 9px; border-radius:999px; }
.mk-input { margin-top: 6px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 11px 14px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13.5px; }
.mk-input .snd { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
@media (max-width: 640px) { .mockup-grid { grid-template-columns: 1fr; } .mk-side { display: none; } .mockup { transform: none; } }

/* Полоса метрик */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-faint);
  border: 1px solid var(--border-faint); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-soft); padding: 30px 24px; text-align: center; }
.stat .sv { font-family: var(--font-serif); font-size: 38px; font-weight: 500; letter-spacing: -0.03em; }
.stat .sl { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Bento-сетка возможностей */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bento .feature { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.bento .span-2 { grid-column: span 2; }
.bento .tall { display: flex; flex-direction: column; justify-content: space-between; }
@media (max-width: 820px) { .bento { grid-template-columns: 1fr 1fr; } .bento .span-2 { grid-column: span 2; } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .bento .span-2 { grid-column: span 1; } }

/* ===== Секции ===== */
section { padding: 84px 0; }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); margin: 14px 0 0; font-weight: 480; }
.section-head p { color: var(--text-dim); font-size: 18px; margin-top: 16px; line-height: 1.55; }
.divider-soft { border: none; border-top: 1px solid var(--border-faint); }

/* ===== Фичи ===== */
.grid { display: grid; gap: 1px; background: var(--border-faint); border: 1px solid var(--border-faint);
  border-radius: var(--radius); overflow: hidden; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.feature { background: var(--bg-soft); padding: 32px 30px; transition: background .25s; }
.feature:hover { background: var(--raised); }
.feature .fic {
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent-faint); color: var(--accent-ink);
  display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--accent-soft);
}
.feature .fic svg { width: 20px; height: 20px; }
.feature h3 { font-size: 19px; margin-bottom: 9px; font-weight: 500; }
.feature p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }

/* Карточки общего вида */
.card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }

/* ===== Логотипы моделей (строка доверия) ===== */
.logos { display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: center; align-items: center; }
.logos .ml { color: var(--text-dim); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; opacity: .82; transition: opacity .2s, color .2s; }
.logos .ml:hover { opacity: 1; color: var(--text); }

/* ===== Как работает ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.step .sn { font-family: var(--font-serif); font-size: 15px; color: var(--accent-ink); margin-bottom: 14px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.step h3 { font-size: 21px; margin-bottom: 10px; font-weight: 500; }
.step p { color: var(--text-dim); font-size: 15.5px; line-height: 1.6; }

/* ===== Тарифы ===== */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 auto 40px; background: var(--card-2);
  border-radius: 999px; border: 1px solid var(--border-faint); }
.tabs-wrap { display: flex; justify-content: center; }
.tab { padding: 9px 22px; border-radius: 999px; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-weight: 500; font-size: 14.5px; color: var(--text-dim); transition: all .2s; }
.tab.active { background: var(--bg-soft); color: var(--text); box-shadow: var(--shadow-sm); }

.price-card { position: relative; display: flex; flex-direction: column; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-card .tag { position: absolute; top: -11px; left: 30px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 999px; }
.price-card .plan-name { font-family: var(--font-serif); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.price-card .price { font-family: var(--font-serif); font-size: 42px; font-weight: 500; letter-spacing: -0.03em; margin: 10px 0 2px; }
.price-card .price small { font-family: var(--font-sans); font-size: 15px; color: var(--muted); font-weight: 400; }
.price-card ul { list-style: none; margin: 22px 0 26px; display: grid; gap: 12px; }
.price-card ul li { color: var(--text-2); font-size: 15px; padding-left: 28px; position: relative; line-height: 1.45; }
.price-card ul li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.price-card .btn { margin-top: auto; }

/* Сетки тарифов (с отступами, отдельные карточки) */
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ===== FAQ ===== */
.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--border-faint); }
.faq-item { border-bottom: 1px solid var(--border-faint); }
.faq-q { width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 24px 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--text);
  font-family: var(--font-sans); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.faq-q .pm { flex: 0 0 auto; width: 22px; height: 22px; position: relative; color: var(--accent-ink); transition: transform .3s; }
.faq-q .pm::before, .faq-q .pm::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.faq-q .pm::before { top: 10px; left: 3px; right: 3px; height: 2px; }
.faq-q .pm::after { left: 10px; top: 3px; bottom: 3px; width: 2px; transition: opacity .3s; }
.faq-item.open .pm::after { opacity: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; color: var(--text-dim); font-size: 15.5px; line-height: 1.65; }
.faq-a div { padding: 0 4px 24px; }

/* ===== CTA ===== */
.cta-band { background: linear-gradient(135deg, var(--accent), var(--accent-ink)); color: #fff;
  border-radius: var(--radius-lg); padding: 72px 48px; text-align: center; box-shadow: var(--shadow-lg); }
[data-theme="dark"] .cta-band { background: linear-gradient(135deg, var(--accent), var(--accent-ink)); border: none; }
.cta-band h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 14px; color: inherit; font-weight: 480; }
.cta-band p { opacity: .92; font-size: 18px; margin-bottom: 32px; }
.cta-band .btn-primary { background: #fff; color: var(--accent-ink); }
.cta-band .btn-primary:hover { background: var(--accent-faint); color: var(--accent-ink); }

/* ===== Футер ===== */
footer { border-top: 1px solid var(--border-faint); padding: 48px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--text); }

/* ===== Авторизация ===== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 42px 38px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; text-align: center; font-weight: 500; }
.auth-card .sub { color: var(--text-dim); text-align: center; margin-bottom: 28px; font-size: 15px; }
.input { width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 15px; font-family: var(--font-sans); margin-bottom: 13px;
  outline: none; transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); margin: 22px 0; font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 18px; line-height: 1.5; }
.alert { background: var(--accent-faint); border: 1px solid var(--accent-soft); color: var(--accent-ink);
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; text-align: center; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft);
  font-weight: 500; font-size: 14px; color: var(--text-2); }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero { padding: 64px 0 40px; }
  .cta-band { padding: 48px 24px; }
  /* Шапка на мобиле: компактнее, тема+Войти помещаются без переноса */
  .nav-inner { height: 58px; }
  .logo { font-size: 18px; }
  .nav-actions { gap: 8px; margin-right: 2px; }
  .nav-actions .btn { padding: 7px 14px; font-size: 14px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  /* Бейдж-подарок: аккуратный перенос, точка у первой строки, не липнет к краям */
  .badge {
    align-items: center; gap: 8px; font-size: 13px; line-height: 1.4;
    padding: 7px 14px; max-width: 100%;
  }
  .badge .dot { flex: 0 0 auto; }
  .badge-full { display: none; }     /* на мобиле прячем длинный текст */
  .badge-short { display: inline; }  /* показываем короткий */
}

/* Анимация появления */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===================================================================
   ДАШБОРД
   =================================================================== */
.dash { display: grid; grid-template-columns: 272px 1fr; height: 100vh; background: var(--bg); }
.sidebar { background: var(--bg-soft); border-right: 1px solid var(--border-faint); display: flex;
  flex-direction: column; padding: 18px 16px; gap: 16px; overflow: hidden; }
.sidebar .logo { font-size: 19px; padding: 4px 4px 0; }
.bal-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.bal-box .label { color: var(--text-dim); font-size: 13px; }
.bal-box .val { font-family: var(--font-serif); font-size: 30px; font-weight: 500; margin: 2px 0 13px; letter-spacing: -0.02em; }
.bal-box .val small { font-family: var(--font-sans); font-size: 15px; color: var(--muted); }
.sb-section-title { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 4px; margin-top: 4px; }
.model-select { width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-soft); color: var(--text); font-size: 14px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; outline: none; }
.model-meta { font-size: 12.5px; color: var(--muted); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 450; font-size: 14px; transition: background .15s; }
.sb-nav a:hover { background: var(--card-2); color: var(--text); }

.chat-wrap { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.chat-top { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px;
  border-bottom: 1px solid var(--border-faint); background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); }
.chat-top .title { font-family: var(--font-serif); font-weight: 500; font-size: 16px; }
.chat-top .acts { display: flex; gap: 9px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft);
  cursor: pointer; display: grid; place-items: center; font-size: 15px; color: var(--text-dim); }
.icon-btn:hover { background: var(--card-2); }

.mode-switch { display: inline-flex; background: var(--card-2); border: 1px solid var(--border-faint); border-radius: 10px; padding: 3px; gap: 3px; }
.mode-btn { padding: 7px 14px; border: none; background: none; color: var(--text-dim); font-family: var(--font-sans);
  font-weight: 500; font-size: 13.5px; border-radius: 7px; cursor: pointer; transition: all .15s; }
.mode-btn.active { background: var(--bg-soft); color: var(--text); box-shadow: var(--shadow-sm); }

.conv-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-dim); font-size: 14px; transition: background .15s; white-space: nowrap; overflow: hidden; }
.conv-item:hover, .conv-item.active { background: var(--card-2); color: var(--text); }
.conv-item .ct { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.conv-item .del { opacity: 0; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.conv-item:hover .del { opacity: .55; }
.conv-item .del:hover { opacity: 1; background: var(--accent-faint); }

.messages { flex: 1; overflow-y: auto; padding: 30px 0; }
.msg-inner { width: min(740px, 92%); margin: 0 auto; display: flex; gap: 15px; padding: 11px 0; }
.msg-avatar { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.msg-avatar.user { background: var(--card-2); color: var(--text-2); }
.msg-avatar.ai { background: var(--accent); color: #fff; font-family: var(--font-serif); overflow: hidden; }
.msg-avatar.ai:has(img.bi) { border: 1px solid var(--border); }
.msg-avatar .bi { width: 20px; height: 20px; object-fit: contain; display: block; }
.msg-body { flex: 1; min-width: 0; }
.msg-body .who { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.msg-body .content { font-size: 15.5px; line-height: 1.72; color: var(--text); word-wrap: break-word; }
.msg-body .content p { margin: 0 0 11px; }
.msg-body .content pre { background: var(--card-2); border: 1px solid var(--border-faint); border-radius: 11px;
  padding: 14px; overflow-x: auto; font-size: 13.5px; margin: 10px 0; }
.msg-body .content code { background: var(--card-2); padding: 2px 6px; border-radius: 6px; font-size: 13.5px; }
.msg-body .content pre code { background: none; padding: 0; }
.msg-body .content img { max-width: 100%; border-radius: 12px; margin-top: 4px; display: block; border: 1px solid var(--border); }
/* Типографика ответа: serif-заголовки, аккуратные списки/цитаты, жирный/курсив */
.msg-body .content .md-h { font-family: var(--font-serif); font-weight: 600; line-height: 1.28;
  color: var(--text); letter-spacing: -.01em; margin: 18px 0 8px; }
.msg-body .content .md-h1 { font-size: 25px; }
.msg-body .content .md-h2 { font-size: 21px; }
.msg-body .content .md-h3 { font-size: 18px; }
.msg-body .content .md-h4 { font-size: 16px; }
.msg-body .content > .md-h:first-child { margin-top: 2px; }
.msg-body .content ul, .msg-body .content ol { margin: 6px 0 12px; padding-left: 24px; }
.msg-body .content li { margin: 4px 0; line-height: 1.6; }
.msg-body .content ul li::marker { color: var(--accent); }
.msg-body .content ol li::marker { color: var(--text-dim); font-weight: 600; }
.msg-body .content blockquote { margin: 12px 0; padding: 6px 16px; border-left: 3px solid var(--accent);
  color: var(--text-2); background: var(--accent-faint); border-radius: 0 9px 9px 0; }
.msg-body .content blockquote p { margin: 0; }
.msg-body .content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.msg-body .content strong { font-weight: 700; color: var(--text); }
.msg-body .content em { font-style: italic; }
.msg-body .content del { color: var(--muted); }
.msg-body .content a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.msg-meta { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.cursor::after { content: "▋"; animation: blink 1s steps(2) infinite; color: var(--accent); margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.img-loading { color: var(--text-dim); font-style: italic; }

.chat-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--text-dim); }
.chat-empty .big { font-size: 42px; margin-bottom: 14px; }
.chat-empty h2 { font-family: var(--font-serif); font-weight: 500; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; max-width: 580px; }
.suggestion { padding: 11px 16px; border: 1px solid var(--border); background: var(--bg-soft); border-radius: 11px;
  cursor: pointer; font-size: 14px; color: var(--text-2); transition: border-color .2s, background .2s; }
.suggestion:hover { border-color: var(--accent); background: var(--accent-faint); }

.composer { border-top: 1px solid var(--border-faint); padding: 16px 0 22px; background: var(--bg); }
.composer-inner { width: min(740px, 92%); margin: 0 auto; }
.composer-box { display: flex; align-items: flex-end; gap: 10px; background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 9px 9px 9px 16px; transition: border-color .2s, box-shadow .2s; box-shadow: var(--shadow-sm); }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.composer textarea { flex: 1; border: none; background: none; resize: none; color: var(--text); font-size: 15.5px;
  font-family: var(--font-sans); outline: none; max-height: 200px; line-height: 1.5; padding: 7px 0; }
.composer textarea::placeholder { color: var(--muted); }
.send-btn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 16px; display: grid; place-items: center; transition: opacity .2s, background .2s; }
.send-btn:hover { background: var(--accent-ink); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }
.composer .hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 9px; }

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0 28% 0 0; z-index: 60; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid !important; }
}
.menu-btn { display: none; }

/* ── Код в сообщениях: заголовок + копирование ── */
.code-block { margin: 12px 0; border: 1px solid var(--border-faint); border-radius: 11px; overflow: hidden; background: var(--card-2); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font-size: 12px;
  color: var(--text-dim); background: color-mix(in srgb, var(--card-2) 70%, var(--bg)); border-bottom: 1px solid var(--border-faint); }
.code-head .lang { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.code-copy { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; border-radius: 5px; }
.code-copy:hover { color: var(--text); background: var(--border-faint); }
.code-block pre { margin: 0; border: none; border-radius: 0; background: transparent; padding: 14px; }

/* Таблицы в сообщениях */
.msg-body .content table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.msg-body .content th, .msg-body .content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.msg-body .content th { background: var(--card-2); font-weight: 600; }

/* Действия под ответом */
.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .15s; }
.msg-inner:hover .msg-actions { opacity: 1; }
.msg-act { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; transition: all .15s; }
.msg-act:hover { color: var(--text); background: var(--card-2); }
.msg-act.copied { color: var(--pine); }

/* Кнопка отправки в режиме «стоп» */
.send-btn.stop { background: var(--text); }
.send-btn.stop:hover { background: var(--accent-ink); }

/* ── Кастомное меню выбора модели ── */
.model-picker { position: relative; }
.model-trigger { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--bg-soft); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.model-trigger:hover { background: var(--card-2); }
.model-trigger .chev { color: var(--muted); font-size: 11px; }
.model-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 60vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 7px; z-index: 80; display: none; }
.model-menu.open { display: block; }
.mm-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px 5px; }
.mm-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; transition: background .12s; }
.mm-item:hover { background: var(--card-2); }
.mm-item.active { background: var(--accent-faint); }
.mm-item .mm-name { font-size: 14px; font-weight: 500; color: var(--text); }
.mm-item .mm-cost { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mm-item.active .mm-name { color: var(--accent-ink); }

/* ===================================================================
   ДАШБОРД — профессиональный вид (ChatGPT/Claude-like). Sans-serif,
   монохромные иконки, чёткие фоны. Переопределяет ранние правила.
   =================================================================== */
.dash { font-family: var(--font-sans); }
[data-theme="light"] .dash { --side-bg: #f5f3ee; --chat-bg: #ffffff; --line: #e7e3da; }
[data-theme="dark"]  .dash { --side-bg: #16130e; --chat-bg: #1c1813; --line: #2c271f; }

.dash .sidebar { background: var(--side-bg); border-right: 1px solid var(--line); gap: 14px; padding: 16px 12px; }
.dash .chat-wrap { background: var(--chat-bg); }
.dash .chat-top { background: var(--chat-bg); border-bottom: 1px solid var(--line); backdrop-filter: none; }
.dash .composer { background: var(--chat-bg); border-top: 1px solid var(--line); }
.dash .messages { background: var(--chat-bg); }

/* Шрифты приложения — без serif */
.dash h2, .dash .bal-box .val, .dash .chat-empty h2, .dash .logo,
.dash .msg-avatar.ai { font-family: var(--font-sans); }
.dash .logo { font-weight: 600; letter-spacing: -0.02em; }
.dash .bal-box .val { font-weight: 700; letter-spacing: -0.02em; }
.dash .chat-empty h2 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.dash .msg-body .who { color: var(--text); }
.dash .msg-avatar.ai { font-weight: 700; }

/* Логотип-марка — чёткий квадрат */
.dash .logo .mark { border-radius: 8px; }

/* Баланс */
.dash .bal-box { background: var(--chat-bg); border: 1px solid var(--line); border-radius: 14px; }

/* Иконки в кнопках/навигации */
.ic { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.btn .ic { width: 16px; height: 16px; }

/* Кнопки дашборда */
.dash .btn-primary { background: var(--accent); color: #fff; font-weight: 500; }
.dash .btn-primary:hover { background: var(--accent-ink); }
.dash .btn-ghost { border-color: var(--line); background: var(--chat-bg); color: var(--text); }
.dash .btn-ghost:hover { background: var(--card-2); }

/* Навигация сайдбара */
.dash .sb-nav a { font-size: 14px; color: var(--text-dim); }
.dash .sb-nav a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.dash .sb-nav a .ic { color: var(--muted); }
.dash .sb-section-title { color: var(--muted); }

/* Список диалогов */
.dash .conv-item { color: var(--text-dim); }
.dash .conv-item:hover, .dash .conv-item.active { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.dash .conv-item .del { color: var(--muted); }
.dash .conv-item .del .ic { width: 15px; height: 15px; }

/* Сегментированный переключатель режима */
.dash .mode-switch { background: var(--card-2); border-color: var(--line); }
.dash .mode-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); }
.dash .mode-btn .ic { width: 15px; height: 15px; }
.dash .mode-btn.active { background: var(--chat-bg); color: var(--text); }

/* Пузыри сообщений — крупнее, чище */
.dash .msg-inner { gap: 16px; padding: 14px 0; }
.dash .msg-avatar { width: 30px; height: 30px; border-radius: 8px; }
.dash .msg-avatar.user { background: var(--card-2); color: var(--text-2); }

/* Композер */
.dash .composer-box { background: var(--chat-bg); border-color: var(--border-strong); border-radius: 14px; }
.dash .send-btn { border-radius: 10px; }

/* Пустой экран — иконка-спарк */
.dash .chat-empty .spark { width: 34px; height: 34px; color: var(--accent); margin: 0 auto 16px; display: block; }
.dash .chat-empty p { color: var(--text-dim); }

/* hljs — мягкая подстройка под палитру */
.hljs { background: transparent !important; color: var(--text); font-size: 13.5px; }
[data-theme="light"] .hljs-keyword, [data-theme="light"] .hljs-selector-tag { color: #0a6e6a; }
[data-theme="light"] .hljs-string, [data-theme="light"] .hljs-attr { color: #2f5547; }
[data-theme="light"] .hljs-number, [data-theme="light"] .hljs-literal { color: #8a5a00; }
[data-theme="light"] .hljs-comment { color: #9b9488; font-style: italic; }
[data-theme="light"] .hljs-title, [data-theme="light"] .hljs-function .hljs-title { color: #1f1d1a; font-weight: 600; }
[data-theme="dark"] .hljs-keyword { color: #4cc7c1; }
[data-theme="dark"] .hljs-string, [data-theme="dark"] .hljs-attr { color: #7fa896; }
[data-theme="dark"] .hljs-number, [data-theme="dark"] .hljs-literal { color: #d6a55c; }
[data-theme="dark"] .hljs-comment { color: #807866; font-style: italic; }
[data-theme="dark"] .hljs-title { color: #f4efe6; font-weight: 600; }

/* ===================================================================
   ДАШБОРД v2 — Gemini-style: сворачиваемый сайдбар, инпут-пилюля,
   профиль внизу, тосты, кнопка «вниз». Переопределяет блоки выше.
   =================================================================== */
.dash { grid-template-columns: var(--sb-w, 272px) 1fr; transition: grid-template-columns .28s cubic-bezier(.2,.8,.2,1); }
.dash.collapsed { --sb-w: 70px; }

.dash .sidebar {
  background: var(--side-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; overflow: hidden;
}

/* Верх: бургер + логотип */
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 44px; padding: 0 4px 0 6px; margin-bottom: 16px; }
.sb-top .sb-logo { flex: 1; }
.rail-btn { width: 42px; height: 42px; flex: 0 0 auto; border: none; background: none; border-radius: 10px;
  cursor: pointer; display: grid; place-items: center; color: var(--text-dim); transition: background .15s; }
.rail-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.rail-btn .ic { width: 20px; height: 20px; }
.sb-logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-sans); font-weight: 600;
  font-size: 18px; letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; }
.sb-logo .mark { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-family: var(--font-serif); font-weight: 600; font-size: 15px; }

/* Пункты меню */
.sb-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 11px; border: none;
  background: none; border-radius: 11px; cursor: pointer; color: var(--text-2); font-family: var(--font-sans);
  font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; transition: background .15s; }
.sb-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.sb-item .ic { width: 19px; height: 19px; flex: 0 0 auto; color: var(--text-dim); }
.sb-item.on { background: var(--accent-faint); color: var(--accent-ink); }
.sb-item.on .ic { color: var(--accent-ink); }

/* Поиск */
.sb-search { padding: 4px 2px; display: none; }
.sb-search.open { display: block; }
.sb-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--chat-bg); color: var(--text); font-size: 14px; font-family: var(--font-sans); outline: none; }
.sb-search input:focus { border-color: var(--accent); }

/* Недавние */
.sb-recents { flex: 1; overflow-y: auto; margin-top: 6px; padding-right: 2px; }
.sb-label { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 8px 11px 4px; font-weight: 600; }
.sb-date { font-size: 11px; color: var(--muted); padding: 12px 11px 4px; font-weight: 600; }
.conv-item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  color: var(--text-dim); font-size: 14px; white-space: nowrap; overflow: hidden; transition: background .12s; }
.conv-item:hover, .conv-item.active { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.conv-item .ct { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.conv-item .dots { opacity: 0; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: none;
  background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; font-size: 16px; }
.conv-item:hover .dots { opacity: .7; }
.conv-item .dots:hover { opacity: 1; background: color-mix(in srgb, var(--text) 10%, transparent); }
.conv-rename { flex: 1; min-width: 0; border: 1px solid var(--accent); border-radius: 7px; padding: 5px 8px;
  font: inherit; font-size: 14px; background: var(--chat-bg); color: var(--text); outline: none; }
.conv-item .pin-ic { width: 13px; height: 13px; flex: 0 0 auto; fill: none; stroke: var(--accent);
  stroke-width: 1.8; stroke-linejoin: round; }

/* Контекстное меню диалога (поделиться/закрепить/переименовать/удалить) */
.ctx-menu { position: fixed; z-index: 80; min-width: 200px; padding: 6px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: msgin .14s ease; }
.ctx-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: none;
  background: none; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; color: var(--text-2); text-align: left; }
.ctx-menu button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.ctx-menu button .ic { width: 17px; height: 17px; flex: 0 0 auto; color: var(--text-dim); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.ctx-menu button.danger .ic { color: var(--danger); }

/* Модалка «Поделиться» */
.share-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 15, 10, .45);
  display: grid; place-items: center; padding: 20px; animation: msgin .15s ease; }
.share-card { width: min(460px, 100%); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px; box-shadow: var(--shadow-lg); }
.share-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.share-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.share-row { display: flex; gap: 8px; margin-bottom: 16px; }
.share-row input { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; background: var(--card-2); color: var(--text-2); outline: none; }
.share-row .btn { flex: 0 0 auto; }
.share-done { display: block; margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 14px; padding: 6px 4px; }
.share-done:hover { color: var(--text); }

/* Низ: баланс + профиль */
.sb-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.sb-bal { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 11px; color: var(--text-2);
  transition: background .15s; }
.sb-bal:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.sb-bal .bal-ic { width: 19px; flex: 0 0 auto; color: var(--accent); display: grid; place-items: center; }
.sb-bal .bal-ic .ic { width: 19px; height: 19px; }
.sb-bal .lbl { display: flex; flex-direction: column; line-height: 1.15; }
.sb-bal .lbl b { font-size: 14.5px; color: var(--text); }
.sb-bal .lbl small { font-size: 12px; color: var(--muted); }
.sb-user-wrap { position: relative; }
.sb-user { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 11px; border: none;
  background: none; border-radius: 11px; cursor: pointer; transition: background .15s; }
.sb-user:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.sb-user .ava { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.sb-user .uname { flex: 1; min-width: 0; text-align: left; font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .chev { color: var(--muted); font-size: 13px; flex: 0 0 auto; transition: transform .2s; }
.sb-user-wrap.open .sb-user .chev { transform: rotate(180deg); }

/* Меню профиля */
.profile-menu { position: absolute; left: 4px; right: 4px; bottom: calc(100% + 6px); z-index: 70;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; }
.sb-user-wrap.open .profile-menu { display: block; animation: msgin .14s ease; }
.profile-menu .pm-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--border-faint); margin-bottom: 5px; }
.profile-menu .pm-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-menu .pm-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: none;
  background: none; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; color: var(--text-2); text-align: left; }
.pm-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.pm-item .ic { width: 17px; height: 17px; flex: 0 0 auto; color: var(--text-dim); }
.pm-item .theme-glyph { width: 17px; text-align: center; flex: 0 0 auto; font-size: 15px; }
.pm-item.danger { color: var(--danger); }
.pm-item.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pm-item.danger .ic { color: var(--danger); }

/* Свёрнутый сайдбар */
.dash.collapsed .sidebar { padding: 12px; align-items: stretch; }
.dash.collapsed .lbl, .dash.collapsed .sb-label, .dash.collapsed .sb-date,
.dash.collapsed .sb-search, .dash.collapsed .conv-item .dots { display: none !important; }
.dash.collapsed .sb-item { justify-content: center; padding: 11px 0; }
.dash.collapsed .conv-item { display: none; }
.dash.collapsed .sb-recents { overflow: hidden; }
.dash.collapsed .sb-bal { justify-content: center; padding: 10px 0; }
.dash.collapsed .sb-user { justify-content: center; padding: 8px 0; }
.dash.collapsed .sb-user .chev { display: none; }
.dash.collapsed .sb-top { justify-content: center; margin-bottom: 12px; }
.dash.collapsed .sb-logo { display: none; }

/* Шапка чата */
.dash .chat-top { display: flex; align-items: center; gap: 10px; padding: 12px 20px; min-height: 56px;
  border-bottom: 1px solid var(--line); background: var(--chat-bg); backdrop-filter: none; }
.dash .chat-top .menu-btn { display: none; }
.dash .ct-title { flex: 1; font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Лента сообщений */
.dash .messages { background: var(--chat-bg); }

/* Пустой экран — приветствие по центру */
.hero-chat { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 6px; }
.hero-chat .greet { font-family: var(--font-serif); font-size: clamp(26px, 4vw, 40px); font-weight: 500; letter-spacing: -.02em; }
.hero-chat .greet .accent { color: var(--accent-ink); }
.hero-chat .sub { color: var(--text-dim); font-size: 16px; margin-top: 2px; }
.hero-chat .suggestions { margin-top: 22px; }

/* Композер-пилюля */
.dash .composer { border-top: none; background: var(--chat-bg); padding: 4px 0 18px; }
.dash .composer-box { display: block; background: var(--chat-bg); border: 1px solid var(--border-strong);
  border-radius: 24px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.dash .composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border-strong)); box-shadow: var(--shadow); }
.dash .composer textarea { width: 100%; border: none; background: none; resize: none; color: var(--text);
  font-size: 16px; font-family: var(--font-sans); outline: none; max-height: 220px; line-height: 1.5; padding: 8px 6px 4px; }
.comp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; }
.comp-left { display: inline-flex; align-items: center; gap: 2px; background: var(--card-2); border-radius: 999px; padding: 3px; }
.web-toggle { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-dim); transition: all .15s; }
.web-toggle .ic { width: 16px; height: 16px; }
.web-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.web-toggle.on { background: var(--accent); color: #fff; }
.web-toggle.on .ic { color: #fff; }
/* Нативный интернет (DeepSeek/Gemini/Qwen/Grok/GPT-5 Nano) — зелёная подсветка
   с лёгким свечением, отличает «бесплатный встроенный» от платного поиска. */
.web-toggle.native { background: #16a34a; color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 25%, transparent); }
.web-toggle.native .ic { color: #fff; }
.web-toggle.native:hover { background: #15a046; color: #fff; }
.web-searching { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-ink); font-size: 14px; }
.web-searching::before { content: ""; width: 13px; height: 13px; border: 2px solid var(--accent);
  border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.web-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent-ink);
  background: var(--accent-faint); border: 1px solid var(--accent-soft); padding: 2px 8px; border-radius: 20px; margin-right: 6px; }
.seg { border: none; background: none; padding: 6px 13px; border-radius: 999px; cursor: pointer; font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; color: var(--text-dim); transition: all .15s; }
.seg.active { background: var(--chat-bg); color: var(--text); box-shadow: var(--shadow-sm); }
.comp-right { display: inline-flex; align-items: center; gap: 8px; }
.dash .model-trigger { padding: 7px 12px; border-radius: 999px; font-size: 13.5px; }
.dash .send-btn { width: 40px; height: 40px; border-radius: 50%; }
.model-menu.up { top: auto; bottom: calc(100% + 8px); }
.comp-foot { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px 0; flex-wrap: wrap; }
.comp-foot .model-meta { font-size: 12px; color: var(--muted); }
.comp-foot .hint { font-size: 12px; color: var(--muted); }

/* Вложения: лоток превью в композере */
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 6px 8px; }
.att-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--card-2); border-radius: 10px; }
.att-chip.att-img { width: 54px; height: 54px; padding: 0; }
.att-chip.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }
.att-chip.att-file { padding: 8px 9px 8px 11px; font-size: 13px; color: var(--text-2); max-width: 220px; }
.att-chip.att-file .ic { color: var(--accent); flex: 0 0 auto; }
.att-chip .att-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ✕ внутри картинки — тёмный кружок, не обрезается */
.att-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.62); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.att-x:hover { background: rgba(0,0,0,.82); }
/* у файла ✕ в ряд, не налезает */
.att-chip.att-file .att-x { position: static; width: 18px; height: 18px; flex: 0 0 auto; margin-left: 2px;
  background: var(--border-strong); color: var(--text); }
.att-chip.att-file .att-x:hover { background: var(--muted); color: #fff; }
.composer-box.dragover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }

/* Вложения в отправленном сообщении пользователя */
.att-sent { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-thumb { max-width: 220px; max-height: 220px; border-radius: 12px; border: 1px solid var(--border); }
.att-file-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2);
  background: var(--card-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 11px; }

/* Кнопка «вниз» */
/* Кнопка «вниз» отключена по просьбе — не показываем никогда */
.scroll-btn { display: none !important; }
.scroll-btn.show { opacity: 1; pointer-events: auto; }
.scroll-btn:hover { color: var(--text); }
.scroll-btn .ic { width: 19px; height: 19px; }
.chat-wrap { position: relative; }

/* Тосты */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex;
  flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toastin .25s cubic-bezier(.2,.8,.2,1); max-width: 90vw; }
.toast.err { background: var(--accent-ink); color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Появление сообщений */
.msg-row { animation: msgin .35s cubic-bezier(.2,.8,.2,1); }
@keyframes msgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Переключатель темы в сайдбаре */
.sb-item .theme-glyph { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 16px; color: var(--text-dim); }
.dash.collapsed #theme-toggle { justify-content: center; padding: 11px 0; }

/* Плавающая кнопка меню (только мобайл) */
.mobile-menu { display: none; position: absolute; top: 12px; left: 12px; z-index: 6; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--chat-bg); color: var(--text-dim);
  cursor: pointer; place-items: center; box-shadow: var(--shadow-sm); }
.mobile-menu .ic { width: 20px; height: 20px; }

/* Без верхней полосы лента начинается с отступом */
.dash .messages { padding-top: 26px; }

/* Шторка для мобильных */
.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(20,15,10,.4); z-index: 59; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .dash .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); }
  .dash.sb-open .sidebar { transform: none; }
  .dash.sb-open .sidebar-scrim { display: block; }
  .mobile-menu { display: grid; }
  .dash .messages { padding-top: 64px; }
  .dash.collapsed { --sb-w: 1fr; }
  .composer-box { border-radius: 22px; }
}

/* ===== Гостевой режим ===== */
.guest-bar { position: absolute; top: 14px; right: 16px; z-index: 7; display: flex; align-items: center; gap: 10px; }
.guest-bar .btn { padding: 9px 18px; font-size: 14px; }
.free-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.free-chip .ic { color: var(--accent); }

.guest-gate { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--chat-bg) 70%, transparent); backdrop-filter: blur(8px); }
.gate-card { width: min(440px, 100%); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px; text-align: center; box-shadow: var(--shadow-lg); }
.gate-card .gate-spark { font-size: 30px; color: var(--accent); margin-bottom: 8px; }
.gate-card h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 500; margin-bottom: 10px; }
.gate-card p { color: var(--text-dim); font-size: 15px; line-height: 1.5; margin-bottom: 22px; }

/* ===== Меню моделей — бренд-иконки + цены (MashaGPT-style) ===== */
.model-menu .mm-head { display: flex; justify-content: flex-end; padding: 8px 12px 6px; }
.model-menu .mm-prices { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.model-menu .mm-prices:hover { color: var(--text); }
.mm-item { gap: 11px; }
.mm-brand { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); font-size: 13px; font-weight: 700; border: 1px solid var(--border); overflow: hidden; }
.mm-item .mm-mid { flex: 1; min-width: 0; }
.mm-item .mm-name { display: block; }
.mm-item .mm-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mm-item .mm-cost { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.mm-item .mm-cost .bolt { color: var(--accent); }
.mm-item.locked { opacity: .55; }
.mm-item.locked .mm-lock { font-size: 12px; color: var(--muted); }

/* ===== Плашка стоимости после ответа ===== */
.cost-pill { display: inline-block; background: var(--accent-faint); color: var(--accent-ink);
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.msg-meta .tok { margin-left: 8px; color: var(--muted); }

/* ===== Иконка модели на кнопке выбора ===== */
.dash .model-trigger { display: inline-flex; align-items: center; gap: 7px; }
.mt-brand { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); font-size: 11px; font-weight: 700; border: 1px solid var(--border); overflow: hidden; }
.mt-brand:empty { display: none; }
.mm-brand img.bi, .mt-brand img.bi { width: 72%; height: 72%; object-fit: contain; display: block; }

/* ===== Кнопка «+» и меню ===== */
.comp-left { display: inline-flex; align-items: center; gap: 8px; background: none; padding: 0; border-radius: 0; }
.plus-wrap { position: relative; }
.plus-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--chat-bg); color: var(--text-dim); cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.plus-btn:hover { background: var(--card-2); color: var(--text); }
.plus-btn .ic { width: 18px; height: 18px; }
.plus-menu { position: absolute; bottom: calc(100% + 10px); left: 0; min-width: 210px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 80; }
.plus-menu.open { display: block; }
.plus-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: none;
  background: none; border-radius: 9px; cursor: pointer; font-family: var(--font-sans); font-size: 14px; color: var(--text-2); }
.plus-menu button:hover { background: var(--card-2); color: var(--text); }
.plus-menu button .ic { width: 18px; height: 18px; color: var(--text-dim); }

/* Чип режима изображений */
.mode-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 11px; border-radius: 999px;
  background: var(--accent-faint); color: var(--accent-ink); font-size: 13px; font-weight: 500; }
.mode-chip .ic { color: var(--accent-ink); }
.mode-chip .chip-x { border: none; background: none; cursor: pointer; color: var(--accent-ink); font-size: 13px; padding: 0 2px; line-height: 1; }

/* ===== Пустой экран: приветствие + инпут по центру + чипы ===== */
.welcome-top, .welcome-bottom { display: none; }
.dash.empty .messages { display: none; }
.dash.empty .chat-wrap { justify-content: center; }
.dash.empty .composer { padding-top: 4px; padding-bottom: 4px; }
.dash.empty .welcome-top { display: block; }
.dash.empty .welcome-bottom { display: flex; }
.welcome-top { text-align: center; padding: 0 16px 8px; animation: msgin .4s cubic-bezier(.2,.8,.2,1); }
.welcome-top .greet { font-family: var(--font-serif); font-size: clamp(26px, 4.4vw, 42px); font-weight: 500; letter-spacing: -.02em; }
.welcome-top .greet .accent { color: var(--accent-ink); }
.welcome-bottom { gap: 10px; flex-wrap: wrap; justify-content: center; padding: 8px 16px 0; width: min(760px, 92%); margin: 0 auto; }
.achip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border-strong);
  background: var(--chat-bg); border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--text-2);
  font-family: var(--font-sans); transition: border-color .2s, background .2s; }
.achip:hover { border-color: var(--accent); background: var(--accent-faint); color: var(--accent-ink); }
.achip .ic { width: 17px; height: 17px; color: var(--accent-ink); }

/* ===================================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ДАШБОРДА (≤860px) — профессиональный проход
   Цели: убрать «сырость», уместить чат, меню моделей нижним шитом,
   центрировать приветствие, плавная шторка-сайдбар (Gemini-style).
   =================================================================== */
@media (max-width: 860px) {
  /* высота с учётом адресной строки мобильного браузера (не обрезает чат) */
  .dash, .chat-wrap { height: 100dvh; }

  /* лента сообщений: ровные поля, безопасная зона, не липнет к краям */
  .messages { padding: 60px 14px 10px; }

  /* приветствие — по центру свободной области, а не у верха */
  .chat-empty { height: 100%; align-content: center; }
  .chat-empty .big { font-size: 34px; }
  .chat-empty h2 { font-size: 22px; line-height: 1.25; }
  .suggestions { gap: 8px; margin-top: 18px; }

  /* композер прижат к низу, с учётом «жестовой» зоны телефона */
  .composer { padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); }
  .composer-inner { width: 94%; }
  .composer-box { border-radius: 22px; }
  .send-btn { width: 42px; height: 42px; }

  /* МЕНЮ ВЫБОРА МОДЕЛИ → нижний шит на всю ширину (как в Gemini) */
  .model-menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-height: 80dvh; overflow-y: auto;
    border-radius: 20px 20px 0 0; border-bottom: none;
    padding: 6px 10px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 44px rgba(0,0,0,.32);
    animation: sheetup .26s cubic-bezier(.2,.8,.2,1);
  }
  .model-menu::before {            /* «ручка» сверху, как в нативных шитах */
    content: ""; display: block; width: 42px; height: 4px; border-radius: 3px;
    background: var(--border-strong); margin: 6px auto 12px;
  }
  .mm-item { padding: 13px 12px; }            /* крупнее зона тапа */
  .mm-item .mm-name { font-size: 15px; }
  .mm-item .mm-brand { width: 30px; height: 30px; }

  /* шторка-сайдбар: шире, мягкое затемнение */
  .dash .sidebar { width: 86%; max-width: 320px; }
  .sidebar-scrim { background: rgba(15,12,8,.55); backdrop-filter: blur(2px); }

  /* мод-чип «Изображение» виднее */
  .mode-chip { font-size: 13px; }
}
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }

/* ===== Поиск по чатам — модальное окно (заголовки списком) ===== */
.search-modal { display: none; position: fixed; inset: 0; z-index: 90; padding: 78px 16px;
  background: rgba(15,12,8,.45); backdrop-filter: blur(4px); }
.search-modal.open { display: block; }
.search-card { width: min(640px, 100%); margin: 0 auto; background: var(--chat-bg);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: sheetup .2s cubic-bezier(.2,.8,.2,1); }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-bar .ic { color: var(--muted); width: 18px; height: 18px; }
.search-bar input { flex: 1; border: none; background: none; outline: none; color: var(--text);
  font-size: 16px; font-family: var(--font-sans); }
.search-close { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer;
  padding: 4px 9px; border-radius: 8px; }
.search-close:hover { background: var(--card-2); color: var(--text); }
.search-results { max-height: 62vh; overflow-y: auto; padding: 8px; }
.search-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 12px 10px 5px; }
.search-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: none;
  background: none; color: var(--text); padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-family: var(--font-sans); }
.search-item:hover { background: var(--card-2); }
.search-item .ic { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.search-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .search-modal { padding: 56px 10px; } .search-results { max-height: 72vh; } }

/* ===================================================================
   МОБИЛЬНАЯ ДОВОДКА v2 (≤860px) — идёт последней, перекрывает прежние
   =================================================================== */
@media (max-width: 860px) {
  body, .chat-wrap, .dash { overflow-x: hidden; }   /* никакого горизонтального скролла */

  /* --- Шит выбора модели: жёстко фиксируем низ (перебиваем .up) --- */
  #model-menu.model-menu, #model-menu.model-menu.up {
    position: fixed !important; left: 0 !important; right: 0 !important;
    bottom: 0 !important; top: auto !important; width: 100% !important;
    max-height: 78dvh; border-radius: 20px 20px 0 0;
  }
  .model-menu .mm-item .mm-name { font-size: 13.5px; }
  .model-menu .mm-item .mm-sub  { font-size: 11px; }

  /* --- Композер: не разъезжается в режиме картинок --- */
  .comp-bar { flex-wrap: wrap; gap: 6px; }
  .comp-left { flex-wrap: wrap; gap: 4px; }
  .comp-right { margin-left: auto; }
  .web-toggle span { display: none; }            /* «Веб» — только иконка */
  .mode-chip { font-size: 12px; padding: 5px 8px; }
  .model-trigger { max-width: 46vw; }
  #model-trigger-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* --- Пустой чат: только приветствие + поле по центру, без чипов --- */
  .dash.empty .welcome-bottom { display: none !important; }
  .welcome-top .greet { font-size: 26px; }

  /* --- Сообщения: переносим длинный текст/код, не ломаем ширину --- */
  .messages .content { overflow-wrap: anywhere; word-break: break-word; }
  .messages .code-block pre { overflow-x: auto; }
  .msg-row, .msg-inner { max-width: 100%; }
  .messages img { max-width: 100%; height: auto; }

  /* --- Композер «спросите что угодно»: матовое стекло с размытием --- */
  .composer {
    background: color-mix(in srgb, var(--chat-bg) 72%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid color-mix(in srgb, var(--line, var(--border)) 60%, transparent);
  }
  .composer-box {
    background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }

  /* --- ШТОРКА КАК В GEMINI: главный экран уезжает вправо, сайдбар слева --- */
  .dash .chat-wrap { transition: transform .28s cubic-bezier(.2,.8,.2,1); will-change: transform; }
  .dash.sb-open .chat-wrap { transform: translateX(86%); }
  .dash .sidebar { width: 86%; max-width: 360px; box-shadow: none; }
  .sidebar-scrim { background: rgba(10,8,5,.35); }
}
