/* Connected organization chart. Node geometry is shared with the chart layout. */
.org-panel {
  --org-color: #2455f5;
  --org-soft: #edf3ff;
  --org-line: #91a9e4;
  --org-border: #dce5f4;
  --org-ink: #243956;
  --org-muted: #71849d;
  padding: 0;
  min-width: 0;
  overflow: hidden;
}
.org-panel button { -webkit-tap-highlight-color: transparent; }
.org-panel button:focus-visible,
.org-chart-shell button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--org-color) 48%, white);
  outline-offset: 3px;
  position: relative;
  z-index: 4;
}
.org-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  padding: 24px 24px 18px;
}
.org-title { min-width: 0; }
.org-title h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.045em; }
.org-title small { display: block; margin-top: 6px; color: var(--org-muted); font-size: 12px; line-height: 1.6; }
.org-view-switch { display: inline-flex; flex-shrink: 0; gap: 4px; padding: 4px; border-radius: 10px; background: #f0f3f8; }
.org-view-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #8291a8;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}
.org-view-switch button svg { height: 17px; width: 17px; }
.org-view-switch button.active { color: var(--org-color); border-color: #e7ebf3; background: #fff; box-shadow: 0 2px 5px rgb(45 68 107 / 5%); }
.org-search-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 24px 20px; }
.org-search-row .search-field { flex: 1 1 240px; min-width: 0; margin: 0; }
.org-search-row .search-field input { min-height: 46px; font-size: 14px; background: #fff; padding-right: 14px; }
.org-search-row .search-field > svg { top: 14px; }
.org-depth { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.org-depth label { color: #788aa2; font-size: 12px; white-space: nowrap; }
.org-depth select { width: auto; min-width: 108px; min-height: 46px; padding: 10px 32px 10px 12px; border-color: #e3e9f3; font-size: 14px; }
.org-panel #team-results { min-width: 0; padding: 0 24px 24px; }
.org-panel #team-results > .team-list { padding: 3px 0; }
.org-search-status,
.org-subtree-notice { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 11px 14px; margin-bottom: 13px; border: 1px solid var(--org-border); border-radius: 9px; background: var(--org-soft); color: #6b80a3; font-size: 12px; line-height: 1.6; }
.org-search-status strong,
.org-subtree-notice strong { color: var(--org-color); }
.org-clear,
.org-subtree-notice button { min-height: 44px; padding: 8px 10px; margin: -7px -7px -7px 0; border-radius: 7px; background: transparent; color: var(--org-color); font-size: 14px; font-weight: 550; }
.org-clear:hover,
.org-subtree-notice button:hover { background: rgb(255 255 255 / 80%); }
.org-chart-shell { min-width: 0; width: 100%; color: var(--org-ink); }
.org-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 9px; }
.org-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; min-width: 0; flex: 1; font-size: 12px; color: #99a7bb; }
.org-breadcrumb button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; max-width: 100%; padding: 8px 9px; margin-left: -9px; border-radius: 8px; color: #6480aa; background: transparent; font-size: 14px; font-weight: 550; text-align: left; overflow-wrap: anywhere; }
.org-breadcrumb button:hover { background: var(--org-soft); color: var(--org-color); }
.org-breadcrumb svg { height: 16px; width: 16px; }
.org-tools,
.org-controls { display: flex; align-items: center; flex-shrink: 0; gap: 3px; }
.org-tools button,
.org-controls button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 44px; min-height: 44px; padding: 10px; border: 1px solid #e7ecf4; border-radius: 8px; background: #fff; color: #7890b1; }
.org-tools button svg,
.org-controls button svg { width: 18px; height: 18px; }
.org-tools button:hover,
.org-controls button:hover { color: var(--org-color); border-color: var(--org-border); background: var(--org-soft); }
.org-tools button:disabled { opacity: .4; background: #f5f7fb; cursor: not-allowed; }
.org-zoom-label { min-width: 45px; padding: 0 5px; color: #7890ac; font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.org-helper { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 1px 0 13px; color: #8394ad; font-size: 12px; line-height: 1.65; }
.org-helper > span { max-width: 100%; }
.org-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: #8a9ab1; font-size: 12px; }
.org-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.org-legend i,
.org-legend .swatch,
.org-legend .org-swatch { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border-radius: 3px; border: 1px solid var(--org-line); background: var(--org-soft); }
.org-legend .is-root,
.org-legend .root { border-color: var(--org-color); background: var(--org-color); }
.org-legend .inactive { border-color: #b9c3d2; background: #e9edf3; }
.org-legend .match { border-color: #d8ab5e; background: #fff0cb; }
.org-viewport {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 480px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  border: 1px solid #e1e8f3;
  border-radius: 12px;
  background-color: #f8fafd;
  background-image: radial-gradient(circle, #dce4ef 1px, transparent 1px);
  background-size: 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: #bdcce2 #f3f6fb;
}
.org-viewport:active { cursor: grabbing; }
.org-viewport:focus-visible { outline: 3px solid #aabef1; outline-offset: 3px; }
.org-viewport::-webkit-scrollbar { height: 9px; width: 9px; }
.org-viewport::-webkit-scrollbar-track { background: #f3f6fb; border-radius: 10px; }
.org-viewport::-webkit-scrollbar-thumb { background: #c0cee2; border: 2px solid #f3f6fb; border-radius: 10px; }
.org-sizer { position: relative; min-width: 100%; min-height: 100%; flex: none; }
.org-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; isolation: isolate; }
svg.org-connectors { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; pointer-events: none; }
.org-connectors path { fill: none; stroke: var(--org-line); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
article.org-node {
  position: absolute;
  z-index: 1;
  width: 172px;
  min-width: 172px;
  max-width: 172px;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
  border: 1px solid #d8e2f0;
  border-radius: 12px;
  background: #fff;
  color: var(--org-ink);
  box-shadow: 0 3px 9px rgb(38 67 105 / 5%);
  overflow: visible;
  cursor: default;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  letter-spacing: -.035em;
}
.org-node.is-root { border-color: var(--org-color); box-shadow: 0 3px 12px rgb(45 78 147 / 9%); }
.org-node.is-selected { border-color: var(--org-color); box-shadow: 0 0 0 2px var(--org-color), 0 5px 15px rgb(45 78 147 / 10%); }
.org-node.is-match { border-color: #d2a551; box-shadow: 0 0 0 2px #eed19a, 0 3px 9px rgb(99 77 29 / 7%); }
.org-node.is-inactive { border-style: dashed; background: #fafbfd; color: #8090a5; }
.org-node.is-center { border-color: #38a78b; border-style: solid; background: #f0fbf7; color: #184b3f; box-shadow: 0 3px 12px rgb(26 122 96 / 12%); }
.org-node.is-center.is-match { box-shadow: 0 0 0 2px #eed19a, 0 3px 12px rgb(26 122 96 / 12%); }
.org-node.is-center .org-node-main { background: transparent; }
.org-node.is-center.is-root .org-node-main { background: #f0fbf7; }
.org-node.is-center.is-root .org-position { color: #20745f; }
.org-node.is-center .org-node-main:hover { background: #e3f6ee; }
.org-node.is-center .org-node-bottom { background: #e8f7f1; border-top-color: #c7e8dc; }
.org-node.is-center .org-position, .org-node.is-center .org-collapse { color: #20745f; }
.org-node-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  height: 111px;
  min-height: 111px;
  padding: 9px 11px 8px;
  border: 0;
  border-radius: 11px 11px 0 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  text-align: left;
  line-height: 1.3;
  overflow: hidden;
}
.org-node-main:hover { background: var(--org-soft); }
.org-node.is-root .org-node-main { background: var(--org-soft); }
.org-node-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; font-size: 12px; }
.org-node-marker { display: flex; align-items: center; gap: 5px; min-width: 0; }
.org-node-marker .org-position { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-center-badge { flex: 0 0 auto; padding: 2px 5px; border-radius: 4px; background: #cceee0; color: #075d46; font-size: 10px; line-height: 1.4; font-weight: 800; letter-spacing: .02em; }
.org-level { flex: 0 0 auto; }
.org-legend { flex-wrap: wrap; }
.org-center-legend { display: inline-flex; align-items: center; gap: 5px; color: #20745f; white-space: nowrap; }
.org-center-legend i { width: 9px; height: 9px; border: 1px solid #38a78b; border-radius: 3px; background: #cceee0; }
.org-position { color: #8ca0ba; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.org-node.is-root .org-position { color: var(--org-color); font-weight: 700; }
.org-level { color: #8195ae; font-size: 12px; }
.org-node-name { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; min-width: 0; }
.org-node-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 750; line-height: 1.4; letter-spacing: -.05em; }
.org-node-name small { min-width: 0; flex-shrink: 0; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8da0b9; font-size: 12px !important; line-height: 1.4; }
.org-node-code { color: #8a9db6; font-size: 12px; line-height: 1.3; letter-spacing: .015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-node-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.4; }
.org-plan { display: inline-block; flex-shrink: 0; max-width: 75px; padding: 2px 5px; border-radius: 4px; background: #eff3fa; color: #6e85a9; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-node.is-root .org-plan { background: #fff; color: var(--org-color); }
.org-volume { min-width: 0; color: #7b8eaa; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.3; text-align: right; white-space: nowrap; letter-spacing: -.065em; }
.org-node-bottom { display: flex; align-items: center; justify-content: space-between; min-width: 0; width: 100%; height: 37px; padding: 0 5px 0 7px; border-top: 1px solid #edf1f7; border-radius: 0 0 11px 11px; background: #fbfcfe; }
.org-collapse,
.org-focus { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; min-height: 36px; padding: 6px; border-radius: 6px; background: transparent; color: #7a91b0; font-size: 12px; font-weight: 500; line-height: 1.3; }
.org-collapse { min-width: 45px; }
.org-focus { width: 36px; flex: 0 0 36px; }
.org-collapse svg,
.org-focus svg { width: 15px; height: 15px; }
.org-collapse:hover,
.org-focus:hover { color: var(--org-color); background: var(--org-soft); }
.org-leaf { padding-left: 5px; color: #9aabc0; font-size: 12px; line-height: 1.4; }
.org-chart-caption { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 7px 18px; padding-top: 12px; color: #8e9eb4; font-size: 12px; line-height: 1.65; }
.org-chart-caption strong { color: #617d9f; font-weight: 600; }
.org-empty { padding: 65px 20px; border: 1px dashed #dde6f3; border-radius: 12px; background: #fafcff; color: #8a9cb4; font-size: 14px; line-height: 1.8; text-align: center; }
.org-empty svg { display: block; width: 33px; height: 33px; margin: 0 auto 14px; color: #adbbd0; }
.org-empty strong { display: block; color: #617d9f; margin-bottom: 5px; }
.org-empty button { min-height: 44px; margin-top: 14px; font-size: 14px; }
.org-chart-shell.is-expanded {
  position: fixed;
  z-index: 80;
  inset: 12px;
  width: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  border: 1px solid #dce5f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 18px rgb(25 43 75 / 35%), 0 15px 70px rgb(25 43 75 / 20%);
}
.org-chart-shell.is-expanded .org-toolbar,
.org-chart-shell.is-expanded .org-helper,
.org-chart-shell.is-expanded .org-chart-caption { flex-shrink: 0; }
.org-chart-shell.is-expanded .org-viewport { flex: 1 1 auto; height: auto; min-height: 160px; }
.org-chart-shell.is-expanded .org-toolbar { margin-bottom: 8px; }
@media (max-width: 767px) {
  .org-panel { padding: 0; border-radius: 14px; }
          .org-topline { padding: 20px 14px 15px; gap: 13px; }
  .org-title h2 { font-size: 17px; }
  .org-title small { font-size: 12px !important; }
  .org-view-switch { gap: 2px; padding: 3px; }
  .org-view-switch button { min-height: 44px; padding: 9px 10px; font-size: 14px; }
  .org-view-switch button svg { width: 16px; height: 16px; }
  .org-search-row { padding: 0 14px 17px; gap: 10px; }
  .org-search-row .search-field { flex-basis: 100%; }
  .org-search-row .search-field input { font-size: 16px; }
  .org-depth { width: 100%; justify-content: space-between; }
  .org-depth label { font-size: 12px; }
  .org-depth select { flex: 0 0 auto; min-width: 112px; font-size: 14px; }
  .org-panel #team-results { padding: 0 12px 16px; }
  .org-search-status, .org-subtree-notice { padding: 11px; font-size: 12px; line-height: 1.65; }
  .org-toolbar { gap: 3px 10px; margin-bottom: 8px; }
  .org-breadcrumb { flex: 1 1 100%; font-size: 12px; }
  .org-breadcrumb button { font-size: 14px; }
  .org-tools { width: 100%; justify-content: flex-end; gap: 3px; }
  .org-tools button, .org-controls button { min-width: 44px; min-height: 44px; padding: 10px; }
  .org-zoom-label { font-size: 12px; min-width: 41px; padding: 0 2px; }
  .org-helper { gap: 7px; margin: 9px 0 12px; font-size: 12px; }
  .org-legend { gap: 10px; font-size: 12px; }
  .org-viewport { height: 490px; border-radius: 10px; }
  .org-chart-caption { font-size: 12px; gap: 4px; padding-top: 11px; }
  .org-chart-caption > span { max-width: 100%; }
  .org-node-name strong { font-size: 15px !important; }
  .org-node-name small { font-size: 12px !important; }
  .org-node-main, .org-node-top, .org-position, .org-level, .org-node-code,
  .org-node-meta, .org-plan, .org-volume, .org-collapse, .org-leaf { font-size: 12px !important; }
  .org-node-main { line-height: 1.3 !important; }
  .org-node-name small { line-height: 1.4 !important; }
  .org-chart-shell.is-expanded {
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .org-chart-shell.is-expanded .org-viewport { flex: 1 1 auto; min-height: 120px; height: auto; }
  .org-chart-shell.is-expanded .org-helper { margin-top: 2px; margin-bottom: 9px; }
  .org-chart-shell.is-expanded .org-chart-caption { padding-top: 9px; }
}
@media (max-width: 374px) {
  .org-topline { align-items: flex-start; }
  .org-view-switch { margin-left: auto; }
  .org-topline, .org-search-row { padding-left: 12px; padding-right: 12px; }
  .org-panel #team-results { padding-left: 10px; padding-right: 10px; }
  .org-tools { flex-wrap: wrap; }
  .org-legend { column-gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .org-panel *, .org-chart-shell * { scroll-behavior: auto !important; transition: none !important; }
}
/* The chart controls share one row where possible; the canvas keeps its own scroll. */
.org-controls { flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.org-controls > .org-tools { flex-wrap: wrap; }
.org-depth { color: #71849d; font-size: 12px; }
.org-tool-separator { height: 20px; width: 1px; margin: 0 5px; background: #e2e8f3; }
.org-node-bottom > .org-tool { width: 36px; height: 36px; padding: 8px; background: transparent; color: var(--org-color); border-radius: 6px; }
.org-node-bottom > .org-tool svg { width: 16px; height: 16px; }
.org-node-bottom > .org-tool:hover { background: var(--org-soft); }
.org-volume small { font-size: 10px; }
.org-viewport.is-panning { cursor: grabbing; user-select: none; }
body.org-view-expanded { overflow: hidden; }
.org-chart-shell.is-expanded .org-controls { flex: 0 0 auto; }
.org-panel #team-results .org-node-main { font-size: 12px; }
@media(max-width:767px) {
  .main:has(.org-panel) .page-heading { margin-bottom: 18px; gap: 8px; }
  .main:has(.org-panel) .page-heading .eyebrow { display:none; }
  .main:has(.org-panel) .page-heading p { display:none; }
  .main:has(.org-panel) .page-heading .btn { padding: 9px 12px; }
  .main:has(.org-panel) .stat-grid { margin-bottom: 16px; gap: 7px; }
  .main:has(.org-panel) .stat-card { padding: 12px 10px; }
  .main:has(.org-panel) .stat-label { font-size: 12px; }
  .main:has(.org-panel) .stat-value { margin-top: 5px; font-size: 20px; }
  .main:has(.org-panel) .stat-value small { display: inline; margin-left: 3px; }
        .org-topline { padding: 12px; gap:8px; flex-wrap:nowrap; }
  .org-title h2 { font-size: 15px; }
  .org-title small { display:none; }
  .org-view-switch button { min-height:40px; padding:8px 9px; }
  .org-search-row { padding:0 12px 12px; }
  .org-toolbar { flex-wrap:nowrap; gap:8px; }
  .org-breadcrumb { flex:1; }
  .org-toolbar > .org-tools { width:auto; }
  .org-controls { gap: 6px; flex-wrap:nowrap; }
  .org-controls .org-depth { width:auto; gap:5px; }
  .org-depth select { min-width:62px; width:62px; min-height:40px; padding:8px 3px; }
  .org-controls > .org-tools { width:auto; gap:0; flex-wrap:nowrap; }
  .org-controls button { min-width:36px; min-height:44px; width:36px; padding:8px; border:0; }
  .org-controls [data-org-action="collapse-all"], .org-controls [data-org-action="expand-all"], .org-tool-separator { display:none; }
  .org-zoom-label { min-width:38px; }
  .org-helper { margin-top:0; font-size:12px; }
  .org-helper .org-legend { display:none; }
  .org-viewport { height:490px; }
  .org-volume small { font-size:12px; }
}
@media(max-width:374px) {
  .org-controls .org-depth { font-size:0; }
  .org-depth select { font-size:14px; }
  .org-node-name strong { max-width:95px; }
}

/* Organization paths are display order within the selected genealogy. */
.org-position { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-tools .org-tool:has(> span) { gap: 6px; font-size: 13px; }
.org-controls { flex-wrap: wrap; }
.org-controls > .org-tools { flex-wrap: wrap; }

/* Prioritize the diagram over dashboard summaries. */
.main:has(.org-panel) { padding-top:24px; }
.main:has(.org-panel) .page-heading { margin-bottom:16px; }
.org-summary { display:flex; flex-wrap:wrap; align-items:center; gap:12px 28px; margin:0 0 20px; padding:12px 18px; border:1px solid var(--line); border-radius:12px; background:white; }
.org-summary-item { display:flex; align-items:baseline; gap:12px; flex:1; min-width:0; }
.org-summary-label { color:var(--muted); font-size:13px; white-space:nowrap; }
.org-summary-value { font-size:20px; font-weight:750; white-space:nowrap; }
.org-summary-value small { font-size:12px; color:var(--muted); font-weight:400; margin-left:4px; }
.org-panel .org-topline { padding-top:14px; padding-bottom:10px; }
.org-panel .org-title small { display:none; }
.org-panel .org-search-row { padding-bottom:10px; }
.org-helper { margin:12px 0 0; }
@media(max-width:767px) {
 .main:has(.org-panel) { padding-top:18px; }
 .main:has(.org-panel) .page-heading { margin-bottom:12px; gap:8px; }
 .main:has(.org-panel) .page-heading h1 { font-size:23px; }
 .main:has(.org-panel) .page-heading p { display:none; }
 .main:has(.org-panel) .page-heading .eyebrow { display:none; }
 .main:has(.org-panel) .heading-actions { margin-left:0; }
 .main:has(.org-panel) .heading-actions .btn { padding:8px 12px; }
 .org-summary { padding:8px 12px; margin-bottom:12px; gap:12px; }
 .org-summary-item { display:flex; flex-direction:column; gap:2px; }
 .org-summary-label { white-space:normal; font-size:12px; }
 .org-summary-value { font-size:19px; }
 .org-summary-value small { display:inline; font-size:12px; }
    .org-panel .org-topline { padding:10px 12px 8px; }
 .org-panel .org-search-row { padding:0 12px 8px; }
 .org-panel #team-results { padding:0 12px 12px; }
 .org-title h2 { font-size:15px; }
 .org-view-switch button { min-height:40px; padding:6px 10px; }
 .org-controls [data-org-action="collapse-all"],.org-controls [data-org-action="expand-all"],.org-controls .org-tool-separator { display:none; }
 .org-controls { gap:8px; margin-bottom:10px; }
 .org-controls .org-depth { gap:6px; font-size:12px; }
 .org-controls .org-depth select { min-width:66px; min-height:44px; width:66px; padding:7px 5px; }
 .org-controls > .org-tools { gap:2px; }
 .org-controls [data-org-action="fit"] svg { display:none; }
 .org-controls [data-org-action="fit"] { width:auto; min-width:64px; padding:8px; white-space:nowrap; }
 .org-controls .org-zoom-label { min-width:37px; padding:0 2px; }
 .org-viewport { height:440px; min-height:320px; }
}
