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

   Ідея: неоморфізм із характером. Увесь сайт — одна формована поверхня з холодного
   фарфору: кадри лежать у лотку, фото в лунці, а натискання справді щось змінює.
   Оранжевий — єдиний живий колір: увімкнено, обрано, дія. Тінь дає форму,
   але межі й текст ніколи не покладаються лише на неї: контраст тексту від 4,5:1.
   Заголовки й ціни — Rubik (м’які кути, як лита пластмаса), текст — Golos Text.
   ========================================================= */

/* ---------- Шрифти (локально, з @fontsource-variable; ₴ лежить у cyrillic-ext) ---------- */
@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-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-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: "Rubik"; font-style: normal; font-display: swap; font-weight: 300 900; src: url(/fonts/rubik-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: "Rubik"; font-style: normal; font-display: swap; font-weight: 300 900; src: url(/fonts/rubik-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: "Rubik"; font-style: normal; font-display: swap; font-weight: 300 900; src: url(/fonts/rubik-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 {
  /* Поверхня: світло падає зліва згори */
  --surf: #e4eaf4;
  --hi: #ffffff;
  --lo: #b3bed1;
  --edge: rgba(255, 255, 255, 0.65);
  --convex: linear-gradient(145deg, #f0f4fb, #d9e0ec);
  --concave: linear-gradient(145deg, #d6dde9, #edf1f8);
  --raise: 10px 10px 22px var(--lo), -10px -10px 22px var(--hi);
  --raise-s: 5px 5px 11px var(--lo), -5px -5px 11px var(--hi);
  --raise-xs: 2px 2px 5px var(--lo), -2px -2px 5px var(--hi);
  --press: inset 7px 7px 14px var(--lo), inset -7px -7px 14px var(--hi);
  --press-s: inset 3px 3px 7px var(--lo), inset -3px -3px 7px var(--hi);

  /* Оранжевий акцент. Текст на ньому темний: контраст 6:1 */
  --tag: #ff6a2b;
  --tag-deep: #d94d10;
  --tag-soft: #ffe0d1;
  --tag-hover: #ff7c44;
  --on-tag: #1b1208;
  --tag-glow: 0 0 14px rgba(255, 106, 43, 0.75);
  --tag-grad: linear-gradient(145deg, #ff8650, #f85c1a);

  --navy: #1b2540;        /* чорнило */
  --navy-2: #2a3657;
  --ink-rgb: 27 37 64;
  --cta: var(--tag);
  --cta-ink: var(--on-tag);
  --on-navy-2: #c3cce2;
  --on-navy-3: #9aa6c4;
  --logo-fill: var(--tag);
  --sale: #d11a2a;        /* стара ціна й помилки */
  --steel: #cfd7e4;
  --steel-2: #a9b4c8;

  --ink: var(--navy);
  --ink-2: #414c69;
  --ink-3: #566181;
  --paper: var(--surf);
  --paper-2: #d9e0ec;
  --page: var(--surf);
  --studio: #d9e0ec;
  --studio-2: #cdd5e3;
  --line: rgba(27, 37, 64, 0.14);
  --line-strong: rgba(27, 37, 64, 0.3);

  /* Назви лишилися від спільної основи кабінету й оплати */
  --blue: var(--navy);
  --blue-deep: var(--navy-2);
  --blue-tint: rgba(27, 37, 64, 0.07);
  --blue-line: rgba(27, 37, 64, 0.28);
  --on-blue: #ffffff;
  --on-ink: #ffffff;
  --marker: var(--tag);
  --marker-soft: var(--tag-soft);
  --red-pen: var(--sale);
  --board: var(--navy);
  --board-2: var(--navy-2);
  --chalk: #ffffff;
  --mint: #0a7d55;
  --k-image: var(--tag);
  --e-image: var(--tag-deep);
  --k-video: var(--tag);
  --e-video: var(--tag-deep);
  --k-music: #b8ecd6;
  --e-music: #0a7d55;
  --k-text: var(--studio-2);
  --e-text: var(--steel-2);
  --plate: var(--navy);
  --screen: var(--navy-2);
  --screen-ink: #ffffff;
  --screen-ink-2: var(--on-navy-2);
  --screen-ink-3: var(--on-navy-3);

  --ok: #0a6e4b;
  --ok-tint: rgba(10, 125, 85, 0.12);
  --warn: #7a4a00;
  --warn-tint: rgba(255, 106, 43, 0.16);
  --danger: #b5131f;
  --danger-tint: rgba(209, 26, 42, 0.1);

  --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);

  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Rubik", "Golos Text", system-ui, sans-serif;
  --font-hand: var(--font-body);
  --font-mono: var(--font-body);
  --w-price: 100%;
  --w-head: 100%;
  --w-label: 100%;

  /* Радіуси: литво без гострих кутів */
  --r-xs: 8px;
  --r-s: 12px;
  --r-btn: 16px;
  --r-m: 22px;
  --r-l: 30px;
  --r-pill: 999px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 8vw, 112px);
  --header-h: 76px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-print: var(--raise-s);
  --shadow-float: var(--raise);
  --shadow-sticker: var(--raise-s);

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

/* Темна глава: та сама форма, інше світло */
.dark {
  --surf: #232d49;
  --hi: #303c60;
  --lo: #151c31;
  --edge: rgba(255, 255, 255, 0.07);
  --convex: linear-gradient(145deg, #2b3657, #1f2841);
  --concave: linear-gradient(145deg, #1c243c, #2a3454);
  /* Тіні треба оголосити наново: у :root вони вже обчислені зі світлими кольорами */
  --raise: 10px 10px 22px var(--lo), -10px -10px 22px var(--hi);
  --raise-s: 5px 5px 11px var(--lo), -5px -5px 11px var(--hi);
  --raise-xs: 2px 2px 5px var(--lo), -2px -2px 5px var(--hi);
  --press: inset 7px 7px 14px var(--lo), inset -7px -7px 14px var(--hi);
  --press-s: inset 3px 3px 7px var(--lo), inset -3px -3px 7px var(--hi);
  --navy: #eef2fb;
  --ink: #eef2fb;
  --ink-2: #c3cce2;
  --ink-3: #a3aecb;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.28);
  background: var(--surf);
  color: var(--ink);
}

.theme-light ::selection { background: var(--tag); color: var(--on-tag); }
.theme-light .input::placeholder { color: #66718f; }
/* ---------- Скидання ---------- */
*, *::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(--on-blue); }

: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: var(--on-ink); text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографіка ---------- */
.h1, .h2, .display {
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
  text-transform: uppercase;
}
.h1 { font-size: clamp(2.3rem, 1.4rem + 3.2vw, 4.4rem); line-height: 1; letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.04; letter-spacing: -0.005em; }
.h1 em, .h2 em, .display em { font-style: normal; color: var(--blue); }
.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: var(--on-blue); }
.btn--dark { background: var(--ink); color: var(--on-ink); }
.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(--blue); color: var(--on-blue); border-color: transparent; box-shadow: var(--shadow-sticker), inset 0 -3px 0 rgba(0, 0, 0, 0.18); font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.btn--marker:active:not(:disabled) { transform: scale(0.97); }
.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: var(--blue-deep); }
  .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: var(--on-blue); }
.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: 700; font-size: 1.15rem; letter-spacing: 0.01em; text-transform: uppercase; 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(0, 0, 0, 0.8);
  }
  .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: clamp(36px, 5vw, 64px) 0 28px; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-size: 0.97rem; }
.site-footer__main { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)); gap: 40px clamp(32px, 6vw, 88px); }
.site-footer__brand p { margin: 16px 0 0; max-width: 34ch; font-size: 1.04rem; line-height: 1.5; }
.site-footer h2 { font-family: var(--font-body); font-size: 0.92rem; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.site-footer ul { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; color: var(--ink-2); font-weight: 500; overflow-wrap: anywhere; }
@media (hover: hover) { .site-footer a:hover { color: var(--blue); } }
.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; margin-top: clamp(32px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--ink-3); }
.site-footer__bottom nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
@media (max-width: 760px) {
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-footer__main { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* ---------- Сповіщення (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: #262139; color: var(--ink); border: 1px solid var(--line);
  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(5, 4, 9, 0.72); backdrop-filter: blur(3px); }
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: var(--on-blue); 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: var(--t-fg); stroke: var(--t-fg); stroke-width: 1.2; stroke-linejoin: round; transform-origin: 12px 11.5px; }
.token__stand { stroke: var(--t-bg); stroke-width: 2.2; stroke-linecap: round; }
.token[data-level="out"] { --t-bg: #4a4560; --t-fg: #c3bdd9; }
.token[data-level="low"] { --t-bg: #e88a2e; }
.token[data-level="ok"] { --t-bg: var(--blue); }
.token[data-level="lots"] { --t-bg: var(--mint); }
.token[data-level="max"] { --t-bg: #b6a9ff; --t-fg: var(--on-blue); }
@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 { transform: scale(0.2); opacity: 0; } }

/* Маркер під словом */
/* Акцент: сигнальний жовтий */
.hl { color: var(--blue); }
/* Рукописна нотатка на полях */
/* Мітка цеху: моноширинний шрифт великими літерами */
.hand { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8em; }
/* Менше руху: прибираємо зсуви, лишаємо зміну прозорості */
@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; } }

/* ---------- Особливості Товарки поверх спільної основи ---------- */
body { font-weight: 400; line-height: 1.55; background: var(--surf); }
:focus-visible { outline: 3px solid var(--tag-deep); outline-offset: 3px; }
.h1, .h2, .display, .brand__name, .modal__title, .auth__title { font-family: var(--font-display); text-transform: none; }
.h1, .h2, .display { font-weight: 700; letter-spacing: -0.022em; text-shadow: 1px 1px 0 var(--hi); }
.dark :is(.h1, .h2) { text-shadow: none; }
.h1 { font-size: clamp(2.6rem, 1.5rem + 4.1vw, 5.1rem); line-height: 1.02; }
.h2 { font-size: clamp(2rem, 1.4rem + 2.3vw, 3.3rem); line-height: 1.06; }
.h1 em, .h2 em, .display em { font-style: normal; color: inherit; }
.h3 { font-weight: 700; letter-spacing: 0; }
.lead { line-height: 1.55; }
.brand { gap: 9px; }
.brand__name { font-size: 1.3rem; line-height: 1; }
.brand__logo { width: 40px; height: 40px; --logo-ink: var(--navy); }
.brand__name svg { display: block; width: auto; height: 1em; overflow: visible; }

/* Кнопки: опуклі, під пальцем утискаються */
.btn { font-weight: 650; border: 1px solid var(--edge); border-radius: var(--r-btn); background: var(--convex); color: var(--ink); box-shadow: var(--raise-s); transition: box-shadow 130ms var(--ease-out), transform 130ms var(--ease-out), filter 130ms ease; }
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: translateY(1px); box-shadow: var(--press-s); }
.btn--light, .btn--ghost, .btn--soft, .btn--quiet, .btn--oauth { background: var(--convex); color: var(--ink); border-color: var(--edge); }
.btn--quiet { box-shadow: none; background: transparent; border-color: transparent; }
.btn--dark { background: linear-gradient(145deg, #2c3859, #182139); color: #fff; border-color: rgba(255, 255, 255, 0.08); }
.btn--primary, .btn--marker, .btn--key {
  background: var(--tag-grad); color: var(--on-tag); border-color: rgba(255, 255, 255, 0.28); font-family: var(--font-body); text-transform: none; letter-spacing: 0;
  box-shadow: 6px 6px 14px rgba(217, 77, 16, 0.38), -5px -5px 12px var(--hi), inset 1px 1px 1px rgba(255, 255, 255, 0.4);
}
.btn--primary:active:not(:disabled), .btn--marker:active:not(:disabled), .btn--key:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 4px 4px 9px rgba(150, 50, 5, 0.5), inset -3px -3px 7px rgba(255, 190, 150, 0.5); }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.03); }
  .btn--light:hover, .btn--ghost:hover { border-color: var(--edge); }
  .btn--primary:hover, .btn--marker:hover, .btn--key:hover { background: var(--tag-grad); filter: brightness(1.06); }
  .btn--dark:hover { background: linear-gradient(145deg, #34416a, #1e2843); }
  .btn--quiet:hover { background: transparent; box-shadow: var(--raise-xs); }
}
.btn[disabled], .btn[aria-disabled="true"] { box-shadow: var(--press-s); }

/* Поля: заглиблені, межа лишається видимою */
.input { border: 1px solid var(--line); border-radius: var(--r-s); background: var(--concave); box-shadow: var(--press-s); color: var(--ink); }
.input:focus, .theme-light .input:focus { border-color: var(--tag-deep); box-shadow: var(--press-s), 0 0 0 2px var(--tag); }
@media (hover: hover) { .input:hover:not(:focus) { border-color: var(--line-strong); } }
.check input { accent-color: var(--tag-deep); }

/* Перемикач: заглиблена доріжка, обраний сегмент піднімається й підсвічується */
.segmented { gap: 4px; width: fit-content; max-width: 100%; padding: 5px; border-radius: var(--r-btn); background: var(--concave); box-shadow: var(--press-s); }
.segmented label { position: relative; min-height: 36px; padding: 0 13px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-2); font-size: 0.9rem; }
@media (hover: hover) { .segmented label:hover { color: var(--ink); } }
.segmented input:checked + label { background: var(--convex); color: var(--ink); box-shadow: var(--raise-xs); }
.segmented input:checked + label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tag); box-shadow: var(--tag-glow); }
.segmented input:focus-visible + label { outline: 3px solid var(--tag-deep); outline-offset: 2px; }

