.map-figure { margin:20px 0 0; background:var(--cream-raised); border:1px solid var(--rule); border-radius:0; overflow:hidden; }
.map-caption { display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; padding:18px 22px 10px; font-size:0.78rem; }
.map-caption strong { font-family:var(--font); font-size:1.2rem; font-weight:400; margin-right:auto; }
.map-key { display:inline-flex; gap:8px; align-items:center; color:var(--ink-muted); }
.edge-key { display:inline-block; width:26px; border-top:2px solid var(--focus); }
.edge-key.skip { border-top:2px dashed var(--warning); }
.map-summary { margin:0; padding:0 22px 16px; font-size:0.85rem; }
.abstraction-map { overflow:auto; border-top:1px solid var(--rule); }
.abstraction-map svg { display:block; width:auto; min-width:100%; max-width:none; height:auto; border:0; border-radius:0; font-family:var(--font-ui); }
.abstraction-map g[data-node] { cursor:pointer; outline:none; }
.abstraction-map .node-card { fill:var(--cream-raised); stroke:#4e7777; stroke-width:1; }
.abstraction-map g[data-node]:hover .node-card, .abstraction-map g[data-node]:focus .node-card { fill:var(--signal-bg); stroke:var(--focus); stroke-width:2; }
.abstraction-map .node-name { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; fill:var(--ink); }
.site-main .map-figure .map-footnote { padding:14px 22px; margin:0; border-top:1px solid var(--rule); font-size:0.78rem; max-width:none; }
.map-measure-detail { overflow:auto; }
.map-measure-detail table { border-collapse:collapse; width:100%; font-size:0.82rem; white-space:nowrap; }
.map-measure-detail th, .map-measure-detail td { text-align:left; padding:8px 14px 8px 0; border-bottom:1px solid var(--rule); }
.map-measure-detail th { font-weight:600; }
.abstraction-map g[data-clones]:not([data-clones="0"]) .node-card { fill:#302719; stroke:var(--warning); }
.abstraction-map .node-clones { font-size:11px; fill:var(--warning); }

.abstraction-map .node-card { rx:0; }
.abstraction-map svg > rect { fill:var(--cream); }
.abstraction-map svg > rect:nth-of-type(even) { fill:var(--cream-raised); }
.abstraction-map svg > text { fill:var(--ink-muted); }
.abstraction-map [data-edge] { stroke:var(--focus); }
.abstraction-map [data-edge][stroke-dasharray] { stroke:var(--warning); }
.abstraction-map marker path { fill:var(--focus); }
.abstraction-map marker[id$="skip-arrow"] path { fill:var(--warning); }

/* Scope first: nested package/type groups, then one definition's neighbours. */
.structure-toolbar { display:flex; flex-wrap:wrap; gap:8px; padding:14px; border-bottom:1px solid var(--rule); }
.abstraction-map button { font:inherit; cursor:pointer; border:1px solid var(--rule); border-radius:0; background:var(--cream); color:var(--focus); padding:8px 10px; text-align:left; overflow-wrap:anywhere; }
.abstraction-map button:hover, .abstraction-map button:focus-visible { background:var(--signal-bg); border-color:var(--focus); }
.structure-toolbar button { font-size:.8rem; }
.structure-toolbar button[aria-pressed="true"] { background:var(--signal-bg); border-color:var(--focus); color:var(--ink); }
.structure-browser { padding:20px; color:var(--ink); }
.structure-browser h3 { font-size:1.05rem; overflow-wrap:anywhere; margin:12px 0; }
.structure-browser h4 { font-size:.8rem; font-weight:500; text-transform:uppercase; letter-spacing:.04em; color:var(--violet); margin:0 0 14px; }
.structure-browser p { font-size:.82rem; line-height:1.65; }
.structure-browser nav { display:flex; flex-wrap:wrap; gap:8px; }
.structure-browser label { display:block; margin-top:20px; font-size:.82rem; }
.structure-browser input { display:block; width:min(100%,32rem); min-width:0; margin:8px 0; background:var(--code-bg); color:var(--ink); border:1px solid var(--rule); padding:10px; font:inherit; }
.structure-empty { color:var(--ink-muted); }
.structure-package { border:1px solid var(--rule); margin:12px 0; }
.structure-package > summary { padding:14px; background:var(--cream-raised); color:var(--ink); overflow-wrap:anywhere; cursor:pointer; }
.structure-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:8px 14px 14px; }
.structure-groups > p, .structure-single-types { grid-column:1 / -1; }
.structure-single-types { margin-top:18px; border-top:1px dashed var(--rule); padding-top:14px; }
.structure-single-types[open] { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.structure-single-types > summary { cursor:pointer; color:var(--ink-muted); font-size:.82rem; }
.structure-single-types > summary { grid-column:1 / -1; }
.structure-group-label { color:var(--violet); }
.structure-type { border:1px solid var(--rule); border-top:2px solid var(--violet); padding:14px; min-width:0; }
.structure-type > code { display:block; border-top:1px solid var(--rule); padding-top:12px; color:var(--ink-muted); }
.structure-browser code { font-family:var(--mono); white-space:normal; overflow-wrap:anywhere; color:var(--ink); background:transparent; padding:0; font-size:.78rem; }
.structure-browser ul { list-style:none; padding:0; margin:12px 0 0; }
.structure-browser li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin:8px 0; font-size:.78rem; }
.structure-type ul { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.structure-type li { margin:0; }
.structure-neighbourhood { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr); gap:36px; margin:24px 0; align-items:center; }
.structure-neighbourhood > section { position:relative; min-width:0; padding:14px; border:1px solid var(--rule); }
.structure-neighbourhood > section[data-connects="true"]:not(:last-child)::after { content:""; position:absolute; width:24px; height:8px; left:calc(100% + 6px); top:50%; background:var(--focus); clip-path:polygon(0 40%,75% 40%,75% 0,100% 50%,75% 100%,75% 60%,0 60%); }
.structure-selected { background:var(--signal-bg); border-color:var(--focus) !important; }
.structure-selected strong { display:block; font-size:1rem; margin-bottom:14px; overflow-wrap:anywhere; }
.structure-selected > code { display:block; }
.structure-neighbours ul { max-height:360px; overflow:auto; }
.structure-neighbours li { display:block; padding-bottom:10px; border-bottom:1px solid var(--rule); }
.structure-neighbours small { display:block; color:var(--ink-muted); overflow-wrap:anywhere; margin-top:4px; }
.structure-neighbours button { width:100%; }
.structure-scope { border-top:1px dashed var(--rule); color:var(--ink-muted); padding-top:14px; }
@media(max-width:640px) {
  .structure-browser { padding:12px; }
  .structure-groups { padding:6px 10px 10px; }
  .structure-groups, .structure-single-types[open] { grid-template-columns:1fr; }
  .structure-neighbourhood { grid-template-columns:1fr; }
  .structure-neighbourhood > section[data-connects="true"]:not(:last-child)::after { left:calc(50% - 12px); top:calc(100% + 14px); transform:rotate(90deg); }
  .structure-neighbours ul { max-height:180px; }
}
