/* ═══════════════════════════════════════════════════════════
   Винил — витрина коллекции
   Тёмная тема, тёплый свет лампы над вертушкой, оранжевый акцент.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* поверхности */
  --bg: #121010;
  --bg-raised: #1b1716;
  --bg-sunken: #0d0b0b;
  --line: #2b2523;

  /* текст: три ступени, а не «яркий/бледный» */
  --ink: #f2ece4;
  --ink-soft: #bcb0a6;
  --ink-dim: #8d8279;

  /* акцент — только для «активного фильтра» и главного действия */
  --accent: #e8930c;
  --accent-ink: #171004;
  --accent-soft: rgba(232, 147, 12, 0.14);
  --ok: #e8930c;
  --danger: #ff8f6b;

  /* радиусы: концентричные, outer = inner + padding */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* кегль: 6 ступеней вместо семнадцати случайных */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1rem;
  --fs-xl: 1.125rem;
  --fs-2xl: 1.375rem;

  /* глубина: тени для объёма, границы только для структуры */
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --ring-hover: 0 0 0 1px rgba(255, 255, 255, 0.14);
  --shadow-cover: 0 10px 24px rgba(0, 0, 0, 0.5);
  --shadow-cover-lift: 0 18px 38px rgba(0, 0, 0, 0.58);
  --shadow-modal: 0 32px 70px rgba(0, 0, 0, 0.62);

  /* движение */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 130ms;
  --base: 200ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* авторское display у .ed-foot било UA-правило [hidden] — футер редактора
   торчал на шаге поиска. Ставим приоритет один раз и на всё. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Golos Text", system-ui, sans-serif;
  font-size: var(--fs-md);
  min-height: 100vh;
  /* лёгкое тёплое пятно света сверху, как лампа над вертушкой */
  background-image: radial-gradient(900px 420px at 50% -140px, rgba(232, 147, 12, 0.13), transparent 70%);
  background-repeat: no-repeat;
}

p, li { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 96px; }

/* ── Шапка ───────────────────────────────────────────────── */
header {
  padding: 28px 0 4px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
header .titles { flex: 1; min-width: 180px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

h1 {
  font-family: "Unbounded", sans-serif;
  font-weight: 900;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.14em;
}
h1 .disc {
  display: inline-block;
  width: 0.66em; height: 0.66em;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 0 12%, var(--accent) 13% 34%, #181414 35% 100%);
  box-shadow: inset 0 0 0 1px #332b28;
  /* крутится один раз при загрузке — постоянное движение в поле зрения
     мешает разглядывать коллекцию */
  animation: spin 2.4s var(--ease) 1;
  transition: rotate 600ms var(--ease);
}
h1:hover .disc { rotate: 180deg; }
@keyframes spin { from { rotate: 0deg; } to { rotate: 360deg; } }

.tagline {
  color: var(--ink-dim);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.tagline b { color: var(--ink-soft); font-weight: 600; }

.header-actions { display: flex; gap: 4px; align-items: center; }
.link-quiet {
  color: var(--ink-dim);
  font-size: var(--fs-sm);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  transition: color var(--fast) var(--ease);
}
.link-quiet:hover { color: var(--ink); }
.link-quiet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Кнопки ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  background: var(--bg-raised);
  box-shadow: var(--ring);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 11px 16px;
  font: inherit;
  font-size: var(--fs-md);
  cursor: pointer;
  transition: box-shadow var(--fast) var(--ease),
              background-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              scale var(--fast) var(--ease);
}
.btn:hover { box-shadow: var(--ring-hover); }
.btn:active { scale: 0.96; }
.btn:disabled { opacity: 0.5; cursor: default; scale: 1; }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn.primary:hover { background: #f5a020; box-shadow: 0 4px 14px rgba(232, 147, 12, 0.28); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { box-shadow: 0 0 0 1px rgba(255, 143, 107, 0.45); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* иконка внутри кнопки с текстом: оптически поджимаем её сторону */
.btn.has-icon { padding-left: 14px; }
.btn svg { flex: none; }

/* ── Панель управления ───────────────────────────────────── */
.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  /* сплошная подложка вместо градиента: раньше обложки просвечивали
     сквозь нижнюю треть залипшей панели */
  background: rgba(18, 16, 16, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  margin: 0 -20px;
  padding: 14px 20px 12px;
}
.search-row { display: flex; gap: 10px; }
.search {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-sunken);
  box-shadow: var(--ring);
  border-radius: var(--r-md);
  padding: 0 6px 0 14px;
  transition: box-shadow var(--fast) var(--ease);
}
.search:focus-within { box-shadow: 0 0 0 1px var(--accent); }
.search > svg { flex: none; color: var(--ink-dim); }
.search input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--ink);
  font: inherit; font-size: var(--fs-lg);
  padding: 12px 0;
}
.search input::placeholder { color: var(--ink-dim); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  flex: none;
  position: relative;
  width: 32px; height: 32px;
  display: none;
  align-items: center; justify-content: center;
  border: none; background: none; color: var(--ink-dim);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
/* кружок 32px, но палец попадает в 44px */
.search .clear::after {
  content: ""; position: absolute;
  top: 50%; left: 50%; translate: -50% -50%;
  width: 44px; height: 44px;
}
.search.has-text .clear { display: flex; }
.search .clear:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.btn-random { flex: none; width: 48px; padding: 0; }

/* фильтры: сортировка — переключатель режима, фасеты — активные фильтры.
   Раньше и то и другое выглядело одинаковой оранжевой таблеткой. */
.filters { display: flex; align-items: center; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 9px; min-width: 0; }
.filter-group .label {
  font-size: var(--fs-xs);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: none;
}

/* сегментированный контрол: внешний радиус = внутренний + padding */
.segmented {
  display: flex;
  gap: 2px;
  background: var(--bg-sunken);
  box-shadow: var(--ring);
  border-radius: var(--r-md);   /* 8 + 4 */
  padding: 4px;
  flex: none;
}
.segmented .chip {
  border: none; background: none;
  color: var(--ink-dim);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  min-width: 6.9em;             /* держим место под « ↑», чтобы ряд не прыгал */
  font: inherit; font-size: var(--fs-sm);
  cursor: pointer;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.segmented .chip:hover { color: var(--ink); box-shadow: none; }
.segmented .chip.active {
  background: var(--bg-raised);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--ring);
}

/* фасеты — таблетки; активная заливается акцентом */
.chips {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 2px 0;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  scroll-snap-align: start;
  border: none;
  background: var(--bg-raised);
  box-shadow: var(--ring);
  color: var(--ink-soft);
  border-radius: var(--r-full);
  padding: 8px 15px;
  font: inherit; font-size: var(--fs-sm);
  cursor: pointer;
  transition: color var(--fast) var(--ease),
              background-color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              scale var(--fast) var(--ease);
}
.chip:hover { color: var(--ink); box-shadow: var(--ring-hover); }
.chip:active { scale: 0.96; }
.chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: none;
}
.chip:focus-visible, .search .clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Сетка карточек ──────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 16px;
  margin-top: 26px;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 34px 22px; }
}

