/* ==========================================================================
   AlpGroup: стили сайта.

   Как устроено:
   1. Весь внешний вид задаётся переменными в блоках темы (summit, nexora).
      Чтобы поменять цвет, фон или стеклянность карточек, правится только тема.
   2. Компоненты (карточки, кнопки, меню) используют только переменные и
      не знают, какая тема включена.
   3. Тема переключается атрибутом data-theme на <html> (кнопка в верхней панели).
   4. Анимации отключаются у тех, кто включил «уменьшить движение» (в конце файла).
   ========================================================================== */

/* Для плавной анимации угла у бегущей подсветки рамки (Chrome, Edge, Safari) */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- 1. Тема по умолчанию: summit (горы, стекло, лайм) ---------- */
:root,
:root[data-theme="summit"] {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --accent-rgb: 182 255 46;
  --accent: rgb(var(--accent-rgb));
  --accent-2: rgb(122 222 28);
  --accent-ink: #0a1400;           /* цвет текста на лаймовой кнопке */

  --violet-rgb: 160 112 255;
  --orange-rgb: 255 138 42;
  --blue-rgb: 70 150 255;
  --red-rgb: 255 90 60;

  --text: #f1f5ee;
  --text-dim: #9ba59a;
  --text-faint: #6b756a;

  --page-bg: #05070a;
  --card-bg: linear-gradient(145deg, rgb(255 255 255 / .075), rgb(255 255 255 / .015)), rgb(11 15 13 / .58);
  --card-bg-solid: #101512;        /* запасной цвет, если браузер не умеет размытие */
  --card-border: rgb(255 255 255 / .09);
  --card-blur: 18px;
  --card-shadow: 0 10px 40px rgb(0 0 0 / .35);
  --outline-hover: rgb(var(--accent-rgb) / .75);

  --hero-art: none;                  /* в Summit справа слоистая фотография (.scene), не фон */
  --hero-art-size: cover;
  --hero-art-pos: right bottom;
  --hero-shade: linear-gradient(90deg, rgb(5 7 10 / .94) 0%, rgb(5 7 10 / .55) 42%, transparent 75%);
  --aurora-1: rgb(var(--accent-rgb) / .20);
  --aurora-2: rgb(130 90 255 / .16);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --ease-soft: cubic-bezier(.33, .1, .25, 1);   /* мягкий старт и финиш для hover */
}

/* ---------- Тема nexora (плоские тёмные карточки, ядовитый зелёный) ---------- */
:root[data-theme="nexora"] {
  --accent-rgb: 150 255 0;
  --accent: rgb(var(--accent-rgb));
  --accent-2: rgb(96 214 0);

  --page-bg: #050605;
  --card-bg: linear-gradient(160deg, #151a14 0%, #0b0e0a 100%);
  --card-bg-solid: #0e120d;
  --card-border: rgb(255 255 255 / .07);
  --card-blur: 0px;
  --card-shadow: 0 8px 30px rgb(0 0 0 / .45);

  --hero-art: url("../img/gem.svg");
  --hero-art-size: auto 92%;
  --hero-art-pos: right 7% center;
  --hero-shade: radial-gradient(ellipse 60% 120% at 80% 40%, rgb(var(--accent-rgb) / .16), transparent 70%);
  --aurora-1: rgb(var(--accent-rgb) / .13);
  --aurora-2: rgb(var(--accent-rgb) / .05);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Иконки ---------- */
.icon {
  width: 1.3em; height: 1.3em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Свечение вокруг иконки: цвет берётся из --tone (по умолчанию лаймовый) */
.glow { filter: drop-shadow(0 0 6px rgb(var(--tone, var(--accent-rgb)) / .6)); }

/* ---------- Фон страницы ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--page-bg); }
.bg::before, .bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px);
  will-change: transform;
}
.bg::before {
  width: 640px; height: 640px; left: -180px; bottom: -220px;
  background: radial-gradient(circle, var(--aurora-1), transparent 68%);
  animation: drift-a 20s ease-in-out infinite alternate;
}
.bg::after {
  width: 720px; height: 720px; right: -220px; top: -260px;
  background: radial-gradient(circle, var(--aurora-2), transparent 68%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

/* ---------- 3. Каркас страницы ---------- */
.shell {
  display: grid; grid-template-columns: 264px minmax(0, 1fr);
  gap: 24px; min-height: 100vh; padding: 20px;
  max-width: 1560px; margin: 0 auto;
}
.main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.content { display: flex; flex-direction: column; gap: 22px; padding-bottom: 24px; }

/* ---------- Полоса прокрутки: тонкая, тёмная, с лаймовым бегунком ---------- */
html { scrollbar-width: thin; scrollbar-color: rgb(var(--accent-rgb) / .45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--accent-rgb) / .35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--accent-rgb) / .7); background-clip: padding-box; }

/* Обязательные стили Lenis (из документации библиотеки) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Панели и карточки ---------- */
.panel, .card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(140%);
  backdrop-filter: blur(var(--card-blur)) saturate(140%);
  box-shadow: var(--card-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .card { background: var(--card-bg-solid); }
}

/* Карточка с ховером: приподнимается, обводка светится лаймом,
   по рамке бежит световой блик, внутри следует подсветка за курсором. */
.card {
  transition: transform .55s var(--ease-soft), border-color .45s var(--ease-soft), box-shadow .55s var(--ease-soft);
}
.card::before {                       /* бегущий блик по рамке */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--a), transparent 0 62%, rgb(var(--accent-rgb) / .95) 82%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .5s var(--ease-soft); pointer-events: none;
}
.card::after {                        /* подсветка под курсором */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(46px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--accent-rgb) / .42), transparent 72%);
  opacity: 0; transition: opacity .5s var(--ease-soft);
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: var(--outline-hover);
  box-shadow:
    0 0 0 1px rgb(var(--accent-rgb) / .5),
    0 0 12px 1px rgb(var(--accent-rgb) / .55),      /* небольшое яркое свечение у рамки */
    0 16px 48px rgb(0 0 0 / .5),
    0 0 36px rgb(var(--accent-rgb) / .16);
}
.card:hover::before, .card:focus-within::before { opacity: 1; animation: spin-a 3.2s linear infinite; }
.card:hover::after { opacity: 1; }

