/* =========================================================
   «Стікер»: необруталізм для AI Solver. Підключається останнім на всіх
   сторінках користувача (адмінка лишається у своєму стилі).
   Жовте тло, товсті чорні рамки, жорсткі тіні, квадратні кути,
   синя головна дія, рожевий акцент, зелена відповідь.
   ========================================================= */
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/dela-gothic-one-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/dela-gothic-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900; src: url(/fonts/golos-text-cyrillic-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900; src: url(/fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900; src: url(/fonts/golos-text-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --st-yellow: #ffd21f;
  --st-pink: #ff4f9a;
  --st-green: #19d38a;
  --st-b: 3px solid var(--ink);
  --st-b-lg: 4px solid var(--ink);

  --blue: #2340ff;
  --blue-deep: #1428c4;
  --blue-tint: #e3e6ff;
  --blue-line: #101010;
  --marker: #ff4f9a;
  --marker-soft: #ffd9e8;
  --red-pen: #d3002f;
  --board: #2340ff;
  --board-2: #1428c4;
  --chalk: #ffffff;
  --mint: #19d38a;
  --ink: #101010;
  --ink-2: #2b2820;
  --ink-3: #47423a;
  --page: var(--st-yellow);
  --paper-2: #ffffff;
  --studio: #fff3b8;
  --studio-2: #ffe680;
  --line: #101010;
  --line-strong: #101010;
  --grid-line: transparent;
  --ok: #06663f;
  --ok-tint: #c9f7e3;
  --warn-tint: #fff3b8;
  --danger: #b0002a;
  --danger-tint: #ffdbe6;

  --font-display: "Dela Gothic One", "Arial Black", sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Golos Text", system-ui, sans-serif;

  --header-h: 72px;
  --shadow-print: 6px 6px 0 var(--ink);
  --shadow-float: 8px 8px 0 var(--ink);
  --shadow-sticker: 5px 5px 0 var(--ink);
}

*, *::before, *::after { border-radius: 0 !important; }
.spinner, .dots i, .avatar { border-radius: 50% !important; }
.katex * { border-radius: unset !important; }

body { font-weight: 450; }
.paper-grid { background-image: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Заголовки */
.h1, .h2, .display, .app-top__title, .task__title, .solve__title, .auth__title, .auth__aside-title, .section-title, .brand__name {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0;
}
.h1 { font-size: clamp(2.1rem, 1.2rem + 3.3vw, 4.1rem); line-height: 1.12; }
.h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.7rem); line-height: 1.16; }
.h3 { font-weight: 800; letter-spacing: 0; }
.lead { color: var(--ink); }
.hand { font-family: var(--font-body); font-weight: 800; font-size: 0.95rem; }
.hl, .h1 .hl, .h2 .hl {
  background: #fff; color: var(--ink); padding: 0 0.16em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hl::before, .hl::after { display: none; }
/* Висока «коробка» шрифту інакше наїжджає на рядок вище */
.h1 .hl, .h2 .hl { display: inline-block; line-height: 1.12; }
.answer, .demo .answer { background: var(--st-green); color: var(--ink); border: var(--st-b); }
.demo .katex-display { font-size: 0.88em; }
.eyebrow {
  display: inline-block; width: fit-content; justify-self: start; padding: 3px 10px; background: var(--st-pink); color: var(--ink);
  border: var(--st-b); font-family: var(--font-body); font-weight: 800; font-size: 0.86rem; letter-spacing: 0; text-transform: none;
  transform: rotate(-1.5deg);
}
.link { color: var(--blue-deep); text-decoration-thickness: 2px; }

/* Кнопки: натиск вдавлює наліпку в тінь */
.btn {
  border: var(--st-b); box-shadow: var(--shadow-sticker); font-weight: 800;
  transition: transform 90ms var(--ease-out), box-shadow 90ms var(--ease-out), background-color 120ms ease;
}
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn--sm { box-shadow: 3px 3px 0 var(--ink); }
.btn--sm:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary, .btn--marker { background: var(--blue); color: #fff; border-color: var(--ink); }
.btn--marker:active:not(:disabled) { box-shadow: 1px 1px 0 var(--ink); }
.btn--light, .btn--ghost, .btn--soft, .btn--on-blue { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--ghost-dark { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink); border-color: transparent; box-shadow: none; }
@media (hover: hover) {
  .btn--primary:hover, .btn--marker:hover { background: var(--blue-deep); }
  .btn--light:hover, .btn--ghost:hover, .btn--soft:hover, .btn--on-blue:hover { background: var(--studio); border-color: var(--ink); }
  .btn--quiet:hover { background: #fff; }
}

/* Форми */
.input { border: var(--st-b); background: #fff; }
.input::placeholder { color: #5e5a50; }
.input:focus { border-color: var(--blue); box-shadow: 4px 4px 0 var(--blue); }
.segmented label { border: var(--st-b); }
.segmented input:checked + label { background: var(--ink); border-color: var(--ink); color: #fff; }
.form-alert { border: var(--st-b); }

/* Шапка і підвал */
.site-header { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: var(--st-b-lg); }
.site-header[data-scrolled] { border-bottom-color: var(--ink); }
.site-nav a { color: var(--ink); font-weight: 700; }
@media (hover: hover) { .site-nav a:hover { background: var(--st-yellow); } }
.nav-toggle { border: var(--st-b); }
.brand__name { font-size: 1.1rem; }
/* Підвал: кольорові колонки-посилання і назва з наліпок на всю ширину */
.site-footer { position: relative; z-index: 4; padding: 0; background: var(--ink); color: #fff; border-top: var(--st-b-lg); overflow: hidden; }
.foot-lead { padding: clamp(28px, 5vw, 64px) var(--gutter); max-width: 22em; font-family: var(--font-display); font-size: clamp(1.4rem, 1rem + 2vw, 2.7rem); line-height: 1.2; text-wrap: balance; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: var(--st-b-lg); border-color: var(--ink); }
.foot-col { --fill: var(--st-yellow); padding-block: 22px 0; background: var(--fill); color: var(--ink); border-right: var(--st-b-lg); }
.foot-col:last-child { border-right: 0; }
.foot-col--pink { --fill: var(--st-pink); }
.foot-col--green { --fill: var(--st-green); }
.site-footer .foot-col h2 { margin: 0 0 14px; padding-inline: 20px; color: var(--ink); font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 1rem + 1vw, 2rem); }
.site-footer .foot-col ul { gap: 0; }
.site-footer .foot-col li { border-top: var(--st-b); }
/* Рядок заливається кольором зліва, текст відсувається: видно, куди ведеш курсор */
.site-footer .foot-col a {
  display: block; padding: 14px 20px; color: var(--ink); font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); font-weight: 800;
  background: linear-gradient(var(--ink), var(--ink)) left / 0 100% no-repeat;
  transition: background-size 180ms var(--ease-out), padding-left 180ms var(--ease-out), color 120ms ease;
}
@media (hover: hover) { .site-footer .foot-col a:hover { background-size: 100% 100%; padding-left: 34px; color: var(--fill); } }
.site-footer .foot-col a:active { background-size: 100% 100%; color: var(--fill); }
.site-footer .foot-col a:focus-visible { outline-color: var(--ink); outline-offset: -4px; }

/* Назва на всю ширину по літерах; рух і підгонку кегля дає footer-word.js */
.foot-word { padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(14px, 2vw, 26px); overflow: hidden; cursor: default; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.foot-word__row { display: flex; width: max-content; align-items: flex-end; font-family: var(--font-display); font-size: 14vw; line-height: 1; }
.foot-word__l { display: block; color: #ffe08a; cursor: pointer; will-change: transform; transition: opacity 120ms ease; -webkit-tap-highlight-color: transparent; }
/* М’які кольори плавно перетікають по напису */
@media (prefers-reduced-motion: no-preference) {
  .foot-word__l { animation: foot-tint 14s linear infinite; animation-delay: calc(var(--i, 0) * -1.1s); }
}
@keyframes foot-tint {
  0%, 100% { color: #ffe08a; }
  25% { color: #ffb4c6; }
  50% { color: #b9c6ff; }
  75% { color: #a5ecd0; }
}
.foot-word__gap { width: 0.22em; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 0 var(--gutter) 24px; font-size: 0.86rem; color: #fff; }
@media (max-width: 760px) {
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .foot-col { border-right: 0; border-bottom: var(--st-b-lg); }
  .foot-col:last-child { border-bottom: 0; }
}

/* ---------- Лендинг ---------- */
.hero__note { display: inline-block; padding: 3px 12px; background: var(--st-pink); border: var(--st-b); color: var(--ink); transform: rotate(-2deg); }
.hero__note svg { display: none; }
.hero__proof li { color: var(--ink); }
.demo__arrow, .demo__tape { display: none; }
.demo__sheet, .demo__photo { border: var(--st-b-lg); box-shadow: var(--shadow-print); background: #fff; }
.demo__tabs { background: transparent; border: 0; box-shadow: none; }
.demo__tab { border: var(--st-b); background: #fff; color: var(--ink); }
.demo__tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.ticker { background: var(--ink); color: var(--st-yellow); border-block: var(--st-b-lg); }
.ticker span { font-family: var(--font-display); font-weight: 400; color: var(--st-yellow); }
.section.how { background: #fff; border-bottom: var(--st-b-lg); }
.step, .bento__card, .review, .subject-chip, .plan, .faq__list details, .final__card {
  background: #fff; border: var(--st-b-lg); box-shadow: var(--shadow-print);
}
.step__n { font-family: var(--font-display); font-weight: 400; color: var(--blue); font-size: 2.4rem; }
.bento__card--board, .board { background: var(--blue); color: #fff; }
.bento__card--board p, .bento__card--board h3, .board__text, .board__kicker, .board__chalk { color: #fff; }
.board { border: var(--st-b-lg); box-shadow: var(--shadow-float); background-image: none; }
.check-demo { background: #fff; color: var(--ink); border: var(--st-b); }
.check-demo span, .check-demo p { color: var(--ink); }
.check-demo em { color: var(--danger); font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; }
.check-demo .bad { color: var(--danger); }
.check-demo .ok { color: var(--ok); }
.subject-chip { box-shadow: 3px 3px 0 var(--ink); border-width: 3px; }
.plan--popular { background: var(--st-pink); transform: rotate(-1deg); }
.plan__badge { background: var(--ink); color: #fff; border: 0; }
.plan__name, .plan__amount { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
.plan__note, .plan__credits, .plan__save, .pricing__fine, .faq__aside-note { color: var(--ink); }
.faq__answer { color: var(--ink); }
.final__card { background: var(--blue); color: #fff; box-shadow: var(--shadow-float); }
.final__card .h2, .final__note, .final__card p { color: #fff; }
.final__card .hl { color: var(--ink); }
.final__card .btn--marker { background: var(--st-yellow); color: var(--ink); }

/* ---------- Кабінет ---------- */
.page-app { background: var(--st-yellow); }
.app-side { background: #fff; border-right: var(--st-b-lg); }
.app-nav a { color: var(--ink); font-weight: 750; border: 3px solid transparent; }
@media (hover: hover) { .app-nav a:hover { background: var(--studio); } }
.app-nav a[aria-current="page"], .app-nav a[aria-current="page"] svg { background: var(--ink); color: #fff; }
.side-balance { background: var(--st-yellow); border: var(--st-b); }
.side-balance__label, .side-balance__level, .app-side__link { color: var(--ink); }
.side-balance__value { font-family: var(--font-display); font-weight: 400; }
.app-top { background: #fff; border-bottom: var(--st-b-lg); }
.balance-chip { border: var(--st-b); background: var(--st-yellow); }
.balance-chip > svg { color: var(--ink); }
.balance-chip__add { background: var(--blue); }
.avatar { background: var(--st-pink); color: var(--ink); border: var(--st-b); }
.menu { border: var(--st-b-lg); box-shadow: var(--shadow-print); }
.app-banner { border: var(--st-b); }
.app-tabbar { background: #fff; border-top: var(--st-b-lg); box-shadow: none; }
.app-tabbar a { color: var(--ink); font-weight: 750; }
.app-tabbar a[aria-current="page"], .app-tabbar a[aria-current="page"] svg { background: var(--ink); color: #fff; }

.panel, .solve__sheet, .sheet, .cond, .task-card, .balance-card, .pack, .topup, .custom-topup, .iban-pay, .iban-step, .notice, .empty, .ledger, .orders, .settings .panel, .plan-card {
  background: #fff; border: var(--st-b-lg); box-shadow: var(--shadow-print);
}
.panel .panel, .iban-pay .iban-step, .topup .custom-topup, .topup .pack { box-shadow: 3px 3px 0 var(--ink); border-width: 3px; }
.panel__title { font-weight: 800; }
.balance-card { background: var(--st-pink); color: var(--ink); }
.balance-card__label, .balance-card__sub, .balance-card__hint { color: var(--ink); }
.balance-card__value { font-family: var(--font-display); font-weight: 400; color: var(--ink); }
.panel .ledger, .panel .orders, .ledger, .orders { background: none; border: 0; box-shadow: none; }
.topup { padding: clamp(16px, 2.4vw, 22px); }
.balance-card, .balance-card * { color: var(--ink); }
.balance-card .btn--primary, .balance-card .btn--marker, .balance-card .btn svg { color: #fff; }
.sheet .sol .answer, .sol .answer, .sol p.answer { background: var(--st-green) !important; }
.pack--popular { background: var(--st-pink); }
.pack__name, .pack__price { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
.pack__badge { background: var(--ink); color: #fff; }
.pack__note, .pack__meta, .pack__credits, .pack__save { color: var(--ink); }
.req-row { border-color: var(--ink); }
.tag { border: 2px solid var(--ink); }

/* ---------- Нове завдання ---------- */
.solve__note { display: inline-block; width: fit-content; padding: 2px 10px; background: var(--st-pink); border: var(--st-b); color: var(--ink); transform: rotate(-1.5deg); }
.solve__or { color: var(--ink); font-family: inherit; }
.drop { border: var(--st-b-lg); border-style: dashed; background: var(--studio); }
.drop--over { background: var(--st-pink); border-style: solid; }
.drop__icon { background: var(--st-yellow); border: var(--st-b); color: var(--ink); }
.drop__sub { color: var(--ink); }
.subj, .mode, .examples__chip { border: var(--st-b); background: #fff; color: var(--ink); font-weight: 700; }
.mode__hint { color: inherit; opacity: 0.85; }
.subj[aria-pressed="true"], .mode[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.mode[aria-pressed="true"] .mode__name, .mode[aria-pressed="true"] .mode__hint { color: #fff; }
@media (hover: hover) { .subj:hover, .mode:hover, .examples__chip:hover { background: var(--studio); border-color: var(--ink); color: var(--ink); } .subj[aria-pressed="true"]:hover, .mode[aria-pressed="true"]:hover { background: var(--ink); color: #fff; } }
.solve__go { margin-top: 16px; }
.solve__submit { width: 100%; min-height: 64px; font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; }
.solve__cost { color: var(--ink); }
.shot { border: var(--st-b); }

/* ---------- Розв’язок ---------- */
.task__back { color: var(--ink); font-weight: 800; }
.task__meta { color: var(--ink); }
.cond__label, .ask__label { color: var(--ink); }
.sol .answer {
  background: var(--st-green); color: var(--ink); border: var(--st-b-lg); box-shadow: var(--shadow-sticker);
  padding: 14px 16px; margin: 0 0 22px; font-size: 1.15rem; font-weight: 700;
}
.sol .answer::before, .sol .answer::after { display: none; }
.sol .answer strong { color: var(--ink); }
.step-h__n { background: var(--ink); color: #fff; border: 0; font-family: var(--font-body); font-weight: 800; }
.step-ask {
  display: none; margin: 6px 0 0; padding: 4px 0; border: 0; background: none;
  color: var(--blue-deep); font-weight: 750; font-size: 0.9rem;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
[data-can-ask] .step-ask { display: inline-block; }
.msg--q p, .msg--q { background: var(--st-yellow); color: var(--ink); }
.msg--q { border: var(--st-b); }
.msg--a { border-left: var(--st-b-lg); }
.thinking__text { font-weight: 800; }
.thinking__lines i { background: var(--ink); }

/* ---------- Вхід і реєстрація ---------- */
.auth__aside { background: var(--blue); color: #fff; border-right: var(--st-b-lg); }
.auth__aside-title, .auth__aside-kicker, .auth__aside p, .auth__aside li { color: #fff; }
.auth__aside-inner .auth__note { background: #fff; color: var(--ink); border: var(--st-b-lg); box-shadow: var(--shadow-print); }
.auth__note * { color: var(--ink); }
.auth__note-line { background: #fff !important; }
.auth__note-n { background: var(--st-yellow); border-color: var(--ink); }
.auth__note-answer { background: var(--st-green) !important; }
.auth__aside, .auth__aside-inner { background-image: none; border: 0; box-shadow: none; }
.auth__aside { outline: 0; margin: 0; }
.auth__main { background: var(--st-yellow); }
.auth__card { background: #fff; border: var(--st-b-lg); box-shadow: var(--shadow-print); padding: clamp(20px, 4vw, 32px); }
.auth__bonus { background: var(--st-pink); color: var(--ink); border: var(--st-b); }
.btn--oauth { background: #fff; color: var(--ink); }
.auth__subtitle, .auth__foot, .auth__links { color: var(--ink); }

/* Документи */
.legal, .legal__body { background: #fff; }

@media (max-width: 640px) {
  .plan--popular { transform: none; }
  .btn--lg { width: 100%; }
  .hero__actions { display: grid; }
  .site-header__inner { gap: 10px; }
  .site-header .brand__name { font-size: 0.92rem; }
  .site-header .btn { padding-inline: 12px; }
  .nav-toggle { flex: none; width: 44px; }
  /* На телефоні кнопка «Розв’язати» має бути близько до камери */
  .drop { padding: 14px; }
  .drop__icon, .drop__sub { display: none; }
  .solve__title { font-size: 1.25rem; }
  .solve__go { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 5; background: #fff; padding-block: 8px 2px; }
  .solve__text textarea.input { min-height: 72px; }
  .examples { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .examples__label { display: none; }
  .examples__chip { flex: none; }
  .pack__name { font-size: 1rem; }
  .step, .bento__card, .review, .plan, .final__card, .panel, .solve__sheet, .sheet, .cond, .task-card, .balance-card, .pack { box-shadow: 4px 4px 0 var(--ink); }
}
/* Вузька шапка: лишаємо знак, щоб кнопка й меню вмістилися */
@media (max-width: 430px) { .site-header .brand__name { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Розв’язок не має розпирати сторінку: формули гортаються всередині себе */
.task, .task__grid > *, .sheet, .sheet__body, .ask, .ask__row, .thread, .msg { min-width: 0; max-width: 100%; }
.ask__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ask__quick .examples__chip { max-width: 100%; white-space: normal; text-align: left; }
.sol .katex-display { overflow-x: auto; overflow-y: hidden; }
.app-tabbar a { min-width: 0; text-align: center; line-height: 1.15; }
@media (max-width: 640px) {
  .task__grid { grid-template-columns: minmax(0, 1fr); }
  .sheet__body { padding: 16px 14px; }
  [data-ask], [data-thread] { padding-inline: 14px; }
  .sol .answer { font-size: 1.05rem; padding: 12px; }
}
@media (max-width: 400px) { .app-tabbar a { font-size: 0.72rem; padding-inline: 2px; } }
/* Довгі українські слова в широкому шрифті не мають виходити за край */
.legal__doc h1, .task__title, .auth__title { overflow-wrap: break-word; }
@media (max-width: 400px) { .legal__doc h1 { hyphens: auto; } }
.legal__doc h1 { font-size: clamp(1.5rem, 1rem + 3vw, 2.6rem); }
@media (max-width: 640px) {
  .legal__doc nav a, .legal__doc li a, .legal__toc a { display: inline-block; padding-block: 7px; }
}

/* ---------- Шапка: знак-наліпка і панель із комірок на всю ширину ---------- */
.brand { gap: 0; }
.brand__word { display: inline-flex; align-items: center; gap: 0.3em; font-family: var(--font-display); font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.65rem); line-height: 1; color: var(--ink); }
.brand__ai { padding: 0.16em 0.26em 0.2em; background: var(--blue); color: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); rotate: -5deg; transition: rotate 180ms var(--ease-out); }
.brand__solver { display: inline-flex; }
.brand__solver i { display: block; font-style: normal; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .brand:hover .brand__ai { rotate: 4deg; }
  .brand:hover .brand__solver i { animation: brand-hop 420ms var(--ease-out) calc(var(--i) * 45ms); }
}
@keyframes brand-hop { 40% { transform: translateY(-0.28em) rotate(-6deg); } }

.site-header > .wrap { width: 100%; max-width: none; margin: 0; padding-left: var(--gutter); }
.site-header__inner { gap: 0; height: calc(var(--header-h) - 4px); align-items: stretch; }
.site-header .brand { align-self: center; margin-right: auto; }
.site-nav { align-self: stretch; margin-left: 0; gap: 0; }
.site-nav a, .site-header__login {
  --fill: var(--st-yellow);
  display: flex; align-items: center; padding: 0 clamp(14px, 1.7vw, 28px); border-left: var(--st-b-lg); color: var(--ink);
  font-family: var(--font-display); font-weight: 400; font-size: clamp(0.82rem, 0.72rem + 0.25vw, 1rem); white-space: nowrap;
  background: linear-gradient(var(--fill), var(--fill)) bottom / 100% 0 no-repeat; transition: background-size 150ms var(--ease-out);
}
.site-nav a:nth-child(2) { --fill: var(--st-pink); }
.site-nav a:nth-child(3) { --fill: var(--st-green); }
.site-nav a:nth-child(4) { --fill: #b9c6ff; }
@media (hover: hover) { .site-nav a:hover, .site-header__login:hover { background-color: transparent; background-size: 100% 100%; color: var(--ink); } }
.site-nav a:focus-visible, .site-header__login:focus-visible, .nav-toggle:focus-visible { outline-offset: -6px; }
.site-header__actions { align-self: stretch; gap: 0; margin: 0; }
.site-header__actions .btn { height: 100%; min-height: 0; padding-inline: clamp(14px, 2vw, 32px); border: 0; border-left: var(--st-b-lg); box-shadow: none; font-family: var(--font-display); font-weight: 400; font-size: clamp(0.82rem, 0.72rem + 0.25vw, 1rem); }
.site-header__actions .btn:active:not(:disabled) { transform: none; box-shadow: none; background: var(--ink); }
.site-header__actions .site-header__login { height: 100%; border-radius: 0; padding-block: 0; text-decoration: none; }
.site-nav a, .site-header__login, .site-header__actions .btn { -webkit-tap-highlight-color: transparent; }
.site-nav a:active, .site-header__login:active { background-size: 100% 100%; box-shadow: inset 0 -6px 0 var(--ink); }
.site-nav a[aria-current="true"] { background-size: 100% 100%; box-shadow: inset 0 -6px 0 var(--ink); }
@media (hover: hover) { .site-header__actions .btn:hover { background: var(--st-pink); color: var(--ink); } }
.site-header__actions .btn:active:not(:disabled) { background: var(--ink); color: #fff; }
.nav-toggle { align-self: stretch; width: 60px; height: auto; flex: none; border: 0; border-left: var(--st-b-lg); background: var(--st-yellow); }
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle[aria-expanded="true"] { background: var(--st-pink); }
@media (max-width: 960px) {
  .mobile-nav { padding: 0; background: var(--ink); border-top: var(--st-b-lg); box-shadow: none; }
  .mobile-nav a { padding: 16px var(--gutter); border-bottom: var(--st-b-lg); background: var(--st-yellow); color: var(--ink); font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }
  .mobile-nav a:nth-child(2) { background: var(--st-pink); }
  .mobile-nav a:nth-child(3) { background: var(--st-green); }
  .mobile-nav a:nth-child(4) { background: #b9c6ff; }
  .mobile-nav a:nth-child(5) { background: #fff; }
}
@media (max-width: 420px) {
  .app-top__brand .brand__solver { display: none; }
  .site-header__actions .btn { padding-inline: 10px; }
  .nav-toggle { width: 50px; }
}

/* ---------- Кабінет як чат: історія зліва, одне поле вводу ---------- */
.page-app { background: #fff8dc; }
.app { grid-template-columns: 280px minmax(0, 1fr); }
.app-tabbar { display: none !important; }
.app-side { gap: 12px; padding: 14px 12px; }
.app-side .brand { padding: 6px 8px 10px; }
.new-task { display: flex; align-items: center; justify-content: center; min-height: 48px; background: var(--blue); color: #fff; border: var(--st-b); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 0.95rem; transition: transform 90ms var(--ease-out), box-shadow 90ms var(--ease-out); }
.new-task:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.chat-search { width: 100%; min-height: 40px; padding: 6px 10px; background: #fff8dc; border: 2px solid var(--ink); font-size: 16px; }
.chats { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 1px; margin-inline: -4px; padding-inline: 4px; }
.chats a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats a[aria-current="page"] { background: var(--st-yellow); box-shadow: inset 0 0 0 2px var(--ink); }
@media (hover: hover) { .chats a:not([aria-current]):hover { background: #fff3b8; } }
.chats__label { padding: 12px 10px 4px; font-size: 0.8rem; font-weight: 800; color: var(--ink-3); }
.chats__empty { padding: 10px; font-size: 0.9rem; color: var(--ink-3); }
.chats a.chats__all { margin-top: 6px; color: var(--blue-deep); font-weight: 800; }
.chats__busy { flex: none; width: 9px; height: 9px; background: var(--st-pink); border: 2px solid var(--ink); margin-left: auto; }
.app-side__foot { margin-top: 0; gap: 6px; }
.side-balance { padding: 10px; }
.side-balance__value { margin-bottom: 6px; }
.app-nav a { min-height: 40px; }
.app-side__link { padding: 6px 12px; }
.demo-note { display: none; }
.app-burger { display: none; }
.app-top { min-height: 60px; background: transparent; border-bottom: 0; position: static; }
.app-top__title { display: none; }
.user-menu { flex: none; }
.balance-chip { margin-left: auto; }
.app-view { padding: 0 clamp(14px, 3vw, 32px) 32px; }
.app-side, .app-top .balance-chip, .avatar { box-shadow: none; }

/* Нове завдання */
.home { width: min(100%, 780px); min-height: calc(100dvh - 120px); margin-inline: auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-bottom: 6vh; }
.home__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 1.1rem + 2.4vw, 3rem); line-height: 1.15; text-align: center; margin-bottom: 8px; text-wrap: balance; }
.composer { display: grid; gap: 6px; padding: 12px; background: #fff; border: var(--st-b-lg); box-shadow: var(--shadow-print); transition: background-color 120ms ease; }
.composer.drop--over { background: #ffe0ec; }
.composer .shots { margin: 0 0 4px; }
.composer__input { width: 100%; min-height: 34px; max-height: 240px; padding: 6px; border: 0; outline: 0; background: none; resize: none; font-size: 1.1rem; line-height: 1.45; }
.composer__input::placeholder { color: #5e5a50; }
.composer__hint { padding-inline: 6px; font-size: 0.84rem; color: var(--ink-3); }
.composer__bar { display: flex; align-items: center; gap: 8px; }
.composer__tool { display: grid; place-items: center; width: 44px; height: 44px; border: var(--st-b); background: var(--st-yellow); cursor: pointer; }
.composer__tool svg { width: 22px; height: 22px; }
@media (hover: hover) { .composer__tool:hover { background: var(--st-pink); } }
.composer input:focus-visible + input + ul + label + textarea { outline: 0; }
.composer__grade { height: 44px; padding: 0 8px; border: var(--st-b); background: #fff; font-weight: 700; font-size: 16px; max-width: 130px; }
.composer__send { display: grid; place-items: center; width: 52px; height: 44px; margin-left: auto; padding: 0; background: var(--blue); color: #fff; border: var(--st-b); box-shadow: 3px 3px 0 var(--ink); }
.composer__send svg { width: 22px; height: 22px; }
.composer__send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.composer__send:disabled { opacity: 0.6; }
.composer .drop__camera { display: grid; }
@media (hover: hover) and (pointer: fine) { .composer .drop__camera { display: none; } }
.home__cost { text-align: center; font-size: 0.88rem; }
.home .modes, .home .subjects { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.home .mode, .home .subj { width: auto; min-height: 38px; padding: 4px 12px; border-width: 2px; font-size: 0.9rem; }
.home .mode__name { font-size: inherit; }
.home .examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.home .examples__chip { border-width: 2px; background: none; font-weight: 600; font-size: 0.85rem; }

/* Розв’язок: стрічка діалогу й поле внизу */
body[data-screen="task"] .app-view { padding-bottom: 0; }
.task { width: min(100%, 820px); margin-inline: auto; }
.task__head { margin-bottom: 4px; }
.task__back { display: none; }
.task__actions { margin-left: auto; }
.task__actions .btn--primary { display: none; }
.task__title { font-size: clamp(1.15rem, 1rem + 0.9vw, 1.7rem); }
.task__grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
.cond { position: static; transform: none; justify-self: end; width: fit-content; max-width: min(86%, 560px); padding: 10px 14px; background: var(--st-yellow); border: var(--st-b); box-shadow: 4px 4px 0 var(--ink); rotate: none; }
.cond__label { display: none; }
.sheet { background: none; border: 0; box-shadow: none; padding: 0; overflow: visible; }
.sheet::before, .sheet::after { display: none; }
.sheet__body { padding: 0 !important; background: none; }
[data-ask], [data-thread] { padding-inline: 0 !important; }
.thread { border-top: 0; padding-top: 0; margin-top: 18px; display: grid; gap: 14px; }
.msg--q { justify-self: end; width: fit-content; max-width: 86%; padding: 10px 14px; box-shadow: 4px 4px 0 var(--ink); }
.msg--a { border-left: 0; padding-left: 0; background: none; }
[data-ask] { position: sticky; bottom: 0; z-index: 6; padding-block: 10px 14px; background: linear-gradient(transparent, #fff8dc 18px); }
.ask { margin: 0; padding: 0; border: 0; gap: 8px; }
.ask__label { display: none; }
.ask__quick { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 !important; padding: 2px 0 !important; }
.ask__quick .examples__chip { flex: none; white-space: nowrap !important; border-width: 2px; font-size: 0.82rem; }
.ask__row { padding: 8px; background: #fff; border: var(--st-b-lg); box-shadow: var(--shadow-sticker); align-items: center; }
.ask__input { height: 44px; min-height: 40px; max-height: 120px; resize: none; border: 0 !important; box-shadow: none !important; padding: 6px; background: none; }
.ask__send { --btn-h: 42px; width: 48px; box-shadow: 3px 3px 0 var(--ink); }
.ask__left { font-size: 0.78rem; text-align: center; color: var(--ink-3); }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(84vw, 320px); height: 100dvh; border-right: var(--st-b-lg); transform: translateX(-104%); transition: transform 200ms var(--ease-out); }
  .drawer-open .app-side { transform: none; }
  .app-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(16, 16, 16, 0.5); }
  .app-burger { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; background: #fff; border: var(--st-b); }
  .app-burger svg { width: 24px; height: 24px; }
  .app-top { padding: 8px 12px; position: sticky; top: 0; background: #fff8dc; }
  .app-top__brand { display: inline-flex; margin-right: auto; }
  .home { min-height: calc(100dvh - 90px); justify-content: flex-end; padding-bottom: 14px; }
  .home__title { margin-bottom: auto; padding-top: 12vh; }
  .home .modes, .home .subjects, .home .examples { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .home .mode, .home .subj, .home .examples__chip { flex: none; white-space: nowrap; }
  .home .composer { order: 9; }
  .home .form-alert { order: 9; }
  .home__cost { order: 10; }
  .home .examples { display: none; }
}

/* =========================================================
   Вхід і реєстрація: жовтий стіл із карткою-наліпкою ліворуч,
   синя панель із живим розв'язком праворуч
   ========================================================= */
.page-auth .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.page-auth .auth__main {
  background-color: var(--st-yellow);
  background-image: linear-gradient(rgba(16,16,16,.07) 2px, transparent 2px), linear-gradient(90deg, rgba(16,16,16,.07) 2px, transparent 2px);
  background-size: 44px 44px;
}
.page-auth .auth__back { padding: 8px 14px; border: var(--st-b); background: #fff; color: var(--ink); font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
@media (hover: hover) { .page-auth .auth__back:hover { background: var(--st-pink); } }
.page-auth .auth__back:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.page-auth .auth__card { position: relative; width: min(100%, 440px); margin-block: clamp(40px, 8vh, 80px); padding: clamp(26px, 4vw, 38px); box-shadow: 10px 10px 0 var(--ink); animation: sa-drop 520ms cubic-bezier(.2,1.4,.4,1) both; }
.page-auth .auth__card::before {
  content: attr(data-tab); position: absolute; top: -20px; left: 20px; padding: 6px 12px;
  background: var(--st-pink); border: var(--st-b); box-shadow: 3px 3px 0 var(--ink); rotate: -4deg;
  font-family: var(--font-display); font-size: .85rem; color: var(--ink);
}
.page-auth .auth__card:not([data-tab])::before { display: none; }
.page-auth .auth__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 1.3rem + 1vw, 2.15rem); letter-spacing: -.01em; text-wrap: balance; line-height: 1.05; }
.page-auth .auth__subtitle { font-size: 1rem; }
.page-auth .auth__subtitle a, .page-auth .auth__links a { color: var(--ink); background: linear-gradient(var(--st-yellow), var(--st-yellow)) 0 88% / 100% .45em no-repeat; text-decoration: none; }
@media (hover: hover) { .page-auth .auth__subtitle a:hover, .page-auth .auth__links a:hover { background-size: 100% 100%; } }
.page-auth .auth__bonus { rotate: -1deg; box-shadow: 3px 3px 0 var(--ink); }
.page-auth .field__label { font-weight: 800; }
.page-auth .input { border: var(--st-b); border-radius: 0; background: #fff; min-height: 52px; transition: background-color 120ms, box-shadow 120ms; }
.page-auth .input:focus { outline: 0; background: #fffbe0; box-shadow: 4px 4px 0 var(--blue); }
.page-auth .auth__form .btn--primary { min-height: 58px; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; box-shadow: 5px 5px 0 var(--ink); }
.page-auth .auth__form .btn--primary:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.page-auth .auth__foot { padding: 8px 12px; background: #fff; border: var(--st-b); width: fit-content; }
@keyframes sa-drop { from { opacity: 0; transform: translateY(-24px) rotate(-3deg); } }

/* Права панель */
.page-auth .sa { display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 5vh, 48px); place-items: stretch; padding: clamp(36px, 5vw, 72px) 0 0; background: var(--blue); border-left: var(--st-b-lg); overflow: hidden; }
.sa__kicker { padding-inline: clamp(32px, 5vw, 72px); font-family: var(--font-display); font-size: clamp(2rem, 1.2rem + 2.4vw, 3.6rem); line-height: 1.02; color: #fff; }
.sa__kicker mark { display: inline-block; margin-top: 8px; padding: 0 .2em; background: var(--st-yellow); color: var(--ink); border: var(--st-b-lg); box-shadow: 6px 6px 0 var(--ink); rotate: -2deg; }
.sa__desk { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; padding-inline: clamp(32px, 5vw, 72px); }
.sa__task { position: relative; overflow: hidden; padding: 20px; background: #fff; border: var(--st-b-lg); box-shadow: 8px 8px 0 var(--ink); rotate: -3deg; }
.sa__task p { margin-top: 14px; font-family: var(--font-display); font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); color: var(--ink); }
.sa__tag { display: inline-block; padding: 3px 8px; background: var(--st-pink); border: var(--st-b); font-weight: 800; font-size: .8rem; color: var(--ink); }
.sa__scan { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--blue); opacity: .85; animation: sa-scan 2.4s ease-in-out infinite; }
.sa__steps { display: grid; gap: 10px; }
.sa__steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: var(--st-b); box-shadow: 4px 4px 0 var(--ink); font-weight: 750; color: var(--ink); animation: sa-s1 7s infinite both; }
.sa__steps li b { display: grid; place-items: center; width: 26px; height: 26px; background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 400; }
.sa__steps li:nth-child(2) { animation-name: sa-s2; }
.sa__steps .sa__answer { background: var(--st-green); font-family: var(--font-display); font-weight: 400; rotate: 1.5deg; animation-name: sa-s3; }
.sa__sticker { position: absolute; padding: 6px 12px; border: var(--st-b); box-shadow: 3px 3px 0 var(--ink); font-family: var(--font-display); font-size: .82rem; color: var(--ink); animation: sa-bob 4s ease-in-out infinite; }
.sa__sticker--pink { left: calc(clamp(32px, 5vw, 72px) - 10px); bottom: -34px; background: var(--st-pink); rotate: 4deg; }
.sa__sticker--green { right: clamp(20px, 3vw, 48px); top: -38px; background: var(--st-yellow); rotate: -5deg; animation-delay: -2s; }
.sa__belt { margin-top: auto; border-top: var(--st-b-lg); background: var(--st-yellow); overflow: hidden; }
.sa__track { display: flex; width: max-content; animation: sa-belt 26s linear infinite; }
.sa__track span { padding: 14px 22px; border-right: var(--st-b); font-family: var(--font-display); font-size: .95rem; color: var(--ink); }
.sa__track span:nth-child(3n+2) { background: var(--st-pink); }
.sa__track span:nth-child(3n) { background: #fff; }
@keyframes sa-scan { 50% { top: calc(100% - 6px); } }
@keyframes sa-s1 { 0%, 6% { opacity: 0; transform: translateX(24px); } 12%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateX(-12px); } }
@keyframes sa-s2 { 0%, 18% { opacity: 0; transform: translateX(24px); } 24%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateX(-12px); } }
@keyframes sa-s3 { 0%, 30% { opacity: 0; transform: scale(.6); } 36%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateX(-12px); } }
@keyframes sa-bob { 50% { translate: 0 -6px; } }
@keyframes sa-belt { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sa *, .page-auth .auth__card { animation: none !important; } }
@media (max-width: 1180px) { .sa__desk { grid-template-columns: 1fr; } .sa__sticker--pink { bottom: -30px; } }
@media (max-width: 960px) {
  .page-auth .auth { grid-template-columns: 1fr; }
  .page-auth .auth__aside { display: none; }
  .page-auth .auth__card { box-shadow: 7px 7px 0 var(--ink); }
}
