/* =====================================================================
   Тема: тональная палитра из одного «семени» (--h), как динамические
   цвета в Pixel. Всё считается в OKLCH, светлая и тёмная схемы.
   ===================================================================== */
/* Шрифты лежат локально: Google Sans Flex (латиница, оси ROND/wdth) + Onest (кириллица),
   Pixelify Sans для «пиксельных» мест и Material Symbols Rounded для значков. */
@font-face { font-family: 'Site Sans'; src: url(/fonts/google-sans-flex-latin.woff2) format('woff2'); font-weight: 300 800; font-stretch: 75% 125%; font-display: swap;
  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: 'Site Sans'; src: url(/fonts/onest-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Site Sans'; src: url(/fonts/onest-cyrillic-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Pixelify'; src: url(/fonts/pixelify-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Pixelify'; src: url(/fonts/pixelify-cyrillic.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Material Symbols Rounded'; src: url(/fonts/material-symbols-rounded.woff2) format('woff2'); font-weight: 400 600; font-display: block; }

:root {
  --h: 165;
  --font: 'Site Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pixel: 'Pixelify', 'Site Sans', monospace;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --r-xs: 8px; --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-xl: 32px; --r-xxl: 48px; --r-full: 999px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 160ms; --t-med: 320ms; --t-slow: 560ms;
  --wrap: 1180px;
  --bar-h: 72px;
  color-scheme: light dark;
}

[data-theme="light"] {
  color-scheme: light;
  --surface: oklch(98.6% .007 var(--h));
  --sc-lowest: oklch(100% 0 0);
  --sc-low: oklch(96.6% .012 var(--h));
  --sc: oklch(94.6% .016 var(--h));
  --sc-high: oklch(92.6% .02 var(--h));
  --sc-highest: oklch(90.4% .024 var(--h));
  --on-surface: oklch(22% .016 var(--h));
  --on-surface-var: oklch(43% .022 var(--h));
  --outline: oklch(63% .02 var(--h));
  --outline-var: oklch(86% .02 var(--h));
  --primary: oklch(46% .11 var(--h));
  --on-primary: oklch(99% .01 var(--h));
  --primary-c: oklch(89% .08 var(--h));
  --on-primary-c: oklch(26% .07 var(--h));
  --secondary-c: oklch(91.5% .035 var(--h));
  --on-secondary-c: oklch(28% .03 var(--h));
  --tertiary: oklch(48% .1 calc(var(--h) + 70));
  --tertiary-c: oklch(90% .065 calc(var(--h) + 70));
  --on-tertiary-c: oklch(27% .07 calc(var(--h) + 70));
  --error: oklch(52% .19 25);
  --error-c: oklch(93% .045 25);
  --on-error-c: oklch(33% .12 25);
  --inverse: oklch(29% .015 var(--h));
  --on-inverse: oklch(95% .01 var(--h));
  --scrim: oklch(15% .02 var(--h) / .38);
  /* тона для товаров, у каждого свой --ph */
  --tone-l: 88%; --tone-c: .085; --on-tone-l: 26%;
}

[data-theme="dark"] {
  color-scheme: dark;
  --surface: oklch(16.5% .011 var(--h));
  --sc-lowest: oklch(13.5% .008 var(--h));
  --sc-low: oklch(19.5% .013 var(--h));
  --sc: oklch(21.8% .015 var(--h));
  --sc-high: oklch(25.4% .017 var(--h));
  --sc-highest: oklch(29.4% .019 var(--h));
  --on-surface: oklch(92.5% .012 var(--h));
  --on-surface-var: oklch(78% .02 var(--h));
  --outline: oklch(61% .02 var(--h));
  --outline-var: oklch(35% .02 var(--h));
  --primary: oklch(83% .1 var(--h));
  --on-primary: oklch(26% .07 var(--h));
  --primary-c: oklch(36% .08 var(--h));
  --on-primary-c: oklch(92% .07 var(--h));
  --secondary-c: oklch(32% .03 var(--h));
  --on-secondary-c: oklch(90% .03 var(--h));
  --tertiary: oklch(82% .09 calc(var(--h) + 70));
  --tertiary-c: oklch(36% .07 calc(var(--h) + 70));
  --on-tertiary-c: oklch(91% .06 calc(var(--h) + 70));
  --error: oklch(78% .13 25);
  --error-c: oklch(37% .11 25);
  --on-error-c: oklch(92% .05 25);
  --inverse: oklch(91% .012 var(--h));
  --on-inverse: oklch(24% .015 var(--h));
  --scrim: oklch(5% .01 var(--h) / .6);
  --tone-l: 38%; --tone-c: .085; --on-tone-l: 92%;
}

/* ============================ База ============================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-variation-settings: 'ROND' 60;
  background: var(--surface); color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--primary-c); color: var(--on-primary-c); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 16px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-full); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ms {
  font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr; flex: none;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased; user-select: none;
  width: 1em; overflow: hidden;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 450, 'GRAD' 0, 'opsz' 24; }

/* Типографика (шкала M3) */
.display { font-size: clamp(56px, 10.5vw, 156px); line-height: .92; letter-spacing: -.035em; font-weight: 560; font-variation-settings: 'ROND' 100, 'wdth' 108, 'opsz' 144; }
.h1 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -.02em; font-weight: 520; font-variation-settings: 'ROND' 80, 'opsz' 48; }
.h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; letter-spacing: -.01em; font-weight: 520; font-variation-settings: 'ROND' 70; }
.title-l { font-size: 22px; line-height: 28px; font-weight: 520; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 560; letter-spacing: .01em; }
.body-l { font-size: 16px; line-height: 24px; }
.body-m { font-size: 14px; line-height: 20px; }
.label { font-size: 14px; line-height: 20px; font-weight: 560; letter-spacing: .01em; }
.muted { color: var(--on-surface-var); }
.pixel { font-family: var(--pixel); font-variation-settings: normal; }
.measure { max-width: 60ch; }

