/* Справка Bridge Admin — модальное окно и иллюстрации интерфейса */

.help-overlay { z-index: 6000; }

.help-box {
  width: min(96vw, 960px);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.help-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.help-role-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.help-layout {
  display: flex;
  min-height: 0;
  flex: 1;
}

.help-toc {
  width: 230px;
  min-width: 200px;
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  overflow-y: auto;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.help-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.35;
}

.help-toc a:hover,
.help-toc a.active {
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
}

.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 24px;
}

.help-intro {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.help-section {
  margin-bottom: 28px;
  scroll-margin-top: 12px;
}

.help-section h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
}

.help-section p,
.help-section li {
  font-size: 13px;
  line-height: 1.55;
}

.help-section p { margin: 6px 0; }

.help-section ul,
.help-section ol {
  margin: 8px 0 12px 18px;
}

.help-section li { margin: 4px 0; }

.help-section code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
}

.help-section table.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 12px;
}

.help-table th,
.help-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.help-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.help-steps {
  counter-reset: bhelp;
  list-style: none;
  margin: 10px 0 0 !important;
  padding: 0;
}

.help-steps > li {
  counter-increment: bhelp;
  position: relative;
  padding-left: 36px;
  margin-bottom: 14px;
}

.help-steps > li::before {
  content: counter(bhelp);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-tip {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--success-soft);
  border: 1px solid rgba(34, 133, 90, 0.25);
  border-radius: 10px;
  font-size: 12px;
  margin: 10px 0;
}

.help-tip-icon { flex-shrink: 0; font-weight: 700; color: var(--success); }

.help-warn {
  background: var(--warning-soft);
  border-color: rgba(184, 134, 11, 0.3);
}

.help-warn .help-tip-icon { color: var(--warning); }

.help-figure { margin: 14px 0 18px; }

.help-figure figcaption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  font-weight: 500;
}

.help-shot-wrap { position: relative; }

.help-shot {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.help-shot-label {
  display: inline-block;
  margin-bottom: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* —— мини-макеты интерфейса —— */

.bm {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  line-height: 1.35;
  background: var(--bg);
}

.bm-shell { display: flex; min-height: 170px; }

.bm-side {
  width: 26%;
  min-width: 110px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 10px 8px;
}

.bm-brand { font-weight: 800; font-size: 12px; margin: 0 4px 8px; color: var(--accent); }

.bm-group {
  margin: 8px 4px 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.bm-nav {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.bm-nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.bm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.bm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.bm-top strong { font-size: 12px; display: block; }
.bm-top small { font-size: 9px; color: var(--text-muted); }

.bm-content { padding: 10px 12px; flex: 1; }

.bm-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
}

.bm-card-title { font-weight: 700; font-size: 11px; }
.bm-card-sub { font-size: 9px; color: var(--text-muted); margin-bottom: 6px; }

.bm-btn {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  margin: 2px 3px 2px 0;
}

.bm-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.bm-btn.warn { border-color: rgba(184, 134, 11, 0.45); color: var(--warning); }
.bm-btn.hl { box-shadow: 0 0 0 2px var(--accent-glow); }

.bm-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 9px;
  margin-right: 3px;
}

.bm-chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 700; }

.bm-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 6px 0 8px; }

.bm-tab { padding: 4px 9px; font-size: 9px; font-weight: 600; color: var(--text-muted); }
.bm-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

.bm-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}

.bm-badge.ok { background: var(--success-soft); color: var(--success); }
.bm-badge.warn { background: var(--warning-soft); color: var(--warning); }
.bm-badge.danger { background: var(--danger-soft); color: var(--danger); }
.bm-badge.info { background: var(--info-soft); color: var(--info); }

.bm-switch {
  display: inline-block;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: #dfe7e3;
  position: relative;
  vertical-align: middle;
}

.bm-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

.bm-switch.on { background: var(--accent); }
.bm-switch.on::after { left: 14px; }

.bm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.bm-row:last-child { border-bottom: none; }
.bm-row small { display: block; font-size: 8px; color: var(--text-muted); }

.bm-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.bm-table th { text-align: left; color: var(--text-dim); font-weight: 700; padding: 3px 5px; border-bottom: 1px solid var(--border); }
.bm-table td { padding: 4px 5px; border-bottom: 1px solid var(--border); }
.bm-table td small { display: block; color: var(--text-muted); font-size: 8px; }

.bm-field { margin-bottom: 6px; }
.bm-field label { display: block; font-size: 8px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }

.bm-input {
  padding: 4px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 9px;
  min-height: 20px;
}

.bm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bm-grid2 > * { min-width: 0; }

.bm-note {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 9px;
  margin-top: 6px;
}

.bm-login {
  padding: 22px 16px;
  display: flex;
  justify-content: center;
}

.bm-login .bm-card { width: 230px; padding: 14px; }

.bm-flow {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.bm-flow-node {
  flex: 1;
  min-width: 120px;
  max-width: 220px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
}

.bm-flow-node.center { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.bm-flow-node strong { display: block; font-size: 11px; margin-bottom: 3px; }
.bm-flow-node div { font-size: 9px; color: var(--text-muted); }

.bm-flow-arrow {
  align-self: center;
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  min-width: 60px;
}

@media (max-width: 760px) {
  .help-layout { flex-direction: column; }
  .help-toc {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 130px;
  }
}
