/* Оформление сайта. Цвета собраны в начале: поменяй их, чтобы перекрасить сайт. */
:root {
  --bg: #0d0a0f;
  --panel: #151118;
  --panel-2: #1d1721;
  --panel-3: #261e2b;
  --line: #2c2331;
  --text: #f3edf3;
  --mute: #a094a6;
  --accent: #f0436a;
  --accent-2: #9c1a45;
  --accent-soft: rgba(240, 67, 106, 0.14);
  --accent-ink: #fff;
  --good: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #f2b84b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  /* Фирменная заливка кнопок и значков, её бледный вариант и цветное свечение под ней. */
  --grad: linear-gradient(135deg, #ff5c7a, var(--accent-2));
  --grad-soft: linear-gradient(135deg, rgba(255, 92, 122, 0.24), rgba(156, 26, 69, 0.1));
  --glow: 0 8px 24px -8px rgba(240, 67, 106, 0.7);
  /* Движения: быстрый старт и мягкая остановка; spring чуть перелетает цель и возвращается. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 15.5px; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.5; overflow-x: hidden;
}
body.has-modal { overflow: hidden; }
::selection { background: rgba(240, 67, 106, 0.38); color: #fff; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: 0.5; cursor: default; }
/* Рамка фокуса видна тем, кто ходит по странице клавиатурой; у полей ввода своя подсветка. */
:focus-visible { outline: 2px solid rgba(255, 92, 122, 0.75); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
small { color: var(--mute); font-size: 0.84rem; }
code, pre { font-family: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", monospace; font-size: 0.88em; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mute { color: var(--mute); }
.pad { padding: 14px 4px; }
.center { display: grid; place-items: center; padding: 34px 0; }
.hint { color: var(--mute); font-size: 0.86rem; display: flex; gap: 7px; align-items: center; }
.problem { color: #ffb4b4; background: rgba(255, 107, 107, 0.09); border: 1px solid rgba(255, 107, 107, 0.3); border-radius: 11px; padding: 11px 14px; }
.warn { color: #f6d38b; background: rgba(242, 184, 75, 0.08); border: 1px solid rgba(242, 184, 75, 0.28); border-radius: 11px; padding: 10px 13px; font-size: 0.88rem; }
.noscript { text-align: center; padding: 40px 20px; }
.mobile, .icon-btn.mobile { display: none; }
/* Тонкие полосы прокрутки в цвет страницы. */
.chats, .log, .modal-body, .code pre, .table-scroll { scrollbar-width: thin; scrollbar-color: #3d3145 transparent; }

/* Кольцо загрузки: градиент от прозрачного к фирменному цвету, середина вырезана маской. */
.spinner {
  width: 30px; height: 30px; border-radius: 50%; display: inline-block; flex: none;
  background: conic-gradient(rgba(255, 92, 122, 0) 0deg, rgba(255, 92, 122, 0.3) 140deg, #ff5c7a 300deg, #ffd3dd 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  animation: spin 0.8s linear infinite;
}
.spinner.small {
  width: 16px; height: 16px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--mute); }
.boot .spinner { width: 36px; height: 36px; }

/* ---- Кнопки и поля ---- */
.primary {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 17px; border-radius: 11px;
  background: var(--grad); color: var(--accent-ink); font-weight: 650;
  box-shadow: 0 6px 20px rgba(240, 67, 106, 0.28); transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s;
}
/* По кнопке под курсором пробегает блик. */
.primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-110%); transition: transform 0.7s var(--ease);
}
.primary:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(240, 67, 106, 0.65); }
.primary:hover::after { transform: translateX(110%); }
.primary:active { transform: translateY(0) scale(0.98); }
.primary.big { padding: 13px 24px; font-size: 1.04rem; border-radius: 13px; }
.ghost {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--text); background: var(--panel-2); font-size: 0.92rem;
  transition: border-color 0.18s, background-color 0.18s, color 0.18s, transform 0.18s var(--ease);
}
.ghost:hover { border-color: #4a3c52; background: #231b28; }
.ghost:active { transform: scale(0.98); }
.ghost.danger { color: #ff9c9c; }
.ghost.danger:hover { border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.08); }
.link { color: var(--mute); display: inline-flex; gap: 6px; align-items: center; font-size: 0.92rem; padding: 6px 0; transition: color 0.18s; }
.link:hover { color: var(--text); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--mute); flex: none; transition: background-color 0.18s, color 0.18s; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; padding: 2px 7px; border-radius: 999px; background: var(--panel-3); color: var(--mute); white-space: nowrap; }
.tag.free { background: rgba(62, 207, 142, 0.12); color: var(--good); }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(62, 207, 142, 0.1); border: 1px solid rgba(62, 207, 142, 0.3); color: #8be7bf; font-size: 0.92rem; box-shadow: 0 0 26px -8px rgba(62, 207, 142, 0.5); }
input[type="text"], input[type="search"], textarea, select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; outline: none; width: 100%;
  transition: border-color 0.18s, box-shadow 0.22s var(--ease);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
select.lang { width: auto; padding: 7px 10px; background: var(--panel-2); }

/* ---- Марка ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.08rem; }
.brand:hover { text-decoration: none; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px -6px rgba(240, 67, 106, 0.75);
  transition: transform 0.35s var(--spring);
}
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }

/* ---- Первая страница ---- */
.landing { max-width: 1080px; margin: 0 auto; padding: 0 22px 40px; }
/* За страницей медленно плавают два пятна света: розовое сверху и лиловое снизу. */
.landing::before {
  content: ""; position: fixed; inset: -20% -10% auto; height: 620px; pointer-events: none; z-index: -1;
  background: radial-gradient(520px 320px at 30% 20%, rgba(240, 67, 106, 0.2), transparent 70%),
    radial-gradient(520px 340px at 78% 6%, rgba(156, 26, 69, 0.26), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.landing::after {
  content: ""; position: fixed; right: -15%; bottom: -30%; width: 80vw; height: 70vh; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(130, 50, 150, 0.14), transparent);
  animation: drift 24s ease-in-out infinite alternate-reverse;
}
@keyframes drift { to { transform: translate3d(4%, 5%, 0) scale(1.08); } }
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; gap: 12px; }
.top-right { display: flex; gap: 10px; align-items: center; }
.hero { text-align: center; padding: 64px 0 54px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero > * { animation: up 0.7s var(--ease) backwards; }
.hero > :nth-child(2) { animation-delay: 0.07s; }
.hero > :nth-child(3) { animation-delay: 0.14s; }
.hero > :nth-child(4) { animation-delay: 0.21s; }
/* Заголовок залит градиентом от белого к розовому; отступ снизу, чтобы не срезались хвосты букв. */
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.08; max-width: 840px; padding-bottom: 0.08em;
  background: linear-gradient(180deg, #fff 30%, #ffc6d3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: #cdc2d2; font-size: 1.14rem; max-width: 660px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 6px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.feature {
  background: linear-gradient(180deg, #19141c, var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s var(--ease);
}
.feature:hover { transform: translateY(-4px); border-color: rgba(240, 67, 106, 0.38); box-shadow: 0 18px 40px -18px rgba(240, 67, 106, 0.45); }
.feature h3 { font-size: 1.04rem; margin: 12px 0 5px; }
.feature p { color: var(--mute); font-size: 0.94rem; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); transition: color 0.3s, box-shadow 0.3s, transform 0.35s var(--spring);
}
.feature:hover .feature-icon { background: var(--grad); color: #fff; box-shadow: var(--glow); transform: scale(1.06) rotate(-5deg); }
.steps { margin: 54px auto 0; max-width: 760px; }
.steps h2 { text-align: center; font-size: 1.5rem; margin-bottom: 20px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li {
  display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.steps li:hover { border-color: #46394d; transform: translateX(3px); }
.steps li i { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: var(--glow); display: grid; place-items: center; font-style: normal; font-weight: 700; flex: none; }
.foot { margin-top: 54px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 18px; flex-wrap: wrap; color: var(--mute); font-size: 0.9rem; justify-content: center; align-items: center; }
.foot .link { padding: 0; font-size: inherit; }

/* Окошко с примером ответа: под ним цветное свечение в два тона. */
.preview {
  max-width: 760px; margin: 0 auto 46px; background: var(--panel); border: 1px solid #33283a; border-radius: 20px; overflow: hidden; text-align: left;
  box-shadow: var(--shadow), -50px 30px 100px -50px rgba(255, 92, 122, 0.55), 50px 50px 100px -50px rgba(156, 26, 69, 0.75);
  animation: up 0.8s var(--ease) 0.25s backwards;
}
.preview-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.preview-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3040; }
.preview-bar i:nth-child(1) { background: rgba(255, 107, 129, 0.75); }
.preview-bar i:nth-child(2) { background: rgba(242, 184, 75, 0.7); }
.preview-bar i:nth-child(3) { background: rgba(62, 207, 142, 0.65); }
.preview-bar span { margin-left: auto; font-size: 0.84rem; color: var(--mute); display: inline-flex; gap: 6px; align-items: center; }
.preview-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.preview-q {
  align-self: flex-end; background: linear-gradient(135deg, #34283a, #281f2d); border-radius: 18px 18px 5px 18px; padding: 10px 15px; max-width: 80%;
  animation: up 0.6s var(--ease) 0.5s backwards;
}
.preview-a { color: #e4dbe6; animation: up 0.6s var(--ease) 0.7s backwards; }
.preview-a ul { margin: 8px 0 0; padding-left: 1.3em; }
.preview-a li { margin: 4px 0; }
.preview-foot { color: var(--mute); font-size: 0.82rem; }

/* ---- Окна ---- */
.shade { position: fixed; inset: 0; background: rgba(6, 4, 8, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade 0.2s var(--ease); }
/* Закрытое окно ещё мгновение тает и опускается, клики сквозь него уже проходят. */
.shade.closing { pointer-events: none; animation: fade-out 0.18s ease forwards; }
.modal {
  width: min(460px, 100%); max-height: min(88vh, 860px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 160px), var(--panel);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 0.34s var(--ease);
}
.shade.closing .modal { animation: sink 0.18s ease forwards; }
.modal.wide { width: min(680px, 100%); }
.modal.roomy { width: min(540px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 12px 22px; }
.modal-head h2 { font-size: 1.16rem; }
.modal-body { padding: 4px 22px 22px; overflow-y: auto; overflow-x: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes sink { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; }
.toast {
  background: rgba(38, 30, 43, 0.94); backdrop-filter: blur(10px); border: 1px solid #45384c; padding: 9px 16px; border-radius: 12px;
  box-shadow: var(--shadow); max-width: min(92vw, 520px);
  animation: toast-in 0.34s var(--spring); transition: opacity 0.35s, transform 0.35s var(--ease);
}
.toast.bad { border-color: rgba(255, 107, 107, 0.55); color: #ffc9c9; box-shadow: var(--shadow), 0 0 24px -8px rgba(255, 107, 107, 0.5); }
.toast.gone { opacity: 0; transform: translateY(10px) scale(0.97); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } }

/* ---- Вход ---- */
.login { display: flex; flex-direction: column; gap: 16px; }
.login-grid { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.qr { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; max-width: 200px; }
.qr img, .qr-img { border-radius: 12px; background: #fff; padding: 8px; display: block; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.login-steps ol { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 14px; }
.login-steps li > span { display: block; margin-bottom: 7px; }
/* Кнопка в окне входа стоит в узкой колонке: текст в ней не переносится. */
.login-steps .primary.big { padding: 12px 18px; white-space: nowrap; }
.login-code {
  font-size: 2.2rem; font-weight: 800; letter-spacing: 0.16em; color: #fff; background: var(--accent-soft); border: 1px solid rgba(240, 67, 106, 0.4);
  border-radius: 12px; display: inline-block; padding: 2px 18px; font-variant-numeric: tabular-nums; box-shadow: 0 10px 28px -14px rgba(240, 67, 106, 0.85);
}
.waiting { display: flex; gap: 9px; align-items: center; color: var(--mute); font-size: 0.92rem; margin-top: 14px; flex-wrap: wrap; }

/* ---- Каркас приложения ---- */
.shell { display: grid; grid-template-columns: 288px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side {
  background: radial-gradient(300px 200px at 0% 0%, rgba(240, 67, 106, 0.09), transparent 70%), var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 12px; min-height: 0;
}
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 6px; }
.new {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 11px; background: var(--grad-soft); color: #ff9ab0; font-weight: 600;
  border: 1px solid rgba(240, 67, 106, 0.32); transition: border-color 0.2s, color 0.2s, box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}
.new:hover { border-color: rgba(255, 92, 122, 0.6); color: #ffc2cf; box-shadow: 0 10px 26px -12px rgba(240, 67, 106, 0.75); }
.new:active { transform: scale(0.98); }
.new .icon { transition: transform 0.35s var(--spring); }
.new:hover .icon { transform: rotate(90deg); }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kinds button {
  display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 8px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); font-size: 0.92rem;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.kinds button:hover { border-color: #46394d; background: #221a27; transform: translateY(-1px); }
.kinds button:active { transform: scale(0.98); }
.side-label { color: var(--mute); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 8px 0; display: flex; align-items: center; gap: 10px; min-height: 30px; }
.side-clear { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; color: var(--mute); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--line); transition: color 0.18s, background-color 0.18s, border-color 0.18s; }
.side-clear:hover { color: #ff9c9c; background: rgba(255, 107, 107, 0.1); border-color: rgba(255, 107, 107, 0.35); }
.chats { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.chat-row { position: relative; display: flex; align-items: center; border-radius: 10px; color: #d8cedb; font-size: 0.94rem; transition: background-color 0.18s, color 0.18s; }
.chat-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 2px 8px 10px; color: inherit; }
.chat-link:hover { text-decoration: none; }
.chat-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row:hover { background: var(--panel-2); }
.chat-x { flex: none; width: 26px; height: 26px; margin: 0 5px 0 2px; border-radius: 7px; display: grid; place-items: center; opacity: 0.5; transition: opacity 0.15s, background-color 0.15s; }
.chat-row:hover .chat-x, .chat-row.on .chat-x { opacity: 0.85; }
.chat-x:hover { opacity: 1; background: rgba(255, 107, 107, 0.16); }
.chat-row .chat-x:hover .icon { color: #ff9c9c; }
/* Открытый чат: розовая заливка, тающая вправо, и светящаяся полоска слева. */
.chat-row.on { background: linear-gradient(90deg, rgba(240, 67, 106, 0.18), rgba(240, 67, 106, 0.05) 75%); color: #fff; }
.chat-row.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px rgba(240, 67, 106, 0.8); }
.chat-row .icon { color: var(--mute); }
.chat-row.on .chat-link .icon { color: #ff8fa6; }
.chat-row.pop { animation-name: row-in; }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 1.4s ease-out infinite; flex: none; }
@keyframes ping { from { box-shadow: 0 0 0 0 rgba(240, 67, 106, 0.6); } to { box-shadow: 0 0 0 7px rgba(240, 67, 106, 0); } }
.side-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.free { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 11px; background: rgba(62, 207, 142, 0.08); border: 1px solid rgba(62, 207, 142, 0.24); color: #8be7bf; font-size: 0.9rem; }
.wallet {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 92, 122, 0.08), rgba(156, 26, 69, 0.03)), var(--panel-2); border: 1px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease);
}
.wallet:hover { border-color: rgba(240, 67, 106, 0.42); box-shadow: 0 10px 24px -14px rgba(240, 67, 106, 0.7); }
.wallet span { display: flex; gap: 9px; align-items: center; }
.wallet em { font-style: normal; color: #fff; font-size: 0.8rem; font-weight: 650; padding: 3px 10px; border-radius: 8px; background: var(--grad); box-shadow: var(--glow); }
.me { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 11px; color: var(--mute); transition: background-color 0.18s, color 0.18s; }
.me:hover { background: var(--panel-2); color: var(--text); }
.me-row { display: flex; align-items: center; gap: 4px; }
.me-row .me { flex: 1; min-width: 0; }
.me-row .icon-btn { flex: none; color: var(--mute); }
.me-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ff7a93, var(--accent-2));
  color: #fff; font-weight: 700; font-size: 0.9rem; flex: none; box-shadow: 0 4px 12px -4px rgba(240, 67, 106, 0.6);
}
.avatar.big { width: 48px; height: 48px; font-size: 1.3rem; box-shadow: 0 8px 22px -8px rgba(240, 67, 106, 0.75); }
.drawer-shade { display: none; }

/* ---- Чат ---- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; height: 100dvh; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
.chat-title { font-weight: 650; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; min-width: 0; }
/* Пока открывается другой чат, на месте названия стоит заглушка: она не бледнеет, как кнопка. */
.chat-title:disabled { opacity: 1; }
/* Кнопки под полем ввода: модель и мышление. */
.model-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 0.87rem; min-width: 0; max-width: 46%; color: #d9cfdc; transition: border-color 0.18s, color 0.18s, background-color 0.18s;
}
.model-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-chip .icon { flex: none; }
.model-chip:hover { border-color: var(--accent); color: var(--text); }
.model-chip[hidden] { display: none; }
.model-chip.think i { font-style: normal; color: var(--mute); }
.model-chip.think.on { border-color: rgba(240, 67, 106, 0.55); background: var(--accent-soft); color: #ffb3c2; }
.model-chip.think.on i { color: #e58aa0; }
.model-chip.think.off { opacity: 0.55; }
/* Переписка с кнопкой «вниз», которая появляется, когда до конца далеко. */
.log-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.log { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: auto; }
.to-bottom {
  position: absolute; left: 50%; bottom: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(38, 30, 43, 0.92); backdrop-filter: blur(8px); border: 1px solid #45384c; color: var(--text); box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.75);
  opacity: 0; pointer-events: none; transform: translate(-50%, 12px) scale(0.9);
  transition: opacity 0.2s, transform 0.28s var(--ease), border-color 0.18s;
}
.to-bottom.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.to-bottom:hover { border-color: rgba(240, 67, 106, 0.6); }
.log-inner { max-width: 840px; margin: 0 auto; padding: 22px 18px 12px; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
/* Пустой чат: значок, приветствие и подсказки появляются друг за другом. */
.welcome { margin: auto 0; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 30px 0; }
.welcome > * { animation: up 0.55s var(--ease) backwards; }
.welcome > :nth-child(2) { animation-delay: 0.06s; }
.welcome > :nth-child(3) { animation-delay: 0.12s; }
.welcome h2 { font-size: 1.6rem; }
.welcome-icon {
  width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px rgba(240, 67, 106, 0.3);
}
.welcome > .welcome-icon { animation: pop 0.6s var(--spring) backwards, breathe 3.6s ease-in-out 0.6s infinite alternate; }
@keyframes breathe { to { box-shadow: 0 14px 44px rgba(240, 67, 106, 0.55); } }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; max-width: 640px; }
.suggest button {
  padding: 8px 13px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); color: #d8cedb; font-size: 0.92rem; text-align: left;
  animation: up 0.5s var(--ease) backwards; transition: border-color 0.2s, color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.suggest button:nth-child(1) { animation-delay: 0.18s; }
.suggest button:nth-child(2) { animation-delay: 0.24s; }
.suggest button:nth-child(3) { animation-delay: 0.3s; }
.suggest button:nth-child(4) { animation-delay: 0.36s; }
.suggest button:hover { border-color: rgba(240, 67, 106, 0.55); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(240, 67, 106, 0.75); }
.msg { display: flex; min-width: 0; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: linear-gradient(135deg, #34283a, #281f2d); border: 1px solid rgba(255, 255, 255, 0.04); box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.9);
  border-radius: 18px 18px 5px 18px; padding: 10px 15px; max-width: min(78%, 620px);
}
.msg.bot .bubble { max-width: 100%; min-width: 0; width: 100%; }
.msg.faded { opacity: 0.55; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.shot { display: block; width: fit-content; max-width: 100%; border-radius: 13px; }
.shot img { max-width: min(100%, 420px); max-height: 420px; border-radius: 13px; display: block; border: 1px solid var(--line); transition: opacity 0.35s; }
.msg.user .shot img { max-width: 220px; max-height: 220px; }
/* Пока картинка грузится, на её месте мерцает заглушка; загрузилась, и картинка проявляется. */
.shot.loading { position: relative; overflow: hidden; width: 260px; height: 190px; background: var(--panel-2); }
.msg.user .shot.loading { width: 150px; height: 120px; }
.shot.loading img { opacity: 0; }
.clip { max-width: min(100%, 520px); border-radius: 13px; display: block; background: #000; }
.doc { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 0.9rem; max-width: 100%; }
.doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 0.82rem; margin-top: 7px; min-height: 26px; flex-wrap: wrap; }
.note { color: var(--warn); }
.actions { display: flex; gap: 2px; align-items: center; opacity: 0.75; transition: opacity 0.2s; }
.msg:hover .actions { opacity: 1; }
.actions button, .actions a { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--mute); font-size: 0.78rem; font-weight: 600; transition: background-color 0.15s, color 0.15s; }
.actions button:hover, .actions a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
/* Модель пишет: три точки по очереди подпрыгивают. */
.typing { display: inline-flex; gap: 5px; align-items: center; height: 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #ff8aa1, #c43a62); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.made {
  display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  max-width: 420px; margin-top: 10px; transition: border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.made:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 26px -16px rgba(240, 67, 106, 0.75); }
.made span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.made-icon { font-size: 1.6rem; }
.notice {
  align-self: flex-start; min-width: 0; max-width: min(100%, 620px); background: linear-gradient(90deg, rgba(240, 67, 106, 0.07), rgba(240, 67, 106, 0) 60%), var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 11px 15px; display: flex; flex-direction: column; gap: 10px;
}
.notice-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.notice-buttons button { padding: 6px 12px; border-radius: 9px; background: var(--accent-soft); color: #ff8fa6; border: 1px solid rgba(240, 67, 106, 0.3); font-size: 0.9rem; font-weight: 600; transition: background-color 0.18s, transform 0.18s var(--ease); }
.notice-buttons button:hover { background: rgba(240, 67, 106, 0.24); }
.notice-buttons button:active { transform: scale(0.97); }

/* ---- Разметка ответа ---- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 0.75em; }
.md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.1em 0 0.45em; line-height: 1.3; }
.md h2 { font-size: 1.32rem; } .md h3 { font-size: 1.16rem; } .md h4 { font-size: 1.04rem; } .md h5, .md h6 { font-size: 0.98rem; }
.md ul, .md ol { margin: 0 0 0.75em; padding-left: 1.5em; }
.md li { margin: 0.22em 0; }
.md li > ul, .md li > ol { margin: 0.2em 0 0; }
.md code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; }
.md blockquote { margin: 0 0 0.75em; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: #cdc2d2; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.1em 0; }
.md a { text-decoration: underline; text-decoration-color: rgba(240, 67, 106, 0.5); }
.code { background: #0a080c; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 0.75em; overflow: hidden; box-shadow: 0 12px 28px -20px rgba(0, 0, 0, 0.9); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 13px; background: linear-gradient(90deg, #211a26, var(--panel-2)); color: var(--mute); font-size: 0.78rem; }
.code-copy { width: 28px; height: 24px; border-radius: 6px; color: var(--mute); transition: background-color 0.15s, color 0.15s; }
.code-copy:hover { background: var(--panel-3); color: var(--text); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.code pre code { background: none; border: 0; padding: 0; white-space: pre; }
.table-scroll { overflow-x: auto; margin: 0 0 0.75em; }
/* В таблице слова не рвём посреди: узкая таблица лучше прокрутится вбок, чем покажет «Случа-й». */
.md table { border-collapse: collapse; font-size: 0.93rem; overflow-wrap: break-word; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 11px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); white-space: nowrap; }
.md td code { white-space: nowrap; }

/* ---- Поле ввода ---- */
.composer { max-width: 840px; width: 100%; margin: 0 auto; padding: 6px 18px 12px; }
/* Поле ввода: сверху текст, под ним строка с кнопками. Слева скрепка, модель и мышление,
   справа отправка. */
.composer-box {
  display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 9px 9px 8px 9px;
  box-shadow: 0 12px 34px -18px rgba(0, 0, 0, 0.9); transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
/* В фокусе рамка поля становится градиентной, вокруг появляется мягкое свечение. */
.composer-box:focus-within {
  border-color: transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(135deg, rgba(255, 92, 122, 0.8), rgba(156, 26, 69, 0.55) 60%, rgba(90, 72, 98, 0.6)) border-box;
  box-shadow: 0 0 0 4px rgba(240, 67, 106, 0.07), 0 16px 40px -20px rgba(240, 67, 106, 0.55);
}
.composer.drop .composer-box { border-color: var(--accent); background: var(--accent-soft); }
.composer-bar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.composer-bar .grow { flex: 1; min-width: 4px; }
.composer-bar .icon-btn { width: 34px; height: 34px; }
.composer textarea { border: 0; background: none; resize: none; padding: 5px 6px 3px; width: 100%; max-height: 220px; min-height: 34px; box-shadow: none; line-height: 1.45; }
.composer textarea:focus { box-shadow: none; }
/* Отправка: тусклее, пока отправлять нечего; со светом, когда есть текст или файл. */
.send {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; opacity: 0.8;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s, opacity 0.2s;
}
.send.ready { opacity: 1; box-shadow: 0 8px 22px -6px rgba(240, 67, 106, 0.85); }
.send.stop { opacity: 1; background: var(--panel-3); color: var(--text); border: 1px solid #5a4862; box-shadow: none; }
.send:hover { filter: brightness(1.1); }
.send:active { transform: scale(0.93); }
.composer-note { text-align: center; color: #6f6475; font-size: 0.76rem; margin-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 7px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 0.86rem; max-width: 240px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--mute); }
.chip button:hover { background: var(--panel-3); color: var(--text); }

/* ---- Меню чата, формы ---- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.banner { display: flex; align-items: flex-start; gap: 11px; line-height: 1.45; }
.banner .icon { flex: none; margin-top: 1px; }
.danger-solid {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; background: linear-gradient(135deg, #ef4b60, #b9243c);
  color: #fff; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(214, 58, 79, 0.7); transition: filter 0.18s, transform 0.18s var(--ease);
}
.danger-solid:hover { filter: brightness(1.08); }
.danger-solid:active { transform: scale(0.98); }
.danger-solid:disabled, .confirm .ghost:disabled { opacity: 0.55; cursor: default; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; text-align: left; transition: background-color 0.18s, color 0.18s; }
.menu-item .icon { transition: color 0.18s, transform 0.25s var(--spring); }
.menu-item:hover { background: var(--panel-2); }
.menu-item:hover .icon { color: var(--accent); transform: scale(1.08); }
.menu-item.danger { color: #ff9c9c; }
.menu-item.danger:hover .icon { color: #ff9c9c; }
a.menu-item, a.ghost { color: inherit; }
a.menu-item:hover, a.ghost:hover { text-decoration: none; }
.menu-label { color: var(--mute); font-size: 0.8rem; padding: 8px 12px 2px; }
.role-row, .seg, .amounts, .coins { display: flex; flex-wrap: wrap; gap: 7px; }
.role-row { padding: 0 12px 8px; }
.role-row button, .seg button, .amounts button, .coins button {
  padding: 7px 13px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 0.92rem;
  transition: border-color 0.18s, background-color 0.18s, color 0.18s, box-shadow 0.25s var(--ease), transform 0.18s var(--ease);
}
.role-row button:hover, .seg button:hover, .amounts button:hover, .coins button:hover { border-color: #5a4862; }
.role-row button:active, .seg button:active, .amounts button:active, .coins button:active { transform: scale(0.96); }
.role-row button.on, .seg button.on, .amounts button.on {
  background: linear-gradient(135deg, rgba(255, 92, 122, 0.28), rgba(156, 26, 69, 0.18)); border-color: rgba(255, 92, 122, 0.75); color: #fff;
  box-shadow: 0 6px 18px -10px rgba(240, 67, 106, 0.9);
}

/* ---- Модели ---- */
.models { display: flex; flex-direction: column; gap: 12px; }
.model-list { display: flex; flex-direction: column; gap: 6px; }
.model {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); text-align: left;
  transition: border-color 0.18s, background-color 0.18s, transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.model:hover { border-color: #5a4862; transform: translateY(-1px); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.9); }
.model.on { border-color: var(--accent); background: linear-gradient(90deg, rgba(240, 67, 106, 0.2), rgba(240, 67, 106, 0.06)); box-shadow: 0 8px 22px -14px rgba(240, 67, 106, 0.8); }
/* Строка модели: сама модель и звёздочка избранного рядом. */
.model-row { display: flex; gap: 6px; align-items: stretch; }
.model-row .model { flex: 1; min-width: 0; }
.star { flex: none; width: 44px; border-radius: 12px; display: grid; place-items: center; color: #6f6276; background: var(--panel-2); border: 1px solid var(--line); transition: color 0.18s, border-color 0.18s; }
.star:hover { color: #ffcf5c; border-color: #5a4862; }
.star.on { color: #ffcf5c; }
.star.on .icon path { fill: currentColor; }
/* Звёздочка, которую только что отметили, подпрыгивает. */
.star.burst .icon { animation: burst 0.45s var(--spring); }
@keyframes burst { 40% { transform: scale(1.35) rotate(-12deg); } }

/* ---- Помощь и документы ---- */
.help { display: flex; flex-direction: column; gap: 14px; }
.help-item { display: flex; gap: 14px; align-items: flex-start; }
.help-item .feature-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; }
.help-item b { display: block; margin-bottom: 2px; }
.help-item p { margin: 0; color: #cdc2d2; }
.help-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.help-links .ghost { display: inline-flex; align-items: center; gap: 7px; }
.legal { line-height: 1.65; color: #ded4e2; }
.legal strong { color: var(--text); font-size: 1.05rem; }
.model-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.model-main small { flex-basis: 100%; }
.model-price, .model-rate { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.9rem; white-space: nowrap; }
.model-rate { color: var(--mute); }
.model-price b.gift { color: var(--good); }
.amounts button small { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 400; color: var(--mute); }

/* ---- Кошелёк ---- */
.pay { display: flex; flex-direction: column; gap: 16px; }
.pay > .link:last-child { margin-top: auto; align-self: flex-start; }
.pay > .center:only-child { margin: auto; }
.coin-icon { flex: none; display: block; border-radius: 50%; }
.coin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.coin-tile {
  min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 4px 8px; border-radius: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color 0.2s, background-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.coin-tile:hover { border-color: var(--accent); background: var(--panel-3); transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(240, 67, 106, 0.7); }
.coin-tile:active { transform: scale(0.97); }
.coin-tile > .coin-icon, .coin-tile > .coin-pair { transition: transform 0.3s var(--spring); }
.coin-tile:hover > .coin-icon, .coin-tile:hover > .coin-pair { transform: scale(1.08); }
.coin-tile b { font-size: 0.93rem; margin-top: 5px; }
.coin-tile b, .coin-tile small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-tile small { color: var(--mute); font-size: 0.74rem; }
.coin-tile em { font-style: normal; color: var(--mute); font-size: 0.72rem; margin-top: 4px; padding: 2px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.045); white-space: nowrap; }
.coin-tile.low { opacity: 0.58; }
.coin-tile.low em { color: var(--warn); }
.coin-pair { position: relative; flex: none; width: 40px; height: 40px; }
.coin-pair > .coin-icon { position: absolute; left: 0; bottom: 0; }
.coin-pair > .coin-icon.net { left: auto; bottom: auto; right: -3px; top: -3px; box-shadow: 0 0 0 2.5px var(--panel-2); }
.coin-pair.alone > .coin-icon { position: static; }
.coin-tile:hover .coin-icon.net { box-shadow: 0 0 0 2.5px var(--panel-3); }
@media (max-width: 480px) { .coin-grid { grid-template-columns: repeat(3, 1fr); } }
/* Баланс: розовая плашка со свечением, по которой изредка пробегает блик. */
.balance {
  position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 92, 122, 0.26), rgba(156, 26, 69, 0.1) 60%, rgba(120, 52, 160, 0.08));
  border: 1px solid rgba(240, 67, 106, 0.3); box-shadow: 0 14px 34px -20px rgba(240, 67, 106, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.balance::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-120%) skewX(-18deg); animation: sheen 6s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0% { transform: translateX(-120%) skewX(-18deg); } 25%, 100% { transform: translateX(400%) skewX(-18deg); } }
.balance b { font-size: 1.9rem; letter-spacing: -0.02em; }
.balance span { color: #e6c9d2; font-size: 0.88rem; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--mute); font-size: 0.84rem; }
.custom { display: flex; align-items: center; gap: 8px; }
.custom span { color: var(--mute); font-weight: 700; }
.methods, .networks { display: flex; flex-direction: column; gap: 8px; }
.method, .networks button {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); text-align: left;
  transition: border-color 0.2s, background-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.method:hover, .networks button:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 12px 26px -16px rgba(240, 67, 106, 0.75); }
.method:active { transform: scale(0.99); }
.method span:nth-child(2), .networks button { flex: 1; }
.method span:nth-child(2) { display: flex; flex-direction: column; }
.networks button { justify-content: space-between; }
.method-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; transition: transform 0.3s var(--spring); }
.method:hover .method-icon { transform: scale(1.07); }
.method-icon.stars { background: linear-gradient(135deg, rgba(242, 184, 75, 0.26), rgba(242, 184, 75, 0.08)); color: var(--warn); }
.method-icon.crypto { background: linear-gradient(135deg, rgba(62, 207, 142, 0.24), rgba(62, 207, 142, 0.07)); color: var(--good); }
.method-icon.think { background: var(--grad-soft); color: var(--accent); }
.method.on { border-color: var(--accent); background: linear-gradient(90deg, rgba(240, 67, 106, 0.2), rgba(240, 67, 106, 0.06)); }
.method > .icon { flex: none; color: var(--accent); transition: transform 0.25s var(--ease); }
.method:hover > .icon { transform: translateX(3px); }
.thinking { display: flex; flex-direction: column; gap: 12px; }
.thinking .small { font-size: 0.86rem; margin: 0; }
.method-icon.big { width: 60px; height: 60px; border-radius: 18px; }
.promo { display: flex; gap: 8px; align-items: center; color: var(--mute); }
.promo button { padding: 9px 14px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; transition: border-color 0.18s; }
.promo button:hover { border-color: var(--accent); }
.invoice { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 8px 0; }
.invoice h3 { font-size: 1.24rem; }
.copy-row { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 13px; text-align: left; }
.copy-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.copy-row code { overflow-wrap: anywhere; font-size: 0.9rem; }
/* Оплата пришла: галочка выскакивает, и от неё дважды расходится зелёное кольцо. */
.big-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(62, 207, 142, 0.14); color: var(--good); }
.paid .big-check { animation: pop 0.55s var(--spring) backwards, ring 1.4s ease-out 0.35s 2; }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.45); } to { box-shadow: 0 0 0 20px rgba(62, 207, 142, 0); } }
.ledger { display: flex; flex-direction: column; }
.ledger-row { display: grid; grid-template-columns: 1fr auto 86px; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.ledger-row span { display: flex; flex-direction: column; }
.ledger-row > small { text-align: right; }
.plus { color: var(--good); } .minus { color: var(--text); }

/* ---- Профиль ---- */
.profile { display: flex; flex-direction: column; gap: 18px; }
.profile-head { display: flex; align-items: center; gap: 13px; }
.profile-head div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stats div { background: linear-gradient(180deg, var(--panel-2), #1a141e); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; display: flex; flex-direction: column; }
.stats div:first-child { background: linear-gradient(135deg, rgba(255, 92, 122, 0.2), rgba(156, 26, 69, 0.08)); border-color: rgba(240, 67, 106, 0.3); }
.stats b { font-size: 1.14rem; }
.free-line { color: #8be7bf; background: rgba(62, 207, 142, 0.08); border: 1px solid rgba(62, 207, 142, 0.24); border-radius: 11px; padding: 9px 13px; font-size: 0.93rem; }
.profile section { display: flex; flex-direction: column; gap: 4px; }
.profile h3 { font-size: 1rem; margin-bottom: 4px; }
.setting-row, .switch-row, .session { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting-row > span, .switch-row > span, .session > span, .setting-col > span { display: flex; flex-direction: column; min-width: 0; }
.setting-row .seg { flex: none; flex-wrap: nowrap; }
.setting-col { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; align-items: flex-start; }
.setting-col textarea { resize: vertical; }
.switch-row { cursor: pointer; }
/* Флажки настроек нарисованы переключателями: кружок переезжает вправо, дорожка заливается. */
.switch-row input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; width: 40px; height: 23px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--panel-3); border: 1px solid #45384c; transition: background-color 0.2s, border-color 0.2s, box-shadow 0.25s var(--ease);
}
.switch-row input[type="checkbox"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #c9bccd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); transition: transform 0.3s var(--spring), background-color 0.2s;
}
.switch-row input[type="checkbox"]:checked { background: var(--grad); border-color: transparent; box-shadow: 0 4px 14px -4px rgba(240, 67, 106, 0.75); }
.switch-row input[type="checkbox"]:checked::before { transform: translateX(17px); background: #fff; }
.sessions { display: flex; flex-direction: column; margin-bottom: 8px; }

/* ---- Заглушки на время загрузки ---- */
/* Серые блоки в форме того, что сейчас придёт, и бегущий по ним блик. */
.sk { position: relative; overflow: hidden; display: block; flex: none; max-width: 100%; background: var(--panel-2); border-radius: 8px; }
.sk::after, .shot.loading::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045) 40%, rgba(255, 143, 166, 0.07) 55%, transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk.line { height: 11px; border-radius: 6px; }
.sk.round { border-radius: 50%; }
.sk.tile { border-radius: 12px; }
.sk.speech { border-radius: 18px 18px 5px 18px; background: var(--panel-3); }
.sk-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.sk-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sk-row.wrap { flex-wrap: wrap; gap: 7px; }
.sk-chats { display: flex; flex-direction: column; gap: 2px; }
.sk-chats .sk-row { padding: 10px; }
.sk-user { display: flex; justify-content: flex-end; }
.sk-answer { display: flex; flex-direction: column; gap: 11px; padding: 6px 0 10px; }
.sk-welcome { margin: auto 0; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 30px 0; }
.sk-welcome .suggest { margin-top: 10px; }
.sk-composer { min-height: 93px; justify-content: space-between; }
.sk-composer > .sk { margin: 9px 6px 0; }
.sk-method, .sk-model { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); }
.sk-model { justify-content: space-between; }

/* ---- Появление ---- */
/* enter: содержимое блока проявляется снизу; fwd и back: шаг окна въезжает справа или слева.
   pop: новое сообщение, новая строка чата. reveal: блок первой страницы при прокрутке. */
.enter { animation: enter 0.3s var(--ease) backwards; }
.enter-fwd { animation: enter-fwd 0.32s var(--ease) backwards; }
.enter-back { animation: enter-back 0.32s var(--ease) backwards; }
.pop { animation: msg-in 0.36s var(--ease) backwards; }
.msg.user.pop { transform-origin: 100% 100%; animation-name: bubble-in; }
.reveal { opacity: 0; }
.reveal.shown { opacity: 1; animation: up 0.7s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes enter-fwd { from { opacity: 0; transform: translateX(18px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-18px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(0.94); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }

/* ---- Телефон ---- */
@media (max-width: 860px) {
  .mobile, .icon-btn.mobile { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform 0.32s var(--ease); box-shadow: var(--shadow); }
  .shell.drawer .side { transform: none; }
  .shell.drawer .drawer-shade { display: block; position: fixed; inset: 0; background: rgba(6, 4, 8, 0.6); z-index: 39; animation: fade 0.25s var(--ease); }
  .chat-head { padding: 8px 10px; }
  .log-inner { padding: 16px 12px 8px; }
  .composer { padding: 4px 10px 8px; }
  .composer-note { display: none; }
  .model-chip.think i { display: none; }
  .model-chip { max-width: 42%; }
  .login-grid { grid-template-columns: 1fr; }
  .qr { display: none; }
  .model { grid-template-columns: minmax(0, 1fr) auto; }
  .model-rate { display: none; }
  .hero { padding: 38px 0 40px; }
  .top-right .primary { display: none; }
  .msg.user .bubble { max-width: 88%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setting-row.stack { flex-direction: column; align-items: flex-start; gap: 9px; }
  .shade { padding: 10px; }
  .modal-head { padding: 14px 10px 10px 16px; }
  .modal-body { padding: 4px 16px 18px; }
}

/* ---- Тем, кто попросил систему двигать поменьше: всё встаёт на место сразу ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; transition-delay: 0s !important;
  }
  .spinner { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
  .reveal { opacity: 1; }
}