/* ============================ Каркас ============================ */
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

.statusbar {
  height: 32px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 560; color: var(--on-surface-var);
}
.statusbar .wrap { display: flex; align-items: center; gap: 14px; }
.statusbar .sb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.statusbar .ms { font-size: 18px; }
.sb-clock { font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--outline); display: inline-block; flex: none; }
.dot.on { background: oklch(72% .17 150); box-shadow: 0 0 0 3px oklch(72% .17 150 / .22); }

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.appbar .wrap { height: var(--bar-h); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: -.01em; font-variation-settings: 'ROND' 100; }
.brand svg { width: 34px; height: 34px; }

.nav { display: flex; gap: 4px; margin-left: 24px; padding: 4px; background: var(--sc); border-radius: var(--r-full); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: var(--r-full); text-decoration: none; font-weight: 560; font-size: 15px; color: var(--on-surface-var);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a .ms { font-size: 20px; }
.nav a:hover { color: var(--on-surface); background: var(--sc-high); }
.nav a[aria-current="page"] { background: var(--secondary-c); color: var(--on-secondary-c); }
.nav a[aria-current="page"] .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.avatar-btn {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 4px 16px 4px 4px;
  border-radius: var(--r-full); background: var(--sc-high); text-decoration: none; font-weight: 560;
  transition: background-color var(--t-fast) var(--ease);
}
.avatar-btn:hover { background: var(--sc-highest); }
.avatar-btn img { width: 40px; height: 40px; border-radius: 12px; image-rendering: pixelated; background: var(--sc-highest); }

/* Нижняя навигация (телефон) */
.bottomnav { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .avatar-btn span { display: none; }
  .avatar-btn { padding: 4px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(var(--n, 3), 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 45; padding: 12px 8px calc(16px + env(safe-area-inset-bottom));
    background: var(--sc);
  }
  .bottomnav a { display: grid; justify-items: center; gap: 4px; text-decoration: none; font-size: 12px; font-weight: 600; color: var(--on-surface-var); }
  .bottomnav a .pill { width: 64px; height: 32px; border-radius: var(--r-full); display: grid; place-items: center; transition: background-color var(--t-med) var(--ease), width var(--t-med) var(--spring); }
  .bottomnav a[aria-current="page"] { color: var(--on-surface); }
  .bottomnav a[aria-current="page"] .pill { background: var(--secondary-c); color: var(--on-secondary-c); }
  .bottomnav a[aria-current="page"] .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
  main { padding-bottom: 110px; }
  .statusbar .hide-s { display: none; }
}

main { min-height: calc(100dvh - 32px - var(--bar-h) - 160px); }
main:focus { outline: none; }
.view { animation: viewIn var(--t-med) var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.footer { padding: 48px 0 40px; color: var(--on-surface-var); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--on-surface); }
.footer .links { display: flex; gap: 8px; margin-left: auto; }

/* ============================ Кнопки ============================ */
.btn {
  --bg: var(--primary); --fg: var(--on-primary);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border: 0; border-radius: var(--r-full);
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; user-select: none; isolation: isolate; overflow: hidden;
  transition: border-radius var(--t-med) var(--spring), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn::after { content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity var(--t-fast) var(--ease); z-index: -1; }
.btn:hover::after { opacity: .08; }
/* Экспрессивное нажатие: пилюля «сжимается» в скруглённый квадрат */
.btn:active { border-radius: var(--r-s); }
.btn:active::after { opacity: .12; }
.btn .ms { font-size: 20px; margin-left: -4px; }
.btn.tonal { --bg: var(--secondary-c); --fg: var(--on-secondary-c); }
.btn.tertiary { --bg: var(--tertiary-c); --fg: var(--on-tertiary-c); }
.btn.text { --bg: transparent; --fg: var(--primary); padding: 0 14px; }
.btn.outline { --bg: transparent; --fg: var(--on-surface); box-shadow: inset 0 0 0 1px var(--outline-var); }
.btn.danger { --bg: var(--error-c); --fg: var(--on-error-c); }
.btn.big { height: 64px; padding: 0 32px; font-size: 17px; }
.btn.small { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.loading { pointer-events: none; }
.btn.loading::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--on-surface-var); cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-radius var(--t-med) var(--spring);
}
.icon-btn:hover { background: var(--sc-high); color: var(--on-surface); }
.icon-btn:active { border-radius: var(--r-s); }
.icon-btn.filled { background: var(--sc-high); color: var(--on-surface); }

/* Чипы */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-s); border: 0; box-shadow: inset 0 0 0 1px var(--outline-var);
  background: transparent; color: var(--on-surface-var); font-size: 14px; font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-radius var(--t-med) var(--spring), color var(--t-fast);
}
.chip .ms { font-size: 18px; margin-left: -2px; }
a.chip { text-decoration: none; }
img.broken { visibility: hidden; }
.chip:hover { background: var(--sc-high); color: var(--on-surface); }
.chip[aria-pressed="true"] { background: var(--secondary-c); color: var(--on-secondary-c); box-shadow: none; border-radius: var(--r-full); }
.chip.static { cursor: default; background: var(--sc-high); box-shadow: none; color: var(--on-surface); }
.chip.static:hover { background: var(--sc-high); }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-full); font-size: 13px; font-weight: 600; background: var(--sc-highest); color: var(--on-surface-var); white-space: nowrap; }
.tag .ms { font-size: 16px; margin-left: -2px; }
.tag.ok { background: oklch(from var(--primary-c) l c 150); color: oklch(from var(--on-primary-c) l c 150); }
.tag.wait { background: var(--tertiary-c); color: var(--on-tertiary-c); }
.tag.bad { background: var(--error-c); color: var(--on-error-c); }
.tag.accent { background: var(--primary-c); color: var(--on-primary-c); }

