/* Платформа ликвидности — дизайн-система.
   Правила: один шрифт (Manrope), размеры только по шкале Tailwind, отступы только 0/2/4/8/12/16/24/32/40/48/64/80/96,
   скругления Tailwind, плоские фоны, движение по кривой cubic-bezier(0.22,1,0.36,1). */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #0B0B0C;
  --ink-2: #3A3D42;
  --muted: #6E737A;
  --faint: #A2A7AE;
  --line: #E6E8EB;
  --line-2: #F0F1F3;
  --bg: #F6F7F8;
  --surface: #FFFFFF;
  --brand: #21A038;
  --brand-ink: #127A2A;
  --brand-soft: #EAF6EC;
  --brand-line: #C4E6CB;
  --warn: #8A5A00;
  --warn-soft: #FFF5E0;
  --danger: #B42318;
  --danger-soft: #FDEDEB;
  --info: #1D5BA6;
  --info-soft: #EAF1FA;
  --neutral-soft: #F0F1F3;
  --dark: #181818;
  --dark-2: #272727;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 256px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --surface-2: #FAFAFB;
  --hover: #FAFAFB;
  --input-line: #D5D8DD;
  --input-hover: #B9BEC5;
  --info-line: #CADCF1;
  --warn-line: #F1DDAE;
  --danger-line: #F2C6C1;
  --best-row: #F5FBF6;
  --bar-muted: #B9C2CC;
  --glass: rgba(255, 255, 255, .78);
  --glass-strong: rgba(255, 255, 255, .95);
  --glass-line: rgba(11, 11, 12, .08);
  --h-from: #000000;
  --h-to: #666666;
  color-scheme: light;
}

/* Тёмная тема: фоны только из палитры скилла (#000000, #181818, #1F1F1F, #272727, #313131).
   Включается системной настройкой или переключателем (data-theme на <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F2F2;
    --ink-2: #C9C9C9;
    --muted: #9B9B9B;
    --faint: #6E6E6E;
    --line: #313131;
    --line-2: #272727;
    --bg: #181818;
    --surface: #1F1F1F;
    --surface-2: #272727;
    --hover: #272727;
    --brand: #2CAA47;
    --brand-ink: #6FD283;
    --brand-soft: rgba(47, 179, 74, .16);
    --brand-line: rgba(47, 179, 74, .38);
    --warn: #F0B44C;
    --warn-soft: rgba(240, 180, 76, .14);
    --warn-line: rgba(240, 180, 76, .34);
    --danger: #F28B82;
    --danger-soft: rgba(242, 139, 130, .14);
    --danger-line: rgba(242, 139, 130, .36);
    --info: #8AB8F2;
    --info-soft: rgba(138, 184, 242, .14);
    --info-line: rgba(138, 184, 242, .34);
    --neutral-soft: #272727;
    --dark: #000000;
    --dark-2: #1F1F1F;
    --input-line: #313131;
    --input-hover: #4A4A4A;
    --best-row: rgba(47, 179, 74, .08);
    --bar-muted: #4A4A4A;
    --glass: rgba(31, 31, 31, .78);
    --glass-strong: rgba(24, 24, 24, .95);
    --glass-line: rgba(255, 255, 255, .08);
    --h-from: #FFFFFF;
    --h-to: #9B9B9B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F2F2F2;
  --ink-2: #C9C9C9;
  --muted: #9B9B9B;
  --faint: #6E6E6E;
  --line: #313131;
  --line-2: #272727;
  --bg: #181818;
  --surface: #1F1F1F;
  --surface-2: #272727;
  --hover: #272727;
  --brand: #2CAA47;
  --brand-ink: #6FD283;
  --brand-soft: rgba(47, 179, 74, .16);
  --brand-line: rgba(47, 179, 74, .38);
  --warn: #F0B44C;
  --warn-soft: rgba(240, 180, 76, .14);
  --warn-line: rgba(240, 180, 76, .34);
  --danger: #F28B82;
  --danger-soft: rgba(242, 139, 130, .14);
  --danger-line: rgba(242, 139, 130, .36);
  --info: #8AB8F2;
  --info-soft: rgba(138, 184, 242, .14);
  --info-line: rgba(138, 184, 242, .34);
  --neutral-soft: #272727;
  --dark: #000000;
  --dark-2: #1F1F1F;
  --input-line: #313131;
  --input-hover: #4A4A4A;
  --best-row: rgba(47, 179, 74, .08);
  --bar-muted: #4A4A4A;
  --glass: rgba(31, 31, 31, .78);
  --glass-strong: rgba(24, 24, 24, .95);
  --glass-line: rgba(255, 255, 255, .08);
  --h-from: #FFFFFF;
  --h-to: #9B9B9B;
  color-scheme: dark;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration: none; transition: color 300ms var(--ease); }
a:hover { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--ink); color: var(--surface); padding: 8px 12px; border-radius: 8px; font-weight: 600; transition: transform 300ms var(--ease); }
.skip:focus { transform: translateY(80px); color: var(--surface); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Каркас приложения ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { overflow-y: auto; width: var(--sidebar); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 24px 12px 16px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 14px; line-height: 16px; }
.brand-name span { display: block; font-weight: 500; font-size: 12px; line-height: 16px; color: var(--muted); }
.nav-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--faint); padding: 16px 12px 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500;
  transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.nav a .ic { color: var(--faint); transition: color 300ms var(--ease); }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a:hover .ic { color: var(--ink-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.active .ic { color: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 9999px; padding: 0 8px; font-size: 12px; line-height: 20px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 9999px; background: var(--neutral-soft); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.who-wrap { min-width: 0; flex: 1; }
.who { font-weight: 600; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 12px; line-height: 16px; color: var(--muted); }
.logout { color: var(--muted); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.logout:hover { color: var(--danger); background: var(--danger-soft); }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; padding: 32px 40px 64px; max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 36px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.back:hover { color: var(--ink); }

/* Мобильная шапка приложения и меню на всю высоту */
.topbar { display: none; }
.menu-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 500ms var(--ease), opacity 300ms var(--ease); }
.menu-btn span:nth-child(1) { transform: translateY(-4px); }
.menu-btn span:nth-child(2) { transform: translateY(4px); }
[aria-expanded="true"] .menu-btn span:nth-child(1), .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
[aria-expanded="true"] .menu-btn span:nth-child(2), .menu-btn[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); }

