/* OKKwork — инструменты качественной проверки в шапке */

.okkwork-qc-tools {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

html.okkwork-qc-tools-visible .okkwork-qc-tools:not([hidden]) {
  display: inline-flex;
}

.okkwork-qc-tools[hidden] {
  display: none !important;
}

/* Зарплата в шапке — только Менеджер ОКК и Руководитель ОКК, не администратор */
html.okkwork-header-can-toggle .okkwork-okk-salary,
html:not(.okkwork-okk-salary-visible) .okkwork-okk-salary,
.okkwork-okk-salary[hidden] {
  display: none !important;
}

/*
 * Кластер шапки: в макете left 1084px (справа от поиска, у «Поддержки»).
 * Нельзя писать #129_23 — селектор невалиден. Не растягивать блок влево:
 * фиксированная ширина + right: calc(100% - 1517px) уводила иконки к поиску.
 */
html.okkwork-qc-tools-visible .Pixso-frame-219_2 .Pixso-frame-129_23,
html.okkwork-header-can-toggle .Pixso-frame-219_2 .Pixso-frame-129_23,
html.okkwork-qc-tools-visible [id="129_23"].Pixso-frame-129_23,
html.okkwork-header-can-toggle [id="129_23"].Pixso-frame-129_23 {
  left: 1084px !important;
  right: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
}

html.okkwork-qc-tools-visible .frame-content-129_23,
html.okkwork-header-can-toggle .frame-content-129_23 {
  gap: 10px !important;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: auto !important;
}

/* Дата лицензии в Pixso: position:absolute; left:330px — вне flex-gap. */
html.okkwork-header-panel-admin .Pixso-frame-219_2 .Pixso-frame-129_33,
html.okkwork-header-panel-admin .okkwork-license-countdown,
html.okkwork-header-can-toggle:not(.okkwork-header-panel-work) .Pixso-frame-129_33 {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}

.okkwork-header-panel-toggle {
  box-sizing: border-box;
  display: none;
  width: 28px;
  height: 28px;
  margin: 0 8px 0 0;
  padding: 0;
  border: 1.5px solid #5aa0d6;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

html.okkwork-header-can-toggle .okkwork-header-panel-toggle:not([hidden]) {
  display: inline-flex;
}

.okkwork-header-panel-toggle:hover,
.okkwork-header-panel-toggle:focus-visible {
  background: #d7ecff;
  border-color: #0658a2;
  outline: none;
}

.okkwork-header-panel-toggle__icon {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 2px solid #0658a2;
  border-bottom: 2px solid #0658a2;
  transform: rotate(-45deg);
  margin: 0 0 0 -2px;
}

html.okkwork-header-panel-work .okkwork-header-panel-toggle__icon {
  transform: rotate(135deg);
  margin: 0 0 0 2px;
}

/*
 * Скрыть баланс/лицензию в рабочем режиме.
 * Нельзя писать #129_29 — селектор невалиден, правило целиком отбрасывается.
 * Специфичность выше .Pixso-frame-219_2 .Pixso-frame-129_29 { display:flex !important }.
 */
html.okkwork-header-panel-work .Pixso-frame-219_2 .Pixso-frame-129_29,
html.okkwork-header-panel-work .Pixso-frame-219_2 .Pixso-frame-129_29.okkwork-tooltip-host,
html.okkwork-header-panel-work .Pixso-frame-219_2 [data-okkwork-perm="balance"],
html.okkwork-header-panel-work .Pixso-frame-219_2 .Pixso-frame-129_33,
html.okkwork-header-panel-work .Pixso-frame-219_2 .okkwork-license-countdown,
html.okkwork-header-panel-work [id="129_29"].Pixso-frame-129_29,
html.okkwork-header-panel-work [id="129_33"].okkwork-license-countdown,
.Pixso-frame-219_2 .Pixso-frame-129_29.okkwork-header-panel-off,
.Pixso-frame-219_2 .okkwork-license-countdown.okkwork-header-panel-off,
.Pixso-frame-129_29.okkwork-header-panel-off,
.okkwork-license-countdown.okkwork-header-panel-off {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-width: 0 !important;
  width: 0 !important;
}

.okkwork-qc-tools__btn {
  box-sizing: border-box;
  position: relative;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #5aa0d6;
  border-radius: 8px;
  background: #d7ecff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.okkwork-qc-tools__btn:hover,
.okkwork-qc-tools__btn:focus-visible {
  background: #c5e4ff;
  border-color: #0658a2;
  outline: none;
}

.okkwork-qc-tools__btn--soon,
.okkwork-qc-tools__btn[aria-disabled="true"] {
  cursor: default;
}

.okkwork-qc-tools__btn--soon .okkwork-qc-tools__main,
.okkwork-qc-tools__btn--soon .okkwork-qc-tools__badge,
.okkwork-qc-tools__btn[aria-disabled="true"] .okkwork-qc-tools__main,
.okkwork-qc-tools__btn[aria-disabled="true"] .okkwork-qc-tools__badge {
  opacity: 0.55;
  filter: grayscale(0.12);
}

.okkwork-qc-tools__btn--soon:hover,
.okkwork-qc-tools__btn--soon:focus-visible,
.okkwork-qc-tools__btn[aria-disabled="true"]:hover,
.okkwork-qc-tools__btn[aria-disabled="true"]:focus-visible {
  background: #d7ecff;
  border-color: #5aa0d6;
  outline: none;
}

.okkwork-qc-tools__main {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.okkwork-qc-tools__badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 1px #fff);
}

/* Тизер «Заработная плата ОКК» — высота как у QC-кнопок 36px, уже чтобы не слипаться с «Поддержкой» */
.okkwork-okk-salary {
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  gap: 5px;
  width: max-content;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  margin: 0 0 0 4px;
  padding: 0 8px 0 6px;
  border: 1.5px solid #5aa0d6;
  border-radius: 8px;
  background: #d7ecff;
  box-shadow: none;
  cursor: default;
  flex: 0 0 auto;
  line-height: 1;
  user-select: none;
  overflow: visible;
}

.okkwork-okk-salary:hover,
.okkwork-okk-salary:focus-visible {
  background: #c5e4ff;
  border-color: #0658a2;
  outline: none;
}

.okkwork-okk-salary__rub {
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #0658a2;
  color: #f4fbff;
  font-family: "Rubik", "Rubik-Medium", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.okkwork-okk-salary__texts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.okkwork-okk-salary__title {
  font-family: "Rubik", "Rubik-Medium", sans-serif;
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  color: #3d7ab0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.okkwork-okk-salary__value {
  font-family: "Rubik", "Rubik-Medium", sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #0658a2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.okkwork-okk-salary.okkwork-tooltip-host::after {
  left: 50%;
  z-index: 101650;
}

#okkwork-qc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 101620;
  font-family: "Rubik", "Rubik-Medium", system-ui, sans-serif;
}

#okkwork-qc-modal.is-open {
  display: block;
}

.okkwork-qc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.okkwork-qc-modal__card {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  margin: 6vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(6, 88, 162, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.okkwork-qc-modal__card--wide {
  width: min(980px, calc(100vw - 24px));
  max-height: min(90vh, 860px);
}

.okkwork-qc-modal__card--analysis {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
}

.okkwork-qc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e4eef7;
}

.okkwork-qc-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0658a2;
}

.okkwork-qc-modal__close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #51606c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.okkwork-qc-modal__close:hover {
  background: #eef5fb;
}

.okkwork-qc-modal__body {
  padding: 16px 20px 20px;
  overflow: auto;
  color: #51606c;
  font-size: 14px;
  line-height: 1.45;
}

.okkwork-qc-modal__hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f3f8fd;
  border-radius: 10px;
  color: #3d5a73;
}