/* ---------- Кнопки ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border: 0; border-radius: 14px; cursor: pointer;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .45s var(--ease-soft), box-shadow .5s var(--ease-soft), background .45s var(--ease-soft), border-color .45s var(--ease-soft);
}
.btn .icon { transition: transform .5s var(--ease-soft); }
.btn:hover .icon-go { transform: translateX(5px); }

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .55), 0 8px 26px rgb(var(--accent-rgb) / .25);
}
.btn-primary::after {                 /* блик пробегает по кнопке */
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .6), transparent);
  transform: skewX(-20deg); transition: left .8s var(--ease-soft);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .9), 0 14px 38px rgb(var(--accent-rgb) / .45);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0) scale(.98); }

.btn-ghost {
  background: rgb(255 255 255 / .05); border: 1px solid var(--card-border); color: var(--text);
}
.btn-ghost:hover {
  transform: translateY(-2px); border-color: var(--outline-hover);
  background: rgb(var(--accent-rgb) / .07);
  box-shadow: 0 0 24px rgb(var(--accent-rgb) / .18);
}

.icon-btn {
  position: relative; width: 46px; height: 46px; display: grid; place-items: center; flex: none;
  border-radius: 50%; cursor: pointer; color: var(--text-dim);
  background: rgb(255 255 255 / .05); border: 1px solid var(--card-border);
  transition: transform .45s var(--ease-soft), border-color .45s var(--ease-soft), box-shadow .45s var(--ease-soft), color .45s var(--ease-soft);
}
.icon-btn:hover {
  color: var(--accent); border-color: var(--outline-hover);
  box-shadow: 0 0 22px rgb(var(--accent-rgb) / .28); transform: translateY(-2px);
}
.icon-btn:hover .icon { animation: icon-spin .8s var(--ease); }
.icon-btn:active { transform: scale(.94); }

/* ---------- Левое меню ---------- */
.sidebar {
  position: sticky; top: 20px; align-self: start; height: calc(100vh - 40px);
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 16px;
  border-radius: var(--radius-xl);
  background: var(--card-bg); border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(var(--card-blur)); backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--card-shadow);
}
.brand { display: block; padding: 2px 8px 6px; }
.brand img {
  width: 100%; max-width: 186px; height: auto;
  filter: drop-shadow(0 0 0 rgb(var(--accent-rgb) / 0));
  transition: filter .65s var(--ease-soft), transform .65s var(--ease-soft);
}
.brand:hover img { filter: drop-shadow(0 0 14px rgb(255 140 50 / .55)); transform: scale(1.03); }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 15px; color: var(--text-dim); font-weight: 500;
  border: 1px solid transparent;
  transition: transform .5s var(--ease-soft), color .4s var(--ease-soft), background .45s var(--ease-soft), border-color .45s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.nav-item .icon { width: 1.35em; height: 1.35em; transition: filter .45s var(--ease-soft); }
.nav-item:hover {
  color: var(--text); transform: translateX(5px);
  background: rgb(var(--accent-rgb) / .07); border-color: rgb(var(--accent-rgb) / .45);
  box-shadow: 0 0 26px rgb(var(--accent-rgb) / .14);
}
.nav-item:hover .icon { color: var(--accent); filter: drop-shadow(0 0 7px rgb(var(--accent-rgb) / .8)); animation: icon-pop .6s var(--ease); }
.nav-item.is-active {
  color: var(--accent-ink); font-weight: 600; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .6), 0 10px 30px rgb(var(--accent-rgb) / .3);
}
.nav-item.is-active:hover { transform: translateX(3px); }
.nav-item.is-active .icon { color: var(--accent-ink); filter: none; }
.nav-item.is-soon { opacity: .45; cursor: default; pointer-events: none; }
.nav-tag {
  margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: rgb(255 255 255 / .08); color: var(--text-dim);
}

.side-foot { margin-top: auto; }
.user-chip {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 16px; background: rgb(255 255 255 / .04); border: 1px solid var(--card-border);
  transition: border-color .45s var(--ease-soft), box-shadow .45s var(--ease-soft);
}
.user-chip:hover { border-color: var(--outline-hover); box-shadow: 0 0 22px rgb(var(--accent-rgb) / .15); }
.avatar {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 50%; font-weight: 700; text-transform: uppercase;
  color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgb(var(--accent-rgb) / .4);
}
.user-meta { min-width: 0; line-height: 1.25; }
.user-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 12px; color: var(--text-dim); }
.user-chip form { margin-left: auto; }
.user-chip .icon-btn { width: 36px; height: 36px; }

