:root {
  --bg: #101826;
  --panel: #152030;
  --raise: #1b293c;
  --line: #26364b;
  --text: #dde5ee;
  --muted: #8796a9;
  --in: #3bb8a4;
  --out: #e3a23b;
  --risk: #e25a4f;
  --cand: #9d8cff;
  --ok: #6cc08b;
  --radius-s: 4px;
  --radius-m: 8px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--in); outline-offset: 2px; }
.num, td.num, .kpi-value { font-variant-numeric: tabular-nums; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 600; font-size: 16px; text-decoration: none; padding: 4px 10px 18px; letter-spacing: 0.01em; }
.brand span { color: var(--in); }
#projects-nav a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-decoration: none; padding: 8px 10px; border-radius: var(--radius-s); color: var(--muted); }
#projects-nav a:hover { background: var(--raise); color: var(--text); }
#projects-nav a[aria-current='page'] { background: var(--raise); color: var(--text); box-shadow: inset 2px 0 0 var(--in); }
#projects-nav .nav-chain { font-size: 12px; color: var(--muted); }
main { padding: 28px 32px 64px; min-width: 0; outline: none; }

/* ---------- заголовок проєкту ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { font-size: 26px; font-weight: 600; margin: 0; line-height: 1.15; }
.head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 12px; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--in); border-color: var(--in); color: #08201c; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.small { padding: 4px 9px; font-size: 13px; }

/* ---------- смуга платоспроможності — головний акцент ---------- */
.solvency { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px 16px; margin-bottom: 20px; }
.solvency-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.solvency-cash { font-size: 30px; font-weight: 600; line-height: 1.1; }
.solvency-cash small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.runway { text-align: right; }
.runway-days { font-size: 30px; font-weight: 600; line-height: 1.1; }
.runway-days.bad { color: var(--risk); }
.runway-days.warn { color: var(--out); }
.runway small { display: block; color: var(--muted); }
.scale { position: relative; height: 34px; margin: 18px 0 30px; }
.scale-track { position: absolute; inset: 12px 0; background: var(--raise); border-radius: 3px; }
.scale-cash { position: absolute; left: 0; top: 12px; bottom: 12px; background: var(--in); border-radius: 3px; }
.scale-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--out); }
.scale-mark span { position: absolute; top: 38px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--muted); }
.scale-mark.end span { transform: translateX(-100%); }
.scale-mark.start span { transform: none; }
.scale-mark b { color: var(--text); font-weight: 500; }
.solvency-note { color: var(--muted); font-size: 13px; }

/* ---------- висновок ---------- */
.verdict { border-left: 3px solid var(--muted); padding: 2px 0 2px 18px; margin-bottom: 22px; }
.verdict.ok { border-left-color: var(--ok); }
.verdict.watch { border-left-color: var(--out); }
.verdict.risk, .verdict.critical { border-left-color: var(--risk); }
.verdict-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.verdict-head h2 { font-size: 19px; font-weight: 600; margin: 0; line-height: 1.3; }
.level { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.level.ok { background: rgba(108, 192, 139, 0.15); color: var(--ok); }
.level.watch { background: rgba(227, 162, 59, 0.15); color: var(--out); }
.level.risk { background: rgba(226, 90, 79, 0.15); color: var(--risk); }
.level.critical { background: var(--risk); color: #fff; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 110ch; }
.findings li { position: relative; padding-left: 18px; }
.findings li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.findings li.ok::before { background: var(--ok); }
.findings li.watch::before { background: var(--out); }
.findings li.risk::before, .findings li.critical::before { background: var(--risk); }
.verdict-note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

/* ---------- показники ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.kpi { padding: 12px 14px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 18px; font-weight: 500; margin-top: 2px; }
.kpi-hint { font-size: 12.5px; color: var(--muted); }
.up { color: var(--ok); }
.down { color: var(--risk); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current='page'] { color: var(--text); border-bottom-color: var(--in); }

/* ---------- блоки ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
section.block { margin-bottom: 30px; }
section.block h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
section.block .lead { color: var(--muted); margin: 0 0 12px; font-size: 13px; max-width: 72ch; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- таблиці ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover { background: var(--panel); }
td a { text-decoration: none; }
td.nowrap, td:has(> a.addr) { white-space: nowrap; }
td a:hover { text-decoration: underline; }
.addr { color: var(--muted); font-size: 12.5px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 12px; background: var(--raise); color: var(--muted); }
.tag.cand { color: var(--cand); box-shadow: inset 0 0 0 1px var(--cand); background: transparent; }
.tag.in { color: var(--in); }
.tag.out { color: var(--out); }
.amount-in { color: var(--in); }
.amount-out { color: var(--out); }
tr.highlight td { background: rgba(59, 184, 164, 0.08); }

/* ---------- форми ---------- */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 12.5px; color: var(--muted); }
input[type='text'], input[type='number'], input[type='date'], input[type='email'], input[type='password'], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--in); outline: none; }
input.inline { background: transparent; border-color: transparent; padding: 3px 6px; width: 100%; }
input.inline:hover, input.inline:focus { border-color: var(--line); background: var(--panel); }
textarea { width: 100%; min-height: 360px; font-size: 13px; line-height: 1.5; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); }

