/* TrendVideo — общие стили всех страниц. Страница добавляет только своё,
   в <style> блока head своего шаблона. Токены — здесь, один раз. */
/* ---------- Шрифт Inter (свой сервер, переменная толщина 100–900; лицензия — fonts/Inter-OFL.txt) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f8fafc;
  --border: #e6e8eb; --border-strong: #d5d8dd; --line: #f1f2f4;
  --text: #1a1d21; --text-muted: #6b7280; --text-soft: #9aa0a6;
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-soft: #eff4ff;
  --accent: #0f9d58; --accent-dark: #0b8043; --danger: #d93025; --warn: #b26a00;
  --radius: 12px; --radius-md: 10px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; }
a:hover { color: var(--primary); }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.ok { color: var(--accent-dark); }
.bad { color: var(--danger); }
.warn { color: var(--warn); }
.run { color: var(--primary-dark); }
.spacer { flex: 1 1 auto; }

/* ---------- Подсказка ⓘ: значок и всплывающий текст на чистом CSS ----------
   Текст — в data-tip. У элементов у правого края — ещё data-tip-right.
   Не ставить opacity < 1 на элемент с подсказкой и его родителей. */
[data-tip] { position: relative; }
[data-tip]:hover { z-index: 400; }
[data-tip]:not([data-tip=""]):hover::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 300;
  width: max-content; max-width: 320px; padding: 9px 12px; border-radius: 10px;
  background: #fff; color: #1a1d21; border: 1px solid #d5d8dd;
  font: 400 13px/1.5 var(--font); font-style: normal; text-transform: none; letter-spacing: 0;
  white-space: normal; text-align: left; box-shadow: 0 8px 28px rgba(16,24,40,.14); pointer-events: none;
}
[data-tip-right]:not([data-tip=""]):hover::after { left: auto; right: 0; }
.ii { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid #c9ced6; color: #6b7280; font: italic 700 10.5px/1 ui-serif, Georgia, serif; cursor: help; margin-left: 7px;
  text-transform: none; letter-spacing: 0; vertical-align: -2px; }
.ii.caps { margin-left: 6px; }
.ii.flush { margin-left: 0; }
.ii.lg { width: 18px; height: 18px; font-size: 11px; margin-left: 8px; }
/* Подсказка у недоступной кнопки: прозрачность — у кнопки, подсказка — у обёртки */
.tipwrap { display: inline-flex; }

/* ---------- Логотип (шапка — в site.css) и вкладки ---------- */
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
/* Логотип TubeTopic (static/logo/tubetopic-logo.svg, пропорции 5 : 1): задаётся только высота — 26 px, на телефоне
   22 px (site.css); не перекрашивается и не растягивается. */
.brand-logo { display: block; height: 26px; width: auto; }
.nav-tabs { display: flex; gap: 4px; background: #eef0f3; padding: 4px; border-radius: 9px; max-width: 100%; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { padding: 7px 14px; border-radius: 6px; text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 600;
  white-space: nowrap; background: transparent; border: none; cursor: pointer; font-family: inherit; line-height: inherit; }
.nav-tab:hover { color: var(--text-muted); }
.nav-tab.active, .nav-tab.active:hover { color: var(--primary); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.06); }

/* ---------- Страница ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 22px 24px 60px; }
.page--narrow { max-width: 1100px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1 1 auto; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; display: inline-flex; align-items: center; }
.page-meta { font-size: 13px; color: var(--text-muted); }
.page-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.page-link:hover { color: var(--primary-dark); }
.back-link { display: flex; width: fit-content; font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; margin-bottom: 8px; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) {
  .page { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Кнопки и поля ---------- */
