/* =========================================================
   Базова система: шрифти, токени, типографіка, кнопки, форми,
   шапка й підвал сайту. Підключається на всіх сторінках.

   Ідея: шкільний зошит. Кремовий папір у клітинку, фіолетове «чорнило»
   для дій, жовтий маркер для головного, зелена шкільна дошка як один
   сміливий блок, рукописні нотатки на полях (Caveat) — як у відмінника.
   ========================================================= */

/* ---------- Шрифти (локально, з @fontsource-variable) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-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: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-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: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/onest-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: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/onest-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: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/onest-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/caveat-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: "Caveat"; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/caveat-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: "Caveat"; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/caveat-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Токени ---------- */
:root {
  /* Палітра. Назви --blue* лишилися від основи: це «чорнило» — головний колір дій */
  --blue: #4b3df0;        /* фіолетове чорнило: кнопки, вибране (з білим 6,1:1) */
  --blue-deep: #2e22b0;   /* натиснуті стани, текст на світлому фіолетовому */
  --blue-tint: #edeaff;
  --blue-line: #d4cdff;
  --marker: #ffe14a;      /* жовтий маркер: головне на сторінці */
  --marker-soft: #fff4b8;
  --red-pen: #e5484d;     /* червона ручка вчителя */
  --board: #17392f;       /* шкільна дошка */
  --board-2: #1f4a3d;
  --chalk: #f4f1e6;
  --mint: #2fae79;

  --ink: #1d1b2e;         /* текст */
  --ink-2: #4c4860;       /* другорядний текст (8:1 на папері) */
  --ink-3: #6b6680;       /* підказки (5:1 на папері) */
  --paper: #ffffff;       /* аркуш: картки, поля */
  --page: #fbf8f0;        /* тло сторінки: кремовий зошит */
  --studio: #f3efe3;      /* тихе тло блоків */
  --studio-2: #e9e3d2;
  --line: #e6dfcc;
  --line-strong: #cfc6ae;
  --grid-line: rgba(75, 61, 240, 0.075);

  --ok: #11734e;
  --ok-tint: #dcf3e7;
  --warn: #8a5300;
  --warn-tint: #fdf0d2;
  --danger: #b4232c;
  --danger-tint: #fde6e6;

  /* Старі назви, якими ще користуються сторінки */
  --primary: var(--blue);
  --primary-hover: var(--blue-deep);
  --primary-text: var(--blue);
  --primary-soft: var(--blue-tint);
  --primary-soft-2: var(--blue-line);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --card: var(--paper);
  --paper-2: #fdfbf6;

  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Print", cursive;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Радіуси за ієрархією: дрібні елементи керування → кнопки → блоки */
  --r-xs: 6px;
  --r-s: 10px;
  --r-btn: 14px;
  --r-m: 16px;
  --r-l: 22px;
  --r-pill: 999px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 120px);
  --header-h: 68px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-print: 0 1px 1px rgba(29, 27, 46, 0.06), 0 10px 26px -12px rgba(29, 27, 46, 0.3);
  --shadow-float: 0 2px 6px rgba(29, 27, 46, 0.07), 0 24px 56px -20px rgba(29, 27, 46, 0.38);
  /* «Наліпка»: жорстка тінь, як у вирізаного з паперу */
  --shadow-sticker: 3px 3px 0 var(--ink);

  color-scheme: light;
  accent-color: var(--blue);
}

/* Папір у клітинку (5 мм ≈ 22 px) */
.paper-grid {
  background-color: var(--page);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
/* ---------- Скидання ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(h1, h2, h3, h4, p, figure, blockquote, dl, dd) { margin: 0; }
:where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--marker); color: var(--ink); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r-xs); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-s);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографіка ---------- */
.h1, .h2, .display {
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}
.h1 { font-size: clamp(2.2rem, 1.4rem + 2.8vw, 3.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.h2 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.75rem); line-height: 1.08; letter-spacing: -0.03em; }
.h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 750; letter-spacing: -0.01em; text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.18rem); line-height: 1.6; color: var(--ink-2); max-width: 34em; }
.muted { color: var(--ink-2); }
/* Цифри однакової ширини — для лічильників і сум, що змінюються */
.mono { font-variant-numeric: tabular-nums; }
p { text-wrap: pretty; }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
  --btn-h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-weight: 700; font-size: 0.97rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: scale(0.97); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn--sm { --btn-h: 40px; padding: 0 16px; font-size: 0.92rem; }
