/* OrgChart (PA-FORMS-005): the chart, its inspector, date groups and Position Hierarchy.
   Loaded after form-designer.css (the order is in base.css). */
/* ---------- OrgChart (PA-FORMS-005; FW-UI-188, migration step M11) ----------
   The one chart of organisation, positions and people, as the accepted Apple
   mockup draws it (docs/design/reference/org-chart.html; OrgChart, ZoomControl,
   Inspector; P52, P76, P83, P84, P85): cards on a dotted canvas joined by thin
   lines, the Functional Manager as a dashed line under the cards, «−» and «+N»
   under a card that has subordinates, one zoom capsule at the bottom right. */
.org-stage{position:relative;display:flex;justify-content:center;align-items:flex-start;gap:56px;width:max-content;min-width:100%;padding:calc(var(--toolbar-h) + 28px) 40px 60px;transform-origin:0 0}
/* The level is a number the chart's script sets (org-chart.js): a fixed level of the menu, or Zoom to Fit's. */
/* The zoom level the script sets as data-org-level: the fixed levels and Zoom to Fit's grid of 5 % (10-100 %). */
.org-stage[data-org-level="10"]{zoom:0.1}.org-stage[data-org-level="15"]{zoom:0.15}.org-stage[data-org-level="20"]{zoom:0.2}.org-stage[data-org-level="25"]{zoom:0.25}.org-stage[data-org-level="30"]{zoom:0.3}.org-stage[data-org-level="35"]{zoom:0.35}.org-stage[data-org-level="40"]{zoom:0.4}.org-stage[data-org-level="45"]{zoom:0.45}.org-stage[data-org-level="50"]{zoom:0.5}.org-stage[data-org-level="55"]{zoom:0.55}.org-stage[data-org-level="60"]{zoom:0.6}.org-stage[data-org-level="65"]{zoom:0.65}.org-stage[data-org-level="70"]{zoom:0.7}.org-stage[data-org-level="75"]{zoom:0.75}.org-stage[data-org-level="80"]{zoom:0.8}.org-stage[data-org-level="85"]{zoom:0.85}.org-stage[data-org-level="90"]{zoom:0.9}.org-stage[data-org-level="95"]{zoom:0.95}.org-stage[data-org-level="100"]{zoom:1}.org-stage[data-org-level="150"]{zoom:1.5}
.oc-tree{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center}
.oc-root-label{margin:0 0 10px;font:var(--type-mac-caption);color:var(--label-2)}
.oc-node{display:flex;flex-direction:column;align-items:center}
.oc-kids{position:relative;display:flex;justify-content:center;gap:22px;padding-top:26px}
.oc-kids::before{content:"";position:absolute;top:0;left:50%;width:1px;height:13px;background:var(--label-3)}
.oc-kids>.oc-node{position:relative;padding-top:13px}
.oc-kids>.oc-node::before{content:"";position:absolute;top:0;left:50%;width:1px;height:13px;background:var(--label-3)}
.oc-kids>.oc-node::after{content:"";position:absolute;top:0;left:-11px;right:-11px;height:1px;background:var(--label-3)}
.oc-kids>.oc-node:first-child::after{left:50%}
.oc-kids>.oc-node:last-child::after{right:50%}
.oc-kids>.oc-node:only-child::after{display:none}
/* Many cards without subordinates under one card stand in two columns. */
.oc-kids.oc-stack{display:grid;grid-template-columns:repeat(2,auto);gap:8px}
.oc-kids.oc-stack>.oc-node{padding-top:0}
.oc-kids.oc-stack>.oc-node::before,.oc-kids.oc-stack>.oc-node::after{display:none}
.oc-card{position:relative;width:196px;padding:9px 11px;border-radius:var(--r-group);background:var(--group);box-shadow:0 0 0 .5px var(--group-line),0 2px 8px color-mix(in srgb,var(--label) 7%,transparent);color:var(--label);font:var(--type-mac-body);text-align:left;cursor:default;user-select:none}
.oc-card[aria-selected="true"]{box-shadow:0 0 0 2.5px var(--accent),0 2px 8px color-mix(in srgb,var(--label) 7%,transparent)}
.oc-card.vacant{box-shadow:0 0 0 .5px var(--group-line),inset 3px 0 0 var(--orange),0 2px 8px color-mix(in srgb,var(--label) 7%,transparent)}
.oc-card.vacant[aria-selected="true"]{box-shadow:0 0 0 2.5px var(--accent),inset 3px 0 0 var(--orange)}
.oc-card.is-drop{box-shadow:0 0 0 2.5px var(--accent),0 0 0 6px var(--focus)}
.oc-card:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.oc-card[draggable="true"]{cursor:grab}
.oc-card .pos{display:block;font:var(--type-mac-caption);font-weight:400;color:var(--label-2);overflow-wrap:anywhere}
.oc-card .pos:empty{display:none}
.oc-card b{display:block;margin:1px 0 5px;font:var(--type-mac-emphasis);overflow-wrap:anywhere}
.oc-card .who{display:flex;align-items:center;gap:6px;min-width:0;font:var(--type-mac-callout)}
.oc-card .who+.who{margin-top:3px}
.oc-card .who .avatar{width:20px;height:20px;font-size:9px}
.oc-card .who>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.oc-card .meta{display:block;margin-top:5px;font:var(--type-mac-caption);font-weight:400;color:var(--label-2);font-variant-numeric:tabular-nums}
.oc-caps{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.oc-caps>.badge{white-space:normal}
/* «−» folds a branch, «+N» - the Positions under the card - unfolds it (P84). */
.oc-more{position:absolute;left:50%;bottom:-10px;z-index:1;transform:translateX(-50%);min-width:28px;height:20px;min-height:0;padding:0 6px;border:0;border-radius:10px;background:var(--control);box-shadow:0 0 0 .5px var(--separator),0 1px 3px color-mix(in srgb,var(--label) 12%,transparent);color:var(--label-2);font:var(--type-mac-caption);cursor:pointer}
.oc-more:hover{background:var(--control);color:var(--label)}
.oc-more:focus-visible{outline:2px solid var(--focus);outline-offset:1px;box-shadow:none}
/* The Functional Manager line (P85): the legend's dashed line, under the cards. */
.org-stage>svg.oc-fm{position:absolute;left:0;top:0;z-index:0;overflow:visible;pointer-events:none}
.org-stage>svg.oc-fm path{fill:none;stroke:var(--label-2);stroke-width:1.5;stroke-dasharray:5 4}
/* The legend's line samples. */
.ph-line{display:inline-block;flex:none;width:22px;height:0;border-top:1.5px solid var(--label-2)}
.ph-line.dashed{border-top-style:dashed}
/* One zoom control on a canvas (ZoomControl, P52): − | level ▾ | +. */
.zoom-ctl{position:absolute;right:16px;bottom:16px;z-index:2}
.zoom-ctl .zoom-lvl{width:auto;gap:2px;padding:0 6px;font:var(--type-mac-callout)}
.zoom-ctl .zoom-lvl .num{min-width:34px;text-align:center}
/* Chart frame (FW-UI-106, PO 2026-11-05: a layout to try for the chart): the
   chart full width under a tool row (view, changes, Find, zoom); the selected
   node's details open in an inspector on the right and close with it. */
.chart-inspector{display:none;flex-direction:column;min-height:0;border-left:var(--hairline-w) solid var(--group-line);background:var(--window)}
.chart-inspector.value-cells{--rc-label:120px}
.chart-inspector .ie-panel-body>.settings-card{margin:0 0 10px}.chart-inspector .ie-panel-body>.message{margin:0 0 12px}
.chart-inspector .rule-order{margin:0 0 10px}
/* Inspector frame (FW-UI-106, PO 2026-11-05 «Выезжающие панели должны работать
   одинаково на всех страницах»): a table or list page opens the selected row in
   the same inspector as the Chart frame - a 340px column on the right that
   pushes the content, sticky while the page scrolls, closed by its × or Escape. */
.inspector-frame{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.inspector-frame.has-inspector{grid-template-columns:minmax(0,1fr) 340px}
.inspector-frame>.chart-inspector{position:sticky;top:0;max-height:calc(100vh - 220px);border-left:0;border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-card)}
.inspector-frame.has-inspector>.chart-inspector{display:flex}
.inspector-frame>div{min-width:0}
.settings-form .settings-panes>.settings-pane:has(.inspector-frame){overflow:visible}
/* On a phone the selected row's inspector stands under the content, full width. */
@media(max-width:700px){.inspector-frame.has-inspector{grid-template-columns:minmax(0,1fr)}.inspector-frame>.chart-inspector{position:static;max-height:none}}
/* Date groups (FW-UI-106, PO 2026-11-05): rows that run on one date stand
   under the ordinary window subhead - the date in ink, the number of rows and
   the group's state muted on the same line - with a hairline above; the head
   stays at the top while its rows scroll. */
.settings-form .settings-panes>.settings-pane:has(.date-group){overflow:visible}
/* ---------- Organisation Chart, the window (FW-UI-188) ----------
   The window's tools stand in the toolbar's row (M03); the canvas runs under
   them to the window's edges; the inspector floats at the side from the
   window's top (P58, its toggle in the toolbar); the status bar counts what
   is shown. */
.ph-sub{display:block;color:var(--label-2);font:var(--type-mac-caption);font-weight:400}
.scroll>.settings-form.ph-window{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
.scroll>.ph-window>.settings-titlebar{position:relative;grid-column:1;grid-row:1;background:linear-gradient(var(--page) 55%,color-mix(in srgb,var(--page) 0%,transparent))}
.scroll>.ph-window>.ph-body{position:relative;display:block;grid-column:1;grid-row:1/3;min-height:0;background:none}
.ph-window>.ph-inspector{grid-column:2;grid-row:1/-1}
.ph-window>.ph-status{grid-column:1;grid-row:3}
.ph-canvas{position:absolute;inset:0;overflow:hidden;background:radial-gradient(circle,var(--label-4) 1px,transparent 1.2px) 0 0/18px 18px,var(--page)}
.ph-canvas>.org-chart{position:absolute;inset:0;overflow:auto}
.ph-canvas>.org-chart[hidden]{display:none}
.ph-nothing{position:absolute;left:24px;top:calc(var(--toolbar-h) + 16px);margin:0}
/* The toolbar's search (Search): one capsule; with no room it folds into its
   magnifier and opens over its neighbours while typed in (P53). */
.ph-find{position:relative;flex:none;width:200px;margin:0}
.ph-find input{width:100%;height:30px;border-radius:var(--r-capsule);background:var(--fill-2)}
.ph-find .search-icon{top:8px;pointer-events:none}
@container (max-width:1400px){.main:not(.side-hidden) .ph-find{width:32px}}
@container (max-width:960px){.ph-find{width:32px}}
@container (max-width:1400px){.main:not(.side-hidden) .ph-find:not(:focus-within) input:placeholder-shown{padding:0;cursor:pointer}.main:not(.side-hidden) .ph-find:not(:focus-within) input:placeholder-shown::placeholder{color:transparent}.main:not(.side-hidden) .ph-find:focus-within input{position:absolute;right:0;top:0;width:220px}}
@container (max-width:960px){.ph-find:not(:focus-within) input:placeholder-shown{padding:0;cursor:pointer}.ph-find:not(:focus-within) input:placeholder-shown::placeholder{color:transparent}.ph-find:focus-within input{position:absolute;right:0;top:0;width:220px}}
.ph-views .tb-btn[aria-pressed="true"]{color:var(--accent-text);background:var(--fill-2)}
.ph-window .tb-btn[aria-disabled="true"]{color:var(--label-3);background:none}
/* The inspector (Inspector): glass, the side panel's one width. */
.ph-inspector{width:min(var(--inspector-w),46vw);min-height:0;margin:var(--gap-window) var(--gap-window) var(--gap-window) 0;padding:14px;overflow:auto;border-radius:var(--r-sidebar);background:var(--glass);-webkit-backdrop-filter:blur(30px) saturate(180%);backdrop-filter:blur(30px) saturate(180%);box-shadow:var(--glass-shadow),inset 0 0 0 1px var(--glass-edge)}
.ph-inspector>.settings-card{margin:0 0 10px}
.ph-inspector>.settings-heading{margin:14px 2px 5px}
/* «Selected» carries the Position's History clock at its end (the mockup's .sel-h); the popover's note stands under its list. */
.ph-inspector>.settings-heading.ph-sel-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.history-card>.ph-hist-note{margin:8px 2px 0;color:var(--label-2);font:var(--type-mac-caption)}
/* A version line's chevron, as the record window draws it (window.css gives it its look only inside a column window; the chart's History stands outside one). */
.ph-inspector>.history-card .hist-list .op-chev{display:inline-block;width:8px;height:8px;flex:none;fill:none;stroke:var(--label-3);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ph-inspector>.history-card .hist-list .op-line:hover .op-chev{stroke:var(--label-2)}
.ph-seg{display:flex;margin:0 0 12px}
.ph-seg>*{flex:1;justify-content:center}
.ph-legend .settings-row{justify-content:flex-start;gap:8px;min-height:30px;font:var(--type-mac-callout);color:var(--label)}
.ph-none{display:flex;align-items:center;justify-content:center;min-height:44px;margin:0;color:var(--label-2)}
/* The status bar. */
.scroll>.ph-window>.ph-status{justify-content:flex-start;min-height:28px;padding:0 16px;background:var(--window)}
.ph-status .settings-count{flex:none;font:var(--type-mac-caption);font-weight:400;color:var(--label-2)}
/* The List view (P76): the outline of the same Positions and folds. */
.ph-outline{position:absolute;inset:0;overflow:auto;padding:calc(var(--toolbar-h) + 8px) 24px 48px;background:var(--page)}
.ph-outline[hidden]{display:none}
.ph-outline>.settings-card{max-width:var(--record-w);margin:0 auto}
.ph-row{position:relative;display:flex;align-items:center;gap:8px;min-height:32px;padding:6px 12px;color:var(--label);font:var(--type-mac-body);cursor:default}
.ph-row+.ph-row::before{content:"";position:absolute;top:0;left:12px;right:0;border-top:var(--hairline-w) solid var(--field-line)}
.ph-row:hover{background:var(--fill-hover)}
.ph-row[aria-selected="true"]{background:var(--accent-soft)}
.ph-row:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.ph-ind{flex:none;width:calc(18px * var(--ph-depth,0))}
.ph-row[aria-level="2"]{--ph-depth:1}.ph-row[aria-level="3"]{--ph-depth:2}.ph-row[aria-level="4"]{--ph-depth:3}.ph-row[aria-level="5"]{--ph-depth:4}.ph-row[aria-level="6"]{--ph-depth:5}.ph-row[aria-level="7"]{--ph-depth:6}.ph-row[aria-level="8"]{--ph-depth:7}.ph-row[aria-level="9"]{--ph-depth:8}.ph-row[aria-level="10"]{--ph-depth:9}.ph-row[aria-level="11"]{--ph-depth:10}.ph-row[aria-level="12"]{--ph-depth:11}.ph-row[aria-level="13"]{--ph-depth:12}
.ph-disc{flex:none;display:inline-grid;place-items:center;width:18px;height:22px;min-height:0;margin:0 -4px;padding:0;border:0;border-radius:4px;background:none;box-shadow:none;color:var(--label-2);cursor:pointer}
.ph-disc:hover{background:none}
.ph-disc:focus-visible{outline:2px solid var(--focus);box-shadow:none}
.ph-disc svg{width:10px;height:10px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.ph-disc[aria-expanded="true"] svg{transform:rotate(90deg)}
span.ph-disc{visibility:hidden}
.ph-ttl{flex:1;min-width:0;display:flex;flex-direction:column}
.ph-ttl>b{font:var(--type-mac-body);overflow-wrap:anywhere}
.ph-ttl>span{font:var(--type-mac-caption);font-weight:400;color:var(--label-2);overflow-wrap:anywhere}
.ph-ttl>.oc-fmrow{display:flex;align-items:center;gap:6px;margin-top:2px}
.oc-fmrow>.ph-line{width:16px}
.ph-fte{flex:none;font:var(--type-mac-caption);font-weight:400;color:var(--label-2)}
/* A Position's menu (P83) and the zoom menu open where they are asked. */
.ph-menu{position:fixed;inset:auto;margin:0}
/* The sandbox of a restructuring project keeps the chart in its section. */
.ph-canvas.oc-sandbox{position:relative;inset:auto;border-radius:var(--r-group);background:var(--group);box-shadow:0 0 0 .5px var(--group-line)}
.ph-canvas.oc-sandbox>.org-chart{position:relative;inset:auto;max-height:min(560px,70vh)}
.oc-sandbox .org-stage{padding:20px 40px 64px}
.oc-sandbox+[data-org-selected]{margin-top:12px}
/* In the sandbox the zoom stands at the chart's top left (restructuring.html .rs-tools). */
.oc-sandbox .zoom-ctl{left:12px;top:12px;right:auto;bottom:auto}
@media(prefers-reduced-motion:reduce){.ph-disc svg{transition:none}}
/* iPhone (P76, IPhoneOrgChart): the outline list by default, one button to
   the chart, no inspector; a tapped node opens its sheet; the disclosure is a
   touch target. */
@media(max-width:700px){
 .scroll>.settings-form.ph-window{grid-template-columns:minmax(0,1fr)}
 .ph-window>.ph-inspector,.ph-window .ph-mac,.ph-find,.ph-window>.settings-titlebar>.tb-sep,.scroll>.ph-window>.ph-status{display:none}
 .ph-views .tb-btn[aria-pressed="true"]{display:none}
 /* The navigation bar and the large title stand over the list, not on it. */
 .scroll>.ph-window>.settings-titlebar{background:var(--page)}
 .scroll>.ph-window>.ph-body{grid-row:2}
 .ph-outline{padding:4px 16px 24px}
 .ph-window .org-stage{padding-top:28px}
 .ph-row{min-height:44px;font:var(--type-ios-body)}
 .ph-ind{width:calc(12px * var(--ph-depth,0))}
 .ph-ttl>b{overflow-wrap:break-word}
 .ph-ttl>span,.ph-fte{font:var(--type-ios-footnote)}
 .ph-fte{max-width:96px;text-align:right}
 .ph-disc{width:30px;height:44px;margin:-10px -8px -10px -10px}
 .ph-disc svg{width:12px;height:12px}
 /* The node's sheet: Correct, Open and the profile in one row, Operations
    the whole width under them (IPhoneOrgChart). */
 dialog>.settings-footer[data-org-sheet-foot]{flex-wrap:wrap}
 dialog>.settings-footer[data-org-sheet-foot]>*{flex:1 1 0;min-width:0}
 dialog>.settings-footer[data-org-sheet-foot]>.primary-button{flex-basis:100%}
}
