/* ─────────────────────────────────────────────
   Graph page styles (relay-app#468)
   Consumes the global v3.5 tokens from @relay/ui (bare names already live).
   Only the two gc-kit aliases missing globally are defined here, PAGE-SCOPED
   under .graph-page so nothing leaks into the app-shell overhaul's token
   pipeline (VRU8V7). When that pipeline lands globally, these are harmless.
   ───────────────────────────────────────────── */

.graph-page {
  --ring: var(--accent-ui);
  --radius-card: var(--radius-lg);
}

/* ── type-filter chips (live counts; selection = tint + accent-text) ── */
.graph-page .gc-tchips { display: flex; flex-wrap: wrap; gap: 8px; }
.graph-page .gc-tchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--border-hi); border-radius: var(--radius-full);
  background: var(--bg); font: 500 12.5px var(--font); color: var(--text-2);
  cursor: pointer;
}
.graph-page .gc-tchip .g { color: var(--text-2); font-size: 12px; }
.graph-page .gc-tchip .n { font-family: var(--mono); font-size: 10.5px; color: var(--text-muted); }
/* Included (the default for all types) is the CALM state — a plain chip whose
   only accent is the teal type-glyph. The old solid-teal fill turned the resting
   toolbar into five loud pills that read as status, not toggles. */
.graph-page .gc-tchip[aria-pressed="true"] {
  background: var(--surface); border-color: var(--border-hi); color: var(--text);
}
.graph-page .gc-tchip[aria-pressed="true"] .g { color: var(--accent-ui); }
.graph-page .gc-tchip[aria-pressed="true"] .n { color: var(--text-muted); }
/* Excluded is the state that should stand out (something IS being filtered): the
   chip recedes and its count is struck. */
.graph-page .gc-tchip[aria-pressed="false"] { color: var(--text-faint); border-color: var(--border); opacity: .72; }
.graph-page .gc-tchip[aria-pressed="false"] .g { color: var(--text-faint); }
.graph-page .gc-tchip[aria-pressed="false"] .n { text-decoration: line-through; }

