/* ============ ТИМОТЕО AI — Neo-Dark / Glassmorphism ============ */
:root {
  --bg-0: #070b16;
  --bg-1: #0a1022;
  --bg-2: #0e1530;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --text-0: #eef2ff;
  --text-1: #a7b0c8;
  --text-2: #64708f;
  --cyan: #22d3ee;
  --cyan-2: #67e8f9;
  --cyan-deep: #0891b2;
  --purple: #a855f7;
  --purple-2: #c084fc;
  --purple-deep: #7c3aed;
  --lime: #a3e635;
  --gold: #fbbf24;
  --pink: #f472b6;
  --danger: #f87171;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-1: 0 8px 32px rgba(2, 6, 23, 0.55);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.28);
  --glow-purple: 0 0 24px rgba(168, 85, 247, 0.28);
  --font: 'Inter', -apple-system, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ------- фон с неоновыми пятнами ------- */
.bg-fx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(800px 520px at 92% 8%, rgba(168, 85, 247, 0.14), transparent 60%),
    radial-gradient(700px 480px at 50% 115%, rgba(34, 211, 238, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 55%, var(--bg-0));
}
.bg-fx::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 75%);
}

/* ------- анимации ------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.86) translateY(10px); } 60% { transform: scale(1.02); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes springIn { 0% { opacity: 0; transform: translateY(18px) scale(0.7); } 55% { transform: translateY(-4px) scale(1.06); } 75% { transform: translateY(1px) scale(0.98); } 100% { opacity: 1; transform: none; } }
@keyframes pulseRing {
  0% { transform: scale(0.55); opacity: 0.85; }
  80% { transform: scale(1.75); opacity: 0; }
  100% { transform: scale(1.75); opacity: 0; }
}
@keyframes neuronGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.85)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 18px rgba(34, 211, 238, 1)); transform: scale(1.12); }
}
@keyframes waveBar {
  0%, 100% { transform: scaleY(0.35); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}
@keyframes caretBlink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------- общие элементы ------- */
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

.btn {
  border: 1px solid var(--stroke-2);
  background: var(--glass-2);
  color: var(--text-0);
  border-radius: 999px;
  padding: 13px 22px;
  font: 600 15px/1 var(--font);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s;
  backdrop-filter: blur(14px);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  user-select: none;
}
.btn:active { transform: scale(0.965); }
.btn:hover { border-color: rgba(34, 211, 238, 0.5); box-shadow: var(--glow-cyan); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  border: none; color: #04101c;
  box-shadow: 0 10px 32px rgba(34, 211, 238, 0.3);
}
.btn-primary:hover { box-shadow: 0 12px 42px rgba(168, 85, 247, 0.42); filter: brightness(1.06); }
.btn-danger { border-color: rgba(248, 113, 113, 0.45); color: var(--danger); background: rgba(248, 113, 113, 0.08); }
.btn-danger:hover { box-shadow: 0 0 22px rgba(248, 113, 113, 0.25); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: var(--stroke); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.input, .textarea, .select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--stroke);
  border-radius: 999px;
  padding: 14px 20px;
  color: var(--text-0);
  font: 500 15px/1.4 var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
}
.textarea { border-radius: var(--r-md); resize: none; }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14), var(--glow-cyan);
  background: rgba(34, 211, 238, 0.05);
}
.input::placeholder, .textarea::placeholder { color: var(--text-2); }

.card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-1);
}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 7px 14px;
  background: var(--glass-2); border: 1px solid var(--stroke);
  font-size: 12.5px; font-weight: 600; color: var(--text-1);
}
.chip.gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 146, 60, 0.14));
  border-color: rgba(251, 191, 36, 0.45); color: var(--gold);
}
.chip.cyan { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); color: var(--cyan-2); }
.chip.purple { background: rgba(168, 85, 247, 0.13); border-color: rgba(168, 85, 247, 0.4); color: var(--purple-2); }

