/* AI Hub — минималистичный интерфейс. Светлая и тёмная темы. */

:root {
  --bg: #fbfbfa;
  --bg-2: #ffffff;
  --bg-3: #f2f2f0;
  --ink: #1b1b1a;
  --ink-2: #4a4a47;
  --ink-3: #8a8a85;
  --line: #e5e4e0;
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --danger: #d24b3e;
  --ok: #1f9254;
  --warn: #b9770e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --rail: 56px;
  --sidebar: 264px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131315;
    --bg-2: #1a1a1d;
    --bg-3: #232327;
    --ink: #ececea;
    --ink-2: #b6b6b2;
    --ink-3: #7d7d79;
    --line: #2c2c31;
    --accent: #6c95ff;
    --accent-ink: #0d1220;
    --danger: #ef6a5c;
    --ok: #4bbd80;
    --warn: #d69b3e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #131315;
  --bg-2: #1a1a1d;
  --bg-3: #232327;
  --ink: #ececea;
  --ink-2: #b6b6b2;
  --ink-3: #7d7d79;
  --line: #2c2c31;
  --accent: #6c95ff;
  --accent-ink: #0d1220;
  --danger: #ef6a5c;
  --ok: #4bbd80;
  --warn: #d69b3e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- каркас */
.app { display: grid; grid-template-columns: var(--rail) var(--sidebar) 1fr; height: 100vh; height: 100dvh; }

/* Скрытие боковой панели — только на широком экране: на мобильном раскладка другая. */
@media (min-width: 901px) {
  .app.no-sidebar { grid-template-columns: var(--rail) 0 1fr; }
}

.rail {
  grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 0; background: var(--bg-3); border-right: 1px solid var(--line);
}
.rail__logo { font-size: 20px; color: var(--accent); margin-bottom: 10px; user-select: none; }
.rail__spacer { flex: 1; }
.rail__btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-3);
  cursor: pointer; transition: background .15s, color .15s;
}
.rail__btn:hover { background: rgba(127,127,127,.14); color: var(--ink); }
.rail__btn.is-active { background: var(--bg-2); color: var(--accent); box-shadow: var(--shadow); }

.sidebar {
  grid-column: 2; display: flex; flex-direction: column; min-width: 0;
  background: var(--bg); border-right: 1px solid var(--line);
}
.sidebar__top { padding: 12px; display: grid; gap: 8px; }
.sidebar__list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.sidebar__foot { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

.main { grid-column: 3; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.view { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.view.is-active { display: flex; }

/* ---------------------------------------------------------------- элементы */
.btn {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.iconbtn {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-3); cursor: pointer;
}
.iconbtn:hover { background: rgba(127,127,127,.14); color: var(--ink); }
.iconbtn--sm { width: 26px; height: 26px; }
.iconbtn--send { background: var(--accent); color: var(--accent-ink); }
.iconbtn--send:hover { background: var(--accent); filter: brightness(1.08); color: var(--accent-ink); }
.iconbtn.is-rec { color: #fff; background: var(--danger); }
.ico { display: grid; place-items: center; }

.input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); outline: none;
}
.input:focus { border-color: var(--accent); }
.input--search { background: var(--bg-3); }
select.input { appearance: auto; }
.label { display: block; font-size: 13px; color: var(--ink-3); margin: 12px 0 5px; }
textarea.input { resize: vertical; min-height: 80px; font-family: inherit; }

.chip {
  padding: 5px 11px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--bg-2); font-size: 13px; cursor: pointer; color: var(--ink-2);
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip--model { font-family: var(--mono); font-size: 12px; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 100px; font-size: 11px;
  background: var(--bg-3); color: var(--ink-3); border: 1px solid var(--line); }
.tag--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tag--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* ---------------------------------------------------------------- список чатов */
.chatitem {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-2); font-size: 14px;
}
.chatitem:hover { background: var(--bg-3); color: var(--ink); }
.chatitem.is-active { background: var(--bg-3); color: var(--ink); font-weight: 500; }
.chatitem__title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatitem__meta { font-size: 11px; color: var(--ink-3); }
.chatitem .iconbtn { opacity: 0; }
.chatitem:hover .iconbtn { opacity: 1; }
.sidebar__group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); padding: 12px 10px 4px; }

