/* Network graph page (Components/Pages/Graph.razor, ClientApp/graph). Everything is under .aldus.graph-page.
   Dark by default (Lampblack roles); data-gtheme on the root switches it, independent of the app theme.
   Graph-only roles are --g-* tokens; the WebGL palette mirrors them in ClientApp/graph/src/theme.js.
   Positions of labels, the tooltip and the label pool are set from JS (transform), never as markup styles. */

/* the graph fills the content area edge to edge: no legacy main padding */
.shell-main:has(.aldus.graph-page) { padding: 0; margin: 0; }

/* While the graph is dark, the page header (Layout/TopBar.razor) takes the Lampblack roles so the top of the
   page matches the canvas, whatever the app theme. Derived --ad-* tints are re-declared here because they
   resolve where they are defined (:root). Popovers inside the header follow automatically. */
body:has(.aldus.graph-page[data-gtheme="dark"]) .top {
  color-scheme: dark;
  --color-ground: var(--aldus-lampblack);
  --color-raised: #1D1915;
  --color-surface: #16120F;
  --color-rule: #3A332B;
  --color-text: var(--aldus-proof-paper);
  --color-text-muted: #A89E90;
  --color-on-ink: var(--aldus-printers-black);
  --color-ink: var(--aldus-proof-paper);
  --ad-tint: color-mix(in srgb, var(--aldus-proof-paper) 6%, transparent);
  --ad-tint-2: color-mix(in srgb, var(--aldus-proof-paper) 11%, transparent);
  --ad-row-hover: color-mix(in srgb, var(--aldus-proof-paper) 3.5%, transparent);
  --ad-line-soft: color-mix(in srgb, #3A332B 60%, transparent);
  background: var(--aldus-lampblack);
  color: var(--aldus-proof-paper);
  border-bottom-color: rgba(246, 241, 231, .08);
  transition: none; /* no fade from the app header when the graph mounts */
}
/* With the light graph the header matches the canvas (Proof Paper) and takes the light roles, whatever the app
   theme (rule 67). */
body:has(.aldus.graph-page[data-gtheme="light"]) .top {
  color-scheme: light;
  --color-ground: var(--aldus-proof-paper);
  --color-raised: #F1EEE8;
  --color-surface: #FFFFFF;
  --color-rule: #E0DBD1;
  --color-text: var(--aldus-printers-black);
  --color-text-muted: var(--aldus-slate);
  --color-on-ink: var(--aldus-proof-paper);
  --color-ink: var(--aldus-printers-black);
  --ad-tint: color-mix(in srgb, var(--aldus-printers-black) 5%, transparent);
  --ad-tint-2: color-mix(in srgb, var(--aldus-printers-black) 9%, transparent);
  --ad-row-hover: color-mix(in srgb, var(--aldus-printers-black) 3%, transparent);
  --ad-line-soft: color-mix(in srgb, #E0DBD1 60%, transparent);
  background: var(--aldus-proof-paper);
  color: var(--aldus-printers-black);
  border-bottom-color: rgba(26, 22, 17, .08);
  transition: none;
}
/* a hairline between the side menu and a dark graph (the dark app theme has the same rule in aldus.css) */
body:has(.aldus.graph-page[data-gtheme="dark"]) .side {
  border-right-color: color-mix(in srgb, var(--color-on-menu) 20%, var(--color-menu));
}

.aldus.graph-page {
  --g-bg: #0D0B09;
  --g-glass: rgba(29, 25, 21, .72);
  --g-glass-strong: rgba(29, 25, 21, .9);
  --g-solid: #1D1915; /* solid surface: side panel, toolbar menus (a nested backdrop blur does not apply there), modal */
  --g-rule: rgba(246, 241, 231, .12);
  --g-text: var(--aldus-proof-paper);
  --g-muted: #A89E90;
  --g-halo: rgba(13, 11, 9, .85);
  --g-pill: rgba(29, 25, 21, .82);
  --g-pill-shadow: rgba(0, 0, 0, .45);
  --g-hover: rgba(246, 241, 231, .08);
  --g-warn: #E39347;
  --g-err: var(--aldus-rubric-on-black);
  --g-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  position: relative;
  height: calc(100vh - var(--ad-top-h));
  overflow: hidden;
  background: var(--g-bg);
  color: var(--g-text);
  font-size: 13px;
  isolation: isolate;
}

.aldus.graph-page[data-gtheme="light"] {
  --g-bg: #F6F1E7;
  --g-glass: rgba(255, 255, 255, .74);
  --g-glass-strong: rgba(255, 255, 255, .94);
  --g-solid: #FFFFFF;
  --g-rule: rgba(26, 22, 17, .12);
  --g-text: #1A1611;
  --g-muted: #6F665C;
  --g-halo: rgba(246, 241, 231, .9);
  --g-pill: rgba(255, 255, 255, .86);
  --g-pill-shadow: rgba(26, 22, 17, .14);
  --g-hover: rgba(26, 22, 17, .06);
  --g-warn: var(--color-status-warning);
  --g-err: var(--color-status-failed);
  --g-shadow: 0 8px 28px rgba(26, 22, 17, .14);
}

.aldus.graph-page :focus-visible { outline: 2px solid var(--g-text); outline-offset: 2px; }
/* components set display (grid, flex); the hidden attribute must still win */
.aldus.graph-page [hidden] { display: none !important; }
/* aldus.css colours headings for the app theme; on the graph's own surfaces they follow the graph theme */
.aldus.graph-page :is(h1, h2, h3, h4, p, label, dt, dd, li, summary) { color: inherit; }

/* ---------- stage ---------- */

.aldus.graph-page .gx-stage { position: absolute; inset: 0; }
.aldus.graph-page .gx-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.aldus.graph-page .gx-canvas.gx-pointer { cursor: pointer; }
.aldus.graph-page .gx-canvas.gx-grabbing { cursor: grabbing; }
.aldus.graph-page .gx-canvas:focus-visible { outline: none; }

.aldus.graph-page .gx-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aldus.graph-page .gx-label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-size: 12px; line-height: 16px; color: var(--g-text);
  /* a pill centred on its node (renderer.js #updateLabels): solid enough to read over edges, no blur (80 of
     them move every frame) */
  padding: 2px 8px; border-radius: 999px; background: var(--g-pill); border: 1px solid var(--g-rule);
  box-shadow: 0 1px 3px var(--g-pill-shadow);
  will-change: transform;
}
.aldus.graph-page .gx-label.strong { font-weight: 600; background: var(--g-glass-strong); border-color: var(--g-muted); }
.aldus.graph-page .gx-cluster-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none;
  font-size: 13px; font-weight: 600; color: var(--g-muted); letter-spacing: .01em;
  text-shadow: 0 0 4px var(--g-halo), 0 0 10px var(--g-halo);
}

