/**
 * Общая оболочка: фон, шапка, кнопки. Палитра: #FFA742 #318230 #79CE4B #EFF9E3
 */

:root {
  --color-pale: #eff9e3;
  --color-green-dark: #318230;
  --color-green-mid: #79ce4b;
  --color-accent: #ffa742;

  --shell-bg: var(--color-pale);
  --shell-text: #1a3018;
  --shell-muted: #3d5537;
  --shell-card: #ffffff;
  --shell-border: #c4dfb2;
  --table-header-bg: #dff3d4;
  --row-highlight-bg: #e8f8dc;

  --btn-primary-bg: var(--color-accent);
  --btn-primary-border: #e08620;
  --btn-secondary-bg: var(--color-green-dark);
  --btn-secondary-border: #246622;
  --btn-muted-bg: #d8f0cb;
  --btn-muted-border: #98d078;
  /* Chrome buttons: never square (90°) corners; labels stay inside the box */
  --btn-radius: 10px;
  --btn-radius-sm: 8px;
  --nav-bg: var(--color-green-dark);
  --danger-bg: #b3261e;
  --danger-border: #8c1f19;
  --site-brand-logo-text-gap: 16px;
}

body.site-body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  background: var(--shell-bg);
  color: var(--shell-text);
  line-height: 1.35;
}

html.ui-locale-pending:not(.uzi-locale-ready) .site-shell,
html.ui-locale-pending:not(.uzi-locale-ready) .login-page {
  visibility: hidden;
}

/* Первая загрузка языка на устройстве (пока нет localStorage-кэша бандла) */
.uzi-locale-first-load {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 48, 24, 0.45);
  box-sizing: border-box;
}

.uzi-locale-first-load[hidden] {
  display: none !important;
}

.uzi-locale-first-load-card {
  width: min(420px, 100%);
  background: var(--shell-card, #fff);
  color: var(--shell-text, #1a3018);
  border: 1px solid var(--shell-border, #c4dfb2);
  border-radius: 10px;
  padding: 22px 24px 20px;
  box-shadow: 0 12px 40px rgba(26, 48, 24, 0.18);
}

.uzi-locale-first-load-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.uzi-locale-first-load-body {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--shell-muted, #3d5537);
}

.uzi-locale-first-load-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--btn-muted-bg, #d8f0cb);
  overflow: hidden;
}

.uzi-locale-first-load-bar > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--color-green-dark, #318230);
  animation: uzi-locale-first-load-slide 1.1s ease-in-out infinite;
}

.uzi-locale-first-load--refresh .uzi-locale-first-load-title,
.uzi-locale-first-load--refresh .uzi-locale-first-load-body {
  display: none;
}

.uzi-locale-first-load--refresh .uzi-locale-first-load-card {
  width: min(280px, 72vw);
  padding: 18px 22px 16px;
}

.uzi-locale-first-load--refresh {
  background: rgba(26, 48, 24, 0.28);
}

@keyframes uzi-locale-first-load-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* Резиновый shell: клинические страницы на всю ширину viewport */
.site-shell {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  box-sizing: border-box;
}

/* Общий адаптив сетки измерений (ОБП / мошонка / простата / таз …) */
.site-shell .meas-field input {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .site-shell .meas-row-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell .meas-row-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .template-path-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .adult-pathology-grid-single .path-checkbox-list.path-checkbox-list--column-major {
    grid-template-columns: minmax(0, 1fr);
  }
}

.site-header-wrap {
  background: var(--nav-bg);
  color: #fff;
  box-shadow: 0 1px 4px rgba(49, 130, 48, 0.2);
}

.site-header {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  box-sizing: border-box;
}

.site-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 10px;
  width: 100%;
}

.site-brand {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--site-brand-logo-text-gap);
  font-weight: 700;
  font-size: clamp(14px, 2.2vw, 16px);
  color: #fff;
  text-decoration: none;
  margin-right: 0;
}

.site-brand-logo {
  display: block;
  flex-shrink: 0;
  height: 32px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 3px 8px;
  box-sizing: content-box;
}

.site-brand-text {
  min-width: 0;
  padding-left: 2px;
}

.site-header-temporary-access {
  order: 2;
  flex: 0 0 auto;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #1a3018;
  border: 1px solid rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.site-header-temporary-access-note {
  margin: 6px 0 0;
  padding: 0;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.site-header-temporary-access-mail {
  color: #ffe8c4;
  text-decoration: underline;
}

.site-header-temporary-access-mail:hover {
  color: #fff;
}

.site-brand:hover {
  text-decoration: underline;
}

/* Пункты меню скрыты до /api/me (site-header.js → html.site-nav-ready). */
html:not(.site-nav-ready) .site-nav {
  visibility: hidden;
  pointer-events: none;
}

.site-nav {
  order: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-start;
  box-sizing: border-box;
}

.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px clamp(10px, 1.4vw, 14px);
  border-radius: 10px;
  background: rgba(239, 249, 227, 0.15);
  border: 1px solid rgba(239, 249, 227, 0.35);
  color: #fff !important;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
  max-width: min(280px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.site-nav .nav-link:hover {
  background: rgba(255, 167, 66, 0.35);
  border-color: rgba(255, 167, 66, 0.55);
}

.site-nav-feed-link {
  position: relative;
  padding-right: clamp(12px, 1.8vw, 18px);
}

.site-nav-feed-bell {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.45));
}

.site-nav .nav-link[aria-current="page"] {
  background: var(--color-accent);
  color: #1a1408 !important;
  border-color: #f5c06a;
  font-weight: 700;
}

/*
 * Guest public pages (e.g. /liver-swe): one section chip + brand + locale + login
 * on a single compact row. Class toggled by site-header.js (html.site-guest-public).
 */
@media (min-width: 769px) {
  html.site-guest-public .site-header {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  html.site-guest-public .site-header-row {
    flex-wrap: nowrap;
    row-gap: 0;
    align-items: center;
  }

  html.site-guest-public .site-nav {
    order: 2;
    flex: 0 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  html.site-guest-public .site-nav .nav-link {
    min-height: 32px;
    padding: 4px 12px;
  }

  html.site-guest-public .site-brand-logo {
    height: 26px;
    padding: 2px 6px;
  }
}

/* inline-flex выше перебивает [hidden] на десктопе — «Активность» и «ПЖ» только для админа (site-header.js) */
.site-nav-uni-templates {
  display: contents;
}

.site-nav .nav-link[hidden] {
  display: none !important;
}

.site-header-user {
  order: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 0 0 auto;
  margin-left: 0;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 600;
  color: #eff9e3;
  max-width: 100%;
}

/* Без locale (админка) — user-кластер всё равно справа. */
.site-header-row:not(:has(.site-header-locale)) .site-header-user {
  margin-left: auto;
}

.site-header-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(260px, 42vw);
}

.site-header-locale {
  order: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: clamp(11px, 1.5vw, 13px);
  font-weight: 600;
  color: #eff9e3;
}

.site-header-locale-label {
  display: none;
}

.site-header-locale-select {
  font: inherit;
  font-weight: 600;
  color: #1a3d12;
  background: #eff9e3;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 2px 6px;
  max-width: 9rem;
  cursor: pointer;
}

.site-header-group-name {
  font-size: 12px;
  font-weight: 500;
  color: #d8f0c4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(200px, 38vw);
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  line-height: 1.35;
}

.site-header-device-warn {
  margin: 0;
  padding: 3px 10px 5px;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
  color: #6b4a12;
  background: #fff6df;
  border-bottom: 1px solid #e8d4a8;
}

.feature-dev-notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #b00020;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
}

.feature-dev-notice-dialog {
  max-width: min(420px, calc(100vw - 32px));
  padding: 20px 22px;
  border: 1px solid #ef9a9a;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.feature-dev-notice-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.feature-dev-notice-dialog-text {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: #b00020;
  text-align: center;
}

.feature-dev-notice-dialog-actions {
  display: flex;
  justify-content: center;
}

.feature-dev-notice-dialog-actions button {
  min-height: 40px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #b00020;
  background: #b00020;
  color: #fff;
}

.site-header-logout {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #eff9e3;
  text-decoration: underline;
  cursor: pointer;
}

.site-header-logout:hover {
  color: var(--color-accent);
}

.site-header-login {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #eff9e3;
  text-decoration: underline;
  cursor: pointer;
}

.site-header-login:hover {
  color: var(--color-accent);
}

.settings-snapshots-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  border: 1px solid #dde4ec;
  border-radius: 6px;
}

