/* За Здоровье — навигация, шапка, дашборд, страницы */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: #F6F9FC; color: #1F2A37; }
.hidden { display: none !important; }
.muted { color: #64748b; font-size: 0.9rem; }
.hint { font-size: 0.9rem; color: #64748b; margin: 0.5rem 0; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 6, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-gate.hidden { display: none !important; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
.auth-card h2 { margin: 0 0 0.5rem; }
.auth-card label { display: block; margin-top: 0.6rem; font-size: 0.9rem; color: #334155; }
.auth-card input { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 0.2rem; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.auth-screen { display: block; }
.auth-screen.hidden { display: none !important; }
.auth-mode-tabs { display: flex; gap: 0.25rem; margin: 0.75rem 0; }
.auth-mode-tab {
  flex: 1; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 500;
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; color: #475569;
}
.auth-mode-tab:hover { background: #e2e8f0; }
.auth-mode-tab.active { background: #0f766e; border-color: #0f766e; color: #fff; }
.auth-methods-label { font-size: 0.9rem; color: #64748b; margin: 0.5rem 0 0.35rem; }
.auth-methods { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.25rem; }
.auth-method-btn {
  width: 100%; padding: 0.6rem 0.75rem; font-size: 0.9rem; text-align: left;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; color: #334155;
}
.auth-method-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #0f766e; color: #0f766e; }
.auth-method-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-method-oauth:disabled { cursor: default; }
.auth-back-btn { background: none; border: none; color: #64748b; font-size: 0.9rem; cursor: pointer; padding: 0.25rem 0; margin-bottom: 0.5rem; }
.auth-back-btn:hover { color: #0f766e; }
.auth-name-label.hidden, .auth-name-input.hidden { display: none !important; }
/* Одна линия: чекбокс + текст. Специфичность выше .card-form label { display:block } */
label.auth-show-password-row,
.card-form label.auth-show-password-row {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0 0 !important;
  padding: 0;
  width: 100%;
  max-width: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: #334155;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
label.auth-show-password-row input[type="checkbox"],
.card-form label.auth-show-password-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  margin: 0 !important;
  flex-shrink: 0;
  accent-color: #0f766e;
  cursor: pointer;
}
label.auth-show-password-row .auth-show-password-text,
.card-form label.auth-show-password-row .auth-show-password-text {
  flex: 0 1 auto;
  white-space: nowrap;
}
.cabinet-show-password-row {
  margin-top: 0.75rem !important;
  margin-bottom: 0.25rem !important;
}
body.theme-dark .auth-card {
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
body.theme-dark .auth-card h2 { color: #f1f5f9; }
body.theme-dark .auth-card label { color: #cbd5e1; }
body.theme-dark .auth-card input {
  background: #0f172a;
  border-color: #475569;
  color: #f1f5f9;
}
body.theme-dark .auth-methods-label { color: #94a3b8; }
body.theme-dark .auth-method-btn {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}
body.theme-dark .auth-method-btn:hover:not(:disabled) {
  background: #1e293b;
  border-color: #2dd4bf;
  color: #5eead4;
}
body.theme-dark .auth-mode-tab {
  background: #334155;
  border-color: #475569;
  color: #cbd5e1;
}
body.theme-dark .auth-mode-tab:hover { background: #475569; }
body.theme-dark label.auth-show-password-row,
body.theme-dark .card-form label.auth-show-password-row { color: #cbd5e1; }
body.theme-dark .auth-back-btn { color: #94a3b8; }
body.theme-dark .auth-back-btn:hover { color: #5eead4; }

.admin-users-search-wrap { margin-bottom: 1rem; }
.admin-users-search-label { display: block; font-size: 0.9rem; font-weight: 500; color: #334155; margin-bottom: 0.35rem; }
.admin-users-search-input { width: 100%; max-width: 360px; padding: 0.5rem 0.75rem; font-size: 0.95rem; border: 1px solid #cbd5e1; border-radius: 8px; }
.admin-users-search-input:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2); }

.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #0f766e; color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.header-btn { background: transparent; border: none; color: inherit; font-size: 1.25rem; padding: 0.5rem; cursor: pointer; border-radius: 8px; }
a.header-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.header-btn:hover { background: rgba(255,255,255,0.15); }
/* Единый стиль с обводкой для всех кнопок справа в хедере */
.header-btn-outline {
  border: 1px solid rgba(255,255,255,0.5) !important;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background: transparent;
  color: #fff;
}
.header-btn-outline:hover { background: rgba(255,255,255,0.15); }
.header-user-trigger.header-btn-outline[aria-expanded="true"] { background: rgba(255,255,255,0.2); }
.header-btn-bell { position: relative; }
.header-right-group { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; flex-shrink: 0; }
.header-user-block { display: flex; align-items: center; margin-right: 0; flex-shrink: 0; min-width: fit-content; }
.header-login-link { font-size: 0.9375rem; font-weight: 600; color: #fff; text-decoration: none; white-space: nowrap; padding: 0.35rem 0.6rem; border: none; border-radius: 8px; background: transparent; }
.header-login-link:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.header-user-block { position: relative; }
.header-user-block .header-login-link.hidden { display: none !important; }
.header-user-logged-in.hidden { display: none !important; }
.header-user-trigger {
  font-size: 0.9375rem; font-weight: 600; color: #fff; background: none; border: none;
  border-radius: 8px; padding: 0.35rem 0.6rem; cursor: pointer; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.header-user-trigger:hover { background: rgba(255,255,255,0.15); }
.header-user-trigger[aria-expanded="true"] { background: rgba(255,255,255,0.2); }
.header-user-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 0.25rem;
  min-width: 180px; background: #fff; color: #1e293b; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18); border: 1px solid #e2e8f0;
  padding: 0.35rem 0; z-index: 150;
}
.header-user-block.open .header-user-menu { display: block; }
.header-user-menu-item {
  display: block; width: 100%; padding: 0.5rem 1rem; font-size: 0.9rem; color: #334155;
  text-decoration: none; background: none; border: none; cursor: pointer; text-align: left;
}
.header-user-menu-item:hover { background: #f1f5f9; }
.header-user-menu-logout { color: #64748b; }
.header-user-menu-logout:hover { color: #dc2626; background: #fef2f2; }
.header-btn-help { font-size: 0.9rem; font-weight: 600; padding: 0.35rem 0.6rem; white-space: nowrap; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 0.5rem; }
.header-right-spaced { gap: 0.5cm; }
.header-btn-label { margin-left: 0.2rem; font-size: 0.85rem; font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.header-btn-home { line-height: 1; flex-shrink: 0; }
.header-btn-home svg { display: block; }
.header-btn-icon { font-size: 1.1rem; line-height: 1; }
.notifications-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; text-align: center; background: #dc2626; border-radius: 8px; }
.notifications-badge.hidden { display: none !important; }
.header-severity { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.severity-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.severity-green { background: #22c55e; }
.severity-yellow { background: #eab308; }
.severity-red { background: #ef4444; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR — SaaS-grade medical navigation
   ═══════════════════════════════════════════════════════════════ */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: #fff; border-right: 1px solid #e2e8f0;
  z-index: 200; display: flex; flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.drawer.closed { transform: translateX(-100%); }

/* Logo bar */
.drawer-logo {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.drawer-logo-link {
  display: flex; align-items: center; gap: 0.625rem;
  flex: 1; min-width: 0;
  text-decoration: none; color: inherit; cursor: pointer;
  border-radius: 8px; padding: 0.25rem 0;
}
.drawer-logo-link:hover { background: #f1f5f9; }
.drawer-logo-link:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
.drawer-logo-icon { font-size: 1.375rem; line-height: 1; }
.drawer-logo-name { font-size: 0.9375rem; font-weight: 700; color: #0f766e; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-close-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  background: none; border: none; color: #94a3b8; cursor: pointer;
  border-radius: 6px; padding: 0;
}
.drawer-close-btn:hover { background: #f1f5f9; color: #475569; }

/* Nav scroll container */
.drawer-nav { padding: 0.625rem 0 0.75rem; overflow-y: auto; flex: 1; min-height: 0; }

/* Group labels */
.drawer-nav-group {
  display: block; padding: 0.625rem 1.25rem 0.25rem;
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #94a3b8; user-select: none;
}
.drawer-nav-group:first-child { padding-top: 0.25rem; }

/* Nav link items */
.drawer-nav-link {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem; font-weight: 500; color: #475569;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-color 0.1s;
  position: relative;
}
.drawer-nav-link:hover {
  background: #f8fafc; color: #1e293b;
}
.drawer-nav-link.active {
  border-left-color: #0f766e;
  background: #f0fdfa; color: #0f766e; font-weight: 600;
}
.drawer-nav-link.active .nav-icon { color: #0f766e; opacity: 1; }
.drawer-nav-link:hover .nav-icon { opacity: 0.85; }

/* Icon */
.nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; opacity: 0.75;
  transition: opacity 0.1s;
}
.nav-icon svg { display: block; }
.nav-label { flex: 1; line-height: 1.3; }

/* Numeric badge (notifications) */
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 4px;
  background: #ef4444; color: #fff;
  font-size: 0.625rem; font-weight: 700; text-align: center;
  line-height: 18px; border-radius: 9px; flex-shrink: 0;
}
.nav-badge.hidden { display: none !important; }

/* Footer version */
.drawer-version {
  flex-shrink: 0; padding: 0.625rem 1.25rem; margin: 0;
  font-size: 0.75rem; border-top: 1px solid #e2e8f0;
}

/* Backdrop (mobile overlay) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 199; backdrop-filter: blur(2px); }
.drawer-backdrop.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT — main content areas
   ═══════════════════════════════════════════════════════════════ */
.app-main { padding: 1rem; padding-bottom: 4.5rem; max-width: 720px; margin: 0 auto; min-height: 60vh; }
.app-main.app-main--wide { max-width: 1240px; }

/* ═══════════════════════════════════════════════════════════════
   DESKTOP: навигация в бургере (как на мобильной)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
  /* Drawer: overlay, открывается по клику на бургер, backdrop закрывает */
  .drawer.closed { transform: translateX(-100%); }
  .drawer:not(.closed) { box-shadow: 4px 0 24px rgba(0,0,0,0.22); }
}
.page { display: block; }
.page.hidden { display: none !important; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: center;
  padding: 0.5rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
  background: #fff; border-top: 1px solid #e2e8f0; z-index: 90;
  overflow-x: hidden;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #6B7280;
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 0;
}
.bottom-nav .nav-item--action {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
.bottom-nav .nav-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.bottom-nav .nav-item--concierge-slot {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 0;
}
.bottom-nav .nav-item--concierge-slot .vc-float-btn,
.bottom-nav .nav-item--concierge-slot .vc-float-btn--in-nav {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin: 0 auto;
  position: static;
  right: auto;
  left: auto;
  transform: none !important;
}
.bottom-nav .nav-item--concierge-slot .vc-float-btn--in-nav .vc-float-icon svg {
  width: 20px;
  height: 20px;
}
.bottom-nav .nav-item--concierge-slot .vc-pulse {
  display: none;
}
.bottom-nav .nav-item-label { font-size: 10px; line-height: 1.2; text-align: center; }
.bottom-nav .nav-item:hover { color: #2CB7A5; }
.bottom-nav .nav-item.active { color: #2CB7A5; font-weight: 600; }

/* Brand block (shared) */
.brand-block {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: inherit; flex: 1; min-width: 0; overflow: hidden;
}
.brand-mark { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; overflow: hidden; }
.brand-text strong { font-size: clamp(0.8rem, 2.5vw, 0.9375rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Light medical theme */
.app-header--light {
  background: #FFFFFF;
  color: #1F2A37;
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.app-header--light .header-btn,
.app-header--light .header-login-link { color: #1F2A37; }
.app-header--light .header-btn:hover,
.app-header--light .header-login-link:hover { background: #E8F8F6; color: #2CB7A5; }
.app-header--light .header-user-trigger { color: #1F2A37; }
.app-header--light .header-user-trigger:hover { background: #E8F8F6; color: #2CB7A5; }
.app-header--light .brand-text strong { color: #1F2A37; }
.app-header--light .brand-text small { color: #6B7280; }
.header-severity--soft {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem; border-radius: 8px;
}
.app-header--light .header-severity--soft { color: #6B7280; background: #E8F8F6; }
.header-severity--soft .severity-dot { width: 14px; height: 14px; }
.drawer-logo--light .drawer-logo-name { color: #2CB7A5; }
.drawer-logo--light { border-bottom-color: #E5E7EB; }
.app-main--light { background: #F6F9FC; }
.bottom-nav--light {
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
}

/* ═══ Dark theme (Healthcare AI Decision Support: from-slate-900 via-teal-900 to-slate-900) ═══ */
body.theme-dark {
  background: linear-gradient(to bottom right, #0f172a 0%, #134e4a 50%, #0f172a 100%);
  color: #f1f5f9;
}
body.theme-dark .muted { color: #94a3b8; }
body.theme-dark .hint { color: #94a3b8; }

.app-header--dark {
  background: rgba(15, 23, 42, 0.85);
  color: #f1f5f9;
  border-bottom: 1px solid rgba(45, 212, 191, 0.2);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}
.app-header--dark .header-btn,
.app-header--dark .header-login-link { color: #f1f5f9; }
.app-header--dark .header-btn:hover,
.app-header--dark .header-login-link:hover { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
.app-header--dark .header-user-trigger { color: #f1f5f9; }
.app-header--dark .header-user-trigger:hover { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
.app-header--dark .brand-text strong { color: #f1f5f9; }
.app-header--dark .brand-text small { color: #94a3b8; }
.app-header--dark .header-severity--soft {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.25);
}
.app-main--dark {
  background: transparent;
  color: #f1f5f9;
}
.bottom-nav--dark {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid #1e293b;
}
.bottom-nav--dark .nav-item { color: #94a3b8; }
.bottom-nav--dark .nav-item:hover { color: #2dd4bf; }
.bottom-nav--dark .nav-item.active { color: #2dd4bf; font-weight: 600; }

/* ═══ Узкие экраны: автомасштаб, без наслоения ═══ */
@media (max-width: 480px) {
  .app-main {
    padding: 0.75rem;
    padding-bottom: 4.4rem;
  }
  .page-shell {
    padding: 0.35rem 0;
  }
  .app-header { padding: 0.4rem 0.75rem; }
  .brand-text small { display: none; }
  .header-severity span:not(.severity-dot) { display: none; }
  .header-severity { padding: 0.2rem; }
  .bottom-nav .nav-item-label { display: none; }
  .bottom-nav .nav-item { padding: 0.35rem 0.15rem; }
  .bottom-nav .nav-item-icon { width: 28px; height: 28px; font-size: 1rem; }
  .bottom-nav .nav-item--concierge-slot .vc-float-btn,
  .bottom-nav .nav-item--concierge-slot .vc-float-btn--in-nav { width: 28px; height: 28px; }
  .bottom-nav { padding: 0.4rem 0.25rem; padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0)); }

  /* Анализы: на мобильном не сжимаем кнопки и табы в одну узкую строку */
  .ref-labs-content { padding: 0 0.75rem 1.25rem; }
  .ref-labs-upload-actions {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0 0.75rem 0.85rem;
  }
  .ref-labs-quick-btn {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.65rem;
    gap: 0.4rem;
    font-size: 0.84rem;
    line-height: 1.25;
  }
  .ref-labs-upload-submit-row {
    padding: 0 0.75rem 0.85rem;
    flex-wrap: wrap;
  }
  .ref-labs-upload-submit {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .ref-labs-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ref-labs-tab {
    min-height: 2.35rem;
    font-size: 0.8rem;
    padding: 0.55rem 0.45rem;
  }
}
@media (max-width: 360px) {
  .brand-text strong { font-size: 0.8rem; }
  .header-right-group { gap: 0.2rem; }
}

.drawer-logo--dark { border-bottom-color: rgba(45, 212, 191, 0.2); }
.drawer-logo--dark .drawer-logo-name { color: #2dd4bf; }
body.theme-dark .drawer {
  background: rgba(15, 23, 42, 0.98);
  border-right-color: rgba(45, 212, 191, 0.2);
}
body.theme-dark .drawer-nav-link { color: #94a3b8; }
body.theme-dark .drawer-nav-link:hover { background: rgba(45, 212, 191, 0.08); color: #2dd4bf; }
body.theme-dark .drawer-nav-link.active { border-left-color: #2dd4bf; background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }
body.theme-dark .drawer-nav-group { color: #64748b; }
body.theme-dark .drawer-version { border-top-color: rgba(45, 212, 191, 0.15); color: #64748b; }

/* Dark: карточки и виджеты */
body.theme-dark .widget--soft,
body.theme-dark .widget {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  color: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.theme-dark .widget--soft h3,
body.theme-dark .widget h3,
body.theme-dark .section-head h3 { color: #f1f5f9; }
body.theme-dark .section-hero .eyebrow { color: #2dd4bf; }
body.theme-dark .section-hero h2 { color: #f1f5f9; }
body.theme-dark .section-hero .hint { color: #94a3b8; }

/* Dark: карта тела и чипы */
body.theme-dark .body-map-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .body-map-zone {
  background: rgba(45, 212, 191, 0.12);
  color: #e2e8f0;
  border-color: rgba(45, 212, 191, 0.4);
}
body.theme-dark .body-map-zone:hover {
  background: #14b8a6;
  color: #0f172a;
}
body.theme-dark .chip-btn {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .chip-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: #2dd4bf;
  color: #2dd4bf;
}

/* Dark: формы и инпуты */
body.theme-dark .card-form input,
body.theme-dark .card-form textarea,
body.theme-dark .card-form select {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
}
body.theme-dark .card-form input::placeholder,
body.theme-dark .card-form textarea::placeholder { color: #64748b; }
body.theme-dark .card-form label { color: #cbd5e1; }
body.theme-dark .btn-primary {
  background: #14b8a6;
  color: #0f172a;
  border: none;
}
body.theme-dark .btn-primary:hover { background: #2dd4bf; color: #0f172a; }
body.theme-dark .btn-secondary {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.4);
}
body.theme-dark .btn-secondary:hover { background: rgba(45, 212, 191, 0.25); }

body.theme-dark .header-user-menu {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(45, 212, 191, 0.25);
  color: #f1f5f9;
}
body.theme-dark .header-user-menu-item { color: #e2e8f0; }
body.theme-dark .header-user-menu-item:hover { background: rgba(45, 212, 191, 0.15); }
body.theme-dark .labs-report-select,
body.theme-dark .card-form select {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
}
body.theme-dark .chat-panel {
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid rgba(45, 212, 191, 0.2);
}
body.theme-dark .chat-panel-header { border-bottom-color: rgba(51, 65, 85, 0.8); }

/* Справочник — тёмная тема */
body.theme-dark .reference-title { color: #f1f5f9; }
body.theme-dark .reference-subtitle { color: #94a3b8; }
body.theme-dark .reference-search-wrap {
  background: rgba(30, 41, 59, 0.8); border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .reference-search-input { color: #f1f5f9; }
body.theme-dark .reference-search-input::placeholder { color: #64748b; }
body.theme-dark .reference-popular-label { color: #94a3b8; }
body.theme-dark .ref-chip {
  background: rgba(30, 41, 59, 0.8); color: #e2e8f0; border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .ref-chip:hover { background: rgba(51, 65, 85, 0.9); }
body.theme-dark .ref-chip--active {
  background: rgba(45, 212, 191, 0.2); border-color: #2dd4bf; color: #2dd4bf;
}
body.theme-dark .reference-segment {
  background: rgba(30, 41, 59, 0.6); border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .ref-segment-btn { color: #94a3b8; }
body.theme-dark .ref-segment-btn:hover { color: #e2e8f0; }
body.theme-dark .ref-segment-btn--active {
  background: rgba(248, 250, 252, 0.95); color: #0f172a;
}
body.theme-dark .ref-cat-chip {
  background: rgba(30, 41, 59, 0.8); color: #e2e8f0; border-color: rgba(51, 65, 85, 0.9);
}
body.theme-dark .ref-cat-chip:hover { background: rgba(51, 65, 85, 0.9); }
body.theme-dark .ref-cat-chip--active {
  background: #14b8a6; border-color: #14b8a6; color: #0f172a;
}
body.theme-dark .ref-card {
  background: rgba(30, 41, 59, 0.7); border-color: rgba(51, 65, 85, 0.8);
}
body.theme-dark .ref-card:hover {
  background: rgba(51, 65, 85, 0.8); border-color: rgba(45, 212, 191, 0.3);
}
body.theme-dark .ref-card.ref-card--accordion:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.8);
}
body.theme-dark .ref-card-panel { border-top-color: rgba(51, 65, 85, 0.8); }
body.theme-dark .ref-card-section-title { color: #2dd4bf; }
body.theme-dark .ref-card-section-text { color: #cbd5e1; }
body.theme-dark .ref-card-title { color: #f1f5f9; }
body.theme-dark .ref-card-desc { color: #94a3b8; }
body.theme-dark .ref-card-category { color: #64748b; }
body.theme-dark .ref-card-arrow { color: #64748b; }
body.theme-dark .ref-card-badge--mild { background: rgba(34, 197, 94, 0.25); color: #4ade80; }
body.theme-dark .ref-card-badge--medium { background: rgba(251, 191, 36, 0.25); color: #fcd34d; }
body.theme-dark .ref-card-badge--serious { background: rgba(248, 113, 113, 0.25); color: #f87171; }
body.theme-dark .reference-expert-block {
  background: rgba(30, 41, 59, 0.7); border-color: rgba(51, 65, 85, 0.8);
}
body.theme-dark .reference-expert-block:hover {
  background: rgba(51, 65, 85, 0.8); border-color: rgba(45, 212, 191, 0.3);
}
body.theme-dark .reference-expert-title { color: #f1f5f9; }
body.theme-dark .reference-urgent-details summary { color: #94a3b8; }

/* Section hero (consultation, labs, reports, etc.) */
.section-hero {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.section-hero .eyebrow { margin: 0 0 0.25rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #2CB7A5; }
.section-hero h2 { margin: 0 0 0.35rem; font-size: 1.25rem; font-weight: 700; color: #1F2A37; }
.section-hero .hint { margin: 0; font-size: 0.9rem; color: #6B7280; }
.bodymap-ghost-btn { text-decoration: none; }

/* Body map */
.body-map-card {
  display: flex; flex-wrap: wrap; gap: 1rem;
  padding: 1rem; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px;
}
.body-map-figure {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
  min-width: 180px;
}
.body-map-zone {
  padding: 0.5rem 0.65rem; font-size: 0.8rem; font-weight: 500;
  background: #E8F8F6; color: #1F2A37; border: 1px solid #2CB7A5;
  border-radius: 8px; cursor: pointer; text-align: center;
  transition: background 0.15s, transform 0.1s;
}
.body-map-zone:hover { background: #2CB7A5; color: #fff; transform: scale(1.02); }
.body-map-side { flex: 1; min-width: 200px; }
.body-map-side .chip-row { margin-top: 0.5rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-btn {
  padding: 0.35rem 0.65rem; font-size: 0.8rem;
  background: #FFFFFF; color: #1F2A37; border: 1px solid #E5E7EB;
  border-radius: 999px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip-btn:hover { background: #E8F8F6; border-color: #2CB7A5; color: #2CB7A5; }
.widget--soft { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.section-head h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #1F2A37; }
.section-head .hint { margin: 0; }
.page-shell { padding: 0.5rem 0; }
.consultation-shell .widget--soft { margin: 1rem 0; }
.consultation-shell .card-form { margin-top: 0.5rem; }
.consultation-shell .card-form label:first-of-type { margin-top: 0; }

/* Консультация — один экран, супер-юзабилити */
.consultation-flow .consultation-header { margin-bottom: 1.25rem; }
.consultation-flow .consultation-header h2 { margin: 0 0 0.35rem; }
.symptom-input-block { margin-bottom: 1rem; }
.symptom-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.symptom-input-field {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(30, 41, 59, 0.8);
  color: #f1f5f9;
}
.symptom-input-field::placeholder { color: #64748b; }
.symptom-input-field:focus { outline: none; border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2); }
.btn-add-symptom,
.btn-voice-symptom {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-add-symptom:hover,
.btn-voice-symptom:hover { background: rgba(45, 212, 191, 0.25); transform: scale(1.05); }
.selected-symptoms-block { margin-bottom: 1rem; }
.selected-symptoms-title { margin: 0 0 0.5rem; font-size: 0.9375rem; font-weight: 600; }
.selected-symptoms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem;
}
.selected-symptoms-empty { margin: 0; font-size: 0.875rem; }
.selected-symptoms-empty.hidden { display: none !important; }
.chip.chip-selected {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.35rem 0.65rem;
  background: rgba(45, 212, 191, 0.2);
  border: 1px solid rgba(45, 212, 191, 0.5);
  border-radius: 999px;
  font-size: 0.875rem;
  color: #e2e8f0;
}
.chip-remove {
  padding: 0 0.2rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.chip-remove:hover { color: #f1f5f9; background: rgba(255,255,255,0.1); }
.consultation-cta-wrap {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}
.btn-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background: #14b8a6;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-cta-primary:hover:not(:disabled) { background: #2dd4bf; transform: translateY(-1px); }
.btn-cta-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.cta-hint { margin: 0.5rem 0 0; font-size: 0.8125rem; color: #94a3b8; text-align: center; }
.consultation-extra { margin-top: 1rem; }
.consultation-extra summary { cursor: pointer; font-weight: 600; color: #94a3b8; padding: 0.5rem 0; }
.body-map-suggestions { margin-top: 0.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Третий экран — Проверка симптомов (ref Healthcare AI 72) */
.ref-symptoms-flow { padding-bottom: 5.5rem; max-width: 28rem; margin: 0 auto; }
.ref-symptoms-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}
.ref-symptoms-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 1.25rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}
.ref-symptoms-back:hover { background: rgba(51, 65, 85, 0.8); }
.ref-symptoms-title { margin: 0; font-size: 1rem; font-weight: 500; color: #f1f5f9; }
.ref-symptoms-spacer { width: 2.5rem; }
.ref-symptoms-content { padding: 2rem 1rem 1rem; }
.ref-symptoms-question { margin-bottom: 2rem; }
.ref-symptoms-h1 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: #f1f5f9; }
.ref-symptoms-sub { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-symptoms-input-wrap { margin-bottom: 1.5rem; }
.ref-symptoms-input-row {
  position: relative;
  display: flex;
  align-items: center;
}
.ref-symptoms-input {
  width: 100%;
  height: 3rem;
  padding: 0 4.5rem 0 1rem;
  font-size: 1rem;
  color: #f1f5f9;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  box-sizing: border-box;
}
.ref-symptoms-input::placeholder { color: #64748b; }
.ref-symptoms-input:focus { outline: none; border-color: #2dd4bf; }
.ref-symptoms-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ref-symptoms-btn--ghost {
  right: 2.75rem;
  background: transparent;
  color: #94a3b8;
}
.ref-symptoms-btn--ghost:hover { background: #334155; color: #f1f5f9; }
.ref-symptoms-btn--add {
  right: 0.5rem;
  background: #14b8a6;
  color: #fff;
}
.ref-symptoms-btn--add:hover:not(:disabled) { background: #0d9488; }
.ref-symptoms-btn--add:disabled { opacity: 0.5; cursor: not-allowed; }
.ref-symptoms-selected-block { margin-bottom: 1.5rem; }
.ref-symptoms-label { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 500; color: #94a3b8; }
.ref-symptoms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}
.ref-symptoms-chips .chip.chip-selected {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #5eead4;
}
.ref-symptoms-empty { margin: 0; font-size: 0.875rem; }
.ref-symptoms-empty.hidden { display: none !important; }
.ref-symptoms-common-block { margin-bottom: 1.5rem; }
.ref-symptoms-common-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ref-symptom-chip {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ref-symptom-chip:hover {
  background: #334155;
  border-color: rgba(20, 184, 166, 0.5);
}
.ref-symptoms-body-map { margin-bottom: 1rem; }
.ref-symptoms-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid #1e293b;
}
.ref-symptoms-cta-bar .ref-symptoms-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  background: #14b8a6;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.ref-symptoms-cta-btn:hover:not(:disabled) { background: #0d9488; transform: translateY(-1px); }
.ref-symptoms-cta-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ref-symptoms-cta-arrow { transition: transform 0.2s; }
.ref-symptoms-cta-btn:hover:not(:disabled) .ref-symptoms-cta-arrow { transform: translateX(4px); }
.ref-symptoms-extra { padding: 0 1rem 1rem; max-width: 28rem; margin: 0 auto; }
.ref-symptoms-body-link {
  display: block;
  font-size: 0.875rem;
  color: #2dd4bf;
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.ref-symptoms-body-link:hover { text-decoration: underline; }

/* ═══ Flow консультации: тело → симптомы → Михаил → результаты ═══ */
.ref-consultation-flow {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
  max-width: 28rem;
  margin: 0 auto;
  position: relative;
}
.ref-consultation-nav {
  position: fixed;
  top: 3.5rem;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}
.ref-consultation-nav--result { top: 0.5rem; }
.ref-consultation-arrow {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 300;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, color 0.15s;
}
.ref-consultation-arrow:hover { background: rgba(51, 65, 85, 0.9); color: #f1f5f9; }
.ref-consultation-step { padding: 1rem 1rem 6rem; }
.ref-consultation-step.hidden { display: none !important; }
.ref-consultation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.ref-consultation-title { margin: 0; font-size: 1rem; font-weight: 500; color: #f1f5f9; }
.ref-consultation-skip {
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: #2dd4bf;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0.375rem;
}
.ref-consultation-skip:hover { background: rgba(51, 65, 85, 0.8); }
.ref-consultation-question { margin-bottom: 1.5rem; }
.ref-consultation-h1 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: #f1f5f9; }
.ref-consultation-sub { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-consultation-figure-wrap {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 1rem;
}
.ref-body-figure {
  margin-bottom: 1rem;
}
.ref-body-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.ref-body-svg {
  width: 100%;
  max-width: 160px;
  height: auto;
}
.ref-body-zones.hidden { display: none !important; }
.ref-body-zone-svg {
  fill: rgba(71, 85, 105, 0.6);
  stroke: #64748b;
  stroke-width: 1.5;
  cursor: pointer;
  pointer-events: all;
  transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}
.ref-body-zone-svg:hover {
  fill: rgba(51, 65, 85, 0.9);
  stroke: rgba(20, 184, 166, 0.6);
}
.ref-body-zone-svg.selected {
  fill: rgba(20, 184, 166, 0.35);
  stroke: rgba(20, 184, 166, 0.9);
  filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.4));
}
.ref-body-flip-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
  background: transparent;
  border: 1px dashed #475569;
  border-radius: 0.5rem;
  cursor: pointer;
}
.ref-body-flip-btn:hover { background: rgba(51, 65, 85, 0.5); color: #f1f5f9; }
.ref-consultation-selected { margin-bottom: 1.5rem; }
.ref-consultation-label { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 500; color: #94a3b8; }
.ref-consultation-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ref-consultation-empty { margin: 0; font-size: 0.875rem; }
.ref-consultation-empty.hidden { display: none !important; }
.ref-consultation-cta-inline {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 0 0 1rem;
}
.ref-consultation-cta-inline .ref-consultation-cta-btn {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.ref-consultation-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid #1e293b;
}
.ref-consultation-cta--hidden { display: none !important; }
.ref-consultation-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  background: #14b8a6;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.ref-consultation-cta-btn:hover:not(:disabled) { background: #0d9488; transform: translateY(-1px); }
.ref-consultation-cta-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ref-consultation-search-wrap { position: relative; margin-bottom: 1rem; }
.ref-consultation-search {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  font-size: 1rem;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.75rem;
}
.ref-consultation-search::placeholder { color: #64748b; }
.ref-consultation-search:focus { outline: none; border-color: #2dd4bf; }
.ref-consultation-add-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  background: #14b8a6;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}
.ref-consultation-add-btn:hover { background: #0d9488; }
.ref-consultation-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  z-index: 10;
}
.ref-consultation-suggestions.hidden { display: none !important; }
.ref-consultation-suggestion-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  color: #f1f5f9;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
}
.ref-consultation-suggestion-item:hover { background: rgba(51, 65, 85, 0.8); }
.ref-consultation-common { margin-bottom: 1rem; }
.ref-consultation-common-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ref-consultation-common-chips .ref-symptom-chip {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #475569;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ref-consultation-common-chips .ref-symptom-chip:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(20, 184, 166, 0.5);
  color: #5eead4;
}
.ref-consultation-chat-body { min-height: 20rem; }
.ref-mikhail-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}
.ref-mikhail-bubble {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 95%;
}
.ref-mikhail-bubble--ai { align-self: flex-start; }
.ref-mikhail-bubble--user { align-self: flex-end; flex-direction: row-reverse; }
.ref-mikhail-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 184, 166, 0.3);
  color: #5eead4;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50%;
}
.ref-mikhail-bubble--user .ref-mikhail-avatar { display: none; }
.ref-mikhail-body { flex: 1; min-width: 0; }
.ref-mikhail-name { margin: 0 0 0.25rem; font-size: 0.75rem; font-weight: 600; color: #2dd4bf; }
.ref-mikhail-text { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: #e2e8f0; }
.ref-mikhail-bubble--user .ref-mikhail-text {
  padding: 0.75rem 1rem;
  background: rgba(20, 184, 166, 0.25);
  border-radius: 1rem 1rem 0.25rem 1rem;
}
.ref-mikhail-subtext {
  margin: 0.5rem 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  white-space: pre-line;
}
.ref-mikhail-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ref-mikhail-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid #475569;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ref-mikhail-option:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.5);
  color: #5eead4;
}

/* Четвёртый экран — Области тела (ref Healthcare AI 73) */
.ref-body-areas-flow { padding-bottom: 5.5rem; max-width: 28rem; margin: 0 auto; }
.ref-body-areas-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}
.ref-body-areas-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 1.25rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}
.ref-body-areas-back:hover { background: rgba(51, 65, 85, 0.8); }
.ref-body-areas-title { margin: 0; font-size: 1rem; font-weight: 500; color: #f1f5f9; }
.ref-body-areas-skip {
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: #2dd4bf;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: background 0.15s;
}
.ref-body-areas-skip:hover { background: rgba(51, 65, 85, 0.8); }
.ref-body-areas-content { padding: 2rem 1rem 1rem; }
.ref-body-areas-prev { margin-bottom: 1rem; }
.ref-body-areas-question { margin-bottom: 2rem; }
.ref-body-areas-h1 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: #f1f5f9; }
.ref-body-areas-sub { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-body-areas-map-card {
  padding: 2rem;
  margin-bottom: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 1rem;
  backdrop-filter: blur(4px);
}
.ref-body-areas-figure {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  max-height: 400px;
}
.ref-body-areas-figure .ref-body-zone {
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ref-body-areas-figure .ref-body-zone:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(20, 184, 166, 0.5);
  color: #f1f5f9;
}
.ref-body-areas-figure .ref-body-zone.body-zone-selected,
.body-areas-shell .body-zone.selected {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.5);
  color: #5eead4;
}
.ref-body-areas-selected-block { margin-bottom: 1.5rem; }
.ref-body-areas-label { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 500; color: #94a3b8; }
.ref-body-areas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}
.ref-body-areas-chips .chip.chip-selected {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #5eead4;
}
.ref-body-areas-empty { margin: 0; font-size: 0.875rem; }
.ref-body-areas-empty.hidden { display: none !important; }
.ref-body-areas-suggestions-block { margin-bottom: 1rem; }
.ref-body-areas-suggestions-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ref-body-areas-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid #1e293b;
}
.ref-body-areas-cta-bar .ref-body-areas-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  background: #14b8a6;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.ref-body-areas-cta-btn:hover:not(:disabled) { background: #0d9488; transform: translateY(-1px); }
.ref-body-areas-cta-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ref-body-areas-cta-arrow { transition: transform 0.2s; }
.ref-body-areas-cta-btn:hover:not(:disabled) .ref-body-areas-cta-arrow { transform: translateX(4px); }

/* Шестой экран — Результаты триажа (ref Healthcare AI 75) */
.ref-result-flow {
  min-height: 100vh;
  padding-bottom: 5rem;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to bottom right, #0f172a, #134e4a, #0f172a);
  color: #f1f5f9;
}
.ref-result-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1rem 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}
.ref-result-header-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
  color: #f1f5f9;
}
.ref-result-content { padding: 1.25rem 1rem 2rem; }
.ref-result-triage-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(16, 185, 129, 0.1);
  margin-bottom: 1.5rem;
}
.ref-result-triage-card:has(.care-level--medium) {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}
.ref-result-triage-card:has(.care-level--high) {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}
.ref-result-triage-icon-wrap {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
}
.ref-result-triage-card:has(.care-level--medium) .ref-result-triage-icon-wrap {
  background: rgba(245, 158, 11, 0.2);
}
.ref-result-triage-card:has(.care-level--high) .ref-result-triage-icon-wrap {
  background: rgba(239, 68, 68, 0.2);
}
.ref-result-triage-icon {
  font-size: 1.5rem;
  color: #34d399;
}
.ref-result-triage-card:has(.care-level--medium) .ref-result-triage-icon { color: #fbbf24; }
.ref-result-triage-card:has(.care-level--high) .ref-result-triage-icon { color: #f87171; }
.ref-result-triage-body { flex: 1; min-width: 0; }
.ref-result-triage-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #34d399;
}
.ref-result-triage-card:has(.care-level--medium) .ref-result-triage-title { color: #fbbf24; }
.ref-result-triage-card:has(.care-level--high) .ref-result-triage-title { color: #f87171; }
.ref-result-triage-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.45;
}
.ref-result-triage-timeframe {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}
.ref-result-triage-timeframe .ref-result-timeframe-icon { font-size: 1rem; }
.ref-result-section { margin-bottom: 1.5rem; }
.ref-result-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ref-result-section-icon { font-size: 1.25rem; }
.ref-result-cards,
.ref-result-recommendations {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
}
.ref-result-cards ul,
.ref-result-recommendations ul { margin: 0; padding-left: 1.25rem; }
.ref-result-cards li,
.ref-result-recommendations li { margin: 0.35rem 0; color: #cbd5e1; line-height: 1.5; }
.ref-result-cards .muted,
.ref-result-recommendations .muted { color: #64748b; }
.ref-result-cards p,
.ref-result-recommendations p { margin: 0.5rem 0 0; color: #94a3b8; font-size: 0.9rem; }
.ref-result-emergency-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-bottom: 1.5rem;
}
.ref-result-emergency-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: #f87171;
}
.ref-result-emergency-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #f87171;
}
.ref-result-emergency-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
}
.ref-result-emergency-list li { margin: 0.25rem 0; }
.ref-result-when-doctor { margin-top: 0.5rem; font-size: 0.875rem; color: #94a3b8; }
.ref-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.ref-result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.05s;
  border: 1px solid transparent;
}
.ref-result-btn--outline {
  background: transparent;
  border-color: #475569;
  color: #f1f5f9;
}
.ref-result-btn--outline:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: #64748b;
}
.ref-result-btn--primary {
  background: #14b8a6;
  color: #fff;
  border: none;
}
.ref-result-btn--primary:hover { background: #0d9488; }
.ref-result-disclaimer {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid #334155;
  margin-bottom: 1rem;
}
.ref-result-disclaimer-text {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}
.ref-result-disclaimer-text strong { color: #cbd5e1; }
.ref-result-details.expandable-section {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid #334155;
}
.ref-result-details.expandable-section summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: #94a3b8;
  list-style: none;
}
.ref-result-details.expandable-section summary::-webkit-details-marker { display: none; }
.ref-result-details .expandable-section__body {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #334155;
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.5;
}
.ref-result-details .expandable-section__body .muted { color: #64748b; }
.ref-result-doctor-report .ref-report-section {
  margin-bottom: 1.25rem;
}
.ref-result-doctor-report .ref-report-section:last-child { margin-bottom: 0; }
.ref-result-doctor-report .ref-report-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #94a3b8;
}
.ref-result-doctor-report .ref-report-section p {
  margin: 0;
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.55;
}
.ref-result-doctor-report .ref-report-section .report-structured-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ref-result-doctor-report .ref-report-section .report-structured-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.ref-result-doctor-report .ref-report-section .report-label {
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}
.ref-result-doctor-report .ref-report-section .report-value {
  color: #e2e8f0;
}
.ref-result-download-wrap {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #334155;
}
.ref-result-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.4);
  border-radius: 8px;
  cursor: pointer;
}
.ref-result-download-btn:hover {
  background: rgba(20, 184, 166, 0.25);
  border-color: #14b8a6;
}

/* Седьмой экран — Анализы (ref Healthcare AI 76) */
.ref-labs-flow {
  min-height: 100vh;
  padding-bottom: 5rem;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to bottom right, #0f172a, #134e4a, #0f172a);
  color: #f1f5f9;
}
.ref-labs-header { padding: 1.25rem 1rem 0.5rem; }
.ref-labs-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 600; color: #f1f5f9; }
.ref-labs-subtitle { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-labs-content { padding: 0 1rem 1.5rem; }
.ref-labs-upload-card {
  border-radius: 12px;
  border: 2px dashed #334155;
  background: rgba(30, 41, 59, 0.3);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
}
.ref-labs-upload-card:has(.labs-upload-dragover) {
  border-style: solid;
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.1);
}
.ref-labs-upload-label {
  display: block;
  position: relative;
  padding: 2rem 1rem;
  cursor: pointer;
  text-align: center;
}
.ref-labs-upload-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.2);
  font-size: 2rem;
  color: #2dd4bf;
}
.ref-labs-upload-heading { display: block; font-weight: 600; color: #f1f5f9; margin-bottom: 0.5rem; }
.ref-labs-upload-hint { display: block; font-size: 0.875rem; color: #94a3b8; margin-bottom: 1rem; }
.ref-labs-upload-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.ref-labs-format-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: #334155;
  color: #94a3b8;
}
.ref-labs-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}
.ref-labs-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #f1f5f9;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ref-labs-quick-btn:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: #64748b;
}
.ref-labs-quick-icon { font-size: 1.25rem; }
.ref-labs-upload-submit-row {
  padding: 0 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ref-labs-upload-submit {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #14b8a6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.ref-labs-upload-submit:hover { background: #0d9488; }
.ref-labs-feedback { font-size: 0.875rem; color: #94a3b8; }
.ref-labs-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}
.ref-labs-tab {
  padding: 0.65rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ref-labs-tab:hover { color: #f1f5f9; background: rgba(51, 65, 85, 0.4); }
.ref-labs-tab.ref-labs-tab--active {
  color: #f1f5f9;
  background: rgba(20, 184, 166, 0.2);
}
.ref-labs-tab-panels { margin-bottom: 1rem; }
.ref-labs-tab-panel { min-height: 2rem; }
.ref-labs-tab-panel--hidden { display: none !important; }
.ref-labs-sort-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ref-labs-sort-label { font-size: 0.875rem; color: #94a3b8; }
.ref-labs-sort-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 8px;
}
.ref-labs-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ref-labs-flow .labs-docs-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.ref-labs-flow .labs-doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
}
.ref-labs-flow .labs-doc-item .labs-doc-name { font-weight: 500; color: #f1f5f9; }
.ref-labs-flow .labs-doc-item .muted { font-size: 0.75rem; color: #94a3b8; }
.ref-labs-flow .labs-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}
.ref-labs-flow .labs-doc-actions .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #475569;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.ref-labs-flow .labs-doc-actions .btn-sm:hover { background: rgba(51, 65, 85, 0.6); color: #f1f5f9; }
.ref-labs-flow .labs-doc-actions .btn-danger { border-color: #dc2626; color: #f87171; }
.ref-labs-flow .labs-doc-actions .btn-danger:hover { background: rgba(220, 38, 38, 0.2); }
.ref-labs-empty { margin: 0.5rem 0; font-size: 0.875rem; }
.ref-labs-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.ref-labs-empty-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.7; }
.ref-labs-ai-card {
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.2), rgba(219, 39, 119, 0.2));
  margin-bottom: 1rem;
}
.ref-labs-ai-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.ref-labs-ai-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.ref-labs-ai-source {
  margin: 0 0 0.5rem;
  font-size: clamp(0.75rem, 1.2vw + 0.65rem, 0.8125rem);
  line-height: 1.35;
  color: #cbd5e1;
  word-break: break-word;
}
.ref-labs-ai-text { margin: 0 0 0.75rem; font-size: 0.875rem; color: #94a3b8; line-height: 1.4; }
.ref-labs-ai-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 0.25rem;
  box-sizing: border-box;
}
.ref-labs-ai-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem clamp(0.35rem, 1.2vw, 0.65rem);
  font-size: clamp(0.7rem, 1.1vw + 0.55rem, 0.8125rem);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  background: #a855f7;
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
}
.ref-labs-ai-btn:hover { background: #9333ea; border-color: rgba(196, 181, 253, 0.55); }
@media (max-width: 380px) {
  .ref-labs-ai-actions { gap: 0.3rem; }
  .ref-labs-ai-btn { font-size: 0.68rem; padding: 0.45rem 0.25rem; }
}
.ref-labs-expand { margin-top: 0.75rem; }
.ref-labs-expand summary { cursor: pointer; font-size: 0.875rem; color: #94a3b8; }
/* Автомасштабирование блока просмотра отчёта под разные устройства */
.ref-labs-expand .dashboard-collapsible-body {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid #334155;
  color: #cbd5e1;
  font-size: clamp(0.8125rem, 2vw + 0.7rem, 0.9375rem);
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: visible;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.ref-labs-expand .dashboard-collapsible-body .report-doctor-section {
  max-width: 100%;
  min-width: 0;
}
.ref-labs-expand .dashboard-collapsible-body .report-doctor-main {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}
.ref-labs-expand .dashboard-collapsible-body .report-doctor-section h4 {
  font-size: clamp(0.9rem, 2.2vw + 0.7rem, 1rem);
  margin: 0 0 0.5rem;
  word-wrap: break-word;
}
.ref-labs-expand .dashboard-collapsible-body .report-doctor-paragraph,
.ref-labs-expand .dashboard-collapsible-body .report-doctor-main p {
  max-width: 100%;
  word-wrap: break-word;
}
.ref-labs-expand .dashboard-collapsible-body img {
  max-width: 100%;
  height: auto;
  display: block;
}
.ref-labs-expand .dashboard-collapsible-body table {
  max-width: 100%;
  display: block;
  overflow-x: auto;
}
.ref-labs-expand .dashboard-collapsible-body table td,
.ref-labs-expand .dashboard-collapsible-body table th {
  word-wrap: break-word;
}
@media (max-width: 480px) {
  .ref-labs-expand .dashboard-collapsible-body {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.8125rem;
  }
}

/* Полноэкранный просмотр отчёта по кнопке «Просмотр отчёта» */
.labs-report-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}
.labs-report-fullscreen:not(.hidden) {
  pointer-events: auto;
}
.labs-report-fullscreen.hidden { display: none !important; }
.labs-report-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
}
.labs-report-fullscreen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: #0f172a;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.labs-report-fullscreen-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}
.labs-report-fullscreen-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
}
.labs-report-fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.labs-report-fullscreen-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid #475569;
  border-radius: 8px;
  cursor: pointer;
}
.labs-report-fullscreen-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
  border-color: #64748b;
}
.labs-report-fullscreen-close {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.labs-report-fullscreen-close:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.6);
}
.labs-report-fullscreen-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  font-size: clamp(0.875rem, 2vw + 0.7rem, 1rem);
  line-height: 1.5;
  color: #cbd5e1;
  -webkit-overflow-scrolling: touch;
}
.labs-report-fullscreen-body .report-doctor-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}
.labs-report-fullscreen-body .report-doctor-section:last-of-type { border-bottom: none; }
.labs-report-fullscreen-body .report-doctor-section h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #c084fc;
}
.labs-report-fullscreen-body .report-doctor-main,
.labs-report-fullscreen-body .report-doctor-paragraph,
.labs-report-fullscreen-body p { max-width: 100%; word-wrap: break-word; }
.labs-report-fullscreen-body img { max-width: 100%; height: auto; }
.labs-report-fullscreen-body table { max-width: 100%; display: block; overflow-x: auto; }

.ref-labs-extra {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid #334155;
}
.ref-labs-extra summary { cursor: pointer; font-size: 0.9rem; color: #94a3b8; }
.ref-labs-extra-inner { margin-top: 0.75rem; }
.ref-labs-extra-inner .labs-report-row { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ref-labs-extra-inner .labs-report-select,
.ref-labs-extra-inner input[type="text"] {
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 8px;
}
.ref-labs-extra-inner .btn-secondary { border: 1px solid #475569; color: #e2e8f0; background: transparent; }
.ref-labs-extra-inner .btn-primary { background: #14b8a6; color: #fff; border: none; }

/* PDF mode picker */
.pdf-mode-modal {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-mode-modal.hidden { display: none !important; }
.pdf-mode-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}
.pdf-mode-modal-content {
  position: relative;
  width: min(92vw, 420px);
  border-radius: 14px;
  padding: 1rem 1rem 1.1rem;
  background: #0f172a;
  border: 1px solid #334155;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.pdf-mode-modal-content h3 {
  margin: 0 0 0.35rem;
  color: #f8fafc;
  font-size: 1.05rem;
}
.pdf-mode-modal-content .muted {
  margin: 0 0 0.9rem;
  color: #94a3b8;
  font-size: 0.88rem;
}
.pdf-mode-actions {
  display: flex;
  gap: 0.55rem;
}
.pdf-mode-actions .btn-primary,
.pdf-mode-actions .btn-secondary {
  flex: 1 1 0;
}
.pdf-mode-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.pdf-mode-modal-close:hover {
  background: rgba(51, 65, 85, 0.55);
  color: #f8fafc;
}

/* Анализы — зона загрузки (legacy, для совместимости) */
.labs-upload-zone .labs-upload-form { margin: 0; }
.labs-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  border: 2px dashed rgba(45, 212, 191, 0.4);
  border-radius: 14px;
  background: rgba(45, 212, 191, 0.06);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.labs-upload-drop:hover,
.labs-upload-drop.labs-upload-dragover {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.1);
}
.labs-upload-icon { font-size: 2rem; color: #2dd4bf; }
.labs-upload-label { font-weight: 600; color: #f1f5f9; }
.labs-upload-hint { font-size: 0.875rem; color: #94a3b8; }
.visually-hidden-input { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; }
.ref-labs-upload-label .visually-hidden-input { inset: 0; width: 100%; height: 100%; cursor: pointer; overflow: visible; pointer-events: auto; }
.labs-upload-row { margin-top: 0.75rem; }
.labs-ai-summary-block { margin-top: 1rem; }
.labs-expand-details { margin-top: 0.5rem; }

/* Dashboard — заголовок секции быстрых действий */
.dashboard-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
}
body.theme-dark .dashboard-section-title { color: #94a3b8; }

/* Экран выбора области тела */
.body-areas-shell .back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #2dd4bf;
  text-decoration: none;
}
.body-areas-shell .back-link:hover { text-decoration: underline; }
.body-areas-prev-symptoms {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 10px;
}
.body-areas-prev-symptoms.hidden { display: none !important; }
.body-silhouette-figure {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.body-zone {
  padding: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.body-zone:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.5);
  transform: scale(1.02);
}
.body-areas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem;
}
.body-areas-cta { margin-top: 1.5rem; }
.body-areas-cta .btn-cta-primary { display: inline-flex; width: 100%; }
.consultation-body-link { margin-top: 0.75rem; }
.btn-body-areas { text-decoration: none; }

.widget { background: #fff; border-radius: 12px; padding: 1rem; margin: 0.75rem 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.widget h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.widget-red-flags { border-left: 4px solid #fef3c7; }
.guide-list { margin: 0.5rem 0; padding-left: 1.25rem; }
.guide-list li { margin: 0.35rem 0; }
.search-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; box-sizing: border-box; }
.specialty-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.specialty-tag { display: inline-block; padding: 0.4rem 0.75rem; background: #e2e8f0; border-radius: 8px; font-size: 0.9rem; color: #334155; cursor: pointer; }
.specialty-tag:hover { background: #cbd5e1; }
.ref-doctor-back {
  display: inline-block; margin-bottom: 1rem; font-size: 0.9rem; color: #64748b; text-decoration: none;
}
button.ref-doctor-back {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.ref-doctor-back:hover { color: #0f766e; }
.ref-cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}
.ref-cross-links .btn-secondary {
  border-radius: 999px;
  border: 1px solid rgba(13, 148, 136, 0.35);
  background: linear-gradient(180deg, #f0fdfa 0%, #e6fffb 100%);
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}
.ref-cross-links .btn-secondary:hover {
  background: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%);
  border-color: rgba(13, 148, 136, 0.55);
}
.ref-doctor-profiles-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-top: 1rem;
}
.ref-doctor-profile-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 4rem;
  padding: 1rem 0.75rem; font-size: 0.95rem; font-weight: 500; text-align: center;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; cursor: pointer; color: #334155;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ref-doctor-profile-card:hover {
  background: #f0fdfa; border-color: #14b8a6; box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}
.ref-doctor-profile-card.is-selected {
  background: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%);
  border-color: #0d9488;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.22);
}
.ref-clinic-selected-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0 0.95rem;
  flex-wrap: wrap;
}
.ref-selected-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #67e8f9;
  color: #0f766e;
  font-size: 0.84rem;
  font-weight: 700;
}
.ref-doctor-profile-info { margin: 1rem 0; padding: 1rem; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; }
.ref-doctor-profile-info p { margin: 0; line-height: 1.6; color: #475569; }
.ref-doctor-profile-cta { margin-top: 1.5rem; }
.ref-doctor-clinic-placeholder {
  margin-top: 1rem; padding: 1.5rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; text-align: center;
}
.ref-doctor-clinic-placeholder p { margin: 0.5rem 0; }
.ref-doctor-clinic-placeholder-list {
  margin: 0.75rem 0 0;
  padding: 0 0 0 1.2rem;
  text-align: left;
}
.ref-doctor-clinic-placeholder-item {
  margin: 0.32rem 0;
  line-height: 1.45;
}
.ref-lab-marker-main {
  font-weight: 600;
}
.ref-lab-marker-patient {
  margin-top: 0.18rem;
  color: #0f766e;
  font-size: 0.9rem;
}
.ref-lab-marker-doctor {
  margin-top: 0.15rem;
  color: #475569;
  font-size: 0.86rem;
}
body.dark .ref-lab-marker-patient,
body.theme-dark .ref-lab-marker-patient {
  color: #5eead4;
}
body.dark .ref-lab-marker-doctor,
body.theme-dark .ref-lab-marker-doctor {
  color: #cbd5e1;
}
body.theme-dark .ref-doctor-back { color: #94a3b8; }
body.theme-dark .ref-doctor-back:hover { color: #2dd4bf; }
body.theme-dark .ref-cross-links .btn-secondary {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(45, 212, 191, 0.42);
  color: #99f6e4;
}
body.theme-dark .ref-cross-links .btn-secondary:hover {
  background: rgba(20, 184, 166, 0.24);
  border-color: rgba(45, 212, 191, 0.62);
}
body.theme-dark .ref-doctor-profiles-flow h2,
body.theme-dark .ref-doctor-profile-flow h2,
body.theme-dark .ref-doctor-clinic-flow h2 { color: #f1f5f9; }
body.theme-dark .ref-doctor-profile-card {
  background: rgba(30, 41, 59, 0.5); border-color: #334155; color: #e2e8f0;
}
body.theme-dark .ref-doctor-profile-card:hover {
  background: rgba(20, 184, 166, 0.15); border-color: #14b8a6; box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
}
body.theme-dark .ref-doctor-profile-card.is-selected {
  background: rgba(20, 184, 166, 0.3);
  border-color: #2dd4bf;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.28);
}
body.theme-dark .ref-selected-badge {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(45, 212, 191, 0.55);
  color: #99f6e4;
}
body.theme-dark .ref-doctor-profile-info {
  background: rgba(30, 41, 59, 0.5); border-color: #334155;
}
body.theme-dark .ref-doctor-profile-info p { color: #cbd5e1; }
body.theme-dark .ref-doctor-clinic-placeholder {
  background: rgba(30, 41, 59, 0.5); border-color: #334155; color: #cbd5e1;
}
.find-doctor-section .widget, .offline-guide-section .widget, .reference-shell .widget, .privacy-section .widget, .help-section .widget { margin: 0.75rem 0; }
.help-section .help-faq h3 { margin-top: 0; }
.help-section .help-faq h3 { color: #0f172a; font-size: 1.15rem; }
.faq-list { margin: 0; padding: 0; }
.faq-list dt { font-weight: 600; color: #0f172a; margin-top: 1rem; font-size: 1rem; line-height: 1.4; }
.faq-list dt:first-of-type { margin-top: 0; }
.faq-list dd { margin: 0.5rem 0 0; padding-left: 0; color: #1e293b; line-height: 1.6; font-size: 0.95rem; }
.faq-list-wrap { margin-top: 0.25rem; }
body.theme-dark .help-section .help-faq h3 { color: #f1f5f9; }
body.theme-dark .faq-list dt { color: #e2e8f0; }
body.theme-dark .faq-list dd { color: #cbd5e1; }
.help-user-questions-list { margin-top: 0.5rem; }
.help-admin-faq-item { margin: 0.35rem 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.help-admin-faq-item .btn-secondary { flex-shrink: 0; }
.help-admin-user-questions-list .help-admin-uq-item { position: relative; }
.help-admin-user-questions-list .labs-report-row { margin-top: 0.35rem; }
.help-admin-user-questions-list .btn-danger { margin-left: 0.5rem; }
.input-text { padding: 0.4rem 0.6rem; font-size: 0.9rem; border: 1px solid #cbd5e1; border-radius: 8px; flex: 1; min-width: 120px; }
.offline-list { margin-top: 0.75rem; max-height: 60vh; overflow-y: auto; }
.offline-items-ul { list-style: none; margin: 0; padding: 0; }
.offline-card { padding: 0.75rem 0; border-bottom: 1px solid #e2e8f0; }
.offline-card:last-child { border-bottom: none; }
.offline-desc { margin: 0.35rem 0; font-size: 0.9rem; }
.urgent-hint { color: #b91c1c; font-size: 0.9rem; margin: 0.35rem 0; }

/* Справочник (Figma) */
.reference-shell { padding: 0.5rem 0 5rem; }
.reference-header { margin-bottom: 1.25rem; }
.reference-title { margin: 0 0 0.35rem; font-size: 1.5rem; font-weight: 700; color: #1F2A37; }
.reference-subtitle { margin: 0; font-size: 0.9rem; color: #64748b; }
.reference-search-wrap {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; margin-bottom: 1rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
}
.reference-search-wrap--inline { margin-top: 0.5rem; margin-bottom: 0.75rem; }
.reference-search-icon { font-size: 1.1rem; color: #64748b; flex-shrink: 0; }
.reference-search-input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font-size: 1rem; color: #1F2A37;
}
.reference-search-input::placeholder { color: #94a3b8; }
.reference-search-input:focus { outline: none; }
/* Подсказки поиска справочника */
.ref-reference-search-field { position: relative; z-index: 5; }
.reference-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(280px, 45vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.reference-search-suggestions.hidden,
.reference-search-suggestions[hidden] {
  display: none !important;
}
.reference-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  font-size: 0.95rem;
  color: #1f2a37;
  cursor: pointer;
  font-family: inherit;
}
.reference-suggestion:last-child { border-bottom: none; }
.reference-suggestion:hover,
.reference-suggestion:focus {
  background: #f8fafc;
  outline: none;
}
.reference-suggestion--empty {
  cursor: default;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}
.reference-suggestion--empty:hover { background: transparent; }
body.theme-dark .reference-search-suggestions {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
body.theme-dark .reference-suggestion {
  color: #f1f5f9;
  border-bottom-color: #334155;
}
body.theme-dark .reference-suggestion:hover,
body.theme-dark .reference-suggestion:focus {
  background: #334155;
}
body.theme-dark .reference-suggestion--empty:hover { background: transparent; }
.reference-popular { margin-bottom: 1rem; }
.reference-popular-label { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 500; color: #64748b; }
.reference-popular-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ref-chip {
  padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 500;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  border-radius: 999px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ref-chip:hover { background: #e2e8f0; }
.ref-chip--active { background: rgba(15, 118, 110, 0.12); border-color: #0f766e; color: #0f766e; }
.reference-segment {
  display: flex; gap: 0.25rem; margin-bottom: 1rem; padding: 0.25rem;
  background: #f1f5f9; border-radius: 12px; border: 1px solid #e2e8f0;
}
.ref-segment-btn {
  flex: 1; padding: 0.6rem 0.75rem; font-size: 0.9rem; font-weight: 500;
  background: transparent; color: #64748b; border: none; border-radius: 10px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.ref-segment-btn:hover { color: #334155; }
.ref-segment-btn--active { background: #fff; color: #1F2A37; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.reference-categories { margin-bottom: 1rem; overflow-x: visible; }
.reference-categories--wrap .reference-categories-scroll {
  flex-wrap: wrap;
  min-width: 0;
}
.reference-categories-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  align-items: flex-start;
}
.ref-cat-chip {
  flex-shrink: 0; padding: 0.45rem 0.9rem; font-size: 0.85rem;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  border-radius: 999px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ref-cat-chip:hover { background: #e2e8f0; }
.ref-cat-chip--active { background: #0f766e; border-color: #0f766e; color: #fff; }
.reference-list { margin-bottom: 1rem; }
.reference-list--hidden { display: none !important; }
.reference-cards { display: flex; flex-direction: column; gap: 0.75rem; max-height: 55vh; overflow-y: auto; }
.ref-card {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.ref-card:hover { background: #f8fafc; border-color: #cbd5e1; }
.ref-card-content { flex: 1; min-width: 0; }
.ref-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.35rem; }
.ref-card-title { margin: 0; font-size: 1rem; font-weight: 700; color: #1F2A37; }
.ref-card-badge {
  flex-shrink: 0; padding: 0.2rem 0.5rem; font-size: 0.75rem; font-weight: 600;
  border-radius: 999px;
}
.ref-card-badge--mild { background: #dcfce7; color: #166534; }
.ref-card-badge--medium { background: #fef3c7; color: #b45309; }
.ref-card-badge--serious { background: #fee2e2; color: #b91c1c; }
.ref-card-desc { margin: 0 0 0.25rem; font-size: 0.875rem; color: #64748b; line-height: 1.4; }
.ref-card-category { margin: 0; font-size: 0.8rem; color: #94a3b8; }
.ref-card-arrow { flex-shrink: 0; font-size: 1.1rem; color: #94a3b8; margin-top: 0.15rem; }
/* Справочник: раскрытие карточки по клику (<details>) */
.ref-card--accordion {
  display: block;
  cursor: default;
}
.ref-card--accordion > .ref-card-summary {
  list-style: none;
  cursor: pointer;
}
.ref-card--accordion > .ref-card-summary::-webkit-details-marker,
.ref-card--accordion > .ref-card-summary::marker {
  display: none;
}
.ref-card-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}
.ref-card--accordion .ref-card-summary-row .ref-card-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.ref-card-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 0.35rem;
  transition: transform 0.2s ease;
  line-height: 1;
}
.ref-card--accordion[open] .ref-card-chevron {
  transform: rotate(-180deg);
}
.ref-card-panel {
  padding-top: 0.75rem;
  margin-top: 0.65rem;
  border-top: 1px solid #e2e8f0;
}
.ref-card-section { margin-bottom: 0.85rem; }
.ref-card-section:last-child { margin-bottom: 0; }
.ref-card-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f766e;
  text-transform: none;
  letter-spacing: 0;
}
.ref-card-section-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #334155;
}
.reference-expert-block {
  display: flex; align-items: center; gap: 0.75rem; padding: 1rem;
  border-radius: 14px; text-decoration: none; color: inherit;
  background: #f8fafc; border: 1px solid #e2e8f0;
  margin-bottom: 1rem; transition: background 0.15s, border-color 0.15s;
}
.reference-expert-block:hover { background: #f1f5f9; border-color: #cbd5e1; }
.reference-expert-icon { font-size: 1.25rem; }
.reference-expert-title { font-weight: 600; color: #1F2A37; }
.reference-urgent-details { margin-top: 0.75rem; }
.reference-urgent-details summary { cursor: pointer; font-size: 0.9rem; color: #64748b; padding: 0.35rem 0; }

/* Восьмой экран — Справочник (ref Healthcare AI 77) */
.ref-reference-flow {
  min-height: 100vh;
  padding-bottom: 5rem;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to bottom right, #0f172a, #134e4a, #0f172a);
  color: #f1f5f9;
}
.ref-reference-flow .ref-reference-header { padding: 1.25rem 1rem 0.5rem; margin-bottom: 0.75rem; }
.ref-reference-flow .ref-reference-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 600; color: #f1f5f9; }
.ref-reference-flow .ref-reference-subtitle { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-reference-flow .ref-reference-content { padding: 0 1rem 1.5rem; }
.ref-reference-flow .ref-reference-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 12px;
}
.ref-reference-flow .ref-reference-search-icon { font-size: 1.25rem; color: #94a3b8; flex-shrink: 0; }
.ref-reference-flow .ref-reference-search .reference-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #f1f5f9;
}
.ref-reference-flow .ref-reference-search .reference-search-input::placeholder { color: #64748b; }
.ref-reference-flow .ref-reference-search .reference-search-input:focus { outline: none; }
.ref-reference-flow .ref-reference-popular { margin-bottom: 1rem; }
.ref-reference-flow .ref-reference-popular-label { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; }
.ref-reference-flow .ref-reference-popular-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.ref-reference-flow .ref-reference-popular-chips .ref-chip {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #475569;
  color: #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.ref-reference-flow .ref-reference-popular-chips .ref-chip:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: #64748b;
  color: #f1f5f9;
}
.ref-reference-flow .ref-reference-popular-chips .ref-chip--active {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.5);
  color: #5eead4;
}
.ref-reference-flow .ref-reference-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 12px;
}
.ref-reference-flow .ref-reference-segment .ref-segment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ref-reference-flow .ref-reference-segment .ref-segment-btn:hover { color: #f1f5f9; }
.ref-reference-flow .ref-reference-segment .ref-segment-btn--active {
  background: rgba(20, 184, 166, 0.2);
  color: #f1f5f9;
}
.ref-reference-flow .ref-reference-segment-icon { font-size: 1rem; }
.ref-reference-flow .ref-reference-categories { margin-bottom: 1rem; overflow-x: visible; }
.ref-reference-flow .ref-reference-categories .reference-categories-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  min-width: 0;
  align-items: flex-start;
}
.ref-reference-flow .ref-cat-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #475569;
  color: #94a3b8;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.ref-reference-flow .ref-cat-chip:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f1f5f9;
}
.ref-reference-flow .ref-cat-chip--active {
  background: #14b8a6;
  border-color: #14b8a6;
  color: #fff;
}
.ref-reference-flow .ref-reference-list { margin-bottom: 1rem; }
.ref-reference-flow .ref-reference-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 55vh;
  overflow-y: auto;
}
.ref-reference-flow .ref-reference-cards .ref-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ref-reference-flow .ref-reference-cards .ref-card.ref-card--accordion {
  display: block;
  cursor: default;
}
.ref-reference-flow .ref-reference-cards .ref-card.ref-card--accordion:hover {
  background: rgba(30, 41, 59, 0.5);
  border-color: #334155;
}
.ref-reference-flow .ref-reference-cards .ref-card:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: #475569;
}
.ref-reference-flow .ref-reference-cards .ref-card-title { color: #f1f5f9; font-weight: 600; }
.ref-reference-flow .ref-reference-cards .ref-card-desc { color: #94a3b8; }
.ref-reference-flow .ref-reference-cards .ref-card-category { color: #64748b; font-size: 0.75rem; }
.ref-reference-flow .ref-reference-cards .ref-card-arrow { color: #64748b; }
.ref-reference-flow .ref-reference-cards .ref-card--accordion > .ref-card-summary { color: inherit; }
.ref-reference-flow .ref-reference-cards .ref-card-panel {
  border-top-color: #334155;
}
.ref-reference-flow .ref-reference-cards .ref-card-section-title { color: #5eead4; }
.ref-reference-flow .ref-reference-cards .ref-card-section-text { color: #cbd5e1; }
.ref-reference-flow .ref-reference-cards .ref-card-chevron { color: #64748b; }
.ref-reference-flow .ref-reference-cards .ref-card-badge--mild { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ref-reference-flow .ref-reference-cards .ref-card-badge--medium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.ref-reference-flow .ref-reference-cards .ref-card-badge--serious { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.ref-reference-flow .ref-reference-cards .muted { color: #64748b; }
.ref-reference-flow .ref-reference-search.reference-search-wrap--inline {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.ref-reference-flow .ref-reference-expert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(147, 51, 234, 0.2));
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}
.ref-reference-flow .ref-reference-expert:hover { opacity: 0.95; }
.ref-reference-flow .ref-reference-expert-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.2);
  font-size: 1.25rem;
}
.ref-reference-flow .ref-reference-expert-body { flex: 1; min-width: 0; }
.ref-reference-flow .ref-reference-expert-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.ref-reference-flow .ref-reference-expert-text { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; line-height: 1.4; }
.ref-reference-flow .ref-reference-expert-link { font-size: 0.875rem; color: #60a5fa; }
.ref-reference-flow .ref-reference-urgent {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid #334155;
}
.ref-reference-flow .ref-reference-urgent summary { cursor: pointer; font-size: 0.9rem; color: #94a3b8; }
.ref-reference-flow .ref-reference-urgent-body { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #334155; font-size: 0.875rem; color: #cbd5e1; }
.ref-reference-flow .ref-reference-urgent-body .muted { color: #64748b; }

/* Девятый экран — Отчёты (ref Healthcare AI 78) */
.ref-reports-flow {
  min-height: 100vh;
  padding-bottom: 5rem;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to bottom right, #0f172a, #134e4a, #0f172a);
  color: #f1f5f9;
}
.ref-reports-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1rem 0.5rem;
}
.ref-reports-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 600; color: #f1f5f9; }
.ref-reports-subtitle { margin: 0; font-size: 0.875rem; color: #94a3b8; }
.ref-reports-download-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #475569;
  border-radius: 10px;
  background: transparent;
  color: #f1f5f9;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ref-reports-download-btn:hover { background: rgba(51, 65, 85, 0.6); border-color: #64748b; }
.ref-reports-content { padding: 0 1rem 1.5rem; }
.ref-reports-time {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ref-reports-time-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ref-reports-time-btn:hover { background: rgba(51, 65, 85, 0.8); color: #f1f5f9; }
.ref-reports-time-btn--active { background: #14b8a6; color: #fff; }
.ref-reports-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ref-reports-stat-card {
  padding: 1rem;
  border-radius: 12px;
  border: none;
  color: #fff;
  min-height: 5rem;
}
.ref-reports-stat--consultations { background: linear-gradient(135deg, #0d9488, #059669); }
.ref-reports-stat--health { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.ref-reports-stat--labs { background: linear-gradient(135deg, #d97706, #ea580c); }
.ref-reports-stat--visits { background: linear-gradient(135deg, #db2777, #e11d48); }
.ref-reports-stat-icon { font-size: 1.25rem; display: block; margin-bottom: 0.35rem; opacity: 0.9; }
.ref-reports-stat-label { font-size: 0.75rem; opacity: 0.95; display: block; margin-bottom: 0.25rem; }
.ref-reports-stat-value { font-size: 1.75rem; font-weight: 700; display: block; }
.ref-reports-stat-hint { font-size: 0.7rem; opacity: 0.9; display: block; margin-top: 0.2rem; }
.ref-reports-chart-card {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
}
.ref-reports-chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.ref-reports-chart-title { margin: 0; font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.ref-reports-chart-filter {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
}
.ref-reports-chart-filter:hover { background: rgba(51, 65, 85, 0.6); color: #f1f5f9; }
.ref-reports-chart-placeholder {
  min-height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
}
.ref-reports-chart-placeholder .muted { color: #64748b; font-size: 0.875rem; }
.ref-reports-recent-block { margin-bottom: 1rem; }
.ref-reports-recent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.ref-reports-recent-head .ref-reports-recent-title { margin: 0; flex: 1 1 auto; min-width: 0; }
.ref-reports-recent-title { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; }
.ref-reports-recent-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ref-reports-flow .ref-reports-recent-list .recommendations-list-ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.ref-reports-flow .ref-reports-recent-list .recommendation-item {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-bottom: none;
  list-style: none;
}
.ref-reports-flow .ref-reports-recent-list .recommendation-date { display: block; font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.35rem; }
.ref-reports-flow .ref-reports-recent-list .recommendation-title { margin: 0.35rem 0 0.25rem; font-weight: 600; color: #f1f5f9; font-size: 0.9375rem; }
.ref-reports-flow .ref-reports-recent-list .recommendation-summary { margin: 0.25rem 0 0.5rem; font-size: 0.875rem; color: #94a3b8; line-height: 1.4; }
.ref-reports-flow .ref-reports-recent-list .recommendation-actions { margin-top: 0.5rem; }
.ref-reports-flow .ref-reports-recent-list .recommendation-actions .btn-secondary {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid #475569;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
}
.ref-reports-flow .ref-reports-recent-list .recommendation-actions .btn-secondary:hover { background: rgba(51, 65, 85, 0.6); color: #f1f5f9; }
.ref-reports-flow .ref-reports-recent-list .severity-pill { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 999px; }
.ref-reports-flow .ref-reports-recent-list .severity-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ref-reports-flow .ref-reports-recent-list .severity-yellow { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.ref-reports-flow .ref-reports-recent-list .severity-red { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.ref-reports-flow .ref-reports-recent-list .muted { color: #64748b; }
.ref-reports-flow .ref-reports-recent-list .reports-docs-deleted-title { margin: 1rem 0 0.5rem; font-size: 0.9rem; color: #94a3b8; }
.ref-reports-clear-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #475569;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
}
.ref-reports-clear-btn:hover { background: rgba(51, 65, 85, 0.6); color: #f1f5f9; }
.ref-reports-recent-hint { margin: 0.5rem 0 0; font-size: 0.8rem; color: #64748b; }
.ref-reports-recent-hint a { color: #5eead4; text-decoration: none; }
.ref-reports-recent-hint a:hover { text-decoration: underline; }
.ref-reports-export {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid #334155;
}
.ref-reports-export-title { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.ref-reports-export-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.ref-reports-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #475569;
  background: transparent;
  color: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ref-reports-export-btn:hover { background: rgba(51, 65, 85, 0.6); border-color: #64748b; }
.ref-reports-extra {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid #334155;
}
.ref-reports-extra summary { cursor: pointer; font-size: 0.9rem; color: #94a3b8; }
.ref-reports-extra-inner { margin-top: 0.75rem; }
.ref-reports-extra-inner .widget { margin-bottom: 1rem; }
.ref-reports-extra-inner .widget h3 { margin: 0 0 0.5rem; font-size: 1rem; color: #f1f5f9; }
.ref-reports-extra-inner .report-content,
.ref-reports-extra-inner .labs-docs-list { font-size: 0.875rem; color: #cbd5e1; }
.ref-reports-extra-inner .labs-docs-ul { list-style: none; padding: 0; margin: 0; }
.ref-reports-extra-inner .labs-doc-item { padding: 0.5rem 0; border-bottom: 1px solid #334155; }
.ref-reports-extra-inner .labs-doc-item .labs-doc-name { color: #f1f5f9; }
.ref-reports-extra-inner .labs-doc-item .muted { color: #64748b; }
.ref-reports-extra-inner .hint { color: #94a3b8; font-size: 0.875rem; }
.ref-reports-extra-inner .hint a { color: #5eead4; }
.ref-reports-extra-inner .labs-report-row { margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.ref-reports-extra-inner .labs-report-select { padding: 0.4rem 0.6rem; background: #334155; border: 1px solid #475569; color: #f1f5f9; border-radius: 8px; }

/* Десятый экран — Профиль (ref Healthcare AI 79) */
.ref-profile-flow {
  min-height: 100vh;
  padding-bottom: 5rem;
  max-width: 32rem;
  margin: 0 auto;
  background: linear-gradient(to bottom right, #0f172a, #134e4a, #0f172a);
  color: #f1f5f9;
}
.ref-profile-content { padding: 1.25rem 1rem 1.5rem; }
.ref-profile-header-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0d9488, #059669);
  color: #fff;
  margin-bottom: 1rem;
}
.ref-profile-avatar-wrap { flex-shrink: 0; }
.ref-profile-avatar {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.5rem;
  font-weight: 700;
}
.ref-profile-header-body { flex: 1; min-width: 0; }
.ref-profile-name { margin: 0 0 0.25rem; font-size: 1.25rem; font-weight: 600; }
.ref-profile-email { margin: 0 0 0.5rem; font-size: 0.875rem; opacity: 0.95; }
.ref-profile-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; opacity: 0.95; }
.ref-profile-meta-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.ref-profile-edit-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
}
.ref-profile-edit-btn:hover { background: rgba(255, 255, 255, 0.3); }
.ref-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ref-profile-stat-card {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  text-align: center;
}
.ref-profile-stat-icon { display: block; font-size: 1.25rem; margin-bottom: 0.35rem; }
.ref-profile-stat--health .ref-profile-stat-icon { color: #34d399; }
.ref-profile-stat--consultations .ref-profile-stat-icon { color: #60a5fa; }
.ref-profile-stat--labs .ref-profile-stat-icon { color: #a78bfa; }
.ref-profile-stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: #f1f5f9; }
.ref-profile-stat-label { display: block; font-size: 0.7rem; color: #94a3b8; margin-top: 0.2rem; }
.ref-profile-block { margin-bottom: 1rem; }
.ref-profile-block-title { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; }
.ref-profile-card {
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  overflow: hidden;
}
.ref-profile-card--divided .ref-profile-row { border-bottom: 1px solid #334155; }
.ref-profile-card--divided .ref-profile-row:last-child { border-bottom: none; }
.ref-profile-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.ref-profile-row:hover { background: rgba(51, 65, 85, 0.5); }
.ref-profile-row-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
}
.ref-profile-row-icon--red { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.ref-profile-row-icon--amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.ref-profile-row-icon--blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.ref-profile-row-icon--muted { background: rgba(71, 85, 105, 0.5); color: #94a3b8; }
.ref-profile-row-text { flex: 1; min-width: 0; }
.ref-profile-row-label { display: block; font-size: 0.9rem; font-weight: 500; color: #f1f5f9; }
.ref-profile-row-sublabel { display: block; font-size: 0.75rem; color: #94a3b8; margin-top: 0.15rem; }
.ref-profile-row-arrow { flex-shrink: 0; font-size: 1.1rem; color: #64748b; }
.ref-profile-row--switch { cursor: default; }
.ref-profile-row--switch:hover { background: transparent; }
.ref-profile-switch {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.35rem;
  flex-shrink: 0;
}
.ref-profile-switch input { opacity: 0; width: 0; height: 0; }
.ref-profile-switch-slider {
  position: absolute;
  inset: 0;
  background: #475569;
  border-radius: 999px;
  transition: background 0.2s;
}
.ref-profile-switch-slider::before {
  content: "";
  position: absolute;
  height: 1rem;
  width: 1rem;
  left: 0.2rem;
  bottom: 0.18rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.ref-profile-switch input:checked + .ref-profile-switch-slider { background: #14b8a6; }
.ref-profile-switch input:checked + .ref-profile-switch-slider::before { transform: translateX(1.15rem); }
.ref-profile-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #f87171;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ref-profile-logout:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.6); }
.ref-profile-logout-icon { font-size: 1.1rem; }
.ref-profile-version { margin: 1rem 0 0; font-size: 0.75rem; color: #64748b; text-align: center; }

.privacy-section .widget h3 { margin-top: 1rem; }
.privacy-section .widget h3:first-of-type { margin-top: 0; }
.notifications-list { list-style: none; margin: 0; padding: 0; }
.notification-item { padding: 0.75rem 0; border-bottom: 1px solid #e2e8f0; }
.notification-item:last-child { border-bottom: none; }
.notification-date { font-size: 0.8rem; display: block; margin-bottom: 0.25rem; }
.notification-body { margin: 0.35rem 0 0; font-size: 0.9rem; }

.card-form label { display: block; margin-top: 0.75rem; margin-bottom: 0.25rem; font-size: 0.9rem; color: #475569; }
.card-form input, .card-form textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; box-sizing: border-box; }
.card-form select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; box-sizing: border-box; background: #fff; }
.family-access-widget { margin-top: 0.9rem; }
.family-access-rows { display: grid; gap: 0.5rem; }
.family-access-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(170px, 1.2fr);
  gap: 0.5rem;
}
@media (max-width: 860px) {
  .family-access-row { grid-template-columns: 1fr; }
}
.labs-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.labs-upload-row .btn-primary,
.labs-upload-row .btn-secondary {
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  min-height: 2.5rem;
  border-radius: 8px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.labs-upload-row .btn-primary {
  background: #0f766e;
  color: #fff;
  border: none;
}
.labs-upload-row .btn-primary:hover { background: #0d5c55; }
.labs-upload-row .btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.labs-upload-row .btn-secondary:hover { background: #e2e8f0; }
.labs-upload-row .labs-camera-btn {
  position: relative;
}
.labs-upload-row .labs-camera-btn .labs-camera-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.9);
  position: relative;
  flex: 0 0 auto;
}
.labs-upload-row .labs-camera-btn .labs-camera-icon::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  position: absolute;
}
.labs-upload-row .labs-camera-btn .labs-camera-icon::after {
  content: "";
  width: 0.15rem;
  height: 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  position: absolute;
  top: 0.12rem;
  right: 0.14rem;
}
.labs-choose-file-label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #475569;
}
.labs-file-input {
  margin-top: 0;
}
.labs-upload-row + .labs-upload-row {
  margin-top: 0.75rem;
}
.btn-primary { margin-top: 0.75rem; padding: 0.6rem 1.2rem; background: #0f766e; color: #fff; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; }
.btn-primary:hover { background: #0d5c55; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.radio-label, .checkbox-label { display: block; margin: 0.35rem 0; font-size: 0.9rem; }
.setting-label { margin-top: 1rem; font-weight: 600; font-size: 0.9rem; }
.unified-hint { margin-bottom: 0.5rem; }

/* Настройки: тарифы — читаемый контрастный текст */
.widget-unified-mode-tariff .tariff-plan-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}
.widget-unified-mode-tariff .tariff-lead {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #1e293b;
}
.widget-unified-mode-tariff .tariff-next-hint {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}
.widget-unified-mode-tariff .setting-label { color: #0f172a; }
.widget-unified-mode-tariff .tariff-options-list--settings {
  margin-top: 0;
  color: #334155;
  font-size: 0.9rem;
}
.widget-unified-mode-tariff .tariff-options-list--settings li { margin-bottom: 0.4rem; }
.widget-unified-mode-tariff #freeOptionsList > .hint { color: #475569; font-size: 0.875rem; }
.widget-unified-mode-tariff .checkbox-label { color: #1e293b; }

body.theme-dark .widget-unified-mode-tariff .tariff-plan-title { color: #f8fafc; }
body.theme-dark .widget-unified-mode-tariff .tariff-lead { color: #e2e8f0; }
body.theme-dark .widget-unified-mode-tariff .tariff-next-hint { color: #f1f5f9; }
body.theme-dark .widget-unified-mode-tariff .setting-label { color: #f1f5f9; }
body.theme-dark .widget-unified-mode-tariff .tariff-options-list--settings,
body.theme-dark .widget-unified-mode-tariff .tariff-options-list--settings li { color: #e2e8f0; }
body.theme-dark .widget-unified-mode-tariff #freeOptionsList > .hint { color: #cbd5e1; }
body.theme-dark .widget-unified-mode-tariff .checkbox-label { color: #e2e8f0; }
.tariff-accordion { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.tariff-expand { border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; overflow: hidden; }
.tariff-expand.tariff-free { border-color: #cbd5e1; }
.tariff-expand.expanded { border-color: #0f766e; background: #fff; box-shadow: 0 2px 8px rgba(15,118,110,0.08); }
.tariff-expand-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.875rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  color: #1e293b;
}
.tariff-expand-header:hover { background: rgba(15,118,110,0.06); }
.tariff-expand-title { font-weight: 700; color: #0f766e; }
.tariff-expand-desc { font-size: 0.875rem; color: #64748b; margin-left: auto; }
.tariff-expand-chevron {
  font-size: 0.7rem;
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.tariff-expand.expanded .tariff-expand-chevron { transform: rotate(180deg); color: #0f766e; }
.tariff-expand-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid #f1f5f9;
}
.tariff-expand.expanded .tariff-expand-body { display: block; }
.tariff-options-list { margin: 0.75rem 0 0; padding-left: 1.25rem; font-size: 0.875rem; color: #475569; line-height: 1.6; }
.tariff-options-list li { margin-bottom: 0.35rem; }
.tariff-options-list--compact { margin-top: 0.35rem; margin-bottom: 0; }
.tariff-pay-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
@media (min-width: 480px) {
  .tariff-pay-options { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
}
.tariff-pay-options .tariff-btn { flex: 1; min-width: 12rem; text-align: center; justify-content: center; }
.tariff-btn { margin-top: 0.75rem; display: inline-block; }
/* Модальное окно редактирования документа */
.doc-edit-modal { position: fixed; inset: 0; z-index: 350; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.doc-edit-modal.hidden { display: none !important; }
.doc-edit-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.doc-edit-modal-content { position: relative; background: #fff; border-radius: 12px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.doc-edit-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid #e2e8f0; }
.doc-edit-modal-body { padding: 1rem; }
.doc-edit-modal-body label { display: block; margin-top: 0.75rem; margin-bottom: 0.25rem; font-size: 0.9rem; }
.doc-edit-modal-body .input-text { width: 100%; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 8px; }
.doc-edit-modal-body .input-textarea { width: 100%; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 8px; resize: vertical; font-family: inherit; }
.doc-edit-modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 1rem; border-top: 1px solid #e2e8f0; }
.btn-secondary { padding: 0.5rem 1rem; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; }
.btn-secondary:hover { background: #e2e8f0; }

.top-complaint-item { display: inline-flex; align-items: center; margin-bottom: 6px; }
.top-complaint-delete {
  flex-shrink: 0; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2); background: #fff; color: #64748b;
  cursor: pointer; font-size: 18px; line-height: 1; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.top-complaint-delete:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.labs-doc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.labs-doc-name { flex: 1 1 auto; min-width: 0; }
.labs-doc-badge { color: #0f766e; font-weight: bold; }
.labs-doc-actions { display: flex; gap: 0.35rem; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.85rem; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.btn-edit { background: #f0fdfa; color: #0f766e; border-color: #0f766e; }
.btn-edit:hover { background: #ccfbf1; }
.btn-danger { background: #fef2f2; color: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #fee2e2; }
.labs-report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.labs-report-select { min-width: 180px; padding: 0.35rem 0.5rem; border-radius: 8px; border: 1px solid #e2e8f0; }

.payment-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.payment-modal.hidden { display: none !important; }
.payment-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.payment-modal-content { position: relative; background: #fff; border-radius: 12px; max-width: 400px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.payment-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid #e2e8f0; }
.payment-close { font-size: 1.5rem; }
.payment-step { padding: 1rem; }
.payment-methods { display: flex; flex-direction: column; gap: 0.5rem; }
.payment-method-btn { padding: 0.6rem 1rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; font-size: 1rem; text-align: left; }
.payment-method-btn:hover { background: #f1f5f9; border-color: #0f766e; }
.payment-back-btn { margin-bottom: 0.75rem; padding: 0.35rem 0; background: none; border: none; color: #0f766e; cursor: pointer; font-size: 0.9rem; }
.payment-method-screen { min-height: 80px; }
.save-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.save-feedback { font-size: 0.85rem; color: #64748b; }
.save-salute { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.save-salute.save-salute-visible { opacity: 1; }
.save-salute-text { background: #0f766e; color: #fff; padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 600; }

.vitals-last { margin-bottom: 0.75rem; font-size: 0.9rem; }
.health-subsection { margin-top: 1.25rem; margin-bottom: 0.35rem; font-size: 1rem; }
.vitals-form .vitals-row { margin-top: 0.75rem; }
.vitals-form .vitals-text-num {
  width: 100%;
  max-width: 11rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}
.vitals-inline { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.vitals-inline input { width: 5rem; min-width: 4rem; }
.vitals-inline .vitals-text-num { max-width: 5.5rem; }
.vitals-sep { color: #64748b; font-weight: 600; }

.ad-or-news-block { margin: 0.5rem 0; padding: 0.75rem; background: #f0fdf4; border-radius: 8px; font-size: 0.9rem; }

/* Forum + News portal */
.forum-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

#page-forum #forumThreadTitleInput,
#page-forum #forumSearchInput,
#page-news #newsSearchInput {
  width: 100%;
  max-width: none;
}

#page-forum #forumThreadContentInput,
#page-forum #forumCommentContentInput {
  width: 100%;
  min-height: 150px;
  max-width: none;
  resize: vertical;
  padding: 0.7rem 0.8rem;
  font-size: 0.98rem;
  line-height: 1.45;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
}

.forum-branches-list {
  display: grid;
  gap: 0.65rem;
}

.forum-branch-card {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.05);
}

.forum-branch-card.is-clickable {
  cursor: pointer;
}

.forum-branch-card.is-active {
  border-color: rgba(15, 118, 110, 0.55);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(226, 250, 246, 0.85));
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.16);
}

.forum-branch-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: #0f172a;
}

.forum-branch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
}

.forum-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.forum-manage-actions .btn-secondary,
.forum-manage-actions .btn-danger {
  font-size: 0.8rem;
  padding: 0.32rem 0.6rem;
}

.forum-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  line-height: 1;
}

.forum-threads-list,
.forum-comments-list {
  display: grid;
  gap: 0.55rem;
}

.forum-thread-card,
.forum-comment-card {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  padding: 0.85rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248, 250, 252, 0.8));
}

.forum-thread-card.is-clickable {
  cursor: pointer;
}

.forum-thread-card.is-active {
  border-color: rgba(20, 184, 166, 0.6);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.92), rgba(224, 242, 254, 0.65));
  box-shadow: 0 3px 12px rgba(20, 184, 166, 0.14);
}

.forum-master-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.news-master-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 1100px) {
  .forum-master-detail {
    grid-template-columns: minmax(360px, 0.95fr) minmax(540px, 1.2fr);
  }
  .news-master-detail {
    grid-template-columns: minmax(420px, 1fr) minmax(560px, 1.2fr);
  }
  .forum-master-detail > .widget,
  .news-master-detail > .widget {
    margin: 0;
  }
}

#forumThreadsList,
#forumCommentsList,
#newsActiveContent {
  max-height: 62vh;
  overflow: auto;
}

.news-fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 460;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

body.modal-open {
  overflow: hidden;
}

.news-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
}

.news-fullscreen-content {
  position: relative;
  width: min(1100px, 96vw);
  height: min(94vh, 980px);
  margin: auto;
  background: #0b1623;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 14px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.2rem;
}

.news-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.news-fullscreen-header h3 {
  margin: 0;
  color: #f8fafc;
}

.news-fullscreen-body {
  margin-top: 0.4rem;
  padding: 0.8rem 0.2rem 0.2rem;
  color: #e2e8f0;
  line-height: 1.55;
  overflow: auto;
}

.news-fullscreen-body p {
  margin: 0 0 0.9rem;
}

body.theme-dark .news-fullscreen-content {
  background: #020617;
  border-color: rgba(45, 212, 191, 0.28);
}

body.theme-dark .forum-branch-card {
  border-color: rgba(45, 212, 191, 0.25);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.92));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

body.theme-dark .forum-branch-card.is-active {
  border-color: rgba(45, 212, 191, 0.55);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.22), rgba(30, 41, 59, 0.88));
}

body.theme-dark .forum-thread-card,
body.theme-dark .forum-comment-card {
  border-color: rgba(100, 116, 139, 0.42);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(17, 24, 39, 0.9));
}

.forum-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.35rem 0 0.55rem;
}

.forum-admin-grid label {
  display: block;
  font-size: 0.82rem;
  color: #475569;
  margin-bottom: 0.2rem;
}

@media (max-width: 920px) {
  .forum-admin-grid {
    grid-template-columns: 1fr;
  }
}
.symptom-history-list { padding-left: 1.25rem; margin: 0.5rem 0; }
.symptom-history-list li { margin-bottom: 0.35rem; }

.recommendations-list { margin-top: 1rem; }
.recommendations-list-ul { list-style: none; padding: 0; margin: 0; }
.recommendation-item { padding: 0.75rem 0; border-bottom: 1px solid #e2e8f0; }
.recommendation-item:last-child { border-bottom: none; }
.recommendation-date { font-size: 0.85rem; }

.labs-docs-ul { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.labs-doc-item { padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; }
.labs-doc-item:last-child { border-bottom: none; }
.labs-doc-name { font-weight: 500; }
.recommendation-title { margin: 0.25rem 0 0; font-weight: 600; font-size: 0.95rem; color: #0f766e; }
.recommendation-summary { margin: 0.35rem 0 0; font-size: 0.9rem; color: #334155; }
.reports-docs-deleted-title { margin: 1rem 0 0.5rem 0; font-size: 0.95rem; color: #64748b; }
.reports-docs-deleted-ul .recommendation-actions { margin-top: 0.25rem; }
.trash-ul { list-style: none; padding: 0; margin: 0; }
.trash-item { padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.trash-item-name { flex: 1 1 200px; }
.trash-item-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.symptom-history-actions { margin-bottom: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.symptom-history-list { list-style: none; padding: 0; margin: 0; }
.symptom-history-list li { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid #f1f5f9; }
.symptom-history-list .symptom-entry-cb { margin-top: 0.2rem; flex-shrink: 0; }
.symptom-history-list .symptom-entry-text { flex: 1; }
.recommendation-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.recommendation-export-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}
.recommendation-sequence {
  margin-top: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.5rem 0.65rem;
}
.recommendation-sequence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #0f766e;
  font-size: 0.82rem;
}
.recommendation-sequence-status {
  font-size: 0.72rem;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.recommendation-sequence-line {
  margin: 0.22rem 0 0;
  font-size: 0.82rem;
  color: #334155;
}
.recommendation-seq-toggle {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
}
.recommendation-sequence-details {
  margin-top: 0.5rem;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.5rem;
}
.recommendation-sequence-phases {
  margin: 0;
  padding-left: 1rem;
}
.recommendation-sequence-phase {
  margin: 0.15rem 0 0.55rem;
}
.recommendation-sequence-phase-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f766e;
}
.recommendation-sequence-list {
  margin: 0.2rem 0 0;
  padding-left: 1rem;
}
.recommendation-sequence-list li {
  font-size: 0.8rem;
  margin: 0.12rem 0;
}
.recommendation-sequence-collected { color: #0f766e; }
.recommendation-sequence-needs { color: #7c2d12; }
.severity-pill { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.8rem; margin-left: 0.5rem; }
.severity-pill.severity-green { background: #dcfce7; color: #166534; }
.severity-pill.severity-yellow { background: #fef9c3; color: #854d0e; }
.severity-pill.severity-red { background: #fee2e2; color: #991b1b; }

.chat-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 100%; max-width: 400px;
  background: #fff; box-shadow: -2px 0 12px rgba(0,0,0,0.15); z-index: 300;
  display: flex; flex-direction: column; transition: transform 0.2s ease;
}
.chat-panel.closed { transform: translateX(100%); }
.chat-panel-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; }
.chat-panel-title-wrap { flex: 1; min-width: 0; }
.chat-panel-subtitle { margin: 0.2rem 0 0 0; font-size: 0.75rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; }
.chat-msg { margin-bottom: 0.75rem; }
.chat-msg-bubble { display: inline-block; max-width: 85%; padding: 0.5rem 0.75rem; border-radius: 12px; font-size: 0.9rem; }
.chat-msg-user .chat-msg-bubble { background: #0f766e; color: #fff; margin-left: auto; }
.chat-msg-assistant .chat-msg-bubble {
  background: #f1f5f9;
  color: #1e293b;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: min(85%, 38em);
  line-height: 1.55;
}
.chat-thinking { padding: 0 1rem 0.5rem; }
.chat-thinking .chat-msg-bubble { background: #f1f5f9; font-style: italic; }
.chat-form { padding: 1rem; border-top: 1px solid #e2e8f0; }
.chat-form .chat-input-wrap { margin-bottom: 0.5rem; }
.voice-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.voice-input-wrap input { flex: 1; min-width: 0; }
.chat-mic-btn { flex-shrink: 0; padding: 0.5rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; font-size: 1.1rem; }
.chat-mic-btn:hover { background: #f1f5f9; }
.chat-mic-btn.recording { background: #fef3c7; border-color: #f59e0b; }
.chat-mic-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.chat-voice-options { font-size: 0.85rem; margin-bottom: 0.5rem; display: block; }
.chat-prev-topic-banner {
  padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
  font-size: 0.85rem; color: #475569;
}
.chat-prev-topic-banner.hidden { display: none !important; }
.chat-prev-topic-text { margin: 0 0 0.5rem 0; }
.chat-prev-topic-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chat-prev-topic-actions .btn-secondary { font-size: 0.85rem; padding: 0.35rem 0.6rem; }
.chat-new-continue-banner {
  padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f0fdfa;
  font-size: 0.9rem; color: #0f766e;
}
.chat-new-continue-banner.hidden { display: none !important; }
.chat-new-continue-text { margin: 0 0 0.5rem 0; font-weight: 500; }
.chat-new-continue-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chat-restore-last { padding: 0.5rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-size: 0.85rem; }
.chat-restore-last.hidden { display: none !important; }
.chat-restore-last-btn { padding: 0.3rem 0.6rem; }
.disclaimer { font-size: 0.85rem; color: #64748b; margin-bottom: 0.5rem; }

/* Пятый экран — Чат консультации (ref Healthcare AI 74) */
.chat-panel-ref {
  background: linear-gradient(to bottom right, #0f172a 0%, #022c22 50%, #0f172a 100%);
  color: #f1f5f9;
}
.chat-panel-ref-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}
.chat-panel-ref-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #f1f5f9;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-panel-ref-back:hover { background: rgba(51, 65, 85, 0.8); }
.chat-panel-ref-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.chat-panel-ref-avatar {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}
.chat-panel-ref-name { font-size: 0.875rem; font-weight: 500; color: #f1f5f9; }
.chat-panel-ref-sub { font-size: 0.75rem; color: #34d399; }
.chat-messages-ref {
  padding: 1.5rem 1rem;
  flex: 1;
  overflow-y: auto;
}
.chat-panel-ref .chat-msg {
  display: flex;
  margin-bottom: 1rem;
}
.chat-panel-ref .chat-msg-user {
  justify-content: flex-end;
}
.chat-panel-ref .chat-msg-assistant {
  justify-content: flex-start;
}
.chat-panel-ref .chat-msg-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-panel-ref .chat-msg-user .chat-msg-bubble {
  background: #059669;
  color: #fff;
  border-radius: 1rem 1rem 0.25rem 1rem;
}
.chat-panel-ref .chat-msg-assistant .chat-msg-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 1rem 1rem 1rem 0.25rem;
}
.chat-panel-ref .chat-msg-assistant .chat-msg-bubble::before {
  content: "Михаил";
  display: block;
  font-size: 0.75rem;
  color: #34d399;
  margin-bottom: 0.35rem;
}
.chat-thinking-ref {
  padding: 0 1rem 0.5rem;
}
.chat-thinking-ref .chat-msg-ref-assistant {
  display: flex;
  justify-content: flex-start;
}
.chat-thinking-ref .chat-msg-ref-bubble {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
  background: #1e293b;
  border-radius: 1rem 1rem 1rem 0.25rem;
}
.chat-form-ref {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid #1e293b;
}
.chat-form-ref-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.chat-input-ref {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  color: #f1f5f9;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 9999px;
}
.chat-input-ref::placeholder { color: #64748b; }
.chat-input-ref:focus { outline: none; border-color: #10b981; }
.chat-send-ref {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: #10b981;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.chat-send-ref:hover:not(:disabled) { background: #059669; transform: translateY(-1px); }
.chat-form-ref-options {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: #94a3b8;
}
.chat-mic-ref {
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 0.375rem;
}
.chat-mic-ref:hover { background: rgba(51, 65, 85, 0.6); color: #f1f5f9; }

/* ═══════════════════════════════════════════════════════════════
   VOICE AI CONCIERGE
   ═══════════════════════════════════════════════════════════════ */
.vc-wrapper {
  position: fixed;
  bottom: calc(4.5rem + 0.75rem);
  right: 1.25rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.625rem;
}
@media (min-width: 960px) {
  .vc-wrapper { bottom: 1.5rem; }
}

/* Floating mic button */
.vc-float-btn {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #0f766e; color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(15,118,110,0.45);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.vc-float-btn:hover { background: #0d6560; transform: scale(1.06); box-shadow: 0 6px 20px rgba(15,118,110,0.55); }
.vc-float-btn:active { transform: scale(0.96); }
.vc-float-btn.vc-float--listening { background: #dc2626; box-shadow: 0 4px 16px rgba(220,38,38,0.45); }
.vc-float-btn.vc-float--speaking { background: #0284c7; box-shadow: 0 4px 16px rgba(2,132,199,0.45); }
.vc-float-icon { position: relative; z-index: 1; }

/* Pulse ring animation */
.vc-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(15,118,110,0.4);
  animation: vc-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
.vc-float-btn.vc-float--listening .vc-pulse {
  border-color: rgba(220,38,38,0.5);
  animation: vc-pulse 1.0s ease-in-out infinite;
}
.vc-float-btn.vc-float--speaking .vc-pulse {
  border-color: rgba(2,132,199,0.5);
  animation: vc-pulse 1.6s ease-in-out infinite;
}
@keyframes vc-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.22); opacity: 0; }
}

/* Panel */
.vc-panel {
  width: 420px; max-width: calc(100vw - 1.25rem);
  height: min(760px, calc(100vh - 3.5rem));
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.vc-panel-header,
.vc-sequence,
.vc-waveform,
.vc-auto-toggle,
.vc-barge-hint,
.vc-voice-row,
.vc-controls,
.vc-disclaimer { flex-shrink: 0; }
.vc-panel--hidden { display: none !important; }

.vc-panel-header {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
}
.vc-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(255,255,255,0.18); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.vc-avatar svg { stroke: #fff; }
.vc-panel-title-wrap { flex: 1; min-width: 0; }
.vc-panel-title { font-size: 0.875rem; font-weight: 700; }
.vc-status { font-size: 0.7rem; opacity: 0.85; display: block; margin-top: 1px; }
.vc-close-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  border-radius: 8px; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.vc-close-btn:hover { background: rgba(255,255,255,0.28); }
.vc-reset-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  border-radius: 8px; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.vc-reset-btn:hover { background: rgba(255,255,255,0.28); }

.vc-transcript {
  padding: 0.75rem 1rem;
  flex: 1 1 auto;
  min-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.vc-transcript::-webkit-scrollbar { width: 8px; }
.vc-transcript::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.vc-transcript::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.vc-msg { margin: 0 0 0.45rem; font-size: 0.9rem; line-height: 1.5; }
.vc-msg:last-child { margin-bottom: 0; }
.vc-msg-user { color: #0f766e; font-weight: 500; }
.vc-msg-assistant {
  color: #1e293b;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
  line-height: 1.55;
}
.vc-msg-system { color: #94a3b8; font-style: italic; }
.vc-msg-hint { font-size: 0.74rem; line-height: 1.35; margin-bottom: 0.3rem; }
.vc-msg-protocol {
  white-space: normal;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
}
.vc-proto-intro {
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 0.4rem;
}
.vc-proto-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.vc-proto-step {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.42rem 0.48rem;
}
.vc-proto-step-title {
  margin: 0 0 0.18rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f766e;
}
.vc-proto-step-list {
  margin: 0;
  padding-left: 1rem;
}
.vc-proto-step-list li {
  margin: 0.08rem 0;
  font-size: 0.75rem;
  color: #1f2937;
  line-height: 1.35;
}

.vc-sequence {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.6rem 0.85rem;
  max-height: 180px;
  overflow-y: auto;
}
.vc-seq-empty {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}
.vc-seq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  color: #0f766e;
  font-size: 0.8rem;
}
.vc-seq-status {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.vc-seq-current,
.vc-seq-target {
  margin: 0.2rem 0;
  font-size: 0.74rem;
  color: #334155;
}
.vc-seq-phases {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}
.vc-seq-phase {
  margin: 0.2rem 0 0.45rem;
  color: #334155;
}
.vc-seq-phase.is-current .vc-seq-phase-title {
  color: #0f766e;
  font-weight: 700;
}
.vc-seq-phase-title { font-size: 0.76rem; font-weight: 600; }
.vc-seq-phase-goal { font-size: 0.72rem; color: #475569; margin-top: 0.1rem; }
.vc-seq-phase-need { font-size: 0.72rem; color: #64748b; margin-top: 0.12rem; }
.vc-seq-list { margin: 0.15rem 0 0; padding-left: 1rem; }
.vc-seq-list li { font-size: 0.72rem; margin: 0.1rem 0; }

/* Waveform animation */
.vc-waveform {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 0.5rem 1rem; height: 36px;
  background: #f8fafc;
}
.vc-bar {
  width: 3px; border-radius: 2px; background: #0f766e;
  animation: vc-wave 1.2s ease-in-out infinite;
}
.vc-bar:nth-child(1) { animation-delay: 0s; height: 6px; }
.vc-bar:nth-child(2) { animation-delay: 0.1s; height: 14px; }
.vc-bar:nth-child(3) { animation-delay: 0.2s; height: 20px; }
.vc-bar:nth-child(4) { animation-delay: 0.15s; height: 24px; }
.vc-bar:nth-child(5) { animation-delay: 0.25s; height: 20px; }
.vc-bar:nth-child(6) { animation-delay: 0.1s; height: 16px; }
.vc-bar:nth-child(7) { animation-delay: 0.2s; height: 10px; }
.vc-bar:nth-child(8) { animation-delay: 0.05s; height: 6px; }
@keyframes vc-wave {
  0%, 100% { transform: scaleY(0.45); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}
/* Waveform only animates when speaking */
.vc-waveform:not(.vc-waveform--active) .vc-bar { animation: none; transform: scaleY(0.3); opacity: 0.25; }

.vc-auto-toggle {
  display: block;
  padding: 0.35rem 1rem 0;
  font-size: 0.76rem;
  color: #475569;
  user-select: none;
}
.vc-auto-toggle input {
  margin-right: 0.35rem;
  vertical-align: middle;
}
.vc-barge-hint {
  margin: 0.2rem 1rem 0;
  font-size: 0.74rem;
  color: #64748b;
}

.vc-voice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem 0.1rem;
}
.vc-voice-row label {
  font-size: 0.76rem;
  color: #475569;
  white-space: nowrap;
}
.vc-voice-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font-size: 0.76rem;
  color: #1e293b;
  background: #fff;
}
.vc-voice-mode {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font-size: 0.76rem;
  color: #1e293b;
  background: #fff;
}

.vc-controls {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem;
  padding: 0.75rem 1rem;
}
.vc-text-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.92rem;
  color: #1e293b;
  background: #fff;
}
.vc-text-input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.16);
}
.vc-mic-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: #0f766e; color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(15,118,110,0.35);
  transition: background 0.12s, transform 0.1s;
}
.vc-mic-btn:hover { background: #0d6560; transform: scale(1.06); }
.vc-mic-btn--active { background: #dc2626 !important; box-shadow: 0 2px 8px rgba(220,38,38,0.4); }
.vc-send-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #0f766e;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.vc-send-btn:hover:not(:disabled) { background: #ccfbf1; color: #0d9488; }
.vc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vc-stop-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.vc-stop-btn:hover:not(:disabled) { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.vc-stop-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.vc-disclaimer {
  margin: 0; padding: 0.5rem 1rem;
  font-size: 0.7rem; color: #94a3b8; text-align: center;
  border-top: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
  .vc-wrapper {
    left: 0.5rem;
    right: 0.5rem;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.35rem);
    align-items: center;
  }
  .vc-wrapper.vc-wrapper--open {
    bottom: env(safe-area-inset-bottom, 0px);
  }
  .vc-wrapper.vc-wrapper--open .vc-float-btn {
    display: none;
  }
  .vc-panel {
    width: calc(100vw - 0.4rem);
    max-width: calc(100vw - 0.4rem);
    height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.25rem);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.25rem);
    border-radius: 12px;
  }
  .vc-panel-header {
    padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
  }
  .vc-transcript {
    min-height: 42dvh;
  }
  .vc-controls {
    padding: 0.65rem 0.8rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    gap: 0.45rem;
  }
  .vc-send-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  .vc-barge-hint {
    margin: 0.15rem 0.8rem 0;
  }
  .vc-msg { font-size: 0.95rem; }
}

/* Отчёт — структурированные блоки с заголовками */
.report-single { margin-top: 0; }
.report-doctor-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 1rem;
}
.report-doctor {
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  color: #1e293b;
}
.report-risk-warning {
  color: #b91c1c;
  font-weight: 700;
}
.report-line { margin: 0.2rem 0; }
.report-bullet { padding-left: 1.1rem; position: relative; }
.report-bullet::before {
  content: "•";
  position: absolute;
  left: 0.2rem;
  color: #334155;
}
.report-empty-line { height: 0.5rem; }
.report-subheading {
  font-weight: 700;
  color: #0f766e;
  margin: 0.8rem 0 0.35rem;
}
.report-table-wrap {
  overflow-x: auto;
  margin: 0.6rem 0 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: auto;
}
.report-table th, .report-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.report-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}
.report-table tr:last-child td { border-bottom: none; }
@media (max-width: 1280px) {
  .report-table th, .report-table td {
    font-size: 0.88rem;
    padding: 0.5rem 0.55rem;
  }
}
.report-actions { margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.report-actions .btn-download { font-size: 0.95rem; }
.report-actions .btn-download:disabled { cursor: not-allowed; }
.report-section .report-content { padding: 0.5rem 0; }
/* Анализы: нижний #reportSection — дубль отчёта для врача (основной выше / в развёрнутом виде). PDF — кнопка в карточке AI. */
#page-labs #reportSection {
  display: none !important;
}
/* Читаемость отчётов в тёмной теме: блоки с белым фоном должны иметь тёмный текст */
body.theme-dark .report-section .report-doctor-heading { color: #0f766e; }
body.theme-dark .report-section .report-content .doctor-details summary { color: #334155; }
body.theme-dark .report-section .report-content .doctor-details pre { color: #0f172a; background: #f8fafc; }
.report-user-blocks { font-size: 0.95rem; line-height: 1.6; }
.report-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.report-block:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.report-block-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.report-block-body {
  margin: 0;
  padding: 0;
}
.report-block-body p { margin: 0.35rem 0 0.5rem; }
.report-block-body p:first-child { margin-top: 0; }
.report-label { font-size: 0.9rem; margin-bottom: 0.25rem !important; }
.report-doc-name { font-size: 0.9rem; margin: 0 0 0.5rem; }
.report-extracted-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 12rem;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.25rem;
}
.report-text-truncated { font-size: 0.85rem; margin-top: 0.35rem; }
.report-list { margin: 0.35rem 0 0; padding-left: 1.25rem; }
.report-list li { margin: 0.35rem 0; }
.report-next { margin-top: 0.5rem; font-weight: 500; }
.report-disclaimer { font-size: 0.85rem; margin-top: 0.5rem; }

/* Microbiome card v1.1 */
.microbiome-card { border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; background: #fff; }
.microbiome-card .axis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.microbiome-card .axis-item { border: 1px solid #eef2f7; border-radius: 12px; padding: 12px; background: #fafafa; }
@media (max-width: 760px) {
  .microbiome-card .axis-grid { grid-template-columns: 1fr; }
}

.ref-smart-route-section {
  border: 1px solid #99f6e4;
  background: linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
}
.ref-smart-route-hint {
  margin: 0 0 0.7rem 0;
  color: #0f766e;
  line-height: 1.45;
}
.ref-smart-route-tests {
  margin: 0 0 0.8rem 0;
  display: grid;
  gap: 0.45rem;
}
.ref-smart-route-test {
  font-size: 0.95rem;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}
.ref-smart-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
body.dark .ref-smart-route-section,
body.theme-dark .ref-smart-route-section {
  border-color: rgba(45, 212, 191, 0.35);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.2) 0%, rgba(30, 41, 59, 0.45) 100%);
}
body.dark .ref-smart-route-hint,
body.theme-dark .ref-smart-route-hint {
  color: #99f6e4;
}
body.dark .ref-smart-route-test,
body.theme-dark .ref-smart-route-test {
  border-color: rgba(153, 246, 228, 0.3);
  background: rgba(15, 23, 42, 0.45);
}

/* Mobile hotfixes: bottom nav mic alignment + labs controls fit */
@media (max-width: 480px) {
  .bottom-nav .nav-item,
  .bottom-nav .nav-item--concierge-slot {
    align-self: center;
    justify-self: center;
    min-width: 0;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
  }
  .bottom-nav .nav-item--concierge-slot .vc-float-btn--in-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    inset: auto;
    transform: none !important;
  }

  .ref-labs-content {
    padding: 0 0.75rem 1.25rem !important;
  }
  .ref-labs-upload-actions {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
    padding: 0 0.75rem 0.85rem !important;
  }
  .ref-labs-quick-btn {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.72rem 0.62rem;
    gap: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: normal;
  }
  .ref-labs-upload-submit-row {
    padding: 0 0.75rem 0.85rem !important;
    flex-wrap: wrap;
  }
  .ref-labs-upload-submit {
    width: 100%;
    text-align: center;
  }
  .ref-labs-tab {
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 0;
    align-items: center;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }
  .bottom-nav .nav-item,
  .bottom-nav .nav-item--concierge-slot {
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0;
  }
  .bottom-nav .nav-item-icon {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
  }
  .bottom-nav .nav-item--concierge-slot .vc-float-btn,
  .bottom-nav .nav-item--concierge-slot .vc-float-btn--in-nav {
    width: 24px;
    height: 24px;
    margin: 0 auto;
  }
}