.okkwork-qc-modal__drop {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1.5px dashed #8bb8dc;
  border-radius: 10px;
  background: #f7fbff;
  cursor: pointer;
  color: #0658a2;
  font-weight: 500;
  font-size: 13px;
  box-sizing: border-box;
}

.okkwork-qc-modal__drop span,
.okkwork-qc-modal__drop [data-qc-drop-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.okkwork-qc-modal__drop--compact {
  min-height: 36px;
  padding: 5px 10px;
}

.okkwork-qc-modal__drop.is-over {
  background: #e7f3ff;
  border-color: #0658a2;
}

.okkwork-qc-modal__drop.is-busy {
  cursor: wait;
  opacity: 0.72;
  pointer-events: none;
}

.okkwork-qc-modal__drop-name {
  font-weight: 400;
  font-size: 13px;
  color: #3d5a73;
}

.okkwork-qc-modal__file {
  display: none;
}

.okkwork-qc-modal__player {
  width: 100%;
  max-height: 148px;
  margin: 0 0 8px;
  border-radius: 10px;
  background: #0f172a;
}

audio.okkwork-qc-modal__player {
  max-height: none;
  height: 40px;
  background: transparent;
}

.okkwork-qc-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.okkwork-qc-modal__btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: #0658a2;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.okkwork-qc-modal__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.okkwork-qc-modal__btn--ghost {
  background: #e8f2fb;
  color: #0658a2;
}

.okkwork-qc-modal__status {
  margin: 0 0 10px;
  color: #0658a2;
  font-weight: 500;
  font-size: 13px;
}

.okkwork-qc-transcribe {
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: min(62vh, 540px);
}

.okkwork-qc-transcribe__media {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-right: 4px;
}

.okkwork-qc-transcribe__media .okkwork-qc-modal__toolbar {
  margin: 0;
}

.okkwork-qc-transcribe__media .okkwork-qc-analysis__side {
  max-height: min(38vh, 280px);
  overflow: auto;
}

.okkwork-qc-transcribe__media .okkwork-qc-analysis__id,
.okkwork-qc-transcribe__media .okkwork-qc-analysis__summary {
  margin-bottom: 10px;
}

.okkwork-qc-transcribe__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.okkwork-qc-transcribe__empty {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed #c9dcea;
  border-radius: 12px;
  background: #fbfcfe;
  color: #64748b;
  font-size: 14px;
}

