/* ============================================================================
   Дизайн-система. Все цвета, шрифты и скругления — в переменных :root:
   чтобы перекрасить сайт, достаточно поменять значения здесь.
   ========================================================================== */
:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* База: тёплый светлый фон, чернильный текст */
  --bg: #F7ECEF;
  --bg-2: #F0E2E9;
  --card: #FFFFFF;
  --side: #FBF4F6;          /* боковая панель приложения */
  --ink: #2B2440;
  --ink-2: #4A4263;
  --muted: #776F8C;
  --line: #E8DAE4;
  --line-2: #D9C9DA;

  /* Акцент: розовый -> сиреневый -> голубой */
  --pink: #FF9EBB;
  --pink-soft: #FBD9E5;
  --peach: #FFD3BF;
  --violet: #B9A5FF;
  --violet-soft: #E9E1FF;
  --blue: #8DB9FF;
  --blue-soft: #DAE7FF;
  --accent: #7B6CF6;          /* ссылки, фокус, активные состояния */
  --accent-ink: #5A49D6;
  --grad: linear-gradient(120deg, #FFA8C2 0%, #C9A7FF 52%, #8DB9FF 100%);
  --grad-soft: linear-gradient(120deg, #F9DAE5 0%, #E8DDFD 52%, #D7E6FD 100%);
  --grad-text: linear-gradient(100deg, #F0679B 0%, #9A7BF4 50%, #4F93F5 100%);

  --danger: #E5484D;
  --danger-soft: #FFECEC;
  --success: #1F9D6B;
  --success-soft: #E4F7EE;
  --warn-soft: #FFF3D9;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-pill: 999px;

  --shadow: 0 14px 40px rgba(123, 108, 246, .14);
  --shadow-sm: 0 4px 14px rgba(123, 108, 246, .10);
  --shadow-btn: 0 8px 22px rgba(201, 138, 230, .38);

  /* Элементы, зависящие от темы (см. темы ниже) */
  --input-bg: #FFFFFF;
  --on-ink: #FFFFFF;        /* текст на фоне цвета --ink (тёмные кнопки, тосты) */
  --on-grad: #2B2440;       /* текст на градиенте */
  --ink-hover: #3A3156;
  --bubble-bg: #2B2440;     /* сообщение пользователя */
  --bubble-ink: #FFFFFF;
  --code-bg: #2B2440;
  --code-ink: #F4EFFF;
  --pink-ink: #C2356B;
  --blue-ink: #2F6ED6;
  --backdrop: rgba(43, 36, 64, .42);
  /* Лендинг: шапка, «стеклянные» карточки и цветные пятна за первым экраном */
  --header-bg: rgba(247, 236, 239, .84);
  --glass: rgba(255, 255, 255, .86);
  --glass-border: #FFFFFF;
  --glow-a: rgba(255, 168, 194, .42);
  --glow-b: rgba(141, 185, 255, .40);
  --glow-c: rgba(201, 167, 255, .30);

  --sidebar-w: 288px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ---------------------------------------------------------------- Темы приложения
   data-theme ставится на <html> только внутри приложения (/app): лендинг всегда в «Облаке».
   cloud — тёплый градиент (значения :root выше); classic — тёмная, как у Claude и ChatGPT; snow — нейтральная светлая. */
:root[data-theme="classic"] {
  color-scheme: dark;
  --bg: #212121; --bg-2: #2A2A2A; --card: #2F2F2F; --side: #171717;
  --ink: #ECECEC; --ink-2: #CFCFCF; --muted: #9A9A9A; --line: #3A3A3A; --line-2: #4A4A4A;
  --input-bg: #2A2A2A; --on-ink: #171717; --ink-hover: #FFFFFF;
  --accent: #A89CFF; --accent-ink: #BDB3FF;
  --pink-soft: #4A2A38; --pink-ink: #FFA8C2; --violet-soft: #353049; --blue-soft: #27344A; --blue-ink: #9DC3FF;
  --grad-soft: linear-gradient(120deg, #3D2E3B 0%, #34304B 52%, #2B3548 100%);
  --danger: #FF7B7B; --danger-soft: #3F2528; --success: #5BD39B; --success-soft: #203A2E; --warn-soft: #3F3620;
  --bubble-bg: #3A3A3A; --bubble-ink: #F3F3F3; --code-bg: #0F0F0F; --code-ink: #E8E8E8;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35); --shadow-btn: 0 8px 22px rgba(0, 0, 0, .4);
  --backdrop: rgba(0, 0, 0, .6);
  --header-bg: rgba(33, 33, 33, .86); --glass: rgba(47, 47, 47, .9); --glass-border: #3A3A3A;
  --glow-a: rgba(255, 168, 194, .14); --glow-b: rgba(141, 185, 255, .14); --glow-c: rgba(201, 167, 255, .12);
}
:root[data-theme="snow"] {
  --bg: #FFFFFF; --bg-2: #F3F3F6; --card: #FFFFFF; --side: #F7F7F9;
  --ink: #0F0F14; --ink-2: #3C3C46; --muted: #71717A; --line: #E6E6EB; --line-2: #D4D4DC;
  --bubble-bg: #F1F1F4; --bubble-ink: #0F0F14; --code-bg: #1B1B22; --code-ink: #EDEDF2;
  --pink-soft: #FCE7F0; --violet-soft: #EEEBFF; --blue-soft: #E7EEFF;
  --grad-soft: linear-gradient(120deg, #F7F3F6 0%, #F1EFFA 52%, #EDF2FB 100%);
  --shadow: 0 14px 40px rgba(15, 15, 20, .08); --shadow-sm: 0 4px 14px rgba(15, 15, 20, .06); --shadow-btn: 0 8px 22px rgba(123, 108, 246, .22);
  --backdrop: rgba(15, 15, 20, .4);
  --header-bg: rgba(255, 255, 255, .86); --glass: rgba(255, 255, 255, .9); --glass-border: #E6E6EB;
  --glow-a: rgba(255, 168, 194, .22); --glow-b: rgba(141, 185, 255, .22); --glow-c: rgba(201, 167, 255, .16);
}
:root[data-theme="sun"] {
  --bg: #FBF1E6; --bg-2: #F5E4D2; --card: #FFFFFF; --side: #FDF6EE;
  --ink: #2E2017; --ink-2: #5A4636; --muted: #8C7360; --line: #F0DFCC; --line-2: #E3CBB0;
  --pink: #FFB36B; --pink-soft: #FFE4CC; --peach: #FFD3B0; --violet: #FF9E5E; --violet-soft: #FFEEDD; --blue: #FFD36E; --blue-soft: #FFF3DC;
  --accent: #F08A2C; --accent-ink: #D5701C; --pink-ink: #C65A12; --blue-ink: #B8600E;
  --grad: linear-gradient(120deg, #FFCF9A 0%, #FFA559 52%, #FF8A3D 100%);
  --grad-soft: linear-gradient(120deg, #FFEBD6 0%, #FFE1C4 52%, #FFD6B3 100%);
  --grad-text: linear-gradient(100deg, #F7931E 0%, #FF7A1A 50%, #FF5E00 100%);
  --on-grad: #3B2416; --bubble-bg: #3B2416; --bubble-ink: #FFF7F0; --code-bg: #2E2017; --code-ink: #FFF1E4; --ink-hover: #4A3324;
  --shadow: 0 14px 40px rgba(240, 138, 44, .16); --shadow-sm: 0 4px 14px rgba(240, 138, 44, .12); --shadow-btn: 0 8px 22px rgba(255, 140, 66, .38);
  --backdrop: rgba(46, 32, 23, .42);
  --header-bg: rgba(251, 241, 230, .86); --glass: rgba(255, 255, 255, .86); --glass-border: #FFFFFF;
  --glow-a: rgba(255, 179, 107, .40); --glow-b: rgba(255, 211, 110, .36); --glow-c: rgba(255, 158, 94, .28);
}
:root[data-theme="classic"] .msg.user .bubble { border: 1px solid var(--line-2); }
:root[data-theme="snow"] .msg.user .bubble { border: 1px solid var(--line); }

/* Переключатель тем */
.theme-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .theme-picker { grid-template-columns: repeat(4, 1fr); } }
.theme-opt { padding: 8px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: border-color .12s; }
.theme-opt:hover { border-color: var(--violet); }
.theme-opt.on { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; color: var(--ink); }
.theme-opt .sw { height: 44px; border-radius: 10px; margin-bottom: 7px; display: flex; align-items: flex-end; padding: 6px; gap: 4px; }
.theme-opt .sw i { display: block; height: 7px; border-radius: 4px; flex: 1; }
.theme-opt .sw.cloud { background: linear-gradient(120deg, #F7ECEF, #F1E4EC); } .theme-opt .sw.cloud i { background: linear-gradient(120deg, #FFA8C2, #C9A7FF, #8DB9FF); }
.theme-opt .sw.classic { background: #212121; } .theme-opt .sw.classic i { background: #4A4A4A; }
.theme-opt .sw.snow { background: #fff; box-shadow: inset 0 0 0 1px #E6E6EB; } .theme-opt .sw.snow i { background: #D4D4DC; }
.theme-opt .sw.sun { background: linear-gradient(120deg, #FBF1E6, #F5E4D2); } .theme-opt .sw.sun i { background: linear-gradient(120deg, #FFCF9A, #FFA559, #FF8A3D); }
.theme-wrap { position: relative; margin-left: auto; }
.theme-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); background: var(--bg-2); font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.theme-btn:hover { background: var(--violet-soft); color: var(--ink); }
.theme-btn svg { width: 14px; height: 14px; color: var(--muted); }
.theme-btn svg:first-child { width: 17px; height: 17px; color: var(--ink-2); }
.lp-header .theme-btn { height: 36px; }
@media (max-width: 640px) { .only-wide { display: none; } .lp-header .theme-btn { padding: 0 8px; gap: 3px; } }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 130; width: 210px; background: var(--card); border-radius: 18px; padding: 6px; box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: pop .14s ease; }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; text-align: left; color: var(--ink); font-weight: 800; font-size: 14px; }
.theme-menu button:hover { background: var(--bg-2); }
.theme-menu button.on { background: var(--grad-soft); }
.theme-menu .sw { width: 28px; height: 28px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.theme-menu .sw.cloud { background: linear-gradient(120deg, #FFA8C2, #C9A7FF, #8DB9FF); }
.theme-menu .sw.classic { background: #212121; }
.theme-menu .sw.snow { background: #fff; }
.theme-menu .sw.sun { background: linear-gradient(120deg, #FFCF9A, #FFA559, #FF8A3D); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; font-weight: 800; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: #E4DBFF; }

/* ---------------------------------------------------------------- Утилиты */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 0; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 20px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 15px; line-height: 1.2; text-align: center; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, opacity .12s ease;
  text-decoration: none !important; user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--grad); color: var(--on-grad); box-shadow: var(--shadow-btn); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(201, 138, 230, .5); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--ink-hover); }
.btn-secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--violet); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--violet-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-lg { min-height: 54px; padding: 15px 26px; font-size: 16.5px; }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); flex: none; transition: background .12s;
}
.icon-btn:hover { background: var(--violet-soft); }
.icon-btn svg { width: 22px; height: 22px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block; flex: none;
  border: 2.5px solid var(--line-2); border-top-color: var(--ink); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; color: var(--muted); }
.loading-block .spinner { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- Карточки, бейджи, формы */
.card { background: var(--card); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card-lg { padding: 26px; border-radius: var(--r-lg); }
.card-soft { background: var(--grad-soft); border-color: transparent; box-shadow: none; }
.section-title { font-weight: 800; font-size: 17px; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--violet-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.chip.pink { background: var(--pink-soft); color: var(--pink-ink); }
.chip.blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.success { background: var(--success-soft); color: var(--success); }
.badge { display: inline-block; padding: 4px 12px; border-radius: var(--r-pill); background: var(--grad); color: var(--on-grad); font-size: 12.5px; font-weight: 800; }

.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.input, .textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--input-bg);
  font-size: 16px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(185, 165, 255, .25); }
.field-error { color: var(--danger); font-size: 13.5px; min-height: 0; }
.field-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14.5px; }
.alert-info { background: var(--blue-soft); }
.alert-success { background: var(--success-soft); }
.alert-warn { background: var(--warn-soft); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }

.empty { text-align: center; padding: 48px 16px; }
.empty .ic { font-size: 44px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-top: 6px; }

.profile-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.profile-row:last-of-type { border-bottom: 0; }
.profile-row .k { color: var(--muted); }
.profile-row .v { font-weight: 700; text-align: right; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; text-decoration: none !important; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.menu-item .t { flex: 1; font-weight: 600; }
.menu-item .arrow { color: var(--muted); }

/* ---------------------------------------------------------------- Тосты и модалки */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { background: var(--ink); color: var(--on-ink); padding: 11px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow); max-width: 440px; animation: pop .18s ease; }
.toast.success { background: #1C7D58; }
.toast.error { background: #C93A3F; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: var(--backdrop); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .16s ease; }
.modal { background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 20px calc(22px + var(--safe-b)); animation: sheet .22s ease; overscroll-behavior: contain; }
.modal.wide { max-width: 640px; }
.modal-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
.modal-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); }
  .modal-handle { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }

/* ---------------------------------------------------------------- Экран загрузки */
.app-root { min-height: 100vh; min-height: 100dvh; }
.boot-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.boot-logo { width: 76px; height: 76px; border-radius: 22px; box-shadow: var(--shadow); animation: breathe 1.6s ease-in-out infinite; }
.boot-title { font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
@keyframes breathe { 50% { transform: scale(1.06); } }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none !important; }
.logo img { width: 34px; height: 34px; border-radius: 10px; }

/* ============================================================================
   Лендинг
   ========================================================================== */
.landing { overflow-x: clip; }
.lp-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.lp-header.scrolled { border-color: var(--line); }
.lp-header .container { display: flex; align-items: center; gap: 16px; height: 68px; }
.lp-nav { display: none; gap: 26px; margin: 0 auto; }
.lp-nav a { color: var(--ink-2); font-weight: 600; font-size: 15px; }
.lp-header .actions { margin-left: auto; display: flex; gap: 8px; }
@media (min-width: 900px) { .lp-nav { display: flex; } .lp-header .actions { margin-left: 0; } }
@media (max-width: 430px) {
  .lp-header .container { gap: 8px; padding: 0 14px; }
  .lp-header .logo { font-size: 17px; gap: 8px; white-space: nowrap; }
  .lp-header .logo img { width: 30px; height: 30px; }
  .lp-header .actions { gap: 6px; }
  .lp-header .btn-sm { padding: 7px 11px; font-size: 13.5px; }
}

.hero { position: relative; padding: 36px 0 28px; }
.hero::before { /* мягкие цветные пятна за первым экраном */
  content: ''; position: absolute; inset: -120px -20% auto; height: 620px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px 320px at 12% 30%, var(--glow-a), transparent 70%),
    radial-gradient(460px 340px at 88% 22%, var(--glow-b), transparent 70%),
    radial-gradient(420px 300px at 55% 70%, var(--glow-c), transparent 70%);
}
.hero h1 { font-size: clamp(34px, 7.6vw, 66px); letter-spacing: -.035em; line-height: 1.04; margin-top: 16px; }
.hero-sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-2); margin-top: 18px; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-note { color: var(--muted); font-size: 14px; margin-top: 12px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.hero-trust span::before { content: '✓'; color: var(--accent); font-weight: 800; margin-right: 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 700; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-text); }
@media (min-width: 960px) { .hero { padding: 64px 0 48px; } }

/* Первый экран по центру: заголовок и широкая полоса запроса, как на главной ChatGPT / Claude */
/* Первый экран выровнен по левому краю; полоса запроса и примеры — под заголовком */
.hero-center { display: flex; flex-direction: column; align-items: flex-start; }
.hero-center h1 { max-width: 900px; }
.hero-center .hero-sub { max-width: 640px; }

.ask-bar { width: 100%; max-width: 780px; margin-top: 30px; text-align: left; background: var(--card); border-radius: 28px; padding: 10px 10px 10px 12px; box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line-2); transition: box-shadow .15s; }
.ask-bar:focus-within { box-shadow: 0 18px 50px rgba(123, 108, 246, .22), inset 0 0 0 1.5px var(--violet); }
.ask-bar textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: none; padding: 10px 10px 6px; font-size: 17px; line-height: 1.5; min-height: 64px; max-height: 220px; }
.ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-pick { position: relative; min-width: 0; }
.ask-model { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: var(--r-pill); background: var(--bg); font-weight: 700; font-size: 14.5px; color: var(--ink); max-width: 100%; transition: background .12s; }
.ask-model:hover { background: var(--bg-2); }
.ask-model .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-model svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.ask-menu { position: absolute; left: 0; top: calc(100% + 10px); z-index: 40; width: min(300px, 82vw); max-height: 340px; overflow-y: auto; background: var(--card); border-radius: 20px; padding: 6px; box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: pop .14s ease; }
.ask-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 14px; font-weight: 700; font-size: 14.5px; text-align: left; color: var(--ink); }
.ask-menu button:hover { background: var(--bg); }
.ask-menu button.on { background: var(--grad-soft); }
.ask-menu .em { width: 30px; height: 30px; border-radius: 10px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.ask-menu button.on .em { background: var(--card); }
.ask-menu .nm { flex: 1; min-width: 0; }
.ask-menu .chip { font-size: 11.5px; padding: 2px 8px; }
.ask-bar .send { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-btn); transition: opacity .12s; }
.ask-bar .send:disabled { opacity: .45; box-shadow: none; cursor: default; }
.ask-bar .send svg { width: 20px; height: 20px; }
.ask-hint { margin-top: 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 780px; }
.ask-examples button { padding: 8px 14px; border-radius: var(--r-pill); background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--line-2); font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-align: left; transition: box-shadow .12s, color .12s; }
.ask-examples button:hover { box-shadow: inset 0 0 0 1.5px var(--violet); color: var(--ink); }
.ask-quote { text-align: center; font-weight: 600; color: var(--ink-2); background: var(--grad-soft); border-radius: 14px; padding: 10px 14px; margin: 4px 0 10px; font-size: 14.5px; }

.lp-section { padding: 52px 0; }
.lp-section.tint { background: var(--grad-soft); }
.lp-section h2 { font-size: clamp(28px, 5.4vw, 44px); letter-spacing: -.03em; }
.lp-section .lead { color: var(--ink-2); font-size: 17.5px; margin-top: 12px; max-width: 640px; }
@media (min-width: 900px) { .lp-section { padding: 84px 0; } }

.steps { display: grid; gap: 14px; margin-top: 28px; }
.step { background: var(--card); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--glass-border); }
.step .n { font-size: 34px; font-weight: 800; letter-spacing: -.04em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { font-size: 20px; margin-top: 8px; }
.step p { color: var(--ink-2); margin-top: 8px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.models-grid { display: grid; gap: 12px; margin-top: 28px; }
.model-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; gap: 14px; align-items: flex-start; transition: transform .15s, box-shadow .15s; }
.model-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.model-card .em { width: 46px; height: 46px; border-radius: 14px; background: var(--grad-soft); font-size: 22px; display: flex; align-items: center; justify-content: center; flex: none; }
.model-card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.model-card p { color: var(--ink-2); font-size: 14.5px; margin-top: 4px; }
@media (min-width: 640px) { .models-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .models-grid { grid-template-columns: repeat(3, 1fr); } }

.features { display: grid; gap: 12px; margin-top: 28px; }
.feature { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 22px; }
.feature .ic { width: 48px; height: 48px; border-radius: 15px; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.feature h3 { font-size: 19px; margin-top: 14px; }
.feature p { color: var(--ink-2); margin-top: 6px; font-size: 15.5px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }

.cta-band { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--grad); color: var(--on-grad); padding: 40px 22px; text-align: center; }
.cta-band::after { content: ''; position: absolute; width: 360px; height: 360px; right: -120px; top: -160px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(26px, 5vw, 40px); }
.cta-band p { margin: 12px auto 22px; max-width: 520px; color: var(--on-grad); opacity: .82; font-size: 17px; }
.cta-band .tiny { margin-top: 12px; font-size: 13.5px; color: var(--on-grad); opacity: .75; }
@media (min-width: 800px) { .cta-band { padding: 64px 40px; } }

.plans { display: grid; gap: 12px; margin-top: 28px; align-items: stretch; }
.plan { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; }
.plan.featured { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: var(--shadow); }
.plan .badge { position: absolute; top: -12px; left: 20px; }
.plan .name { font-weight: 700; color: var(--ink-2); }
.plan .price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.plan .price small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan .per { color: var(--muted); font-size: 14px; margin-top: 4px; min-height: 21px; }
.plan .per s { opacity: .7; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; gap: 9px; font-size: 14.5px; flex: 1; }
.plan li { display: flex; gap: 9px; }
.plan li::before { content: '✓'; color: var(--accent); font-weight: 800; flex: none; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .plans.four { grid-template-columns: repeat(4, 1fr); } .plans.three { grid-template-columns: repeat(3, 1fr); } }
.plans.compact .plan { padding: 18px; }
.plans.compact .plan .price { font-size: 28px; }

.trial-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; margin-top: 28px; padding: 20px 22px; border-radius: var(--r-lg); background: var(--grad-soft); border: 1px solid var(--glass-border); }
.trial-strip b { font-size: 19px; }

.faq { max-width: 760px; }  /* колонка вопросов у левого края, как остальные секции */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 10px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--violet-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--ink-2); }

.lp-footer { border-top: 1px solid var(--line); padding: 32px 0 calc(40px + var(--safe-b)); color: var(--muted); font-size: 14px; }
.lp-footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0; }
.lp-footer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

.promo-face { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; box-shadow: var(--shadow-sm); }
.auth-page { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(520px 360px at 10% 0%, var(--glow-a), transparent 70%), radial-gradient(520px 360px at 100% 10%, var(--glow-b), transparent 70%), var(--bg); }
.auth-page .container { padding-top: 28px; padding-bottom: 40px; }

/* ============================================================================
   Приложение: боковая панель + чат
   ========================================================================== */
.shell { display: flex; height: 100vh; height: 100dvh; background: var(--bg); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 120; width: min(86vw, var(--sidebar-w)); background: var(--side);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(-102%);
  transition: transform .22s ease; padding-top: var(--safe-t);
}
.shell.drawer .sidebar { transform: none; box-shadow: var(--shadow); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 110; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s; }
.shell.drawer .drawer-backdrop { opacity: 1; pointer-events: auto; }
.sb-head { padding: 14px 14px 10px; display: flex; align-items: center; gap: 8px; }
.sb-head .logo { font-size: 18px; gap: 8px; }
.sb-head .logo img { width: 30px; height: 30px; }
.sb-head .icon-btn { width: 32px; height: 32px; }
.sb-new { margin: 4px 12px 8px; }
.sb-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.sb-label { padding: 12px 10px 6px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sb-chat { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none !important; position: relative; }
.sb-chat:hover { background: var(--bg-2); }
.sb-chat.active { background: var(--grad-soft); color: var(--ink); }
.sb-chat .em { flex: none; width: 22px; text-align: center; }
.sb-chat .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-chat .del { flex: none; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); display: none; align-items: center; justify-content: center; }
.sb-chat:hover .del, .sb-chat.active .del { display: inline-flex; }
.sb-chat .del svg { width: 16px; height: 16px; }
.sb-chat .del:hover { background: var(--card); color: var(--danger); }
.sb-empty { padding: 18px 12px; color: var(--muted); font-size: 14px; }
.sb-foot { padding: 10px 12px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sb-plan { border-radius: 16px; padding: 12px 14px; background: var(--grad-soft); font-size: 13.5px; }
.sb-plan b { display: block; font-size: 14.5px; }
.sb-plan .bar { height: 6px; border-radius: 6px; background: var(--card); margin: 8px 0 10px; overflow: hidden; }
.sb-plan .bar i { display: block; height: 100%; border-radius: 6px; background: var(--grad-text); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none !important; }
.sb-user:hover { background: var(--bg-2); }
.sb-user .av { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: var(--on-grad); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.sb-user .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.topbar { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 8px; min-height: 56px; }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.pick-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 12px; font-weight: 700; font-size: 15px; color: var(--ink); min-width: 0; }
.pick-btn:hover { background: var(--violet-soft); }
.pick-btn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pick-btn.role { font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.topbar .spacer { flex: 1; }
.page-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page { padding: 8px 16px calc(28px + var(--safe-b)); max-width: 720px; margin: 0 auto; width: 100%; }

@media (min-width: 900px) {
  .sidebar { position: static; transform: none; width: var(--sidebar-w); flex: none; box-shadow: none !important; }
  .drawer-backdrop, .only-mobile { display: none !important; }
  .topbar { padding: 12px 18px 8px; }
}
@media (max-width: 899px) { .only-desktop { display: none !important; } }

/* --- Чат --- */
.chat-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scroll-behavior: auto; }
.chat-col { max-width: 780px; margin: 0 auto; padding: 8px 16px 24px; width: 100%; }
.msg { display: flex; margin-top: 18px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--bubble-bg); color: var(--bubble-ink); border-radius: 20px 20px 6px 20px; padding: 11px 16px; max-width: 86%; white-space: pre-wrap; word-break: break-word; }
.msg.bot { gap: 10px; align-items: flex-start; }
.msg.bot .av { width: 32px; height: 32px; border-radius: 11px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; margin-top: 2px; }
.msg.bot .body { flex: 1; min-width: 0; }
.msg .who { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.msg .attach { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 6px; flex-wrap: wrap; }
.msg .attach img { width: 84px; height: 84px; object-fit: cover; border-radius: 14px; }
.msg-actions { display: flex; gap: 2px; margin-top: 6px; margin-left: -6px; }
.msg-actions button, .msg-actions a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none; }
.msg-actions button:hover, .msg-actions a:hover { background: var(--violet-soft); color: var(--accent-ink); }
.msg-actions svg { width: 15px; height: 15px; }
.msg-error { display: inline-flex; gap: 8px; align-items: center; padding: 9px 13px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-size: 14.5px; font-weight: 600; margin-top: 4px; }
.typing { display: inline-flex; gap: 5px; padding: 12px 2px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .18s; background: var(--pink); }
.typing i:nth-child(3) { animation-delay: .36s; background: var(--blue); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.gen-pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 520px; margin-top: 4px; }
.gen-pics.one { grid-template-columns: 1fr; max-width: 420px; }
.gen-pics a { display: block; border-radius: 16px; overflow: hidden; background: var(--grad-soft); aspect-ratio: 1; position: relative; }
.gen-pics img { width: 100%; height: 100%; object-fit: cover; }
.gen-wait { max-width: 420px; aspect-ratio: 16 / 10; border-radius: 18px; background: var(--grad-soft); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; color: var(--ink-2); font-weight: 700; margin-top: 4px; }
.gen-wait small { font-weight: 500; color: var(--muted); }
@keyframes shimmer { from { background-position: 0 0; } to { background-position: -200% 0; } }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sources a { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--blue-soft); color: var(--blue-ink); font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Пустой диалог */
.chat-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 0 12px; }
.chat-empty .big { width: 72px; height: 72px; border-radius: 24px; background: var(--grad); color: var(--on-grad); display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: var(--shadow-btn); }
.chat-empty h2 { font-size: clamp(24px, 5vw, 32px); margin-top: 18px; }
.chat-empty p { color: var(--ink-2); margin-top: 8px; max-width: 460px; }
.suggests { display: grid; gap: 8px; margin-top: 22px; width: 100%; max-width: 560px; }
.suggests button { text-align: left; padding: 13px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; color: var(--ink-2); transition: border-color .12s, transform .12s; }
.suggests button:hover { border-color: var(--violet); transform: translateY(-1px); }
@media (min-width: 640px) { .suggests { grid-template-columns: 1fr 1fr; } }