.settings-snapshots-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f6;
  font-size: 13px;
}

.settings-snapshots-item:last-child {
  border-bottom: none;
}

.settings-snapshots-meta {
  flex: 1;
  min-width: 12em;
  line-height: 1.4;
}

.settings-snapshots-tag {
  font-size: 11px;
  color: #6b7280;
  font-weight: normal;
}

.session-bar.site-session {
  margin: 14px 0 12px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  justify-content: flex-end;
}

.session-bar.site-session .who {
  margin-right: auto;
  color: var(--shell-muted);
}

/* RU-only note above help/reference link lists */
.ru-ref-links-notice {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  opacity: 0.85;
}
.ru-ref-links-notice[hidden] {
  display: none !important;
}

/* Кнопки */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: #1a1408;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-muted {
  background: var(--btn-muted-bg);
  border-color: var(--btn-muted-border);
  color: var(--shell-text);
}

.btn-muted:hover:not(:disabled) {
  background: #cae8b8;
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.06);
}

.shell-field {
  flex: 1 1 200px;
  min-width: 140px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}

.shell-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.shell-hint {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  color: var(--shell-muted);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 768px) {
  :root {
    --site-brand-logo-text-gap: 12px;
  }

  .site-header-wrap {
    position: relative;
    z-index: 1003;
  }

  .site-header-row {
    flex-wrap: nowrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
  }

  .site-brand {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(42vw, 140px);
    margin-right: 0;
    font-size: 13px;
    overflow: hidden;
  }

  .site-brand-logo {
    height: 18px;
    width: auto;
    max-width: 68px;
    padding: 1px 4px;
    object-fit: contain;
  }

  .site-brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav-toggle {
    order: 3;
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 5px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 11px;
    border: 1px solid rgba(239, 249, 227, 0.45);
    border-radius: 10px;
    background: rgba(239, 249, 227, 0.12);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .site-nav-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  .site-nav-toggle-bar {
    display: block;
    height: 3px;
    width: 100%;
    background: #eff9e3;
    border-radius: 1px;
    transition:
      transform 0.18s ease,
      opacity 0.18s ease;
  }

  body.site-nav-drawer-open .site-nav-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  body.site-nav-drawer-open .site-nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  body.site-nav-drawer-open .site-nav-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-header-user {
    order: 5;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 6px 10px;
    max-width: min(220px, 52vw);
  }

  .site-header-locale {
    order: 4;
    margin-left: auto;
  }

  .site-header-user-name {
    max-width: min(100px, 28vw);
  }

  /* На узком экране группа только занимает место в ряду с locale/логином */
  .site-header-group-name {
    display: none;
  }

  .site-nav {
    order: 10;
    position: fixed;
    z-index: 1002;
    left: 0;
    right: 0;
    top: var(--site-header-h, 52px);
    max-height: min(70dvh, calc(100dvh - var(--site-header-h, 52px)));
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 10px 14px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    margin: 0;
    flex: none !important;
    width: auto;
    max-width: none;
    min-width: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform-origin: top center;
    transform: scaleY(0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.16s ease,
      transform 0.16s ease,
      visibility 0.16s;
  }

  body.site-nav-drawer-open .site-nav {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav .nav-link {
    flex: none;
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    box-sizing: border-box;
  }

  body.site-nav-drawer-open {
    overflow: hidden;
  }
}

@media (max-width: 400px) {
  :root {
    --site-brand-logo-text-gap: 8px;
  }

  .site-brand-logo {
    height: 16px;
    max-width: 56px;
    padding: 1px 3px;
  }

  .site-brand {
    max-width: min(38vw, 120px);
    font-size: 12px;
  }
}

.site-nav-toggle {
  order: 3;
  display: none;
}

.site-nav-backdrop {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  right: 0;
  top: var(--site-header-h, 52px);
  bottom: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(20, 35, 18, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.site-nav-drawer-open .site-nav-backdrop {
  display: block;
}

@media (min-width: 769px) {
  body.site-nav-drawer-open {
    overflow: auto;
  }

  body.site-nav-drawer-open .site-nav-backdrop {
    display: none !important;
  }
}

/* Baseline: all shell/main chrome buttons are rounded (page pills/circles override) */
.site-shell button:not(.site-header-logout),
.site-main button {
  border-radius: var(--btn-radius-sm);
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.25;
}

.site-shell .actions button,
.site-shell .norms-save-row button,
.site-shell .presets-row button,
.site-shell #protocolEquipmentPanel button,
.site-shell .row-actions button,
.site-shell .vein-patterns-row button,
.site-shell .vein-pattern-modal-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  border: 1px solid var(--btn-muted-border);
  background: var(--btn-muted-bg);
  color: var(--shell-text);
  box-shadow: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  -webkit-appearance: none;
  appearance: none;
}

/* Clinical pages on .site-main without .site-shell (mamma, universal) */
.site-main .actions button,
.site-main .norms-save-row button,
.site-main .presets-row button,
.site-main #protocolEquipmentPanel button,
.site-main .row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  border: 1px solid var(--btn-muted-border);
  background: var(--btn-muted-bg);
  color: var(--shell-text);
  box-shadow: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  -webkit-appearance: none;
  appearance: none;
}

/* Toolbar fields: same visual height as .actions buttons (min-height 40px) */
.site-shell .actions input:not([type="checkbox"]):not([type="radio"]),
.site-shell .actions select,
.site-shell #protocolEquipmentPanel select,
.site-main .actions input:not([type="checkbox"]):not([type="radio"]),
.site-main .actions select,
.site-main .mamma-protocol-toolbar input:not([type="checkbox"]):not([type="radio"]),
.site-main .mamma-protocol-toolbar select,
.site-main #protocolEquipmentPanel select {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.25;
  border: 1px solid #767676;
  border-radius: var(--btn-radius-sm);
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--shell-text);
  vertical-align: middle;
}

.site-shell .actions select,
.site-shell #protocolEquipmentPanel select,
.site-main .actions select,
.site-main .mamma-protocol-toolbar select,
.site-main #protocolEquipmentPanel select {
  width: auto;
  min-width: 6em;
}