/* ---------- glass surfaces ---------- */

.aldus.graph-page :is(.gx-toolbar, .gx-legend, .gx-stats, .gx-pop, .gx-status.on, .gx-focusbar) {
  background: var(--g-glass);
  border: 1px solid var(--g-rule);
  border-radius: 10px;
  box-shadow: var(--g-shadow);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  color: var(--g-text);
}

/* ---------- toolbar ---------- */

.aldus.graph-page .gx-toolbar { position: absolute; top: 12px; left: 12px; display: flex; gap: 2px; padding: 4px; z-index: 5; } /* above the legend and the detail card, so an open menu is never under them */
.aldus.graph-page .gx-group { display: flex; gap: 2px; }
.aldus.graph-page .gx-group + .gx-group { border-left: 1px solid var(--g-rule); padding-left: 2px; margin-left: 2px; }
.aldus.graph-page .gx-btn {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--g-text); cursor: pointer; list-style: none;
}
.aldus.graph-page .gx-btn::-webkit-details-marker { display: none; }
.aldus.graph-page .gx-btn:hover { background: var(--g-hover); }
.aldus.graph-page .gx-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.aldus.graph-page .gx-btn[aria-pressed="true"] { background: var(--g-hover); }
.aldus.graph-page .gx-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.aldus.graph-page .gx-menu { position: relative; }
.aldus.graph-page .gx-menu[open] > summary { background: var(--g-hover); }
.aldus.graph-page .gx-menu > summary { position: relative; }
/* active-filter count on an icon-only menu button: a small dot-style badge on its top right corner */
.aldus.graph-page .gx-mbadge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 1;
  border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--g-text); color: var(--g-bg); font-weight: 600; font-variant-numeric: tabular-nums;
}
.aldus.graph-page .gx-mbadge[hidden] { display: none; }
.aldus.graph-page .gx-pop {
  position: absolute; top: calc(100% + 8px); left: 0; width: 280px; padding: 12px; display: grid; gap: 12px;
  max-height: min(72vh, 680px); overflow: auto; overscroll-behavior: contain;
  background: var(--g-glass-strong);
}
.aldus.graph-page .gx-toolbar .gx-pop { background: var(--g-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
.aldus.graph-page .gx-pop.wide { width: 340px; }
/* Layout menu: a short list of actions (icon and text); Node size: one stepper */
.aldus.graph-page .gx-pop.list { width: 240px; padding: 6px; gap: 2px; }
.aldus.graph-page .gx-pop.narrow { width: auto; min-width: 160px; padding: 8px; }
.aldus.graph-page .gx-mi {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--g-text); text-align: left; cursor: pointer; font: inherit;
}
.aldus.graph-page .gx-mi:hover:not(:disabled) { background: var(--g-hover); }
.aldus.graph-page .gx-mi:disabled { opacity: .35; cursor: default; }
.aldus.graph-page .gx-mi:focus-visible { outline: 2px solid var(--g-text); outline-offset: -2px; }
.aldus.graph-page .gx-stepper-c.wide { grid-template-columns: 32px 1fr 32px; height: 32px; }
.aldus.graph-page .gx-pop-g { display: grid; gap: 8px; }
.aldus.graph-page .gx-pop-g + .gx-pop-g { border-top: 1px solid var(--g-rule); padding-top: 12px; }
.aldus.graph-page .gx-pop-g > .sub { color: var(--g-muted); font-size: 12px; }
.aldus.graph-page .gx-filters { display: grid; gap: 12px; }
.aldus.graph-page .gx-field { display: grid; gap: 4px; }
.aldus.graph-page .gx-field > span { color: var(--g-muted); font-size: 12px; }
.aldus.graph-page .gx-sel {
  height: 30px; padding: 0 8px; border: 1px solid var(--g-rule); border-radius: 6px;
  background: transparent; color: var(--g-text); font: inherit;
}
.aldus.graph-page .gx-sel option { background: var(--g-bg); color: var(--g-text); }
.aldus.graph-page .gx-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.aldus.graph-page .gx-check input { accent-color: var(--g-text); }

/* ---------- legend ---------- */

.aldus.graph-page .gx-legend { position: absolute; left: 12px; bottom: 12px; padding: 6px 6px 10px 12px; width: 240px; max-width: calc(100% - 24px); z-index: 3; }
.aldus.graph-page .gx-legend.min { padding-bottom: 6px; }
.aldus.graph-page .gx-lg-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aldus.graph-page .gx-lg-t { color: var(--g-muted); font-size: 12px; font-weight: 500; }
.aldus.graph-page .gx-lg-b { padding: 4px 6px 0 0; max-height: 40vh; overflow: auto; }
.aldus.graph-page .gx-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.aldus.graph-page .gx-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.aldus.graph-page .gx-legend .gx-lg-types { gap: 1px; margin: 0 0 0 -6px; }
.aldus.graph-page .gx-legend .gx-lg-types li { display: block; }
.aldus.graph-page .gx-legend .gx-lg-types li.gx-lg-sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--g-rule); }
.aldus.graph-page .gx-lg-i {
  width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--g-text); font: inherit; text-align: left; cursor: pointer;
}
.aldus.graph-page .gx-lg-i:hover { background: var(--g-hover); }
.aldus.graph-page .gx-lg-i.on { background: var(--g-hover); font-weight: 600; }
.aldus.graph-page .gx-lg-i.off { color: var(--g-muted); }
.aldus.graph-page .gx-lg-i.off .gx-sw { opacity: .3; }
.aldus.graph-page .gx-lg-f { margin: 6px 0 0; color: var(--g-muted); font-size: 12px; }
.aldus.graph-page .gx-legend .gx-ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aldus.graph-page .gx-legend b { font-weight: 500; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.aldus.graph-page .gx-sw.dot,
.aldus.graph-page .gx-sw.diamond,
.aldus.graph-page .gx-sw.square { width: 10px; height: 10px; }
.aldus.graph-page .gx-sw.bar { width: 16px; height: 8px; }
.aldus.graph-page .gx-ramp { display: flex; align-items: center; gap: 2px; }
.aldus.graph-page .gx-ramp span { color: var(--g-muted); font-size: 12px; margin: 0 6px; }

/* ---------- stats, status ---------- */

.aldus.graph-page .gx-stats {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 6px 10px;
  font: 12px/1.3 var(--font-mono, ui-monospace, monospace); color: var(--g-muted); font-variant-numeric: tabular-nums;
}

.aldus.graph-page .gx-status { display: none; }
.aldus.graph-page .gx-status.on {
  display: grid; gap: 8px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px)); padding: 20px; z-index: 4; text-align: left;
}
.aldus.graph-page .gx-status.on p { margin: 0; color: var(--g-muted); }
.aldus.graph-page .gx-status.error b { color: var(--g-err); }
.aldus.graph-page .gx-status .btn { justify-self: start; }
/* loading: the Aldus animated loader (brand/loaders) alone on a small card */
.aldus.graph-page .gx-status.loading { width: auto; justify-items: center; padding: 20px; }
.aldus.graph-page .gx-loader { width: 88px; height: 88px; }

