/* What the Map adds to the kit: the bars above the graph, and the graph itself, a stage of four lanes with its edges, nodes and chips. Colours come from tokens.css. */

.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; border-bottom: 1px solid var(--ln); font-size: 12px; }
.map-bar:first-child { gap: 8px 10px; padding: 12px 14px; }
/* An item named by a whole address keeps to its line, cut with an ellipsis where the bar is narrower than it. */
.map-bar .btn { max-width: 100%; min-width: 0; }
.map-path-item { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; min-width: 0; }
.map-path-item .ell { flex: 0 1 auto; }
.map-path-lane { color: var(--dim); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.map-box { overflow-x: auto; padding: 16px 20px 24px; }
.map-stage { position: relative; flex: none; }
.map-lane { position: absolute; top: 0; height: 26px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--ln2); color: var(--dim); font: 700 10.5px var(--font); text-transform: uppercase; letter-spacing: 0.06em; }
.map-edges { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map-edge { fill: none; stroke: var(--edge); stroke-width: 2; stroke-linecap: round; }
.map-edge.is-direct { stroke-dasharray: 5 4; }
.map-edge.is-on { stroke: var(--accm); stroke-width: 2.5; }
.map-edge.is-dim { opacity: 0.3; }

.map-node { position: absolute; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ln2); border-radius: 4px; background: var(--pn); }
.map-node.is-orphan { border-style: dashed; background: transparent; }
.map-node.is-on { border-color: var(--accm); }
.map-node.is-selected { border-color: var(--accm); box-shadow: 0 0 0 2px var(--accm); }
.map-node.is-dim { opacity: 0.38; }
.map-node.tone-ok { border-left: 3px solid var(--ok); }
.map-node.tone-low { border-left: 3px solid var(--wn); }
.map-node.tone-none { border-left: 3px solid var(--no); background: var(--nobg); }
.map-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; padding: 6px 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.map-pick:focus-visible { outline-offset: -2px; }
.map-r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.map-r1 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.map-r1 b.mono { font-size: 10.5px; font-weight: 500; }
.map-tile { min-width: 16px; height: 16px; font-size: 8.5px; }
.map-r2 { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--dim); font-size: 11px; white-space: nowrap; }
.map-r2.tone-ok { color: var(--ok); font-weight: 600; }
.map-r2.tone-low { color: var(--wn); font-weight: 600; }
.map-r2.tone-none { color: var(--no); font-weight: 600; }
.map-node .role { padding: 0 4px; font-size: 10px; line-height: 14px; }
.map-clock { height: 5px; flex: none; margin: 0 8px 3px; overflow: hidden; border-radius: 3px; background: var(--ln); }
.map-clock i { display: block; height: 100%; background: currentColor; }
.map-clock.tone-ok { color: var(--ok); }
.map-clock.tone-low { color: var(--wn); }
.map-clock.tone-none { color: var(--no); }
.map-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 8px 5px; }
.map-chip { display: inline-flex; align-items: center; gap: 4px; height: 18px; max-width: 100%; padding: 0 6px; overflow: hidden; border: 1px solid var(--ln2); border-radius: 999px; background: var(--pn2); font: 500 10.5px var(--font); white-space: nowrap; cursor: pointer; }
.map-chip:hover { border-color: var(--dim); }
.map-chip.is-selected { border-color: var(--accm); box-shadow: 0 0 0 2px var(--accm); }
.map-chip .web2-word { padding: 2px 4px; font-size: 8.5px; }
.map-alert { margin: 0 8px 3px; padding: 1px 6px; border: 1px solid var(--no); border-radius: 4px; background: var(--nobg); color: var(--no); font-size: 10.5px; font-weight: 600; white-space: nowrap; }

/* A window narrower than the stage and the panel together scales the stage down, so that the graph fits beside an open panel; narrower still, the graph scrolls in its own box. */
@media (max-width: 1419px) and (min-width: 1081px) { .map-page.has-panel .map-stage { zoom: 0.81; } }