.hit { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.hit:hover { background: var(--bg-3); }
.hit__title { font-size: 13px; font-weight: 500; }
.hit__snippet { font-size: 12px; color: var(--ink-3); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------------------------------------------------------------- шапка */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg); min-height: 54px;
}
.topbar__title { font-weight: 550; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__tools { display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- сообщения */
.messages { flex: 1; overflow-y: auto; padding: 20px 16px 8px; scroll-behavior: smooth; }
.msg { max-width: 780px; margin: 0 auto 18px; }
.msg__head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 5px; }
.msg__who { font-weight: 600; color: var(--ink-2); }
.msg__actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: .15s; }
.msg:hover .msg__actions { opacity: 1; }
.msg__body { }
.msg--user .msg__body {
  background: var(--bg-3); border-radius: var(--radius); padding: 10px 14px; white-space: pre-wrap; word-break: break-word;
}
.msg--assistant .msg__body { word-break: break-word; }
.msg--error .msg__body { color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius); padding: 10px 14px; }
.msg__body > :first-child { margin-top: 0; }
.msg__body > :last-child { margin-bottom: 0; }
.msg__body p { margin: .6em 0; }
.msg__body ul, .msg__body ol { padding-left: 1.3em; }
.msg__body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 14px; }
.msg__body th, .msg__body td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.msg__body blockquote { margin: .6em 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--ink-2); }
.msg__body code:not(.hljs) { background: var(--bg-3); padding: 1px 5px; border-radius: 5px;
  font-family: var(--mono); font-size: .88em; }
