/* Graph: neighbourhood and clusters (graph.js). Hex tile hover/focus and .hx-pill live in org.css. */
.g-head { gap: 12px 24px; }
.g-cap { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }

/* ---- neighbourhood: toolbar ---- */
.g-toolbar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; background: var(--surface); border-radius: 28px; padding: 8px 20px; }
.g-toolbar .select { flex: 0 1 300px; min-width: 0; padding: 0 12px; }
.g-checks { display: flex; flex-wrap: wrap; gap: 0 20px; }
.g-checks label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.g-checks input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.g-maplink { display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; }
.g-maplink:hover { text-decoration: underline; }

/* ---- neighbourhood: map and side column ---- */
.g-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.g-map { flex: 3 1 480px; padding: 16px 0; gap: 8px; }
.g-maphead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 20px; }
.g-back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); font-weight: 500; }
.g-back:hover { border-color: var(--ink); }
.g-rel { font-size: 12px; line-height: 1.2; font-style: italic; }
.g-more { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 8px 20px 4px; }
.g-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.g-card { padding: 24px; gap: 12px; }
.g-focus { display: flex; gap: 12px; align-items: flex-start; margin-top: -4px; }
.g-title { font: 600 20px/1.25 var(--font-display); overflow-wrap: anywhere; }
.g-stats { padding-top: 12px; border-top: 1px solid var(--border); color: var(--ink-2); }
.g-legend { display: flex; flex-direction: column; gap: 8px; }
.g-legend > div { display: flex; align-items: center; gap: 10px; }
.g-key { padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-2); }
.g-minidisc { display: flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; border-radius: 50%; background: #4A5364; color: #fff; font-size: 8px; font-weight: 600; }
.g-ring::after { content: ""; position: absolute; inset: 3px; background: var(--surface); clip-path: var(--hex-clip); }

/* ---- clusters ---- */
.g-clusters { flex-direction: row; flex-wrap: wrap; gap: 24px 32px; align-items: flex-start; padding: 26px 28px; }
.g-clegend { flex: 0 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.g-ctotal { padding: 10px 0; border-top: var(--rule-hero); border-bottom: var(--rule-hero); }
.g-ctotal h2 { margin: 0; font: 600 20px/1.3 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; }
.g-ctotal div { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.g-clegend .dim-group { opacity: 0.5; }
.g-unit { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; border: 0; background: transparent; font: 600 15px/1.2 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; text-align: left; cursor: pointer; }
.g-unit[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: 4px; }
.g-clegend ol { margin: 0 0 0 26px; padding: 0; list-style: none; }
.g-clegend ol button { display: flex; gap: 6px; align-items: baseline; width: 100%; min-height: 30px; padding: 3px 0; border: 0; background: transparent; color: var(--ink-2); font-size: 13px; text-align: left; cursor: pointer; }
.g-clegend ol button:hover, .g-unit:hover span { text-decoration: underline; }
.g-clegend ol button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.g-clegend .no { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 400; }
.g-cmain { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
@media (pointer: coarse) { .g-unit, .g-clegend ol button { min-height: 40px; } }
.g-clegend ol button { justify-content: space-between; gap: 12px; }
.g-ctools { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; justify-content: space-between; }
.g-zoom { display: flex; gap: 6px; }
.g-tool { min-width: 40px; min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); font: 500 15px/1 var(--font-text); color: var(--ink); cursor: pointer; }
.g-tool.wide { font-size: 13px; padding: 0 14px; }
.g-tool:hover { border-color: var(--ink); }
.g-tool[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* the force graph (forcegraph.js) */
.fg-wrap { position: relative; height: clamp(460px, 68vh, 820px); border-radius: var(--radius-tile); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; touch-action: none; }
.fg-canvas { display: block; cursor: grab; outline: none; }
.fg-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.fg-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 2px; max-width: 280px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(17, 18, 22, 0.18); }
.fg-tip[hidden] { display: none; } /* display:flex above would otherwise beat the hidden attribute */
.fg-tip b { font-size: 13px; font-weight: 600; }
.fg-tip span { color: rgba(255, 255, 255, 0.78); }
.fg-tip .hx-pill { align-self: flex-start; margin: 4px 0 0; }
.g-cmain:fullscreen { background: var(--bg); padding: 20px; }
.g-cmain:fullscreen .fg-wrap { flex: 1; height: auto; }
.g-ckey { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 12px; border-top: var(--rule-row); font-size: 12px; color: var(--ink-2); }
.g-ckey span { display: flex; align-items: center; gap: 6px; }
.g-ckey i { display: block; flex: none; border-radius: 50%; box-sizing: border-box; box-shadow: 0 0 0 1px var(--border); }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.g-chips .chip { border: 0; cursor: pointer; font: inherit; font-size: 13px; }

/* ---- clusters: selection panel ---- */
.split[data-graph="sel"] .split-main { padding: 24px 28px; gap: 12px; }
.split[data-graph="sel"] .split-hl { padding: 24px 28px; justify-content: space-between; gap: 16px; }
.split[data-graph="sel"] .split-hl .eyebrow { padding: 0; }
.split[data-graph="sel"] .btn { justify-content: space-between; }
.g-selhead { display: flex; gap: 14px; align-items: center; }
.g-ringmark { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 5px solid; background: var(--surface); }
.g-ringmark.solid { border-color: var(--ink) !important; border-width: 4px; }
.g-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 4px 20px; }
.g-rank { display: grid; grid-template-columns: 20px 26px 1fr auto; gap: 8px; align-items: center; min-height: 40px; padding: 4px 0; border-top: 1px dotted var(--border); font-size: 13px; }
.g-rank:hover .name { text-decoration: underline; }
.g-rank .no { color: var(--ink-3); font-weight: 600; }
.g-rank .name { font-weight: 500; min-width: 0; }
.g-rank .level { font-size: 12px; gap: 5px; }
.g-disc { width: 26px; height: 26px; font-size: 10px; }
button.chip:hover { background: var(--border); }
