/* ============================================================
   SALESer — Design System v1  «Tinder-premium»
   Слои токенов:  primitive → semantic → component
   Бренд: pink→purple (узнаваемость свайпа), грейд = цвет по тиру.
   Док: docs/DESIGN_SYSTEM.md
   ============================================================ */

:root {
  /* ── PRIMITIVE: палитра ─────────────────────────────────── */
  --bg:            #0a0a12;
  --bg-2:          #11111d;
  --bg-3:          #161622;
  --surface:       rgba(255,255,255,0.045);
  --surface-2:     rgba(255,255,255,0.07);
  --surface-solid: #15151f;
  --glass:         rgba(18,16,28,0.72);
  --line:          rgba(255,255,255,0.09);
  --line-2:        rgba(255,255,255,0.15);

  --text:  #f5f6fc;
  --muted: #b7b9d8;   /* поднят для WCAG-контраста на тёмном */
  --faint: #8a8aa8;

  --brand:   #ff3d6e;
  --brand-2: #8b5cf6;
  --grad-brand: linear-gradient(120deg, #ff3d6e 0%, #8b5cf6 100%);
  --grad: var(--grad-brand);              /* alias для .tech и пр. */

  --ok:   #2ee6a0;
  --nope: #ff5a6a;

  /* ── PRIMITIVE: грейд-тиры (свой язык рва) ──────────────── */
  --g-c:      #7c93b8;  --g-c-grad:     linear-gradient(135deg,#8fa6c8,#5d7cae);
  --g-b:      #a78bfa;  --g-b-grad:     linear-gradient(135deg,#b69dff,#7c5cf0);
  --g-a:      #ff5d83;  --g-a-grad:     linear-gradient(135deg,#ff7a9b,#ff3d6e);
  --g-aplus:  #ffce4a;  --g-aplus-grad: linear-gradient(135deg,#ffe79a,#f5b13c);

  /* ── PRIMITIVE: типографика ─────────────────────────────── */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --fs-display: 34px;
  --fs-h1:      28px;
  --fs-h2:      24px;
  --fs-title:   20px;
  --fs-lg:      18px;
  --fs-base:    16px;
  --fs-sm:      14px;
  --fs-xs:      12px;

  /* ── PRIMITIVE: 4px-сетка отступов ──────────────────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* ── PRIMITIVE: радиусы ─────────────────────────────────── */
  --r-sm: 12px; --r: 16px; --r-card: 22px; --r-lg: 28px; --r-pill: 999px;

  /* ── PRIMITIVE: тени / elevation / glow ─────────────────── */
  --e1: 0 4px 16px -6px rgba(0,0,0,0.45);
  --e2: 0 12px 34px -10px rgba(0,0,0,0.55);
  --e3: 0 18px 50px -12px rgba(0,0,0,0.62);
  --glow-brand: 0 10px 30px -8px rgba(255,61,110,0.5);

  /* ── SEMANTIC ───────────────────────────────────────────── */
  --app-max: 480px;
  --tabbar-h: 76px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs-base)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
}
button, input, select, textarea { font-family: inherit; }
input, textarea { user-select: text; }

/* ── App shell ─────────────────────────────────────────────── */
.app {
  position: relative;
  max-width: var(--app-max);
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(80% 50% at 80% -5%, rgba(139,92,246,0.18), transparent 60%),
    radial-gradient(70% 45% at 0% 0%, rgba(255,61,110,0.16), transparent 55%),
    var(--bg);
  overflow: hidden;
}

.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) var(--sp-5) var(--sp-3);
  flex: 0 0 auto;
}
.appbar .right { display: flex; align-items: center; gap: var(--sp-4); }

/* ── Лого-знак ─────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo svg { width: 30px; height: 30px; display: block; filter: drop-shadow(0 4px 10px rgba(255,61,110,0.35)); }
.logo .wm { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.5px; }
.logo .wm b { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; }

.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-1) var(--sp-5) 0;
}
.screen.with-tabs { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.screen.center-col { display: flex; flex-direction: column; }

/* pull-to-refresh индикатор */
.ptr {
  position: absolute; top: calc(env(safe-area-inset-top) + 58px); left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none; z-index: 5;
  opacity: 0; transition: opacity .15s;
}
.ptr.on { opacity: 1; }
.ptr .spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Нижняя таб-навигация (glass) ──────────────────────────── */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; cursor: pointer; color: var(--faint); font-size: var(--fs-xs); font-weight: 600;
  transition: color .15s, transform .1s;
}
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .15s; }
.tab.active { color: var(--text); }
.tab.active svg { stroke: var(--brand); transform: translateY(-1px) scale(1.06); }
.tab:active { transform: scale(0.92); }