/* ============================ Поверхности ============================ */
.surface { background: var(--sc-low); border-radius: var(--r-xl); padding: 28px; }
.surface.high { background: var(--sc); }
.surface.tight { padding: 20px; }
.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head .grow { flex: 1; min-width: 240px; }
.section-head p { margin-top: 6px; }

/* Форма товара (shape) — клип через SVG clipPath из app.js */
.shape { display: grid; place-items: center; flex: none; background: var(--tone, var(--primary-c)); color: var(--on-tone, var(--on-primary-c)); }
.tone {
  --tone: oklch(var(--tone-l) var(--tone-c) var(--ph, var(--h)));
  --on-tone: oklch(var(--on-tone-l) .07 var(--ph, var(--h)));
}

/* ============================ Главная ============================ */
.hero { padding: 40px 0 24px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-name { overflow-wrap: anywhere; animation: nameIn 1.1s var(--ease) both; }
@keyframes nameIn {
  from { font-variation-settings: 'ROND' 0, 'wdth' 80, 'opsz' 144; font-weight: 300; opacity: 0; letter-spacing: -.06em; }
}
.hero-tag { margin-top: 24px; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.45; color: var(--on-surface-var); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.ip-pill {
  display: inline-flex; align-items: center; gap: 14px; height: 64px; padding: 0 12px 0 28px;
  border: 0; border-radius: var(--r-full); background: var(--primary-c); color: var(--on-primary-c); cursor: pointer;
  font-family: var(--pixel); font-size: 22px; letter-spacing: .02em;
  transition: border-radius var(--t-med) var(--spring), background-color var(--t-fast);
}
.ip-pill:active { border-radius: var(--r-m); }
.ip-pill .copy { width: 44px; height: 44px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.ip-pill .copy .ms { font-size: 20px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.hero-art { position: relative; aspect-ratio: 1; width: min(100%, 520px); justify-self: end; cursor: pointer; border: 0; padding: 0; background: none; }
.hero-art .blob { position: absolute; inset: 0; animation: rot 48s linear infinite; }
.hero-art .blob path { fill: var(--primary-c); transition: fill var(--t-med); }
.hero-art .blob .ring { fill: none; stroke: var(--outline-var); stroke-width: .004; }
.hero-art .block { position: absolute; inset: 22%; filter: drop-shadow(0 18px 24px oklch(20% .05 var(--h) / .28)); transition: transform var(--t-slow) var(--spring); }
.hero-art:hover .block { transform: translateY(-6px) rotate(-2deg); }
.hero-art:active .block { transform: scale(.94); }
@keyframes rot { to { transform: rotate(360deg); } }

.online-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.heads { display: flex; flex-wrap: wrap; gap: 6px; }
.heads img { width: 36px; height: 36px; border-radius: 10px; image-rendering: pixelated; background: var(--sc-highest); }
.heads .more { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--sc-highest); font-size: 12px; font-weight: 700; }

.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.about { display: grid; gap: 20px; align-content: start; }
.about .lead { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; font-weight: 450; letter-spacing: -.005em; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }

.recent { display: grid; gap: 4px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); background: var(--sc); }
.recent-item:first-child { border-radius: var(--r-l) var(--r-l) var(--r-m) var(--r-m); }
.recent-item:last-child { border-radius: var(--r-m) var(--r-m) var(--r-l) var(--r-l); }
.recent-item img { width: 32px; height: 32px; border-radius: 8px; image-rendering: pixelated; }
.recent-item .who { font-weight: 600; }
.recent-item .when { margin-left: auto; font-size: 13px; color: var(--on-surface-var); white-space: nowrap; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 24px; border-radius: var(--r-xl); background: var(--sc-low); }
.step .num { width: 48px; height: 48px; display: grid; place-items: center; font-family: var(--pixel); font-size: 24px; margin-bottom: 20px; }
.step p { margin-top: 6px; color: var(--on-surface-var); }
.step code, .code-inline { font-family: var(--pixel); font-size: 1.05em; padding: 2px 8px; border-radius: 8px; background: var(--primary-c); color: var(--on-primary-c); }

/* ============================ Магазин ============================ */
.store-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 24px; }
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.cats::-webkit-scrollbar { display: none; }

.grid { grid-auto-flow: dense; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px;
  border-radius: var(--r-xl); background: var(--sc-low); text-align: left; border: 0; cursor: pointer; color: inherit;
  transition: background-color var(--t-fast) var(--ease), border-radius var(--t-med) var(--spring);
}
.card:hover { background: var(--sc); }
.card:active { border-radius: var(--r-l); }
.card .top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.card .shape { width: 72px; height: 72px; }
.card .shape .ms { font-size: 34px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 40; }
.card .name { font-size: 24px; line-height: 1.15; font-weight: 560; letter-spacing: -.01em; font-variation-settings: 'ROND' 80; }
.card .desc { color: var(--on-surface-var); font-size: 15px; line-height: 1.5; }
.card .perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.card .perks li { display: flex; gap: 10px; align-items: start; }
.card .perks .ms { font-size: 18px; color: var(--on-tone); background: var(--tone); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; margin-top: -1px; font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20; }
.card .foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 4px; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price b { font-size: 32px; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variation-settings: 'ROND' 100, 'opsz' 40; }
.price s { color: var(--on-surface-var); font-size: 16px; }
.price small { display: block; width: 100%; color: var(--on-surface-var); font-size: 13px; font-weight: 500; }
.card .buy { width: 56px; height: 56px; border-radius: var(--r-l); display: grid; place-items: center; background: var(--tone); color: var(--on-tone); transition: border-radius var(--t-med) var(--spring); }
.card:hover .buy { border-radius: var(--r-full); }

/* Главный товар — крупнее и в своём тоне */
.card.featured { grid-column: span 2; background: var(--tone); color: var(--on-tone); flex-direction: row; gap: 32px; padding: 32px; }
.card.featured:hover { background: var(--tone); filter: brightness(1.03); }
.card.featured .side { display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 0; }
.card.featured .shape { width: 180px; height: 180px; background: var(--on-tone); color: var(--tone); align-self: center; }
.card.featured .shape .ms { font-size: 80px; }
.card.featured .desc, .card.featured .price s, .card.featured .price small { color: inherit; opacity: .78; }
.card.featured .perks .ms { background: var(--on-tone); color: var(--tone); }
.card.featured .buy { background: var(--on-tone); color: var(--tone); }
.card.featured .tag { background: var(--on-tone); color: var(--tone); }
.card.featured .name { font-size: 34px; }
@media (max-width: 640px) {
  .card.featured { grid-column: auto; flex-direction: column; padding: 24px; }
  .card.featured .shape { width: 112px; height: 112px; align-self: start; }
  .card.featured .shape .ms { font-size: 52px; }
}

.empty { padding: 48px 24px; text-align: center; border-radius: var(--r-xl); background: var(--sc-low); display: grid; gap: 12px; justify-items: center; }
.empty .shape { width: 88px; height: 88px; }
.empty .shape .ms { font-size: 40px; }

/* ============================ Диалоги и листы ============================ */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: 20px; animation: fade var(--t-med) var(--ease) both; }
.scrim.closing { animation: fade var(--t-fast) var(--ease) reverse both; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(560px, 100%); max-height: min(88dvh, 860px); overflow: auto; overscroll-behavior: contain;
  background: var(--sc-high); border-radius: var(--r-xxl); padding: 28px;
  animation: pop var(--t-slow) var(--spring) both;
}
.dialog.wide { width: min(980px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(12px); } }
.dialog-head { display: flex; align-items: start; gap: 16px; margin-bottom: 20px; }
.dialog-head .grow { flex: 1; min-width: 0; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .scrim { place-items: end stretch; padding: 0; }
  .dialog { width: 100%; border-radius: var(--r-xxl) var(--r-xxl) 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); animation: sheet var(--t-slow) var(--ease) both; }
  .dialog::before { content: ''; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--outline); opacity: .5; margin: 0 auto 16px; }
  @keyframes sheet { from { transform: translateY(100%); } }
}

