main {max-width:1540px}
#organization {margin:0 0 .4rem; color:#a9c1ce; overflow-wrap:anywhere}
#identity {display:flex; gap:.8rem; align-items:center; margin-bottom:1rem; color:#bdd0df}
#identity img {width:44px;height:44px;object-fit:contain;border-radius:.5rem}
#summary {margin:0; font-variant-numeric:tabular-nums}
.org-layout {display:grid; grid-template-columns:minmax(175px,230px) minmax(0,1fr); gap:1rem}
aside,.chart {min-width:0; border:1px solid var(--border); border-radius:14px; background:#10202b; padding:1rem}
aside h2 {margin-top:1.15rem;margin-bottom:.35rem}
aside ul {padding:0; margin:0; list-style:none; max-height:17rem; overflow:auto}
aside li {margin-bottom:.3rem; overflow-wrap:anywhere}
aside button {text-align:left; width:100%; background:#122b3a; color:#e8f4fa; border-color:#345262; font-size:.88rem; padding:.35rem .55rem; overflow-wrap:anywhere}
.chart {padding:.75rem}
.chart-tools {display:flex; gap:.45rem; flex-wrap:wrap; align-items:center}
.chart-tools button {padding:.35rem .65rem}
.chart-tools output {font-variant-numeric:tabular-nums; padding:0 .35rem}
.checkbox {display:flex; align-items:center; gap:.4rem; margin:0}
.checkbox input {appearance:auto; height:1rem; width:1rem; min-height:0}
.legend {color:var(--muted); margin:.55rem 0; font-size:.82rem}
.legend {display:flex; flex-wrap:wrap; column-gap:.85rem}
.legend span::before {content:""; display:inline-block; width:1.25rem; margin-right:.3rem; vertical-align:middle; border-top:2px solid #5fa4b9}
.legend .communication::before {border-top:2px dashed #ad9acb}
.legend .collaboration::before {border-top:3px dotted #d6ad64}
.chart-tools > label:has(select) {margin:0; flex:1; min-width:min(100%,11rem)}
#graph-view {margin-top:.65rem}
#post-list {padding:0; margin:.8rem 0 0; list-style:none; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap:.55rem}
#post-list button {display:grid;text-align:left; width:100%;height:100%;min-height:4.5rem;gap:.15rem;overflow-wrap:anywhere}
#post-list span {font-size:.83rem; font-weight:400; color:#c4dbe5}
nav {gap:1rem}
nav a:last-child {text-align:right}
#viewport {overflow:auto; height:clamp(360px,58vh,780px); border-radius:9px; background:#081722; border:1px solid #263e4e; background-image:radial-gradient(#365063 1px, transparent 1px); background-size:18px 18px}
#chart-size {position:relative;overflow:hidden;min-width:100%; min-height:100%}
#canvas {position:absolute; transform-origin:top left}
#links,#cards {position:absolute; inset:0; width:100%; height:100%}
#links {pointer-events:none}
#links path {fill:none;stroke-width:2}
#links .hierarchy {stroke:#5fa4b9}
#links .communication {stroke:#ad9acb;stroke-dasharray:5 5}
#links .collaboration {stroke:#d6ad64;stroke-dasharray:9 4 2 4}
.post {position:absolute; width:210px; height:132px; overflow:hidden; background:#132b38; color:#eefaff; border:1px solid #426273; border-left:4px solid #7bb9c8; border-radius:12px; padding:.65rem .65rem .65rem .75rem; text-align:left; display:flex; flex-direction:column; gap:.2rem}
.post:hover {background:#1a3a49}
.post[data-kind=leader] {border-left-color:#a7eff5}
.post[data-kind=ai] {border-left-color:#c5b0f1}
.post[data-kind=vacant] {border-left-color:#d4ac6d}
.post .service,.post .kind {color:#b5cdd8;font-weight:400;font-size:.75rem}
.post > span {max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.post .occupant {display:flex;align-items:center;gap:.35rem; font-size:.93rem; margin-top:auto}
.post .occupant img {width:26px;height:26px;object-fit:cover;border-radius:50%}
#cards.movable .post {cursor:grab;touch-action:none}
#cards.movable .post:active {cursor:grabbing}
dialog {background:#112431;color:#e8f4fa;border:1px solid #426273;border-radius:16px;padding:1.2rem;max-width:min(550px,94vw);width:100%;max-height:88vh;overflow:auto}
dialog::backdrop {background:#020913bb}
dialog h2 {margin:0 0 1rem}
dialog .actions {margin:1rem 0 0}
dialog .error {color:#ffc09e}
#editor-error:empty {display:none}
#editor-error {color:#ffc09e}
dialog .checkbox {margin:.6rem 0}
dialog ul {padding-left:1.1rem}
dialog li {margin:.5rem 0}
dialog li button {margin-left:.5rem}
@media(max-width:800px) {
  .org-layout {grid-template-columns:minmax(0,1fr)}
  .chart {grid-row:1}
  aside ul {max-height:12rem}
}
@media(max-width:460px) {
  main {padding-inline:.7rem}
  .toolbar {gap:.4rem}
  .toolbar button {font-size:.85rem}
  #viewport {height:410px}
}

.recruit-results {list-style:none; margin:0; padding:0; display:grid; gap:.45rem; max-height:42vh; overflow:auto}
.recruit-results li {display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.6rem; background:#142f3e; border-radius:.5rem; padding:.65rem; margin:0}
.recruit-results li > div {display:grid; gap:.12rem; overflow-wrap:anywhere}
.recruit-results li span,.recruit-results li small {font-size:.81rem;color:#c4dbe5}
.recruit-results li button {margin:0; padding:.35rem .55rem; font-size:.85rem}
.recruit-results img,.recruit-profile img,.portrait-preview img {width:50px;height:50px;object-fit:cover;border-radius:.5rem}
.recruit-profile,.portrait-preview {display:flex;align-items:center;gap:.8rem}
.agent-status {display:grid;grid-template-columns:minmax(9rem,1fr) minmax(0,1fr);gap:.35rem;font-size:.9rem}
.agent-status dt {font-weight:650}
.agent-status dd {margin:0;overflow-wrap:anywhere}
#people li img,#post-list li img {width:27px;height:27px;object-fit:cover;border-radius:50%;vertical-align:middle;margin-right:.5rem}
@media(max-width:420px) {
  .recruit-results {max-height:33vh}
  .recruit-results li {gap:.38rem; padding:.4rem}
  .recruit-results img {width:34px;height:34px}
  .recruit-results li button {font-size:.74rem;padding:.3rem}
}