.lang { font-size: var(--fs-xs); color: var(--muted); cursor: pointer; font-weight: 600; letter-spacing: .3px; }
.link { color: var(--brand); cursor: pointer; text-decoration: none; font-weight: 600; }

/* ── Типографика / утилиты ─────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); }
h2 { font-size: var(--fs-h2); letter-spacing: -0.5px; margin: var(--sp-2) 0; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.spacer { flex: 1; }
.err { color: var(--nope); font-size: var(--fs-sm); margin-top: var(--sp-3); min-height: 18px; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.section-hint { color: var(--muted); font-size: var(--fs-xs); margin: 0 0 var(--sp-2); }

/* ── Карточки / формы ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--sp-5);
  margin: var(--sp-3) 0;
  backdrop-filter: blur(8px);
}
label { display: block; font-size: var(--fs-sm); color: var(--muted); margin: var(--sp-4) 0 var(--sp-2); font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 14px 15px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text);
  font-size: var(--fs-base); transition: border-color .15s, background .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  background: rgba(139,92,246,0.08); box-shadow: 0 0 0 3px rgba(139,92,246,0.16);
}

.btn {
  width: 100%; padding: 16px; border: 0; border-radius: var(--r); cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--fs-base); font-weight: 600; margin-top: var(--sp-4); color: #fff;
  background: var(--grad-brand); box-shadow: var(--glow-brand);
  transition: transform .08s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: .55; }
.btn.secondary { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; color: var(--text); }
.btn.small { width: auto; padding: 11px 18px; font-size: var(--fs-sm); margin-top: 0; }

/* ── Лендинг / онбординг ───────────────────────────────────── */
.hero { text-align: center; padding: var(--sp-2) var(--sp-2); }
.hero h1 { font-size: var(--fs-display); line-height: 1.08; margin: var(--sp-5) 0 var(--sp-3); letter-spacing: -1px; font-weight: 700; }
.hero p { color: var(--muted); margin: 0 auto var(--sp-5); max-width: 320px; }