.product-sheet .hero-shape { width: 96px; height: 96px; }
.product-sheet .hero-shape .ms { font-size: 44px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48; }
.summary { display: grid; gap: 2px; margin-top: 20px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--sc-highest); font-size: 15px; }
.summary .row:first-child { border-radius: var(--r-l) var(--r-l) 6px 6px; }
.summary .row:last-child { border-radius: 6px 6px var(--r-l) var(--r-l); }
.summary .row:only-child { border-radius: var(--r-l); }
.summary .row.total { font-weight: 650; font-size: 18px; }

.product-sheet .perks { list-style: none; margin: 0; padding: 20px; display: grid; gap: 10px; border-radius: var(--r-l); background: var(--sc-highest); font-size: 15px; }
.product-sheet .perks li { display: flex; gap: 10px; align-items: start; }
.product-sheet .perks .ms { font-size: 18px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--tone); color: var(--on-tone); font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20; }

/* Snackbar */
.snackbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%);
  min-width: min(340px, calc(100% - 32px)); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: var(--r-m);
  background: var(--inverse); color: var(--on-inverse); font-size: 15px; font-weight: 500;
  animation: snack var(--t-slow) var(--spring) both;
}
.snackbar.out { animation: snackOut var(--t-fast) var(--ease) both; }
@keyframes snack { from { opacity: 0; transform: translate(-50%, 24px); } }
@keyframes snackOut { to { opacity: 0; transform: translate(-50%, 12px); } }
@media (max-width: 760px) { .snackbar { bottom: 110px; } }

