/* MainRWE — фирменный стиль. Красный в духе dm365.ru, шрифт Onest. */
:root {
  --red: #D7192B; --red-700: #B01322; --red-800: #8E0F1B; --red-50: #FDEDEE; --red-100: #F6D3D6; --red-200: #F1C3C8;
  --ink: #1B1C20; --ink-2: #4A4C55; --muted: #686B75; --faint: #8E909A;
  --line: #E4E4E8; --line-2: #D5D5DB; --ground: #F5F5F7; --soft: #FAFAFB; --white: #FFFFFF; --gray-bg: #F0F0F2;
  --amber: #E8A33D; --amber-bg: #FDF1DE; --amber-ink: #7A4F08; --amber-line: #C98418;
  --blue: #2F6FDB; --blue-bg: #E6EEFC; --blue-ink: #1D4FA8;
  --green: #178A66; --green-bg: #E2F3EC; --green-ink: #0F6B4E;
  --r-sm: 8px; --r: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
  --shadow: 0 1px 2px rgba(27, 28, 32, .05), 0 4px 16px rgba(27, 28, 32, .05);
  --shadow-lg: 0 12px 40px rgba(27, 28, 32, .14);
  --font: "Onest", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --side-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
a { color: var(--red-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-800); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img, svg { vertical-align: middle; }
button { font: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--gray-bg); padding: 1px 6px; border-radius: 5px; }
[hidden] { display: none !important; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.text-red { color: var(--red-700); }
.text-green { color: var(--green-ink); }
.optional { font-weight: 400; color: var(--muted); }
.req { color: var(--red); margin-left: 3px; font-weight: 700; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(215, 25, 43, .35); outline-offset: 2px; }
.only-mobile { display: none !important; }
.inline { display: inline; }

/* --- логотип --- */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.logo-word { font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.logo-word b { color: var(--red); font-weight: 800; }
.logo-inverse, .logo-inverse .logo-word, .logo-inverse .logo-word b { color: #fff; }

/* --- кнопки --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-700); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-secondary.is-active { border-color: var(--red); color: var(--red-700); background: var(--red-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--gray-bg); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-white { background: #fff; color: var(--red-700); }
.btn-white:hover { background: var(--red-50); color: var(--red-800); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-xl { height: 56px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; background: transparent; border-radius: 9px; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--gray-bg); color: var(--ink); }
.icon-btn[disabled] { opacity: .3; cursor: default; background: transparent; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--red-700); font-size: 13px; font-weight: 600; cursor: pointer; }
.small-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.help-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.help-inline:hover { color: var(--red-700); }

/* --- поля ввода --- */
.input, .select { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23686B75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover { border-color: #B9BBC2; }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(215, 25, 43, .14); }
.input[readonly] { background: var(--soft); }
.input:disabled, .select:disabled { background: var(--ground); color: var(--muted); }
.input-lg { height: 48px; font-size: 16px; border-radius: 12px; }
.input-sm { height: 34px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.4; }
.field-error { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--red-700); line-height: 1.35; }
.field-error .ic { margin-top: 2px; }
.field-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--amber-ink); line-height: 1.35; }
.field-warn .ic { margin-top: 2px; }
.has-error .input, .has-error .select { border-color: var(--red-700); background: #FFFBFB; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--red); flex-shrink: 0; }
.check.has-error { color: var(--red-700); }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; }
.check-chip input { margin: 0; width: 16px; height: 16px; }
.checks-col { display: flex; flex-direction: column; gap: 10px; }
.search-input { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--muted); min-width: 180px; flex: 0 1 260px; }
.search-input input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 14px; color: var(--ink); background: transparent; }
.search-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(215, 25, 43, .14); }
.copy-box { display: flex; gap: 8px; align-items: center; }
.copy-box .input { flex: 1; font-size: 12px; }
.more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }

/* --- бейджи и статусы --- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.badge-sm { height: 22px; padding: 0 8px; font-size: 11.5px; gap: 4px; }
.b-gray { background: var(--gray-bg); color: var(--ink-2); }
.b-amber { background: var(--amber-bg); color: var(--amber-ink); }
.b-blue { background: var(--blue-bg); color: var(--blue-ink); }
.b-green { background: var(--green-bg); color: var(--green-ink); }
.b-ink { background: var(--ink); color: #fff; }
.b-red { background: var(--red-50); color: var(--red-700); }
a.b-red:hover { background: var(--red-100); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); } .dot-amber { background: var(--amber); }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.chip-amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip-red { background: var(--red-50); color: var(--red-700); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.code-chip { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--gray-bg); color: var(--ink); }
.type-chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-2); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-2); }
.flag-amber { background: var(--amber-bg); color: var(--amber-ink); }
.flag-blue { background: var(--blue-bg); color: var(--blue-ink); }
.flag-green { background: var(--green-bg); color: var(--green-ink); }

/* --- флеш-сообщения и уведомления --- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.flash > span { flex: 1; }
.flash .ic { margin-top: 1px; }
.flash-success { background: var(--green-bg); color: var(--green-ink); border-color: #C5E6D8; }
.flash-error { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.flash-warning { background: var(--amber-bg); color: var(--amber-ink); border-color: #F2D7A8; }
.flash-info { background: var(--blue-bg); color: var(--blue-ink); border-color: #CBDAF7; }
.flash-close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0; height: 20px; }
.flash-close:hover { opacity: 1; }
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; font-size: 14px; }
.notice-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notice-red { background: var(--red-50); color: var(--red-800); }
.notice-amber { background: var(--amber-bg); color: var(--amber-ink); }
.notice-gray { background: var(--gray-bg); color: var(--ink-2); }
.notice-green { background: var(--green-bg); color: var(--green-ink); }
.tip { padding: 14px 16px; border-radius: 12px; background: var(--red-50); color: var(--red-800); font-size: 14px; margin: 18px 0; }

/* --- карточки, таблицы --- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 22px; }
.card-pad-x { padding-left: 22px; padding-right: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 12px; }
.card-pad > .card-head { padding-top: 0; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.card-foot.spread { justify-content: space-between; flex-wrap: wrap; }
.content > .card + .card, .content > .card + .section, .content > .section + .section, .content > .split + .card, .content > .card + .split, .content > .kpis + .split, .content > .notice + .card, .content > .split + .split, .content > .card + .form-actions { margin-top: 18px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 12px; background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid #F0F0F2; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFCFD; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td, .table-compact th { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-matched td { background: #FBFDFC; }
.w-40 { width: 40%; } .w-60 { width: 60%; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px !important; }
.mini-bar { display: flex; align-items: center; gap: 8px; }
.mini-bar .bar { width: 90px; }
.person { display: flex; align-items: center; gap: 10px; }
.person > span:last-child { display: flex; flex-direction: column; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; background: var(--gray-bg); color: var(--ink); }
.bar { height: 6px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.bar-blue > span { background: var(--blue); } .bar-green > span { background: var(--green); } .bar-amber > span { background: var(--amber); }
.empty { text-align: center; padding: 48px 24px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--ink-2); max-width: 560px; }
.empty-big { padding: 64px 24px; }
.empty-art { width: 64px; height: 64px; border-radius: 18px; background: var(--red-50); color: var(--red); display: flex; align-items: center; justify-content: center; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 6px; }
.empty-inline { padding: 18px; border: 0; background: transparent; text-align: left; align-items: flex-start; }
.empty-inline p { color: var(--muted); font-size: 14px; }
.pager { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* --- оболочка приложения --- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(90deg, #fff 0, #fff calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), var(--ground) var(--side-w)); }
.sidebar { width: var(--side-w); flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; }
.side-logo { text-decoration: none; padding: 4px 8px; }
.project-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); text-decoration: none; color: var(--ink); }
.project-switch:hover { border-color: var(--line-2); color: var(--ink); }
.project-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; text-transform: uppercase; }
.project-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.project-switch-text b { font-size: 13px; }
.project-switch-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--ground); color: var(--ink); }
.nav-item.active { background: var(--red-50); color: var(--red-700); font-weight: 600; }
.nav-item span:first-of-type { flex: 1; }
.nav-count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; }
.side-help { margin-top: auto; }
.side-help-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--ground); color: var(--ink); text-decoration: none; }
.side-help-card:hover { background: var(--red-50); color: var(--ink); }
.side-help-card .ic { color: var(--red); margin-top: 1px; }
.side-help-card > span { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.side-help-card > span > span { color: var(--muted); font-size: 12px; }
.side-user { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid #F0F0F2; }
.side-user-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px; border-radius: 10px; }
.side-user-link:hover { background: var(--ground); color: var(--ink); }
.side-user-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); color: var(--muted); width: 200px; }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); }
.top-search:focus-within { border-color: var(--ink); background: #fff; }
.content { padding: 28px 32px 56px; max-width: 1480px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head .lead { margin-top: 6px; color: var(--muted); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 19px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-invite { margin-bottom: 18px; }
.narrow { max-width: 760px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .select { width: auto; min-width: 160px; }
.toggle-group { display: flex; gap: 6px; }
.toggle { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; color: var(--ink); text-decoration: none; }
.toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.toggle.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; text-decoration: none; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { border-color: var(--red); color: var(--ink); font-weight: 700; }
.tab-count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); }
.tab-count-red { background: var(--red); color: #fff; }
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-lg); }
.pop-right .pop-body { left: auto; right: 0; }

/* --- KPI и графики --- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.kpi-link:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--ink); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kpi-value { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-note { font-size: 12.5px; color: var(--muted); }
.chart-card { min-height: 300px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 22px; border-bottom: 1px solid #C9CAD0; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.bar-fill { width: 64%; max-width: 38px; background: var(--red); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar-fill { background: var(--red-700); }
.bar-val { font-size: 12px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-label { position: absolute; bottom: -24px; font-size: 12px; color: var(--muted); }
.chart-card .bars { margin-bottom: 28px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feed li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-200); margin-top: 6px; flex-shrink: 0; }
.feed-detail { display: block; color: var(--ink-2); }
.feed-time { display: block; font-size: 12px; color: var(--muted); }

/* --- онбординг --- */
.onboarding { padding: 22px; margin-bottom: 18px; border-color: var(--red-200); background: linear-gradient(0deg, #fff, #fff); }
.onb-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; }
.onb-head h2 { font-size: 20px; }
.onb-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.onb-progress { width: 220px; height: 8px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; }
.onb-progress span { display: block; height: 100%; background: var(--red); border-radius: 999px; }
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.onb-step.is-done { background: var(--soft); }
.onb-step.is-done .onb-text b { color: var(--ink-2); }
.onb-step.is-done .onb-text span { display: none; }
.onb-num { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; color: var(--ink-2); }
.is-done .onb-num { background: var(--green); border-color: var(--green); color: #fff; }
.onb-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: var(--muted); line-height: 1.35; }
.onb-text b { font-size: 14px; color: var(--ink); }
.launch-box { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-radius: 14px; background: var(--red-50); }
.launch-text { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); flex: 1; min-width: 260px; }
.launch-text b { font-size: 15px; color: var(--ink); }

