/* Бизнес-радар — визуальный язык в духе Альфа-Банка: красный акцент, чёрный, много воздуха,
   крупная плотная типографика, скругления 20–24 px. Шрифт Inter (OFL) лежит в /static/fonts. */

@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/static/fonts/InterDisplay-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/static/fonts/InterDisplay-ExtraBold.woff") format("woff"); font-weight: 800; font-display: swap; }

:root {
  --red: #ef3124; --red-2: #ff5440; --red-deep: #c4170c; --black: #0b0b0d;
  --bg: #f2f3f5; --surface: #ffffff; --ink: #0b0b0d; --ink2: #2f3238; --muted: #737a85; --line: #e5e7eb;
  --soft: #f6f7f9; --soft2: #eef0f3; --sk1: #eceef1; --sk2: #f7f8fa;
  --accent: var(--red); --accent-ink: #ffffff; --on-ink: #ffffff;
  --risk: #e5302a; --risk-bg: #fdecea; --opp: #0f9d58; --opp-bg: #e3f6ec; --mixed: #c97a00; --mixed-bg: #fdf1df;
  --watch: #2f6fd6; --watch-bg: #e7effc; --fact: #2f6fd6; --bank: var(--red); --ai: #7a4fd6;
  --bank-bg: #fff1ef; --ai-bg: #f4f0ff; --hl: #fff6c2; --warn-bg: #fff5da; --warn-ink: #8a5b00; --warn-bg2: #ffe6bf; --warn-ink2: #8f3d00;
  --ind-bg: #f5f0e6; --ind-ink: #6d5422;
  --radius: 22px; --radius-s: 14px;
  --shadow: 0 1px 2px rgba(16, 18, 22, .04), 0 10px 30px rgba(16, 18, 22, .06);
  --shadow-lift: 0 2px 4px rgba(16, 18, 22, .05), 0 22px 48px rgba(16, 18, 22, .12);
  --sidebar: #0b0b0d; --sidebar-ink: #c9ccd2; --top-bg: rgba(255, 255, 255, .86);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Display", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #0b0b0d; --surface: #16171a; --ink: #f2f3f5; --ink2: #c9ccd2; --muted: #8e949e; --line: #2a2c31;
  --soft: #1c1d21; --soft2: #232429; --sk1: #1c1d21; --sk2: #26272c; --on-ink: #0b0b0d;
  --risk: #ff5a4f; --risk-bg: #3a1b19; --opp: #34d17f; --opp-bg: #14301f; --mixed: #ffb340; --mixed-bg: #33261a;
  --watch: #6aa6ff; --watch-bg: #172338; --fact: #6aa6ff; --ai: #a98bff; --bank-bg: #2e1916; --ai-bg: #221c36;
  --hl: #3d3613; --warn-bg: #352b14; --warn-ink: #f2c46b; --warn-bg2: #3f2a12; --warn-ink2: #ffb36b; --ind-bg: #2e281d; --ind-ink: #e2c48a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35); --shadow-lift: 0 22px 48px rgba(0, 0, 0, .55);
  --sidebar: #060607; --top-bg: rgba(22, 23, 26, .86);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d; --surface: #16171a; --ink: #f2f3f5; --ink2: #c9ccd2; --muted: #8e949e; --line: #2a2c31;
    --soft: #1c1d21; --soft2: #232429; --sk1: #1c1d21; --sk2: #26272c; --on-ink: #0b0b0d;
    --risk: #ff5a4f; --risk-bg: #3a1b19; --opp: #34d17f; --opp-bg: #14301f; --mixed: #ffb340; --mixed-bg: #33261a;
    --watch: #6aa6ff; --watch-bg: #172338; --fact: #6aa6ff; --ai: #a98bff; --bank-bg: #2e1916; --ai-bg: #221c36;
    --hl: #3d3613; --warn-bg: #352b14; --warn-ink: #f2c46b; --warn-bg2: #3f2a12; --warn-ink2: #ffb36b; --ind-bg: #2e281d; --ind-ink: #e2c48a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35); --shadow-lift: 0 22px 48px rgba(0, 0, 0, .55);
    --sidebar: #060607; --top-bg: rgba(22, 23, 26, .86);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
b, strong { font-weight: 650; }
a { color: var(--watch); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 26px; font-weight: 700; margin: 6px 0; }
.red { color: var(--red); }
::selection { background: rgba(239, 49, 36, .22); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 700; }
.sub-h { font-weight: 700; font-size: 13px; margin: 16px 0 6px; }

select, input, textarea { font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--surface); color: var(--ink); max-width: 320px; transition: border-color .15s; }
select:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
select:focus, input:focus, textarea:focus { border-color: var(--red); outline: none; }
textarea, input[type=url] { width: 100%; max-width: none; margin-bottom: 10px; }

/* ---------- кнопки */
.btn { background: var(--ink); color: var(--on-ink); border: 0; border-radius: 12px; padding: 9px 16px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .16); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.btn-red, .tour-btn { background: var(--red); color: #fff; }
.btn-red:hover, .tour-btn:hover { background: var(--red-2); box-shadow: 0 10px 26px rgba(239, 49, 36, .38); }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn-glass { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .16); }
.icon-btn { border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; width: 38px; height: 36px; cursor: pointer; display: grid; place-items: center; transition: box-shadow .2s; }
.icon-btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--red); }