/* Шапка: окрема плашка над поверхнею */
.site-header { top: 10px; margin: 10px var(--gutter) 0; background: var(--convex); border: 1px solid var(--edge); border-radius: 24px; box-shadow: var(--raise-s); -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header[data-scrolled] { border-bottom-color: var(--edge); }
.site-header .site-header__inner { width: 100%; padding-inline: clamp(12px, 2vw, 22px); }
.site-nav a { color: var(--ink-2); font-weight: 550; }
@media (hover: hover) { .site-nav a:hover { color: var(--ink); } }
.site-header__login { color: var(--ink); }
.nav-toggle { background: var(--convex); border-color: var(--edge); box-shadow: var(--raise-xs); border-radius: var(--r-s); }
.mobile-nav { background: var(--surf); border-bottom: 0; border-radius: 0 0 24px 24px; box-shadow: var(--raise-s); }

.modal__title { font-weight: 700; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.08; }
dialog.modal { background: var(--surf); box-shadow: 18px 18px 44px rgba(27, 37, 64, 0.35), -6px -6px 22px rgba(255, 255, 255, 0.5); border: 1px solid var(--edge); }
dialog.modal::backdrop { background: rgba(27, 37, 64, 0.45); backdrop-filter: blur(4px); }
.modal__close { border-radius: 50%; background: var(--convex); box-shadow: var(--raise-xs); }
.toast { background: var(--navy); color: #fff; border-color: transparent; border-radius: var(--r-btn); box-shadow: 8px 8px 22px rgba(27, 37, 64, 0.4); }
.toast--error { background: #8f1219; }
.hand { font-family: var(--font-body); font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 0.9em; }
.token[data-level="out"] { --t-bg: var(--steel-2); --t-fg: var(--navy); }
.token[data-level="low"] { --t-bg: var(--sale); --t-fg: #fff; }
.token[data-level="ok"], .token[data-level="lots"], .token[data-level="max"] { --t-bg: var(--tag); --t-fg: var(--on-tag); }
.skip-link { border-radius: var(--r-s); }

/* Підвал: темна плита */
.site-footer { --surf: #232d49; background: var(--surf); color: var(--on-navy-2); border-top: 0; margin: clamp(32px, 5vw, 60px) clamp(8px, 2vw, 24px) clamp(8px, 2vw, 24px); border-radius: 36px; }
.site-footer h2 { color: #fff; font-weight: 700; }
.site-footer a { color: var(--on-navy-2); }
.site-footer .brand { color: #fff; }
.site-footer .brand__logo { --logo-ink: #eef2fb; }
@media (hover: hover) { .site-footer a:hover { color: var(--tag); } }
.site-footer__bottom { border-top-color: rgba(255, 255, 255, 0.16); color: var(--on-navy-3); }
.site-footer__bottom a { color: var(--on-navy-3); }