/* Альфа-Бизнес · Инсайты. Токены — из макета Figma («Дизайн · Компоненты»). */
:root {
  --red: #ef3124;
  --red-soft: #fff1ef;
  --ink: #1c1c1e;
  --ink-2: #4d4d52;
  --muted: #86868b;
  --placeholder: #a6a6ab;
  --bg: #f3f4f6;
  --line: #e4e5e8;
  --white: #ffffff;
  --blue: #3e8bf5;
  --blue-soft: #e8f1fe;
  --violet: #6a3fd8;
  --violet-soft: #efeafe;
  --green: #16934a;
  --green-soft: #e3f6ea;
  --yellow: #a86a00;
  --yellow-soft: #fff4d6;
  --orange: #d9480f;
  --orange-soft: #ffede5;
  --highlight: #ffeb99;
  --radius-card: 24px;
  --radius-btn: 16px;
  --shadow-modal: 0 24px 64px rgba(28, 28, 30, 0.22);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.35; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Каркас ---------- */
.topbar {
  height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 24px 0 16px;
  position: sticky; top: 0; z-index: 20; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.topbar-spacer { flex: 1; }
.company-switch { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; text-align: left; }
.company-switch:hover { background: #fff; }
.company-switch { min-width: 0; }
.company-switch > span:last-child { min-width: 0; }
.company-switch b { font-size: 14px; font-weight: 600; display: block; overflow-wrap: anywhere; }
.company-switch small { font-size: 12px; color: var(--muted); display: block; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; font-size: 18px; color: var(--ink-2); flex: 0 0 40px; }
.icon-btn:hover, .icon-btn.is-active { background: #fff; color: var(--ink); }

/* Тумблер набора данных: сегменты на общей дорожке, «бегунок» едет под выбранным. */
.ds-toggle { display: flex; align-items: center; gap: 10px; }
.ds-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ds-track { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); background: #fff; border-radius: 20px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.ds-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 17px; background: var(--ink);
  transform: translateX(calc(100% * var(--i))); transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1); }
.ds-track button { position: relative; z-index: 1; height: 34px; padding: 0 16px; border-radius: 17px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: color 0.2s; }
.ds-track button.is-active { color: #fff; }
.ds-toggle.is-busy { opacity: 0.6; pointer-events: none; }
.ds-toggle.is-compact .ds-track button { height: 30px; padding: 0 12px; font-size: 12px; }
.login-source { margin: 20px 0 4px; display: grid; gap: 8px; justify-items: start; }
.ds-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ds-card { background: var(--bg); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; border: 2px solid transparent; }
.ds-card.is-active { border-color: var(--ink); background: #fff; }

/* Настройки демо */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0 0 18px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.key-hint { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; letter-spacing: 0.08em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.card.security-card { background: var(--ink); color: #fff; }
.security-card .card-title { color: #fff; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 13px; line-height: 1.4; color: #d5d5da; }
.checklist li { padding-left: 26px; position: relative; }
.checklist li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 9px; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; font-family: ui-monospace, Consolas, monospace; }
.input-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.input-eye:hover { background: var(--bg); }
.nav-settings { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.sidebar .all { text-align: left; width: 100%; }
button.nav-item { width: 100%; text-align: left; }
.tabs-line button { font: inherit; color: inherit; }

.user-pill { height: 40px; padding: 0 20px; border-radius: 20px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }

.logo { width: var(--s, 36px); height: var(--s, 36px); flex: 0 0 var(--s, 36px); border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: calc(var(--s, 36px) / 2.1); }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 0 32px 64px 12px; }
.sidebar { padding-top: 20px; padding-bottom: 20px; position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 72px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sidebar .all { font-size: 17px; font-weight: 500; padding: 8px 12px 18px; display: block; }
.sidebar hr { border: 0; border-top: 1px solid var(--line); margin: 0 4px 12px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 15px; color: var(--ink); }
.nav-item:hover { background: rgba(255, 255, 255, 0.6); }
.nav-item.is-active { background: #fff; color: var(--red); font-weight: 700; }
.nav-item.is-muted { color: var(--ink); opacity: 0.9; cursor: default; }
/* Раздел «Инсайты»: одна белая плашка на родителя и подпункты, активный подпункт — красным текстом. */
.nav-group.is-open { background: #fff; border-radius: 14px; padding: 2px 0 6px; margin: 2px 0; }
.nav-group.is-open .nav-parent { color: var(--red); font-weight: 700; }
.nav-group.is-open .nav-item:hover { background: var(--bg); }
.nav-sub { padding: 8px 12px 8px 24px; margin: 0 6px; font-size: 14px; color: var(--ink-2); }
.nav-group .nav-sub.is-active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.badge-new { font-size: 10px; font-weight: 700; line-height: 1; color: #fff; background: var(--blue); padding: 4px 7px; border-radius: 8px; letter-spacing: 0.02em; }

.main { min-width: 0; padding-top: 20px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a:hover { color: var(--ink); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: 32px; font-weight: 700; line-height: 1.2; }
.page-sub { color: var(--muted); margin-top: 6px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }

/* ---------- Базовые элементы ---------- */
.card { background: #fff; border-radius: var(--radius-card); padding: 24px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.block-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.link { color: var(--red); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: var(--radius-btn); font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: #d8271b; }
.btn--secondary { background: #fff; color: var(--ink); }
.btn--secondary:hover { background: #fafafa; }
.btn--ghost { background: var(--bg); }
.btn--ghost:hover { background: #e9eaee; }
.btn--block { width: 100%; height: 52px; font-size: 16px; }
.btn--sm { height: 36px; padding: 0 22px; border-radius: 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 12px; border-radius: 14px; background: var(--bg); font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--white { background: #fff; }
.chip--violet { background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.chip--yellow { background: var(--yellow-soft); color: var(--yellow); font-weight: 600; }

.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 13px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag--risk { background: var(--orange-soft); color: var(--orange); }
.tag--opp { background: var(--green-soft); color: var(--green); }
.tag--mixed { background: var(--yellow-soft); color: var(--yellow); }
.tag--neutral { background: var(--bg); color: var(--ink-2); }
.tag--new { background: var(--blue); color: #fff; }

.origin { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.origin--fact { background: var(--blue-soft); color: var(--blue); }
.origin--bank { background: var(--red); color: #fff; }
.origin--ai { background: var(--violet-soft); color: var(--violet); }

.ref { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; }
button.ref:hover { background: var(--blue); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.pill { height: 36px; padding: 0 18px; border-radius: 18px; background: #fff; font-size: 14px; font-weight: 600; }
.pill.is-active { background: var(--ink); color: #fff; }
.pill--select { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; }
.pill--select.is-set { font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }
.pill--select[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.pill--select .caret { font-size: 11px; color: var(--muted); }
.select { height: 36px; padding: 0 34px 0 16px; border-radius: 18px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231c1c1e' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid var(--line); font-size: 14px; appearance: none; cursor: pointer; }

.meter { position: relative; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; background: var(--red); border-radius: 3px; }
.meter--green > i { background: var(--green); }
.meter--violet > i { background: var(--violet); }

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.input, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; font-size: 15px; background: #fff; outline: none; }
.input:focus, .textarea:focus { border-color: var(--ink); }
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }

.segmented { display: flex; gap: 8px; }
.segmented button { height: 36px; padding: 0 20px; border-radius: 18px; background: var(--bg); font-size: 14px; font-weight: 600; }
.segmented button.is-active { background: var(--ink); color: #fff; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eceef1 0%, #f6f7f9 50%, #eceef1 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-card); }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-size: 14px; z-index: 100; box-shadow: var(--shadow-modal); }

/* ---------- Лента ---------- */
.feed-card { display: block; background: #fff; border-radius: var(--radius-card); padding: 24px; }
.feed-card.is-new { border: 1px solid var(--violet); }
.feed-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.feed-card-top .date { font-size: 13px; color: var(--muted); }
.significance { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.significance .meter { width: 64px; }
.feed-card h3 { font-size: 18px; font-weight: 700; line-height: 1.25; margin-bottom: 12px; overflow-wrap: anywhere; }
.feed-card h3 a:hover { color: var(--red); }
.why { background: var(--red-soft); border-radius: 12px; padding: 11px 14px; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.why b { color: var(--red); font-weight: 700; margin-right: 4px; }
.feed-card .summary { color: var(--muted); font-size: 14px; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-card-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bank-mark { color: var(--red); font-size: 13px; font-weight: 600; margin-left: 8px; }
.sources-count { color: var(--muted); font-size: 13px; }
.feed-card-bottom .btn { margin-left: auto; }
.feed-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ai-running { background: var(--violet-soft); color: var(--violet); border-radius: 12px; padding: 11px 14px; font-weight: 600; margin-bottom: 14px; }

.empty { text-align: left; }
.empty-icon { width: 48px; height: 48px; border-radius: 24px; background: var(--bg); display: grid; place-items: center; font-size: 20px; margin-bottom: 18px; }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* ---------- Инсайт ---------- */
.insight-head h1 { font-size: 32px; line-height: 1.2; margin: 16px 0 18px; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-label { font-size: 13px; color: var(--muted); margin-right: 6px; min-width: 90px; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.statement { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 10px 0; }
.statement p { font-size: 16px; line-height: 1.4; }
.statement .refs, .rv .refs { display: flex; flex-wrap: wrap; gap: 4px; }
/* На телефоне номера источников и оценки уходят под текст: иначе текст вывода сжат в узкую колонку. */
@media (max-width: 600px) {
  .statement { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .statement > .refs { grid-column: 2; align-items: center; }
}
/* Уверенность модели — один вид везде: утверждения, риски и возможности, ответы в чате. */
.conf { font-size: 12px; color: var(--violet); margin-top: 4px; }
/* Отзывы на выводы: 👍 / 👎 при наведении (на телефоне — всегда), выбор причины «не полезно». */
.st-fb { display: inline-flex; gap: 2px; margin-left: 4px; opacity: 0; transition: opacity 0.15s; vertical-align: middle; }
[data-fb-scope]:hover .st-fb, .st-fb:focus-within, .st-fb:has(.is-active) { opacity: 1; }
@media (hover: none) { .st-fb { opacity: 1; } }
.st-fb button { width: 28px; height: 24px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); }
.st-fb button.st-fb-down svg { transform: rotate(180deg); }
.st-fb button:hover { background: var(--bg); color: var(--ink); }
.st-fb button.is-active { background: var(--ink); color: #fff; }
.bank-block .st-fb button { color: #b8b8bd; }
.bank-block .st-fb button:hover { background: #3a3a3f; color: #fff; }
.bank-block .st-fb button.is-active { background: #fff; color: var(--ink); }
.fb-btn.is-active { background: var(--ink); color: #fff; }
.fb-mine { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fb-mine:empty { display: none; }
.bank-block .fb-mine { color: #b8b8bd; margin: -8px 0 12px; }
/* Оценка эксперта */
.expert-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.expert-total { font-size: 15px; }
.expert-mine { margin-top: 10px; font-weight: 600; }
.expert-form { display: grid; gap: 14px; }
.expert-form .field-label { margin: 0; display: grid; gap: 6px; }
.expert-form .input, .expert-form .textarea { color: var(--ink); font-weight: 400; }
.expert-q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.expert-q legend { padding: 0; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.expert-q .pill { box-shadow: inset 0 0 0 1px var(--line); }
.expert-q .pill[aria-checked="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.expert-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.expert-remember { display: flex; gap: 8px; align-items: center; }
.expert-form .error { color: var(--red); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.expert-list { margin: 10px 0; padding-left: 20px; display: grid; gap: 4px; }
.fb-reasons { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--bg); color: var(--ink); }
.fb-reasons .textarea { min-height: 64px; font-size: 14px; }
.pill--sm { height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.fb-reasons .pill { box-shadow: inset 0 0 0 1px var(--line); }
.fb-reasons .pill.is-active { box-shadow: none; }
.subtle-label { font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.rv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rv { border-radius: 18px; padding: 20px; }
.rv--risk { background: var(--orange-soft); }
.rv--opp { background: var(--green-soft); }
.rv h4 { margin: 0 0 12px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.rv--risk h4 { color: var(--orange); }
.rv--opp h4 { color: var(--green); }
.rv .item { margin-bottom: 14px; }
.rv .item p { font-size: 15px; }
.rv .item .xsmall { color: var(--ink-2); margin-top: 6px; }
.bank-block { background: var(--ink); color: #fff; border-radius: var(--radius-card); padding: 28px 32px; position: relative; overflow: hidden; }
.bank-block::before { content: ''; position: absolute; left: 16px; top: 24px; bottom: 24px; width: 3px; background: var(--red); border-radius: 2px; }
.bank-block .block-title { display: flex; align-items: center; gap: 12px; }
.bank-quote { font-size: 18px; font-weight: 500; line-height: 1.4; margin-bottom: 14px; }
.bank-src { font-size: 13px; color: #b8b8bd; display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.bank-block .link { color: #ff6b5f; }
.action { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; align-items: start; border-top: 1px solid var(--bg); }
.action:first-of-type { border-top: 0; }
.action-kind { font-size: 12px; font-weight: 600; background: var(--bg); padding: 5px 10px; border-radius: 10px; justify-self: start; }
.product { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
.product-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.product .btn { margin-left: auto; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.src-card { background: var(--bg); border-radius: 16px; padding: 16px; position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.src-card .type { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.src-card .title { font-size: 14px; font-weight: 600; }
.src-card .meta { font-size: 12px; color: var(--muted); }
.src-card .link { margin-top: auto; }
.src-card:has(.thumb) .title, .src-card:has(.thumb) .type { padding-right: 48px; }
.src-card .thumb { position: absolute; right: 12px; top: 12px; width: 36px; height: 46px; border-radius: 4px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.src-card.is-target { box-shadow: 0 0 0 2px var(--blue); }
.side-sources li { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 6px 0; }
.side-sources ul { list-style: none; margin: 0; padding: 0; }

.progress-card h2 { font-size: 20px; margin-bottom: 6px; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.step-dot { width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: 0 0 22px; }
.step-dot--done { background: var(--green); }
.step-dot--running { background: var(--violet); }
.step-dot--pending { border: 1.5px solid var(--line); }
.steps li.is-pending { color: var(--placeholder); }
.steps li.is-running { color: var(--violet); font-weight: 600; }

.banner { border-radius: 16px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.banner--warn { background: var(--yellow-soft); color: var(--yellow); font-weight: 600; }
.banner--info { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.banner .btn { margin-left: auto; }

/* ---------- Окна и панели ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 28, 30, 0.45); z-index: 50; display: grid; place-items: center; padding: 24px; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: var(--radius-card); width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; overscroll-behavior: contain; padding: 32px; box-shadow: var(--shadow-modal); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.modal-head h2 { font-size: 22px; }
.close { font-size: 20px; color: var(--muted); line-height: 1; padding: 4px; }
.close:hover { color: var(--ink); }
.modal .sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal .field { margin-bottom: 18px; }
.modal .hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.modal .error { color: var(--red); font-size: 13px; margin-top: 10px; }

.outcome { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; margin: 20px 0; }
.outcome-icon { width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.outcome-icon--new { background: var(--green-soft); color: var(--green); }
.outcome-icon--joined { background: var(--violet-soft); color: var(--violet); font-size: 26px; }
.outcome-icon--dup { background: var(--yellow-soft); color: var(--yellow); }
.outcome h3 { font-size: 18px; margin-bottom: 4px; }
.outcome p { font-size: 13px; color: var(--muted); }
.event-preview { background: var(--bg); border-radius: 16px; padding: 16px; margin-bottom: 24px; }
.event-preview .top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.event-preview h4 { margin: 0 0 12px; font-size: 16px; line-height: 1.3; }

.pdf-modal { background: var(--ink); color: #fff; width: min(760px, 100%); display: flex; flex-direction: column; overscroll-behavior: contain; }
.pdf-modal .close { color: #99999e; }
.pdf-modal .sub { color: #99999e; }
.pdf-nav { display: flex; gap: 8px; }
.pdf-nav button { width: 40px; height: 40px; border-radius: 12px; background: #38383d; color: #fff; font-size: 20px; font-weight: 700; }
.pdf-nav button[disabled] { opacity: 0.35; }
/* Размер рамки страницы задаёт openPdfViewer (fit): шапка, страница и миниатюры помещаются без прокрутки. */
.pdf-modal--wide { width: min(1100px, 100%); }
.pdf-page { background: #fff; border-radius: 8px; display: grid; place-items: center; overflow: hidden; margin: 8px auto 20px; max-width: 100%; flex: 0 0 auto; }
.pdf-page img { width: 100%; height: 100%; object-fit: contain; }
.pdf-page.is-loading { background: linear-gradient(90deg, #eceef1 0%, #f6f7f9 50%, #eceef1 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.pdf-page.is-loading img { opacity: 0; }
.pdf-strip { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; margin-bottom: 16px; flex: 0 0 auto; overscroll-behavior: contain; }
.pdf-strip button { flex: 0 0 56px; height: 72px; border-radius: 4px; overflow: hidden; background: #fff; opacity: 0.55; outline: 2px solid transparent; }
.pdf-strip button.is-active { opacity: 1; outline-color: var(--red); }
.pdf-strip-num { color: var(--ink); font-size: 12px; font-weight: 500; }
.pdf-strip img { width: 100%; height: 100%; object-fit: cover; }

.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { background: #fff; width: min(480px, 100vw); height: 100vh; display: flex; flex-direction: column; animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 28px 32px 12px; }
.drawer-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drawer-body { padding: 8px 32px 24px; overflow: auto; flex: 1; }
.drawer-foot { padding: 16px 32px 24px; border-top: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 0 0 24px; position: relative; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.timeline .t-title { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.timeline .t-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.timeline .t-time { font-size: 12px; color: var(--muted); }
.step-dot--retry { background: #f0a020; }
.tag-retry { font-size: 11px; font-weight: 600; background: var(--yellow-soft); color: var(--yellow); padding: 3px 8px; border-radius: 8px; }
.feature-list { display: grid; gap: 12px; margin-bottom: 24px; }
.feature-list b { font-size: 14px; display: block; }
.feature-list span { font-size: 12px; color: var(--muted); }

.chat { display: flex; flex-direction: column; gap: 14px; }
.bubble-q { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 18px 18px 4px 18px; padding: 12px 16px; max-width: 85%; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bubble-a { background: var(--bg); border-radius: 18px 18px 18px 4px; padding: 16px; display: grid; gap: 14px; max-width: 100%; }
.bubble-a .st { display: grid; gap: 6px; }
.bubble-a .st-top { display: flex; justify-content: space-between; align-items: center; }
.bubble-a p { font-size: 14px; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
/* Номера и список источников в ответе — не ссылки: серый текст без подсветки. */
.ref-text { font-size: 12px; color: var(--muted); cursor: default; }
.src-text { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.thinking { align-self: flex-start; background: var(--violet-soft); color: var(--violet); font-weight: 600; border-radius: 14px; padding: 10px 16px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
.suggest button { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; font-size: 13px; text-align: left; }
.suggest button:hover:not([disabled]) { border-color: var(--ink); }
.suggest button[disabled] { opacity: 0.5; cursor: default; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 16px; }
.ask-form textarea { border: 0; outline: none; flex: 1; min-width: 0; font-size: 14px; line-height: 20px; padding: 6px 0; background: transparent; resize: none; overflow-y: auto; max-height: 112px; }
.ask-form textarea:disabled { color: var(--muted); }
.ask-form button { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 16px; background: var(--red); color: #fff; font-weight: 700; }
.ask-form button:hover:not([disabled]) { background: #d8271b; }
.ask-form button[disabled] { background: var(--muted); cursor: default; }

/* ---------- Главная Альфа-Бизнеса ---------- */
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.quick .btn { height: 40px; font-size: 14px; border-radius: 12px; }
.hero { background: var(--ink); color: #fff; border-radius: 28px; padding: 16px; display: grid; grid-template-columns: 1.6fr 1fr 1.15fr; gap: 12px; }
.hero-panel { background: #2a2a2e; border-radius: 20px; padding: 20px; }
.hero-balance { font-size: 30px; font-weight: 700; }
.hero-company { font-size: 26px; font-weight: 700; margin-top: 6px; overflow-wrap: anywhere; }
.hero-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 28px; font-size: 13px; }
.hero-value { font-size: 18px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.chip--dark { background: #3a3a3f; color: #fff; }
.no-data { color: var(--muted); font-size: 14px; margin-top: 18px; }
.hero .dim { color: #99999e; font-size: 13px; }
.todo { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; font-size: 14px; }
.todo li { display: flex; justify-content: space-between; }
.todo b { color: #ff6b5f; }
.insights-widget { background: #fff; color: var(--ink); border-radius: 20px; padding: 18px; border: 2px solid var(--red); display: flex; flex-direction: column; gap: 10px; }
.insights-widget h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.iw-item { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.iw-item:hover { color: var(--red); }
.iw-item .tag { justify-self: start; height: 22px; font-size: 11px; padding: 0 8px; }
.tabs-line { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 16px; font-size: 20px; font-weight: 700; color: #b5b5ba; }
.tabs-line .is-active { color: var(--ink); }
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr; gap: 12px; }
.promo { border-radius: 20px; padding: 18px; font-weight: 800; min-height: 180px; }

/* ---------- Профиль ---------- */
.profile-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-hero-text { flex: 1 1 320px; min-width: 0; }
.profile-hero h2 { font-size: 20px; margin-bottom: 10px; overflow-wrap: anywhere; }
.profile-hero .meter { width: 320px; max-width: 100%; margin: 6px 0; }
.profile-hero .btn { margin-left: auto; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card { background: #fff; border-radius: 20px; padding: 20px; }
.feature-card .label { font-size: 12px; color: var(--muted); }
.feature-card .value { font-size: 22px; font-weight: 700; margin: 8px 0; }
.feature-card .value.yes { color: var(--green); }
.feature-card .value.no { color: var(--muted); }
.feature-card .why-text { font-size: 12px; color: var(--muted); }
.cp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cp-table th { text-align: left; font-size: 12px; font-weight: 400; color: var(--muted); padding: 0 8px 12px; }
.cp-table td { padding: 12px 8px; border-top: 1px solid var(--bg); }
.cp-table .meter { width: 120px; display: inline-block; vertical-align: middle; margin-right: 12px; }
.section-title { font-size: 20px; font-weight: 700; margin: 28px 0 14px; }

/* ---------- Аналитика банка ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.report-card { background: #fff; border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; text-align: left; }
.report-card:hover .report-pages { background: #eceef1; }
.report-pages { background: var(--bg); border-radius: 16px; padding: 24px 24px 14px; margin-bottom: 18px; transition: background 0.15s; }
.report-pages .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.report-pages .pg { aspect-ratio: 3 / 4; background: #fff; border-radius: 4px; overflow: hidden; }
.report-pages .pg img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.report-pages .pg--empty { background: rgba(255, 255, 255, 0.5); }
.report-card .rubric { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.report-card h3 { font-size: 16px; line-height: 1.3; margin-bottom: 10px; }
.report-card .info { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.report-card .link { margin-top: auto; }
.ingest-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Вход ---------- */
.login { max-width: 560px; margin: 40px auto; }
.login h1 { font-size: 32px; margin-bottom: 8px; }
.account-list { display: grid; gap: 8px; margin: 24px 0; }
.account { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 18px; padding: 14px 16px; text-align: left; border: 2px solid transparent; }
.account:hover { border-color: var(--line); }
.account.is-active { border-color: var(--red); background: var(--red-soft); }
.account b { display: block; font-size: 15px; }
.account small { display: block; color: var(--muted); font-size: 12px; }
.role-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

/* Выпадающий список компаний и ролей */
.dropdown { position: fixed; width: 340px; background: #fff; border-radius: 20px; padding: 8px; box-shadow: var(--shadow-modal); z-index: 40; max-height: 70vh; overflow: auto; }
.dropdown .group-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px 6px; }
.dropdown .opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; text-align: left; }
.dropdown .opt:hover { background: var(--bg); }
.dropdown .opt.is-active { background: var(--red-soft); }
.dropdown .opt b { font-size: 14px; display: block; }
.dropdown .opt small { font-size: 12px; color: var(--muted); display: block; }
.dropdown .check { margin-left: auto; color: var(--red); font-weight: 700; }
.dropdown--select { width: auto; min-width: 220px; max-width: min(360px, calc(100vw - 32px)); }
.dropdown--select .opt { padding: 9px 12px; }
.dropdown--select .opt b { overflow-wrap: anywhere; }
.dropdown .opt:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }

@media (max-width: 1200px) {
  .two-col, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .ds-label { display: none; }
  .hero { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 16px 48px; gap: 0; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; }
  .company-switch small, .brand > span:last-child { display: none; }
  .rv-grid, .feature-grid, .ds-cards { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 8px; }
  .topbar #ds-slot { display: none; } /* на телефоне тумблер — в «Настройках демо» (⚙) */
  .user-pill { padding: 0 12px; }
  .action { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; }
  .page-title, .insight-head h1 { font-size: 26px; }
  .significance .meter { display: none; }
  .profile-hero .btn { margin-left: 0; width: 100%; }
}
