/* ═══════════════════════════════════════════════════════════════
   BUMAGA SCAM LIST — Public Page Styles v1.0
   Location: /assets/css/scam.css

   CLEAN FLAT DARK — matches disputes.css / escrow.css / methods.css
   No gradients. No glow. No glassmorphism.
   Hover = border-color only.

   Namespace: scm-*   (scm-adm-* уже занят admin панелью)
   Dependencies: tokens.css (--bp-* variables)
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Layout ── */
.scm-page {
    max-width: clamp(900px, 86vw, 1280px);
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* ══════════════════════════════════════════════════════════
   HERO — icon + title + subtitle + metrics bar
   Паттерн: disputes.css dsp-hero / escrow.css
   ══════════════════════════════════════════════════════════ */
.scm-hero {
    text-align: center;
    padding: 52px 0 40px;
}

.scm-hero-title {
    font-size: 42px;
    font-weight: 900;
    color: var(--bp-text);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    line-height: 1.1;
}

/* Иконка — точная копия dsp-hero-icon */
.scm-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--bp-accent) 0%, #2d7cd6 100%);
    border-radius: var(--bp-radius);
    box-shadow: 0 8px 25px rgba(74, 158, 255, 0.3);
    flex-shrink: 0;
}

.scm-hero-icon svg {
    width: 30px;
    height: 30px;
    color: #fff;
}

.scm-hero-sub {
    font-size: 16px;
    color: var(--bp-text-secondary);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 24px;
}

/* ── Metrics bar (inline-flex с сепараторами) ── */
.scm-hero-metrics {
    display: inline-flex;
    align-items: center;
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    margin-bottom: 14px;
    overflow: visible; /* было hidden — резало tooltip */
}

.scm-hero-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 32px;
}

.scm-hero-metric-sep {
    width: 1px;
    height: 36px;
    background: var(--bp-border);
    flex-shrink: 0;
}

.scm-hero-metric-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--bp-text);
    font-family: var(--bp-mono);
    line-height: 1;
}

.scm-hero-metric-val--damage {
    color: var(--bp-red, #ef4444);
}

.scm-hero-metric-val--resolved {
    color: var(--bp-green, #22c55e);
}

/* Участники — синий акцент платформы */
.scm-hero-metric-val--actors {
    color: #4a9eff;
}

/* Материалы — приглушённый, наименее важная метрика */
.scm-hero-metric-val--media {
    color: #888888;
}

.scm-hero-metric-lbl {
    font-size: 11px;
    color: var(--bp-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Metric tooltip (ⓘ hover) ── */
.scm-hero-metric {
    position: relative;
}

.scm-metric-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    color: var(--bp-text-muted);
    cursor: help;
    font-size: 10px;
    font-style: normal;
    opacity: .3;        /* очень тихая — не тянет внимание */
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity .1s;
}

.scm-hero-metric:hover .scm-metric-info {
    opacity: .7;
}

.scm-metric-tooltip {
    position: absolute;
    top: calc(100% + 6px);  /* вниз, не вверх — не перекрывает subtitle */
    left: 50%;
    transform: translateX(-50%);
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--bp-text-muted);
    white-space: nowrap;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Треугольник сверху */
.scm-metric-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--bp-border);
}

.scm-hero-metric:hover .scm-metric-tooltip {
    opacity: 1;
}

/* ── Trust note ── */
.scm-hero-trust {
    font-size: 12px;
    color: var(--bp-text-muted);
    margin: 0 auto 20px;
    max-width: 440px;
    line-height: 1.5;
}

/* ── CTA buttons ── */
.scm-hero-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.scm-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--bp-accent);
    color: #fff;
    border-radius: var(--bp-radius-xs);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--bp-transition-fast);
}

.scm-hero-cta:hover {
    background: var(--bp-accent-hover);
}

.scm-hero-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: transparent;
    color: var(--bp-text-secondary);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-xs);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color var(--bp-transition-fast), color var(--bp-transition-fast);
}

.scm-hero-ghost:hover {
    border-color: var(--bp-accent);
    color: var(--bp-text);
}

/* ══════════════════════════════════════════════════════════
   BODY LAYOUT — одна колонка (sidebar удалён)
   ══════════════════════════════════════════════════════════ */
.scm-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ══════════════════════════════════════════════════════════
   TABS — segmented control (view mode switcher)
   Паттерн: trading UI / admin dashboards / security panels
   НЕ CTA кнопки — режим отображения данных
   ══════════════════════════════════════════════════════════ */
.scm-tabs {
    display: inline-flex;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}

.scm-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.scm-tab:hover {
    color: var(--bp-text);
}

.scm-tab.active {
    background: #1a1a1a;
    border-color: var(--bp-accent);
    color: var(--bp-accent);
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   PANELS
   ══════════════════════════════════════════════════════════ */
.scm-panel { display: block; }
.scm-panel--hidden { display: none; }

/* Внутренний отступ для топ-панелей — как proxy-card */
.scm-panel-inner {
    padding: 18px 22px 22px;
}

/* ══════════════════════════════════════════════════════════
   ACTOR GROUP — grouped view для топ-табов
   ══════════════════════════════════════════════════════════ */
.scm-actor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes scmActorGroupIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.scm-actor-group {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
    animation: scmActorGroupIn 0.22s ease both;
}

/* Stagger — каждая следующая группа появляется с задержкой */
.scm-actor-group:nth-child(1)  { animation-delay: 0.00s; }
.scm-actor-group:nth-child(2)  { animation-delay: 0.04s; }
.scm-actor-group:nth-child(3)  { animation-delay: 0.08s; }
.scm-actor-group:nth-child(4)  { animation-delay: 0.12s; }
.scm-actor-group:nth-child(5)  { animation-delay: 0.16s; }
.scm-actor-group:nth-child(6)  { animation-delay: 0.20s; }
.scm-actor-group:nth-child(7)  { animation-delay: 0.24s; }
.scm-actor-group:nth-child(8)  { animation-delay: 0.28s; }
.scm-actor-group:nth-child(9)  { animation-delay: 0.32s; }
.scm-actor-group:nth-child(10) { animation-delay: 0.36s; }

.scm-actor-group:hover {
    border-color: rgba(74,158,255,0.3);
}

/* ── Actor header: ранг + хэндл + итого ── */
/* #252525 = raised surface — светлее карточки (#1a1a1a), тёмнее страницы */
.scm-actor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #252525;
    border-bottom: 1px solid #2a2a2a;
}