/* ---------- алерти ---------- */
.alert-item { display: grid; grid-template-columns: 4px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert-item .bar { border-radius: 2px; background: var(--muted); }
.alert-item.high .bar { background: var(--risk); }
.alert-item.medium .bar { background: var(--out); }
.alert-item.info .bar { background: var(--in); }
.alert-text { white-space: pre-line; }
.alert-text a { color: var(--in); }
.alert-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.empty { color: var(--muted); padding: 28px 0; }
.error { color: var(--risk); }
.callout { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }

#toast { position: fixed; bottom: 20px; right: 20px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; opacity: 0; transform: translateY(6px); transition: opacity 0.15s, transform 0.15s; pointer-events: none; max-width: 420px; }
#toast.show { opacity: 1; transform: none; }
#toast.err { border-color: var(--risk); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .brand { padding: 4px 10px; }
  #projects-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  main { padding: 20px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .runway { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- позначка рівня біля назви ---------- */
.head h1 .level { font-size: 13px; vertical-align: 5px; margin-left: 10px; text-decoration: none; }
a.level:hover { filter: brightness(1.15); }

/* ---------- звіт для PDF: світла тема ---------- */
body.print-mode {
  --bg: #ffffff;
  --panel: #f4f6f9;
  --raise: #e9edf2;
  --line: #d6dce4;
  --text: #17212d;
  --muted: #5b6878;
  --in: #1d8a79;
  --out: #c07a0e;
  --risk: #c4362c;
  --ok: #2b8a52;
  --cand: #6a59d6;
  background: var(--bg);
  color: var(--text);
}
html:has(body.print-mode) { background: #fff; }
.print-mode .side { display: none; }
.print-mode .shell { grid-template-columns: 1fr; }
.print-mode main { max-width: 1000px; margin: 0 auto; }
.print-mode .btn.primary { color: #fff; }
.print-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.report-head { margin-bottom: 20px; }
.report-head h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.report-head .sub { color: var(--muted); }
.report-foot { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.level.critical { color: #fff; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 11.5px; }
  .print-toolbar, .side, #toast { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .verdict, .solvency, .kpis, section.block, .alert-item, tr { break-inside: avoid; }
  section.block h2 { break-after: avoid; }
  /* на аркуші A4 тримаємо десктопну верстку, а не мобільну */
  .solvency-top { flex-wrap: nowrap; }
  .runway { text-align: right; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 18px; }
  .kpis { grid-template-columns: repeat(5, 1fr); }
  .kpi { padding: 9px 10px; }
  .kpi-value { font-size: 15px; }
  .solvency-cash, .runway-days { font-size: 24px; }
  tbody tr:hover { background: none; }
  a { text-decoration: none; }
}

/* =====================================================================
   Оновлений дизайн: логотипи, картки проєктів, шапка, показники, висновок
   ===================================================================== */

/* ---------- логотипи ---------- */
.logo { display: inline-grid; place-items: center; flex: none; object-fit: contain; background: var(--raise); border: 1px solid var(--line); }
.logo.xs { width: 22px; height: 22px; border-radius: 6px; font-size: 9.5px; }
.logo.m { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; }
.logo.l { width: 64px; height: 64px; border-radius: 15px; font-size: 22px; }
.logo.mono { background: hsl(var(--h) 42% 26%); border-color: hsl(var(--h) 40% 34%); color: hsl(var(--h) 75% 86%); font-weight: 600; letter-spacing: 0.02em; }
.print-mode .logo.mono { background: hsl(var(--h) 55% 90%); border-color: hsl(var(--h) 45% 80%); color: hsl(var(--h) 55% 28%); }

/* ---------- бічне меню ---------- */
#projects-nav a { align-items: center; gap: 10px; }
#projects-nav .nav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.watch { background: var(--out); }
.dot.risk, .dot.critical { background: var(--risk); }
.dot.critical { box-shadow: 0 0 0 3px rgba(226, 90, 79, 0.25); }

/* ---------- плашки рівня й чипи ---------- */
.level { border-radius: 999px; padding: 3px 10px; text-decoration: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--raise); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.chain-bsc { color: #f0b90b; border-color: rgba(240, 185, 11, 0.35); background: rgba(240, 185, 11, 0.08); }
.chip.chain-polygon { color: #b49cff; border-color: rgba(130, 71, 229, 0.45); background: rgba(130, 71, 229, 0.12); }
.print-mode .chip.chain-bsc { color: #8a6a00; }
.print-mode .chip.chain-polygon { color: #5a32b8; }

/* ---------- шапка проєкту ---------- */
.phead { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 20px; }
.phead h1 { font-size: 28px; font-weight: 600; margin: 0 0 8px; line-height: 1.1; }
.logo-btn { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 15px; }
.logo-edit { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 15px; background: rgba(8, 14, 22, 0.72); color: #fff; font-size: 12px; opacity: 0; transition: opacity 0.15s; }
.logo-btn:hover .logo-edit, .logo-btn:focus-visible .logo-edit { opacity: 1; }
.logo-row { display: flex; gap: 18px; align-items: center; }
.logo-row .lead { margin-bottom: 10px; }
.logo-row .btn { margin-right: 6px; }

/* ---------- картки проєктів ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pcard { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 16px; border-radius: 14px; background: linear-gradient(180deg, var(--panel) 0%, rgba(21, 32, 48, 0.4) 100%); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.pcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--muted); }
.pcard.lvl-ok::before { background: var(--ok); }
.pcard.lvl-watch::before { background: var(--out); }
.pcard.lvl-risk::before, .pcard.lvl-critical::before { background: var(--risk); }
.pcard:hover { border-color: #3b506b; transform: translateY(-1px); }
.pcard-top { display: flex; align-items: center; gap: 12px; }
.pcard-id { flex: 1; min-width: 0; }
.pcard-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-sub { color: var(--muted); font-size: 12.5px; }
.pcard-cash { display: flex; align-items: baseline; justify-content: space-between; }
.pcard-cash span { color: var(--muted); }
.pcard-cash b { font-size: 27px; font-weight: 600; }
.spark { width: 100%; height: 44px; display: block; }
.pcard-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: -6px; }
.pcard-legend span:last-child { margin-left: auto; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.sw.in { background: var(--in); }
.sw.out { background: var(--out); }
.pcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pcard-stats dt { color: var(--muted); font-size: 12px; }
.pcard-stats dd { margin: 2px 0 0; font-weight: 500; }
.pcard-stats small { display: block; font-size: 12px; font-weight: 400; }
.pcard-alert { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard.add { align-items: center; justify-content: center; gap: 6px; color: var(--in); border-style: dashed; background: transparent; min-height: 220px; }
.pcard.add::before { display: none; }
.pcard.add .plus { font-size: 32px; line-height: 1; }

/* ---------- платоспроможність ---------- */
.solvency { border-radius: 14px; padding: 20px 22px 18px; background: linear-gradient(180deg, var(--panel), rgba(21, 32, 48, 0.55)); }
.solvency.lvl-watch { box-shadow: inset 0 3px 0 var(--out); }
.solvency.lvl-risk, .solvency.lvl-critical { box-shadow: inset 0 3px 0 var(--risk); }
.solvency.lvl-ok { box-shadow: inset 0 3px 0 var(--ok); }
.solvency-cash { font-size: 34px; }
.runway-days { font-size: 34px; }
.scale { height: 40px; margin: 20px 0 34px; }
.scale-track { inset: 13px 0; border-radius: 999px; }
.scale-cash { top: 13px; bottom: 13px; border-radius: 999px; background: linear-gradient(90deg, rgba(59, 184, 164, 0.55), var(--in)); box-shadow: 0 0 14px rgba(59, 184, 164, 0.35); }
.scale-mark { width: 2px; border-radius: 1px; }
.scale-mark span { top: 42px; background: var(--raise); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }

/* ---------- показники ---------- */
.kpis { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kpi { padding: 14px 16px; }
.kpi .spark.line { height: 30px; margin-top: 10px; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--raise); margin-top: 14px; }
.meter span { display: block; height: 100%; border-radius: 3px; }
.meter span.ok { background: var(--ok); }
.meter span.bad { background: var(--risk); }
.meter i { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text); }

/* ---------- графіки й таблиці в картках ---------- */
section.block > .chart { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px 6px; }
.chart g.bar:hover rect:not([fill='transparent']) { filter: brightness(1.25); }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap th { background: rgba(255, 255, 255, 0.02); }
.callout { border-radius: 12px; }

/* ---------- ролі гаманців ---------- */
.role-select { border-left: 3px solid var(--muted); }
.role-select.role-collection { border-left-color: var(--in); }
.role-select.role-payout { border-left-color: var(--out); }
.role-select.role-team { border-left-color: var(--risk); }
.role-select.role-exchange { border-left-color: #5aa9e6; }
.role-select.role-intermediate { border-left-color: var(--cand); }

/* ---------- висновок ---------- */
.verdict { border: 1px solid var(--line); border-left-width: 4px; border-radius: 14px; padding: 20px 22px; background: var(--panel); }
.verdict-head { justify-content: space-between; margin-bottom: 6px; }
.verdict-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.count { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--raise); color: var(--muted); }
.count.risk, .count.critical { color: var(--risk); }
.count.watch { color: var(--out); }
.count.ok { color: var(--ok); }
.verdict-title { font-size: 22px; font-weight: 600; margin: 6px 0 16px; line-height: 1.25; }
.findings { gap: 10px; max-width: none; }
.findings li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); }
.findings li::before { display: none; }
.findings li b { font-weight: 600; }
.findings li p { margin: 3px 0 0; opacity: 0.86; }
.ficon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--raise); color: var(--muted); }
.findings li.ok .ficon { background: rgba(108, 192, 139, 0.15); color: var(--ok); }
.findings li.watch .ficon { background: rgba(227, 162, 59, 0.15); color: var(--out); }
.findings li.risk .ficon { background: rgba(226, 90, 79, 0.15); color: var(--risk); }
.findings li.critical .ficon { background: var(--risk); color: #fff; }
.findings li.critical { border-color: rgba(226, 90, 79, 0.5); }

/* ---------- звіт: шапка з логотипом ---------- */
.report-head { display: flex; gap: 16px; align-items: center; }
.print-mode .pcard, .print-mode .solvency { background: var(--panel); }
.print-mode .table-wrap th { background: var(--raise); }

@media (max-width: 900px) {
  .phead { grid-template-columns: auto 1fr; }
  .phead .actions { grid-column: 1 / -1; }
  .phead h1 { font-size: 23px; }
  .cards { grid-template-columns: 1fr; }
}
@media print {
  .findings li, .pcard { break-inside: avoid; }
  .logo-btn .logo-edit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard, .logo-edit { transition: none; }
  .pcard:hover { transform: none; }
}
a.btn { display: inline-block; text-decoration: none; }
.pcard .spark { height: 52px; }

/* ---------- вкладка «Команда» ---------- */
.team-hero { display: grid; grid-template-columns: 1.3fr auto 1fr; gap: 28px; align-items: center; padding: 22px 24px; margin-bottom: 26px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.team-hero.has { box-shadow: inset 0 3px 0 var(--risk); }
.team-total { font-size: 34px; font-weight: 600; line-height: 1.15; margin: 2px 0 4px; }
.team-hero.has .team-total { color: var(--risk); }
.team-counts { display: flex; gap: 22px; }
.team-counts div { display: flex; flex-direction: column; align-items: center; }
.team-counts b { font-size: 24px; font-weight: 600; }
.team-counts span { font-size: 12px; color: var(--muted); }
.team-action .lead { margin: 10px 0 0; }
.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.team-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.team-card.confirmed { border-left: 4px solid var(--risk); }
.team-card.candidate { border-left: 4px solid var(--cand); }
.team-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.team-card .addr { word-break: break-all; }
.team-name { font-weight: 600; margin-bottom: 2px; }
.chip.team-ok { color: var(--risk); border-color: rgba(226, 90, 79, 0.45); background: rgba(226, 90, 79, 0.1); font-size: 11.5px; padding: 1px 8px; }
.team-figures { display: flex; gap: 22px; flex-wrap: wrap; }
.team-figures div { display: flex; flex-direction: column; }
.team-figures span { font-size: 12px; color: var(--muted); }
.team-figures b { font-weight: 500; }
.onward { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.onward-item a { color: var(--in); text-decoration: none; }
.reasons { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.reasons li::marker { color: var(--muted); }
.team-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.score { position: relative; flex: none; width: 120px; height: 22px; border-radius: 999px; background: var(--raise); overflow: hidden; }
.score span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.score.lo span { background: rgba(135, 150, 169, 0.45); }
.score.mid span { background: rgba(227, 162, 59, 0.7); }
.score.hi span { background: var(--risk); }
.score b { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; font-weight: 600; }
@media (max-width: 900px) {
  .team-hero { grid-template-columns: 1fr; }
  .team-list { grid-template-columns: 1fr; }
}

/* ---------- фірмовий логотип ---------- */
.brand { display: block; padding: 2px 8px 22px; }
.brand img { display: block; width: 180px; height: auto; }
.report-brand { display: block; height: 26px; width: auto; margin: 0 0 14px auto; }
@media (max-width: 900px) {
  .brand { padding: 2px 8px; }
  .brand img { width: 140px; }
}

/* =====================================================================
   Градієнти кольорів спідометра: фон, рамки, кнопки, цифри, графіки
   ===================================================================== */
:root {
  --in: #2fd3d8;
  --lime: #9be86a;
  --blue: #2f7dff;
  --violet: #5b5cff;
  --g-dial: linear-gradient(90deg, #9be86a 0%, #2fd3d8 45%, #2f7dff 100%);
  --g-roi: linear-gradient(120deg, #3ee0ff 0%, #2f8bff 55%, #5b5cff 100%);
  --g-out: linear-gradient(180deg, #f4bd4f, #e8743b);
  --g-risk: linear-gradient(90deg, #f0a24b, #e25a4f);
  --g-frame: linear-gradient(135deg, rgba(62, 224, 255, 0.45), rgba(47, 125, 255, 0.12) 45%, rgba(155, 232, 106, 0.32));
  --glow: 0 0 0 1px rgba(47, 211, 216, 0.25), 0 10px 32px -12px rgba(47, 139, 255, 0.45);
}

/* ---------- фон: м'яке «сяйво» ---------- */
/* Окремий нерухомий шар: браузер малює його один раз, а не перемальовує весь екран на кожному кроці прокрутки. */
body:not(.print-mode) { background: var(--bg); }
body:not(.print-mode)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(47, 139, 255, 0.16), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(47, 211, 216, 0.1), transparent 60%),
    radial-gradient(900px 600px at 70% 110%, rgba(91, 92, 255, 0.1), transparent 60%);
  transform: translateZ(0);
}
.side { background: linear-gradient(180deg, rgba(21, 32, 48, 0.92), rgba(16, 24, 38, 0.78)); border-right: 0; box-shadow: inset -1px 0 0 rgba(47, 211, 216, 0.14); }

/* ---------- градієнтні рамки панелей ---------- */
.solvency,
.kpis,
.verdict,
.pcard:not(.add),
.team-hero,
.team-card,
.table-wrap,
.callout,
section.block > .chart {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #172336, #131d2c) padding-box, var(--g-frame) border-box;
}
.verdict { border-left-width: 4px; }
.verdict.ok { border-left-color: var(--ok); }
.verdict.watch { border-left-color: var(--out); }
.verdict.risk, .verdict.critical { border-left-color: var(--risk); }
.team-card.confirmed { border-left: 4px solid var(--risk); }
.team-card.candidate { border-left: 4px solid var(--cand); }
.pcard:not(.add):hover, .team-card:hover { box-shadow: var(--glow); }
.pcard:not(.add) { transition: box-shadow 0.2s, transform 0.2s; }

/* ---------- кнопки ---------- */
.btn.primary { background: var(--g-dial); border: 0; color: #06202a; font-weight: 600; box-shadow: 0 6px 20px -8px rgba(47, 211, 216, 0.7); }
.btn.primary:hover { filter: brightness(1.08) saturate(1.05); box-shadow: 0 8px 24px -8px rgba(47, 139, 255, 0.8); }
.btn:not(.primary):hover { border-color: rgba(47, 211, 216, 0.55); }
/* Кнопка «Новий проєкт»: рамка в кольорах спідометра, плюс у кружечку */
.side-add {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(#152031, #152031) padding-box, var(--g-dial) border-box;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: box-shadow 0.15s, background 0.15s;
}
.side-add::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--g-dial);
  color: #06202a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.side-add:hover {
  background: linear-gradient(rgba(47, 211, 216, 0.14), rgba(47, 125, 255, 0.14)) padding-box, linear-gradient(#152031, #152031) padding-box, var(--g-dial) border-box;
  box-shadow: 0 6px 20px -10px rgba(47, 211, 216, 0.8);
}
.side-add:focus-visible { outline: 2px solid var(--in); outline-offset: 2px; }

/* ---------- вкладки й меню ---------- */
.tabs a { position: relative; border-bottom-color: transparent !important; }
.tabs a[aria-current='page']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--g-dial); box-shadow: 0 0 10px rgba(47, 211, 216, 0.6); }
#projects-nav a[aria-current='page'] { box-shadow: none; background: linear-gradient(90deg, rgba(47, 211, 216, 0.14), rgba(47, 125, 255, 0.04)); position: relative; }
#projects-nav a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--g-dial); }

/* ---------- градієнтні цифри ---------- */
.solvency-cash, .pcard-cash b, .kpi-value, .phead h1, .head h1 {
  background: var(--g-roi);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.phead h1, .head h1 { background: linear-gradient(120deg, #ffffff 30%, #b9e9ff 70%, #8fb4ff); -webkit-background-clip: text; background-clip: text; }
.kpi-value { background: linear-gradient(120deg, #eaf6ff, #9fd6ff); -webkit-background-clip: text; background-clip: text; }
.solvency-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.solvency-cash { display: inline-block; }
.team-hero.has .team-total { background: var(--g-risk); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- смуга каси й шкали ---------- */
.scale-cash { background: var(--g-dial); box-shadow: 0 0 18px rgba(47, 211, 216, 0.45); }
.scale-mark { background: linear-gradient(180deg, #f6c65a, #e8743b); width: 3px; }
.meter span.ok { background: var(--g-dial); }
.meter span.bad { background: var(--g-risk); }
.score.mid span { background: linear-gradient(90deg, #f6c65a, #f0a24b); }
.score.hi span { background: var(--g-risk); }
.solvency.lvl-watch { box-shadow: inset 0 3px 0 var(--out); }
.solvency.lvl-ok { box-shadow: inset 0 3px 0 var(--lime); }

/* ---------- картки проєктів ---------- */
.pcard.lvl-ok::before { background: var(--g-dial); }
.pcard.lvl-watch::before { background: linear-gradient(90deg, #f6c65a, #e8743b); }
.pcard.lvl-risk::before, .pcard.lvl-critical::before { background: var(--g-risk); }
.pcard.add { border: 1px dashed rgba(47, 211, 216, 0.4); }
.pcard.add .plus { background: var(--g-dial); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 40px; }
.sw.in, .sw-in { background: linear-gradient(180deg, #9be86a, #2fd3d8 50%, #2f7dff); }
.sw.out, .sw-out { background: var(--g-out); }
.legend i.sw-in, .legend i.sw-out { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- логотипи-ініціали ---------- */
.logo.mono { background: linear-gradient(135deg, hsl(var(--h) 55% 34%), hsl(calc(var(--h) + 40) 55% 24%)); }

/* ---------- висновок: позначки рівня ---------- */
.level.ok { background: linear-gradient(90deg, rgba(155, 232, 106, 0.2), rgba(47, 211, 216, 0.2)); color: #b5f08f; }
.level.critical { background: var(--g-risk); }
.findings li { background: rgba(10, 16, 26, 0.55); }

/* ---------- фокус ---------- */
:focus-visible { outline: 2px solid #2fd3d8; outline-offset: 2px; }

/* ---------- PDF: світлий і чистий ---------- */
.print-mode .solvency,
.print-mode .kpis,
.print-mode .verdict,
.print-mode .team-hero,
.print-mode .team-card,
.print-mode .table-wrap,
.print-mode .callout,
.print-mode section.block > .chart {
  background: linear-gradient(180deg, #f8fafc, #f2f5f9) padding-box, linear-gradient(135deg, rgba(47, 125, 255, 0.35), rgba(47, 211, 216, 0.25), rgba(155, 232, 106, 0.35)) border-box;
}
.print-mode .findings li { background: #fff; }
.print-mode .kpi-value, .print-mode .phead h1, .print-mode .head h1 { background: none; color: var(--text); -webkit-text-fill-color: var(--text); }
.print-mode .solvency-cash, .print-mode .pcard-cash b, .print-mode .team-total { background: none !important; color: #1a64d6; -webkit-text-fill-color: #1a64d6; }
.print-mode .report-head h1 { color: var(--text); }
@media print {
  body { background: #fff !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard:not(.add) { transition: none; }
}

/* Посилання на проєкт під назвою */
.plinks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13.5px; }
.plinks a { color: #8fd8ff; text-decoration: none; border-bottom: 1px solid rgba(143, 216, 255, 0.35); }
.plinks a:hover { color: #c4ecff; border-bottom-color: currentColor; }
.plinks a:focus-visible { outline: 2px solid var(--in); outline-offset: 2px; border-radius: 2px; }
#links-text { min-height: 110px; }
.print-mode .plinks a { color: #1a64d6; border-bottom-color: rgba(26, 100, 214, 0.35); }
.report-links { margin: 4px 0 6px; }

/* ---------- схема руху грошей ---------- */
.flow-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.flow-top h2 { margin-bottom: 4px; }
.flow-team { color: #f0a24b; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: rgba(12, 19, 30, 0.6); }
.seg a { padding: 5px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a[aria-current] { background: var(--g-dial); color: #06202a; font-weight: 600; }
.seg a:focus-visible { outline: 2px solid var(--in); outline-offset: 1px; }
.sankey-wrap { overflow-x: auto; border-radius: var(--radius-s, 10px); padding: 10px 6px; background: rgba(9, 14, 23, 0.55); border: 1px solid var(--line); }
.sankey { display: block; min-width: 900px; font-family: inherit; }
.sankey .flow-link { transition: fill-opacity 0.15s; }
.sankey .flow-link:hover { fill-opacity: 0.55; }
.sankey a text:hover { text-decoration: underline; }
.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.flow-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.print-mode .sankey-wrap { background: none; border: 0; }
.print-mode .sankey { min-width: 0; }
@media print { .print-break { break-before: page; } }
.flow-controls { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- вхід і реєстрація ---------- */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
#auth[hidden], .shell[hidden] { display: none; }
.auth-card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #172336, #121b29) padding-box, var(--g-frame) border-box;
  box-shadow: 0 30px 80px -40px rgba(47, 139, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-logo { display: block; margin: 0 auto 2px; height: 38px; width: auto; }
.auth-card .lang-switch { align-self: center; }
.auth-tabs { align-self: stretch; display: flex; }
.auth-tabs a { flex: 1; text-align: center; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label, .stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-card input, .stack input { width: 100%; padding: 10px 12px; font-size: 15px; }
.auth-card .btn.primary { padding: 11px; font-size: 15px; margin-top: 4px; }
.auth-note { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.auth-note.ok { color: #9be86a; }
.auth-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.auth-error { margin: 0; min-height: 1em; color: #ff8a7a; font-size: 13.5px; }
.auth-error:empty { display: none; }

/* ---------- низ бокової панелі: учасник, мова, вихід ---------- */
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.side-foot:empty { display: none; }
.me-name { font-weight: 600; font-size: 14px; }
.me-role { font-size: 12px; color: var(--muted); }
.foot-links { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.foot-links a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.foot-links a:hover { color: #8fd8ff; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.linkish:hover { color: var(--text); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e25a4f; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.badge[hidden] { display: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: rgba(12, 19, 30, 0.6); align-self: flex-start; }
.lang-switch button { background: none; border: 0; color: var(--muted); padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.lang-switch button[aria-pressed='true'] { background: var(--g-dial); color: #06202a; }
.lang-switch button:focus-visible, .linkish:focus-visible { outline: 2px solid var(--in); outline-offset: 2px; }
.btn.danger { color: #ff8a7a; }
.btn.danger:hover { border-color: #e25a4f; }
section.block.narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) { .side-foot { margin-top: 0; border-top: 0; padding: 0; flex-direction: row; align-items: center; width: 100%; justify-content: space-between; } }