@media (max-width: 560px) {
  .aldus.graph-page .gx-legend { max-width: calc(100% - 24px); }
  .aldus.graph-page .gx-stats { display: none; }
}

/* ---------- side panel ---------- */

.aldus.graph-page .gx-stats { right: auto; left: 12px; bottom: auto; top: 60px; }

.aldus.graph-page { --gx-panel-w: 440px; }
.aldus.graph-page .gx-panel {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: var(--gx-panel-w); max-width: calc(100% - 24px);
  display: flex; flex-direction: column; z-index: 4;
  background: var(--g-solid); border: 1px solid var(--g-rule); border-radius: 12px; box-shadow: var(--g-shadow);
}
.aldus.graph-page .gx-panel[hidden] { display: none; }
.aldus.graph-page .gx-reopen { position: absolute; top: 12px; right: 12px; z-index: 4; background: var(--g-glass); border: 1px solid var(--g-rule); }
.aldus.graph-page .gx-reopen[hidden] { display: none; }
.aldus.graph-page .gx-resize { position: absolute; left: -4px; top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; border-radius: 4px; }
.aldus.graph-page .gx-resize:hover, .aldus.graph-page .gx-resize:focus-visible { background: var(--g-hover); }

.aldus.graph-page .gx-panel-h { display: flex; align-items: center; gap: 4px; padding: 6px 6px 0 10px; border-bottom: 1px solid var(--g-rule); }
.aldus.graph-page .gx-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }
.aldus.graph-page .gx-tabs [role="tab"] {
  border: 0; background: transparent; color: var(--g-muted); font: inherit; font-weight: 500;
  padding: 8px 10px 9px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.aldus.graph-page .gx-tabs [role="tab"]:hover { color: var(--g-text); }
.aldus.graph-page .gx-tabs [role="tab"].on { color: var(--g-text); border-bottom-color: var(--g-text); }
.aldus.graph-page .gx-panel-b { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 16px; overscroll-behavior: contain; }

/* what a path or focused set highlights, with Clear: a pill at the top of the graph */
.aldus.graph-page .gx-focusbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: min(520px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 999px; background: var(--g-glass-strong);
}
.aldus.graph-page.panel-open .gx-focusbar { left: calc((100% - var(--gx-panel-w) - 24px) / 2); }
.aldus.graph-page .gx-focusbar .gx-banner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.aldus.graph-page .gx-tab { display: grid; gap: 14px; }
/* Explore fills the panel height so its footer (Apply, Reset) sits on the bottom edge, and stays there (sticky)
   while the lists scroll; the negative offsets cover the panel body's own padding */
.aldus.graph-page .gx-explore { display: flex; flex-direction: column; min-height: 100%; }
/* Scope: each list is as tall as its rows, up to a cap, and scrolls inside past it; the tab (panel body) scrolls
   when both open cards don't fit. Rows never stretch to fill space. */
.aldus.graph-page .gx-sec.scope .gx-checklist { max-height: min(360px, 42vh); }
.aldus.graph-page .gx-pinfoot {
  position: sticky; bottom: -16px; z-index: 1; margin: auto -14px -16px; padding: 12px 14px 16px;
  background: var(--g-solid); border-top: 1px solid var(--g-rule); border-radius: 0 0 12px 12px;
}
.aldus.graph-page .gx-sec { display: grid; gap: 8px; }
.aldus.graph-page .gx-sec + .gx-sec { border-top: 1px solid var(--g-rule); padding-top: 14px; }
.aldus.graph-page .gx-sec h3, .aldus.graph-page .gx-card h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--g-text); }
.aldus.graph-page .gx-muted { color: var(--g-muted); margin: 0; font-size: 12px; }
.aldus.graph-page .gx-warn { color: var(--g-warn); }
.aldus.graph-page .gx-err { color: var(--g-err); margin: 0; }
.aldus.graph-page .gx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aldus.graph-page .gx-row.end { justify-content: flex-end; }
.aldus.graph-page .gx-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aldus.graph-page .gx-field.inline { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.aldus.graph-page .gx-field output { color: var(--g-text); font-variant-numeric: tabular-nums; }
.aldus.graph-page input[type="range"] { width: 100%; accent-color: var(--g-text); }

.aldus.graph-page .gx-input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--g-rule); border-radius: 8px;
  background: var(--g-hover); color: var(--g-text); font: inherit;
}
.aldus.graph-page .gx-input.sm { height: 30px; }
.aldus.graph-page .gx-input::placeholder { color: var(--g-muted); }
.aldus.graph-page .gx-input:focus { outline: 2px solid var(--g-text); outline-offset: -1px; }
.aldus.graph-page input[type="date"] { color-scheme: dark; }
.aldus.graph-page[data-gtheme="light"] input[type="date"] { color-scheme: light; }

