/* Голоса для чата · Алабаи
   Шрифты из игры: Balsamiq Sans 700 (ники над собаками) и Onest 500/600 (текст сообщений).
   SIL OFL 1.1, лицензии в assets/fonts/. */

@font-face { font-family: "Balsamiq Sans"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/balsamiq-sans-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Balsamiq Sans"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/balsamiq-sans-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/onest-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/onest-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/onest-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/onest-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  color-scheme: dark;

  /* Тёплый графит */
  --bg:          oklch(0.185 0.011 62);
  --surface:     oklch(0.228 0.012 62);
  --surface-2:   oklch(0.272 0.013 62);
  --surface-3:   oklch(0.318 0.014 62);
  --line:        oklch(0.335 0.013 62);
  --line-strong: oklch(0.43 0.015 62);

  --text:   oklch(0.955 0.013 85);
  --text-2: oklch(0.82 0.018 78);
  --text-3: oklch(0.70 0.018 72);

  /* Единственный акцент: бирюза брелока-лапки из игры */
  --accent:      oklch(0.79 0.118 199);
  --accent-ink:  oklch(0.24 0.04 205);
  --accent-soft: oklch(0.79 0.118 199 / 0.12);
  --accent-line: oklch(0.79 0.118 199 / 0.55);

  /* Материал облачка «гав-гав» из оверлея */
  --cream:      oklch(0.935 0.048 82);
  --cream-ink:  oklch(0.30 0.035 60);

  --warn: oklch(0.78 0.13 55);

  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-voice: "Balsamiq Sans", "Onest", system-ui, sans-serif;

  --radius-card: 18px;
  --radius-ctl: 12px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: 16px;
  --max: 1180px;
}

@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scrollbar-color: var(--line-strong) var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection { background: oklch(0.79 0.118 199 / 0.32); color: var(--text); }

img, svg { display: block; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: var(--radius-ctl);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus-visible { top: 12px; }

/* ---------- Шапка ---------- */

.site-head { padding-block: 28px 20px; }

.site-head__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 16px;
}

.site-head__charm {
  width: 60px;
  height: 60px;
  margin-block: -4px;
  transform: rotate(-8deg);
}

.site-head h1 {
  margin: 0;
  font-family: var(--font-voice);
  font-weight: 700;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.site-head__lede {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.45;
  max-width: 62ch;
  text-wrap: pretty;
}

.demo-note {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 12px 6px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.3;
}
.demo-note svg { width: 16px; height: 16px; flex: none; color: var(--warn); }
.demo-note[hidden] { display: none; }

.site-head__offset { grid-column: 2 / -1; }

/* Кнопки-ссылки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-3); border-color: var(--text-3); }
  .btn--primary:hover { background: oklch(0.84 0.11 199); border-color: oklch(0.84 0.11 199); }
}

/* ---------- Панель поиска ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-block: 12px;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.toolbar.is-stuck { border-bottom-color: var(--line); }

.toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.search {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  color: var(--text-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 44px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  caret-color: var(--accent);
  transition: border-color 160ms ease, background-color 160ms ease;
}
.search input::placeholder { color: var(--text-3); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search input:focus-visible { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent-soft); }

.search__kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text-3);
  font-size: 0.8125rem;
  pointer-events: none;
}

.search__clear {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
}
.search__clear svg { width: 18px; height: 18px; }
.search__clear[hidden], .search__kbd[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .search__clear:hover { background: var(--surface-3); color: var(--text); }
}
@media (hover: none), (pointer: coarse) { .search__kbd { display: none; } }

.toolbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  flex: 0 1 auto;
}

.category { flex: 0 1 210px; }
.category select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font: inherit;
}
.category select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort__options { flex-wrap: wrap; }
.catalog__more { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 28px; }
.catalog__more[hidden] { display: none; }

.count {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  white-space: nowrap;
  min-width: 9ch;
}

/* Сортировка: радиогруппа в виде переключателя */
.sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.sort legend {
  float: left;
  padding: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.sort__options {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.sort__option { position: relative; }
.sort__option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.sort__option > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  line-height: 1.4;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease, color 160ms ease;
}
.sort__option > span svg { width: 14px; height: 14px; }
.sort__option input:checked + span { background: var(--surface-3); color: var(--text); }
.sort__option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .sort__option input:not(:checked):hover + span { color: var(--text); }
}

/* ---------- Каталог ---------- */

.catalog { padding-block: 8px 56px; }

.voice-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.voice {
  container-type: inline-size;
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px 16px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 0 oklch(1 0 0 / 0.04);
  transition: box-shadow 200ms ease, background-color 200ms ease;
}

.voice[data-state="playing"],
.voice[data-state="paused"],
.voice[data-state="loading"] {
  background: color-mix(in oklch, var(--surface) 92%, var(--accent));
  box-shadow: inset 0 0 0 1px var(--accent-line), 0 10px 28px -14px oklch(0.79 0.118 199 / 0.45);
}

.voice__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 14px;
}

