/* Таверна — на токенах сайта (site/assets/css/style.css), подключается после него.
   Все классы с префиксом tv-, чтобы не задевать ни сайт, ни игру. */

[hidden] { display: none !important; }

.tv-body { min-height: 100vh; display: flex; flex-direction: column; }
.tv-body main { flex: 1; }

.tv-section { padding-top: clamp(20px, 3vw, 32px); }

/* ---------- Шапка раздела ---------- */
.tv-head .lead { max-width: 62ch; }
.tv-head-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Вкладки раздела ---------- */
.tv-subnav {
  display: flex; gap: 4px; margin-bottom: 26px; padding: 4px;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(12, 10, 19, .6);
  width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tv-subnav::-webkit-scrollbar { display: none; }
.tv-subnav a {
  padding: 8px 16px; border-radius: 999px; font-size: .9rem; color: var(--text-2);
  white-space: nowrap; transition: background .2s, color .2s;
}
.tv-subnav a:hover { color: var(--text); background: var(--surface-2); }
.tv-subnav a.is-active { color: var(--on-gold, #1a1206); background: linear-gradient(135deg, var(--btn-a, var(--gold-2)), var(--btn-b, var(--gold))); font-weight: 600; }

/* ---------- Фокус с клавиатуры ---------- */
.tv-body main :focus-visible, .tv-dialog :focus-visible {
  outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px;
}

/* ---------- Фильтры ленты ---------- */
.tv-filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.tv-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tv-filter-row-2 { justify-content: space-between; }
.tv-filters fieldset, .tv-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Переключатели на настоящих радиокнопках: сами кнопки спрятаны, но в фокусе
   и в порядке Tab, стрелки листают варианты — как у любой группы радио */
.tv-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); }
.tv-seg input, .tv-chips input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.tv-seg label {
  padding: 8px 16px; border-radius: 999px; font-size: .92rem; color: var(--text-2);
  cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; user-select: none;
}
.tv-seg label:hover { color: var(--text); }
.tv-seg input:checked + label { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(240,180,111,.45); }
.tv-seg input:focus-visible + label, .tv-chips input:focus-visible + label { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.tv-seg-gender[hidden] { display: none; }
.tv-seg-cap { align-self: center; padding: 0 6px 0 12px; font-size: .8rem; color: var(--text-2); }
.tv-seg-wide { display: flex; width: 100%; }
.tv-seg-wide label { flex: 1; text-align: center; white-space: normal; }

.tv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-chips label {
  padding: 6px 14px; border-radius: 999px; font-size: .86rem; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; user-select: none;
  transition: border-color .2s, color .2s, background .2s;
}
.tv-chips label:hover { color: var(--text); border-color: var(--border-strong); }
.tv-chips input:checked + label { color: var(--gold-t, var(--gold-2)); border-color: rgba(240,180,111,.55); background: rgba(232,147,76,.1); }

.tv-search { position: relative; flex: 1 1 240px; min-width: 0; }
.tv-search input { padding-left: 42px; border-radius: 999px; }
.tv-search-ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
  fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}

.tv-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; color: var(--text-2); user-select: none; }
.tv-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tv-switch-track {
  position: relative; width: 44px; height: 26px; border-radius: 999px; flex: none;
  background: var(--surface-2); border: 1px solid var(--border-strong); transition: background .2s, border-color .2s;
}
.tv-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-3); transition: transform .2s, background .2s;
}
.tv-switch input:checked + .tv-switch-track { background: rgba(192,80,58,.35); border-color: rgba(240,143,176,.6); }
.tv-switch input:checked + .tv-switch-track::after { transform: translateX(18px); background: var(--rose); }
.tv-switch input:focus-visible + .tv-switch-track { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------- Поля ввода ---------- */
.tv-body input[type="text"], .tv-body input[type="email"], .tv-body input[type="search"],
.tv-body textarea, .tv-body select, .tv-dialog textarea, .tv-dialog input[type="email"], .tv-dialog input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 12px; font: inherit; color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--border-strong); accent-color: var(--gold);
  transition: border-color .2s, background .2s;
}
.tv-body textarea, .tv-dialog textarea { resize: vertical; line-height: 1.55; }
.tv-body input:focus, .tv-body textarea:focus, .tv-body select:focus, .tv-dialog textarea:focus, .tv-dialog input:focus {
  outline: none; border-color: var(--gold); background: rgba(255,255,255,.07);
}
.tv-body [aria-invalid="true"] { border-color: var(--rose) !important; }
.tv-body input::placeholder, .tv-body textarea::placeholder, .tv-dialog textarea::placeholder { color: var(--text-3); }
.tv-body select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8934c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.tv-body option { background: #17131f; color: var(--text); }
.tv-body input[type="search"]::-webkit-search-cancel-button { filter: invert(.7); }

.tv-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; min-width: 0; }
.tv-field > label, .tv-label, .tv-label-row label, .tv-fieldset legend { font-size: .9rem; color: var(--text); font-weight: 500; }
.tv-fieldset { margin-bottom: 20px; }
.tv-fieldset legend { margin-bottom: 8px; padding: 0; }
.tv-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tv-counter { font-size: .78rem; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-counter.is-near { color: var(--gold-t, var(--gold-2)); }
.tv-optional { color: var(--text-3); font-weight: 400; font-size: .82rem; margin-left: 6px; }
.tv-hint { font-size: .84rem; color: var(--text-3); line-height: 1.5; }
.tv-field-error { font-size: .86rem; color: var(--rose); }
.tv-field-error:empty { display: none; }
.tv-field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0 16px; }

.tv-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: .95rem; line-height: 1.45; }
.tv-check input, .tv-radio input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); }
.tv-check a { color: var(--gold-t, var(--gold-2)); text-decoration: underline; text-underline-offset: 3px; }
.tv-field-check { gap: 6px; }
.tv-field-check .tv-hint { padding-left: 32px; }

