/* impaper trend — слой поверх ledger.css.
   ledger.css — это style.css из sborka без изменений (шапка, панели, чипы,
   кнопки, таблицы, темы, анимации), поэтому оба сервиса читаются как один
   продукт. Здесь только то, чего в sborka нет: графики, карточка темы,
   списки «что делать», и привязка старых классов trend к языку sborka. */

:root {
  --font: "Onest", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: var(--font-mono);
  --hover: var(--overlay-hover);
  --chart-a: var(--chart-qr);
  --chart-b: var(--chart-manual);
  --ease: cubic-bezier(.22, .85, .3, 1);
}

[hidden] { display: none !important; }
.up { color: var(--good); } .dn { color: var(--critical); }
.ico { width: 16px; height: 16px; flex: none; }

/* ---- шапка ---------------------------------------------------------- */
.brand-sub { font-weight: 650; color: var(--accent); font-size: 14px; margin-left: -3px; }
nav a.tr-nav { display: inline-flex; align-items: center; gap: 6px; }
nav a.tr-nav .ico { width: 15px; height: 15px; opacity: .8; }
nav a.tr-nav.active .ico { opacity: 1; }
.tr-count {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-full);
  background: var(--accent); color: var(--accent-ink); line-height: 1.4;
}
a.status-pill { text-decoration: none; }
a.status-pill:hover { border-color: var(--rule-strong); }
.status-pill-word { color: var(--ink-muted); }
.user-who.tr-ver { border: 0; border-top: 1px solid var(--rule); margin: 4px 0 0; padding: 8px 10px 4px; font-size: 11px; color: var(--ink-faint); }
/* Шапка держится в одну строку: сначала уходят второстепенные подписи,
   потом иконки пунктов; ниже ~1200px она переносится, как в sborka. */
@media (max-width: 1720px) { .status-pill-opt { display: none; } }
@media (max-width: 1620px) { .user-name { display: none; } }
@media (max-width: 1520px) { .brand-sub { display: none; } nav a.tr-nav { padding: 7px 8px; gap: 5px; } .topbar-inner { gap: 10px 14px; } }
@media (max-width: 1400px) { .tr .status-pill .status-pill-word { display: none; } }
@media (max-width: 1340px) { nav a.tr-nav .ico { display: none; } }

/* ---- страница ------------------------------------------------------- */
.tr-page { display: grid; gap: 18px; align-content: start; padding-top: 24px; }
.tr-page > .banner { margin: 0; }
.tr-alert { display: flex; align-items: center; gap: 10px; }
.tr-alert .ico { width: 18px; height: 18px; }

/* Заголовок страницы: старая .bar trend получает вид .page-head sborka. */
.bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.bar h1 { font-size: 27px; font-weight: 800; letter-spacing: -.012em; line-height: 1.15; margin: 0 8px 0 0; display: flex; align-items: center; gap: 10px; }
.bar h1 .ico { width: 24px; height: 24px; color: var(--accent); }
.bar .hint { margin: 0 0 0 auto; font-size: 12.5px; color: var(--ink-faint); }
.pane.page { padding: 0; margin: 0; max-width: none; display: grid; gap: 18px; align-content: start; }
p.lead { margin: 0; color: var(--ink-muted); font-size: 14px; max-width: 86ch; line-height: 1.55; }

/* ---- панели --------------------------------------------------------- */
/* В sborka .card — узкая форма входа (padding 22px, max-width 460px); здесь
   это панель во всю ширину колонки. */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); overflow-x: auto; min-width: 0; padding: 0; max-width: none;
}
.card > h2, .card > .card-head {
  display: flex; align-items: center; gap: 8px; margin: 0; min-height: 42px; padding: 10px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--rule);
  font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; color: var(--ink);
}
.card > h2 .ico { width: 17px; height: 17px; color: var(--accent); }
.card > h2.tone-good .ico { color: var(--good); }
.card > h2.tone-warn .ico { color: var(--warn); }
.card > h2.tone-crit .ico { color: var(--critical); }
.card > h2 small {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-muted);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-full); padding: 1px 8px;
}
.card-note { margin: 0; padding: 10px 16px 4px; color: var(--ink-muted); font-size: 12.5px; line-height: 1.5; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; align-items: start; }

/* Строка «что делать»: как строка магазина в sborka — плотная, со своим
   значком состояния и выезжает при загрузке. */