/* ---------- Верхняя панель ---------- */
.topbar { display: flex; align-items: center; gap: 14px; }
.burger { display: none; }
.search {
  flex: 1; max-width: 480px; display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 16px; border-radius: 999px; color: var(--text-dim);
  background: var(--card-bg); border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(var(--card-blur)); backdrop-filter: blur(var(--card-blur));
  transition: border-color .45s var(--ease-soft), box-shadow .55s var(--ease-soft), max-width .65s var(--ease-soft);
}
.search:hover { border-color: rgb(var(--accent-rgb) / .4); }
.search:focus-within {
  max-width: 560px; color: var(--accent); border-color: var(--outline-hover);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .12), 0 0 30px rgb(var(--accent-rgb) / .22);
}
/* Выше по весу, чем общие правила полей ниже: внутри пилюли у поля нет своей рамки и фона */
.search input[type="search"] {
  flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 0; outline: 0;
  background: transparent; box-shadow: none; color: var(--text); font: inherit;
}
.search input[type="search"]::placeholder { color: var(--text-faint); }
.kbd {
  font-size: 12px; padding: 2px 8px; border-radius: 8px; color: var(--text-faint);
  border: 1px solid var(--card-border); background: rgb(255 255 255 / .04);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
/* Тема: показываем нужную иконку */
.theme-toggle .i-sun { display: none; }
:root[data-theme="nexora"] .theme-toggle .i-sun { display: block; }
:root[data-theme="nexora"] .theme-toggle .i-moon { display: none; }

/* ---------- Заголовок страницы ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.muted { color: var(--text-dim); }
.accent-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Главная: герой ---------- */
.hero {
  touch-action: pan-y;               /* вертикально прокручиваем страницу, всё остальное отдаём эффектам (волны от пальца) */
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 440px; padding: 36px 44px; display: flex; flex-direction: column; justify-content: center; gap: 16px;
  border-radius: var(--radius-xl);
  background: #070a10; border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
}
.hero::before {                       /* картинка справа */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--hero-art) var(--hero-art-pos) / var(--hero-art-size) no-repeat;
}
.hero::after {                        /* затемнение слева, чтобы читался текст */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-shade);
}
.hero h1 {
  max-width: 560px; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.1;
  font-weight: 700; letter-spacing: -.025em;
}
.hero p { max-width: 440px; color: var(--text-dim); font-size: 16px; }
.eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 99px; font-size: 13px; color: var(--accent);
  background: rgb(var(--accent-rgb) / .1); border: 1px solid rgb(var(--accent-rgb) / .3);
}
.eyebrow i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); animation: beacon 2s ease-in-out infinite;
}
.hero .btn { align-self: flex-start; margin-top: 6px; }


/* Фото горы слоями (Summit): справа, левый край растворяется в тёмном фоне */
.scene {
  position: absolute; z-index: -2; top: 0; right: 0; bottom: 0; width: min(62%, 780px); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38%);
  mask-image: linear-gradient(90deg, transparent 0, #000 38%);
}
.layer-fx { opacity: 0; transition: opacity .6s var(--ease-soft); }   /* WebGL-копия фото с рябью; видна, когда готова */
.scene.is-gl .layer-fx { opacity: 1; }
.layer {
  position: absolute; left: -6%; top: -6%; width: 112%; height: 112%; max-width: none;
  object-fit: cover; object-position: 50% 18%;
  will-change: transform; pointer-events: none; user-select: none;
}
[data-theme="nexora"] .scene { display: none; }                /* у Nexora на этом месте кристалл */

/* Логотип: картинка и поверх неё канвас с бликами; оба с одной раскладкой */
.logo3d {
  /* светлая обводка по контуру и мягкое свечение под самим логотипом (по альфе, не по прямоугольнику) */
  --logo-halo: drop-shadow(0 0 1.5px rgb(255 255 255 / 1)) drop-shadow(0 0 3px rgb(255 255 255 / .6)) drop-shadow(0 0 14px rgb(255 255 255 / .5)) drop-shadow(0 8px 20px rgb(0 0 0 / .55));
  --logo-halo-sm: drop-shadow(0 0 1px rgb(255 255 255 / 1)) drop-shadow(0 0 3px rgb(255 255 255 / .55)) drop-shadow(0 0 9px rgb(255 255 255 / .38));
}
.logo3d { position: relative; display: block; will-change: transform; }
.logo3d-hero { position: absolute; z-index: 2; right: 6%; top: 15%; width: min(400px, 34%); filter: var(--logo-halo); }
.logo3d-sm { filter: var(--logo-halo-sm); width: 100%; max-width: 186px; transition: filter .65s var(--ease-soft), transform .65s var(--ease-soft); }
.brand:hover .logo3d-sm { filter: var(--logo-halo-sm) drop-shadow(0 0 14px rgb(255 140 50 / .55)); transform: scale(1.03); }
.hero-mid { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 560px; will-change: transform; }
.logo3d-img { display: block; width: 100%; height: auto; transition: opacity .5s var(--ease-soft); }
.logo3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .5s var(--ease-soft); pointer-events: none; }
.logo3d.is-gl .logo3d-canvas { opacity: 1; }
.logo3d.is-gl .logo3d-img { opacity: 0; }                        /* остаётся в разметке (alt, размеры), но не виден */

