/* =========================================================
   Базова система: шрифти, токени, типографіка, кнопки, форми,
   шапка й підвал сайту. Підключається на всіх сторінках.

   Ідея: «Clay» — сайт ніби виліплений із пластиліну. Одна тепла пісочна
   поверхня, з якої картки випирають (світло зліва згори, тінь справа знизу),
   поля вдавлені всередину, кнопки — пухкі кольорові кульки. Пастельні фарби
   розрізняють предмети, округлий Nunito для всього тексту, рукописні нотатки
   (Caveat) — як підказки на шпаргалці.
   ========================================================= */

/* ---------- Шрифти (локально, з @fontsource-variable) ---------- */
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(/fonts/nunito-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: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(/fonts/nunito-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: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(/fonts/nunito-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 {
  /* Поверхня, з якої все виліплено. Картки й сторінка одного кольору — об'єм дають тіні */
  --surface: #f5ede6;
  --surface-2: #ede2d8;   /* тихі підкладки, вдавлені місця */
  --surface-3: #e3d5c8;   /* наведення */

  /* Головна фарба — бірюзова кулька. Назви --blue* лишилися від основи */
  --blue: #0e8577;        /* кнопки, вибране (з білим ≈ 4,6:1) */
  --blue-deep: #0a5f55;   /* натиснуте, бірюзовий текст і посилання */
  --blue-tint: #cdebe5;
  --blue-line: #a9dbd2;
  --marker: #ff9f5a;      /* мандаринова кулька: головне на сторінці. Лише заливка, не текст */
  --marker-soft: #ffe0c4;
  --red-pen: #ff6b6b;     /* «червона ручка» — помилки в перевірці */
  --pink: #ffa3b5;
  --peach: #ffd25e;      /* соняшникова */
  --sky: #8ccfff;
  --mint: #8fdcb5;
  --mint-ink: #17795a;
  /* «Дошка» — темний пластилін */
  --board: #23404a;
  --board-2: #2f5360;
  --chalk: #f6f0ea;

  --ink: #2e2925;         /* текст */
  --ink-2: #5b5149;       /* другорядний (≈ 6,9:1 на поверхні) */
  --ink-3: #6f645a;       /* підказки (≈ 4,8:1) */
  --paper: var(--surface);
  --page: var(--surface);
  --studio: var(--surface-2);
  --studio-2: var(--surface-3);
  --line: rgba(46, 41, 37, 0.1);
  --line-strong: rgba(46, 41, 37, 0.22);
  --grid-line: transparent;

  --ok: #17795a;
  --ok-tint: rgba(79, 209, 165, 0.22);
  --warn: #8a5300;
  --warn-tint: rgba(255, 190, 70, 0.26);
  --danger: #c0283f;
  --danger-tint: rgba(255, 107, 107, 0.16);

  /* Старі назви, якими ще користуються сторінки */
  --primary: var(--blue);
  --primary-hover: var(--blue-deep);
  --primary-text: var(--blue-deep);
  --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(--surface);
  --paper-2: var(--surface-2);

  --font-display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Nunito", 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: 10px;
  --r-s: 14px;
  --r-btn: 999px;
  --r-m: 20px;
  --r-l: 28px;
  --r-xl: 40px;
  --r-pill: 999px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 120px);
  --header-h: 68px;

  /* Ліплення: світло падає зліва згори.
     --lift — картка випирає, --press — вдавлена (поля, натиснуте),
     --clay — об'єм кольорової кульки (кнопки, значки) */
  --hi: #ffffff;
  --lo: #d9c8b9;
  --lift: 12px 12px 28px var(--lo), -12px -12px 28px var(--hi);
  --lift-s: 6px 6px 14px var(--lo), -6px -6px 14px var(--hi);
  --press: inset 6px 6px 12px var(--lo), inset -6px -6px 12px var(--hi);
  --press-s: inset 3px 3px 7px var(--lo), inset -3px -3px 7px var(--hi);
  --clay: inset -5px -7px 12px rgba(0, 0, 0, 0.16), inset 5px 7px 12px rgba(255, 255, 255, 0.45);
  --clay-down: inset 4px 6px 12px rgba(0, 0, 0, 0.22);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-snap: cubic-bezier(0.34, 1.4, 0.64, 1);
  --shadow-print: var(--lift-s);
  --shadow-float: 0 2px 4px rgba(46, 41, 37, 0.08), 0 24px 56px -18px rgba(46, 41, 37, 0.38);
  --shadow-sticker: var(--lift-s);

  color-scheme: light;
  accent-color: var(--blue);
}

/* Колишній «папір у клітинку» — тепер просто поверхня */
.paper-grid { background: var(--surface); }

/* ---------- Скидання ---------- */
*, *::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(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 550;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
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: 3px solid var(--blue); outline-offset: 3px; 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-pill);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографіка ---------- */
.h1, .h2, .display {
  font-family: var(--font-display);
  font-weight: 1000;
  text-wrap: balance;
}
.h1 { font-size: clamp(2.3rem, 1.4rem + 3vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; }
.h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.06; letter-spacing: -0.025em; font-weight: 900; }
.h3 { font-size: 1.18rem; line-height: 1.3; font-weight: 850; letter-spacing: -0.01em; text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem); line-height: 1.55; 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 24px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--surface);
  box-shadow: var(--lift-s);
  font-weight: 850; font-size: 0.98rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 200ms ease, transform 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: scale(0.97); box-shadow: var(--press-s); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn--sm { --btn-h: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn--lg { --btn-h: 56px; padding: 0 30px; font-size: 1.04rem; }
.btn--block { width: 100%; }
/* Кольорові кульки: об'єм усередині + тінь від поверхні */
.btn--primary, .btn--dark, .btn--danger, .btn--marker, .btn--on-blue {
  box-shadow: var(--clay), 6px 8px 16px var(--lo), -5px -5px 12px var(--hi);
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--light { background: var(--surface); color: var(--ink); }
.btn--soft { background: var(--blue-tint); color: var(--blue-deep); box-shadow: var(--clay), var(--lift-s); }
.btn--ghost { background: var(--surface); color: var(--ink); }
/* Кнопки на темному тлі */
.btn--on-blue { background: #fff; color: var(--blue-deep); box-shadow: var(--clay), 0 10px 22px -10px rgba(0, 0, 0, 0.45); }
.btn--ghost-dark { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35); }
.btn--danger { background: var(--danger); color: #fff; }
/* Жовта кулька: головна дія на сторінці */
.btn--marker { background: var(--marker); color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink-2); padding-inline: 14px; box-shadow: none; }
.btn--primary:active:not(:disabled), .btn--dark:active:not(:disabled), .btn--danger:active:not(:disabled), .btn--marker:active:not(:disabled), .btn--soft:active:not(:disabled) { box-shadow: var(--clay-down); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn--primary:hover { background: #0b7469; }
  .btn--dark:hover { background: #433b35; }
  .btn--soft:hover { background: var(--blue-line); }
  .btn--on-blue:hover { background: var(--chalk); }
  .btn--ghost-dark:hover { background: rgba(255, 255, 255, 0.18); }
  .btn--danger:hover { background: #a91f34; }
  .btn--marker:hover { background: #ff8f40; }
  .btn--quiet:hover { color: var(--ink); background: var(--surface-2); transform: none; }
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; }

/* Текстове посилання-дія */
.link { color: var(--blue-deep); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--blue-line); text-underline-offset: 4px; }
@media (hover: hover) { .link:hover { text-decoration-color: currentColor; } }

.spinner {
  width: 22px; height: 22px; flex: none;
  border: 3px 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: 8px; }
.field + .field { margin-top: 18px; }
.field__label { font-weight: 800; font-size: 0.93rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__hint { font-size: 0.86rem; color: var(--ink-3); font-weight: 600; }
.field__error { font-size: 0.87rem; color: var(--danger); font-weight: 700; }
.field__error:empty { display: none; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--press-s);
  font-size: 1rem; font-weight: 600;
  transition: box-shadow 150ms ease;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #9a8e82; font-weight: 500; }
.input:focus { outline: none; box-shadow: var(--press-s), 0 0 0 3px var(--blue-line); }
.input[aria-invalid="true"] { box-shadow: var(--press-s), 0 0 0 2px var(--red-pen); }
.input[aria-invalid="true"]:focus { box-shadow: var(--press-s), 0 0 0 3px rgba(255, 107, 107, 0.5); }
@media (forced-colors: active) { .input { border: 1px solid; } .input:focus { outline: 2px solid Highlight; } }
.input--with-btn { padding-right: 54px; }
.input-wrap { position: relative; }
.input-wrap__btn {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3);
}
@media (hover: hover) { .input-wrap__btn:hover { color: var(--ink); box-shadow: var(--lift-s); } }
.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.92rem; 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(--blue-deep); }

.form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-m);
  font-size: 0.93rem; line-height: 1.45; font-weight: 700;
}
.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: 900; }

/* Сегментовані перемикачі (radio): вдавлений жолоб, вибране — кулька */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; 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: 42px; padding: 0 16px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--lift-s);
  font-weight: 750; font-size: 0.93rem; cursor: pointer;
  transition: box-shadow 180ms ease, background-color 150ms ease, color 150ms ease;
}
@media (hover: hover) { .segmented label:hover { color: var(--blue-deep); } }
.segmented input:checked + label { background: var(--blue); color: #fff; box-shadow: var(--clay), 4px 6px 12px var(--lo); }
.segmented input:focus-visible + label { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Логотип ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: var(--r-xs); }
.brand__logo { display: block; width: 38px; height: 38px; flex: none; transition: transform 400ms var(--ease-snap); }
.brand__logo svg { width: 100%; height: 100%; }
@media (hover: hover) { .brand:hover .brand__logo { transform: rotate(-10deg) scale(1.06); } }
.brand__name { font-family: var(--font-display); font-weight: 1000; font-size: 1.22rem; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
@media (max-width: 420px) {
  .site-header .brand { gap: 8px; }
  .site-header .brand__logo { width: 32px; height: 32px; }
  .site-header .brand__name { font-size: 1.02rem; }
}
@media (max-width: 350px) { .site-header .brand__name { display: none; } }

/* ---------- Шапка сайту ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: box-shadow 200ms ease;
}
.site-header[data-scrolled] { box-shadow: 0 10px 24px -18px rgba(46, 41, 37, 0.45); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 9px 14px; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 750; font-size: 0.95rem; color: var(--ink-2);
  transition: color 150ms ease, box-shadow 200ms ease;
}
@media (hover: hover) { .site-nav a:hover { color: var(--ink); box-shadow: var(--lift-s); } }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__login { padding: 9px 14px; font-weight: 800; font-size: 0.95rem; text-decoration: none; border-radius: var(--r-pill); }
@media (hover: hover) { .site-header__login:hover { color: var(--blue-deep); } }
.nav-toggle {
  display: none;
  width: 46px; height: 46px; margin-left: auto;
  place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface); box-shadow: var(--lift-s);
}
.nav-toggle[aria-expanded="true"] { box-shadow: var(--press-s); }
.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: calc(var(--header-h) + 6px) 12px auto 12px; z-index: 49;
    padding: 8px 18px;
    background: var(--surface);
    border-radius: var(--r-l);
    box-shadow: var(--shadow-float);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 800; 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: 8px; }
  .site-header__actions .btn { padding-inline: 14px; --btn-h: 42px; font-size: 0.9rem; }
  .nav-toggle { width: 42px; height: 42px; flex: none; }
  .site-header__cta-long { display: none; }
  .site-header__cta-short { display: inline; }
}

/* ---------- Підвал ---------- */
.site-footer { padding: 56px 0 36px; background: var(--surface); color: var(--ink-2); font-size: 0.95rem; }
.site-footer__grid { padding: clamp(28px, 4vw, 44px); border-radius: var(--r-xl); box-shadow: var(--press); }
.site-footer__bottom { padding-inline: clamp(8px, 2vw, 20px); }
.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.95rem; font-weight: 900; 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: 700; }
@media (hover: hover) { .site-footer a:hover { color: var(--blue-deep); } }
.site-footer__bottom { margin-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.87rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .site-footer__grid { padding: 26px 20px; }
  .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: 14px 18px; border-radius: var(--r-l);
  background: var(--ink); color: #fff;
  box-shadow: var(--clay), var(--shadow-float);
  font-weight: 700; font-size: 0.95rem; line-height: 1.4;
  animation: toast-in 360ms var(--ease-snap);
}
.toast--error { background: #8e1f33; }
.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(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: scale(0.97); } }

/* ---------- Діалоги ---------- */
dialog.modal {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-float), inset 2px 2px 0 rgba(255, 255, 255, 0.7);
}
dialog.modal::backdrop { background: rgba(46, 41, 37, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in 280ms var(--ease-snap); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.modal__body { padding: 30px; }
.modal__title { font-family: var(--font-display); font-weight: 950; font-size: 1.4rem; letter-spacing: -0.02em; 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: 50%; background: var(--surface); color: var(--ink-2); box-shadow: var(--lift-s);
}
@media (hover: hover) { .modal__close:hover { color: var(--ink); } }
.modal__close:active { box-shadow: var(--press-s); }
.modal__close svg { width: 18px; height: 18px; }
.modal__actions { display: flex; gap: 12px; 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: #cbbfb3; }
.token[data-level="low"] { --t-bg: var(--peach); --t-fg: var(--ink); }
.token[data-level="ok"] { --t-bg: var(--blue); }
.token[data-level="lots"] { --t-bg: var(--mint); --t-fg: var(--ink); }
.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-snap); }
  [data-burst="gain"] .token__tick { animation: token-tick 0.6s 0.1s var(--ease-out) backwards; }
}
@keyframes token-spend { 30% { transform: translateY(-3px) scale(0.86, 0.94); } }
@keyframes token-gain { 35% { transform: scale(1.3, 1.2); } }
@keyframes token-tick { from { stroke-dashoffset: 16; } }

/* Пастельна «пляма» під словом */
.hl { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 94%, transparent 94%); padding: 0 0.1em; border-radius: 0.2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* Рукописна нотатка на полях */
.hand { font-family: var(--font-hand); font-weight: 700; letter-spacing: 0; }
/* Менше руху: прибираємо зсуви, лишаємо зміну прозорості */
@media (prefers-reduced-motion: reduce) {
  .toast, dialog.modal[open] { animation-name: fade-in; }
  .btn:active:not(:disabled, [aria-disabled="true"]), .btn:hover { transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
