/* CE Dashboard — дизайн-система.
   Направление: точный, спокойный инструмент осмотрщика. Нейтральный графит, один фирменный акцент,
   цвет живёт в графиках и фотографиях машин. Сетка 4px, веса 400–600, без свечений и градиентов.
   Принципы чистки интерфейса — по unslop, автор Damir Sokolovsky (@heydamir), CC BY 4.0,
   https://github.com/heydamir/unslop */
:root {
  color-scheme: dark;
  --side: #0b0c15;
  --bg: #0e1019;
  --surface: #13141f;
  --surface-2: #1a1c29;
  --surface-3: #232637;
  --border: rgba(167, 173, 220, .10);
  --border-2: rgba(167, 173, 220, .17);
  --text: #f1f2f8;
  --text-2: #a7adc4;
  --text-3: #7c829e;
  --accent: #8b7ff5;
  --accent-fill: #6d5ef0;
  --accent-soft: rgba(139, 127, 245, .14);
  --btn-bg: #f1f2f8;
  --btn-ink: #0e1019;
  --logo-car: #7a6bff;
  --logo-text: #f1f2f8;
  --pos: #4cc38a;
  --neg: #e5484d;
  --warn: #d6a13c;
  --grid: #1f2232;
  --axis: #30344a;
  --shadow: 0 16px 48px rgba(0, 0, 0, .5);
  --top-light: inset 0 1px 0 rgba(255, 255, 255, .06);
  /* графики: проверенная на различимость категориальная палитра */
  --s1: #9085e9; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #3987e5; --s8: #e66767;
  --s-other: #565b74;
  --dv-pos2: #3987e5; --dv-pos1: #2b5b96; --dv-mid: #4d4d55; --dv-neg1: #8a4444; --dv-neg2: #e66767; --dv-none: #2d2d30;
  --st-good: #2f9461; --st-warn: #b98420; --st-serious: #b9562d; --st-crit: #c9393e;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: var(--ui-font, 'Manrope'), -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: var(--ui-mono, 'JetBrains Mono'), ui-monospace, 'SF Mono', Menlo, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --side: #eceef5;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --surface-3: #e9ebf3;
  --border: rgba(24, 27, 39, .08);
  --border-2: rgba(24, 27, 39, .14);
  --text: #181b27;
  --text-2: #475068;
  --text-3: #737b92;
  --accent: #6d5ef0;
  --accent-fill: #6d5ef0;
  --accent-soft: rgba(109, 94, 240, .09);
  --logo-car: #3b05d9;
  --logo-text: #181b27;
  --btn-bg: #181b27;
  --btn-ink: #ffffff;
  --pos: #15803d;
  --neg: #dc2626;
  --warn: #a16207;
  --grid: #eceef5;
  --axis: #d2d7e6;
  --shadow: 0 8px 24px rgba(0, 0, 0, .08);
  --top-light: none;
  --s1: #6250d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #2a78d6; --s8: #e34948;
  --s-other: #b9b9c0;
  --dv-pos2: #2a78d6; --dv-pos1: #9ec5f4; --dv-mid: #cfcfd4; --dv-neg1: #f0a9a4; --dv-neg2: #d03b3b; --dv-none: #e8e8ea;
  --st-good: #16803f; --st-warn: #a16207; --st-serious: #b9562d; --st-crit: #c9393e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 4px solid transparent; background-clip: content-box; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 12px; background: var(--side); border-right: 1px solid var(--border); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px; }
/* фирменный логотип в две строки: форма из PNG-масок, цвет — по теме (лупа и Car — фирменный, Experts — цвет текста) */
.logo-line { --lh: 40px; position: relative; display: block; height: var(--lh); width: calc(var(--lh) * 550 / 200); flex: none; }
.logo-line::before, .logo-line::after { content: ''; position: absolute; inset: 0; }
.logo-line::before { background: var(--logo-car); -webkit-mask: url(/img/logo-car.png) no-repeat 0 0 / 100% 100%; mask: url(/img/logo-car.png) no-repeat 0 0 / 100% 100%; }
.logo-line::after { background: var(--logo-text); -webkit-mask: url(/img/logo-experts.png) no-repeat 0 0 / 100% 100%; mask: url(/img/logo-experts.png) no-repeat 0 0 / 100% 100%; }
.app .brand-mark { display: none; }
.app.collapsed .brand-mark { display: block; color: var(--logo-car); }
.app.collapsed .logo-line { display: none; }
.brand-mark { width: 24px; height: 24px; flex: none; color: var(--accent); display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.brand-name { font-weight: 600; font-size: 16px; }
.brand-sub { display: none; }
.nav-label { font-size: 12px; color: var(--text-3); padding: 24px 12px 8px; }
.sidebar nav, .sidebar .nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; border: 0; background: none; width: 100%; text-align: left; transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav-item .icon { color: var(--text-3); }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: var(--top-light); }
.nav-item.active .icon { color: var(--text); }
.nav-item[disabled] { color: var(--text-3); cursor: default; }
.nav-item[disabled]:hover { background: none; color: var(--text-3); }
.nav-item .tag { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.sync-line { font-size: 12px; color: var(--text-3); padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 12px 12px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 500; color: var(--text-2); flex: none; }
.app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .nav-item span, .app.collapsed .nav-item .tag, .app.collapsed .user-meta, .app.collapsed .sync-line span { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 0; }
.app.collapsed .brand, .app.collapsed .user-chip, .app.collapsed .sync-line { justify-content: center; padding-left: 0; padding-right: 0; }
.app.collapsed .nav-label { display: block; height: 16px; padding: 0; margin: 12px 8px 4px; border-top: 1px solid var(--border); font-size: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 32px; background: var(--bg); border-bottom: 1px solid var(--border); }
.page-title { font-size: 20px; line-height: 28px; font-weight: 500; margin: 0; }
.page-sub { font-size: 12px; line-height: 16px; color: var(--text-3); }
.content { padding: 24px 32px 64px; max-width: 1600px; width: 100%; margin: 0 auto; }
.only-m { display: none !important; }

/* ---------- элементы управления ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.btn .icon { color: var(--text-2); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn-bg); border-color: transparent; color: var(--btn-ink); }
.btn.primary .icon { color: inherit; }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 8px; }
.btn.icon-only { width: 32px; padding: 0; justify-content: center; }
.btn.sm.icon-only { width: 28px; }
.btn.on { border-color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .count { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input { height: 32px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); padding: 0 12px; outline: none; min-width: 0; font-size: 13px; transition: border-color .15s var(--ease); }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-3); }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 36px; width: 100%; }
.kbd, .nav-item .tag { font-family: var(--mono); font-size: 11px; line-height: 16px; color: var(--text-3); border: 1px solid var(--border-2); padding: 0 4px; border-radius: 4px; }

.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: none; height: 28px; min-width: 28px; padding: 0 8px; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; transition: color .15s var(--ease), background-color .15s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), var(--top-light); }
:root:not([data-theme="light"]) .seg { background: var(--side); }
:root:not([data-theme="light"]) .seg button.active { background: var(--surface-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; height: 40px; padding: 0 12px; color: var(--text-2); font-weight: 500; position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color .15s var(--ease); }
.tabs button .icon { color: var(--text-3); }
.tabs button:hover, .tabs button.active { color: var(--text); }
.tabs button.active .icon { color: var(--text); }
.tabs button.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); }
.tabs .badge { font-family: var(--mono); font-size: 12px; color: var(--text-3); border: 0; padding: 0; height: auto; }

.pop { position: fixed; z-index: 200; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; animation: rise .18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } }
.pop-search { padding: 4px 4px 8px; }
.pop-search .input { width: 100%; }
.pop-list { max-height: 304px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pop-item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; border: 0; background: none; width: 100%; text-align: left; flex: none; }
.pop-item:hover, .pop-item.kb { background: var(--surface-3); }
.pop-item .meta { margin-left: auto; color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.pop-item .check { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-2); display: grid; place-items: center; flex: none; }
.pop-item.sel .check { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.pop-item .check .icon { width: 12px; height: 12px; stroke-width: 2.5; opacity: 0; }
.pop-item.sel .check .icon { opacity: 1; }
.pop-item.radio .tick { margin-left: auto; opacity: 0; color: var(--text); display: grid; }
.pop-item.radio.sel .tick { opacity: 1; }
.pop-foot { border-top: 1px solid var(--border); margin-top: 4px; padding: 4px; display: flex; gap: 8px; align-items: center; }
.pop-sep { height: 1px; background: var(--border); margin: 4px 0; flex: none; }

.chip { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; display: inline-block; }
.linekey { width: 12px; height: 2px; border-radius: 1px; flex: none; display: inline-block; }

/* ---------- карточки и сетки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head > .grow { flex: 1 1 200px; min-width: 160px; }
.card-head > h3.grow { flex-basis: 120px; min-width: 120px; }
.card-title { font-size: 14px; line-height: 20px; font-weight: 500; margin: 0; }
.card-sub { font-size: 12px; line-height: 16px; color: var(--text-3); }
.card-body { padding: 12px 20px 20px; }
.card-body.flush { padding-left: 12px; padding-right: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4, .g6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-side { grid-template-columns: 280px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ---------- плитки-показатели: подпись, число, изменение ---------- */
.tile { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.tile-value { font-size: 28px; line-height: 32px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
/* набегающее число: ширина меняется плавно, лишняя цифра на долю секунды обрезается, а не толкает подпись */
.cu { display: inline-flex; white-space: nowrap; font-variant-numeric: tabular-nums; transition: width .28s cubic-bezier(.2, .7, .3, 1); clip-path: inset(-50% 0 -50% 0); }
.cu.cu-still { transition: none; }
.cu.cu-done { clip-path: none; transition: none; }
.cu-n { flex: none; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .cu { transition: none; } }
.tile-value small { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--text-3); }
.tile-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--text-3); min-height: 16px; flex-wrap: wrap; }
.tile-note { font-size: 12px; line-height: 16px; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-2); }
.delta.up { color: var(--pos); }
.delta.down { color: var(--neg); }
.delta .icon { width: 12px; height: 12px; stroke-width: 2; }
.hero { font-size: 56px; line-height: 60px; font-weight: 500; letter-spacing: -.03em; }
.hero small { font-size: 16px; font-weight: 400; color: var(--text-3); letter-spacing: 0; margin-left: 8px; }