/* ============ AUTH ============ */
.auth-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 26px 18px; position: relative; z-index: 1;
}
.auth-card {
  width: 100%; max-width: 430px;
  padding: 34px 30px 28px;
  border-radius: var(--r-xl);
  background: rgba(14, 21, 48, 0.55);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(26px);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.7), 0 0 60px rgba(34, 211, 238, 0.08);
  animation: popIn 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.1);
}
.logo-badge {
  width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 24px;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.22));
  border: 1px solid rgba(34, 211, 238, 0.4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-cyan);
  animation: floaty 5s ease-in-out infinite;
}
.logo-badge svg { width: 42px; height: 42px; }
.auth-title { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.auth-title span {
  background: linear-gradient(90deg, var(--cyan), var(--purple-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-sub { text-align: center; color: var(--text-1); font-size: 14px; margin: 8px 0 24px; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: rgba(255, 255, 255, 0.045); border-radius: 999px; padding: 5px; margin-bottom: 20px;
  border: 1px solid var(--stroke);
}
.auth-tab {
  padding: 11px; text-align: center; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--text-1); cursor: pointer;
  transition: all 0.22s ease; border: none; background: transparent;
}
.auth-tab.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(168, 85, 247, 0.22));
  color: var(--text-0);
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.18);
}
.form-row { margin-bottom: 13px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-1); margin: 0 0 7px 16px; letter-spacing: 0.2px; }
.form-error {
  color: var(--danger); font-size: 13px; text-align: center; min-height: 18px;
  margin: 8px 0 2px; font-weight: 500;
}
.form-note { font-size: 12px; color: var(--text-2); text-align: center; margin-top: 14px; }
.form-note b { color: var(--cyan-2); font-weight: 600; }

/* ============ APP SHELL ============ */
.app-shell { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; min-height: 100dvh; padding: 0 0 108px; }
.top-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.92), rgba(7, 11, 22, 0.72) 75%, transparent);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.2px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.25), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(34, 211, 238, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.brand-logo svg { width: 22px; height: 22px; }
.top-capsules { display: flex; gap: 8px; align-items: center; }
.capsule {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--stroke-2);
  font-size: 12.5px; font-weight: 700;
  backdrop-filter: blur(14px);
  cursor: default;
}
.capsule svg { width: 15px; height: 15px; }
.capsule.tokens { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.35); }
.capsule.pro {
  color: var(--gold);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.1));
  border-color: rgba(251, 191, 36, 0.42);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.18);
}

.page { padding: 6px 18px 20px; animation: fadeUp 0.34s ease; }
.greet-title { font-size: 27px; font-weight: 800; letter-spacing: -0.6px; margin: 10px 0 4px; }
.greet-sub { color: var(--text-1); font-size: 14.5px; margin-bottom: 22px; }

