/* Related sectors as a network (MAR-789, scripts/lib/sector-network.mjs).
   Three columns from 720px of container width: part of | the sector and its
   sub-sectors | closest sectors. Narrower, the groups stack as plain lists
   and the lines are not drawn. */
.sn { position: relative; display: grid; grid-template-columns: 1fr; row-gap: 20px; container-type: inline-size; }
.sn-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; }
.sn-lines path { stroke: var(--border-mid); }
.sn-lines path.is-active { stroke: var(--blue); }
.sn-group { position: relative; min-width: 0; }
.sn-title { margin: 0 0 12px; font: 600 0.6875rem/1.3 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-light); }
.sn-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sn-node { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; border: 1px solid var(--border-light); border-radius: 6px; background: var(--surface-card, var(--navy-light)); font: 500 0.8125rem/1.35 var(--font-sans); color: var(--white); text-decoration: none; outline: none; transition: border-color .15s ease; }
.sn-node:hover, .sn-node:focus-visible { border-color: var(--blue); }
a.sn-node:hover .sn-name { color: var(--blue); }
.sn-name { min-width: 0; }
.sn-n { margin-left: auto; flex: none; padding-left: 8px; font-size: 0.6875rem; color: var(--text-light); font-variant-numeric: tabular-nums; }
.sn-focus { display: none; flex-direction: column; justify-content: center; width: fit-content; max-width: 100%; min-height: 56px; padding: 8px 16px; border-radius: 8px; background: var(--blue); color: var(--on-accent, #fff); /* theme-guardrail-allow: text on the accent fill */ }
.sn-focus strong { font: 600 0.9375rem/1.35 var(--font-sans); }
.sn-focus span { font: 500 0.6875rem/1.3 var(--font-sans); opacity: 0.8; font-variant-numeric: tabular-nums; }
.sn-foot { margin: 16px 0 0; font: 500 0.6875rem/1.4 var(--font-sans); color: var(--text-light); }

@container (min-width: 720px) {
    .sn-focus { display: flex; }
    .sn-n-unit { display: none; }
}
/* The grid itself is the container's child, so the columns are set on the
   section's inner width instead. */
@media (min-width: 1101px) {
    .sn { column-gap: 40px; }
    .sn.has-parents.has-related { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.25fr); grid-template-rows: auto auto 1fr; }
    .sn.has-parents:not(.has-related) { grid-template-columns: minmax(0, 0.85fr) minmax(0, 2.35fr); grid-template-rows: auto auto 1fr; }
    .sn.has-related:not(.has-parents) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .sn .sn-focus { display: flex; }
    .sn .sn-n-unit { display: none; }
    .sn.has-parents .sn-parent { grid-column: 1; grid-row: 1; }
    .sn.has-parents .sn-focus { grid-column: 2; grid-row: 2; }
    .sn.has-parents .sn-child { grid-column: 2; grid-row: 3; }
    .sn.has-parents .sn-related { grid-column: 3; grid-row: 1 / span 3; }
    .sn:not(.has-parents) .sn-focus { grid-column: 1; grid-row: 1; }
    .sn:not(.has-parents) .sn-child { grid-column: 1; grid-row: 2; }
    .sn:not(.has-parents) .sn-related { grid-column: 2; grid-row: 1 / span 2; }
    .sn-child { padding-left: 30px; }
    .sn-child ul { max-width: 24rem; }
    .sn-related { padding-left: 80px; }
}
@media (max-width: 1100px) {
    .sn .sn-focus { display: none; }
    .sn .sn-n-unit { display: inline; }
    .sn-foot { display: none; }
}