.tv-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Статусы ---------- */
.tv-status { font-size: .92rem; color: var(--text-2); margin: 10px 0; }
.tv-status:empty { display: none; }
.tv-status.is-error { color: var(--rose); padding: 10px 14px; border-radius: 12px; background: rgba(240,143,176,.08); border: 1px solid rgba(240,143,176,.3); }
.tv-status.is-ok { color: var(--teal); padding: 10px 14px; border-radius: 12px; background: rgba(95,212,196,.07); border: 1px solid rgba(95,212,196,.3); }
.tv-loading { color: var(--text-3); padding: 40px 0; text-align: center; }
.tv-loading::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px;
  background: var(--gold-2); box-shadow: 0 0 12px var(--gold); vertical-align: 1px; animation: tv-flicker 1.4s ease-in-out infinite;
}
@keyframes tv-flicker { 0%, 100% { opacity: .45; } 40% { opacity: 1; } 70% { opacity: .7; } }
.tv-feed-status { min-height: 1.2em; }
/* «Подносим ещё…» лежит прямо на заднике темы: подложка цвета темы (замер 16.10: 1,3:1 в «Розовом королевстве») */
.tv-feed-status:not(:empty):not(.is-error):not(.is-ok) { display: inline-block; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* ---------- Пустые состояния ---------- */
.tv-notice {
  grid-column: 1 / -1; text-align: center; padding: clamp(36px, 6vw, 60px) 22px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); background: radial-gradient(420px 160px at 50% 0%, rgba(232,147,76,.08), transparent 70%), var(--surface);
}
.tv-notice-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); margin-bottom: 8px; }
.tv-notice-text { color: var(--text-2); max-width: 52ch; margin: 0 auto; }
.tv-notice-actions { justify-content: center; margin-top: 20px; }

/* ---------- Лента ----------
   Карточки — вертикальные 3:4, картинка на всю карточку, текст поверх
   затемнения снизу (образец владельца 07.10 — лента character.ai).
   Колонки: телефон 2, планшет 3, ПК 4 (замер — отчёт 07.10). */