/* ------- Bento Grid ------- */
.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}
.bento-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 18px 17px 16px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s;
  animation: fadeUp 0.4s ease backwards;
}
.bento-card:nth-child(1) { animation-delay: 0.03s; }
.bento-card:nth-child(2) { animation-delay: 0.08s; }
.bento-card:nth-child(3) { animation-delay: 0.13s; }
.bento-card:nth-child(4) { animation-delay: 0.18s; }
.bento-card:nth-child(5) { animation-delay: 0.23s; }
.bento-card:nth-child(6) { animation-delay: 0.28s; }
.bento-card:active { transform: scale(0.97); }
.bento-card:hover { border-color: rgba(34, 211, 238, 0.4); }
.bento-card.g-cyan:hover { box-shadow: var(--glow-cyan); border-color: rgba(34, 211, 238, 0.55); }
.bento-card.g-purple:hover { box-shadow: var(--glow-purple); border-color: rgba(168, 85, 247, 0.55); }
.bento-card.g-lime:hover { box-shadow: 0 0 24px rgba(163, 230, 53, 0.25); border-color: rgba(163, 230, 53, 0.5); }
.bento-card.wide { grid-column: span 2; display: flex; align-items: center; gap: 16px; }
.bento-icon {
  width: 52px; height: 52px; border-radius: 17px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-2);
}
.bento-icon svg { width: 27px; height: 27px; }
.bento-card.g-cyan .bento-icon { background: rgba(34, 211, 238, 0.13); border-color: rgba(34, 211, 238, 0.35); }
.bento-card.g-purple .bento-icon { background: rgba(168, 85, 247, 0.14); border-color: rgba(168, 85, 247, 0.38); }
.bento-card.g-lime .bento-icon { background: rgba(163, 230, 53, 0.12); border-color: rgba(163, 230, 53, 0.35); }
.bento-title { font-weight: 750; font-size: 15.5px; margin-top: 12px; letter-spacing: -0.1px; }
.bento-card.wide .bento-title { margin-top: 0; }
.bento-desc { color: var(--text-1); font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
.bento-arrow {
  margin-left: auto; width: 34px; height: 34px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: #051222;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 2px 12px;
}
.section-title { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.section-link { color: var(--cyan-2); font-size: 13px; font-weight: 600; cursor: pointer; background: none; border: none; }

/* ------- список чатов ------- */
.chat-list { display: flex; flex-direction: column; gap: 9px; }
.chat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s, background 0.18s;
}
.chat-row:active { transform: scale(0.985); }
.chat-row:hover { border-color: rgba(34, 211, 238, 0.35); background: var(--glass-2); }
.chat-row-icon {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.3);
  display: flex; align-items: center; justify-content: center;
}
.chat-row-icon svg { width: 20px; height: 20px; }
.chat-row-main { flex: 1; min-width: 0; }
.chat-row-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-sub {
  color: var(--text-1); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.chat-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.chat-row-time { color: var(--text-2); font-size: 11px; }
.unread-dot {
  min-width: 21px; height: 21px; border-radius: 999px; padding: 0 6px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #04121e; font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.empty-state {
  text-align: center; padding: 36px 20px; color: var(--text-1);
}
.empty-state svg { width: 54px; height: 54px; opacity: 0.55; margin-bottom: 12px; }

/* ============ CHAT VIEW ============ */
.chat-view {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg-0);
  display: flex; flex-direction: column;
  animation: fadeIn 0.22s ease;
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10, 16, 34, 0.85);
  backdrop-filter: blur(20px);
}
.icon-btn {
  width: 40px; height: 40px; flex: none;
  border-radius: 14px; border: 1px solid var(--stroke);
  background: var(--glass-2);
  color: var(--text-0);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.18s, box-shadow 0.18s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn:hover { border-color: rgba(34, 211, 238, 0.5); box-shadow: var(--glow-cyan); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.accent {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border: none; color: #04121e;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.3);
}
.icon-btn.stop {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none; color: #fff;
  box-shadow: 0 8px 24px rgba(244, 114, 182, 0.4);
  animation: popIn 0.25s ease;
}
.chat-header-main { flex: 1; min-width: 0; }
.chat-header-title {
  font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.model-switch {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 3px; padding: 4px 10px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan-2); font-size: 11px; font-weight: 700;
  cursor: pointer; border-radius: 999px;
  transition: box-shadow 0.18s;
}
.model-switch:hover { box-shadow: var(--glow-cyan); }
.model-switch svg { width: 12px; height: 12px; }
.model-menu {
  position: absolute; top: 58px; right: 62px; z-index: 80;
  width: 232px; padding: 8px;
  background: rgba(14, 21, 48, 0.96);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-md);
  backdrop-filter: blur(22px);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.7);
  animation: popIn 0.18s ease;
}
.model-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: 12px; cursor: pointer;
  transition: background 0.15s;
}
.model-item:hover { background: var(--glass-2); }
.model-item.active { background: rgba(34, 211, 238, 0.13); }
.model-item-icon {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.model-item-name { font-size: 13px; font-weight: 700; }
.model-item-desc { font-size: 11px; color: var(--text-1); }

/* ------- сообщения ------- */
.msg-scroll {
  flex: 1; overflow-y: auto; padding: 18px 16px 12px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}
.msg-scroll::-webkit-scrollbar { width: 5px; }
.msg-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
.msg { display: flex; flex-direction: column; max-width: 86%; animation: fadeUp 0.28s ease; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.admin { align-self: flex-start; align-items: flex-start; }
.msg-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-2); margin: 0 6px 5px;
}
.msg-author { font-weight: 700; color: var(--text-1); }
.msg-bubble {
  padding: 13px 17px;
  border-radius: 20px;
  font-size: 15px; line-height: 1.58;
  white-space: pre-wrap; word-wrap: break-word;
  position: relative;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(34, 211, 238, 0.07));
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-bottom-right-radius: 7px;
}
.msg.admin .msg-bubble {
  background: var(--glass-2);
  border: 1px solid var(--stroke-2);
  border-bottom-left-radius: 7px;
  box-shadow: 0 8px 26px rgba(2, 6, 23, 0.35);
}
.msg.admin .msg-bubble code, .msg.user .msg-bubble code {
  font-family: var(--mono); font-size: 12.5px;
  background: rgba(0, 0, 0, 0.35); padding: 2px 7px; border-radius: 8px;
  color: var(--cyan-2);
}
.msg-bubble pre {
  font-family: var(--mono); font-size: 12.5px;
  background: rgba(0, 0, 0, 0.42); border: 1px solid var(--stroke);
  border-radius: 13px; padding: 12px 14px; overflow-x: auto; margin: 8px 0;
  color: var(--cyan-2);
}
.msg-attach {
  margin-top: 9px; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 13px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--stroke);
  font-size: 12.5px; color: var(--text-1); cursor: pointer; max-width: 100%;
}
.msg-attach img {
  max-width: 220px; max-height: 200px; border-radius: 12px; display: block;
}
.msg-actions { display: flex; gap: 6px; margin: 6px 4px 0; }
.mini-btn {
  border: none; background: transparent; color: var(--text-2);
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 9px;
  transition: color 0.15s, background 0.15s;
}
.mini-btn:hover { color: var(--cyan-2); background: rgba(34, 211, 238, 0.1); }
.mini-btn svg { width: 13px; height: 13px; }
.type-caret {
  display: inline-block; width: 9px; height: 17px;
  background: var(--cyan);
  margin-left: 3px; vertical-align: -3px;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
  animation: caretBlink 0.85s steps(1) infinite;
}