.card {
  cursor: pointer;
  border: none; background: none; color: inherit; font: inherit;
  text-align: left;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: rise 0.5s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.cover-wrap { position: relative; }
/* пластинка, выглядывающая из-за обложки: чуть видна всегда — на телефоне
   ховера нет, а это главная фишка витрины */
.cover-wrap::before {
  content: "";
  position: absolute;
  inset: 4% 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #0c0a0a 0 4%, var(--accent) 5% 17%, #151212 18% 100%), #151212;
  box-shadow: inset 0 0 0 1px #2e2724, inset 0 0 18px rgba(0, 0, 0, 0.8);
  translate: 7% 0;
  transition: translate var(--base) var(--ease), rotate var(--base) var(--ease);
  z-index: 0;
}
.card:hover .cover-wrap::before,
.card:focus-visible .cover-wrap::before { translate: 26% 0; rotate: 40deg; }
.cover {
  position: relative; z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--bg-raised);
  /* нейтральная белая обводка, не тонированная — иначе читается как грязь */
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  box-shadow: var(--shadow-cover);
  transition: translate var(--base) var(--ease),
              rotate var(--base) var(--ease),
              box-shadow var(--base) var(--ease);
}
.card:hover .cover, .card:focus-visible .cover {
  translate: 0 -4px;
  rotate: -1deg;
  box-shadow: var(--shadow-cover-lift);
}
.card:active .cover { scale: 0.98; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--r-sm); }
.card .album {
  margin-top: 12px;
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.3;
  /* длинные названия режем на двух строках: ряды выравнивает грид,
     а третья строка ломала бы ритм подписей */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .artist { color: var(--ink-dim); font-size: var(--fs-sm); margin-top: 2px; }
.card .year {
  color: var(--ink-dim);
  font-size: var(--fs-xs);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* метка переиздания: год копии виден на витрине, без открытия карточки */
.reissue {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  display: flex; align-items: center; gap: 4px;
  padding: 5px 9px 5px 7px;
  border-radius: var(--r-full);
  background: rgba(10, 8, 7, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--ring);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* клик проходит насквозь — метка не должна перехватывать карточку */
  pointer-events: none;
}
.reissue svg { color: var(--accent); }

.card-edit {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(10, 8, 7, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  /* на десктопе всплывает по наведению — 63 кружка поверх обложек
     превращали витрину в панель управления */
  opacity: 0;
  scale: 0.85;
  transition: opacity var(--fast) var(--ease),
              scale var(--fast) var(--ease),
              background-color var(--fast) var(--ease),
              color var(--fast) var(--ease);
}
.card:hover .card-edit,
.card:focus-within .card-edit,
.card-edit:focus-visible { opacity: 1; scale: 1; }
.card-edit:hover { background: var(--accent); color: var(--accent-ink); }
.card-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) {
  .card-edit { opacity: 1; scale: 1; }
}

.card.spotlight .cover {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  animation: pulse 0.9s var(--ease) 3;
}
@keyframes pulse {
  50% { translate: 0 -6px; scale: 1.03; }
}

/* скелетоны на время загрузки: 9 МБ обложек доезжают рывками */
.skel { animation: fade 1.3s ease-in-out infinite alternate; }
.skel .box {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--r-xs);
  background: var(--bg-raised);
  box-shadow: var(--ring);
}
.skel .line {
  height: 0.72em; margin-top: 14px;
  border-radius: var(--r-full);
  background: var(--bg-raised);
}
.skel .line.short { width: 55%; margin-top: 8px; }
@keyframes fade { from { opacity: 0.5; } to { opacity: 0.9; } }

/* ── Пустое состояние и ошибка загрузки ──────────────────── */
.empty { text-align: center; color: var(--ink-dim); padding: 64px 0; display: none; }
.empty .big { font-size: 2.2rem; margin-bottom: 12px; }
.empty .btn { margin-top: 18px; }

.loaderr {
  display: none;
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  box-shadow: var(--ring);
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-md);
}
.loaderr .btn { margin-top: 14px; text-decoration: none; }