/* --- проекты --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; }
.project-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--ink); transform: translateY(-1px); }
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-top .badge { margin-left: auto; }
.pc-kind { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pc-title { font-size: 17px; font-weight: 600; line-height: 1.35; min-height: 46px; }
.pc-progress { display: flex; flex-direction: column; gap: 8px; }
.pc-progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.pc-progress-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid #F0F0F2; }
.pc-stats div { display: flex; flex-direction: column; min-width: 0; }
.pc-stats b { font-size: 17px; }
.pc-stats span { font-size: 12px; color: var(--muted); }
.pc-foot { font-size: 12px; color: var(--muted); }
.project-card-new { border-style: dashed; border-width: 1.5px; align-items: center; justify-content: center; text-align: center; min-height: 260px; }
.project-card-new > span:last-child { font-size: 13.5px; color: var(--muted); max-width: 260px; }
.pc-new-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--red-50); color: var(--red); display: flex; align-items: center; justify-content: center; }

/* --- мастер --- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.wizard-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wizard-step { display: flex; flex-direction: column; gap: 16px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; }
.step-head h2 { font-size: 18px; }
.step-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wizard-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.wizard-side { position: sticky; top: 80px; }
.side-tip h3 { font-size: 16px; margin-bottom: 12px; }
.tip-steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.tip-steps b { color: var(--ink); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.tpl-card { position: relative; display: block; cursor: pointer; }
.tpl-card input { position: absolute; opacity: 0; }
.tpl-body { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .15s, background .15s; }
.tpl-card:hover .tpl-body { border-color: var(--line-2); }
.tpl-card input:checked + .tpl-body { border-color: var(--red); background: #FFFBFB; box-shadow: 0 0 0 3px rgba(215, 25, 43, .08); }
.tpl-card input:focus-visible + .tpl-body { outline: 3px solid rgba(215, 25, 43, .35); }
.tpl-title { font-weight: 700; font-size: 15px; padding-right: 26px; }
.tpl-text { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.tpl-visits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.tpl-visit { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--gray-bg); color: var(--ink-2); }
.tpl-visit.is-event { background: var(--amber-bg); color: var(--amber-ink); }
.tpl-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: transparent; }
.tpl-card input:checked ~ .tpl-check { background: var(--red); border-color: var(--red); color: #fff; }

/* --- конструктор --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.form-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.form-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--ink); }
.form-card-top { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.matrix-table th, .matrix-table td { text-align: center; }
.matrix-table th.sticky-col, .matrix-table td.sticky-col { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 220px; }
.matrix-table th.sticky-col { background: var(--soft); }
.v-name { display: block; color: var(--ink); font-size: 13px; }
.v-when { display: block; font-weight: 500; font-size: 11px; }
.cell-check { display: inline-flex; cursor: pointer; }
.cell-check input { position: absolute; opacity: 0; }
.cell-check span { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; transition: background .1s; }
.cell-check input:checked + span { background: var(--red); border-color: var(--red); }
.cell-check input:checked + span::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.cell-check input:focus-visible + span { outline: 3px solid rgba(215, 25, 43, .35); }
.visit-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.visit-item { padding: 0; }
.visit-item > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.visit-item > summary::-webkit-details-marker { display: none; }
.visit-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex-shrink: 0; }
.visit-badge.is-event { background: var(--amber-bg); color: var(--amber-ink); }
.visit-sum { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.visit-sum .muted { font-size: 13px; }
.visit-new summary .visit-badge { background: var(--red-50); color: var(--red); }
.visit-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 0 18px 18px; }
.visit-form .field label { display: flex; flex-direction: column; gap: 6px; }
.visit-form .grow { flex: 1 1 220px; }
.small-field { width: 96px; }
.visit-actions { display: flex; gap: 6px; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.builder-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.builder-side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.field-list { list-style: none; margin: 0; padding: 0 12px; }
.field-section { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 14px 10px 6px; }
.field-row { display: flex; align-items: center; gap: 6px; border-radius: 12px; padding: 4px; }
.field-row + .field-row { margin-top: 2px; }
.field-row:hover { background: var(--soft); }
.field-row.is-editing { background: var(--red-50); box-shadow: inset 0 0 0 1.5px var(--red); }
.field-move { display: flex; flex-direction: column; }
.field-move form { line-height: 0; }
.field-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; text-decoration: none; color: var(--ink); }
.field-main:hover { color: var(--ink); }
.field-label { font-weight: 600; font-size: 14.5px; }
.field-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.add-field { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 14px 22px 18px; border-top: 1px solid #F0F0F2; margin-top: 10px; }
.rules-intro { padding-bottom: 6px; }
.rule-list { list-style: none; margin: 0; padding: 6px 12px; }
.rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; }
.rule-row + .rule-row { border-top: 1px solid #F0F0F2; }
.rule-row.is-off { opacity: .55; }
.rule-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.rule-if { font-weight: 600; }
.rule-msg { color: var(--ink-2); font-size: 13px; }
.rule-builder { margin: 8px 22px 22px; padding: 16px; border-radius: 14px; background: var(--ground); display: flex; flex-direction: column; gap: 10px; }
.rb-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--red-700); }
.rb-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rb-line .select { width: auto; max-width: 280px; background-color: #fff; }
.rb-line .input { width: 200px; }
.rb-line .input.grow { flex: 1 1 260px; width: auto; }
.rb-word { font-weight: 700; color: var(--ink); width: 34px; }
.rb-compare { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.editor .card-title { margin: 0; }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.range-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.range-box legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; display: flex; align-items: center; gap: 6px; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-soft { background: #FFFCF6; }
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 14px; background: var(--blue-bg); color: var(--blue-ink); margin-bottom: 18px; font-size: 14px; }
.preview-banner > span { flex: 1; min-width: 240px; }

/* --- пациенты --- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.subj-table td { padding-top: 10px; padding-bottom: 10px; }
.subj-link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.3; }
.subj-link:hover .mono { color: var(--red-700); }
.vcol { min-width: 104px; }
.cell-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); }
.vcell { position: relative; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vc-verified { background: var(--green-bg); } .vc-done { background: var(--blue-bg); } .vc-partial { background: var(--amber-bg); }
.vc-open { border: 1.5px dashed #B9BBC2; } .vc-overdue { border: 1.5px dashed var(--red); }
.vcell-mini { width: 18px; height: 18px; border-radius: 5px; }
.vcell-q { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.vcell-q-static { position: static; border: 0; }
.cell-cap { font-size: 12px; }
.cell-text { font-size: 12px; color: var(--muted); }
.subj-head { padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; margin-bottom: 18px; }
.subj-id { display: flex; flex-direction: column; }
.subj-id .mono { font-size: 22px; font-weight: 600; }
.subj-id .muted { font-size: 13px; }
.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; }
.subj-head .head-actions { margin-left: auto; }
.subj-note { width: 100%; }
.subj-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.subj-visits { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.subj-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.visit-card { padding: 6px 8px 8px; scroll-margin-top: 80px; }
.visit-card:target { box-shadow: 0 0 0 2px var(--red-200); }
.visit-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px 10px; }
.visit-card-head h2 { font-size: 17px; }
.vstate { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); white-space: nowrap; }
.vstate-verified { background: var(--green-bg); color: var(--green-ink); } .vstate-done { background: var(--blue-bg); color: var(--blue-ink); }
.vstate-partial { background: var(--amber-bg); color: var(--amber-ink); } .vstate-overdue { background: var(--red-50); color: var(--red-700); }
.vstate-open { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.form-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.form-row:hover { background: var(--ground); color: var(--ink); }
.form-row-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.form-row-go { color: var(--faint); }
.instance-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 14px 2px; }
.add-event { display: flex; align-items: center; gap: 8px; margin: 6px 6px 4px; padding: 10px 12px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--red-700); font-weight: 600; font-size: 14px; text-decoration: none; }
.add-event:hover { border-color: var(--red); background: var(--red-50); }
.inline-actions { display: flex; gap: 6px; margin: 8px 0; }

/* --- ввод данных --- */
.entry-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.back-link:hover { color: var(--ink); }
.entry-nav { display: flex; gap: 6px; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.entry-layout-single { grid-template-columns: minmax(0, 860px); }
.entry-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.crf-card { overflow: hidden; }
.crf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid #F0F0F2; }
.crf-head h1 { font-size: 24px; margin: 2px 0 4px; }
.crf-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crf-desc { padding: 12px 24px 0; color: var(--ink-2); font-size: 14px; }
.crf-card > .notice { margin: 14px 24px 0; }
.crf-card > .flash { margin: 14px 24px 0; }
.crf-form { padding: 10px 24px 0; }
.crf-section { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 22px 0 4px; }
.crf-field { padding: 14px 0; border-bottom: 1px solid #F3F3F5; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 90px; }
.crf-field:last-of-type { border-bottom: 0; }
.crf-field.has-error .input { border-color: var(--red-700); background: #FFFBFB; }
.crf-field.has-warn .input { border-color: var(--amber-line); background: #FFF8EC; }
.crf-label-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crf-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.crf-code { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.crf-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crf-control > .input { max-width: 420px; }
.crf-control > textarea.input { max-width: 640px; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-num { width: 150px; font-variant-numeric: tabular-nums; }
.input-date { width: 190px; }
.unit { font-size: 14px; color: var(--muted); }
.nd-select { width: auto; height: 36px; font-size: 13px; color: var(--ink-2); }
.crf-msgs { display: flex; flex-direction: column; gap: 4px; }
.crf-msgs:empty { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg .opt { position: relative; cursor: pointer; }
.seg .opt input { position: absolute; opacity: 0; }
.seg .opt span { display: flex; align-items: center; height: 40px; padding: 0 16px; font-size: 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.seg .opt:last-child span { border-right: 0; }
.seg .opt:hover span { background: var(--ground); }
.seg .opt input:checked + span { background: var(--ink); color: #fff; font-weight: 600; }
.seg .opt input:focus-visible + span { box-shadow: inset 0 0 0 3px rgba(215, 25, 43, .4); }
.seg .opt input:disabled + span { cursor: default; color: var(--muted); }
.seg .opt input:disabled:checked + span { background: #5B5E68; color: #fff; }
.seg-wide { display: flex; }
.seg-wide .opt { flex: 1; }
.seg-wide .opt span { justify-content: center; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts .opt { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; padding: 6px 2px; }
.opts .opt input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
.reason-box { margin: 10px 0 0; padding: 14px; border-radius: 12px; background: var(--ground); display: flex; flex-direction: column; gap: 6px; }
.reason-box label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.reason-box.has-error, .reason-box.is-needed { background: var(--amber-bg); }
.reason-box.has-error .input, .reason-box.is-needed .input { border-color: var(--amber-line); }
.crf-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; margin: 14px -24px 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(4px); }
.crf-live { margin-right: auto; }
.crf-live b { color: var(--red-700); }
.crf-live .w { color: var(--amber-ink); }
.sdv-card .card-title { margin-bottom: 8px; }
.sdv-card p { margin-bottom: 12px; }
.side-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid #F0F0F2; }
.side-tab { height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 500; color: var(--muted); cursor: pointer; }
.side-tab.is-active { border-color: var(--red); color: var(--ink); font-weight: 700; }
.side-pane { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.side-empty { padding: 4px 2px; }
.query { border: 1px solid var(--red-200); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.query.is-closed { border-color: var(--line); background: var(--soft); }
.query-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.query-head .badge { margin-left: auto; }
.qmsg { font-size: 14px; }
.qmsg + .qmsg { padding-top: 8px; border-top: 1px dashed var(--line); }
.qmsg-meta { font-size: 12px; color: var(--muted); }
.qmsg-meta b { color: var(--ink); font-weight: 600; }
.qform { display: flex; flex-direction: column; gap: 8px; }
.qform .btn { align-self: flex-start; }
.qform-inline { flex-direction: row; }
.qform-inline .input { height: 34px; font-size: 13px; }
.new-query { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--ground); }
.new-query-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; }
.new-query .btn { align-self: flex-start; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.history li + li { padding-top: 12px; border-top: 1px solid #F0F0F2; }
.h-meta { font-size: 12px; color: var(--muted); }
.h-diff s { color: var(--muted); }
.h-reason { color: var(--ink-2); font-style: italic; }

/* --- команда и импорт --- */
.roles-list { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.roles-list dt { font-weight: 700; font-size: 14px; }
.roles-list dd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.site-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-pick legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.invite-note { margin-left: 12px; }
.member-edit, .site-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member-edit .select { width: auto; }
.site-form { align-items: flex-end; }
.site-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.site-form .grow { flex: 1 1 200px; }
.site-form-new { padding: 16px 22px; border-top: 1px solid var(--line); background: var(--soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.steps-line { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps-line li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.steps-line li span { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.steps-line li.is-active { border-color: var(--red); color: var(--ink); font-weight: 600; }
.steps-line li.is-active span { background: var(--red); color: #fff; }
.steps-line li.is-done span { background: var(--green); color: #fff; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; color: var(--ink-2); position: relative; }
.dropzone:hover { border-color: var(--red); background: var(--red-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > span { display: flex; flex-direction: column; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-bg); }
.map-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 14px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.preview-table summary { cursor: pointer; }
.preview-table .table-wrap { margin-top: 12px; }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.fmt-card { position: relative; cursor: pointer; }
.fmt-card input { position: absolute; opacity: 0; }
.fmt-card > span { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--ink-2); }
.fmt-card > span b { font-size: 15px; color: var(--ink); }
.fmt-card input:checked + span { border-color: var(--red); background: #FFFBFB; }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist li b { margin-left: auto; }
.checklist li.ok .ic { color: var(--green); }
.checklist li.no .ic { color: var(--red); }
.audit-table td { vertical-align: top; }

/* --- выпадающая справка --- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 60; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--red-700); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(27, 28, 32, .32); z-index: 55; }

/* --- статьи помощи --- */
.prose { font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.prose h1 { font-size: 34px; margin: 6px 0 10px; }
.prose h2 { font-size: 22px; margin: 4px 0 8px; }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose-drawer { font-size: 14.5px; }
.prose-drawer h3 { font-size: 16px; margin-top: 20px; }
.help-summary { font-size: 17px; color: var(--ink-2); }
.steps-big { counter-reset: s; list-style: none; padding: 0 !important; }
.steps-big li { counter-increment: s; position: relative; padding-left: 52px; margin-bottom: 20px; }
.steps-big li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps-big h3 { margin-top: 4px !important; }
.help-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.help-table th, .help-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rule-demo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px; border-radius: 12px; background: var(--ground); font-size: 14px; margin-bottom: 12px; }
.rule-demo b { background: #fff; border: 1px solid var(--line-2); padding: 3px 10px; border-radius: 8px; font-weight: 600; }

/* --- публичный сайт --- */
.public { background: #fff; }
.pub-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.pub-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pub-header-inner { display: flex; align-items: center; gap: 28px; height: 70px; }
.pub-logo { text-decoration: none; }
.pub-nav { display: flex; gap: 22px; }
.pub-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.pub-nav a:hover { color: var(--red-700); }
.pub-actions { margin-left: auto; display: flex; gap: 8px; }
.pub-footer { background: var(--ground); border-top: 1px solid var(--line); margin-top: 0; }
.pub-footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 48px; padding: 40px 24px; }
.pub-footer-brand p { color: var(--muted); font-size: 14px; max-width: 420px; margin-top: 10px; }
.pub-footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pub-footer-links a { color: var(--ink-2); text-decoration: none; }
.pub-footer-links a:hover { color: var(--red-700); }
.pub-footer-copy { grid-column: 1 / -1; font-size: 13px; color: var(--muted); padding-top: 16px; border-top: 1px solid var(--line); }
.lp-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-700); }
.lp-hero { padding: 64px 0 56px; overflow: hidden; background: radial-gradient(900px 480px at 85% 20%, #FDEFF0 0%, rgba(253, 239, 240, 0) 70%); }
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.lp-hero h1 { font-size: clamp(38px, 5.2vw, 64px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; margin: 16px 0 20px; }
.lp-lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 560px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.lp-proof { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--ink-2); }
.lp-proof li { display: flex; align-items: center; gap: 6px; }
.lp-proof .ic { color: var(--green); }
.lp-hero-art { position: relative; height: 560px; }
.lp-mock { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(27, 28, 32, .13); }
.lp-mock-form { top: 0; left: 0; width: 360px; }
.lpm-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lpm-dots { display: flex; gap: 5px; }
.lpm-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }
.lpm-title { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.lpm-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.lpm-h { font-weight: 700; font-size: 16px; }
.lpm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.lpm-input { display: inline-flex; align-items: baseline; gap: 6px; min-width: 128px; height: 34px; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lpm-input i { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.lpm-input-warn { border-color: var(--amber-line); background: #FFF8EC; }
.lpm-msg { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--amber-ink); background: var(--amber-bg); border-radius: 8px; padding: 6px 8px; }
.lpm-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; font-size: 12px; }
.lpm-seg > * { padding: 7px 10px; border-right: 1px solid var(--line); }
.lpm-seg > *:last-child { border: 0; }
.lpm-seg b { background: var(--ink); color: #fff; }
.lpm-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.lpm-btn, .lpm-btn-ghost { font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-radius: 9px; }
.lpm-btn { background: var(--red); color: #fff; }
.lpm-btn-ghost { border: 1px solid var(--line-2); }
.lp-mock-matrix { left: 36px; top: 418px; width: 300px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.lpm-mtitle { font-weight: 700; font-size: 13px; }
.lpm-mrow { display: grid; grid-template-columns: 1fr 34px 34px 34px; gap: 8px; align-items: center; font-size: 12px; }
.lpm-c { position: relative; width: 30px; height: 30px; border-radius: 8px; background: var(--ground); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.lpm-c b { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.lpm-c-open { background: #fff; border: 1.5px dashed #B9BBC2; }
.lpm-c-over { background: #fff; border: 1.5px dashed var(--red); }
.lpm-c-fut { background: transparent; }
.lp-mock-phone { left: 344px; top: 64px; width: 204px; padding: 26px 14px 16px; border-radius: 28px; border: 6px solid var(--ink); display: flex; flex-direction: column; gap: 7px; }
.lpp-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 56px; height: 6px; border-radius: 999px; background: var(--ink); }
.lpp-q { font-size: 12.5px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.lpp-opt { font-size: 11.5px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; }
.lpp-on { border: 1.5px solid var(--red); background: #FFF6F7; font-weight: 600; }
.lpp-btn { margin-top: 4px; text-align: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--red); padding: 9px; border-radius: 10px; }
.lp-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.lp-strip-inner { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding-top: 20px; padding-bottom: 20px; }
.lp-strip-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 6px; }
.lp-tag { font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.lp-section { padding: 88px 0; }
.lp-soft { background: var(--ground); }
.lp-section-head { max-width: 720px; margin-bottom: 40px; }
.lp-section-head h2, .lp-split h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 14px; line-height: 1.08; }
.lp-section-head p, .lp-split p { font-size: 17px; color: var(--ink-2); line-height: 1.6; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lp-steps li { padding: 28px; border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.lp-step-n { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; background: var(--red); color: #fff; font-size: 24px; font-weight: 800; align-items: center; justify-content: center; margin-bottom: 18px; }
.lp-steps h3 { font-size: 20px; margin-bottom: 8px; }
.lp-steps p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.lp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lp-feature { background: #fff; border-radius: 20px; padding: 26px; border: 1px solid var(--line); }
.lp-ficon { width: 46px; height: 46px; border-radius: 14px; background: var(--red-50); color: var(--red); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.lp-feature h3 { font-size: 18px; margin-bottom: 8px; }
.lp-feature p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.lp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.lp-list { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.lp-list li { display: flex; gap: 10px; align-items: flex-start; }
.lp-list .ic { color: var(--red); margin-top: 3px; }
.lp-rule { background: var(--ink); color: #fff; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(27, 28, 32, .2); }
.lp-rule-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.lp-rw { width: 38px; font-weight: 700; color: #B9BBC2; }
.lp-pill { padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-weight: 600; }
.lp-pill-op { background: rgba(255, 255, 255, .18); font-family: var(--mono); }
.lp-pill-red { background: var(--red); }
.lp-pill-amber { background: var(--amber); color: var(--ink); }
.lp-rule-msg { color: #D5D5DB; font-size: 13.5px; }
.lp-rule-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 6px 0; }
.lp-split-rev { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.lp-phone-big { display: flex; justify-content: center; }
.lpb-screen { width: 300px; border: 10px solid var(--ink); border-radius: 40px; background: #fff; padding: 22px 18px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 70px rgba(27, 28, 32, .2); }
.lpb-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lpb-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lpb-progress i { height: 5px; border-radius: 999px; background: var(--gray-bg); display: block; }
.lpb-progress i.on { background: var(--red); }
.lpb-q { font-size: 15px; font-weight: 700; line-height: 1.35; }
.lpb-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.lpb-scale span { text-align: center; font-size: 12px; font-weight: 600; padding: 9px 0; border: 1px solid var(--line-2); border-radius: 8px; }
.lpb-scale span.on { background: var(--red); border-color: var(--red); color: #fff; }
.lpb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lpb-opts span { text-align: center; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; font-weight: 600; font-size: 14px; }
.lpb-opts span.on { border: 2px solid var(--red); background: #FFF6F7; }
.lpb-btn { text-align: center; background: var(--red); color: #fff; font-weight: 700; padding: 14px; border-radius: 14px; }
.lp-dark { background: var(--ink); color: #fff; padding: 88px 0; }
.lp-section-head-dark h2 { color: #fff; }
.lp-section-head-dark .lp-eyebrow { color: #FF8A95; }
.lp-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.lp-trust > div { padding: 24px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.lp-ticon { width: 44px; height: 44px; border-radius: 13px; background: var(--red); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.lp-trust h3 { font-size: 17px; margin-bottom: 8px; }
.lp-trust p { color: #C9CAD0; font-size: 14.5px; line-height: 1.55; }
.lp-faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.lp-faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.lp-faq summary { cursor: pointer; font-size: 17px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--red); }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq p { color: var(--ink-2); margin-top: 10px; font-size: 15.5px; line-height: 1.6; }
.lp-cta-band { background: var(--red); color: #fff; padding: 56px 0; }
.lp-cta-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.lp-cta-inner h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.02em; }
.lp-cta-inner p { color: #FFE3E5; margin-top: 8px; font-size: 16px; }
.prose-page { padding-top: 48px; padding-bottom: 64px; max-width: 820px; }
.prose-page h1 { font-size: 34px; margin-bottom: 8px; }
.prose-page h2 { font-size: 20px; margin: 28px 0 8px; }
.prose-page p, .prose-page li { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.help-hero { background: var(--ground); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.help-hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.help-hero p { color: var(--ink-2); font-size: 17px; margin: 8px 0 20px; max-width: 640px; }
.help-search { display: flex; align-items: center; gap: 10px; max-width: 560px; height: 54px; padding: 0 16px; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; color: var(--muted); }
.help-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--ink); background: transparent; }
.help-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(215, 25, 43, .14); }
.help-cats { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 32px; }
.help-start { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 18px; background: var(--red); color: #fff; text-decoration: none; }
.help-start:hover { background: var(--red-700); color: #fff; }
.help-start > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.help-start b { font-size: 18px; }
.help-start > span > span { color: #FFE3E5; font-size: 14px; }
.help-start-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; }
.help-cat h2 { font-size: 20px; margin-bottom: 12px; }
.help-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.help-item { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.help-item:hover { border-color: var(--red-200); background: #FFFBFB; color: var(--ink); }
.help-item span { font-size: 14px; color: var(--ink-2); }
.help-page { display: grid; grid-template-columns: 260px minmax(0, 760px); gap: 48px; padding-top: 40px; padding-bottom: 64px; }
.help-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 94px; align-self: start; }
.help-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); margin-bottom: 14px; }
.help-nav-cat { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.help-nav-item { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.help-nav-item:hover { background: var(--ground); color: var(--ink); }
.help-nav-item.is-active { background: var(--red-50); color: var(--red-700); font-weight: 600; }
.help-pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.help-pn a { display: flex; flex-direction: column; text-decoration: none; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; max-width: 48%; color: var(--ink); }
.help-pn a span { font-size: 12px; color: var(--muted); }
.help-pn-next { text-align: right; margin-left: auto; }

/* --- вход и регистрация --- */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.auth-brand { position: relative; overflow: hidden; background: var(--red); color: #fff; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-logo { text-decoration: none; position: relative; z-index: 1; }
.auth-logo .logo-word { font-size: 24px; }
.auth-brand-text { position: relative; z-index: 1; max-width: 520px; }
.auth-brand-text h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; line-height: 1.06; letter-spacing: -0.03em; }
.auth-brand-text p { margin-top: 16px; font-size: 17px; color: #FFE3E5; line-height: 1.55; }
.auth-points { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 14.5px; }
.auth-points li { display: flex; gap: 8px; align-items: center; }
.auth-bg-mark { position: absolute; right: -180px; bottom: -210px; width: 640px; height: 640px; opacity: .13; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-logo-mobile { display: none; text-decoration: none; }
.auth-title { font-size: 30px; font-weight: 700; }
.auth-sub { color: var(--ink-2); font-size: 15px; margin-top: -8px; }
.auth-foot { margin-top: 32px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--muted); }
.invite-box { padding: 16px; border-radius: 14px; background: var(--ground); }
.invite-project { font-size: 18px; font-weight: 700; }
.invite-meta { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

/* --- ePRO (пациент) --- */
.epro { background: var(--ground); }
.epro-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.epro-header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.epro-project { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.epro-main { flex: 1; padding: 24px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.epro-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.epro-lead { font-size: 17px; color: var(--ink-2); line-height: 1.5; }
.epro-list { display: flex; flex-direction: column; gap: 10px; }
.epro-task { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px solid var(--line-2); border-radius: 16px; text-decoration: none; color: var(--ink); min-height: 72px; }
.epro-task:hover, .epro-task:focus-visible { border-color: var(--red); background: #FFF6F7; color: var(--ink); }
.epro-task-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.epro-task-text b { font-size: 17px; }
.epro-task-text span { font-size: 14px; color: var(--muted); }
.epro-go { color: var(--red); }
.epro-done { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 16px; background: var(--green-bg); color: var(--green-ink); font-size: 16px; }
.epro-sub { font-size: 16px; margin-top: 8px; }
.epro-sent { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 15px; }
.epro-sent li { display: flex; gap: 8px; align-items: center; }
.epro-sent .ic { color: var(--green); }
.epro-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.epro-meta { font-size: 14px; color: var(--muted); }
.epro-form { padding: 0; }
.epro-form .crf-field { padding: 20px 0; gap: 12px; }
.epro-form .crf-label { font-size: 18px; line-height: 1.35; }
.epro-form .input { height: 52px; font-size: 18px; }
.epro-form .input-num { width: 140px; }
.epro-form textarea.input { height: auto; font-size: 16px; }
.opts-big { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.opts-big .opt { position: relative; cursor: pointer; }
.opts-big .opt input { position: absolute; opacity: 0; }
.opts-big .opt span { display: flex; align-items: center; min-height: 56px; padding: 12px 16px 12px 48px; border: 1.5px solid var(--line-2); border-radius: 14px; font-size: 16.5px; position: relative; }
.opts-big .opt span::before { content: ""; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
.opts-big .opt-check span::before { border-radius: 6px; }
.opts-big .opt input:checked + span { border: 2px solid var(--red); padding-left: 47px; background: #FFF6F7; font-weight: 600; }
.opts-big .opt input:checked + span::before { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 4px #fff; }
.opts-big .opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(215, 25, 43, .3); }
.epro-submit { margin-top: 12px; }
.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: 100%; }
.scale-opt { position: relative; cursor: pointer; }
.scale-opt input { position: absolute; opacity: 0; }
.scale-opt span { display: flex; align-items: center; justify-content: center; height: 52px; border: 1.5px solid var(--line-2); border-radius: 12px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scale-opt input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.scale-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(215, 25, 43, .3); }
.epro-foot { padding: 16px 20px 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* --- страница ошибки --- */
.error-page { background: #fff; }
.error-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.error-wrap a:first-child { text-decoration: none; margin-bottom: 20px; }
.error-code { font-size: 88px; font-weight: 800; color: var(--red); letter-spacing: -0.04em; line-height: 1; }
.error-wrap h1 { font-size: 28px; }
.error-wrap p { color: var(--ink-2); max-width: 520px; }
.error-actions { display: flex; gap: 10px; margin-top: 10px; }

/* --- адаптив --- */
@media (max-width: 1180px) {
  .builder, .entry-layout, .subj-layout { grid-template-columns: minmax(0, 1fr); }
  .builder-side, .entry-side, .subj-side { position: static; max-height: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .lp-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .lp-hero-art { height: 480px; max-width: 620px; }
  .lp-features, .lp-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .only-mobile { display: inline-flex !important; }
  .shell { background: var(--ground); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(27, 28, 32, .32); z-index: 65; }
  .topbar { padding: 0 16px; }
  .top-search, .help-btn span { display: none; }
  .content { padding: 20px 16px 48px; }
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wizard-side { position: static; }
  .pub-nav { display: none; }
  .lp-steps { grid-template-columns: minmax(0, 1fr); }
  .lp-split, .lp-split-rev, .lp-faq-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-logo-mobile { display: block; }
  .help-page { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .help-nav { position: static; }
  .pub-footer-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .crumbs > a, .crumbs > span { display: none; }
  .topbar .badge { display: none; }
  .page-head h1 { font-size: 24px; }
  .lp-hero { padding-top: 40px; }
  .lp-hero-art { height: auto; display: flex; flex-direction: column; gap: 14px; }
  .lp-mock { position: relative; inset: auto; width: 100%; }
  .lp-mock-phone { display: none; }
  .lp-features, .lp-trust { grid-template-columns: minmax(0, 1fr); }
  .lp-section, .lp-dark { padding: 56px 0; }
  .pub-actions .btn-ghost { display: none; }
  .pub-header-inner { gap: 12px; }
  .kpi-value { font-size: 26px; }
  .crf-head, .crf-form { padding-left: 16px; padding-right: 16px; }
  .crf-foot { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .seg { display: flex; flex-wrap: wrap; }
  .seg .opt { flex: 1 1 auto; }
  .seg .opt span { justify-content: center; border-bottom: 1px solid var(--line); }
  .map-grid { grid-template-columns: minmax(0, 1fr); }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .auth-points { grid-template-columns: 1fr; }
  .subj-head .head-actions { margin-left: 0; }
}
@media print {
  .sidebar, .topbar, .entry-side, .crf-foot, .help-btn { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