/* ------- индикатор мышления ------- */
.thinking {
  align-self: flex-start;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px 13px 14px;
  border-radius: 20px; border-bottom-left-radius: 7px;
  background: var(--glass-2);
  border: 1px solid rgba(34, 211, 238, 0.25);
  animation: fadeUp 0.3s ease;
}
.neuro { position: relative; width: 38px; height: 38px; flex: none; }
.neuro-core {
  position: absolute; inset: 7px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--cyan-2), var(--cyan-deep));
  animation: neuronGlow 1.7s ease-in-out infinite;
}
.neuro-ring {
  position: absolute; inset: 7px; border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.7);
  animation: pulseRing 1.8s ease-out infinite;
}
.neuro-ring:nth-child(2) { animation-delay: 0.6s; }
.thinking-text { font-size: 13.5px; font-weight: 700; color: var(--cyan-2); }
.thinking-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.wave { display: flex; align-items: center; gap: 3.5px; height: 26px; }
.wave i {
  width: 3.5px; border-radius: 99px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  animation: waveBar 1.1s ease-in-out infinite;
}
.wave i:nth-child(1) { height: 12px; animation-delay: 0s; }
.wave i:nth-child(2) { height: 22px; animation-delay: 0.12s; }
.wave i:nth-child(3) { height: 16px; animation-delay: 0.24s; }
.wave i:nth-child(4) { height: 25px; animation-delay: 0.36s; }
.wave i:nth-child(5) { height: 13px; animation-delay: 0.48s; }
.wave i:nth-child(6) { height: 20px; animation-delay: 0.6s; }
.wave i:nth-child(7) { height: 10px; animation-delay: 0.72s; }