/* ── segmented control (Arrange lens, time window) ── */
.graph-page .gc-seg {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.graph-page .gc-seg-o {
  padding: 4px 11px; border: 0; background: transparent; cursor: pointer;
  font: 500 12.5px var(--font); color: var(--text-muted); border-radius: var(--radius-sm);
}
.graph-page .gc-seg-o[aria-selected="true"] { background: var(--accent-tint); color: var(--accent-text); }

/* ── honest counter ── */
.graph-page .gc-counter { font-family: var(--mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Code chip (copy + scramble) ── */
.graph-page .gc-code {
  display: inline-flex; align-items: center; padding: 2px 7px; border: 0;
  border-radius: var(--radius-sm); background: var(--teal-dim);
  font: 500 12px var(--mono); letter-spacing: 0.06em; color: var(--accent-text); cursor: pointer;
}
.graph-page .gc-code.is-copied { color: var(--success); }

/* ── status badge (neutral; label carries meaning, never color) ── */
.graph-page .gc-badge {
  font: 600 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius-sm); border: 0.5px solid var(--border-hi);
  color: var(--text-2); background: transparent; white-space: nowrap; flex: none;
}

/* ── list row (.gc-li ranked-twin anatomy) ── */
.graph-page .gc-list { display: flex; flex-direction: column; }
.graph-page .gc-li {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 4px;
  border: 0; border-bottom: 0.5px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; text-align: left; cursor: pointer;
}
.graph-page .gc-li:last-child { border-bottom: 0; }
.graph-page .gc-li[aria-current="true"] { outline: 2px solid var(--ring); outline-offset: -2px; }
.graph-page .gc-li .ico {
  width: 32px; height: 32px; flex: none; border-radius: var(--radius);
  background: var(--panel); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.graph-page .gc-li[aria-current="true"] .ico { background: var(--accent-tint); color: var(--accent-text); }
.graph-page .gc-li .main { flex: 1; min-width: 0; }
.graph-page .gc-li .title {
  display: block; font: 500 13px var(--font); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.graph-page .gc-li .title .code { font-family: var(--mono); color: var(--accent-text); letter-spacing: 0.04em; }
.graph-page .gc-li .sub { display: block; font-size: 12px; color: var(--text-muted); }

/* ── hover tooltip (dies when a panel pins) ── */
.graph-page .gc-tip {
  /* Flow normally inside the absolutely-positioned .graph-tip wrapper. If this
   * is itself absolute, it resolves its width against the wrapper's shrink-to-0
   * box and every word wraps onto its own line — the tall skinny tooltip bug. */
  width: max-content; max-width: 240px; padding: 9px 11px;
  border: 1px solid var(--border-hi); border-radius: var(--radius); background: var(--bg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10); pointer-events: none;
}
.graph-page .gc-tip .tip-title { overflow-wrap: anywhere; }
.graph-page .gc-tip .tip-type {
  font: 600 9.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.graph-page .gc-tip .tip-title { font: 500 13px var(--font); color: var(--text); margin: 2px 0; }
.graph-page .gc-tip .tip-meta { font-size: 11.5px; color: var(--text-muted); }

/* ── canvas control cluster ── */
.graph-page .gc-ctls { display: inline-flex; flex-direction: column; gap: 6px; }
.graph-page .gc-ctl {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 0.5px solid var(--border); border-radius: var(--radius); background: var(--bg);
  color: var(--text-2); font-size: 14px; cursor: pointer;
}
.graph-page .gc-ctl:hover { border-color: var(--ring); color: var(--text); }

/* ── health meter (attention share; fill is a UI element, not a type colour) ── */
.graph-page .gc-meter, .gc-meter {
  display: inline-block; width: 56px; height: 4px; border-radius: var(--radius-full, 9999px);
  background: var(--panel); overflow: hidden; vertical-align: middle;
}
.graph-page .gc-meter-fill, .gc-meter-fill { display: block; height: 100%; background: var(--accent-ui); }

/* ── manifest provenance line (read-only; via_code shown only when present) ── */
.graph-page .gc-prov, .gc-prov {
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted);
}
.graph-page .gc-prov strong, .gc-prov strong { font-weight: 600; color: var(--text-2); }

/* ── page layout (#470–#473) ── */
/* The .page host is content-sized (no fixed height), so height:100% would
   collapse the flex column and zero out the canvas. Anchor a real height:
   fill the shell's page area when it IS constrained, floor at 78vh when it
   isn't — either way the stage/canvas gets drawable height. */
.page.active.graph-page { display: flex; flex-direction: column; height: 100%; min-height: min(78vh, 760px); }
.graph-page .graph-head { position: relative; padding: 4px 4px 10px; }
.graph-page .graph-title { font: italic 400 30px var(--display); letter-spacing: -0.01em; color: var(--text); margin: 0; }
.graph-page .graph-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.graph-page .graph-viewtoggle { position: absolute; top: 4px; right: 4px; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.graph-page .gvt { padding: 4px 12px; border: 0; background: transparent; cursor: pointer; font: 500 12.5px var(--font); color: var(--text-muted); border-radius: var(--radius-sm); }
.graph-page .gvt[aria-selected="true"] { background: var(--accent-tint); color: var(--accent-text); }

.graph-page .graph-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 4px; border-top: 0.5px solid var(--border); }
.graph-page .graph-search { flex: 0 1 260px; padding: 7px 11px; border: 1px solid var(--border-hi); border-radius: var(--radius); background: var(--bg); font: 400 13px var(--font); color: var(--text); }
.graph-page .graph-counter-slot { margin-left: auto; }

.graph-page .graph-focuschrome { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.graph-page .graph-trail { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.graph-page .graph-crumb { border: 0; background: transparent; cursor: pointer; font: 500 12.5px var(--font); color: var(--accent-text); padding: 2px 4px; border-radius: var(--radius-sm); }
.graph-page .graph-crumb:last-child { color: var(--text); }
.graph-page .graph-crumb-sep { color: var(--text-faint); }

.graph-page .graph-stage { position: relative; flex: 1 1 auto; min-height: 66vh; border-top: 0.5px solid var(--border); overflow: hidden; }
/* touch-action:none — the canvas owns pinch/pan; without it the browser hijacks
   two-finger gestures as page zoom (the dark-bar overflow bug on mobile). */
.graph-page .graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.graph-page .graph-ctls-slot { position: absolute; left: 12px; bottom: 12px; z-index: 5; }
.graph-page .graph-tip { position: absolute; z-index: 40; }

/* empty / unavailable state — centered over the (blank) canvas; a bare canvas
   reads as broken. pointer-events:none so it never blocks canvas gestures. */
.graph-page .graph-empty {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 24px; pointer-events: none;
}
.graph-page .graph-empty-title { font: 600 15px var(--font); color: var(--text-2); }
.graph-page .graph-empty-hint { font-size: 12.5px; color: var(--text-muted); max-width: 320px; }
/* Only the transient-error state offers a retry. The overlay is pointer-events:none
   so gestures pass through to the canvas — re-enable them on the button alone. */
.graph-page .graph-empty-retry {
  margin-top: 10px; pointer-events: auto; cursor: pointer;
  font: 600 12.5px var(--font); color: var(--text-2);
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
}
.graph-page .graph-empty-retry:hover { border-color: var(--text-muted); color: var(--text-1); }

/* nodes present, but nothing connects them — guidance card (not the empty state) */
.graph-page .graph-noedges {
  position: absolute; inset: 0; z-index: 4; display: flex;
  align-items: center; justify-content: center; padding: 24px; pointer-events: none;
}
.graph-page .gne-card {
  pointer-events: auto; max-width: 340px; text-align: center;
  background: var(--bg); border: 0.5px solid var(--border-hi); border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,.10); padding: 18px 20px 20px;
}
.graph-page .gne-title { font: 600 14.5px var(--font); color: var(--text); }
.graph-page .gne-hint { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); margin-top: 6px; }
.graph-page .gne-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.graph-page .gne-act {
  cursor: pointer; font: 600 12.5px var(--font); padding: 7px 13px; border-radius: var(--radius);
  border: 0; background: var(--accent-ui); color: var(--on-accent);
}
.graph-page .gne-act:hover { filter: brightness(1.05); }
.graph-page .gne-act.gne-ghost { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-hi); }
.graph-page .gne-act.gne-ghost:hover { border-color: var(--text-faint); color: var(--text); }
.graph-page .gne-act:focus-visible { outline: 2px solid var(--accent-ui); outline-offset: 2px; }

.graph-page .graph-list { position: absolute; inset: 0; overflow: auto; padding: 4px 2px; background: var(--bg); }

/* detail panel (desktop right sidebar; bottom sheet ≤800px) */
.graph-page .graph-panel {
  position: absolute; top: 12px; right: 12px; width: 316px; max-height: calc(100% - 24px);
  overflow: auto; z-index: 20; padding: 16px; background: var(--bg);
  border: 0.5px solid var(--border-hi); border-radius: var(--radius-lg); box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.graph-page .gp-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; font: 400 15px/1 var(--font); color: var(--text-muted); background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.graph-page .gp-close:hover { color: var(--text); background: var(--surface); }
.graph-page .gp-head { padding-right: 30px; }
.graph-page .gp-type { font: 600 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.graph-page .gp-back { border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px 0 0; margin-right: 2px; }
.graph-page .gp-back:hover { color: var(--accent-text); }
.graph-page .gp-title { font: 500 16px var(--font); color: var(--text); margin: 4px 0 8px; }
.graph-page .gp-glyph { display: inline-flex; color: var(--text-2); }
.graph-page .gp-glyph svg { display: block; }
/* envelope spec grid (the gc-spec contract, RCTX-667) */
.graph-page .gp-spec { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 12.5px; margin: 0 0 2px; }
.graph-page .gp-spec dt { color: var(--text-muted); }
.graph-page .gp-spec dd { color: var(--text-2); margin: 0; }
.graph-page .gp-spec dd.mono { font-family: var(--mono); font-size: 11.5px; }
.graph-page .gp-sect { font: 600 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 6px; }
.graph-page .gp-rel { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 6px 4px; border-radius: var(--radius-sm); text-align: left; }
.graph-page .gp-rel:hover { background: var(--surface); }
/* relation column: dash-grammar sample + direction-aware name, fixed width so rows align */
.graph-page .gp-rel .rel { flex: none; width: 108px; display: inline-flex; align-items: center; gap: 5px; overflow: hidden; }
.graph-page .gp-rel .rel svg { flex: none; color: var(--text-faint); }
.graph-page .gp-rel:hover .rel svg { color: var(--text-muted); }
.graph-page .gp-rel .rel-name { font: 500 10px var(--mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.graph-page .gp-rel .ico { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--panel); font-size: 11px; color: var(--text-2); }
.graph-page .gp-rel .t { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-page .gp-more { font-size: 11.5px; color: var(--text-muted); padding: 4px; }
.graph-page .gp-locked { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; padding: 10px; border: 1px dashed var(--border-hi); border-radius: var(--radius); }
.graph-page .gp-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.graph-page .gp-act { width: 100%; height: auto; padding: 8px; font: 500 12.5px var(--font); justify-content: center; }
.graph-page .gp-act[data-ctl="enter-sel"] { background: var(--accent-tint); color: var(--accent-text); border-color: transparent; }
.graph-page .gp-hint { font-size: 11px; line-height: 1.4; color: var(--text-muted); margin-top: 2px; text-align: center; }

@media (max-width: 800px) {
  .graph-page .graph-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh;
    border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.16);
  }
  .graph-page .graph-panel[hidden] { visibility: hidden; pointer-events: none; }
}

/* ── phones (≤640px) ── The toolbar was a ~270px wall of wrapped controls that
   ate a third of the screen before the graph, and the counter overflowed the
   right edge. Each control group becomes a single sideways-scrolling strip; the
   counter wraps on its own row; the canvas gets the height back. */
@media (max-width: 640px) {
  .graph-page { min-height: 100%; }
  .graph-page .graph-title { font-size: 22px; }
  .graph-page .graph-sub { font-size: 12px; }
  .graph-page .graph-toolbar { gap: 8px; padding: 8px 2px; }
  .graph-page .graph-search { flex: 1 1 100%; }               /* full-width search */
  /* One row, scroll sideways, instead of wrapping into three rows of chips.
     The slot itself must take a full row and be allowed to shrink (min-width:0),
     or its nowrap child pushes the toolbar — and the page — wider than the
     viewport. The child then scrolls within the bounded slot. */
  .graph-page .graph-types { flex: 1 1 100%; min-width: 0; }
  .graph-page .gc-tchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .graph-page .gc-tchips::-webkit-scrollbar { display: none; }
  .graph-page .gc-tchip { flex: none; }
  /* Segmented groups get their own full-width scroll strip so a long lens row
     (Force/Time/Orbit/Heat/Owner) never overflows or wraps mid-control. */
  .graph-page .graph-arrange, .graph-page .graph-window { flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .graph-page .graph-arrange::-webkit-scrollbar,
  .graph-page .graph-window::-webkit-scrollbar { display: none; }
  .graph-page .graph-arrange .gc-seg, .graph-page .graph-window .gc-seg { width: max-content; }
  /* Counter: own full-width row, wraps rather than clipping "N total". */
  .graph-page .graph-counter-slot { margin-left: 0; width: 100%; }
  .graph-page .gc-counter { white-space: normal; line-height: 1.6; }
  /* Trim the canvas control cluster to essentials on a thumb-sized screen. */
  .graph-page .gc-ctl[data-ctl="stage"],
  .graph-page .gc-ctl[data-ctl="copy-link"] { display: none; }
  .graph-page .gc-ctls { flex-direction: row; flex-wrap: wrap; max-width: 132px; }
  /* Hand the reclaimed vertical space to the map. */
  .graph-page .graph-stage { min-height: 70vh; }
}

/* ── accessibility: visible focus, honored everywhere ── */
.graph-page :focus-visible { outline: 2px solid var(--accent-ui); outline-offset: 2px; }

/* ── saved views (SPEC.graph-app-api.md §4, RCTX-592) ── */
.graph-page .graph-views { position: relative; display: inline-flex; }
.graph-page .gv-wrap { position: relative; }
.graph-page .gv-toggle {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font: 500 12.5px var(--font); color: var(--text-muted); cursor: pointer;
}
.graph-page .gv-toggle:hover { border-color: var(--ring); color: var(--text); }
.graph-page .gv-toggle[aria-expanded="true"] { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.graph-page .gv-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 200px; max-height: 320px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--bg); border: 0.5px solid var(--border-hi); border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
.graph-page .gv-save {
  padding: 6px 10px; margin-bottom: 4px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; font: 600 12.5px var(--font); color: var(--accent-text); cursor: pointer;
}
.graph-page .gv-save:hover { background: var(--accent-tint); }
.graph-page .gv-row { display: flex; align-items: center; gap: 2px; }
.graph-page .gv-chip {
  flex: 1; min-width: 0; padding: 6px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; font: 500 12.5px var(--font); color: var(--text-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.graph-page .gv-chip:hover { background: var(--accent-tint); color: var(--accent-text); }
.graph-page .gv-del {
  width: 22px; height: 22px; flex: none; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: .55;
}
.graph-page .gv-del:hover { opacity: 1; color: var(--text); background: var(--surface); }
.graph-page .gv-empty { padding: 8px 10px; font: 400 12px var(--font); color: var(--text-muted); }

/* ── Stage mode — minimal-UI full-bleed canvas (RCTX-593) ── */
/* Tuck the app chrome (same #app-shell class idiom as .rail-collapsed). */
.app-shell.stage-on .sidebar,
.app-shell.stage-on .topbar,
.app-shell.stage-on #breadcrumb-bar { display: none; }
.app-shell.stage-on .main { margin-left: 0 !important; transition: margin-left .16s ease; }
.app-shell.stage-on .content { max-width: none; padding: 0; }

/* Tuck the graph's own header; the toolbar becomes a top overlay that peeks. */
.app-shell.stage-on .graph-page { position: relative; min-height: 100vh; }
.app-shell.stage-on .graph-page .graph-head { display: none; }
.app-shell.stage-on .graph-page .graph-toolbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 15; margin: 0;
  padding: 8px 12px; border-top: 0; border-bottom: 0.5px solid var(--border);
  background: var(--bg); transform: translateY(-100%); transition: transform .16s ease;
}
.app-shell.stage-on.stage-peek .graph-page .graph-toolbar { transform: translateY(0); }

/* Pull-tab handle — only in Stage; fades out while peeking. */
.graph-page .graph-stage-tab { display: none; }
.app-shell.stage-on .graph-page .graph-stage-tab {
  display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 16; width: 48px; height: 16px; padding: 0;
  border: 0.5px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px;
  background: var(--surface); color: var(--text-muted); cursor: pointer; opacity: .75;
  transition: opacity .16s ease;
}
.app-shell.stage-on .graph-page .graph-stage-tab::before {
  content: ''; display: block; width: 20px; height: 2px; margin: 6px auto 0;
  border-radius: 2px; background: currentColor;
}
.app-shell.stage-on .graph-page .graph-stage-tab:hover { opacity: 1; color: var(--text); }
.app-shell.stage-on.stage-peek .graph-page .graph-stage-tab { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .app-shell.stage-on .main,
  .app-shell.stage-on .graph-page .graph-toolbar,
  .app-shell.stage-on .graph-page .graph-stage-tab { transition: none; }
}

/* ── truncation honesty affordance (SPEC.graph-app-api §3.2) ── */
.graph-page .gc-narrow {
  margin-left: 8px; padding: 2px 8px; border: 0.5px solid var(--border-hi);
  border-radius: var(--radius-full); background: transparent;
  font: 500 11.5px var(--font); color: var(--accent-text); cursor: pointer;
}
.graph-page .gc-narrow:hover { background: var(--accent-tint); border-color: transparent; }

/* ── load-more affordance (window=all keyset walk, RCTX-540) ── */
.graph-page .gc-loadmore {
  margin-left: 8px; padding: 2px 10px; border: 0; border-radius: var(--radius-full);
  background: var(--accent-fill); color: var(--on-accent);
  font: 600 11.5px var(--font); cursor: pointer;
}
.graph-page .gc-loadmore:hover { filter: brightness(1.05); }

/* ── help layer: legend dialog + guided tour (RCTX-665) ── */
/* z semantics: panel 20 < tip 40 < tour spotlight 70 < tour card 71; the
   legend <dialog> lives in the browser top layer above all of it. */
.graph-page kbd {
  font: 500 10.5px var(--mono); color: var(--text-muted);
  border: 1px solid var(--border-hi); border-bottom-width: 2px;
  border-radius: var(--radius-sm); padding: 1px 5px; background: var(--bg);
}
.graph-page .graph-legend {
  margin: auto; width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px);
  background: var(--bg); color: var(--text); border: 0.5px solid var(--border-hi);
  border-radius: var(--radius-card); padding: 18px 18px 16px; overflow-y: auto;
}
/* ::backdrop sits in the top layer — an ancestor combinator can fail to match
   it, so scope by the (page-unique) class alone. Literal color: custom
   properties don't reliably reach the backdrop. */
.graph-legend::backdrop { background: rgba(0, 0, 0, .38); }
.graph-page .graph-legend h2 { font: italic 400 22px var(--display); color: var(--text); margin: 0; }
.graph-page .graph-legend .lg-sub { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 10px; }
.graph-page .graph-legend h3 {
  font: 600 11px var(--font); color: var(--text-muted); letter-spacing: 0.02em; margin: 14px 0 4px;
}
.graph-page .lg-rows { margin-top: 8px; }
.graph-page .lg-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--text-2); }
.graph-page .lg-row svg { flex: none; color: var(--text-2); display: block; }
.graph-page .lg-row .lg-swatch { width: 26px; flex: none; display: inline-flex; }
.graph-page .lg-row strong { color: var(--text); font-weight: 600; }
.graph-page .lg-row .lg-d { color: var(--text-muted); }
.graph-page .lg-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.graph-page .lg-keys span { display: flex; gap: 5px; align-items: center; font-size: 12px; color: var(--text-2); }
.graph-page .lg-foot { display: flex; gap: 8px; margin-top: 16px; }
.graph-page .lg-close {
  padding: 7px 12px; border: 1px solid var(--border-hi); border-radius: var(--radius);
  background: transparent; font: 400 12.5px var(--font); color: var(--text-2); cursor: pointer;
}