/* ---------- Карточки со статистикой ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 22px; }
.icon-tile {
  --tone: var(--accent-rgb);
  width: 56px; height: 56px; flex: none; display: grid; place-items: center;
  border-radius: 18px; color: rgb(var(--tone));
  background: radial-gradient(circle at 30% 25%, rgb(var(--tone) / .28), rgb(var(--tone) / .08));
  border: 1px solid rgb(var(--tone) / .4);
  box-shadow: inset 0 0 18px rgb(var(--tone) / .14), 0 0 22px rgb(var(--tone) / .18);
  transition: transform .6s var(--ease-soft), box-shadow .55s var(--ease-soft);
}
.icon-tile .icon {
  width: 28px; height: 28px;
  filter: drop-shadow(0 0 3px rgb(var(--tone) / .45));
  transition: filter .6s var(--ease-soft);
}
.stat .icon-tile .icon { animation: float 5s ease-in-out infinite, glow-pulse 3.2s ease-in-out infinite; }  /* только у крупных цифр */
.stat:hover .icon-tile, .item:hover .icon-tile, .row:hover .icon-tile, .pick:hover .icon-tile {
  transform: scale(1.1) rotate(-5deg); box-shadow: inset 0 0 18px rgb(var(--tone) / .25), 0 0 34px rgb(var(--tone) / .5);
}
/* Блик по плитке иконки: сам пробегает раз в несколько секунд (у соседних со сдвигом), при наведении ускоряется */
.icon-tile { position: relative; overflow: hidden; isolation: isolate; }
.icon-tile::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -80%; width: 55%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .55) 45%, rgb(var(--tone) / .5) 55%, transparent);
  transform: skewX(-18deg); mix-blend-mode: soft-light;
  animation: tile-sheen 7s var(--ease-soft) infinite; animation-delay: calc(var(--i, 0) * 1.1s);
}
.stat:hover .icon-tile::after, .item:hover .icon-tile::after, .row:hover .icon-tile::after, .pick:hover .icon-tile::after { animation-duration: 1.4s; animation-delay: 0s; }
@keyframes tile-sheen { 0%, 70% { left: -80%; } 100% { left: 140%; } }
/* Большой блок со списком (.block) сам иконки не трогает: оживает только строка под курсором */
.stat:hover .icon-tile .icon { animation: float 5s ease-in-out infinite, glow-pulse 1.2s ease-in-out infinite; }
.item:hover .icon-tile .icon, .row:hover .icon-tile .icon, .pick:hover .icon-tile .icon { animation: float 3.2s ease-in-out infinite, glow-pulse 1.6s ease-in-out infinite; }
.tone-violet { --tone: var(--violet-rgb); }
.tone-orange { --tone: var(--orange-rgb); }
.tone-blue { --tone: var(--blue-rgb); }
.tone-red { --tone: var(--red-rgb); }
.tone-grey { --tone: 150 160 150; }

.stat-value { font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 20px; font-weight: 600; margin-left: 2px; color: var(--text-dim); }
.stat-label { margin-top: 4px; font-size: 13px; color: var(--text-dim); }

/* Кольцо готовности: рисуется само при загрузке */
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.ring-bg { stroke: rgb(255 255 255 / .08); }
.ring-fg {
  stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--pct, 0));
  filter: drop-shadow(0 0 5px rgb(var(--accent-rgb) / .8));
  animation: ring-draw 1.6s var(--ease) .4s both;
}
.ring .ring-icon {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent);
}
.ring .ring-icon .icon { width: 26px; height: 26px; animation: glow-pulse 3.2s ease-in-out infinite; }

/* ---------- Двухколоночные блоки ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.block { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.block-head h2 { font-size: 18px; font-weight: 600; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); transition: color .4s var(--ease-soft); }
.link-more .icon { width: 1em; height: 1em; transition: transform .45s var(--ease-soft); }
.link-more:hover { color: var(--accent); }
.link-more:hover .icon { transform: translateX(4px); }

/* Список операций и быстрых ссылок: у строки при наведении лаймовая обводка */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 16px;
  border: 1px solid transparent; background: rgb(255 255 255 / .03);
  transition: transform .5s var(--ease-soft), border-color .45s var(--ease-soft), background .45s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.row:hover {
  transform: translateX(4px); border-color: rgb(var(--accent-rgb) / .55);
  background: rgb(var(--accent-rgb) / .06);
  box-shadow: 0 0 10px 1px rgb(var(--accent-rgb) / .5), 0 0 24px rgb(var(--accent-rgb) / .13);
}
.row .icon-tile { width: 42px; height: 42px; border-radius: 14px; }
.row .icon-tile .icon { width: 21px; height: 21px; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.row > .icon:last-child { color: var(--text-faint); transition: transform .45s var(--ease-soft), color .45s var(--ease-soft); }
.row:hover > .icon:last-child { color: var(--accent); transform: translateX(4px); }
.empty { padding: 26px 8px; text-align: center; color: var(--text-dim); }
.empty.ok { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--accent); --tone: var(--accent-rgb); }
.empty.ok .icon { width: 34px; height: 34px; animation: float 5s ease-in-out infinite, glow-pulse 3.2s ease-in-out infinite; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.row.is-cancelled { opacity: .5; }
.row.is-cancelled .row-title { text-decoration: line-through; text-decoration-color: rgb(255 255 255 / .35); }
.tag-cancel { margin-left: 6px; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 99px; color: var(--text-dim); background: rgb(255 255 255 / .08); }

/* ---------- Журнал и отмена ---------- */
.journal { display: flex; flex-direction: column; gap: 14px; }
.entry-meta { margin-left: 8px; font-size: 13px; font-weight: 400; }
.more { text-align: center; margin-top: 8px; }
.row-link { color: inherit; transition: color .4s var(--ease-soft); }
.row-link:hover { color: var(--accent); }
.cancel-form { flex: none; display: inline-flex; }
.btn-cancel {
  flex: none; padding: 6px 14px; border-radius: 99px; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--text-dim); background: rgb(255 255 255 / .04); border: 1px solid var(--card-border);
  transition: color .4s var(--ease-soft), border-color .45s var(--ease-soft), background .45s var(--ease-soft), box-shadow .45s var(--ease-soft), transform .45s var(--ease-soft);
}
.btn-cancel:hover { color: rgb(var(--red-rgb)); border-color: rgb(var(--red-rgb) / .6); box-shadow: 0 0 14px rgb(var(--red-rgb) / .3); }
.btn-cancel.is-armed {                     /* второй шаг: «Точно отменить?» */
  color: #fff; background: rgb(var(--red-rgb) / .85); border-color: rgb(var(--red-rgb)); box-shadow: 0 0 18px rgb(var(--red-rgb) / .55);
}
.btn-cancel.is-off { opacity: .35; cursor: not-allowed; }
.btn-cancel.is-off:hover { color: var(--text-dim); border-color: var(--card-border); box-shadow: none; }