button { font: inherit; font-size: 13px; font-weight: 600; line-height: 1.45; cursor: pointer; border-radius: var(--radius-sm); padding: 7px 13px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
button.danger { color: var(--danger); border-color: #f1c7c4; }
button.danger:hover:not(:disabled) { background: #fdf0ef; border-color: #f1c7c4; color: var(--danger); }
/* Переключатель-фильтр во включённом состоянии (как «Убранные») */
button.on, button.on:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
button.sm { padding: 6px 12px; }
button.xs { padding: 5px 11px; }
button.solid-danger, button.solid-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
/* Кнопка-ссылка: «Подробнее ▾», «▾ Подробности запуска», «Сбросить» */
button.link { border: none; background: transparent; color: var(--primary); font-size: 12.5px; font-weight: 600; padding: 2px 0; border-radius: 0; }
button.link:hover:not(:disabled) { color: var(--primary-dark); }
button.link.pad { padding: 2px 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input[type=text], input[type=number], input[type=password], select, textarea {
  font: inherit; color: var(--text); padding: 7px 10px; background: #fbfbfc; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
select { background: var(--surface); }
input[type=number] { font-variant-numeric: tabular-nums; }
.msg { font-size: 12.5px; font-weight: 500; }
.msg.ok { color: var(--accent-dark); }
.msg.err { color: var(--danger); }
.msg.warn { color: var(--warn); }
.msg.info { color: var(--text-soft); font-weight: 400; }
.msg.run { color: var(--primary-dark); font-weight: 400; }
.msg:empty { display: none; }

/* ---------- Белые блоки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 18px; margin-bottom: 16px; }
.card h2, .block-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: inline-flex; align-items: center; }
.block-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.badge-gray { font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: #f1f3f6; border-radius: 6px; padding: 2px 8px; }
.callout { margin: 12px 0 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; background: #fff7e6; color: #8a5200; border: 1px solid #fde4b5; }
.callout.bad { background: #fdf0ef; color: #a52a20; border-color: #f5c7c2; }
.callout.run { background: var(--primary-soft); color: var(--primary-dark); border-color: #c7d7fe; }
.callout a { color: inherit; font-weight: 600; }

/* ---------- Плитки с цифрами ---------- */
.tiles { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 12px; }
.tile { display: inline-flex; flex-direction: column; gap: 1px; min-width: 120px; padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: default; }
.tile .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.tile .v { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.25; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--text-muted); }
.tile.hi { border-color: #c7d7fe; background: var(--primary-soft); }
.tile.hi .v { color: var(--primary-dark); }
.tile.dim { opacity: .6; }
.tiles .arrow { align-self: center; color: #c9ced6; font-size: 18px; }

/* ---------- Ряд действий, раскрывающиеся подробности ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.actions .note { font-size: 12.5px; color: var(--text-soft); }
.actions .note.run { color: var(--primary-dark); }
.actions .note.bad { color: var(--danger); }
.details { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid #eceef1; border-radius: var(--radius-md);
  font-size: 13px; color: #4b5563; }
.details > div { padding: 2px 0; }
.details a { color: var(--primary); text-decoration: none; font-weight: 600; }
.details a:hover { color: var(--primary-dark); }
table.bands { border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
table.bands th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft);
  text-align: right; padding: 0 16px 4px 0; }
table.bands th:first-child { text-align: left; }
table.bands th:last-child { padding-right: 0; }
table.bands td { padding: 3px 16px 3px 0; text-align: right; font-variant-numeric: tabular-nums; }
table.bands td:first-child { text-align: left; }
table.bands td:last-child { padding-right: 0; }
.hyps { margin: 10px 0 0; padding: 12px 14px 12px 32px; background: var(--primary-soft); border: 1px solid #dbe6fe; border-radius: var(--radius-md);
  font-size: 13.5px; color: #1e3a8a; }
.hyps li { margin: 2px 0; }

/* ---------- Вкладки этапов (Рекомендации, Тренды) ---------- */
.stage-tabs { display: flex; flex-wrap: nowrap; gap: 6px; padding-left: 12px; overflow-x: auto; scrollbar-width: none; }
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab { flex: none; display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 16px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; background: #eef0f3; color: var(--text-muted); font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.stage-tab:hover { color: var(--text-muted); }
.stage-tab.active, .stage-tab.active:hover { background: #fff; color: var(--primary); }
.stage-tab .n { color: var(--text-soft); font-weight: 700; }
.stage-tab .c { color: var(--text-soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.stage-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 18px; margin-bottom: 16px; }

/* ---------- Переключатель-сегменты (период, режим) ---------- */
.seg { display: inline-flex; background: #eef0f3; padding: 3px; border-radius: 9px; gap: 2px; }
.seg > button, .seg > a { border: none; border-radius: 7px; padding: 5px 12px; font-size: 13px; font-weight: 600; background: transparent;
  color: var(--text-muted); text-decoration: none; line-height: 1.45; }
.seg > button:hover:not(:disabled), .seg > a:hover { color: var(--text-muted); border-color: transparent; }
.seg > .active, .seg > .active:hover:not(:disabled) { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* ---------- Чипы тем ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); margin-right: 4px; }
.chip { padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 99px; text-decoration: none; color: var(--text-muted);
  background: var(--surface); font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active, .chip.active:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Фильтры (вариант 12a): кнопка «Фильтры» и панель под ней — app.js, TV.filterMenu ---------- */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fm { position: relative; flex: none; }
.fm-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid #d5d8dd; border-radius: 8px;
  background: #fff; font-size: 13.5px; font-weight: 600; line-height: 20px; color: #1a1d21; }
.fm-btn:hover:not(:disabled) { border-color: #b8bec7; color: #1a1d21; }
.fm.open .fm-btn, .fm.open .fm-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.fm-btn svg { width: 15px; height: 15px; flex: none; }
.fm-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #2563eb; color: #fff; font-size: 12px; font-weight: 700;
  line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.fm-panel { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: 376px; max-width: calc(100vw - 28px);
  max-height: 560px; flex-direction: column; background: #fff; border: 1px solid #e6e8eb; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,24,40,.14); }
.fm.open .fm-panel { display: flex; }
.fm-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.fm-sec { padding: 16px 20px 12px; }
.fm-sec--out { padding-bottom: 16px; }
.fm-sep { height: 1px; background: #eef0f3; }
.fm-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 14px; line-height: 20px; }
.fm-head--lv { gap: 6px; }
.fm-sec--out .fm-head { margin-bottom: 10px; }
.fm-name { flex: 1 1 auto; font-weight: 600; color: #1a1d21; }
.fm-level { font-size: 13px; color: #7c8492; }
.fm-val { font-weight: 600; color: #7c8492; font-variant-numeric: tabular-nums; }
.fm-val.on { color: #2563eb; }
/* Ступенчатый ползунок: дорожка 4 px, отметки, ручка 18 px; при перетаскивании — синяя рамка и ореол */
.fm-slider { position: relative; height: 28px; cursor: pointer; touch-action: none; }
.fm-track { position: absolute; left: 9px; right: 9px; top: 12px; height: 4px; border-radius: 2px; overflow: hidden; background: #e6e8eb; }
.fm-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #2563eb; transition: width .12s ease; }
.fm-zone { position: absolute; top: 0; bottom: 0; }
.fm-zone.low { background: #f6d3d0; }
.fm-zone.mid { background: #f5e2bf; }
.fm-zone.high { background: #c9e8d6; }
.fm-zone.low.on { background: #d93025; }
.fm-zone.mid.on { background: #e09a1a; }
.fm-zone.high.on { background: #0f9d58; }
.fm-ticks { position: absolute; left: 9px; right: 9px; top: 20px; height: 4px; }
.fm-tick { position: absolute; top: 0; width: 1px; height: 4px; background: #c4c9d0; }
.fm-rail { position: absolute; left: 9px; right: 9px; top: 5px; height: 18px; }
.fm-thumb { position: absolute; top: 0; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 1px solid #c4c9d0;
  box-shadow: 0 1px 3px rgba(16,24,40,.2); cursor: grab; outline: none; transition: left .12s ease; }
.fm-thumb:focus-visible, .fm-thumb:focus { border-color: #2563eb; }
.fm-slider.drag .fm-thumb { border-color: #2563eb; box-shadow: 0 0 0 5px rgba(37,99,235,.16), 0 1px 3px rgba(16,24,40,.24); cursor: grabbing; }
.fm-marks { position: relative; height: 18px; margin-top: 2px; }
.fm-mark { position: absolute; top: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 12px; line-height: 18px; font-weight: 500;
  color: #7c8492; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fm-mark:hover:not(:disabled) { color: #1a1d21; }
/* выбранное — класс sel: класс on у кнопок занят переключателем-фильтром (button.on) */
.fm-mark.sel { font-weight: 600; color: #1a1d21; }
/* Outlier Score: поле «от … ×» и быстрые значения серым текстом */
.fm-out { display: flex; align-items: center; gap: 12px; }
.fm-num { position: relative; flex: none; width: 112px; }
.fm-num-pre { position: absolute; left: 12px; top: 0; font-size: 13px; line-height: 36px; color: #7c8492; pointer-events: none; }
.fm-num-x { position: absolute; right: 12px; top: 0; font-size: 14px; line-height: 36px; font-weight: 500; color: #9aa0a6; pointer-events: none; }
.fm-num input[type=text] { display: block; width: 100%; height: 36px; padding: 0 28px 0 36px; border: 1px solid #d5d8dd; border-radius: 8px; background: #fff;
  font-size: 14px; font-weight: 600; color: #1a1d21; text-align: right; font-variant-numeric: tabular-nums; }
.fm-num input[type=text]:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); background: #fff; }
.fm-presets { display: flex; align-items: center; gap: 2px; }
.fm-preset { height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 500; line-height: 28px;
  color: #9aa0a6; font-variant-numeric: tabular-nums; }
.fm-preset:hover:not(:disabled) { color: #1a1d21; background: #f4f5f7; }
.fm-preset.sel, .fm-preset.sel:hover:not(:disabled) { font-weight: 600; color: #2563eb; }
.fm-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border-top: 1px solid #eef0f3; }
.fm-gap { flex: 1 1 auto; }
.fm-reset { height: 36px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 14px; font-weight: 600; color: #4b5563; }
.fm-reset:hover:not(:disabled) { color: #1a1d21; }
.fm-reset:disabled { color: #c4c9d0; opacity: 1; }
.fm-apply { height: 36px; padding: 0 18px; border: 0; border-radius: 8px; background: #2563eb; font-size: 14px; font-weight: 600; color: #fff; }
.fm-apply:hover:not(:disabled) { background: #1d4ed8; color: #fff; }
/* Телефон: панель — шторка снизу (макет 16h): «Фильтры» и «Сбросить» сверху, вместо ползунков — ряды отметок-кнопок
   (68 px высотой), Outlier Score — поле 112×44 и быстрые значения кнопками, «Применить» во всю ширину внизу.
   Затемнение рисует сам корень панели (::before): нажатие по нему закрывает без изменений (app.js). */
.fm-mhead, .fm-steps { display: none; }
@media (max-width: 600px) {
  .fm.open { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .fm.open::before { content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(16,24,40,.42); }
  .fm-panel { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 61; width: auto; max-width: none; max-height: calc(100% - 48px);
    border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(16,24,40,.16); cursor: auto; animation: sheet-up .22s cubic-bezier(.2,0,0,1); }
  .fm-panel::before { content: ""; flex: none; display: block; width: 36px; height: 4px; margin: 8px auto 4px; border-radius: 2px; background: #d5d8dd; }
  .fm-mhead { display: flex; align-items: center; flex: none; min-height: 56px; padding: 4px 112px 8px 20px; }
  .fm-mhead h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; color: #1a1d21; }
  .fm-reset { position: absolute; top: 20px; right: 8px; height: 44px; padding: 0 12px; font-size: 15px; color: #2563eb; }
  .fm-reset:hover:not(:disabled) { color: #1d4ed8; }
  .fm-sep { display: none; }
  .fm-sec { padding: 16px 20px 4px; box-shadow: inset 0 1px 0 #eef0f3; }
  .fm-sec--out { padding: 16px 20px 20px; }
  .fm-head, .fm-sec--out .fm-head { margin-bottom: 0; font-size: 15px; line-height: 22px; }
  .fm-head--lv { gap: 4px; }
  .fm-val, .fm-level { font-size: 14px; font-weight: 600; }
  .fm-level { color: #2563eb; }
  .fm-slider, .fm-marks { display: none; }
  .fm-steps { display: block; position: relative; margin: 4px -4px 0; }
  .fm-seg { position: absolute; top: 22px; height: 4px; }
  .fm-stops { position: relative; display: grid; }
  button.fm-step { position: relative; height: 68px; padding: 0; border: 0; border-radius: 0; background: none; -webkit-tap-highlight-color: transparent; }
  .fm-step-dot { position: absolute; left: 50%; top: 20px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; }
  .fm-step-ring { position: absolute; left: 50%; top: 12px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff;
    border: 2px solid #2563eb; box-shadow: 0 1px 4px rgba(16,24,40,.2); opacity: 0; transition: opacity .12s; }
  .fm-step.sel .fm-step-ring { opacity: 1; }
  .fm-step-label { position: absolute; left: 0; right: 0; top: 44px; font-size: 13px; line-height: 18px; font-weight: 500; color: #6b7280;
    text-align: center; white-space: nowrap; }
  .fm-step.sel .fm-step-label { font-weight: 600; color: #1a1d21; }
  .fm-out { gap: 8px; margin-top: 12px; }
  .fm-num-pre { font-size: 15px; line-height: 44px; }
  .fm-num-x { font-size: 15px; line-height: 44px; }
  .fm-num input[type=text] { height: 44px; padding: 0 30px 0 36px; border-radius: 10px; font-size: 16px; text-align: left; }
  .fm-presets { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .fm-preset { flex: 1 1 0; min-width: 0; height: 44px; padding: 0; border-radius: 10px; background: #f1f2f4; font-size: 14px; font-weight: 600;
    line-height: 44px; color: #4b5563; }
  .fm-preset:hover:not(:disabled) { background: #f1f2f4; color: #4b5563; }
  .fm-preset.sel, .fm-preset.sel:hover:not(:disabled) { background: #eff4ff; color: #2563eb; }
  .fm-foot { padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }
  .fm-gap { display: none; }
  .fm-apply { flex: 1 1 auto; height: 48px; border-radius: 10px; font-size: 15px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.shown-count { font-size: 13px; color: var(--text-soft); cursor: help; }
.shown-count b { color: var(--text); }

/* ---------- Таблица видео (общий компонент TV.videoTable) ----------
   Одна на всех страницах (макет «Video Table - Final»). Широкий вид — таблица: обложка, название с каналом,
   просмотры (число и единица — отдельными столбцами), Outlier Score, Like Rate со шкалой, «Опубликовано».
   Цифры стоят по первой строке названия (vertical-align: baseline). Шапка таблицы залипает под шапкой
   сайта; для этого у обёртки overflow: clip (с overflow-x: auto залипание не работает). На телефоне (экран до
   600 px) — карточки (.vc, ниже). Строки дорисовываются пачками по мере прокрутки. */
.vt-wrap { background: #fff; border: 1px solid #e6e8eb; border-radius: 12px; overflow: clip; }
@media (max-width: 1100px) { .vt-wrap { overflow-x: auto; } }        /* узкое окно: прокрутка вместо обрезки */
table.vt { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; color: #1a1d21; }
table.vt th { position: sticky; top: 63px; z-index: 2; background: #fafbfc; box-shadow: inset 0 -1px 0 #e6e8eb;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280;
  white-space: nowrap; user-select: none; vertical-align: bottom; text-align: right; padding: 12px 16px; transition: color .12s; }
table.vt th[data-sort] { cursor: pointer; }
table.vt th[data-sort]:not(.sorted):hover { color: #1a1d21; }
table.vt th.sorted { color: #2563eb; box-shadow: inset 0 -2px 0 #2563eb; }
table.vt th.vt-video { text-align: left; padding: 12px 16px 12px 20px; }
table.vt th.vt-views { padding: 12px 16px 12px 24px; width: 154px; }
table.vt th.vt-out { width: 168px; }          /* ширины — с отступами (box-sizing: border-box) */
table.vt th.vt-lv { width: 144px; }
table.vt th.vt-days { padding: 12px 24px 12px 16px; width: 180px; }
table.vt th.vt-rank { text-align: left; padding: 12px 0 12px 20px; width: 40px; }
table.vt tbody tr { border-bottom: 1px solid #eef0f3; }
table.vt tbody tr:last-child { border-bottom: none; }
table.vt tbody tr:hover td { background: #f8fafe; }
table.vt td { background: #fff; vertical-align: baseline; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding: 9px 16px 16px; line-height: 24px; }
table.vt td.vt-rank { vertical-align: top; text-align: left; padding: 16px 0 16px 20px; color: #9aa0a6; font-size: 13px; font-weight: 600; }
table.vt td.vt-thumbc { vertical-align: top; padding: 16px 0 16px 20px; width: 1%; }
table.vt td.vt-video { text-align: left; white-space: normal; padding: 9px 24px 16px 20px; line-height: 1.45; }
/* Просмотры: число по правому краю, «млн/тыс.» — в своём столбце по левому (смена единицы видна по столбцу). */
table.vt td.vt-views { padding: 9px 0 16px 24px; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
table.vt td.vt-unit { padding: 9px 16px 16px 5px; width: 1%; text-align: left; font-size: 11.5px; font-weight: 500; color: #9aa0a6; }
table.vt td.vt-out { font-size: 14px; font-weight: 600; color: #30353b; letter-spacing: -.01em; }
table.vt td.vt-lv { font-size: 14px; font-weight: 600; color: #30353b; }
table.vt td.vt-days { padding: 9px 24px 16px 16px; font-size: 13px; font-weight: 400; color: #7c8492; }
/* Отсортированный столбец — крупнее и темнее (класс у таблицы: sort-views, sort-out, sort-lv, sort-days). */
table.vt.sort-views td.vt-views { font-size: 22px; font-weight: 700; }
table.vt.sort-views td.vt-unit { font-size: 12px; }
table.vt.sort-out td.vt-out, table.vt.sort-lv td.vt-lv { font-size: 20px; font-weight: 700; color: #1a1d21; }
table.vt.sort-days td.vt-days { font-size: 16px; font-weight: 600; color: #1a1d21; }
.vt-x { color: #9aa0a6; font-weight: 500; margin-left: 1px; }               /* «×» у Outlier Score */
/* Like Rate: шкала 0–5% под числом, отметки на 2% и 3%; полоса — цвет уровня. */
.lr-scale { position: relative; width: 72px; height: 3px; margin: 8px 0 0 auto; border-radius: 2px; background: #eceef1; }
.lr-fill { position: absolute; left: 0; top: 0; height: 3px; border-radius: 2px; }
.lr-fill.lr-low { background: #d93025; }
.lr-fill.lr-mid { background: #e09a1a; }
.lr-fill.lr-high { background: #0f9d58; }
.lr-tick { position: absolute; top: -2px; width: 1px; height: 7px; background: #c4c9d0; }
table.vt td.vt-score { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
table.vt th[data-x] { white-space: normal; text-transform: none; letter-spacing: 0; font-size: 10.5px; line-height: 1.25; max-width: 92px; }
table.vt td.vt-x { font-size: 14px; color: var(--text-muted); }
table.vt td.vt-x.bold { font-weight: 700; color: var(--text); }
.vt-thumb { flex: none; position: relative; display: block; width: 240px; height: 135px; border-radius: 8px; overflow: hidden; background: #e9ebee; }
.vt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
/* Ячейка названия: название, канал, внизу (на уровне низа обложки) — «Похожие видео». */
.vt-main { display: flex; flex-direction: column; align-items: flex-start; min-height: 139px; }
.vt-grow { flex: 1 1 auto; min-height: 12px; }
.vt-title { min-width: 280px; max-width: 540px; color: #1a1d21; text-decoration: none; font-size: 16px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.vt-title:hover { color: #2563eb; }
/* Переведённое название: оригинал — во всплывающей подсказке через 0,35 с (наведение или фокус). */
.vt-tw { position: relative; display: block; max-width: 540px; }
.vt-orig-tip { position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; width: max-content; max-width: 440px; padding: 9px 12px 10px;
  border-radius: 10px; background: #fff; border: 1px solid #d5d8dd; box-shadow: 0 8px 28px rgba(16,24,40,.14); pointer-events: none;
  opacity: 0; transform: translateY(-3px); transition: opacity .12s ease, transform .12s ease; transition-delay: 0s; }
.vt-tw:hover .vt-orig-tip, .vt-tw:focus-within .vt-orig-tip { opacity: 1; transform: none; transition-delay: .35s; }
.vt-orig-cap { display: block; font-size: 12px; line-height: 16px; font-weight: 600; color: #7c8492; }
.vt-orig-text { display: block; margin-top: 3px; font-size: 13.5px; line-height: 20px; font-weight: 500; color: #1a1d21; text-wrap: pretty; }
.vt-ch { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; line-height: 20px; color: #7c8492;
  min-width: 0; max-width: 100%; }
.vt-av { width: 20px; height: 20px; border-radius: 50%; flex: none; color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; overflow: hidden; background: #e9ebee; }
.vt-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-chname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
a.vt-chname { color: inherit; text-decoration: none; }
a.vt-chname:hover { color: #2563eb; text-decoration: underline; }
.vt-ban { border: none; background: transparent; color: var(--text-soft); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 0; opacity: 0; }
tr:hover .vt-ban { opacity: 1; }
.vt-ban:hover:not(:disabled) { color: var(--danger); border-color: transparent; }
@media (hover: none) { .vt-ban { opacity: 1; } }
.vt-pill { font-size: 11.5px; font-weight: 600; line-height: 1.45; border-radius: 6px; padding: 1px 7px; cursor: default; white-space: nowrap; }
.vt-pill.why { color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #c7d7fe; }
.vt-pill.new { color: #fff; background: var(--accent); }
.vt-pill.cardp { color: var(--text-muted); border: 1px solid #e3e5e9; opacity: .55; }
tr:hover .vt-pill.cardp { opacity: 1; }
.vt-pill.cardp.st-fail { color: var(--danger); }
.vt-pill.cardp.st-batch { color: var(--primary); }
.vt-pill.cardp.st-page { color: var(--warn); }
button.vt-pill.hop { color: var(--primary); background: #fff; border: 1px solid #c7d7fe; padding: 1px 7px; cursor: pointer; font-size: 11.5px; line-height: 1.45; }
button.vt-pill.hop:hover:not(:disabled) { background: var(--primary-soft); border-color: #c7d7fe; color: var(--primary-dark); }
.vt-pill.link { text-decoration: none; color: var(--primary); border: 1px solid #c7d7fe; cursor: pointer; }
.vt-badge { align-self: flex-start; margin-top: 8px; font-size: 11.5px; font-weight: 700; color: #3730a3; background: #e0e7ff; border-radius: 6px; padding: 1px 8px; }
.vt-badge.top { color: #15803d; background: #dcfce7; }
.vt-badge.bottom { color: #b91c1c; background: #fee2e2; }
.vt-badge.older { color: #64748b; background: #f1f5f9; }
.vt-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vt-badges .vt-badge { margin-top: 0; }
.vt-empty { padding: 48px 24px; text-align: center; color: var(--text-soft); font-size: 14px; }
.vt-more { height: 1px; }
/* ---------- Телефон (до 600 px): карточки вместо таблицы (макет «VideoTable layout=\"cards\"») ----------
   Обложка 16:9 во всю ширину без скругления; под ней кружок канала 36 px слева от текста (12 px), название
   16/22 600 в две строки (обрезано до 60 знаков по слову) и «⋯» (зона нажатия 44 px), «канал · дата» 13,5 px серым,
   три показателя с подписями 12 px (просмотры 20/700, Outlier Score и Like Rate 15/600 со шкалой; отсортированный —
   синяя подпись и 18/700). Между карточками — 8 px цвета страницы. */
.vc-list { display: flex; flex-direction: column; gap: 8px; }
.vc { background: #fff; }
.vc-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e9ebee; }
.vc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-cover .vt-dur { right: 8px; bottom: 8px; padding: 0 5px; border-radius: 4px; font-size: 12px; line-height: 18px; }
.vc-body { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 18px; }
.vc-av { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #e9ebee; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.vc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-main { flex: 1 1 auto; min-width: 0; }
.vc-top { display: flex; align-items: flex-start; gap: 4px; }
.vc-rank { flex: none; margin-right: 4px; font-size: 13px; line-height: 22px; font-weight: 600; color: #9aa0a6; font-variant-numeric: tabular-nums; }
.vc-title { flex: 1 1 auto; min-width: 0; color: #1a1d21; text-decoration: none; font-size: 16px; line-height: 22px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.vc-title:hover { color: #1a1d21; }
button.vc-more { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -11px -14px -11px 0;
  padding: 0; border: 0; border-radius: 22px; background: none; color: #6b7280; -webkit-tap-highlight-color: transparent; }
button.vc-more:hover:not(:disabled) { color: #6b7280; }
button.vc-more:active { background: #eef0f3; }
.vc-more svg { width: 20px; height: 20px; display: block; }
.vc-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-size: 13.5px; line-height: 20px; color: #7c8492; }
.vc-ch { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-meta > span:not(.vc-ch) { flex: none; white-space: nowrap; }
.vc-date.on { font-weight: 600; color: #1a1d21; }
.vc-main .vt-badges { margin-top: 8px; }
.vc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; row-gap: 2px; align-items: baseline; margin-top: 14px;
  font-variant-numeric: tabular-nums; }
.vc-nums.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vc-cap { font-size: 12px; line-height: 16px; font-weight: 500; color: #7c8492; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-cap.on { color: #2563eb; }
.vc-v { font-size: 15px; line-height: 26px; font-weight: 600; color: #30353b; white-space: nowrap; }
.vc-v.on { font-size: 18px; font-weight: 700; color: #1a1d21; }
.vc-v.vc-views { font-size: 20px; font-weight: 700; letter-spacing: -.015em; color: #1a1d21; }
.vc-unit { margin-left: 4px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: #9aa0a6; }
.vc-v.vc-score { color: var(--primary-dark); }
.vc-v .lr-scale { display: block; margin: 5px 0 0; }
.vc-reason { margin-top: 10px; font-size: 13px; line-height: 1.45; color: #4b5563; white-space: pre-line; }
.vc-none { border-radius: 0; border-left: 0; border-right: 0; }

/* ---------- Поповер карточки и подсказка «почему» ---------- */
.card-pop { position: fixed; z-index: 500; width: 400px; max-width: calc(100vw - 24px); max-height: calc(100vh - 16px); overflow-y: auto;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 3px 16px 14px;
  font-size: 13.5px; line-height: 1.5; display: none; }
.card-pop.open { display: block; }
.cp-k { font-size: 10.5px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; margin: 9px 0 2px; }
.cp-title { font-weight: 600; color: var(--text); }
.cp-en { color: var(--text-muted); font-size: 13px; }
.cp-dish { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.cp-long { color: var(--text-muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow-y: auto; }
.cp-type { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.cp-ings { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-ing { padding: 2px 8px; border-radius: 99px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 500; }
.cp-sum { color: var(--text); }
.cp-empty { padding: 11px 0 0; color: var(--text-soft); }
.why-pop { position: fixed; z-index: 520; width: max-content; max-width: 340px; padding: 8px 11px; border-radius: 8px; background: #fff; color: var(--text);
  border: 1px solid var(--border-strong); font-size: 13px; line-height: 1.5; box-shadow: 0 8px 24px rgba(16,24,40,.18); pointer-events: none;
  white-space: pre-line; display: none; }
.why-pop.open { display: block; }

/* ---------- Обычная таблица (Каналы) ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; }
table.data th { background: #fafbfc; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft);
  text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
table.data th[data-sort] { cursor: pointer; }
table.data th.sorted { color: var(--primary); }
table.data tbody tr { border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: #f8fafe; }
table.data td { padding: 11px 14px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Модалка токена и тост ---------- */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); z-index: 1000; align-items: center; justify-content: center; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px 26px; width: min(420px, 92vw); box-shadow: var(--shadow-lg); animation: pop .14s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.modal p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-muted); }
.modal input { width: 100%; margin-bottom: 16px; padding: 10px 12px; font-size: 14px; }
.modal-row { display: flex; gap: 8px; justify-content: flex-end; }
.modal-row button { padding: 9px 18px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000; background: #1f2937; color: #fff; padding: 11px 16px;
  border-radius: 10px; font-size: 13.5px; box-shadow: 0 12px 40px rgba(16,24,40,.28); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); }
.toast button, .toast button:hover:not(:disabled) { background: none; border: none; color: #93c5fd; font-weight: 700; padding: 0; font-size: 13.5px; }

/* ---------- Шторка снизу (телефон; app.js — TV.sheet): радиус 16, ручка, затемнение под ней закрывает ----------
   Меню «⋯» у видео, «Сортировка», «Ваши каналы» и слой «Похожие видео» (sh--layer: 16 px от верха, своя шапка,
   список на фоне страницы). Пока шторка открыта, страница под ней не прокручивается (sheet-open у <html>). */
/* только у <html>: body со своим overflow стал бы прокручиваемым блоком, и всё прилипающее отлипло бы */
html.sheet-open { overflow: hidden; }
.sh-bg { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer;
  background: rgba(16,24,40,0); transition: background .22s ease; -webkit-tap-highlight-color: transparent; }
.sh-bg.open { background: rgba(16,24,40,.42); }
.sh { position: relative; display: flex; flex-direction: column; max-height: calc(100% - 48px); cursor: auto; outline: none;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(16,24,40,.16); color: #1a1d21;
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2,0,0,1); }
.sh-bg.open .sh { transform: none; }
.sh-top { flex: none; }
.sh-handle { padding: 8px 0 4px; }
.sh-handle::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: #d5d8dd; }
.sh-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.sh--menu .sh-body { padding: 4px 8px calc(24px + env(safe-area-inset-bottom)); }
.sh-title { margin: 0; padding: 0 12px 8px; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; }
/* Меню видео: название (и оригинальное), затем действия по 48 px */
.sh-video { margin-bottom: 6px; padding: 8px 12px 14px; box-shadow: inset 0 -1px 0 #eef0f3; }
.sh-video-title { font-size: 15px; line-height: 21px; font-weight: 600; text-wrap: pretty; }
.sh-cap { margin-top: 12px; font-size: 12px; line-height: 16px; font-weight: 600; color: #7c8492; }
.sh-orig { margin-top: 3px; font-size: 14px; line-height: 20px; font-weight: 500; text-wrap: pretty; }
.sh-item, button.sh-item { display: flex; align-items: center; gap: 14px; width: 100%; height: 48px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; font-family: inherit; font-size: 15px; line-height: 20px; font-weight: 500; color: #1a1d21; text-align: left; text-decoration: none; }
.sh-item:hover, button.sh-item:hover:not(:disabled) { color: #1a1d21; }
.sh-item:active { background: #f4f5f7; }
.sh-item svg { width: 20px; height: 20px; flex: none; display: block; color: #6b7280; }
/* Списки с выбором (сортировка, каналы): строка 56 px, выбранная — синяя и с галочкой */
.sh-list { display: flex; flex-direction: column; }
.sh-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: none; font-family: inherit; text-align: left; color: #1a1d21; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.sh-opt:hover, button.sh-opt:hover:not(:disabled) { color: #1a1d21; }
.sh-opt:active { background: #f4f5f7; }
.sh-opt-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sh-opt-label { font-size: 15px; line-height: 22px; font-weight: 500; }
.sh-opt.sel .sh-opt-label { font-weight: 600; color: #2563eb; }
.sh-opt-sub { font-size: 13px; line-height: 18px; font-weight: 400; color: #7c8492; }
.sh-check { width: 20px; height: 20px; flex: none; color: #2563eb; opacity: 0; }
.sh-opt.sel .sh-check { opacity: 1; }
/* «Ваши каналы» (страница идей): кружок 32 px, название и число видео в строку; у открытого — жирнее и галочка */
.sh-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: #e9ebee center / cover no-repeat; color: #fff; font-size: 13px; font-weight: 700; }
.sh-chan-text { flex-direction: row; align-items: baseline; gap: 8px; }
.sh-chan .sh-opt-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-chan.sel .sh-opt-label { color: #1a1d21; }
.sh-chan-n { flex: none; font-size: 13px; line-height: 18px; color: #7c8492; font-variant-numeric: tabular-nums; }
/* Слой «Похожие видео»: шторка почти во весь экран, шапка белая, список — на фоне страницы */
.sh--layer .sh { flex: 1 1 auto; max-height: none; min-height: 0; margin-top: 16px; overflow: hidden; background: #f4f5f7; }
.sh--layer .sh-top { background: #fff; box-shadow: inset 0 -1px 0 #e6e8eb; }
.sh--layer .sh-handle { padding-bottom: 0; }
.sh-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 16px; }
.sh-head h2 { flex: 1 1 auto; margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -.01em; }
button.sh-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 22px; background: none; color: #6b7280; }
button.sh-x:hover:not(:disabled) { color: #1a1d21; }
button.sh-x:active { background: #eef0f3; }
.sh-x svg { width: 20px; height: 20px; display: block; }
.sh--layer .sh-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sh--layer .vt-empty { padding: 40px 16px; }
.sh .gate-card.sh-gate { margin: 24px 16px; }

/* ---------- Блоки настроек ----------
   Шапка (заголовок + ⓘ, бейдж, ссылка справа), краткая строка состояния с
   «Подробнее», строки параметров «подпись слева — содержимое», своя кнопка
   сохранения и ряд действий (опасное — справа). */
.set-tabs { margin: 0 0 16px; }
/* Черта между вкладками сегмента и общими (#segments, #general). */
.set-tabs .nav-sep { flex: none; width: 1px; margin: 6px 4px; background: #d5d9e0; }
.sblocks { display: flex; flex-direction: column; gap: 14px; }
.set-heading { margin: 2px 0 -2px 2px; font-size: 19px; font-weight: 700; letter-spacing: -.015em; display: inline-flex; align-items: center; align-self: flex-start; }
.sblock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 18px; font-size: 14px; }
.sb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.sb-title { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; display: inline-flex; align-items: center; }
.sb-title.mb { display: flex; margin-bottom: 10px; }
.sb-check.lg { font-size: 14px; }
.sb-badge { font-size: 12px; font-weight: 600; color: var(--text-muted); background: #f1f3f6; border-radius: 6px; padding: 2px 8px; }
.sb-badge[data-tip] { cursor: help; }
.sb-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 13px; }
.sb-link:hover { color: var(--primary-dark); }
.sb-side { font-size: 13px; color: var(--text-muted); }
.sb-side.bad { color: var(--danger); }
.sb-sub { font-size: 13px; color: var(--text-muted); }
.sb-note { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.sb-note a { color: var(--primary); font-weight: 600; text-decoration: none; }
/* Краткая строка: 2–4 главные цифры и «Подробнее» */
.sb-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 0 2px; }
.sb-bi { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--text-muted); cursor: default; }
.sb-bi b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sb-bi b.good, .sb-tile .v.good { color: var(--accent-dark); }
.sb-bi b.warn, .sb-tile .v.warn { color: var(--warn); }
.sb-bi b.bad, .sb-tile .v.bad { color: var(--danger); }
.sb-panel { margin: 6px 0 4px; padding: 12px 14px; background: var(--surface-2); border: 1px solid #eceef1; border-radius: var(--radius-md); }
.sb-panel.lines { padding: 10px 14px; font-size: 13px; color: var(--text-muted); }
.sb-panel.lines > div { padding: 2px 0; }
.sb-panel.lines .bad { color: var(--danger); }
.sb-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-tile { display: inline-flex; flex-direction: column; gap: 1px; min-width: 110px; padding: 7px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: default; }
.sb-tile .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.sb-tile .v { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.25; font-variant-numeric: tabular-nums; }
.sb-tiles.vec .sb-tile .v { font-size: 15px; }
.sb-ptext { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.sb-ptext + .sb-ptext { margin-top: 4px; }
.sb-ptext.bad { color: var(--danger); }
.sb-ptext b { color: var(--text); }
.sb-ptext a { color: var(--primary); font-weight: 600; text-decoration: none; }
.sb-ptext:empty { display: none; }
.sb-pmsg { font-size: 13px; color: var(--accent-dark); font-weight: 500; margin-top: 10px; }
.sb-pmsg:empty { display: none; }
.sb-journal { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.sb-jt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin-bottom: 4px; }
.sb-jlog { max-height: 140px; overflow-y: auto; font-size: 12.5px; }
.sb-jlog div { display: flex; gap: 10px; padding: 2px 0; }
.sb-jlog time { color: var(--text-soft); font-variant-numeric: tabular-nums; flex: none; }
.sb-jlog span { color: var(--text-muted); }
.sb-jlog div:first-child span { color: var(--text); font-weight: 600; }
/* Строки параметров: подпись 136px слева, на узком — над содержимым */
.sb-form { margin-top: 8px; }
.sb-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.sb-row.center { align-items: center; }
.sb-k { flex: 0 0 136px; padding-top: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft);
  display: inline-flex; align-items: center; }
.sb-k.p4 { padding-top: 4px; }
.sb-k.p2 { padding-top: 2px; }
.sb-row.center .sb-k { padding-top: 0; }
.sb-v { flex: 1 1 280px; min-width: 0; }
.sb-v.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sb-v.text { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: #4b5563; }
/* Пояснение «откуда берётся» со ссылкой на настройку (вкладка «Похожие видео»). */
.sb-v.sim-src-text { padding-top: 4px; font-size: 13.5px; line-height: 1.55; color: #4b5563; max-width: 640px; }
.sim-src-text a { color: var(--primary); font-weight: 600; text-decoration: none; }
.sim-src-text a:hover { text-decoration: underline; }
.sb-caption { font-size: 12.5px; color: var(--text-soft); }
.sb-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sb-picker select { padding: 6px 28px 6px 9px; font-size: 13.5px; max-width: 100%; min-width: 0; background: #fff; }
.sb-picker label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.sb-price { font-size: 12.5px; color: var(--text-soft); }
.sb-price.below { display: block; margin-top: 6px; }
.sblock input[type=number] { padding: 5px 8px; width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.sblock select.sm { padding: 5px 28px 5px 9px; font-size: 13.5px; background: #fff; max-width: 100%; }
.sb-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.sb-check input, .sb-toggle input, .sb-run-toggle input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; flex: none; }
.sb-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text); margin-top: 12px; }
.sb-dim { opacity: .5; }
/* Чипы «что отправлять» */
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchips.sm { gap: 5px; }
.fbreak { flex-basis: 100%; height: 0; }
button.fchip, button.fchip:hover:not(:disabled) { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px;
  border: 1px solid #e3e5e9; background: #fff; color: #5f6670; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
button.fchip .box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #c9ced6; background: #fff; flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; line-height: 1; }
button.fchip.on, button.fchip.on:hover:not(:disabled) { background: var(--primary-soft); border-color: #c7d7fe; color: var(--primary-dark); }
button.fchip.on .box { background: var(--primary); border-color: var(--primary); }
button.fchip.off, button.fchip.off:hover:not(:disabled) { background: #fafbfc; border-color: #eceef1; color: #a3a9b0; cursor: default; }
button.fchip.off .box { border-color: #dde0e4; }
button.fchip.lock { cursor: default; }
.fchips.sm button.fchip { padding: 3px 9px 3px 5px; font-size: 12px; }
.fchips.sm button.fchip .box { width: 13px; height: 13px; font-size: 9px; }
.sb-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 24px; }
.sb-col-k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin-bottom: 5px; }
/* Промпт: свёрнут */
.sb-ptop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.sb-pbtn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; }
button.sb-pbtn .chev { color: var(--text-soft); font-size: 11px; }
.sb-pbadge { font-size: 11px; font-weight: 700; color: #b45309; background: #fef3c7; border-radius: 6px; padding: 2px 7px; cursor: default; }
.sb-pstd { font-size: 12.5px; color: var(--text-soft); }
.sb-ptip { font-size: 12.5px; color: var(--text-soft); margin: 8px 0 6px; }
textarea.sb-prompt { width: 100%; min-height: 220px; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px 12px; resize: vertical; display: block; }
.sb-preset { margin-top: 8px; }
/* Сохранение и действия */
.sb-save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.sb-save.plain { margin-top: 12px; padding-top: 0; border-top: none; }
.sb-save.inline { margin-top: 10px; padding-top: 0; border-top: none; }
.sb-msg { font-size: 12.5px; color: var(--text-soft); }
.sb-msg.warn { color: var(--warn); }
.sb-msg.ok { color: var(--accent-dark); }
.sb-msg.err { color: var(--danger); }
.sb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.sb-actions.mt14 { margin-top: 14px; }
.sb-actions .note { font-size: 12.5px; color: var(--text-soft); }
.sb-actions .note.run { color: var(--primary-dark); }
.sb-actions .note.bad { color: var(--danger); }
.sblock .msg { display: block; margin-top: 8px; }
.sblock .msg:empty { display: none; }
.sblock .callout { margin-top: 10px; }
.sb-links { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13.5px; margin-top: 14px; align-items: center; }
.sb-links a { color: var(--primary); text-decoration: none; font-weight: 600; }
/* Таблицы в блоках: пороги, диапазоны, условия */
.sb-scroll { overflow-x: auto; }
table.sb-table { border-collapse: collapse; font-size: 13.5px; }
table.sb-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); text-align: left; padding: 0 14px 4px 0; white-space: nowrap; }
table.sb-table td { padding: 3px 14px 3px 0; }
table.sb-table td.muted { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.sb-table.thr th { font-size: 11.5px; font-weight: 700; padding: 0 18px 6px 0; }
table.sb-table.thr th:last-child { padding-right: 0; }
table.sb-table.thr td { padding: 4px 18px 4px 0; }
table.sb-table.thr td:last-child { padding-right: 0; }
table.sb-table.thr input { padding: 6px 8px; }
.dotted { border-bottom: 1px dotted var(--text-soft); cursor: help; }
button.sb-x, button.sb-x:hover:not(:disabled) { border: none; background: transparent; color: var(--text-soft); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 0; }
button.sb-x:hover:not(:disabled) { color: var(--danger); }
/* Сетки параметров: свой канал, группировка трендов */
.sb-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 28px; margin-top: 12px; }
.sb-gl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin-bottom: 6px;
  display: inline-flex; align-items: center; }
.sb-pairs { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 13.5px; color: #4b5563; }
.sb-pairs > span { display: inline-flex; align-items: center; }
.sb-subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.sb-subb { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px 12px; }
.sb-subb.wide { grid-column: 1 / -1; }
.sb-subb .sb-gl { margin-bottom: 8px; }
label.sb-gl { gap: 8px; cursor: pointer; }
label.sb-gl input { width: 14px; height: 14px; accent-color: var(--primary); margin: 0; }
.sb-show { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; font-size: 13.5px; color: #4b5563; }
.sb-show label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 6px 0; }
.sb-show label > span { min-width: 0; line-height: 1.3; }
.sb-show select { max-width: 220px; }
.sb-show label small { display: block; font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.sb-fast { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, max-content)); gap: 6px 22px; align-items: center; font-size: 13.5px;
  color: #4b5563; margin-top: 8px; }
.sb-fast label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Этап 3: блоки прогонов */
.sb-run { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px 12px; margin-top: 10px; }
.sb-run h3 { margin: 0; font-size: 14px; font-weight: 700; }
.sb-run .sb-row { border-top: none; padding: 10px 0 0; }
.sb-run .sb-k { flex-basis: 120px; }
.sb-run-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.sb-run-toggle .note { font-weight: 500; color: var(--text-muted); font-size: 13px; }
@media (max-width: 760px) {
  .sb-k, .sb-run .sb-k { flex-basis: 100%; padding-top: 0; }
}

/* Вкладки «Сегменты» и «Общие настройки» (web/templates/admin/_tab_*.html). */
table.sb-table.segs { width: 100%; }
table.sb-table.segs td { padding: 7px 18px 7px 0; vertical-align: middle; }
table.sb-table.segs td.acts { white-space: nowrap; text-align: right; padding-right: 0; }
table.sb-table.segs td.acts button + button { margin-left: 6px; }
table.sb-table.segs .sb-badge { white-space: nowrap; }
.seg-copy { display: flex; flex-direction: column; gap: 8px; }
.seg-copy-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.seg-copy-head .muted { font-weight: 400; font-size: 12.5px; }
.seg-form .seg-copy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 260px; overflow-y: auto; }
.seg-form .seg-copy-list label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }
.svc-group { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.svc-group .sb-gl { margin-bottom: 0; }
.svc-group .sb-pairs { width: 100%; }
.sb-tile .s { font-size: 12px; color: var(--text-muted); }

/* ---------- «Похожие видео»: ссылка и отдельная страница ----------
   В таблице — внизу ячейки названия (на уровне низа обложки), видна при наведении на строку и при фокусе с
   клавиатуры; на сенсорных экранах и в узком виде (карточки) — всегда. Открывает страницу похожих в новой вкладке. */
a.vt-sim-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 600;
  line-height: 20px; color: #2563eb; text-decoration: none; }
a.vt-sim-link:hover { color: #1d4ed8; text-decoration: underline; }
.vt-sim-link svg { width: 15px; height: 15px; flex: none; display: block; }
table.vt .vt-sim-link { opacity: 0; transition: opacity .15s; }
table.vt tr:hover .vt-sim-link, table.vt .vt-sim-link:focus-visible { opacity: 1; }
@media (hover: none) { table.vt .vt-sim-link { opacity: 1; } }
/* Страница «Похожие видео»: исходное видео — первой строкой на голубой полосе с меткой, под ним — полоса цвета страницы. */
table.vt tr.vt-src td, table.vt tbody tr.vt-src:hover td { background: #eff4ff; }
.vt-src-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #dbe6fe; color: #1d4ed8;
  font-size: 12px; font-weight: 600; line-height: 22px; white-space: nowrap; }
table.vt tr.vt-band td, table.vt tbody tr.vt-band:hover td { height: 10px; padding: 0; background: #f4f5f7;
  box-shadow: inset 0 1px 0 #e6e8eb, inset 0 -1px 0 #e6e8eb; }

/* ---------- Like Rate: цвет числа (после правил «… b { color }», чтобы их перебить) ---------- */
.lr-low, b.lr-low { color: #b91c1c; }
.lr-mid, b.lr-mid { color: #b45309; }
.lr-high, b.lr-high { color: #15803d; }