.todo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: background 120ms ease;
}
.card-note + .todo, h2 + .todo { border-top: 0; }
.todo:hover { background: var(--overlay-hover); }
.todo:hover .todo-main b { color: var(--accent); }
.todo-main { min-width: 0; display: grid; gap: 2px; }
.todo-main b { font-weight: 650; font-size: 14px; transition: color 120ms ease; }
.todo-main small { color: var(--ink-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.todo-num { text-align: right; display: grid; gap: 2px; justify-items: end; }
.todo-num b { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.todo-num small { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }
.more {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--rule);
  font-size: 12.5px; font-weight: 650; color: var(--accent); text-decoration: none;
}
.more:hover { background: var(--accent-soft); }
.more::after { content: ""; width: 7px; height: 7px; border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor; transform: rotate(45deg); transition: transform 140ms ease; }
.more:hover::after { transform: translateX(3px) rotate(45deg); }

/* Пустое состояние: внутри панели — тихая строка, а не пунктирная рамка. */
.card .empty, td.empty { border: 0; background: none; text-align: left; padding: 14px 16px; margin: 0; color: var(--ink-muted); font-size: 13px; border-radius: 0; }

/* ---- сводка (плитки-фильтры) ---------------------------------------- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden;
}
.tiles button, .tiles .tile, .tiles a {
  position: relative; text-align: left; background: transparent; border: 0; border-left: 1px solid var(--rule);
  padding: 13px 18px; min-width: 0; font: inherit; color: inherit; text-decoration: none; cursor: pointer;
  transition: background 130ms ease;
}
.tiles > :first-child { border-left: 0; }
.tiles button:hover, .tiles a:hover { background: var(--overlay-hover); }
.tiles button::after, .tiles a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease);
}
.tiles button[aria-pressed="true"], .tiles a.on { background: var(--accent-soft); }
.tiles button[aria-pressed="true"]::after, .tiles a.on::after { transform: scaleX(1); }
.tiles .k { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--ink-muted); }
.tiles .k .ico { width: 14px; height: 14px; }
.tiles .v { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.tiles .s { display: block; font-size: 11.5px; color: var(--ink-faint); line-height: 1.35; margin-top: 2px; }

/* ---- переключатели: сегменты sborka --------------------------------- */
.pills, nav.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--rule);
  border-radius: var(--r-sm); background: var(--surface-2);
}
.pills button, a.pill {
  padding: 5px 10px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink-muted); text-decoration: none;
  transition: background 130ms ease, color 130ms ease, box-shadow 130ms ease;
}
.pills button:hover, a.pill:hover { color: var(--ink); }
.pills button[aria-pressed="true"], a.pill.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.search {
  flex: 1 1 220px; max-width: 320px; min-width: 0; font-size: 13.5px; border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M11 4a7 7 0 100 14 7 7 0 000-14zM21 21l-5-5'/%3E%3C/svg%3E") no-repeat 10px center / 15px;
  padding: 7px 10px 7px 32px; color: var(--ink); font-family: inherit;
}
.search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- таблицы -------------------------------------------------------- */
.card table { font-size: 13px; }
.card thead th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }
thead th.srt { cursor: pointer; user-select: none; }
thead th.srt:hover { color: var(--ink); }
thead th[aria-sort] { color: var(--accent); }
thead th[aria-sort="descending"]::after { content: " ↓"; } thead th[aria-sort="ascending"]::after { content: " ↑"; }
td.r, th.r { text-align: right; }
td { background: var(--surface); }
tbody tr.sel { cursor: pointer; }
tbody tr.sel:hover td { background: var(--overlay-hover); }
tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.nm { font-weight: 650; }
.nm a { color: var(--ink); text-decoration: none; }
.nm a:hover { color: var(--accent); text-decoration: underline; }
td small { display: block; color: var(--ink-muted); font-size: 11.5px; font-weight: 400; margin-top: 1px; }
td .chip + small { margin-top: 3px; }
.chip:not(.good):not(.warn):not(.crit):not(.accent):not(.wb):not(.ozon):not(.yandex):not(.fb):not(.ok) { background: var(--surface-2); color: var(--ink-muted); }
.chip.tag { text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--rule); background: var(--surface); }

/* ---- кнопки: старые классы trend в виде кнопок sborka ---------------- */
.btn.ghost, .btn.small {
  background: var(--surface); color: var(--ink-muted); border: 1px solid var(--rule-strong);
  padding: 6px 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--ink); background: var(--surface); }
