/* Портал комплекса цифрового депозитария — стили страниц портала.
   Семейство «RWA Fin»: светлая тема, акцент #1f3f73, рамки 1 px вместо теней, сетка 8 px. */

/* Шрифт Inter подключается отдельно: /.portal/fonts.css (общий для портала и продуктов). */

:root {
  --accent: #1f3f73; --accent-hover: #173159; --accent-soft: #eef2f8; --accent-line: #c9d5e6;
  --bg: #f6f7f9; --surface: #ffffff; --border: #e3e6eb; --border-strong: #cfd5dd;
  --text: #16202e; --muted: #5b6675;
  --ok: #1e7a4c; --ok-bg: #e8f5ee; --ok-line: #bfe3cf;
  --warn: #8a5a00; --warn-bg: #fff6e5; --warn-line: #f0dcb1;
  --err: #b42318; --err-bg: #fdecea; --err-line: #f3c5bf;
  --info: #1f5f99; --info-bg: #eaf2fb; --info-line: #c7dcf1;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --r-sm: 6px; --r: 8px; --r-lg: 10px;
  --focus-ring: 0 0 0 3px rgba(31, 63, 115, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
/* Видимый фокус (бриф, 4б): обводка 2 px #1f3f73 с отступом 2 px у всех интерактивных элементов. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.nowrap, .nw { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 2147483600; padding: 8px 16px;
  background: var(--surface); color: var(--accent); border: 1px solid var(--accent); border-radius: var(--r);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.ic-arrow { width: 14px; height: 14px; transition: transform .15s ease; }

/* --- знак и шапка публичных страниц --- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-hex { width: 20px; height: 20px; fill: var(--accent); flex: none; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sep { width: 1px; height: 18px; background: var(--border-strong); flex: none; }
.brand-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pub-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.pub-head-in { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; }
.pub-main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 56px 24px 64px; }
.pub-foot { border-top: 1px solid var(--border); background: var(--surface); }
.pub-foot-in {
  max-width: 1160px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: space-between; color: var(--muted); font-size: 13px;
}
.pub-foot a { color: var(--muted); }
.pub-foot a:hover { color: var(--accent); }

/* --- вход и регистрация --- */
.auth {
  display: grid; grid-template-columns: minmax(0, 1fr) 440px; column-gap: 72px; row-gap: 32px;
  grid-template-areas: "intro card" "products card"; grid-template-rows: auto 1fr; align-items: start;
}
.auth-register { grid-template-columns: minmax(0, 1fr) 560px; }
.auth-intro { grid-area: intro; padding-top: 8px; }
.auth-card { grid-area: card; }
.auth-products { grid-area: products; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.auth-intro h1 { font-size: 34px; line-height: 1.18; letter-spacing: -0.02em; max-width: 21ch; }
.lead { font-size: 16px; line-height: 1.6; color: var(--muted); margin-top: 16px; max-width: 62ch; }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px; }
.auth-card h2 { font-size: 22px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.auth-alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; }
.auth-alt-title { color: var(--muted); }
.btn-block-soft { width: 100%; margin-top: 10px; }
.auth-alt .muted { font-size: 13px; margin-top: 14px; }

.list-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); max-width: 560px; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.plist-num { width: 16px; color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.plist-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.plist-title { font-weight: 600; font-size: 15px; }
.plist-role { color: var(--muted); font-size: 13.5px; }

.checklist { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.checklist .ic { color: var(--ok); margin-top: 3px; }

.tile {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; line-height: 1;
}
.tile-sm { width: 24px; height: 24px; border-radius: 6px; font-size: 10.5px; }

/* --- формы --- */
.form { margin-top: 4px; }
.field { margin-top: 16px; min-width: 0; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input, .field select, select {
  width: 100%; height: 42px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select { width: auto; min-width: 160px; padding-right: 32px; cursor: pointer; }
.field input:hover, select:hover { border-color: #b4bcc8; }
.field input:focus, select:focus { border-color: var(--accent); }
.field input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.has-error input { border-color: var(--err); }
.has-error input:focus { border-color: var(--err); }
.field-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--err); font-size: 13px; margin-top: 6px; }
.field-error .ic { width: 14px; height: 14px; margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; cursor: pointer; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.field label.check { display: flex; font-size: 14px; font-weight: 400; margin-bottom: 0; }
.field-check .check { margin-top: 0; }
.field-check { margin-top: 20px; }
.field-check.has-error .check input { outline: 2px solid var(--err); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600;
  line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); color: var(--text); border-color: #b4bcc8; }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }
.btn-block { width: 100%; margin-top: 24px; }
.btn-sm { padding: 0 12px; font-size: 14px; }
/* Маленькая вторичная кнопка в строке текста: «Скопировать» у отпечатка (единый вид плашек результата, бриф 4е). */
.btn-xs { height: 28px; padding: 0 10px; font-size: 13px; vertical-align: middle; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* --- сообщения --- */
.alert {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px;
  border: 1px solid; border-radius: var(--r); font-size: 14px; line-height: 1.5;
}
.alert .ic { margin-top: 2px; }
.alert-body { min-width: 0; }
.alert-title { font-weight: 600; }
.alert-body ul { margin: 6px 0 0; padding-left: 18px; }
.alert-body li + li { margin-top: 2px; }
.alert-body a { color: inherit; }
.alert-error { background: var(--err-bg); border-color: var(--err-line); }
.alert-error .ic, .alert-error .alert-title { color: var(--err); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.alert-warn .ic, .alert-warn .alert-title { color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: var(--info-line); }
.alert-info .ic { color: var(--info); }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.alert-ok .ic { color: var(--ok); }
/* Плашка результата — единый вид комплекса (бриф, 4е): значок «галочка в круге», итог жирным, отпечаток с кнопкой
   «Скопировать», время «ДД.ММ.ГГГГ, ЧЧ:ММ МСК». Цвета — как у сообщений. */
.result { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid;
  border-radius: var(--r); font-size: 14px; line-height: 1.5; }
.result > .ic { width: 18px; height: 18px; margin-top: 1px; }
.result-body { min-width: 0; display: grid; gap: 4px; }
.result-title { font-weight: 600; color: var(--text); }
.result-fp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.result-fp code.fp { font-size: 13px; }
.result-when { color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.result-actions .muted { font-size: 13px; }
.result-progress { width: min(320px, 100%); height: 8px; margin: 4px 0 2px; accent-color: var(--info); }
.result-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.result-ok > .ic { color: var(--ok); }
.result-error { background: var(--err-bg); border-color: var(--err-line); }
.result-error > .ic, .result-error .result-title { color: var(--err); }
.result-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.result-warn > .ic { color: var(--warn); }
.result-info { background: var(--info-bg); border-color: var(--info-line); }
.result-info > .ic { color: var(--info); }
.error-summary:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.error-summary ul { padding-left: 16px; }

/* --- документ (политика ПДн, служебные страницы) --- */
.doc { max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 40px 48px; margin: 0 auto; }
.doc h1 { font-size: 28px; line-height: 1.2; }
.doc .lead { margin-top: 12px; }
.doc-list { margin: 28px 0 0; }
.doc-list > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.doc-list dt { font-weight: 600; font-size: 14px; }
.doc-list dd { margin: 0; font-size: 15px; color: var(--text); }
.doc-note { margin: 24px 0; padding: 12px 14px; background: var(--bg); border-radius: var(--r); font-size: 14px; color: var(--muted); }
.doc-short { max-width: 560px; }
.doc-short .alert { margin-bottom: 24px; }
.doc .inline-form { margin-top: 24px; }

/* --- страницы после входа --- */
.page { width: 100%; max-width: 1312px; margin: 0 auto; padding: 32px 24px 56px; }
.page-head h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; }
.page-head .lead { margin-top: 8px; font-size: 15.5px; max-width: none; }
.page-head-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: end; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.access {
  margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 4px 16px;
}
.access > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.access > div:first-child { border-top: 0; }
.access dt { color: var(--muted); }
.access dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.section { margin-top: 40px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.section-head h2 { font-size: 20px; }
.section-head p { color: var(--muted); font-size: 14px; max-width: 78ch; }
#scenario .section-head { display: block; }
#scenario .section-head p { margin-top: 6px; }
#scenario .section-head .guest-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.guest-note .ic { margin-top: 3px; color: var(--accent); }

.catalog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: #b3bfcf; }
.card:hover .ic-arrow { transform: translateX(3px); }
.card:focus-within { border-color: var(--accent); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-step { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-title { font-size: 17px; line-height: 1.3; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-role { font-size: 13.5px; font-weight: 500; color: var(--accent); }
.card-text { font-size: 14px; color: var(--muted); line-height: 1.55; flex: 1 0 auto; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border);
}
.chip {
  display: inline-block; font-size: 12px; line-height: 1.4; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.card-open {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; margin-left: auto; font-size: 15px;
  font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); white-space: nowrap; transition: border-color .15s ease, background-color .15s ease;
}
.card:hover .card-open { border-color: #b4bcc8; background: var(--bg); }
/* витрина проверяющего: разделы «только чтение» — состояние одной строкой и кнопки внизу карточки */
.card-tool:hover { border-color: var(--border); }
.tool-status { display: flex; gap: 8px; align-items: flex-start; flex: 1 0 auto; font-size: 14px; line-height: 1.55;
  color: var(--muted); }
.tool-status .ic { flex: none; margin-top: 3px; color: var(--accent); }
.tool-status-ok .ic { color: var(--ok); }
.tool-status-warn .ic { color: var(--warn); }
.tool-status-err { color: var(--err); }
.tool-status-err .ic { color: var(--err); }
.card-foot-actions { justify-content: flex-start; gap: 8px; }
.card-howto { background: var(--accent-soft); border-color: var(--accent-line); }
.card-howto:hover { border-color: var(--accent-line); }
.card-howto .card-title { font-size: 16px; }
.howto { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.howto li { position: relative; padding-left: 14px; }
.howto li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.deal {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.5fr);
  margin: 16px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.deal > div { padding: 14px 20px; border-left: 1px solid var(--border); min-width: 0; }
.deal > div:first-child { border-left: 0; }
.deal dt { font-size: 12.5px; color: var(--muted); }
.deal dd { margin: 4px 0 0; font-size: 14px; font-weight: 500; line-height: 1.45; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr) 320px; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step-num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.step-title { font-size: 15px; }
.step-text { margin-top: 2px; font-size: 14px; color: var(--muted); max-width: 92ch; }
.step-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 500; line-height: 1.3; background: var(--surface); width: 100%;
  transition: border-color .15s ease, color .15s ease;
}
.step-link-text { flex: 1 1 auto; min-width: 0; }
.step-link:hover { border-color: var(--accent); color: var(--accent); }
.step-link:hover .ic-arrow { transform: translateX(2px); }

.app-foot { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; }
.app-foot-in {
  max-width: 1312px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 6px 24px;
  justify-content: space-between; color: var(--muted); font-size: 13px;
}
.app-foot a { color: var(--muted); }

/* --- администрирование --- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; }
.stat-label { display: block; font-size: 14px; color: var(--muted); }
.stat-value { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
/* длинное слово значения («Приостановлено») переносится, а не выходит за плитку (рецензия R14, П-10: 405 > 390 px) */
.stat { min-width: 0; }
.stat-value { overflow-wrap: anywhere; hyphens: auto; }
.stat-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.tabs { display: flex; gap: 2px; margin-top: 32px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a {
  padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
/* на ПК все вкладки видны сразу (девятая — «Состояние комплекса» — не помещается в строку): перенос, а не прокрутка */
@media (min-width: 961px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
}

.panel { margin-top: 24px; }
.panel + .panel { margin-top: 32px; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; }
.panel-head p { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 80ch; }
.panel-head .crumbs { margin-bottom: 6px; }

/* position: relative — блок прокрутки становится опорным для скрытых подписей (.visually-hidden):
   иначе они выпадают из прокрутки и расширяют страницу на телефоне. */
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 16px;
  background: #fafbfc; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th.num { text-align: right; }
.table th.col-name { width: 24%; }
.table th.col-wide { width: 40%; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfd; }
.table code { font-size: 13px; background: var(--bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.cell-title { font-weight: 600; color: var(--text); text-decoration: none; }
.cell-title:hover { color: var(--accent); text-decoration: underline; }
.cell-sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #eef0f3; color: var(--muted); }
/* длинное действие журнала на телефоне переносится, а не выходит за экран (рецензия R16, Н-18: 391 px при 390) */
@media (max-width: 640px) { .badge-wrap { white-space: normal; max-width: 100%; } }
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: 32px; text-align: center; }
.empty-title { font-weight: 600; margin-bottom: 4px; }

.user-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 20px; }
.facts > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 14px; }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: grid; gap: 16px; }
.action { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.action h3 { font-size: 16px; }
.action > p, .action form > p { margin-top: 6px; font-size: 14px; }
.action .btn { margin-top: 14px; }
.action-danger { border-color: var(--err-line); }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.inline-form .btn { margin-top: 0; }
.inline-form select { height: 40px; }
/* Поле с подписью над ним (бриф, 4в) и кнопка по нижнему краю поля — одной строкой. */
.inline-form-bottom { align-items: flex-end; }
.field-compact { margin-top: 0; }
.inline-form .field-compact select { height: 38px; }

.invite-form {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px 150px 110px auto; gap: 0 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 20px 20px;
}
.invite-submit { padding-top: 43px; }
.invite-form select { width: 100%; }
/* Код приглашения с выбором организации-клиента (поле есть, когда организаций больше одной). */
.invite-form-orgs { grid-template-columns: minmax(0, 1fr) 300px 220px 150px 100px auto; }
/* Организации-клиенты: новая организация — наименование, код, кнопка одной строкой. */
.org-form {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px auto; gap: 0 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 20px 20px;
}
.org-submit { padding-top: 43px; }
.org-filter { margin: 0 0 16px; }
.org-filter select { min-width: 260px; }
/* Вход через каталог организации: второй способ под формой пароля, отделён строкой «или». */
.auth-or { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--border); }
.btn-directory { width: 100%; margin-top: 12px; }
.reveal { margin-bottom: 16px; padding: 16px 20px; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: var(--r-lg); }
.reveal-head { display: flex; gap: 10px; align-items: flex-start; }
.reveal-head .ic { color: var(--ok); margin-top: 3px; }
.reveal-title { font-weight: 600; }
.reveal-head .muted { font-size: 14px; margin-top: 2px; }
.reveal-grid { display: grid; gap: 10px; margin-top: 14px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.copy-label { width: 64px; font-size: 13px; color: var(--muted); }
/* подписи длиннее «Секрет» («Временный пароль», «Адрес активации») — своей шириной, не наезжая на значение */
.reveal-wide .copy-label { width: 132px; }
/* QR-код второго фактора (portal/qr.py): белый фон и рамка — читается и в тёмной теме */
.qr-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 12px 0 4px; }
.qr-box .qr { width: 200px; height: 200px; max-width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; }
.qr-box figcaption { max-width: 34ch; font-size: 13px; }
/* «Памятка для клиента» при выдаче доступа в личный кабинет */
.lk-memo .panel-head { align-items: flex-start; }
.lk-memo-sheet { border: 1px dashed var(--border); border-radius: var(--r-lg); padding: 16px 20px; }
.lk-memo-sheet h3 { margin: 14px 0 8px; font-size: 16px; }
.lk-memo-org { margin: 0; font-size: 13px; color: var(--muted); }
.ob-lk-modes .check-hint { display: block; }
@media print {
  .printing-memo body * { visibility: hidden; }
  .printing-memo .lk-memo-sheet, .printing-memo .lk-memo-sheet * { visibility: visible; }
  .printing-memo .lk-memo-sheet { position: absolute; left: 0; top: 0; width: 100%; border: 0; color: #000;
    background: #fff; }
}
.code-big { font-size: 18px; font-weight: 600; letter-spacing: .06em; background: var(--surface); padding: 6px 12px; border-radius: var(--r-sm); border: 1px solid var(--ok-line); }
.code-link { font-size: 13px; background: var(--surface); padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--ok-line); overflow-wrap: anywhere; }

/* --- окно подтверждения необратимого действия — одно на все продукты (бриф, 4б) --- */
dialog.confirm-dialog {
  width: min(440px, calc(100vw - 32px)); margin: auto; padding: 24px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 16px 48px rgba(22, 32, 46, .24);
  white-space: normal; text-align: left;
}
dialog.confirm-dialog::backdrop { background: rgba(22, 32, 46, .45); }
.dialog-title { font-size: 18px; font-weight: 600; line-height: 1.35; }
.dialog-text { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.btn-danger-solid { background: #b42318; color: #ffffff; border-color: #b42318; }
.btn-danger-solid:hover { background: #912018; border-color: #912018; color: #ffffff; }
.action-buttons { margin-top: 14px; }
/* Поле в окне подтверждения (выбор роли): подпись над полем, на всю ширину окна. */
dialog .dialog-field { margin-top: 16px; }
dialog .dialog-field select { width: 100%; }

/* --- данные продуктов: возврат исходных данных по кнопке --- */
.reset-state { display: grid; gap: 12px; }
.reset-state .alert { margin-top: 0; }
.reset-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.reset-action .muted { font-size: 14px; }

/* --- второй фактор: шаг входа с кодом и профиль --- */
.auth-single { max-width: 440px; margin: 0 auto; }
.auth-card-title { font-size: 22px; }
.field input.code-input { max-width: 200px; font-size: 18px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.action h2 { font-size: 16px; }
.profile-grid { margin-top: 24px; }
.action > form + form { margin-top: 4px; }
.plain-steps { margin: 12px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 6px; }
.reveal-plain { margin: 14px 0 8px; background: var(--bg); border-color: var(--border); }
.reveal-plain .code-big, .reveal-plain .code-link { border-color: var(--border); }
.action .inline-form .field { margin-top: 0; }

/* --- реестр отпечатков журналов: строка витрины и страница администратора --- */
.anchor-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.anchor-line .ic { margin-top: 3px; }
.anchor-line-ok .ic { color: var(--ok); }
.anchor-line-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.anchor-line-warn .ic { color: var(--warn); }
.anchor-line-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.anchor-line a { margin-left: 4px; }
code.fp { font-size: 13px; }
.panel-action { margin: 0; }
.anchor-hint { font-size: 14px; margin: 12px 0 16px; }
.anchor-note { font-size: 14px; margin: -4px 0 16px; padding-left: 12px; border-left: 2px solid var(--info-line);
  color: var(--text); max-width: 960px; }

/* --- пакет для проверяющего комплекса: строка витрины (администратор) и страница --- */
.exam-line { margin-top: 8px; }
.exam-line-info .ic { color: var(--info); }
.exam-line a + a { margin-left: 12px; }
.exam-form { margin-top: 16px; }
.exam-form .field { width: 160px; }
.exam-form .field input { height: 38px; font-variant-numeric: tabular-nums; }
.exam-state:empty { display: none; }
.exam-state { margin-bottom: 4px; }
@media (max-width: 520px) {
  .exam-form .field { width: calc(50% - 6px); }
  .exam-form .btn { width: 100%; }
}

/* --- паспорт клиента: поиск, сводка и карточки продуктов --- */
.pp-search {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-top: 24px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.pp-search .field { flex: 1 1 360px; max-width: 600px; }
.pp-search .field input { height: 38px; }
.search-row { display: flex; align-items: center; gap: 8px 12px; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.ob-search .ob-search-row input { height: 38px; }
.pp-table .cell-action { width: 1%; white-space: nowrap; text-align: right; }
.pp-none { margin-top: 12px; color: var(--muted); font-size: 14px; }
.pp-stats { margin-top: 24px; }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; align-items: start; }
.pp-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.pp-head { display: flex; align-items: flex-start; gap: 12px; }
.pp-title { flex: 1 1 auto; min-width: 0; }
.pp-title h2 { font-size: 16px; line-height: 1.3; }
.pp-title p { margin-top: 2px; font-size: 13px; color: var(--muted); }
.pp-head .badge { flex: none; margin-top: 4px; }
.pp-facts { margin: 0; border-top: 1px solid var(--border); }
.pp-facts > div {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.pp-facts dt { color: var(--muted); }
.pp-facts dd { margin: 0; overflow-wrap: anywhere; }
.pp-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.pp-items { display: grid; gap: 2px; margin: 4px 0 0; padding-left: 18px; }
.tone-err { color: var(--err); }
.tone-warn { color: var(--warn); }
.tone-ok { color: var(--ok); }
.pp-note { padding: 12px 14px; font-size: 14px; color: var(--muted); background: var(--bg); border-radius: var(--r); }
.pp-fail {
  display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; font-size: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r);
}
.pp-fail .ic { margin-top: 2px; color: var(--warn); }
.pp-foot { margin-top: auto; }
.pp-na { background: #fafbfc; }
.pp-refresh { margin: 0; }
.pp-refresh .btn { height: 30px; }
.pp-skeleton { display: grid; gap: 10px; padding: 8px 0 4px; }
.pp-skeleton span {
  display: block; height: 12px; border-radius: 4px; background: #eef1f5; animation: pp-pulse 1.4s ease-in-out infinite;
}
.pp-skeleton span:nth-child(2) { width: 82%; }
.pp-skeleton span:nth-child(3) { width: 64%; }
@keyframes pp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* блок витрины */
.pp-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r-lg);
}
.pp-cta-text { flex: 1 1 420px; min-width: 0; }
.pp-cta h2 { font-size: 20px; }
.pp-cta p { margin-top: 6px; max-width: 78ch; font-size: 14px; color: var(--muted); }
.pp-cta-side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pp-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pp-pick {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; font-size: 14px; font-weight: 500;
  color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); white-space: nowrap;
}
.pp-pick:hover { color: var(--accent); border-color: var(--accent); }
/* заголовок паспорта: источник сведений — строкой под ФИО (рецензия R10: колонка справа сдвигала ФИО вниз) */
.pp-page-head .lead { margin-top: 6px; }
.pp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; margin: 12px 0 0; font-size: 14px; }
.pp-meta > div { display: flex; gap: 6px; align-items: center; }
.pp-meta dt { color: var(--muted); }
.pp-meta dd { margin: 0; font-weight: 500; }
.pp-meta-action { margin-left: auto; }
/* сводный вывод: одна строка «можно ли работать с клиентом» и причины */
.pp-verdict { margin-top: 20px; padding: 16px 20px; border: 1px solid; border-radius: var(--r-lg); }
.pp-verdict-err { background: var(--err-bg); border-color: var(--err-line); }
.pp-verdict-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.pp-verdict-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.pp-verdict-info, .pp-verdict-muted { background: var(--info-bg); border-color: var(--info-line); }
.pp-verdict-head { display: flex; gap: 12px; align-items: flex-start; }
.pp-verdict-head > .ic { width: 20px; height: 20px; margin-top: 18px; }
.pp-verdict-err .pp-verdict-head > .ic, .pp-verdict-err h2 { color: var(--err); }
.pp-verdict-warn .pp-verdict-head > .ic { color: var(--warn); }
.pp-verdict-ok .pp-verdict-head > .ic { color: var(--ok); }
.pp-verdict-info .pp-verdict-head > .ic { color: var(--info); }
.pp-verdict-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pp-verdict h2 { margin-top: 2px; font-size: 19px; line-height: 1.35; }
.pp-verdict-norm { margin-top: 2px; font-size: 13px; color: var(--muted); }
.pp-reasons { display: grid; gap: 6px; margin: 12px 0 0 32px; padding: 12px 0 0; list-style: none;
  border-top: 1px solid rgba(22, 32, 46, .1); }
.pp-reason { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.pp-reason > .ic { margin-top: 3px; }
.pp-reason-err > .ic { color: var(--err); }
.pp-reason-warn > .ic { color: var(--warn); }
.pp-reason-ok > .ic { color: var(--ok); }
.pp-reason-info > .ic, .pp-reason-muted > .ic { color: var(--info); }
.pp-reason-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.pp-reason-text { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.pp-norm { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pp-src { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap;
  text-decoration: none; }
a.pp-src:hover { color: var(--accent); text-decoration: underline; }
.tile-xs { width: 18px; height: 18px; border-radius: 4px; font-size: 8.5px; }
.pp-silent { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0 32px; font-size: 13.5px; color: var(--warn); }
.pp-silent .ic { margin-top: 3px; }
/* расхождения между продуктами — находка контроля */
.pp-conflicts { margin-top: 12px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn); border-radius: var(--r-lg); }
.pp-conflicts-head { display: flex; gap: 10px; align-items: flex-start; }
.pp-conflicts-head > .ic { margin-top: 3px; color: var(--warn); }
.pp-conflicts h2 { font-size: 16px; }
.pp-conflicts-head p { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.pp-conflict-list { display: grid; gap: 12px; margin: 12px 0 0 26px; padding: 0; list-style: none; }
.pp-conflict-title { font-weight: 600; font-size: 14.5px; }
.pp-conflict-items { display: grid; gap: 2px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; }
.pp-conflict-items li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; }
.pp-conflict-product { color: var(--muted); }
.pp-conflict-hint { margin-top: 4px; font-size: 13px; color: var(--muted); }
.pp-conflicts-ok { border-color: var(--ok-line); border-left-color: var(--ok); }
.pp-conflicts-ok .pp-conflicts-head > .ic { color: var(--ok); }
.pp-conflicts-ok .pp-conflict-title { font-weight: 500; }
.pp-checks { margin: 14px 0 0 26px; padding-top: 12px; border-top: 1px solid var(--border); }
.pp-checks .pp-conflict-list { margin: 8px 0 0; }
.pp-checks .pp-conflict-title { font-weight: 500; }
.pp-checks-title { display: flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--ok); }
/* оглавление-якоря к карточкам: на телефоне и планшете (карточки одной колонкой) */
.pp-toc { display: none; margin-top: 20px; }
.pp-toc-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pp-toc ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pp-toc-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; font-size: 13.5px;
  font-weight: 500; color: var(--text); text-decoration: none; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
}
.pp-toc-link:hover { color: var(--accent); border-color: var(--accent); }
.pp-toc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pp-toc-dot-ok { background: var(--ok); }
.pp-toc-dot-warn { background: var(--warn); }
.pp-toc-dot-err { background: var(--err); }
.pp-toc-dot-info { background: var(--info); }
.pp-card { scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
@media (max-width: 960px) {
  .pp-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-toc { display: block; }
}
@media (max-width: 640px) {
  .pp-meta-action { margin-left: 0; }
  .pp-verdict { padding: 14px 16px; }
  .pp-verdict-head > .ic { display: none; }
  .pp-reasons, .pp-silent { margin-left: 0; }
  .pp-verdict h2 { font-size: 17px; }
  .pp-conflicts { padding: 14px 16px; }
  .pp-conflict-list, .pp-checks { margin-left: 0; }
  .pp-conflict-items li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pp-toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-toc-link { width: 100%; }
  .pp-search { padding: 14px 16px; }
  .search-row { flex-wrap: wrap; }
  .search-row .btn { width: 100%; }
  .pp-card { padding: 16px; }
  .pp-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pp-cta { padding: 16px; }
  .pp-cta-side, .pp-cta-side .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-skeleton span { animation: none; }
}

/* --- события комплекса: показатели, потоки, отбор по потоку и лента шины событий --- */
.ev-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ev-flow {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.ev-flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ev-flow-head h3 { font-size: 15px; line-height: 1.4; }
.ev-flow-head .badge { flex: none; margin-top: 1px; }
.ev-flow-route { font-size: 13.5px; color: var(--muted); }
.ev-flow-note { font-size: 13.5px; }
.ev-flow-foot { margin-top: auto; padding-top: 4px; font-size: 14px; }
.ev-check { margin-bottom: 16px; }
/* переход к ленте (#ev-feed) и к записи (#ev-12) — не под закреплённой полосой комплекса */
#ev-feed, .ev-table tr[id] { scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
.ev-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px;
  margin-bottom: 12px; }
.ev-filter-label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ev-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px 4px 12px; font-size: 14px;
  font-weight: 500; line-height: 1.35; color: var(--text); text-decoration: none; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
}
.ev-chip:hover { color: var(--accent); border-color: var(--accent); }
.ev-chip[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.ev-chip-n {
  display: inline-block; min-width: 22px; padding: 0 6px; font-size: 12px; font-weight: 600; line-height: 20px;
  text-align: center; color: var(--text); background: #eef1f5; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.ev-chip-label { min-width: 0; }
.ev-updated { font-size: 13px; }
.ev-updated-wrap { display: grid; gap: 2px; justify-items: end; text-align: right; max-width: 52ch; }
/* Ширины колонок заданы: длинные названия потоков и продуктов переносятся, дата и время — в одну строку. Уже 1170 px
   таблица прокручивается внутри своего блока, на телефоне строки — карточками. */
.table.ev-table { table-layout: fixed; min-width: 1170px; }
.ev-table th, .ev-table td { padding-left: 12px; padding-right: 12px; }
.ev-table th.ev-col-when { width: 16%; }
.ev-table th.ev-col-flow { width: 18%; }
.ev-table th.ev-col-route { width: 17%; }
.ev-table th.ev-col-object { width: 15%; }
.ev-table th.ev-col-latency { width: 8%; }
.ev-table th.ev-col-result { width: 17%; }
.ev-table th.ev-col-action { width: 9%; }
.ev-table td { overflow-wrap: break-word; }
.ev-table .cell-action { white-space: nowrap; text-align: right; }
.ev-result-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ev-result .cell-sub { margin-top: 0; }
.ev-broken td, .ev-table tbody tr.ev-broken:hover td { background: var(--err-bg); }
.ev-fp { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ev-fp summary { cursor: pointer; }
.ev-fp summary:hover { color: var(--accent); }
.ev-fp-body { display: block; margin-top: 4px; }
.ev-table .ev-fp code.fp { font-size: 12px; }
.ev-cta .pp-cta-text .ev-cta-status { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; color: var(--text); }
.ev-cta-status .ic { margin-top: 3px; }
.ev-cta-status-ok .ic { color: var(--ok); }
.ev-cta-status-warn .ic { color: var(--warn); }
/* витрина проверяющего: четыре раздела в ряд, «Как устроен доступ» — строкой ниже на всю ширину */
.exam-tools .card-howto { grid-column: 1 / -1; }
@media (min-width: 961px) {
  .exam-tools .card-howto .howto { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
@media (max-width: 960px) {
  .ev-flows { grid-template-columns: minmax(0, 1fr); }
}
/* телефон: строка ленты — карточка, итог сверху (главная колонка видна сразу) */
@media (max-width: 640px) {
  .ev-flow { padding: 14px 16px; }
  .ev-toolbar { display: block; }
  .ev-updated { margin-top: 10px; }
  .ev-updated-wrap { justify-items: start; text-align: left; max-width: none; }
  .ev-updated-wrap .ev-updated { margin-top: 0; }
  .ev-updated-wrap .ev-updated:first-child { margin-top: 10px; }
  .ev-chips { display: grid; gap: 6px; }
  .ev-chip { width: 100%; justify-content: space-between; }
  /* .table.ev-table — сильнее общих правил карточек ниже по файлу */
  .table.ev-table { min-width: 0; table-layout: auto; }
  .table.ev-table tr { display: flex; flex-direction: column; }
  .table.ev-table td { padding-left: 0; padding-right: 0; }
  .table.ev-table td.ev-result { order: -1; }
  .table.ev-table td.cell-action { text-align: left; }
  .table.ev-table td.cell-action:empty { display: none; }
  .table.ev-table td.cell-action .btn { width: 100%; }
  .ev-fp { text-align: right; }
}

/* --- витрина: дорожка «Клиент А через четыре продукта» --- */
#scenario + #client-a .section-head { display: block; }
#client-a .section-head p { margin-top: 6px; }

/* --- утренняя сводка руководителя депозитария --- */
.br-meta-line { margin-top: 8px; font-size: 14px; color: var(--muted); }
.br-day { margin-top: 16px; }
.br-day:first-of-type { margin-top: 0; }
.br-day h3 { font-size: 15px; margin-bottom: 8px; }
.br-day-overdue h3 { color: var(--err); }
.br-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.br-item { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--r); font-size: 14px; }
.br-item-err { border-left-color: var(--err); }
.br-item-warn { border-left-color: var(--warn); }
.br-item-info { border-left-color: var(--info); }
.br-src { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.br-body { display: flex; flex-direction: column; min-width: 0; }
.br-kind { font-size: 12px; font-weight: 600; color: var(--muted); }
.br-title { overflow-wrap: anywhere; }
.br-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.br-when { font-size: 13.5px; font-weight: 500; }
.br-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.br-empty { padding: 10px 14px; font-size: 14px; color: var(--muted); background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--r); }
.br-later { margin-top: 10px; font-size: 14px; }
.br-breaks { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.br-breaks li { display: flex; flex-direction: column; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; }
@media (min-width: 641px) { .table.br-table { min-width: 720px; } }  /* телефон — карточками */
.br-integrity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.br-item:has(.br-chips) { grid-template-columns: minmax(0, 1fr) auto auto; }
@media (max-width: 960px) {
  .br-item { grid-template-columns: minmax(0, 1fr) auto; }
  .br-src { grid-column: 1 / -1; }
  .br-integrity { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .br-item, .br-item:has(.br-chips) { grid-template-columns: minmax(0, 1fr); }
  .br-open { justify-self: start; }
}

/* --- интеграции и API --- */
@media (min-width: 641px) { .table.int-table { min-width: 1040px; } }  /* телефон — карточками */
@media (max-width: 640px) { .int-table .nw { white-space: normal; } }
.int-table th:nth-child(1) { width: 17%; }
.int-table th:nth-child(2) { width: 30%; }
.int-table th:nth-child(3) { width: 18%; }
.int-table th:nth-child(4) { width: 15%; }
.int-table th:nth-child(5) { width: 20%; }
.int-table .cell-stack .btn { margin-bottom: 4px; }
.int-how { display: grid; gap: 8px; margin: 0; padding: 16px 20px 16px 36px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); font-size: 14.5px; }

/* --- состояние комплекса (администрирование): потоки шины и последние события --- */
.st-flows { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.st-flows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; }
@media (min-width: 641px) { .table.st-table { min-width: 760px; } }  /* телефон — карточками */
.st-sub { margin-top: 20px; font-size: 15px; }
.st-events { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.st-events li { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.st-more { margin-top: 10px; font-size: 14px; }
@media (max-width: 640px) {
  .st-events li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* --- место под полосу комплекса до загрузки bar.js (без сдвига страницы) --- */
#rwf-portal-bar:empty { display: block; height: 40px; background: #16202e; }

/* --- адаптивность --- */
@media (max-width: 1180px) {
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { column-gap: 48px; grid-template-columns: minmax(0, 1fr) 420px; }
  .auth-register { grid-template-columns: minmax(0, 1fr) 520px; }
}
@media (max-width: 960px) {
  .auth, .auth-register { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "card" "products";
    grid-template-rows: none; }
  .auth-intro h1 { max-width: none; }
  .auth-card { max-width: 560px; }
  .page-head-split { grid-template-columns: minmax(0, 1fr); }
  .deal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .deal > div:nth-child(3) { border-left: 0; }
  .deal > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .step { grid-template-columns: 32px minmax(0, 1fr) 260px; }
  .access { max-width: 520px; }
  .user-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invite-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .invite-form .field:first-of-type { grid-column: 1 / -1; }
  .invite-submit { grid-column: 1 / -1; padding-top: 20px; }
  .org-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .org-submit { grid-column: 1 / -1; padding-top: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .pub-head-in, .pub-foot-in { padding-left: 16px; padding-right: 16px; }
  .pub-main { padding: 24px 16px 40px; }
  .auth { row-gap: 24px; }
  .auth-intro { padding-top: 0; }
  .auth-intro h1 { font-size: 26px; }
  .auth-intro .lead { font-size: 15px; margin-top: 10px; }
  .auth-intro .lead-wide { display: none; }
  .eyebrow { margin-bottom: 8px; font-size: 12.5px; }
  .auth-card { padding: 24px 20px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .brand-sub { font-size: 13px; }
  .page { padding: 24px 16px 40px; }
  .page-head h1 { font-size: 23px; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { padding: 18px; }
  .section { margin-top: 32px; }
  .step { grid-template-columns: 32px minmax(0, 1fr); padding: 16px; gap: 12px; align-items: start; }
  .step-num { margin-top: -4px; }
  .step-link { grid-column: 2; justify-self: stretch; }
  .deal { grid-template-columns: minmax(0, 1fr); }
  .deal > div { border-left: 0; padding: 12px 16px; }
  .deal > div + div { border-top: 1px solid var(--border); }
  .stats { gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 24px; }
  .pp-stats .stat-value { font-size: 20px; }
  .doc { padding: 28px 20px; }
  .doc h1 { font-size: 23px; }
  .doc-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .invite-form { grid-template-columns: minmax(0, 1fr); padding: 4px 16px 16px; }
  .org-form { grid-template-columns: minmax(0, 1fr); padding: 4px 16px 16px; }
  .org-filter, .org-filter .field { width: 100%; }
  .org-filter select { min-width: 0; width: 100%; }
  .app-foot-in { padding: 16px; }
  .copy-label { width: 100%; }
}
/* --- телефон: широкие таблицы — карточками, главная колонка сверху, без горизонтальной прокрутки --- */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  .table { min-width: 0; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 16px; }
  .table tr + tr { margin-top: 12px; }
  .table td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0;
    border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .table td.tnum { white-space: nowrap; }
  .table td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 13px; text-align: left; }
  .table td.cell-main { display: block; padding: 0 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
    text-align: left; font-size: 15px; }
  .table td.cell-main::before, .table td.cell-action::before { content: none; }
  .table td.cell-action { display: block; padding-top: 10px; text-align: left; }
  .table td .cell-sub { display: inline; margin-left: 6px; }
  .table td.cell-main .cell-sub { display: block; margin: 2px 0 0; }
  /* значение с подстроками (продукт и эпоха, состояние и пояснение) — одним блоком справа от подписи */
  .table td .cell-stack { display: block; min-width: 0; }
  .table td .cell-stack .cell-sub { display: block; margin: 2px 0 0; }
  /* «Четыре глаза в комплексе»: длинные значения — под подписью во всю ширину, а не узкой колонкой справа */
  .fe-table td { display: block; text-align: left; }
  .fe-table td::before { display: block; margin-bottom: 2px; }
  .table tbody tr:hover td { background: transparent; }
  .dialog-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* --- цепочка доказательств, хронология клиента, приёмка пилота --- */
.tile-bus { background: #46546a; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pp-toc-extra { border-style: dashed; }
/* блок паспорта: цепочки клиента */
.pp-evidence .panel-head { margin-bottom: 12px; }
.evs-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.evs-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-lg);
}
.evs-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.evs-meta { display: flex; flex-wrap: wrap; gap: 6px; }
/* хронология */
.tl-filter { margin-bottom: 12px; }
.tl-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); }
.tl-item { display: grid; grid-template-columns: 164px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start;
  padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-when { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; white-space: nowrap; }
.tl-body { display: flex; gap: 10px; min-width: 0; }
.tl-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: #b4bcc8; }
.tl-dot-ok { background: var(--ok); }
.tl-dot-warn { background: var(--warn); }
.tl-dot-err { background: var(--err); }
.tl-dot-info { background: var(--info); }
.tl-main { min-width: 0; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.tl-who { font-size: 13px; color: var(--muted); }
.tl-title { margin-top: 2px; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.tl-text { margin-top: 2px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.tl-action { justify-self: end; }
.tl-more { margin-top: 8px; font-size: 13px; }
/* цепочка: звенья — шагами сверху вниз, линия связывает номера */
.ch-lead { margin-top: 16px; font-size: 14.5px; color: var(--muted); max-width: 96ch; }
.ch-how { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; font-size: 13.5px;
  background: var(--info-bg); border: 1px solid var(--info-line); border-radius: var(--r); }
.ch-how .ic { margin-top: 2px; color: var(--info); }
.ch-list { scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
.ch-chain { scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
.ch-chain-hl .panel-head h2 { color: var(--accent); }
.ch-ref { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ch-steps { position: relative; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ch-step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.ch-step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: -14px; width: 2px;
  background: var(--border-strong); }
.ch-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 600;
  font-size: 14px; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); z-index: 1; }
.ch-step-found .ch-num { border-color: var(--accent); color: var(--accent); }
.ch-step-verified .ch-num { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.ch-step-missing .ch-num { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.ch-card { min-width: 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); }
.ch-step-missing .ch-card { background: #fffdf8; border-style: dashed; border-color: var(--warn-line); }
.ch-step-na .ch-card { background: #fafbfc; border-style: dashed; }
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.ch-head > div { min-width: 0; display: grid; gap: 2px; }
.ch-head .badge { flex: none; margin-top: 2px; }
.ch-title { font-size: 15.5px; line-height: 1.35; }
.ch-reason { margin-top: 6px; font-size: 14px; color: var(--muted); }
.ch-facts { margin: 10px 0 0; border-top: 1px solid var(--border); }
.ch-facts > div { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px; }
.ch-facts > div:last-child { border-bottom: 0; }
.ch-facts dt { color: var(--muted); }
.ch-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ch-facts .cell-stack { display: grid; gap: 2px; justify-items: start; }
.ch-check .cell-sub { margin-top: 2px; }
.ch-fp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ch-foot { margin-top: 10px; }
.ev-chain-link { font-size: 13px; overflow-wrap: normal; word-break: normal; }
.ch-step-hl .ch-card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* приёмка пилота: критерии */
.acc-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.acc-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.acc-no { border-color: var(--err-line); border-left: 3px solid var(--err); }
.acc-ok { border-left: 3px solid var(--ok); }
.acc-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
  font-weight: 600; background: var(--bg); color: var(--muted); }
.acc-body { min-width: 0; }
.acc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 12px; }
.acc-title { font-weight: 600; min-width: 0; flex: 1 1 320px; }
.acc-reason { margin-top: 4px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.acc-ev { margin-top: 6px; font-size: 13px; color: var(--muted); }
.acc-ev summary { cursor: pointer; }
.acc-ev ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; overflow-wrap: anywhere; }
@media (min-width: 641px) { .table.acc-table { min-width: 720px; } }
@media (max-width: 640px) {
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 14px; }
  .tl-action { justify-self: stretch; }
  .tl-action .btn { width: 100%; }
  .ch-step { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .ch-num { width: 26px; height: 26px; font-size: 13px; }
  .ch-step:not(:last-child)::before { left: 12px; top: 28px; }
  .ch-card { padding: 12px 14px; }
  .ch-head { flex-wrap: wrap; }
  .ch-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ch-foot .btn, .ch-chain .panel-head .btn { width: 100%; }
  .evs-row { padding: 10px 12px; }
  .acc-item { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .acc-num { display: none; }
}
/* звенья цепочки одной строкой */
.ch-map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0;
  list-style: none; }
.ch-map-node { position: relative; min-width: 0; }
.ch-map-node:not(:last-child)::after { content: "→"; position: absolute; right: -8px; top: 50%; width: 8px;
  transform: translateY(-50%); text-align: center; font-size: 12px; color: var(--muted); }
.ch-map-node a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center;
  height: 100%; padding: 8px 10px; color: var(--text); text-decoration: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); }
.ch-map-node a:hover { border-color: var(--accent); }
.ch-map-n { grid-row: span 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 600; color: var(--accent); border: 1.5px solid var(--accent); }
.ch-map-t { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ch-map-s { font-size: 12px; line-height: 1.3; }
.ch-map-s.tone-muted, .ch-map-s.tone-info { color: var(--info); }
.ch-map-ok .ch-map-n { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.ch-map-missing a { border-style: dashed; border-color: var(--warn-line); background: #fffdf8; }
.ch-map-missing .ch-map-n { color: var(--warn); border-color: var(--warn); border-style: dashed; }
.ch-map-na a { border-style: dashed; background: #fafbfc; }
.ch-map-na .ch-map-n { color: var(--muted); border-color: var(--border-strong); }
.ch-map-na .ch-map-s { color: var(--muted); }
.ch-step { scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
@media (max-width: 960px) {
  .ch-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-map-node::after { display: none; }
}
@media (max-width: 640px) {
  .tl-filter .ev-chips { display: flex; flex-wrap: wrap; }
  .tl-filter .ev-chip { width: auto; }
  .tl-action { justify-self: start; }
  .tl-action .btn { width: auto; }
}
/* звено «в работе» — ещё не наступило: не дефект, а ожидание решения в срок */
.ch-step-pending .ch-card { background: var(--surface); border-color: var(--info-line); }
.ch-step-pending .ch-num { border-color: var(--info); color: var(--info); border-style: dotted; }
.ch-reason-main { color: var(--text); font-weight: 500; }
.ch-map-pending a { border-color: var(--info-line); }
.ch-map-pending .ch-map-n { color: var(--info); border-color: var(--info); border-style: dotted; }
.int-guide { display: inline-block; margin-top: 6px; font-size: 13.5px; }

/* --- роли, новый сотрудник --- */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-off { background: #fafbfc; border-style: dashed; }
.card-off .tile { background: #8a94a3; }
.role-panel .panel-head { margin-bottom: 12px; }
.role-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.role-form .field { margin-top: 0; min-width: 260px; }
.staff-form { display: grid; gap: 16px; }
.staff-set { margin: 0; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.staff-set legend { padding: 0 6px; font-weight: 600; font-size: 15px; }
.staff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin-top: 8px; }
.check-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.check-label { display: block; }
.check-hint { display: block; font-size: 13px; color: var(--muted); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.staff-set .field-compact { max-width: 360px; }
.staff-submit { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.rm-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); }
.rm-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.rm-row:last-child { border-bottom: 0; }
.rm-row .src { color: var(--text); font-size: 14px; white-space: normal; }
.rm-powers, .rm-other { margin-top: 12px; font-size: 14px; }
@media (min-width: 641px) { .table.rm-table { min-width: 1180px; table-layout: fixed; } }  /* телефон — карточками */
.rm-table th.col-name { width: 16%; }
.rm-table td { font-size: 13.5px; }
.rm-table th { white-space: normal; vertical-align: bottom; }
.staff-set .check-grid + .field, .staff-set .field-error + .field { margin-top: 16px; }
.rm-table .rm-active { background: var(--accent-soft); }
.rm-power-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 14px; }
@media (max-width: 960px) {
  .staff-grid, .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .staff-set { padding: 14px 14px; }
  .staff-grid, .check-grid, .check-grid-wide { grid-template-columns: minmax(0, 1fr); }
  .rm-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .role-form .field { min-width: 0; width: 100%; }
  .role-form .btn, .staff-submit .btn { width: 100%; }
  .table.rm-table td:not(.cell-main) { display: block; text-align: left; padding: 6px 0; }
  .table.rm-table td:not(.cell-main)::before { display: block; margin-bottom: 1px; }
}
.pw-panel { max-width: 520px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.pw-out { margin-top: 16px; font-size: 14px; }
@media (max-width: 640px) { .pw-panel { padding: 16px; } }
/* регуляторный радар: дата слева, запись справа; на телефоне дата — строкой над записью */
.rd-filters { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 16px; }
.rd-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rd-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--r-lg); scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
.rd-ready-product { border-left-color: var(--ok); }
.rd-ready-bank { border-left-color: #d08b00; }
.rd-ready-act { border-left-color: var(--info); }
.rd-item:target { box-shadow: 0 0 0 2px var(--accent-line); }
.rd-date { display: grid; align-content: start; gap: 2px; padding-right: 16px; border-right: 1px solid var(--border); }
.rd-date-cap { font-size: 13px; color: var(--muted); }
.rd-date-val { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; white-space: nowrap; }
.rd-date-word { font-size: 15px; font-weight: 500; color: var(--muted); }
.rd-date-left { font-size: 13px; color: var(--info); }
.rd-body { min-width: 0; }
.rd-act { font-size: 13px; color: var(--muted); }
.rd-title { font-size: 17px; margin-top: 2px; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rd-facts { display: grid; gap: 8px; margin: 12px 0 0; }
.rd-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
.rd-facts dt { color: var(--muted); font-size: 14px; }
.rd-facts dd { margin: 0; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.rd-date-note { font-size: 13px; color: var(--muted); line-height: 1.4; }
.rd-screens { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rd-screen { display: inline-flex; gap: 8px; align-items: flex-start; color: var(--text); text-decoration: none; }
.rd-screen .tile-sm { margin-top: 1px; }
.rd-screen-text { display: grid; min-width: 0; }
.rd-screen-title { font-weight: 500; color: var(--accent); }
.rd-screen:hover .rd-screen-title { text-decoration: underline; }
.rd-screen-rule { font-size: 13px; color: var(--muted); }
.rd-sources { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.rd-sources-title { font-weight: 600; color: var(--text); }
.rd-sources ul { display: grid; gap: 2px; margin: 4px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.rd-foot { margin-top: 16px; font-size: 13px; }
@media (max-width: 640px) {
  .rd-item { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .rd-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 0 0 8px; border-right: 0;
    border-bottom: 1px solid var(--border); }
  .rd-date-val { font-size: 18px; }
  .rd-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rd-filters { display: grid; gap: 12px; }
}
/* репетиция проверки Банка России: запросы проверяющего карточками, итог — таблицей */
.rh-start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 12px; }
.rh-start .field { margin: 0; }
.rh-note { margin: 0 0 16px; font-size: 13.5px; max-width: 110ch; }
.rh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.rh-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rh-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--info);
  border-radius: var(--r-lg); scroll-margin-top: calc(var(--rwf-bar-h, 40px) + 16px); }
.rh-done { border-left-color: var(--ok); }
.rh-late { border-left-color: var(--err); }
.rh-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 600;
  color: var(--accent); border: 1.5px solid var(--accent); }
.rh-done .rh-num { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.rh-body { min-width: 0; }
.rh-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; }
.rh-title { font-size: 16.5px; min-width: 0; flex: 1 1 320px; }
.rh-ask { margin: 10px 0 0; padding: 10px 14px; background: var(--bg); border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--r) var(--r) 0; font-size: 14.5px; }
.rh-facts { display: grid; gap: 6px; margin: 12px 0 0; }
.rh-facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.rh-facts dt { color: var(--muted); font-size: 14px; }
.rh-facts dd { margin: 0; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.rh-from { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; }
.rh-tiles { display: inline-flex; gap: 4px; flex: none; }
.rh-form { margin-top: 12px; }
.rh-answer { margin-top: 12px; padding: 10px 14px; background: var(--ok-bg); border: 1px solid var(--ok-line);
  border-radius: var(--r); display: grid; gap: 6px; }
.rh-answer .result-fp { margin: 0; }
.rh-file { display: grid; gap: 2px; font-size: 14px; }
.rh-file-name { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 641px) { .table.rh-table { min-width: 860px; } .table.rh-plan { min-width: 760px; } }
.rh-plan td.cell-main .cell-sub { display: block; margin-top: 2px; }
@media (max-width: 640px) {
  .rh-item { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .rh-num { display: none; }
  .rh-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rh-stats { grid-template-columns: minmax(0, 1fr); }
  .rh-start, .rh-start .field, .rh-start select, .rh-start .btn { width: 100%; }
  .rh-form .btn, .rh-answer .btn-sm { width: 100%; }
}

/* --- стандарт форм (docs/depo-pack-2026-11-19/FORMS_STANDARD.md, 23.11) ---
   Форма — разделы с заголовками в порядке процесса; над формой одна строка «что произойдёт».
   Сетка: на ПК две колонки только для коротких парных полей, длинные — на всю ширину; на телефоне — одна колонка.
   Подписи короткие, в одну строку: поля одной строки начинаются на одной высоте. Отступы 8/16/24, между разделами 24+. */
.sform { margin-top: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); max-width: 880px; }
.sform-flat { margin-top: 0; padding: 0; background: none; border: 0; border-radius: 0; max-width: none; }
.form-lead { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.panel .form-lead { margin-top: -4px; }
.fsec { margin: 0; padding: 0; border: 0; min-width: 0; }
.fsec + .fsec, .fsec + .fgrid, .fgrid + .fsec { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.fsec-title { display: block; float: left; width: 100%; padding: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.fsec-title + * { clear: left; }
.fsec-sub { clear: left; padding-top: 4px; color: var(--muted); font-size: 13.5px; }
.fgrid { clear: left; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start;
  padding-top: 12px; }
.fgrid > .field, .fgrid > .field-check, .fgrid > .check { margin-top: 0; }
.fgrid > .field-wide, .fgrid > .fgrid-wide { grid-column: 1 / -1; }
.fgrid .field label:not(.check) { white-space: nowrap; }
.fgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid-pair { grid-template-columns: repeat(2, max-content); gap: 16px 24px; }
.field.has-error > .field-hint { display: none; }
.field-narrow input, .field-narrow select { max-width: 220px; }
.field select { width: 100%; }
.req { margin-left: 3px; color: var(--err); font-weight: 600; }
.opt { margin-left: 4px; color: var(--muted); font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.form-actions .muted { font-size: 13.5px; }
.sform .error-summary, form[data-std] > .error-summary { margin: 0 0 16px; }
button[aria-busy="true"] { cursor: progress; }
.sform + .table-wrap, .sform + .panel-sub { margin-top: 16px; }

/* поле даты: маска ДД.ММ.ГГГГ и календарь */
.date-input { position: relative; max-width: 190px; }
.date-input input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.date-btn { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 40px; display: flex; align-items: center;
  justify-content: center; padding: 0; border: 0; border-left: 1px solid var(--border); background: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--muted); cursor: pointer; }
.date-btn:hover { color: var(--accent); background: var(--accent-soft); }
.date-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-btn .ic { width: 18px; height: 18px; }
.cal { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 288px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(22, 32, 46, .14); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-title { font-size: 14px; font-weight: 600; }
.cal-nav { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.cal-nav:hover { border-color: var(--border-strong); background: var(--bg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { padding: 4px 0; color: var(--muted); font-size: 12px; text-align: center; }
.cal-day { height: 34px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--text);
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-day:hover { background: var(--accent-soft); }
.cal-day[aria-current="date"] { box-shadow: inset 0 0 0 1px var(--accent-line); font-weight: 600; }
.cal-day[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cal-day:disabled { color: var(--border-strong); background: none; cursor: default; }
.cal-day:focus-visible, .cal-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 640px) {
  .sform { padding: 16px; }
  .fgrid, .fgrid-3, .fgrid-pair { grid-template-columns: minmax(0, 1fr); }
  .fgrid .field label:not(.check) { white-space: normal; }
  .field-narrow input, .field-narrow select { max-width: none; }
  .date-input { max-width: none; }
  .form-actions .btn { width: 100%; }
  .cal { width: min(288px, calc(100vw - 48px)); }
}

/* --- личный кабинет клиента депозитария (portal/clientviews.py) --- */
.lk-step { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.lk-panel .plain-steps { margin-top: 0; }
.lk-code-form { margin-top: 16px; }
.lk-new-secret { margin-top: 12px; }
.lk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.lk-out { margin-top: 16px; font-size: 14px; }
.lk-filter { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.ob-lk { margin-top: 24px; }
.ob-lk-form { display: grid; gap: 14px; justify-items: start; }
.ob-lk-note { margin-top: 12px; font-size: 13.5px; }
.ob-reps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ob-rep { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ob-rep-who p { margin: 0; }
.ob-rep-name { font-weight: 600; }
.ob-rep-status { font-size: 14px; margin-top: 4px; }

/* «Проверьте сведения»: предупреждения правил сведений и отметка «Сведения сверены с подлинником документа» */
.checks-block { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--warn-line);
  border-radius: var(--r-lg, 10px); background: var(--warn-bg); color: var(--ink, inherit); }
.checks-block ul { margin: 6px 0 10px; padding-left: 20px; }
.checks-title { margin: 0; font-weight: 600; }

/* «Доступ в личный кабинет выдан» на 390 px: значения переносятся внутри карточки, кнопка копирования — под значением
   (рецензия R21, B‑9.1, B‑11.1: адрес входа выходил за экран — 574 px) */
.reveal-grid .copy-row > code { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 480px) {
  .reveal-grid .copy-row { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .reveal-grid .copy-row > code { width: 100%; box-sizing: border-box; }
}
