/* frontend_compass/compass.css — стиль продуктов COMPASS (install-хаб + сайдбар).
 * Спокойный инженерный жанр: белый, синий #0f62fe, никаких градиентов и «ИИ-дашбордов».
 * Нарочно НЕ похож на ЭМК (frontend_emc) — врач видит границу систем. */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 13px/1.5 -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; color: #161616; background: #fff; }

/* общие контролы */
.cp-input {
  width: 100%; height: 34px; padding: 0 11px;
  font: 400 13px -apple-system, "Segoe UI", sans-serif; color: #161616;
  border: 1px solid #8d8d8d; border-radius: 6px; background: #fff; outline: none;
}
.cp-input:focus { border-color: #0f62fe; box-shadow: 0 0 0 2px rgba(15,98,254,.2); }
textarea.cp-input { height: auto; padding: 8px 11px; resize: vertical; }
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 15px; cursor: pointer; white-space: nowrap;
  border-radius: 6px; border: 1px solid transparent;
  font: 600 13px -apple-system, "Segoe UI", sans-serif; background: #f4f4f4; color: #161616;
}
.cp-btn:hover { background: #e5e5e5; }
.cp-btn-primary { background: #0f62fe; color: #fff; }
.cp-btn-primary:hover { background: #0043ce; }
.cp-btn-outline { background: #fff; border-color: #0f62fe; color: #0f62fe; }
.cp-btn-outline:hover { background: #edf5ff; }
.cp-btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.cp-btn-block { width: 100%; }

/* ============ install-хаб ============ */
.cp-page { background: #f4f4f4; min-height: 100vh; }
.cp-head { background: #161616; color: #fff; padding: 22px 32px; }
.cp-brand { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.cp-brand .cp-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; background: #0f62fe; color: #fff;
  font-weight: 800; margin-right: 9px; vertical-align: -7px;
}
.cp-ver { font-weight: 400; opacity: .6; font-size: 13px; margin-left: 6px; }
.cp-sub { font-size: 12px; opacity: .7; margin-top: 3px; }
.cp-main { max-width: 760px; margin: 0 auto; padding: 28px 20px 40px; }
.cp-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 26px 28px; }
.cp-card h1 { font-size: 19px; letter-spacing: -.01em; margin-bottom: 20px; }
.cp-step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid #f0f0f0; }
.cp-step-num {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  background: #0f62fe; color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.cp-login { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cp-login .cp-input { width: 180px; }
.cp-status { margin-top: 8px; font-size: 12px; color: #6f6f6f; }
.cp-status.ok { color: #044317; }
.cp-status.err { color: #a51616; }
.cp-bookmark-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.cp-bookmark {
  display: inline-block; padding: 8px 18px; border-radius: 999px;
  background: #0f62fe; color: #fff; font-weight: 700; text-decoration: none; cursor: grab;
  box-shadow: 0 6px 16px -6px rgba(9,54,131,.45);
}
.cp-hint { font-size: 11.5px; color: #6f6f6f; }
.cp-emc-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.cp-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f0f0f0; font-size: 11.5px; color: #6f6f6f; line-height: 1.6; }
.cp-foot { text-align: center; font-size: 11px; color: #8d8d8d; padding: 16px; }

/* ============ сайдбар (iframe) ============ */
.sb-body { background: #fff; }
.sb-app { display: flex; flex-direction: column; height: 100vh; }

.sb-login { height: 100vh; display: flex; align-items: center; justify-content: center; background: #f4f4f4; }
.sb-login-box { width: 300px; background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 22px; }
.sb-login-box b { display: block; margin-bottom: 12px; }
.sb-login-box form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sb-login-err { color: #a51616; font-size: 12px; margin-top: 8px; }
.sb-login-err.ok { color: #047817; }

.sb-head { padding: 13px 16px 11px; border-bottom: 1px solid #e0e0e0; position: relative; }
.sb-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sb-title span { font-weight: 500; color: #8d8d8d; font-size: 12px; margin-left: 6px; }
.sb-sub { font-size: 11px; color: #525252; margin-top: 2px; }
.sb-live { color: #047817; font-weight: 700; }
.sb-latency { color: #8d8d8d; margin-left: 8px; }
.sb-src { font-size: 11px; margin-top: 6px; padding: 5px 8px; background: #edf5ff; border: 1px solid #c8dbff; border-radius: 5px; color: #0043ce; }
.sb-head-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.sb-close, .sb-expand, .sb-bell {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 7px; color: #525252; cursor: pointer;
}
.sb-close:hover, .sb-expand:hover, .sb-bell:hover { background: #f4f4f4; color: #161616; }
.sb-bell { position: relative; }
.sb-bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px;
  background: #da1e28; color: #fff; font: 700 9.5px/15px system-ui; text-align: center;
  border-radius: 999px; padding: 0 3px;
}
.sb-notiflist {
  position: absolute; top: 86px; right: 10px; z-index: 30; width: calc(100% - 20px);
  background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(22,22,22,.3);
  max-height: 55vh; overflow-y: auto; padding: 10px;
}
.sb-notif-head { font: 700 11px system-ui; text-transform: uppercase; letter-spacing: .05em; color: #525252; margin-bottom: 8px; }
.sb-notif-item { border: 1px solid #f0d3d3; background: #fdf1f1; border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; font-size: 11.5px; }
.sb-notif-item b { display: block; margin-bottom: 2px; color: #a51616; }
.sb-notif-item .when { color: #8d8d8d; font-size: 10px; }
.sb-notif-item .cp-btn { margin-top: 6px; }

.sb-cohort-item { border: 1px solid #e7ece9; background: #f7faf8; border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; }
.sb-cohort-item .co-fio { font-size: 12.5px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.co-delta { font: 800 11px system-ui; border-radius: 999px; padding: 1px 7px; background: #e6f5ec; color: #047817; }
.co-delta.up { background: #fdeaea; color: #a51616; }
.sb-cohort-item .co-meta { font-size: 11px; color: #6f6f6f; margin-top: 2px; }

/* адаптив панели: узкие экраны */
@media (max-width: 520px) {
  /* .sb-src НЕ прячем: «Источник: экран ЭМК» — ключевая честная метка,
     панель iframe всегда узкая, плашка однострочная и помещается */
  .sb-qr-img { width: 150px; height: 150px; }
}

/* ---------- вкладки панели ---------- */
.sb-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid #e0e0e0; }
.sb-tab {
  flex: 1; min-height: 36px; cursor: pointer; border: none; background: none;
  font: 700 12.5px system-ui; color: #525252; border-radius: 8px 8px 0 0;
  box-shadow: inset 0 -2.5px 0 transparent; transition: color .15s, box-shadow .15s;
}
.sb-tab:hover { color: #161616; }
.sb-tab--on { color: #0f62fe; box-shadow: inset 0 -2.5px 0 #0f62fe; }
.stab { overflow-y: auto; flex: 1; }
.stab[hidden] { display: none; }

.sb-table--cohort td, .sb-table--cohort th { font-size: 11.5px; padding: 7px 8px; }
.sb-table--cohort td:last-child { white-space: nowrap; }

.pheno-row { display: flex; gap: 6px; margin: 10px 0 12px; }
.pheno {
  flex: 1; min-height: 40px; cursor: pointer; border: 2px solid #e0e0e0; border-radius: 9px;
  background: #fff; font: 700 11.5px system-ui; color: #525252;
  transition: border-color .14s, background .14s, color .14s;
}
.pheno:hover { border-color: #0f62fe; }
.pheno--on { border-color: #0f62fe; background: #edf5ff; color: #0043ce; }

#wi-chart { width: 100%; height: auto; }

/* ---------- дашборд состояния (fullscreen поверх ЭМК) ---------- */
.dash {
  position: fixed; inset: 0; z-index: 2147483002; background: #f4f4f4; overflow-y: auto;
  display: flex; flex-direction: column; animation: dash-in .28s ease both;
}
@keyframes dash-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.dash[hidden] { display: none; }
.dash-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 22px;
  background: #161616; color: #fff; position: sticky; top: 0; z-index: 5;
}
.dash-title { font-size: 18px; font-weight: 800; }
.dash-title span { font-weight: 400; opacity: .65; font-size: 13px; margin-left: 8px; }
.dash-actions { margin-left: auto; display: flex; gap: 8px; }
.dash-actions .cp-btn { background: rgba(255,255,255,.12); color: #fff; }
.dash-actions .cp-btn:hover { background: rgba(255,255,255,.22); }
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px; padding: 18px 22px; flex: 1; align-content: start;
}
.dash-card { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.dash-sv { margin-bottom: 10px; }
.dash-kv { font-size: 12.5px; color: #393939; line-height: 1.7; }
.dash-kv b { display: inline-block; min-width: 150px; color: #525252; }
.dash-notifs { max-height: 260px; overflow-y: auto; }
.dash-sla { font-size: 13px; line-height: 1.8; color: #393939; }
.dash-actions-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#dash-pk { width: 100%; height: auto; }
#dash-cluster { width: 100%; height: auto; }
.dash-card--map { grid-column: span 2; }
@media (max-width: 900px) { .dash-card--map { grid-column: span 1; } }
.dash-tl { font-size: 12px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.dash-tl b { color: #0043ce; }
.dash-tl .when { color: #8d8d8d; font-size: 10.5px; }
.dash-foot { text-align: center; font: 400 11px system-ui; color: #8d8d8d; padding: 14px; }

.sb-alert { margin: 12px 14px 0; padding: 10px 12px; border-radius: 8px; background: #da1e28; color: #fff; }
.sb-alert-sub { font-size: 11.5px; opacity: .9; margin: 3px 0 8px; }

.sb-empty { padding: 34px 22px 26px; text-align: center; color: #525252; font-size: 13px; line-height: 1.7; }
.sb-empty-title { font-size: 15px; font-weight: 800; color: #161616; margin-bottom: 14px; }
.sb-steps { text-align: left; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.sb-step { padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fafafa; font-size: 12px; line-height: 1.55; }
.sb-step b { color: #0f62fe; }
.sb-empty .cp-btn { margin-bottom: 8px; }
.sb-conn { margin-top: 12px; font-size: 11px; color: #8d8d8d; }
.sb-conn.ok { color: #047817; }
.sb-conn.err { color: #a51616; }
.sb-dim { color: #8d8d8d; font-size: 11.5px; }
.sb-body-content { padding: 14px 16px 18px; overflow-y: auto; flex: 1; }

.sb-svetofor { padding: 12px 14px; border-radius: 8px; border: 1px solid #e0e0e0; background: #f4f4f4; margin-bottom: 14px; }
.sb-svetofor.green { background: #e8f5eb; border-color: #42a35f; }
.sb-svetofor.amber { background: #fdf6dd; border-color: #d3a91e; }
.sb-svetofor.red   { background: #fdeaea; border-color: #e05058; }
.sb-svetofor-head { font-size: 13px; font-weight: 800; }
.sb-svetofor.green .sb-svetofor-head { color: #047817; }
.sb-svetofor.amber .sb-svetofor-head { color: #8a6d00; }
.sb-svetofor.red .sb-svetofor-head { color: #a51616; }
.sb-svetofor-text { font-size: 12px; margin-top: 4px; line-height: 1.55; }

.sb-sec { margin-bottom: 15px; }
.sb-sec-t {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #525252; border-bottom: 1px solid #e0e0e0; padding-bottom: 5px; margin-bottom: 9px;
}
.sb-note { font-size: 11px; color: #6f6f6f; margin-bottom: 9px; line-height: 1.5; }
.sb-badge-amber { background: #f1c21b; color: #161616; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }

.sb-confirm {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 5px;
  border: 1px solid #e0e0e0; border-radius: 7px; background: #fff; font-size: 12px;
}
.sb-confirm .lbl { flex: 1; line-height: 1.4; }
.sb-confirm.done { background: #f0fdf2; border-color: #9fd8ac; color: #047817; }
.sb-mini {
  flex: none; font: 600 11px -apple-system, sans-serif; cursor: pointer; padding: 3px 10px;
  border: 1px solid #0f62fe; border-radius: 6px; background: #0f62fe; color: #fff;
}
.sb-confirm.done .sb-mini { border-color: #9fd8ac; background: #fff; color: #047817; }

.sb-datareq {
  font-size: 11.5px; padding: 8px 10px; border-radius: 6px; line-height: 1.5;
  border-left: 3px solid #f1c21b; background: #fffdf4; margin-bottom: 6px;
}
.sb-datareq div { margin: 3px 0 1px; }
.sb-cite { font-size: 10.3px; color: #525252; }

.sb-pk-legend { display: flex; gap: 16px; font-size: 11px; color: #393939; margin: 6px 0 4px; }
.sw { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: 2px; border-radius: 2px; }
.sw-p { background: #0f62fe; }
.sw-m { background: #9f1853; }
.sb-pk-nums { font-size: 11px; color: #393939; }
.sb-routing { font-size: 12.5px; font-weight: 700; }

.sb-table { border-collapse: collapse; width: 100%; }
.sb-table td, .sb-table th { border-bottom: 1px solid #f0f0f0; padding: 5px 6px; font-size: 11px; text-align: left; }
.sb-table th { color: #525252; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.sb-table td:last-child, .sb-table th:last-child { white-space: nowrap; }

.sb-cbr { border: 1px solid #e0e0e0; border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; font-size: 11.5px; line-height: 1.5; }
.sb-cbr .sim { float: right; background: #e8f5eb; color: #047817; border: 1px solid #9fd8ac; border-radius: 999px; padding: 0 7px; font-weight: 700; }

.sb-passport { font-size: 10.8px; color: #393939; background: #f4f4f4; border: 1px solid #e0e0e0; border-radius: 6px; padding: 9px 11px; line-height: 1.55; }
.sb-passport div { margin-bottom: 2px; }
.sb-warnbox { font-size: 11px; max-height: 130px; overflow-y: auto; line-height: 1.5; }
.sb-warnbox div { padding: 3px 0 3px 10px; border-left: 2px solid #f1c21b; margin-bottom: 4px; }

.sb-actions { margin: 16px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.sb-foot { font-size: 10px; color: #6f6f6f; text-align: center; line-height: 1.6; }

.sb-qr { margin: 0 16px 16px; padding: 14px; border: 1px solid #e0e0e0; border-radius: 10px; text-align: center; }
.sb-qr-img { width: 190px; height: 190px; margin: 10px auto; display: block; }
.sb-qr-link { font-size: 10px; color: #0f62fe; word-break: break-all; margin: 8px 0; }

/* модалки */
.sb-modal { position: fixed; inset: 0; background: rgba(22,22,22,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; }
.sb-modal[hidden] { display: none; }
.sb-modal-box { width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 10px; padding: 18px 20px; }
.sb-modal-box h3 { font-size: 14px; margin-bottom: 12px; }
.sb-modal-actions { display: flex; gap: 8px; margin-top: 14px; }

.f057 { border: 1px solid #393939; border-radius: 4px; padding: 14px 16px; font-size: 12px; }
.f057 h4 { text-align: center; font-size: 12.5px; margin-bottom: 4px; }
.f057 .f057-org { text-align: center; font-size: 10.5px; color: #525252; margin-bottom: 10px; }
.f057 table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.f057 td { border: 1px solid #8d8d8d; padding: 5px 8px; }
.f057 td.k { width: 150px; background: #f4f4f4; font-weight: 600; }
.f057 .f057-foot { font-size: 9.5px; color: #6f6f6f; }

[hidden] { display: none !important; }

@media print {
  body * { visibility: hidden; }
  .sb-modal-box, .sb-modal-box * { visibility: visible; }
  .sb-modal { position: absolute; inset: 0; background: #fff; padding: 0; display: block; }
  .sb-modal-actions { display: none; }
}

/* ==== HAM-A-14: клиницистская шкала (врач) ==== */
.hama-items { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.hama-row { display: flex; align-items: center; gap: 8px; }
.hama-row__text { flex: 1; font-size: 12px; line-height: 1.35; color: var(--cp-ink, #1f2937); }
.hama-row__chips { display: flex; gap: 3px; }
.hama-chip { min-width: 26px; height: 24px; border: 1px solid #d4d4d8; background: #fff;
  border-radius: 6px; font-size: 11px; cursor: pointer; padding: 0 4px; }
.hama-chip:hover { border-color: #a1a1aa; }
.hama-chip--on { background: #312e81; border-color: #312e81; color: #fff; }
.hama-head { display: flex; gap: 3px; justify-content: flex-end; margin-bottom: 2px; }
.hama-head span { width: 26px; text-align: center; font-size: 10px; color: #71717a; }

/* ==== Зоны ПРЕДЛОЖИТЬ/ПРОВЕРИТЬ/РЕШИТЬ (структура панели, слайд 05) ==== */
.dash-zone { display: flex; align-items: baseline; gap: 8px; margin: 14px 2px 6px; }
.dash-zone__p { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #312e81;
  border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 999px; padding: 2px 10px; }
.dash-zone .sb-dim { font-size: 11px; }

/* ==== Категории маршрутизации: ОБЯЗАТЕЛЬНО/ЖЕЛАТЕЛЬНО визуально различимы ==== */
.route-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  border-radius: 4px; padding: 1px 7px; margin-right: 6px; vertical-align: middle; }
.route--mandatory { background: #c0392b; color: #fff; }
.route--recommended { background: #d97706; color: #fff; }
.route--primary { background: #6b7280; color: #fff; }

/* ==========================================================================
   v9 «МЕДИЦИНСКАЯ ЗАПИСКА»: записка вместо плиток. Один герой-вердикт,
   секции через линейки 1px, крупная цифра, светофор = левая полоса.
   Анти-ИИ-чеклист: docs/UI_RESEARCH.md R4. SSOT: docs/UX_UI_DESIGN.md.
   ========================================================================== */
.note { display: block; }
.note-sec { padding: 12px 2px 14px; border-bottom: 1px solid #e4e7eb; }
.note-sec-t { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: #6b7280; margin-bottom: 8px; }
.note-list { display: flex; flex-direction: column; gap: 5px; }
.note-line { font-size: 13px; line-height: 1.5; color: #161616; }
.note-line b.imp { color: #1f8a4c; }
.note-line b.worse { color: #c0392b; }
.note-line .when { color: #8d8d8d; font-size: 10.5px; margin-left: 6px; }

/* Герой-вердикт: левая полоса задаёт цвет состояния, текст чёрный */
.hero-verdict { border-left: 4px solid #9aa4ad; background: #fff; border-radius: 0 10px 10px 0;
  padding: 12px 14px 10px; margin: 10px 0 2px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hero-verdict .sb-svetofor-head { font-size: 16px; font-weight: 800; }
.hero-verdict .sb-svetofor-text { font-size: 13px; line-height: 1.5; color: #161616; margin-top: 3px; }
.hero-routing { font-size: 12px; color: #393939; margin-top: 6px; }
.hero-actions { margin-top: 8px; display: flex; gap: 14px; align-items: baseline; }
/* hero перекрывает старые фоны светофора: цвет = только левая полоса + заголовок */
.hero-verdict { background: #fff !important; border-color: #e4e7eb !important; }
.hero-verdict.hero-green { border-left-color: #1f8a4c; }
.hero-verdict.hero-green .sb-svetofor-head { color: #1f8a4c; }
.hero-verdict.hero-amber .sb-svetofor-head { color: #b7791f; }
.hero-verdict.hero-red .sb-svetofor-head { color: #c0392b; }
.hero-verdict.hero-amber { border-left-color: #b7791f; }
.hero-verdict.hero-red { border-left-color: #c0392b; }

/* Действия-ссылки со стрелкой (вместо плиток-кнопок) */
.act-link { background: none; border: none; padding: 0; font-size: 13px; font-weight: 600;
  color: #0043ce; cursor: pointer; text-align: left; }
.act-link:hover { text-decoration: underline; }
.act-row { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }

/* Сворачиваемые секции записки */
.note-details { border-bottom: 1px solid #e4e7eb; padding: 10px 2px; }
.note-details summary { font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: #6b7280; cursor: pointer; }

/* Дашборд: карточка-записка шире плитки, зоны — капсом */
.dash-card--wide { grid-column: span 2; }
@media (max-width: 900px) { .dash-card--wide { grid-column: span 1; } }
.dash-zone { margin-top: 18px; }
.dash-zone__p { font-size: 10.5px; letter-spacing: .1em; color: #374151; background: none;
  border: none; border-bottom: 2px solid #161616; padding: 0 0 3px; border-radius: 0; }
#dash-gad-chart { width: 100%; height: auto; margin-bottom: 6px; }
#gad-chart { width: 100%; height: auto; margin: 6px 0 2px; }
.msg-doc { background: #f8fafc; }

/* ==== v9.3: опросники по пунктам + расписание приёма + чат ==== */
.bars { display: flex; flex-direction: column; gap: 3px; margin: 4px 0 8px; }
.bar-row { display: flex; align-items: center; gap: 6px; }
.bar-lbl { flex: 0 0 158px; font-size: 10.5px; color: #525252; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: #f1f3f5; border-radius: 4px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: #0043ce; border-radius: 4px; }
.bar-track i.bar--hi { background: #c0392b; }
.bar-v { flex: 0 0 12px; font-size: 10.5px; text-align: right; color: #161616; }
.day-strip { display: flex; gap: 3px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.day-strip .day { width: 13px; height: 13px; border-radius: 3px; }
.day-strip .day--ok { background: #1f8a4c; }
.day-strip .day--skip { background: #c0392b; }
.day-strip .when { margin-left: 6px; }

/* чат-пузыри: врач слева, пациент справа */
.chat { display: flex; flex-direction: column; gap: 6px; }
.chat-msg { max-width: 88%; padding: 7px 11px; border-radius: 12px; font-size: 12.5px;
  line-height: 1.45; position: relative; }
.chat-msg--doc { align-self: flex-start; background: #eef3ff; border: 1px solid #d5e2ff; }
.chat-msg--pat { align-self: flex-end; background: #f0f7f2; border: 1px solid #d5e8dc; }
.chat-msg .when { display: block; font-size: 9.5px; color: #8d8d8d; margin-top: 2px; }

/* ==== v9.5: пункты дашборда + флаги неполадок + чат-мессенджер в панели ==== */
.dash-nav { display: flex; gap: 14px; margin: 0 auto; }
.dash-nav a { color: rgba(255,255,255,.85); font-size: 12.5px; text-decoration: none;
  padding: 4px 2px; border-bottom: 2px solid transparent; }
.dash-nav a:hover { color: #fff; border-bottom-color: #fff; }
.dash-zone[id] { scroll-margin-top: 76px; }
.flag-chip { display: inline-block; font-size: 10.5px; font-weight: 700; border: 1.5px solid;
  border-radius: 999px; padding: 1px 8px; margin: 2px 4px 2px 0; background: #fff; }
#intake-flags { max-height: 420px; overflow-y: auto; }
/* панельный чат = мессенджер: фикс-высота, скролл, инпут снизу */
#panel-chat-body { max-height: 240px; overflow-y: auto; padding: 2px; background: #fafbfc;
  border: 1px solid #eef0f2; border-radius: 10px; padding: 8px; }

/* узкий iframe панели-дашборда: навигация переносится, титул компактнее */
.dash-head { flex-wrap: wrap; }
.dash-nav { flex-wrap: wrap; gap: 8px 12px; margin: 6px 0 0; width: 100%; }
@media (min-width: 1100px) { .dash-nav { width: auto; margin: 0; } }

/* v9.6: канвасы аналитики вписаны в колонку */
#ov-clusters { width: 100%; height: auto; }