.okkwork-qc-analysis {
  display: contents;
}

.okkwork-qc-analysis__side {
  padding: 8px 2px 4px;
  border: 0;
  min-width: 0;
}

.okkwork-qc-analysis__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}

.okkwork-qc-analysis__id {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

.okkwork-qc-analysis__h {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.okkwork-qc-analysis__summary {
  margin: 0 0 18px;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.okkwork-qc-analysis__qa {
  margin: 0;
  padding: 0 0 0 18px;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.okkwork-qc-analysis__qa li + li {
  margin-top: 8px;
}

.okkwork-qc-analysis__qa strong {
  color: #0f172a;
}

.okkwork-qc-analysis__chat-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.okkwork-qc-modal__transcript {
  border: 1px solid #d7e6f2;
  border-radius: 12px;
  min-height: 180px;
  max-height: 340px;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
}

.okkwork-qc-chat {
  flex: 1;
  min-height: min(52vh, 420px);
  max-height: min(68vh, 620px);
  padding: 12px 10px 14px;
  background: #fbfcfe;
}

.okkwork-qc-chat__row {
  display: flex;
  margin: 10px 0 0;
}

.okkwork-qc-chat__row:first-child {
  margin-top: 0;
}

.okkwork-qc-chat__row--same {
  margin-top: 4px;
}

.okkwork-qc-chat__row--them {
  justify-content: flex-start;
}

.okkwork-qc-chat__row--me {
  justify-content: flex-end;
}

.okkwork-qc-chat__bubble {
  max-width: 78%;
  padding: 8px 12px 10px;
  border-radius: 14px;
  box-sizing: border-box;
}

.okkwork-qc-chat__row--them .okkwork-qc-chat__bubble {
  background: #f2f2f2;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

.okkwork-qc-chat__row--me .okkwork-qc-chat__bubble {
  background: #e8f4fd;
  border: 1px solid #b7d4ee;
  border-bottom-right-radius: 6px;
}

.okkwork-qc-chat__meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0658a2;
  margin-bottom: 4px;
}

.okkwork-qc-chat__text,
.okkwork-qc-seg__text {
  margin: 0;
  white-space: pre-wrap;
  outline: none;
  min-height: 1.4em;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.4;
}

.okkwork-qc-seg {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6fafd;
}

.okkwork-qc-seg__meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0658a2;
  margin-bottom: 4px;
}

@media (max-width: 820px) {
  .okkwork-qc-transcribe {
    grid-template-columns: 1fr;
  }
  .okkwork-qc-analysis {
    grid-template-columns: 1fr;
  }
  .okkwork-qc-analysis__side {
    border-right: 0;
    border-bottom: 1px solid #e4eef7;
    padding: 0 0 12px;
  }
}

.okkwork-qc-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.okkwork-qc-modal__field input,
.okkwork-qc-modal__field textarea {
  border: 1px solid #c9dcea;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  color: #334155;
}

.okkwork-qc-modal__field textarea {
  min-height: 88px;
  resize: vertical;
}

.okkwork-qc-modal__warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff4e8;
  border-radius: 10px;
  color: #8a4b12;
}

.okkwork-qc-modal__ok {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #e8f8ee;
  border-radius: 10px;
  color: #166534;
}

.okkwork-qc-pop {
  position: absolute;
  z-index: 2;
  display: none;
  padding: 8px;
  background: #fff;
  border: 1px solid #c9dcea;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.okkwork-qc-pop.is-open {
  display: flex;
  gap: 8px;
  align-items: center;
}

.okkwork-qc-pop input {
  width: 88px;
  border: 1px solid #c9dcea;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.okkwork-qc-fill {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 420px;
  border: 1px solid #e4eef7;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.okkwork-qc-fill__side {
  display: flex;
  flex-direction: column;
  background: #f7fbff;
  border-right: 1px solid #e4eef7;
}

.okkwork-qc-fill__side-title {
  margin: 0;
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.okkwork-qc-fill__list {
  flex: 1;
  overflow: auto;
  padding: 4px 8px 8px;
}

.okkwork-qc-fill__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #334155;
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.okkwork-qc-fill__item.is-active {
  background: #e7f3ff;
  color: #0658a2;
  font-weight: 600;
}

.okkwork-qc-fill__side-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e4eef7;
}

.okkwork-qc-fill__link {
  border: 0;
  background: transparent;
  color: #0658a2;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.okkwork-qc-fill__main {
  padding: 16px 18px 18px;
  overflow: auto;
}

.okkwork-qc-fill__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.okkwork-qc-fill__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #334155;
}

.okkwork-qc-fill__main .okkwork-qc-modal__field textarea {
  min-height: 140px;
}

@media (max-width: 720px) {
  .okkwork-qc-fill {
    grid-template-columns: 1fr;
  }
  .okkwork-qc-fill__side {
    border-right: 0;
    border-bottom: 1px solid #e4eef7;
    max-height: 180px;
  }
}
