/* ═══════════════════════════════════════════
   Оргструктура: «Река», «Требует внимания», подсказка
   Шрифты не объявляем — наследуются от страницы.
   ═══════════════════════════════════════════ */

#screen-org {
  --ov-ink2: var(--muted);
  --ov-muted: var(--muted);        /* подписи не светлее этого */
  --ov-line: var(--line-strong);
  --ov-warn: var(--accent);
  --ov-warn-ink: var(--accent);
  --ov-warn-bg: var(--tint-accent);
  --ov-warn-line: var(--tint-accent);
}

/* шапка экрана */
.ov-titlebox { min-width: 0; }
.ov-meta { margin-top: 6px; font-size: 14px; color: var(--ov-muted); line-height: 1.4; }
.ov-meta b { color: var(--ink); font-weight: 600; }
.ov-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin-right: 5px; vertical-align: -1px; }
.ov-key.is-out { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
#org-source { max-width: 100%; }
#org-filters:empty { display: none; }

/* панель над схемой */
.ov-bar {
  position: sticky; top: var(--header-h, 56px); z-index: 20;
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 10px 0; margin-bottom: 6px;
  background: var(--bg); border-bottom: 1px solid var(--ov-line);
}
.ov-attn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.ov-attn-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ov-warn-ink); margin-right: 4px; }
.ov-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; line-height: 1.2;
  color: var(--ov-warn-ink); background: var(--ov-warn-bg); border: 1px solid var(--ov-warn-line);
  transition: background .15s, border-color .15s, color .15s;
}
.ov-chip b { font-weight: 700; }
.ov-chip:hover { border-color: var(--ov-warn-ink); }
.ov-chip.is-on { background: var(--ui-seg-active-bg, var(--accent)); border-color: transparent; color: var(--ui-seg-active-text, var(--ui-accent-text)); }
.ov-chip:focus-visible, .ov-zoom button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-attn.is-ok { color: var(--ok); font-size: 13px; }
.ov-zoom { display: inline-flex; align-items: stretch; margin-left: auto; background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ov-zoom button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 9px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.ov-zoom button:hover { background: var(--bg); }
.ov-zoom [data-zoom="reset"] { min-width: 54px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.ov-empty { padding: 40px 0; text-align: center; color: var(--ov-muted); font-size: 14px; }

/* «Река» на широком экране */
.ov-scroll { overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; padding-bottom: 8px; }
.ov-scroll.is-pan { cursor: grab; }
.ov-scroll.is-panning { cursor: grabbing; user-select: none; }
.ov-svg { display: block; margin: 0 auto; }
.ov-svg text { pointer-events: none; }
.ov-svg .ov-ref text, .ov-svg .ov-p text { pointer-events: auto; }

.ov-link { fill: none; transition: stroke-opacity .2s, stroke-width .2s; }
.ov-l1 { stroke: var(--ink); stroke-opacity: .22; stroke-width: 1.4; }
.ov-l2 { stroke-opacity: .55; stroke-width: 1.5; }
.ov-l3 { stroke-opacity: .45; stroke-width: 1.2; }
.ov-link.is-dash { stroke-dasharray: 4 4; }
.ov-link.is-dot { stroke-dasharray: 2 3; stroke-opacity: .35; }

.ov-card, .ov-sub, .ov-unit { transition: opacity .2s; }
.ov-card-bg { fill: var(--white); stroke: var(--ov-line); stroke-width: 1; transition: stroke .2s, stroke-width .2s; }
.ov-card.is-outside .ov-card-bg { fill: transparent; stroke-dasharray: 4 4; stroke: var(--line-strong); }
.ov-sub-bg { fill: transparent; stroke: none; transition: fill .2s; }

.ov-t-dept { font-size: 13.5px; font-weight: 600; fill: var(--ink); }
.ov-t-head { font-size: 12px; fill: var(--ov-ink2); }
.ov-t-warn { font-size: 12px; fill: var(--ov-warn); }
.ov-t-cnt { font-size: 11px; fill: var(--ov-muted); }
.ov-t-sub { font-size: 13px; font-weight: 500; fill: var(--ink); }
.ov-t-head2 { font-size: 11.2px; fill: var(--ov-ink2); }
.ov-t-cnt2 { font-size: 11.2px; fill: var(--ov-muted); }
.ov-t-unit { font-size: 12px; fill: var(--ov-ink2); }
.ov-root-bg { fill: var(--inv-bg); }
.ov-stage-bg { fill: var(--inv-bg); }
.ov-stage-floor { stroke: var(--line-strong); stroke-width: 2; }
.ov-t-root { font-size: 15px; font-weight: 700; fill: var(--inv-fg); }
.ov-t-rootname { font-size: 12.5px; font-weight: 600; fill: var(--inv-fg); }
.ov-t-rootsub { font-size: 11px; fill: var(--inv-muted); }
.ov-t-rootwarn { font-size: 12px; fill: var(--accent); }
.ov-t-rootset { font-size: 12.5px; font-weight: 600; fill: var(--inv-fg); text-decoration: underline; }
/* узел без своего руководителя: серым — кто руководит выше («через отдел: Имя») */
.ov-t-via { font-size: 11.2px; fill: var(--ov-muted); }
.ov-t-vianame { fill: var(--ov-ink2); }
.ov-t-u2 { font-size: 10.8px; }
.ov-ref:hover .ov-t-vianame { text-decoration: underline; }

/* назначить руководителя на схеме: только у того, кто правит структуру (data-ov-head) */
.ov-svg .ov-headset text { pointer-events: auto; }
.ov-headset { cursor: pointer; }
.ov-headset:focus { outline: none; }
.ov-headset:hover .ov-t-warn, .ov-headset:focus-visible .ov-t-warn,
.ov-headset:focus-visible .ov-t-head, .ov-headset:focus-visible .ov-t-head2, .ov-headset:focus-visible .ov-t-vianame { text-decoration: underline; }
.ov-headset:focus-visible .ov-t-warn, .ov-headset:focus-visible .ov-t-via { fill: var(--accent); }
.ov-root.ov-headset .ov-root-bg { transition: fill .15s; }
.ov-root.ov-headset:hover .ov-root-bg { fill: color-mix(in srgb, var(--inv-bg) 88%, var(--inv-fg)); }
.ov-root.ov-headset:focus-visible .ov-root-bg { stroke: var(--accent); stroke-width: 3; }
.ov-stage.ov-headset:hover .ov-stage-cap { fill: var(--inv-fg); }
.ov-stage.ov-headset:focus-visible > path:first-child { stroke: var(--accent); stroke-width: 3; }

.ov-p, .ov-ref { cursor: pointer; }
.ov-p { transition: opacity .2s; }
.ov-p:focus, .ov-ref:focus { outline: none; }
.ov-p-head { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.ov-p-ring { fill: none; stroke: var(--ink); stroke-width: 2.4; opacity: 0; transition: opacity .2s; }
.ov-p:hover .ov-p-ring { opacity: .35; }
.ov-p.is-hit .ov-p-ring { opacity: 1; }
.ov-p:focus-visible .ov-p-ring, .ov-ref:focus-visible .ov-p-ring { opacity: 1; stroke: var(--accent); }
.ov-ref:hover .ov-t-head, .ov-ref:hover .ov-t-head2 { text-decoration: underline; }

/* подсветка: найденное и путь к нему ярко, остальное приглушено */
.ov-hl .ov-p:not(.is-hit) { opacity: .26; }
.ov-hl .ov-p.is-soft, .ov-hl .ov-ref .ov-p, .ov-hl .ov-v-ref .ov-p, .ov-hl .ov-hv-ref .ov-p { opacity: 1; }
.ov-hl .ov-card:not(.is-lit), .ov-hl .ov-sub:not(.is-lit), .ov-hl .ov-unit:not(.is-lit) { opacity: .45; }
.ov-hl .ov-link { stroke-opacity: .12; }
.ov-hl .ov-link.is-lit { stroke-opacity: 1; stroke-width: 2.2; }
.ov-hl .ov-l1.is-lit { stroke-opacity: .85; stroke-width: 2; }
.ov-card.is-lit .ov-card-bg { stroke: var(--ink); stroke-width: 1.6; }
.ov-card.is-target .ov-card-bg { stroke: var(--ov-warn); stroke-width: 2.2; }
.ov-sub.is-target .ov-sub-bg { fill: var(--ov-warn-bg); stroke: var(--ov-warn); stroke-width: 1.2; }

/* найденные заметны при любом масштабе: кольцо постоянного размера на экране (радиус ставит ovSyncHalos); трижды мигает и остаётся */
.ov-p-halo { fill: none; stroke: var(--accent); pointer-events: none; animation: ov-halo 1.1s ease-in-out 3; }
@keyframes ov-halo { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes ov-halo-box { 50% { outline-offset: 7px; } }

/* поиск ничего не нашёл: сообщение в липкой панели над схемой */
.ov-nomatch {
  flex: 0 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 8px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4;
  color: var(--ov-warn-ink); background: var(--ov-warn-bg); border: 1px solid var(--ov-warn-line);
}
.ov-nomatch[hidden] { display: none; }
.ov-nomatch-reset {
  margin-left: auto; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--ov-warn-ink); background: transparent; border: 1px solid var(--ov-warn-ink);
}
.ov-nomatch-reset:hover { background: var(--ov-warn-ink); color: var(--on-color); }
.ov-nomatch-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* «Река» на узком экране: дерево сверху вниз */
.ov-v { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.ov-v-root { background: var(--inv-bg); color: var(--inv-fg); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ov-v-root-title { font-size: 15px; font-weight: 700; }
.ov-v-rootpos, .ov-v-rootcnt { font-size: 12px; color: var(--inv-muted); }
.ov-v-root .ov-v-refname { color: var(--inv-fg); font-weight: 600; }
.ov-v-rootwarn { font-size: 13px; color: var(--accent); }
.ov-v-rootset { align-self: flex-start; min-height: 32px; padding: 4px 12px; border: 1px solid color-mix(in srgb, var(--inv-fg) 50%, transparent); border-radius: 8px; background: transparent; color: var(--inv-fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ov-v-rootset:hover { border-color: var(--inv-fg); }
.ov-v-rootset:focus-visible, .ov-v-set:focus-visible, .ov-hv-set:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-v-via { color: var(--ov-muted); }
.ov-v-via .ov-v-refname { color: var(--ov-ink2); }
.ov-v-set { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ov-warn); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ov-v-card { background: var(--white); border: 1px solid var(--ov-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; transition: opacity .2s, border-color .2s, box-shadow .2s; }
.ov-v-dept.is-outside .ov-v-card { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.ov-v-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.ov-v-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.ov-v-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-v-warn { font-size: 13px; color: var(--ov-warn); }
.ov-v-cnt { font-size: 12px; color: var(--ov-muted); }
.ov-v-kids { margin: 8px 0 0 14px; padding-left: 14px; border-left: 2px solid var(--c-soft); display: flex; flex-direction: column; gap: 12px; }
.ov-v-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 2px 6px; margin: 0 -6px; border-radius: 8px; transition: opacity .2s, background .2s; }
.ov-v-sname { font-size: 14px; font-weight: 500; }
.ov-v-uname { font-size: 13px; color: var(--ov-ink2); }
.ov-v-meta { font-size: 12px; color: var(--ov-muted); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ov-v-unit { margin-left: 2px; padding-left: 12px; border-left: 1.5px dashed var(--c-soft); }
.ov-v-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ov-v-ref { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--ov-ink2); text-align: left; }
.ov-v-meta .ov-v-ref { font-size: 12px; }
.ov-v-ref:hover .ov-v-refname { text-decoration: underline; }
.ov-v-ref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.ov-c {
  width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1;
  background: var(--c); color: var(--fg, var(--on-color)); cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
}
.ov-c.is-out { background: var(--white); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.ov-c.is-head { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.ov-c.is-out.is-head { box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.ov-c.is-mini { width: 22px; height: 22px; font-size: 9px; cursor: inherit; }
.ov-c.is-hit { outline: 2.5px solid var(--ink); outline-offset: 2px; animation: ov-halo-box 1.1s ease-in-out 3; }
.ov-c:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.ov-hl .ov-v-card:not(.is-lit), .ov-hl .ov-v-label:not(.is-lit) { opacity: .45; }
.ov-v-card.is-lit { border-color: var(--ink); }
.ov-v-card.is-target { border-color: var(--ov-warn); box-shadow: 0 0 0 1px var(--ov-warn); }
.ov-v-label.is-target { background: var(--ov-warn-bg); box-shadow: inset 0 0 0 1px var(--ov-warn); }

/* переключатель «Река / Зал» */
.ov-views { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.ov-view {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ov-ink2);
}
.ov-view:hover { color: var(--ink); }
.ov-view.is-on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px var(--shadow-c); }
.ov-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* «Зал» на широком экране */
.ov-hrow { fill: none; stroke-opacity: .1; stroke-linecap: round; transition: stroke-opacity .2s; }
.ov-hl .ov-hrow:not(.is-lit) { stroke-opacity: .04; }
.ov-hlabel { font-size: 11.2px; font-weight: 600; letter-spacing: .06em; transition: opacity .2s; }
.ov-hl .ov-hlabel:not(.is-lit) { opacity: .4; }
.ov-hlabel.is-target { text-decoration: underline; }
.ov-stage-cap { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; fill: var(--inv-muted); }
.ov-stage-name { font-weight: 600; fill: var(--inv-fg); }
.ov-stage-pos { fill: var(--inv-muted); }
.ov-stage-sum { font-size: 11.5px; fill: var(--inv-muted); }
.ov-stage-warn { font-size: 13.5px; fill: var(--accent); }
.ov-stage-set { font-size: 13px; font-weight: 600; fill: var(--inv-fg); text-decoration: underline; }
.ov-stage-name.is-hit { fill: var(--accent); text-decoration: underline; }
.ov-ref:hover .ov-stage-name { text-decoration: underline; }
.ov-hall-note { max-width: 640px; margin: 6px auto 0; text-align: center; font-size: 12.5px; line-height: 1.45; color: var(--ov-muted); }

/* «Зал» на узком экране: сцена сверху, отделы — рядами кресел */
.ov-hv { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.ov-hv-stage {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 16px; border-radius: 120px 120px 12px 12px / 60px 60px 12px 12px;
  background: var(--inv-bg); color: var(--inv-fg);
}
.ov-hv-cap { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--inv-muted); }
.ov-hv-ref { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.ov-hv-ref .ov-stage-name { font-size: 15px; color: var(--inv-fg); }
.ov-hv-ref .ov-stage-name.is-hit { color: var(--accent); text-decoration: underline; }
.ov-hv-ref:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ov-hv-pos { font-size: 12px; color: var(--inv-muted); }
.ov-hv-sum { font-size: 12px; color: var(--inv-muted); }
.ov-hv-warn { font-size: 14px; color: var(--accent); }
.ov-hv-set { min-height: 32px; padding: 4px 14px; border: 1px solid color-mix(in srgb, var(--inv-fg) 50%, transparent); border-radius: 8px; background: transparent; color: var(--inv-fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ov-hv-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; transition: opacity .2s; }
.ov-hv-title.is-target { text-decoration: underline; }
.ov-hv-seats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; padding: 8px; border-radius: 12px; background: var(--c-band); }
.ov-hv-seats .ov-c { width: 30px; height: 30px; font-size: 10.5px; }
.ov-hv-gap { width: 30px; height: 30px; flex: none; }
.ov-hl .ov-hv-title:not(.is-lit) { opacity: .45; }

/* мини-профиль: по наведению с задержкой, на телефоне — по тапу; внутри кнопки */
.ov-tip {
  position: fixed; z-index: 150; left: 0; top: 0; width: 300px; max-width: calc(100vw - 16px);
  padding: 11px 12px 10px; border-radius: 12px;
  background: var(--white); border: 1px solid var(--ov-line, var(--border));
  box-shadow: 0 10px 30px var(--shadow-c), 0 2px 6px var(--shadow-c);
  font-size: 12.5px; line-height: 1.4; color: var(--muted);
  opacity: 0; visibility: hidden; transform: translateY(2px);
  transition: opacity .15s, transform .15s, visibility 0s linear .15s;
}
.ov-tip.show { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s; }
.ov-tip-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.ov-tip-pos { margin-top: 1px; }
.ov-tip-lead { color: var(--muted); margin-top: 2px; }
.ov-tip-rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ov-line, var(--border)); }
.ov-tip-row { display: contents; }
.ov-tip-k { color: var(--muted); }
.ov-tip-v { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ov-tip-v .ic { vertical-align: -1px; margin: 0 2px; color: var(--muted); }
.ov-tip-muted { color: var(--muted); }
.ov-tip-warn { color: var(--accent); }
.ov-tip-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.ov-tip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 12.5px; line-height: 1.2; color: var(--ink); text-decoration: none;
  background: var(--bg); border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.ov-tip-btn:hover { background: var(--white); border-color: var(--ink); }
.ov-tip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ov-tip-btn .ic { color: var(--muted); }

/* выгрузка: PNG и печать */
.ov-tools { display: inline-flex; gap: 6px; }
.ov-tool {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--ink); background: var(--white); border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.ov-tool:hover { border-color: var(--ink); }
.ov-tool:focus-visible, .ov-mark:focus-visible, .ov-focus-exit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* «Подсветить» */
.ov-marks { flex: 0 0 100%; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.ov-marks-title { font-size: 13px; font-weight: 600; color: var(--ov-ink2); }
.ov-marks-row { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ov-marks-row::-webkit-scrollbar { display: none; }
.ov-mark {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ov-ink2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.ov-mark b { font-weight: 600; color: var(--ov-muted); font-variant-numeric: tabular-nums; }
.ov-mark:hover { color: var(--ink); }
.ov-mark.is-on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px var(--shadow-c); }
.ov-mark.is-on b { color: var(--ink); }
.ov-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ov-muted); }
.ov-legend b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.ov-lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ov-lg.is-staff { background: var(--ov-mk-staff); }
.ov-lg.is-out { background: var(--ov-mk-out); }

/* «Штат и аутсорс»: два цвета, никого не гасим */
#screen-org { --ov-mk-staff: var(--info); --ov-mk-out: var(--warn); }
.ov-mt g.ov-p.mk-staff > circle:not(.ov-p-head):not(.ov-p-ring):not(.ov-p-halo) { fill: var(--ov-mk-staff); stroke: none; }
.ov-mt g.ov-p.mk-out > circle:not(.ov-p-head):not(.ov-p-ring):not(.ov-p-halo) { fill: var(--ov-mk-out); stroke: none; }
.ov-mt g.ov-p.mk-staff > text, .ov-mt g.ov-p.mk-out > text { fill: var(--on-color); }
.ov-mt .ov-c.mk-staff { background: var(--ov-mk-staff); color: var(--on-color); }
.ov-mt .ov-c.mk-out { background: var(--ov-mk-out); color: var(--on-color); box-shadow: none; }
.ov-mt .ov-c.mk-out.is-head { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.ov-mt .ov-p circle, .ov-mt .ov-c { transition: fill .15s, background .15s; }

/* фокус на человеке: он сам — кольцо цвета акцента */
.ov-p.is-focus .ov-p-ring { opacity: 1; stroke: var(--accent); stroke-width: 3; }
.ov-c.is-focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.ov-stage-name.is-focus, .ov-hv-ref .ov-stage-name.is-focus { fill: var(--accent); color: var(--accent); }
.ov-focusbar {
  flex: 0 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  padding: 7px 8px 7px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  background: var(--inv-bg); color: var(--inv-muted);
}
.ov-focusbar[hidden] { display: none; }
.ov-focus-title b { color: var(--inv-fg); font-weight: 600; }
.ov-focus-meta { color: var(--inv-muted); min-width: 0; flex: 1; }
.ov-focus-exit {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 6px 4px 11px; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--inv-fg); background: color-mix(in srgb, var(--inv-fg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--on-color) 28%, transparent);
}
.ov-focus-exit:hover { background: color-mix(in srgb, var(--inv-fg) 16%, transparent); }
.ov-focus-exit kbd { font: inherit; font-size: 11px; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--inv-fg) 14%, transparent); color: var(--inv-muted); }

/* печать: только схема и заголовок; включается классом на время печати (ovPrint) */
@media print {
  body.ov-printing { background: #fff; } /* ui-kit-allow: печать остаётся светлой */
  body.ov-printing > *:not(#screen-org) { display: none !important; }
  body.ov-printing #screen-org { display: block !important; padding: 0 !important; margin: 0 !important; }
  body.ov-printing #screen-org .screen-actions, body.ov-printing #org-filters, body.ov-printing .ov-bar,
  body.ov-printing .ov-tip, body.ov-printing .ov-hall-note { display: none !important; }
  body.ov-printing .ov-scroll { overflow: visible !important; }
  body.ov-printing .ov-svg { width: 100% !important; height: auto !important; }
  body.ov-printing #screen-org * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.ov-printing .ov-p-halo, body.ov-printing .ov-c.is-hit { animation: none; }
}

@media (max-width: 768px) {
  .ov-bar { position: static; }
  .ov-attn-title { width: 100%; }
  .ov-views { order: -1; }
  .ov-nomatch-reset { min-height: 44px; padding: 8px 16px; }
  .ov-tools { order: 1; }
  .ov-marks { order: 2; }
  .ov-marks-title { width: 100%; }
  .ov-mark { min-height: 36px; }
  .ov-tool { min-height: 40px; }
  /* панель над схемой на телефоне не липкая: плашка фокуса — внизу экрана, «Выйти» всегда под пальцем */
  .ov-focusbar {
    order: 3; position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 10px 10px 10px 14px; box-shadow: 0 10px 30px var(--shadow-c);
  }
  .ov-focus-meta { order: 3; flex: 0 0 100%; }
  .ov-focus-exit { min-height: 40px; padding: 4px 14px; }
  .ov-focus-exit kbd { display: none; }
  .ov-tip-btn { min-height: 40px; padding: 8px 11px; }
  .ov-v-rootset, .ov-hv-set { min-height: 44px; }
  .ov-v-set { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-link, .ov-p, .ov-card, .ov-sub, .ov-unit, .ov-c, .ov-v-card, .ov-v-label, .ov-tip, .ov-tip.show, .ov-chip, .ov-mark, .ov-tool { transition: none; }
  .ov-p-halo, .ov-c.is-hit { animation: none; }
}
