/* ==========================================================================
   180+ Mini App — дизайн-система «180+».
   Синій — герой (#2C7BFF), фіолетовий (#7C5CFF) — енергія. Один фірмовий
   градієнт blue→violet. Темна «жива» поверхня (near-black з аврами). Один
   шрифт — Onest. БЕЗ жовто-синього прапора, БЕЗ золота як базового кольору.

   Токени 180+ додано в :root, а 13 історичних змінних ПЕРЕНАПРАВЛЕНО на нову
   палітру — тож усі наявні var(--...) миттєво отримують новий вигляд без правок.
   ========================================================================== */

:root {
  /* ---- Brand: electric azure (герой — дії/фокус/лінки) ---- */
  --blue-50:  #ECF2FF;
  --blue-100: #D2E0FF;
  --blue-200: #A8C6FF;
  --blue-300: #76A4FF;
  --blue-400: #4D88FF;
  --blue-500: #2C7BFF;   /* core brand */
  --blue-600: #1F5CE0;
  --blue-700: #1A47B4;

  /* ---- Violet: енергія / партнер по градієнту ---- */
  --violet-300: #B79CFF;
  --violet-400: #9A78FF;
  --violet-500: #7C5CFF;   /* core violet */
  --violet-600: #6A3FF0;
  --violet-700: #5A2FD6;

  /* ---- Ink: індиго-фіолетова нейтраль (темні поверхні → світлий текст) ---- */
  --ink-950: #07060F;
  --ink-900: #0B0A1C;
  --ink-850: #11102A;
  --ink-800: #171734;
  --ink-750: #1C1B40;   /* card surface */
  --ink-700: #24234F;   /* elevated card */
  --ink-600: #322F66;
  --ink-500: #46437F;
  --ink-400: #615DA0;
  --ink-300: #8E8AC2;
  --ink-200: #B6B2E0;   /* secondary text */
  --ink-100: #DCD9F5;   /* primary text */
  --ink-50:  #F4F3FF;

  /* ---- Semantic status (мінімально — переважно відповіді) ---- */
  --green-500: #1FB985;
  --green-400: #34D6A0;
  --amber-500: #F5A41E;  /* серія / застереження — дуже стримано */
  --amber-400: #FFB94A;
  --red-500:   #F2456A;
  --red-400:   #FF6B86;

  /* ---- Semantic aliases ---- */
  --surface-app:     var(--ink-900);
  --surface-sunken:  var(--ink-800);
  --surface-card:    var(--ink-750);
  --surface-raised:  var(--ink-700);
  --surface-overlay: rgba(7, 6, 15, 0.66);
  --surface-glass:   rgba(50, 47, 102, 0.30);

  --text-strong:  var(--ink-50);
  --text-body:    var(--ink-100);
  --text-muted:   var(--ink-200);
  --text-faint:   var(--ink-300);
  --text-disabled:var(--ink-400);
  --text-on-brand:#FFFFFF;

  --brand:       var(--blue-500);
  --brand-hover: var(--blue-400);
  --brand-press: var(--blue-600);
  --brand-soft:  rgba(44, 123, 255, 0.16);
  --brand-ring:  rgba(86, 100, 255, 0.50);
  --violet-soft: rgba(124, 92, 255, 0.16);

  --success: var(--green-500);
  --success-soft: rgba(31, 185, 133, 0.16);
  --warning: var(--amber-500);
  --warning-soft: rgba(245, 164, 30, 0.16);
  --danger:  var(--red-500);
  --danger-soft: rgba(242, 69, 106, 0.16);
  --info:    var(--blue-500);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.20);

  /* interactive state surfaces (hover / press) */
  --surface-hover: #2A2856;
  --surface-press: #201F45;
  --ghost-hover:   rgba(255, 255, 255, 0.06);
  --ghost-press:   rgba(255, 255, 255, 0.10);
  --danger-hover:  var(--red-400);
  --danger-press:  #D6395C;

  /* ---- Фірмовий градієнт blue → violet + «жива» підкладка ---- */
  --grad-brand: linear-gradient(130deg, #2C7BFF 0%, #5E5BFF 52%, #9A4DFF 100%);
  --grad-brand-soft: linear-gradient(130deg, rgba(44,123,255,.18), rgba(154,77,255,.18));
  --grad-app: radial-gradient(1100px 760px at 8% -12%, #2A2570 0%, transparent 52%),
              radial-gradient(1000px 720px at 96% 4%, #1B2C84 0%, transparent 48%),
              linear-gradient(180deg, #0B0A1C 0%, #07060F 100%);

  /* ---- Typography (один шрифт — Onest) ---- */
  --font-body: 'Onest', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;
  --fw-bold: 700; --fw-extrabold: 800; --fw-black: 900;
  --ls-tight: -0.03em; --ls-snug: -0.015em; --ls-normal: 0;
  --ls-wide: 0.02em; --ls-eyebrow: 0.1em;

  /* ---- Spacing / radii ---- */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem;
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px;
  --r-xl: 24px; --r-2xl: 32px; --r-pill: 999px;
  --bw-hair: 1px; --bw: 1.5px; --bw-bold: 2px;

  /* ---- Shadows / glow (темна UI: глибокі + фірмове сяйво) ---- */
  --shadow-sm: 0 1px 2px rgba(3, 6, 18, 0.40);
  --shadow-md: 0 6px 18px rgba(3, 6, 18, 0.45);
  --shadow-lg: 0 18px 44px rgba(3, 6, 18, 0.55);
  --shadow-xl: 0 32px 80px rgba(3, 6, 18, 0.62);
  --glow-brand:  0 10px 36px rgba(86, 92, 255, 0.55);
  --glow-violet: 0 10px 38px rgba(124, 92, 255, 0.55);
  --inset-top:   inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 360ms;

  /* =========== 13 історичних змінних → перенаправлено на 180+ =========== */
  --bg-1: var(--ink-900);          /* #0B0A1C — app background */
  --bg-2: var(--ink-800);          /* #171734 — sunken */
  --accent-1: var(--blue-500);     /* #2C7BFF — blue (герой) */
  --accent-2: var(--violet-500);   /* #7C5CFF — violet (енергія) */
  --azure: var(--blue-500);        /* #2C7BFF */
  --text: var(--ink-100);          /* #DCD9F5 */
  --text-dim: var(--ink-200);      /* #B6B2E0 */
  --card: var(--surface-card);     /* #1C1B40 — суцільна card-поверхня */
  --card-border: var(--border);    /* rgba(255,255,255,.11) */
  --good: var(--green-500);        /* #1FB985 */
  --bad: var(--red-500);           /* #F2456A */
  --radius: var(--r-lg);           /* 18px */
  --accent: var(--brand);          /* легасі-фолбек, що траплявся в коді */
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Форм-контроли НЕ успадковують font-family від body — UA-стиль прибиває їм
   свій (Arial/Roboto/SF). Без цього рядка кожна кнопка, чипс і поле вводу
   малювались системним шрифтом поруч із Onest-заголовками: це і було головне
   джерело відчуття «непослідовний дизайн». Тільки font-family: розмір і вагу
   класи задають самі й мають перемагати. */
button, input, select, textarea { font-family: inherit; }

/* атрибут hidden має перемагати будь-який display з класів (.btn тощо) */
[hidden] { display: none !important; }

/* стабільний жолоб скролбара: у повноекранному режимі контент не зсувається вправо */
html { scrollbar-gutter: stable; }

body {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  background: var(--surface-app);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Числа (бали / КБ / таймер / очки) — табличні цифри, аби колонки рівнялись */
.num, #live-timer, .score-hero .nmt, .stat-big .num, .prof-kpi b,
.prof-subj-score b, .an-kpi-v, .lb-rank, .lb-pts, .lb-me-card,
.theme-count, .nah-left { font-variant-numeric: tabular-nums; }
/* «жива» підкладка окремим fixed-шаром: background-attachment:fixed глючить на 4K.
   --grad-app: дві аври (blue+violet) над near-black. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-color: var(--ink-950);
  background-image: var(--grad-app);
}

#zoom-toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  padding: 8px 16px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--card-border); backdrop-filter: blur(10px);
  font-weight: 800; opacity: 0; transition: opacity .2s; pointer-events: none; }
#zoom-toast.show { opacity: 1; }
#zoom-ctl { position: fixed; right: 14px; bottom: 14px; z-index: 60;
  display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 999px;
  backdrop-filter: blur(10px); opacity: .55; transition: opacity .15s; }
#zoom-ctl:hover { opacity: 1; }
#zoom-ctl button { background: none; border: none; color: var(--text); font-size: 17px;
  font-weight: 800; width: 28px; height: 28px; cursor: pointer; line-height: 1; }
#zoom-ctl span { font-size: 12px; font-weight: 700; color: var(--text-dim);
  min-width: 40px; text-align: center; cursor: pointer; }

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 90px; }

/* ---------- loader ---------- */
.loader-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; }
.hex-loader { font-size: 64px; animation: spin 1.6s ease-in-out infinite; color: var(--azure);
  filter: drop-shadow(0 0 28px rgba(44, 123, 255, .55)); }
.loader-text { font-size: 28px; font-weight: 800; letter-spacing: 4px; margin-top: 8px; }
@keyframes spin { 50% { transform: rotate(180deg) scale(1.15); } }

/* ---------- generic ---------- */
/* Картка 180+: суцільна поверхня, тонка hairline-рамка, м'яка темна тінь,
   щедре заокруглення (--r-xl). Енергія — від градієнта на активних елементах. */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 16px;
  margin-bottom: 12px;
  /* без --inset-top: у картки Є своя 1px рамка, тож внутрішня світла лінія
     давала подвійний край угорі — картки виглядали «перекошено підсвіченими».
     На .btn inset доречний, бо там рамка прозора. */
  box-shadow: var(--shadow-md);
}

/* Первинна кнопка: фірмовий градієнт blue→violet + сяйво (той самий вигляд,
   що сподобався фаундеру). */
.btn {
  display: block; width: 100%;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
  font-size: 17px; font-weight: var(--fw-bold); letter-spacing: var(--ls-snug);
  color: var(--text-on-brand);
  background: var(--grad-brand);
  box-shadow: var(--glow-brand), var(--inset-top);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); filter: brightness(.97); }
.btn:focus-visible { outline: var(--bw-bold) solid var(--brand); outline-offset: 2px; }

/* Єдиний фокус-ринг для ВСІХ інтерактивних елементів. Досі така правка була
   рівно одна (.btn), тож решта падала на дефолтне кільце браузера — на майже
   чорному тлі це низькоконтрастний ореол не тієї форми. */
.ans-btn:focus-visible, .subject-chip:focus-visible, .nav-cell:focus-visible,
.tab-btn:focus-visible, .lb-chip:focus-visible, .lb-help:focus-visible,
.seg-toggle button:focus-visible, .theme-row:focus-visible, .topbar .back:focus-visible,
.hero-btn:focus-visible, .gear:focus-visible, .hint-x:focus-visible, .link-btn:focus-visible,
.scr-btn:focus-visible, .nah-btn:focus-visible, .nah-pack:focus-visible, .an-win:focus-visible,
.login-btn:focus-visible, .spec-match:focus-visible, .switch:focus-visible,
.m-slot:focus-visible, .rec-card:focus-visible {
  outline: var(--bw-bold) solid var(--brand); outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Вторинна кнопка: піднята поверхня, чіткіша рамка, без градієнта. */
.btn.secondary { background: var(--surface-raised); border: 1px solid var(--border-strong);
  color: var(--text-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); filter: none; }
.btn.secondary:active { background: var(--surface-press); transform: scale(.98); }
.btn.small { padding: 11px; font-size: 15px; margin-bottom: 8px; }

.title { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 14px; }

/* шапка екрана: кнопка-іконка зліва, назва ІДЕАЛЬНО по центру (симетричний грід) */
.topbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  gap: 10px; margin-bottom: 14px; }
.topbar .back { background: var(--card); border: 1px solid var(--card-border); color: var(--text);
  border-radius: 12px; width: 44px; height: 44px; padding: 0; font-size: 17px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.topbar .grow { font-weight: 800; font-size: 17px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* топбар із кількома діями справа: третя колонка під групу, а не під 1 кнопку */
.topbar-wide { grid-template-columns: 44px 1fr auto; }
.topbar-actions { display: flex; gap: 6px; justify-self: end; }

/* ---------- home ---------- */
.hero { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
/* min-width:0 — інакше flex-айтем не стискається нижче свого тексту й довге
   ім'я виштовхує іконки праворуч за край екрана */
.hero-txt { flex: 1; min-width: 0; }
.hero-txt h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* web-only header actions (fullscreen / logout) — clean icon buttons */
.hero-btn { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
  background: var(--card); border: 1px solid var(--card-border); color: var(--text-dim);
  border-radius: 12px; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease; }
.hero-btn:hover { color: var(--text); border-color: var(--accent-2); background: rgba(255,255,255,.04); }
.hero-btn:active { transform: scale(.9); }
.hero-btn svg { display: block; }
.hero .hex { width: 52px; height: 52px; border-radius: 14px;
  background: var(--grad-brand); box-shadow: var(--glow-brand);
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; }
.hex-logo { width: 56px; height: 56px; border-radius: 16px; display: block;
  box-shadow: 0 6px 20px rgba(44, 123, 255, .5); }
.hex-loader-img { width: 84px; height: 84px; border-radius: 22px;
  animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 10px 36px rgba(6, 93, 167, .5); }
@keyframes pulse { 50% { transform: scale(1.09); } }
.hero h1 { font-size: 20px; }
.hero p { color: var(--text-dim); font-size: 13px; }

.subjects { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subject-chip { padding: 11px 17px; border-radius: var(--r-pill); font-size: 15px; font-weight: 700;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); color: var(--text-dim); cursor: pointer;
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .12s ease; }
.subject-chip:hover { border-color: var(--border-strong); color: var(--text); }
.subject-chip:active { transform: scale(.94); }
.subject-chip.active { background: var(--grad-brand);
  color: #fff; border-color: transparent; box-shadow: var(--glow-brand); }
/* сесія, яку користувач уже проходив */
.subject-chip.done { background: rgba(31, 185, 133, .16);
  color: var(--green-400); border-color: rgba(31, 185, 133, .40); }
.subject-chip.done.active { background: linear-gradient(130deg, #1d9d6b, var(--green-500));
  color: #eafff3; box-shadow: 0 0 0 2px rgba(31, 185, 133, .45); }

.mode-card { position: relative; overflow: hidden; cursor: pointer;
  transition: transform .12s var(--ease-out), border-color .18s ease, box-shadow .18s ease; }
.mode-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.mode-card:active { transform: scale(.99); }
.mode-card h3 { font-size: 18px; margin-bottom: 4px; }
.mode-card p { color: var(--text-dim); font-size: 13px; }
.mode-card .emoji { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 34px; opacity: .85; }

/* головне меню: три режими одним рядком */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row3 .card { margin-bottom: 0; text-align: center; padding: 14px 6px; }
.row3 .m-emoji { font-size: 26px; margin-bottom: 4px; }
.row3 h3 { font-size: 15px; margin-bottom: 2px; }
.row3 p { font-size: 11px; color: var(--text-dim); }
@media (max-width: 359px) { .row3 p { display: none; } }

/* ---------- list buttons ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid3 .btn { margin-bottom: 0; padding: 14px 8px; }

/* ---------- player ---------- */
.progress-wrap { height: 7px; border-radius: 999px; background: rgba(255,255,255,.10); margin-bottom: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px;
  background: var(--grad-brand); transition: width .25s; }
.player-meta { display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: 14px; margin-bottom: 10px; min-height: 28px; }
.player-meta b { color: var(--text); }
.meta-right { display: inline-flex; align-items: center; gap: 6px; }
#live-timer { font-variant-numeric: tabular-nums; min-width: 38px; display: inline-block; }

/* ---------- чернетка ---------- */
.scratch-wrap { margin: 0 0 10px; border: 1px dashed var(--card-border);
  border-radius: 14px; background: rgba(255,255,255,.04); overflow: hidden; }
/* довге затискання на канвасі не викликає виділення/копіювання */
.scratch-wrap, .scratch-full, #scratch, #scratch-full-cv {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.scratch-head { display: flex; justify-content: space-between; align-items: center;
  padding: 4px 12px 0; font-size: 13px; color: var(--text-dim); }
.scratch-head .link-btn { padding: 4px 0; }
.scr-btn { width: 32px; height: 30px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2));
  border: 1px solid rgba(255,255,255,.25); color: #fff;
  font-size: 19px; font-weight: 800; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.scr-btn.scr-danger { background: rgba(255, 94, 108, .25); border-color: rgba(255, 94, 108, .5); font-size: 15px; }
.scr-btn svg { display: block; }
.scr-btn.active { background: #fff; color: var(--accent-1); border-color: #fff; }
/* канвас виключений із зум-контексту UI — малюється завжди 1:1 */
.scratch-wrap, .scratch-full { zoom: var(--inv-zoom, 1); }
#scratch { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; }
.scratch-full { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 80%); }
.scratch-full .scratch-head { padding: calc(10px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)) 14px 6px; font-size: 15px; }
.scratch-full .link-btn { font-size: 18px; padding: 4px 8px; }
.scratch-full .hint-x { font-size: 22px; }
#scratch-full-cv { flex: 1; width: 100%; touch-action: none; cursor: crosshair; }
/* ПК: затиснутий Space = «рука» — панорама полотна замість малювання */
#scratch.space-pan, #scratch-full-cv.space-pan { cursor: grab; }
#scratch.panning, #scratch-full-cv.panning { cursor: grabbing; }
.scratch-kbd-hint { color: var(--text-dim); font-size: 11px; font-weight: 400; margin-left: 8px; opacity: .8; }

.q-images img { width: 100%; border-radius: 14px; margin-bottom: 10px; background: #fff; display: block; }

.answers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.answers.cols-4 { grid-template-columns: repeat(4, 1fr); }
.answers.cols-6 { grid-template-columns: repeat(6, 1fr); }
.answers.cols-7 { grid-template-columns: repeat(7, 1fr); }
.answers.cols-8 { grid-template-columns: repeat(8, 1fr); }
.ans-btn { padding: 14px 0; border-radius: var(--r-md); border: 1px solid var(--card-border);
  background: var(--surface-raised); color: var(--text); font-size: 17px; font-weight: 700; cursor: pointer;
  transition: transform .1s var(--ease-out), background .16s ease, border-color .16s ease; }
.ans-btn:hover { border-color: var(--border-strong); }
.ans-btn:active { transform: scale(.97); }
.ans-btn.selected { background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: var(--glow-brand); }
.ans-btn.dim { opacity: .45; }

/* відповідності: пусті ячейки 1..N + літери (тап або перетягування) */
.match-slots { display: flex; gap: 8px; margin: 10px 0; }
.m-slot { flex: 1; min-height: 52px; border: 1.5px dashed var(--card-border); border-radius: 13px;
  background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center;
  gap: 7px; cursor: pointer; transition: border-color .12s, background .12s; }
.m-slot .m-num { color: var(--text-dim); font-weight: 800; font-size: 14px; }
.m-slot .m-val { font-size: 19px; font-weight: 800; min-width: 14px; }
.m-slot.filled { border-style: solid; background: var(--brand-soft); border-color: var(--border-strong); }
.m-slot.hot, .m-slot.drop { border-style: solid; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--brand-soft); }
.m-letter { touch-action: none; }
.m-letter.dragging { opacity: .4; }
.drag-ghost { position: fixed; z-index: 300; pointer-events: none;
  transform: translate(-50%, -120%); width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff;
  font-size: 22px; font-weight: 800; box-shadow: var(--glow-brand); }
.match-hint { color: var(--text-dim); font-size: 13px; margin-bottom: 6px; }

.short-input { width: 100%; padding: 14px; border-radius: var(--r-md); border: var(--bw) solid var(--border);
  background: var(--surface-sunken); color: var(--text); font-size: 17px; margin: 10px 0; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease; }
.short-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.player-nav { display: flex; gap: 8px; margin: 10px 0; }
.player-nav .btn { margin-bottom: 0; }
.player-nav .nav-cnt { flex: 1.4; }
.player-nav .nav-arr { flex: 1; }

.nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.nav-cell { padding: 12px 0; text-align: center; border-radius: 12px; font-weight: 700; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-border); }
.nav-cell.answered { background: var(--grad-brand); border-color: transparent; color: #fff; }
.nav-cell.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- results ---------- */
.score-hero { text-align: center; padding: 26px 16px; }
.score-hero .nmt { font-size: 56px; font-weight: 900;
  background: linear-gradient(120deg, var(--blue-400), var(--violet-400));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-hero .sub { color: var(--text-dim); margin-top: 4px; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 14px; }
.dot { width: 13px; height: 13px; border-radius: 50%; }
.dot.g { background: var(--good); } .dot.b { background: var(--bad); } .dot.n { background: rgba(255,255,255,.2); }

/* Кольорова смуга статусу. Раніше це був border-left: 4px на елементі, який
   водночас .card із border-radius 24px — 4px рамка під таким радіусом
   зрізається в «серп»: угорі товстий, донизу сходить нанівець, зі швом об
   1px hairline. Псевдоелемент дає рівну вертикальну смугу. */
.review-item, .verdict-ok, .verdict-bad { position: relative; overflow: hidden; }
.review-item::before, .verdict-ok::before, .verdict-bad::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bad); }
.review-item.ok::before, .verdict-ok::before { background: var(--good); }
.review-item.part::before { background: var(--warning); }
.review-item .rev-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.review-item .rev-answers { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.review-item .rev-answers b { color: var(--text); }
.review-item img { width: 100%; border-radius: 12px; margin-top: 8px; background: #fff; }
.expl { white-space: pre-wrap; font-size: 14px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 12px; margin-top: 8px; }
/* Rendered LaTeX-Markdown explanation (apka). KaTeX needs normal white-space. */
.expl .md { white-space: normal; line-height: 1.5; }
.expl .md p { margin: 0 0 8px; }
.expl .md p:last-child, .expl .md ol:last-child, .expl .md ul:last-child { margin-bottom: 0; }
.expl .md ol, .expl .md ul { margin: 0 0 8px; padding-left: 22px; }
.expl .md li { margin: 4px 0; }
.expl .md strong { color: #fff; }
.expl .md code { background: rgba(255,255,255,.1); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
/* Block formulas: let wide ones scroll instead of overflowing the card. */
.expl .md .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.expl .md .katex { font-size: 1.05em; }
.link-btn { background: none; border: none; color: var(--blue-300); font-size: 14px;
  font-weight: 700; cursor: pointer; padding: 8px 0; min-height: 34px; }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
/* pure-opacity fade (no vertical "pull") for the themes list */
@keyframes qfade { from { opacity: 0; } }

/* ---------- cascading picker ---------- */
.picker { padding-bottom: 8px; }
.lvl-label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin: 10px 2px 8px; }
/* всі варіанти видно одразу — переносимо рядками, без горизонтального скролу */
.lvl-row { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }
.subject-chip.wide { padding: 9px 18px; }
/* pencil button to change the 4th subject — same font size as the chips */
.subject-chip.chip-edit { padding: 9px 12px; opacity: .9; }
.subject-chip.chip-add { border-style: dashed; color: var(--text-dim); }
/* Subject picker: ALWAYS two rows on phone — 3 mandatory on row 1,
   (4th subject + ✏️) on row 2. Chips share a uniform size. */
#row-subj { display: flex; flex-wrap: wrap; gap: 6px; }
/* chips sized to their text (not stretched) — keeps gaps tight */
#row-subj .subject-chip { flex: 0 0 auto; }
/* forced line break after the 2nd subject → row1=[math,hist], row2=[mova,4th,✏️] */
.lvl-break { flex-basis: 100%; width: 100%; height: 0; margin: 0; padding: 0; }
/* desktop / wide: single row, sized to content (no forced break) */
@media (min-width: 680px) {
  #row-subj .subject-chip { flex: 0 0 auto; }
  .lvl-break { display: none; }
}
/* web (browser, any width): force the whole subject picker onto ONE row,
   horizontally scrollable if it overflows — no wrapping, no forced break */
body.web #row-subj { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.web #row-subj::-webkit-scrollbar { display: none; }
body.web .lvl-break { display: none; }
.lvl-hint { color: var(--text-dim); font-size: 14px; padding: 6px 2px; }
.lvl-anim:not([hidden]) { animation: slideIn .34s cubic-bezier(.22,.61,.36,1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } }
.picker .btn { margin-top: 10px; margin-bottom: 6px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.row2 .card { margin-bottom: 0; min-width: 0; }
.row2 .mode-card h3 { font-size: 16px; }
.row2 .mode-card p { font-size: 12px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 6, 15, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; animation: fade .2s ease; }
/* хедер Telegram у фулскріні перекриває верх — кнопки опускаємо нижче safe area */
.lb-close { position: absolute;
  top: calc(14px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  right: 14px; z-index: 101;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3);
  background: rgba(28, 27, 64, .9); color: #fff; font-size: 20px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
  padding-top: calc(8px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.lb-stage img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff;
  transition: transform .06s linear; transform-origin: center; user-select: none; }
.q-images img, .review-item img { cursor: zoom-in; }
/* скарга — окремо, праворуч, не лізе в очі */
.rev-report { display: block; margin-left: auto; text-align: right;
  color: var(--text-dim); font-size: 12.5px; opacity: .75; padding: 2px 0; }
.rev-report:active { opacity: 1; }
.gear { background: none; border: none; font-size: 16px; cursor: pointer;
  min-width: 40px; min-height: 40px; vertical-align: middle;
  padding: 0 0 0 6px; vertical-align: middle; opacity: .85; }
.topbar .gear { justify-self: end; font-size: 18px; }
.lb-arr { position: absolute; top: 50%; transform: translateY(-50%); z-index: 101;
  width: 46px; height: 64px; border-radius: 14px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(28, 27, 64, .9); color: #fff;
  font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-arr:active { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); }
.lb-count { position: absolute;
  top: calc(22px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  left: 50%; transform: translateX(-50%); z-index: 101;
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(28, 27, 64, .9); color: #fff;
  font-size: 14px; font-weight: 700; }

/* ---------- random verdict ---------- */
/* смуги .verdict-* задані разом із .review-item вище (псевдоелемент) */

/* ---------- stats ---------- */
.stat-big { text-align: center; padding: 18px 8px; }
.stat-big .num { font-size: 34px; font-weight: 900;
  background: linear-gradient(120deg, var(--blue-400), var(--violet-400));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-big .cap { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 2px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.07);
  overflow-wrap: anywhere; }
.stat-row:last-child { border-bottom: none; }
.stat-row.dim { color: var(--text-dim); }
.stat-row span:first-child { flex-shrink: 0; max-width: 55%; }
.stat-row span:last-child { text-align: right; white-space: nowrap; }
.stat-big { min-width: 0; }
.stat-big .num { font-size: clamp(22px, 8vw, 34px); overflow: hidden; text-overflow: ellipsis; }

/* ---------- admin analytics dashboard ---------- */
.an-toggle { display: flex; gap: 8px; margin: 4px 0 12px; }
.an-win { flex: 1; padding: 9px 0; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: var(--card); color: var(--text-dim); font-weight: 700; font-size: 14px; cursor: pointer; }
.an-win.active { background: var(--grad-brand); color: var(--text-on-brand);
  border-color: transparent; box-shadow: var(--glow-brand); }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.an-kpi { background: var(--card); border-radius: 16px; padding: 14px 12px; text-align: center;
  min-width: 0; }
.an-kpi-v { font-size: clamp(22px, 7vw, 30px); font-weight: 800; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; }
.an-kpi-l { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.an-kpi-s { font-size: 11px; color: var(--text-dim); opacity: .8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-fun-row { margin: 10px 0; }
.an-fun-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px;
  font-weight: 600; margin-bottom: 5px; }
.an-fun-h .dim { color: var(--text-dim); font-weight: 400; font-size: 12px; white-space: nowrap; }
.an-fun-bars { display: flex; flex-direction: column; gap: 4px; }
.an-bar { height: 22px; border-radius: 6px; display: flex; align-items: center; min-width: 28px;
  transition: width .3s ease; }
.an-bar span { font-size: 11px; font-weight: 700; color: #fff; padding: 0 7px; white-space: nowrap; }
.an-bar.started { background: #3a86ff; }
.an-bar.finished { background: #2eaf6e; }
.an-bar.abandoned { background: #e74c3c; }
.an-sep { height: 1px; background: rgba(255,255,255,.1); margin: 12px 0; }
.an-q { cursor: pointer; }
.an-friction .stat-row span:last-child { font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }

/* ---------- admin ---------- */
.admin-q { display: flex; align-items: center; gap: 10px; padding: 10px 2px;
  border-bottom: 1px solid rgba(255,255,255,.07); cursor: pointer; }
.admin-q:last-child { border-bottom: none; }
.admin-q .qn { font-weight: 800; min-width: 34px; }
.admin-q .qmeta { flex: 1; font-size: 13px; color: var(--text-dim); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.admin-q .qmeta b { color: var(--text); }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); margin: 12px 2px 6px; }
.field { width: 100%; padding: 12px; border-radius: var(--r-md); border: var(--bw) solid var(--border);
  background: var(--surface-sunken); color: var(--text); font-size: 15px; outline: none; font-family: inherit;
  transition: border-color .16s ease, box-shadow .16s ease; }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.field { min-height: 110px; resize: vertical; }
.btn.danger { background: var(--danger); box-shadow: var(--shadow-sm); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); filter: none; }
.btn.danger:active { background: var(--danger-press); transform: scale(.97); }
.sess-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.sess-actions .btn { margin-bottom: 0; }

/* ---------- партіал-мітки, match single-level, calc ---------- */
.dot.y { background: #f1c40f; }

select.field { appearance: none; -webkit-appearance: none; }
.score-hero .nmt .of { font-size: 26px; color: var(--text-dim); -webkit-text-fill-color: var(--text-dim); }

/* ---------- swipe anim + hint ---------- */
.slide-l { animation: slideL .22s ease; }
.slide-r { animation: slideR .22s ease; }
@keyframes slideL { from { opacity: .4; transform: translateX(60px); } }
@keyframes slideR { from { opacity: .4; transform: translateX(-60px); } }
.swipe-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--card-border); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.hint-x { background: none; border: none; color: var(--text-dim); font-size: 16px;
  cursor: pointer; min-width: 40px; min-height: 40px; padding: 2px 6px; }

/* ---------- fullscreen safe area (Telegram Bot API 8+) ---------- */
#app {
  padding-top: calc(16px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}
body { touch-action: pan-y; }
/* свайп вниз не оновлює/не тягне сторінку (браузерний pull-to-refresh) */
html, body { overscroll-behavior-y: none; }

/* ---------- довідкові матеріали ---------- */
/* --kb — висота екранної клавіатури, її виставляє visualViewport-хендлер у app.js */
.mats-overlay { position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 90;
  max-height: 46vh; overflow-y: auto;
  background: rgba(11, 10, 28, .97); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,.5); animation: sheetUp .22s ease; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: .5; } }
.mats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mat-thumb { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top;
  border-radius: 10px; background: #fff; cursor: zoom-in; }
.sheet-bg { position: fixed; inset: 0; z-index: -1; }
.mats-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
/* рядок налаштування з повзунком */
.set-row { display: flex; justify-content: space-between; align-items: center;
  padding: 5px 2px; font-size: 14px; font-weight: 600; }
.set-row .switch { width: 42px; height: 24px; }
.set-row .switch .knob { width: 18px; height: 18px; }
.set-row .switch.on .knob { left: 21px; }
.switch { width: 48px; height: 28px; border-radius: 999px; position: relative;
  background: rgba(255,255,255,.14); border: 1px solid var(--card-border);
  cursor: pointer; transition: background .15s; padding: 0; flex-shrink: 0; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--grad-brand); border-color: transparent; box-shadow: var(--glow-brand); }
.switch.on .knob { left: 23px; }
/* компактна шторка на ПК — праворуч унизу, не на всю ширину */
@media (min-width: 900px) {
  .sheet-compact { left: auto; right: 24px; bottom: 24px; width: 360px;
    border-radius: 20px; border: 1px solid var(--card-border); }
}
.mats-head .hint-x { font-size: 22px; }
.mats-body img { width: 100%; border-radius: 12px; margin-bottom: 10px; background: #fff; cursor: zoom-in; }
.mode-card.centered { text-align: center; }
.spec-match { display: block; width: 100%; text-align: left; padding: 10px 12px; margin-top: 6px;
  border-radius: 12px; border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font-size: 14px; cursor: pointer; }
.spec-match:active { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); }

/* ---------- stats (1:1 з ботом) ---------- */
.stat-subj { margin-bottom: 12px; }
.stat-subj .dim2 { color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.fb-area { width: 100%; resize: vertical; min-height: 120px; font-family: inherit; }

/* ---------- профіль ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prof-kpi { text-align: center; padding: 6px 2px; }
.prof-kpi b { display: block; font-size: 22px; }
.prof-kpi span { color: var(--text-dim); font-size: 12px; }
.prof-daily { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--card-border);
  color: var(--text-dim); font-size: 14px; text-align: center; }
.prof-subj { cursor: pointer; padding: 14px 16px; }
.prof-subj-top { display: flex; align-items: center; gap: 10px; }
.prof-subj-name { font-size: 15px; flex: 1; }
.prof-subj-name .prof-extra { display: block; color: var(--text-dim); font-weight: 400; font-size: 11px; }
.prof-subj-score { text-align: right; flex-shrink: 0; }
.prof-subj-score b { display: block; font-size: 22px; line-height: 1.1;
  background: linear-gradient(120deg, var(--blue-400), var(--violet-400));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.prof-subj-score b.dim { -webkit-text-fill-color: var(--text-dim); }
.prof-subj-score span { color: var(--text-dim); font-size: 11px; }
.prof-none { color: var(--text-dim); font-size: 12px; }
.prof-chev { color: var(--text-dim); font-size: 13px; transition: transform .2s; }
.prof-subj.open .prof-chev { transform: rotate(180deg); }
.prof-subj-det { display: none; margin-top: 10px; padding-top: 4px;
  border-top: 1px solid var(--card-border); }
.prof-subj.open .prof-subj-det { display: block; }
.prof-subj-det .dim2 { color: var(--text-dim); font-size: 13px; padding: 6px 0; }

/* ── рейтинг (leaderboard) ─────────────────────────────────────────── */
.lb-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.lb-chip { padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--surface-sunken); color: var(--text-dim); border: 1px solid var(--border-subtle);
  transition: color .16s ease, background .16s ease, border-color .16s ease; }
.lb-chip.on { color: #fff; border-color: var(--brand); background: var(--brand-soft); }
.lb-card { padding: 6px 8px; margin-top: 10px; }
.lb-mine { margin-top: 14px; }
.lb-mine-h { font-size: 13px; font-weight: 700; color: var(--text-dim); margin: 0 4px 6px; }
.lb-me-card { margin-top: 10px; text-align: center; }
.lb-cta { margin-top: 10px; text-align: center; }
.lb-cta .btn { margin-top: 10px; }
/* Тебе ще немає в рейтингу → список розмито, зверху — CTA-«ворота». */
.lb-locked { position: relative; }
.lb-locked .lb-card {
  filter: blur(7px); pointer-events: none; user-select: none;
  opacity: .85; transform: scale(.99);
}
.lb-gate {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; padding: 14px;
}
.lb-gate .lb-gate-cta {
  margin: 0; max-width: 94%;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  border: 1px solid var(--card-border);
}
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; }
.lb-row + .lb-row { border-top: 1px solid rgba(255, 255, 255, .05); }
.lb-row.me { background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(44, 123, 255, .4); }
.lb-row.me + .lb-row, .lb-row + .lb-row.me { border-top-color: transparent; }
.lb-rank { width: 36px; text-align: center; font-weight: 800; flex: none; }
.lb-ava { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; }
.lb-ava-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--ink-700); color: var(--ink-200); font-size: 13px; font-weight: 800; }
.lb-ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-name .lb-link { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, .35); }
.lb-pts { font-weight: 800; color: var(--blue-300); flex: none; }
.lb-help { width: 36px; height: 36px; flex: none; border-radius: 50%; font-weight: 800;
  font-size: 16px; background: rgba(255, 255, 255, .08); color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, .15); line-height: 1; }
.lb-help:active { background: var(--brand-soft); color: #fff; }
.lb-help-list { margin: 4px 0 0; padding-left: 20px; }
.lb-help-list li { margin-bottom: 9px; font-size: 14px; line-height: 1.4; color: var(--text); }
.set-row small { font-weight: 400; }

/* ── нижня панель вкладок: 🏆 Рейтинг · 🏠 Головна ────────────────────
   Видима лише на трьох верхніх екранах (render() ховає, setActiveTab показує).
   Низ ураховує iOS safe-area, фон — скло в тон бренду. */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; justify-content: center; gap: 6px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(11, 10, 28, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); }
.tab-btn { flex: 1; max-width: 172px; display: flex; flex-direction: column;
  align-items: center; gap: 1px; padding: 5px 4px; border: none; border-radius: 14px;
  background: none; color: var(--text-dim); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s, transform .08s; }
.tab-btn:active { transform: scale(.94); }
.tab-btn .tab-ic { font-size: 20px; line-height: 1.25; }
.tab-btn .tab-lbl { font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.tab-btn.on { color: #fff; background: var(--grad-brand); box-shadow: var(--glow-brand); }
/* контент не ховається за панель */
body.has-tabbar #app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
/* веб-зум-контрол піднімаємо над панеллю, щоб не перекривались */
body.has-tabbar #zoom-ctl { bottom: calc(68px + env(safe-area-inset-bottom)); }

/* ── Fullscreen Mini App (body.tg-fs): нативний Telegram-хедер/футер прибрано,
   тож контент відсуваємо власними safe-area відступами. --tg-top/--tg-bottom
   виставляє JS із tg.safeAreaInset + contentSafeAreaInset (виріз/чубчик,
   плаваюча ✕ угорі, home-indicator знизу). Без класу tg-fs — нуль впливу. */
body.tg-fs #app {
  padding-top: calc(16px + var(--tg-top, 0px));
  padding-bottom: calc(90px + var(--tg-bottom, 0px));
}
body.tg-fs.has-tabbar #app { padding-bottom: calc(86px + var(--tg-bottom, 0px)); }
body.tg-fs #tabbar { padding-bottom: calc(7px + var(--tg-bottom, 0px)); }
body.tg-fs #zoom-ctl { bottom: calc(14px + var(--tg-bottom, 0px)); }

/* ---------- confirm (Enter/Esc) ---------- */
.confirm-ov { position: fixed; inset: 0; z-index: 120; background: rgba(8,4,28,.6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  animation: fade .15s ease; }
.confirm-box { background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--card-border); border-radius: 18px; padding: 18px;
  width: min(92vw, 380px); box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.confirm-box p { font-weight: 700; margin-bottom: 14px; }
.confirm-row { display: flex; gap: 8px; }
.confirm-row .btn { margin-bottom: 0; flex: 1; }
.confirm-hint { color: var(--text-dim); font-size: 12px; margin-top: 10px; text-align: center; }

/* ---------- web version (desktop) ---------- */
@media (min-width: 900px) {
  #app { max-width: 760px; }
  .q-images img { max-height: 72vh; object-fit: contain; }
  .nav-grid { grid-template-columns: repeat(10, 1fr); }
}
/* ПК: завдання зліва, чернетка справа (⚙️ дозволяє поміняти місцями).
   Без чернетки — звичайна центрована колонка. */
@media (min-width: 1100px) {
  #app:has(.play-wrap.has-cv) { max-width: 1240px; }
  .play-wrap.has-cv { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
    gap: 18px; align-items: start; }
  .play-wrap.has-cv.swap { grid-template-columns: minmax(0, 1fr) minmax(0, 600px); }
  .play-wrap.has-cv.swap .play-col { order: 2; }
  .play-wrap.has-cv .scratch-wrap { position: sticky; top: 12px; margin: 0; }
}
#tg-login iframe { border-radius: 14px; }

/* ---------- адмін: керування фото завдання ---------- */
.adm-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.adm-img { position: relative; }
.adm-img img { height: 90px; border-radius: 8px; background: #fff; display: block; cursor: zoom-in; }
.adm-img-x { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px;
  border-radius: 50%; border: 1px solid var(--card-border); background: var(--bad);
  color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.paste-zone { border: 1.5px dashed var(--card-border); border-radius: 12px;
  padding: 14px; text-align: center; color: var(--text-dim); font-size: 14px;
  cursor: text; outline: none; }
.paste-zone:focus { border-color: var(--azure); color: var(--text); }

/* минулі спроби */
.attempt-row { cursor: pointer; }
.attempt-row.noreview { opacity: .55; cursor: default; }

/* ---------------- режим «За темами» ---------------- */
.seg-toggle { display: flex; gap: 6px; margin: 12px 0 4px; background: var(--surface-sunken);
  border: 1px solid var(--border-subtle); border-radius: 999px; padding: 5px; }
.seg-toggle button { flex: 1; padding: 9px 6px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: color var(--dur) var(--ease-out); }
.seg-toggle button.active { background: var(--grad-brand); color: #fff; box-shadow: var(--glow-brand); }

/* ---------------- калькулятор: куди я проходжу ---------------- */
.bd-mini { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px;
  margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.bd-mini b { color: var(--text); font-weight: 700; }
.rec-box { margin-top: 14px; }
.rec-title { font-size: 15px; font-weight: 800; margin: 18px 2px 4px; }
.rec-title .sub { font-size: 11px; font-weight: 500; color: var(--text-dim); }
.rec-kse { display: block; text-decoration: none; color: var(--text); margin-top: 8px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--card-border); background: var(--card); }
.rec-kse:active { transform: scale(0.99); }
.rec-kse.ok { border-color: rgba(46,204,113,.55); background: rgba(46,204,113,.10); }
.rec-kse-head { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.rec-kse-mark { font-size: 15px; }
.rec-kse-specs { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
/* KSE grants list (priority-ordered, strict per-subject) */
.rec-kse-box { display: block; margin-top: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--card-border); background: var(--card); }
.rec-kse-box.none { text-decoration: none; color: var(--text); }
.rec-kse-box.none .rec-kse-title { margin-bottom: 0; }
.rec-kse-title { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.rec-grant { border-top: 1px solid var(--card-border); }
.rec-grant:first-of-type { border-top: none; }
.rec-grant-head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 0; cursor: pointer; }
.rec-grant-head:active { opacity: .7; }
.rec-grant-top { font-size: 14px; font-weight: 700; }
.rec-grant-name {}
.rec-grant.ok .rec-grant-name { color: #2ecc71; }
.rec-grant-chev { flex-shrink: 0; width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center; border-radius: 50%;
  font-size: 18px; font-weight: 800; line-height: 1; color: #4aa3ff;
  background: rgba(74,163,255,.16); border: 1px solid rgba(74,163,255,.35);
  transition: transform .18s; }
.rec-grant-head.open .rec-grant-chev { transform: rotate(180deg);
  color: #fff; background: #4aa3ff; }
.rec-grant-body { padding: 0 0 9px; }
.rec-grant-link { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent, #4aa3ff); text-decoration: underline; }
.rec-grant-progs { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rec-grant-reason { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rec-grant-cond { font-size: 11px; color: var(--text-dim); margin-top: 3px; font-style: italic; }
.rec-grant-benefits { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-dim); }
.rec-grant-benefits li { margin: 1px 0; }
.rec-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rec-card { display: block; text-decoration: none; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text); }
.rec-card:active { transform: scale(0.99); }
.rec-card.near { border-color: rgba(241,196,15,.5); }
.rec-uni { font-size: 14px; font-weight: 700; }
.rec-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rec-gap { font-size: 12px; font-weight: 700; color: #e0a800; margin-top: 3px; }
.rec-score { font-size: 12px; margin-top: 4px; }

.theme-group { margin: 14px 2px 6px; font-size: 13px; font-weight: 700; letter-spacing: .4px;
  color: var(--text-dim); text-transform: uppercase; }
.theme-row { position: relative; width: 100%; display: block; overflow: hidden; text-align: left;
  margin-bottom: 8px; padding: 0; border: 1px solid var(--card-border); border-radius: 14px;
  background: var(--card); color: var(--text); cursor: pointer; }
.theme-row:active { transform: scale(0.99); }
.theme-fill { position: absolute; inset: 0 auto 0 0; height: 100%;
  background: linear-gradient(90deg, rgba(46,204,113,.38), rgba(46,204,113,.20));
  border-right: 2px solid rgba(46,204,113,.65); transition: width .3s; z-index: 0; }
.theme-row-in { position: relative; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 14px 14px; }
.theme-name { font-size: 15px; font-weight: 600; }
.theme-count { font-size: 13px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }

.theme-sheet .th-label { margin: 12px 2px 6px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.theme-sheet .th-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-sheet .th-opts button { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--card-border);
  background: var(--card); color: var(--text-dim); font-size: 14px; font-weight: 700; cursor: pointer; }
.theme-sheet .th-opts button.active {
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); color: #fff; border-color: transparent; }

/* результати теми: неправильні завдання */
.nav-cell.wrong { border-color: var(--bad); color: var(--bad); }

/* ================= Наголоси ================= */
.nah-card.mode-card .m-emoji, .nah-card .m-emoji { }
.nah-intro p { margin: 0 0 8px; font-size: 14px; }
.nah-overall { font-size: 13px; color: var(--text-dim); }
.nah-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.nah-pack { border: 1px solid var(--card-border); background: var(--card); border-radius: 12px;
  padding: 12px 6px; text-align: center; cursor: pointer; transition: transform .1s; }
.nah-pack:active { transform: scale(.96); }
.nah-pack.part { border-color: rgba(255,193,7,.5); }
.nah-pack.done { border-color: rgba(46,204,113,.6); background: rgba(46,204,113,.12); }
.nah-pack-lab { font-size: 16px; font-weight: 800; }
.nah-pack-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.nah-pack.done .nah-pack-sub::after { content: " ✓"; color: #2ecc71; }
.nah-top { grid-template-columns: 44px 1fr auto; }
.nah-left { font-size: 12px; color: var(--text-dim); font-weight: 700; text-align: right; white-space: nowrap; }
/* full-screen color feedback while dragging */
.nah-tint { position: fixed; inset: 0; z-index: 69; pointer-events: none; background: transparent; }
/* екран гри зафіксований на весь viewport — сторінка НЕ рухається вбік */
.nah-game { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  overflow: hidden; touch-action: none;
  padding: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom)); }
/* deck of cards (Tinder-style) */
.nah-deck { position: relative; flex: 1; min-height: 0; margin: 4px 0; }
.nah-corners { position: absolute; left: 16px; right: 16px; bottom: 4px; top: auto; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; transition: opacity .6s ease; }
.nah-cor { font-size: 14px; font-weight: 800; }
.nah-cor.no { color: #ff6b6b; }
.nah-cor.yes { color: #2ecc71; }
/* картка менша за колоду й центрована (видно верхнє/нижнє меню) */
.nah-card { position: absolute; left: 50%; top: 45%; width: min(90%, 400px); height: min(66%, 410px);
  background: linear-gradient(180deg, #2e2168, #241a52);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px; padding: 18px; text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  will-change: transform; touch-action: none; }
.nah-card.behind { pointer-events: none; }
.nah-card.hint-yes { border-color: rgba(46,204,113,.9); box-shadow: 0 10px 34px rgba(46,204,113,.3); }
.nah-card.hint-no { border-color: rgba(231,76,60,.9); box-shadow: 0 10px 34px rgba(231,76,60,.3); }
.nah-word { font-weight: 800; letter-spacing: .5px; line-height: 1.2; max-width: 100%; word-break: break-word; }
.nah-vow { color: #4aa3ff; }
.nah-note { font-size: 14px; color: var(--text-dim); margin-top: 10px; }
.nah-q { font-size: 13px; color: var(--text-dim); margin-top: 18px; }
.nah-swipe-hint { text-align: center; color: var(--text-dim); font-weight: 700; font-size: 14px; margin-top: 14px; }
/* кнопки ПК — нижче, внахлест на нижню частину карток */
/* кнопки ПК — окремо під картками (без нахлесту) */
.nah-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.nah-btn { padding: 16px 0; border-radius: 16px; border: 2px solid; background: var(--card); font-size: 17px; font-weight: 800; cursor: pointer; }
.nah-btn.no { color: #e74c3c; border-color: rgba(231,76,60,.55); }
.nah-btn.yes { color: #2ecc71; border-color: rgba(46,204,113,.55); }
.nah-btn:active { transform: scale(.97); }
.nah-kbd-hint { color: var(--text-dim); font-size: 12px; margin-top: 8px; text-align: center; }
.nah-done { text-align: center; }
.nah-done-emoji { font-size: 52px; }
.nah-entry { display: flex; align-items: center; justify-content: center; gap: 8px; }
.nah-entry-sub { font-size: 12px; font-weight: 600; opacity: .8; }
.theme-row.nah-theme { background: var(--grad-brand-soft); border: 1px solid rgba(124,92,255,.45); }
.theme-row.nah-theme .theme-name { font-weight: 800; }

/* флеш-сигнал на весь екран + банер правильного наголосу */
/* плавне ОДНЕ підсвічування фону: поступово загоряється і поступово згасає (~2с, без блимання) */
@keyframes nahFlashOk {
  0% { background: rgba(0,214,107,0); } 32% { background: rgba(0,214,107,.55); }
  100% { background: rgba(0,214,107,0); } }
@keyframes nahFlashBad {
  0% { background: rgba(255,38,38,0); } 32% { background: rgba(255,38,38,.6); }
  100% { background: rgba(255,38,38,0); } }
.nah-vow-bad { color: #ff3b3b; }
.nah-vow-good { color: #18e07a; }
.nah-card.corrected { border-color: rgba(255,255,255,.3); }
.nah-tint.flash-ok { animation: nahFlashOk 2s ease-in-out; }
.nah-tint.flash-bad { animation: nahFlashBad 2s ease-in-out; }
.nah-correct { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40;
  background: rgba(231,76,60,.95); color: #fff; padding: 10px 16px; border-radius: 14px;
  font-size: 18px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.nah-correct .nah-vow { color: #fff8b0; }

/* плавна поява нової картки */
.nah-card.enter { opacity: 0 !important; transform: translate(-50%, calc(-50% + 46px)) scale(.82) !important; }
/* налаштування анімації */
.nah-set-lab { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.nah-anim-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nah-anim-seg button { padding: 10px 4px; border-radius: 12px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,.05); color: var(--text-dim); font-size: 13px; font-weight: 700; cursor: pointer; }
.nah-anim-seg button.active { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); color: #fff; border-color: transparent; }
/* зелений блок із правильним наголосом (по тапу — знищення) */
.nah-correct-block { position: absolute; left: 8px; right: 8px; top: 56%; bottom: auto; z-index: 45; cursor: pointer;
  background: linear-gradient(180deg, #1f9d57, #16864a); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 16px 14px; text-align: center; box-shadow: 0 12px 36px rgba(22,134,74,.5);
  opacity: 0; transform: translateY(20px); transition: opacity .22s ease, transform .22s ease; }
.nah-correct-block.in { opacity: 1; transform: translateY(0); }
.nah-correct-block:active { transform: scale(.98); }
.nah-cb-lab { font-size: 13px; font-weight: 700; color: #d9ffe9; }
.nah-cb-word { font-size: 30px; font-weight: 800; margin: 6px 0; color: #fff; }
.nah-cb-word .nah-vow { color: #fff3a0; }
.nah-cb-tap { font-size: 12px; color: #cfeede; }
/* шредер */
.nah-shred { position: absolute; z-index: 35; pointer-events: none; }
.nah-strip { position: absolute; top: 0; bottom: 0; overflow: hidden; border-radius: 0; }

/* налаштування анімації — ⚙️ всередині гри */
.nah-top-right { display: flex; align-items: center; gap: 8px; }
.nah-gear { background: var(--card); border: 1px solid var(--card-border); color: var(--text);
  border-radius: 10px; width: 36px; height: 34px; font-size: 16px; cursor: pointer; }
.nah-set-pop { position: absolute; right: 0; top: 46px; z-index: 50; width: min(320px, 92%);
  background: #2a1f5e; border: 1px solid rgba(255,255,255,.2); border-radius: 16px; padding: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5); }

/* ============================================================
   Публічний лендинг (web, логаут) — .lp
   #app має max-width:560px; лендинг розривається на повну ширину
   через від'ємні поля, щоб виглядати як справжній сайт.
   ============================================================ */
.lp {
  /* 100vw враховує жолоб скролбара (html { scrollbar-gutter: stable }), тож
     лендінг виходив ширшим за body і сторінка їхала вбік. Рахуємо відступ від
     реальної ширини батька, а не від viewport. */
  --lp-gutter: calc((100vw - 100%) / 2);
  margin: -16px calc(-1 * var(--lp-gutter)) -90px;
  width: auto;
  text-align: center;
  overflow-x: clip;
}
.lp section,
.lp .lp-head,
.lp .lp-foot { padding-left: 20px; padding-right: 20px; }
.lp h2, .lp h3, .lp p { margin: 0; }

/* контейнер для вмісту секцій — обмежує ширину на десктопі */
.lp-hero, .lp-stats, .lp-sec, .lp-band, .lp .lp-foot > * { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ---- header ---- */
.lp-head {
  display: flex; align-items: center; gap: 14px;
  max-width: 1040px; margin: 0 auto;
  padding-top: 14px; padding-bottom: 14px;
}
.lp-brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 19px; letter-spacing: 1px; }
.lp-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; box-shadow: 0 3px 12px rgba(0,0,0,.4); }
.lp-nav { display: flex; gap: 22px; margin-left: auto; }
.lp-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .15s; }
.lp-nav a:hover { color: var(--text); }
.lp-login-btn { width: auto; margin: 0; padding: 9px 20px; font-size: 14px; }
.lp-head .lp-nav + .lp-login-btn { margin-left: 0; }

/* ---- hero ---- */
.lp-hero { padding-top: 48px; padding-bottom: 40px; }
.lp-badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 22px;
  backdrop-filter: blur(8px);
}
.lp-h1 { font-size: clamp(30px, 7vw, 54px); font-weight: 900; line-height: 1.08; letter-spacing: -.5px; }
.lp-grad {
  background: linear-gradient(100deg, var(--azure), #7aa9ff 60%, #c4b5ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lp-sub { max-width: 620px; margin: 20px auto 0; color: var(--text-dim); font-size: clamp(15px, 2.4vw, 19px); line-height: 1.5; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.lp-cta { width: auto; margin: 0; padding: 15px 30px; font-size: 16px; }
.lp-cta-note { margin-top: 14px; color: var(--text-dim); font-size: 13px; }

/* ---- stats band ---- */
.lp-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  padding-top: 8px; padding-bottom: 40px;
}
.lp-stat {
  flex: 1 1 150px; max-width: 220px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 18px 14px; backdrop-filter: blur(10px);
}
.lp-stat b { display: block; font-size: 26px; font-weight: 900; color: var(--azure); }
.lp-stat span { font-size: 13px; color: var(--text-dim); }

/* ---- generic section ---- */
.lp-sec { padding-top: 46px; padding-bottom: 46px; }
.lp-h2 { font-size: clamp(24px, 5vw, 36px); font-weight: 900; letter-spacing: -.3px; }
.lp-lead { max-width: 560px; margin: 12px auto 0; color: var(--text-dim); font-size: 16px; line-height: 1.5; }

/* ---- feature grid ---- */
.lp-grid {
  display: grid; gap: 14px; margin-top: 30px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  text-align: left;
}
.lp-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(10px); transition: transform .15s, border-color .15s;
}
.lp-card:hover { transform: translateY(-3px); border-color: rgba(122,169,255,.45); }
.lp-ic { font-size: 30px; margin-bottom: 10px; }
.lp-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.lp-card p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }

/* ---- subjects ---- */
.lp-subjects {
  display: grid; gap: 10px; margin-top: 28px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.lp-subj {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 13px 15px; font-weight: 700; font-size: 14px;
}
.lp-subj-ic { font-size: 20px; }

/* ---- steps ---- */
.lp-steps {
  display: grid; gap: 16px; margin-top: 30px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.lp-step {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 24px 20px; backdrop-filter: blur(10px);
}
.lp-step-n {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 18px rgba(6,93,167,.4);
}
.lp-step h3 { font-size: 18px; font-weight: 800; margin-bottom: 7px; }
.lp-step p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }

/* ---- CTA band ---- */
.lp-band {
  margin-top: 14px; margin-bottom: 14px;
  padding: 48px 24px; border-radius: 24px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--card-border); backdrop-filter: blur(10px);
}
.lp-band .lp-cta { margin-top: 24px; }

/* ---- FAQ ---- */
.lp-faq { max-width: 640px; margin: 28px auto 0; text-align: left; }
.lp-faq-i {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 4px 16px; margin-bottom: 10px;
}
.lp-faq-i summary {
  cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 15px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.lp-faq-i summary::-webkit-details-marker { display: none; }
.lp-faq-i summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--text-dim); transition: transform .2s; }
.lp-faq-i[open] summary::after { transform: rotate(45deg); }
.lp-faq-i p { color: var(--text-dim); font-size: 14px; line-height: 1.55; padding: 0 0 14px; }

/* ---- footer ---- */
.lp-foot {
  margin-top: 20px; padding-top: 40px; padding-bottom: 48px;
  border-top: 1px solid var(--card-border);
}
.lp-foot .lp-brand { justify-content: center; margin: 0 auto; }
.lp-foot-about { max-width: 480px; margin: 16px auto 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.lp-foot-links { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 20px; }
.lp-foot-links a { color: var(--azure); text-decoration: none; font-weight: 700; font-size: 14px; }
.lp-foot-links a:hover { text-decoration: underline; }
.lp-foot-login {
  background: none; border: none; color: var(--text-dim); font-weight: 700; font-size: 14px;
  cursor: pointer; padding: 0; font-family: inherit;
}
.lp-foot-login:hover { color: var(--text); }
.lp-foot-copy { margin-top: 24px; color: var(--text-dim); font-size: 12px; opacity: .8; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  .lp-nav { display: none; }
  .lp-hero { padding-top: 34px; }
  .lp-cta-row .lp-cta { flex: 1 1 100%; }
}

/* ===================== login screen (web) ===================== */
.login {
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 18px 28px;
  min-height: 84vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.login-logo {
  width: 76px; height: 76px; border-radius: 22px; object-fit: cover;
  box-shadow: 0 12px 34px rgba(6, 93, 167, .45);
}
.login-wordmark {
  font-size: 26px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(100deg, #8fb6ff, #d7c4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-h1 { font-size: 23px; font-weight: 800; margin: 4px 0 8px; }
.login-sub {
  color: var(--text-dim); font-size: 14px; line-height: 1.5;
  margin: 0 0 22px; max-width: 340px;
}
.login-methods { width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 12px; }
.login-tg { min-height: 46px; display: flex; align-items: center;
  justify-content: center; width: 100%; border-radius: 14px; }
.login-tg.li-current { box-shadow: 0 0 0 2px var(--azure, #4aa3ff); border-radius: 16px; }
.login-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text);
  background: var(--card); border: 1px solid var(--card-border);
  text-decoration: none; transition: border-color .15s, background .15s, transform .05s;
}
.login-btn:active { transform: scale(.985); }
.login-google { background: #fff; color: #1f1f1f; border-color: #fff; }
.login-google:hover { background: #f3f3f3; }
.login-guest { background: var(--card); }
.login-guest:hover { border-color: var(--accent-2); }
.li-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 4px; border-radius: 50%;
  background: linear-gradient(135deg, #16c172, #0a9d5b); color: #fff;
  font-size: 12px; font-weight: 800;
}
.login-or {
  width: 100%; display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 12px; margin: 18px 0 16px;
}
.login-or::before, .login-or::after {
  content: ""; flex: 1; height: 1px; background: var(--card-border);
}
.login-warn {
  color: #ffd27a; font-size: 12.5px; line-height: 1.45;
  margin: 10px 4px 0; max-width: 340px;
}
.login-bot {
  margin-top: auto; padding-top: 26px;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 13px; text-decoration: none;
}
.login-bot:hover { color: var(--text); }
.login-bot b { color: var(--azure, #6cb0ff); font-weight: 700; }
.login-bot-ic { font-size: 15px; }

/* ===================== guest reminder banner (home) ===================== */
/* Нагадування гостю зареєструватись: фірмовий blue→violet (не золото/прапор) */
.guest-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 11px 12px;
  border-radius: 14px;
  background: var(--grad-brand-soft);
  border: 1px solid rgba(124, 92, 255, .35);
}
.guest-banner-ic { font-size: 18px; flex: 0 0 auto; }
.guest-banner-txt { flex: 1; font-size: 13px; line-height: 1.35; color: var(--text); }
.guest-banner-cta {
  flex: 0 0 auto; border: none; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: #fff; background: var(--grad-brand); box-shadow: var(--glow-brand);
}
.guest-banner-x {
  flex: 0 0 auto; border: none; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 15px; line-height: 1; padding: 4px;
}
.guest-banner-x:hover { color: var(--text); }

/* Доступність: поважаємо системне «зменшити рух» (у застосунку ~15 анімацій,
   зокрема nahFlashOk/Bad, що заливають увесь екран кольором на 2 с). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* 7-8 варіантів на вузькому екрані стискали кнопки до ~34px — переносимо */
@media (max-width: 400px) {
  .answers.cols-7, .answers.cols-8 { grid-template-columns: repeat(4, 1fr); }
}