/* Поле ввода */
.composer-wrap { flex: none; padding: 6px 12px calc(10px + var(--safe-b)); }
.composer { max-width: 780px; margin: 0 auto; background: var(--card); border-radius: 26px; box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--line-2); padding: 8px; transition: box-shadow .15s; }
.composer:focus-within { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--violet); }
.composer .previews { display: flex; gap: 8px; padding: 6px 6px 2px; flex-wrap: wrap; }
.composer .pv { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; }
.composer .pv img { width: 100%; height: 100%; object-fit: cover; }
.composer .pv button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(43, 36, 64, .78); color: #fff; font-size: 13px; line-height: 1; }
.composer .line { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: none; padding: 10px 8px; font-size: 16px; line-height: 1.45; max-height: 200px; min-height: 44px; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: var(--on-grad); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-btn); transition: opacity .12s, transform .12s; }
.composer .send:disabled { opacity: .45; box-shadow: none; cursor: default; }
.composer .send svg { width: 20px; height: 20px; }
.composer-hint { max-width: 780px; margin: 7px auto 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.composer-hint button { color: var(--accent-ink); font-weight: 700; }

/* --- Разметка ответа --- */
.md { line-height: 1.62; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote, .md table, .md h1, .md h2, .md h3, .md h4 { margin: 10px 0 0; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19.5px; } .md h3 { font-size: 17.5px; } .md h4 { font-size: 16px; font-weight: 800; }
.md h1, .md h2, .md h3 { margin-top: 18px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin-top: 4px; }
.md li > ul, .md li > ol { margin-top: 4px; }
.md a { text-decoration: underline; text-underline-offset: 3px; }
.md code { font-family: var(--mono); font-size: .9em; background: var(--violet-soft); padding: 2px 6px; border-radius: 6px; }
.md pre { background: var(--code-bg); color: var(--code-ink); border-radius: 16px; overflow: hidden; }
.md pre .bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px 7px 14px; background: rgba(255, 255, 255, .07); font-size: 12px; color: #C9BFE6; font-family: var(--mono); }
.md pre .bar button { color: #EDE6FF; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; font-family: var(--font); }
.md pre .bar button:hover { background: rgba(255, 255, 255, .12); }
.md pre code { display: block; padding: 14px; overflow-x: auto; background: none; color: inherit; font-size: 13.5px; line-height: 1.55; border-radius: 0; }
.md blockquote { border-left: 3px solid var(--violet); padding: 2px 0 2px 14px; color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.md .tbl { overflow-x: auto; margin-top: 10px; }
.md table { border-collapse: collapse; font-size: 14.5px; margin: 0; }
.md th, .md td { border: 1px solid var(--line-2); padding: 7px 11px; text-align: left; }
.md th { background: var(--violet-soft); font-weight: 800; }
.md sup a { text-decoration: none; font-weight: 800; }
.md .cursor::after { content: ''; display: inline-block; width: 9px; height: 17px; border-radius: 3px; background: var(--violet); margin-left: 3px; vertical-align: -3px; animation: blink 1s infinite both; }

/* --- Выбор нейросети и роли --- */
.pick-list { display: grid; gap: 8px; margin-top: 12px; }
.pick-group { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 10px; }
.pick-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); transition: border-color .12s; }
.pick-item:hover { border-color: var(--violet); }
.pick-item.active { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.pick-item .em { width: 40px; height: 40px; border-radius: 13px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.pick-item .nm { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-item .ds { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.pick-item .right { margin-left: auto; flex: none; font-size: 12.5px; font-weight: 800; color: var(--muted); text-align: right; white-space: nowrap; padding-top: 2px; }
.pick-item.locked .em { filter: grayscale(.6); opacity: .75; }
.pick-item .edit { margin-left: auto; flex: none; }

.limits { display: grid; gap: 10px; }
.limit .row { justify-content: space-between; font-size: 14.5px; }
.limit .bar { height: 7px; border-radius: 7px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.limit .bar i { display: block; height: 100%; border-radius: 7px; background: var(--grad-text); }

.install-steps { display: grid; gap: 10px; margin-top: 14px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; }
.install-step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: var(--on-grad); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }
.ico { display: inline-block; padding: 1px 8px; border-radius: 8px; background: var(--violet-soft); font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

.view { min-height: 100vh; min-height: 100dvh; }

/* ---------------------------------------------------------------- Юридические страницы /legal */
.legal-body { min-height: 100dvh; display: flex; flex-direction: column; }
.legal-body main { flex: 1; }
.legal { max-width: 820px; padding-top: 28px; padding-bottom: 48px; }
.legal h1 { font-size: clamp(28px, 5vw, 40px); margin-top: 12px; }
.legal-sub { color: var(--muted); margin-top: 8px; font-size: 17px; }
.legal-back { display: inline-block; font-weight: 700; margin-bottom: 4px; }
.legal-doc { margin-top: 24px; line-height: 1.65; }
.legal-doc h2 { font-size: 22px; margin: 32px 0 10px; }
.legal-doc h3 { font-size: 18px; margin: 22px 0 8px; }
.legal-doc h4 { font-size: 16.5px; margin: 18px 0 6px; }
.legal-doc h2, .legal-doc h3, .legal-doc h4, .legal h1 { scroll-margin-top: 84px; }
.legal-doc h2:target, .legal-doc h3:target { color: var(--accent-ink); }
.legal-doc h2 { padding-top: 18px; border-top: 1px solid var(--line); margin-top: 40px; }
.legal-doc p { margin: 10px 0; }
.legal-doc p .num { font-weight: 800; color: var(--accent-ink); text-decoration: none; margin-right: 2px; }
.legal-doc p:target { background: var(--grad-soft); border-radius: 10px; padding: 6px 10px; margin-left: -10px; margin-right: -10px; }
.legal-doc ul { padding-left: 22px; } .legal-doc li { margin: 4px 0; }
.legal-doc a { text-decoration: underline; text-underline-offset: 3px; word-break: break-word; }
.legal-doc .tbl { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.legal-doc table { border-collapse: collapse; min-width: 100%; font-size: 15px; }
.legal-doc th, .legal-doc td { border: 1px solid var(--line-2); padding: 8px 12px; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--violet-soft); font-weight: 800; }
.legal-nav { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; line-height: 2; }
.legal-nav a { color: var(--ink-2); font-weight: 600; } .legal-nav a.cur { color: var(--accent-ink); }
.legal-toc { margin-top: 16px; padding-top: 0; border-top: 0; }

/* Баннер согласия на cookie */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 150; margin: 0 auto; max-width: 640px; background: var(--card); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 14px 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; animation: sheet .25s ease; }
.cookie-bar p { flex: 1; margin: 0; }
.cookie-bar a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; } }