/* ── Rank badge — таблетка с цветом по позиции ── */
.scm-actor-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--bp-mono);
    flex-shrink: 0;
    /* default: 4+ */
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #555;
}

/* 🥇 Gold */
.scm-actor-rank--1 {
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

/* 🥈 Silver */
.scm-actor-rank--2 {
    background: rgba(180, 180, 180, 0.08);
    border-color: rgba(180, 180, 180, 0.2);
    color: #aaaaaa;
}

/* 🥉 Bronze */
.scm-actor-rank--3 {
    background: rgba(205, 127, 50, 0.1);
    border-color: rgba(205, 127, 50, 0.25);
    color: #cd7f32;
}

.scm-actor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.scm-actor-handle {
    font-size: 14px;
    font-weight: 700;
    color: var(--bp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Топ-1 хэндл чуть крупнее */
.scm-actor-group[data-rank="1"] .scm-actor-handle {
    font-size: 15px;
}

.scm-actor-meta {
    font-size: 11px;
    color: var(--bp-text-muted);
    font-family: var(--bp-mono);
}

.scm-actor-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--bp-accent);
    font-family: var(--bp-mono);
    flex-shrink: 0;
    white-space: nowrap;
}

.scm-actor-group[data-rank="1"] .scm-actor-total {
    font-size: 15px;
}

/* ── Actor cases: список кейсов внутри группы ── */
/* #141414 = inner level — темнее карточки, создаёт глубину под header */
.scm-actor-cases {
    display: flex;
    flex-direction: column;
    background: #141414;
}

/* Column header — унифицирован с .scm-registry-head */
.scm-actor-cases-head {
    display: grid;
    grid-template-columns: 52px 100px 1fr 20px;
    gap: 8px;
    padding: 6px 16px 6px 48px;
    border-top: 1px solid #222;
    border-bottom: 1px solid #1e1e1e;
    background: #111;
}

.scm-actor-cases-col {
    font-size: 10px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.scm-actor-case-row {
    display: grid;
    grid-template-columns: 52px 100px 1fr 20px;
    gap: 8px;
    padding: 10px 16px 10px 48px; /* отступ = ранг(20) + gap(12) + padding(16) */
    align-items: center;
    border-top: 1px solid #222;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.scm-actor-case-row:hover {
    background: rgba(74,158,255,0.08);
    border-color: rgba(74,158,255,0.15);
}

.scm-actor-case-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--bp-text-muted);
    font-family: var(--bp-mono);
    white-space: nowrap;
}

.scm-actor-case-dmg {
    font-size: 13px;
    font-weight: 700;
    color: var(--bp-text);
    font-family: var(--bp-mono);
    white-space: nowrap;
}

/* Семантические цвета ущерба — сигнал опасности */
.scm-actor-case-dmg--zero    { color: var(--bp-text-muted); }
.scm-actor-case-dmg--low     { color: #888888; }          /* < $100   */
.scm-actor-case-dmg--medium  { color: #f59e0b; }          /* $100–999 */
.scm-actor-case-dmg--high    { color: #ef4444; }          /* ≥ $1000  */

.scm-actor-case-date {
    font-size: 11px;
    color: var(--bp-text-muted);
    font-family: var(--bp-mono);
}

.scm-actor-case-arrow {
    font-size: 14px;
    color: var(--bp-text-muted);
    text-align: right;
    transition: color 0.15s, transform 0.15s;
}

.scm-actor-case-row:hover .scm-actor-case-arrow {
    color: var(--bp-accent);
    transform: translateX(2px);
}

/* Открытая строка в grouped view */
.scm-actor-case-row--open {
    background: rgba(74,158,255,0.08);
    border-left: 2px solid #4a9eff;
    padding-left: 46px; /* компенсируем 2px border */
}

.scm-actor-case-row--open .scm-actor-case-arrow {
    color: var(--bp-accent);
    transform: rotate(90deg);
}

/* ══════════════════════════════════════════════════════════
   GROUPED EXPAND — inline expand внутри actor cases
   Идентичен .scm-row-expand — единый стиль платформы
   ══════════════════════════════════════════════════════════ */
.scm-grouped-expand {
    border-top: 1px solid #2a2a2a;
    background: #1a1a1a;
    animation: scmExpandIn .18s ease; /* тот же keyframe что у .scm-row-expand */
}

/* ── Sidebar стили — закомментированы, сохранены на случай отката ──
.scm-main  { min-width: 0; }
.scm-aside { min-width: 0; }
── */

/* ══════════════════════════════════════════════════════════
   CONTENT CARD — единая карточка для всех состояний
   Фиксированная ширина — карточка НИКОГДА не меняет размер
   overflow: hidden — контент не может распирать карточку
   ══════════════════════════════════════════════════════════ */
.scm-content-card {
    width: min(860px, 100%);
    margin-left: auto;
    margin-right: auto;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    overflow: clip; /* clip = не создаёт scroll context в отличие от hidden */
}

/* ══════════════════════════════════════════════════════════
   CONTROL BAR — title + tabs + search в одну строку
   ══════════════════════════════════════════════════════════ */
.scm-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid #222;
}

.scm-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--bp-text);
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.scm-control-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

/* ── Segmented tabs ── */
.scm-tabs {
    display: inline-flex;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    flex-shrink: 0;
}

.scm-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.scm-tab:hover {
    color: var(--bp-text);
}

.scm-tab.active {
    background: #1a1a1a;
    border-color: var(--bp-accent);
    color: var(--bp-accent);
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   CONTROL SLOT — фиксированный контейнер для search ↔ badge
   Оба элемента absolute внутри → DOM не двигается при смене
   ══════════════════════════════════════════════════════════ */
.scm-control-slot {
    position: relative;
    flex: 1;           /* растягивается на доступное место */
    min-width: 140px;  /* не схлопывается */
    max-width: 240px;  /* не занимает слишком много */
    height: 34px;
    flex-shrink: 1;
}

/* ══════════════════════════════════════════════════════════
   SEARCH — компактный, абсолютно позиционирован в слоте
   ══════════════════════════════════════════════════════════ */
.scm-search-wrap {
    position: absolute;
    inset: 0;
    transition: opacity 0.18s ease;
}

.scm-search-wrap--hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Sort badge — абсолютно позиционирован в том же слоте ── */
.scm-sort-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: var(--bp-radius-xs);
    color: #555;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--bp-mono);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.scm-sort-badge svg {
    color: #444;
    flex-shrink: 0;
}

.scm-sort-badge--visible {
    opacity: 1;
}

.scm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bp-text-muted);
    pointer-events: none;
}