.btn--lg { --btn-h: 54px; padding: 0 28px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--soft { background: var(--blue-tint); color: var(--blue-deep); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
/* Кнопки на синьому тлі */
.btn--on-blue { background: var(--paper); color: var(--blue-deep); }
.btn--ghost-dark { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
/* Жовтий маркер: головна дія на сторінці */
.btn--marker { background: var(--marker); color: var(--ink); border-color: var(--ink); box-shadow: var(--shadow-sticker); }
.btn--marker:active:not(:disabled) { box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }
.btn--quiet { background: transparent; color: var(--ink-2); padding-inline: 12px; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--blue-deep); }
  .btn--dark:hover { background: #26304a; }
  .btn--light:hover, .btn--ghost:hover { border-color: var(--ink); }
  .btn--soft:hover { background: var(--blue-line); }
  .btn--on-blue:hover { background: var(--blue-tint); }
  .btn--ghost-dark:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
  .btn--danger:hover { background: #8f1a21; }
  .btn--marker:hover { background: #ffd914; }
  .btn--quiet:hover { color: var(--ink); background: var(--studio); }
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; }

/* Текстове посилання-дія */
.link { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) { .link:hover { color: var(--blue-deep); } }

.spinner {
  width: 22px; height: 22px; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Форми ---------- */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 18px; }
.field__label { font-weight: 700; font-size: 0.92rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__hint { font-size: 0.85rem; color: var(--ink-3); font-weight: 500; }
.field__error { font-size: 0.86rem; color: var(--danger); font-weight: 600; }
.field__error:empty { display: none; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--paper);
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.input { min-height: 92px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #8b92a0; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(75, 61, 240, 0.2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 44, 0.15); }
@media (hover: hover) { .input:hover:not(:focus) { border-color: var(--ink-3); } }
@media (forced-colors: active) { .input:focus { outline: 2px solid Highlight; } }
.input--with-btn { padding-right: 52px; }
.input-wrap { position: relative; }
.input-wrap__btn {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
}
@media (hover: hover) { .input-wrap__btn:hover { color: var(--ink); background: var(--studio); } }
.input-wrap__btn svg { width: 20px; height: 20px; }
.input-wrap__btn .icon-eye-off { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon-eye { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon-eye-off { display: block; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; cursor: pointer; }
.check a { color: var(--ink); }

.form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-s);
  font-size: 0.92rem; line-height: 1.45; font-weight: 600;
}
.form-alert:empty { display: none; }
.form-alert--error { background: var(--danger-tint); color: var(--danger); }
.form-alert--ok { background: var(--ok-tint); color: var(--ok); }
.form-alert--info { background: var(--blue-tint); color: var(--blue-deep); }
.form-alert a { color: inherit; font-weight: 800; }

/* Сегментовані перемикачі (radio) */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-s);
  background: var(--paper); font-weight: 650; font-size: 0.92rem; cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
@media (hover: hover) { .segmented label:hover { border-color: var(--ink); } }
.segmented input:checked + label { background: var(--blue); border-color: var(--blue); color: #fff; }
.segmented input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Назва сервісу (текстовий знак замість іконки) ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; border-radius: var(--r-xs); }
.brand { gap: 10px; }
.brand__logo { display: block; width: 34px; height: 34px; flex: none; transition: transform 300ms var(--ease-out); }
.brand__logo svg { width: 100%; height: 100%; }
@media (hover: hover) { .brand:hover .brand__logo { transform: rotate(-8deg); } }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
@media (max-width: 360px) { .site-header .brand__name { font-size: 0.98rem; } }

/* ---------- Шапка сайту ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header[data-scrolled] { border-bottom-color: var(--line); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a {
  padding: 8px 12px; border-radius: var(--r-s);
  text-decoration: none; font-weight: 600; font-size: 0.94rem; color: var(--ink-2);
  transition: color 150ms ease;
}
@media (hover: hover) { .site-nav a:hover { color: var(--ink); } }
.site-header__actions { display: flex; align-items: center; gap: 6px; }
.site-header__login { padding: 8px 12px; font-weight: 700; font-size: 0.94rem; text-decoration: none; border-radius: var(--r-s); }
@media (hover: hover) { .site-header__login:hover { color: var(--blue); } }
.nav-toggle {
  display: none;
  width: 44px; height: 44px; margin-left: auto;
  place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--paper);
}
.nav-toggle svg { width: 20px; height: 20px; }
.mobile-nav { display: none; }

@media (max-width: 960px) {
  .site-nav, .site-header__actions .site-header__login { display: none; }
  .site-header__actions { margin-left: auto; }
  .nav-toggle { display: grid; margin-left: 0; }
  .mobile-nav {
    display: block;
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
    padding: 4px var(--gutter) 20px;
    background: var(--page);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(29, 27, 46, 0.4);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
  .mobile-nav a:last-child { border-bottom: 0; }
}
.site-header__cta-short { display: none; }
@media (max-width: 480px) {
  .site-header__inner { gap: 12px; }
  .site-header__actions .btn { padding-inline: 14px; }
  .site-header__cta-long { display: none; }
  .site-header__cta-short { display: inline; }
}

/* ---------- Підвал ---------- */
.site-footer { padding: 56px 0 36px; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-size: 0.94rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.site-footer__brand p { margin-top: 12px; max-width: 26ch; }
.site-footer h2 { font-family: var(--font-body); font-size: 0.92rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; color: var(--ink-2); font-weight: 600; }
@media (hover: hover) { .site-footer a:hover { color: var(--blue); } }
.site-footer__bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Сповіщення (toasts) ---------- */
.toasts {
  position: fixed; z-index: 200; left: 50%; bottom: 24px; translate: -50% 0;
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-m);
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-float);
  font-weight: 600; font-size: 0.94rem; line-height: 1.4;
  animation: toast-in 300ms var(--ease-out);
}
.toast--error { background: #5c1418; }
.toast__icon { flex: none; width: 20px; height: 20px; }
.toast[data-leaving] { animation: toast-out 200ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; } }

/* ---------- Діалоги ---------- */
dialog.modal {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0; border-radius: var(--r-l);
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-float);
}
dialog.modal::backdrop { background: rgba(29, 27, 46, 0.5); }
dialog.modal[open] { animation: modal-in 220ms var(--ease-out); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal__body { padding: 28px; }
.modal__title { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 10px; }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-2);
}
@media (hover: hover) { .modal__close:hover { background: var(--studio); color: var(--ink); } }
.modal__close svg { width: 20px; height: 20px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Швидкий вхід у режимі розробки (лише localhost) ---------- */
.dev-login {
  position: fixed; z-index: 250; top: 16px; right: 16px;
  width: min(340px, calc(100% - 32px));
  padding: 16px 18px;
  border-radius: 16px;
  background: #111317; color: #f4f4f5;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  font: 500 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dev-login__title { font-weight: 750; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #ffb347; }
.dev-login__text { margin-top: 6px; color: rgba(255, 255, 255, 0.72); }
.dev-login__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dev-login .btn { font-family: inherit; letter-spacing: 0; text-transform: none; box-shadow: none; border: 0; }
.dev-login .btn--primary { background: var(--marker); color: #111; }
.dev-login .btn--light { background: #fff; color: #111; }
@media (max-width: 600px) { .dev-login { top: auto; bottom: 90px; right: 16px; } }

/* ---------- Баланс задач (public/js/token.js) ----------
   Квадратик-клітинка з галочкою; колір залежить від запасу: порожньо → трішки → запас → відмінник. */
.token { --t-bg: var(--blue); --t-fg: #fff; flex: none; overflow: visible; }
.token--s { width: 18px; height: 18px; }
.token--m { width: 28px; height: 28px; }
.token--l { width: 64px; height: 64px; }
.token__box { fill: var(--t-bg); }
.token__tick { fill: none; stroke: var(--t-fg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 0; }
.token[data-level="out"] { --t-bg: #c9c3b3; }
.token[data-level="low"] { --t-bg: #f08a24; }
.token[data-level="ok"] { --t-bg: var(--blue); }
.token[data-level="lots"] { --t-bg: var(--mint); }
.token[data-level="max"] { --t-bg: var(--ink); --t-fg: var(--marker); }
@media (prefers-reduced-motion: no-preference) {
  [data-burst="spend"] .token { animation: token-spend 0.7s var(--ease-out); }
  [data-burst="gain"] .token { animation: token-gain 0.8s var(--ease-out); }
  [data-burst="gain"] .token__tick { animation: token-tick 0.6s 0.1s var(--ease-out) backwards; }
}
@keyframes token-spend { 30% { transform: translateY(-3px) rotate(-8deg) scale(0.9); } }
@keyframes token-gain { 35% { transform: scale(1.35) rotate(6deg); } }
@keyframes token-tick { from { stroke-dashoffset: 16; } }

/* Маркер під словом */
.hl { background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%); padding: 0 0.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* Рукописна нотатка на полях */
.hand { font-family: var(--font-hand); font-weight: 600; letter-spacing: 0; }
/* Менше руху: прибираємо зсуви, лишаємо зміну прозорості */
@media (prefers-reduced-motion: reduce) {
  .toast, dialog.modal[open] { animation-name: fade-in; }
  .btn:active:not(:disabled, [aria-disabled="true"]) { transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
