/* ==========================================================================
   ipr533-unified.css — оформление единой оболочки ИПР-533 (prom.html?mode=ext).

   Работает поверх prod-ext-app.css: расчётная логика не затрагивается,
   меняется только компоновка рабочей области.
   ========================================================================== */

/* ---------- каркас: три колонки ---------- */
body.u533-unified #peWorkspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 1fr) minmax(360px, 460px);
  gap: 12px;
  align-items: start;
}
body.u533-unified #peLeftCol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
}
body.u533-unified #peRightCol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
body.u533-unified .u533__center { min-width: 0; }
body.u533-unified #peViewBody { min-width: 0; }

/* ---------- постоянная сцена ---------- */
body.u533-unified .u533__sceneSection {
  display: block !important;
  border: 1px solid var(--pe-line, #d8dee6);
  border-radius: 10px;
  background: var(--pe-surface, #fff);
  padding: 10px 12px 6px;
  margin-bottom: 0;
}
body.u533-unified .u533__sceneSection .pe__view { display: block !important; }
body.u533-unified .u533__sceneSection h2 { margin-top: 0; }
body.u533-unified .u533__sceneSection #pePlan { max-height: 62vh; }

/* ---------- вкладки представлений ---------- */
body.u533-unified .u533__tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 0 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--pe-line, #d8dee6);
}
body.u533-unified .u533__tab {
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--pe-line, #d8dee6);
  border-radius: 7px;
  background: var(--pe-surface-soft, #f4f6f9);
  color: var(--pe-text, #1d2430);
  cursor: pointer;
}
body.u533-unified .u533__tab:hover { background: var(--pe-accent-soft, #e8f0fe); }
body.u533-unified .u533__tab.is-active {
  background: var(--pe-accent, #1f6feb);
  border-color: var(--pe-accent, #1f6feb);
  color: #fff;
  font-weight: 600;
}
body.u533-unified .u533__tabKey {
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .08);
  opacity: .7;
}
body.u533-unified .u533__tab.is-active .u533__tabKey { background: rgba(255, 255, 255, .25); opacity: .9; }

/* ---------- группы разделов ---------- */
body.u533-unified .u533__group { display: none; }
body.u533-unified .u533__group.is-active { display: block; }
body.u533-unified .u533__group .pe__view { display: block !important; margin-bottom: 16px; }

/* ---------- дерево объектов ---------- */
body.u533-unified .u533__search { padding: 0 2px 6px; }
body.u533-unified .u533__search input {
  font: inherit;
  font-size: 12.5px;
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--pe-line, #d8dee6);
  border-radius: 7px;
  background: var(--pe-surface, #fff);
  color: var(--pe-text, #1d2430);
}
body.u533-unified .u533__grpHead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pe-muted, #6b7684);
  padding: 4px 2px;
  cursor: pointer;
  user-select: none;
}
body.u533-unified .u533__grpChev { font-size: 10px; width: 10px; }
body.u533-unified .u533__grpIco { font-size: 13px; }
body.u533-unified .u533__grpTitle { flex: 1 1 auto; }
body.u533-unified .u533__count {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--pe-surface-soft, #f4f6f9);
  color: var(--pe-muted, #6b7684);
}
body.u533-unified .u533__grp.is-collapsed .u533__node { display: none; }
body.u533-unified .u533__node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  margin: 2px 0;
  border-radius: 7px;
  border-left: 3px solid transparent;
  cursor: pointer;
}
body.u533-unified .u533__node:hover { background: var(--pe-surface-soft, #f4f6f9); }
body.u533-unified .u533__node.is-active {
  background: var(--pe-accent-soft, #e8f0fe);
  border-left-color: var(--pe-accent, #1f6feb);
}
body.u533-unified .u533__node.is-empty { cursor: default; opacity: .75; }
body.u533-unified .u533__node.is-empty:hover { background: transparent; }
body.u533-unified .u533__nodeName { font-size: 12.5px; color: var(--pe-text, #1d2430); }
body.u533-unified .u533__nodeMeta { font-size: 11px; color: var(--pe-muted, #6b7684); }
body.u533-unified .u533__empty { font-size: 12px; color: var(--pe-muted, #6b7684); margin: 4px 0; }

/* ---------- дерево событий ---------- */
body.u533-unified #u533EvtTree .pe__tree { font-size: 11.5px; }
body.u533-unified #u533EvtTree .pe__treeRow { flex-wrap: wrap; }

/* ---------- свойства ---------- */
body.u533-unified .u533__propsTitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 8px;
  color: var(--pe-text, #1d2430);
}
body.u533-unified .u533__mini {
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border: 1px solid var(--pe-line, #d8dee6);
  border-radius: 5px;
  background: var(--pe-surface, #fff);
  color: var(--pe-muted, #6b7684);
  cursor: pointer;
}
body.u533-unified .u533__mini:hover { color: var(--pe-accent, #1f6feb); border-color: var(--pe-accent, #1f6feb); }
body.u533-unified .u533__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
body.u533-unified .u533__field { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
body.u533-unified .u533__fieldLabel {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--pe-muted, #6b7684);
}
body.u533-unified .u533__help {
  font-style: normal;
  font-size: 10px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  background: var(--pe-surface-soft, #f4f6f9);
  color: var(--pe-muted, #6b7684);
  cursor: help;
}
body.u533-unified .u533__field input,
body.u533-unified .u533__field select {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 7px;
  min-height: 32px;
  border: 1px solid var(--pe-line, #d8dee6);
  border-radius: 6px;
  background: var(--pe-surface, #fff);
  color: var(--pe-text, #1d2430);
  width: 100%;
}
body.u533-unified .u533__fieldMsg { font-size: 10.5px; color: #c0392b; }
body.u533-unified .u533__field.is-bad input,
body.u533-unified .u533__field.is-bad select { border-color: #c0392b; }

/* ---------- состояние проекта ---------- */
body.u533-unified .u533__statusList { list-style: none; margin: 0; padding: 0; }
body.u533-unified .u533__statusItem {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 0;
  cursor: pointer;
  color: var(--pe-text, #1d2430);
}
body.u533-unified .u533__statusDot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--pe-muted, #6b7684);
}
body.u533-unified .u533__statusItem.is-crit .u533__statusDot { background: #c0392b; }
body.u533-unified .u533__statusItem.is-warn .u533__statusDot { background: #e0a300; }
body.u533-unified .u533__statusItem.is-info .u533__statusDot { background: #3d8bd4; }
body.u533-unified .u533__ok { font-size: 12px; color: #2e7d32; margin: 4px 0; }
body.u533-unified .u533__saved {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--pe-line, #d8dee6);
  font-size: 11px;
  color: var(--pe-muted, #6b7684);
}

/* ---------- модальное окно справки ---------- */
body.u533-unified .u533__modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 20, 28, .45);
}
body.u533-unified .u533__modalBox {
  max-width: 420px;
  background: var(--pe-surface, #fff);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}
body.u533-unified .u533__modalBox h3 { margin: 0 0 10px; font-size: 16px; }
body.u533-unified .u533__keys { margin: 0 0 14px; padding-left: 18px; font-size: 13px; }
body.u533-unified .u533__keys li { margin: 3px 0; }
body.u533-unified .u533__modalClose {
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: var(--pe-accent, #1f6feb);
  color: #fff;
  cursor: pointer;
}

/* ---------- печать ---------- */
@media print {
  body.u533-unified #peLeftCol,
  body.u533-unified .u533__tabs,
  body.u533-unified #peToolbar { display: none !important; }
  body.u533-unified #peWorkspace { display: block; }
  body.u533-unified .u533__group { display: block !important; }
  body.u533-unified .u533__sceneSection { break-inside: avoid; }
}

/* ---------- адаптив ---------- */
@media (max-width: 1400px) {
  body.u533-unified #peWorkspace {
    grid-template-columns: minmax(250px, 300px) minmax(340px, 1fr) minmax(320px, 400px);
  }
}
@media (max-width: 1100px) {
  body.u533-unified #peWorkspace { grid-template-columns: minmax(240px, 300px) 1fr; }
  body.u533-unified .u533__center { grid-column: 1 / -1; order: -1; }
  body.u533-unified .u533__sceneSection #pePlan { max-height: 46vh; }
}
@media (max-width: 860px) {
  body.u533-unified #peWorkspace { grid-template-columns: 1fr; }
  body.u533-unified .u533__tabs {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--pe-surface, #fff);
    padding-top: 6px;
  }
  body.u533-unified .u533__sceneSection #pePlan { max-height: 42vh; }
  body.u533-unified .u533__grid { grid-template-columns: 1fr; }
  body.u533-unified #peLeftCol .dock { max-height: none; }
}

/* ---------- рабочая область и колонки ---------- */
body.u533-unified .u533__workspace { min-width: 0; }
body.u533-unified .u533__groups { min-width: 0; }
body.u533-unified #peLeftCol .dock { flex: 0 0 auto; }
body.u533-unified #peLeftCol .dock.u533__dock--tree .dock-body { overflow: auto; max-height: 40vh; }
body.u533-unified #peLeftCol .dock.u533__dock--props .dock-body { overflow: auto; max-height: 34vh; }
body.u533-unified #peLeftCol .dock.u533__dock--status .dock-body { overflow: auto; }
body.u533-unified .u533__grp { margin-bottom: 6px; }
body.u533-unified .u533__grpHead { cursor: pointer; user-select: none; }

/* --- сенсорные таргеты: заголовки групп дерева и мини-кнопки >= 32px --- */
body.u533-unified .u533__grpHead { min-height: 32px; }
body.u533-unified .u533__mini { min-width: 32px; min-height: 32px; }