.btn.ghost.small { padding: 5px 10px; }
.btn.ghost[name="status"][value="work"]:hover { border-color: var(--good); color: var(--good); background: var(--good-soft); }
form.inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
td form.inline { flex-wrap: nowrap; justify-content: flex-end; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.note { font-size: 12.5px; color: var(--ink-muted); margin: 0; }
.err { color: var(--critical); font-size: 13px; } .ok { color: var(--good); font-size: 13px; }

/* ---- «Наши темы»: таблица и карточка рядом -------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; align-items: start; }
.tablepane { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: auto; max-height: calc(100vh - 250px); min-height: 360px; }
.tablepane:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tablepane table td.r, .tablepane table td .chip { white-space: nowrap; }
.tablepane th, .tablepane td { padding-left: 10px; padding-right: 10px; }
.tablepane thead th { position: sticky; top: 0; z-index: 2; }
.detail {
  position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  padding: 18px; display: flex; flex-direction: column; gap: 16px;
}
.detail h2 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin: 0 0 6px; text-wrap: balance; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.verdict { margin: 0; padding: 11px 13px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent); font-size: 13.5px; line-height: 1.5; }
/* В sborka .lbl — наклейка 58×40 мм; здесь подпись блока. */
.lbl { width: auto; height: auto; box-sizing: border-box; padding: 0; border: 0; background: none; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink-muted); margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { background: var(--surface-2); border-radius: var(--r-sm); padding: 9px 11px; min-width: 0; border: 1px solid var(--rule); }
.facts b { display: block; font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.facts span { font-size: 11.5px; color: var(--ink-muted); line-height: 1.35; display: block; }
.spark { width: 84px; height: 26px; display: block; overflow: visible; }
.spark path.l { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark path.a { fill: var(--accent-soft); } .spark circle { fill: var(--accent); }
.barcell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.barcell i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.barcell i b { display: block; height: 100%; background: var(--accent); border-radius: 3px; transform-origin: left; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 14px; font-size: 13px; }
.kv .h { font-size: 11px; font-weight: 650; color: var(--ink-faint); }
.kv .v { font-family: var(--font-mono); text-align: right; }
.kv .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv2 { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; }
.kv2 span { color: var(--ink-muted); } .kv2 b { font-weight: 500; overflow-wrap: anywhere; }
ul.why { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-muted); }
ul.why li::marker { color: var(--accent); }

/* ---- графики -------------------------------------------------------- */
.chartbox { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .g { stroke: var(--rule); } .chart text { fill: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; }
.chart .la { fill: none; stroke: var(--chart-a); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .lb { fill: none; stroke: var(--chart-b); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .fa { fill: var(--chart-a); opacity: .12; } .chart .fb { fill: var(--chart-b); opacity: .12; }
.chart .pa { fill: var(--chart-a); stroke: var(--surface); stroke-width: 2; } .chart .pb { fill: var(--chart-b); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--rule-strong); stroke-dasharray: 3 3; }
.chart .lproj { fill: none; stroke: var(--chart-a); stroke-width: 2; stroke-dasharray: 6 5; opacity: .7; }
.chart .m-launch { stroke: var(--warn); fill: var(--warn); stroke-dasharray: 3 3; }
.chart .m-rise { stroke: var(--chart-b); fill: var(--chart-b); stroke-dasharray: 3 3; }
.chart .m-peak { stroke: var(--critical); fill: var(--critical); stroke-dasharray: 3 3; }
.chart text.m-launch, .chart text.m-rise, .chart text.m-peak { stroke: none; font-family: var(--font); font-size: 11px; font-weight: 600; }
.chart .m-today { stroke: var(--ink-faint); stroke-width: 1.5; }
.chart .m-todaytext { fill: var(--ink-muted); font-family: var(--font); font-size: 11px; }
.chart.wide { width: 100%; height: auto; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-2); padding: 6px 9px; font-size: 12px; white-space: nowrap; z-index: 3; }
.tip b { font-family: var(--font-mono); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { background: none; border-top: 2px dashed var(--chart-a); height: 0; }

/* ---- «как читать» --------------------------------------------------- */
details.how { margin: 0; font-size: 13px; color: var(--ink-muted); }
.tablepane details.how { margin: 10px 14px; }
details.how summary { cursor: pointer; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
details.how summary::-webkit-details-marker { display: none; }
details.how summary::before { content: "?"; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }
details.how ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 5px; max-width: 95ch; }
details.how.card-like { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-1); }

/* ---- поводы и интеграции -------------------------------------------- */
h2.plain { border: 0; padding: 0; font-size: 17px; font-weight: 750; margin: 0 0 2px; background: none; min-height: 0; }
.event, .integ { overflow: visible; }
.event-head, .integ-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule); background: var(--surface-2); border-radius: var(--r-md) var(--r-md) 0 0; }
.event-head .muted, .integ-head .muted { font-size: 13px; }
.event-body, .integ-body { padding: 16px; display: grid; gap: 12px; }
.integ-body p { margin: 0; }
.integ-body details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.event-dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.event-dates div { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 9px 11px; display: grid; gap: 2px; min-width: 0; }
.event-dates span { font-size: 11.5px; color: var(--ink-muted); }
.event-dates b { font-family: var(--font-mono); font-size: 16px; }
.event-dates small { font-size: 11.5px; color: var(--ink-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
a.tag { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-full); padding: 4px 11px; font-size: 12.5px; background: var(--surface); transition: border-color 120ms ease, background 120ms ease; }
a.tag:hover { border-color: var(--accent); background: var(--accent-soft); }
.thumb { width: 36px; height: 36px; object-fit: cover; border-radius: var(--r-sm); vertical-align: middle; margin-right: 8px; }
.quote { margin: 0; font-size: 15px; }
.inline-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-muted); }
.inline-label select { border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--surface); padding: 5px 8px; max-width: 220px; font: inherit; color: var(--ink); }