/* Панель быстрых настроек (как шторка Android) */
.qs-scrim { place-items: start end; padding: 16px; }
.qs {
  width: min(380px, 100%); background: var(--sc-high); border-radius: var(--r-xxl); padding: 20px;
  animation: qsIn var(--t-slow) var(--spring) both; transform-origin: top right;
}
@keyframes qsIn { from { opacity: 0; transform: scale(.85) translateY(-12px); } }
.qs h3 { font-size: 14px; font-weight: 600; color: var(--on-surface-var); margin: 4px 4px 12px; }
.qs-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qs-tile {
  display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 16px; border: 0;
  border-radius: var(--r-full); background: var(--sc-highest); color: var(--on-surface); cursor: pointer; text-align: left;
  transition: background-color var(--t-med) var(--ease), border-radius var(--t-med) var(--spring);
}
.qs-tile .ms { font-size: 24px; }
.qs-tile b { display: block; font-size: 15px; font-weight: 600; }
.qs-tile small { display: block; font-size: 12px; color: var(--on-surface-var); }
.qs-tile[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-radius: var(--r-l); }
.qs-tile[aria-pressed="true"] small { color: inherit; opacity: .8; }
.qs-tile[aria-pressed="true"] .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.qs-tile.span { grid-column: span 2; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.swatch {
  display: grid; justify-items: center; gap: 8px; padding: 12px 4px; border: 0; border-radius: var(--r-l);
  background: transparent; cursor: pointer; color: var(--on-surface-var); font-size: 12px; font-weight: 600;
  transition: background-color var(--t-fast);
}
.swatch:hover { background: var(--sc-highest); }
.swatch .disc { position: relative; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; transition: border-radius var(--t-med) var(--spring); }
.swatch .disc i:first-child { grid-row: span 2; }
.swatch[aria-pressed="true"] { color: var(--on-surface); }
.swatch[aria-pressed="true"] .disc { border-radius: 16px; }
.swatch[aria-pressed="true"] .disc::after { content: 'check'; font-family: 'Material Symbols Rounded'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #fff; background: oklch(0% 0 0 / .28); }

/* ============================ Формы ============================ */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--on-surface-var); padding-left: 4px; }
.field small { font-size: 12px; color: var(--on-surface-var); padding-left: 4px; }
.input, .select, .textarea {
  width: 100%; height: 56px; padding: 0 18px; border: 0; border-radius: var(--r-m);
  background: var(--sc-highest); color: var(--on-surface); font-size: 16px;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--t-fast), background-color var(--t-fast);
}
.textarea { height: auto; min-height: 96px; padding: 14px 18px; resize: vertical; line-height: 1.5; }
.textarea.code { font-family: var(--mono); font-size: 13.5px; }
.input:hover, .select:hover, .textarea:hover { box-shadow: inset 0 0 0 1px var(--outline); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 22px) 26px, calc(100% - 17px) 26px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.promo-row { display: flex; gap: 8px; margin-top: 16px; }
.promo-row .input { flex: 1; height: 48px; text-transform: uppercase; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 18px; border-radius: var(--r-m); background: var(--sc-highest); cursor: pointer; }
.switch-row small { display: block; color: var(--on-surface-var); font-size: 13px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; appearance: none; margin: 0; border-radius: var(--r-full); background: var(--sc-highest); box-shadow: inset 0 0 0 2px var(--outline); cursor: pointer; transition: background-color var(--t-fast); }
.switch::after { content: ''; position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all var(--t-med) var(--spring); }
.switch:checked { background: var(--primary); box-shadow: none; }
.switch:checked::after { left: 24px; top: 4px; width: 24px; height: 24px; background: var(--on-primary); }
.switch:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ============================ Вход ============================ */
.login { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 32px 0 48px; align-items: stretch; }
.login-card { background: var(--sc-low); border-radius: var(--r-xxl); padding: clamp(24px, 4vw, 48px); display: grid; gap: 24px; align-content: start; }
.login-aside { background: var(--primary-c); color: var(--on-primary-c); border-radius: var(--r-xxl); padding: clamp(24px, 4vw, 48px); display: grid; gap: 28px; align-content: start; }
.login-aside ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.login-aside li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.login-aside li .n { width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--pixel); font-size: 20px; background: var(--on-primary-c); color: var(--primary-c); }
.login-aside li p { opacity: .82; margin-top: 2px; }
.login-aside code { font-family: var(--pixel); font-size: 1.1em; padding: 1px 8px; border-radius: 8px; background: var(--on-primary-c); color: var(--primary-c); }
.nick-field { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: var(--r-l); background: var(--sc-highest); }
.nick-field:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.nick-field img { width: 48px; height: 48px; border-radius: 14px; image-rendering: pixelated; background: var(--sc-high); transition: transform var(--t-med) var(--spring); }
.nick-field input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; font-size: 20px; font-weight: 560; }
.nick-field input:focus { outline: none; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes input {
  width: 100%; aspect-ratio: .82; min-width: 0; border: 0; border-radius: var(--r-m); text-align: center;
  background: var(--sc-highest); font-family: var(--pixel); font-size: clamp(26px, 4vw, 38px); caret-color: var(--primary);
  transition: border-radius var(--t-med) var(--spring), background-color var(--t-fast), box-shadow var(--t-fast);
}
.code-boxes input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); border-radius: var(--r-l); }
.code-boxes input.filled { background: var(--primary-c); color: var(--on-primary-c); border-radius: var(--r-l); }
.code-boxes.shake { animation: shake .42s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.form-error { display: flex; gap: 10px; align-items: start; padding: 12px 16px; border-radius: var(--r-m); background: var(--error-c); color: var(--on-error-c); font-size: 14px; font-weight: 500; }
.form-error .ms { font-size: 20px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-aside { order: -1; } }

/* ============================ Личный кабинет ============================ */
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 32px; border-radius: var(--r-xxl); background: var(--primary-c); color: var(--on-primary-c); }
.profile .face { width: 132px; height: 132px; background: var(--on-primary-c); display: grid; place-items: center; }
.profile .face img { width: 78px; height: 78px; image-rendering: pixelated; }
.profile .stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.profile .stat { padding: 10px 16px; border-radius: var(--r-l); background: color-mix(in oklch, var(--on-primary-c) 12%, transparent); }
.profile .stat b { display: block; font-size: 22px; line-height: 1.1; font-weight: 600; font-variation-settings: 'ROND' 100; }
.profile .stat span { font-size: 13px; opacity: .8; }
.profile .actions { display: flex; flex-direction: column; gap: 8px; }
.profile .btn.on-c { --bg: var(--on-primary-c); --fg: var(--primary-c); }
.profile .btn.ghost { --bg: transparent; --fg: var(--on-primary-c); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--on-primary-c) 30%, transparent); }
@media (max-width: 760px) {
  .profile { grid-template-columns: auto 1fr; padding: 24px; gap: 20px; }
  .profile .face { width: 88px; height: 88px; }
  .profile .face img { width: 52px; height: 52px; }
  .profile .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}

.lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grant { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--sc-low); }
.grant .row { display: flex; align-items: center; gap: 16px; }
.grant .shape { width: 56px; height: 56px; }
.grant .shape .ms { font-size: 28px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.grant .left { font-size: 13px; color: var(--on-surface-var); display: flex; justify-content: space-between; }

/* Волнистый индикатор (Material 3 Expressive) */
.wavy { display: block; width: 100%; height: 16px; overflow: visible; }
.wavy .track { stroke: var(--sc-highest); }
.wavy .val { stroke: var(--primary); }
.wavy.animated .val { animation: wave 1.2s linear infinite; }
@keyframes wave { to { stroke-dashoffset: -24; } }

.list { display: grid; gap: 2px; }
.list-item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--sc-low); border-radius: 6px; }
.list-item:first-child { border-top-left-radius: var(--r-l); border-top-right-radius: var(--r-l); }
.list-item:last-child { border-bottom-left-radius: var(--r-l); border-bottom-right-radius: var(--r-l); }
.list-item .shape { width: 44px; height: 44px; }
.list-item .shape .ms { font-size: 22px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .grow span { font-size: 13px; color: var(--on-surface-var); }
.list-item .amt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.list-item { text-decoration: none; transition: background-color var(--t-fast); }
a.list-item:hover { background: var(--sc); }

/* ============================ Оплата ============================ */
.checkout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 32px 0 48px; }
.checkout .state { display: grid; gap: 20px; align-content: center; justify-items: start; padding: clamp(24px, 4vw, 48px); border-radius: var(--r-xxl); background: var(--sc-low); }
.checkout .state .shape { width: 120px; height: 120px; }
.checkout .state .shape .ms { font-size: 56px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48; }
.test-pay { display: grid; gap: 14px; padding: 24px; border-radius: var(--r-xl); background: var(--tertiary-c); color: var(--on-tertiary-c); }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }

/* ============================ Админка ============================ */
.admin { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 24px 0 48px; align-items: start; }
.rail { position: sticky; top: calc(var(--bar-h) + 16px); display: grid; gap: 4px; }
.rail a { display: grid; justify-items: center; gap: 4px; padding: 4px 0 6px; text-decoration: none; font-size: 12px; font-weight: 600; color: var(--on-surface-var); text-align: center; }
.rail a .pill { width: 56px; height: 32px; display: grid; place-items: center; border-radius: var(--r-full); transition: background-color var(--t-fast); }
.rail a:hover .pill { background: var(--sc-high); }
.rail a[aria-current="page"] { color: var(--on-surface); }
.rail a[aria-current="page"] .pill { background: var(--secondary-c); color: var(--on-secondary-c); }
.rail a[aria-current="page"] .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .rail { position: static; display: flex; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .rail a { min-width: 76px; }
}
.admin-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head .grow { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { padding: 20px; border-radius: var(--r-xl); background: var(--sc-low); display: grid; gap: 4px; }
.tile b { font-size: 30px; line-height: 1.1; font-weight: 600; font-variation-settings: 'ROND' 100; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--on-surface-var); }
.tile.accent { background: var(--primary-c); color: var(--on-primary-c); }
.tile.accent span { color: inherit; opacity: .8; }
@media (max-width: 960px) { .tiles { grid-template-columns: 1fr 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--primary); }
.chart .bar.zero { fill: var(--sc-highest); }
.chart text { fill: var(--on-surface-var); font-size: 11px; font-family: var(--font); }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border-radius: var(--r-xl); background: var(--sc-low); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--on-surface-var); padding: 14px 16px; white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--outline-var); vertical-align: middle; }
.table tr:hover td { background: var(--sc); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table code { font-family: var(--mono); font-size: 12.5px; color: var(--on-surface-var); }
.row-actions { display: flex; gap: 4px; justify-content: end; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.editor .preview { position: sticky; top: 0; align-self: start; display: grid; gap: 12px; }
.editor .preview .card { cursor: default; background: var(--sc); }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } .editor .preview { position: static; order: -1; } }
.shape-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.shape-pick button { width: 52px; height: 52px; border: 0; padding: 6px; border-radius: var(--r-m); background: var(--sc-highest); cursor: pointer; }
.shape-pick button .shape { width: 100%; height: 100%; }
.shape-pick button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--primary); background: var(--sc); }
.hue-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; border-radius: var(--r-full); background: linear-gradient(90deg in oklch longer hue, oklch(70% .13 0), oklch(70% .13 359)); }
.hue-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sc-lowest); box-shadow: 0 0 0 3px var(--on-surface); cursor: pointer; }
.hue-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--sc-lowest); border: 3px solid var(--on-surface); cursor: pointer; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.icon-pick button { width: 40px; height: 40px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--on-surface-var); cursor: pointer; display: grid; place-items: center; }
.icon-pick button:hover { background: var(--sc-highest); color: var(--on-surface); }
.hint { font-size: 13px; color: var(--on-surface-var); line-height: 1.5; }
.hint code { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--sc-highest); color: var(--on-surface); }
.console-log { font-family: var(--mono); font-size: 13px; }