.roles { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }
.role {
  flex: 1; text-align: center; padding: 15px 8px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.role.active { border-color: var(--brand); background: rgba(255,61,110,0.12); }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.chip { padding: 9px 14px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.chip.toggle { cursor: pointer; transition: border-color .15s, background .15s; }
.chip.toggle.on { border-color: var(--brand); background: rgba(255,61,110,0.14); color: #fff; }

/* ── Соцвход ────────────────────────────────────────────────── */
.or { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 2px; color: var(--faint); font-size: var(--fs-xs); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.social .gbtn { width: 100%; display: flex; justify-content: center; min-height: 44px; }
.social iframe { color-scheme: normal; border-radius: 14px !important; }
.role-pick .roles { margin-bottom: var(--sp-2); }

/* ── Грейд-визуальный язык (ров) ───────────────────────────── */
.grade-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.3px;
  padding: 6px 15px; border-radius: var(--r-pill);
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 8px 22px -8px rgba(139,92,246,0.55);
}
.grade-badge .vrf { width: 13px; height: 13px; display: inline-block; }
.grade-badge.tier-c     { background: var(--g-c-grad);     color: #0c1018; box-shadow: 0 8px 22px -8px rgba(124,147,184,0.5); }
.grade-badge.tier-b     { background: var(--g-b-grad);     color: #fff;    box-shadow: 0 8px 22px -8px rgba(139,92,246,0.55); }
.grade-badge.tier-a     { background: var(--g-a-grad);     color: #fff;    box-shadow: 0 8px 22px -8px rgba(255,61,110,0.55); }
.grade-badge.tier-aplus { background: var(--g-aplus-grad); color: #2a1d00; box-shadow: 0 8px 24px -6px rgba(245,177,60,0.6); }
.grade-badge.tier-none  { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); box-shadow: none; }

.grade-card { text-align: center; }
/* кольцо вокруг тира — толщина/цвет задаём инлайн через conic-gradient в JS */
.grade-ring {
  width: 96px; height: 96px; border-radius: 50%; margin: 4px auto var(--sp-3);
  display: flex; align-items: center; justify-content: center;
  padding: 5px; position: relative;
}
.grade-ring .inner {
  width: 100%; height: 100%; border-radius: 50%; background: var(--bg-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.grade-ring .gl { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -1px; }
.grade-ring .sc { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.score-big { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -1px; }
.score-big small { font-size: var(--fs-lg); color: var(--muted); font-weight: 600; }
.bars { margin-top: var(--sp-4); text-align: left; }
.bar-row { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-2) 0; }
.bar-label { font-size: var(--fs-xs); color: var(--muted); width: 92px; }
.bar { flex: 1; height: 9px; background: rgba(255,255,255,0.07); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; background: var(--grad-brand); border-radius: var(--r-pill); transition: width .5s cubic-bezier(.22,1,.36,1); }
.bar-val { font-size: var(--fs-xs); color: var(--muted); width: 36px; text-align: right; }

/* ── Tinder-колода ─────────────────────────────────────────── */
.deck-wrap { position: relative; flex: 1; display: flex; flex-direction: column; }
.deck { position: relative; flex: 1 1 auto; min-height: 380px; margin: var(--sp-2) 0 var(--sp-1); }
.swipe-card {
  position: absolute; inset: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(10,10,18,0) 35%, rgba(10,10,18,0.92) 100%), var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--e3);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sp-6);
  will-change: transform;
  touch-action: pan-y;
}
.swipe-card.top { animation: cardIn .32s cubic-bezier(.22,1,.36,1); }
@keyframes cardIn { from { transform: scale(.96) translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
.swipe-card .cat-tag {
  position: absolute; top: var(--sp-4); left: var(--sp-4);
  font-size: var(--fs-xs); font-weight: 600; padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.swipe-card .cat-tag::before { content:""; width:6px; height:6px; border-radius:50%; background: var(--brand); }
.swipe-card .grade-req {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  font-family: var(--font-display);
  font-size: var(--fs-xs); font-weight: 700; padding: 6px 12px; border-radius: var(--r-pill);
}
.swipe-card .glow { position: absolute; inset: 0; z-index: 0; background: radial-gradient(120% 70% at 50% 0%, rgba(139,92,246,0.28), transparent 60%); }
.swipe-card .card-photo {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
  filter: saturate(1.05) contrast(1.02);
}
.swipe-card .card-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,10,18,0.12) 0%, rgba(10,10,18,0.02) 38%, rgba(10,10,18,0.97) 100%);
}
.swipe-card .cat-tag, .swipe-card .grade-req, .swipe-card .stamp { z-index: 3; }
.swipe-card .body { position: relative; z-index: 2; }
.swipe-card .company { font-size: var(--fs-sm); color: rgba(255,255,255,0.85); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.swipe-card .company .vbiz { color: var(--ok); }
.swipe-card .role-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.6px; margin: var(--sp-1) 0 var(--sp-2); line-height: 1.1; }
.swipe-card .meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.swipe-card .pill { font-size: var(--fs-xs); padding: 6px 11px; border-radius: var(--r-pill); background: rgba(255,255,255,0.12); font-weight: 600; backdrop-filter: blur(4px); }
.swipe-card .pill.accent { background: rgba(255,61,110,0.22); color: #fff; }
.swipe-card .reqs { font-size: var(--fs-sm); color: rgba(255,255,255,0.78); line-height: 1.45; }

.stamp {
  position: absolute; top: 30px; z-index: 3;
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  padding: 6px 16px; border-radius: var(--r-sm); border: 4px solid; opacity: 0; letter-spacing: 1px;
  transition: opacity .05s;
}
.stamp.like { left: 22px; color: var(--ok); border-color: var(--ok); transform: rotate(-16deg); }
.stamp.nope { right: 22px; color: var(--nope); border-color: var(--nope); transform: rotate(16deg); }

.deck-actions { display: flex; justify-content: center; gap: var(--sp-6); padding: var(--sp-4) 0 var(--sp-1); }
.act {
  width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface-solid); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--e2); transition: transform .12s, box-shadow .12s;
}
.act:active { transform: scale(0.9); }
.act svg { width: 28px; height: 28px; }
.act.nope svg { stroke: var(--nope); }
.act.like { width: 70px; height: 70px; }
.act.like svg { fill: var(--brand); }
.act.like:active { box-shadow: 0 0 0 6px rgba(255,61,110,0.14), var(--e2); }

.deck-empty { text-align: center; padding: 50px 20px; }
.deck-empty .big { font-size: 46px; margin-bottom: var(--sp-3); }

/* ── It's a match overlay ──────────────────────────────────── */
.match {
  position: absolute; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--sp-6);
  background: radial-gradient(80% 60% at 50% 30%, rgba(255,61,110,0.25), rgba(10,10,18,0.92) 70%), rgba(10,10,18,0.86);
  backdrop-filter: blur(10px);
  animation: matchIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes matchIn { from { opacity: 0; } to { opacity: 1; } }
.match h2 {
  font-size: 38px; letter-spacing: -1px; margin: var(--sp-4) 0 var(--sp-2);
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.match .heart { font-size: 64px; animation: pop .5s cubic-bezier(.22,1.4,.36,1); }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.match p { color: var(--muted); max-width: 280px; margin: 0 auto var(--sp-6); }
.match .btn { max-width: 300px; }

/* ── Скелетоны ─────────────────────────────────────────────── */
.skel { background: linear-gradient(100deg, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.05) 70%); background-size: 200% 100%; border-radius: var(--r-sm); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 100%; border-radius: var(--r-lg); }
.skel-line { height: 14px; margin: 10px 0; }
.skel-block { height: 86px; margin: var(--sp-3) 0; border-radius: var(--r-card); }

/* ── Модули обучения ───────────────────────────────────────── */
.module { padding: 0; overflow: hidden; }
.mod-head { display: flex; justify-content: space-between; align-items: center; padding: 17px 18px; cursor: pointer; gap: var(--sp-3); }
.mod-title { font-weight: 600; font-family: var(--font-display); }
.tech { font-size: var(--fs-xs); font-weight: 600; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-top: 3px; }
.chev { color: var(--muted); transition: transform .2s; flex: 0 0 auto; }
.mod-body { padding: 0 18px 18px; }
.mod-text { white-space: pre-wrap; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); }
.module.done { border-color: rgba(46,230,160,0.4); }
.done-tag { display: inline-block; margin-top: var(--sp-3); color: var(--ok); font-weight: 600; font-size: var(--fs-sm); }

/* ── Квиз ──────────────────────────────────────────────────── */
.q-title { font-weight: 600; font-family: var(--font-display); margin: var(--sp-1) 0 var(--sp-3); line-height: 1.35; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-size: var(--fs-sm); margin: 0;
  transition: border-color .12s, background .12s;
}
.opt:has(input:checked) { border-color: var(--brand); background: rgba(255,61,110,0.12); }
.opt input { width: auto; accent-color: var(--brand); }
.ok-border { border-color: var(--ok); }
.bad-border { border-color: var(--nope); }

/* ── Медиа в профиле ───────────────────────────────────────── */
.media-row { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-2) 0; }
.avatar {
  width: 66px; height: 66px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 26px; overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Матчи ─────────────────────────────────────────────────── */
.match-list { margin-top: var(--sp-2); }
.match-row {
  display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  margin: var(--sp-2) 0; cursor: pointer; transition: background .12s;
}
.match-row:active { background: var(--surface-2); }
.m-ava { width: 54px; height: 54px; border-radius: 14px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.m-ava img { width: 100%; height: 100%; object-fit: cover; }
.m-body { flex: 1; min-width: 0; }
.m-top { display: flex; align-items: center; gap: var(--sp-2); }
.m-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.m-top .grade-badge { padding: 3px 9px; font-size: 11px; }
.m-sub { font-size: var(--fs-xs); color: var(--brand); font-weight: 600; }
.m-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ── Чат ───────────────────────────────────────────────────── */
.chat-head { padding: var(--sp-1) 0 var(--sp-3); flex: 0 0 auto; }
.chat-log { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-2) 0; }
.chat-input { display: flex; gap: var(--sp-2); align-items: center; padding: var(--sp-3) 0 var(--sp-1); flex: 0 0 auto; }
.chat-input input { flex: 1; }
.chat-input .btn { width: auto; margin-top: 0; padding: 14px 18px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: var(--fs-sm); line-height: 1.4; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--grad-brand); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }

/* ── Плитки ────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-2); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--sp-5); cursor: pointer; font-weight: 600; }
.tile .tile-ic { font-size: 26px; margin-bottom: var(--sp-2); }
.tile:active { transform: scale(0.98); }