/* ---- формы ---------------------------------------------------------- */
.formcard { max-width: 820px; }
.formbody { padding: 14px 16px; display: grid; gap: 12px; }
.formbody.row { grid-template-columns: minmax(0, 1fr) 200px auto; align-items: end; }
.formbody label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-muted); min-width: 0; }
.formbody input, .formbody select, form.inline select, .copyrow input {
  font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 400; border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-family: inherit; padding: 8px 10px; min-width: 0; transition: border-color 120ms ease;
}
.formbody input:hover, .formbody select:hover { border-color: var(--accent); }
.formbody input:focus-visible, .formbody select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.formnote { margin: 0; padding: 0 16px 14px; }
.formbody.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .formbody.grid3 { grid-template-columns: 2fr 1fr 1.4fr; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-family: var(--font-mono); font-size: 12.5px; }
ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 6px 16px 14px; display: grid; gap: 4px; }
ol.steps > li { counter-increment: step; position: relative; padding: 10px 0 10px 40px; border-top: 1px solid var(--rule); color: var(--ink-muted); }
ol.steps > li:first-child { border-top: 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
ol.steps > li b { color: var(--ink); }
ol.steps .formbody { padding: 10px 0 0; }
ol.steps code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.banner.tr-box { display: grid; gap: 8px; max-width: 820px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 26px; display: grid; gap: 12px; }
.login label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); }
.login input { font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 9px 11px; font-family: inherit; }
.login input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .err { color: var(--critical); font-size: 13px; }

/* ---- движение: одна последовательность при загрузке ------------------ */
@keyframes trRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes trGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trDraw { from { stroke-dashoffset: var(--len, 1200); } to { stroke-dashoffset: 0; } }
@keyframes trFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes trFadeArea { from { opacity: 0; } to { opacity: .12; } }
@media (prefers-reduced-motion: no-preference) {
  .tr-page > .bar, .tr-page > .tiles, .tr-page > .split, .pane.page > *, .cols > .card {
    animation: trRise 360ms var(--ease) both;
  }
  .tr-page > .tiles { animation-delay: 40ms; }
  .tr-page > .split, .pane.page > :nth-child(2) { animation-delay: 80ms; }
  .pane.page > :nth-child(3) { animation-delay: 120ms; }
  .cols > .card:nth-child(2) { animation-delay: 60ms; }
  .cols > .card:nth-child(3) { animation-delay: 100ms; }
  .cols > .card:nth-child(4) { animation-delay: 140ms; }
  .cols > .card:nth-child(n+5) { animation-delay: 180ms; }
  .todo { animation: rowIn 280ms var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 30ms); }
  .tr-rows tbody tr, #rows.enter tr { animation: rowIn 260ms var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
  .barcell i b { animation: trGrow 600ms var(--ease) both; }
  .spark path.l { stroke-dasharray: 300; animation: trDraw 900ms ease-out both; --len: 300; }
  .spark path.a { animation: trFade 700ms ease-out both; }
  .detail.swap > * { animation: trRise 260ms var(--ease) both; }
  .detail.swap > :nth-child(2) { animation-delay: 30ms; }
  .detail.swap > :nth-child(3) { animation-delay: 60ms; }
  .detail.swap > :nth-child(n+4) { animation-delay: 90ms; }
  .chart path.la, .chart path.lb { stroke-dasharray: 2400; animation: trDraw 900ms ease-out both; --len: 2400; }
  .chart path.fa, .chart path.fb { animation: trFadeArea 700ms ease-out both; }
  .event-dates div { animation: trRise 320ms var(--ease) both; }
  .event-dates div:nth-child(2) { animation-delay: 40ms; } .event-dates div:nth-child(3) { animation-delay: 80ms; } .event-dates div:nth-child(4) { animation-delay: 120ms; }
}

/* ---- узкие экраны --------------------------------------------------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .tablepane { max-height: none; }
  .detail { position: static; max-height: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > * { border-top: 1px solid var(--rule); }
}
@media (max-width: 800px) { .event-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .formbody.row, .formbody.grid2, .formbody.grid3 { grid-template-columns: minmax(0, 1fr); }
  .bar h1 { font-size: 22px; }
  .bar .hint { margin-left: 0; width: 100%; }
}
.tr-page { overflow-x: clip; }
/* В sborka подписи в плашке прячутся на узких экранах; здесь «в работе» без
   подписи читалось бы как «0 чего?», поэтому подпись остаётся. */
.tr .status-pill .status-pill-word { display: inline; }
@media (max-width: 480px) { .tr .status-pill .status-pill-opt { display: none; } }

/* ---- «Что делать»: план действий ------------------------------------
   Каждое дело — карточка с одинаковым скелетом: метка источника и срок,
   предмет (тема), что сделать одной фразой, «Почему» цифрами, «Что сделать»
   шагами, куда нажать. Одинаковый скелет и даёт читаемость. */
.plan-h { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.012em; }
.plan-h .ico { width: 20px; height: 20px; color: var(--accent); }
.plan-h small { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-muted); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-full); padding: 1px 9px; }
#week .plan-h .ico { color: var(--critical); }
#ahead .plan-h .ico { color: var(--warn); }
.plan-sec { display: grid; gap: 12px; scroll-margin-top: 70px; }
.plan-sec-head { display: grid; gap: 3px; }
.plan-lead { display: grid; gap: 12px; }
.plan-more { padding-left: 2px; }
.plan-empty { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); color: var(--ink-muted); font-size: 13.5px; }
.plan-empty .ico { color: var(--good); width: 18px; height: 18px; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); gap: 14px; align-items: start; }

