/* Dark Factory brain-map surface — copied from 12 UI/dark-factory-design/surfaces/surfaces.css.
   Colors come from the page's own tokens (see .org-graph in dialer-admin.html). */
/* ── BRAIN RINGS ── */
.dfb { position: relative; width: 100%; }
.dfb svg { display: block; width: 100%; height: auto; }
.dfb .edge { stroke: var(--border-light); stroke-width: 1; fill: none; transition: stroke var(--fast), opacity var(--fast); }
.dfb .edge.hot { stroke: var(--cyan); opacity: 1; }
.dfb .ring { fill: none; stroke: var(--border); stroke-dasharray: 2 6; }
.dfb .n circle { transition: r var(--fast), opacity var(--fast); cursor: pointer; }
.dfb .n text { font: 10px var(--font-mono); fill: var(--text-dim); pointer-events: none; transition: opacity var(--fast); }
.dfb .n.root text { font-size: 12px; fill: var(--text); font-weight: 600; }
.dfb.focus .n:not(.hot) { opacity: .18; }
.dfb.focus .edge:not(.hot) { opacity: .08; }
.dfb .n.hot text { fill: var(--text); }
.dfb .n { animation: dfb-pop .5s var(--ease-pop) both; transform-box: fill-box; transform-origin: center; }
@keyframes dfb-pop { from { opacity: 0; transform: scale(.4); } }


/* ── ORG TREE ── copied from 12 UI/dark-factory-design/surfaces/surfaces.css.
   Colors come from the page's own tokens (see .acc-org in brain-hub.html). */
@keyframes df-rise { from { opacity: 0; transform: translateY(6px); } }
.dfo { color: var(--text); }
.dfo-root { display: flex; flex-direction: column; align-items: center; }
.dfo-node {
    position: relative; background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: var(--r-lg); padding: 9px 12px; text-align: left; width: 100%;
    animation: df-rise .35s var(--ease-pop) both;
    transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.dfo-node.click { cursor: pointer; }
.dfo-node.click:hover { border-color: var(--cyan-hover); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.dfo-node.root { width: auto; min-width: min(280px, 100%); text-align: center; padding: 12px 18px; }
.dfo-node.wait { border-style: dashed; }
.dfo-node.live { border-color: var(--cyan-line); border-style: solid; }
.dfo-node.plan { border-style: dashed; border-color: var(--amber); }
.dfo-node.sel  { border-color: var(--cyan-hover); box-shadow: 0 0 22px var(--cyan-glow); }
.dfo-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.dfo-name .df-dot { flex-shrink: 0; }
.dfo-type { margin-left: auto; font: 8.5px var(--font-mono); letter-spacing: .14em; color: var(--text-muted); text-transform: uppercase; }
.dfo-meta { margin-top: 3px; padding-left: 14px; font-size: 10.5px; color: var(--text-dim); line-height: 1.5; }
.dfo-head { display: flex; align-items: center; justify-content: center; gap: 0; max-width: 100%; }
.dfo-head .dfo-node { width: 170px; flex-shrink: 1; min-width: 0; }
.dfo-head .dfo-node.root { width: 250px; min-width: 0; flex-shrink: 0; }
@media (max-width: 640px) {
    .dfo-head { flex-direction: column; gap: 6px; }
    .dfo-head .dfo-node, .dfo-head .dfo-node.root { width: min(280px, 78vw); }
    .dfo-head .dfo-hline { display: none; }
    .dfo-head .dfo-node.root { order: -1; }
}
.dfo-head .dfo-hline { width: 34px; height: 1px; background: var(--border-light); }
.dfo-wire { position: relative; width: 1px; height: 22px; margin: 0 auto; background: var(--border-light); flex: none; }
.dfo-wire.live { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }
.dfo-wire.live::after {
    content: ''; position: absolute; left: -1px; width: 3px; height: 5px; border-radius: 2px;
    background: var(--text); animation: dfo-flow 1.3s linear infinite;
}
@keyframes dfo-flow { from { top: 0; opacity: 1; } to { top: 100%; opacity: 0; } }
.dfo-wire.plan { background: repeating-linear-gradient(to bottom, var(--amber) 0 4px, transparent 4px 8px); }
.dfo-wire i { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font: normal 8.5px var(--font-mono);
    letter-spacing: .1em; white-space: nowrap; color: var(--text-muted); }
.dfo-wire.live i { color: var(--cyan); }
/* the tree: root on top → bracket → one row of crews → each crew's kids hang below.
   .dfo scrolls sideways when a team is wider than the screen; the page never does. */
.dfo { overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; }
.dfo-tree { width: max-content; min-width: 100%; margin: 0 auto; }
.dfo-crews { display: flex; justify-content: center; align-items: flex-start; }
.dfo-crew { position: relative; display: flex; flex-direction: column; gap: 0; width: 214px; flex: none;
    padding: 22px 9px 0; animation: df-rise .4s var(--ease-pop) both; }
/* bracket: each crew draws its half of the bar plus the drop line to its own top box */
.dfo-crew::before, .dfo-crew::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px;
    border-top: 1px solid var(--border-light); pointer-events: none; }
.dfo-crew::before { left: 0; }
.dfo-crew::after  { right: 0; border-left: 1px solid var(--border-light); }
.dfo-crews.live .dfo-crew::before, .dfo-crews.live .dfo-crew::after { border-top-color: var(--cyan-line); }
.dfo-crew.live::after { border-left-color: var(--cyan); box-shadow: -4px 0 8px -6px var(--cyan); }
.dfo-crew.plan::after { border-left-style: dashed; border-left-color: var(--amber); }
.dfo-crews .dfo-crew:first-child::before, .dfo-crews .dfo-crew:last-child::after { border-top-color: transparent; }
.dfo-crew > .dfo-node:first-child { border-top-width: 2px; }
.dfo-crew > .dfo-kids { gap: 6px; }
@media (max-width: 640px) { .dfo-crew { width: 190px; } }
.dfo-kids { display: flex; flex-direction: column; gap: 6px; }
.dfo-kids.pills { flex-direction: row; flex-wrap: wrap; }
.dfo-kids.pills > .dfo-node { width: auto; flex: 1 1 auto; padding: 5px 9px; border-radius: 999px; }
.dfo-kids.pills > .dfo-node .dfo-meta, .dfo-kids.pills > .dfo-node .dfo-type { display: none; }
.dfo-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding-left: 14px; }
.dfo-chips span { font: 9.5px var(--font-mono); letter-spacing: .04em; padding: 1px 7px; border-radius: 999px;
    border: 1px solid var(--border-light); color: var(--text-dim); }
.dfo-kids.pills > .dfo-node .dfo-chips { display: none; }
.dfo-empty { border: 1px dashed var(--border-light); border-radius: var(--r-lg); padding: 14px; text-align: center;
    font-size: 11px; color: var(--text-dim); line-height: 1.6; }