/* ---------- шапка */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: var(--top-bg); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.brand { font-weight: 800; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(239, 49, 36, .35); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt small { font-family: var(--font); font-weight: 600; font-size: 12px; color: var(--red); letter-spacing: 0; }
.proto { font: 600 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; letter-spacing: .02em; }
.session { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; align-items: flex-end; }
.session label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.session select { font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; padding: 7px 10px; border-radius: 11px; max-width: 250px; }
#roleSelect { max-width: 200px; }
.user-chip { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); padding: 7px 0; text-transform: none; letter-spacing: 0; font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.budget-badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 7px 12px; background: var(--soft2); white-space: nowrap; cursor: help; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.budget-badge.ok { background: var(--opp-bg); color: var(--opp); }
.budget-badge.mid { background: var(--mixed-bg); color: var(--mixed); }
.budget-badge.low { background: var(--risk-bg); color: var(--risk); }
.budget-badge.off { color: var(--muted); }

/* ---------- каркас */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--top-h, 64px)); background: linear-gradient(90deg, var(--sidebar) 240px, transparent 240px); }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: var(--top-h, 64px); height: calc(100vh - var(--top-h, 64px)); overflow-y: auto; }
.nav-item { padding: 10px 12px; border-radius: 12px; cursor: pointer; text-decoration: none; color: var(--sidebar-ink); display: flex; align-items: center; gap: 12px;
  font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav-item svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-item span:not(.badge) { flex: 1; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 650; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
.nav-item.active svg { color: var(--red); opacity: 1; }
.nav-item.muted { color: #5f646d; cursor: default; }
.nav-item.muted:hover { background: none; color: #5f646d; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #50545c; margin: 16px 12px 6px; font-weight: 700; }
.nav-foot { margin-top: auto; padding: 16px 12px 4px; font-size: 11px; color: #50545c; line-height: 1.5; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; flex: none !important; }
.badge:empty { display: none; }

main { padding: 24px 28px 28px; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h2 { font-size: 34px; margin: 2px 0 0; }
.card, .feed-col, .impact-wrap, .scenarios, .tabs, .hero { scroll-margin-top: calc(var(--top-h, 64px) + 18px); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.skeleton { height: 120px; border-radius: 16px; background: linear-gradient(90deg, var(--sk1), var(--sk2), var(--sk1)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { color: var(--muted); padding: 48px 32px; text-align: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.loading { color: var(--muted); padding: 20px; }
.notice { font-size: 12.5px; background: var(--warn-bg); border-radius: 10px; padding: 8px 12px; margin: 8px 0; color: var(--warn-ink); }
.ok { color: var(--opp); }
.bad { color: var(--risk); }

/* ---------- герой главной */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 8px; align-items: center;
  background: radial-gradient(1200px 520px at 85% 40%, rgba(239, 49, 36, .20), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(239, 49, 36, .10), transparent 60%), #0b0b0d;
  color: #fff; border-radius: 28px; padding: 44px 44px 0; margin-bottom: 22px; overflow: hidden; min-height: 520px; isolation: isolate; }
:root[data-theme="dark"] .hero { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07); } }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 60%); z-index: -1; }
.hero-copy { padding-bottom: 76px; position: relative; z-index: 2; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .7); text-transform: lowercase;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); padding: 6px 12px 6px 10px; border-radius: 999px; }
.hero-eyebrow span:last-child::first-letter { text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(239, 49, 36, .7); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(239, 49, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 49, 36, 0); } }
.hero h1 { font-size: clamp(36px, 4.4vw, 64px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: 20px 0 16px; max-width: 12ch; }
.hero h1 .red { color: var(--red); display: block; }
.hero-sub { color: rgba(255, 255, 255, .72); font-size: 16px; max-width: 54ch; margin: 0 0 26px; }
.hero-sub b { color: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; max-width: 560px; }
.hs { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: transform .2s var(--ease), background .2s, border-color .2s; }
button.hs:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .1); }
.hs b { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hs span { font-size: 12.5px; color: rgba(255, 255, 255, .62); font-weight: 500; }
.hs.risk b { color: #ff5a4f; } .hs.risk:hover { border-color: rgba(255, 90, 79, .6); }
.hs.opportunity b { color: #34d17f; } .hs.opportunity:hover { border-color: rgba(52, 209, 127, .6); }
.hs.watch b { color: #6aa6ff; } .hs.watch:hover { border-color: rgba(106, 166, 255, .6); }
.hs.bank { cursor: default; } .hs.bank b { color: #fff; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-globe { position: relative; align-self: stretch; min-height: 460px; margin: -44px -44px 0 -20px; }
.hero-globe canvas { position: absolute; inset: 0; width: 100%; height: calc(100% - 48px); cursor: grab; touch-action: pan-y; }
.hero-globe canvas.grab { cursor: grabbing; }
.globe-legend { position: absolute; left: 24px; right: 24px; bottom: 62px; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; color: rgba(255, 255, 255, .6); pointer-events: none; }
.globe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg.risk { background: #ff453a; box-shadow: 0 0 8px #ff453a; } .lg.opportunity { background: #30d178; box-shadow: 0 0 8px #30d178; }
.lg.watch { background: #64a8ff; box-shadow: 0 0 8px #64a8ff; } .lg.hq { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 49, 36, .35); }
.lg.partner { background: #fff; transform: rotate(45deg); border-radius: 1px; width: 7px; height: 7px; }
.globe-hint { position: absolute; top: 56px; right: 40px; font-size: 11px; color: rgba(255, 255, 255, .35); pointer-events: none; }
.globe-tip { position: absolute; z-index: 5; width: 300px; background: rgba(22, 23, 26, .92); color: #fff; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px;
  padding: 12px 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); backdrop-filter: blur(12px); pointer-events: none; font-size: 14px; line-height: 1.4; }
.globe-tip .gt-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.globe-tip .muted { color: rgba(255, 255, 255, .55); }
.globe-tip .gt-why { color: rgba(255, 255, 255, .7); margin-top: 6px; }
.globe-tip .gt-cta { color: var(--red-2); font-weight: 600; font-size: 12px; margin-top: 8px; }
.ticker { grid-column: 1 / -1; margin: 0 -44px; border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); overflow: hidden; height: 48px; display: flex; align-items: center;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 34px; white-space: nowrap; animation: tick 60s linear infinite; padding-left: 34px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.tk { display: inline-flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: rgba(255, 255, 255, .62); }
.tk b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--red-2); align-self: center; }
.tk-r { font-size: 11.5px; font-weight: 600; }
.tk-r.up { color: #ff7b70; } .tk-r.down { color: #5fe0a0; }

/* ---------- главная: карточки */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-col { display: grid; gap: 20px; min-width: 0; }
.radar-widget { position: relative; overflow: hidden; }
.radar-widget::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.widget-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.widget-head h2 { font-size: 26px; margin-top: 4px; }
.widget-list { display: flex; flex-direction: column; gap: 10px; }
.w-item { border-radius: 16px; padding: 14px 16px 14px 18px; cursor: pointer; background: var(--soft); position: relative; transition: transform .2s var(--ease), box-shadow .2s, background .2s; }
.w-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--watch); }
.w-item.eff-risk::before { background: var(--risk); } .w-item.eff-opportunity::before { background: var(--opp); } .w-item.eff-mixed::before { background: var(--mixed); }
.w-item:hover { transform: translateX(4px); background: var(--surface); box-shadow: var(--shadow-lift); }
.w-item .title { margin: 6px 0 2px; font-size: 15.5px; line-height: 1.35; }
.w-item .why { font-size: 13px; color: var(--muted); margin-top: 4px; }
.w-item.read { opacity: .6; }
.w-item.read:hover { opacity: 1; }
.quiet { background: var(--opp-bg); color: var(--opp); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 10px; }

.pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-right: 6px; letter-spacing: .01em; }
.pill.risk { background: var(--risk-bg); color: var(--risk); }
.pill.opportunity { background: var(--opp-bg); color: var(--opp); }
.pill.mixed { background: var(--mixed-bg); color: var(--mixed); }
.pill.watch { background: var(--watch-bg); color: var(--watch); }
.pill.bank { background: var(--bank-bg); color: var(--bank); }
.pill.due { background: var(--warn-bg); color: var(--warn-ink); }
.pill.due.soon { background: var(--warn-bg2); color: var(--warn-ink2); }
.globe-tip .pill.risk { background: rgba(255, 69, 58, .2); color: #ff8a80; }
.globe-tip .pill.opportunity { background: rgba(48, 209, 120, .18); color: #6ee7a8; }
.globe-tip .pill.watch { background: rgba(100, 168, 255, .18); color: #9cc5ff; }
.globe-tip .pill.mixed { background: rgba(255, 179, 64, .18); color: #ffcd80; }
.legend { margin: 6px 0 12px; }

.radar-card { display: flex; flex-direction: column; gap: 6px; }
.radar-chart { display: grid; place-items: center; padding: 6px 0; }
.radar-svg { width: 100%; max-width: 320px; overflow: visible; }
.rd-grid { fill: none; stroke: var(--line); }
.rd-axis { stroke: var(--line); }
.rd-shape { fill: color-mix(in srgb, var(--red) 14%, transparent); stroke: var(--red); stroke-width: 2; stroke-linejoin: round; }
.rd-label { font-size: 10px; fill: var(--muted); font-family: var(--font); font-weight: 500; }
.rd-dot { stroke: var(--surface); stroke-width: 2; opacity: .95; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }

.profile-card h3 { font-size: 20px; margin-top: 4px; }
.profile-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 13.5px; }
.profile-card dt { color: var(--muted); }
.profile-card dd { margin: 0; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; background: var(--soft2); border-radius: 999px; padding: 3px 10px; font-weight: 500; }
button.chip { border: 0; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); transition: transform .15s, box-shadow .15s; }
button.chip:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip.interest.more { background: var(--opp-bg); color: var(--opp); font-weight: 650; }
.chip.interest.mute { background: var(--soft); color: var(--muted); text-decoration: line-through; }
.chip.trust { font-weight: 650; }
.chip.trust.official { background: var(--bank-bg); color: var(--red); }
.chip.trust.agency { background: var(--watch-bg); color: var(--watch); }
.chip.trust.demo { background: var(--ai-bg); color: var(--ai); }
.chip.geo { background: var(--opp-bg); color: var(--opp); }
.chip.ind { background: var(--ind-bg); color: var(--ind-ink); }
.overrides { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; }
.ov { border-radius: 8px; padding: 2px 8px; background: var(--soft2); }
.ov.more { background: var(--opp-bg); }
.ov.less, .ov.mute { background: var(--risk-bg); }
.mix-row, .peer-row { display: grid; grid-template-columns: 1fr 90px 40px; gap: 8px; align-items: center; font-size: 12px; margin: 4px 0; }
.peer-row { grid-template-columns: 1fr 80px 36px 46px; }
.mix-row i, .peer-row .bar i { display: block; height: 8px; border-radius: 4px; background: var(--ink); }
.mix-row i { grid-column: 2; }
.mix-row.unk i { background: var(--line); }
.peer-row .bar { background: var(--soft2); border-radius: 4px; height: 8px; overflow: hidden; }
.peer-row .bar i { background: var(--red); }
.mix-row b, .peer-row b { text-align: right; }

.bank-card { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--surface) 55%, color-mix(in srgb, var(--red) 6%, var(--surface))); }
.bank-card table.fc { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.bank-card td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.bank-card td.num { font-weight: 750; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rev { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.rev.up { background: var(--risk-bg); color: var(--risk); }
.rev.down { background: var(--opp-bg); color: var(--opp); }
.spark { width: 100%; height: 86px; margin: 4px 0; }
.spark text { font-size: 10px; fill: var(--ink); font-family: var(--font); font-weight: 600; }
.spark text.lbl { fill: var(--muted); font-weight: 500; }

/* ---------- лента и разбор */
.radar-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.65fr); gap: 22px; align-items: start; }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.feed-head h2 { font-size: 24px; white-space: nowrap; }
.feed-head .btn { white-space: nowrap; }
.feed-tools { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--soft2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink); padding: 6px 12px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 550; transition: background .15s, color .15s; }
.seg button:hover { color: var(--red); }
.seg button.on { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tool-row input[type=search] { flex: 1 1 160px; min-width: 120px; }
.tool-row select { font-size: 13px; padding: 6px 8px; }
.chk { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.chk input { accent-color: var(--red); }
.rerank-note { min-height: 18px; color: var(--ai); }

.feed-item { background: var(--surface); border-radius: 18px; padding: 14px 16px 14px 20px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); position: relative;
  border: 1.5px solid transparent; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: cardIn .45s var(--ease) both; }
.feed-item:nth-child(2) { animation-delay: .03s; } .feed-item:nth-child(3) { animation-delay: .06s; } .feed-item:nth-child(4) { animation-delay: .09s; }
.feed-item:nth-child(5) { animation-delay: .12s; } .feed-item:nth-child(n+6) { animation-delay: .15s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feed-item::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--watch); }
.feed-item.eff-risk::before { background: var(--risk); } .feed-item.eff-opportunity::before { background: var(--opp); } .feed-item.eff-mixed::before { background: var(--mixed); }
.feed-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.feed-item.active { border-color: var(--ink); box-shadow: var(--shadow-lift); }
.feed-item .title { font-weight: 650; font-size: 15.5px; line-height: 1.35; margin-top: 6px; padding-right: 22px; }
.feed-item .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.feed-item .reasons { font-size: 13px; margin-top: 8px; color: var(--ink2); font-weight: 500; }
.feed-item.read { background: var(--soft); box-shadow: none; }
.feed-item.read .title { color: var(--muted); font-weight: 550; }
.feed-item.read:not(.active) { opacity: .7; }
.feed-item.read.active .title { color: var(--ink); }
.feed-item.read:hover { opacity: 1; }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 7px; vertical-align: 2px; box-shadow: 0 0 0 3px rgba(239, 49, 36, .18); }
.read-mark { font-size: 11px; color: var(--opp); font-weight: 650; margin-left: 6px; white-space: nowrap; }
.score-bar { height: 3px; background: var(--line); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.score-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ink), var(--red)); border-radius: 3px; }
.hide-btn { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; transition: background .15s; }
.hide-btn:hover { background: var(--soft2); color: var(--ink); }
.unhide { position: absolute; top: 12px; right: 14px; }
.personal { font-size: 12px; color: var(--mixed); margin-top: 4px; }
.ai-note { font-size: 12px; color: var(--ai); margin-top: 6px; }
.ai-note .rel { letter-spacing: 1px; margin-left: 4px; }
.story-badge { margin-top: 8px; font-size: 12px; color: var(--watch); background: var(--watch-bg); border-radius: 8px; padding: 4px 10px; display: inline-block; font-weight: 550; }

.insight-col { position: sticky; top: calc(var(--top-h, 64px) + 16px); max-height: calc(100vh - var(--top-h, 64px) - 32px); overflow: auto; }
.insight { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; animation: viewIn .4s var(--ease); }
.insight > h2 { font-size: 28px; line-height: 1.12; letter-spacing: -.025em; margin: 12px 0 0 !important; }
.takeaway { font-size: 17px; font-weight: 600; line-height: 1.45; background: #0b0b0d; color: #fff; border-radius: 18px; padding: 18px 20px; margin: 16px 0;
  position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); }
.takeaway::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(rgba(239, 49, 36, .35), transparent 70%); }
.takeaway .claim-kind { color: #b9a2ff !important; font-weight: 800; letter-spacing: .06em; font-size: 11px; }
.takeaway .src { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.tab { padding: 10px 14px; cursor: pointer; border: 0; border-bottom: 2.5px solid transparent; background: transparent; font: inherit; font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { border-color: var(--red); color: var(--ink); }
.q { margin: 22px 0; }
.q h4 { margin: 0 0 8px; font-size: 16px; display: flex; gap: 10px; align-items: center; font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
.q h4 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-size: 13px; display: grid; place-items: center; font-family: var(--font); flex: none; }
.claim { padding: 9px 12px 9px 14px; border-left: 3px solid var(--line); margin: 6px 0; background: var(--soft); border-radius: 0 12px 12px 0; font-size: 14px; }
.claim.fact { border-color: var(--fact); }
.claim.assumption { border-color: var(--muted); color: var(--muted); font-style: italic; }
.claim.bank_view { border-color: var(--bank); background: var(--bank-bg); }
.claim.ai_inference { border-color: var(--ai); }
.claim .kind { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.claim.fact .kind { color: var(--fact); } .claim.bank_view .kind { color: var(--bank); } .claim.ai_inference .kind { color: var(--ai); } .claim.assumption .kind { color: var(--muted); }
.src { display: inline-block; font-size: 11px; background: var(--soft2); border-radius: 6px; padding: 1px 7px; margin: 4px 4px 0 0; cursor: pointer; color: var(--ink2); font-style: normal; font-weight: 550; transition: background .15s, color .15s; }
.src:hover { background: var(--ink); color: var(--on-ink); }
.src.bank, .src.forecast, .src.doc { background: var(--bank-bg); color: var(--red); }
.conf { font-size: 11px; color: var(--muted); margin-left: 6px; }
.conf.low { color: var(--mixed); }
.conf-low { opacity: .85; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.product { border: 1.5px dashed color-mix(in srgb, var(--red) 55%, transparent); border-radius: 14px; padding: 12px 14px; margin: 8px 0; font-size: 14px; background: color-mix(in srgb, var(--red) 3%, var(--surface)); }
.product .lbl { font-size: 10.5px; color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.product .btn { margin-top: 8px; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quality { font-size: 13px; padding-left: 18px; }
.quality li { margin: 3px 0; }
.sources-list { padding-left: 20px; }
.sources-list li { margin: 8px 0; font-size: 13.5px; }
.sources-list li.hl { background: var(--hl); border-radius: 8px; }
.trace-step { border-left: 2px solid var(--line); padding: 4px 0 10px 14px; margin-left: 6px; font-size: 13px; }
.trace-step .k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.trace-step pre { white-space: pre-wrap; word-break: break-word; background: var(--soft); border-radius: 10px; padding: 10px; max-height: 220px; overflow: auto; font-size: 12px; }
.feedback { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
#fbReasons { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#fbReasons[hidden] { display: none; }
.disclaimer { margin-top: 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.scale { margin-top: 8px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 6px 0 10px; color: var(--muted); }
.kinds span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k-fact::before { background: var(--fact); } .k-assumption::before { background: var(--muted); }
.k-bank_view::before { background: var(--bank); } .k-ai_inference::before { background: var(--ai); }
details.story { margin: 12px 0; background: var(--soft); border-radius: 14px; padding: 12px 16px; }
details.story summary { cursor: pointer; font-weight: 650; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 8px 10px; cursor: pointer; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.cur { font-weight: 650; cursor: default; }
.timeline li.cur::before { background: var(--red); border-color: var(--red); }
.timeline li:hover:not(.cur) { color: var(--watch); }

/* прогресс агента */
.progress { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
.progress li { padding: 6px 0 6px 28px; position: relative; }
.progress li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.progress li.run::before { background: var(--red); animation: pulse 1s infinite; box-shadow: 0 0 0 4px rgba(239, 49, 36, .18); }
.progress li.ok::before { background: var(--opp); }
.progress li.fallback::before { background: var(--mixed); }
@keyframes pulse { 50% { opacity: .35; } }

/* сценарии и «что если» */
.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.scen { border-radius: 16px; padding: 14px; background: var(--soft); position: relative; overflow: hidden; }
.scen::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line); }
.scen.watch::before { background: var(--watch); } .scen.risk::before { background: var(--risk); } .scen.opportunity::before { background: var(--opp); }
.scen-t { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.scen-v { font-family: var(--display); font-size: 24px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.whatif { margin-top: 14px; border-radius: 16px; padding: 14px 16px; background: var(--soft); }
.whatif summary { cursor: pointer; font-weight: 700; }
.wi-grid { display: grid; gap: 12px; margin: 14px 0; }
.wi-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 80px; gap: 4px 10px; align-items: center; font-size: 14px; }
.wi-row .small { grid-column: 2 / 4; margin-top: -4px; }
.wi-row input[type=range] { width: 100%; accent-color: var(--red); max-width: none; border: 0; padding: 0; }
.wi-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.wi-field { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.wi-field input { width: 100%; max-width: none; }
.wi-out { background: var(--surface); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.wi-total { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.wi-line { display: grid; grid-template-columns: minmax(150px, 260px) 110px 1fr; gap: 8px; font-size: 13px; padding: 3px 0; align-items: baseline; }

/* карта влияния */
.impact-wrap { margin: 14px 0; border-radius: 18px; padding: 14px 16px; background: var(--soft); }
.impact-wrap summary { cursor: pointer; font-weight: 700; }
.impact { position: relative; margin-top: 10px; }
.im-heads { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.im-heads span { position: absolute; top: 0; white-space: nowrap; }
.im-svg { width: 100%; height: auto; overflow: visible; }
.im-edge { fill: none; opacity: .55; transition: opacity .2s; }
.im-node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; transition: opacity .2s; }
.im-node text { font-size: 13px; fill: var(--ink); font-family: var(--font); font-weight: 500; }
.im-node.ev rect { fill: var(--ink); stroke: var(--ink); }
.im-node.ev text { fill: var(--on-ink); font-weight: 600; }
.im-node.fa rect { stroke: var(--watch); }
.im-node.ba rect { stroke: var(--ai); }
.im-node.ba.ind rect { stroke-dasharray: 5 3; }
.im-node.ef.risk rect { fill: var(--risk-bg); stroke: var(--risk); }
.im-node.ef.opportunity rect { fill: var(--opp-bg); stroke: var(--opp); }
.im-node.ef.mixed rect { fill: var(--mixed-bg); stroke: var(--mixed); }
.im-node.ef.watch rect { fill: var(--watch-bg); stroke: var(--watch); }
.im-node.ef text { font-weight: 700; }
.im-node { cursor: default; outline: none; }
.im-edge.dim { opacity: .08; }
.im-node.dim { opacity: .3; }

/* таймлайн агента */
.tl { margin: 10px 0 14px; }
.tl-sum { font-weight: 650; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tl-legend { font-weight: 400; font-size: 12px; color: var(--muted); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.tl-row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr minmax(120px, 190px); gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.tl-track { position: relative; height: 12px; background: var(--soft2); border-radius: 6px; }
.tl-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; min-width: 3px; }
.tl-bar.llm, .tl-legend .llm { background: var(--ai); }
.tl-bar.tool, .tl-legend .tool { background: var(--watch); }
.tl-bar.rules, .tl-legend .rules { background: var(--muted); }

/* чат */
.chat { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.chat h4 { font-family: var(--display); font-size: 18px; margin: 0 0 10px; letter-spacing: -.01em; }
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.msg { padding: 10px 14px; border-radius: 16px; max-width: 90%; white-space: pre-wrap; font-size: 14px; animation: cardIn .3s var(--ease); }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--on-ink); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 6px; white-space: normal; }
.msg.typing::after { content: "…"; animation: pulse 1s infinite; }
.msg.bot p { margin: 0 0 8px; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot ul, .msg.bot ol { margin: 0 0 8px; padding-left: 20px; }
.msg.bot li { margin: 3px 0; }
.chat-row { display: flex; gap: 8px; }
.chat-row input { flex: 1; max-width: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick button { font: inherit; font-size: 12.5px; font-weight: 550; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: box-shadow .15s, color .15s; }
.quick button:hover { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); }
.cite { display: inline-block; margin: 0 0 0 4px; padding: 0 7px; border-radius: 9px; font-size: 11px; line-height: 17px; vertical-align: 1px; background: var(--soft2); color: var(--muted); text-decoration: none; white-space: nowrap; cursor: help; font-weight: 600; }
a.cite { cursor: pointer; }
a.cite:hover { color: var(--red); }
.cite.bank, .cite.forecast, .cite.doc { background: var(--bank-bg); color: var(--red); }
.lbl { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; margin-right: 2px; }
.lbl.bank { background: var(--bank-bg); color: var(--red); }
.lbl.ai { background: var(--ai-bg); color: var(--ai); }

/* ---------- источники, дайджест, мониторинг */
.sources-card { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table.sources { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sources th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
table.sources td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sources tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.status { white-space: nowrap; font-weight: 650; }
.status.ok { color: var(--opp); } .status.mid { color: var(--mixed); } .status.bad { color: var(--risk); } .status.muted { color: var(--muted); font-weight: 400; }
.err { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.digest-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; }
.dg-main h3 { font-size: 24px; margin-top: 4px; }
.dg-list { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.dg-list li { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.dg-list li[data-ev] { cursor: pointer; transition: transform .15s var(--ease); }
.dg-list li[data-ev]:hover { transform: translateX(3px); }
.dg-list li[data-ev]:hover b { text-decoration: underline; }
.dg-side { display: grid; gap: 20px; align-content: start; }
.email .em-head { border-bottom: 1px solid var(--line); padding: 8px 0; margin-bottom: 8px; }
.email .em-body { font-size: 14px; }
.em-btn { display: inline-flex; background: var(--red); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 650; border: 0; cursor: pointer; font: inherit; }
.push-n { margin-top: 8px; background: var(--soft2); border-radius: 16px; padding: 12px 14px; font-size: 14px; }

.mon-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mon-h { margin: 30px 0 0; font-size: 20px; }
.alerts { display: grid; gap: 8px; margin-top: 14px; }
.alert { padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); font-weight: 500; }
.alert.warn { background: rgba(239, 160, 36, .12); border-color: rgba(239, 160, 36, .45); }
.alert.info { background: rgba(60, 130, 230, .09); border-color: rgba(60, 130, 230, .35); }
.alert.ok { background: rgba(40, 170, 90, .09); border-color: rgba(40, 170, 90, .35); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.metric { transition: transform .2s var(--ease), box-shadow .2s; }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.metric .v { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.metric.good { box-shadow: inset 4px 0 0 #1fa463, var(--shadow); }
.metric.warn { box-shadow: inset 4px 0 0 #e0a024, var(--shadow); }
.funnel { margin-top: 14px; display: grid; gap: 10px; }
.fn-row { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 48px; gap: 10px; align-items: center; font-size: 14px; }
.fn-bar { height: 10px; background: var(--soft2); border-radius: 6px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red-2)); border-radius: 6px; }
.fn-row b { text-align: right; }

/* ---------- диалоги, тур, онбординг, тосты */
dialog { border: 0; border-radius: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); width: min(640px, 92vw); background: var(--surface); color: var(--ink); padding: 26px; }
dialog::backdrop { background: rgba(8, 8, 10, .55); backdrop-filter: blur(4px); }
dialog[open] { animation: dlgIn .3s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
dialog h3 { font-size: 24px; margin: 4px 0 6px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; }
.act-form { display: flex; flex-direction: column; gap: 8px; }
.act-form textarea { width: 100%; max-width: none; }
.act-form .row { display: flex; justify-content: flex-end; gap: 8px; }
#onboard { width: min(580px, 92vw); padding: 0; overflow: hidden; }
.ob { padding: 28px 30px; position: relative; }
.ob::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.ob h2 { margin: 6px 0 8px; font-size: 30px; }
.ob-list { padding-left: 22px; margin: 14px 0 20px; display: grid; gap: 10px; }
.ob-list li::marker { color: var(--red); font-weight: 800; }
.ob .row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#tour { display: none; position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#tour.on { display: block; }
.tour-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(8, 8, 10, .62); pointer-events: none; border: 2px solid var(--red); }
.tour-pop { position: fixed; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .4); pointer-events: auto; z-index: 2; }
.tour-pop.corner { box-shadow: 0 0 0 2px var(--red), 0 24px 64px rgba(0, 0, 0, .45); }
.tour-pop h3 { margin: 4px 0 6px; font-size: 19px; }
.tour-pop p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.tour-pop .row { display: flex; justify-content: space-between; gap: 8px; }
.tour-n { font-size: 11px; color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500;
  opacity: 0; transition: .3s var(--ease); pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lift); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-foot { margin-top: 36px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- вход */
body.logged-out .layout, body.logged-out .topbar { display: none; }
.login { position: fixed; inset: 0; background: #070708; color: #fff; overflow: auto; z-index: 40; }
.login[hidden] { display: none; }
.login-globe { position: fixed; right: -12vw; top: 50%; transform: translateY(-50%); width: min(1100px, 90vw); height: min(1100px, 90vw); opacity: .9; pointer-events: none; }
.login-glow { position: fixed; inset: 0; background: radial-gradient(900px 600px at 15% 30%, rgba(239, 49, 36, .16), transparent 60%), linear-gradient(90deg, #070708 30%, rgba(7, 7, 8, .3) 70%, rgba(7, 7, 8, .6)); pointer-events: none; }
.login-inner { position: relative; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 440px); gap: 40px; align-items: center; padding: 48px clamp(20px, 6vw, 96px); max-width: 1440px; margin: 0 auto; }
.brand-light { color: #fff; font-size: 18px; }
.login-hero h1 { font-size: clamp(48px, 7.4vw, 112px); font-weight: 800; letter-spacing: -.045em; line-height: .95; margin: 36px 0 22px; }
.login-hero h1::after { content: "."; color: var(--red); }
.login-lead { font-size: clamp(17px, 1.6vw, 21px); color: rgba(255, 255, 255, .72); max-width: 40ch; margin: 0 0 34px; line-height: 1.5; }
.login-lead b { color: #fff; font-weight: 650; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.login-points li { display: flex; flex-direction: column; padding: 14px 18px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); min-width: 150px; backdrop-filter: blur(6px); }
.login-points b { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.login-points span { font-size: 13px; color: rgba(255, 255, 255, .6); max-width: 18ch; }
.login-form { background: rgba(255, 255, 255, .96); color: #0b0b0d; border-radius: 28px; padding: 32px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
  animation: dlgIn .6s var(--ease); }
.login-form h2 { margin: 0 0 4px; font-size: 34px; color: #0b0b0d; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #737a85; font-weight: 600; }
.login-form input { max-width: none; background: #fff; color: #0b0b0d; border-color: #e5e7eb; padding: 11px 14px; font-size: 15px; }
.login-form .sub-h { color: #0b0b0d; }
.login-form .muted { color: #737a85; }
.login-err { color: #e5302a; font-size: 13px; min-height: 18px; }
.demo-list { display: grid; gap: 6px; max-height: 280px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.demo-acc { text-align: left; border: 0; box-shadow: inset 0 0 0 1.5px #e5e7eb; background: #fff; color: #0b0b0d; border-radius: 14px; padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; font: inherit;
  transition: box-shadow .15s, transform .15s var(--ease); }
.demo-acc:hover { box-shadow: inset 0 0 0 1.5px var(--red); transform: translateX(3px); }
.demo-acc b { font-weight: 650; }
.login-note { margin: 4px 0 0; }

/* ---------- адаптив */
@media (min-width: 981px) {
  #view-radar .radar-grid { height: calc(100vh - var(--top-h, 64px) - 48px); }
  body[data-view="radar"] main { padding-bottom: 24px; }
  body[data-view="radar"] .app-foot { display: none; }
  #view-radar .feed-col, #view-radar .insight-col { height: 100%; max-height: none; overflow-y: auto; overscroll-behavior: contain; position: static; padding: 0 6px 4px 2px; }
  #view-radar .feed-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 2px 0 6px; }
}
@media (min-width: 1281px) { .topbar { flex-wrap: nowrap; } }
@media (max-width: 1600px) { .proto { display: none; } }
@media (max-width: 1280px) {
  .topbar { padding-bottom: 12px; }
  .top-actions { order: 1; margin-left: auto; }
  .session { order: 2; width: 100%; margin-left: 0; padding-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 1200px) {
  .hero { grid-template-columns: 1fr; padding: 32px 28px 0; }
  .hero-copy { padding-bottom: 0; }
  .hero-globe { margin: 0 -28px; min-height: 420px; }
  .ticker { margin: 0 -28px; }
  .globe-hint { top: 12px; right: 24px; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; background: none; }
  .sidebar { position: sticky; top: var(--top-h, 64px); height: auto; flex-direction: row; overflow-x: auto; padding: 8px; z-index: 20; }
  .nav-item { white-space: nowrap; gap: 8px; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .nav-sep, .nav-foot, .nav-item.muted { display: none; }
  .proto, .brand-txt small { display: none; }
  .home-grid, .radar-grid, .cols { grid-template-columns: 1fr; }
  .radar-widget { grid-row: auto; }
  .insight-col { position: static; max-height: none; }
  main { padding: 16px; }
  .session { margin-left: 0; width: 100%; }
  .top-actions { margin-left: auto; }
  .login-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .login-hero h1 { margin-top: 20px; }
  .login-globe { right: -40vw; top: 18%; width: 120vw; height: 120vw; opacity: .5; }
}
@media (max-width: 640px) {
  .hero { border-radius: 22px; padding: 26px 18px 0; min-height: 0; }
  .hero h1 { font-size: 38px; }
  .hero-globe { margin: 0 -18px; min-height: 340px; }
  .ticker { margin: 0 -18px; }
  .globe-legend { bottom: 56px; font-size: 11px; gap: 4px 10px; }
  .globe-hint { display: none; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hs b { font-size: 28px; }
  .budget-badge { display: none; }
  .topbar { gap: 10px 12px; padding: 10px 14px; }
  .top-actions { order: 1; }
  .session { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sess-user { grid-column: 1 / -1; flex-direction: row !important; align-items: center; gap: 8px !important; }
  .sess-user .user-chip { padding: 0; }
  .session label { flex: 1 1 140px; }
  .session select { max-width: none; width: 100%; }
  .page-head h2 { font-size: 28px; }
  .insight { padding: 18px; }
  .insight > h2 { font-size: 23px; }
  table.sources th:nth-child(n+4), table.sources td:nth-child(n+4) { display: none; }
  .wi-row { grid-template-columns: 1fr 70px; } .wi-row input[type=range] { grid-column: 1 / 3; } .wi-row .small { grid-column: 1 / 3; }
  .wi-line { grid-template-columns: 80px 1fr; } .wi-line .small { grid-column: 1 / 3; }
  .tl-row { grid-template-columns: 1fr; }
  .fn-row { grid-template-columns: 1fr 40px; } .fn-row .fn-bar { grid-column: 1 / -1; grid-row: 2; }
  .login-form { padding: 24px 20px; border-radius: 22px; }
  .login-points li { min-width: calc(50% - 7px); }
}
@media (max-width: 900px) { .digest-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* очищенный клиентский вид */
.w-dots { color: var(--red); letter-spacing: 1px; font-size: 9px; margin-left: 4px; vertical-align: 1px; }
.trace-raw { margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.trace-raw summary { cursor: pointer; font-weight: 650; font-size: 14px; }
.trace-raw .trace-step { margin-top: 8px; }

/* ---- этап 13: «Коротко», подробный разбор по кнопке, расхождения, исполнители и сроки действий */
.takeaway.short { display: grid; gap: 12px; }
.sh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sh-head .claim-kind { color: #ff8a80; font-weight: 800; letter-spacing: .1em; font-size: 11px; }
.sh-mat { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
.sh-mat.m3 { background: rgba(255, 69, 58, .25); color: #ffb3ad; }
.sh-mat.m2 { background: rgba(100, 168, 255, .2); color: #b8d4ff; }
.sh-mat.m0, .sh-mat.m1 { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .6); }
.sh-row { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: baseline; position: relative; z-index: 1; }
.sh-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .5); }
.sh-v { font-size: 15.5px; font-weight: 550; line-height: 1.45; }
.sh-range { margin-top: 8px; font-size: 14px; font-weight: 550; }
.sh-range b { font-family: var(--display); font-weight: 800; font-size: 17px; }
.sh-range b.neg { color: #ff8a80; } .sh-range b.pos { color: #6ee7a8; }
.takeaway.short .sh-head .claim-kind { color: #ff8a80 !important; }
.sh-note, .sh-meta { display: block; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .55); margin-top: 3px; }
.sh-src { position: relative; z-index: 1; }
.detail-toggle { width: 100%; margin: 14px 0 4px; padding: 12px 16px; justify-content: center; }
.diverge { border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; background: linear-gradient(90deg, var(--watch-bg), var(--bank-bg)); }
.dv-head { font-weight: 750; margin-bottom: 6px; }
.dv-row { font-size: 14px; margin: 4px 0; }
.act-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.act-meta span { font-size: 12px; font-weight: 600; border-radius: 8px; padding: 2px 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.am-due { color: var(--red); }
.ai-weak { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }
.ai-strong { font-size: 12px; color: var(--red); margin-top: 6px; font-weight: 650; }
@media (max-width: 640px) { .sh-row { grid-template-columns: 1fr; gap: 2px; } }

/* Эффект за 12 месяцев: график накопления и разбивка по рычагам */
.effect-chart { background: var(--soft); border-radius: 16px; padding: 12px 14px 8px; margin: 4px 0 10px; }
.ec-head { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.effect-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ec-grid { stroke: var(--line); stroke-width: 1; }
.ec-zero { stroke: var(--muted); stroke-width: 1.2; opacity: .6; }
.ec-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ec-end { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ec-start { stroke: var(--ink2); stroke-dasharray: 3 3; opacity: .5; }
.ec-lbl { font-size: 11px; fill: var(--ink2); }
.ec-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.ec-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ec-legend i.negative { background: var(--risk); } .ec-legend i.base { background: var(--watch); } .ec-legend i.positive { background: var(--opp); }
.lever-wrap { overflow-x: auto; margin: 0 0 8px; }
.lever-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lever-table th { text-align: right; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.lever-table th:first-child { text-align: left; }
.lever-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lever-table td:not(:first-child) { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lever-table td.bad { color: var(--risk); } .lever-table td.ok { color: var(--opp); }
.lever-table .lt-f { font-size: 11px; margin-top: 2px; }
.lever-table .lt-total td { font-weight: 800; border-bottom: 0; }
.scen-note { margin-bottom: 8px; }
@media (max-width: 640px) { .lever-table .lt-f { display: none; } .ec-end { font-size: 10px; } }