.scm-search-input {
    width: 100%;
    height: 100%;
    padding: 0 36px 0 38px;
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-xs);
    color: var(--bp-text);
    font-size: 13px;
    transition: border-color var(--bp-transition-fast);
    outline: none;
    box-sizing: border-box;
}

.scm-search-input::placeholder { color: var(--bp-text-muted); }
.scm-search-input:focus { border-color: var(--bp-accent); }

.scm-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--bp-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    line-height: 1;
    border-radius: 3px;
    transition: color var(--bp-transition-fast);
}

.scm-search-clear:hover { color: var(--bp-text); }

/* ══════════════════════════════════════════════════════════
   REGISTRY TABLE — строки вместо карточек
   ══════════════════════════════════════════════════════════ */

/* Слой 1 — основной фон реестра */
.scm-registry {
    background: transparent;
    border: none;
    border-top: 1px solid #2a2a2a;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
}

/* Expand — ограничен шириной карточки через overflow:hidden на родителе */
.scm-row-expand {
    overflow: hidden;
}

/* Заголовок таблицы */
.scm-registry-head {
    display: grid;
    grid-template-columns: 64px 40px 1fr 110px 36px 24px;
    gap: 8px;
    padding: 8px 16px;
    background: #111;
    border-bottom: 1px solid #2a2a2a;
}

.scm-registry-col {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #555;
}

.scm-registry-col--damage { text-align: right; }

/* ── Строка реестра ── */
.scm-row {
    display: block;
    border-bottom: 1px solid #222;
}

.scm-row:last-child { border-bottom: none; }

.scm-row-inner {
    display: grid;
    grid-template-columns: 64px 40px 1fr 110px 36px 24px;
    gap: 8px;
    padding: 12px 16px;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.scm-row-inner:hover {
    background: rgba(74,158,255,0.08);
}

/* Открытая строка — синий акцент слева 3px как proxy active item */
.scm-row--open > .scm-row-inner {
    background: rgba(74,158,255,0.10);
    border-left: 3px solid #4a9eff;
    padding-left: 13px;
}

/* ── Resolved row — визуально "закрыто" ──
   Приглушённая opacity + teal-полоска слева.
   Hover сохраняется — строка кликабельна.               */
.scm-row--resolved > .scm-row-inner {
    opacity: 0.55;
    border-left: 3px solid rgba(20, 184, 166, 0.5); /* teal-500/50 */
    padding-left: 13px;
}
.scm-row--resolved > .scm-row-inner:hover {
    opacity: 0.8;
    background: rgba(20, 184, 166, 0.06);
}
/* Открытый resolved — полная яркость */
.scm-row--resolved.scm-row--open > .scm-row-inner {
    opacity: 1;
    background: rgba(20, 184, 166, 0.08);
    border-left-color: #14b8a6;
}

/* Превью 56px */
.scm-row-thumb {
    width: 56px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    background: #222;
    position: relative;
    flex-shrink: 0;
    border: 1px solid #2a2a2a;
}

.scm-row-thumb picture,
.scm-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scm-row-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
}

.scm-row-thumb-hover {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: opacity .13s;
    border-radius: 5px;
}

.scm-row-inner:hover .scm-row-thumb-hover { opacity: 1; }

.scm-row-num-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.scm-row-num {
    font-size: 12px;
    font-weight: 700;
    color: #444;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
}