/* ------- поле ввода ------- */
.composer-wrap {
  padding: 10px 14px 16px;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 22, 0.9) 32%);
}
.token-strip {
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px 9px;
  font-size: 11px; color: var(--text-2); font-weight: 600;
}
.token-bar {
  flex: 1; height: 5px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.token-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  transition: width 0.5s ease;
}
.attach-chips { display: flex; gap: 8px; padding: 2px 6px 9px; flex-wrap: wrap; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 13px;
  background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.35);
  font-size: 12px; font-weight: 600; color: var(--cyan-2);
  animation: springIn 0.42s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.attach-chip button {
  border: none; background: rgba(255, 255, 255, 0.12); color: var(--text-1);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.composer {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 9px 10px 9px 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
  border: 1.5px solid var(--stroke-2);
  backdrop-filter: blur(20px);
  transition: border-color 0.22s, box-shadow 0.25s;
}
.composer:focus-within {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1), var(--glow-cyan);
}
.composer textarea {
  flex: 1; border: none; background: transparent; resize: none; outline: none;
  color: var(--text-0); font: 500 15px/1.45 var(--font);
  max-height: 128px; padding: 8px 2px;
}
.composer textarea::placeholder { color: var(--text-2); }
.composer .icon-btn { width: 38px; height: 38px; border-radius: 13px; }
.composer .icon-btn svg { width: 18px; height: 18px; }
.icon-btn.listening {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none; color: white;
  animation: pulseRing 1.4s ease-out infinite;
  box-shadow: 0 0 22px rgba(244, 114, 182, 0.5);
}
.mic-wave {
  display: flex; align-items: center; gap: 3px; height: 30px; padding: 0 4px;
}
.mic-wave i {
  width: 3.5px; border-radius: 99px;
  background: linear-gradient(180deg, var(--pink), var(--purple-2));
  animation: waveBar 0.7s ease-in-out infinite;
}
.mic-wave i:nth-child(1) { height: 10px; animation-delay: 0s; }
.mic-wave i:nth-child(2) { height: 20px; animation-delay: 0.08s; }
.mic-wave i:nth-child(3) { height: 28px; animation-delay: 0.16s; }
.mic-wave i:nth-child(4) { height: 15px; animation-delay: 0.24s; }
.mic-wave i:nth-child(5) { height: 24px; animation-delay: 0.32s; }
.mic-wave i:nth-child(6) { height: 11px; animation-delay: 0.4s; }

/* ------- слайдер креативности ------- */
.slider-wrap { padding: 6px 4px 2px; }
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--text-2); margin-bottom: 9px;
}
.slider-val { color: var(--cyan-2); font-family: var(--mono); }
input[type='range'].temp-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 9px; border-radius: 99px; outline: none;
  background: linear-gradient(90deg, var(--cyan), var(--purple) 55%, var(--pink));
  cursor: grab;
}
input[type='range'].temp-slider:active { cursor: grabbing; }
input[type='range'].temp-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff, var(--cyan) 65%);
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.5);
  transition: transform 0.16s cubic-bezier(0.3, 1.6, 0.5, 1);
}
input[type='range'].temp-slider::-webkit-slider-thumb:active { transform: scale(1.18); }
input[type='range'].temp-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff, var(--cyan) 65%);
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.5);
}

/* ============ НИЖНЯЯ НАВИГАЦИЯ ============ */
.bottom-nav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 50;
  display: flex; gap: 4px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(14, 21, 48, 0.82);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.65), 0 0 40px rgba(34, 211, 238, 0.1);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 15px 8px; border-radius: 999px; border: none;
  background: transparent; color: var(--text-2);
  font-size: 10px; font-weight: 700; cursor: pointer;
  transition: all 0.22s ease;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active {
  color: var(--text-0);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(168, 85, 247, 0.22));
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.2);
}
.nav-item:active { transform: scale(0.93); }