.msg__att { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg__img { max-width: 260px; max-height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.msg__usage { font-size: 11px; color: var(--ink-3); margin-top: 6px; font-family: var(--mono); }
.cursor::after { content: '▍'; animation: blink 1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.codeblock { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: .8em 0; }
.codebar { display: flex; align-items: center; padding: 4px 6px 4px 12px; background: var(--bg-3);
  border-bottom: 1px solid var(--line); }
.codebar__lang { font-size: 11px; color: var(--ink-3); font-family: var(--mono); text-transform: lowercase; }
.codebar__actions { margin-left: auto; display: flex; gap: 2px; }
.codeblock pre { margin: 0; padding: 12px; overflow-x: auto; background: var(--bg-2); }
.codeblock code { font-family: var(--mono); font-size: 13px; line-height: 1.5; background: none; }

.empty { max-width: 640px; margin: 8vh auto; text-align: center; color: var(--ink-3); }
.empty h2 { color: var(--ink); font-weight: 600; font-size: 22px; margin-bottom: 6px; }
.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 22px; text-align: left; }
.starter { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); cursor: pointer; font-size: 13px; color: var(--ink-2); }
.starter:hover { border-color: var(--accent); color: var(--ink); }
.starter b { display: block; color: var(--ink); font-weight: 550; margin-bottom: 2px; }

/* ---------------------------------------------------------------- ввод */
.composer { padding: 8px 16px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.composer__box {
  max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 5px;
}
.composer__box:focus-within { border-color: var(--accent); }
.composer__input {
  flex: 1; border: 0; outline: none; background: transparent; resize: none;
  padding: 7px 4px; max-height: 200px; line-height: 1.5;
}
.composer__files { max-width: 780px; margin: 0 auto 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.filechip { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 100px; font-size: 12px; }
.filechip img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.composer__hint { max-width: 780px; margin: 6px auto 0; font-size: 11px; color: var(--ink-3); text-align: center; min-height: 14px; }

/* ---------------------------------------------------------------- страницы */
.page { flex: 1; overflow-y: auto; padding: 22px 20px 60px; }
.page__inner { max-width: 860px; margin: 0 auto; }
.page h1 { font-size: 20px; margin: 0 0 4px; }
.page h2 { font-size: 15px; margin: 26px 0 10px; }
.page .muted { color: var(--ink-3); font-size: 13px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  padding: 14px 16px; margin-bottom: 10px; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card__title { font-weight: 550; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 12px 14px; }
.stat__label { font-size: 12px; color: var(--ink-3); }
.stat__value { font-size: 22px; font-weight: 600; margin-top: 2px; letter-spacing: -.01em; }
.stat__sub { font-size: 12px; color: var(--ink-3); }

.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px;
  border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-size: 12px; }

.keyrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: 0; }
.keyrow__val { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.dot--on { background: var(--ok); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.gallery img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; cursor: pointer; }
.gallery figcaption { padding: 7px 9px; font-size: 12px; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.notelist { display: grid; gap: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; background: var(--bg-2); }
.note__text { flex: 1; white-space: pre-wrap; font-size: 14px; }
.note.is-off { opacity: .5; }

.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 100px; transition: .18s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------------------------------------------------------------- модалки */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 16px;
}
.modal { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; width: min(560px, 100%); max-height: 86dvh; overflow-y: auto; }
.modal--sm { width: min(380px, 100%); }
.modal--wide { width: min(1000px, 100%); height: min(720px, 86dvh); display: flex; flex-direction: column; }
.modal__title { margin: 0 0 6px; font-size: 16px; }
.modal__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.modal__head .modal__title { flex: 1; margin: 0; }
.modal__text { margin: 0 0 14px; color: var(--ink-2); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.preview__frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }

.picker__search { margin-bottom: 10px; }
.picker__list { max-height: 52dvh; overflow-y: auto; margin: 0 -6px; }
.picker__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.picker__item:hover { background: var(--bg-3); }
.picker__item.is-active { background: var(--bg-3); }
.picker__name { font-family: var(--mono); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.picker__meta { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.picker__group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 12px 10px 4px; }

/* ---------------------------------------------------------------- уведомления */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow); animation: toastIn .2s ease-out; }
.toast--err { background: var(--danger); color: #fff; }
.toast--ok { background: var(--ok); color: #fff; }
.toast.is-out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

.banner { padding: 9px 14px; background: color-mix(in srgb, var(--warn) 15%, var(--bg));
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

/* ---------------------------------------------------------------- заставка / вход */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 300; padding: 20px; }
.boot__card { width: min(400px, 100%); text-align: center; }
.boot__logo { font-size: 34px; color: var(--accent); }
.boot__title { font-size: 22px; margin: 6px 0 2px; }
.boot__sub { color: var(--ink-3); font-size: 13px; margin: 0 0 18px; }

/* ---------------------------------------------------------------- адаптив */
.only-mobile { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  /* Одна колонка: контент сверху, панель навигации снизу. */
  .app { grid-template-columns: 100%; grid-template-rows: minmax(0, 1fr) auto; }
  .rail {
    grid-column: 1; grid-row: 2; flex-direction: row; justify-content: space-around;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    gap: 0;
  }
  .rail__logo, .rail__spacer { display: none; }
  .rail__btn { width: 44px; height: 42px; }
  .main { grid-column: 1; grid-row: 1; min-width: 0; }

  /* Список чатов — выдвижная панель поверх контента. */
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 60;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow);
    background: var(--bg-2);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar.is-open { transform: none; }
  /* Нижняя навигация всегда поверх шторки — иначе из неё не выйти. */
  .rail { position: relative; z-index: 70; }
  .sidebar { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35); }
  .only-mobile { display: grid; }

  /* Крупный шрифт в полях — иначе iOS зумит страницу при фокусе. */
  .input, .composer__input, select.input, textarea.input { font-size: 16px; }

  .messages { padding: 14px 12px 4px; }
  .msg { margin-bottom: 16px; }
  .msg__actions { opacity: 1; }
  .composer { padding: 6px 10px 10px; }
  .composer__hint { text-align: left; }
  .page { padding: 16px 14px 48px; }

  .topbar { padding: 8px 10px; gap: 6px; }
  .topbar__title { font-size: 15px; }
  .topbar__tools { min-width: 0; flex-shrink: 0; }
  .topbar__tools .chip { max-width: 118px; padding: 5px 9px; }

  /* Карточки и строки перестраиваются в столбик вместо горизонтальной каши. */
  .card { padding: 12px 13px; }
  .card__head { flex-wrap: wrap; row-gap: 4px; }
  .keyrow { flex-wrap: wrap; row-gap: 6px; }
  .keyrow > .btn { flex: 1 1 auto; }
  .keyrow__val { word-break: break-all; }
  .row--between { gap: 12px; }
  .grid2, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  /* Широкие таблицы прокручиваются внутри себя, а не растягивают страницу. */
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -13px; padding: 0 13px; }
  table.data { min-width: 460px; }

  /* Модалки — как шторка снизу, до неё легко дотянуться. */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-width: none; border-radius: 16px 16px 0 0; border-bottom: 0;
    max-height: 88dvh; padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    animation: sheetUp .2s ease-out;
  }
  .modal--sm { width: 100%; }
  .modal--wide { height: 88dvh; }
  .picker__list { max-height: 58dvh; }
  .picker__item { flex-wrap: wrap; row-gap: 2px; padding: 11px 10px; }
  .picker__name { flex: 1 1 100%; }
  .modal__actions .btn { flex: 1; }

  /* Всплывающие подсказки не должны прятаться за нижней панелью. */
  .toasts { bottom: calc(70px + env(safe-area-inset-bottom)); }

  /* Поля и выпадающие списки на всю ширину — иначе текст обрезается.
     Узкие поля цен внутри таблицы остаются узкими. */
  .page .input { max-width: none !important; width: 100%; }
  .page td .input { max-width: 84px !important; width: 84px; }
  .page .row > .btn { flex: 1 1 auto; }
}

@keyframes sheetUp { from { transform: translateY(16px); } }

@media (max-width: 480px) {
  .msg__img { max-width: 150px; }
  .stat__value { font-size: 18px; }
  .stat { padding: 10px 11px; }
  .starters { grid-template-columns: 1fr; }
  .empty { margin: 4vh auto; }
  .topbar__tools .chip { max-width: 96px; font-size: 12px; }
  .msg--user .msg__body { padding: 9px 12px; }
}

@media (max-width: 380px) {
  .rail__btn { width: 40px; }
  .grid2, .grid4 { grid-template-columns: 1fr; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
::-webkit-scrollbar-track { background: transparent; }