/* ✓ badge — маленький teal-чекмарк под номером кейса */
.scm-row-resolved-badge {
    font-size: 9px;
    font-weight: 700;
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 3px;
    padding: 0px 4px;
    line-height: 1.6;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.scm-row-actor-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.scm-row-actor {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scm-row-date {
    font-size: 11px;
    color: #555;
    font-family: 'Roboto Mono', monospace;
}

.scm-row-damage-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.scm-row-damage {
    font-size: 13px;
    font-weight: 700;
    color: #e0e0e0;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
}

.scm-row-damage--zero { color: #444; }

.scm-row-link-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.scm-row-link-btn:hover {
    border-color: rgba(74,158,255,.5);
    color: #4a9eff;
    background: rgba(74,158,255,.08);
}

.scm-row-chevron {
    font-size: 15px;
    color: #444;
    transition: transform 0.2s ease, color 0.2s ease;
    text-align: center;
    line-height: 1;
    display: block;
    width: 16px;
}

.scm-row--open .scm-row-chevron,
.scm-row-chevron.open {
    transform: rotate(90deg);
    color: #4a9eff;
}

/* ══════════════════════════════════════════════════════════
   EXPAND — inline case detail
   Gallery panel: #111  (inner block — как поиск в proxy/sms)
   Meta panel:    #1a1a1a  (surface — единый с реестром)
   ══════════════════════════════════════════════════════════ */
.scm-row-expand {
    border-top: 1px solid #2a2a2a;
    background: #1a1a1a;
    animation: scmExpandIn .18s ease;
}

@keyframes scmExpandIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.scm-expand-inner {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 260px;
}

/* ── Gallery panel: #111 как inner search/tab блоки в proxy/sms ── */
.scm-exp-gallery {
    padding: 16px;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #111;
}

.scm-exp-gallery-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 2px;
}

.scm-exp-gallery--empty {
    padding: 48px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #444;
    font-size: 11px;
    background: #111;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Слайды — object-fit: contain, не cover */
.scm-exp-slides {
    position: relative;
    height: 280px;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    cursor: zoom-in;
}

/* Hover overlay — "Открыть" */
.scm-exp-slides-hover {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    opacity: 0;
    transition: opacity .18s;
    z-index: 3;
    pointer-events: none;
    border-radius: 7px;
}

.scm-exp-slides:hover .scm-exp-slides-hover {
    opacity: 1;
}

.scm-exp-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    display: none;
}

/* picture — flex но тоже скрыт по умолчанию */
picture.scm-exp-slide {
    display: none;
    align-items: center;
    justify-content: center;
}

picture.scm-exp-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.scm-exp-slide--active {
    display: block;
}

picture.scm-exp-slide--active {
    display: flex;
}

.scm-exp-slide--video {
    object-fit: contain;
    background: #111;
}

/* Control-bar: стрелки + счётчик в одну строку */
.scm-exp-gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 4px 8px;
}

.scm-exp-nav-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    line-height: 1;
    font-family: inherit;
}

.scm-exp-nav-btn:hover:not(:disabled) {
    color: #4a9eff;
}

.scm-exp-nav-btn:disabled { opacity: .2; cursor: default; }

.scm-exp-gallery-counter {
    font-size: 12px;
    color: #888;
    font-family: 'Roboto Mono', monospace;
}

/* Стрип превью — один ряд, горизонтальный скролл */
.scm-exp-strip {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.scm-exp-strip::-webkit-scrollbar {
    height: 3px;
}

.scm-exp-strip::-webkit-scrollbar-track { background: transparent; }
.scm-exp-strip::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.scm-exp-strip-thumb {
    width: 42px;
    height: 30px;
    border-radius: 5px;
    background-color: #1f1f1f;
    background-size: cover;
    background-position: center;
    border: 1px solid #333;
    cursor: pointer;
    opacity: .45;
    transition: opacity .15s, border-color .15s;
    position: relative;
    flex: 0 0 auto;
}

.scm-exp-strip-thumb:hover { opacity: .75; }

.scm-exp-strip-thumb--active {
    opacity: 1;
    border-color: #4a9eff;
    box-shadow: 0 0 0 1px rgba(74,158,255,.3);
}

.scm-exp-strip-video-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,.5);
    border-radius: 3px;
}

/* ── Meta panel: единый surface с реестром ── */
.scm-exp-meta {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #1a1a1a;
    min-width: 0;        /* критично для grid — не выходит за пределы */
    overflow: visible;   /* текст НЕ обрезается */
}

.scm-exp-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid #2a2a2a;
    min-width: 0;
}

.scm-exp-section:first-child { padding-top: 0; }
.scm-exp-section:last-child { border-bottom: none; padding-bottom: 0; }

/* Labels — точно как proxy-card-title */
.scm-exp-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
}

.scm-exp-value {
    font-size: 13px;
    color: #ccc;
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 0;
}

/* Ущерб — синий акцент как цены в proxy/sms */
.scm-exp-damage {
    font-size: 24px;
    font-weight: 800;
    color: #4a9eff;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: -.5px;
    line-height: 1.1;
}

/* Зачёркнутая сумма для resolved-кейсов */
.scm-exp-damage-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.scm-exp-damage--struck {
    font-size: 24px;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: -.5px;
    line-height: 1.1;
    color: #444;
    text-decoration: line-through;
    text-decoration-color: #555;
    text-decoration-thickness: 2px;
}

/* ── Resolved banner — внутри expand-блока ──
   Нейтральный teal — "закрыто", не "всё хорошо" */
.scm-exp-resolved-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(20, 184, 166, 0.07);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-left: 3px solid #14b8a6;
    border-radius: 8px;
}
.scm-exp-resolved-banner-icon {
    font-size: 15px;
    color: #14b8a6;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.scm-exp-resolved-banner-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.scm-exp-resolved-banner-text {
    font-size: 13px;
    font-weight: 600;
    color: #c8f7f1;
    line-height: 1.3;
}
.scm-exp-resolved-banner-date {
    font-size: 11px;
    color: #14b8a6;
    font-family: 'Roboto Mono', monospace;
    opacity: 0.8;
}

/* Реквизиты — readonly data capsule, не input */
.scm-exp-mono {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    word-break: break-all;
    color: #aaa;
    background: #111;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    display: block;
    margin-top: 3px;
    line-height: 1.5;
    user-select: all;
    flex: 1;
    min-width: 0;
}