.act {
  --tone: var(--accent);
  position: relative; display: grid; gap: 10px; padding: 16px 18px 14px 21px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  transition: box-shadow 160ms ease, transform 160ms ease, opacity 300ms ease;
}
.act::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tone); }
.act:hover { box-shadow: var(--shadow-2); }
.act.tone-good { --tone: var(--good); } .act.tone-warn { --tone: var(--warn); }
.act.tone-neutral { --tone: var(--ink-faint); } .act.is-overdue { --tone: var(--critical); }
.act.is-lead { padding: 20px 22px 16px 26px; border-color: color-mix(in srgb, var(--tone) 40%, var(--rule)); box-shadow: var(--shadow-2); }
.act.is-lead::before { width: 5px; }
.act.is-lead .act-subject { font-size: 25px; }
.act.is-done { opacity: 0; transform: scale(.98); }
.act-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-badge .ico { width: 12px; height: 12px; }
.act-due { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-muted); }
.act-due .ico { width: 14px; height: 14px; }
.act-due b { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.act-due small { color: var(--ink-faint); font-size: 12px; }
.act-due.warn b, .act-due.warn .ico { color: var(--warn); }
.act-due.crit { color: var(--critical); background: var(--critical-soft); border-radius: var(--r-full); padding: 3px 10px; }
.act-due.crit b, .act-due.crit small { color: var(--critical); }
.act-subject { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; overflow-wrap: anywhere; }
.act-verb { margin: -4px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.act-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; padding-top: 10px; border-top: 1px solid var(--rule); }
.act-lbl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); margin-bottom: 5px; }
.act-lbl .ico { width: 13px; height: 13px; }
.act-why, .act-steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.act-why li::marker { color: var(--tone); }
.act-steps { color: var(--ink); }
.act-steps li::marker { font-family: var(--font-mono); font-weight: 700; color: var(--tone); }
.act-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--rule); }
.act-links, .act-decide { display: flex; gap: 6px; flex-wrap: wrap; }
.act-foot .btn-line, .act-foot .btn-ghost { font-size: 12px; padding: 6px 11px; }
.plan-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r-full); box-shadow: var(--shadow-3);
  font-size: 13.5px; font-weight: 600; transition: opacity 220ms ease, transform 260ms var(--ease); max-width: calc(100vw - 32px);
}
.plan-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) {
  .act-grid > .act { animation: rowIn 300ms var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 35ms); }
  .plan-lead .act { animation: trRise 420ms var(--ease) both; }
  .act.is-overdue .act-due.crit { animation: pillPulseCrit 2.4s ease-out infinite; }
}
@keyframes pillPulseCrit { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--critical) 35%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (max-width: 700px) {
  .act-body { grid-template-columns: minmax(0, 1fr); }
  .act { padding: 14px 14px 12px 18px; }
}

