/* Hallmark v2.0.0 · genre: atmospheric · theme: custom by request (hacker / web3: dark grid, acid lime for agents, ice for markets, mono as material) · deal: manual (no Node) · signature: live network map of agents in the hero */
/* critique: one lime signal, one cool; mono carries what machines wrote; motion is the content, all of it stops under reduced motion */
/* waive 54/67: mono is the material here (log, readouts, hashes) — labels stay sentence case and untracked */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--color-paper);
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
}
::selection { background: var(--color-accent-soft); color: var(--color-ink); }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; transition: none; }

.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: var(--space-lg); } }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero; }

/* Фоновые маленькие глаза: под контентом, над сеткой фона */
.watchers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
main, .foot { position: relative; z-index: 1; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--color-paper) 82%, transparent); backdrop-filter: blur(10px); border-bottom: var(--rule-hair) solid var(--color-rule); }
.nav__in { display: flex; align-items: center; gap: var(--space-lg); min-height: 60px; }
.wordmark { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-sm); color: var(--color-ink); text-decoration: none; }
.wordmark__slash { color: var(--color-accent); }
.nav__links { display: none; gap: var(--space-md); margin-inline-start: auto; }
.nav__links a { font-size: var(--text-sm); color: var(--color-muted); text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.nav__links a:hover { color: var(--color-ink); }
.nav__cta { margin-inline-start: auto; }
@media (min-width: 860px) { .nav__links { display: flex; } .nav__cta { margin-inline-start: 0; } }
.in-tg .nav__cta { display: none; } /* внутри Telegram бот уже открыт */
/* Кнопка «наверх»: справа снизу, над нижней панелью вкладок */
.to-top { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 19; display: grid; justify-items: center; gap: 0; width: 52px; padding: 6px 0 5px; border: var(--rule-hair) solid var(--color-accent); border-radius: var(--radius-pill); background: color-mix(in oklab, var(--color-paper-3) 90%, transparent); backdrop-filter: blur(6px); color: var(--color-accent); font-size: var(--text-lg); line-height: 1; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
.to-top span { font-size: 10px; color: var(--color-muted); }
.in-tg .to-top { display: none; }
.t-link { color: inherit; text-decoration: none; border-bottom: var(--rule-hair) dotted var(--color-rule-2); }
.t-link:hover, .t-link:focus-visible { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.to-top:hover { background: var(--color-accent-soft); }
.to-top:active { transform: translateY(1px); }
.to-top[hidden] { display: none; }
@media (min-width: 860px) { .to-top { bottom: 24px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-pill);
  border: var(--rule-hair) solid var(--color-rule-2); background: var(--color-paper-2);
  color: var(--color-ink); font: 500 var(--text-sm) / 1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-accent-ink); }

/* Hero: ASCII-глаз на всю ширину, текст поверх */
.hero { position: relative; overflow: clip; min-height: calc(100svh - 60px - 72px); display: grid; background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
@media (min-width: 860px) { .hero { min-height: calc(100svh - 60px); } }
.hero__eye { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--color-paper) 0%, color-mix(in oklab, var(--color-paper) 78%, transparent) 30%, transparent 48%); }
.hero__in { position: relative; z-index: 1; display: grid; align-content: center; gap: var(--space-xl); padding-block: var(--space-xl); }
/* Телефон: глаз занимает верхнюю полосу (высота ≈ 54vw), текст начинается под ним */
@media (max-width: 959px) {
  .hero::after { background: linear-gradient(180deg, transparent 0, transparent calc(50vw), var(--color-paper) calc(58vw + 24px)); }
  .hero__in { align-content: start; padding-top: calc(54vw + 16px); }
}
.hero__text { display: grid; gap: var(--space-md); justify-items: start; max-width: 34rem; }
.hero__tag { font-size: var(--text-xs); color: var(--color-cool); }
.blink { color: var(--color-accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__head { font: 500 var(--text-display) / 1.02 var(--font-display); letter-spacing: -0.035em; color: var(--color-ink); overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
.hero__lede { font-size: var(--text-lg); max-width: 34ch; color: var(--color-ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); padding-top: var(--space-xs); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); font-size: var(--text-xs); color: var(--color-muted); }
.hero__tick { color: var(--color-accent); }

/* Shared section type */
.sec-head { font: 500 var(--text-xl) / 1.08 var(--font-display); letter-spacing: -0.025em; color: var(--color-ink); overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
.sec-lede { max-width: 42ch; color: var(--color-muted); }

/* ASCII-рамки: JS рисует +---+ и | точно по размеру блока; без JS остаётся обычная линия */
.ascii { position: relative; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); }
.is-app .ascii { border-color: transparent; }
.ascii > :not(.frame) { position: relative; z-index: 1; }
.frame { position: absolute; inset: 0; z-index: 0; margin: 0; font: 400 13px / 1 var(--font-mono); color: var(--color-rule-2); white-space: pre; overflow: hidden; pointer-events: none; transition: color var(--dur-med) var(--ease-out); }
.frame--probe { inset: auto; left: -9999px; top: 0; visibility: hidden; }

/* Вкладки (Mini App): нижняя панель на телефоне, ссылки в шапке на широких экранах */
.view { min-height: calc(100svh - 60px); }
.nav__links a[aria-current="page"] { color: var(--color-accent); }
.tabs { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in oklab, var(--color-paper-3) 92%, transparent); backdrop-filter: blur(10px); border-top: var(--rule-hair) solid var(--color-rule); }
.tabs__item { display: grid; justify-items: center; gap: 2px; padding: var(--space-sm) var(--space-xs); min-height: 60px; font-size: var(--text-xs); color: var(--color-muted); text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.tabs__ico { font-size: var(--text-sm); }
.tabs__item:hover { color: var(--color-ink); }
.tabs__item[aria-current="page"] { color: var(--color-accent); }
/* Глаз — главная кнопка: приподнятый круг между «Поиском» и «Журналом» */
.tabs__item--eye { position: relative; align-content: end; }
.tabs__item--eye .tabs__ico { display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; border: var(--rule-hair) solid var(--color-accent);
  border-radius: 50%; background: var(--color-paper-3); color: var(--color-accent); font-size: var(--text-base, 1rem); font-weight: 600;
  box-shadow: 0 0 0 4px var(--color-paper-3), 0 0 18px color-mix(in oklab, var(--color-accent) 35%, transparent);
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.tabs__item--eye[aria-current="page"] .tabs__ico { background: var(--color-accent); color: var(--color-accent-ink); }
.tabs__item--eye:hover .tabs__ico { background: var(--color-accent-soft); }
body { padding-bottom: 72px; }
@media (min-width: 860px) { .tabs { display: none; } body { padding-bottom: 0; } }

/* Search tree */
.search { display: grid; gap: var(--space-lg); padding-block: var(--space-xl) var(--space-md); }
.search__head { display: grid; gap: var(--space-sm); }
.scope { background: var(--color-glass); min-width: 0; padding: 14px; }
.scope__canvas { display: block; width: 100%; height: clamp(340px, 62vw, 680px); touch-action: pan-y; }
/* Командная строка дерева: $ tree --find [ссылка] [Найти] */
.scope__cmd { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); padding: var(--space-xs) var(--space-sm) var(--space-sm); border-bottom: var(--rule-hair) dashed var(--color-rule); }
.scope__prompt { font-size: var(--text-sm); color: var(--color-accent); white-space: nowrap; }
.scope__cmd .input { flex: 1 1 14rem; }
.scope__cmd .finder__err { flex-basis: 100%; }
.scope__found { display: grid; margin: var(--space-xs) 0 var(--space-sm); }
.scope__found[hidden] { display: none; }
@media (max-width: 719px) { .scope__panel--count { display: none; } }
.scope__panels { display: grid; gap: var(--space-md); border-top: var(--rule-hair) dashed var(--color-rule); padding-top: var(--space-md); }
@media (min-width: 860px) { .scope__panels { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.scope__panel { display: grid; gap: var(--space-sm); align-content: start; padding: 0 var(--space-sm) var(--space-xs); min-width: 0; }
.scope__head { font: 500 var(--text-sm) / 1.3 var(--font-body); color: var(--color-muted); }
.finds { display: grid; gap: 4px; align-content: start; min-height: 5.6em; }
.finds li { font-size: var(--text-sm); animation: line-in var(--dur-med) var(--ease-out) both; }
.finds a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--space-md); white-space: nowrap; padding: var(--space-xs) 0; border-bottom: var(--rule-hair) dashed var(--color-rule); color: var(--color-ink); text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.finds a span { color: var(--color-muted); font-size: var(--text-xs); text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finds a:hover { color: var(--color-accent); }
.finds li:first-child a { color: var(--color-accent); }
.finds:empty { display: none; }
.scope__big { font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.03em; color: var(--color-ink); }
.scope__note { font-size: var(--text-xs); color: var(--color-muted); }

/* Журнал: окно терминала на всю ширину */
.logv { padding-block: var(--space-xl) var(--space-lg); }
.term { background: var(--color-glass); min-width: 0; padding: 14px 18px; }
.term__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0 var(--space-sm); border-bottom: var(--rule-hair) dashed var(--color-rule); font-size: var(--text-xs); color: var(--color-muted); }
.term__title { font: 500 var(--text-sm) / 1.3 var(--font-mono); color: var(--color-ink); }
.term__state { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-accent); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); animation: pulse 1.6s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
.term__body { height: clamp(18rem, 52svh, 30rem); overflow: hidden; padding-top: var(--space-sm); font-size: var(--text-xs); line-height: 1.9; color: var(--color-ink-2); display: flex; flex-direction: column; justify-content: flex-end; mask-image: linear-gradient(transparent, var(--color-ink) 18%); }
.term__body li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .term__body li { white-space: normal; line-height: 1.5; padding-block: 3px; } }
@keyframes line-in { from { opacity: 0; transform: translateX(-8px); } }
.t-time { color: var(--color-muted); }
.t-eye { color: var(--color-accent); }
.t-eye--src { color: var(--color-cool); }
.t-eye--ok { color: var(--color-ink); }
.t-eye--bad { color: var(--color-bad); }
.t-who { color: var(--color-accent); }
.t-src { color: var(--color-cool); }
.t-ok { color: var(--color-ink); }
.t-bad { color: var(--color-bad); }
.t-cursor { color: var(--color-accent); margin-left: 1px; animation: blink 1s steps(1) infinite; }

/* Конвейер: ASCII-блоки и стрелки с бегущим символом */
.pipe { padding-block: var(--space-lg) var(--space-2xl); display: grid; gap: var(--space-lg); }
.pipe__track { display: grid; gap: var(--space-xs); justify-items: stretch; }
@media (min-width: 1040px) { .pipe__track { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: var(--space-xs); } }
.stage { display: grid; gap: var(--space-sm); align-content: start; padding: 20px 18px; background: var(--color-glass-2); transition: background-color var(--dur-med) var(--ease-out); }
.stage.is-hot { background: var(--color-accent-soft); }
.stage.is-hot > .frame { color: var(--color-accent); }
.stage__n { font-size: var(--text-xs); color: var(--color-accent); }
.stage__head { font: 500 var(--text-lg) / 1.2 var(--font-display); color: var(--color-ink); }
.stage__body { font-size: var(--text-sm); color: var(--color-muted); }
.stage__out { display: block; margin-top: var(--space-xs); font-size: var(--text-xs); color: var(--color-cool); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage__out::before { content: "> "; color: var(--color-muted); }
.pipe__link { align-self: center; justify-self: center; white-space: pre; font-size: var(--text-sm); line-height: 1; color: var(--color-rule-2); }
.pipe__link.is-v { line-height: 0.95; }

/* Сигнал */
.sig { display: grid; gap: var(--space-xl); align-items: center; padding-block: var(--space-xl) var(--space-lg); }
@media (min-width: 960px) { .sig { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.sig__text { display: grid; gap: var(--space-md); justify-items: start; }
.sigcard { display: grid; gap: var(--space-sm); padding: 26px 26px 22px; background: var(--color-glass-2); overflow: hidden; }
.sigcard > .frame { color: var(--color-accent); opacity: 0.7; }
.sigcard::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(transparent 0 46%, color-mix(in oklab, var(--color-accent) 10%, transparent) 50%, transparent 54%); transform: translateY(-100%); animation: scan 4.5s linear infinite; pointer-events: none; }
@keyframes scan { to { transform: translateY(100%); } }
.sigcard__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); font-size: var(--text-xs); }
.sigcard__hash { color: var(--color-muted); }
.chip { padding: 2px var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); font-family: var(--font-body); font-size: var(--text-xs); }
.chip--accent { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); }
.sigcard__gift { padding-top: var(--space-md); font: 500 var(--text-xl) / 1.1 var(--font-display); color: var(--color-ink); }
.sigcard__old { font-size: var(--text-sm); color: var(--color-muted); }
.sigcard__price { font-size: var(--text-display); font-weight: 500; line-height: 1; letter-spacing: -0.04em; color: var(--color-accent); overflow-wrap: break-word; min-width: 0; }
.sigcard__meta { display: grid; margin-top: var(--space-md); border-top: var(--rule-hair) dashed var(--color-rule-2); font-size: var(--text-sm); }
.sigcard__meta div { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) dashed var(--color-rule); }
.sigcard__meta dt { color: var(--color-muted); }
.sigcard__meta dt::after { content: ":"; }
.sigcard__meta dd { color: var(--color-cool); text-align: end; }