/* Row: mono текст + кнопка копировать */
.scm-exp-mono-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-top: 3px;
}

.scm-exp-copy-btn {
    flex-shrink: 0;
    width: 32px;
    background: #111;
    border: none;
    border-radius: 6px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}

.scm-exp-copy-btn:hover {
    color: #4a9eff;
    background: rgba(74,158,255,.08);
}

.scm-exp-copy-btn:active {
    transform: scale(0.92);
}

.scm-exp-copy-btn--copied {
    color: #34d399 !important;
    background: rgba(52,211,153,.08) !important;
}

.scm-exp-muted { color: #444; }

.scm-exp-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 2px 0;
}

/* Акторы */
.scm-exp-actors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    min-width: 0;
}

.scm-exp-actor {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(74,158,255,.06);
    border: 1px solid rgba(74,158,255,.12);
    border-radius: 20px;
    font-size: 12px;
    color: #777;
    font-weight: 500;
}

.scm-exp-actor--primary {
    background: rgba(74,158,255,.12);
    border-color: rgba(74,158,255,.35);
    color: #4a9eff;
    font-weight: 600;
}

.scm-exp-actor-id {
    font-size: 11px;
    color: #444;
    font-family: 'Roboto Mono', monospace;
    margin-left: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* Skeleton */
.scm-exp-gallery--skeleton { background: #111; }

.scm-exp-skeleton-main {
    height: 180px;
    background: #1f1f1f;
    border-radius: 6px;
    border: 1px solid #333;
    animation: scmPulse 1.4s ease-in-out infinite;
}

.scm-exp-skeleton-strip {
    height: 28px;
    background: #1f1f1f;
    border-radius: 4px;
    animation: scmPulse 1.4s ease-in-out infinite .2s;
}

.scm-exp-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: #1f1f1f;
    margin-bottom: 10px;
    animation: scmPulse 1.4s ease-in-out infinite;
}

.scm-expand-error {
    padding: 28px;
    text-align: center;
    color: #444;
    font-size: 13px;
}

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.scm-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #1f1f1f;
    border: 1px solid rgba(74,158,255,.25);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    color: #4a9eff;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s, transform .18s;
    z-index: 500;
    white-space: nowrap;
    font-weight: 500;
}

.scm-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.scm-empty {
    grid-column: 1 / -1;
    padding: 48px 20px;
    text-align: center;
    color: var(--bp-text-muted);
    font-size: 14px;
    display: none;
}

.scm-empty.is-visible { display: block; }

/* ══════════════════════════════════════════════════════════
   LOAD MORE
   ══════════════════════════════════════════════════════════ */
.scm-load-more-wrap {
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid #222;
}

.scm-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-xs);
    color: var(--bp-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--bp-transition-fast), color var(--bp-transition-fast);
}

.scm-load-more-btn:hover:not(:disabled) {
    border-color: var(--bp-accent);
    color: var(--bp-text);
}

.scm-load-more-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.scm-sidebar-block {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.scm-sidebar-block:last-child { margin-bottom: 0; }

.scm-sidebar-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
}

.scm-sidebar-title {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Toggle: По ущербу / По частоте */
.scm-sidebar-toggle {
    display: flex;
    gap: 4px;
}

.scm-sidebar-toggle-btn {
    padding: 3px 9px;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--bp-border);
    border-radius: 6px;
    color: var(--bp-text-muted);
    cursor: pointer;
    transition: border-color var(--bp-transition-fast), color var(--bp-transition-fast), background var(--bp-transition-fast);
    font-weight: 500;
}

.scm-sidebar-toggle-btn:hover {
    border-color: var(--bp-accent);
    color: var(--bp-text);
}

.scm-sidebar-toggle-btn.active {
    background: var(--bp-accent-dim);
    border-color: var(--bp-accent);
    color: var(--bp-accent);
    font-weight: 600;
}

/* ── Recent rows ── */
.scm-sidebar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--bp-border-light);
    cursor: pointer;
    transition: background var(--bp-transition-fast);
    text-decoration: none;
}

.scm-sidebar-row:last-child { border-bottom: none; }

.scm-sidebar-row:hover {
    background: rgba(74,158,255,0.06);
}

.scm-sidebar-row:hover .scm-sidebar-row-handle {
    color: var(--bp-accent);
}

.scm-sidebar-row-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--bp-text-muted);
    font-family: var(--bp-mono);
    flex-shrink: 0;
    min-width: 32px;
}

.scm-sidebar-row-info {
    flex: 1;
    min-width: 0;
}

.scm-sidebar-row-handle {
    font-size: 13px;
    font-weight: 600;
    color: var(--bp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--bp-transition-fast);
}

.scm-sidebar-row-date {
    font-size: 11px;
    color: var(--bp-text-muted);
    font-family: var(--bp-mono);
    margin-top: 1px;
}

.scm-sidebar-row-damage {
    font-size: 13px;
    font-weight: 700;
    color: var(--bp-accent);
    font-family: var(--bp-mono);
    flex-shrink: 0;
}

/* ── Top-5 rows с рангом ── */
.scm-sidebar-row--top {
    padding: 10px 16px;
}

.scm-sidebar-row-rank {
    font-size: 11px;
    font-weight: 800;
    color: #444;
    font-family: var(--bp-mono);
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
}

/* Топ-1 выделяем */
.scm-sidebar-row--top:first-child .scm-sidebar-row-rank {
    color: var(--bp-accent);
}

.scm-sidebar-row--top:first-child .scm-sidebar-row-handle {
    color: var(--bp-text);
    font-size: 14px;
}

.scm-sidebar-row--top:first-child .scm-sidebar-row-damage {
    font-size: 14px;
}

/* ══════════════════════════════════════════════════════════
   MODAL — кейс + галерея
   ══════════════════════════════════════════════════════════ */