@media (max-width: 960px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40; padding: 12px 16px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; }
  .shell { flex-direction: column; }
  .sidebar { inset: 64px 0 0 0; width: auto; border: 0; background: var(--glass-strong); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 16px; opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease); }
  .sidebar .brand { display: none; }
  .sidebar.open { opacity: 1; pointer-events: auto; }
  .sidebar .nav a, .sidebar .nav-label { opacity: 0; transform: translateY(24px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
  .sidebar.open .nav a, .sidebar.open .nav-label { opacity: 1; transform: none; }
  .sidebar .nav a { padding: 12px; font-size: 16px; line-height: 24px; }
  .main { margin-left: 0; padding: 24px 16px 48px; }
  .page-head h1 { font-size: 24px; line-height: 32px; }
}

/* ---------- Поверхности ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.card-tight { padding: 0; overflow: hidden; }
.card-head { padding: 16px 24px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; letter-spacing: -0.01em; }
.card-head .card-title { margin: 0; }
.card-title .muted { font-weight: 500; font-size: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.grid-side-left { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .grid-side, .grid-side-left, .grid-3, .grid-4, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv > span:first-child { color: var(--muted); }
.kv > :last-child { text-align: right; font-weight: 600; }

.stat { margin: 0; }
.stat .label { color: var(--muted); font-weight: 500; }
.stat .value { font-size: 30px; line-height: 36px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .hint { color: var(--muted); font-size: 12px; line-height: 16px; margin-top: 4px; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background-color 300ms var(--ease); }
.t tr.row-link:hover td { background: var(--surface-2); }
.t .r { text-align: right; }
.t td.num, .t th.num { text-align: right; }
.card .t th:first-child, .card .t td:first-child { padding-left: 24px; }
.card .t th:last-child, .card .t td:last-child { padding-right: 24px; }

/* ---------- Статусы ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 2px 12px 2px 8px; border-radius: 9999px; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.pill-ok, .pill-published, .pill-shown, .pill-approved, .pill-agreed { background: var(--brand-soft); color: var(--brand-ink); }
.pill-warn, .pill-in_work, .pill-pending, .pill-accepted { background: var(--warn-soft); color: var(--warn); }
.pill-bad, .pill-rejected, .pill-hidden { background: var(--danger-soft); color: var(--danger); }
.pill-info, .pill-moderation { background: var(--info-soft); color: var(--info); }
.pill-none, .pill-withdrawn, .pill-expired { background: var(--neutral-soft); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--ink-2); font-size: 12px; line-height: 16px; font-weight: 600; }
.tag-best { background: var(--brand); color: #fff; }

/* ---------- Формы и кнопки ---------- */
label.f { display: block; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--input-line); border-radius: 8px; outline: none;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease); }
textarea.input { height: auto; min-height: 80px; resize: vertical; }
.input:hover { border-color: var(--input-hover); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(33,160,56,.14); }