.site-shell .actions button.primary,
.site-shell button.primary,
.site-shell #protocolEquipmentPanel button.primary,
.site-shell .row-actions button.primary,
.site-shell .vein-patterns-row button.primary,
.site-shell .vein-pattern-modal-footer button.primary,
.site-main .actions button.primary,
.site-main button.primary,
.site-main #protocolEquipmentPanel button.primary,
.site-main .row-actions button.primary {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.site-shell .actions button.secondary,
.site-shell button.secondary,
.site-shell #protocolEquipmentPanel button.secondary,
.site-shell .row-actions button.secondary,
.site-shell .vein-patterns-row button.secondary,
.site-shell .vein-pattern-modal-footer button.secondary,
.site-main .actions button.secondary,
.site-main button.secondary,
.site-main #uniPathologyList button.secondary:not(.path-list-btn-delete),
.site-main #protocolEquipmentPanel button.secondary,
.site-main .row-actions button.secondary {
  border: 1px solid var(--btn-secondary-border);
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.site-shell .actions button.secondary:hover:not(:disabled),
.site-shell button.secondary:hover:not(:disabled),
.site-shell #protocolEquipmentPanel button:hover:not(:disabled),
.site-shell .row-actions button:hover:not(:disabled),
.site-shell .vein-patterns-row button:hover:not(:disabled),
.site-shell .vein-pattern-modal-footer button:hover:not(:disabled),
.site-main .actions button.secondary:hover:not(:disabled),
.site-main button.secondary:hover:not(:disabled),
.site-main #uniPathologyList button.secondary:hover:not(:disabled):not(.path-list-btn-delete),
.site-main #protocolEquipmentPanel button:hover:not(:disabled),
.site-main .row-actions button:hover:not(:disabled) {
  filter: brightness(1.06);
}

.site-shell .actions button.primary:hover:not(:disabled),
.site-shell button.primary:hover:not(:disabled),
.site-shell #protocolEquipmentPanel button.primary:hover:not(:disabled),
.site-shell .row-actions button.primary:hover:not(:disabled),
.site-main .actions button.primary:hover:not(:disabled),
.site-main button.primary:hover:not(:disabled),
.site-main #protocolEquipmentPanel button.primary:hover:not(:disabled),
.site-main .row-actions button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.site-shell .actions button:disabled,
.site-shell button:disabled,
.site-shell #protocolEquipmentPanel button:disabled,
.site-shell .row-actions button:disabled,
.site-main .actions button:disabled,
.site-main button:disabled,
.site-main #protocolEquipmentPanel button:disabled,
.site-main .row-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.site-main #uniPathologyList button.secondary:not(.path-list-btn-delete) {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: var(--btn-radius-sm);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
}

.site-main .path-list-btn-edit,
.site-main .edit-path-inline {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.site-main .protocol-panel-build-btn {
  font-weight: 700;
}

/* Патологии: единые кнопки в цветах сайта */
.site-shell #pathologyPanelRoot .actions > button.secondary,
.site-shell #thyroidPathologyPanelRoot .actions > button.secondary,
.site-shell #uniPathologyActions > button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.site-shell #pathologyPanelRoot .path-checkbox-list button.secondary,
.site-shell #pathologyPanelRoot .template-path-col-actions button.secondary,
.site-shell #thyroidPathologyPanelRoot .path-checkbox-list button.secondary,
.site-shell #uniPathologyList button.secondary:not(.path-list-btn-delete) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: var(--btn-radius-sm);
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.site-shell .path-list-btn-edit,
.site-shell .edit-path-inline {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

/* Bilateral pathology side pick (Правая / Левая / Обе) — right column */
.site-shell .path-side-cluster,
#pathologyPanelRoot .path-side-cluster,
#mammaPathologyPanel .path-side-cluster,
.path-checkbox-list .path-side-cluster {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
}
.site-shell .path-side-pick-slot,
#pathologyPanelRoot .path-side-pick-slot,
#mammaPathologyPanel .path-side-pick-slot,
.path-checkbox-list .path-side-pick-slot,
#pathologyPanelRoot .joints-path-side-slot,
#pathologyPanelRoot .bca-intr-path-side-slot {
  flex: 0 0 auto;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
}
.site-shell .path-side-cluster > .path-side-pick-slot,
#pathologyPanelRoot .path-side-cluster > .path-side-pick-slot,
.path-checkbox-list .path-side-cluster > .path-side-pick-slot {
  margin-left: 0;
}
/* Bosniak before side buttons; full label, no ellipsis */
.site-shell .path-bosniak-slot,
#pathologyPanelRoot .path-bosniak-slot,
#mammaPathologyPanel .path-bosniak-slot,
.path-checkbox-list .path-bosniak-slot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 0 4px 0 0;
  min-width: 0;
  white-space: nowrap;
}
.site-shell .path-bosniak-slot[hidden],
#pathologyPanelRoot .path-bosniak-slot[hidden],
#mammaPathologyPanel .path-bosniak-slot[hidden],
.path-checkbox-list .path-bosniak-slot[hidden] {
  display: none !important;
}
.site-shell .path-side-pick,
#pathologyPanelRoot .path-side-pick,
#mammaPathologyPanel .path-side-pick,
.path-checkbox-list .path-side-pick {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  vertical-align: middle;
  border: 1px solid #8fa88f;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.site-shell .path-side-pick--idle,
#pathologyPanelRoot .path-side-pick--idle,
#mammaPathologyPanel .path-side-pick--idle,
.path-checkbox-list .path-side-pick--idle {
  opacity: 0.55;
  filter: grayscale(0.15);
}
.site-shell .path-side-pick-btn,
#pathologyPanelRoot .path-side-pick-btn,
#mammaPathologyPanel .path-side-pick-btn,
.path-checkbox-list .path-side-pick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 2.8em;
  margin: 0;
  padding: 2px 9px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #c5d0c5;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  background: #f4f6f4;
  color: #2a332a;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  transition: background 0.1s ease, color 0.1s ease;
}
.site-shell .path-side-pick-btn:last-child,
#pathologyPanelRoot .path-side-pick-btn:last-child,
#mammaPathologyPanel .path-side-pick-btn:last-child,
.path-checkbox-list .path-side-pick-btn:last-child {
  border-right: 0;
}
.site-shell .path-side-pick-btn:hover,
#pathologyPanelRoot .path-side-pick-btn:hover,
#mammaPathologyPanel .path-side-pick-btn:hover,
.path-checkbox-list .path-side-pick-btn:hover {
  background: #e8eee8;
}
.site-shell .path-side-pick-btn[aria-pressed="true"],
#pathologyPanelRoot .path-side-pick-btn[aria-pressed="true"],
#mammaPathologyPanel .path-side-pick-btn[aria-pressed="true"],
.path-checkbox-list .path-side-pick-btn[aria-pressed="true"] {
  background: #1f5c28;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
  opacity: 1;
}
.site-shell .path-side-pick-btn[aria-pressed="true"]:hover,
#pathologyPanelRoot .path-side-pick-btn[aria-pressed="true"]:hover,
#mammaPathologyPanel .path-side-pick-btn[aria-pressed="true"]:hover,
.path-checkbox-list .path-side-pick-btn[aria-pressed="true"]:hover {
  background: #174820;
  color: #fff;
}

/* Pathology rows: name grows; side pick + bosniak column + actions align */
.site-shell #pathologyPanelRoot .path-checkbox-list [data-pathology-order-row],
.site-shell #mammaPathologyPanel .path-checkbox-list [data-pathology-order-row],
.site-shell #mammaPathologyPanel .mamma-pathology-list [data-pathology-order-row],
.site-shell #uniPathologyList [data-pathology-order-row],
.site-shell .path-checkbox-list [data-pathology-order-row].path-order-row--with-side {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
.site-shell #pathologyPanelRoot .path-checkbox-list [data-pathology-order-row] > label.path-check,
.site-shell #mammaPathologyPanel .path-checkbox-list [data-pathology-order-row] > label.path-check,
.site-shell #mammaPathologyPanel .mamma-pathology-list [data-pathology-order-row] > label.path-check,
.site-shell #uniPathologyList [data-pathology-order-row] > label.path-check,
.site-shell .path-checkbox-list [data-pathology-order-row].path-order-row--with-side > label.path-check {
  flex: 1 1 auto !important;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* No side slot: push edit/actions to the right */
.site-shell #pathologyPanelRoot .path-checkbox-list [data-pathology-order-row] > label.path-check + .path-list-btn-edit,
.site-shell #pathologyPanelRoot .path-checkbox-list [data-pathology-order-row] > label.path-check + .edit-path-inline,
.site-shell #mammaPathologyPanel [data-pathology-order-row] > label.path-check + .path-list-btn-edit,
.site-shell #mammaPathologyPanel [data-pathology-order-row] > label.path-check + .edit-path-inline,
.site-shell #uniPathologyList [data-pathology-order-row] > label.path-check + .path-list-btn-edit,
.site-shell #uniPathologyList [data-pathology-order-row] > label.path-check + .edit-path-inline {
  margin-left: auto;
}

/* Wide screens: two columns when the list is the full-width panel body
   (scrotum, …). Skip lists inside .template-path-col (OBP dual),
   --column-major (already split in JS), and --single-col (joints). */
@media (min-width: 1100px) {
  .site-shell #pathologyPanelRoot > .path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col),
  .site-shell #mammaPathologyPanel > .path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col),
  .site-shell #mammaPathologyPanel > .mamma-pathology-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col),
  .site-shell #uniPathologyList.path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 4px;
    align-content: start;
  }

  .site-shell #pathologyPanelRoot > .path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) > .adult-obp-path-group,
  .site-shell #pathologyPanelRoot > .path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) > [data-pathology-order-row],
  .site-shell #mammaPathologyPanel > .path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) > [data-pathology-order-row],
  .site-shell #mammaPathologyPanel > .mamma-pathology-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) > [data-pathology-order-row],
  .site-shell #uniPathologyList.path-checkbox-list:not(.path-checkbox-list--column-major):not(.path-checkbox-list--single-col) > [data-pathology-order-row] {
    min-width: 0;
  }

  /* Independent columns (expandable groups): avoid row-pair gaps when one side opens. */
  .site-shell #pathologyPanelRoot > .path-checkbox-list.path-checkbox-list--column-major {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 4px;
    align-content: start;
  }

  .site-shell #pathologyPanelRoot > .path-checkbox-list.path-checkbox-list--column-major > .path-checkbox-list-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
}