/* ---- макеты «Что делать» (A список+карточка, B календарь, C сводка) ---- */
.mk-spark { display: block; overflow: visible; }
.mk-spark .l { fill: none; stroke: var(--chart-a); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.mk-spark .a { fill: var(--chart-a); opacity: .12; }
.mk-spark circle { fill: var(--chart-a); }
.mk-spark.tone-good .l { stroke: var(--good); } .mk-spark.tone-good .a, .mk-spark.tone-good circle { fill: var(--good); }
.mk-spark.tone-warn .l { stroke: var(--warn); } .mk-spark.tone-warn .a, .mk-spark.tone-warn circle { fill: var(--warn); }
.mk-spark-none { display: block; width: 84px; height: 2px; background: var(--rule); border-radius: 2px; }
.mk-pair { display: inline-flex; align-items: flex-end; gap: 4px; height: 30px; }
.mk-pair i { width: 12px; background: var(--rule-strong); border-radius: 3px 3px 0 0; min-height: 2px; }
.mk-pair i.now { background: var(--accent); }
.mk-fig { margin: 0; display: grid; gap: 4px; }
.mk-val { fill: var(--ink) !important; font-weight: 700; font-size: 12px !important; }
.mk-hbar { display: grid; grid-template-columns: 64px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-muted); }
.mk-hbar i { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.mk-hbar b { display: block; height: 100%; background: var(--rule-strong); border-radius: 6px; transform-origin: left; }
.mk-hbar.now b { background: var(--accent); }
.mk-hbar em { font-style: normal; font-family: var(--font-mono); font-weight: 700; color: var(--ink); text-align: right; }
.mk-wbfig { gap: 8px; padding: 6px 0; }

/* C — сводка с графиками и колонки */
.mk-charts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mk-chart-card { padding-bottom: 12px; }
.mk-chart-card > svg { padding: 0 10px; }
.mk-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.mk-kpis div { padding: 10px 16px; border-left: 1px solid var(--rule); display: grid; }
.mk-kpis div:first-child { border-left: 0; }
.mk-kpis span { font-size: 11.5px; color: var(--ink-muted); font-weight: 650; }
.mk-kpis b { font-family: var(--font-mono); font-size: 20px; font-weight: 800; }
.mk-kpis small { font-size: 11px; color: var(--ink-faint); }
.mk-dot { fill: var(--chart-a); stroke: var(--surface); stroke-width: 2; opacity: 0; transition: opacity 120ms ease; }
.mk-dot:hover, svg:hover .mk-dot { opacity: 1; }
.mk-bars { display: grid; gap: 8px; padding: 6px 16px 4px; }
.mk-bar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 54px; gap: 10px; align-items: center; font-size: 12.5px; }
.mk-bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.mk-bar i { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.mk-bar i b { display: block; height: 100%; border-radius: 5px; background: var(--good); transform-origin: left; }
.mk-bar.crit i b { background: var(--critical); }
.mk-bar em { font-style: normal; font-family: var(--font-mono); font-weight: 700; text-align: right; }
.mk-bar.good em { color: var(--good); } .mk-bar.crit em { color: var(--critical); }
.mk-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mk-col { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px; display: grid; gap: 10px; }
.mk-col-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; padding: 4px 6px; }
.mk-col-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.mk-col-head h2 .ico { width: 17px; height: 17px; color: var(--accent); }
.mk-col:first-child .mk-col-head h2 .ico { color: var(--critical); }
.mk-col-head b { justify-self: end; font-family: var(--font-mono); font-size: 20px; }
.mk-col-head small { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-muted); }
.mk-col-body { display: grid; gap: 8px; }
.mk-card { --tone: var(--accent); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1); position: relative; transition: box-shadow 140ms ease, opacity 300ms ease; }
.mk-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tone); }
.mk-card.tone-good { --tone: var(--good); } .mk-card.tone-warn { --tone: var(--warn); } .mk-card.is-overdue { --tone: var(--critical); }
.mk-card:hover { box-shadow: var(--shadow-2); }
.mk-card > summary { list-style: none; cursor: pointer; display: grid; gap: 6px; padding: 11px 12px 11px 15px; }
.mk-card > summary::-webkit-details-marker { display: none; }
.mk-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-card-top .chip { font-size: 9.5px; }
.mk-card-top .act-due { font-size: 11.5px; } .mk-card-top .act-due b { font-size: 12px; }
.mk-card-mid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.mk-card-mid > span { display: grid; gap: 1px; min-width: 0; }
.mk-card-mid b { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.mk-card-mid small { font-size: 12px; color: var(--ink-muted); }
.mk-card-why { font-size: 12px; color: var(--ink-muted); border-top: 1px solid var(--rule); padding-top: 6px; }
.mk-card[open] .mk-card-why { display: none; }
.mk-card-more { display: grid; gap: 12px; padding: 0 12px 12px 15px; }
.mk-card-more .act-body { grid-template-columns: minmax(0, 1fr); }

@media (prefers-reduced-motion: no-preference) {
  .mk-bar i b, .mk-hbar b { animation: trGrow 700ms var(--ease) both; }
  .mk-col-body > .mk-card { animation: rowIn 280ms var(--ease) both; animation-delay: calc(150ms + var(--i, 0) * 35ms); }
  .mk-card[open] .mk-card-more { animation: trRise 240ms var(--ease) both; }
  .mk-spark .l { stroke-dasharray: 400; animation: trDraw 900ms ease-out both; --len: 400; }
}
@media (max-width: 1250px) { .mk-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mk-charts > :first-child { grid-column: 1 / -1; } }
@media (max-width: 1000px) { .mk-board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .mk-charts { grid-template-columns: minmax(0, 1fr); } }

.mk-evchart text { font-size: var(--fs, 11px); }
.mk-evchart text.m-launch, .mk-evchart text.m-rise, .mk-evchart text.m-peak, .mk-evchart .m-todaytext { font-size: var(--fs, 11px); }
.mk-rel { display: grid; justify-items: center; min-width: 56px; padding: 3px 8px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--surface-2); line-height: 1.15; }
.mk-rel small { font-size: 9.5px; color: var(--ink-faint); }
.mk-rel b { font-family: var(--font-mono); font-size: 13px; }