/* Службы: маленькие глаза в ASCII-рамках */
.crew { padding-block: var(--space-2xl); display: grid; gap: var(--space-lg); }
.crew__grid { display: grid; gap: var(--space-md); }
@media (min-width: 860px) { .crew__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.unit { display: grid; gap: var(--space-sm); align-content: start; padding: 22px 20px; background: var(--color-glass); }
.unit__eye { margin: 0; font-size: var(--text-sm); line-height: 1.15; white-space: pre; }
.unit__n { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); font-weight: 500; line-height: 1; letter-spacing: -0.04em; color: var(--color-ink); }
.unit__n span { font-size: var(--text-sm); letter-spacing: 0; color: var(--color-muted); }
.unit__head { font: 500 var(--text-lg) / 1.2 var(--font-display); color: var(--color-accent); }
.unit__body { font-size: var(--text-sm); color: var(--color-muted); max-width: 34ch; }

/* Поиск подарков: шаги коллекция → модель → фон, список чипов, номера */
.finder { display: grid; gap: var(--space-md); padding-block: var(--space-md) var(--space-2xl); }
.finder__top { display: grid; gap: var(--space-md); align-items: end; }
.finder__label { font-size: var(--text-xs); color: var(--color-muted); }
.input { flex: 1; min-width: 0; min-height: 44px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-sm); transition: border-color var(--dur-short) var(--ease-out); }
.input::placeholder { color: var(--color-muted); }
.input:hover { border-color: var(--color-muted); }
.input:focus-visible { border-color: var(--color-accent); }
.finder__err { font-size: var(--text-xs); color: var(--color-bad); }
.finder__box { display: grid; gap: var(--space-md); padding: 18px; background: var(--color-glass); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--space-xs); font-size: var(--text-xs); }
.crumbs li + li::before { content: ">"; margin-right: var(--space-xs); color: var(--color-rule-2); }
.crumbs li { display: flex; align-items: center; }
.crumb { padding: 4px var(--space-xs); border: var(--rule-hair) dashed var(--color-rule-2); border-radius: var(--radius-pill); background: none; color: var(--color-muted); font: inherit; cursor: pointer; transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.crumb:hover:not(:disabled) { color: var(--color-ink); border-color: var(--color-muted); }
.crumb.is-done { color: var(--color-ink); border-style: solid; }
.crumb.is-on { color: var(--color-accent); border-color: var(--color-accent); }
.crumb:disabled { opacity: 0.45; cursor: default; }
.finder__tools { display: grid; gap: var(--space-xs); }
/* Список шага поиска: строки «название — количество, редкость», без внутренней прокрутки */
.rows { display: grid; border-top: var(--rule-hair) dashed var(--color-rule); }
.rows[hidden] { display: none; }
.rows > .chip-btn { justify-self: start; margin-top: var(--space-sm); }
.rows > .finder__empty { padding-top: var(--space-sm); }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 44px; padding: var(--space-xs) var(--space-xs); border: 0; border-bottom: var(--rule-hair) dashed var(--color-rule); background: none; color: var(--color-ink); font: 500 var(--text-sm) / 1.3 var(--font-body); text-align: left; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.row:hover { background: var(--color-paper-2); color: var(--color-accent); }
.row:active { background: var(--color-accent-soft); }
.row { justify-content: flex-start; }
.row__ico { position: relative; flex: none; width: 46px; height: 46px; margin: 4px 0 8px; border-radius: 12px; background: var(--color-paper-2); }
.backdrop { background: radial-gradient(circle at 50% 42%, color-mix(in oklab, var(--bd) var(--backdrop-center), var(--color-paper-2)) 0%, color-mix(in oklab, var(--bd) var(--backdrop-edge), var(--color-paper-3)) 100%); }
.swatch { background: color-mix(in oklab, var(--bd) var(--backdrop-swatch), var(--color-paper-2)); }
.row__ico img { display: block; width: 100%; height: 100%; padding: 5px; border-radius: 12px; object-fit: contain; }
.row__badge { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 0 5px; border-radius: 6px; background: var(--color-paper-3); color: var(--color-ink-2); font-size: 10px; line-height: 14px; white-space: nowrap; }
.row__name { flex: 1; display: inline-flex; align-items: center; gap: var(--space-xs); min-width: 0; overflow-wrap: anywhere; }
.row__meta { flex: none; font-size: var(--text-xs); color: var(--color-muted); }
.row__sw { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; margin-right: var(--space-xs); }
.chip-btn { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 36px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink-2); font: 500 var(--text-sm) / 1.2 var(--font-body); cursor: pointer; transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.finder__tools[hidden] { display: none; }
.chip-btn:hover:not(:disabled) { border-color: var(--color-accent); color: var(--color-ink); }
.chip-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.chip-btn:active { background: var(--color-accent-soft); }
.chip-btn--ghost { justify-self: start; border-style: dashed; color: var(--color-muted); }
.finder__empty { font-size: var(--text-xs); color: var(--color-muted); }
.result { display: grid; gap: var(--space-md); }
.result[hidden] { display: none; }
.result__head { font-size: var(--text-sm); color: var(--color-muted); }
.result__head b { font-weight: 500; color: var(--color-accent); font-size: var(--text-lg); }
.result__nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: var(--space-sm); }
.tile { display: grid; gap: 4px; justify-items: center; padding: 6px; border: var(--rule-hair) solid var(--color-rule); border-radius: 12px; color: var(--color-cool); font-size: var(--text-xs); text-decoration: none; transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.tile img { width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: cover; background: var(--color-paper-2); }
.tile:hover { border-color: var(--color-cool); color: var(--color-ink); }
.finder__note { font-size: var(--text-xs); color: var(--color-muted); max-width: 70ch; }

/* Карточка подарка */
.gift { display: grid; gap: var(--space-md); padding-block: var(--space-lg) var(--space-2xl); }
.gift__back { justify-self: start; font-size: var(--text-sm); color: var(--color-muted); text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.gift__back:hover { color: var(--color-accent); }
.gift__card { display: grid; gap: var(--space-lg); padding: 20px; background: var(--color-glass); }
@media (min-width: 860px) { .gift__card { grid-template-columns: 240px minmax(0, 1fr); padding: 26px; } }
.gift__art { position: relative; display: grid; place-items: center; width: min(200px, 56vw); aspect-ratio: 1; justify-self: center; align-self: start; border-radius: 16px; overflow: hidden; }
@media (min-width: 860px) { .gift__art { width: 100%; } }
.gift__img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.gift__art:not(.is-fallback) .gift__pattern, .gift__art:not(.is-fallback) .gift__model { visibility: hidden; }
.gift__pattern { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-size: var(--text-sm); line-height: 1.6; color: var(--color-ink); opacity: 0.28; white-space: pre; }
.gift__model { position: relative; font: 500 var(--text-lg) / 1.1 var(--font-display); color: var(--color-ink); text-align: center; padding: var(--space-md); overflow-wrap: break-word; min-width: 0; }
.gift__main { display: grid; gap: var(--space-md); align-content: start; min-width: 0; }
.gift__head { display: grid; gap: var(--space-xs); }
.gift__title { font: 500 var(--text-xl) / 1.1 var(--font-display); color: var(--color-ink); overflow-wrap: break-word; min-width: 0; }
.gift__title span { color: var(--color-muted); font-size: 0.7em; }
.gift__tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chip--bad { border-color: var(--color-bad); color: var(--color-bad); }
/* Редкость модели: цвет шкалы + эффект по уровню (без анимации при prefers-reduced-motion) */
.tier { --tier: var(--tier-common); position: relative; overflow: hidden; border-color: color-mix(in oklab, var(--tier) 70%, transparent);
  background: color-mix(in oklab, var(--tier) 16%, transparent); color: var(--tier); }
.tier--rare { --tier: var(--tier-rare); box-shadow: 0 0 10px color-mix(in oklab, var(--tier) 35%, transparent); }
.tier--epic { --tier: var(--tier-epic); animation: tier-pulse 2.4s ease-in-out infinite; }
.tier--legendary { --tier: var(--tier-legendary); box-shadow: 0 0 14px color-mix(in oklab, var(--tier) 45%, transparent); }
.tier--legendary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%,
  color-mix(in oklab, white 55%, transparent) 50%, transparent 70%); transform: translateX(-120%); animation: tier-shine 3.2s ease-in-out infinite; }