/* Скелетоны */
.skeleton { background: linear-gradient(90deg, var(--sc-low), var(--sc-high), var(--sc-low)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-xl); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { width: min(72vw, 360px); justify-self: center; order: -1; }
  .home-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================ Статистика в кабинете ============================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; border-radius: var(--r-xl); overflow: hidden; }
.stat-cell { background: var(--sc-low); padding: 20px; display: grid; gap: 6px; align-content: start; }
.stat-cell .ms { font-size: 22px; color: var(--primary); }
.stat-cell b { font-size: 28px; line-height: 1.1; font-weight: 600; font-variation-settings: 'ROND' 100; font-variant-numeric: tabular-nums; }
.stat-cell span { font-size: 13px; color: var(--on-surface-var); }
@media (max-width: 760px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.stats-two { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
@media (max-width: 960px) { .stats-two { grid-template-columns: 1fr; } }
.donate-card { display: grid; gap: 18px; align-content: start; padding: 28px; border-radius: var(--r-xl); background: var(--tertiary-c); color: var(--on-tertiary-c); }
.donate-card .big { font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variation-settings: 'ROND' 100; }
.donate-card .rows { display: grid; gap: 10px; font-size: 15px; }
.donate-card .rows div { display: flex; justify-content: space-between; gap: 12px; }
.donate-card .rows span { opacity: .8; }
.donate-card .priv { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-l); background: color-mix(in oklch, var(--on-tertiary-c) 10%, transparent); }
.donate-card .priv .shape { width: 44px; height: 44px; }
.donate-card .priv .shape .ms { font-size: 22px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.online-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

/* ============================ Карточки дня ============================ */
.cards-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.timer { font-family: var(--pixel); font-size: 28px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.deck { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; perspective: 1200px; }
@media (max-width: 960px) { .deck { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .deck { gap: 8px; } }
.gcard { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; border-radius: var(--r-l); }
.gcard:disabled { cursor: default; }
.gcard .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 720ms var(--spring); }
.gcard.flipped .inner { transform: rotateY(180deg); }
.gcard .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r-l); overflow: hidden; display: grid; place-items: center; }
.gcard .back {
  background-color: var(--primary-c); color: var(--on-primary-c);
  background-image:
    linear-gradient(45deg, color-mix(in oklch, var(--on-primary-c) 9%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in oklch, var(--on-primary-c) 9%, transparent) 75%),
    linear-gradient(45deg, color-mix(in oklch, var(--on-primary-c) 9%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in oklch, var(--on-primary-c) 9%, transparent) 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px;
  transition: transform var(--t-med) var(--spring), border-radius var(--t-med) var(--spring);
}
.gcard .back .q { width: 52%; aspect-ratio: 1; display: grid; place-items: center; background: var(--on-primary-c); color: var(--primary-c); font-family: var(--pixel); font-size: clamp(22px, 2.6vw, 36px); }
.gcard:not(:disabled):hover .back { transform: translateY(-6px) rotate(-1.5deg); border-radius: var(--r-xl); }
.gcard:not(:disabled):active .back { transform: scale(.96); }
.gcard .front {
  transform: rotateY(180deg); align-content: center; gap: 10px; padding: 12px; text-align: center;
  background: oklch(var(--tone-l) var(--rc) var(--rh)); color: oklch(var(--on-tone-l) .07 var(--rh));
}
.gcard .front .shape { width: 52%; aspect-ratio: 1; height: auto; background: oklch(var(--on-tone-l) .07 var(--rh)); color: oklch(var(--tone-l) var(--rc) var(--rh)); }
.gcard .front .shape .ms { font-size: clamp(22px, 2.6vw, 34px); font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 40; }
.gcard .front b { font-size: clamp(12px, 1.2vw, 15px); line-height: 1.2; font-weight: 600; }
.gcard .front small { font-size: 12px; opacity: .75; }
.gcard.dim .front { filter: saturate(.35); opacity: .55; }
.gcard.won { z-index: 1; }
.gcard.won .face.front { box-shadow: 0 0 0 3px oklch(var(--on-tone-l) .07 var(--rh)); }
.gcard.won.legendary .front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, oklch(100% 0 0 / .45) 50%, transparent 70%); background-size: 250% 100%;
  animation: shine 2.4s var(--ease) infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@media (max-width: 640px) { .gcard .front small { display: none; } .gcard .front { padding: 6px; gap: 6px; } }
.pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pool .tag { background: oklch(var(--tone-l) var(--rc) var(--rh)); color: oklch(var(--on-tone-l) .07 var(--rh)); }
.pool .tag em { font-style: normal; opacity: .7; font-weight: 500; }

/* ============================ Новости ============================ */
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feed .post-card:first-child.pinned { grid-column: span 2; grid-row: span 2; }
@media (max-width: 960px) { .feed { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .feed { grid-template-columns: 1fr; } .feed .post-card:first-child.pinned { grid-column: auto; grid-row: auto; } }
.post-card { display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--sc-low); overflow: hidden; text-decoration: none; color: inherit; transition: background-color var(--t-fast), border-radius var(--t-med) var(--spring); }
.post-card:hover { background: var(--sc); }
.post-card:active { border-radius: var(--r-l); }
.post-cover { position: relative; aspect-ratio: 16 / 9; background: var(--tone, var(--primary-c)); overflow: hidden; display: grid; place-items: center; }
.post-card.pinned .post-cover { aspect-ratio: auto; flex: 1; min-height: 220px; }
.post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-cover .shape { width: 34%; aspect-ratio: 1; height: auto; background: var(--on-tone); color: var(--tone); }
.post-cover .shape .ms { font-size: clamp(32px, 5vw, 64px); font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48; }
.post-body { padding: 20px 22px 22px; display: grid; gap: 8px; }
.post-body h3 { font-size: 21px; line-height: 1.25; font-weight: 560; font-variation-settings: 'ROND' 80; }
.post-card.pinned .post-body h3 { font-size: clamp(24px, 2.6vw, 32px); }
.post-body p { color: var(--on-surface-var); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--on-surface-var); }