/* ---- запреты ---- */
.fb-result { display: flex; gap: 12px; align-items: flex-start; margin: 0 16px 16px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5; }
.fb-result .ico { width: 22px; height: 22px; margin-top: 1px; }
.fb-result.crit { background: var(--critical-soft); color: var(--ink); border-left: 3px solid var(--critical); }
.fb-result.crit .ico, .fb-result.crit b { color: var(--critical); }
.fb-result.good { background: var(--good-soft); border-left: 3px solid var(--good); }
.fb-result.good .ico, .fb-result.good b { color: var(--good); }
.fb-filter { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.fb-weak { color: var(--warn); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.fb-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); min-width: 0; }
.fb-item b { font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.fb-item small { display: block; font-size: 11.5px; color: var(--ink-muted); }
.fb-item .icon-btn { width: 26px; height: 26px; opacity: .45; transition: opacity 120ms ease; }
.fb-item:hover .icon-btn { opacity: 1; }
.fb-item .icon-btn:hover { color: var(--critical); border-color: var(--critical); background: var(--critical-soft); }
.fb-inline { display: inline; }
.chip.fb { background: var(--critical-soft); color: var(--critical); }
.chip.ok { background: var(--good-soft); color: var(--good); }
@media (prefers-reduced-motion: no-preference) { .fb-grid > .fb-item { animation: rowIn 240ms var(--ease) both; animation-delay: calc(var(--i, 0) * 12ms); } }
.fb-in { margin: 0; }
.mk-card-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip .ico { width: 11px; height: 11px; }
.mk-chart-note { padding: 6px 16px 0; }

/* Тёмная тема для системных элементов (списки, прокрутка, поля дат). */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 650; text-decoration: none; transition: top 160ms ease; }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* ---- настройки: ключи и Telegram ---- */
.keys-table td { vertical-align: top; }
.keys-table td small { max-width: 320px; }
.keys-table tr.is-unused td { color: var(--ink-muted); }
.keys-actions { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.keys-actions form { margin: 0; }
.keys-del:hover { color: var(--critical) !important; border-color: var(--critical) !important; background: var(--critical-soft) !important; }
.tg-switches { display: grid; gap: 8px; padding: 10px 0 0; }
.tg-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.tg-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex: none; }