.tv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
/* Подгрузка следующей страницы при прокрутке не должна притушать ленту (мигала) — только полная перезагрузка */
.tv-grid[aria-busy="true"]:not(.is-appending) { opacity: 1; filter: grayscale(.7); transition: filter .2s; } /* не гасим текст прозрачностью (16.10, контраст) */
/* Заглушка карточки, пока первая страница ленты в пути (14.10): та же форма 3:4, мягкий блик */
.tv-skel { content-visibility: visible; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  background: linear-gradient(110deg, #0e0c1a 30%, #1a1630 50%, #0e0c1a 70%) 0 0 / 220% 100%; animation: tv-skel 1.4s linear infinite; }
@keyframes tv-skel { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .tv-skel { animation: none; } }
.tv-card {
  position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; min-width: 0; isolation: isolate;
  background: #0e0c1a; box-shadow: 0 10px 28px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,255,255,.07);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
  /* Лента длинная: карточки вне экрана не раскладываем и не рисуем. Высоту держит aspect-ratio */
  content-visibility: auto; contain-intrinsic-size: auto 360px;
}
/* Подложки текста. В покое — тёмный низ только под названием, картинка остаётся видна;
   при раскрытии — завеса погуще на всю карточку. Прозрачность анимируется, а не градиент */
.tv-card::before, .tv-card::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: opacity .3s; }
.tv-card::before { background: linear-gradient(to top, rgba(7,5,12,.86) 0, rgba(7,5,12,.55) 26%, rgba(7,5,12,0) 46%); }
.tv-card::after { opacity: 0; background: linear-gradient(to top, rgba(7,5,12,.96) 0, rgba(7,5,12,.88) 42%, rgba(7,5,12,.5) 74%, rgba(7,5,12,.14) 100%); }
.tv-card-link { position: absolute; inset: 0; display: block; color: inherit; border-radius: inherit; }
.tv-card-link:focus-visible { outline: 3px solid var(--gold-2); outline-offset: -3px; }
.tv-card-art { position: absolute; inset: 0; z-index: -1; }
.tv-card-art .tv-cover { width: 100%; height: 100%; aspect-ratio: auto; }
.tv-card-art .tv-cover > img, .tv-card-art .tv-cover > svg { transition: transform .6s cubic-bezier(.2,.8,.2,1); will-change: auto; }
@media (hover: hover) {
  .tv-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 46px rgba(0,0,0,.5), 0 0 0 1px rgba(240,180,111,.55), 0 0 36px rgba(232,147,76,.22);
  }
  .tv-card:hover .tv-cover > img, .tv-card:hover .tv-cover > svg { transform: scale(1.05); }
}
.tv-cover { aspect-ratio: 16 / 10; background: #0e0c1a; overflow: hidden; position: relative; }
.tv-cover img, .tv-cover svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.tv-card-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; }
.tv-badge {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(10,8,16,.88); border: 1px solid var(--border-strong);
  color: var(--text); line-height: 1.3;
}
.tv-badge.is-world { color: #c9cbff; border-color: rgba(154,157,212,.6); }
.tv-badge.is-hero { color: #ffd29a; border-color: rgba(240,180,111,.65); }
.tv-badge.is-npc { color: #8fe6d6; border-color: rgba(95,212,196,.6); }
.tv-badge.is-official { color: #1b1209; background: linear-gradient(135deg, #f5c987, #e8934c); border-color: rgba(255,226,170,.8); }
.tv-badge.is-official .tv-badge-star { margin-right: 5px; }
/* Разрядка .06em и боковой зазор «А» оставляют хвост справа: надпись съезжала влево на 0,7–1,7 px (замер 22.10).
   Отступ в em, а не в px: на телефоне у значка свои поля и шрифт мельче */
.tv-badge.is-official { white-space: nowrap; }   /* отрицательный отступ иначе переносит подпись на вторую строку */
.tv-badge.is-official .tv-badge-txt { margin-right: -.1em; }
@media (max-width: 560px) {
  /* Карточка ленты: только звезда, подпись остаётся для читалки экрана и подсказки. На странице записи подпись целиком */
  .tv-card .tv-badge.is-official { padding-left: 8.5px; padding-right: 7.5px; }   /* глиф звезды сидит левее середины на ~1 px */
  .tv-card .tv-badge.is-official .tv-badge-star { margin-right: 0; }
  .tv-card .tv-badge.is-official .tv-badge-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Внутри игры карточки узкие и на компьютере (~157 px): по ширине окна правило выше не срабатывало, и подпись
   «От разработчика» ломалась на две строки, закрывая обложку (проверка 22.10). Решаем по ширине самого ряда значков:
   он растянут left/right, поэтому сдерживание ширины его не меняет. Старый браузер без @container — правило выше */
.tv-card .tv-card-badges { container: tvbadges / inline-size; }
@container tvbadges (max-width: 220px) {
  .tv-badge.is-official { padding-left: 8.5px; padding-right: 7.5px; }
  .tv-badge.is-official .tv-badge-star { margin-right: 0; }
  .tv-badge.is-official .tv-badge-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.tv-badge.is-adult { color: #fff; background: rgba(192,80,58,.9); border-color: rgba(240,143,176,.6); }

/* Текст поверх картинки: в покое только название, остальное в .tv-card-more раскрывается
   (наведение на ПК, фокус с клавиатуры, первое касание на телефоне — класс is-peek) */
.tv-card-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 44px 16px 14px; display: flex; flex-direction: column; min-width: 0;
}
.tv-card-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.tv-card-more-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tv-card-more-in > :first-child { margin-top: 8px; }
.tv-card.is-peek::after, .tv-card:has(.tv-card-link:focus-visible)::after { opacity: 1; }
.tv-card.is-peek .tv-card-more, .tv-card:has(.tv-card-link:focus-visible) .tv-card-more { grid-template-rows: 1fr; opacity: 1; }
@media (hover: hover) {
  .tv-card:hover::after { opacity: 1; }
  .tv-card:hover .tv-card-more { grid-template-rows: 1fr; opacity: 1; }
}
/* Предпросмотр при публикации: автор хочет видеть все поля сразу */
.tv-preview-card .tv-card::after { opacity: 1; }
.tv-preview-card .tv-card .tv-card-more { grid-template-rows: 1fr; opacity: 1; }
.tv-card-title {
  font-family: var(--font-display); font-size: 1.42rem; font-weight: 700; line-height: 1.15; color: #fff;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.tv-card-short {
  color: #ddd5c8; font-size: .86rem; line-height: 1.42; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tv-card .tv-card-source { color: #a9e2cf; font-size: .78rem; font-style: italic; -webkit-line-clamp: 1; }
.tv-card-author { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: .82rem; color: #e6dfd4; margin: 1px 0 0; }
.tv-ava {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; color: #fff; line-height: 1;
  background: linear-gradient(135deg, hsl(var(--ava-h, 30) 70% 52%), hsl(calc(var(--ava-h, 30) + 40) 70% 38%));
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.35);
}
.tv-card-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tv-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tv-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: #f3ede4; font-variant-numeric: tabular-nums; line-height: 1.35;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16);
}
.tv-pill .tv-heart, .tv-pill .tv-take-ic { width: 14px; height: 14px; }
.tv-pill .tv-heart { fill: #ff7aa2; stroke: #ff7aa2; }
.tv-take-ic { fill: none; stroke: #9fd8ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tv-pill-genre { padding-left: 10px; color: #e9dcc8; font-weight: 500; }
@media (max-width: 1100px) { .tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tv-tags li, .tv-tags a {
  font-size: .76rem; padding: 2px 10px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-2); overflow-wrap: anywhere;
}
.tv-tags li:has(a) { padding: 0; border: 0; background: none; }
.tv-tags a { display: inline-block; transition: color .2s, border-color .2s; }
.tv-tags a:hover { color: var(--gold-t, var(--gold-2)); border-color: rgba(240,180,111,.45); }
.tv-card-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--text-3); margin-top: auto; padding-top: 4px; min-width: 0; }
.tv-card-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tv-card-genre { white-space: nowrap; color: var(--text-2); }
.tv-card-stats { display: flex; gap: 14px; align-items: center; font-size: .84rem; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 10px; }
.tv-stat { display: inline-flex; align-items: center; gap: 5px; }
.tv-heart { width: 16px; height: 16px; fill: none; stroke: var(--rose); stroke-width: 2; stroke-linejoin: round; }
.tv-more { display: flex; justify-content: center; margin-top: 28px; }
.tv-sentinel { height: 1px; }

/* ---------- Панели (вход, псевдоним) ---------- */
.tv-panel {
  padding: clamp(20px, 3vw, 28px); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); max-width: 560px;
}
.tv-gate .tv-panel { margin: 0 auto 24px; }
.tv-panel-title { font-family: var(--font-display); font-size: 1.55rem; margin-bottom: 8px; }
.tv-panel-lead { margin-bottom: 18px; font-size: .92rem; }
.tv-auth-step .tv-field { margin-bottom: 14px; }
.tv-resend-note { margin: 0 0 12px; color: var(--text-2); overflow-wrap: anywhere; }
.tv-resend-note b { color: var(--text); font-weight: 700; }
.tv-resend-row { margin: 12px 0 0; }
.tv-resend { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; font: inherit; font-size: .95rem; font-weight: 700; color: var(--gold-t, var(--text)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; max-width: 100%; }
.tv-resend:disabled { color: var(--text-2); text-decoration: none; cursor: default; opacity: 1; }
.tv-auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-3); font-size: .82rem; }
.tv-auth-or::before, .tv-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Диалоги ---------- */
.tv-dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #17131f, #100d18); color: var(--text); box-shadow: var(--shadow);
}
.tv-dialog-wide { width: min(560px, calc(100vw - 32px)); }
.tv-dialog::backdrop { background: rgba(5,4,10,.7); backdrop-filter: blur(3px); }
.tv-dialog-title { font-family: var(--font-display); font-size: 1.45rem; margin-bottom: 10px; overflow-wrap: anywhere; } /* длинное слово в названии записи не вылезает за край окна (находка 086) */
.tv-dialog-text { color: var(--text-2); margin-bottom: 16px; font-size: .95rem; }
.tv-dialog-actions { justify-content: flex-end; margin-top: 8px; }
.tv-dialog .tv-panel { padding: 0; border: 0; background: none; margin-bottom: 12px; }
.tv-dialog .tv-panel-title { font-size: 1.1rem; }
.tv-reasons { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; }
.tv-reasons legend { font-weight: 500; margin-bottom: 8px; }
.tv-radio { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: .94rem; }
.tv-radio:hover { background: var(--surface-2); }
.tv-radio:has(input:checked) { background: rgba(232,147,76,.1); }

/* ---------- Кнопки ---------- */
.tv-btn-danger { color: #fff; background: linear-gradient(135deg, #d0654d, var(--ember)); box-shadow: 0 10px 26px rgba(192,80,58,.3); }
.tv-danger-text { color: var(--rose); }
.tv-quiet { color: var(--text-2); }
/* «Скопировать ссылку» — отдельной строкой во всю ширину, а не в две строки внутри половинки ряда (находка 014) */
.tv-share .share-copy { flex: 1 1 100%; white-space: nowrap; }
.tv-linkbtn { background: none; border: 0; padding: 0; color: var(--gold-t, var(--gold-2)); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.btn:disabled { opacity: 1; filter: saturate(.4); border-style: dashed; cursor: default; transform: none; } /* состояние — обесцвеченностью и рамкой, текст читаем (16.10) */

/* ---------- Страница записи ---------- */
.tv-record-art { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 28px; }
/* Запись: большая обложка сверху. Вертикальная картинка не режется в полоску —
   она целиком по центру, а по бокам её же размытая копия (.tv-cover-blur) */
.tv-record-art .tv-cover { aspect-ratio: auto; height: clamp(240px, 38vh, 380px); } /* от высоты окна: на ПК 580 px занимали весь первый экран, название и «Взять себе» уходили вниз (находка 062) */
.tv-cover.has-backdrop .tv-cover-blur {
  position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px);
  object-fit: cover; filter: blur(30px) brightness(.55) saturate(1.3);
}
.tv-cover.has-backdrop .tv-cover-img { position: relative; object-fit: contain; }
@media (max-width: 720px) {
  .tv-record-art .tv-cover.is-art { aspect-ratio: 16 / 10; }
}
.tv-record-art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; pointer-events: none;
  background: linear-gradient(to top, rgba(7,5,12,.55), transparent);
}
.tv-record-art .tv-card-badges { top: 16px; left: 16px; }
.tv-record-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.tv-record-main { min-width: 0; }
.tv-record-eyebrow { margin-bottom: 12px; }
.tv-record-title { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; overflow-wrap: anywhere; }
.tv-record-short { font-size: 1.15rem; color: var(--text-2); margin-top: 14px; overflow-wrap: anywhere; }
.tv-record-meta { color: var(--text-3); font-size: .9rem; margin: 14px 0; }
.tv-record-main .tv-tags { margin-bottom: 26px; }
.tv-record-desc {
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.75; color: #e7dfd2;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.tv-record-side { position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.tv-record-actions {
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.tv-take-row { flex-wrap: nowrap; }
.tv-take { flex: 1 1 auto; }
.tv-like { padding-inline: 16px; gap: 7px; font-variant-numeric: tabular-nums; }
.tv-like .tv-heart { width: 18px; height: 18px; transition: fill .2s, transform .2s; }
.tv-like.is-on .tv-heart { fill: var(--rose); transform: scale(1.08); }
.tv-like.is-on { border-color: rgba(240,143,176,.5); }
.tv-author-tools { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.tv-record-auth .tv-panel { max-width: none; }
.tv-banner { padding: 14px 16px; border-radius: 14px; margin-bottom: 20px; background: rgba(232,147,76,.08); border: 1px solid rgba(240,180,111,.35); color: var(--gold-t, var(--gold-2)); }
.tv-banner-reason { color: var(--text-2); margin-top: 6px; font-size: .92rem; overflow-wrap: anywhere; }

.tv-age {
  max-width: 560px; margin: 20px auto; text-align: center; padding: clamp(28px, 5vw, 48px) 24px;
  border-radius: var(--radius); background: radial-gradient(360px 180px at 50% 0%, rgba(192,80,58,.18), transparent 70%), var(--surface);
  border: 1px solid rgba(240,143,176,.3);
}
.tv-age-mark {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: #fff;
  background: linear-gradient(135deg, #d0654d, var(--ember)); box-shadow: 0 10px 30px rgba(192,80,58,.35);
}
.tv-age-title { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 12px; }
.tv-age-text { color: var(--text-2); }
.tv-age-actions { justify-content: center; margin-top: 22px; }

/* ---------- Публикация ---------- */
.tv-publish { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.tv-form {
  padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 0;
}
.tv-form-title { font-size: 1.9rem; margin-bottom: 6px; }
.tv-form > .tv-hint:first-of-type { margin-bottom: 22px; }
.tv-form > .tv-hint b { color: var(--text); font-weight: 600; }
.tv-nick-slot .tv-panel { margin: -10px 0 22px; max-width: none; background: rgba(0,0,0,.18); }
.tv-preview { position: sticky; top: calc(var(--nav-h) + 16px); }
.tv-preview-title { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 12px; }
.tv-preview-card .tv-card:hover { transform: none; }
.tv-picker { margin: -6px 0 22px; display: flex; flex-direction: column; gap: 14px; }
.tv-picker .tv-notice { padding: 24px 18px; }
.tv-picker .tv-notice-title { font-size: 1.2rem; }
.tv-pick-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.tv-pick-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tv-pick {
  text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.03);
  border: 1px solid var(--border); min-width: 0; transition: border-color .2s, background .2s;
}
.tv-pick:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tv-pick[aria-pressed="true"] { border-color: var(--gold); background: rgba(232,147,76,.1); }
.tv-pick b { display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-pick span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; color: var(--text-3); }
.tv-cover-pick { display: flex; gap: 16px; align-items: flex-start; }
.tv-cover-thumb {
  flex: none; width: 120px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  border: 1px dashed var(--border-strong); display: grid; place-items: center; background: rgba(0,0,0,.2);
}
.tv-cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tv-cover-empty { font-size: .8rem; color: var(--text-3); }
.tv-cover-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.tv-cover-actions .tv-hint { flex-basis: 100%; }
.tv-file-btn { cursor: pointer; }
.tv-file-btn:has(+ input:focus-visible) { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.tv-done { max-width: 640px; margin: 0 auto; }
.tv-done:focus { outline: none; }

/* ---------- Мои записи и модерация ---------- */
.tv-page-title { margin-bottom: 8px; }
.tv-page-lead { margin-bottom: 22px; }
.tv-mine-head { justify-content: space-between; margin-bottom: 16px; }
.tv-mine-list, .tv-queue-list { display: flex; flex-direction: column; gap: 14px; }
.tv-mine-item, .tv-mod-item {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; padding: 16px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.tv-mine-item.is-deleted { opacity: 1; filter: grayscale(.7); }
.tv-mine-cover .tv-cover { border-radius: 12px; }
.tv-mine-body, .tv-mod-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tv-mine-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tv-mine-title { font-family: var(--font-display); font-size: 1.35rem; overflow-wrap: anywhere; }
.tv-mine-title a:hover { color: var(--gold-t, var(--gold-2)); }
.tv-mine-reason { font-size: .9rem; color: var(--gold-t, var(--gold-2)); padding: 8px 12px; border-radius: 10px; background: rgba(232,147,76,.08); overflow-wrap: anywhere; }
.tv-mine-stats { font-size: .86rem; color: var(--text-3); }
.tv-mod-item.is-target { outline: 2px solid var(--gold-t, var(--gold-2)); outline-offset: 4px; }
.tv-appeal { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tv-appeal .tv-mine-reason { align-self: stretch; }
.tv-appeal-comment { align-self: stretch; margin-bottom: 0; }
.tv-appeal-sent { color: var(--teal); background: rgba(95,212,196,.07); }
.tv-mine-actions { margin-top: 6px; }
.tv-state { font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; border: 1px solid; }
.tv-state.is-published { color: var(--teal); border-color: rgba(95,212,196,.4); background: rgba(95,212,196,.07); }
.tv-state.is-review { color: var(--gold-t, var(--gold-2)); border-color: rgba(240,180,111,.45); background: rgba(232,147,76,.08); }
.tv-state.is-hidden { color: var(--rose); border-color: rgba(240,143,176,.45); background: rgba(240,143,176,.07); }
.tv-state.is-deleted { color: var(--text-3); border-color: var(--border-strong); }

.tv-mod-item { display: block; }
.tv-mod-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
.tv-mod-author { gap: 10px; }
.tv-mod-desc { margin-top: 6px; }
.tv-mod-desc summary { cursor: pointer; color: var(--text-2); font-size: .9rem; padding: 4px 0; }
.tv-mod-desc .tv-record-desc { font-size: .95rem; padding-top: 12px; max-height: 420px; overflow-y: auto; }
.tv-mod-reports { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: rgba(240,143,176,.05); border: 1px solid rgba(240,143,176,.22); }
.tv-mod-reports h3 { font-size: .95rem; color: var(--rose); margin-bottom: 10px; font-family: var(--font-body); }
.tv-mod-reports ul { display: flex; flex-direction: column; gap: 10px; }
.tv-mod-reports li { font-size: .9rem; }
.tv-mod-comment { color: var(--text-2); margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tv-mod-noreports { margin-top: 14px; }
.tv-mod-note { margin: 16px 0 8px; }

/* ---------- Правила ---------- */
.tv-rules { max-width: 780px; display: flex; flex-direction: column; gap: 18px; }
.tv-rules-block { padding: clamp(20px, 3vw, 30px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tv-rules-block h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 14px; }
.tv-rules-block p + p { margin-top: 12px; }
.tv-rules-block p, .tv-rules-block li { color: var(--text-2); line-height: 1.65; }
.tv-rules-block b { color: var(--text); font-weight: 600; }
.tv-rules-block ul { display: flex; flex-direction: column; gap: 10px; }
.tv-rules-block li { position: relative; padding-left: 26px; }
.tv-rules-block li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); opacity: .8; }
.tv-rules-block.is-yes { border-color: rgba(95,212,196,.28); }
.tv-rules-block.is-yes h2 { color: var(--teal); }
.tv-rules-block.is-yes li::before { background: var(--teal); }
.tv-rules-block.is-no { border-color: rgba(240,143,176,.28); }
.tv-rules-block.is-no h2 { color: var(--rose); }
.tv-rules-block.is-no li::before { background: none; width: 10px; height: 2px; border-radius: 0; top: .78em; background-color: var(--rose); }
.tv-rules-block a { color: var(--gold-t, var(--gold-2)); text-decoration: underline; text-underline-offset: 3px; }
.tv-rules-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Узкие экраны ---------- */
@media (max-width: 960px) {
  .tv-record-grid, .tv-publish { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tv-record-side, .tv-preview { position: static; }
  /* Находка 081: на телефоне блок действий (лайк, копирование, четыре «Поделиться») шёл первым, и название с автором
     начинались ниже 1000 px. Теперь порядок: обложка, название, автор, теги, затем действия, затем описание. */
  .tv-record-grid { display: flex; flex-direction: column; gap: 0; }
  .tv-record-main { display: contents; }
  .tv-record-side { order: 2; margin: 6px 0 22px; }
  .tv-record-main > .tv-record-desc, .tv-record-main > h2.visually-hidden { order: 3; }
  .tv-preview { max-width: 420px; }
}
@media (max-width: 720px) {
  .tv-record-art .tv-cover { height: auto; aspect-ratio: 4 / 5; max-height: 52vh; }
  .tv-record-art { margin-bottom: 20px; }
}
@media (max-width: 600px) {
  .tv-filter-row { gap: 10px; }
  .tv-filter-row > .tv-seg { flex: 1 1 auto; }
  .tv-filter-row > .tv-seg label { flex: 1; text-align: center; padding: 8px 10px; }
  .tv-search { flex-basis: 100%; order: -1; }
  /* Две колонки, как в образце: на 360 карточка ≈160×213, текст не мельче 12px.
     Строку описания и жанр прячем — на такой ширине они съедали бы картинку */
  .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tv-card { border-radius: 16px; }
  .tv-card-badges { top: 8px; left: 8px; right: 8px; gap: 4px; }
  .tv-badge { font-size: .7rem; padding: 3px 7px; letter-spacing: .03em; }
  .tv-card-body { padding: 40px 10px 10px; }
  .tv-card-more-in { gap: 5px; }
  .tv-card-title { font-size: 1.04rem; line-height: 1.18; }
  .tv-card-short { font-size: .78rem; line-height: 1.35; -webkit-line-clamp: 2; }
  .tv-pill-genre, .tv-card .tv-card-source { display: none; }
  .tv-card-author { font-size: .75rem; gap: 5px; }
  .tv-ava { width: 18px; height: 18px; font-size: .64rem; }
  .tv-pills { gap: 4px; }
  .tv-pill { font-size: .75rem; padding: 2px 8px 2px 6px; gap: 4px; }
  .tv-pill .tv-heart, .tv-pill .tv-take-ic { width: 12px; height: 12px; }
  .tv-field-pair { grid-template-columns: minmax(0, 1fr); }
  .tv-cover-pick { flex-direction: column; }
  .tv-cover-thumb { width: 100%; max-width: 200px; }
  .tv-mine-item, .tv-mod-grid { grid-template-columns: minmax(0, 1fr); }
  .tv-mine-cover { max-width: 100%; }
  .tv-head-actions .btn { width: 100%; }
  .tv-subnav { width: 100%; }
  .tv-subnav a { flex: 1 0 auto; text-align: center; padding: 8px 12px; }
  .tv-take-row { flex-wrap: wrap; }
  .tv-dialog { padding: 20px 18px; }
  .tv-seg-wide { flex-direction: column; border-radius: 18px; }
  .tv-seg-wide label { border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-card, .tv-card:hover { transition: none; transform: none; }
  .tv-card::before, .tv-card::after, .tv-card-more { transition: none; }
  .tv-loading::before { animation: none; opacity: 1; }
  .tv-switch-track, .tv-switch-track::after, .tv-like .tv-heart, .tv-grid[aria-busy="true"] { transition: none; }
}

/* Поиск: общий отступ полей выше перебивал место под значок лупы */
.tv-body .tv-search input[type="search"] { padding-left: 42px; border-radius: 999px; }

/* Вкладки раздела на телефоне: четыре в ряд без прокрутки */
@media (max-width: 480px) {
  .tv-subnav { display: grid; grid-template-columns: repeat(4, auto); justify-content: stretch; gap: 2px; }
  .tv-subnav a { padding: 8px 6px; font-size: .82rem; }
}

/* Свои галочки и радиокнопки: системные в тёмной теме — белые квадраты */
.tv-check input[type="checkbox"], .tv-radio input[type="radio"] {
  appearance: none; -webkit-appearance: none; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.32); background: rgba(255,255,255,.05); transition: background .15s, border-color .15s;
}
.tv-check input[type="checkbox"] { border-radius: 6px; }
.tv-radio input[type="radio"] { border-radius: 50%; }
.tv-check input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
.tv-check input[type="checkbox"]:checked::after {
  content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid #1a1206; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tv-radio input[type="radio"]:checked { border-color: var(--gold); box-shadow: inset 0 0 0 4px #17131f; background: var(--gold); }
.tv-check input:focus-visible, .tv-radio input:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.tv-check input[aria-invalid="true"] { border-color: var(--rose); }

/* На телефоне в списках обложка — полоса, а не полэкрана */
@media (max-width: 600px) {
  .tv-mine-cover .tv-cover { aspect-ratio: 21 / 8; }
}
.tv-rules-block ul + p { margin-top: 14px; }

/* Происхождение записи (07.10): «Авторское» спокойнее, «По мотивам» заметнее —
   игрок должен сразу видеть, что перед ним пересказ чужого замысла */
.tv-badge.is-original { color: #cfc6b8; }
.tv-badge.is-fanwork { color: #9fd8c4; border-color: rgba(120,200,170,.5); }
.tv-card-source, .tv-record-source { color: var(--text-3); font-size: .84rem; font-style: italic; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0; }
.tv-record-source { font-size: .95rem; margin-top: 6px; }

/* Фильтры компактнее (07.10): лента — главное на экране, переключатели — служебное.
   На телефоне жанры — одна строка с прокруткой вбок, а не три строки кнопок */
.tv-filters { gap: 10px; margin-bottom: 16px; }
.tv-filter-row { gap: 8px 10px; }
.tv-seg { padding: 3px; }
.tv-seg label { padding: 6px 13px; font-size: .86rem; }
.tv-chips { gap: 6px; }
.tv-chips label { padding: 5px 12px; font-size: .8rem; }
.tv-body .tv-search input[type="search"] { padding-top: 9px; padding-bottom: 9px; }
.tv-switch { font-size: .86rem; }
@media (max-width: 600px) {
  /* Находка 015 (ночная проверка 15.10, перепроверка): прокручиваемый ряд жанров под затуханием прятал чип «Нуар», а тумблер
     18+ стоял на нём. Жанры переносятся строками на всю ширину, тумблер идёт отдельной строкой ниже. */
  .tv-filter-row-2 { flex-wrap: wrap; }
  .tv-filter-row-2 .tv-chips { flex: 1 1 100%; min-width: 0; }
  .tv-chips label { white-space: nowrap; }
  .tv-switch { flex: none; font-size: .8rem; gap: 6px; }
  .tv-switch-track { width: 38px; height: 22px; }
  .tv-switch-track::after { width: 14px; height: 14px; }
  .tv-switch input:checked + .tv-switch-track::after { transform: translateX(16px); }
  .tv-seg label { padding: 5px 8px; font-size: .82rem; }
  .tv-seg { padding: 2px; }
  .tv-filters { gap: 8px; }
}
/* Ссылка на статические страницы персонажей (/personazhi/) под кнопками шапки ленты */
.tv-hero-more { margin: 16px 0 0; font-size: .92rem; color: var(--text-2); }
.tv-hero-more a { color: var(--gold-2); }

/* ---------- Теги (09.10): вкладки «Для вас / Все записи», строка чипов, выбор в форме ---------- */
/* 15.10, владелец: «Теги почти не видно, сделай им задний фон». Плотная подложка под вкладками, видом записи,
   чипами тегов и подписью ленты: непрозрачная (--bg под тёмной заливкой темы), по токенам темы, чтобы текст
   (--text) читался на любом пятне картинки-задника. Контраст текста к подложке — не ниже 4,5:1 (замер в отчёте). */
:root { --tv-pod: color-mix(in srgb, var(--bg) 84%, var(--surface-2)); }
.tv-feedtabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 999px;
  background: var(--tv-pod); border: 1px solid var(--border-strong); max-width: 100%;
}
.tv-feedtab {
  appearance: none; border: 0; background: none; cursor: pointer; font: inherit;
  padding: 7px 18px; border-radius: 999px; font-size: .9rem; color: var(--text-2); white-space: nowrap;
  transition: background .2s, color .2s;
}
.tv-feedtab:hover { color: var(--text); }
/* 320 px: «Официальные» вылезало за рамку полосы, документ шире окна на 8 px (U1-005, 29.10) */
@media (max-width: 359px) { .tv-feedtabs { gap: 2px; } .tv-feedtab { padding: 7px 12px; font-size: .86rem; } }
.tv-feedtab.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(240,180,111,.45); font-weight: 600; }
.tv-kindtabs { display: flex; width: fit-content; } /* вид записи — отдельной строкой под «Для вас / Все записи» и на ПК */
.tv-feedlead { margin: -4px 0 14px; color: var(--text); font-size: .9rem; padding: 7px 12px; border-radius: 12px; background: var(--tv-pod); width: fit-content; max-width: 100%; }

.tv-tegbar { margin-bottom: 12px; }
.tv-tegbar-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tv-tegrow { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1 1 auto; }
.tv-tegrow-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.tv-teg {
  appearance: none; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: .8rem; line-height: 1.3; white-space: nowrap;
  color: var(--text); background: var(--tv-pod); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border-strong));
  transition: border-color .2s, color .2s, background .2s;
}
.tv-teg:hover { color: var(--text); border-color: var(--gold); }
.tv-teg.is-on { color: var(--gold-t, var(--gold-2)); border-color: rgba(240,180,111,.7); background: color-mix(in srgb, var(--gold) 22%, var(--tv-pod)); }
.tv-teg:disabled { opacity: 1; filter: saturate(.4); border-style: dashed; cursor: default; }
.tv-teg-n { color: var(--text-2); font-size: .72rem; }
.tv-teg-x { font-size: 1.05rem; line-height: .8; margin: -2px -3px 0 0; opacity: .8; }
.tv-teg-all { border-style: dashed; color: var(--text); flex: none; align-self: flex-start; }
.tv-teg-all::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.tv-teg-all.is-open::after { transform: translateY(1px) rotate(-135deg); }
.tv-teg-main { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.tv-teg-reset {
  appearance: none; border: 1px solid var(--border-strong); background: var(--tv-pod); font: inherit; cursor: pointer; flex: none;
  color: var(--text); font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; padding: 4px 12px; border-radius: 999px;
}
.tv-teg-reset:hover { border-color: var(--gold); }
.tv-tegbar-note:empty { display: none; }
.tv-tegbar-note { margin: 6px 0 0; }

.tv-tegpanel {
  margin-top: 10px; padding: 14px; border-radius: 16px; background: rgba(12,10,19,.72);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px;
}
.tv-body .tv-tegpanel .tv-tegpanel-search { border-radius: 999px; padding-top: 8px; padding-bottom: 8px; max-width: 360px; }
.tv-tegpanel-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.tv-tegpanel-title { margin: 0 0 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tv-tegpanel-empty { margin: 0; }

/* Выбор в форме публикации: выбранные сверху, весь справочник — в прокручиваемом окне */
.tv-tegpick .tv-tegpanel { margin-top: 8px; padding: 12px; }
.tv-tegpick .tv-tegpanel-groups { max-height: 280px; overflow-y: auto; padding-right: 4px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tv-tegpick-sel { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; align-items: center; margin-top: 8px; }
.tv-tegpick-empty { color: var(--text-3); font-size: .86rem; }

/* Теги на карточке ленты и на странице записи */
.tv-card-tegi { margin: 0; font-size: .76rem; color: var(--gold-t, var(--gold-2)); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-record-main .tv-tegi { margin-bottom: 12px; }
.tv-tegi a { color: var(--gold-t, var(--gold-2)); border-color: rgba(240,180,111,.35); }

@media (max-width: 600px) {
  .tv-feedtabs { display: flex; width: 100%; }
  .tv-feedtab { flex: 1; text-align: center; padding: 7px 10px; font-size: .86rem; }
  /* 320 px: «Официальные» вылезало за рамку полосы, документ шире окна на 8 px (U1-005, 29.10): равные доли (flex: 1) короче слова */
  @media (max-width: 359px) { .tv-feedtabs { gap: 2px; } .tv-feedtab { flex: 1 1 auto; min-width: 0; padding: 7px 7px; font-size: .8rem; } }
  /* Строка чипов на телефоне — одна строка с прокруткой вбок, как жанры */
  .tv-tegrow {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 18px;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .tv-tegrow::-webkit-scrollbar { display: none; }
  /* 390 px (проверка 09.10): «Все теги» стояла справа от прокручиваемой строки, и обрезанный краем строки
     чип («К…») выглядел залезшим под кнопку. Теперь кнопка слева, строка чипов уходит до края экрана
     (обрез и затухание — у края, как у любой ленты вбок), «Сбросить теги» — отдельной строкой ниже */
  .tv-tegbar-line { align-items: center; flex-wrap: wrap; row-gap: 6px; }
  .tv-teg-all { order: -1; align-self: center; }
  /* 15.10: слева край строки с плавным затуханием (было 4 px): чип, прокрученный под край, не торчит
     полукруглым обрезком рядом с «Все теги», а гаснет. Прокрутка при каждой перерисовке строки — в начало. */
  .tv-tegrow {
    flex: 1 1 0; margin-left: 0; padding-left: 6px; scroll-padding-left: 6px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 85%, transparent);
    mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 85%, transparent);
  }
  /* «Сбросить теги» — отдельной строкой и по ширине текста (была на всю ширину); разрыв строки — пустой элемент после чипов */
  .tv-tegbar-line::after { content: ''; order: 1; flex: 0 0 100%; height: 0; }
  .tv-teg-reset { order: 2; flex: 0 0 auto; margin-top: -6px; text-align: left; font-size: .76rem; }
  .tv-tegpanel { padding: 12px 10px; }
  .tv-tegpanel-groups { grid-template-columns: minmax(0, 1fr); }
  .tv-tegpanel .tv-tegrow-wrap .tv-teg { font-size: .78rem; padding: 5px 10px; }
  .tv-card-tegi { font-size: .7rem; }
}

/* Плавность прокрутки отдельной страницы (13.10): фиксированная шумовая подложка с mix-blend-mode
   пересчитывалась на каждый кадр прокрутки ленты. Шум едва виден — на странице Таверны его нет */
body.tv-body .sky::after { content: none; }

/* ---------- Читаемость над яркими задниками (13.10, проверяющий) ----------
   neo_action: огни города справа, pink_kingdom: светлый сад. Полупрозрачная --surface там пропускает фон,
   и мелкие чипы тегов, подпись ленты и описание в карточке бледнели (на телефоне сильнее). Подложка под ними
   теперь плотная; цвет текста и подложки подобран так, что контраст не ниже 4,5:1 на любом пятне фона. */
html[data-theme="neo_action"] .tv-chips label, html[data-theme="neo_action"] .tv-tags li, html[data-theme="neo_action"] .tv-tags a {
  background: rgba(7, 9, 16, .92); color: #e6edf3; border-color: rgba(120, 160, 190, .45);
}
html[data-theme="neo_action"] .tv-teg { background: rgba(7, 9, 16, .92); color: #e6edf3; border-color: rgba(120, 160, 190, .45); }
html[data-theme="neo_action"] .tv-teg .tv-teg-n { color: #aab6c2; }
html[data-theme="neo_action"] .tv-teg.is-on { background: rgba(0, 60, 34, .95); color: #7dffb4; border-color: #22e07a; }
html[data-theme="neo_action"] .tv-chips input:checked + label { background: rgba(0, 60, 34, .95); color: #7dffb4; border-color: #22e07a; }
html[data-theme="neo_action"] .tv-feedlead, html[data-theme="neo_action"] .tv-card-more .tv-card-short {
  color: #eef3f7; text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}
html[data-theme="neo_action"] .tv-feedlead { padding: 8px 12px; border-radius: 10px; background: rgba(7, 9, 16, .86); }
html[data-theme="pink_kingdom"] .tv-chips label, html[data-theme="pink_kingdom"] .tv-tags li, html[data-theme="pink_kingdom"] .tv-tags a {
  background: rgba(255, 255, 255, .95); color: #6b1d46; border-color: #e58cb8;
}
html[data-theme="pink_kingdom"] .tv-teg { background: rgba(255, 255, 255, .95); color: #6b1d46; border-color: #e58cb8; }
html[data-theme="pink_kingdom"] .tv-teg .tv-teg-n { color: #8a4a69; }
html[data-theme="pink_kingdom"] .tv-teg.is-on { background: #8f1a55; color: #fff; border-color: #8f1a55; }
html[data-theme="pink_kingdom"] .tv-chips input:checked + label { background: #8f1a55; color: #fff; border-color: #8f1a55; }
html[data-theme="pink_kingdom"] .tv-feedlead { padding: 8px 12px; border-radius: 12px; background: rgba(255, 245, 250, .93); color: #5e1a3d; }
/* текст раскрытой карточки лежит на картинке: в этих двух темах затемняем подложку плотнее */
html[data-theme="neo_action"] .tv-card::after, html[data-theme="pink_kingdom"] .tv-card::after {
  background: linear-gradient(to top, rgba(7, 5, 12, .97) 0, rgba(7, 5, 12, .93) 55%, rgba(7, 5, 12, .72) 82%, rgba(7, 5, 12, .3) 100%);
}
html[data-theme="neo_action"] .tv-card .tv-card-tegi, html[data-theme="pink_kingdom"] .tv-card .tv-card-tegi { opacity: 1; color: #ffd9ec; }

/* Зоны нажатия на телефоне >= 44 px (20.10, замечание 5) */
@media (pointer: coarse), (max-width: 767.98px) {
  .tv-feedtab, .tv-subnav a, .tv-teg, .tv-teg-reset { min-height: 44px; }
  .tv-subnav a { display: inline-flex; align-items: center; justify-content: center; }
  .lp-tegi .tv-tegrow { row-gap: 6px; }
}