/* ============ БИБЛИОТЕКА / НАСТРОЙКИ / ПРОФИЛЬ ============ */
.search-bar { position: relative; margin-bottom: 16px; }
.search-bar .input { padding-left: 45px; }
.search-bar svg {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-2);
}
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; padding: 8px 15px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--stroke);
  color: var(--text-1); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: all 0.18s;
}
.cat-chip.active {
  background: rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.45);
  color: var(--cyan-2); box-shadow: var(--glow-cyan);
}
.prompt-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
.prompt-card {
  padding: 17px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform 0.16s, border-color 0.2s, box-shadow 0.2s;
}
.prompt-card:active { transform: scale(0.98); }
.prompt-card:hover { border-color: rgba(168, 85, 247, 0.45); box-shadow: var(--glow-purple); }
.prompt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prompt-icon {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.35);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.prompt-title { font-weight: 750; font-size: 14px; }
.prompt-text {
  color: var(--text-1); font-size: 12.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-foot { display: flex; gap: 7px; margin-top: 11px; }

.settings-card {
  padding: 19px; margin-bottom: 13px;
  border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--stroke);
}
.settings-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.settings-desc { color: var(--text-1); font-size: 12.5px; margin-bottom: 14px; line-height: 1.5; }
.settings-title svg { width: 18px; height: 18px; color: var(--cyan-2); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--stroke); }
.toggle-label { font-size: 13.5px; font-weight: 650; }
.toggle-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.switch {
  position: relative; width: 50px; height: 28px; flex: none;
  background: rgba(255, 255, 255, 0.1); border-radius: 999px;
  cursor: pointer; border: 1px solid var(--stroke-2);
  transition: background 0.22s;
}
.switch i {
  position: absolute; top: 2.5px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; transition: transform 0.24s cubic-bezier(0.3, 1.4, 0.5, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.switch.on { background: linear-gradient(135deg, var(--cyan), var(--purple)); border-color: transparent; }
.switch.on i { transform: translateX(21px); }

.profile-hero {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 20px 24px; margin-bottom: 15px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid var(--stroke-2);
}
.avatar {
  width: 88px; height: 88px; border-radius: 28px;
  background: linear-gradient(140deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: #04121e;
  box-shadow: 0 14px 40px rgba(34, 211, 238, 0.35);
}
.profile-name { font-size: 21px; font-weight: 800; }
.profile-sub { color: var(--text-1); font-size: 12.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.stat-card {
  padding: 15px 10px; text-align: center;
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--stroke);
}
.stat-val {
  font-size: 19px; font-weight: 800; font-family: var(--mono);
  background: linear-gradient(90deg, var(--cyan), var(--purple-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-lbl { font-size: 10.5px; color: var(--text-2); font-weight: 700; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ------- тосты / модалки ------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px);
}
.toast {
  padding: 13px 17px; border-radius: 15px;
  background: rgba(14, 21, 48, 0.95); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(18px);
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  animation: popIn 0.3s ease;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.6);
}
.toast.ok { border-color: rgba(163, 230, 53, 0.4); color: var(--lime); }
.toast.err { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: 100%; max-width: 420px;
  background: rgba(14, 21, 48, 0.98);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-lg);
  padding: 23px;
  animation: popIn 0.26s ease;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.8);
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.modal-desc { color: var(--text-1); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.modal-actions { display: flex; gap: 9px; margin-top: 16px; }
.modal-actions .btn { flex: 1; padding: 12px 16px; }

/* ------- адаптив ------- */
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .bento-card.wide { grid-column: span 3; }
  .prompt-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .top-capsules .capsule span.lbl { display: none; }
  .bento-desc { display: none; }
  .bento-card { padding: 14px; }
}