/* ---------- списки с тонкими полосами ---------- */
.rank { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px; border-radius: 8px; border: 0; background: none; text-align: left; width: 100%; align-items: center; transition: background-color .15s var(--ease); }
button.rank-row:hover { background: var(--surface-2); }
.rank-row.sel, button.rank-row.sel:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.rank-row.sel .rank-name, .rank-row.sel .rank-val { color: var(--text); font-weight: 600; }
.rank-row.dim { opacity: .42; }
.rank-row.dim:hover { opacity: .8; }
.rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.rank-name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; }
.rank-val small { color: var(--text-3); font-weight: 400; margin-left: 8px; font-size: 12px; font-family: var(--mono); }
.rank-track { grid-column: 1 / -1; height: 4px; position: relative; }
.rank-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 2px 2px 0; min-width: 2px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow: auto; border-radius: 0 0 12px 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { position: sticky; top: 0; z-index: 2; text-align: left; font-weight: 400; font-size: 12px; color: var(--text-3); padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
table.t th:first-child, table.t td:first-child { padding-left: 20px; }
table.t th:last-child, table.t td:last-child { padding-right: 20px; }
table.t th.sortable { cursor: pointer; }
table.t th.sortable:hover { color: var(--text); }
table.t th .arrow { display: inline-block; width: 12px; margin-left: 4px; color: var(--text); }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background-color .15s var(--ease); }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.strong, .strong { font-weight: 500; }
table.t td.nowrap, .nowrap { white-space: nowrap; }
table.t td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