.site-shell .path-bosniak-opt,
#pathologyPanelRoot .path-bosniak-opt,
#mammaPathologyPanel .path-bosniak-opt,
.path-checkbox-list .path-bosniak-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--shell-muted, #555);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.site-shell .path-bosniak-opt .path-bosniak-opt-input,
#pathologyPanelRoot .path-bosniak-opt .path-bosniak-opt-input,
#mammaPathologyPanel .path-bosniak-opt .path-bosniak-opt-input,
.path-checkbox-list .path-bosniak-opt .path-bosniak-opt-input {
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}

.pathology-side-token-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px dashed var(--btn-muted-border, #c8c8c8);
  border-radius: 8px;
  background: var(--shell-panel-muted, #fafafa);
}
.pathology-side-token-chips__hint {
  font-size: 12px;
  line-height: 1.35;
  color: var(--shell-muted, #555);
}
.pathology-side-token-chips__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pathology-side-token-chips__btn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  border: 1px solid var(--btn-muted-border, #b0b0b0);
  background: #fff;
  color: var(--shell-text, #222);
  cursor: pointer;
}
.pathology-side-token-chips__btn:hover {
  border-color: var(--color-green-mid, #5a9a3a);
}
.pathology-side-token-chips__btn.is-copied {
  border-color: var(--color-green-mid, #5a9a3a);
  background: var(--color-pale, #e8f8dc);
}
.pathology-side-token-chips__legend {
  margin: 8px 0 0;
  padding: 0 0 0 1.1em;
  list-style: disc;
  font-size: 12px;
  line-height: 1.4;
  color: var(--shell-muted, #555);
}
.pathology-side-token-chips__legend-item {
  margin: 0 0 4px;
}
.pathology-side-token-chips__legend-item code {
  font-size: 11px;
  font-weight: 600;
  color: var(--shell-text, #222);
}

/* ↑↓ stay side-by-side even if the pathology row wraps */
.site-shell .path-reorder-pair,
#pathologyPanelRoot .path-reorder-pair,
#thyroidPathologyPanelRoot .path-reorder-pair,
#mammaPathologyPanel .path-reorder-pair,
.path-checkbox-list .path-reorder-pair {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.site-shell .path-list-btn-reorder,
.site-shell .path-list-btn-add-path,
.site-shell .path-list-btn-subgroup,
.site-shell .adult-obp-path-group-toggle,
.site-shell .thyroid-path-group-toggle {
  min-width: 1.75rem;
  padding: 2px 8px !important;
  font-size: 11px !important;
  border-color: var(--btn-muted-border);
  background: var(--btn-muted-bg);
  color: var(--shell-text);
  flex: 0 0 auto;
}

.site-shell .path-list-btn-duplicate {
  min-height: 28px !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  border-color: var(--color-green-mid);
  background: var(--color-pale);
  color: var(--color-green-dark);
}

.site-shell .path-list-btn-delete {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  border-radius: 8px !important;
  border: 1px solid #e8a8a8 !important;
  background: #fff5f5 !important;
  color: var(--danger-bg) !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.site-shell .path-list-btn-delete:hover:not(:disabled) {
  background: #fde8e8 !important;
  border-color: #d88888 !important;
  filter: none;
}

#pathologyEditOverlay .kidney-ref-head button.primary,
#thyroidPathologyEditOverlay .kidney-ref-head button.primary,
#thyroidNoduleZonesOverlay .kidney-ref-head button.primary,
#pathologyEditOverlay .kidney-ref-head #btnPathologyModalSave,
#thyroidNoduleZonesOverlay .kidney-ref-head #btnThyroidNoduleZonesApply,
.site-shell #pathologyEditOverlay .kidney-ref-head button.primary,
.site-shell #thyroidPathologyEditOverlay .kidney-ref-head button.primary,
.site-shell #pathologyEditOverlay .kidney-ref-head #btnPathologyModalSave {
  min-height: 32px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: var(--btn-radius-sm, 8px) !important;
  border: 1px solid var(--btn-primary-border) !important;
  background: var(--btn-primary-bg) !important;
  color: #1a1408 !important;
  box-shadow: none !important;
  filter: none !important;
}

#pathologyEditOverlay .kidney-ref-head button.secondary,
#thyroidPathologyEditOverlay .kidney-ref-head button.secondary,
#thyroidNoduleZonesOverlay .kidney-ref-head button.secondary,
#pathologyEditOverlay .kidney-ref-head #btnPathologyModalClose,
#thyroidNoduleZonesOverlay .kidney-ref-head #btnThyroidNoduleZonesCancel,
.site-shell #pathologyEditOverlay .kidney-ref-head button.secondary,
.site-shell #thyroidPathologyEditOverlay .kidney-ref-head button.secondary,
.site-shell #pathologyEditOverlay .kidney-ref-head #btnPathologyModalClose {
  min-height: 32px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: var(--btn-radius-sm, 8px) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  background: var(--btn-secondary-bg) !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
}

.site-shell .actions button.primary,
.site-shell button.primary {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.site-shell .actions button.secondary,
.site-shell button.secondary {
  border: 1px solid var(--btn-secondary-border);
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.site-shell .actions button.secondary:hover:not(:disabled),
.site-shell button.secondary:hover:not(:disabled),
.site-shell #pathologyPanelRoot .actions > button.secondary:hover:not(:disabled),
.site-shell #thyroidPathologyPanelRoot .actions > button.secondary:hover:not(:disabled),
.site-shell #uniPathologyActions > button.secondary:hover:not(:disabled),
.site-shell #pathologyPanelRoot .path-checkbox-list button.secondary:hover:not(:disabled),
.site-shell #thyroidPathologyPanelRoot .path-checkbox-list button.secondary:hover:not(:disabled),
.site-shell #uniPathologyList button.secondary:hover:not(:disabled):not(.path-list-btn-delete),
.site-shell .path-list-btn-edit:hover:not(:disabled),
.site-shell .edit-path-inline:hover:not(:disabled) {
  filter: brightness(1.06);
}

#pathologyEditOverlay .kidney-ref-head button.primary:hover:not(:disabled),
#thyroidPathologyEditOverlay .kidney-ref-head button.primary:hover:not(:disabled),
#pathologyEditOverlay .kidney-ref-head #btnPathologyModalSave:hover:not(:disabled),
.site-shell #pathologyEditOverlay .kidney-ref-head button.primary:hover:not(:disabled),
.site-shell #thyroidPathologyEditOverlay .kidney-ref-head button.primary:hover:not(:disabled),
.site-shell #pathologyEditOverlay .kidney-ref-head #btnPathologyModalSave:hover:not(:disabled) {
  filter: brightness(1.05);
}

#pathologyEditOverlay .kidney-ref-head button.secondary:hover:not(:disabled),
#thyroidPathologyEditOverlay .kidney-ref-head button.secondary:hover:not(:disabled),
#pathologyEditOverlay .kidney-ref-head #btnPathologyModalClose:hover:not(:disabled),
.site-shell #pathologyEditOverlay .kidney-ref-head button.secondary:hover:not(:disabled),
.site-shell #thyroidPathologyEditOverlay .kidney-ref-head button.secondary:hover:not(:disabled),
.site-shell #pathologyEditOverlay .kidney-ref-head #btnPathologyModalClose:hover:not(:disabled) {
  filter: brightness(1.06);
}

.site-shell .norms-save-row button {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.site-shell button.btn-muted {
  border-color: var(--btn-muted-border);
  background: var(--btn-muted-bg);
  color: var(--shell-text);
}

.site-shell .plaque-chip button,
.site-shell .chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0 4px;
  border: none;
  border-radius: var(--btn-radius-sm);
  background: transparent;
  font-weight: 700;
  line-height: 1;
  color: #a00;
  overflow: hidden;
  box-sizing: border-box;
}

.group-offers-banner {
  margin-bottom: 14px;
  border: 1px solid #c9d4e8;
  border-radius: 10px;
  background: #f3f7ff;
  padding: 12px 14px;
}
.group-offers-banner-inner > strong {
  display: block;
  margin-bottom: 10px;
}
.group-offers-item {
  border-top: 1px solid #dbe4f2;
  padding-top: 10px;
  margin-top: 10px;
}
.group-offers-item:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.group-offers-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.group-offers-meta {
  color: #555;
  font-size: 13px;
}
.group-offers-msg {
  font-size: 13px;
  color: #333;
  margin-bottom: 8px;
}
.group-offers-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.group-offers-actions button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--btn-primary-border, #2d6a4f);
  background: var(--btn-primary-bg, #2d6a4f);
  color: #fff;
}
.group-offers-actions button.ghost {
  background: #fff;
  color: #333;
  border-color: #a0a0a0;
}
.group-offers-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Плавающая кнопка «Сформировать протокол» на страницах шаблонов */
.protocol-floating-build-btn {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  /* Выше модалки первой загрузки языка (10050), иначе кнопка «пропадает» под оверлеем */
  z-index: 10110;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: min(92vw, 22rem);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(49, 130, 48, 0.35);
  border: 1px solid var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.protocol-floating-build-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(49, 130, 48, 0.42);
}

.protocol-floating-build-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.protocol-floating-build-btn.is-busy {
  opacity: 0.72;
  cursor: wait;
}

/* Резервная кнопка в блоке «Итоговый протокол» — всегда доступна */
.protocol-panel-build-btn {
  font-weight: 700;
}

.protocol-panel-build-btn.is-busy {
  opacity: 0.72;
  cursor: wait;
}

/* Модальное окно патологий — единый стиль (оверлей вне .site-shell) */
.kidney-ref-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(26, 48, 24, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: auto;
}

.kidney-ref-overlay[hidden] {
  display: none !important;
}

.kidney-ref-sheet {
  background: var(--shell-card, #fff);
  border: 1px solid var(--shell-border, #c4dfb2);
  border-radius: 12px;
  max-width: min(960px, 100%);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(49, 130, 48, 0.18);
}

.kidney-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--shell-border, #c4dfb2);
  background: linear-gradient(180deg, var(--color-pale, #eff9e3) 0%, #fff 100%);
  border-radius: 12px 12px 0 0;
}

.kidney-ref-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--color-green-dark, #318230);
}

.kidney-ref-scroll {
  overflow: auto;
  padding: 14px 16px;
  flex: 1 1 auto;
  max-height: calc(92vh - 60px);
  background: #fff;
}

.pathology-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Any modal using kidney-ref (incl. outside .site-shell): soft chrome buttons */
.kidney-ref-overlay .kidney-ref-head button,
.kidney-ref-overlay .pathology-modal-head-actions button,
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 16px;
  border-radius: var(--btn-radius, 10px);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--btn-muted-border);
  background: var(--btn-muted-bg);
  color: var(--shell-text);
}

.kidney-ref-overlay .kidney-ref-head button.primary,
.kidney-ref-overlay .pathology-modal-head-actions button.primary,
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button.primary {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.kidney-ref-overlay .kidney-ref-head button.secondary,
.kidney-ref-overlay .pathology-modal-head-actions button.secondary,
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button.secondary {
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.kidney-ref-overlay .kidney-ref-head button.primary:hover:not(:disabled),
.kidney-ref-overlay .pathology-modal-head-actions button.primary:hover:not(:disabled),
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.kidney-ref-overlay .kidney-ref-head button.secondary:hover:not(:disabled),
.kidney-ref-overlay .pathology-modal-head-actions button.secondary:hover:not(:disabled),
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button.secondary:hover:not(:disabled) {
  filter: brightness(1.06);
}

/* Vein pattern modal (dialog outside .site-shell): same chrome as pathology overlays */
.vein-pattern-modal-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 16px;
  border-radius: var(--btn-radius, 10px);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.vein-pattern-modal-footer button.primary {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #1a1408;
}

.vein-pattern-modal-footer button.secondary,
.vein-pattern-modal-footer button:not(.primary) {
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: #fff;
}

.vein-pattern-modal-footer button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.vein-pattern-modal-footer button.secondary:hover:not(:disabled),
.vein-pattern-modal-footer button:not(.primary):hover:not(:disabled) {
  filter: brightness(1.06);
}

.pathology-modal-sticky-name {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--shell-border, #c4dfb2);
  box-shadow: 0 4px 12px rgba(49, 130, 48, 0.08);
}

.pathology-modal-name-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--shell-text, #1a3018);
}

.pathology-modal-name-label input,
.pathology-modal-name-label select,
#pathologyEditOverlay select,
#thyroidPathologyEditOverlay select {
  font-weight: normal;
  padding: 8px 10px;
  border: 1px solid var(--shell-border, #c4dfb2);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--shell-text, #1a3018);
  background: #fff;
}

.pathology-modal-placeholder-scroll {
  max-height: min(52vh, 560px);
  overflow-y: auto;
  border: 1px solid var(--shell-border, #c4dfb2);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  background: var(--color-pale, #eff9e3);
}

.pathology-protocol-fields input[type="text"],
.pathology-protocol-fields textarea {
  font: 14px Arial, Helvetica, sans-serif;
  border: 1px solid var(--shell-border, #c4dfb2);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--shell-text, #1a3018);
  background: #fff;
  padding: 7px 10px;
}

/* Шаблон / без отличия — серый; при focus или отличии — полноценный цвет */
.pathology-protocol-fields input[type="text"]:not(.pathology-ph-edited):not(:focus):not(.pathology-ph-active),
.pathology-protocol-fields textarea:not(.pathology-ph-edited):not(:focus):not(.pathology-ph-active) {
  color: var(--shell-muted, #3d5537);
  opacity: 0.72;
}

.pathology-protocol-fields input[type="text"]:focus,
.pathology-protocol-fields textarea:focus,
.pathology-protocol-fields input[type="text"].pathology-ph-active,
.pathology-protocol-fields textarea.pathology-ph-active,
.pathology-protocol-fields input[type="text"].pathology-ph-edited,
.pathology-protocol-fields textarea.pathology-ph-edited {
  color: var(--shell-text, #1a3018);
  opacity: 1;
}

.pathology-protocol-fields input[type="text"]:not(.pathology-ph-edited)::placeholder,
.pathology-protocol-fields textarea:not(.pathology-ph-edited)::placeholder {
  color: var(--shell-muted, #3d5537);
  opacity: 0.65;
}

.pathology-protocol-fields input[type="text"].pathology-ph-edited,
.pathology-protocol-fields textarea.pathology-ph-edited {
  background: #e8f8dc;
  border-color: var(--color-green-mid, #79ce4b) !important;
  box-shadow: none;
}

#pathologyEditOverlay .pathology-modal-head-actions .primary,
#thyroidPathologyEditOverlay .pathology-modal-head-actions .primary,
#thyroidNoduleZonesOverlay .thyroid-pathology-modal-head-actions .primary,
#fgdsPathologyEditOverlay .pathology-modal-head-actions .primary,
#pathologyEditOverlay #btnPathologyModalSave,
#thyroidPathologyEditOverlay #btnThyroidPathologyModalSave,
#thyroidNoduleZonesOverlay #btnThyroidNoduleZonesApply {
  min-height: 34px;
  padding: 7px 16px;
  border-radius: var(--btn-radius, 10px);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--btn-primary-border) !important;
  background: var(--btn-primary-bg) !important;
  color: #1a1408 !important;
  box-shadow: none !important;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  line-height: 1.25;
}

#pathologyEditOverlay .pathology-modal-head-actions .secondary,
#thyroidPathologyEditOverlay .pathology-modal-head-actions .secondary,
#thyroidNoduleZonesOverlay .thyroid-pathology-modal-head-actions .secondary,
#fgdsPathologyEditOverlay .pathology-modal-head-actions .secondary,
#pathologyEditOverlay #btnPathologyModalClose,
#thyroidPathologyEditOverlay #btnThyroidPathologyModalClose,
#thyroidNoduleZonesOverlay #btnThyroidNoduleZonesCancel {
  min-height: 34px;
  padding: 7px 16px;
  border-radius: var(--btn-radius, 10px);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--btn-secondary-border) !important;
  background: var(--btn-secondary-bg) !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  line-height: 1.25;
}

.pathology-protocol-fields .modal-path-section-title {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-green-dark, #318230);
}

.pathology-protocol-fields .modal-path-section-title strong {
  color: var(--color-green-dark, #318230);
}

/* Блок «Датчики» — одна строка, перед итоговым протоколом */
.protocol-equipment-panel {
  margin-bottom: 14px;
}

#protocolEquipmentPanel .protocol-equipment-title {
  margin: 0 0 8px;
  font-size: 14px;
}

#protocolEquipmentPanel .protocol-equipment-settings-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.35;
}

#protocolEquipmentPanel .protocol-equipment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

#protocolEquipmentPanel .protocol-equipment-apparatus {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex: 0 0 auto;
}

#protocolEquipmentPanel .protocol-equipment-apparatus-label {
  white-space: nowrap;
  font-size: 13px;
}

#protocolEquipmentPanel .protocol-equipment-apparatus-select {
  width: auto;
  min-width: 16ch;
  max-width: none;
  padding: 6px 36px 6px 8px;
  font-size: 13px;
  box-sizing: border-box;
  flex-shrink: 0;
}

#protocolEquipmentPanel .protocol-equipment-sensors {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13px;
  flex: 1 1 auto;
  min-width: 0;
}

#protocolEquipmentPanel .protocol-equipment-sensor-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#protocolEquipmentPanel .protocol-equipment-mode {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.equipment-catalog-editor {
  max-width: 720px;
}

.equipment-catalog-editor--compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equipment-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.equipment-compact-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 14em;
  min-width: 12em;
}

.equipment-compact-select {
  width: 100%;
  min-width: 12em;
  font-weight: 600;
  box-sizing: border-box;
}

.equipment-compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.equipment-show-hidden {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-muted, #666);
  user-select: none;
}

.equipment-sensors-panel {
  border: 1px solid var(--color-border, #d8d8d8);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.equipment-sensors-panel-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.equipment-apparatus-block {
  border: 1px solid var(--color-border, #d8d8d8);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #fff;
}

.equipment-apparatus-summary {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.equipment-apparatus-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.equipment-apparatus-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted, #666);
  white-space: nowrap;
}

.equipment-apparatus-field--model {
  flex: 1 1 12em;
  min-width: 12em;
}

.equipment-apparatus-brand {
  flex: 0 0 auto;
  min-width: 10em;
  max-width: 14em;
  font-weight: 600;
}

.equipment-apparatus-summary::-webkit-details-marker {
  display: none;
}

.equipment-apparatus-name {
  width: 100%;
  min-width: 12em;
  font-weight: 600;
  box-sizing: border-box;
}

.equipment-sensors-list {
  margin: 10px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equipment-sensor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.equipment-sensor-model {
  flex: 1;
  min-width: 10em;
}

.equipment-sensor-type {
  min-width: 12em;
}

.equipment-catalog-actions {
  margin-top: 12px;
}

.protocol-recommended-equipment {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.35;
}

/* Unified «Итоговый протокол» panel + compact chrome (ProtocolPreviewChrome.mount) */
#finalProtocolPanel {
  margin-top: 4px;
}

#finalProtocolPanel > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  padding: 6px 0;
  user-select: none;
}

.protocol-preview-chrome > h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.protocol-preview-chrome-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.35;
}

.protocol-preview-chrome-actions {
  margin-bottom: 8px;
}

/* Dense toolstrip: Build | options | export | more */
.protocol-preview-chrome .ppc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  padding: 6px;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f4 100%);
  border: 1px solid #c9d0d8;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.protocol-preview-chrome .ppc-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  min-height: 40px;
}

.protocol-preview-chrome .ppc-cluster + .ppc-cluster {
  border-left: 1px solid #c9d0d8;
}

.protocol-preview-chrome .ppc-cluster-build:empty,
.protocol-preview-chrome .ppc-cluster-more:empty {
  display: none;
}

.protocol-preview-chrome .ppc-cluster-build {
  flex: 0 0 auto;
  padding-left: 4px;
}

.protocol-preview-chrome .ppc-cluster-opts {
  flex: 1 1 auto;
}

.protocol-preview-chrome .ppc-cluster-export {
  flex: 0 0 auto;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: #c5ccd4;
  border: 1px solid #c5ccd4;
  border-radius: 8px;
  margin: 2px 6px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.protocol-preview-chrome .ppc-cluster-more {
  flex: 0 1 auto;
  border-left: none;
  padding-left: 4px;
}

.protocol-preview-chrome .ppc-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: #5a6570;
}

.protocol-preview-chrome .ppc-inline-lab {
  white-space: nowrap;
  font-weight: 500;
}

.protocol-preview-chrome .ppc-inline-check {
  padding: 0 2px;
  color: #3d4650;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.protocol-preview-chrome .ppc-inline-check input {
  margin: 0;
  accent-color: #c47a1a;
}

/* Compact controls — scoped; do not fight global 40px actions elsewhere */
.protocol-preview-chrome .ppc-bar select {
  min-height: 32px;
  height: 32px;
  padding: 2px 8px;
  font-size: 13px;
  border-radius: 6px;
  border-color: #b6bec8;
  background: #fff;
  min-width: 4.5em;
}

.protocol-preview-chrome .ppc-inline-paste select {
  min-width: 6.5em;
}

.protocol-preview-chrome .ppc-cluster-build .protocol-panel-build-btn,
.protocol-preview-chrome .ppc-cluster-build button {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Segmented export: gap = divider; hidden buttons leave no stub */
.protocol-preview-chrome .ppc-cluster-export .ppc-seg,
.protocol-preview-chrome .ppc-cluster-export button {
  min-height: 32px;
  padding: 5px 11px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #2a3340;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
  white-space: nowrap;
}

.protocol-preview-chrome .ppc-cluster-export .ppc-seg.primary,
.protocol-preview-chrome .ppc-cluster-export button.primary {
  background: #fff4e4;
  color: #1a1408;
}

.protocol-preview-chrome .ppc-cluster-export .ppc-seg:hover:not(:disabled),
.protocol-preview-chrome .ppc-cluster-export button:hover:not(:disabled) {
  background: #f0f3f7;
}

.protocol-preview-chrome .ppc-cluster-export .ppc-seg.primary:hover:not(:disabled),
.protocol-preview-chrome .ppc-cluster-export button.primary:hover:not(:disabled) {
  background: #ffe8c8;
}

.protocol-preview-chrome .ppc-cluster-export .ppc-seg[hidden],
.protocol-preview-chrome .ppc-cluster-export button[hidden] {
  display: none !important;
}

.protocol-preview-chrome .ppc-linkbtn {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #3a6ea5;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  white-space: nowrap;
}

.protocol-preview-chrome .ppc-linkbtn:hover:not(:disabled) {
  background: rgba(58, 110, 165, 0.08);
  color: #2a5680;
}

.protocol-preview-chrome .ppc-linkbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.protocol-preview-chrome-status {
  margin: 0 0 8px;
  min-height: 1.2em;
  font-size: 12.5px;
}

.protocol-preview-frame-wrap {
  border: 1px solid #888;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.protocol-preview-chrome-frame {
  width: 100%;
  min-height: 560px;
  border: 0;
  display: block;
  background: #fff;
  vertical-align: top;
}

.protocol-preview-chrome-include-scheme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 900px) {
  .protocol-preview-chrome .ppc-cluster + .ppc-cluster {
    border-left: 0;
  }

  .protocol-preview-chrome .ppc-cluster-export {
    margin-left: 0;
  }

  .protocol-preview-chrome .ppc-cluster-opts,
  .protocol-preview-chrome .ppc-cluster-export,
  .protocol-preview-chrome .ppc-cluster-more {
    border-top: 1px solid #d5dae0;
    width: 100%;
  }
}

/*
 * Салатовая «Сообщить» справа внутри обводки протокола.
 * Под блоком — запас под fixed «Сформировать».
 */
.protocol-feedback-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
  padding: 6px 8px;
  border-top: 1px solid #ccc;
  background: #f7f7f7;
  position: relative;
  z-index: 2;
}

.protocol-feedback-clearance {
  display: block;
  width: 100%;
  /* Чуть больше высоты fixed «Сформировать» + bottom inset, без большой пустоты */
  height: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  min-height: 60px;
  pointer-events: none;
  flex-shrink: 0;
}

#protocolFeedbackBtn.protocol-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  padding: 4px 12px;
  min-height: 0;
  height: auto;
  max-width: 100%;
  border-radius: var(--btn-radius-sm);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: #c8e86a;
  border: 1px solid #9cc84a;
  color: #2d4a14;
  box-shadow: none;
}