.scm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}

.scm-modal-overlay.is-open {
    display: flex;
}

.scm-modal {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    width: 100%;
    max-width: 780px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    animation: scmModalIn .18s ease;
}

@keyframes scmModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* ── Modal header ── */
.scm-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--bp-border);
    position: sticky;
    top: 0;
    background: var(--bp-card);
    z-index: 2;
}

.scm-modal-title-block {}

.scm-modal-case-num {
    font-size: 20px;
    font-weight: 900;
    color: var(--bp-text);
    font-family: var(--bp-mono);
    margin-bottom: 4px;
}

.scm-modal-actors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scm-modal-actor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(74,158,255,.08);
    border: 1px solid rgba(74,158,255,.2);
    border-radius: 12px;
    font-size: 12px;
    color: var(--bp-text-secondary);
}

.scm-modal-actor--primary {
    background: rgba(74,158,255,.14);
    border-color: var(--bp-accent);
    color: var(--bp-text);
    font-weight: 600;
}

.scm-modal-actor-tag { color: var(--bp-text-muted); }

.scm-modal-actor-badge {
    font-size: 10px;
    color: var(--bp-accent);
    opacity: .8;
}

.scm-modal-close {
    background: none;
    border: none;
    color: var(--bp-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--bp-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--bp-transition-fast), background var(--bp-transition-fast);
    flex-shrink: 0;
    margin-left: 16px;
}

.scm-modal-close:hover {
    color: var(--bp-text);
    background: var(--bp-card-hover);
}

/* ── Галерея ── */
.scm-gallery {
    background: var(--bp-bg);
    position: relative;
    user-select: none;
}

.scm-gallery-viewport {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.scm-gallery-img.is-active { display: block; }

.scm-gallery-video {
    width: 100%;
    max-height: 100%;
    display: none;
}

.scm-gallery-video.is-active { display: block; }

.scm-gallery-empty {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bp-text-muted);
    font-size: 13px;
    gap: 8px;
}

/* Стрелки */
.scm-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background var(--bp-transition-fast);
    backdrop-filter: blur(4px);
}

.scm-gallery-btn:hover { background: rgba(0,0,0,.8); }
.scm-gallery-btn--prev { left: 10px; }
.scm-gallery-btn--next { right: 10px; }
.scm-gallery-btn:disabled { opacity: .25; cursor: default; }

/* Счётчик */
.scm-gallery-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    pointer-events: none;
}

/* ── Modal body ── */
.scm-modal-body {
    padding: 20px 24px;
}

.scm-modal-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--bp-border);
}

.scm-modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.scm-modal-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bp-text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.scm-modal-value {
    font-size: 14px;
    color: var(--bp-text-secondary);
    line-height: 1.6;
    word-break: break-word;
}

.scm-modal-value--damage {
    font-size: 20px;
    font-weight: 800;
    color: var(--bp-text);
    font-family: var(--bp-mono);
}

.scm-modal-value--mono {
    font-family: var(--bp-mono);
    font-size: 13px;
    word-break: break-all;
}

/* ── Modal footer ── */
.scm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--bp-border);
}

.scm-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-xs);
    color: var(--bp-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--bp-transition-fast), color var(--bp-transition-fast);
}

.scm-share-btn:hover {
    border-color: var(--bp-accent);
    color: var(--bp-text);
}

.scm-share-btn--copied {
    border-color: var(--bp-green, #22c55e) !important;
    color: var(--bp-green, #22c55e) !important;
}

.scm-arbitrage-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--bp-accent);
    border: none;
    border-radius: var(--bp-radius-xs);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--bp-transition-fast);
}

.scm-arbitrage-btn:hover { background: var(--bp-accent-hover); }

/* ── Modal loading/error states ── */
.scm-modal-loading,
.scm-modal-error {
    padding: 48px 24px;
    text-align: center;
    color: var(--bp-text-muted);
    font-size: 14px;
}

.scm-modal-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bp-border);
    border-top-color: var(--bp-accent);
    border-radius: 50%;
    animation: scmSpin .7s linear infinite;
    margin-bottom: 12px;
}

@keyframes scmSpin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   SKELETON CARDS (пока грузится)
   ══════════════════════════════════════════════════════════ */
.scm-skeleton {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    overflow: hidden;
    animation: scmPulse 1.4s ease-in-out infinite;
}

@keyframes scmPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .55; }
}

.scm-skeleton-thumb {
    aspect-ratio: 16/9;
    background: var(--bp-card-hover);
}

.scm-skeleton-body {
    padding: 12px 14px 14px;
}

.scm-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: var(--bp-card-hover);
    margin-bottom: 8px;
}

.scm-skeleton-line--sm { width: 50%; }
.scm-skeleton-line--md { width: 75%; }
.scm-skeleton-line--lg { width: 100%; }

/* ══════════════════════════════════════════════════════════
   LIGHTBOX — fullscreen viewer
   ══════════════════════════════════════════════════════════ */
.scm-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}

.scm-lightbox.is-open { display: flex; }

.scm-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    cursor: default;
}

/* Видео в лайтбоксе — те же габариты что у img */
.scm-lightbox-video {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    display: block;
    background: #000;
    outline: none;
}

.scm-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 1501;
}

.scm-lightbox-close:hover { background: rgba(255,255,255,.18); }

.scm-lightbox-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 1501;
    line-height: 1;
}

.scm-lightbox-btn:hover { background: rgba(255,255,255,.18); }
.scm-lightbox-btn:disabled { opacity: .2; cursor: default; }
.scm-lightbox-btn--prev { left: 20px; }
.scm-lightbox-btn--next { right: 20px; }