.input-sm { height: 32px; padding: 4px 12px; font-size: 14px; }
input[type=file].input { padding: 4px; }
input[type=file].input::file-selector-button { border: 0; background: var(--neutral-soft); border-radius: 4px; padding: 4px 12px; margin-right: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.input-sm[type=file]::file-selector-button { padding: 2px 8px; }
.field { margin-bottom: 16px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hint { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; font: inherit; font-size: 16px; line-height: 24px; font-weight: 600; border-radius: 8px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-dark { background: var(--ink); color: var(--surface); }
.btn-dark:hover { background: var(--ink-2); color: var(--surface); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--input-line); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { font-size: 14px; line-height: 20px; padding: 4px 12px; }
.btn-lg { padding: 12px 24px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .4; cursor: not-allowed; transform: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Уведомления и пустые состояния ---------- */
.note { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.note .ic { margin-top: 0; }
.note-ok { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.note-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.note-bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.note-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 40px 24px; }
.empty .ic { width: 32px; height: 32px; color: var(--faint); }
.empty b { color: var(--ink); font-size: 16px; line-height: 24px; }

/* ---------- Шкала этапов ---------- */
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.step { position: relative; padding-right: 8px; }
.step::before { content: ""; position: absolute; top: 11px; left: 32px; right: 8px; height: 2px; border-radius: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step.done::before { background: var(--brand); }
.step .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 9999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current .dot { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.step.failed .dot { border-color: var(--danger); background: var(--danger); color: #fff; }
.step .s-label { font-weight: 700; margin-top: 12px; }
.step .s-note { font-size: 12px; line-height: 16px; color: var(--muted); padding-right: 8px; margin-top: 2px; }
.step.todo .s-label { color: var(--muted); }
.step.failed .s-note { color: var(--danger); }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; } .step::before { display: none; } }

/* ---------- Сравнение предложений ---------- */
.compare tr.best-row td { background: var(--best-row); }
.big-num { font-size: 18px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.callout { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 12px; padding: 16px 24px; }
.callout .big { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bar-track { height: 8px; background: var(--line-2); border-radius: 9999px; min-width: 80px; overflow: hidden; }
.bar { height: 8px; border-radius: 9999px; background: var(--bar-muted); }
.bar.best { background: var(--brand); }

/* ---------- Журнал событий ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 9999px; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: 12px; line-height: 16px; color: var(--muted); margin-bottom: 2px; }

/* ---------- Чат ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 280px); min-height: 480px; padding: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); font-weight: 700; }
.chat-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.msg { max-width: 72%; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: var(--brand-line); }
.msg.system { align-self: center; background: var(--info-soft); border-color: var(--info-line); color: var(--info); font-size: 12px; line-height: 16px; }
.msg-meta { display: block; font-size: 12px; line-height: 16px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-weight: 600; }
.doc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: 0; }

/* ---------- Вход и регистрация ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface); }
.auth-side { background: var(--dark); color: #C9C9C9; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-side .brand-name, .auth-side .brand:hover { color: #fff; }
.auth-side .brand-name span { color: #9B9B9B; }
.auth-side h2 { font-size: 36px; line-height: 40px; max-width: 480px; margin-bottom: 16px;
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side p { max-width: 440px; color: #9B9B9B; font-size: 16px; line-height: 24px; }
.auth-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; max-width: 440px; }
.auth-points li { display: flex; gap: 12px; color: #C9C9C9; }
.auth-points .ic { color: var(--brand); margin-top: 0; }
.auth-points b { color: #fff; font-weight: 600; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 440px; }
.auth-form h1 { font-size: 30px; line-height: 36px; margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin-bottom: 32px; font-size: 16px; line-height: 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--neutral-soft); border-radius: 12px; margin-bottom: 24px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease), box-shadow 300ms var(--ease); }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11,11,12,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 24px 16px; gap: 24px; } .auth-side h2 { font-size: 24px; line-height: 32px; } .auth-points { display: none; } }

/* ---------- Лендинг ---------- */
.site { background: var(--surface); }
.site-nav { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 24px; padding: 8px 8px 8px 16px; border-radius: 9999px;
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid var(--glass-line); box-shadow: 0 8px 24px rgba(11,11,12,.06); width: max-content; max-width: calc(100% - 32px); }
.site-nav .brand { padding: 0; }
.site-nav .brand-mark { width: 24px; height: 24px; border-radius: 6px; }
.site-nav .brand-mark svg { width: 16px; height: 16px; }
.site-links { display: flex; gap: 4px; }
.site-links a { color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 9999px; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.site-links a:hover { background: var(--line-2); color: var(--ink); }
.site-nav .btn { border-radius: 9999px; }
.site-nav .menu-btn { display: none; border-radius: 9999px; }
.site-menu { position: fixed; inset: 0; z-index: 45; background: var(--glass-strong); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 96px 24px 24px; display: flex; flex-direction: column; gap: 8px; opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease); }
.site-menu.open { opacity: 1; pointer-events: auto; }
.site-menu a { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--ink); padding: 12px 0; opacity: 0; transform: translateY(24px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.site-menu.open a { opacity: 1; transform: none; }
.site-menu .btn { margin-top: 16px; font-size: 16px; color: #fff; }
@media (max-width: 860px) { .site-links, .site-nav > .btn-ghost { display: none; } .site-nav .menu-btn { display: grid; } .site-nav { gap: 12px; } }
@media (max-width: 520px) { .site-nav .brand-name { display: none; } .site-nav { left: 16px; right: 16px; transform: none; width: auto; justify-content: space-between; } }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-dark { background: var(--dark); color: #C9C9C9; }
.section-tint { background: var(--bg); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 4px 12px; border-radius: 9999px; }
.section-dark .eyebrow { color: #7BD08C; background: #1F2A20; border-color: #2D4630; }
.h-display { font-size: 48px; line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; max-width: 680px;
  background: linear-gradient(90deg, var(--h-from), var(--h-to)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 8px; }
.h-section { font-size: 36px; line-height: 40px; letter-spacing: -0.03em; max-width: 680px; }
.section-dark .h-section { color: #fff; }
.lead-lg { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 680px; }
.section-dark .lead-lg { color: #9B9B9B; }

.hero { padding: 96px 0 64px; margin-top: 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; justify-items: center; text-align: center; }
.hero .h-display { margin: 24px auto 0; }
.hero .lead-lg { margin: 24px auto 0; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.proof { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 32px; color: var(--muted); font-weight: 500; }
.proof span { display: inline-flex; align-items: center; gap: 8px; }
.proof .ic { color: var(--brand); width: 16px; height: 16px; }

/* Витрина продукта в герое: настоящий интерфейс сравнения с примером данных */
.showcase { width: 100%; max-width: 1040px; border-radius: 24px; padding: 8px; background: var(--line-2); border: 1px solid var(--line); text-align: left; }
.showcase-inner { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.showcase-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.showcase-bar i { width: 12px; height: 12px; border-radius: 9999px; background: var(--line); }
.showcase-bar b { margin-left: 8px; font-weight: 600; color: var(--muted); font-size: 12px; }
.showcase-body { padding: 24px; display: grid; gap: 16px; }
.showcase .t td { padding: 12px 16px; }
@media (max-width: 760px) { .showcase .hide-sm { display: none; } }

/* Слоган, который «проявляется» по словам при прокрутке */
.tagline { font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; max-width: 880px; text-wrap: balance; }
.tagline .w { color: rgba(255,255,255,.28); transition: color 500ms var(--ease); }
.tagline .w.on { color: #fff; }
.tagline .w.accent.on { color: #7BD08C; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 48px; counter-reset: s; }
.step-card { padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.step-card .n { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.step-card h3 { font-size: 18px; line-height: 28px; margin-top: 24px; }
.step-card p { color: var(--muted); margin-top: 8px; font-size: 16px; line-height: 24px; }
.benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.benefit { padding: 32px; border-radius: 16px; background: var(--dark-2); border: 1px solid #313131; }
.benefit .ic { width: 32px; height: 32px; color: #7BD08C; }
.benefit h3 { color: #fff; font-size: 20px; line-height: 28px; margin-top: 24px; }
.benefit p { color: #9B9B9B; margin-top: 8px; font-size: 16px; line-height: 24px; }
.benefit .figure { color: #fff; font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -0.03em; margin-top: 24px; font-variant-numeric: tabular-nums; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.role-card { padding: 32px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 16px; }
.role-card h3 { font-size: 24px; line-height: 32px; }
.role-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.role-card li { display: flex; gap: 12px; color: var(--ink-2); font-size: 16px; line-height: 24px; }
.role-card li .ic { color: var(--brand); }
.role-card .btn { align-self: flex-start; margin-top: auto; }
.faq { margin-top: 48px; border-top: 1px solid var(--line); max-width: 880px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0; font-size: 18px; line-height: 28px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform 500ms var(--ease); color: var(--muted); }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 24px; max-width: 720px; }
.final-cta { text-align: center; display: grid; justify-items: center; gap: 24px; }
.footer { padding: 48px 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--muted); font-weight: 500; }
.footer a:hover { color: var(--ink); }
.prose { max-width: 720px; }
.prose h1 { font-size: 36px; line-height: 40px; margin-bottom: 24px; }
.prose h2 { font-size: 20px; line-height: 28px; margin: 32px 0 12px; }
.prose p, .prose li { font-size: 16px; line-height: 24px; color: var(--ink-2); margin-bottom: 12px; }

@media (max-width: 960px) {
  .section { padding: 64px 0; }
  .hero { padding: 64px 0 48px; }
  .h-display { font-size: 36px; line-height: 40px; }
  .h-section { font-size: 30px; line-height: 36px; }
  .tagline { font-size: 36px; line-height: 40px; }
  .steps, .benefits, .roles { grid-template-columns: minmax(0, 1fr); }
  .role-card, .benefit { padding: 24px; }
  .role-card .btn { white-space: normal; text-align: center; }
  .proof { gap: 8px; flex-direction: column; align-items: center; }
  .wrap { padding: 0 16px; }
}

/* Появление секций при прокрутке */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 300ms !important; transition-property: opacity, color, background-color, border-color !important; animation: none !important; }
  .reveal, .site-menu a, .sidebar .nav a, .sidebar .nav-label { transform: none !important; }
  .btn:active { transform: none; }
}

/* ---------- Окно подтверждения ---------- */
.confirm { border: 0; padding: 0; border-radius: 24px; width: min(480px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(11,11,12,.24); }
.confirm::backdrop { background: rgba(11,11,12,.48); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.confirm[open] { animation: confirm-in 500ms var(--ease); }
.confirm[open]::backdrop { animation: fade-in 300ms var(--ease); }
.confirm-body { padding: 24px; display: grid; gap: 12px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon .ic { width: 24px; height: 24px; }
.confirm h2 { font-size: 20px; line-height: 28px; margin-top: 4px; }
.confirm p { color: var(--muted); font-size: 16px; line-height: 24px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px 24px; }
@keyframes confirm-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- График платежей ---------- */
.schedule summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--brand-ink); list-style: none; }
.schedule summary::-webkit-details-marker { display: none; }
.schedule summary .ic { transition: transform 500ms var(--ease); }
.schedule[open] summary .ic { transform: rotate(90deg); }
.schedule-table { margin-top: 12px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.schedule-table .t th { position: sticky; top: 0; border-top: 0; }
.schedule-table .t td, .schedule-table .t th { padding: 8px 16px; }
.schedule-table tr.total td { font-weight: 700; background: var(--surface-2); }
.rub { display: block; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; }

/* ---------- Графики аналитики ---------- */
.funnel { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 96px; gap: 16px; align-items: center; }
.funnel-bar { height: 24px; border-radius: 0 4px 4px 0; background: var(--brand); min-width: 4px; transition: transform 700ms var(--ease); transform-origin: left; }
.funnel-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-value span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; }
.weeks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 160px; padding-top: 24px; }
.week { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 8px; text-align: center; }
.week-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.week-bar { width: 100%; max-width: 40px; border-radius: 4px 4px 0 0; background: var(--brand); min-height: 2px; }
.week-bar.zero { background: var(--line); }
.week-n { font-size: 12px; line-height: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-label { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) { .funnel-row { grid-template-columns: minmax(0, 1fr) 80px; } .funnel-row .funnel-track { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- Ошибки у полей ---------- */
.field-error { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--danger); }
.field-error[hidden] { display: none; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(180,35,24,.14); }

/* ---------- Уведомления ---------- */
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li + li { border-top: 1px solid var(--line-2); }
.inbox a { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: var(--ink); transition: background-color 300ms var(--ease); }
.inbox a:hover { background: var(--hover); color: var(--ink); }
.inbox li.unread .inbox-text { font-weight: 600; }
.inbox-text { flex: 1; min-width: 0; }
.inbox-text time { display: block; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.inbox-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--info-soft); color: var(--info); }
.inbox-icon .ic { width: 16px; height: 16px; }
.inbox-ok { background: var(--brand-soft); color: var(--brand-ink); }
.inbox-warn { background: var(--warn-soft); color: var(--warn); }
.inbox-bad { background: var(--danger-soft); color: var(--danger); }
.inbox-dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--brand); flex-shrink: 0; }
.inbox-card { border-color: var(--brand-line); }
.count-pill { background: var(--brand); color: #fff; border-radius: 9999px; padding: 0 8px; font-size: 12px; line-height: 20px; font-weight: 700; margin-left: 8px; }

/* ---------- Переключатель темы ---------- */
.theme-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.theme-btn:hover { background: var(--line-2); color: var(--ink); }
.theme-btn .ic-moon { display: block; } .theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; } :root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .ic-moon { display: none; } :root:not([data-theme="light"]) .theme-btn .ic-sun { display: block; } }
.site-nav .theme-btn { border-radius: 9999px; }
/* В тёмной теме тёмные секции лендинга отделяются от фона рамкой */
:root[data-theme="dark"] .section-dark { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Верификация: строки документов ---------- */
.kyc-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 1180px) { .kyc-grid { grid-template-columns: minmax(0, 1fr); } }
.kyc-list { list-style: none; margin: 16px 0 0; padding: 0; }
.kyc-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line-2); }
.kyc-check { width: 24px; height: 24px; border-radius: 9999px; display: grid; place-items: center; border: 2px solid var(--line); color: transparent; margin-top: 0; transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease); }
.kyc-row[data-state="uploaded"] .kyc-check, .kyc-row[data-state="pending"] .kyc-check, .kyc-row[data-state="approved"] .kyc-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.kyc-row[data-state="uploading"] .kyc-check { border-color: var(--brand); border-top-color: transparent; animation: kyc-spin 800ms linear infinite; }
@keyframes kyc-spin { to { transform: rotate(360deg); } }
.kyc-info { min-width: 0; }
.kyc-name { font-weight: 600; overflow-wrap: anywhere; }
/* Длинное имя файла переносится на следующую строку, а не уезжает за край */
.kyc-file { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; font-size: 12px; line-height: 16px; font-weight: 500; overflow-wrap: anywhere; word-break: break-word; }
.kyc-file[hidden] { display: none; }
.kyc-file .ic { margin-top: 0; flex-shrink: 0; }
.kyc-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; min-width: 136px; }
.kyc-form { margin: 0; }
.kyc-pick { cursor: pointer; }
.kyc-pick[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.kyc-pick:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.kyc-done-pill[hidden] { display: none; }
.kyc-wrap { overflow-wrap: anywhere; }
@media (max-width: 560px) { .kyc-row { grid-template-columns: 24px minmax(0, 1fr); } .kyc-actions { grid-column: 2; justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .kyc-row[data-state="uploading"] .kyc-check { animation: none; } }

/* ---------- Низ меню: название компании целиком, действия отдельной строкой ---------- */
.sidebar-foot { display: grid; gap: 12px; align-items: stretch; }
.who-row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.who { white-space: normal; overflow-wrap: anywhere; line-height: 20px; }
.who-kyc { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; margin-top: 2px; }
.who-kyc.kyc-approved { color: var(--brand-ink); }
.who-kyc.kyc-pending { color: var(--warn); }
.who-kyc.kyc-rejected, .who-kyc.kyc-none { color: var(--danger); }
.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.foot-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease); }
.foot-btn:hover { background: var(--line-2); color: var(--ink); }
.foot-btn .ic { width: 16px; height: 16px; }
.foot-logout:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.foot-btn .ic-moon { display: inline-block; } .foot-btn .ic-sun { display: none; }
:root[data-theme="dark"] .foot-btn .ic-moon { display: none; } :root[data-theme="dark"] .foot-btn .ic-sun { display: inline-block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot-btn .ic-moon { display: none; } :root:not([data-theme="light"]) .foot-btn .ic-sun { display: inline-block; } }
@media (max-width: 960px) { .sidebar-foot { margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; } .sidebar.open .sidebar-foot { display: grid; } }

/* ---------- Шапка лендинга на телефоне: логотип, тема и меню ---------- */
@media (max-width: 520px) { .site-nav > .btn-primary { display: none; } .site-nav { gap: 8px; } }

/* ---------- Подсказки к сокращениям ---------- */
abbr.term { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: help; position: relative; outline: none; }
abbr.term::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: min(280px, calc(100vw - 32px)); display: none; padding: 8px 12px; border-radius: 8px;
  background: var(--ink); color: var(--surface); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0; text-align: left; white-space: normal; text-wrap: pretty;
  box-shadow: 0 8px 24px rgba(11,11,12,.18); pointer-events: none; transform: translate(-50%, 0); z-index: 60; }
abbr.term:hover::after, abbr.term:focus::after { display: block; animation: tip-in 300ms var(--ease); }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 4px); } }
html, body { overflow-x: clip; }
.tabs { scrollbar-width: none; }
abbr.term:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.section-dark abbr.term::after, .auth-side abbr.term::after { background: #F2F2F2; color: #181818; }
.fx-note { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); background: var(--neutral-soft); border-radius: 6px; padding: 4px 8px; }

/* ---------- Лендинг: переключатель «Для заёмщиков / Для кредиторов» ---------- */
.audience[data-audience="borrower"] [data-for="creditor"], .audience[data-audience="creditor"] [data-for="borrower"] { display: none !important; }
.aud-switch { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--neutral-soft); margin-bottom: 8px; }
.aud-switch a { padding: 8px 16px; border-radius: 9999px; font-weight: 600; color: var(--ink-2); transition: background-color 300ms var(--ease), color 300ms var(--ease), box-shadow 300ms var(--ease); }
.aud-switch a:hover { color: var(--ink); }
.aud-switch a[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11,11,12,.12); }
.app-preview { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.muted-preview { opacity: .6; }
.offer-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 12px; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.offer-preview > div { display: grid; gap: 4px; }
.offer-preview b { font-size: 18px; line-height: 28px; font-variant-numeric: tabular-nums; }
.offer-preview-result b { color: var(--brand-ink); }
@media (max-width: 760px) { .offer-preview { grid-template-columns: 1fr 1fr; } }

/* ---------- Чат и документы сделки ---------- */
.msg-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.file-chip { display: flex; align-items: flex-start; gap: 4px; overflow-wrap: anywhere; word-break: break-word; }
.file-chip .ic { flex-shrink: 0; margin-top: 2px; }
.msg-image { display: block; margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); max-width: 320px; }
.msg-image img { display: block; width: 100%; max-height: 240px; object-fit: cover; background: var(--surface-2); }
.chat-attach { flex-shrink: 0; }
.chat-input-wrap { flex: 1; min-width: 0; display: grid; gap: 4px; }
.chat-file { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--brand-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file[hidden] { display: none; }
.doc-row { align-items: flex-start; }
.doc-info { min-width: 0; flex: 1; }
.doc-name { display: block; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.doc-name:hover { color: var(--brand-ink); }
.doc-buttons { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.doc-buttons form { margin: 0; }

/* Админка: вкладки, выровненные таблицы, формы решений */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 24px; }
.tabs a { display: inline-flex; align-items: center; padding: 12px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; line-height: 20px; text-decoration: none; transition: color 200ms var(--ease), border-color 200ms var(--ease); }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.t-top td { vertical-align: top; }
.cell-wrap { overflow-wrap: anywhere; min-width: 140px; max-width: 320px; }
.decision { display: grid; gap: 8px; min-width: 240px; }
.decision-reject { display: grid; gap: 8px; }
.decision-reject .input { width: 100%; min-width: 0; }
.reason-input { height: auto; min-height: 72px; resize: vertical; font-size: 14px; line-height: 20px; }
.flag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.complain { margin-top: 16px; }
.complain summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.complain summary::-webkit-details-marker { display: none; }
.complain summary:hover { color: var(--danger); }
.complain-form { display: grid; gap: 8px; margin-top: 8px; max-width: 520px; justify-items: start; }
.complain-form .input { width: 100%; }
.complain-sent { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; }
.doc-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc-links a { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.doc-links .ic-sm, .doc-links svg { flex: none; margin-top: 2px; }
@media (max-width: 640px) { .tabs { flex-wrap: nowrap; overflow-x: auto; } .tabs a { white-space: nowrap; } }

/* Калькулятор на главной */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; margin-top: 48px; align-items: start; }
.calc-inputs, .calc-result { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.calc-amount { display: flex; gap: 8px; }
.calc-amount .input { flex: 1; min-width: 0; }
.input-lg { height: 48px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cur-seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 10px; background: var(--neutral-soft); }
.cur-seg label { position: relative; }
.cur-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cur-seg span { display: grid; place-items: center; height: 40px; padding: 0 12px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.cur-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11,11,12,.12); }
.cur-seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.calc-label { display: flex; justify-content: space-between; align-items: baseline; }
.calc-label output { font-weight: 700; font-variant-numeric: tabular-nums; }
.range { width: 100%; accent-color: var(--brand); margin: 8px 0 4px; height: 24px; }
.range-scale { display: flex; justify-content: space-between; }
.calc-pair { grid-template-columns: 1fr 1fr; }
.calc-pair .field { margin-bottom: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.calc-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 16px; }
.calc-big #r-effective { font-size: 48px; line-height: 52px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.calc-unit { color: var(--muted); font-weight: 600; }
.calc-rows { margin: 0 0 24px; display: grid; }
.calc-rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; line-height: 20px; }
.calc-rows dt { color: var(--ink-2); }
.calc-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-total { font-size: 16px !important; }
.calc-total .rub { margin-top: 4px; font-weight: 500; }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .calc-amount { flex-direction: column; } .calc-pair { grid-template-columns: 1fr; } .calc-pair .field + .field { margin-top: 16px; } .calc-big #r-effective { font-size: 40px; line-height: 44px; } }

/* Страница «Безопасность и документы» */
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.trust-card { padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.trust-card .ic { width: 28px; height: 28px; color: var(--brand); }
.trust-card h3 { font-size: 18px; line-height: 28px; margin-top: 16px; }
.trust-card p { color: var(--muted); margin-top: 8px; font-size: 15px; line-height: 22px; }
.access-table .yes { display: inline-flex; gap: 4px; align-items: center; color: var(--brand-ink); font-weight: 600; }
.access-table .no { color: var(--muted); }
.sla-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.sla-item { padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; }
.sla-item b { font-size: 36px; line-height: 40px; letter-spacing: -0.03em; }
.sla-item span { color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.check-list .ic { flex: none; color: var(--brand); margin-top: 2px; }
@media (max-width: 900px) { .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .trust-grid, .sla-grid { grid-template-columns: minmax(0, 1fr); } }

/* Сроки ответа у сотрудников */
.sla { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.sla-soon { background: var(--warn-soft); color: var(--warn); }
.sla-overdue { background: var(--danger-soft); color: var(--danger); }

/* Рейтинг и профиль кредитора */
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.rating-new { background: var(--neutral-soft); color: var(--ink-2); }
.creditor-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.creditor-link:hover { text-decoration-color: currentColor; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.score-big { font-size: 48px; line-height: 52px; font-weight: 700; letter-spacing: -0.03em; }
.score-bar { height: 8px; border-radius: 9999px; background: var(--neutral-soft); overflow: hidden; margin-top: 6px; }
.score-bar i { display: block; height: 100%; background: var(--brand); border-radius: 9999px; }
.score-parts { display: grid; gap: 12px; margin-top: 16px; }
.score-parts .row { display: flex; justify-content: space-between; font-size: 14px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Сохранённые фильтры */
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.saved-list a { font-weight: 600; overflow-wrap: anywhere; }
.yes-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-ink); font-weight: 600; }
.draft-link { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 16px; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: 12px; color: var(--ink); transition: border-color 300ms var(--ease); }
.draft-link:hover { border-color: var(--brand); }
.draft-link > .ic:first-child { color: var(--brand); flex: none; }
.draft-link > span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.h-page { font-size: 44px; line-height: 48px; }
@media (max-width: 640px) { .h-page { font-size: 32px; line-height: 38px; } }

/* Сбор суммы по заявке (частичное финансирование) */
.funding-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.funding-bar { height: 10px; border-radius: 9999px; background: var(--neutral-soft); overflow: hidden; margin-top: 16px; }
.funding-bar i { display: block; height: 100%; background: var(--brand); border-radius: 9999px; transform-origin: left; animation: bar-in 900ms var(--ease) both; }

/* Действия по офферу и встречная ставка */
.offer-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.counter > summary { list-style: none; cursor: pointer; }
.counter > summary::-webkit-details-marker { display: none; }
.counter[open] > summary { background: var(--neutral-soft); }
.counter-form { display: grid; gap: 8px; width: 260px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

/* Переплата по предложениям: горизонтальные полосы */
.over-chart { margin: 0 24px 16px; padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; display: grid; gap: 10px; }
.over-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; line-height: 20px; }
.over-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.over-track { height: 12px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; }
.over-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--muted); opacity: .45; transform-origin: left; animation: bar-in 700ms var(--ease) both; }
.over-row.is-best .over-track i { background: var(--brand); opacity: 1; }
.over-row.is-best .over-name { color: var(--ink); font-weight: 700; }
.over-value { font-weight: 600; min-width: 96px; text-align: right; }
@keyframes bar-in { from { transform: scaleX(0); } }
@media (max-width: 640px) { .over-row { grid-template-columns: minmax(0, 1fr) auto; } .over-track { grid-column: 1 / -1; grid-row: 2; } }
@media (prefers-reduced-motion: reduce) { .over-track i, .funding-bar i { animation: none; transition: none; } }

/* Форма предложения кредитора */
.offer-grid { grid-template-columns: 1.3fr 1fr 1fr 2fr 0.9fr; align-items: start; }
@media (max-width: 1100px) { .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .offer-grid { grid-template-columns: minmax(0, 1fr); } }
.counter-box { display: inline-grid; gap: 2px; text-align: left; padding: 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn-line); max-width: 320px; }

/* Чек-лист первых шагов */
.onboarding-head { display: flex; align-items: center; gap: 16px; }
.onboarding { padding: 16px 24px; }
.onboarding-toggle { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; transition: color 300ms var(--ease); }
.onboarding-head:hover .onboarding-toggle { color: var(--ink); }
.onboarding[open] .when-closed, .onboarding:not([open]) .when-open { display: none; }
@media (max-width: 640px) { .onboarding-toggle span { display: none; } }
.onboarding-ring { --p: 0; width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--neutral-soft) 0); }
.onboarding-ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.onboarding-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.onboarding-steps li { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 14px; line-height: 20px; color: var(--muted); }
.onboarding-steps .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--neutral-soft); color: var(--ink-2); }
.onboarding-steps li.done { color: var(--ink-2); }
.onboarding-steps li.done .dot { background: var(--brand); color: #fff; }
.onboarding-steps li.next { border-color: var(--brand-line); background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.onboarding-steps li.next .dot { background: var(--surface); color: var(--brand-ink); }
.onboarding-steps a { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
@media (max-width: 900px) { .onboarding-steps { grid-template-columns: minmax(0, 1fr); } }

/* Синдикат кредиторов */
.syndicate { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.syndicate-bar { display: flex; gap: 2px; height: 10px; border-radius: 9999px; overflow: hidden; }
.syndicate-bar i { display: block; background: var(--brand); }
.syndicate-bar i:nth-child(2n) { background: #6BBF7B; }
.syndicate-bar i:nth-child(3n) { background: #A8D9B2; }
.syndicate ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.syndicate li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; font-size: 14px; }
.syndicate li .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.syndicate li:nth-child(2n) .sw { background: #6BBF7B; }
.syndicate li:nth-child(3n) .sw { background: #A8D9B2; }
.syndicate li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syndicate li .muted { text-align: right; }

/* Валютный риск */
.stress { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.stress > summary { cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; list-style: none; }
.stress > summary::-webkit-details-marker { display: none; }
.stress .t { margin-top: 8px; font-size: 13px; }
.stress .t td, .stress .t th { padding: 8px; }
.stress .is-base td { background: var(--surface-2); }

/* Отпечаток договора */
.hash { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.hash code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--neutral-soft); }

/* Палитра серий графиков (проверена на различимость, в т.ч. при дальтонизме) */
:root { --s1: #21A038; --s2: #2F6FDB; --s3: #C46F1C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #2FA84A; --s2: #5B8FF0; --s3: #C47530; } }
:root[data-theme="dark"] { --s1: #2FA84A; --s2: #5B8FF0; --s3: #C47530; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .sw { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.sw.s1, .dot.s1 { background: var(--s1); fill: var(--s1); } .sw.s2, .dot.s2 { background: var(--s2); fill: var(--s2); } .sw.s3, .dot.s3 { background: var(--s3); fill: var(--s3); }
.trend { width: 100%; height: auto; display: block; }
.trend .grid-line { stroke: var(--line-2); stroke-width: 1; }
.trend .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.trend .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .line.s1 { stroke: var(--s1); } .trend .line.s2 { stroke: var(--s2); } .trend .line.s3 { stroke: var(--s3); }
.trend .dot { stroke: var(--surface); stroke-width: 2; }
.trend .hit { fill: transparent; }
.trend .pt:hover .dot { r: 6; }

/* Тепловая карта */
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; }
.heat th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px; }
.heat th[scope="row"] { text-align: left; color: var(--ink-2); white-space: nowrap; }
.heat td { padding: 0; }
.heat-cell { display: grid; place-items: center; min-height: 56px; border-radius: 10px; font-weight: 700; font-size: 18px; line-height: 22px;
  background: color-mix(in srgb, var(--brand) var(--a), var(--surface)); color: var(--ink); font-variant-numeric: tabular-nums; }
.heat-cell.strong { color: #fff; }
.heat-cell small { display: block; font-size: 11px; font-weight: 600; opacity: .8; }

/* Время этапов */
.stage-bars { display: grid; gap: 12px; }
.stage-bar { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr) 80px; gap: 16px; align-items: center; }
.stage-track { height: 12px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; }
.stage-track i { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; animation: bar-in 700ms var(--ease) both; transform-origin: left; }
.stage-value { text-align: right; font-weight: 700; }
@media (max-width: 640px) { .stage-bar { grid-template-columns: minmax(0, 1fr) auto; } .stage-track { grid-column: 1 / -1; } }

/* Живые цифры на главной */
.live { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: 32px 0 20px; }
.live-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.live-item { display: grid; gap: 4px; }
.live-item b { font-size: 40px; line-height: 44px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.live-item span { color: var(--muted); }
.live-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(33, 160, 56, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(33, 160, 56, 0); } 100% { box-shadow: 0 0 0 0 rgba(33, 160, 56, 0); } }
@media (max-width: 760px) { .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .live-item b { font-size: 32px; line-height: 36px; } }

/* Схема потоков ликвидности */
.flow { margin: 48px 0 0; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-line { fill: none; stroke: var(--brand); stroke-linecap: round; opacity: .28; }
.flow-line.out { stroke: var(--s2); }
.flow-pulse { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 3 21; animation: flow 1.4s linear infinite; }
.flow-pulse.out { stroke: var(--s2); }
@keyframes flow { to { stroke-dashoffset: -24; } }
.flow-node { fill: var(--brand); stroke: var(--surface); stroke-width: 3; }
.flow-node.out { fill: var(--s2); }
.flow-hub { fill: var(--ink); }
.flow-hub-title { fill: var(--surface); font-weight: 700; font-size: 17px; font-family: inherit; }
.flow-hub-sub { fill: var(--surface); opacity: .7; font-size: 12px; font-family: inherit; }
.flow-label { fill: var(--ink); font-size: 15px; font-weight: 600; font-family: inherit; }
.flow-value { fill: var(--muted); font-weight: 700; }
.flow-head { fill: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-family: inherit; }
.flow-list { display: none; }
.flow figcaption { margin-top: 12px; }
@media (max-width: 700px) {
  .flow { padding: 16px; }
  .flow-svg { display: none; }
  .flow-list { display: grid; gap: 12px; }
  .flow-list h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
  .flow-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .flow-list li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--neutral-soft); }
  .flow-hub-mobile { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--ink); color: var(--surface); font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { .flow-pulse { animation: none; } .live-dot { animation: none; } }
.calc-stress { margin: 0 0 16px; }
.egrul-card { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--neutral-soft); font-size: 14px; line-height: 20px; display: grid; gap: 2px; }
.egrul-card.ok { background: var(--brand-soft); border: 1px solid var(--brand-line); }
.egrul-card.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }

.lang-btn { display: inline-grid; place-items: center; height: 32px; min-width: 40px; padding: 0 10px; border-radius: 9999px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); }
.lang-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.foot-actions .foot-btn[hidden] { display: none; }

.reject-note b { display: block; }
.reject-reason { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.reject-reason span { display: block; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.reject-reason p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.pw-rules li::before { content: "○"; margin-right: 6px; }
.pw-rules li.ok { color: var(--brand-ink); }
.pw-rules li.ok::before { content: "✓"; }

.saved-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.saved-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.saved-title { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0; }

.contract-preview { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.contract-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px; background: var(--surface-2); flex-wrap: wrap; }
.contract-preview code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.pdf-frame { display: block; width: 100%; height: 560px; border: 0; background: var(--neutral-soft); }
@media (max-width: 640px) { .pdf-frame { height: 420px; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 20px; font-weight: 600; box-shadow: 0 12px 32px rgba(11,11,12,.24);
  animation: toast-in 300ms var(--ease); }
.toast-bad { background: var(--danger); color: #fff; }
.toast-ok { background: var(--brand); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

a.who { display: block; color: inherit; }
a.who:hover { text-decoration: underline; text-underline-offset: 3px; }
.account-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.password-form { max-width: 440px; }
.pdf-fallback { height: 100%; min-height: 200px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); }
.pdf-fallback .ic { width: 32px; height: 32px; color: var(--brand); }
.pdf-fallback p { margin: 0; }

/* ==========================================================================
   Разгрузка кабинета и движение (v2).
   Одна задача на экран: второстепенное уходит во вкладки, формы — в выезжающую панель,
   подробности — в раскрывающиеся блоки. Движение: transform и opacity по кривой var(--ease).
   ========================================================================== */

/* Появление блоков при прокрутке: подъём на 32px и проявление, один раз */
.rv { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv.rv-done { transition: none; }

/* Карточки статистики слегка приподнимаются */
.stat { transition: transform 500ms var(--ease), border-color 300ms var(--ease); }
.stat:hover { transform: translateY(-2px); border-color: var(--input-hover); }
.rv.stat.rv-done { transition: transform 500ms var(--ease), border-color 300ms var(--ease); }

/* Вкладки внутри страницы с бегущей линией */
.seg-tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 24px; overflow-x: auto; scrollbar-width: none; }
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tabs [role=tab] { appearance: none; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted);
  font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; border-radius: 8px 8px 0 0; transition: color 300ms var(--ease), background-color 300ms var(--ease); }
.seg-tabs [role=tab]:hover { color: var(--ink); background: var(--line-2); }
.seg-tabs [role=tab][aria-selected=true] { color: var(--ink); }
.seg-tabs [role=tab] .ic { width: 16px; height: 16px; }
.seg-ink { position: absolute; left: 0; bottom: 0; width: 100px; height: 2px; background: var(--brand); border-radius: 2px; transform-origin: left; transform: scaleX(0); pointer-events: none; }
.seg-ink.ready { transition: transform 500ms var(--ease); }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; padding: 0 8px; border-radius: 9999px; background: var(--neutral-soft); color: var(--ink-2); font-size: 12px; line-height: 20px; font-weight: 700; }
.tab-count.hot { background: var(--brand); color: #fff; }
[role=tabpanel].tab-in { animation: panel-in 500ms var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }

/* Выезжающая панель справа для форм */
.drawer { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(480px, 100%); border: 0; padding: 0; background: var(--surface); color: var(--ink);
  box-shadow: -24px 0 64px rgba(11, 11, 12, .18); flex-direction: column; }
.drawer[open] { display: flex; animation: drawer-in 500ms var(--ease); }
.drawer.closing { animation: drawer-out 300ms var(--ease) forwards; }
.drawer::backdrop { background: rgba(11, 11, 12, .40); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.drawer[open]::backdrop { animation: fade-in 300ms var(--ease); }
.drawer.closing::backdrop { animation: fade-out 300ms var(--ease) forwards; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { font-size: 20px; line-height: 28px; }
.drawer-head p { color: var(--muted); margin-top: 4px; }
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease); }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.96); }
@keyframes drawer-in { from { opacity: 0; transform: translateX(64px); } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(64px); } }
@keyframes fade-out { to { opacity: 0; } }

/* Плавное раскрытие подробностей */
details.smooth > summary { list-style: none; cursor: pointer; }
details.smooth > summary::-webkit-details-marker { display: none; }
details.smooth[open] > :not(summary) { animation: unfold 500ms var(--ease); }
details.smooth.closing > :not(summary) { animation: fold 220ms var(--ease) forwards; }
@keyframes unfold { from { opacity: 0; transform: translateY(-8px); } }
@keyframes fold { to { opacity: 0; transform: translateY(-8px); } }
.chev { transition: transform 500ms var(--ease); }
details[open] > summary .chev { transform: rotate(90deg); }

/* Заголовок списка */
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.list-bar h2 { font-size: 20px; line-height: 28px; display: flex; align-items: center; gap: 8px; }
.list-bar p { color: var(--muted); margin-top: 4px; }

/* ---------- Предложения кредиторов у заёмщика: карточки вместо таблицы ---------- */
.offer-list { display: grid; gap: 16px; }
.offer-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 24px; min-width: 0;
  transition: border-color 300ms var(--ease), box-shadow 500ms var(--ease); }
.offer-card:hover { border-color: var(--input-hover); }
.offer-card.is-best { border-color: var(--brand-line); box-shadow: 0 0 0 4px var(--brand-soft); }
.offer-card.is-closed { background: var(--surface-2); }
.offer-card.is-closed .offer-cost .v { color: var(--muted); }
.offer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.offer-who { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.offer-who .avatar { width: 40px; height: 40px; font-size: 14px; }
.offer-name { font-size: 16px; line-height: 24px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; line-height: 16px; margin-top: 4px; }
.offer-cost { text-align: right; }
.offer-cost .v { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.offer-card.is-best .offer-cost .v { color: var(--brand-ink); }
.offer-cost .l { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; border-radius: 12px; overflow: hidden; background: var(--line-2); border: 1px solid var(--line-2); }
.metric { background: var(--surface-2); padding: 12px 16px; min-width: 0; }
.metric .l { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.metric .v { font-size: 16px; line-height: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.metric .s, .metric .rub { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.offer-note { color: var(--ink-2); }
.offer-note span { color: var(--muted); }
.offer-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line-2); }
.offer-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; flex: 1; }
.offer-tools > details[open] { flex-basis: 100%; order: 2; }
.offer-tools > details > summary { display: inline-flex; align-items: center; gap: 4px; }
.offer-card .counter-form { width: min(360px, 100%); }
.offer-card .counter[open] > summary { background: var(--neutral-soft); }
@media (max-width: 760px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .offer-cost { text-align: left; } }

.summary-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.summary-strip > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 24px; min-width: 0; }
.summary-strip .l { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.summary-strip .v { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip .best { background: var(--brand-soft); border-color: var(--brand-line); }
.summary-strip .best .v { color: var(--brand-ink); }
@media (max-width: 900px) { .summary-strip { grid-template-columns: minmax(0, 1fr); } }
.foot-note { color: var(--muted); font-size: 12px; line-height: 16px; margin: 16px 0 0; max-width: 880px; }

/* ---------- Заявки на рынке у кредитора ---------- */
.market-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 16px; min-width: 0;
  transition: border-color 300ms var(--ease); }
.market-card:hover { border-color: var(--input-hover); }
.market-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; padding: 24px; align-items: start; }
.market-amount { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.market-who { margin-top: 4px; }
.market-purpose { color: var(--ink-2); margin-top: 12px; max-width: 680px; }
.market-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 400px; }
.market-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.market-progress .funding-bar { flex: 1; margin: 0; height: 6px; min-width: 120px; max-width: 320px; }
.market-foot { padding: 16px 24px; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.market-foot > .offer-open[open] { flex-basis: 100%; }
.market-foot > .complain, .market-foot > .complain-sent { margin: 0 0 0 auto; }
.market-foot > .complain[open] { flex-basis: 100%; margin: 0; }
.market-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.market-actions .complain, .market-actions .complain-sent { margin: 0; }
.offer-open > summary { display: inline-flex; }
.offer-open[open] > summary { display: none; }
.offer-panel { padding: 24px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.offer-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.offer-panel-head b { font-size: 16px; line-height: 24px; }
.sent-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.sent-note .ic { color: var(--brand); }
@media (max-width: 760px) { .market-main { grid-template-columns: minmax(0, 1fr); } .market-tags { justify-content: flex-start; } }

.filters { padding: 16px 24px; }
.filters-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
@media (max-width: 1100px) { .filters-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters-row .actions { grid-column: 1 / -1; } }
.filters-saved { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 9999px; border: 1px solid var(--line); font-size: 12px; line-height: 16px; font-weight: 600; background: var(--surface);
  transition: border-color 300ms var(--ease); }
.chip:hover { border-color: var(--input-hover); }
.chip a { color: var(--ink-2); }
.chip form { display: contents; }
.chip button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; border-radius: 9999px; color: var(--muted); cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.chip button:hover { background: var(--danger-soft); color: var(--danger); }
.chip button .ic { width: 12px; height: 12px; }

/* Мои предложения у кредитора */
.my-offer { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.7fr)) minmax(0, 1.3fr); gap: 16px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line-2); }
.my-offer:last-child { border-bottom: 0; }
.my-offer .num-col { font-variant-numeric: tabular-nums; }
.my-offer .l { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.my-offer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.my-offer.needs-action { background: var(--warn-soft); }
@media (max-width: 1000px) { .my-offer { grid-template-columns: repeat(3, minmax(0, 1fr)); } .my-offer > :first-child, .my-offer-actions { grid-column: 1 / -1; } .my-offer-actions { align-items: flex-start; } }

/* Список заявок заёмщика */
.app-row { display: grid; grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 168px; gap: 16px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line-2);
  color: inherit; transition: background-color 300ms var(--ease); }
.app-row:last-child { border-bottom: 0; }
.app-row:hover { background: var(--surface-2); color: inherit; }
.app-row .no { color: var(--muted); font-variant-numeric: tabular-nums; }
.app-row .amt { font-size: 16px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-row .sub { color: var(--muted); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .go { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.app-row .go > .ic { color: var(--faint); transition: transform 500ms var(--ease), color 300ms var(--ease); }
.app-row:hover .go > .ic { transform: translateX(4px); color: var(--ink); }
.new-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 9999px; background: var(--brand); color: #fff; font-size: 12px; line-height: 16px; font-weight: 700; white-space: nowrap; }
@media (max-width: 860px) { .app-row { grid-template-columns: minmax(0, 1fr) auto; } .app-row .no, .app-row .where { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .rv { transform: none !important; }
  .drawer[open], .drawer.closing { animation: none !important; }
  .seg-ink.ready { transition: none; }
}