table.pivot { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
table.pivot th, table.pivot td { padding: 8px 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); }
table.pivot th { position: sticky; top: 0; background: var(--surface); color: var(--text-3); font-weight: 400; z-index: 3; font-family: var(--mono); }
table.pivot th:first-child, table.pivot td:first-child { position: sticky; left: 0; text-align: left; background: var(--surface); z-index: 2; min-width: 200px; border-right: 1px solid var(--border); font-family: var(--font); font-size: 13px; padding-left: 20px; }
table.pivot th:first-child { z-index: 4; }
table.pivot tr.sec td { background: var(--surface-2); font-weight: 500; color: var(--text); font-size: 13px; padding-top: 12px; }
table.pivot td.spark { padding: 0 12px; }
table.pivot tr.total td { font-weight: 500; }
table.pivot th.yr, table.pivot td.yr { border-left: 1px solid var(--border-2); }

/* ---------- графики ---------- */
.chart { width: 100%; height: 280px; }
.chart.sm { height: 220px; }
.chart.lg { height: 360px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); }
.legend .li { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; height: 20px; color: inherit; }
.legend .li.off { opacity: .4; }
.viz-tip { font-family: var(--font); font-size: 12px; min-width: 152px; }
.viz-tip .tt { color: var(--text-2); margin-bottom: 8px; }
.viz-tip .tr { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.viz-tip .tr b { margin-left: auto; padding-left: 16px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.viz-tip .tr span { color: var(--text-2); }
.viz-tip .tr { margin: 0 -6px; padding: 2px 6px; border-radius: 4px; transition: opacity .12s, background-color .12s; }
.viz-tip.hov .tr:not(.on):not(.tot) { opacity: .45; }
.viz-tip .tr.on { background: var(--accent-soft); }
.viz-tip .tr.on span, .viz-tip .tr.on b { color: var(--text); font-weight: 600; }
.viz-tip .tr.on .linekey { height: 4px; border-radius: 2px; }
.viz-tip .tot { border-top: 1px solid var(--border-2); margin-top: 4px; padding-top: 4px; }

/* ---------- прочее ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .icon { width: 24px; height: 24px; }
.empty b { color: var(--text); font-weight: 500; }
.empty p { margin: 0; max-width: 460px; font-size: 13px; }
.empty .btn { margin-top: 8px; }
.skeleton { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; } }
.badge { display: inline-flex; align-items: center; gap: 8px; height: 24px; font-size: 12px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; background: var(--text-3); }
.badge.live .dot { background: var(--pos); }
.badge.snap .dot { background: var(--warn); }
.badge.err { color: var(--neg); }
.badge.err .dot { background: var(--neg); }
.badge .icon { width: 12px; height: 12px; }
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--btn-bg); color: var(--btn-ink); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); animation: rise .2s var(--ease); }
.note { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; }
.note .icon { margin-top: 2px; color: var(--text-3); }
pre.code { background: var(--side); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font: 12px/20px var(--mono); overflow: auto; margin: 0; color: var(--text-2); white-space: pre; }
h3.sec { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); margin: 32px 0 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 12px 16px; }
.kv > div > span { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); }
.kv > div > b { font-weight: 500; word-break: break-word; }

/* ---------- палитра команд, боковая панель просмотра ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 300; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.cmdk { position: fixed; top: 16vh; left: 50%; transform: translateX(-50%); width: min(600px, calc(100vw - 32px)); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); z-index: 310; overflow: hidden; }
.cmdk input { width: 100%; border: 0; background: none; outline: none; height: 48px; padding: 0 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.cmdk .pop-list { max-height: 48vh; padding: 4px; }
.cmdk .grp { font-size: 12px; color: var(--text-3); padding: 12px 8px 4px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--border-2); z-index: 310; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .32s var(--ease); }
@keyframes slide { from { transform: translateX(12px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.drawer h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 500; }

/* ---------- отчёты ---------- */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.rcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.rcard:hover { border-color: var(--border-2); background: var(--surface-2); }
.rthumb { aspect-ratio: 16 / 9; background: var(--surface-2); position: relative; overflow: hidden; }
.rthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rthumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 20px; color: var(--text-3); background: var(--surface-2); }
.rthumb .rate { position: absolute; left: 8px; top: 8px; }
.rthumb .play { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .15s var(--ease); }
.rthumb .play .icon { width: 12px; height: 12px; fill: currentColor; }
.rcard:hover .play { opacity: 1; }
.rthumb .views { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .6); border: 0; color: #fff; }
.rbody { padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.rtitle { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.rtitle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmeta { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rmeta i { width: 2px; height: 2px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.rsnip { font-size: 13px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
/* фирменная деталь: оценка осмотра — цифра в моно-ячейке, как на шкале прибора */
.rate { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: #fff; flex: none; }
.rate.r5, .rate.r4 { background: #1fb866; }
.rate.r3 { background: var(--st-warn); }
.rate.r2 { background: var(--st-serious); }
.rate.r1 { background: #0f0f10; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
.rate.r0 { background: rgba(60, 60, 64, .9); color: #c9c9cc; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; }
.sync-ok { background: var(--pos); }
.sync-partial { background: var(--warn); }
.sync-mismatch { background: var(--neg); }
.sync-no_clickup, .sync-unknown { background: var(--text-3); }
.player { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.prose { font-size: 14px; line-height: 24px; color: var(--text); white-space: pre-wrap; }
.prose.dim { color: var(--text-2); }
mark { background: color-mix(in srgb, var(--warn) 36%, transparent); color: inherit; border-radius: 2px; }
.difftag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; min-height: 24px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); margin: 2px 4px 2px 0; flex-wrap: wrap; }
.difftag b { font-weight: 400; color: var(--text-3); }
.difftag .arrow, .difftag em { color: var(--text-3); font-style: normal; }
.difftag.mismatch { box-shadow: inset 2px 0 0 var(--neg); }
.rthumb-sm { width: 64px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; position: relative; background: var(--surface-2); flex: none; }
.rthumb-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rthumb-sm .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- соцсети ---------- */
.plat { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.plat svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.plat.sm { width: 20px; height: 20px; border-radius: 6px; }
.plat.sm svg { width: 12px; height: 12px; }
.vthumb { width: 80px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; display: block; }
.cmp { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cmp-slot { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cmp-slot.empty-slot { color: var(--text-3); }
.cmp-slot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-2); display: block; }
/* соцсети: вкладки с фильтром языка, список видео для сравнения, ячейки с полосой */
.soc-top { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.soc-top .tabs { border-bottom: 0; margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.soc-top .seg { flex: none; }
.soc-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-best { color: var(--accent); font-weight: 600; }
.soc-nodata { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.soc-nodata .soc-ask.icon-only { width: 24px; height: 24px; min-height: 0; padding: 0; color: var(--text-3); }
.soc-nodata .soc-ask:hover { color: var(--accent); }
.soc-foot { display: flex; align-items: center; gap: 12px; padding: 8px 20px; font-size: 12px; color: var(--text-3); }
.soc-barcell { min-width: 120px; font-variant-numeric: tabular-nums; }
.soc-barcell.wide { min-width: 180px; }
.soc-barcell small { color: var(--text-3); font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.soc-barcell .rank-track { margin-top: 6px; }
.soc-barcell .rank-fill { left: auto; right: 0; border-radius: 2px 0 0 2px; }
table.t tr.soc-total td { border-bottom: 0; color: var(--text-2); }
.soc-list { padding: 0 8px 8px; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.soc-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 8px; background: none; width: 100%; text-align: left; font-size: 13px; color: inherit; cursor: pointer; }
.soc-item:hover { background: var(--surface-2); }
.soc-item.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.soc-cmp { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 1100px) { .soc-cmp { grid-template-columns: minmax(0, 1fr); } .soc-list { max-height: 240px; } .soc-top { flex-wrap: wrap; border-bottom: 0; } .soc-top .tabs { flex-basis: 100%; border-bottom: 1px solid var(--border); } }
.slot-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 32px; }
.login h1 { font-size: 20px; line-height: 28px; font-weight: 500; margin: 16px 0 4px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.field .input { height: 40px; }

/* ---------- планшеты и телефоны ---------- */
@media (max-width: 1200px) {
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); }
  .sidebar .brand, .sidebar .nav-label, .sidebar .nav-group, .sidebar-foot { display: none; }
  .sidebar nav { flex-direction: row; flex: 1; gap: 4px; }
  .nav-item, .app.collapsed .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 4px; height: 48px; padding: 0; font-size: 11px; line-height: 12px; }
  .app.collapsed .nav-item span { display: inline; }
  .nav-item.active { background: none; box-shadow: none; }
  .nav-item.active .icon { color: var(--accent); }
  .topbar { padding: 8px 16px; min-height: 56px; gap: 8px; }
  .topbar .row { flex-wrap: nowrap; gap: 4px; }
  .topbar .badge { display: none; }
  .topbar .btn:not(.keep-label) { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .topbar .page-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-title { font-size: 18px; line-height: 24px; }
  .content { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .only-m { display: inline-flex !important; }
  .hide-m { display: none !important; }
  .g2, .g3, .g-2-1, .g-3-2, .g-side { grid-template-columns: minmax(0, 1fr); }
  .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn, .input { height: 36px; }
  .btn.sm { height: 32px; }
  .btn.icon-only { width: 36px; }
  .btn.sm.icon-only { width: 32px; }
  .seg button { height: 32px; min-width: 32px; }
  .filters .search { flex: 1 1 100% !important; max-width: none !important; width: 100% !important; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
  .card-pad { padding: 16px; }
  .tile { padding: 12px 16px; }
  .tile-value { font-size: 24px; line-height: 28px; }
  .hero { font-size: 40px; line-height: 44px; letter-spacing: -.02em; }
  .chart, .chart.lg { height: 260px; }
  .table-wrap table.t { min-width: 640px; }
  table.t th:first-child, table.t td:first-child { padding-left: 16px; }
  .drawer { width: 100vw; border-left: 0; }
  .drawer-head { padding: 12px 16px; }
  .drawer-head > .grow { order: 1; flex: 1 1 calc(100% - 48px); }
  .drawer-head > .drawer-x { order: 2; }
  .drawer-head > .row { order: 3; flex: 1 1 100%; }
  .drawer-body { padding: 16px; }
  .rgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .rsnip { display: none; }
  .toast-host { bottom: calc(72px + env(safe-area-inset-bottom)); }
  table.pivot th:first-child, table.pivot td:first-child { min-width: 136px; padding-left: 12px; white-space: normal; }
}
@media (max-width: 640px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.keep-1 { grid-template-columns: minmax(0, 1fr); }
  table.pivot .spark { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- переходы между разделами ---------- */
.content.page-enter > * { animation: pageIn .42s var(--ease) both; }
.content.page-enter > *:nth-child(2) { animation-delay: .04s; }
.content.page-enter > *:nth-child(3) { animation-delay: .08s; }
.content.page-enter > *:nth-child(n+4) { animation-delay: .12s; }
.content.page-enter .stack > *:nth-child(2), .content.page-enter .grid > *:nth-child(2) { animation: pageIn .42s var(--ease) .05s both; }
.content.page-enter .stack > *:nth-child(3), .content.page-enter .grid > *:nth-child(3) { animation: pageIn .42s var(--ease) .1s both; }
.content.page-enter .grid > *:nth-child(4) { animation: pageIn .42s var(--ease) .15s both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
:root[data-motion="off"] *, :root[data-motion="off"] *::before { animation: none !important; transition: none !important; }

/* ---------- настройки ---------- */
.field-l { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.face-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); text-align: left; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.face-btn:hover { background: var(--surface-2); }
.face-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.face-name { font-size: 16px; font-weight: 600; }
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.acc-swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .15s var(--ease); }
.acc-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; color: var(--text); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; padding-bottom: 0; }
.set-row .seg-wide { width: auto; min-width: 280px; }
.set-t { font-weight: 500; }
.set-s { font-size: 12px; color: var(--text-3); }
.tog { width: 40px; height: 24px; border-radius: 12px; border: 0; background: var(--surface-3); position: relative; flex: none; transition: background-color .15s var(--ease); }
.tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.tog.on { background: var(--accent-fill); }
.tog.on::after { transform: translateX(16px); }
@media (max-width: 900px) { .set-row .seg-wide { min-width: 0; width: 100%; } }

/* ---------- карточки отчётов v2: крупные фото, оценка кольцом, показатели с иконками ---------- */
.rgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card, 300px)), 1fr)); }
.rcard { transition: border-color .15s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.rcard:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .55); background: var(--surface); }
.rthumb .ph-wrap, .rthumb-sm .ph-wrap { position: absolute; inset: 0; }
.ph-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease), transform .4s var(--ease); }
.ph-wrap.loaded img { opacity: 1; }
.rcard:hover .ph-wrap.loaded img { transform: scale(1.03); }
.ph-wrap .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-family: var(--font); font-size: 13px;
  color: hsl(var(--h, 250) 25% 72%); background: radial-gradient(120% 90% at 30% 20%, hsl(var(--h, 250) 30% 22%), hsl(calc(var(--h, 250) + 40) 25% 12%)); }
:root[data-theme="light"] .ph-wrap .ph { color: hsl(var(--h, 250) 25% 40%); background: radial-gradient(120% 90% at 30% 20%, hsl(var(--h, 250) 40% 93%), hsl(calc(var(--h, 250) + 40) 30% 85%)); }
.ph-wrap .ph-ico { width: 36px; height: 36px; fill: currentColor; stroke: none; opacity: .75; flex: none; }
.rthumb-sm .ph-ico { width: 20px; height: 20px; }
.ph-name { font-weight: 600; letter-spacing: .01em; }
.ph-wrap.loading .ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.img-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent 42%); pointer-events: none; }
.ring-pos { position: absolute; right: 10px; bottom: 10px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8, 9, 16, .78); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.ring-pos svg { position: absolute; inset: 4px; }
.ring-num { position: relative; font-family: var(--mono); font-weight: 600; font-size: 16px; }
.badge.on-img { position: absolute; left: 10px; top: 10px; background: rgba(8, 9, 16, .72); border: 0; color: #fff; }
.rclient { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.rclient span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rclient .icon { width: 14px; height: 14px; color: var(--text-3); }
.car-stats { display: flex; gap: 16px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: nowrap; min-width: 0; }
.cst { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cst-v { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 13px; font-weight: 500; white-space: nowrap; }
.cst-v .icon { width: 13px; height: 13px; color: var(--text-3); }
.cst.accent .cst-v, .cst.accent .cst-v .icon { color: var(--accent); }
.cst-l { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cst.end { margin-left: auto; text-align: right; align-items: flex-end; }
.cst-v.mini { font-size: 12px; color: var(--text-2); }
.sizer { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); height: 32px; padding: 0 4px; }
.sizer .icon { width: 14px; height: 14px; }
.sizer input { width: 96px; accent-color: var(--accent); }
.vtabs { margin-top: 12px; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
@media (max-width: 900px) { .car-stats { gap: 12px; } .cst:nth-child(3) { display: none; } }

/* ---------- подписи карточки отчёта v3: всё переносится, ничего не наезжает ---------- */
.rbody { padding: 14px 16px 14px; gap: 8px; }
.rtitle { font-size: 15px; font-weight: 600; line-height: 20px; }
.rclient.none { color: var(--text-3); }
.chips-i { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-i { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; }
.chip-i span { overflow: hidden; text-overflow: ellipsis; }
.chip-i .icon { width: 14px; height: 14px; color: var(--text-3); }
.rfoot { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); min-width: 0; }
.rf-date { flex: none; white-space: nowrap; }
.rf-seller { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard:hover .chip-i { background: var(--surface-3); }
/* скелетон в окне отчёта */
.sk-line { height: 12px; border-radius: 6px; background: var(--surface-2); margin: 10px 0; animation: breathe 1.4s ease-in-out infinite; }
.player.pending { background: var(--surface-2); }
.player.pending img { width: 100%; height: 100%; object-fit: cover; opacity: .55; display: block; }
.player.pending .spin-c { position: absolute; inset: 0; display: grid; place-items: center; }
.player.pending .spin-c i { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; }

/* ---------- карточка характеристик в окне отчёта ---------- */
.dsheet { margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.ds-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ds-head .ring-pos { position: relative; right: auto; bottom: auto; width: 56px; height: 56px; flex: none; box-shadow: none; background: var(--surface); }
.ds-head .ring-pos svg circle:first-child { stroke: var(--surface-3); }
.ds-client { font-size: 16px; font-weight: 600; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: -1px; }
.ds-item { padding: 12px 16px; min-width: 0; border-top: 1px solid var(--border); }
.ds-item.wide { grid-column: span 2; }
.ds-l { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.ds-l .icon { width: 13px; height: 13px; }
.ds-v { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; line-height: 20px; flex-wrap: wrap; word-break: break-word; }
.ds-v.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.ds-note { flex-basis: 100%; font-size: 12px; font-weight: 400; color: var(--warn); }
@media (max-width: 520px) { .ds-item.wide { grid-column: 1 / -1; } .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- появление при прокрутке и рост полос ---------- */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.content.page-enter > .rv, .content.page-enter .grid > .rv, .content.page-enter .stack > .rv { animation: none; }
.rank-fill { transform-origin: left center; }
/* полосы растут при каждой отрисовке блока (в том числе при выборе фильтра), но ждут прелоадер и появления блока при прокрутке */
.rank-fill.grow { animation: growX .9s var(--ease) .15s both; }
.rv:not(.in) .rank-fill.grow, body:has(#preloader) .rank-fill.grow { animation-play-state: paused; }
@keyframes growX { from { transform: scaleX(0); } }
.content.page-enter .segbar > i, .rv.in .segbar > i { animation: growX .8s var(--ease) .1s both; }

/* ползунок размера карточек: шаги = число колонок */
.rgrid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.sizer-track { position: relative; display: flex; align-items: center; }
.sizer input { width: 104px; margin: 0; position: relative; z-index: 1; }
.sizer-ticks { position: absolute; left: 7px; right: 7px; top: 50%; display: flex; justify-content: space-between; pointer-events: none; transform: translateY(6px); }
.sizer-ticks i { width: 2px; height: 4px; border-radius: 1px; background: var(--text-3); opacity: .6; }
@media (max-width: 900px) { .rgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); } }

/* итоги по годам под графиком «Вся история выручки» */
.ystats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); border-top: 1px solid var(--border); }
.ys { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ys + .ys { border-left: 1px solid var(--border); }
.ys-y { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ys-y span { color: var(--text-3); }
.ys-v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ys-d { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
