/* The graph page: a side panel of controls, the drawing, and what is selected. */
body.graph-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.graph-layout { flex: 1; display: flex; min-height: 0; }
.graph-side { width: 300px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-soft); padding: 8px 0 30px; font-size: .88em; }
.side-block { padding: 6px 12px; border-bottom: 1px solid var(--line); }
details.side-block > summary { cursor: pointer; font-weight: 600; color: var(--text-soft); padding: 3px 0; list-style: none; display: flex; align-items: center; }
details.side-block > summary::-webkit-details-marker { display: none; }
details.side-block > summary::before { content: "▸"; margin-right: 6px; color: var(--text-faint); transition: transform .15s; display: inline-block; }
details.side-block[open] > summary::before { transform: rotate(90deg); }
.side-block .tools { margin-left: auto; font-weight: 400; font-size: .9em; }
.side-block .row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.side-block label.row input[type=range] { flex: 1; min-width: 60px; }
.side-block label.row span { min-width: 38px; text-align: right; font-family: var(--mono); font-size: .9em; color: var(--text-soft); }
.side-block input[type=search] { width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.side-block select { flex: 1; padding: 3px 6px; }
.search-results { max-height: 260px; overflow-y: auto; }
.search-results div { padding: 4px 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 4px; }
.search-results div:hover, .search-results div.active { background: var(--bg-hover); color: var(--accent); }
.search-results small { margin-left: auto; }
.checklist label { display: flex; align-items: center; gap: 5px; padding: 1px 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checklist label img { width: 16px; height: 16px; }
.checklist label small { margin-left: auto; padding-left: 6px; }
.checklist .group-title { font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 8px 0 2px; }
.folders ul { list-style: none; margin: 0; padding-left: 12px; }
.folders > ul { padding-left: 0; }
.folders .fname { cursor: pointer; font-weight: 600; color: var(--text-soft); display: block; padding: 2px 0; }
.folders .fname::before { content: "▸ "; color: var(--text-faint); }
.folders li.open > .fname::before { content: "▾ "; }
.folders li > ul { display: none; }
.folders li.open > ul { display: block; }
.folders .fnode { cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 1px 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folders .fnode img { width: 14px; height: 14px; }
.folders .fnode:hover, .folders .fnode.active { color: var(--accent); }
.graph-main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.graph-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: .88em; }
.graph-bar .spacer { flex: 1; }
.graph-canvas { flex: 1; position: relative; background: #fbfbfc; min-height: 0; }
.graph-canvas svg, .graph-canvas #cy { width: 100%; height: 100%; position: absolute; inset: 0; }
#d3 .node { cursor: pointer; }
#d3 .node text { font-size: 11px; fill: #202124; paint-order: stroke; stroke: #fbfbfc; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
#d3 .node.centre circle, #d3 .node.centre rect { stroke: var(--accent); stroke-width: 3px; }
#d3 .edge { fill: none; }
#d3 .edge-label { font-size: 9px; fill: #5f6368; paint-order: stroke; stroke: #fbfbfc; stroke-width: 3px; pointer-events: none; }
#d3 .dim { opacity: .12; }
#d3 .hl line, #d3 line.hl { stroke: var(--accent) !important; stroke-width: 2.4px; }
.tooltip { position: absolute; pointer-events: none; background: rgba(32,33,36,.92); color: #fff; padding: 6px 9px; border-radius: 5px; font-size: .8em; max-width: 300px; display: none; z-index: 5; }
.tooltip img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.graph-info { position: absolute; right: 12px; top: 52px; width: 320px; max-height: calc(100% - 70px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(0,0,0,.12); padding: 12px 14px; font-size: .88em; z-index: 6; }
.graph-info h3 { margin: 0 0 4px; font-size: 1.1em; display: flex; gap: 6px; align-items: center; }
.graph-info h3 img { width: 22px; height: 22px; }
.graph-info .close { position: absolute; right: 8px; top: 6px; border: 0; background: none; cursor: pointer; font-size: 1.2em; color: var(--text-faint); }
.graph-info ul { list-style: none; padding: 0; margin: 4px 0 10px; }
.graph-info li { display: flex; align-items: center; gap: 5px; padding: 2px 0; cursor: pointer; }
.graph-info li:hover { color: var(--accent); }
.graph-info li img { width: 14px; height: 14px; }
.graph-info .rel { color: var(--text-faint); font-size: .85em; white-space: nowrap; }
.graph-info .actions { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
@media (max-width: 820px) {
  body.graph-page { height: auto; overflow: auto; }
  .graph-layout { flex-direction: column; }
  .graph-side { width: 100%; max-height: 45vh; }
  .graph-canvas { height: 70vh; }
}
/* The types' icons, as meta.linked.archi publishes them, in the side panel, the search, the info panel and the tooltip. */
.checklist label .ti, .folders .fnode .ti, .search-results .ti, .graph-info li .ti, .tooltip .ti { width: 28px; height: 13px; margin: 0 3px 0 0; }
.checklist label .ti.pic img, .folders .fnode .ti.pic img, .search-results .ti.pic img, .graph-info li .ti.pic img, .tooltip .ti.pic img { width: 28px; height: 13px; }
.checklist label .ti.bare img, .folders .fnode .ti.bare img, .search-results .ti.bare img, .graph-info li .ti.bare img, .tooltip .ti.bare img { width: 13px; height: 13px; }
.graph-info h3 .ti { width: 44px; height: 21px; }
.graph-info h3 .ti.pic img { width: 44px; height: 21px; }
.graph-info h3 .ti.bare img { width: 20px; height: 20px; }
.graph-hint { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 4; max-width: 560px; background: #fff8e1;
  border: 1px solid #f0d080; border-radius: var(--radius); padding: 10px 14px; font-size: .88em; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.graph-hint .fixes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
