/* panel-memory-graph.css — Memory → Connections (memory step 5), the Memory view's second tab.
   Theme tokens only; no filters of its own (glass reaches the pane it sits in).
   List first: at any width the list comes before the graph, and at the
   panel's narrowest (320 px) the two stack. */
.set-mgraph { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.set-mgraph[hidden] { display: none; }
.set-mgraph-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.set-mgraph-note { display: flex; align-items: center; gap: 8px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary); }
.set-mgraph-note[hidden] { display: none; }
.set-mgraph-list { max-height: 280px; overflow-y: auto; padding: 4px; border: 1px solid var(--hair); border-radius: var(--r-card);
  background: rgba(var(--warm-rgb), .03); }
.set-mgraph-list:focus-visible { outline: 1px solid var(--rim); outline-offset: 1px; }
.set-mgraph-group { padding: 6px 6px 2px; font: 500 var(--fs-xs)/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--t-faint); }
.set-mgraph-row { display: flex; align-items: baseline; gap: 6px; padding: 5px 6px; border-radius: var(--r-ctl); cursor: pointer;
  font: 400 var(--fs-md)/1.35 var(--sans); color: var(--t-body); min-width: 0; }
.set-mgraph-row:hover { background: rgba(var(--warm-rgb), .06); }
.set-mgraph-row.is-active { background: rgba(var(--warm-rgb), .10); box-shadow: inset 0 0 0 1px var(--rim); }
.set-mgraph-row[aria-selected="true"] { color: var(--t-primary); font-weight: 500; }
.set-mgraph-row.is-outdated .set-mgraph-text { text-decoration: line-through; text-decoration-color: var(--t-faint); color: var(--t-secondary); }
.set-mgraph-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.set-mgraph-meta { flex: none; font-size: var(--fs-xs); color: var(--t-faint); }
/* Kind by shape, never by colour alone: the same shapes as the canvas. */
.set-mgraph-kind { flex: none; width: 8px; height: 8px; border: 1.5px solid var(--t-secondary); box-sizing: border-box; align-self: center; }
.set-mgraph-kind[data-kind="fact"] { border-radius: 2px; width: 10px; height: 7px; }
.set-mgraph-kind[data-kind="file"] { border-radius: 0; width: 7px; height: 9px; }
.set-mgraph-kind[data-kind="entity"] { border-radius: 50%; }
.set-mgraph-kind[data-kind="source"] { transform: rotate(45deg); width: 7px; height: 7px; }
.set-mgraph-row.is-outdated .set-mgraph-kind { border-style: dashed; }
.set-mgraph-empty { padding: 10px 6px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-meta); }
.set-mgraph-canvas { position: relative; height: 260px; width: 100%; min-width: 0; border: 1px solid var(--hair); border-radius: var(--r-card);
  background: rgba(var(--warm-rgb), .03); overflow: hidden; }
.set-mgraph-canvas:focus-visible { outline: 1px solid var(--rim); outline-offset: 1px; }
.set-mgraph-live { min-height: 1.4em; font: 400 var(--fs-sm)/1.4 var(--sans); color: var(--t-meta); }
.set-mgraph-details { padding: 10px; border: 1px solid var(--hair); border-radius: var(--r-card); min-width: 0; }
.set-mgraph-details[hidden] { display: none; }
.set-mgraph-dhead, .set-mgraph-sub { font: 500 var(--fs-xs)/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--t-faint); }
.set-mgraph-sub { margin-top: 10px; }
.set-mgraph-dtitle { margin: 4px 0 6px; font: 400 var(--fs-base)/1.4 var(--sans); color: var(--t-primary); overflow-wrap: anywhere; }
blockquote.set-mgraph-dtitle { padding-left: 8px; border-left: 2px solid var(--hair); }
.set-mgraph-why, .set-mgraph-dates { margin: 2px 0; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary); }
.set-mgraph-conns { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.set-mgraph-conn { display: block; width: 100%; text-align: left; padding: 4px 6px; border: 0; border-radius: var(--r-ctl); background: none;
  font: 400 var(--fs-md)/1.35 var(--sans); color: var(--t-body); cursor: pointer; overflow-wrap: anywhere; }
.set-mgraph-conn:hover, .set-mgraph-conn:focus-visible { background: rgba(var(--warm-rgb), .08); color: var(--t-primary); }
.set-mgraph-conn:focus-visible { outline: 1px solid var(--rim); outline-offset: 1px; }
.set-mgraph-edgewhy { display: block; padding: 0 6px 4px; font: 400 var(--fs-sm)/1.35 var(--sans); color: var(--t-meta); }
.set-mgraph-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.set-mgraph-merge[hidden] { display: none; }
.set-mgraph-mergetext { width: 100%; box-sizing: border-box; margin-top: 6px; padding: 6px 8px; resize: vertical;
  font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-primary); background: rgba(var(--warm-rgb), .05);
  border: 1px solid var(--hair); border-radius: var(--r-ctl); }
@media (prefers-reduced-motion: reduce) { .set-mgraph-row, .set-mgraph-conn { transition: none; } }
/* Read by a screen reader, not drawn. */
.px-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.set-mgraph-row { position: relative; }

/* ---- loading: the Parallax mark with light scanning over it, and line-shaped bars ----
   The mark is a mask, so it takes the theme's colour; the scan is a moving
   gradient behind it (the way the thought line shimmers). Reduced motion:
   the mark and the bars sit still. */
.set-mgraph-stage { position: relative; }
.set-mgraph-loader { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.set-mgraph-loader[hidden] { display: none; }
.set-mgraph-loadmark {
  width: 96px; aspect-ratio: 547 / 300;
  -webkit-mask: url(icons/mark.png) center / contain no-repeat;
          mask: url(icons/mark.png) center / contain no-repeat;
  background: linear-gradient(100deg,
    rgba(var(--bone-rgb), .14) 0%, rgba(var(--bone-rgb), .14) 38%,
    rgba(var(--bone-rgb), .78) 50%,
    rgba(var(--bone-rgb), .14) 62%, rgba(var(--bone-rgb), .14) 100%);
  background-size: 250% 100%;
  background-position: 125% 0;
  animation: mgraph-scan 1.8s linear infinite;
}
@keyframes mgraph-scan { to { background-position: -125% 0; } }
.set-mgraph-skel { display: flex; align-items: center; gap: 8px; padding: 9px 8px; margin: 0 0 2px; }
.set-mgraph-skel-kind { flex: none; width: 10px; height: 6px; border-radius: 2px; background: rgba(var(--bone-rgb), .14); }
.set-mgraph-skel-bar {
  display: block; height: 10px; border-radius: 5px; max-width: 100%;
  background: linear-gradient(100deg,
    rgba(var(--bone-rgb), .08) 0%, rgba(var(--bone-rgb), .08) 38%,
    rgba(var(--bone-rgb), .22) 50%,
    rgba(var(--bone-rgb), .08) 62%, rgba(var(--bone-rgb), .08) 100%);
  background-size: 250% 100%;
  background-position: 125% 0;
  animation: mgraph-scan 1.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .set-mgraph-loadmark, .set-mgraph-skel-bar { animation: none; background-position: 50% 0; }
}