.article { max-width: 760px; margin: 0 auto; padding: 32px 0 48px; }
.article .post-cover { border-radius: var(--r-xxl); aspect-ratio: 21 / 9; margin: 24px 0 32px; }
.prose { font-size: 18px; line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h3 { font-size: 26px; line-height: 1.25; font-weight: 560; margin-top: 1.6em; font-variation-settings: 'ROND' 80; }
.prose h4 { font-size: 20px; font-weight: 600; margin-top: 1.4em; }
.prose ul { padding-left: 0; list-style: none; display: grid; gap: 8px; }
.prose li { position: relative; padding-left: 28px; }
.prose li::before { content: ''; position: absolute; left: 4px; top: .62em; width: 10px; height: 10px; background: var(--primary); clip-path: url(#s-pixel); }
.prose a { color: var(--primary); text-underline-offset: 3px; }
.prose code { font-family: var(--pixel); font-size: .95em; padding: 2px 8px; border-radius: 8px; background: var(--primary-c); color: var(--on-primary-c); }
.prose img { border-radius: var(--r-xl); margin: 1.4em 0; }
.prose blockquote { margin: 0; padding: 16px 20px; border-radius: var(--r-l); background: var(--sc-low); color: var(--on-surface-var); }
.like-btn[aria-pressed="true"] { --bg: var(--error-c); --fg: var(--on-error-c); }
.like-btn[aria-pressed="true"] .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ============================ Карта ============================ */
.map-wrap { position: relative; height: calc(100dvh - 32px - var(--bar-h) - 96px); min-height: 420px; border-radius: var(--r-xxl); overflow: hidden; background: var(--sc-low); }
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
.map-bar .grow { flex: 1; }
@media (max-width: 760px) { .map-wrap { height: calc(100dvh - 32px - var(--bar-h) - 200px); border-radius: var(--r-xl); } }
@media (max-width: 1100px) and (min-width: 761px) { .nav a { padding: 0 12px; } .nav a span:not(.ms) { display: none; } }
.motd { font-size: 14px; color: var(--on-surface-var); }
.map-ico { width: 72px; height: 72px; background: var(--on-tone); color: var(--tone); }
.map-ico .ms { font-size: 34px; }

/* ============================ Конструктор префикса ============================ */
.prefix-page { padding: 32px 0 56px; }
.pf-steps { display: grid; gap: 8px; margin: 20px 0 28px; padding: 0; list-style: none; counter-reset: pf; }
.pf-steps li { counter-increment: pf; display: flex; gap: 12px; align-items: center; color: var(--on-surface-var); }
.pf-steps li::before { content: counter(pf); flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--secondary-c); color: var(--on-secondary-c); font-weight: 700; font-size: 14px; }
.pf-steps b { color: var(--on-surface); }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-card { background: var(--sc); border-radius: var(--r-xl); padding: 24px; display: grid; gap: 14px; }
.pf-label { font-weight: 600; margin-top: 8px; }
.pf-label small { font-weight: 400; }
.pf-check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.pf-stops { display: grid; gap: 8px; }
.pf-stop { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.pf-stop input[type=color] { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.pf-stop input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.pf-stop input[type=color]::-webkit-color-swatch { border: 0; border-radius: 14px; }
.pf-stop input[type=color]::-moz-color-swatch { border: 0; border-radius: 14px; }
.pf-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pf-preset { height: 44px; border: 0; border-radius: var(--r-m); cursor: pointer; display: grid; place-items: center; transition: border-radius var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.pf-preset span { font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / .55); }
.pf-preset:hover { border-radius: var(--r-s); transform: translateY(-1px); }
.pf-fmt { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-chat { background: #1b1b1f; border-radius: var(--r-l); padding: 18px 20px; display: grid; gap: 6px; font-family: 'Pixelify Sans', 'Onest', monospace; font-size: 20px; line-height: 1.4; color: #fff; word-break: break-word; overflow-wrap: anywhere; }
.pf-line.dim { opacity: .75; }
.pf-nick { color: #fff; }
.pf-sep { color: #aaa; }
.pf-msg { color: #e8e8e8; }
.pf-out { display: grid; gap: 10px; }
.pf-out-row { display: grid; gap: 4px; }
.pf-out-row > span { font-size: 13px; color: var(--on-surface-var); font-weight: 600; }
.pf-out-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pf-out-line .input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; text-overflow: ellipsis; }
.pf-glow { position: relative; margin-top: 8px; animation: pf-glow 2.2s ease-in-out infinite; }
.pf-glow:hover { animation-play-state: paused; box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary) 35%, transparent), 0 0 32px 6px color-mix(in oklch, var(--primary) 55%, transparent); }
@keyframes pf-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--primary) 0%, transparent), 0 0 12px 0 color-mix(in oklch, var(--primary) 35%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--primary) 22%, transparent), 0 0 34px 8px color-mix(in oklch, var(--primary) 60%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .pf-glow { animation: none; box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary) 30%, transparent), 0 0 24px 4px color-mix(in oklch, var(--primary) 45%, transparent); } }