/* Пульт аналитика. Шрифты только локальные: в закрытой сети внешние CDN недоступны. */
:root {
  --ground: #EEF0EC;
  --surface: #FFFFFF;
  --ink: #17212B;
  --ink-2: #3D4752;
  --muted: #56606B;
  --rule: #D5DAD3;
  --rule-soft: #E4E7E1;
  --accent: #23497A;
  --accent-dark: #16325A;
  --accent-soft: #E1E8F1;
  --star: #B26B00;
  --star-off: #7F8893;
  --up: #2E6B3F;
  --down: #A1392B;
  --note-bg: #F6F1E6;
  --note-fg: #5A4310;
  --added-bg: #F3F7EF;
  --bar: #9FB3CB;
  --story-bar: #4A78B0;
  --night: #17212B;
  --night-2: #222D39;
  --night-line: #3A4754;
  --night-fg: #EEF0EC;
  --night-muted: #A9B4BF;
  --cta: #E9B44C;

  --ui: "Golos Text", "Segoe UI", "PT Sans", system-ui, sans-serif;
  --doc: "PT Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: .92em; background: var(--accent-soft); padding: 1px 5px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding-inline: 24px; }

/* --- верхняя полоса --- */
.topbar { background: var(--night); color: var(--night-fg); }
.topbar-in { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-block: 8px; }
.runnav { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.navbtn { width: 36px; height: 36px; border: 1px solid var(--night-line); border-radius: 4px; background: transparent; color: var(--night-fg); font-size: 18px; }

.pages { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pages a { color: #C9D1D9; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 14px; font-weight: 500; }
.pages a:hover { color: #FFFFFF; }
.pages a[aria-current="true"] { background: #2C3946; color: #FFFFFF; }

/* --- заголовок прогона --- */
.board { flex: 1 0 auto; display: flex; flex-direction: column; gap: 20px; padding-block: 20px 32px; }
.titlerow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.titlerow h1 { margin: 0; font: 700 28px/1.2 var(--doc); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.chip.ok { background: #DDE8DF; color: #1F4D2B; }
.chip.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.funnel { margin-left: auto; font-size: 14px; color: var(--muted); }
.funnel b { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.funnel b.accent { color: var(--accent); }

/* --- панели --- */
.panels { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.panels > .card { flex: 1 1 480px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.card-tools { display: flex; align-items: center; gap: 12px; }

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.quote { border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quote-name { font-size: 13px; color: var(--muted); }
.quote-val { display: flex; align-items: baseline; gap: 6px; }
.quote-val .num { font: 500 22px var(--mono); font-variant-numeric: tabular-nums; }
.quote-val .none { font-size: 15px; color: var(--muted); }
.arrow { font-size: 18px; font-weight: 700; }
.arrow.up { color: var(--up); }
.arrow.down { color: var(--down); }
.quote-unit { font-size: 12px; color: var(--muted); }
.quote a { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-err { font-size: 12px; color: var(--down); overflow-wrap: anywhere; }
.quote-also { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--rule-soft); font-size: 13px; }
.quote-also b { font-weight: 500; font-variant-numeric: tabular-nums; }
.quote-also .none { color: var(--muted); }

/* --- новости --- */
.card.news { padding: 0; gap: 0; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
/* темы новостей сводки (как в «Сюжетах»): кнопки под разделами, метка темы у новости */
.run-topics { padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.row .meta .tag.topic { padding: 1px 8px; font-size: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { min-height: 40px; padding: 6px 14px; border-radius: 4px; border: 1px solid #C3CAC1; background: var(--surface); font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tab .cnt { font-family: var(--mono); font-size: 13px; opacity: .8; }
.tab[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #FFFFFF; }
.check { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.tab-hint { padding: 10px 16px; background: var(--note-bg); color: var(--note-fg); font-size: 14px; border-bottom: 1px solid #E8DCC2; }

.table-scroll { overflow-x: auto; }
.table { min-width: 880px; }
.row { display: grid; grid-template-columns: 60px 40px 56px minmax(0, 1fr) 72px 184px; gap: 0 8px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--ground); }
.row.head { white-space: nowrap; padding-block: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule-soft); }
.row.added { background: var(--added-bg); }
.row input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.row .num { font-family: var(--mono); color: var(--muted); padding-top: 1px; }
.weight { justify-self: start; font: 13px var(--mono); padding: 1px 7px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); }
.weight.strong { background: var(--accent); color: #FFFFFF; }
.row .time { font: 13px var(--mono); color: var(--ink-2); padding-top: 1px; }
.body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.headline-line { display: flex; align-items: flex-start; gap: 6px; }
.headline { font-weight: 600; line-height: 1.35; cursor: pointer; }
.iconbtn { flex: 0 0 28px; height: 28px; margin-top: -3px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.iconbtn:hover { background: var(--ground); color: var(--ink); }
.edit-line { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-line input { flex: 1 1 360px; min-width: 0; padding: 7px 10px; border: 1px solid var(--accent); border-radius: 4px; font-weight: 600; }
.edited-note { font-size: 13px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.meta a { text-decoration: none; }
.pill { border: 1px solid #C9D3E0; background: #EEF3F9; color: var(--accent); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
.algo-reason { font-size: 13px; color: #7A5A12; }
.subs { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.subs .m { color: var(--muted); }
.why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; }
.why > span { font-size: 13px; color: var(--ink-2); }
.why button { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #C3CAC1; background: var(--surface); font-size: 13px; font-weight: 500; }
.why button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #FFFFFF; }
.stars { display: flex; }
.star { width: 34px; height: 34px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.star svg { width: 20px; height: 20px; }
.star path { fill: none; stroke: var(--star-off); stroke-width: 1.6; stroke-linejoin: round; }
.star.on path { fill: var(--star); stroke: var(--star); }
.star:hover path { stroke: var(--star); }
.rate-text { font-size: 12px; color: var(--muted); padding-left: 7px; }
.rate-text.set { color: var(--ink); }
.no-rows { padding: 24px 16px; color: var(--muted); }

/* --- справка по стране --- */
.setup { gap: 18px; }
.setup-grid { display: flex; flex-wrap: wrap; gap: 24px 40px; }
.field { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > input[type="text"] { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); }
.hint { font-size: 13px; color: var(--muted); }
.hint.warn { color: var(--note-fg); background: var(--note-bg); padding: 6px 10px; border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 32px; padding: 0 10px; border: 1px solid #C9D3E0; border-radius: 999px; background: #EEF3F9; color: var(--accent); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn .cnt { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.chip-btn[aria-pressed="true"] .cnt { color: #DCE5F0; }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg-btn { min-height: 40px; padding: 0 14px; border: 1px solid #C3CAC1; margin-left: -1px; background: var(--surface); font-size: 14px; font-weight: 500; }
.seg-btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg-btn:last-child { border-radius: 0 4px 4px 0; }
@media (max-width: 640px) { .seg { gap: 6px; } .seg-btn, .seg-btn:first-child, .seg-btn:last-child { margin-left: 0; border-radius: 4px; } }
.seg-btn[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #FFFFFF; position: relative; }
.dates { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.dates label { display: flex; align-items: center; gap: 8px; }
.dates input { min-height: 40px; padding: 4px 8px; border: 1px solid #C3CAC1; border-radius: 4px; font: 14px var(--mono); background: var(--surface); }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.btn.go { min-height: 44px; padding: 0 22px; border: 0; background: var(--accent); color: #FFFFFF; font-weight: 600; font-size: 15px; border-radius: var(--radius); }
.btn.go:hover { background: var(--accent-dark); }
.setup-note { margin: 0; max-width: 90ch; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.recent { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--rule-soft); }
.recent-row { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 2fr); gap: 4px 16px; padding: 10px 4px; color: var(--ink); text-decoration: none; font-size: 14px; }
.recent-del { flex: none; padding: 6px 8px; }
.recent-row:hover { background: var(--ground); color: var(--ink); }
.recent-row .mono { font-size: 13px; }
.row.brief { grid-template-columns: 96px 40px 56px minmax(0, 1fr) 104px; }
.section-row { padding: 14px 16px 6px; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--rule-soft); }
.tag { font-size: 12px; padding: 0 8px; border-radius: 3px; background: var(--note-bg); color: var(--note-fg); }
textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font: 15px/1.5 var(--ui); resize: vertical; background: var(--surface); }
details.filtered summary { cursor: pointer; font-weight: 600; }
details.filtered ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.sheet .doc-country { text-align: center; font-weight: 700; font-size: 18px; margin-top: -16px; }
.sheet .doc-p { margin: 0 0 6px; }

/* --- источники --- */
.titlerow-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.search { flex: 1 1 320px; min-width: 0; min-height: 40px; padding: 6px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 14px; background: var(--surface); }
.src-table { min-width: 1040px; }
.row.src { grid-template-columns: minmax(0, 1.6fr) 120px 110px minmax(0, 1.3fr) 110px 170px 170px 72px 100px; align-items: center; }
.collect-info { margin: 0; font-size: 14px; color: var(--ink-2); }
.collect-info .chip-dot { display: inline-flex; }
.row.src.head { align-items: end; }
.row.src.disabled .body, .row.src.disabled .src-url { opacity: .55; }
.src-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.src-name:hover { color: var(--accent); text-decoration: underline; }
.src-comment { font-size: 13px; color: var(--muted); }
.src-url { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-news { display: flex; flex-direction: column; font-size: 13px; }
.row.src input[type="checkbox"] { margin: 0 0 0 14px; }
.tag.kind-site { background: var(--accent-soft); color: var(--accent); justify-self: start; }
.tag.kind-telegram { background: #E3F0F6; color: #1F5872; justify-self: start; }
.tag.kind-page { background: #EEE9DD; color: #5A4A1E; justify-self: start; }
.tag.kind-dzen { background: #ECE6F3; color: #4A2F6B; justify-self: start; }
.check-chip { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.chip-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.chip-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.chip-dot.ok { color: #1F4D2B; } .chip-dot.ok::before { background: var(--up); }
.chip-dot.warn { color: var(--note-fg); } .chip-dot.warn::before { background: #C9902A; }
.chip-dot.error { color: var(--down); } .chip-dot.error::before { background: var(--down); }
.page-note { margin: 0; max-width: 100ch; }
.source-form { gap: 20px; max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.form-grid .field { flex: initial; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input[type="text"] { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 15px; background: var(--surface); }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.field legend { padding: 0 0 8px; }
.field-check { justify-content: flex-end; }
.field-check .check { margin-left: 0; }
.seg-radio { min-height: 44px; padding: 0 16px; border: 1px solid #C3CAC1; margin-left: -1px; background: var(--surface); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.seg-radio:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg-radio:last-child { border-radius: 0 4px 4px 0; }
.seg-radio input { margin: 0; accent-color: #FFFFFF; }
.seg-radio:has(input:checked) { background: var(--night); border-color: var(--night); color: #FFFFFF; }
.seg-radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-result { border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--rule); font-size: 14px; }
.check-result p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.check-result .facts { color: var(--muted); font-size: 13px; }
.check-result .btn { align-self: flex-start; }
.check-result.ok { background: #EDF4EE; border-color: #B9D3BE; }
.check-result.ok b { color: #1F4D2B; }
.check-result.warn { background: var(--note-bg); border-color: #E8DCC2; }
.check-result.warn b { color: var(--note-fg); }
.check-result.error { background: #F8ECE9; border-color: #E5C3BC; }
.check-result.error b { color: var(--down); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.btn.danger { margin-left: auto; color: var(--down); border-color: #E5C3BC; }
#sf-status { color: var(--down); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .titlerow-actions { margin-left: 0; } }

/* --- поиск --- */
.search-form { gap: 14px; }
.search-line { display: flex; flex-wrap: wrap; gap: 10px; }
.search-line input { flex: 1 1 420px; min-width: 0; min-height: 48px; padding: 8px 14px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 17px; background: var(--surface); }
.search-line .btn.go { min-height: 48px; padding: 0 28px; }
.search-form .hint { margin: 0; }
.search-line .help-btn { min-height: 48px; min-width: 48px; padding: 0; font-size: 18px; font-weight: 600; color: var(--accent); }
.search-line .help-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.q-rules { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.q-rules h3 { margin: 0; }
.q-rules dl { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 8px 18px; }
.q-rules dl > div { display: contents; }
.q-rules dt { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.q-rules dd { margin: 0; font-size: 14px; color: var(--ink-2); }
.q-rules p { margin: 0; font-size: 13px; }
.q-ex { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 3px; background: var(--accent-soft); color: var(--ink); cursor: pointer; text-align: left; }
.q-ex:hover, .q-ex:focus-visible { border-color: var(--accent); }
@media (max-width: 640px) { .q-rules dl { grid-template-columns: 1fr; gap: 4px; } .q-rules dd { margin-bottom: 8px; } }
.search-form code { white-space: nowrap; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 24px; align-items: start; }
.filters .field { flex: initial; gap: 6px; }
.filters .wide-2 { grid-column: 1 / -1; }
.period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.filters select, .filters input[type="text"] { min-height: 40px; padding: 6px 10px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 14px; background: var(--surface); }
.filters .checks { justify-content: flex-end; gap: 8px; }
.filters .checks .check { margin-left: 0; }
details.multi { position: relative; }
details.multi summary { min-height: 40px; padding: 8px 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font-size: 14px; cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.multi summary::after { content: " ▾"; color: var(--muted); }
details.multi[open] summary { border-color: var(--accent); }
.multi-list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(340px, 90vw); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(23, 33, 43, .15); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.multi-list .check { margin-left: 0; padding: 4px 6px; font-size: 14px; }
.multi-list .cnt { margin-left: auto; padding-left: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.multi-actions { display: flex; justify-content: flex-end; padding-bottom: 4px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px; }
.search-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.facets { flex: 1 1 260px; max-width: 100%; gap: 8px; padding: 16px; }
.facets h2 { margin: 6px 0 2px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facet-list, .days { display: flex; flex-direction: column; gap: 2px; }
.facet { display: grid; grid-template-columns: minmax(0, 1fr) 70px 40px; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: 4px; background: transparent; font-size: 13px; text-align: left; }
.facet:hover { background: var(--ground); }
.facet-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facet-bar { height: 8px; background: #F1F3EF; border-radius: 2px; }
.facet-bar span { display: block; height: 8px; background: var(--bar); border-radius: 2px; }
.facet .cnt { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--ink-2); }
.results { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.hit { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.hit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--ink-2); }
.hit-title { font-weight: 600; font-size: 16px; line-height: 1.4; color: var(--ink); text-decoration: none; }
.hit-title:hover { color: var(--accent); text-decoration: underline; }
.hit-snippet { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
mark { background: #F7E2A8; color: inherit; border-radius: 2px; padding: 0 1px; }
.tag.in-digest { background: #DDE8DF; color: #1F4D2B; }
.tag.rated { background: #F6EBD3; color: #7A4F00; }
.saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.saved-row .chips { flex: 1 1 300px; min-width: 0; }
.saved-chip { display: inline-flex; align-items: stretch; border: 1px solid #C9D3E0; border-radius: 999px; background: #EEF3F9; overflow: hidden; }
.saved-chip button { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 500; }
.saved-apply { padding: 5px 4px 5px 12px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-apply:hover { text-decoration: underline; }
.saved-del { padding: 0 10px 0 6px; color: var(--muted) !important; }
.saved-chip.deleting { border-color: #E5C3BC; background: #F8ECE9; }
.saved-chip.deleting .saved-del { color: var(--down) !important; font-weight: 600; }
.save-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.save-inline input { min-height: 32px; width: 260px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 4px; font-size: 14px; }
.btn.small.save-ok { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.tag.in-brief { background: #E3F0F6; color: #1F5872; text-decoration: none; }
.tag.in-brief:hover { text-decoration: underline; }
.tag.manual { background: #E3F0F6; color: #1F5872; }
@media (max-width: 640px) { .facets { order: 2; } }

/* --- предпросмотр документа --- */
.preview { flex: 1 0 auto; max-width: 920px; padding-block: 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sheet { background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 1px 2px rgba(23, 33, 43, .06); padding: 48px clamp(16px, 5vw, 72px); font: 15px/1.5 var(--doc); display: flex; flex-direction: column; gap: 26px; }
.sheet .doc-title { text-align: center; font-weight: 700; font-size: 24px; letter-spacing: .14em; }
.sheet .doc-period { text-align: center; margin-top: -20px; }
.sheet h2 { margin: 0 0 6px; font-size: 19px; color: var(--accent); }
.sheet ul { margin: 0; padding-left: 22px; }
.sheet .doc-item { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.sheet .doc-item ul { font-size: 14px; }
.sheet .doc-item li { overflow-wrap: anywhere; }
.sheet .doc-subs-head { font-style: italic; font-size: 14px; padding-top: 4px; }
.sheet .doc-subs { padding-left: 44px; font-size: 13px; }

/* --- строка выгрузки --- */
.actionbar { position: sticky; bottom: 0; background: var(--night); color: var(--night-fg); padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.actionbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.counts { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; }
.counts b { font-family: var(--mono); }
.muted-dark { color: var(--night-muted); }
.muted-dark.error { color: #F2A99E; }
.filefield { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #C9D1D9; }
.filefield input { min-height: 40px; width: 280px; max-width: 100%; padding: 6px 10px; border-radius: 4px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-fg); font: 13px var(--mono); }
.actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.save-hint { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--night-muted); }

.btn { min-height: 40px; padding: 0 14px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font-weight: 500; font-size: 14px; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 13px; color: var(--accent); }
.btn.ghost { min-height: 44px; padding: 0 16px; border-color: #5D6B78; background: transparent; color: var(--night-fg); font-size: 15px; border-radius: var(--radius); }
.btn.primary { min-height: 44px; padding: 0 20px; border: 0; background: var(--cta); color: var(--ink); font-weight: 700; font-size: 15px; border-radius: var(--radius); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); background: var(--ink); color: #FFFFFF; padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(23, 33, 43, .25); font-size: 14px; z-index: 10; }
.toast.error { background: var(--down); }

.empty { flex: 1 0 auto; padding-block: 64px; max-width: 720px; }
.empty h1 { font: 700 26px var(--doc); margin: 0 0 12px; }

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .actionbar { position: static; }
  .recent-row { grid-template-columns: 1fr; }
  .funnel, .actions { margin-left: 0; }
  .filefield { flex: 1 1 100%; }
  .filefield input { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* --- страница «Сюжеты» --- */
.page-lede { margin: -6px 0 0; max-width: 84ch; }
.story-tools { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; }
.story-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.story-tool .label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.story-tools .seg-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.stories-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.story-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.story-count { font-size: 13px; }
.story-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) 72px; grid-template-areas: "day main reach" "day spark reach";
  gap: 6px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule-soft); border-radius: var(--radius);
  background: var(--surface); text-align: left; cursor: pointer; color: inherit; }
.story-item:hover { border-color: var(--bar); }
.story-item.selected { border-color: var(--accent); background: #EEF3F9; }
.story-item.fresh { box-shadow: inset 3px 0 0 var(--cta); }
.story-age b { color: var(--down); }
.story-tools .seg-btn.story-urgent-btn:not([aria-pressed="true"]) { color: var(--down); font-weight: 600; }
.story-auto .btn.small { min-height: 32px; }
.story-day { grid-area: day; display: flex; flex-direction: column; align-items: center; line-height: 1; color: var(--accent); }
.story-day b { font-family: var(--doc); font-size: 26px; font-variant-numeric: tabular-nums; }
.story-day span { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.story-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.story-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.story-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--muted); }
.story-reach { grid-area: reach; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; text-align: right; }
.story-reach b { font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.story-reach span { font-size: 12px; color: var(--ink-2); }
.story-reach small { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.spark { grid-area: spark; display: flex; align-items: flex-end; gap: 2px; height: 18px; max-width: 180px; }
.spark i { flex: 1; background: var(--story-bar); border-radius: 2px 2px 0 0; }
.spark i.zero { background: var(--rule-soft); }

.story-detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; min-width: 0;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.story-detail:empty { display: none; }
.story-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.story-card.inline { display: none; }
.story-card h2 { margin: 0; font: 700 20px/1.3 var(--doc); text-wrap: balance; }
.story-card h3.label { margin: 4px 0 -4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.story-facts { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.story-facts > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.story-facts dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.story-facts dd { margin: 0; color: var(--ink-2); }
.story-facts dd a { color: var(--ink); }
.story-facts b { color: var(--ink); }

.day-chart { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.day-chart figcaption.label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dc-plot { display: grid; gap: 2px; }
.dc-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; outline: none; }
.dc-bar-area { width: 100%; height: 96px; padding-top: 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--rule); }
.dc-bar { position: relative; width: 100%; max-width: 24px; background: var(--story-bar); border-radius: 4px 4px 0 0; }
/* подпись над столбцом — внутри него, над верхом: не отнимает высоту у самого столбца */
.dc-value { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.dc-date { font-family: var(--mono); font-size: 11px; color: var(--muted); min-height: 14px; white-space: nowrap; }
.dc-col.in-window .dc-date { color: var(--ink); font-weight: 600; }
.dc-col:hover .dc-bar, .dc-col:focus-visible .dc-bar { background: var(--accent); }
.dc-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.dc-col:hover::after, .dc-col:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); padding: 4px 8px; border-radius: 4px; background: var(--night); color: #FFFFFF; font-size: 12px;
  white-space: nowrap; pointer-events: none; z-index: 2; }
.dc-col:nth-child(-n+2)::after { left: 0; transform: none; }
.dc-col:nth-last-child(-n+2)::after { left: auto; right: 0; transform: none; }
.dc-note { font-size: 12px; }

.timeline { list-style: none; margin: 0 0 4px 6px; padding: 2px 0 2px 22px; border-left: 2px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.tl-day { position: relative; }
.tl-day::before { content: ""; position: absolute; left: -30px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--bar); }
.tl-day.in-window::before { background: var(--accent); border-color: var(--accent); }
.tl-date { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; color: var(--muted); }
.tl-date b { color: var(--ink); font-size: 14px; }
.tl-news { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; }
.tl-news .mono { color: var(--muted); font-size: 12.5px; margin-right: 8px; }
.tl-news a { color: var(--ink); text-decoration: none; }
.tl-news a:hover { color: var(--accent); text-decoration: underline; }
.tl-news .m { color: var(--muted); }
.tl-news .tag { margin-left: 8px; white-space: nowrap; }
/* «Показать все новости» и «и ещё N» у дня, «×» — убрать новость из сюжета, убранные — внизу */
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.tl-head .linklike, .tl-more { font-size: 13px; }
.tl-drop { margin-left: 6px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted);
  font: inherit; line-height: 1.2; cursor: pointer; }
.tl-drop:hover, .tl-drop:focus-visible { border-color: var(--down); color: var(--down); }
.story-excluded summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.story-excluded .tl-news { margin-top: 8px; }
.tag.first { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 980px) {
  .stories-layout { grid-template-columns: minmax(0, 1fr); }
  .story-detail { display: none; }
  .story-card.inline { display: flex; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); margin-top: -7px; }
  .story-item.selected { border-radius: var(--radius) var(--radius) 0 0; }
}
@media (max-width: 640px) {
  .story-tool .seg { gap: 6px; }
  .story-tools .seg-btn, .story-tools .seg-btn:first-child, .story-tools .seg-btn:last-child { margin-left: 0; border-radius: 4px; }
  .story-item { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "day main" "day reach" "day spark"; }
  .story-reach { flex-direction: row; align-items: baseline; gap: 6px; text-align: left; }
  .story-reach b { font-size: 16px; }
  .story-reach small { margin-top: 0; }
  .story-card { padding: 14px 14px; }
  .story-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* --- страница «Качество отбора» --- */
.q-tabs { margin-top: -4px; }
/* «Администрирование» → «Источники»: список и форма источника (sources.js) — как карточки других подразделов */
.adm-src-pane, .adm-src { display: flex; flex-direction: column; gap: 20px; }
.adm-src-head h2 { margin: 0; font: 700 22px/1.2 var(--doc); }
.q-tabs .seg-btn { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.q-tabs .seg-btn[aria-pressed="true"] { color: #FFFFFF; }
.q-pane { display: flex; flex-direction: column; gap: 20px; }
.q-pane[hidden] { display: none; }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.q-period .seg-btn { min-height: 34px; font-size: 13px; }
.q-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.q-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.card .q-tile { background: var(--ground); border-color: var(--rule-soft); }
.q-tile .label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.q-tile b { font: 500 26px/1.15 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.q-tile .muted { font-size: 13px; }
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.q-grid > .card { min-width: 0; }
.q-note { margin: -6px 0 0; max-width: 100ch; font-size: 13px; }
.q-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.q-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.q-table td { padding: 7px 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.q-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-table th.num { font-family: var(--ui); }
.q-table tr.changed td { background: #F6F1E6; }
.chip-v { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.chip-v.over { background: #F8E3DF; color: #8A2E21; }
.chip-v.over::before { content: "↑ "; }
.chip-v.under { background: var(--accent-soft); color: var(--accent); }
.chip-v.under::before { content: "↓ "; }
.q-week-chart .dc-bar-area { height: 120px; }
.q-week-chart .dc-date { font-size: 11px; white-space: normal; text-align: center; }
.q-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-bars li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3em; gap: 10px; align-items: center; font-size: 14px; }
.q-bar { height: 10px; background: var(--rule-soft); border-radius: 0 4px 4px 0; }
.q-bar i { display: block; height: 100%; background: var(--story-bar); border-radius: 0 4px 4px 0; }
.q-bars .num { text-align: right; font-family: var(--mono); }
.q-news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.q-news li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; }
.q-news li > .mono { color: var(--muted); font-size: 12.5px; }
.q-news a { color: var(--ink); text-decoration: none; }
.q-news a:hover { color: var(--accent); text-decoration: underline; }
.q-news .m { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.q-swap li { grid-template-columns: 1em 1.2em minmax(0, 1fr); }
.q-sign { font: 700 15px/1 var(--mono); }
.q-sign.in { color: var(--up); }
.q-sign.out { color: var(--down); }
.q-mark { font-weight: 700; text-align: center; color: var(--muted); }
.q-mark.ok { color: var(--up); }
.q-mark.bad { color: var(--down); }
.q-mark.weak { opacity: .55; }
summary .q-mark { margin-left: 8px; }
.q-details summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.q-details[open] summary { margin-bottom: 10px; }
.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.q-actions .label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.q-actions .seg-btn { min-height: 34px; font-size: 13px; }
.q-proposal { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--rule); padding-top: 14px; }
.q-proposal h3 { margin: 0; font: 700 18px/1.3 var(--doc); }
.q-proposal p { margin: 0; }
.q-diff td:first-child { width: 4em; text-align: center; }
.q-eval { display: flex; flex-direction: column; gap: 12px; }
.q-eval.stale .q-tiles, .q-eval.stale .q-runs { opacity: .5; }
.q-stale { margin: 0; padding: 8px 12px; background: var(--note-bg); color: var(--note-fg); border-radius: 4px; font-size: 14px; }
.q-runs { display: flex; flex-direction: column; gap: 6px; }
.q-run { border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 8px 12px; }
.q-run summary { cursor: pointer; font-size: 14px; }
.q-run[open] summary { margin-bottom: 10px; }
.q-run h4 { margin: 8px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip-s { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--rule-soft); color: var(--ink-2); white-space: nowrap; }
.chip-s.active { background: #DDE8DF; color: #1F4D2B; }
.chip-s.proposed { background: var(--note-bg); color: var(--note-fg); }
.chip-s.rejected { background: #F8E3DF; color: #8A2E21; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 900px) { .q-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .q-tabs, .q-period, .q-actions .seg { gap: 6px; }
  .q-tabs .seg-btn, .q-period .seg-btn, .q-actions .seg-btn { margin-left: 0; border-radius: 4px; }
  .q-bars li { grid-template-columns: minmax(0, 1fr) 3em; }
  .q-bars .q-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* --- новости ИИ (разметка ленты — как у БПЛА: .bpla-*) --- */
.tag.topic { background: var(--accent-soft); color: var(--accent); }
.ai-sort .seg-btn { min-height: 32px; }
.ai-lead { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }

/* --- атаки БПЛА --- */
.bpla-controls { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.bpla-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bpla-tools .label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bpla-tools .seg-btn { min-height: 36px; font-size: 13px; }
.bpla-tools .check { margin-left: 0; }
.bpla-tools .dates input { min-height: 36px; }
.bpla-day { display: flex; align-items: center; gap: 6px; }
.bpla-day .navbtn { border-color: #C3CAC1; background: var(--surface); color: var(--ink); }
.bpla-day .navbtn:disabled { opacity: .4; }
.bpla-day input { min-height: 36px; padding: 4px 8px; border: 1px solid #C3CAC1; border-radius: 4px; font: 14px var(--mono); background: var(--surface); }
.bpla-controls .hint { flex: 1 1 100%; margin: 0; }
.bpla-pick { margin-left: auto; display: flex; gap: 16px; font-size: 14px; }
.bpla-regions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
.bpla-regions:empty { display: none; }
.bpla-list { display: flex; flex-direction: column; }
.bpla-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px 6px; border-bottom: 1px solid var(--rule-soft); background: #F7F8F5; }
.bpla-group-head h2 { margin: 0; font: 700 17px/1.3 var(--doc); }
.bpla-group-head .muted { font-size: 13px; }
.bpla-row { display: grid; grid-template-columns: 28px 92px minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--ground); }
.bpla-row input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.bpla-row.checked { background: var(--added-bg); }
/* открытый контур: документа нет — и галочки «В документ» тоже */
.bpla-row.no-pick { grid-template-columns: 92px minmax(0, 1fr); }
.bpla-row.fresh { box-shadow: inset 3px 0 0 var(--cta); }
.bpla-time { display: flex; flex-direction: column; font: 13px/1.35 var(--mono); color: var(--ink-2); }
.bpla-time b { font-size: 15px; font-weight: 500; color: var(--ink); }
.bpla-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bpla-title { font-size: 15px; line-height: 1.4; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.bpla-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.bpla-meta a { overflow-wrap: anywhere; }
.tag.region { background: var(--accent-soft); color: var(--accent); }
.tag.fresh { background: #FBEBC4; color: #6B4B05; font-weight: 600; }
/* охват новости ИИ (ai.js renderAIReach): источники и счётчики */
.ai-reach { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-reach b { font-weight: 700; color: var(--ink); }
.tag.reason { background: var(--rule-soft); color: var(--ink-2); }
.bpla-empty { padding: 28px 16px; color: var(--muted); font-size: 15px; }
.bpla-sheet { font: 16px/1.5 var(--doc); gap: 0; text-align: justify; }
.bpla-sheet .doc-title { font-weight: 400; letter-spacing: 0; font-size: 17px; }
.bpla-sheet .doc-period { margin: 0 0 22px; }
.bpla-sheet p { margin: 0; text-indent: 1.25cm; }
.bpla-sheet h3 { margin: 22px 0 18px; text-align: center; font-size: 16px; }
@media (max-width: 640px) {
  .bpla-pick { margin-left: 0; }
  .bpla-row { grid-template-columns: 28px minmax(0, 1fr); }
  .bpla-time { grid-column: 2; flex-direction: row; gap: 8px; }
  .bpla-body { grid-column: 2; }
  .bpla-row.no-pick { grid-template-columns: minmax(0, 1fr); }
  .bpla-row.no-pick .bpla-time, .bpla-row.no-pick .bpla-body { grid-column: 1; }
}

/* --- сортировка таблицы сводки по заголовкам столбцов --- */
.th-sort { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.th-sort:hover { color: var(--accent); }
.th-sort.on { color: var(--accent); text-decoration: none; }
.th-sort .arrow { font-family: var(--mono); font-size: 13px; }
.bpla-every { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.bpla-every select { min-height: 36px; padding: 0 8px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 14px var(--ui); }
.bpla-every select:disabled { opacity: .55; }

/* --- постраничный вывод новостей (app.js: pager) --- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.pager-info { font: 13px var(--mono); color: var(--muted); }
.pager-pages, .pager-size { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-size { margin-left: auto; color: var(--muted); }
.pager-size > span { margin-right: 4px; }
.pager-btn { min-width: 36px; min-height: 36px; padding: 0 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); color: var(--ink); font: 14px var(--ui); cursor: pointer; }
.pager-btn:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--accent); color: var(--accent); }
.pager-btn[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #FFFFFF; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-gap { padding: 0 4px; color: var(--muted); }
#sr-pager .pager, .story-list .pager { border-top: 0; padding-inline: 0; }
@media (max-width: 640px) { .pager-size { margin-left: 0; } }

/* --- новость целиком: боковая панель справа (app.js: openNewsPanel) --- */
.news-open { padding: 0; border: 0; background: none; font-family: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.news-open:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(23, 33, 43, .35); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(640px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -8px 0 28px rgba(23, 33, 43, .22); }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 10px 24px; border-bottom: 1px solid var(--rule-soft); }
.drawer-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.drawer-close { width: 40px; height: 40px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.drawer-close:hover { border-color: var(--accent); color: var(--accent); }
.drawer-content { flex: 1; overflow-y: auto; padding: 20px 24px 36px; display: flex; flex-direction: column; gap: 14px; }
.drawer-title { margin: 0; font: 700 23px/1.3 var(--doc); color: var(--ink); overflow-wrap: anywhere; }
.drawer-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.drawer-meta b { color: var(--ink-2); font-weight: 600; }
.drawer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.drawer-pick { align-self: flex-start; margin-left: 0; }
/* «Кратко»: изложение моделью — над текстом новости */
.drawer-short { padding: 12px 14px; border: 1px solid #C9D3E0; border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: #F6F8FB; display: flex; flex-direction: column; gap: 8px; }
.drawer-short.error { border-color: #E3C0B8; border-left-color: var(--down); background: #FBF1EE; }
.short-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.short-head b { color: var(--accent); font-size: 14px; }
.short-text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.drawer-tr .tr-title { margin: 0; font: 700 18px/1.35 var(--doc); color: var(--ink); }
.drawer-short.running .short-text:last-of-type::after { content: "▍"; color: var(--accent); animation: short-caret 1s steps(1) infinite; }
@keyframes short-caret { 50% { opacity: 0; } }
.short-wait { margin: 0; font-size: 13px; color: var(--muted); }
.short-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.short-error { color: var(--down); }
.linklike { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--accent-dark); }
.drawer-body p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.drawer-body .drawer-lead { color: var(--ink-2); }
.drawer-body .drawer-note { font-size: 13px; line-height: 1.45; color: var(--muted); }
/* ссылки на первоисточник из текста новости (app.js: renderOrigins) — под строкой со ссылкой на новость */
.drawer-origins { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; }
.drawer-origins .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.drawer-origins .origin .muted { font-size: 12px; }
/* просмотры, реакции, комментарии (app.js: renderStats) */
.drawer-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.drawer-stats .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.drawer-stats .stat { white-space: nowrap; }
.drawer-stats .muted { font-size: 12px; }
/* переведённая новость (источник с отметкой «Переводить новости на русский»): оригинал — свёрнут */
.drawer-trnote { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.drawer-orig { border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.drawer-orig summary { font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.drawer-orig-title { margin: 12px 0 10px; font: 700 18px/1.35 var(--doc); color: var(--ink-2); overflow-wrap: anywhere; }
.drawer-orig p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.drawer-related { border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.drawer-related h3 { margin: 0 0 8px; font-size: 14px; }
.drawer-related ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
body.drawer-open { overflow: hidden; }
@media (max-width: 640px) { .drawer-content { padding: 16px; } .drawer-title { font-size: 20px; } }

/* --- «Где использовать» в форме источника и метки в списке --- */
.sf-scope { display: flex; flex-direction: column; gap: 10px; }
.sf-scope-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--rule-soft); border-radius: 4px; background: #F7F8F5; }
.sf-scope-box[hidden] { display: none; }
.sf-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.sf-sections { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.sf-sections .check { margin-left: 0; }
.sf-scope-box .hint { margin: 0; }
.sf-translate, .sf-fast { gap: 4px; }
.sf-translate .check, .sf-fast .check { margin-left: 0; align-self: flex-start; }
.sf-translate .hint, .sf-fast .hint { margin: 0; }
.src-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag.scope { background: #EFE7F6; color: #4E2A6E; }
.tag.scope.fast { background: #FBE3DE; color: #8A2A17; font-weight: 600; }
/* «оперативный» у источника и фильтр над списком — кнопки, как тематика */
button.tag.scope.fast { border: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
button.tag.scope.fast:hover { text-decoration: underline; }
.sf-fast .hint.warn { color: var(--note-fg); }
.tag.dup { background: #F6E1DD; color: var(--down); text-decoration: none; }
.tag.dup:hover { text-decoration: underline; }
/* тематика источника: щелчок — найти источники с ней */
.tag.topic { border: 0; font: inherit; font-size: 12px; background: #E2EEF0; color: #1F5560; cursor: pointer; }
.tag.topic:hover { text-decoration: underline; }
.sf-topic-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: 14px; }
.sf-topic-pick[hidden] { display: none; }
.dup-note { margin: 0; font-weight: 600; }
/* заголовок-кнопка «новость целиком» в таблицах сводки и справки, в хронологии сюжета */
.headline.news-open { font-size: inherit; color: var(--ink); }
.tl-news .tl-title { font-size: inherit; line-height: inherit; color: var(--ink); }

/* --- «Сформировать сводку сейчас» и пометка «без модели» (Новости ТВ) --- */
/* «Сформировать»: окно новой сводки (с 18:00 вчера по сейчас, можно поменять) и кнопка */
.run-new { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; }
.run-new .dates input { min-height: 36px; }
.empty .run-new { margin-top: 14px; justify-content: center; }
/* «Новости ТВ»: «Онлайн» (tv.js) / «Сводка за период» (#board) и кнопки окна новой сводки */
#board > .tv-mode, #empty > .tv-mode { margin: 0 0 14px; }
#empty > .tv-mode { justify-content: center; }
.run-win-periods .seg-btn { min-height: 36px; padding: 0 12px; }
.run-win-periods .seg-btn:disabled { opacity: .55; cursor: default; }
.tag.nomodel { background: #F6EBD3; color: #7A4F00; }

/* --- администрирование (admin.js) --- */
.adm-form { display: grid; gap: 20px; max-width: 820px; }
.adm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-field input[type="text"], .adm-num { min-height: 40px; padding: 6px 10px; border: 1px solid #C3CAC1; border-radius: 4px; font: 14px var(--mono); background: var(--surface); }
.adm-num { width: 120px; }
.adm-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-inline input { flex: 1 1 320px; min-width: 0; }
.adm-field .check-result { margin-top: 2px; }
.adm-field .check { margin-left: 0; align-self: flex-start; }
.adm-field > .adm-model { align-self: flex-start; max-width: 100%; }
.adm-form select, .adm-form input[type="time"] { min-height: 40px; padding: 6px 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font-size: 14px; }
.adm-bk-when { align-items: center; }
.adm-bk-when input, .adm-inline .check input { flex: none; }
.adm-bk-when .check { align-self: center; }
.adm-bk-when label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.adm-proxy-row { align-items: center; }
.adm-proxy-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
#adm-backup-form { margin-top: 18px; }
.card .q-tile.adm-bk-error { border-color: #E5B5AA; background: #FBEDEA; }
.adm-bk-error span:last-child { color: #8A2A17; font-size: 13px; overflow-wrap: anywhere; }
.adm-bk-list-title { margin: 18px 0 4px; }
.adm-publish { margin: 2px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 13px; }
.adm-publish:empty { display: none; }
.adm-publish > div { display: contents; }
.adm-publish dt { color: var(--muted); }
.adm-publish dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.adm-publish .error dd { color: var(--down); }
@media (max-width: 640px) { .adm-publish { grid-template-columns: 1fr; gap: 0; } .adm-publish dd { margin-bottom: 6px; } }
.adm-field .check-result p { white-space: pre-line; }
.adm-filters { display: flex; flex-direction: column; gap: 10px; }
.adm-select { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.adm-select select { min-height: 36px; max-width: 260px; padding: 4px 8px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font-size: 14px; }
.adm-chart .dc-bar-area { height: 160px; }
.adm-chart .dc-date { font-size: 11px; overflow: visible; }
.adm-chart.stale { opacity: .5; }
/* «Метрики»: продолжительность сбора (admin.js renderAdminMetrics) */
.adm-mx-chart .dc-bar-area { position: relative; gap: 2px; }
.mx-seg { width: 100%; max-width: 24px; flex: none; }
.mx-seg:first-of-type { border-radius: 4px 4px 0 0; }
.mx-seg.collect, .mx-key.collect { background: #4A78B0; }
.mx-seg.after, .mx-key.after { background: #C98A2B; }
.mx-seg.bad, .mx-key.bad { background: var(--down); }
.adm-mx-chart .dc-col:hover .mx-seg, .adm-mx-chart .dc-col:focus-visible .mx-seg { filter: brightness(.8); }
.mx-limit { position: absolute; left: -1px; right: -1px; border-top: 1px dashed var(--ink-2); pointer-events: none; }
.adm-mx-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.adm-mx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mx-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.mx-key.limit { height: 0; width: 16px; border-radius: 0; border-top: 1px dashed var(--ink-2); }
.card .q-tile.adm-mx-warn { border-color: #E2C887; background: var(--note-bg); }
.card .q-tile.adm-mx-warn .label { color: var(--note-fg); }
.adm-mx-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 32px; }
.adm-mx-cols:empty { display: none; }
.adm-mx-cols h3.label { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.adm-mx-cols p.muted { margin: 8px 0 0; font-size: 13px; }
.adm-mx-bars { display: flex; flex-direction: column; gap: 6px; }
.adm-mx-bar { display: grid; grid-template-columns: minmax(0, 11em) minmax(40px, 1fr) 6.5em; align-items: center; gap: 10px; font-size: 14px; }
.adm-mx-bar .mx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mx-bar .mx-track { height: 10px; background: var(--rule-soft); border-radius: 0 4px 4px 0; }
.adm-mx-bar .mx-track i { display: block; height: 100%; background: #4A78B0; border-radius: 0 4px 4px 0; }
.adm-mx-bar .mx-val { text-align: right; font-size: 13px; color: var(--ink-2); }
.adm-mx-runs summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.adm-mx-runs[open] summary { margin-bottom: 8px; }
.adm-mx-runs .adm-table-wrap { max-height: 420px; overflow-y: auto; }
.adm-table tr.adm-mx-bad td, .adm-table tr.adm-mx-bad th { color: var(--down); }
#adm-mx-sources .adm-table-head { margin-top: 2px; }
.adm-table td.adm-mx-problem { white-space: normal; min-width: 280px; }
.mx-prob { font-weight: 600; }
.mx-prob.error { color: var(--down); }
.mx-prob.stale, .mx-prob.empty, .mx-prob.silent { color: var(--note-fg); }
.adm-table td.adm-mx-collect-cell { white-space: normal; max-width: 320px; overflow-wrap: anywhere; font-size: 13px; }
#adm-mx-jobs thead th { white-space: normal; vertical-align: bottom; }
/* «Метрики» → «Перевод источников» (renderAdminMxTranslate) */
.tr-pair { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.tr-pair i { flex: 1 1 0; max-width: 11px; border-radius: 3px 3px 0 0; }
.tr-in, .mx-key.tr-in { background: #B8C9DE; }
.tr-done, .mx-key.tr-done { background: #4A78B0; }
.adm-mx-tr-chart .dc-col:hover .tr-pair i, .adm-mx-tr-chart .dc-col:focus-visible .tr-pair i { filter: brightness(.85); }
.adm-mx-tr-note { margin: 0; font-size: 13px; }
#adm-mx-tr thead th { white-space: normal; vertical-align: bottom; }
.adm-table tr.adm-mx-late td.adm-mx-problem { color: var(--note-fg); font-weight: 600; }
.adm-table td.adm-mx-phases-cell { white-space: normal; min-width: 260px; font-size: 13px; color: var(--ink-2); }
.adm-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.adm-kinds { font-size: 14px; }
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); text-align: left; white-space: nowrap; }
.adm-table thead th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table tfoot th, .adm-table tfoot td { font-weight: 700; border-top: 1px solid var(--rule); border-bottom: 0; }
.adm-table tr.zero td { color: var(--muted); }
.adm-table .linkbtn { text-align: left; }
.adm-sort { padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.adm-share { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.adm-share > span:last-child { min-width: 3.4em; text-align: right; }
.adm-share-bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.adm-share-bar i { display: block; height: 100%; background: var(--story-bar); }
.adm-table tr.stalled td { background: #FBEDEA; }
.adm-table tr.stalled .adm-share-bar i { background: #B4442F; }
.adm-table .tag.warn { margin-right: 8px; background: #F6D9D2; color: #8A2A17; }
.adm-reason { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.adm-note { margin: 0; font-size: 13px; }
.adm-sort:hover { color: var(--accent); }
/* «Журналы»: службы карточками-кнопками, журнал — как в терминале */
.adm-svcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.adm-svc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.adm-svc:hover { border-color: var(--accent); }
.adm-svc[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.adm-svc-name { font-weight: 600; }
.adm-svc .chip-dot { font-size: 13px; }
.adm-svc-facts { font-size: 12.5px; }
.adm-log-tools { margin: 16px 0 4px; }
.adm-log-q { min-height: 36px; width: 220px; max-width: 100%; padding: 4px 10px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 14px; background: var(--surface); }
.adm-log-info { margin: 6px 0; font-size: 13px; }
.adm-log { margin: 0; max-height: 65vh; min-height: 120px; overflow: auto; padding: 10px 12px; border-radius: var(--radius);
  background: var(--night); color: var(--night-fg); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-log:empty { display: none; }
.log-t { color: var(--night-muted); margin-right: 10px; font-variant-numeric: tabular-nums; }
.log-line.warn { color: #F2D08A; }
.log-line.error { color: #FFB4A8; }
.adm-log mark { background: var(--cta); color: var(--ink); border-radius: 2px; }

/* «Новости ТВ»: строка как в «Новостях ИИ» — галочка, время и дата, новость, оценка */
.row.tv { grid-template-columns: 28px 92px minmax(0, 1fr) 184px; gap: 0 10px; }
/* открытый контур: без галочки и оценки — время и новость */
.row.tv.plain { grid-template-columns: 92px minmax(0, 1fr); }
.row.tv .th-group { display: flex; gap: 14px; }
.row.tv .meta .weight { padding-block: 0; }
#rows { min-width: 0; }   /* строки «Новостей ТВ» переносятся сами, без прокрутки вбок */
@media (max-width: 640px) {
  .row.tv { grid-template-columns: 28px minmax(0, 1fr); row-gap: 6px; }
  .row.tv > .bpla-time { grid-column: 2; flex-direction: row; gap: 8px; }
  .row.tv > .body, .row.tv > div:last-child { grid-column: 2; }
  .row.tv.plain { grid-template-columns: minmax(0, 1fr); }
  .row.tv.plain > .bpla-time, .row.tv.plain > .body { grid-column: 1; }
  .row.tv.head { display: flex; flex-wrap: wrap; gap: 6px 14px; }
  .row.tv.head > span:first-child, .row.tv.head > span:last-child { display: none; }
}

/* --- вход и пользователи (login.html, users.js) --- */
.login-brand { font-weight: 600; font-size: 15px; color: var(--night-fg); }
.login-body .topbar-in { gap: 12px; }
.login-body .edition-badge { margin-left: auto; display: inline-block; }
.login-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px; }
.login-card { width: 100%; max-width: 420px; gap: 16px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field { flex: none; }
.login-form input, .pw-dialog input { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); }
.login-form .btn.go { width: 100%; min-height: 44px; }
.login-status { margin: 0; }
.login-status:empty { display: none; }
.check-result p:empty { display: none; }

.userbox { position: relative; margin-left: auto; }
.runnav:not([hidden]) + .userbox { margin-left: 0; }
.user-btn { min-height: 36px; max-width: 280px; padding: 0 12px; border: 1px solid var(--night-line); border-radius: 4px; background: transparent; color: var(--night-fg); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.user-btn:hover { border-color: var(--night-muted); }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--night-muted); font-size: 12px; white-space: nowrap; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; max-width: calc(100vw - 32px); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(23, 33, 43, .18); }
.user-menu .who { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.user-menu .who b { color: var(--ink); font-size: 15px; }
.user-menu .btn { width: 100%; }
body.not-admin .admin-only { display: none !important; }
body:not(.not-admin) .analyst-only { display: none !important; }
/* редакция: закрытый контур — без того, что требует интернета */
body.edition-closed .open-only { display: none !important; }
body:not(.edition-closed) .closed-only { display: none !important; }
.src-closed-note { margin: 0 0 14px; }

.pw-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); }
.pw-dialog::backdrop { background: rgba(23, 33, 43, .45); }
.pw-dialog form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.pw-dialog h2 { margin: 0; font-size: 19px; }
.pw-dialog .field { flex: none; }

.adm-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.adm-stack > .card { min-width: 0; }
.adm-stack .card-head { flex-wrap: wrap; gap: 8px 16px; }
.usr-add { margin-left: auto; }
.usr-form { padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: #FAFBF9; max-width: none; }
.usr-form h3 { margin: 0; font-size: 16px; }
.usr-form .seg { align-self: flex-start; }
.usr-form input[type="password"] { min-height: 40px; padding: 6px 10px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 14px; background: var(--surface); flex: 1 1 200px; min-width: 0; }
.usr-form input:disabled { background: var(--rule-soft); }
.usr-who { display: flex; flex-direction: column; gap: 2px; }
.usr-state { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.usr-table tr.usr-off td { color: var(--muted); }
.usr-log td.usr-why { white-space: normal; min-width: 240px; color: var(--ink-2); }
.ad-form { max-width: none; }
.ad-form textarea { min-height: 96px; padding: 8px 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 12px/1.45 var(--mono); resize: vertical; }
.adm-inline input.ad-short { flex: 0 1 150px; }
.ad-group { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.ad-group input { flex: none; min-height: 40px; padding: 6px 10px; border: 1px solid #C3CAC1; border-radius: 4px; font: 14px var(--mono); background: var(--surface); }
.hint.ok { color: #1F4D2B; }

/* редакция в шапке: открытый или закрытый контур */
.userbox:not([hidden]) { display: flex; align-items: center; gap: 10px; }
.edition-badge { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; white-space: nowrap;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--night-line); color: var(--night-muted); }
.edition-badge.closed { border-color: var(--cta); color: var(--cta); }
@media (max-width: 720px) { .edition-badge { display: none; } }

/* «Администрирование» → «Передача» (transfer.js) */
#adm-pane-transfer > .check-result { margin-bottom: 14px; }
#adm-pane-transfer .q-tiles { margin-bottom: 18px; }
.tr-key, .tr-resend { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--rule-soft); }
.tr-key h3, .tr-resend h3 { margin: 0; }
.tr-key p { margin: 0; }
.tr-fp b { font-size: 18px; letter-spacing: .04em; }
.tr-pubkey { flex: 1 1 320px; min-width: 0; padding: 8px 10px; background: var(--ground); border: 1px solid var(--rule-soft); border-radius: var(--radius);
  font: 14px var(--mono); overflow-wrap: anywhere; user-select: all; }
.tr-log { max-height: 220px; margin: 16px 0 0; }
.tr-err { color: var(--down); }

/* --- подборки (selections.js) --- */
.sel-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.sel-side { position: sticky; top: 12px; gap: 12px; }
.sel-side section { display: flex; flex-direction: column; gap: 4px; }
.sel-side h2.label { margin: 4px 0 0; }
.sel-list { display: flex; flex-direction: column; gap: 2px; }
.sel-item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; }
.sel-item:hover { background: var(--ground); }
.sel-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sel-item-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sel-count { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #FFFFFF; font: 600 12px/1.5 var(--mono); text-align: center; }
.sel-none { margin: 0; padding: 4px 10px; font-size: 13px; }
.sel-hidden summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.sel-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.sel-feed { display: flex; flex-direction: column; gap: 10px; }
.sel-head h2 { overflow-wrap: anywhere; }
.sel-desc { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.sel-empty h2 { margin: 0; font-size: 17px; }
.sel-empty p { margin: 0; max-width: 60ch; }
.sel-empty .btn { align-self: flex-start; }
.hit.is-new { border-left: 4px solid var(--accent); }
.tag.new-tag { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.sel-form h2 { margin: 0; font-size: 17px; }
.sel-form .field { flex: initial; }
.sel-rules { display: flex; flex-direction: column; gap: 12px; }
.sel-rules .field > input[type="text"], .sel-any-row input { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); }
.sel-any { display: flex; flex-direction: column; gap: 12px; }
.sel-any-field { gap: 6px; }
.sel-any-row { display: flex; gap: 8px; align-items: center; }
.sel-any-row input { flex: 1; min-width: 0; }
.sel-any-add { align-self: flex-start; }
/* вторая и следующие строки «любое из»: «или» / «и ещё» — вместо подписи */
.sel-any-join { align-self: flex-start; min-height: 32px; padding: 4px 8px; border: 1px solid #C3CAC1; border-radius: 4px; font: 600 13px var(--ui); color: var(--ink); background: var(--surface); }
.sel-rules code { font-family: var(--mono); font-size: 12px; background: var(--ground); padding: 0 4px; border-radius: 3px; }
.sel-shared-check { margin-left: 0; }
.sel-preview { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sel-preview #sel-pv-summary { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.sel-pv-days { max-width: 360px; }
.sel-pv-days .facet { cursor: default; }
.sel-pv-days .facet:hover { background: transparent; }
#sel-pv-list { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 860px) {
  .sel-layout { grid-template-columns: minmax(0, 1fr); }
  .sel-side { position: static; }
}
#sel-list { display: flex; flex-direction: column; gap: 10px; }
/* «Главные» подборки (selections.js renderSelTop) и веса тем в конструкторе */
.sel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
#sel-list.sel-top-list { gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.sel-top-list .bpla-row:last-child { border-bottom: 0; }
.sel-rank { font: 600 15px/1.35 var(--mono); color: var(--muted); text-align: right; }
#sel-pager .sel-top-more { display: block; margin: 4px auto 0; }
.sel-weights { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sel-weights h3 { margin: 0; }
.sel-weights .hint { margin: 0; }
.sel-w-rows { display: flex; flex-direction: column; gap: 8px; }
.sel-w-rows:empty { display: none; }
.sel-w-row { display: flex; align-items: center; gap: 8px; }
.sel-w-row input { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); }
.sel-w-row input[type="text"] { flex: 1; min-width: 0; }
.sel-w-row input[type="number"] { width: 4.5em; padding: 8px; }
#sel-f-weight-add { align-self: flex-start; }

/* --- восстановление из резервной копии (admin.js) --- */
.adm-bk-net { display: flex; flex-direction: column; gap: 8px; }
.adm-bk-net p { margin: 0; font-size: 13px; }
.adm-restore { border: 1px solid #E5C3BC; background: #FBF4F2; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.adm-restore h3 { margin: 0; font-size: 16px; }
.adm-restore .hint { margin: 0; }
.adm-rs-files { display: flex; flex-direction: column; gap: 6px; }
.adm-rs-file, .adm-rs-confirm { margin-left: 0; align-items: flex-start; }
.adm-rs-file input, .adm-rs-confirm input { margin-top: 2px; flex: none; }
#adm-rs-go:not(:disabled) { background: var(--down); border-color: var(--down); }

/* --- темы сюжетов (stories.js) --- */
.story-topics-tool { flex-basis: 100%; }
.story-topics-tool .chips { gap: 6px; }
.story-meta .tag.topic { font-size: 11.5px; }
.story-facts .topic-pick { border: 0; cursor: pointer; margin-right: 6px; }
.story-facts .topic-pick:hover { text-decoration: underline; }

/* --- справка по системе (help.js) --- */
.help-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--night-line); border-radius: 4px; color: #C9D1D9; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.help-link:hover { color: #FFFFFF; border-color: var(--night-muted); }
.help-link[aria-current="true"] { background: #2C3946; color: #FFFFFF; }
.help-link-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; font-weight: 700; line-height: 1; }
.help-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; gap: 12px; }
.help-search { display: flex; flex-direction: column; gap: 6px; }
.help-search input { min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); width: 100%; }
.help-toc-box > summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 4px 0; }
.help-toc-list, .help-toc-sections { list-style: none; margin: 0; padding: 0; }
.help-toc-list > li > a { display: block; padding: 6px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; }
.help-toc-list > li > a:hover { background: var(--ground); }
.help-toc-list > li.current > a { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.help-toc-sections { margin: 2px 0 6px 10px; border-left: 2px solid var(--rule-soft); }
.help-toc-sections a { display: block; padding: 3px 10px; color: var(--ink-2); text-decoration: none; font-size: 13px; }
.help-toc-sections a:hover, .help-toc-sections a.active { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.help-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.help-home p { margin: 0; max-width: 75ch; }
.help-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.help-group h2, .help-news h2, .help-results h2 { margin: 0; font-size: 17px; }
.help-group ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.help-news .muted { margin: 0; }
.help-chapter { gap: 10px; padding: 24px 28px 28px; }
.help-chapter-title { margin: 0; font: 700 26px/1.25 var(--doc); }
.help-aud-line { margin: 0; }
.help-back { align-self: flex-start; font-size: 14px; }
.help-inchapter { background: var(--ground); border-radius: var(--radius); padding: 10px 14px; }
.help-inchapter ul { margin: 6px 0 0; padding-left: 18px; columns: 2 260px; column-gap: 28px; font-size: 14px; }
.help-inchapter li { break-inside: avoid; padding: 1px 0; }
.help-section { padding-top: 10px; scroll-margin-top: 12px; border-radius: 4px; }
.help-section.flash { animation: help-flash 1.6s ease-out; }
@keyframes help-flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .help-section.flash { animation: none; } }
.help-section h3 { margin: 10px 0 6px; font-size: 19px; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.help-anchor { color: var(--muted); text-decoration: none; font-weight: 400; opacity: 0; }
.help-section h3:hover .help-anchor, .help-anchor:focus-visible { opacity: 1; }
.help-ed { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #DDE8DF; color: #1F4D2B; white-space: nowrap; }
.help-ed.closed { background: var(--note-bg); color: var(--note-fg); }
.help-ed.other { background: transparent; border: 1px dashed currentColor; }
.help-body { max-width: 82ch; }
.help-body > :first-child { margin-top: 0; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 10px; }
.help-body ul, .help-body ol { padding-left: 22px; }
.help-body li { margin: 3px 0; }
.help-body li > p { margin: 0 0 6px; }
.help-body li > ul, .help-body li > ol, .help-body li > pre { margin: 6px 0; }
.help-body h4 { margin: 14px 0 6px; font-size: 15px; }
.help-body pre { margin: 6px 0 12px; padding: 10px 12px; background: var(--night); color: var(--night-fg); border-radius: var(--radius); overflow-x: auto; font: 13px/1.5 var(--mono); }
.help-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
/* break-word, а не anywhere: столбец таблицы не сужается до буквы — длинный код листается */
.help-body code { overflow-wrap: break-word; }
.help-table { overflow-x: auto; margin: 4px 0 12px; }
.help-table table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.help-table th, .help-table td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; vertical-align: top; }
.help-table th { background: var(--ground); font-weight: 600; }
.help-note { background: var(--note-bg); color: var(--note-fg); border-left: 3px solid #C9902A; padding: 8px 12px; border-radius: 0 4px 4px 0; margin: 4px 0 12px; }
.help-note p { margin: 0; }
.help-pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule-soft); padding-top: 14px; margin-top: 10px; font-size: 14px; }
.help-pager a:last-child { text-align: right; }
.help-q { font-weight: 400; }
.help-results p { margin: 0; }
.help-result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.help-result { display: block; padding: 10px 12px; border-radius: 4px; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
.help-result:hover, .help-result:focus-visible { background: var(--ground); border-color: var(--rule-soft); }
.help-result-path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: 15px; }
.help-result-path b { color: var(--accent-dark); }
.help-snippet { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
mark.help-hit { background: #F6E3A8; color: inherit; padding: 0 1px; border-radius: 2px; }
.help-toc-box:not([open]) { padding-bottom: 0; }
@media (min-width: 901px) { .help-toc-box > summary { display: none; } }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-side { position: static; max-height: none; }
  .help-chapter { padding: 18px 16px 22px; }
}
@media (max-width: 720px) { .help-link { padding: 0 8px; } .help-link-q { display: none; } }

/* --- подборка по описанию: модель составляет условия и проверяет новости (selections.js) --- */
.sel-ai { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.sel-ai textarea { width: 100%; min-height: 64px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font: inherit; font-size: 16px; background: var(--surface); resize: vertical; }
.sel-ai .hint { margin: 0; }
.sel-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.sel-ai-actions .check { margin-left: 0; }
.sel-ai-badge { font: 600 10px/1.7 var(--mono); padding: 0 5px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-dark); letter-spacing: .04em; }
.sel-item.active .sel-ai-badge { background: var(--surface); }
.sel-ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.sel-ai-bar .error, #sel-ai-state.error { color: var(--down); }
.sel-pv-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tag.ai-pending { background: var(--ground); color: var(--muted); }
.tag.ai-no { background: #F6E1DD; color: var(--down); }
.tag.ai-fit { background: #DDE8DF; color: #1F4D2B; }
.hit.ai-rejected { opacity: .8; }

/* --- «Инструменты»: скачать видео (tools.js) --- */
.tool-card { gap: 12px; }
.tool-lede { margin: 0; max-width: 84ch; }
.vd-form { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-form input { flex: 1 1 320px; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #C3CAC1; border-radius: 4px; font-size: 16px; background: var(--surface); }
#vd-status:empty { display: none; }
.vd-card { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px; border: 1px solid var(--rule-soft); border-radius: 4px; }
.vd-card:not(:has(.vd-thumb)) { grid-template-columns: minmax(0, 1fr); }
.vd-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: #E8ECE6; }
.vd-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vd-title { font-weight: 600; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.vd-meta:empty { display: none; }
.vd-choose { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.vd-choose .field { display: flex; flex-direction: column; gap: 6px; }
.vd-choose select { min-height: 44px; padding: 0 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 15px var(--ui); }
.vd-choose .seg { flex-wrap: wrap; }
.seg-radio.off { opacity: .45; cursor: not-allowed; }
#vd-format-hint { margin: 0; }
.vd-list-head { margin: 0 0 6px; overflow-wrap: anywhere; }
.vd-list { list-style: none; margin: 0; padding: 0; }
.vd-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.vd-list-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.vd-jobs { display: flex; flex-direction: column; }
.vd-job { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.vd-job:last-child { border-bottom: 0; padding-bottom: 0; }
.vd-job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vd-job-title { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.vd-job .check-result { margin: 0; }
.vd-progress { display: flex; flex-direction: column; gap: 4px; }
.vd-bar { height: 8px; overflow: hidden; border-radius: 4px; background: #EDF0EA; }
.vd-bar span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.vd-done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vd-done .btn.go, .vd-done .btn.go:hover { color: #FFFFFF; }
.vd-done .muted { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .vd-card { grid-template-columns: minmax(0, 1fr); }
  .vd-choose .btn { width: 100%; }
}

/* «Инструменты»: подразделы (tools.js) — панели без своей рамки, карточки идут как на странице */
.tools-pane { display: contents; }

/* «Инструменты» → «Снимок страницы» (tools-shot.js) */
.sh-opts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 28px; }
.sh-opts .field { flex: initial; gap: 6px; }
.sh-checks .check { margin-left: 0; }
#sh-area-hint { margin: 0; }
.sh-save-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.sh-save-opts .check { margin-left: 0; }
.sh-pages { flex: initial; flex-direction: row; align-items: center; gap: 8px; }
.sh-pages select { min-height: 36px; padding: 0 8px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 14px var(--ui); }
.sh-jobs { display: flex; flex-direction: column; }
.sh-job { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.sh-job:last-child { border-bottom: 0; padding-bottom: 0; }
.sh-job:not(:has(.sh-thumb)) { grid-template-columns: minmax(0, 1fr); }
.sh-thumb { align-self: start; height: 176px; padding: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 3px; background: #EEF0EC; cursor: zoom-in; }
.sh-thumb img { display: block; width: 100%; height: auto; }
.sh-job-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sh-url { font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }
.sh-meta { font-size: 13px; }
.sh-done { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sh-done .hint, .sh-crop { margin: 0; }
.sh-crop { font-size: 13px; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-actions a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.sh-actions .btn.go, .sh-actions .btn.go:hover, .sh-v-actions .btn.go, .sh-v-actions .btn.go:hover { color: #FFFFFF; }
.sh-bar span { width: 35%; animation: sh-run 1.4s ease-in-out infinite; }
@keyframes sh-run { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .sh-bar span { width: 100%; opacity: .5; animation: none; } }
/* просмотр снимка и выделение части */
.sh-viewer { width: min(1100px, calc(100% - 24px)); height: calc(100dvh - 24px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); background: var(--surface); }
.sh-viewer[open] { display: flex; flex-direction: column; }
.sh-viewer::backdrop { background: rgba(23, 33, 43, .6); }
.sh-v-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.sh-v-titles { display: flex; flex: 1 1 300px; flex-direction: column; gap: 2px; min-width: 0; }
.sh-v-titles b { overflow-wrap: anywhere; }
.sh-v-titles .muted { font-size: 13px; }
.sh-v-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-v-body { flex: 1 1 auto; overflow: auto; padding: 12px; background: #DCE0D9; }
.sh-v-wrap { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.sh-v-wrap img { display: block; max-width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.sh-v-sel { position: absolute; border: 2px solid var(--accent); background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 9999px rgba(23, 33, 43, .35); pointer-events: none; }
.sh-v-sel.corner { border-width: 6px; border-radius: 50%; transform: translate(-6px, -6px); box-shadow: none; }
.sh-v-sel.corner .sh-v-h { display: none; }
/* края рамки: широкая зона захвата во всю сторону, видимая ручка посередине */
.sh-v-h { position: absolute; pointer-events: auto; touch-action: none; }
.sh-v-h::after { content: ""; position: absolute; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 2px #FFFFFF; }
.sh-v-h[data-edge="n"], .sh-v-h[data-edge="s"] { left: 12px; right: 12px; height: 18px; cursor: ns-resize; }
.sh-v-h[data-edge="n"] { top: -10px; }
.sh-v-h[data-edge="s"] { bottom: -10px; }
.sh-v-h[data-edge="n"]::after, .sh-v-h[data-edge="s"]::after { left: 50%; top: 6px; width: 44px; height: 6px; margin-left: -22px; }
.sh-v-h[data-edge="w"], .sh-v-h[data-edge="e"] { top: 12px; bottom: 12px; width: 18px; cursor: ew-resize; }
.sh-v-h[data-edge="w"] { left: -10px; }
.sh-v-h[data-edge="e"] { right: -10px; }
.sh-v-h[data-edge="w"]::after, .sh-v-h[data-edge="e"]::after { top: 50%; left: 6px; width: 6px; height: 44px; margin-top: -22px; }
.sh-v-h[data-edge="se"] { right: -12px; bottom: -12px; width: 24px; height: 24px; cursor: nwse-resize; }
.sh-v-h[data-edge="se"]::after { inset: 6px; border-radius: 50%; }
@media (max-width: 640px) {
  .sh-job { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .sh-thumb { height: 112px; }
  .sh-opts .seg-radio { padding: 0 12px; }
  .sh-viewer { width: 100%; height: 100dvh; border-radius: 0; }
}

/* ===== Календарь событий (calendar.js) — по образцу календаря Peter's World ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cal { --k-summit: #8E2A2A; --k-summit-bg: #F6E3E1; --k-bilateral: #1E4E8C; --k-bilateral-bg: #E2ECF8;
  --k-multilateral: #145A5A; --k-multilateral-bg: #DDF0EE; --k-election: #6A3D8F; --k-election-bg: #EDE4F5;
  --k-exercise: #5B5313; --k-exercise-bg: #F1EDCF; --k-defense: #7A4A12; --k-defense-bg: #F6E8D6;
  --k-anniv: #46525E; --k-anniv-bg: #E7EAED; --k-official: #2D5A2E; --k-official-bg: #E2F0E0;
  --k-f250: #8C2D52; --k-f250-bg: #F6E1EA; --k-other: #46525E; --k-other-bg: #ECEEEA; }
.cal-k-summit { --pf: var(--k-summit); --pb: var(--k-summit-bg); }
.cal-k-bilateral { --pf: var(--k-bilateral); --pb: var(--k-bilateral-bg); }
.cal-k-multilateral { --pf: var(--k-multilateral); --pb: var(--k-multilateral-bg); }
.cal-k-election { --pf: var(--k-election); --pb: var(--k-election-bg); }
.cal-k-exercise { --pf: var(--k-exercise); --pb: var(--k-exercise-bg); }
.cal-k-defense { --pf: var(--k-defense); --pb: var(--k-defense-bg); }
.cal-k-anniv { --pf: var(--k-anniv); --pb: var(--k-anniv-bg); }
.cal-k-official { --pf: var(--k-official); --pb: var(--k-official-bg); }
.cal-k-f250 { --pf: var(--k-f250); --pb: var(--k-f250-bg); }
.cal-k-other { --pf: var(--k-other); --pb: var(--k-other-bg); }

.cal-hero { background: var(--night); color: var(--night-fg); border-color: var(--night); padding: 26px 28px 22px; gap: 12px; }
.cal-eye { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 13px; }
.cal-hero .muted { color: var(--night-muted); }
.cal-tag { padding: 2px 10px; border-radius: 999px; background: var(--cta); color: var(--night); font-weight: 700; letter-spacing: .03em; }
.cal-title { margin: 0; font-family: var(--doc); font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; color: #FFFFFF; }
.cal-lead { margin: 0; max-width: 78ch; color: var(--night-fg); opacity: .92; }
.cal-stats { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cal-stats li { padding: 12px 14px; border: 1px solid var(--night-line); border-radius: var(--radius); background: var(--night-2); display: flex; flex-direction: column; gap: 2px; }
.cal-stats b { font-size: 30px; line-height: 1.1; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.cal-stats span { font-size: 13px; color: var(--night-muted); }
.cal-stats li.hot { border-color: var(--cta); }
.cal-stats li.hot b { color: var(--cta); }
.cal-jump { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cal-jump a { display: inline-block; padding: 4px 11px; border: 1px solid var(--night-line); border-radius: 999px; color: var(--night-fg); font-size: 13px; text-decoration: none; }
.cal-jump a:hover { border-color: var(--night-fg); }
.cal-jump a.hot { background: var(--cta); border-color: var(--cta); color: var(--night); font-weight: 600; }
.cal-hero .hint.warn, .cal-hero .check-result { margin: 0; }

.cal-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cal-card { display: flex; gap: 12px; height: 100%; padding: 12px; border: 1px solid var(--rule); border-left: 4px solid var(--pf); border-radius: var(--radius); color: var(--ink); text-decoration: none; background: var(--surface); }
.cal-card:hover { box-shadow: 0 2px 8px rgba(23, 33, 43, .1); }
.cal-card-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-card-rel { font-size: 12px; font-weight: 700; color: var(--down); text-transform: uppercase; letter-spacing: .04em; }
.cal-card-rel:empty { display: none; }
.cal-card-t { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cal-card-l { font-size: 13px; color: var(--muted); }
.cal-card .cal-pill { align-self: flex-start; }

.cal-tile { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 50px; border-radius: 6px; background: var(--night); color: #FFFFFF; line-height: 1; }
.cal-tile i { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--cta); }
.cal-tile b { font-size: 20px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.cal-tile.month b { color: var(--night-muted); }
.cal-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--pb); color: var(--pf); font-size: 12px; font-weight: 700; line-height: 1.4; }

.cal-cats { gap: 6px; }
.cal-cat { border-color: transparent; background: var(--pb); color: var(--pf); }
.cal-cat[aria-pressed="true"] { background: var(--pf); border-color: var(--pf); color: #FFFFFF; }
.cal-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.cal-f { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 0; }
.cal-f-q { flex: 2 1 260px; }
.cal-f input, .cal-f select { min-height: 38px; padding: 0 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 14px var(--ui); min-width: 0; }
.cal-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.cal-count { margin: 0; font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-dot.now { background: var(--down); }
.cal-dot.tent { background: #D9A441; }
.cal-dot.off { background: #2E8B73; }

.cal-table { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 240px 170px 190px; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--rule-soft); align-items: start; }
.cal-head { padding-top: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 2px solid var(--rule); }
.cal-group { display: flex; flex-direction: column; }
.cal-gh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 18px 0 0; padding: 8px 10px; background: var(--ground); border-radius: 4px; font-size: 16px; }
.cal-gn { font-size: 13px; font-weight: 500; color: var(--muted); }
.cal-group.past .cal-gh { color: var(--muted); }
.cal-row.now { box-shadow: inset 4px 0 0 var(--down); background: #FCF6F4; }
.cal-row.past { color: var(--muted); }
.cal-row.past .cal-tile { filter: grayscale(1); opacity: .65; }
.cal-row.past .cal-pill { filter: saturate(.4); }
.cal-row.flash { animation: cal-flash 2.2s ease-out; }
@keyframes cal-flash { from { background: #FFF2C6; } to { background: transparent; } }
.cal-c-date { display: flex; gap: 10px; align-items: flex-start; }
.cal-when { display: flex; flex-direction: column; gap: 3px; font-weight: 600; font-size: 14px; }
.cal-rel { font-size: 12px; font-weight: 700; color: var(--down); }
.cal-row.past .cal-rel { color: var(--muted); font-weight: 500; }
.cal-b { align-self: flex-start; font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.cal-b.new { background: var(--accent-soft); color: var(--accent); }
.cal-b.tent { background: #FBEFD5; color: #7A5410; }
.cal-et { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.cal-untr { display: block; margin-top: 4px; font-size: 12px; color: var(--note-fg); }
.cal-c-loc { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cal-regions { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-rg { border: 0; padding: 1px 8px; border-radius: 4px; background: var(--note-bg); color: var(--note-fg); font: 700 11px var(--ui); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-chip { min-height: 24px; padding: 1px 9px; border: 1px solid var(--rule); border-radius: 999px; background: #F6F7F4; color: var(--ink-2); font: 600 12px var(--ui); cursor: pointer; }
.cal-chip:hover, .cal-rg:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.cal-chip.more { cursor: default; }
.cal-chip.more:hover { background: #F6F7F4; color: var(--ink-2); border-color: var(--rule); }
.cal-c-src { display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.cal-c-src a { color: var(--accent); font-weight: 600; }
.cal-off { align-self: flex-start; padding: 0 6px; border-radius: 4px; background: #D5F0EA; color: #0B4A3E; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cal-via { font-size: 12px; color: var(--muted); }
.cal-empty { padding: 32px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.cal-empty span { color: var(--muted); }

.cal-src-lede { margin: 0; max-width: 90ch; }
.cal-src-list { display: flex; flex-direction: column; }
.cal-src-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.cal-src-item.off { opacity: .6; }
.cal-src-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cal-src-name { font-weight: 600; color: var(--ink); }
.cal-src-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.cal-src-meta .chip-dot { max-width: 100%; overflow-wrap: anywhere; }
.cal-src-comment { margin: 0; font-size: 13px; color: var(--ink-2); }
.cal-src-btns { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.linkbtn.danger { color: var(--down); }
.cal-src-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: #FAFBF8; }
.cal-src-form h3 { margin: 0; font-size: 15px; }
.cal-src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.cal-src-grid .field { flex: initial; gap: 4px; }
.cal-src-grid input, .cal-src-grid select { min-height: 40px; padding: 0 10px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: 15px var(--ui); min-width: 0; }
.cal-s-wide { grid-column: 1 / -1; }
.cal-src-form .check { margin-left: 0; }
.cal-src-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-src-actions .btn.go, .cal-src-actions .btn.go:hover { color: #FFFFFF; }
.cal-src-sample { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
#cal-src-add { align-self: flex-start; }

@media (max-width: 1100px) {
  .cal-row { grid-template-columns: 170px minmax(0, 1fr) 200px 150px; }
  .cal-row > .cal-c-src { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .cal-head > span:last-child { display: none; }
}
@media (max-width: 760px) {
  .cal-hero { padding: 20px 16px 16px; }
  .cal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cal-stats b { font-size: 24px; }
  .cal-head { display: none; }
  .cal-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 4px; }
  .cal-row > .cal-c-src { grid-column: auto; }
  .cal-c-loc { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-src-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-f { flex-basis: 140px; }
  .cal-f input, .cal-f select { font-size: 16px; min-height: 44px; }
}

/* --- уведомления (notify.js): колокольчик в шапке, панель, всплывающие окна, страница --- */
.nf-bell-wrap { position: relative; }
.nf-bell { position: relative; display: inline-grid; place-items: center; width: 40px; min-height: 36px; padding: 0; border: 1px solid var(--night-line); border-radius: 4px; background: transparent; color: var(--night-fg); font-size: 17px; line-height: 1; }
.nf-bell:hover { border-color: var(--night-muted); }
.nf-bell[aria-expanded="true"], .nf-bell[aria-current="true"] { background: #2C3946; }
.nf-badge { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #FFFFFF; border: 2px solid var(--night); font: 600 11px/15px var(--ui); text-align: center; }
.nf-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; width: 380px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(23, 33, 43, .18); display: flex; flex-direction: column; }
.nf-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.nf-panel-head .linkbtn { font-size: 13px; }
.nf-panel-list { list-style: none; margin: 0; padding: 0; max-height: min(420px, 60vh); overflow: auto; }
.nf-panel-list li + li { border-top: 1px solid var(--rule-soft); }
.nf-panel-item, .nf-toast-main { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.nf-panel-item:hover { background: #F4F6F2; }
.nf-panel-item.unread { background: var(--accent-soft); }
.nf-panel-item.unread:hover { background: #D5DFEB; }
.nf-panel-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-title { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.nf-body { font-size: 13px; color: var(--ink-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.nf-when { font-size: 12px; color: var(--muted); }
.nf-ico { flex: none; width: 22px; text-align: center; font-size: 15px; line-height: 1.35; }
.lvl-urgent .nf-ico { color: var(--down); }
.lvl-warn .nf-ico { color: var(--star); }
.lvl-ok .nf-ico { color: var(--up); font-weight: 700; }
.nf-none { margin: 0; padding: 16px 14px; font-size: 14px; }
.nf-panel-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--rule-soft); font-size: 14px; }

.nf-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.nf-toast { position: relative; display: flex; align-items: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(23, 33, 43, .22); pointer-events: auto; animation: nf-in .2s ease-out; }
.nf-toast.lvl-urgent { border-left-color: var(--down); }
.nf-toast.lvl-warn { border-left-color: var(--star); }
.nf-toast.lvl-ok { border-left-color: var(--up); }
.nf-toast-main { padding-right: 4px; }
.nf-toast-x { flex: none; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.nf-toast-x:hover { color: var(--ink); }
@keyframes nf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nf-toast { animation: none; } }

#notify-page .seg { align-self: flex-start; }
.nf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); }
.nf-tools .chips { flex: 1 1 320px; }
.nf-list { display: flex; flex-direction: column; }
.nf-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
.nf-item.unread { background: var(--accent-soft); }
.nf-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nf-item-title { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--ink); font: 600 15px/1.4 var(--ui); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.nf-item-title:hover { color: var(--accent); text-decoration: underline; }
.nf-item-body { margin: 0; font-size: 14px; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.nf-mark { flex: none; font-size: 13px; }
#nf-pager:not(:empty) { padding: 12px 16px; }
.nf-subs { display: flex; flex-direction: column; }
.nf-sub { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-bottom: 1px solid var(--rule-soft); }
.nf-sub:last-child { border-bottom: 0; }
.nf-sub h2 { margin: 0; font-size: 17px; }
.nf-hint { margin: -4px 0 0; font-size: 13px; }
.nf-sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nf-sub-row > .label { flex: 0 0 180px; }
.nf-sub-row.off { opacity: .55; }
.nf-sel-list { display: flex; flex-direction: column; }
.nf-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.nf-sel:first-child { border-top: 0; }
.nf-sel .check { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.nf-sel select { min-height: 36px; padding: 4px 8px; border: 1px solid #C3CAC1; border-radius: 4px; background: var(--surface); font: inherit; font-size: 14px; }
.nf-sel select:disabled { opacity: .55; }
.nf-sub-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: #C9D3E0; color: var(--accent-dark); }
@media (max-width: 720px) {
  .nf-bell { width: 36px; }
  .nf-sub-row > .label { flex-basis: 100%; }
  .nf-toasts { right: 8px; left: 8px; width: auto; max-width: none; bottom: 8px; }
  .nf-panel { position: fixed; left: 8px; right: 8px; top: 56px; width: auto; max-width: none; }
}
#adm-mx-sources .card-tools { flex-wrap: wrap; justify-content: flex-end; }
.nf-sub .check { margin-left: 0; }
.nf-sub > .check, .nf-sub > .btn { align-self: flex-start; }
.nf-sub-btn { white-space: nowrap; }
.sel-head .card-tools { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.nf-sub .check input, .nf-tools .check input { flex: none; }

/* кто говорит (official.py): руководство страны, официально, мнение, аналитика, СМИ */
.tag.who { font-size: 11.5px; }
.tag.who-lead { background: #E1E8F1; color: var(--accent-dark); border-color: #C9D3E0; font-weight: 600; }
.tag.who-official { background: #EEF3F9; color: var(--accent); border-color: #C9D3E0; }
.tag.who-opinion, .tag.who-analysis { background: var(--note-bg); color: var(--note-fg); border-color: #E8DCC2; }
.tag.who-media { background: #F1F2EF; color: var(--muted); border-color: var(--rule); }
