/* Job roles, organization chart and directory. Colours come from the portal theme variables (per-organization branding). */
#orgRoles .or-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
#orgRoles .or-head p { max-width: 720px; }
#orgRoles .or-kpis { margin-bottom: 16px; }
#orgRoles .or-roles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
#orgRoles .or-role { display: grid; gap: 10px; align-content: start; }
#orgRoles .or-role-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
#orgRoles .or-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#orgRoles .or-desc { font-size: 13.5px; line-height: 1.5; }
.or-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
#orgRoles .or-links { display: flex; flex-wrap: wrap; gap: 6px; }
#orgRoles .or-link { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; background: var(--paper); }
#orgRoles .or-link b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-right: 6px; }
#orgRoles .or-holders { margin-top: 2px; }
#orgRoles .or-empty { padding: 6px 0; }
#orgRoles .or-note { background: var(--gold-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
#orgRoles .or-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
#orgRoles .or-filter input[type=search] { flex: 1 1 260px; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 13px; background: #fff; }
#orgRoles .or-people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
#orgRoles .or-person { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
#orgRoles .or-person:hover, #orgRoles .or-person:focus-visible { border-color: var(--gold); }
.or-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.or-avatar.big { flex-basis: 56px; width: 56px; height: 56px; font-size: 18px; }
.or-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
#orgRoles .or-who { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
#orgRoles .or-who strong, #orgRoles .or-who span, #orgRoles .or-who small { overflow-wrap: anywhere; }
#orgRoles .or-who small { color: var(--muted); font-size: 11.5px; }

/* Chart: a top-down tree with connector lines; scrolls sideways when it is wider than the page. */
#orgRoles .or-chart { overflow-x: auto; padding: 24px 16px; }
#orgRoles .or-tree, #orgRoles .or-tree ul { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; position: relative; }
#orgRoles .or-tree { width: max-content; min-width: 100%; gap: 28px; align-items: flex-start; }
#orgRoles .or-tree ul { padding-top: 20px; }
#orgRoles .or-tree li { position: relative; padding: 20px 6px 0; display: flex; flex-direction: column; align-items: center; }
#orgRoles .or-tree > li { padding-top: 0; }
#orgRoles .or-tree ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid var(--line); }
#orgRoles .or-tree ul > li::before, #orgRoles .or-tree ul > li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 20px; border-top: 2px solid var(--line); }
#orgRoles .or-tree ul > li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
#orgRoles .or-tree ul > li:first-child::before, #orgRoles .or-tree ul > li:last-child::after { border-top: 0; }
#orgRoles .or-tree ul > li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 8px 0 0; }
#orgRoles .or-tree ul > li:last-child::after { border-left: 0; }
#orgRoles .or-tree ul > li:first-child::after { border-radius: 8px 0 0 0; }
#orgRoles .or-tree ul > li:only-child::before { display: none; }
#orgRoles .or-tree ul > li:only-child::after { display: block; border-top: 0; border-radius: 0; border-left: 2px solid var(--line); }
#orgRoles .or-node { position: relative; width: 168px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 10px; }
#orgRoles .or-node.me { border-top-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
#orgRoles .or-node.group { background: var(--navy); border-color: var(--navy); color: #fff; }
#orgRoles .or-node.group small, #orgRoles .or-node.group span { color: #ffffffc0; }
#orgRoles .or-node.vacant { border: 1px dashed var(--warning); border-top-width: 3px; background: #fffaf0; }
#orgRoles .or-node-main { display: grid; gap: 2px; width: 100%; padding: 10px 10px 12px; text-align: center; background: none; border: 0; font: inherit; color: inherit; }
#orgRoles button.or-node-main { cursor: pointer; }
#orgRoles .or-node-main strong { font-size: 13px; overflow-wrap: anywhere; }
#orgRoles .or-node-main span { font-size: 12px; overflow-wrap: anywhere; }
#orgRoles .or-node-main small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
#orgRoles .or-toggle { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); z-index: 1; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 11px; font-weight: 700; cursor: pointer; }
#orgRoles .or-loose { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 8px 0 0; padding: 0; }

@media (max-width: 720px) {
  #orgRoles .or-head { flex-direction: column; }
  #orgRoles .or-roles { grid-template-columns: 1fr; }
  /* On a phone the chart becomes an indented list. */
  #orgRoles .or-chart { padding: 14px 10px; }
  #orgRoles .or-tree, #orgRoles .or-tree ul { display: block; width: auto; min-width: 0; padding-top: 0; }
  #orgRoles .or-tree ul { margin-left: 14px; padding-left: 12px; border-left: 2px solid var(--line); }
  #orgRoles .or-tree li { display: block; padding: 6px 0 0; }
  #orgRoles .or-tree li::before, #orgRoles .or-tree li::after, #orgRoles .or-tree ul::before { display: none !important; }
  #orgRoles .or-node { width: 100%; }
  #orgRoles .or-node-main { text-align: left; padding: 8px 44px 8px 10px; }
  #orgRoles .or-toggle { left: auto; right: 8px; bottom: auto; top: 8px; transform: none; }
}