.aldus.graph-page .gx-search { position: relative; }
.aldus.graph-page .gx-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6; list-style: none; margin: 0; padding: 4px;
  background: var(--g-glass-strong); border: 1px solid var(--g-rule); border-radius: 8px; box-shadow: var(--g-shadow);
  max-height: 320px; overflow: auto;
}
.aldus.graph-page .gx-results li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.aldus.graph-page .gx-results li.on, .aldus.graph-page .gx-results li:hover { background: var(--g-hover); }
.aldus.graph-page .gx-results li small { color: var(--g-muted); }
.aldus.graph-page .gx-results .gx-none { display: block; color: var(--g-muted); cursor: default; }
.aldus.graph-page .gx-rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.aldus.graph-page .gx-group-f > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.aldus.graph-page .gx-group-f > summary::-webkit-details-marker { display: none; }
.aldus.graph-page .gx-group-f > summary::before { content: "\203A"; color: var(--g-muted); margin-right: 8px; transition: transform .15s; }
.aldus.graph-page .gx-group-f[open] > summary::before { transform: rotate(90deg); }
.aldus.graph-page .gx-group-f > summary > span:first-child { flex: 1; }
.aldus.graph-page .gx-group-f { border: 1px solid var(--g-rule); border-radius: 8px; }
.aldus.graph-page .gx-group-f > summary { padding: 7px 10px; }
.aldus.graph-page .gx-gf-b { display: grid; gap: 6px; padding: 0 10px 8px; }
.aldus.graph-page .gx-checklist { display: grid; align-content: start; gap: 1px; overflow: auto; max-height: 160px; }
.aldus.graph-page .gx-checklist.l { max-height: 220px; }
.aldus.graph-page .gx-ci { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 2px; cursor: pointer; }
.aldus.graph-page .gx-ci:not(:has(.gx-sw)) { grid-template-columns: auto minmax(0, 1fr) auto; }
.aldus.graph-page .gx-ci input { accent-color: var(--g-text); margin: 0; }
.aldus.graph-page .gx-ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aldus.graph-page .gx-ci b, .aldus.graph-page .gx-badge { font-weight: 500; color: var(--g-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.aldus.graph-page .gx-badge { border: 1px solid var(--g-rule); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.aldus.graph-page .gx-badge.on { border-color: var(--g-text); color: var(--g-text); }
.aldus.graph-page .gx-link {
  border: 0; background: none; padding: 0; color: var(--g-text); font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--g-rule); text-underline-offset: 3px;
}
.aldus.graph-page .gx-link:hover { text-decoration-color: currentColor; }
.aldus.graph-page .gx-link:disabled { opacity: .4; cursor: default; }
.aldus.graph-page .gx-link.name { text-decoration: none; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.aldus.graph-page .gx-link.name:hover { text-decoration: underline; }

.aldus.graph-page .gx-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--g-rule); border-radius: 8px; padding: 2px; gap: 2px; }
.aldus.graph-page .gx-seg button { border: 0; background: transparent; color: var(--g-muted); font: inherit; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.aldus.graph-page .gx-seg button.on { background: var(--g-text); color: var(--g-bg); }
.aldus.graph-page .gx-field > .gx-seg { justify-self: start; }

.aldus.graph-page .gx-btn.sm { width: 26px; height: 26px; font-size: 18px; line-height: 1; }
.aldus.graph-page .gx-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.aldus.graph-page .gx-act {
  border: 1px solid var(--g-rule); background: transparent; color: var(--g-text); font: inherit; font-size: 12px;
  padding: 4px 9px; border-radius: 999px; cursor: pointer;
}
.aldus.graph-page .gx-act:hover { background: var(--g-hover); }
.aldus.graph-page .gx-act[aria-pressed="true"] { background: var(--g-text); color: var(--g-bg); }
.aldus.graph-page .gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aldus.graph-page .gx-chip { border: 1px solid var(--g-rule); background: var(--g-hover); color: var(--g-text); font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.aldus.graph-page .gx-empty { display: grid; gap: 4px; padding: 14px; border: 1px dashed var(--g-rule); border-radius: 8px; }
.aldus.graph-page .gx-empty p { margin: 0; color: var(--g-muted); }
.aldus.graph-page .gx-empty.err b { color: var(--g-err); }
.aldus.graph-page .gx-empty .btn { justify-self: start; margin-top: 4px; }

/* ---------- detail card ---------- */

.aldus.graph-page .gx-card { display: grid; gap: 12px; }
.aldus.graph-page .gx-card-h { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.aldus.graph-page .gx-card-h .gx-sw { margin-top: 6px; width: 12px; height: 12px; }
.aldus.graph-page .gx-card-t h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.aldus.graph-page .gx-card-t small { color: var(--g-muted); }
.aldus.graph-page .gx-title-link { color: inherit; text-decoration: underline; text-decoration-color: var(--g-rule); text-underline-offset: 3px; }
.aldus.graph-page .gx-title-link:hover { text-decoration-color: currentColor; }
.aldus.graph-page .gx-card-tools { display: flex; gap: 2px; margin: -4px -4px 0 0; }
.aldus.graph-page .gx-card-tools .gx-ico { width: 16px; height: 16px; }
.aldus.graph-page .gx-kebab { position: relative; }
.aldus.graph-page .gx-kebab .gx-ico { stroke-width: 2.8; }
.aldus.graph-page .gx-kebab[open] > summary { background: var(--g-hover); }
.aldus.graph-page .gx-kmenu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 2; min-width: 190px; padding: 4px; display: grid;
  background: var(--g-solid); border: 1px solid var(--g-rule); border-radius: 8px; box-shadow: var(--g-shadow);
}
.aldus.graph-page .gx-kmenu hr { border: 0; border-top: 1px solid var(--g-rule); margin: 4px 2px; }
.aldus.graph-page .gx-mi {
  border: 0; background: transparent; color: var(--g-text); font: inherit; text-align: left; padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.aldus.graph-page .gx-mi:hover, .aldus.graph-page .gx-mi:focus-visible { background: var(--g-hover); }

.aldus.graph-page .gx-summary p { margin: 0 0 4px; line-height: 1.45; }
.aldus.graph-page .gx-conns { display: grid; gap: 8px; }
.aldus.graph-page .gx-conn-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* long names wrap instead of widening the panel: grid children may shrink below their content */
.aldus.graph-page :is(.gx-tab, .gx-card, .gx-conns, .gx-gf-b) > * { min-width: 0; }
.aldus.graph-page .gx-group-f > summary > span:first-child { overflow-wrap: anywhere; }
.aldus.graph-page .gx-conn .gx-row { flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
.aldus.graph-page .gx-conn .gx-row > :not(.gx-link) { flex: none; margin-top: 1px; }
.aldus.graph-page .gx-conn .gx-row > .gx-sw { margin-top: 5px; }
.aldus.graph-page .gx-conn .gx-link.name { flex: 1; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; line-height: 1.4; }
.aldus.graph-page .gx-conn small { color: var(--g-muted); }
.aldus.graph-page .gx-conn.filtered :is(.gx-link.name, .gx-dir, .gx-sw) { opacity: .55; }
.aldus.graph-page .gx-conn.filtered span.gx-link.name { cursor: default; text-decoration: none; }
.aldus.graph-page .gx-reveal { display: grid; gap: 2px; }
.aldus.graph-page .gx-reveal .gx-ci { grid-template-columns: auto minmax(0, 1fr); }
.aldus.graph-page .gx-reveal p { margin: 0; font-size: 12px; }
.aldus.graph-page .gx-dir { color: var(--g-muted); width: 14px; text-align: center; flex: none; }

/* ---------- tab content ---------- */

/* Paths: From and To stacked in one box (label above a full-width input), footer with Swap and the Links +/- */
.aldus.graph-page .gx-between { border: 1px solid var(--g-rule); border-radius: 10px; }
.aldus.graph-page .gx-between-b { display: grid; gap: 8px; padding: 10px 10px 12px; }
.aldus.graph-page .gx-between-f {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 8px 10px 10px; border-top: 1px solid var(--g-rule);
}
.aldus.graph-page .gx-between-f .btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; }
.aldus.graph-page .gx-between-f .btn .gx-ico { width: 15px; height: 15px; }
/* limits: two separate captioned fields, each a bordered [- n +] box */
.aldus.graph-page .gx-steppers { display: flex; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; }
.aldus.graph-page .gx-stepper { display: grid; gap: 4px; }
.aldus.graph-page .gx-stepper-l { color: var(--g-muted); font-size: 11px; }
.aldus.graph-page .gx-stepper-c {
  display: grid; grid-template-columns: 28px 30px 28px; align-items: stretch; height: 30px;
  border: 1px solid var(--g-rule); border-radius: 7px; overflow: hidden;
}
.aldus.graph-page .gx-stepper-c output {
  display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums;
  border-inline: 1px solid var(--g-rule); background: var(--g-hover);
}
.aldus.graph-page .gx-step-b { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--g-text); cursor: pointer; }
.aldus.graph-page .gx-step-b:hover:not(:disabled) { background: var(--g-hover); }
.aldus.graph-page .gx-step-b:disabled { opacity: .35; cursor: default; }
.aldus.graph-page .gx-step-b:focus-visible { outline: 2px solid var(--g-text); outline-offset: -2px; }
.aldus.graph-page .gx-step-b .gx-ico { width: 14px; height: 14px; }
.aldus.graph-page .gx-end { display: grid; gap: 4px; }
.aldus.graph-page .gx-end + .gx-end { margin-top: 6px; } /* a little more room above To */
.aldus.graph-page .gx-end-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.aldus.graph-page .gx-end-l { color: var(--g-muted); font-size: 12px; }
.aldus.graph-page .gx-end-hint { color: var(--g-muted); font-size: 11px; opacity: .8; }
/* a chosen end looks like the input it replaced: same height and border, name, type, clear */
.aldus.graph-page .gx-end-v {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  height: 34px; padding: 0 2px 0 10px; border: 1px solid var(--g-rule); border-radius: 8px;
}
.aldus.graph-page .gx-end-v small { color: var(--g-muted); white-space: nowrap; }
.aldus.graph-page .gx-end-v .gx-ico { width: 14px; height: 14px; }

/* Paths results: one card per path, a vertical chain inside: entity, link (direction, relation types), entity ... */
.aldus.graph-page .gx-paths { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aldus.graph-page .gx-path-b {
  width: 100%; text-align: left; display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--g-rule); background: transparent; color: var(--g-text); font: inherit;
}
.aldus.graph-page .gx-path-b:hover { background: var(--g-hover); }
.aldus.graph-page .gx-path.on .gx-path-b { border-color: var(--g-text); background: var(--g-hover); }
.aldus.graph-page .gx-path-h { display: flex; justify-content: space-between; gap: 10px; }
.aldus.graph-page .gx-path-h small { color: var(--g-muted); }
.aldus.graph-page .gx-chain { display: grid; }
.aldus.graph-page .gx-step-n { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-weight: 500; }
.aldus.graph-page .gx-step-name { overflow-wrap: anywhere; }
.aldus.graph-page .gx-step-n small { color: var(--g-muted); font-weight: 400; }
/* the link: a rule down from the swatch above, then the direction and relation types beside it */
.aldus.graph-page .gx-step-e {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-areas: "dir t" ". n"; column-gap: 6px; align-items: center;
  margin: 2px 0 2px 4px; padding: 4px 0 4px 8px; border-left: 2px solid var(--g-rule);
}
.aldus.graph-page .gx-step-dir { grid-area: dir; color: var(--g-muted); text-align: center; }
.aldus.graph-page .gx-step-t { grid-area: t; color: var(--g-muted); font-size: 12px; overflow-wrap: anywhere; }
.aldus.graph-page .gx-step-e small { grid-area: n; color: var(--g-muted); font-size: 11px; }

.aldus.graph-page .gx-matrix-w { display: flex; justify-content: center; }
.aldus.graph-page .gx-matrix { width: 100%; max-width: 320px; aspect-ratio: 1; image-rendering: pixelated; cursor: crosshair; border-radius: 4px; }
.aldus.graph-page .gx-minfo { min-height: 2.6em; display: block; }
.aldus.graph-page .gx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.aldus.graph-page .gx-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.aldus.graph-page .gx-list li small { color: var(--g-muted); font-size: 12px; text-align: right; }
.aldus.graph-page .gx-list.pairs li { display: block; }
.aldus.graph-page .gx-pair {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 0 6px; align-items: center;
  border: 0; background: transparent; color: var(--g-text); font: inherit; text-align: left; padding: 6px; border-radius: 6px; cursor: pointer;
}
.aldus.graph-page .gx-pair:hover { background: var(--g-hover); }
.aldus.graph-page .gx-pair .gx-x { color: var(--g-muted); }
.aldus.graph-page .gx-pair b { font-variant-numeric: tabular-nums; }
.aldus.graph-page .gx-pair small { grid-column: 1 / -1; color: var(--g-muted); font-size: 12px; }

.aldus.graph-page .gx-clusters { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aldus.graph-page .gx-cl { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--g-rule); border-radius: 8px; }
.aldus.graph-page .gx-cl p { margin: 0; }
.aldus.graph-page .gx-cl-h { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.aldus.graph-page .gx-cl-h b { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .aldus.graph-page .gx-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 55%; }
  .aldus.graph-page .gx-resize { display: none; }
  .aldus.graph-page.panel-open .gx-legend { bottom: calc(55% + 16px); }
  .aldus.graph-page .gx-focusbar, .aldus.graph-page.panel-open .gx-focusbar { top: auto; bottom: calc(55% + 16px); left: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .aldus.graph-page * { transition: none !important; }
}