.tr-empty { display: flex; gap: 14px; align-items: flex-start; padding: 18px 4px; }
.tr-empty > .ico { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.tr-empty b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.tr-empty span { display: block; max-width: 60ch; margin-bottom: 10px; }

/* ---- «Запреты», вторая версия --------------------------------------- */
.fb-add-btn { margin-left: 8px; }
.fb-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 18px 28px; align-items: center;
  padding: 22px 24px; border-radius: var(--r-md); border: 1px solid var(--rule); box-shadow: var(--shadow-1);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 55%, var(--accent-soft) 100%);
}
.fb-hero-text h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 19px; font-weight: 800; letter-spacing: -.012em; }
.fb-hero-text h2 .ico { width: 22px; height: 22px; color: var(--accent); }
.fb-hero-text p { margin: 0; color: var(--ink-muted); font-size: 13.5px; line-height: 1.5; max-width: 46ch; }
.fb-hero-box { display: grid; gap: 10px; }
.fb-input {
  width: 100%; font: inherit; font-size: 17px; padding: 13px 16px 13px 44px; border-radius: var(--r-md);
  border: 1.5px solid var(--rule-strong); color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M11 4a7 7 0 100 14 7 7 0 000-14zM21 21l-5-5'/%3E%3C/svg%3E") no-repeat 15px center / 19px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.fb-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fb-verdict { --vt: var(--ink-faint); display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--rule); min-height: 62px; transition: background 200ms ease, border-color 200ms ease; }
.fb-verdict b { display: block; font-size: 14.5px; color: var(--ink); }
.fb-verdict small { display: block; font-size: 12.5px; color: var(--ink-muted); line-height: 1.4; }
.fb-verdict-ico { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--vt); position: relative; opacity: .9; }
.fb-verdict-ico::after { content: ""; position: absolute; inset: 0; background: center / 16px no-repeat; }
.fb-verdict[data-state="idle"] .fb-verdict-ico { background: var(--rule-strong); }
.fb-verdict[data-state="busy"] .fb-verdict-ico { background: transparent; border: 3px solid var(--rule-strong); border-top-color: var(--accent); animation: fzSpin .8s linear infinite; }
.fb-verdict[data-state="ok"] { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.fb-verdict[data-state="ok"] .fb-verdict-ico { background: var(--good); }
.fb-verdict[data-state="ok"] .fb-verdict-ico::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.fb-verdict[data-state="ok"] b { color: var(--good); }
.fb-verdict[data-state="bad"] { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.fb-verdict[data-state="bad"] .fb-verdict-ico { background: var(--critical); }
.fb-verdict[data-state="bad"] .fb-verdict-ico::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E"); }
.fb-verdict[data-state="bad"] b { color: var(--critical); }
.fb-tiles .tile { cursor: default; }
.fb-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fb-risk { list-style: none; margin: 0; padding: 4px 0; }
.fb-risk-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--rule); transition: background 120ms ease; }
.fb-risk-row:first-child { border-top: 0; }
.fb-risk-row:hover { background: var(--overlay-hover); }
.fb-risk-main { min-width: 0; display: grid; gap: 3px; }
.fb-risk-name { font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.fb-risk-name:hover { color: var(--accent); text-decoration: underline; }
.fb-risk-why { font-size: 12px; color: var(--ink-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fb-risk-money { display: grid; justify-items: end; gap: 1px; }
.fb-risk-money b { font-family: var(--font-mono); font-size: 14px; }
.fb-risk-money small { font-size: 11px; color: var(--ink-faint); }
.fb-risk-bar { width: 100%; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.fb-risk-bar i { display: block; height: 100%; background: var(--critical); border-radius: 3px; transform-origin: right; }
.fb-mini { font-size: 12px; padding: 5px 10px; }
.fb-empty-ok { padding: 16px; }
.fb-empty-ok > .ico { background: var(--good-soft); color: var(--good); }
.fb-allowed { border-top: 1px solid var(--rule); padding: 10px 16px 12px; font-size: 13px; }
.fb-allowed summary { cursor: pointer; color: var(--ink-muted); font-weight: 650; }
.fb-allowed ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.fb-allowed li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fb-allowed li small { color: var(--ink-faint); }
.fb-allowed form { display: inline; margin: 0; }
.fb-list { position: sticky; top: 64px; }
.fb-list-tools { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.fb-list-tools .search { max-width: none; flex: 1 1 180px; }
.fb-cat { font: inherit; font-size: 13px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 7px 10px; flex: 0 1 220px; min-width: 0; }
.fb-weak { display: flex; gap: 8px; align-items: baseline; margin: 0; padding: 9px 16px; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-bottom: 1px solid var(--rule); }
.fb-weak .ico { width: 14px; height: 14px; flex: none; align-self: center; }
.fb-weak span { flex: 1; }
.fb-scroll { max-height: calc(100vh - 250px); min-height: 280px; overflow: auto; overscroll-behavior: contain; }
.fb-entries { list-style: none; margin: 0; padding: 0; }
.fb-entry { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--rule); }
.fb-entry:hover { background: var(--overlay-hover); }
.fb-entry b { font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.fb-entry small { display: block; font-size: 11.5px; color: var(--ink-muted); }
.fb-entry.is-weak b { color: var(--warn); }
.fb-aliases { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.fb-aliases i { font-style: normal; font-size: 10.5px; padding: 0 6px; border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--rule); }
.fb-entry form { margin: 0; }
.fb-del { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--ink-faint); cursor: pointer; opacity: 0; transition: opacity 120ms ease, color 120ms ease, background 120ms ease; }
.fb-del svg { width: 14px; height: 14px; }
.fb-entry:hover .fb-del, .fb-del:focus-visible { opacity: 1; }
.fb-del:hover { color: var(--critical); background: var(--critical-soft); border-color: var(--critical); }
.fb-none { padding: 18px 16px; margin: 0; color: var(--ink-muted); font-size: 13px; }
.fb-dialog { width: min(560px, calc(100vw - 40px)); }
@media (hover: none) { .fb-del { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .fb-verdict.pop { animation: trRise 240ms var(--ease) both; }
  .fb-entry { animation: rowIn 220ms var(--ease) both; animation-delay: calc(var(--i, 0) * 14ms); }
  .fb-risk-bar i { animation: trGrow 700ms var(--ease) both; transform-origin: left; }
  .fb-dialog[open] { animation: trRise 220ms var(--ease) both; }
}
@media (max-width: 1000px) {
  .fb-hero, .fb-layout { grid-template-columns: minmax(0, 1fr); }
  .fb-list { position: static; }
  .fb-scroll { max-height: 520px; }
}
@media (max-width: 560px) { .fb-risk-row { grid-template-columns: minmax(0, 1fr) auto; } .fb-risk-act { grid-column: 1 / -1; } .fb-input { font-size: 16px; } }

/* ---- доказательства тренда ---- */
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ev-list li { display: grid; grid-template-columns: 14px 128px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--ink-muted); }
.ev-list b { color: var(--ink); font-weight: 650; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); align-self: center; }
.ev-up .ev-dot { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.ev-down .ev-dot { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }
.ev-flat .ev-dot { background: var(--ink-faint); }
.ev-warn .ev-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ev-none { opacity: .7; }
.ev-none .ev-dot { background: none; border: 1.5px dashed var(--rule-strong); }
.tr-chip { font-size: 9.5px; }

/* ---- товарный знак ---- */
.tm-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); border: 1px dashed var(--rule-strong); background: var(--surface); }
.tm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tm-head b { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; }
.tm-head .ico { width: 15px; height: 15px; color: var(--accent); }
.tm-note { margin: 0; font-size: 12px; color: var(--ink-muted); line-height: 1.45; }
.tm-links { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-links .btn-line { font-size: 12px; padding: 5px 10px; }
.tm-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.tm-form .tm-note-in { flex: 1 1 220px; width: auto; font-size: 12.5px; padding: 6px 9px; }
.tm-form .btn-line { font-size: 12px; padding: 6px 10px; }
.tm-form .btn-line .ico { width: 13px; height: 13px; }
.tm-mark:hover { color: var(--critical); border-color: var(--critical); background: var(--critical-soft); }
.tm-hint { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.tm-hint .ico { width: 13px; height: 13px; color: var(--warn); }