/* Набор в журнале: одна строка-«гармошка», раскрывается в список позиций */
.entry-set > summary { list-style: none; cursor: pointer; }
.entry-set > summary::-webkit-details-marker { display: none; }
.entry-set .chev { flex: none; color: var(--text-faint); transition: rotate .5s var(--ease-soft), color .4s var(--ease-soft); }
.row > .chev:last-child, .row:hover > .chev:last-child { transform: none; }
.row:hover > .chev:last-child { color: var(--accent); }
.entry-set[open] > summary .chev { rotate: 180deg; }
.entry-set[open] > summary { margin-bottom: 8px; }
.sub-rows { margin: 0 0 4px 22px; padding-left: 14px; border-left: 1px solid rgb(var(--accent-rgb) / .28); }

/* ---------- Инвентарь ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 99px; font-size: 14px; color: var(--text-dim);
  background: rgb(255 255 255 / .04); border: 1px solid var(--card-border);
  transition: transform .45s var(--ease-soft), color .4s var(--ease-soft), border-color .45s var(--ease-soft), background .45s var(--ease-soft), box-shadow .45s var(--ease-soft);
}
.chip:hover { color: var(--text); transform: translateY(-2px); border-color: var(--outline-hover); box-shadow: 0 0 20px rgb(var(--accent-rgb) / .18); }
.chip.is-active {
  color: var(--accent-ink); font-weight: 600; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgb(var(--accent-rgb) / .35);
}
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-group { margin-top: 6px; }
.cat-group[open] > .cat-title { margin-bottom: 14px; }
.cat-title { cursor: pointer; list-style: none; transition: text-shadow .5s var(--ease-soft); }
.cat-title::-webkit-details-marker { display: none; }
.cat-title:hover { text-shadow: 0 0 30px rgb(var(--accent-rgb) / .6); }
.cat-title .chev { margin-left: auto; align-self: center; width: 26px; height: 26px; color: var(--accent); text-shadow: none; transition: rotate .5s var(--ease-soft); }
.cat-group[open] > .cat-title .chev { rotate: 180deg; }
.cat-group > .grid-items { padding-bottom: 6px; }
.cat-title {
  display: flex; align-items: baseline; gap: 14px; margin-top: 8px;
  font-size: clamp(22px, 2.4vw, 32px); font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); text-shadow: 0 0 24px rgb(var(--accent-rgb) / .35);
  min-width: 0; overflow-wrap: anywhere;      /* длинное название категории переносится, а не уводит стрелку за край */
}
.cat-title span, .cat-title .chev { flex: none; }
.cat-title span { font-size: clamp(18px, 1.8vw, 24px); font-weight: 700; letter-spacing: 0; color: var(--text); text-shadow: none; padding: 2px 12px; border-radius: 99px; background: rgb(var(--accent-rgb) / .14); border: 1px solid rgb(var(--accent-rgb) / .4); }
.section-title { display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 600; }
.section-title span { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.grid-items { display: flex; flex-direction: column; gap: 12px; }       /* один элемент на всю ширину */
.item { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.item:hover { transform: translateY(-2px); }
.item .icon-tile { width: 44px; height: 44px; border-radius: 14px; }
.item .icon-tile .icon { width: 22px; height: 22px; }
.item-main { flex: 0 1 260px; min-width: 0; }          /* статус стоит рядом с названием */
.item-extra { flex: 1; min-width: 0; }
.item-extra:empty { display: none; }
.item-site { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; font-size: 14px; color: var(--text-dim); }
.item-site .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.item-site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-photo { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 14px; border: 1px solid rgb(var(--accent-rgb) / .35); box-shadow: 0 0 18px rgb(var(--accent-rgb) / .15); transition: transform .6s var(--ease-soft), box-shadow .55s var(--ease-soft); }
.item:hover .item-photo { transform: scale(1.06); box-shadow: 0 0 26px rgb(var(--accent-rgb) / .4); }
.item-name { font-weight: 600; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meter { flex: none; margin-left: auto; width: min(300px, 34%); display: flex; flex-direction: column; gap: 6px; }
.item > .pill { flex: none; min-width: 132px; justify-content: center; }
.item-meta { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  --tone: var(--accent-rgb);
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: rgb(var(--tone)); background: rgb(var(--tone) / .12); border: 1px solid rgb(var(--tone) / .35);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
/* Цвет иконки карточки инструмента зависит от статуса */
.item[data-status="issued"] .icon-tile { --tone: var(--violet-rgb); }
.item[data-status="servicing"] .icon-tile { --tone: var(--orange-rgb); }
.item[data-status="missing"] .icon-tile { --tone: var(--red-rgb); }
.item[data-status="written_off"] .icon-tile { --tone: 150 160 150; }
.pick[data-status="servicing"] .icon-tile { --tone: var(--orange-rgb); }
.pick[data-status="missing"] .icon-tile { --tone: var(--red-rgb); }
.pick > .pill { flex: none; margin-left: auto; }
.pill--issued { --tone: var(--violet-rgb); }
.pill--servicing { --tone: var(--orange-rgb); }
.pill--missing { --tone: var(--red-rgb); }
.pill--written_off, .pill--empty { --tone: 150 160 150; }

.meter { height: 8px; border-radius: 99px; background: rgb(255 255 255 / .08); overflow: hidden; }
.meter i {
  display: block; height: 100%; width: calc(var(--v, 0) * 1%); border-radius: inherit; transform-origin: left;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / .7); animation: grow 1.1s var(--ease) both;
}
.meter-caption { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.meter-caption b { color: var(--text); font-weight: 600; }

/* ---------- Формы и вход ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--text-dim); }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; padding: 13px 15px; border-radius: 13px; color: var(--text); font: inherit;
  background: rgb(255 255 255 / .05); border: 1px solid var(--card-border); outline: 0;
  transition: border-color .45s var(--ease-soft), box-shadow .5s var(--ease-soft), background .45s var(--ease-soft);
}
input:hover, select:hover, textarea:hover { border-color: rgb(var(--accent-rgb) / .4); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: rgb(255 255 255 / .07);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2), 0 0 14px 1px rgb(var(--accent-rgb) / .6), 0 0 34px rgb(var(--accent-rgb) / .28);
}
/* Заполненное поле (класс ставит скрипт): спокойное зелёное свечение, чтобы сразу было видно, что уже введено */
input.is-filled, .dd-btn.is-filled {
  border-color: rgb(var(--accent-rgb) / .5);
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .16), 0 0 16px rgb(var(--accent-rgb) / .16);
}
input.is-filled:focus { border-color: var(--accent); }
select { appearance: none; }
select option { background: #0e1410; color: #e9f0e6; }       /* на случай, если скрипт не загрузился */

/* ---------- Свой выпадающий список (скрипт заменяет им обычный select) ---------- */
.dd { position: relative; }
.dd-native { display: none; }
.dd-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-radius: 13px; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  background: rgb(255 255 255 / .05); border: 1px solid var(--card-border); outline: 0;
  transition: border-color .45s var(--ease-soft), box-shadow .5s var(--ease-soft), background .45s var(--ease-soft);
}
.dd-btn:hover { border-color: rgb(var(--accent-rgb) / .4); }
.dd-btn:focus-visible, .dd.is-open .dd-btn {
  border-color: var(--accent); background: rgb(255 255 255 / .07);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2), 0 0 14px 1px rgb(var(--accent-rgb) / .6), 0 0 34px rgb(var(--accent-rgb) / .28);
}
.dd-btn.is-placeholder .dd-label { color: var(--text-faint); }
.dd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { width: 20px; height: 20px; flex: none; color: var(--accent); transition: transform .5s var(--ease-soft), filter .5s var(--ease-soft); filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / .6)); }
.dd.is-open .dd-caret { transform: rotate(180deg); }
.dd-panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 16px;
  background: var(--card-bg-solid); border: 1px solid rgb(var(--accent-rgb) / .55);
  box-shadow: 0 0 12px 1px rgb(var(--accent-rgb) / .4), 0 24px 60px rgb(0 0 0 / .6);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top;
  transition: opacity .4s var(--ease-soft), transform .5s var(--ease-soft), visibility 0s linear .4s;
}
.dd-up .dd-panel { top: auto; bottom: calc(100% + 8px); transform-origin: bottom; transform: translateY(8px) scale(.98); }
.dd.is-open .dd-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 11px;
  cursor: pointer; color: var(--text-dim);
  transition: background .35s var(--ease-soft), color .35s var(--ease-soft), box-shadow .4s var(--ease-soft);
}
.dd-opt.is-active { background: rgb(var(--accent-rgb) / .12); color: var(--text); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .4); }
.dd-opt[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.dd-opt.is-empty { color: var(--text-faint); }
.dd-opt .icon { width: 16px; height: 16px; flex: none; opacity: 0; }
.dd-opt[aria-selected="true"] .icon { opacity: 1; filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / .7)); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 34px 32px; display: flex; flex-direction: column; gap: 22px; }
.auth-card .brand { padding: 0; }
.auth-card .btn { justify-content: center; width: 100%; }
.form-error { padding: 12px 14px; border-radius: 12px; font-size: 14px; color: rgb(var(--red-rgb)); background: rgb(var(--red-rgb) / .1); border: 1px solid rgb(var(--red-rgb) / .35); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Всплывающие сообщения ---------- */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 12px; width: min(360px, calc(100vw - 40px)); }
.toast {
  --tone: var(--accent-rgb); --ttl: 5s;
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px;
  background: rgb(14 18 16 / .88); border: 1px solid rgb(var(--tone) / .45);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgb(0 0 0 / .5), 0 0 30px rgb(var(--tone) / .18);
  animation: toast-in .6s var(--ease) both;
}
.toast.is-leaving { animation: toast-out .4s ease forwards; }
.toast--error { --tone: var(--red-rgb); }
.toast--warning { --tone: var(--orange-rgb); }
.toast-icon {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  color: var(--accent-ink); background: rgb(var(--tone)); box-shadow: 0 0 18px rgb(var(--tone) / .6);
}
.toast-icon .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.toast-text { flex: 1; font-weight: 500; }
.toast-close { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer; transition: color .2s var(--ease-soft), background .2s var(--ease-soft); }
.toast-close:hover { color: var(--text); background: rgb(255 255 255 / .08); }
.toast::after {                       /* полоска таймера */
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: rgb(var(--tone)); box-shadow: 0 0 10px rgb(var(--tone));
  transform-origin: left; animation: timer var(--ttl) linear forwards;
}