.scm-lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    padding: 5px 14px;
    border-radius: 20px;
    z-index: 1501;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   GRID LOADING STATE — плавный fade без прыжка высоты
   ══════════════════════════════════════════════════════════ */
.scm-grid--loading {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Быстрый fade-in когда данные вернулись */
#scmGrid:not(.scm-grid--loading) {
    transition: opacity 0.18s ease;
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   FILTER BUTTON — кнопка рядом с поиском
   ══════════════════════════════════════════════════════════ */
.scm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 34px;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: var(--bp-radius-xs);
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
}

.scm-filter-btn:hover {
    border-color: #444;
    color: var(--bp-text);
}

.scm-filter-btn--open {
    border-color: rgba(74,158,255,.5);
    color: #4a9eff;
    background: rgba(74,158,255,.06);
}

/* Badge с числом активных фильтров */
.scm-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #4a9eff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

/* Chevron — анимируется при открытии */
.scm-filter-chevron {
    transition: transform .2s ease;
    color: #555;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   FILTER PANEL — выдвижная панель с чипами
   ══════════════════════════════════════════════════════════ */
.scm-filter-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height .22s ease, opacity .18s ease;
    opacity: 0;
    border-bottom: 0px solid #222;
}

.scm-filter-panel--open {
    max-height: 120px;
    opacity: 1;
    border-bottom: 1px solid #222;
}

.scm-filter-panel-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 20px 12px;
    background: #111;
}