#protocolFeedbackBtn.protocol-feedback-btn:hover {
  background: #bde05a;
  border-color: #8bb83c;
}

#protocolFeedbackBtn.protocol-feedback-btn:focus-visible {
  outline: 2px solid #6a9a28;
  outline-offset: 1px;
}

/*
 * Soft chrome buttons: label stays inside the box.
 * Rectangular tool controls that still used ≤4px / square corners — raise to --btn-radius-sm.
 * Do NOT blanket-override all buttons (pills 999px / circles 50% must stay).
 */
body.site-body button:not(.site-header-logout),
body.site-body .btn,
body.site-body a.btn-link,
body.site-body input[type="button"],
body.site-body input[type="submit"],
body.site-body input[type="reset"],
.kidney-ref-overlay button,
dialog button {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.25;
}

.kidney-ref-overlay .kidney-ref-head button,
.kidney-ref-overlay .pathology-modal-head-actions button,
.kidney-ref-overlay .thyroid-pathology-modal-head-actions button,
#thyroidNoduleZonesOverlay #btnThyroidNoduleZonesApply,
#thyroidNoduleZonesOverlay #btnThyroidNoduleZonesCancel,
.uni-step-btn,
.uni-ph-clone-btn,
.uni-ph-phrase-add-btn,
.uni-ph-phrase-preset-btn,
.uni-ph-phrase-remove-btn,
.uni-phrase-pick-opt,
.uni-fill-choice-seg span,
.fgds-swatch,
.colonoscopy-inflammation-toolbar button,
.colon-lesion-delete-btn,
.btn-add-plaque-char,
.vein-phrase-save,
.vein-pattern-modal-footer button,
.mamma-editor-close,
.mamma-cyst-mode-btn,
.mamma-lesion-card-actions button,
.mamma-exam-sync-actions button,
.mamma-cyst-size-actions button,
.mamma-editor-actions button,
.mamma-depth-actions button,
.mamma-pathology-actions button,
.mamma-companion-confirm-actions button,
.mamma-pathology-dialog .actions button,
#mammaHistVerifyDialog button,
.adult-scope-mp-tablist button,
.leg-phrase-modal-close,
.arm-phrase-modal-close,
.vein-pattern-modal-close,
#protocolFeedbackBtn.protocol-feedback-btn {
  border-radius: var(--btn-radius-sm, 8px) !important;
}
