/* Network map (#/graph, #/graph/<id>) and the dev page's detective extras. Uses style.css tokens. */
:root { --g-blue: #7aa7ff; }

.graph-page { padding-bottom: 32px; }
.graph-head h1 { font-size: clamp(26px, 5vw, 36px); margin: 4px 0 4px; }
.graph-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.g-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label2); padding: 4px 10px; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); cursor: pointer; }
.g-toggle input { accent-color: var(--mint); margin: 0; }

.graph-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.gf {
  display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font); color: var(--label3);
  padding: 5px 10px; border-radius: 999px; background: none; border: 1px solid var(--line); cursor: pointer;
}
.gf i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; opacity: 0.35; }
.gf.on { color: var(--label); background: var(--fill); }
.gf.on i { opacity: 1; }

.graph-box {
  position: relative; background: radial-gradient(ellipse at center, var(--surface), var(--bg) 85%);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 380px;
  touch-action: none; /* let d3 handle pinch and pan */
}
.graph-box .empty { padding-top: 140px; }
.graph-loading .list { border: 0; background: none; }
.graph-loading .skel { height: 380px; }
.graph-svg { display: block; width: 100%; user-select: none; -webkit-user-select: none; cursor: grab; }
.graph-svg:active { cursor: grabbing; }

.g-edge { fill: none; stroke-linecap: round; opacity: 0.75; transition: opacity 0.15s; }
.g-edge.dim { opacity: 0.08; }
.g-hit { stroke: transparent; stroke-width: 14; cursor: pointer; }
.g-node { cursor: pointer; transition: opacity 0.15s; outline: none; }
.g-node.dim { opacity: 0.18; }
.g-node.sel .g-shape, .g-node:focus-visible .g-shape { stroke: var(--label); stroke-width: 3; }
.g-glyph { font-size: 10px; text-anchor: middle; pointer-events: none; font-weight: 700; }
.g-label {
  font: 600 10px var(--mono); fill: var(--label2); text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round;
}
.g-node.seed .g-label { fill: var(--label); }
.zoomed-out .g-label { display: none; }
.zoomed-out .g-node.seed .g-label, .zoomed-out .t-mother .g-label { display: block; }

.graph-tip {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; max-width: 260px;
  background: var(--elevated); border: 1px solid var(--fill-strong); border-radius: 12px; padding: 8px 10px;
  font-size: 13px; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.graph-tip b { display: block; font-family: var(--mono); font-size: 12px; }
.graph-tip i { display: none; }

.graph-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 6px; }
.graph-zoom button {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--elevated);
  color: var(--label); font: 700 18px var(--font); cursor: pointer;
}
.graph-zoom button:hover { background: var(--fill-strong); }

.graph-legend { margin: 10px 0 0; }
.gl-nodes { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--label2); }
.gl { display: inline-flex; align-items: center; gap: 6px; }
.gl svg { flex: none; }

.graph-panel {
  margin: 14px 0 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); min-height: 64px;
}
.graph-panel p { margin: 0; }
.gp-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gp-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label3); }
.gp-title { font-weight: 700; font-size: 15px; margin: 4px 0 2px; word-break: break-all; }
.gp-title.num { font-family: var(--mono); font-size: 13px; }
.gp-note { color: var(--label2); font-size: 14px; margin: 2px 0 !important; }
.gp-list { margin: 6px 0; padding-left: 18px; color: var(--label2); font-size: 14px; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.graph-disclaimer { margin-top: 14px; font-size: 13px; }

/* Dev page: launch-hour histogram */
.intel-hours {
  display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 64px;
  padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.intel-hours i { display: block; min-height: 2px; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, var(--violet), rgba(158, 143, 255, 0.35)); }
.intel-hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--label4); padding: 2px 8px 0; }

@media (max-width: 600px) {
  .graph-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .gf { flex: none; }
  .graph-tip { display: none; }
}