/* ---------- Операции: форма выдачи и приёма ---------- */
.op-form { display: flex; flex-direction: column; gap: 18px; }
#positions { display: flex; flex-direction: column; gap: 14px; }
.op-head { position: relative; z-index: 20; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; padding: 18px; }
.field-error { font-size: 13px; color: rgb(var(--red-rgb)); }
.form-error ul { margin: 6px 0 0 18px; }
.pick-head { max-width: 420px; }
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 16px;
  background: rgb(255 255 255 / .03); border: 1px solid var(--card-border);
  transition: transform .5s var(--ease-soft), border-color .45s var(--ease-soft), background .45s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
label.pick { cursor: pointer; }
.pick:hover {
  border-color: rgb(var(--accent-rgb) / .55); background: rgb(var(--accent-rgb) / .06);
  box-shadow: 0 0 10px 1px rgb(var(--accent-rgb) / .5), 0 0 24px rgb(var(--accent-rgb) / .13);
}
.pick.is-selected { border-color: rgb(var(--accent-rgb) / .6); background: rgb(var(--accent-rgb) / .08); }
.pick.is-hidden { display: none; }
.pick input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.pick-check {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px;
  border: 1.5px solid rgb(255 255 255 / .28); color: transparent;
  transition: background .4s var(--ease-soft), border-color .4s var(--ease-soft), color .4s var(--ease-soft), box-shadow .45s var(--ease-soft);
}
.pick-check .icon { width: 14px; height: 14px; }
.pick.is-selected .pick-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 14px rgb(var(--accent-rgb) / .6); }
.pick input:focus-visible ~ .pick-check { outline: 2px solid rgb(var(--accent-rgb) / .8); outline-offset: 2px; }
.pick .icon-tile { width: 42px; height: 42px; border-radius: 14px; }
.pick .icon-tile .icon { width: 21px; height: 21px; }
.pick .item-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pick .item-name, .pick .item-meta { display: block; }
/* Количество ручного инструмента: цифра между двумя большими зелёными стрелками, рядом с названием */
.pick--qty .item-main { flex: 0 1 260px; }
.qty { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.qty input {
  width: 64px; padding: 6px 2px; text-align: center; border-radius: 12px;
  font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--accent);
  text-shadow: 0 0 14px rgb(var(--accent-rgb) / .55);
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input::placeholder { color: rgb(var(--accent-rgb) / .35); text-shadow: none; }
.qty-btn {
  width: 40px; height: 46px; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 0; background: none; color: var(--accent);      /* просто треугольник, без окна */
  transition: transform .45s var(--ease-soft), color .4s var(--ease-soft), opacity .4s var(--ease-soft);
}
.qty-btn .icon {
  width: 30px; height: 30px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / .6));
  transition: filter .5s var(--ease-soft);
}
.qty-btn:hover { transform: scale(1.2); color: #d6ff6b; }
.qty-btn:hover .icon { filter: drop-shadow(0 0 7px rgb(var(--accent-rgb) / .95)) drop-shadow(0 0 16px rgb(var(--accent-rgb) / .6)); }
.qty-btn:active { transform: scale(.9); }
.qty-btn:disabled { opacity: .22; cursor: default; transform: none; }
.qty-btn:disabled .icon { filter: none; }
.qty-of { margin-left: 8px; font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.op-bar { position: sticky; bottom: 16px; z-index: 5; background: var(--card-bg-solid); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.op-count { color: var(--text-dim); }
.op-count b { color: var(--text); font-size: 18px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::after { display: none; }
@media (max-width: 900px) { .op-head { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .pick--qty { flex-wrap: wrap; } .pick--qty .item-main { flex: 1 1 140px; } }
@media (max-width: 520px) { .qty-of { display: none; } .qty-btn { width: 34px; } .qty input { width: 52px; } }

/* ---------- Бегущий блик по рамке при наведении (как у карточек) ---------- */
.row, .pick, .chip:not(.is-active), .nav-item:not(.is-active) { position: relative; }
.row::before, .pick::before, .chip:not(.is-active)::before, .nav-item:not(.is-active)::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0 62%, rgb(var(--accent-rgb) / .95) 82%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .5s var(--ease-soft);
}
.row:hover::before, .pick:hover::before, .chip:not(.is-active):hover::before, .nav-item:not(.is-active):hover::before {
  opacity: 1; animation: spin-a 3.2s linear infinite;
}

/* Редкий блик, пробегающий по активному пункту меню и активному фильтру (как на кнопках) */
.nav-item.is-active, .chip.is-active { position: relative; overflow: hidden; }
.nav-item.is-active::after, .chip.is-active::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .5), transparent);
  transform: skewX(-20deg); animation: shine-idle 6s ease-in-out infinite;
}
@keyframes shine-idle { 0%, 65% { left: -70%; } 100% { left: 130%; } }

/* ---------- 4. Анимации ---------- */
.reveal { animation: reveal .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }

@keyframes reveal { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes spin-a { to { --a: 360deg; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgb(var(--tone, var(--accent-rgb)) / .45)); }
  50% { filter: drop-shadow(0 0 11px rgb(var(--tone, var(--accent-rgb)) / .95)); }
}
@keyframes icon-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes icon-spin { to { transform: rotate(360deg); } }
@keyframes beacon { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(1.5); } }
@keyframes ring-draw { from { stroke-dashoffset: 100; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes drift-a { to { transform: translate(120px, -80px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-100px, 90px) scale(1.1); } }
@keyframes timer { to { transform: scaleX(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.96); } }

/* ---------- 5. Адаптивность ---------- */
.scrim { display: none; }
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }   /* просто 1fr растягивается по самой длинной строке и даёт горизонтальный скролл */
  /* Заставка в узком блоке (телефон, планшет, ноутбук с боковым меню): фото на всю ширину,
     без растворения слева, чтобы гору и волны на ней было видно целиком */
  .hero { padding: 30px 32px; min-height: 400px; }
  .scene { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .logo3d-hero { position: static; order: -1; align-self: flex-start; width: min(240px, 66%); margin-bottom: 4px; }   /* в узком блоке логотип над текстом, а не поверх горы и заголовка */
  /* Гора видна целиком: лёгкое затемнение сверху и снизу вместо сплошной заливки,
     а читаемость текста держат тени и размытое пятно прямо под ним (.hero-mid::before) */
  [data-theme="summit"] .hero::after { background: linear-gradient(180deg, rgb(5 7 10 / .35) 0%, rgb(5 7 10 / .1) 45%, rgb(5 7 10 / .55) 100%); }
  .hero-mid { isolation: isolate; }
  .hero-mid::before {
    content: ""; position: absolute; z-index: -1; inset: -18px -26px; border-radius: 40px; pointer-events: none;
    background: radial-gradient(closest-side, rgb(5 7 10 / .55), rgb(5 7 10 / .25) 70%, transparent);
    filter: blur(14px);
  }
  .hero h1 { text-shadow: 0 1px 2px rgb(0 0 0 / .7), 0 4px 22px rgb(0 0 0 / .65); }
  .hero h1 .accent-text { text-shadow: none; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .6)) drop-shadow(0 3px 12px rgb(0 0 0 / .55)); }   /* у текста с градиентом text-shadow лёг бы поверх букв */
  .hero p { color: #dfe6dc; text-shadow: 0 1px 2px rgb(0 0 0 / .85), 0 2px 14px rgb(0 0 0 / .7); }
  .hero .eyebrow { background: rgb(8 12 8 / .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .hero .btn-primary { box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / .55), 0 8px 26px rgb(0 0 0 / .5); }
}
@media (max-width: 900px) {
  .hero { padding: 26px 22px; min-height: 380px; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 16px; }
  .burger { display: grid; }
  .sidebar {
    position: fixed; z-index: 60; left: 12px; top: 12px; bottom: 12px; height: auto; width: min(290px, calc(100vw - 24px));
    transform: translateX(-120%); transition: transform .65s var(--ease-soft);
    background: var(--card-bg-solid);
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / .6); animation: reveal .3s ease both; }
  :root { --card-blur: 8px; }        /* слабым телефонам тяжело большое размытие */
}
@media (max-width: 700px) {
  /* Компактные строки: меньше отступы и иконки, название максимум в две строки,
     чтобы на экран телефона влезало больше позиций */
  .item { flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; border-radius: var(--radius-md); }
  .item .icon-tile, .item-photo { width: 38px; height: 38px; border-radius: 12px; }
  .item .icon-tile .icon { width: 19px; height: 19px; }
  .item-main { flex: 1 1 0; }
  .item-name { font-size: 15px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .item-meta { font-size: 12px; }
  .item > .pill { min-width: 0; padding: 3px 9px; font-size: 11px; }
  .item-extra { order: 2; flex: 1 1 100%; padding-left: 50px; }     /* адрес под названием, с отступом на ширину иконки */
  .item-site { font-size: 13px; white-space: normal; align-items: flex-start; }   /* длинный адрес переносится, а не обрезается */
  .item-site .icon { margin-top: 2px; }
  .cat-title { font-size: clamp(17px, 5.2vw, 22px); letter-spacing: .02em; gap: 10px; }   /* «ЭЛЕКТРОИНСТРУМЕНТ» влезает в строку целиком */
  .cat-title span { font-size: 15px; padding: 1px 10px; }
  .cat-title .chev { width: 22px; height: 22px; }
  .item-meter { order: 3; width: 100%; gap: 4px; }
  .meter { height: 6px; }
  .meter-caption { font-size: 12px; }

  .rows { gap: 6px; }
  .row { gap: 10px; padding: 8px 10px; border-radius: 14px; }
  .row .icon-tile, .pick .icon-tile { width: 36px; height: 36px; border-radius: 12px; }
  .row .icon-tile .icon, .pick .icon-tile .icon { width: 18px; height: 18px; }
  .row-title { font-size: 14px; }
  .row-sub { font-size: 12px; }

  .pick-list { gap: 8px; }
  .pick { gap: 10px; padding: 8px 12px; border-radius: 14px; }
  .pick > .pill { padding: 3px 9px; font-size: 11px; }
  .grid-items { gap: 8px; }
}
@media (max-width: 520px) {
  .stats { gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .stat-value { font-size: 28px; }
  .icon-tile { width: 48px; height: 48px; border-radius: 16px; }
  .ring { width: 52px; height: 52px; }
  .kbd { display: none; }
  .block { padding: 16px; }
  .row-end { display: none; }
}
@media (max-width: 520px) {
  /* Журнал: кнопки отмены поменьше, вложенный список набора с меньшим отступом, чтобы осталось место под текст */
  .entry.block { padding: 10px; }
  .btn-cancel { padding: 5px 10px; font-size: 12px; }
  .sub-rows { margin-left: 8px; padding-left: 8px; }
}
@media (max-width: 420px) {
  /* Статус уходит строкой ниже, под название: само название получает всю ширину */
  .item-main { flex: 1 1 calc(100% - 50px); }                          /* название на всю строку: остальное переносится ниже */
  .item > .pill { order: 2; margin-left: 50px; }
  .item-extra { order: 3; flex: 1 1 0; padding-left: 0; }              /* адрес рядом со статусом, в той же строке */
  .item-meter { order: 3; flex: 1 1 0; width: auto; min-width: 0; }    /* у количественных счётчик тоже рядом со статусом */
  .cat-title { font-size: clamp(15px, 4.9vw, 20px); letter-spacing: 0; }
}
@media (max-width: 360px) {
  .item-extra { flex: 1 1 100%; padding-left: 50px; }     /* совсем узко: адрес и счётчик своей строкой */
  .item-meter { flex: 1 1 100%; }
}
@media (max-width: 330px) {
  .stats { grid-template-columns: 1fr; }
}

/* ---------- 6. Режим «меньше движения» ----------
   Включается только явно: localStorage.setItem("motion", "reduced") в консоли браузера
   (вернуть: localStorage.removeItem("motion")). Флаг системы prefers-reduced-motion не учитываем:
   в Windows при выключенных анимациях он делал сайт «мёртвым» (DECISIONS, раздел 18). */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  transition-duration: .01ms !important; scroll-behavior: auto !important;
}
:root[data-motion="reduced"] .reveal { animation: none; opacity: 1; }
:root[data-motion="reduced"] .card:hover, :root[data-motion="reduced"] .item:hover { transform: none; }

/* Фото на странице позиции */
.photo-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo-card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-2, transparent); }
.photo-card.is-main { border-color: var(--accent); box-shadow: 0 0 22px rgb(var(--accent-rgb) / .2); }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-main { font-size: 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.photo-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