.scm-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scm-filter-group-label {
    font-size: 10px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Вертикальный разделитель между группами */
.scm-filter-group-sep {
    width: 1px;
    height: 18px;
    background: #2a2a2a;
    flex-shrink: 0;
    align-self: center;
}

/* Кнопка сброса — справа */
.scm-filter-reset {
    margin-left: auto;
    padding: 3px 10px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #555;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
}

.scm-filter-reset:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* ══════════════════════════════════════════════════════════
   CHIPS — общий стиль для обоих групп фильтров
   ══════════════════════════════════════════════════════════ */
.scm-damage-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.scm-damage-chip {
    padding: 3px 11px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
    line-height: 1.6;
}

.scm-damage-chip:hover {
    color: var(--bp-text);
    border-color: #444;
}

.scm-damage-chip.active {
    background: rgba(74,158,255,0.1);
    border-color: rgba(74,158,255,0.4);
    color: #4a9eff;
    font-weight: 600;
}

/* $1000+ — красный акцент */
.scm-damage-chip--hot.active {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}

.scm-damage-chip--hot:hover {
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

/* ══════════════════════════════════════════════════════════
   SEARCH COUNT BAR — PR-1: счётчик результатов под control bar
   ══════════════════════════════════════════════════════════ */
.scm-search-count {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 20px;
    font-size: 12px;
    color: var(--bp-text-muted);
    background: #111;
    border-bottom: 1px solid #222;
    line-height: 1.5;
}

.scm-search-count strong {
    color: #4a9eff;
    font-weight: 700;
}

/* Тег активного фильтра — маленький чип */
.scm-count-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    background: rgba(74,158,255,0.08);
    border: 1px solid rgba(74,158,255,0.2);
    border-radius: 10px;
    font-size: 11px;
    color: #4a9eff;
    font-weight: 500;
}


/* ══════════════════════════════════════════════════════════
   INFO STRIP — дисклеймер + горизонтальные шаги подачи жалобы
   Позиция: между .scm-hero и .scm-layout
   Паттерн: единый стиль платформы (proxy/sms/exchange)
   ══════════════════════════════════════════════════════════ */
.scm-info-strip {
    width: min(860px, 100%);
    margin: 0 auto 20px;
    background: var(--bp-card, #1f1f1f);
    border: 1px solid var(--bp-border, #2a2a2a);
    border-radius: 16px;
    overflow: hidden;
}

/* ── Верхняя строка: иконка + текст + CTA ── */
.scm-info-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #222;
}

.scm-info-icon {
    width: 32px;
    height: 32px;
    background: rgba(74, 158, 255, 0.10);
    border: 1px solid rgba(74, 158, 255, 0.20);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #4a9eff;
}

.scm-info-disclaimer {
    flex: 1;
    font-size: 13px;
    color: var(--bp-text-secondary, #888);
    line-height: 1.5;
    margin: 0;
    min-width: 0;
}

/* ── Нижняя строка: 6 шагов ── */
.scm-info-steps {
    display: flex;
    background: #111;
}

.scm-info-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    text-align: center;
    border-right: 1px solid #1e1e1e;
    min-width: 0;
}

.scm-info-step:last-child {
    border-right: none;
}

.scm-info-step-num {
    width: 20px;
    height: 20px;
    background: rgba(74, 158, 255, 0.10);
    border: 1px solid rgba(74, 158, 255, 0.18);
    border-radius: 5px;
    color: #4a9eff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scm-info-step-lbl {
    font-size: 11px;
    color: #666;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .scm-expand-inner {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    /* PR-1 ROOT FIX: clamp(900px,...) возвращает 900px minimum на мобиле —
       переопределяем max-width чтобы карточка не была шире viewport */
    .scm-page {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        padding: 0 12px 60px;
    }

    /* ── Hero ── */
    .scm-hero { padding: 32px 0 24px; }

    .scm-hero-title {
        font-size: 28px;
        gap: 10px;
    }

    .scm-hero-icon {
        width: 42px;
        height: 42px;
    }

    .scm-hero-icon svg {
        width: 22px;
        height: 22px;
    }

    .scm-hero-sub {
        font-size: 14px;
        padding: 0 8px;
    }

    /* Метрики — 2x2 сетка */
    .scm-hero-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .scm-hero-metric-sep { display: none; }

    .scm-hero-metric {
        padding: 14px 12px;
        border-right: 1px solid var(--bp-border);
        border-bottom: 1px solid var(--bp-border);
    }

    /* Убираем лишние border у крайних ячеек */
    .scm-hero-metric:nth-child(2n) { border-right: none; }
    .scm-hero-metric:nth-last-child(-n+2) { border-bottom: none; }

    .scm-hero-metric-val { font-size: 20px; }

    .scm-hero-metric-lbl {
        font-size: 10px;
        letter-spacing: .3px;
    }

    /* CTA кнопки — вертикально */
    .scm-hero-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 0px;
        gap: 10px;
    }

    .scm-hero-cta,
    .scm-hero-ghost {
        width: 100%;
        justify-content: center;
        padding: 13px 20px;
        font-size: 15px;
    }

    /* ── Content card ── */
    .scm-content-card {
        border-radius: 14px;
    }

    /* ── Info strip — мобиль ── */
    .scm-info-strip {
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .scm-info-top {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .scm-info-icon {
        display: none; /* убираем иконку на мобиле — экономим горизонталь */
    }

    .scm-info-disclaimer {
        font-size: 12px;
        flex-basis: 100%;
    }

    .scm-info-step-lbl {
        font-size: 10px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* ── Control bar: title сверху, табы + search снизу ── */
    .scm-control-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 14px 12px;
    }

    .scm-section-title {
        font-size: 16px;
    }

    /* Правая часть — табы + search на всю ширину */
    .scm-control-bar-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    /* Табы — растягиваем на всю ширину равномерно */
    .scm-tabs {
        display: flex;
        width: 100%;
        overflow: visible;
    }

    .scm-tab {
        flex: 1;
        text-align: center;
        font-size: 12px;
        padding: 7px 6px;
        white-space: nowrap;
    }

    /* Search slot — полная ширина на мобиле */
    .scm-control-slot {
        width: 100%;
        max-width: 100%;
        flex: 1;
        height: 38px;
    }

    /* ── Registry ── */
    .scm-registry-head { display: none; }

    .scm-row-inner {
        grid-template-columns: 54px 1fr auto 26px;
        gap: 8px;
        padding: 10px 12px;
    }

    .scm-row-inner .scm-row-num { display: none; }

    /* Превью чуть меньше на мобиле */
    .scm-row-thumb {
        width: 46px;
        height: 32px;
    }

    .scm-row-damage-cell {
        display: flex;
        align-items: center;
        gap: 6px;
        justify-content: flex-end;
    }

    /* Хэндл — не обрезается */
    .scm-row-actor-cell {
        min-width: 0;
    }

    .scm-row-actor {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    /* ── Expand контейнеры: жёсткое ограничение по ширине ── */
    .scm-row-expand,
    .scm-grouped-expand {
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* ── Expand inner: block вместо grid — убираем 1fr расчёты ── */
    /* display:block гарантирует, что дочерние блоки = 100% ширины контейнера */
    .scm-expand-inner,
    .scm-grouped-expand .scm-expand-inner {
        display: block;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Gallery: полная ширина, без правого border */
    .scm-exp-gallery,
    .scm-grouped-expand .scm-exp-gallery {
        width: 100%;
        box-sizing: border-box;
        border-right: none;
        border-bottom: 1px solid var(--bp-border);
    }

    .scm-exp-slides { height: 240px; }

    /* Meta: block, 100%, overflow hidden — текст wraps через break-word */
    .scm-exp-meta {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        padding: 16px 14px;
        min-width: 0;
    }

    /* Секции внутри meta: тоже ограничиваем */
    .scm-exp-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }

    /* Текст: принудительный перенос на мобиле */
    .scm-exp-value {
        width: 100%;
        max-width: 100%;
        word-break: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    /* Mono реквизиты: тоже ограничиваем */
    .scm-exp-mono-row {
        width: 100%;
        box-sizing: border-box;
    }

    /* Actor IDs — скрываем на мобиле */
    .scm-exp-actor-id { display: none; }

    /* Actor group mobile */
    .scm-actor-header {
        padding: 12px 14px;
    }

    .scm-actor-cases-head {
        grid-template-columns: 44px 80px 1fr 16px;
        padding-left: 38px;
    }

    .scm-actor-case-row {
        grid-template-columns: 44px 80px 1fr 16px;
        padding: 9px 12px 9px 38px;
    }

    /* Panel inner */
    .scm-panel-inner {
        padding: 12px 12px 16px;
    }

    /* PR-3+4: Filter panel mobile */
    .scm-filter-btn { height: 36px; font-size: 12px; }
    .scm-filter-panel--open { max-height: 200px; }
    .scm-filter-panel-inner { padding: 10px 12px 12px; gap: 8px; }
    .scm-filter-group-label { display: none; }
    .scm-filter-group-sep   { display: none; }
    .scm-filter-reset       { margin-left: 0; }
    .scm-damage-chip { font-size: 11px; padding: 3px 9px; }
}

@media (max-width: 480px) {
    .scm-page {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        padding: 0 8px 60px;
    }

    .scm-hero-title { font-size: 24px; }

    .scm-hero-metric-val { font-size: 18px; }

    .scm-row-inner {
        grid-template-columns: 44px 1fr auto 24px;
        padding: 9px 10px;
    }

    .scm-row-link-btn { display: none; }

    .scm-row-damage-cell { gap: 4px; }

    /* Табы — шрифт ещё меньше если не влезает */
    .scm-tab { font-size: 11px; padding: 6px 4px; }

    .scm-actor-cases-head,
    .scm-actor-case-row {
        grid-template-columns: 40px 75px 1fr;
        padding-left: 32px;
    }

    .scm-actor-case-arrow { display: none; }
}