.voice__num {
  margin: 0;
  display: flex;
  align-items: flex-start;
  font: 700 3.25rem/0.86 var(--font-voice);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 200ms ease;
}
.voice__num-sign {
  margin: 3px 3px 0 0;
  font-size: 0.34em;
  line-height: 1;
  color: var(--text-3);
  letter-spacing: 0;
}
.voice[data-state="playing"] .voice__num,
.voice[data-state="paused"] .voice__num,
.voice[data-state="loading"] .voice__num { color: var(--accent); }

.voice__title {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.voice__name {
  margin: 0;
  font: 700 1.375rem/1.15 var(--font-voice);
  overflow-wrap: anywhere;
}

.voice__badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--cream-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Индикатор звучания */
.voice__eq {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}
.voice__eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: 50% 100%;
  transform: scaleY(0.35);
}
.voice[data-state="playing"] .voice__eq { display: inline-flex; }
.voice[data-state="playing"] .voice__eq i { animation: eq 900ms ease-in-out infinite alternate; }
.voice[data-state="playing"] .voice__eq i:nth-child(2) { animation-duration: 640ms; animation-delay: -200ms; }
.voice[data-state="playing"] .voice__eq i:nth-child(3) { animation-duration: 780ms; animation-delay: -480ms; }

@keyframes eq {
  0%   { transform: scaleY(0.3); }
  50%  { transform: scaleY(1); }
  100% { transform: scaleY(0.55); }
}

/* Плеер */
.voice__player {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
}

.play {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -2px 0 0 oklch(0 0 0 / 0.18), inset 0 2px 0 0 oklch(1 0 0 / 0.28);
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.play:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .play:not([aria-disabled="true"]):hover { background: oklch(0.84 0.11 199); }
}

.play > svg,
.play > .play__spinner {
  grid-area: 1 / 1;
  transition: opacity 150ms ease, transform 150ms var(--ease-out), filter 150ms ease;
}
.play svg { width: 20px; height: 20px; }
.play .icon-play { transform: translateX(1px); }

/* По умолчанию видна только иконка «играть» */
.play .icon-pause,
.play .icon-off,
.play .play__spinner { opacity: 0; transform: scale(0.8); filter: blur(2px); }

.voice[data-state="playing"] .play .icon-play,
.voice[data-state="loading"] .play .icon-play,
.voice[data-state="unavailable"] .play .icon-play { opacity: 0; transform: scale(0.8); filter: blur(2px); }

.voice[data-state="playing"] .play .icon-pause,
.voice[data-state="loading"] .play .play__spinner,
.voice[data-state="unavailable"] .play .icon-off { opacity: 1; transform: none; filter: none; }