.tier-text--common { color: var(--tier-common); }
.tier-text--rare { color: var(--tier-rare); }
.tier-text--epic { color: var(--tier-epic); }
.tier-text--legendary { color: var(--tier-legendary); }
/* обводка картинки в карточке — тем же цветом, слабее */
.gift__art.tier-ring--rare { box-shadow: 0 0 0 1px var(--tier-rare), 0 0 18px color-mix(in oklab, var(--tier-rare) 30%, transparent); }
.gift__art.tier-ring--epic { box-shadow: 0 0 0 1px var(--tier-epic), 0 0 22px color-mix(in oklab, var(--tier-epic) 38%, transparent); }
.gift__art.tier-ring--legendary { box-shadow: 0 0 0 1px var(--tier-legendary), 0 0 28px color-mix(in oklab, var(--tier-legendary) 45%, transparent); }
@keyframes tier-pulse { 50% { box-shadow: 0 0 14px color-mix(in oklab, var(--tier) 55%, transparent); } }
@keyframes tier-shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .tier--epic, .tier--legendary::after { animation: none; } }
.gift__attrs, .gift__prices { display: grid; border-top: var(--rule-hair) dashed var(--color-rule-2); font-size: var(--text-sm); }
.gift__attrs div, .gift__prices div { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) dashed var(--color-rule); }
.gift__attrs dt, .gift__prices dt { color: var(--color-muted); }
.gift__attrs dd, .gift__prices dd { color: var(--color-ink); text-align: end; }
.gift__attrs dt { white-space: nowrap; }
.gift__attrs dd span { color: var(--color-cool); margin-left: var(--space-xs); white-space: nowrap; }
.gift__attrs dd .gift__n { color: var(--color-muted); }                 /* «81 шт» — тише процента */
.gift__attrs dd span[class*="tier-text--"] { color: var(--tier, var(--color-cool)); }
.gift__attrs dd .tier-text--common { --tier: var(--tier-common); }
.gift__attrs dd .tier-text--rare { --tier: var(--tier-rare); }
.gift__attrs dd .tier-text--epic { --tier: var(--tier-epic); }
.gift__attrs dd .tier-text--legendary { --tier: var(--tier-legendary); }
.gift__sw { display: inline-block; width: 10px; height: 10px; margin-right: var(--space-xs); border-radius: 2px; vertical-align: baseline; }
@media (min-width: 560px) { .gift__prices { grid-template-columns: 1fr 1fr; column-gap: var(--space-lg); } }
.gift__ivory { display: grid; gap: var(--space-xs); }
.gift__label { font-size: var(--text-xs); color: var(--color-muted); }
.gift__demo { margin-left: var(--space-xs); padding: 0 4px; border: var(--rule-hair) dashed var(--color-rule-2); border-radius: var(--radius-pill); font-family: var(--font-mono); }
.gift__price { font-size: var(--text-display); font-weight: 500; line-height: 1; letter-spacing: -0.04em; color: var(--color-accent); overflow-wrap: break-word; min-width: 0; }
.gift__price--note { font-size: var(--text-lg); letter-spacing: 0; color: var(--color-muted); }
.gift__instant { font-size: var(--text-sm); color: var(--color-ink-2); }
.gift__prices dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px var(--space-sm); }
.gift__prices dd b { font-weight: 500; color: var(--color-ink); }
.gift__none { color: var(--color-muted); }
.siglist-wrap { display: grid; gap: var(--space-md); padding-block: var(--space-md) var(--space-xl); }
.siglist-wrap[hidden] { display: none; }
.siglist { display: grid; gap: var(--space-xs); font-size: var(--text-xs); line-height: 1.5; color: var(--color-ink-2); }
.siglist li { padding-bottom: var(--space-xs); border-bottom: var(--rule-hair) dashed var(--color-rule); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.spark span { flex: 1; min-height: 3px; background: var(--color-accent-soft); border-top: 2px solid var(--color-accent); }
.gift__sales ol { display: grid; gap: 2px; font-size: var(--text-sm); }
.gift__sales li { display: grid; grid-template-columns: 5rem 1fr auto; gap: var(--space-sm); padding: 3px 0; }
.gift__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* Главная: быстрый поиск в шапке, панели «База», «Редкие», «Случайный», «Находки» */
.qsearch { position: relative; display: grid; gap: var(--space-xs); width: 100%; max-width: 28rem; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 15; margin-top: 4px; max-height: 20rem; overflow-y: auto; border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper-3); }
.suggest[hidden] { display: none; }
.suggest__item { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-sm); border-bottom: var(--rule-hair) dashed var(--color-rule); font-size: var(--text-sm); color: var(--color-ink); cursor: pointer; }
.suggest__item .mono { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.suggest__item.is-on, .suggest__item:hover { background: var(--color-accent-soft); color: var(--color-accent); }
.suggest__item--empty { color: var(--color-muted); cursor: default; }
.home { display: grid; gap: var(--space-md); padding-block: var(--space-xl) 0; }
@media (min-width: 860px) { .home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel { display: grid; gap: var(--space-sm); align-content: start; padding: 20px; background: var(--color-glass); }
.panel__head { font: 500 var(--text-lg) / 1.2 var(--font-display); color: var(--color-ink); }
.panel__text { font-size: var(--text-sm); color: var(--color-muted); max-width: 40ch; }
.panel--lucky .btn { justify-self: start; }
.stats { display: grid; font-size: var(--text-sm); }
.stats div { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) dashed var(--color-rule); }
.stats dt { color: var(--color-muted); }
.stats dd { color: var(--color-ink); font-weight: 500; text-align: end; }
.stats a { color: var(--color-accent); text-decoration-color: var(--color-rule-2); text-underline-offset: 3px; }
a.row { text-decoration: none; }
.row__name--stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.row__sub { font-size: var(--text-xs); font-weight: 400; color: var(--color-muted); }
/* Сортировка в поиске */
.sorts { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.finder__box[hidden] { display: none; }
.multi__picked { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.multi__picked[hidden] { display: none; }
.multi__pick { min-height: 32px; font-size: var(--text-xs); border-color: var(--color-accent); color: var(--color-ink); }
.multi__row[aria-pressed="true"] .row__name { color: var(--color-accent); }
.multi__mark { flex: none; font-size: var(--text-xs); color: var(--color-muted); }
.multi__row[aria-pressed="true"] .multi__mark { color: var(--color-accent); }
.row__ico--sm { width: 36px; height: 36px; margin: 4px 0; border-radius: 10px; }
.row__ico--sm img { padding: 3px; border-radius: 10px; }
.multi__go { justify-self: start; }
.multi__coll { display: grid; gap: var(--space-sm); padding-top: var(--space-md); border-top: var(--rule-hair) dashed var(--color-rule); }
.multi__title { font: 600 var(--text-lg) / 1.2 var(--font-body); }
.multi__title .mono { color: var(--color-accent); font-weight: 500; }
.multi__models { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.5; }
.multi__coll > .chip-btn { justify-self: start; }
.multi__coll > .chip-btn[hidden] { display: none; }
.sort-btn { min-height: 32px; padding: 0 var(--space-sm); border: var(--rule-hair) dashed var(--color-rule-2); border-radius: var(--radius-pill); background: none; color: var(--color-muted); font-size: var(--text-xs); cursor: pointer; transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.sort-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sort-btn:hover:not(:disabled) { color: var(--color-ink); border-color: var(--color-muted); }
.sort-btn[aria-pressed="true"] { border-style: solid; border-color: var(--color-accent); color: var(--color-accent); }

/* Outro + footer */
.outro { display: grid; gap: var(--space-lg); justify-items: start; padding-block: var(--space-xl) var(--space-2xl); }
.outro__head { font: 500 var(--text-display) / 1.02 var(--font-display); letter-spacing: -0.035em; color: var(--color-ink); max-width: 16ch; overflow-wrap: break-word; min-width: 0; }
.foot { border-top: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-3); padding-block: var(--space-xl); }
.foot__in { display: grid; gap: var(--space-md); }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); font-size: var(--text-sm); }
.foot__links a { color: var(--color-ink-2); text-decoration-color: var(--color-rule-2); text-underline-offset: 3px; transition: color var(--dur-short) var(--ease-out); }
.foot__links a:hover { color: var(--color-accent); }
.foot__note { font-size: var(--text-xs); color: var(--color-muted); max-width: 60ch; }

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