/* ── Модалки ─────────────────────────────────────────────── */
dialog {
  border: none;
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  box-shadow: var(--ring), var(--shadow-modal);
  color: var(--ink);
  padding: 0;
  max-width: min(440px, calc(100vw - 24px));
  width: 100%;
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: hidden;
}
dialog::backdrop {
  background: rgba(8, 6, 5, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
dialog[open] { animation: dialog-in 220ms var(--ease); }
@keyframes dialog-in {
  from { opacity: 0; translate: 0 10px; scale: 0.98; }
}
dialog[open]::backdrop { animation: fade-in 220ms var(--ease); }
@keyframes fade-in { from { opacity: 0; } }

#modal { display: none; flex-direction: column; }
#modal[open] { display: flex; }
.modal-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  flex: none;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}
.modal-body { padding: 20px 22px 24px; overflow-y: auto; }
.modal-body .album {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: var(--fs-xl);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.modal-body .artist { color: var(--ink-soft); margin-top: 7px; font-size: var(--fs-md); }
.modal-meta { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal-meta span {
  box-shadow: var(--ring);
  border-radius: var(--r-full);
  padding: 6px 13px;
  font-size: var(--fs-xs);
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.modal-meta .y { color: var(--accent); box-shadow: 0 0 0 1px rgba(232, 147, 12, 0.35); }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(10, 8, 7, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color var(--fast) var(--ease), scale var(--fast) var(--ease);
}
.modal-close:hover { background: rgba(10, 8, 7, 0.85); }
.modal-close:active { scale: 0.96; }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-close::after {
  content: ""; position: absolute;
  top: 50%; left: 50%; translate: -50% -50%;
  width: 44px; height: 44px;
}

/* ── Редактор ────────────────────────────────────────────── */
#editor { max-width: min(520px, calc(100vw - 24px)); display: none; flex-direction: column; }
#editor[open] { display: flex; }
.ed-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.ed-head h2 {
  font-family: "Unbounded", sans-serif;
  font-size: var(--fs-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border: none; border-radius: var(--r-sm);
  background: none; color: var(--ink-dim);
  cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease), scale var(--fast) var(--ease);
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.icon-btn:active { scale: 0.96; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn::after {
  content: ""; position: absolute;
  top: 50%; left: 50%; translate: -50% -50%;
  width: 44px; height: 44px;
}
.ed-body { padding: 18px 20px; overflow-y: auto; }

/* поиск наверх — это основной путь; три способа ниже, вторичным рядом */
.find-row { display: flex; gap: 8px; }
.find-row .search { flex: 1; }
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.way {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: none;
  background: var(--bg-sunken);
  box-shadow: var(--ring);
  color: var(--ink-soft);
  border-radius: var(--r-md);
  padding: 13px 6px;
  font: inherit; font-size: var(--fs-xs);
  cursor: pointer; text-align: center;
  transition: color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), scale var(--fast) var(--ease);
}
.way:hover { color: var(--ink); box-shadow: var(--ring-hover); }
.way:active { scale: 0.96; }
.way:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.way svg { color: var(--ink-dim); transition: color var(--fast) var(--ease); }
.way:hover svg { color: var(--accent); }

.form-block { margin-top: 20px; }
.form-block:first-child { margin-top: 0; }
.block-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.field { margin-top: 12px; }
.field:first-child { margin-top: 0; }
.field label { display: block; font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-sunken);
  border: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit; font-size: var(--fs-md);
  outline: none;
  transition: box-shadow var(--fast) var(--ease);
}
.field input:focus, .field select:focus { box-shadow: 0 0 0 1px var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin-top: 12px; }

.hint { color: var(--ink-dim); font-size: var(--fs-sm); line-height: 1.45; }
.note {
  display: flex; align-items: center; gap: 8px;
  color: var(--danger);
  font-size: var(--fs-sm);
  margin-top: 12px;
  line-height: 1.45;
}
.note.ok { color: var(--ok); }

/* результаты поиска */
.results { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.res {
  display: flex; gap: 12px; align-items: center; text-align: left;
  border: none;
  background: var(--bg-sunken);
  box-shadow: var(--ring);
  color: inherit;
  border-radius: var(--r-md);
  padding: 9px 12px; cursor: pointer; font: inherit;
  transition: box-shadow var(--fast) var(--ease), scale var(--fast) var(--ease);
}
.res:hover { box-shadow: var(--ring-hover); }
.res:active { scale: 0.99; }
.res:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.res img {
  width: 46px; height: 46px; object-fit: cover;
  border-radius: var(--r-xs);
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  background: var(--bg); flex: none;
}
.res .t { flex: 1; min-width: 0; }
.res .t b { display: block; font-size: var(--fs-md); font-weight: 600; }
.res .t span { display: block; color: var(--ink-dim); font-size: var(--fs-xs); margin-top: 3px; font-variant-numeric: tabular-nums; }
.res.have { opacity: 0.5; }
.res .tag { font-size: var(--fs-xs); color: var(--accent); flex: none; }

/* выбор обложки */
.covers { display: flex; gap: 10px; flex-wrap: wrap; }
.cover-pick {
  border: none; border-radius: var(--r-sm); padding: 0; background: none;
  cursor: pointer; width: 76px;
  transition: scale var(--fast) var(--ease);
}
.cover-pick:active { scale: 0.96; }
.cover-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cover-pick img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--r-xs);
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  display: block; background: var(--bg);
  transition: outline-color var(--fast) var(--ease);
}
.cover-pick span { display: block; font-size: var(--fs-xs); color: var(--ink-dim); margin-top: 5px; }
.cover-pick.sel img { outline: 2px solid var(--accent); outline-offset: -2px; }
.cover-pick.sel span { color: var(--accent); }

/* показываем блок ДО старта сканера: библиотека меряет его ширину,
   у скрытого получалось 0 → видео шириной 0px, камера «не открывалась» */
#reader { display: none; margin-top: 14px; border-radius: var(--r-md); overflow: hidden; }
#reader.on { display: block; }

.ed-foot {
  display: flex; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex: none;
}
.ed-foot .grow { flex: 1; }

.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner 0.7s linear infinite;
}
@keyframes spinner { to { rotate: 360deg; } }

/* ── Мобильный ───────────────────────────────────────────── */
@media (max-width: 620px) {
  .wrap { padding: 0 16px 72px; }
  /* заголовок, счётчик и кнопки — в одну строку: раньше шапка занимала
     пол-экрана до первой обложки */
  header { padding: 16px 0 2px; gap: 10px; flex-wrap: nowrap; align-items: center; }
  header .titles { flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
  h1 { font-size: 1.5rem; }
  .tagline { font-size: var(--fs-xs); }
  .header-actions { flex: none; }
  .btn.primary { padding: 10px 13px; font-size: var(--fs-sm); }
  .link-quiet { padding: 10px 6px; }
  .controls { margin: 0 -16px; padding: 12px 16px 10px; }
  /* весь ряд фильтров — один горизонтальный скролл, без вложенных */
  .filters {
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    margin: 10px -16px 0;
    padding: 2px 16px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-group { flex: none; gap: 8px; }
  .filter-group .label { display: none; }
  .chips { overflow: visible; padding: 0; }
  .segmented .chip { min-width: 5.4em; padding: 7px 8px; }
  .grid { margin-top: 20px; }
  .ed-body { padding: 16px; }
  .ed-head { padding: 14px 12px 14px 16px; }
  .ed-foot { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .cover-wrap::before { translate: 7% 0; }
}