.play__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid oklch(0.24 0.04 205 / 0.25);
  border-top-color: var(--accent-ink);
}
.voice[data-state="loading"] .play__spinner { animation: spin 700ms linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

.play[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--surface-2);
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.voice__track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.voice__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.voice[data-state="unavailable"] .voice__track {
  height: 0;
  border-top: 2px dashed var(--line-strong);
  border-radius: 0;
  background: none;
}

.voice__time {
  min-width: 5.6em;
  text-align: right;
  color: var(--text-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.voice[data-state="unavailable"] .voice__time { color: var(--text-3); min-width: 0; }

/* Команда в облачке из оверлея и копирование */
.voice__cmd {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bubble {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  aspect-ratio: 320 / 141;
  padding: 6px 10px 17px;
  background: url("../assets/img/chat-bubble.png") center / 100% 100% no-repeat;
  transform-origin: 50% 96%;
}
.bubble__text {
  font: 600 0.9375rem/1 var(--font-ui);
  color: var(--cream-ink);
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}
.bubble__text::selection { background: oklch(0.79 0.118 199 / 0.45); color: var(--cream-ink); }

.copy {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.copy:active { transform: scale(0.97); }
.copy__icon { position: relative; width: 18px; height: 18px; flex: none; }
.copy__icon svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  transition: opacity 150ms ease, transform 150ms var(--ease-out);
}
.copy .icon-check { opacity: 0; transform: scale(0.7); }
.copy__label { overflow: hidden; text-overflow: ellipsis; }

.copy.is-copied {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}
.copy.is-copied .icon-copy { opacity: 0; transform: scale(0.7); }
.copy.is-copied .icon-check { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .copy:not(.is-copied):hover { background: var(--surface-3); border-color: var(--text-3); }
}

@container (max-width: 330px) {
  .bubble { width: 112px; }
  .copy { font-size: 0.875rem; padding: 0 10px; gap: 6px; }
  .voice__num { font-size: 2.875rem; }
}

/* Пустой результат */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 20px 56px;
  border-radius: var(--radius-card);
  border: 1px dashed var(--line-strong);
  text-align: center;
}
.empty[hidden] { display: none; }
.empty .bubble { width: 132px; margin-bottom: 6px; }
.empty h2 {
  margin: 0;
  font: 700 1.5rem/1.2 var(--font-voice);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.empty p { margin: 0; color: var(--text-2); max-width: 40ch; }
.empty .btn { margin-top: 10px; }

/* ---------- Как применить ---------- */

.howto {
  padding-block: 8px 64px;
}

.howto__panel {
  display: grid;
  gap: 28px;
  padding: 28px 20px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (min-width: 900px) {
  .howto__panel {
    grid-template-columns: 1.25fr 1fr;
    gap: 48px;
    padding: 40px 44px;
  }
}

.howto h2 {
  margin: 0 0 18px;
  font-family: var(--font-voice);
  font-weight: 700;
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2rem);
  line-height: 1.1;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 14px;
  align-items: start;
  line-height: 1.5;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font: 700 1.125rem/1 var(--font-voice);
}
.steps li > span { padding-top: 6px; }

/* Команда в тексте: тот же кремовый материал, что у облачка */
.cmd {
  display: inline-block;
  padding: 3px 9px 4px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--cream-ink);
  font: 600 0.9375em/1.45 var(--font-ui);
  white-space: nowrap;
}

.howto__side {
  display: grid;
  align-content: start;
  gap: 18px;
}
@media (min-width: 900px) {
  .howto__side { padding-left: 40px; border-left: 1px solid var(--line); }
}

.howto__more {
  margin: 0;
  display: grid;
  gap: 12px;
}
.howto__more div { display: grid; gap: 4px; }
.howto__more dt { color: var(--text-2); font-size: 0.9375rem; }
.howto__more dd { margin: 0; }

.howto__side .btn { justify-self: start; min-height: 48px; padding: 0 20px; font-size: 1rem; }

/* ---------- Подвал ---------- */

.site-foot {
  margin-top: auto;
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.875rem;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }
.site-foot p { margin: 0; }

/* ---------- Сообщение о копировании ---------- */

.toast-region {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  justify-content: center;
  padding-inline: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 540px);
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 18px 40px -12px oklch(0 0 0 / 0.6);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(calc(100% + 24px));
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
}
.toast[data-open="true"] {
  opacity: 1;
  transform: none;
  transition: opacity 240ms ease, transform 280ms var(--ease-out);
}
.toast__icon { width: 22px; height: 22px; flex: none; color: var(--accent); }
.toast[data-tone="error"] .toast__icon { color: var(--warn); }
.toast__text { flex: 1; margin: 0; display: grid; gap: 1px; }
.toast__text strong { font-weight: 600; }
.toast__text span { color: var(--text-2); }
.toast__action {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
}
.toast__action[hidden] { display: none; }

/* ---------- Личные подборки, сравнение и сообщение о проблеме ---------- */

button:disabled { cursor: default; opacity: 0.55; }
.favorite-filter[aria-pressed="true"], .voice__action[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent);
}
.favorite-filter span { font-variant-numeric: tabular-nums; }
.discovery { padding-top: 6px; padding-bottom: 12px; }
.discovery__row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.discovery__row label { color: var(--text-2); }
.discovery select { min-height: 44px; min-width: 180px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--surface); color: var(--text); font: inherit; }
.discovery p { margin: 8px 0 0; max-width: 85ch; color: var(--text-3); font-size: 0.8125rem; }
.discovery [data-storage-note] { color: var(--warn); }
.voice__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice__action { min-height: 44px; padding: 8px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text-2); font-size: 0.8125rem; line-height: 1.25; }
.voice__report { min-height: 44px; justify-self: start; padding: 6px 2px; border: 0; background: transparent; color: var(--text-3); font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 3px; }
.comparison { padding-top: 8px; padding-bottom: 12px; }
.comparison__panel { padding: 20px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius-card); }
.comparison__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.comparison h2, .report h2 { margin: 0; font: 700 1.5rem/1.2 var(--font-voice); }
.comparison__hint, .comparison__status { margin: 12px 0; color: var(--text-2); font-size: 0.875rem; }
.comparison__status { margin-bottom: 0; min-height: 1.5em; }
.comparison__slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 16px; }
.comparison__slot { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.comparison__slot h3 { margin: 0 0 12px; font: 700 1.125rem/1.35 var(--font-voice); overflow-wrap: anywhere; }
.comparison__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.comparison__actions .btn { white-space: normal; padding-block: 8px; }
.comparison__slot .btn { font-size: 0.8125rem; padding-inline: 10px; }
.comparison__replace { margin-bottom: 16px; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.comparison__replace p { margin: 0 0 10px; overflow-wrap: anywhere; }
.report { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-card); background: var(--surface); color: var(--text); overflow-y: auto; }
.report::backdrop { background: rgb(0 0 0 / 0.72); }
.report p { color: var(--text-2); font-size: 0.9375rem; }
.report .report__voice { color: var(--accent); overflow-wrap: anywhere; }
.report__close { font-size: 0.8125rem; padding-inline: 12px; }
.report__reasons { display: grid; gap: 4px; margin: 16px 0; padding: 0; border: 0; }
.report__reasons legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.report__reasons label { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.report__reasons input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.report textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.report__detail p { margin-top: 4px; font-size: 0.8125rem; }
.report__command-label { display: block; margin-top: 16px; }
.report__command { font-size: 0.9375rem !important; }
.report__status { min-height: 1.5em; }
.toast__action { min-height: 44px; }
.search__clear { width: 44px; height: 44px; top: 2px; right: 2px; }

@media (max-width: 719px) {
  .favorite-filter { flex: 1 1 auto; }
  .comparison__panel, .report { padding: 16px; }
  .comparison__slots { grid-template-columns: 1fr; }
  .comparison__slot { padding: 12px; }
  .discovery__row select { flex: 1; }
  .search__clear { top: 1px; }
}

/* ---------- Узкие экраны ---------- */

@media (max-width: 719px) {
  .site-head { padding-block: 18px 12px; }
  .site-head__row { grid-template-columns: auto 1fr; column-gap: 12px; }
  .site-head__charm { width: 48px; height: 48px; }
  .site-head__lede { font-size: 1rem; }
  .site-head__chat { display: none; }
  .site-head__offset { grid-column: 1 / -1; }

  .toolbar { padding-block: 10px; }
  .toolbar__meta { display: contents; }
  .category { flex: 1 1 160px; min-width: 0; }
  .sort { width: 100%; }
  .sort legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .voice { padding: 14px 14px 14px; gap: 12px; }
  .howto__panel { padding: 24px 16px; }
  .howto__side .btn { justify-self: stretch; }
  .toast__action { padding: 0 10px; }
}

/* Телефон: на первом экране три карточки целиком */
@media (max-width: 719px) {
  .site-head { padding-block: 14px 8px; }
  .site-head__lede { margin-top: 4px; font-size: 0.9375rem; }
  .demo-note { margin-top: 10px; padding: 4px 10px 4px 8px; font-size: 0.8125rem; }
  .demo-note svg { width: 14px; height: 14px; }
  .toolbar { padding-block: 8px; }
  .toolbar__inner { gap: 8px 16px; }
  .search input { height: 46px; }
  .sort__option > span { min-height: 44px; padding-block: 11px; }
  .voice-grid { gap: 12px; }
  .voice { padding: 12px 14px; gap: 10px; }
  .voice__num { font-size: 2.75rem; }
}

/* ---------- Меньше движения ---------- */

@media (prefers-reduced-motion: reduce) {
  .voice[data-state="playing"] .voice__eq i { animation: none; }
  .voice[data-state="playing"] .voice__eq i:nth-child(1) { transform: scaleY(0.55); }
  .voice[data-state="playing"] .voice__eq i:nth-child(2) { transform: scaleY(1); }
  .voice[data-state="playing"] .voice__eq i:nth-child(3) { transform: scaleY(0.75); }
  .voice[data-state="loading"] .play__spinner { animation-duration: 1600ms; }
  .play > svg, .play > .play__spinner, .copy__icon svg { transition: opacity 150ms ease; transform: none !important; filter: none !important; }
  .toast, .toast[data-open="true"] { transform: none; transition: opacity 200ms ease; }
  .btn:active, .copy:active, .play:active { transform: none; }
}

/* ---------- Витрина состояний (states.html) ---------- */

.states { padding-block: 8px 72px; }

.states__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 28px 20px;
}

.state { display: grid; align-content: start; gap: 8px; }
.state--wide { grid-column: 1 / -1; }

.state__title {
  margin: 0;
  font: 700 1.25rem/1.2 var(--font-voice);
}
.state__note {
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 0.9375rem;
  max-width: 62ch;
}

.state__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  align-items: stretch;
}

.empty__title {
  margin: 0;
  font: 700 1.5rem/1.2 var(--font-voice);
  text-wrap: balance;
}

.toast--static {
  align-self: center;
  opacity: 1;
  transform: none;
  transition: none;
  width: 100%;
  max-width: 520px;
}
