Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

feat(viewer): notes below the diagram by default, first screen for the diagram

tt-a1ic93d16485adc
diff --git a/archify.zip b/archify.zip
index 0b4fac2a..0c6e3bb7 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/assets/template.html b/archify/assets/template.html
index 52bdedfc..77c25207 100644
--- a/archify/assets/template.html
+++ b/archify/assets/template.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9500,16 +9522,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9535,10 +9571,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9576,23 +9613,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9834,8 +9878,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9849,7 +9921,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9869,7 +9941,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9891,7 +9963,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -9946,7 +10018,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -9972,6 +10044,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10004,6 +10077,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/bin/visual-check.mjs b/archify/bin/visual-check.mjs
index 6e8e6e0a..277505a0 100644
--- a/archify/bin/visual-check.mjs
+++ b/archify/bin/visual-check.mjs
@@ -1690,7 +1690,12 @@ export class ChromeVisualBrowser {
&& typeof Archify.viewerChromeLayout.stageRect === 'function'
? Archify.viewerChromeLayout.stageRect()
: (stage ? stage.getBoundingClientRect() : null);
- var navigationDockRect = navigationDock ? navigationDock.getBoundingClientRect() : null;
+ // The dock may lift to the viewport floor while the page scrolls; the
+ // stage contract is about its resting position.
+ var navigationDockRect = !navigationDock ? null
+ : window.Archify && Archify.viewerChromeLayout && typeof Archify.viewerChromeLayout.dockRect === 'function'
+ ? Archify.viewerChromeLayout.dockRect()
+ : navigationDock.getBoundingClientRect();
var stageDockIntersectionArea = intersectionArea(stageRect, navigationDockRect);
var viewerChromeReceipt = window.Archify && Archify.viewerChromeLayout
&& typeof Archify.viewerChromeLayout.receipt === 'function'
@@ -1731,12 +1736,13 @@ export class ChromeVisualBrowser {
var bodyStyle = window.getComputedStyle(document.body);
var diagramStyle = diagram ? window.getComputedStyle(diagram) : null;
var svgHeight = svg ? svg.getBoundingClientRect().height : 0;
+ var notesBelowFold = Boolean(reader) && document.documentElement.getAttribute('data-reader-rail') === 'bottom';
var pageComposition = {
bodyPaddingPx: Math.round((parseFloat(bodyStyle.paddingTop) || 0) + (parseFloat(bodyStyle.paddingBottom) || 0)),
headerPx: Math.round(outerHeight(reader && reader.querySelector('.header'))),
diagramChromePx: Math.round(outerHeight(diagram) - svgHeight),
svgPx: Math.round(svgHeight),
- cardsPx: Math.round(outerHeight(reader && reader.querySelector('.cards'))),
+ cardsPx: notesBelowFold ? 0 : Math.round(outerHeight(reader && reader.querySelector('.cards'))),
viewBoxHeight: viewBox ? viewBox.height : 0
};
var svgRect = svg && svg.getBoundingClientRect();
@@ -1754,7 +1760,10 @@ export class ChromeVisualBrowser {
innerWidth: window.innerWidth,
innerHeight: window.innerHeight,
scrollWidth: Math.ceil(document.documentElement.scrollWidth),
- scrollHeight: Math.ceil(document.documentElement.scrollHeight),
+ // Bottom notes and index are reading material below the fold; the
+ // Reader excludes them from the one-screen fit, and so does this check.
+ scrollHeight: Math.max(window.innerHeight, Math.ceil(document.documentElement.scrollHeight - (
+ notesBelowFold ? outerHeight(reader.querySelector('.reader-rail')) : 0))),
resolvedTheme: document.documentElement.getAttribute('data-theme') || '',
readerLayout: document.documentElement.getAttribute('data-reader-layout') || null,
readerOverflow: document.documentElement.getAttribute('data-reader-overflow') || null,
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index ad408f48..aea27401 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9611,16 +9633,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9646,10 +9682,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9687,23 +9724,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9945,8 +9989,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9960,7 +10032,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9980,7 +10052,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10002,7 +10074,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10057,7 +10129,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10083,6 +10155,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10115,6 +10188,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index 11115766..2126f666 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9546,16 +9568,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9581,10 +9617,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9622,23 +9659,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9880,8 +9924,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9895,7 +9967,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9915,7 +9987,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9937,7 +10009,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -9992,7 +10064,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10018,6 +10090,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10050,6 +10123,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index 67883a53..e272f8f0 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9626,16 +9648,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9661,10 +9697,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9702,23 +9739,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9960,8 +10004,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9975,7 +10047,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9995,7 +10067,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10017,7 +10089,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10072,7 +10144,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10098,6 +10170,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10130,6 +10203,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index 236603fd..9f01fb38 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9599,16 +9621,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9634,10 +9670,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9675,23 +9712,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9933,8 +9977,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9948,7 +10020,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9968,7 +10040,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9990,7 +10062,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10045,7 +10117,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10071,6 +10143,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10103,6 +10176,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index 813ff7fc..299790dd 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9617,16 +9639,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9652,10 +9688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9693,23 +9730,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9951,8 +9995,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9966,7 +10038,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9986,7 +10058,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10008,7 +10080,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10063,7 +10135,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10089,6 +10161,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10121,6 +10194,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/archify/test/architecture-reading-size-browser.test.mjs b/archify/test/architecture-reading-size-browser.test.mjs
index a0099182..00f6ee28 100644
--- a/archify/test/architecture-reading-size-browser.test.mjs
+++ b/archify/test/architecture-reading-size-browser.test.mjs
@@ -55,9 +55,9 @@ test('automatic architectures preserve primary reading size when fitting the ful
assert.ok(observed.guideWidth > 0, label + ': diagram must be visible');
assert.ok(observed.guideTop >= observed.toolbarBottom + 4, label + ': toolbar overlaps diagram ' + JSON.stringify(observed));
assert.ok(observed.scrollWidth <= width, label + ': horizontal overflow');
- // A docked summary rail may trade comfort down to its 12px default floor;
- // without it (collapsed, bottom or unavailable) the 13.5px comfort holds.
- const primaryFloor = observed.summaryRail === 'true' ? 12 : 13.5;
+ // A docked or bottom summary rail may trade comfort down to its 12px
+ // floor; without one (collapsed or unavailable) the 13.5px comfort holds.
+ const primaryFloor = observed.summaryRail === 'true' || observed.summaryRail === 'bottom' ? 12 : 13.5;
assert.ok(observed.primaryFont >= primaryFloor, label + ': full-page fitting made primary text too small: ' + observed.primaryFont + ' (rail ' + observed.summaryRail + ')');
if (geometry) assert.deepEqual(observed.geometry, geometry, label + ': authored node geometry/font changed');
else geometry = observed.geometry;
@@ -98,7 +98,8 @@ test('one long label does not enlarge the other titles in a narrow tall architec
assert.equal(result.exceptionDetails, undefined);
const sizes = result.result.value;
assert.ok(sizes[0].source < sizes[1].source, 'fixture must contain a fitted long title');
- assert.ok(sizes[1].projected >= 13.5 && sizes[1].projected <= 14.2, JSON.stringify(sizes));
+ // The bottom rail may trade comfort down to 12px; hierarchy still holds.
+ assert.ok(sizes[1].projected >= 12 - 0.01 && sizes[1].projected <= 14.2, JSON.stringify(sizes));
assert.ok(metrics.scrollWidth <= 1440);
assert.ok(metrics.scrollHeight > 900, 'preserve ordinary scroll instead of shrinking the tall graph');
} finally {
diff --git a/archify/test/desktop-reader-browser.test.mjs b/archify/test/desktop-reader-browser.test.mjs
index 8beb614d..d857bcd8 100644
--- a/archify/test/desktop-reader-browser.test.mjs
+++ b/archify/test/desktop-reader-browser.test.mjs
@@ -279,8 +279,9 @@ test('route-expanded intrinsic architecture preserves reading size with ordinary
&& height === DESKTOP_READABILITY_VIEWPORT.height
));
assert.ok(desktop);
+ // Reading size holds; with notes below the fold the diagram itself fits,
+ // and any remaining overflow must be accepted scroll (checked above).
assert.ok(desktop.diagramWidth >= desktop.viewBoxWidth, JSON.stringify(desktop, null, 2));
- assert.equal(desktop.verticalScrollAccepted, true, JSON.stringify(desktop, null, 2));
} finally {
fs.rmSync(tmp, { recursive: true, force: true });
}
diff --git a/archify/test/joint-layout-browser.test.mjs b/archify/test/joint-layout-browser.test.mjs
index d95ab07b..14ac35f8 100644
--- a/archify/test/joint-layout-browser.test.mjs
+++ b/archify/test/joint-layout-browser.test.mjs
@@ -28,11 +28,14 @@ const pageHelpers = `(() => {
const svg = panel.querySelector(':scope > svg');
const nav = panel.querySelector('.diagram-nav');
const stage = svg.getBoundingClientRect();
- const dock = nav.getBoundingClientRect();
+ // The dock may lift to the viewport floor; layout contracts use its resting box.
+ const dock = Archify.viewerChromeLayout.dockRect();
return {
boxes: ['.container', '.header', '.guided-views', '.cards', '.diagram-container',
'.diagram-container > svg', '.diagram-nav', '[data-legend]']
- .map(selector => [selector, rect(document.querySelector(selector))]),
+ .map(selector => [selector, selector === '.diagram-nav'
+ ? ['left', 'top', 'right', 'bottom', 'width', 'height'].map(key => rounded(dock[key]))
+ : rect(document.querySelector(selector))]),
reserve: parseFloat(getComputedStyle(panel).getPropertyValue('--archify-nav-reserve')) || 0,
rail: panel.getAttribute('data-nav-stage-rail'), rootRail: html.getAttribute('data-nav-stage-rail'),
readerWidth: html.style.getPropertyValue('--archify-reader-width'),
@@ -460,11 +463,11 @@ test('one joint wait preserves real Reader/Chrome convergence at the CLI boundar
assert.equal(before.readerFit, 'intrinsic-height');
const exportedBefore = await canonicalExport();
assert.equal(exportedBefore.canonical, 'true');
- const overflow = await joint('intrinsic-overflow', `document.querySelector('.cards').style.minHeight = '1200px';`);
+ const overflow = await joint('intrinsic-overflow', `document.querySelector('.header').style.minHeight = '1200px';`);
assert.equal(overflow.overflow, 'authored');
clearStage(overflow, 'intrinsic overflow');
unchanged(before, overflow, 'intrinsic overflow');
- await joint('intrinsic-content-restored', `document.querySelector('.cards').style.minHeight = '';`);
+ await joint('intrinsic-content-restored', `document.querySelector('.header').style.minHeight = '';`);
for (const mode of ['embed', 'present', 'print']) {
if (mode === 'print') {
await send('Emulation.setEmulatedMedia', { media: 'print' });
diff --git a/archify/test/reader-readability-maintained-browser.test.mjs b/archify/test/reader-readability-maintained-browser.test.mjs
index 18f6fbfe..0b20cf91 100644
--- a/archify/test/reader-readability-maintained-browser.test.mjs
+++ b/archify/test/reader-readability-maintained-browser.test.mjs
@@ -105,7 +105,10 @@ test('declared wide synthetic reader preserves geometry and reaches edge/node re
edgeFinite: edge.length > 0 && edge.every(Number.isFinite),
nodeFinite: node.length > 0 && node.every(Number.isFinite),
overflowX: Math.max(html.scrollWidth, document.body.scrollWidth) > innerWidth,
- overflowY: Math.max(html.scrollHeight, document.body.scrollHeight) > innerHeight + 1,
+ // Bottom notes and index sit below the fold by design.
+ overflowY: Math.max(html.scrollHeight, document.body.scrollHeight) - (html.getAttribute('data-reader-rail') === 'bottom'
+ ? document.getElementById('reader-rail').getBoundingClientRect().height + parseFloat(getComputedStyle(document.getElementById('reader-rail')).marginTop)
+ : 0) > innerHeight + 1,
theme: html.getAttribute('data-theme'), motion: html.getAttribute('data-motion'),
motionMode: Archify.motionGovernor.mode(), detailLevel: container.getAttribute('data-detail-level'),
cameraScale: camera.scale, cameraMode: camera.mode,
diff --git a/archify/test/semantic-radar.test.mjs b/archify/test/semantic-radar.test.mjs
index 70531a7e..0898021d 100644
--- a/archify/test/semantic-radar.test.mjs
+++ b/archify/test/semantic-radar.test.mjs
@@ -472,12 +472,14 @@ test('Semantic Radar automatically avoids a tall Semantic Passport', {
var passport = document.getElementById('focus-chip').getBoundingClientRect();
var active = document.querySelector('[data-focus-selected]');
var nearestLeft = passport.right + 16;
+ // Aim inside the Passport's vertical band so the request must snap clear.
+ var targetTop = Math.max(radar.top, passport.top);
active.getBoundingClientRect = function () {
return {
left: nearestLeft,
- top: radar.top,
+ top: targetTop,
right: nearestLeft + radar.width,
- bottom: radar.top + radar.height,
+ bottom: targetTop + radar.height,
width: radar.width,
height: radar.height
};
@@ -485,8 +487,8 @@ test('Semantic Radar automatically avoids a tall Semantic Passport', {
return {
radar: { left: radar.left, top: radar.top },
head: { left: head.left, top: head.top, height: head.height },
- requested: { left: passport.right + 8, top: radar.top },
- nearest: { left: nearestLeft, top: radar.top }
+ requested: { left: passport.right + 8, top: targetTop },
+ nearest: { left: nearestLeft, top: targetTop }
};
})()`);
await dragMouse(browser, sessionId, {
diff --git a/docs/assets/archify-demo-lens.png b/docs/assets/archify-demo-lens.png
index caace867..59c7f941 100644
Binary files a/docs/assets/archify-demo-lens.png and b/docs/assets/archify-demo-lens.png differ
diff --git a/docs/assets/archify-demo-reach.png b/docs/assets/archify-demo-reach.png
index 502e276a..e373b43f 100644
Binary files a/docs/assets/archify-demo-reach.png and b/docs/assets/archify-demo-reach.png differ
diff --git a/docs/assets/archify-demo-route.png b/docs/assets/archify-demo-route.png
index 30337d5a..dcb0916b 100644
Binary files a/docs/assets/archify-demo-route.png and b/docs/assets/archify-demo-route.png differ
diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gif
index e2cc89bd..f11858db 100644
Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differ
diff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.json
index 8f7215de..da55de7e 100644
--- a/docs/assets/archify-live-proof.json
+++ b/docs/assets/archify-live-proof.json
@@ -7,13 +7,13 @@
"fps": 10,
"frameCount": 54,
"durationSeconds": 5.4,
- "bytes": 814327,
- "sha256": "65d8fd54105e0448f66fea1f24e34169b2ed3e3c6e5349d422977a019199f8d4",
+ "bytes": 818216,
+ "sha256": "76393a564a6f2308f5b43dbb45abb3b5c30d4769d7bd7e652f0cafc77ff3888f",
"scenes": [
{
"id": "signal-flow",
"artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",
- "artifactSha256": "9579b8ed5bffb0c70d8089cc9c897a0de2e99083b9f31354fd725373655be273",
+ "artifactSha256": "e1980c11f0aaad6b0239cfd4a58f5de28d98fe94356399983c0c1de0800d9320",
"hash": "#focus=planner&reach=downstream",
"eyebrow": "WORKFLOW · SIGNAL FLOW",
"title": "Agent Tool Call",
@@ -22,7 +22,7 @@
{
"id": "blueprint",
"artifact": "docs/gallery/artifacts/production-deployment.architecture.html",
- "artifactSha256": "665b80ecd3c2ce1e6e4581af1df13047f583ff9b1f628dad237bad03289e6f3b",
+ "artifactSha256": "fc675641c60b732dab2b27a1259f824cf95f88eeb4dddd7e0406b762f2eefb32",
"hash": "#lens=backend~database",
"eyebrow": "ARCHITECTURE · BLUEPRINT",
"title": "Production Deployment",
@@ -31,29 +31,11 @@
{
"id": "classic",
"artifact": "docs/gallery/artifacts/cache-miss.sequence.html",
- "artifactSha256": "8d0875d5488bff11cfb59e73e98bdf394d35297295708e95c49700e2f0b69632",
+ "artifactSha256": "bd6e6b655553ba41eaa8cc8e25c96d1ee4859c6f46dee82a27f8be5eec416f9c",
"hash": "#route=web~db",
"eyebrow": "SEQUENCE · CLASSIC",
"title": "Cache Miss Request",
"receipt": "7 participants · 12 messages · 9/9 checks"
}
- ],
- "reusedCapture": {
- "sourceRevision": "397b28a4cfd39a8ca1a3bd95160b499515cb05ff",
- "reason": "Only the node-outline selection callback changed in these artifacts. The embedded GIF scenes use initial focus, reach, and lens URL state and never invoke the hidden node index. Their SVG, styles, animation, and other Viewer bytes are unchanged. The existing GIF is reused, not recaptured.",
- "artifacts": [
- {
- "artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",
- "sha256": "f12f4f8e02a6371d0e12da2ad351ace8411cb732ec5280393fa3ce8087551cb8"
- },
- {
- "artifact": "docs/gallery/artifacts/production-deployment.architecture.html",
- "sha256": "5977192e7ebf717dc5e31713768dd08a84145ecfc170acec94a626616b7ca644"
- },
- {
- "artifact": "docs/gallery/artifacts/cache-miss.sequence.html",
- "sha256": "4ffc766a6fc8399199113cfe498d11c3a00c422c8040937d2bd1aaad5331cefa"
- }
- ]
- }
+ ]
}
diff --git a/docs/cases/mco-runtime.architecture.html b/docs/cases/mco-runtime.architecture.html
index db8d5d71..50eaa7ce 100644
--- a/docs/cases/mco-runtime.architecture.html
+++ b/docs/cases/mco-runtime.architecture.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9661,16 +9683,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9696,10 +9732,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9737,23 +9774,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9995,8 +10039,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -10010,7 +10082,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -10030,7 +10102,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10052,7 +10124,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10107,7 +10179,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10133,6 +10205,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10165,6 +10238,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery.html b/docs/gallery.html
index a972729c..67110acb 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -298,7 +298,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9579b8ed5bffb0c70d8089cc9c897a0de2e99083b9f31354fd725373655be273">9579b8ed5bff</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e1980c11f0aaad6b0239cfd4a58f5de28d98fe94356399983c0c1de0800d9320">e1980c11f0aa</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html#focus=planner" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -328,7 +328,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="665b80ecd3c2ce1e6e4581af1df13047f583ff9b1f628dad237bad03289e6f3b">665b80ecd3c2</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="fc675641c60b732dab2b27a1259f824cf95f88eeb4dddd7e0406b762f2eefb32">fc675641c60b</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html#focus=gateway" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -357,7 +357,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="8d0875d5488bff11cfb59e73e98bdf394d35297295708e95c49700e2f0b69632">8d0875d5488b</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="bd6e6b655553ba41eaa8cc8e25c96d1ee4859c6f46dee82a27f8be5eec416f9c">bd6e6b655553</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html#focus=redis" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -386,7 +386,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5f5d4a659cadb7865665becc06b2c36f7c80982a01258836b88c3ef13047d4db">5f5d4a659cad</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="aef8676cd9ba88a78e17155748715d9b47e93ccdfb6eefbcadb0085f03a87a56">aef8676cd9ba</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -415,7 +415,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ce93365d9e2987ace03855cee85445b4da647659e34c4a98585eea1f01b613bc">ce93365d9e29</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3499742a687b34ec627866a02ccf9cbf097313d00f7d496b2dad6a50f35240e0">3499742a687b</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html#focus=triage" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -444,7 +444,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="4bf36d51169ae36549c2ec57eca4ca64ad3230ba577114b88c7201a95e9828d0">4bf36d51169a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7b6cb9e708b5765106bf44d9d51ccdffe7d09dd8c5d6a84aff3840c3428bc91a">7b6cb9e708b5</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html#focus=consent" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -473,7 +473,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="37e61b0dc59da4e5e949088c4369d068790defe418c50587dfc1d179130e2a61">37e61b0dc59d</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="32abe11767975f3f81a4ac611b0cf4c54ac512caeb52cf761938158826a26aed">32abe1176797</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html#focus=queue" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -502,7 +502,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="4b97674dadcfd8390ce65fb6ab51fe7d47b639744504acbda1592250399f7bb9">4b97674dadcf</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="a3a82fa55023b1d0953d3a42efaabe1102e65445108b55c182d0a9263f49bad0">a3a82fa55023</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html#focus=orders" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -531,7 +531,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e43c7ed230b8fd8696214497c6d9533cf41862c08197fc36f27166f0905da8cf">e43c7ed230b8</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ced7ac41b580446cdf8a823d904154ecb5552db42f33bcc2f315b0ca9297148b">ced7ac41b580</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -560,7 +560,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d444d897c48300bb410cbf0e6f4f9e5a8b9129e9316070f782be99b06f49ce01">d444d897c483</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="0b680dcefcbb1bb27174e0cac44d57ab7cb33270150c2b392af0968bbbda0639">0b680dcefcbb</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html#focus=live" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -589,7 +589,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="fca3ecd2abd7c7f8165dd534b0a8141386d0c9120657f4e032696ea1c8409eff">fca3ecd2abd7</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6a770e5fda18f93dae9e9d6a92794e30a0327eabda9cd94af45ccd11b4b3bda9">6a770e5fda18</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html#focus=api" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -667,8 +667,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 764114,
- "artifactSha256": "9579b8ed5bffb0c70d8089cc9c897a0de2e99083b9f31354fd725373655be273",
+ "artifactBytes": 768262,
+ "artifactSha256": "e1980c11f0aaad6b0239cfd4a58f5de28d98fe94356399983c0c1de0800d9320",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -802,8 +802,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 766841,
- "artifactSha256": "665b80ecd3c2ce1e6e4581af1df13047f583ff9b1f628dad237bad03289e6f3b",
+ "artifactBytes": 770989,
+ "artifactSha256": "fc675641c60b732dab2b27a1259f824cf95f88eeb4dddd7e0406b762f2eefb32",
"sourceBytes": 4734,
"sourceSha256": "cb54bad2dfd0c2d02aa5b496bde6839789a0f07f23062343c4458b8d38806c13",
"checks": [
@@ -935,8 +935,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 758608,
- "artifactSha256": "8d0875d5488bff11cfb59e73e98bdf394d35297295708e95c49700e2f0b69632",
+ "artifactBytes": 762756,
+ "artifactSha256": "bd6e6b655553ba41eaa8cc8e25c96d1ee4859c6f46dee82a27f8be5eec416f9c",
"sourceBytes": 3805,
"sourceSha256": "f5c2e44f9a44000adc7c3b3040c4fcd88fe50b7cf8761302c21eb0c184e5780a",
"checks": [
@@ -1057,8 +1057,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 759628,
- "artifactSha256": "5f5d4a659cadb7865665becc06b2c36f7c80982a01258836b88c3ef13047d4db",
+ "artifactBytes": 763776,
+ "artifactSha256": "aef8676cd9ba88a78e17155748715d9b47e93ccdfb6eefbcadb0085f03a87a56",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -1197,8 +1197,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 756948,
- "artifactSha256": "ce93365d9e2987ace03855cee85445b4da647659e34c4a98585eea1f01b613bc",
+ "artifactBytes": 761096,
+ "artifactSha256": "3499742a687b34ec627866a02ccf9cbf097313d00f7d496b2dad6a50f35240e0",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -1383,8 +1383,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 760948,
- "artifactSha256": "4bf36d51169ae36549c2ec57eca4ca64ad3230ba577114b88c7201a95e9828d0",
+ "artifactBytes": 765096,
+ "artifactSha256": "7b6cb9e708b5765106bf44d9d51ccdffe7d09dd8c5d6a84aff3840c3428bc91a",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -1518,8 +1518,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 757689,
- "artifactSha256": "37e61b0dc59da4e5e949088c4369d068790defe418c50587dfc1d179130e2a61",
+ "artifactBytes": 761837,
+ "artifactSha256": "32abe11767975f3f81a4ac611b0cf4c54ac512caeb52cf761938158826a26aed",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1658,8 +1658,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 764868,
- "artifactSha256": "4b97674dadcfd8390ce65fb6ab51fe7d47b639744504acbda1592250399f7bb9",
+ "artifactBytes": 769016,
+ "artifactSha256": "a3a82fa55023b1d0953d3a42efaabe1102e65445108b55c182d0a9263f49bad0",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1810,8 +1810,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 754006,
- "artifactSha256": "e43c7ed230b8fd8696214497c6d9533cf41862c08197fc36f27166f0905da8cf",
+ "artifactBytes": 758154,
+ "artifactSha256": "ced7ac41b580446cdf8a823d904154ecb5552db42f33bcc2f315b0ca9297148b",
"sourceBytes": 3405,
"sourceSha256": "230242a7557663877766c43a9fe7cffe8b4fb66e4866457dccd24c63175b4917",
"checks": [
@@ -1981,8 +1981,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 755508,
- "artifactSha256": "d444d897c48300bb410cbf0e6f4f9e5a8b9129e9316070f782be99b06f49ce01",
+ "artifactBytes": 759656,
+ "artifactSha256": "0b680dcefcbb1bb27174e0cac44d57ab7cb33270150c2b392af0968bbbda0639",
"sourceBytes": 3629,
"sourceSha256": "ebcd29cbb7001f9a07e5fb45945777f7fa3832bc391ca591bda9ffe3d4be131e",
"checks": [
@@ -2121,8 +2121,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 758654,
- "artifactSha256": "fca3ecd2abd7c7f8165dd534b0a8141386d0c9120657f4e032696ea1c8409eff",
+ "artifactBytes": 762802,
+ "artifactSha256": "6a770e5fda18f93dae9e9d6a92794e30a0327eabda9cd94af45ccd11b4b3bda9",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index 11115766..2126f666 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9546,16 +9568,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9581,10 +9617,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9622,23 +9659,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9880,8 +9924,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9895,7 +9967,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9915,7 +9987,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9937,7 +10009,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -9992,7 +10064,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10018,6 +10090,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10050,6 +10123,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index 813ff7fc..299790dd 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9617,16 +9639,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9652,10 +9688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9693,23 +9730,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9951,8 +9995,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9966,7 +10038,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9986,7 +10058,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10008,7 +10080,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10063,7 +10135,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10089,6 +10161,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10121,6 +10194,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index 964e53e2..0a09dc56 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9638,16 +9660,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9673,10 +9709,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9714,23 +9751,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9972,8 +10016,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9987,7 +10059,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -10007,7 +10079,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10029,7 +10101,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10084,7 +10156,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10110,6 +10182,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10142,6 +10215,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index 67883a53..e272f8f0 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9626,16 +9648,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9661,10 +9697,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9702,23 +9739,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9960,8 +10004,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9975,7 +10047,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9995,7 +10067,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10017,7 +10089,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10072,7 +10144,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10098,6 +10170,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10130,6 +10203,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index 9c54401b..119cfc8e 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9572,16 +9594,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9607,10 +9643,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9648,23 +9685,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9906,8 +9950,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9921,7 +9993,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9941,7 +10013,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9963,7 +10035,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10018,7 +10090,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10044,6 +10116,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10076,6 +10149,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index 6439834a..4ea325d1 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9650,16 +9672,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9685,10 +9721,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9726,23 +9763,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9984,8 +10028,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9999,7 +10071,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -10019,7 +10091,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10041,7 +10113,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10096,7 +10168,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10122,6 +10194,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10154,6 +10227,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index 761ff19e..32509c17 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9577,16 +9599,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9612,10 +9648,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9653,23 +9690,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9911,8 +9955,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9926,7 +9998,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9946,7 +10018,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9968,7 +10040,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10023,7 +10095,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10049,6 +10121,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10081,6 +10154,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index ad408f48..aea27401 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9611,16 +9633,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9646,10 +9682,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9687,23 +9724,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9945,8 +9989,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9960,7 +10032,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9980,7 +10052,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10002,7 +10074,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10057,7 +10129,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10083,6 +10155,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10115,6 +10188,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index c5f5d46c..9e60231f 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9654,16 +9676,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9689,10 +9725,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9730,23 +9767,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9988,8 +10032,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -10003,7 +10075,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -10023,7 +10095,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10045,7 +10117,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10100,7 +10172,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10126,6 +10198,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10158,6 +10231,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index 1afd8f79..2bd25319 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9603,16 +9625,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9638,10 +9674,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9679,23 +9716,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9937,8 +9981,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9952,7 +10024,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9972,7 +10044,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9994,7 +10066,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10049,7 +10121,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10075,6 +10147,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10107,6 +10180,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index 236603fd..9f01fb38 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9599,16 +9621,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9634,10 +9670,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9675,23 +9712,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9933,8 +9977,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9948,7 +10020,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9968,7 +10040,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9990,7 +10062,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10045,7 +10117,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10071,6 +10143,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10103,6 +10176,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index 1a73dc34..2ba8e26a 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -19,8 +19,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 764114,
- "artifactSha256": "9579b8ed5bffb0c70d8089cc9c897a0de2e99083b9f31354fd725373655be273",
+ "artifactBytes": 768262,
+ "artifactSha256": "e1980c11f0aaad6b0239cfd4a58f5de28d98fe94356399983c0c1de0800d9320",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -154,8 +154,8 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 766841,
- "artifactSha256": "665b80ecd3c2ce1e6e4581af1df13047f583ff9b1f628dad237bad03289e6f3b",
+ "artifactBytes": 770989,
+ "artifactSha256": "fc675641c60b732dab2b27a1259f824cf95f88eeb4dddd7e0406b762f2eefb32",
"sourceBytes": 4734,
"sourceSha256": "cb54bad2dfd0c2d02aa5b496bde6839789a0f07f23062343c4458b8d38806c13",
"checks": [
@@ -287,8 +287,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 758608,
- "artifactSha256": "8d0875d5488bff11cfb59e73e98bdf394d35297295708e95c49700e2f0b69632",
+ "artifactBytes": 762756,
+ "artifactSha256": "bd6e6b655553ba41eaa8cc8e25c96d1ee4859c6f46dee82a27f8be5eec416f9c",
"sourceBytes": 3805,
"sourceSha256": "f5c2e44f9a44000adc7c3b3040c4fcd88fe50b7cf8761302c21eb0c184e5780a",
"checks": [
@@ -409,8 +409,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 759628,
- "artifactSha256": "5f5d4a659cadb7865665becc06b2c36f7c80982a01258836b88c3ef13047d4db",
+ "artifactBytes": 763776,
+ "artifactSha256": "aef8676cd9ba88a78e17155748715d9b47e93ccdfb6eefbcadb0085f03a87a56",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -549,8 +549,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 756948,
- "artifactSha256": "ce93365d9e2987ace03855cee85445b4da647659e34c4a98585eea1f01b613bc",
+ "artifactBytes": 761096,
+ "artifactSha256": "3499742a687b34ec627866a02ccf9cbf097313d00f7d496b2dad6a50f35240e0",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -735,8 +735,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 760948,
- "artifactSha256": "4bf36d51169ae36549c2ec57eca4ca64ad3230ba577114b88c7201a95e9828d0",
+ "artifactBytes": 765096,
+ "artifactSha256": "7b6cb9e708b5765106bf44d9d51ccdffe7d09dd8c5d6a84aff3840c3428bc91a",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -870,8 +870,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 757689,
- "artifactSha256": "37e61b0dc59da4e5e949088c4369d068790defe418c50587dfc1d179130e2a61",
+ "artifactBytes": 761837,
+ "artifactSha256": "32abe11767975f3f81a4ac611b0cf4c54ac512caeb52cf761938158826a26aed",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1010,8 +1010,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 764868,
- "artifactSha256": "4b97674dadcfd8390ce65fb6ab51fe7d47b639744504acbda1592250399f7bb9",
+ "artifactBytes": 769016,
+ "artifactSha256": "a3a82fa55023b1d0953d3a42efaabe1102e65445108b55c182d0a9263f49bad0",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1162,8 +1162,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 754006,
- "artifactSha256": "e43c7ed230b8fd8696214497c6d9533cf41862c08197fc36f27166f0905da8cf",
+ "artifactBytes": 758154,
+ "artifactSha256": "ced7ac41b580446cdf8a823d904154ecb5552db42f33bcc2f315b0ca9297148b",
"sourceBytes": 3405,
"sourceSha256": "230242a7557663877766c43a9fe7cffe8b4fb66e4866457dccd24c63175b4917",
"checks": [
@@ -1333,8 +1333,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 755508,
- "artifactSha256": "d444d897c48300bb410cbf0e6f4f9e5a8b9129e9316070f782be99b06f49ce01",
+ "artifactBytes": 759656,
+ "artifactSha256": "0b680dcefcbb1bb27174e0cac44d57ab7cb33270150c2b392af0968bbbda0639",
"sourceBytes": 3629,
"sourceSha256": "ebcd29cbb7001f9a07e5fb45945777f7fa3832bc391ca591bda9ffe3d4be131e",
"checks": [
@@ -1473,8 +1473,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 758654,
- "artifactSha256": "fca3ecd2abd7c7f8165dd534b0a8141386d0c9120657f4e032696ea1c8409eff",
+ "artifactBytes": 762802,
+ "artifactSha256": "6a770e5fda18f93dae9e9d6a92794e30a0327eabda9cd94af45ccd11b4b3bda9",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index bcd16087..fba6b9a5 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -744,6 +744,7 @@
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2374,15 +2375,16 @@
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2450,28 +2452,48 @@
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2607,9 +2629,9 @@
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -5607,6 +5629,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -7237,15 +7260,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail=&quot;true&quot;] .container &gt; .header { grid-column: 1 / -1; }
html[data-reader-rail=&quot;true&quot;] .container &gt; .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram&#39;s height: notes scroll when long and
+ /* The rail is at least the diagram&#39;s height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail=&quot;true&quot;] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;]) .cards:empty { display: none; }
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;]) .cards {
@@ -7313,28 +7337,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail=&quot;bottom&quot;] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: &quot;cards&quot; &quot;index&quot;;
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail=&quot;bottom&quot;] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail=&quot;bottom&quot;] .cards { margin-top: 0; }
+ html[data-reader-rail=&quot;bottom&quot;] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail=&quot;bottom&quot;] .cards:empty { display: none; }
- html[data-reader-rail=&quot;bottom&quot;] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail=&quot;bottom&quot;] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail=&quot;bottom&quot;] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .reader-rail &gt; .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group:has(&gt; .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group:not(:has(&gt; .node-outline-heading)) &gt; ul::before { display: none; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;], [data-reader-rail=&quot;bottom&quot;]) .rail-controls {
display: flex;
@@ -7470,9 +7514,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout&#39;s tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -14228,16 +14272,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute(&#39;aria-expanded&#39;, String(mode === &#39;true&#39; || mode === &#39;overlay&#39;));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === &#39;collapsed&#39;;
+ railPlacement.hidden = !mode || mode === &#39;collapsed&#39; || (mode === &#39;bottom&#39; &amp;&amp; window.innerWidth &lt; RAIL_MIN_VIEWPORT);
railPlacement.setAttribute(&#39;data-placement&#39;, mode === &#39;bottom&#39; ? &#39;bottom&#39; : &#39;right&#39;);
railPlacement.setAttribute(&#39;aria-label&#39;, viewerText(mode === &#39;bottom&#39; ? &#39;viewer.rail.right&#39; : &#39;viewer.rail.bottom&#39;));
railPlacement.title = railPlacement.getAttribute(&#39;aria-label&#39;);
}
}
+ var outline = document.getElementById(&#39;node-outline&#39;);
function hasCards() {
- var outline = document.getElementById(&#39;node-outline&#39;);
return Boolean((cards &amp;&amp; cards.children.length &amp;&amp; !cards.hidden) || (outline &amp;&amp; !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute(&#39;data-reader-rail&#39;) === &#39;bottom&#39; ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram&#39;s
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute(&#39;data-reader-rail&#39;) !== &#39;true&#39; || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty(&#39;--archify-rail-max&#39;, Math.max(diagram.getBoundingClientRect().height, floor) + &#39;px&#39;);
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -14263,10 +14321,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow &gt; 1 &amp;&amp; lastWidth &gt; Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -14304,23 +14363,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth &gt; 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() &amp;&amp; window.innerWidth &gt;= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader&#39;s
+ // opt-in and needs a wide viewport.
+ if (hasCards() &amp;&amp; (readPreference(RAIL_PLACEMENT_KEY) !== &#39;right&#39; || window.innerWidth &lt; RAIL_MIN_VIEWPORT)) {
+ mode = &#39;bottom&#39;;
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra &lt;= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable &amp;&amp; (!comfortWidth || comfortWidth + chrome.diagramX + railExtra &lt;= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === &#39;bottom&#39;) mode = &#39;bottom&#39;;
- else if (collapsedPreference === &#39;1&#39; || (collapsedPreference !== &#39;0&#39; &amp;&amp; !comfortable)) mode = &#39;collapsed&#39;;
+ if (collapsedPreference === &#39;1&#39; || (collapsedPreference !== &#39;0&#39; &amp;&amp; !comfortable)) mode = &#39;collapsed&#39;;
else mode = fitsReadable ? &#39;true&#39; : &#39;overlay&#39;;
}
+ // With notes below the fold, the diagram may trade the renderer&#39;s
+ // comfortable primary size down to the rail&#39;s 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === &#39;bottom&#39; &amp;&amp; primaryWidth &gt; 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth &gt; 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === &#39;true&#39;;
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === &#39;bottom&#39; ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === &#39;bottom&#39; ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -14562,8 +14628,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty(&#39;--archify-dock-lift&#39;, lift + &#39;px&#39;);
+ else container.style.removeProperty(&#39;--archify-dock-lift&#39;);
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -14577,7 +14671,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 &amp;&amp; restorableReserve &gt; 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) &amp;&amp; intersectionArea(cameraNavRect, cameraStageRect) &gt; 0
@@ -14597,7 +14691,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -14619,7 +14713,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -14674,7 +14768,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -14700,6 +14794,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener(&#39;resize&#39;, reprobe, { passive: true });
+ window.addEventListener(&#39;scroll&#39;, scheduleLift, { passive: true });
window.addEventListener(&#39;load&#39;, schedule, { once: true });
window.addEventListener(&#39;beforeprint&#39;, schedule);
window.addEventListener(&#39;afterprint&#39;, reprobe);
@@ -14732,6 +14827,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve &gt; 0; },
receipt: function () { return lastReceipt || measure(); }
};
@@ -19591,6 +19687,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -21221,15 +21318,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail=&quot;true&quot;] .container &gt; .header { grid-column: 1 / -1; }
html[data-reader-rail=&quot;true&quot;] .container &gt; .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram&#39;s height: notes scroll when long and
+ /* The rail is at least the diagram&#39;s height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail=&quot;true&quot;] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;]) .cards:empty { display: none; }
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;]) .cards {
@@ -21297,28 +21395,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail=&quot;bottom&quot;] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: &quot;cards&quot; &quot;index&quot;;
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail=&quot;bottom&quot;] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail=&quot;bottom&quot;] .cards { margin-top: 0; }
+ html[data-reader-rail=&quot;bottom&quot;] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail=&quot;bottom&quot;] .cards:empty { display: none; }
- html[data-reader-rail=&quot;bottom&quot;] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail=&quot;bottom&quot;] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail=&quot;bottom&quot;] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .reader-rail &gt; .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group:has(&gt; .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group:not(:has(&gt; .node-outline-heading)) &gt; ul::before { display: none; }
+ html[data-reader-rail=&quot;bottom&quot;] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail=&quot;true&quot;], [data-reader-rail=&quot;overlay&quot;], [data-reader-rail=&quot;bottom&quot;]) .rail-controls {
display: flex;
@@ -21454,9 +21572,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout&#39;s tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail=&quot;bottom&quot;]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -28214,16 +28332,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute(&#39;aria-expanded&#39;, String(mode === &#39;true&#39; || mode === &#39;overlay&#39;));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === &#39;collapsed&#39;;
+ railPlacement.hidden = !mode || mode === &#39;collapsed&#39; || (mode === &#39;bottom&#39; &amp;&amp; window.innerWidth &lt; RAIL_MIN_VIEWPORT);
railPlacement.setAttribute(&#39;data-placement&#39;, mode === &#39;bottom&#39; ? &#39;bottom&#39; : &#39;right&#39;);
railPlacement.setAttribute(&#39;aria-label&#39;, viewerText(mode === &#39;bottom&#39; ? &#39;viewer.rail.right&#39; : &#39;viewer.rail.bottom&#39;));
railPlacement.title = railPlacement.getAttribute(&#39;aria-label&#39;);
}
}
+ var outline = document.getElementById(&#39;node-outline&#39;);
function hasCards() {
- var outline = document.getElementById(&#39;node-outline&#39;);
return Boolean((cards &amp;&amp; cards.children.length &amp;&amp; !cards.hidden) || (outline &amp;&amp; !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute(&#39;data-reader-rail&#39;) === &#39;bottom&#39; ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram&#39;s
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute(&#39;data-reader-rail&#39;) !== &#39;true&#39; || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty(&#39;--archify-rail-max&#39;, Math.max(diagram.getBoundingClientRect().height, floor) + &#39;px&#39;);
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -28249,10 +28381,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow &gt; 1 &amp;&amp; lastWidth &gt; Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -28290,23 +28423,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth &gt; 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() &amp;&amp; window.innerWidth &gt;= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader&#39;s
+ // opt-in and needs a wide viewport.
+ if (hasCards() &amp;&amp; (readPreference(RAIL_PLACEMENT_KEY) !== &#39;right&#39; || window.innerWidth &lt; RAIL_MIN_VIEWPORT)) {
+ mode = &#39;bottom&#39;;
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra &lt;= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable &amp;&amp; (!comfortWidth || comfortWidth + chrome.diagramX + railExtra &lt;= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === &#39;bottom&#39;) mode = &#39;bottom&#39;;
- else if (collapsedPreference === &#39;1&#39; || (collapsedPreference !== &#39;0&#39; &amp;&amp; !comfortable)) mode = &#39;collapsed&#39;;
+ if (collapsedPreference === &#39;1&#39; || (collapsedPreference !== &#39;0&#39; &amp;&amp; !comfortable)) mode = &#39;collapsed&#39;;
else mode = fitsReadable ? &#39;true&#39; : &#39;overlay&#39;;
}
+ // With notes below the fold, the diagram may trade the renderer&#39;s
+ // comfortable primary size down to the rail&#39;s 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === &#39;bottom&#39; &amp;&amp; primaryWidth &gt; 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth &gt; 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === &#39;true&#39;;
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === &#39;bottom&#39; ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === &#39;bottom&#39; ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -28548,8 +28688,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty(&#39;--archify-dock-lift&#39;, lift + &#39;px&#39;);
+ else container.style.removeProperty(&#39;--archify-dock-lift&#39;);
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -28563,7 +28731,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 &amp;&amp; restorableReserve &gt; 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) &amp;&amp; intersectionArea(cameraNavRect, cameraStageRect) &gt; 0
@@ -28583,7 +28751,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -28605,7 +28773,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -28660,7 +28828,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -28686,6 +28854,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener(&#39;resize&#39;, reprobe, { passive: true });
+ window.addEventListener(&#39;scroll&#39;, scheduleLift, { passive: true });
window.addEventListener(&#39;load&#39;, schedule, { once: true });
window.addEventListener(&#39;beforeprint&#39;, schedule);
window.addEventListener(&#39;afterprint&#39;, reprobe);
@@ -28718,6 +28887,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve &gt; 0; },
receipt: function () { return lastReceipt || measure(); }
};
@@ -32596,7 +32766,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
const status = document.querySelector('#review-status');
const receiptNode = document.querySelector('#archify-compare-receipt');
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
- const exportCss = "\n /* ==========================================================\n THEME VARIABLES — switch by toggling [data-theme] on \u003chtml\u003e\n ========================================================== */\n :root,\n [data-theme=\"dark\"] {\n --bg: #020617;\n --grid: #1e293b;\n --canvas-dot: rgba(148, 163, 184, 0.16);\n --text: #ffffff;\n --text-muted: #94a3b8;\n --text-dim: #475569;\n /* UI chrome and menu hints need more contrast than SVG .t-dim accents */\n --text-faint: #7d8da1;\n\n --panel: rgba(15, 23, 42, 0.5);\n --panel-border: #1e293b;\n --lane-fill: rgba(15, 23, 42, 0.22);\n --lane-stroke: #334155;\n\n --arrow: #64748b;\n --arrow-emphasis: #34d399;\n\n /* Opaque mask color used behind semi-transparent component fills\n so the arrows drawn underneath are properly hidden. */\n --mask: #0f172a;\n\n --frontend-fill: rgba(8, 51, 68, 0.4);\n --frontend-stroke: #22d3ee;\n --backend-fill: rgba(6, 78, 59, 0.4);\n --backend-stroke: #34d399;\n --database-fill: rgba(76, 29, 149, 0.4);\n --database-stroke: #a78bfa;\n --cloud-fill: rgba(120, 53, 15, 0.3);\n --cloud-stroke: #fbbf24;\n --security-fill: rgba(136, 19, 55, 0.4);\n --security-stroke: #fb7185;\n --messagebus-fill: rgba(251, 146, 60, 0.3);\n --messagebus-stroke:#fb923c;\n --external-fill: rgba(30, 41, 59, 0.5);\n --external-stroke: #94a3b8;\n\n --toolbar-bg: rgba(15, 23, 42, 0.8);\n --toolbar-border: #334155;\n --toolbar-text: #e2e8f0;\n --toolbar-hover: rgba(15, 23, 42, 0.95);\n --toolbar-menu-bg: #0f172a;\n }\n\n [data-theme=\"light\"] {\n --bg: #f4f5f7;\n --grid: #e9edf2;\n --canvas-dot: #d9dee5;\n --text: #111827;\n --text-muted: #5b6474;\n --text-dim: #9aa3b2;\n --text-faint: #6b7280;\n\n --panel: #ffffff;\n --panel-border: #e5e7eb;\n --lane-fill: rgba(248, 250, 252, 0.65);\n --lane-stroke: #cbd5e1;\n\n --arrow: #94a3b8;\n --arrow-emphasis: #059669;\n\n --mask: #ffffff;\n\n --frontend-fill: rgba(34, 211, 238, 0.15);\n --frontend-stroke: #0891b2;\n --backend-fill: rgba(52, 211, 153, 0.18);\n --backend-stroke: #059669;\n --database-fill: rgba(167, 139, 250, 0.2);\n --database-stroke: #7c3aed;\n --cloud-fill: rgba(251, 191, 36, 0.18);\n --cloud-stroke: #d97706;\n --security-fill: rgba(251, 113, 133, 0.15);\n --security-stroke: #e11d48;\n --messagebus-fill: rgba(251, 146, 60, 0.15);\n --messagebus-stroke: #ea580c;\n --external-fill: rgba(148, 163, 184, 0.18);\n --external-stroke: #64748b;\n\n --toolbar-bg: rgba(255, 255, 255, 0.92);\n --toolbar-border: #cbd5e1;\n --toolbar-text: #334155;\n --toolbar-hover: #ffffff;\n --toolbar-menu-bg: #ffffff;\n }\n\n /* ==========================================================\n SIGNAL FLOW — an opt-in, motion-forward visual preset.\n The variables also target a standalone exported SVG, whose\n root carries data-preset and data-theme directly.\n ========================================================== */\n [data-preset=\"signal-flow\"][data-theme=\"dark\"] {\n --bg: #030711;\n --grid: #15233a;\n --panel: rgba(6, 14, 28, 0.78);\n --panel-border: #1d3350;\n --lane-fill: rgba(9, 22, 40, 0.5);\n --lane-stroke: #2c4564;\n --text: #f5fbff;\n --text-muted: #9eb0c7;\n --text-dim: #52667f;\n --text-faint: #7890ad;\n --mask: #07101e;\n --frontend-fill: rgba(6, 182, 212, 0.14);\n --frontend-stroke: #67e8f9;\n --backend-fill: rgba(16, 185, 129, 0.14);\n --backend-stroke: #5eead4;\n --database-fill: rgba(139, 92, 246, 0.16);\n --database-stroke: #c4b5fd;\n --cloud-fill: rgba(245, 158, 11, 0.13);\n --cloud-stroke: #fcd34d;\n --security-fill: rgba(244, 63, 94, 0.13);\n --security-stroke: #fda4af;\n --messagebus-fill: rgba(249, 115, 22, 0.13);\n --messagebus-stroke: #fdba74;\n --external-fill: rgba(71, 85, 105, 0.24);\n --external-stroke: #a5b4c7;\n --arrow: #7890ad;\n --arrow-emphasis: #2dd4bf;\n --toolbar-bg: rgba(7, 16, 30, 0.86);\n --toolbar-border: #29415f;\n --toolbar-menu-bg: #07101e;\n }\n\n [data-preset=\"signal-flow\"][data-theme=\"light\"] {\n --bg: #f4f9fc;\n --grid: #d4e5ee;\n --panel: rgba(255, 255, 255, 0.82);\n --panel-border: #bfd5e2;\n --lane-fill: rgba(232, 243, 248, 0.62);\n --lane-stroke: #a9c5d5;\n --text: #102638;\n --text-muted: #587287;\n --text-dim: #8aa2b4;\n --text-faint: #668397;\n --mask: #ffffff;\n --frontend-fill: rgba(6, 182, 212, 0.09);\n --frontend-stroke: #0789a1;\n --backend-fill: rgba(5, 150, 105, 0.09);\n --backend-stroke: #087f69;\n --database-fill: rgba(124, 58, 237, 0.09);\n --database-stroke: #7254c7;\n --cloud-fill: rgba(217, 119, 6, 0.08);\n --cloud-stroke: #b9670b;\n --security-fill: rgba(225, 29, 72, 0.08);\n --security-stroke: #c53a59;\n --messagebus-fill: rgba(234, 88, 12, 0.08);\n --messagebus-stroke: #c65f27;\n --external-fill: rgba(100, 116, 139, 0.1);\n --external-stroke: #607a8c;\n --arrow: #7b97aa;\n --arrow-emphasis: #0d9488;\n }\n\n /* ==========================================================\n BLUEPRINT — a review-first drafting preset for deployment,\n infrastructure, and technical design documentation. It keeps\n the same semantic palette and geometry while trading glow for\n precise grid contrast, squared materials, and drafting marks.\n ========================================================== */\n [data-preset=\"blueprint\"][data-theme=\"dark\"] {\n --bg: #06131f;\n --grid: #17425a;\n --panel: rgba(7, 27, 43, 0.9);\n --panel-border: #27627f;\n --lane-fill: rgba(10, 43, 66, 0.36);\n --lane-stroke: #34799a;\n --text: #e3f6ff;\n --text-muted: #91b8ca;\n --text-dim: #557e92;\n --text-faint: #739caf;\n --mask: #0a2031;\n --frontend-fill: rgba(26, 157, 193, 0.14);\n --frontend-stroke: #66d9ef;\n --backend-fill: rgba(31, 155, 124, 0.13);\n --backend-stroke: #69dfbd;\n --database-fill: rgba(120, 105, 196, 0.14);\n --database-stroke: #b4a8ff;\n --cloud-fill: rgba(197, 145, 43, 0.13);\n --cloud-stroke: #ffd166;\n --security-fill: rgba(199, 76, 104, 0.13);\n --security-stroke: #ff8da1;\n --messagebus-fill: rgba(207, 112, 49, 0.13);\n --messagebus-stroke: #ffad66;\n --external-fill: rgba(84, 119, 139, 0.18);\n --external-stroke: #a7cad9;\n --arrow: #78a3b7;\n --arrow-emphasis: #64dfc1;\n --toolbar-bg: rgba(7, 28, 45, 0.92);\n --toolbar-border: #34799a;\n --toolbar-text: #d8f3ff;\n --toolbar-hover: rgba(18, 58, 83, 0.95);\n --toolbar-menu-bg: #0a2031;\n }\n\n [data-preset=\"blueprint\"][data-theme=\"light\"] {\n --bg: #edf7fa;\n --grid: #b5d5e1;\n --panel: rgba(249, 253, 255, 0.94);\n --panel-border: #78aabd;\n --lane-fill: rgba(210, 232, 240, 0.42);\n --lane-stroke: #83b2c4;\n --text: #123344;\n --text-muted: #4e7486;\n --text-dim: #86a6b4;\n --text-faint: #668c9d;\n --mask: #f9fdff;\n --frontend-fill: rgba(8, 145, 178, 0.08);\n --frontend-stroke: #087f9c;\n --backend-fill: rgba(5, 128, 101, 0.08);\n --backend-stroke: #08755f;\n --database-fill: rgba(100, 75, 180, 0.08);\n --database-stroke: #6757a8;\n --cloud-fill: rgba(181, 120, 15, 0.08);\n --cloud-stroke: #a86609;\n --security-fill: rgba(190, 48, 80, 0.07);\n --security-stroke: #b32f50;\n --messagebus-fill: rgba(196, 81, 22, 0.07);\n --messagebus-stroke: #b65120;\n --external-fill: rgba(79, 112, 128, 0.08);\n --external-stroke: #506f7e;\n --arrow: #6d93a5;\n --arrow-emphasis: #087f69;\n --toolbar-bg: rgba(247, 252, 254, 0.94);\n --toolbar-border: #8ab5c5;\n --toolbar-text: #294f61;\n --toolbar-hover: #ffffff;\n --toolbar-menu-bg: #f9fdff;\n }\n\n /* ==========================================================\n EDITORIAL — a warm, publication-minded preset for design\n reviews, launch notes, and documentation. The diagram keeps\n the same semantic palette and exact geometry, but trades\n software chrome for paper, ink, ruled structure, and one\n restrained vermilion accent.\n ========================================================== */\n [data-preset=\"editorial\"][data-theme=\"dark\"] {\n --bg: #181611;\n --grid: #39342a;\n --panel: rgba(35, 31, 24, 0.96);\n --panel-border: #625a4a;\n --lane-fill: rgba(52, 46, 35, 0.46);\n --lane-stroke: #726957;\n --text: #f4eddf;\n --text-muted: #b9ae9b;\n --text-dim: #776e60;\n --text-faint: #9d917e;\n --mask: #231f18;\n --frontend-fill: rgba(43, 133, 142, 0.16);\n --frontend-stroke: #7fc6c7;\n --backend-fill: rgba(63, 132, 92, 0.16);\n --backend-stroke: #8fc29e;\n --database-fill: rgba(117, 91, 141, 0.17);\n --database-stroke: #c0a4d0;\n --cloud-fill: rgba(170, 119, 49, 0.16);\n --cloud-stroke: #d8ad68;\n --security-fill: rgba(157, 69, 65, 0.17);\n --security-stroke: #df9085;\n --messagebus-fill: rgba(174, 79, 42, 0.16);\n --messagebus-stroke: #df946f;\n --external-fill: rgba(126, 115, 96, 0.18);\n --external-stroke: #b8ad99;\n --arrow: #948978;\n --arrow-emphasis: #dd6b3d;\n --toolbar-bg: rgba(35, 31, 24, 0.92);\n --toolbar-border: #625a4a;\n --toolbar-text: #eee5d5;\n --toolbar-hover: #302a20;\n --toolbar-menu-bg: #231f18;\n }\n\n [data-preset=\"editorial\"][data-theme=\"light\"] {\n --bg: #f2eee5;\n --grid: #d8d0c2;\n --panel: rgba(251, 248, 241, 0.97);\n --panel-border: #c4b9a6;\n --lane-fill: rgba(229, 221, 207, 0.42);\n --lane-stroke: #b8aa94;\n --text: #242018;\n --text-muted: #6f6658;\n --text-dim: #a09788;\n --text-faint: #817767;\n --mask: #fbf8f1;\n --frontend-fill: rgba(31, 117, 126, 0.09);\n --frontend-stroke: #287e84;\n --backend-fill: rgba(42, 119, 75, 0.09);\n --backend-stroke: #397b53;\n --database-fill: rgba(105, 75, 130, 0.09);\n --database-stroke: #765d86;\n --cloud-fill: rgba(157, 103, 31, 0.1);\n --cloud-stroke: #9a671f;\n --security-fill: rgba(153, 58, 52, 0.09);\n --security-stroke: #9e463f;\n --messagebus-fill: rgba(182, 70, 27, 0.09);\n --messagebus-stroke: #ad4b25;\n --external-fill: rgba(101, 91, 75, 0.09);\n --external-stroke: #746b5e;\n --arrow: #8a806f;\n --arrow-emphasis: #bb4c23;\n --toolbar-bg: rgba(251, 248, 241, 0.94);\n --toolbar-border: #c4b9a6;\n --toolbar-text: #40392f;\n --toolbar-hover: #fffdf8;\n --toolbar-menu-bg: #fbf8f1;\n }\n\n * { margin: 0; padding: 0; box-sizing: border-box; }\n\n body {\n --archify-page-top: 2rem;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n background: var(--bg);\n min-height: 100vh;\n padding: var(--archify-page-top) 2rem 2rem;\n color: var(--text);\n /* Theme surfaces change together; animating the page background leaves it\n visibly out of sync with the SVG and panel for the first 200ms. */\n }\n\n html[data-preset=\"signal-flow\"] body {\n background-image:\n radial-gradient(circle at 18% -8%, rgba(34, 211, 238, 0.14), transparent 34rem),\n radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.12), transparent 30rem);\n background-attachment: fixed;\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] body {\n background-image:\n radial-gradient(circle at 18% -8%, rgba(6, 182, 212, 0.12), transparent 34rem),\n radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.08), transparent 30rem);\n }\n html[data-preset=\"blueprint\"] body {\n background-image:\n linear-gradient(var(--grid) 1px, transparent 1px),\n linear-gradient(90deg, var(--grid) 1px, transparent 1px);\n background-size: 32px 32px;\n background-position: -1px -1px;\n background-attachment: fixed;\n }\n html[data-preset=\"editorial\"] body {\n background-image:\n linear-gradient(90deg, transparent 0, transparent 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) calc(5.4rem + 1px), transparent calc(5.4rem + 1px)),\n repeating-linear-gradient(0deg, transparent 0, transparent 31px, color-mix(in srgb, var(--grid) 36%, transparent) 31px, color-mix(in srgb, var(--grid) 36%, transparent) 32px);\n background-attachment: fixed;\n }\n\n /* Gallery/embed mode keeps the generated artifact as the source of truth\n while presenting only its diagram surface inside a proof card. */\n html[data-embed=\"true\"] body {\n min-height: 0;\n padding: 0;\n overflow: hidden;\n background: var(--bg);\n background-image: none;\n }\n html[data-embed=\"true\"] .toolbar,\n html[data-embed=\"true\"] .header,\n html[data-embed=\"true\"] .cards,\n html[data-embed=\"true\"] .diagram-nav,\n html[data-embed=\"true\"] .overview-map,\n html[data-embed=\"true\"] .focus-chip,\n html[data-embed=\"true\"] .route-probe,\n html[data-embed=\"true\"] .semantic-lens,\n html[data-embed=\"true\"] .diagram-guide,\n html[data-embed=\"true\"] .node-finder,\n html[data-embed=\"true\"] .node-outline { display: none !important; }\n html[data-embed=\"true\"] .container { max-width: none; }\n html[data-embed=\"true\"] .diagram-container {\n padding: 0.5rem;\n border: 0;\n border-radius: 0;\n box-shadow: none;\n }\n html[data-embed=\"true\"] .diagram-container svg { min-width: 0; }\n\n /* Presentation Stage is a viewer-only layer: it gives the live diagram\n the viewport while keeping guided views, theme, focus, and exports real.\n Embed mode wins when both query parameters are present. */\n html[data-present=\"true\"]:not([data-embed=\"true\"]) body {\n --archify-page-top: 1rem;\n height: 100dvh;\n min-height: 0;\n padding: 1rem;\n overflow: hidden;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .container {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n width: 100%;\n max-width: none;\n height: calc(100dvh - 2rem);\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header {\n flex: none;\n min-width: 0;\n margin: 0;\n padding-right: 23rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row { margin-bottom: 0.25rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .subtitle {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n min-height: 0;\n padding: 0.75rem;\n padding-bottom: calc(0.75rem + var(--archify-nav-reserve));\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container \u003e svg {\n flex: 1 1 auto;\n height: 100%;\n min-height: 0;\n width: 100%;\n min-width: 0;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .cards { display: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) #btn-present {\n border-color: var(--frontend-stroke);\n color: var(--frontend-stroke);\n }\n\n /* The reader owns only the outer scale. Wide diagrams and measured tall workflows keep one authored\n SVG/viewBox while the runtime chooses a desktop width from the actual\n vertical budget. This avoids device-specific files and breakpoint\n jumps between a laptop and a tall monitor. */\n .container {\n width: 100%;\n max-width: var(--archify-reader-width, 1440px);\n margin: 0 auto;\n }\n @media (min-width: 768px) and (max-height: 920px) {\n .header { margin-bottom: 1rem; }\n .diagram-container { padding: 1rem; }\n .cards { margin-top: 1rem; }\n .card { padding: 1rem; }\n }\n\n .header { margin-bottom: 1.5rem; padding-right: 29.5rem; }\n\n html[data-preset=\"signal-flow\"] .header,\n html[data-preset=\"blueprint\"] .header,\n html[data-preset=\"editorial\"] .header { padding-right: 29.5rem; }\n\n .header-row {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n min-height: 2.75rem;\n margin-bottom: 0.25rem;\n }\n\n .pulse-dot {\n flex: none;\n width: 10px;\n height: 10px;\n background: var(--frontend-stroke);\n border-radius: 50%;\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);\n animation: none;\n }\n\n html[data-motion-capable=\"true\"] .pulse-dot { animation: pulse 2s infinite; }\n\n @keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n\n h1 {\n font-size: 1.5rem;\n font-weight: 650;\n line-height: 1.25;\n letter-spacing: -0.015em;\n }\n\n .subtitle {\n color: var(--text-muted);\n font-size: 0.875rem;\n line-height: 1.55;\n margin-left: 1.375rem;\n }\n\n html[data-preset=\"signal-flow\"] .header-row::after {\n content: attr(data-preset-badge-signal-flow);\n flex: none;\n margin-left: 0.25rem;\n color: var(--frontend-stroke);\n border: 1px solid var(--frontend-stroke);\n border-radius: 999px;\n padding: 0.28rem 0.6rem;\n font-size: 0.625rem;\n letter-spacing: 0.12em;\n opacity: 0.82;\n box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);\n white-space: nowrap;\n }\n\n html[data-preset=\"blueprint\"] .pulse-dot {\n width: 10px;\n height: 10px;\n border: 1px solid var(--frontend-stroke);\n border-radius: 1px;\n background: transparent;\n box-shadow: inset 0 0 0 2px var(--bg);\n transform: rotate(45deg);\n animation: none;\n }\n html[data-preset=\"blueprint\"] .header-row::after {\n content: attr(data-preset-badge-blueprint);\n flex: none;\n margin-left: 0.25rem;\n padding: 0.28rem 0.55rem;\n border-top: 1px solid var(--frontend-stroke);\n border-bottom: 1px solid var(--frontend-stroke);\n color: var(--frontend-stroke);\n font-size: 0.5625rem;\n font-weight: 700;\n letter-spacing: 0.14em;\n white-space: nowrap;\n }\n\n html[data-preset=\"editorial\"] h1,\n html[data-preset=\"editorial\"] .card h3 {\n font-family: Georgia, 'Times New Roman', 'Songti SC', STSong, serif;\n letter-spacing: -0.02em;\n }\n html[data-preset=\"editorial\"] h1 { font-size: 1.72rem; font-weight: 600; }\n html[data-preset=\"editorial\"] .pulse-dot {\n width: 9px;\n height: 9px;\n border: 1px solid var(--arrow-emphasis);\n border-radius: 0;\n background: var(--arrow-emphasis);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);\n transform: rotate(45deg);\n animation: none;\n }\n html[data-preset=\"editorial\"] .header-row::after {\n content: attr(data-preset-badge-editorial);\n flex: none;\n margin-left: 0.25rem;\n padding: 0.32rem 0 0.24rem;\n border-bottom: 2px solid var(--arrow-emphasis);\n color: var(--arrow-emphasis);\n font-family: Georgia, 'Times New Roman', serif;\n font-size: 0.625rem;\n font-style: italic;\n font-weight: 600;\n letter-spacing: 0.08em;\n white-space: nowrap;\n }\n\n .diagram-container {\n --archify-nav-reserve: 0px;\n background: var(--panel);\n border-radius: 1rem;\n border: 1px solid var(--panel-border);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);\n padding: 1.5rem;\n padding-bottom: calc(1.5rem + var(--archify-nav-reserve));\n overflow: hidden;\n position: relative;\n }\n\n html[data-preset=\"signal-flow\"] .diagram-container {\n position: relative;\n overflow: hidden;\n background: linear-gradient(180deg, rgba(8, 20, 38, 0.82), rgba(3, 8, 18, 0.94));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.34);\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] .diagram-container {\n background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 246, 250, 0.94));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 60px rgba(45, 78, 99, 0.12);\n }\n html[data-preset=\"blueprint\"] .diagram-container {\n border-color: var(--panel-border);\n border-radius: 0.35rem;\n background: var(--panel);\n box-shadow:\n inset 0 0 0 1px color-mix(in srgb, var(--panel-border) 34%, transparent),\n 0 18px 48px rgba(0, 0, 0, 0.16);\n }\n html[data-preset=\"blueprint\"] .diagram-container::after {\n content: \"\";\n position: absolute;\n z-index: 10;\n inset: 0.7rem;\n pointer-events: none;\n background:\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1px 1.35rem no-repeat;\n opacity: 0.58;\n }\n html[data-preset=\"editorial\"] .diagram-container {\n overflow: hidden;\n border-color: var(--panel-border);\n border-radius: 0.38rem;\n background:\n linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 12%),\n var(--panel);\n box-shadow:\n 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent),\n 0 18px 48px color-mix(in srgb, #000 19%, transparent);\n }\n html[data-preset=\"editorial\"] .diagram-container::after {\n position: absolute;\n z-index: 10;\n top: 0.72rem;\n right: 1.25rem;\n padding: 0.2rem 0.52rem;\n border: 1px solid var(--panel-border);\n background: var(--panel);\n color: var(--arrow-emphasis);\n content: attr(data-preset-badge-editorial-plate);\n font-family: Georgia, 'Times New Roman', serif;\n font-size: 0.52rem;\n font-style: italic;\n font-weight: 600;\n letter-spacing: 0.09em;\n pointer-events: none;\n }\n html[data-embed=\"true\"][data-preset=\"editorial\"] .diagram-container::after { display: none; }\n html[data-motion-capable=\"true\"][data-preset=\"signal-flow\"][data-ambient-motion=\"running\"] .diagram-container::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n background: linear-gradient(115deg, transparent 28%, rgba(103, 232, 249, 0.035) 48%, transparent 68%);\n transform: translateX(-70%);\n animation: archify-signal-scan 4.8s ease-in-out 1 both;\n }\n\n /* Motion Governor gives the reader a real static state and gives the\n strongest semantic action the only motion budget. Atmosphere resets to\n its authored base instead of freezing mid-cycle. Static artifacts never\n start a decorative pulse or scan. */\n html:not([data-motion-capable=\"true\"]) svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n }\n html:not([data-motion-capable=\"true\"]) svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n }\n html[data-motion=\"still\"] .pulse-dot,\n html[data-motion=\"still\"] .diagram-container::before,\n html[data-motion=\"still\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-motion-owner] .pulse-dot,\n html[data-motion-owner] .diagram-container::before,\n html[data-motion-owner] svg[data-animation=\"trace\"] [data-animate],\n html[data-embed=\"true\"] .pulse-dot,\n html[data-embed=\"true\"] .diagram-container::before,\n html[data-share-playback=\"true\"] .pulse-dot,\n html[data-share-playback=\"true\"] .diagram-container::before,\n html[data-document-hidden=\"true\"] .pulse-dot,\n html[data-document-hidden=\"true\"] .diagram-container::before,\n html[data-document-hidden=\"true\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-motion=\"still\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-motion-owner] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-document-hidden=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n }\n html[data-motion=\"still\"] .diagram-container::before,\n html[data-motion-owner] .diagram-container::before,\n html[data-embed=\"true\"] .diagram-container::before,\n html[data-share-playback=\"true\"] .diagram-container::before {\n opacity: 0;\n }\n html[data-motion=\"still\"] .intent-trace-flow,\n html[data-motion=\"still\"] .route-probe-flow,\n html[data-motion=\"still\"] .route-journey-flow,\n html[data-motion=\"still\"] .semantic-lens-flow,\n html[data-motion=\"still\"] .diagram-guide,\n html[data-motion=\"still\"] .overview-map-live,\n html[data-document-hidden=\"true\"] .intent-trace-flow,\n html[data-document-hidden=\"true\"] .route-probe-flow,\n html[data-document-hidden=\"true\"] .route-journey-flow,\n html[data-document-hidden=\"true\"] .semantic-lens-flow,\n html[data-document-hidden=\"true\"] .diagram-guide,\n html[data-document-hidden=\"true\"] .overview-map-live {\n animation: none !important;\n }\n\n html[data-motion=\"still\"] .intent-trace-flow,\n html[data-motion=\"still\"] .route-probe-flow {\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.72;\n }\n html[data-motion=\"still\"] .route-journey-overlay,\n html[data-document-hidden=\"true\"] .route-journey-overlay { display: none !important; }\n html[data-motion=\"still\"] .relationship-pulse-overlay { display: none !important; }\n\n html[data-motion=\"still\"] svg [data-node-id],\n html[data-motion=\"still\"] svg [data-edge-from],\n html[data-motion=\"still\"] svg [data-detail],\n html[data-motion=\"still\"] svg [data-detail-anchor],\n html[data-motion=\"still\"] svg [data-legend-hit],\n html[data-motion=\"still\"] svg {\n transition: none !important;\n }\n\n svg {\n font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;\n width: 100%;\n min-width: min(900px, 100%);\n display: block;\n transform-origin: 0 0;\n transition: transform 0.18s ease;\n }\n\n .diagram-container.is-camera-moving svg {\n transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);\n }\n .diagram-container.is-camera-transaction svg { transition: none; }\n .diagram-container.is-pannable { cursor: grab; }\n .diagram-container.is-panning { cursor: grabbing; user-select: none; }\n .diagram-container.is-panning svg { transition: none; }\n\n .diagram-nav {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n z-index: 12;\n display: inline-flex;\n align-items: center;\n max-width: calc(100% - 2rem);\n padding: 0.25rem;\n gap: 0.0625rem;\n overflow-x: auto;\n border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);\n border-radius: 0.75rem;\n background: color-mix(in srgb, var(--panel) 84%, transparent);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);\n backdrop-filter: blur(14px) saturate(1.2);\n scrollbar-width: none;\n }\n .diagram-nav::-webkit-scrollbar { display: none; }\n .diagram-nav button,\n .focus-chip button {\n border: 0;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n cursor: pointer;\n }\n .diagram-nav button {\n min-width: 2rem;\n height: 2rem;\n padding: 0 0.4rem;\n border-radius: 0.5rem;\n color: var(--text-muted);\n font-size: 0.75rem;\n font-weight: 500;\n letter-spacing: 0;\n transition: background 0.15s, color 0.15s;\n }\n .diagram-nav button:hover,\n .diagram-nav button:focus-visible {\n color: var(--text);\n background: color-mix(in srgb, var(--text) 6%, transparent);\n }\n .diagram-nav button:hover,\n .diagram-nav button:focus-visible,\n .focus-chip button:hover,\n .focus-chip button:focus-visible { background: var(--toolbar-hover); }\n .diagram-nav button:focus-visible,\n .focus-chip button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .diagram-nav button:disabled { opacity: 0.38; cursor: default; }\n /* The Guide stays on the ? shortcut; Map only earns dock space once the\n reader has zoomed past the full diagram (or opened it from the keyboard). */\n .diagram-nav button[hidden] { display: none; }\n .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }\n .diagram-nav button:disabled:hover { background: transparent; }\n .diagram-nav #btn-route-probe,\n .diagram-nav #btn-overview-map,\n .diagram-nav #btn-semantic-lens {\n min-width: auto;\n padding-inline: 0.6rem;\n color: var(--text-muted);\n font-weight: 500;\n }\n .diagram-nav #btn-node-finder,\n .diagram-nav [data-view=\"out\"] {\n position: relative;\n margin-left: 0.375rem;\n }\n .diagram-nav #btn-node-finder::before,\n .diagram-nav [data-view=\"out\"]::before {\n position: absolute;\n top: 0.55rem;\n bottom: 0.55rem;\n left: -0.19rem;\n width: 1px;\n background: color-mix(in srgb, var(--panel-border) 90%, transparent);\n content: \"\";\n pointer-events: none;\n }\n .diagram-nav-icon {\n display: block;\n width: 0.875rem;\n height: 0.875rem;\n margin: auto;\n background: currentColor;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .diagram-nav-icon.find {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.guide {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.minus {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.plus {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav [data-view=\"reset\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.2rem;\n min-width: 3.1rem;\n padding-inline: 0.35rem;\n }\n .diagram-nav [data-view=\"reset\"][data-detail-visible] {\n min-width: 3.8rem;\n }\n .diagram-nav-detail {\n color: color-mix(in srgb, var(--toolbar-text) 52%, transparent);\n font-size: 0.44rem;\n font-weight: 700;\n line-height: 1;\n letter-spacing: 0.07em;\n }\n .diagram-nav-percent {\n color: var(--text-muted);\n font-size: 0.75rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n line-height: 1;\n }\n /* Mode buttons carry a small glyph so the dock reads as one icon language. */\n .diagram-nav #btn-route-probe,\n .diagram-nav #btn-overview-map,\n .diagram-nav #btn-semantic-lens {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n padding-inline: 0.55rem 0.65rem;\n }\n .diagram-nav #btn-route-probe::before,\n .diagram-nav #btn-overview-map::before,\n .diagram-nav #btn-semantic-lens::before {\n flex: none;\n width: 0.875rem;\n height: 0.875rem;\n background: currentColor;\n content: \"\";\n opacity: 0.85;\n -webkit-mask: var(--nav-glyph) center / contain no-repeat;\n mask: var(--nav-glyph) center / contain no-repeat;\n }\n .diagram-nav #btn-route-probe { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E\"); }\n .diagram-nav #btn-overview-map { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E\"); }\n .diagram-nav #btn-semantic-lens { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E\"); }\n /* Zoom out / level / zoom in join into one stepper well. */\n .diagram-nav [data-view=\"out\"],\n .diagram-nav [data-view=\"reset\"],\n .diagram-nav [data-view=\"in\"] {\n border-radius: 0;\n background: color-mix(in srgb, var(--text) 4.5%, transparent);\n }\n .diagram-nav [data-view=\"out\"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }\n .diagram-nav [data-view=\"out\"]::before { display: none; }\n .diagram-nav [data-view=\"reset\"],\n .diagram-nav [data-view=\"in\"] { margin-left: -0.0625rem; }\n .diagram-nav [data-view=\"in\"] { border-radius: 0 0.5rem 0.5rem 0; }\n .diagram-nav [data-view=\"out\"]:hover,\n .diagram-nav [data-view=\"reset\"]:hover,\n .diagram-nav [data-view=\"in\"]:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }\n .diagram-nav [data-view=\"out\"]:disabled,\n .diagram-nav [data-view=\"in\"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }\n .diagram-nav [data-view=\"out\"]:disabled:hover,\n .diagram-nav [data-view=\"in\"]:disabled:hover { background: color-mix(in srgb, var(--text) 4.5%, transparent); }\n .diagram-nav [data-view=\"reset\"] { min-width: 3.25rem; }\n .diagram-container[data-camera-indicator=\"true\"] .diagram-nav-detail,\n .diagram-container[data-camera-indicator=\"true\"] .diagram-nav-percent { color: var(--frontend-stroke); }\n .diagram-nav #btn-diagram-guide[aria-expanded=\"true\"] {\n color: var(--cloud-stroke);\n background: var(--toolbar-hover);\n }\n\n /* Semantic Radar is a deliberately simplified, viewer-only overview. It\n uses authored node bounds and the live camera viewport rather than\n cloning the canonical SVG, so IDs, filters, animation, and export state\n stay singular and deterministic. */\n .overview-map {\n position: absolute;\n right: 1rem;\n bottom: calc(4.15rem + var(--archify-nav-reserve));\n z-index: 12;\n width: 11.25rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));\n border-radius: 0.78rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.625rem;\n }\n .overview-map[hidden] { display: none; }\n .overview-map[data-docked=\"true\"] {\n position: fixed;\n right: var(--archify-radar-right, 1rem);\n top: var(--archify-radar-top, 1rem);\n bottom: auto;\n }\n .overview-map[data-docked=\"true\"][data-dock-side=\"left\"] {\n right: auto;\n left: var(--archify-radar-left, 1rem);\n }\n html[data-preset=\"blueprint\"] .overview-map { border-radius: 0.28rem; }\n .overview-map-head {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.45rem;\n min-height: 2.25rem;\n padding: 0.42rem 0.48rem 0.38rem 0.55rem;\n border-bottom: 1px solid var(--toolbar-border);\n background: linear-gradient(110deg, color-mix(in srgb, var(--frontend-fill) 45%, transparent), transparent 68%);\n cursor: grab;\n touch-action: none;\n user-select: none;\n }\n .overview-map[data-panel-dragging=\"true\"] .overview-map-head { cursor: grabbing; }\n .overview-map[data-placement-invalid=\"true\"] {\n border-color: var(--security-stroke);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--security-stroke) 34%, transparent), 0 16px 42px rgba(0, 0, 0, 0.3);\n }\n .overview-map[data-compact=\"true\"] {\n width: 7.4rem;\n }\n .overview-map[data-compact=\"true\"] .overview-map-head {\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.24rem;\n min-height: 1.5rem;\n padding: 0.05rem 0.16rem 0.05rem 0.32rem;\n border-bottom: 0;\n }\n .overview-map[data-compact=\"true\"] .overview-map-live,\n .overview-map[data-compact=\"true\"] .overview-map-copy,\n .overview-map[data-compact=\"true\"] .overview-map-surface,\n .overview-map[data-compact=\"true\"] .overview-map-hint {\n display: none;\n }\n .overview-map[data-compact=\"true\"] .overview-map-expand { display: inline-flex; }\n .overview-map[data-compact=\"true\"] .overview-map-close {\n width: 1.15rem;\n height: 1.15rem;\n font-size: 0.72rem;\n }\n .overview-map-live {\n width: 0.42rem;\n height: 0.42rem;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent);\n animation: archify-radar-live 2.4s ease-out infinite;\n }\n .overview-map-copy { min-width: 0; line-height: 1.1; }\n .overview-map-copy strong {\n display: block;\n overflow: hidden;\n color: var(--frontend-stroke);\n font-size: 0.59rem;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .overview-map-copy small {\n display: block;\n margin-top: 0.18rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.52rem;\n letter-spacing: 0.04em;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .overview-map-expand {\n display: none;\n align-items: center;\n justify-content: center;\n min-width: 0;\n height: 1.2rem;\n padding: 0 0.34rem;\n overflow: hidden;\n border: 0;\n border-radius: 0.3rem;\n background: transparent;\n color: var(--frontend-stroke);\n font: inherit;\n font-size: 0.49rem;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n white-space: nowrap;\n cursor: pointer;\n }\n .overview-map-close {\n width: 1.55rem;\n height: 1.55rem;\n padding: 0;\n border: 0;\n border-radius: 0.34rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n .overview-map-expand:hover,\n .overview-map-expand:focus-visible,\n .overview-map-close:hover,\n .overview-map-close:focus-visible { background: var(--toolbar-hover); }\n .overview-map-expand:focus-visible,\n .overview-map-close:focus-visible,\n .overview-map-surface:focus-visible,\n .overview-map-node:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .overview-map-surface {\n position: relative;\n height: 7rem;\n margin: 0.42rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--panel-border) 72%, transparent);\n border-radius: 0.42rem;\n background:\n linear-gradient(color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),\n linear-gradient(90deg, color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),\n color-mix(in srgb, var(--bg) 86%, transparent);\n background-size: 12px 12px;\n cursor: crosshair;\n touch-action: none;\n }\n html[data-preset=\"blueprint\"] .overview-map-surface { border-radius: 0.1rem; }\n .overview-map-surface \u003e svg {\n width: 100%;\n height: 100%;\n min-width: 0;\n transform: none !important;\n transition: none !important;\n display: block;\n overflow: visible;\n }\n .overview-map-node {\n fill: var(--backend-stroke);\n fill-opacity: 0.52;\n stroke: var(--backend-stroke);\n stroke-opacity: 0.86;\n vector-effect: non-scaling-stroke;\n cursor: pointer;\n transition: fill-opacity 140ms ease, stroke-width 140ms ease, filter 140ms ease;\n }\n .overview-map-node[data-kind=\"frontend\"],\n .overview-map-node[data-kind=\"start\"] { fill: var(--frontend-stroke); stroke: var(--frontend-stroke); }\n .overview-map-node[data-kind=\"database\"],\n .overview-map-node[data-kind=\"success\"] { fill: var(--database-stroke); stroke: var(--database-stroke); }\n .overview-map-node[data-kind=\"cloud\"],\n .overview-map-node[data-kind=\"waiting\"] { fill: var(--cloud-stroke); stroke: var(--cloud-stroke); }\n .overview-map-node[data-kind=\"messagebus\"] { fill: var(--messagebus-stroke); stroke: var(--messagebus-stroke); }\n .overview-map-node[data-kind=\"security\"],\n .overview-map-node[data-kind=\"decision\"],\n .overview-map-node[data-kind=\"failure\"] { fill: var(--security-stroke); stroke: var(--security-stroke); }\n .overview-map-node[data-kind=\"external\"],\n .overview-map-node[data-kind=\"neutral\"] { fill: var(--external-stroke); stroke: var(--external-stroke); }\n .overview-map-node[data-radar-active=\"true\"],\n .overview-map-node:hover,\n .overview-map-node:focus-visible {\n fill-opacity: 0.92;\n stroke-width: 2.2;\n filter: drop-shadow(0 0 3px currentColor);\n }\n .overview-map-viewport {\n fill: color-mix(in srgb, var(--frontend-fill) 56%, transparent);\n stroke: var(--frontend-stroke);\n stroke-width: 2;\n vector-effect: non-scaling-stroke;\n pointer-events: none;\n filter: drop-shadow(0 0 3px color-mix(in srgb, var(--frontend-stroke) 54%, transparent));\n }\n .overview-map-hint {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0 0.52rem 0.46rem;\n color: var(--text-faint);\n font-size: 0.49rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n }\n .diagram-nav #btn-overview-map[aria-expanded=\"true\"] {\n color: var(--frontend-stroke);\n background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);\n }\n .overview-map-feedback {\n position: absolute;\n right: 1rem;\n bottom: 4.15rem;\n z-index: 13;\n max-width: min(16rem, calc(100% - 2rem));\n padding: 0.38rem 0.55rem;\n border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));\n border-radius: 0.5rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n font-size: 0.52rem;\n line-height: 1.35;\n pointer-events: none;\n }\n .overview-map-feedback[hidden] { display: none; }\n .focus-chip[data-radar-yielded=\"true\"] { display: none !important; }\n .diagram-nav #btn-route-probe[aria-pressed=\"true\"] {\n color: var(--backend-stroke);\n background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);\n }\n .diagram-nav #btn-semantic-lens[aria-expanded=\"true\"],\n .diagram-nav #btn-semantic-lens[aria-pressed=\"true\"] {\n color: var(--database-stroke);\n background: color-mix(in srgb, var(--database-stroke) 11%, transparent);\n }\n\n /* Semantic Lens turns the compiled node-kind palette into an analytical\n legend. One kind reveals its real traffic; two kinds compare only their\n direct authored relationships. Geometry and the canonical SVG stay put. */\n .semantic-lens {\n position: absolute;\n right: 1rem;\n bottom: calc(4.15rem + var(--archify-nav-reserve));\n z-index: 24;\n width: min(20rem, calc(100% - 2rem));\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--database-stroke) 58%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(135deg, color-mix(in srgb, var(--database-fill) 34%, transparent), transparent 48%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);\n backdrop-filter: blur(18px);\n animation: archify-lens-in 180ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n .semantic-lens[hidden] { display: none; }\n .semantic-lens[data-dock-side=\"left\"] { left: 1rem; right: auto; }\n .semantic-lens[data-dock-side=\"right\"] { left: auto; right: 1rem; }\n html[data-preset=\"blueprint\"] .semantic-lens { border-radius: 0.28rem; }\n .semantic-lens-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.75rem;\n padding: 0.72rem 0.78rem 0.62rem;\n border-bottom: 1px solid var(--toolbar-border);\n }\n .semantic-lens-eyebrow {\n display: block;\n color: var(--database-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.16em;\n text-transform: uppercase;\n }\n .semantic-lens-title {\n display: block;\n margin-top: 0.16rem;\n color: var(--text);\n font-size: 0.82rem;\n letter-spacing: -0.02em;\n }\n .semantic-lens-close {\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .semantic-lens-close:hover,\n .semantic-lens-close:focus-visible { background: var(--toolbar-hover); }\n .semantic-lens-instruction {\n margin: 0;\n padding: 0.52rem 0.78rem 0.48rem;\n color: var(--text-faint);\n font-size: 0.55rem;\n line-height: 1.45;\n }\n .semantic-lens-kinds {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.3rem;\n max-height: min(15rem, 40vh);\n padding: 0 0.5rem 0.5rem;\n overflow-y: auto;\n scrollbar-width: thin;\n }\n .semantic-lens-kind {\n --lens-color: var(--external-stroke);\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.42rem;\n min-width: 0;\n min-height: 2.15rem;\n padding: 0.35rem 0.42rem;\n border: 1px solid color-mix(in srgb, var(--lens-color) 24%, var(--toolbar-border));\n border-radius: 0.45rem;\n background: color-mix(in srgb, var(--panel) 76%, transparent);\n color: var(--toolbar-text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;\n }\n html[data-preset=\"blueprint\"] .semantic-lens-kind { border-radius: 0.12rem; }\n .semantic-lens-kind[data-kind=\"frontend\"],\n .semantic-lens-kind[data-kind=\"start\"] { --lens-color: var(--frontend-stroke); }\n .semantic-lens-kind[data-kind=\"backend\"],\n .semantic-lens-kind[data-kind=\"active\"] { --lens-color: var(--backend-stroke); }\n .semantic-lens-kind[data-kind=\"database\"],\n .semantic-lens-kind[data-kind=\"success\"] { --lens-color: var(--database-stroke); }\n .semantic-lens-kind[data-kind=\"cloud\"],\n .semantic-lens-kind[data-kind=\"waiting\"] { --lens-color: var(--cloud-stroke); }\n .semantic-lens-kind[data-kind=\"messagebus\"] { --lens-color: var(--messagebus-stroke); }\n .semantic-lens-kind[data-kind=\"security\"],\n .semantic-lens-kind[data-kind=\"decision\"],\n .semantic-lens-kind[data-kind=\"failure\"] { --lens-color: var(--security-stroke); }\n .semantic-lens-kind:hover,\n .semantic-lens-kind:focus-visible,\n .semantic-lens-kind[aria-pressed=\"true\"] {\n border-color: color-mix(in srgb, var(--lens-color) 78%, var(--toolbar-border));\n background: color-mix(in srgb, var(--lens-color) 11%, var(--panel));\n }\n .semantic-lens-kind:focus-visible,\n .semantic-lens-close:focus-visible,\n .semantic-lens-actions button:focus-visible {\n outline: 2px solid var(--database-stroke);\n outline-offset: 1px;\n }\n .semantic-lens-kind:disabled { opacity: 0.34; cursor: default; }\n .semantic-lens-swatch {\n width: 0.48rem;\n height: 0.48rem;\n border-radius: 50%;\n background: var(--lens-color);\n box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color) 58%, transparent);\n }\n .semantic-lens-kind strong {\n overflow: hidden;\n color: var(--text);\n font-size: 0.61rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-lens-kind em {\n color: var(--lens-color);\n font-size: 0.54rem;\n font-style: normal;\n font-weight: 800;\n }\n .semantic-lens-status {\n min-height: 2.5rem;\n margin: 0;\n padding: 0.55rem 0.78rem;\n border-top: 1px solid var(--toolbar-border);\n color: var(--text-faint);\n font-size: 0.55rem;\n line-height: 1.45;\n }\n .semantic-lens-status strong { color: var(--database-stroke); font-weight: 800; }\n .semantic-lens-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.28rem;\n padding: 0 0.62rem 0.62rem;\n }\n .semantic-lens-actions button {\n min-height: 1.8rem;\n padding: 0.28rem 0.48rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 0.56rem;\n cursor: pointer;\n }\n .semantic-lens-actions button:hover { background: var(--toolbar-hover); }\n .semantic-lens-actions #semantic-lens-copy { color: var(--database-stroke); }\n @keyframes archify-lens-in {\n from { opacity: 0; transform: translateY(5px) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n\n /* Route Probe answers a reader question over the compiled semantic graph:\n choose two stable nodes and reveal the shortest authored directed route.\n The receipt and signal live entirely in the viewer layer. */\n .route-probe {\n position: absolute;\n left: 1rem;\n bottom: calc(1rem + var(--archify-nav-reserve));\n z-index: 12;\n width: min(46rem, calc(100% - 25rem));\n min-width: 18rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 62%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(115deg, color-mix(in srgb, var(--backend-fill) 50%, transparent), transparent 62%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.75rem;\n }\n .route-probe[hidden] { display: none; }\n /* Picking needs one line of guidance, not a wide empty card; the panel\n widens only when there is a traced route to show. */\n .route-probe:not([data-state=\"result\"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }\n .route-probe-path:has(\u003e .route-probe-placeholder:only-child) { display: none; }\n .route-probe[data-route-dock=\"top\"] {\n top: 1rem;\n bottom: auto;\n }\n html[data-preset=\"blueprint\"] .route-probe { border-radius: 0.25rem; }\n .route-probe-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.65rem;\n padding: 0.625rem 0.75rem 0.5rem;\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);\n }\n .route-probe-copy { min-width: 0; }\n .route-probe-eyebrow {\n display: block;\n color: var(--backend-stroke);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n }\n .route-probe-title {\n display: block;\n margin-top: 0.14rem;\n overflow: hidden;\n color: var(--toolbar-text);\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .route-probe-actions { display: flex; gap: 0.2rem; }\n .route-probe button {\n min-height: 1.55rem;\n padding: 0.25rem 0.42rem;\n border: 0;\n border-radius: 0.36rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n cursor: pointer;\n }\n .route-probe button:hover,\n .route-probe button:focus-visible { background: var(--toolbar-hover); }\n .route-probe button:focus-visible {\n outline: 2px solid var(--backend-stroke);\n outline-offset: 1px;\n }\n .route-probe-copy-link { color: var(--frontend-stroke) !important; }\n .route-probe-find { color: var(--backend-stroke) !important; }\n .route-probe-copy-link[hidden] { display: none; }\n .route-probe-find[hidden] { display: none; }\n .route-probe-path {\n display: flex;\n align-items: center;\n min-height: 2.2rem;\n padding: 0.42rem 0.58rem 0.24rem;\n overflow-x: auto;\n scrollbar-width: thin;\n white-space: nowrap;\n }\n .route-probe-node,\n .route-probe button.route-probe-node {\n flex: none;\n max-width: 9.5rem;\n overflow: hidden;\n min-height: 1.75rem !important;\n padding: 0.22rem 0.38rem;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 46%, var(--toolbar-border));\n border-radius: 999px;\n background: color-mix(in srgb, var(--backend-fill) 52%, transparent);\n color: var(--text);\n font-size: 0.56rem;\n font-weight: 700;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .route-probe-node[data-endpoint=\"start\"] {\n border-color: var(--frontend-stroke);\n color: var(--frontend-stroke);\n }\n .route-probe-node[data-endpoint=\"end\"] {\n border-color: var(--security-stroke);\n color: var(--security-stroke);\n }\n .route-probe-node[data-route-journey-state=\"past\"] { opacity: 0.66; }\n .route-probe-node[data-route-journey-state=\"future\"] { opacity: 0.48; }\n .route-probe-node[aria-current=\"step\"] {\n border-color: var(--backend-stroke);\n background: color-mix(in srgb, var(--backend-fill) 82%, var(--toolbar-menu-bg));\n color: var(--text);\n box-shadow: 0 0 0 1px color-mix(in srgb, var(--backend-stroke) 42%, transparent), 0 0 14px color-mix(in srgb, var(--backend-stroke) 34%, transparent);\n opacity: 1;\n }\n html[data-preset=\"blueprint\"] .route-probe-node[aria-current=\"step\"] {\n border-style: double;\n border-width: 3px;\n border-radius: 0.2rem;\n box-shadow: none;\n }\n .route-probe-arrow {\n flex: none;\n padding: 0 0.28rem;\n color: var(--text-faint);\n font-size: 0.65rem;\n }\n .route-probe-placeholder {\n color: var(--text-faint);\n font-size: 0.75rem;\n }\n .route-probe-status {\n display: block;\n min-height: 1.45rem;\n padding: 0.5rem 0.75rem 0.625rem;\n color: var(--text-muted, var(--text-faint));\n font-size: 0.75rem;\n line-height: 1.45;\n }\n .route-journey-controls {\n display: grid;\n grid-template-columns: 2rem minmax(5.8rem, auto) 2rem minmax(4.8rem, auto);\n justify-content: start;\n gap: 0.22rem;\n padding: 0.08rem 0.58rem 0.28rem;\n }\n .route-journey-controls[hidden] { display: none; }\n .route-journey-controls button {\n min-height: 1.8rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);\n background: color-mix(in srgb, var(--toolbar-bg) 72%, transparent);\n font-size: 0.54rem;\n font-weight: 700;\n }\n .route-journey-controls button:disabled {\n cursor: default;\n opacity: 0.34;\n }\n .route-journey-play { color: var(--backend-stroke) !important; }\n .route-journey-overview { color: var(--frontend-stroke) !important; }\n .route-journey-controls[data-playing=\"true\"] .route-journey-play {\n border-color: color-mix(in srgb, var(--backend-stroke) 64%, var(--toolbar-border));\n background: color-mix(in srgb, var(--backend-fill) 62%, transparent);\n }\n .route-probe[data-state=\"error\"] {\n border-color: color-mix(in srgb, var(--security-stroke) 72%, var(--toolbar-border));\n }\n .route-probe[data-state=\"error\"] .route-probe-status { color: var(--security-stroke); }\n\n .focus-chip {\n position: absolute;\n left: 1rem;\n top: 1rem;\n z-index: 12;\n display: block;\n width: min(22rem, calc(100% - 13rem));\n max-width: calc(100% - 13rem);\n overflow: hidden;\n border: 1px solid var(--frontend-stroke);\n border-radius: 0.85rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.6875rem;\n }\n .focus-chip[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .focus-chip { border-radius: 0.3rem; }\n .focus-chip button {\n flex: none;\n padding: 0.3rem 0.45rem;\n border-radius: 0.35rem;\n font-size: 0.625rem;\n }\n .relationship-lens-head {\n position: relative;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.75rem;\n padding: 0.9rem 0.75rem 0.65rem;\n border-bottom: 1px solid var(--toolbar-border);\n background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);\n }\n .relationship-lens-drag-handle {\n position: absolute;\n top: 0.12rem;\n left: 50%;\n width: 2.5rem;\n height: 0.78rem;\n padding: 0 !important;\n transform: translateX(-50%);\n color: var(--text-faint) !important;\n cursor: grab;\n touch-action: none;\n user-select: none;\n }\n .relationship-lens-drag-handle::before {\n content: \"\";\n display: block;\n width: 1.25rem;\n margin: auto;\n border-top: 2px dotted currentColor;\n opacity: 0.72;\n }\n .focus-chip[data-panel-dragging=\"true\"] .relationship-lens-drag-handle { cursor: grabbing; }\n @media (hover: none), (pointer: coarse) {\n .relationship-lens-drag-handle { display: none; }\n }\n .relationship-lens-copy { min-width: 0; }\n .relationship-lens-actions {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.18rem;\n }\n .relationship-lens-actions button { white-space: nowrap; }\n .relationship-lens-actions #btn-focus-clear {\n display: grid;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n place-items: center;\n color: var(--text-muted);\n font-size: 1rem;\n line-height: 1;\n }\n .relationship-lens-actions #btn-focus-clear:hover,\n .relationship-lens-actions #btn-focus-clear:focus-visible {\n background: var(--toolbar-hover);\n color: var(--text);\n }\n .relationship-lens-actions #btn-focus-copy { color: var(--frontend-stroke); }\n .relationship-lens-actions #btn-focus-relations { display: none; }\n .relationship-lens-eyebrow {\n display: block;\n margin-bottom: 0.18rem;\n color: var(--frontend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.14em;\n text-transform: uppercase;\n }\n .relationship-lens-title {\n display: block;\n overflow: hidden;\n color: var(--text);\n font-size: 0.8rem;\n line-height: 1.35;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-detail {\n display: block;\n margin-top: 0.12rem;\n overflow: hidden;\n color: var(--text-muted);\n font-size: 0.625rem;\n line-height: 1.4;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-detail[hidden] { display: none; }\n .semantic-passport-meta {\n display: flex;\n flex-wrap: wrap;\n gap: 0.24rem;\n margin-top: 0.42rem;\n }\n .semantic-passport-meta span,\n .semantic-passport-meta code {\n max-width: 100%;\n overflow: hidden;\n padding: 0.14rem 0.34rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 82%, transparent);\n border-radius: 999px;\n background: color-mix(in srgb, var(--panel) 68%, transparent);\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5rem;\n letter-spacing: 0.04em;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-meta [data-passport=\"kind\"] {\n border-color: color-mix(in srgb, var(--frontend-stroke) 50%, var(--toolbar-border));\n color: var(--frontend-stroke);\n font-weight: 800;\n text-transform: uppercase;\n }\n .semantic-passport-meta [data-passport=\"tag\"] { color: var(--cloud-stroke); }\n .semantic-passport-meta [data-passport=\"brand\"] {\n border-color: color-mix(in srgb, var(--messagebus-stroke) 52%, var(--toolbar-border));\n color: var(--messagebus-stroke);\n font-weight: 700;\n }\n .semantic-passport-meta [hidden] { display: none; }\n html[data-preset=\"blueprint\"] .semantic-passport-meta span,\n html[data-preset=\"blueprint\"] .semantic-passport-meta code { border-radius: 0.1rem; }\n .semantic-passport-evidence {\n margin-top: 0.52rem;\n padding: 0.5rem;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 32%, var(--toolbar-border));\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--backend-fill) 18%, var(--panel));\n }\n .semantic-passport-evidence[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .semantic-passport-evidence { border-radius: 0.18rem; }\n .semantic-passport-evidence-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.55rem;\n margin-bottom: 0.35rem;\n }\n .semantic-passport-evidence-status {\n display: inline-flex;\n align-items: center;\n gap: 0.28rem;\n color: var(--backend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n }\n .semantic-passport-evidence-status::before {\n content: '';\n width: 0.38rem;\n height: 0.38rem;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--backend-stroke) 14%, transparent);\n }\n .semantic-passport-repository {\n min-width: 0;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n text-decoration: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-repository:hover,\n .semantic-passport-repository:focus-visible { color: var(--backend-stroke); }\n .semantic-passport-evidence-links { display: grid; gap: 0.22rem; }\n .semantic-passport-source {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.15rem 0.45rem;\n align-items: center;\n padding: 0.34rem 0.4rem;\n border: 1px solid transparent;\n border-radius: 0.38rem;\n color: var(--text-muted);\n text-decoration: none;\n }\n a.semantic-passport-source:hover,\n a.semantic-passport-source:focus-visible {\n border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);\n background: color-mix(in srgb, var(--backend-fill) 32%, transparent);\n color: var(--text);\n }\n .semantic-passport-source strong {\n overflow: hidden;\n font-size: 0.5625rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-source code {\n color: var(--backend-stroke);\n font: inherit;\n font-size: 0.5rem;\n }\n .semantic-passport-source small {\n grid-column: 1 / -1;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-summary {\n display: block;\n margin-top: 0.12rem;\n color: var(--text-faint);\n font-size: 0.5625rem;\n }\n .semantic-passport-reach {\n display: grid;\n gap: 0.28rem;\n margin-top: 0.52rem;\n padding-top: 0.48rem;\n border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);\n }\n .semantic-passport-reach[hidden] { display: none; }\n .semantic-passport-reach-label {\n color: var(--text-faint);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n }\n .semantic-passport-reach-actions {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 0.25rem;\n }\n .semantic-passport-reach-actions button {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n min-width: 0;\n min-height: 2rem;\n padding: 0.32rem 0.42rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);\n background: color-mix(in srgb, var(--panel) 70%, transparent);\n color: var(--text-muted);\n text-align: left;\n }\n .semantic-passport-reach-actions button:hover:not(:disabled),\n .semantic-passport-reach-actions button:focus-visible {\n border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));\n color: var(--text);\n }\n .semantic-passport-reach-actions button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .semantic-passport-reach-actions button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n .semantic-passport-reach-actions button[aria-pressed=\"true\"] {\n border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));\n background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);\n color: var(--text);\n }\n #btn-reach-upstream {\n --reach-color: var(--database-stroke);\n --reach-fill: var(--database-fill);\n }\n #btn-reach-downstream {\n --reach-color: var(--backend-stroke);\n --reach-fill: var(--backend-fill);\n }\n .semantic-passport-reach-actions strong {\n color: var(--reach-color, var(--frontend-stroke));\n font-size: 0.625rem;\n }\n .semantic-passport-reach-status {\n color: var(--text-faint);\n font-size: 0.525rem;\n line-height: 1.4;\n }\n .semantic-passport-reach-status[hidden] { display: none; }\n .relationship-lens-list {\n max-height: min(18rem, 46vh);\n overflow: auto;\n padding: 0.4rem;\n scrollbar-width: thin;\n scrollbar-color: var(--frontend-stroke) transparent;\n }\n .relationship-lens-list::-webkit-scrollbar { width: 4px; }\n .relationship-lens-list::-webkit-scrollbar-thumb {\n border-radius: 999px;\n background: color-mix(in srgb, var(--frontend-stroke) 68%, transparent);\n }\n .relationship-lens-group + .relationship-lens-group { margin-top: 0.35rem; }\n .relationship-lens-group-title {\n display: block;\n padding: 0.24rem 0.38rem 0.16rem;\n color: var(--text-faint);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n }\n .relationship-lens-row {\n display: grid;\n grid-template-columns: 2.1rem minmax(0, 1fr);\n gap: 0.06rem 0.45rem;\n width: 100%;\n padding: 0.45rem 0.5rem !important;\n text-align: left;\n }\n .relationship-lens-row:hover,\n .relationship-lens-row:focus-visible,\n .relationship-lens-row[data-preview-active=\"true\"] {\n background: var(--toolbar-hover);\n box-shadow: inset 2px 0 0 var(--frontend-stroke);\n }\n .relationship-lens-row:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -2px;\n }\n .relationship-lens-direction {\n grid-row: 1 / 3;\n align-self: center;\n color: var(--frontend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.08em;\n }\n .relationship-lens-row[data-direction=\"in\"] .relationship-lens-direction { color: var(--database-stroke); }\n .relationship-lens-row[data-direction=\"loop\"] .relationship-lens-direction { color: var(--security-stroke); }\n .relationship-lens-row strong {\n overflow: hidden;\n color: var(--text);\n font-size: 0.6875rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-row small {\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5625rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-empty {\n margin: 0;\n padding: 0.75rem;\n color: var(--text-faint);\n font-size: 0.625rem;\n text-align: center;\n }\n\n /* Diagram Guide keeps the artifact's growing reader vocabulary\n discoverable without widening the permanent control bar. It derives\n honest counts at runtime and delegates every action to an existing\n production interaction instead of creating a second command system. */\n .diagram-guide {\n position: absolute;\n top: 1rem;\n right: 1rem;\n z-index: 26;\n width: min(32rem, calc(100% - 2rem));\n max-height: min(42rem, calc(100% - 2rem));\n overflow: auto;\n border: 1px solid color-mix(in srgb, var(--cloud-stroke) 58%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(135deg, color-mix(in srgb, var(--cloud-fill) 32%, transparent), transparent 42%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);\n backdrop-filter: blur(18px);\n animation: archify-guide-in 180ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n .diagram-guide[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .diagram-guide { border-radius: 0.28rem; }\n .diagram-guide-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 1rem;\n padding: 0.82rem 0.9rem 0.68rem;\n border-bottom: 1px solid var(--toolbar-border);\n }\n .diagram-guide-eyebrow {\n display: block;\n color: var(--cloud-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.16em;\n text-transform: uppercase;\n }\n .diagram-guide-title {\n display: block;\n margin-top: 0.16rem;\n color: var(--text);\n font-size: 0.86rem;\n letter-spacing: -0.02em;\n }\n .diagram-guide-close {\n width: 1.8rem;\n height: 1.8rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .diagram-guide-close:hover,\n .diagram-guide-close:focus-visible { background: var(--toolbar-hover); }\n .diagram-guide-stats {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0;\n padding: 0.54rem 0.9rem;\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);\n color: var(--text-faint);\n font-size: 0.56rem;\n letter-spacing: 0.025em;\n }\n .diagram-guide-stats::before {\n content: '';\n width: 0.42rem;\n height: 0.42rem;\n flex: none;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 10px color-mix(in srgb, var(--backend-stroke) 72%, transparent);\n }\n .diagram-guide-actions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.38rem;\n padding: 0.62rem;\n }\n .diagram-guide-action {\n --guide-accent: var(--frontend-stroke);\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.55rem;\n min-height: 4.15rem;\n padding: 0.55rem 0.58rem;\n border: 1px solid color-mix(in srgb, var(--guide-accent) 22%, var(--toolbar-border));\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n color: var(--toolbar-text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;\n }\n .diagram-guide-action[data-guide-action=\"route\"] { --guide-accent: var(--backend-stroke); }\n .diagram-guide-action[data-guide-action=\"map\"] { --guide-accent: var(--database-stroke); }\n .diagram-guide-action[data-guide-action=\"lens\"] { --guide-accent: var(--messagebus-stroke); }\n\n .diagram-guide-action[data-guide-action=\"present\"] {\n --guide-accent: var(--cloud-stroke);\n }\n .diagram-guide-action:hover,\n .diagram-guide-action:focus-visible {\n border-color: color-mix(in srgb, var(--guide-accent) 76%, var(--toolbar-border));\n background: color-mix(in srgb, var(--guide-accent) 9%, var(--panel));\n transform: translateY(-1px);\n }\n .diagram-guide-action:focus-visible,\n .diagram-guide-close:focus-visible {\n outline: 2px solid var(--cloud-stroke);\n outline-offset: 1px;\n }\n .diagram-guide-action:disabled {\n opacity: 0.42;\n cursor: default;\n transform: none;\n }\n .diagram-guide-index {\n display: grid;\n place-items: center;\n width: 1.65rem;\n height: 1.65rem;\n border: 1px solid color-mix(in srgb, var(--guide-accent) 64%, var(--toolbar-border));\n border-radius: 0.35rem;\n color: var(--guide-accent);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.06em;\n }\n .diagram-guide-action-copy { min-width: 0; }\n .diagram-guide-action strong {\n display: block;\n overflow: hidden;\n color: var(--text);\n font-size: 0.66rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .diagram-guide-action small {\n display: -webkit-box;\n margin-top: 0.18rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n line-height: 1.35;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n .diagram-guide kbd {\n align-self: start;\n min-width: 1.45rem;\n padding: 0.12rem 0.3rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.25rem;\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5rem;\n text-align: center;\n }\n .diagram-guide-shortcuts {\n display: flex;\n flex-wrap: wrap;\n gap: 0.34rem 0.62rem;\n padding: 0.58rem 0.9rem 0.68rem;\n border-top: 1px solid var(--toolbar-border);\n color: var(--text-faint);\n font-size: 0.5rem;\n }\n .diagram-guide-shortcuts span {\n display: inline-flex;\n align-items: center;\n gap: 0.28rem;\n white-space: nowrap;\n }\n .diagram-guide-feedback {\n min-height: 1rem;\n margin: -0.18rem 0.9rem 0.62rem;\n color: var(--security-stroke);\n font-size: 0.5rem;\n }\n .diagram-guide-feedback:empty { display: none; }\n @keyframes archify-guide-in {\n from { opacity: 0; transform: translateY(-5px) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n\n .node-finder {\n position: absolute;\n top: 1rem;\n left: 1rem;\n z-index: 24;\n display: flex;\n flex-direction: column;\n width: min(22rem, calc(100% - 2rem));\n max-height: calc(100% - 2rem);\n overflow: hidden;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.85rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);\n backdrop-filter: blur(16px);\n }\n .node-finder[hidden] { display: none; }\n .node-finder[data-context=\"route-source\"] {\n border-color: color-mix(in srgb, var(--frontend-stroke) 68%, var(--toolbar-border));\n }\n .node-finder[data-context=\"route-target\"] {\n border-color: color-mix(in srgb, var(--security-stroke) 68%, var(--toolbar-border));\n }\n html[data-preset=\"blueprint\"] .node-finder { border-radius: 0.3rem; }\n .node-finder-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.7rem 0.8rem 0.45rem;\n }\n .node-finder-head strong {\n color: var(--text);\n font-size: 0.6875rem;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n }\n .node-finder[data-context=\"route-source\"] .node-finder-head strong { color: var(--frontend-stroke); }\n .node-finder[data-context=\"route-target\"] .node-finder-head strong { color: var(--security-stroke); }\n .node-finder-close {\n width: 1.75rem;\n height: 1.75rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .node-finder-close:hover,\n .node-finder-close:focus-visible { background: var(--toolbar-hover); }\n .node-finder-close:focus-visible,\n .node-finder-result:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -2px;\n }\n .node-finder-search {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.55rem;\n margin: 0 0.55rem 0.55rem;\n padding: 0 0.7rem;\n min-height: 2.6rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n transition: border-color 160ms ease-out, box-shadow 160ms ease-out;\n }\n html[data-preset=\"blueprint\"] .node-finder-search { border-radius: 0.18rem; }\n .node-finder-search \u003e span { color: var(--frontend-stroke); font-size: 0.875rem; }\n .node-finder-search:focus-within {\n border-color: var(--frontend-stroke);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--frontend-stroke) 20%, transparent);\n }\n .node-finder-input {\n appearance: none;\n width: 100%;\n min-width: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--text);\n font: inherit;\n font-size: 0.75rem;\n }\n .node-finder-input:focus-visible { outline: none; }\n .node-finder-input::placeholder { color: var(--text-faint); }\n .node-finder kbd {\n padding: 0.1rem 0.32rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.25rem;\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5625rem;\n }\n .node-finder-results {\n display: grid;\n flex: 1 1 auto;\n gap: 0;\n min-height: 0;\n max-height: min(18rem, 48vh);\n margin: 0 0.55rem 0.45rem;\n padding: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 78%, transparent);\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 54%, transparent);\n scroll-padding-block: 0.25rem;\n scrollbar-width: thin;\n }\n html[data-preset=\"blueprint\"] .node-finder-results { border-radius: 0.18rem; }\n .node-finder-result {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.2rem 0.75rem;\n width: 100%;\n min-height: 3.25rem;\n padding: 0.58rem 0.65rem;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background-color 160ms ease-out;\n }\n .node-finder-result:not(:last-child) {\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 62%, transparent);\n }\n .node-finder-result:hover,\n .node-finder-result:focus-visible {\n position: relative;\n z-index: 1;\n background: color-mix(in srgb, var(--frontend-fill) 48%, var(--toolbar-hover));\n }\n .node-finder-result strong {\n overflow: hidden;\n font-size: 0.75rem;\n line-height: 1.25;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-finder-result small {\n grid-column: 1 / -1;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5625rem;\n letter-spacing: 0.015em;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-finder-result em {\n align-self: center;\n color: var(--frontend-stroke);\n font-size: 0.625rem;\n font-style: normal;\n }\n .node-finder[data-context^=\"route-\"] .node-finder-result em {\n padding: 0.1rem 0.3rem;\n border: 1px solid color-mix(in srgb, currentColor 52%, transparent);\n border-radius: 999px;\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n }\n .node-finder[data-context=\"route-target\"] .node-finder-result em { color: var(--security-stroke); }\n .node-finder-empty {\n padding: 1.1rem 0.75rem 1.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n text-align: center;\n }\n .node-finder-status {\n margin: 0;\n padding: 0.1rem 0.8rem 0.65rem;\n color: var(--text-faint);\n font-size: 0.5625rem;\n }\n\n .cards {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));\n gap: 1rem;\n margin-top: 2rem;\n }\n\n .card {\n background: var(--panel);\n border-radius: 0.75rem;\n border: 1px solid var(--panel-border);\n padding: 1.125rem 1.25rem;\n }\n\n html[data-preset=\"signal-flow\"] .card {\n background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] .card {\n background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);\n }\n\n /* Preserve the one-screen guarantee on ordinary laptop displays. The\n high-screen expansion above must not trade a fuller canvas for page\n scrolling at 900–1080px heights. */\n @media (min-width: 768px) and (max-height: 1100px) {\n .header { margin-bottom: 1rem; }\n .diagram-container {\n padding: 0.875rem;\n padding-bottom: calc(0.875rem + var(--archify-nav-reserve));\n }\n .cards { margin-top: 1rem; }\n .card { padding: 1rem; }\n }\n @media (min-width: 768px) and (max-height: 920px) {\n body { padding-block: 1.25rem; }\n body { --archify-page-top: 1.25rem; }\n .header { margin-bottom: 0.875rem; }\n .cards { margin-top: 0.75rem; }\n html[data-nav-stage-rail=\"true\"] body { padding-block: 0.375rem; }\n /* Align the fixed toolbar with the compact title row. Reserve its hit area\n above the guide without taking extra height from a fitted diagram. */\n html[data-nav-stage-rail=\"true\"] .toolbar { top: 0.25rem; }\n html[data-nav-stage-rail=\"true\"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }\n html[data-nav-stage-rail=\"true\"] .diagram-container[data-nav-stage-rail=\"true\"] { padding-top: 0.5rem; }\n html[data-nav-stage-rail=\"true\"] .cards { margin-top: 0.375rem; }\n }\n\n html[data-preset=\"blueprint\"] .card {\n position: relative;\n border-color: var(--panel-border);\n border-radius: 0.3rem;\n background: var(--panel);\n box-shadow: none;\n }\n html[data-preset=\"blueprint\"] .card::before {\n content: \"\";\n position: absolute;\n top: -1px;\n left: 1rem;\n width: 2.5rem;\n border-top: 2px solid var(--frontend-stroke);\n }\n\n html[data-preset=\"editorial\"] .card {\n position: relative;\n border-radius: 0.28rem;\n background: var(--panel);\n box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);\n }\n html[data-preset=\"editorial\"] .card::before {\n position: absolute;\n top: -1px;\n left: 1.25rem;\n width: 3.25rem;\n border-top: 3px solid var(--arrow-emphasis);\n content: \"\";\n }\n html[data-preset=\"editorial\"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }\n\n /* Summary rail: the reader measures the viewport and enables it only when the\n diagram keeps its readable width beside the notes. */\n .reader-rail { display: contents; }\n html[data-reader-rail=\"true\"] .container {\n display: grid;\n grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);\n grid-auto-flow: row dense;\n column-gap: var(--archify-rail-gap);\n align-items: start;\n }\n html[data-reader-rail=\"true\"] .container \u003e .header { grid-column: 1 / -1; }\n html[data-reader-rail=\"true\"] .container \u003e .diagram-container { grid-column: 1; }\n /* The rail takes exactly the diagram's height: notes scroll when long and\n the index keeps a usable share instead of collapsing to its header. */\n html[data-reader-rail=\"true\"] .reader-rail {\n display: flex;\n flex-direction: column;\n grid-column: 2;\n align-self: stretch;\n contain: size;\n min-height: 0;\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards:empty { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards {\n display: flex;\n flex: 0 1 auto;\n flex-direction: column;\n gap: 0;\n min-height: 0;\n margin-top: 0;\n padding: 0.125rem 0 0;\n overflow-y: auto;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);\n mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards::-webkit-scrollbar { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card { flex: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card {\n padding: 0 0.25rem 1.125rem;\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card + .card {\n padding-top: 1.125rem;\n border-top: 1px solid var(--panel-border);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card::before { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }\n\n .node-outline { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .node-outline:not([hidden]) {\n display: flex;\n flex: 1 0 min(13rem, 55%);\n flex-direction: column;\n min-height: 0;\n margin-top: 0.25rem;\n overflow: hidden;\n border-top: 1px solid var(--panel-border);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }\n /* Collapsed: only the reveal control remains, so the diagram takes the width. */\n html[data-reader-rail=\"collapsed\"] .reader-rail { display: none; }\n /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */\n html[data-reader-rail=\"overlay\"] .reader-rail {\n position: fixed;\n z-index: 150;\n top: 1rem;\n right: 1rem;\n bottom: 1rem;\n display: flex;\n flex-direction: column;\n width: var(--archify-rail-width);\n padding: 0.75rem 1rem 0.5rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n border-radius: 1rem;\n background: var(--toolbar-menu-bg);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);\n animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);\n }\n @keyframes rail-drawer-in {\n from { opacity: 0; transform: translateX(0.75rem); }\n to { opacity: 1; transform: translateX(0); }\n }\n /* Bottom: notes keep their card grid and the index sits beside them. */\n html[data-reader-rail=\"bottom\"] .reader-rail {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 18rem;\n gap: 0.5rem 1rem;\n align-items: start;\n margin-top: 1rem;\n }\n html[data-reader-rail=\"bottom\"] .rail-controls { grid-column: 1 / -1; }\n html[data-reader-rail=\"bottom\"] .cards { margin-top: 0; }\n html[data-reader-rail=\"bottom\"] .cards:empty { display: none; }\n html[data-reader-rail=\"bottom\"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }\n html[data-reader-rail=\"bottom\"] .node-outline:not([hidden]) {\n display: flex;\n flex-direction: column;\n max-height: 22rem;\n padding: 0 0.875rem 0.25rem;\n border: 1px solid var(--panel-border);\n border-radius: 0.75rem;\n background: var(--panel);\n }\n html[data-reader-rail=\"bottom\"] .node-outline-head { padding-top: 0.875rem; }\n .rail-controls { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"], [data-reader-rail=\"bottom\"]) .rail-controls {\n display: flex;\n flex: none;\n justify-content: flex-end;\n gap: 0.125rem;\n margin: -0.25rem -0.25rem 0.25rem 0;\n }\n .rail-control {\n display: inline-grid;\n place-items: center;\n width: 1.875rem;\n height: 1.875rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: var(--text-faint);\n cursor: pointer;\n transition: background 0.14s ease, color 0.14s ease;\n }\n .rail-control[hidden] { display: none; }\n .rail-control:hover,\n .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }\n .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }\n .rail-control-icon,\n .rail-reveal-icon {\n width: 1rem;\n height: 1rem;\n background: currentColor;\n -webkit-mask: var(--rail-glyph) center / contain no-repeat;\n mask: var(--rail-glyph) center / contain no-repeat;\n }\n /* Panel glyphs: a frame with the panel drawn on the side it moves to. */\n .rail-control-icon.placement,\n #rail-placement[data-placement=\"right\"] .rail-control-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E\"); }\n #rail-placement[data-placement=\"bottom\"] .rail-control-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E\"); }\n .rail-control-icon.collapse { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\"); }\n .rail-reveal-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E\"); }\n .rail-reveal[hidden] { display: none; }\n /* The collapsed rail leaves one quiet pill in the canvas corner. */\n .rail-reveal {\n position: absolute;\n z-index: 13;\n top: 0.75rem;\n right: 0.75rem;\n display: inline-flex;\n align-items: center;\n gap: 0.45rem;\n min-height: 2rem;\n padding: 0 0.75rem 0 0.625rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);\n border-radius: 999px;\n background: color-mix(in srgb, var(--panel) 86%, transparent);\n color: var(--text-muted);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);\n backdrop-filter: blur(12px);\n font: inherit;\n font-size: 0.75rem;\n font-weight: 500;\n cursor: pointer;\n transition: color 0.14s ease, background 0.14s ease;\n }\n .rail-reveal:hover,\n .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }\n .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }\n html[data-motion=\"still\"] .reader-rail { animation: none !important; }\n .node-outline-head {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 1.125rem 0.25rem 0.375rem;\n }\n .node-outline-head strong {\n color: var(--text);\n font-size: 0.875rem;\n font-weight: 600;\n letter-spacing: -0.005em;\n }\n .node-outline-count {\n min-width: 1.35rem;\n padding: 0.1rem 0.4rem;\n border-radius: 999px;\n background: color-mix(in srgb, var(--text) 6%, transparent);\n color: var(--text-muted);\n font-size: 0.6875rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n .node-outline-list {\n flex: 1 1 auto;\n min-height: 0;\n margin: 0 -0.375rem;\n padding: 0 0 1.25rem;\n overflow-y: auto;\n list-style: none;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);\n mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);\n }\n .node-outline-list::-webkit-scrollbar { display: none; }\n .node-outline-group + .node-outline-group { margin-top: 0.25rem; }\n .node-outline-group \u003e ul {\n position: relative;\n list-style: none;\n }\n /* A quiet spine ties each group's swatches together like a lane. */\n .node-outline-group \u003e ul::before {\n position: absolute;\n top: 0.95rem;\n bottom: 0.95rem;\n left: calc(0.625rem + 0.3125rem - 0.5px);\n width: 1px;\n background: var(--panel-border);\n content: \"\";\n }\n .node-outline-heading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n padding: 0.7rem 0.625rem 0.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n }\n .node-outline-heading small {\n color: var(--text-dim);\n font-size: 0.6875rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n }\n /* The rail frees the vertical budget, so compact viewports keep the normal\n title spacing instead of the stacked layout's tight stage rail. */\n html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }\n html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }\n html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }\n .node-outline-item {\n position: relative;\n display: grid;\n grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;\n align-items: center;\n column-gap: 0.625rem;\n width: 100%;\n min-height: 1.95rem;\n padding: 0.28rem 0.5rem 0.28rem 0.625rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: var(--text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background 0.16s ease;\n }\n /* Trailing chevron hints that a click focuses the node. */\n .node-outline-item::after {\n grid-column: 4;\n width: 0.75rem;\n height: 0.75rem;\n background: currentColor;\n color: var(--text-muted);\n content: \"\";\n opacity: 0;\n transform: translateX(-3px);\n transition: opacity 0.16s ease, transform 0.16s ease;\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / contain no-repeat;\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / contain no-repeat;\n }\n .node-outline-item:hover,\n .node-outline-item:focus-visible,\n .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }\n .node-outline-item:hover::after,\n .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }\n .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }\n .node-outline-item[aria-current=\"true\"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }\n .node-outline-item[aria-current=\"true\"]::after { opacity: 0; }\n /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */\n .node-outline-dot {\n width: 0.625rem;\n height: 0.5rem;\n border: 1.25px solid var(--outline-tone);\n border-radius: 0.15rem;\n background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));\n transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;\n }\n .node-outline-item:hover .node-outline-dot,\n .node-outline-item:focus-visible .node-outline-dot,\n .node-outline-item[data-previewing] .node-outline-dot,\n .node-outline-item[aria-current=\"true\"] .node-outline-dot {\n background: var(--outline-tone);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);\n transform: scale(1.08);\n }\n .node-outline-item strong {\n overflow: hidden;\n font-size: 0.8125rem;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-outline-item[aria-current=\"true\"] strong { font-weight: 600; }\n .node-outline-item small {\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.6875rem;\n text-align: right;\n text-overflow: ellipsis;\n white-space: nowrap;\n transition: color 0.16s ease;\n }\n .node-outline-item:hover small,\n .node-outline-item[data-previewing] small,\n .node-outline-item[aria-current=\"true\"] small { color: var(--text-muted); }\n\n .card-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 0.625rem;\n }\n\n .card-dot {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n }\n\n .card-dot.cyan { background: var(--frontend-stroke); }\n .card-dot.emerald { background: var(--backend-stroke); }\n .card-dot.violet { background: var(--database-stroke); }\n .card-dot.amber { background: var(--cloud-stroke); }\n .card-dot.rose { background: var(--security-stroke); }\n .card-dot.orange { background: var(--messagebus-stroke); }\n .card-dot.slate { background: var(--external-stroke); }\n\n .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }\n\n .card ul {\n list-style: none;\n color: var(--text-muted);\n font-size: 0.8125rem;\n line-height: 1.6;\n }\n\n .card li {\n position: relative;\n margin-bottom: 0.3rem;\n padding-left: 0.9rem;\n }\n .card li:last-child { margin-bottom: 0; }\n /* Hanging markers take the card's tone so wrapped lines align under text. */\n .card li::before {\n position: absolute;\n top: calc(0.8em - 2px);\n left: 0.2rem;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);\n content: \"\";\n }\n .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }\n .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }\n .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }\n .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }\n .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }\n .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }\n .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }\n .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }\n\n /* ==========================================================\n Print stylesheet — hide interactive controls, force light,\n drop the grid so the diagram doesn't waste ink, use landscape\n so wide diagrams fit, pack summary cards into 2 columns to\n avoid an orphan card on a trailing page.\n ========================================================== */\n @page { size: landscape; margin: 1.5cm; }\n\n @media print {\n /* Force the FULL light palette — including component fills/strokes and\n lane/arrow colors — so printing from dark theme doesn't put neon\n strokes and translucent dark fills on white paper. */\n :root, [data-theme=\"dark\"], [data-theme=\"light\"] {\n --bg: #ffffff;\n --grid: transparent;\n --panel: #ffffff;\n --panel-border: #e2e8f0;\n --text: #0f172a;\n --text-muted: #475569;\n --text-dim: #94a3b8;\n --text-faint: #64748b;\n --mask: #ffffff;\n --lane-fill: rgba(248, 250, 252, 0.65);\n --lane-stroke: #cbd5e1;\n --arrow: #94a3b8;\n --arrow-emphasis: #059669;\n --frontend-fill: rgba(34, 211, 238, 0.15);\n --frontend-stroke: #0891b2;\n --backend-fill: rgba(52, 211, 153, 0.18);\n --backend-stroke: #059669;\n --database-fill: rgba(167, 139, 250, 0.2);\n --database-stroke: #7c3aed;\n --cloud-fill: rgba(251, 191, 36, 0.18);\n --cloud-stroke: #d97706;\n --security-fill: rgba(251, 113, 133, 0.15);\n --security-stroke: #e11d48;\n --messagebus-fill: rgba(251, 146, 60, 0.15);\n --messagebus-stroke:#ea580c;\n --external-fill: rgba(148, 163, 184, 0.18);\n --external-stroke: #64748b;\n }\n body { background: #ffffff !important; padding: 0; }\n .container { max-width: none; }\n .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }\n \n .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }\n .diagram-container { --archify-nav-reserve: 0px !important; }\n html[data-preset=\"signal-flow\"] .diagram-container,\n html[data-preset=\"signal-flow\"] .card { background: #ffffff; }\n .cards { grid-template-columns: 1fr 1fr; }\n /* Ensure elements break sensibly across pages */\n .card { break-inside: avoid; page-break-inside: avoid; }\n .diagram-container { break-inside: avoid; page-break-inside: avoid; }\n .diagram-container svg [data-detail] {\n opacity: 1 !important;\n pointer-events: auto !important;\n }\n .diagram-container svg [data-detail-anchor] { transform: none !important; }\n .diagram-container svg[data-lens-active] [data-node-id],\n .diagram-container svg[data-lens-active] [data-edge-from],\n .diagram-container svg[data-legend-preview-active] [data-node-id],\n .diagram-container svg[data-legend-preview-active] [data-edge-from] {\n opacity: 1 !important;\n filter: none !important;\n }\n [data-legend-bridge-runtime] { display: none !important; }\n .semantic-lens-overlay { display: none !important; }\n .relationship-hit-overlay { display: none !important; }\n .relationship-pulse-overlay { display: none !important; }\n .route-probe-overlay, .route-journey-overlay { display: none !important; }\n .diagram-container svg[data-focus-active] [data-node-id],\n .diagram-container svg[data-focus-active] [data-edge-from],\n .diagram-container svg[data-focus-active] [data-graph-role=\"automatic-crossover-underlay\"],\n .diagram-container svg[data-reach-active] [data-node-id],\n .diagram-container svg[data-reach-active] [data-edge-from],\n .diagram-container svg[data-reach-active] [data-graph-role=\"automatic-crossover-underlay\"],\n .diagram-container svg[data-route-active] [data-node-id],\n .diagram-container svg[data-route-active] [data-edge-from],\n .diagram-container svg[data-route-active] [data-graph-role=\"automatic-crossover-underlay\"] {\n opacity: 1 !important;\n filter: none !important;\n animation: none !important;\n }\n h1, .subtitle { color: #0f172a; }\n }\n\n /* ==========================================================\n TOOLBAR (theme toggle + export menu)\n ========================================================== */\n /* The toolbar tracks the centered reader column and the title row, so\n an adaptive narrow reader does not leave its controls stranded at the\n viewport edge. */\n .toolbar {\n position: absolute;\n top: var(--archify-page-top);\n right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));\n display: flex;\n align-items: center;\n gap: 0.125rem;\n padding: 0;\n border: 0;\n background: transparent;\n box-shadow: none;\n z-index: 100;\n }\n /* Ghost controls keep a 44px hit area while the visible pill stays compact;\n Export is the one primary action. */\n .toolbar button {\n position: relative;\n isolation: isolate;\n background: transparent;\n color: var(--text-muted);\n border: 0;\n padding: 0.5rem 0.75rem;\n border-radius: 0.5625rem;\n font-family: inherit;\n font-size: 0.8125rem;\n font-weight: 500;\n cursor: pointer;\n white-space: nowrap;\n box-shadow: none;\n transition: color 0.15s;\n display: inline-flex;\n align-items: center;\n gap: 0.4rem;\n min-height: 2.75rem;\n }\n .toolbar button::before {\n position: absolute;\n z-index: -1;\n inset: 0.375rem 0;\n border-radius: 0.5rem;\n background: transparent;\n content: \"\";\n transition: background 0.15s, box-shadow 0.15s;\n }\n .toolbar button:hover { color: var(--text); }\n .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }\n .toolbar button[aria-expanded=\"true\"],\n .toolbar button[aria-pressed=\"true\"]:not(#btn-theme) { color: var(--text); }\n .toolbar button[aria-expanded=\"true\"]::before,\n .toolbar button[aria-pressed=\"true\"]:not(#btn-theme)::before {\n background: color-mix(in srgb, var(--text) 8%, transparent);\n }\n .toolbar #btn-export {\n margin-left: 0.375rem;\n padding-right: 0.95rem;\n padding-left: 1rem;\n color: var(--bg);\n font-weight: 550;\n }\n .toolbar #btn-export::before {\n background: var(--text);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);\n }\n .toolbar #btn-export:hover,\n .toolbar #btn-export[aria-expanded=\"true\"] { color: var(--bg); }\n .toolbar #btn-export:hover::before,\n .toolbar #btn-export[aria-expanded=\"true\"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }\n .toolbar button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -4px;\n }\n .toolbar { gap: 0.5rem; }\n .toolbar #btn-export { margin-left: 0; }\n .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }\n /* Tools share one quiet capsule; the capsule is drawn inside the 44px row\n so the controls keep their hit area without a tall visible box. */\n .toolbar-group {\n position: relative;\n isolation: isolate;\n display: flex;\n align-items: center;\n gap: 0.0625rem;\n padding: 0 0.25rem;\n }\n .toolbar-group::before {\n position: absolute;\n z-index: -1;\n inset: 0.25rem 0;\n border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);\n border-radius: 0.6875rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);\n backdrop-filter: blur(12px);\n content: \"\";\n }\n .toolbar-group button { padding-inline: 0.625rem; }\n .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }\n /* Theme becomes a sliding switch; its label stays for assistive tech. */\n .toolbar #theme-label,\n .toolbar #present-label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n }\n .toolbar #btn-theme {\n width: 3.5rem;\n padding: 0;\n justify-content: center;\n }\n .toolbar #btn-theme::before {\n inset: 0.75rem 0.4375rem;\n border-radius: 999px;\n background: color-mix(in srgb, var(--text) 9%, transparent);\n box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);\n }\n .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }\n .toolbar #btn-theme::after {\n position: absolute;\n z-index: 0;\n top: 50%;\n left: 0.5625rem;\n width: 1.125rem;\n height: 1.125rem;\n border-radius: 50%;\n background: var(--panel);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);\n content: \"\";\n transform: translateY(-50%);\n transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);\n }\n .toolbar #theme-icon {\n position: absolute;\n z-index: 1;\n top: 50%;\n left: calc(0.5625rem + 0.1875rem);\n width: 0.75rem;\n height: 0.75rem;\n color: var(--cloud-stroke);\n transform: translateY(-50%);\n transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);\n }\n [data-theme=\"dark\"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }\n [data-theme=\"dark\"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }\n [data-theme=\"dark\"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }\n .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }\n .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }\n html[data-motion=\"still\"] .toolbar #btn-theme::after,\n html[data-motion=\"still\"] .toolbar #theme-icon { transition: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar { right: 1rem; }\n html[data-preset=\"editorial\"] .toolbar { border-radius: 0.45rem; }\n .toolbar #btn-motion[hidden] { display: none !important; }\n .toolbar #btn-motion { min-width: 4.4rem; }\n .toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }\n .toolbar .preset-wrap,\n .toolbar .export-wrap {\n position: relative;\n }\n .toolbar-icon {\n display: inline-block;\n width: 0.95rem;\n height: 0.95rem;\n flex: 0 0 auto;\n background: currentColor;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .toolbar-chevron {\n width: 0.65rem;\n height: 0.65rem;\n transition: transform 0.15s ease;\n }\n [aria-expanded=\"true\"] \u003e .toolbar-chevron { transform: rotate(180deg); }\n [data-theme=\"light\"] #theme-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E\");\n }\n [data-theme=\"dark\"] #theme-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E\");\n }\n #btn-present[aria-pressed=\"false\"] #present-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n #btn-present[aria-pressed=\"true\"] #present-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .toolbar-chevron {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n }\n .toolbar #btn-preset { min-width: 5.4rem; }\n .preset-control-mark {\n width: 0.58rem;\n height: 0.58rem;\n flex: 0 0 auto;\n border: 1px solid var(--frontend-stroke);\n border-radius: 0.2rem;\n background: color-mix(in srgb, var(--frontend-stroke) 28%, transparent);\n transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s;\n }\n #btn-preset[data-preset-option=\"signal-flow\"] .preset-control-mark {\n border-radius: 50%;\n box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 78%, transparent);\n }\n #btn-preset[data-preset-option=\"blueprint\"] .preset-control-mark {\n border-radius: 0.06rem;\n background: transparent;\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frontend-stroke) 32%, transparent);\n transform: rotate(45deg) scale(0.84);\n }\n #btn-preset[data-preset-option=\"editorial\"] .preset-control-mark {\n border-color: var(--arrow-emphasis);\n border-radius: 0;\n background: var(--arrow-emphasis);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);\n transform: rotate(45deg) scale(0.72);\n }\n /* Menus anchor to the tools capsule so they open flush under it. */\n .toolbar-group .preset-wrap { position: static; }\n .toolbar .preset-menu {\n position: absolute;\n top: calc(100% + 0.125rem);\n right: 0;\n display: none;\n width: 17.5rem;\n max-width: calc(100vw - 2rem);\n padding: 0.375rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n border-radius: 0.875rem;\n background: var(--toolbar-menu-bg);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);\n }\n [data-theme=\"dark\"] .toolbar .preset-menu,\n [data-theme=\"dark\"] .toolbar .export-menu {\n border-color: rgba(148, 163, 184, 0.16);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);\n }\n /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */\n .toolbar .preset-menu button,\n .toolbar .export-menu button { isolation: auto; min-height: 0; }\n .toolbar .preset-menu button::before { display: none; }\n .toolbar .preset-menu.open { display: block; }\n .toolbar .preset-menu.open,\n .toolbar .export-menu.open {\n animation: toolbar-menu-in 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);\n transform-origin: top right;\n }\n @keyframes toolbar-menu-in {\n from { opacity: 0; transform: translateY(-0.25rem) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n .preset-menu-heading {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.45rem 0.55rem 0.4rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.01em;\n }\n .preset-menu-shortcut {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n font-weight: 500;\n }\n .preset-menu-shortcut kbd {\n min-width: 1.125rem;\n padding: 0.05rem 0.3rem;\n border: 1px solid var(--panel-border);\n border-bottom-width: 2px;\n border-radius: 0.3rem;\n background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));\n color: var(--text-muted);\n font-family: inherit;\n font-size: 0.625rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n }\n .toolbar .preset-option {\n display: grid;\n grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;\n align-items: center;\n gap: 0.75rem;\n width: 100%;\n min-height: 3.125rem;\n margin-top: 0.125rem;\n padding: 0.45rem 0.6rem 0.45rem 0.5rem;\n border: 0;\n border-radius: 0.625rem;\n background: transparent;\n color: var(--text);\n box-shadow: none;\n backdrop-filter: none;\n text-align: left;\n transition: background 0.14s ease;\n }\n .toolbar .preset-option:hover,\n .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }\n .toolbar .preset-option[aria-checked=\"true\"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }\n .toolbar .preset-option:focus-visible {\n outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);\n outline-offset: -1.5px;\n }\n .preset-option-swatch {\n position: relative;\n width: 2.375rem;\n height: 1.75rem;\n overflow: hidden;\n border: 0;\n border-radius: 0.4375rem;\n background: #0f172a;\n box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);\n transition: box-shadow 0.14s ease, transform 0.14s ease;\n }\n .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }\n .toolbar .preset-option[aria-checked=\"true\"] .preset-option-swatch {\n box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);\n }\n .preset-option-swatch::before,\n .preset-option-swatch::after { position: absolute; content: \"\"; }\n .preset-option-swatch.classic::before {\n top: 0.42rem;\n right: 0.35rem;\n bottom: 0.42rem;\n left: 0.35rem;\n border: 1px solid #22d3ee;\n border-radius: 0.16rem;\n background: rgba(34, 211, 238, 0.14);\n }\n /* Classic previews the canvas it will actually produce in this theme. */\n [data-theme=\"light\"] .preset-option-swatch.classic {\n background:\n radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,\n #ffffff;\n }\n [data-theme=\"light\"] .preset-option-swatch.classic::before {\n border-color: #1b87a3;\n background: rgba(14, 116, 144, 0.08);\n box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);\n }\n .preset-option-swatch.signal-flow {\n border-color: #29415f;\n background: linear-gradient(135deg, #07101e 10%, #10243c 100%);\n }\n .preset-option-swatch.signal-flow::before {\n top: 50%;\n right: 0.2rem;\n left: 0.2rem;\n height: 1px;\n background: linear-gradient(90deg, #67e8f9, #c4b5fd);\n box-shadow: 0 0 8px #67e8f9;\n }\n .preset-option-swatch.signal-flow::after {\n top: calc(50% - 0.13rem);\n right: 0.28rem;\n width: 0.26rem;\n height: 0.26rem;\n border-radius: 50%;\n background: #67e8f9;\n box-shadow: 0 0 7px #67e8f9;\n }\n .preset-option-swatch.blueprint {\n border-color: #34799a;\n border-radius: 0.08rem;\n background-color: #0a2031;\n background-image:\n linear-gradient(rgba(102, 217, 239, 0.18) 1px, transparent 1px),\n linear-gradient(90deg, rgba(102, 217, 239, 0.18) 1px, transparent 1px);\n background-size: 0.42rem 0.42rem;\n }\n .preset-option-swatch.blueprint::before {\n top: 0.34rem;\n right: 0.38rem;\n bottom: 0.34rem;\n left: 0.38rem;\n border: 1px solid #66d9ef;\n }\n .preset-option-swatch.editorial {\n border-color: #b8aa94;\n border-radius: 0.08rem;\n background: repeating-linear-gradient(0deg, #f2eee5 0 0.34rem, #d8d0c2 0.36rem, #f2eee5 0.38rem);\n }\n .preset-option-swatch.editorial::before {\n top: 0;\n bottom: 0;\n left: 0.42rem;\n width: 1px;\n background: #c9502d;\n opacity: 0.72;\n }\n .preset-option-swatch.editorial::after {\n top: 0.52rem;\n right: 0.45rem;\n width: 0.38rem;\n height: 0.38rem;\n background: #c9502d;\n transform: rotate(45deg);\n }\n .preset-option-copy { min-width: 0; }\n .preset-option-copy strong,\n .preset-option-copy small { display: block; }\n .preset-option-copy strong {\n color: var(--text);\n font-size: 0.8125rem;\n font-weight: 550;\n letter-spacing: -0.005em;\n }\n .toolbar .preset-option[aria-checked=\"true\"] .preset-option-copy strong { font-weight: 650; }\n .preset-option-copy small {\n margin-top: 0.125rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 400;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .preset-option-check {\n display: inline-block;\n width: 0.9rem;\n height: 0.9rem;\n color: var(--frontend-stroke);\n background: currentColor;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n opacity: 0;\n }\n .preset-option[aria-checked=\"true\"] .preset-option-check { opacity: 1; }\n html[data-preset=\"editorial\"] .toolbar button,\n html[data-preset=\"editorial\"] .preset-menu,\n html[data-preset=\"editorial\"] .export-menu,\n html[data-preset=\"editorial\"] .overview-map,\n html[data-preset=\"editorial\"] .semantic-lens,\n html[data-preset=\"editorial\"] .route-probe,\n html[data-preset=\"editorial\"] .focus-chip,\n html[data-preset=\"editorial\"] .diagram-guide,\n html[data-preset=\"editorial\"] .node-finder {\n border-radius: 0.3rem;\n }\n .motion-control-dot {\n width: 0.46rem;\n height: 0.46rem;\n flex: 0 0 auto;\n border: 1px solid var(--frontend-stroke);\n border-radius: 50%;\n background: var(--frontend-stroke);\n box-shadow: 0 0 9px color-mix(in srgb, var(--frontend-stroke) 72%, transparent);\n }\n #btn-motion[aria-pressed=\"false\"] .motion-control-dot {\n background: transparent;\n box-shadow: none;\n }\n .toolbar .export-menu {\n position: absolute;\n top: calc(100% + 0.125rem);\n right: 0;\n background: var(--toolbar-menu-bg);\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n width: 19rem;\n max-width: calc(100vw - 2rem);\n max-height: calc(100vh - 5.5rem);\n overflow-y: auto;\n border-radius: 0.875rem;\n padding: 0.375rem;\n display: none;\n flex-direction: column;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);\n scrollbar-width: thin;\n }\n .toolbar .export-menu.open { display: flex; }\n .export-menu-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.55rem 0.6rem 0.6rem;\n }\n .export-menu-header strong,\n .export-menu-header span { display: block; }\n .export-menu-header strong {\n color: var(--text);\n font-size: 0.875rem;\n font-weight: 600;\n letter-spacing: -0.005em;\n }\n .export-menu-header span {\n margin-top: 0.15rem;\n color: var(--text-faint);\n font-size: 0.75rem;\n }\n .export-menu-header kbd {\n min-width: 1.125rem;\n padding: 0.05rem 0.3rem;\n border: 1px solid var(--panel-border);\n border-bottom-width: 2px;\n border-radius: 0.3rem;\n background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));\n color: var(--text-muted);\n font-family: inherit;\n font-size: 0.625rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n }\n .export-menu-section {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: 0.0625rem;\n }\n .export-menu-section + .export-menu-section {\n margin-top: 0.3rem;\n padding-top: 0.3rem;\n border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);\n }\n .export-menu-heading {\n grid-column: 1 / -1;\n display: block;\n padding: 0.4rem 0.6rem 0.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.01em;\n }\n .toolbar .export-menu button {\n display: grid;\n grid-template-columns: 1rem minmax(0, 1fr);\n align-items: center;\n column-gap: 0.7rem;\n background: transparent;\n border: 0;\n box-shadow: none;\n backdrop-filter: none;\n width: 100%;\n min-height: 2.5rem;\n text-align: left;\n padding: 0.4rem 0.6rem;\n border-radius: 0.5625rem;\n color: var(--text);\n white-space: nowrap;\n transition: background 0.14s ease;\n }\n .toolbar .export-menu button:hover,\n .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }\n .toolbar .export-menu button:focus-visible {\n outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);\n outline-offset: -1.5px;\n }\n /* Name and format hint share one line, so each row stays compact. */\n .export-item-copy {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 0.75rem;\n min-width: 0;\n }\n .export-item-copy strong {\n overflow: hidden;\n color: inherit;\n font-size: 0.8125rem;\n font-weight: 500;\n text-overflow: ellipsis;\n }\n .export-item-copy small {\n flex: none;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 450;\n }\n .toolbar .export-menu button::before {\n position: static;\n z-index: auto;\n inset: auto;\n border-radius: 0;\n display: block;\n width: 1rem;\n height: 1rem;\n background: currentColor;\n color: var(--text-muted);\n content: \"\";\n opacity: 0.8;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .toolbar .export-menu button[data-format=\"share-card\"]::before,\n .toolbar .export-menu button[data-action=\"route-share-card\"]::before,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-action^=\"copy\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format=\"png\"]::before,\n .toolbar .export-menu button[data-format=\"jpeg\"]::before,\n .toolbar .export-menu button[data-format=\"webp\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format^=\"svg\"]::before,\n .toolbar .export-menu button[data-format=\"webm\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format=\"share-card\"],\n .toolbar .export-menu button[data-action=\"route-share-card\"],\n .toolbar .export-menu button[data-action=\"reach-share-card\"] {\n color: var(--text);\n background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);\n }\n .toolbar .export-menu button[data-format=\"share-card\"]::before,\n .toolbar .export-menu button[data-action=\"route-share-card\"]::before,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]::before { color: var(--frontend-stroke); opacity: 1; }\n .toolbar .export-menu button[hidden] { display: none; }\n .toolbar .export-menu button[data-format=\"share-card\"]:hover,\n .toolbar .export-menu button[data-action=\"route-share-card\"]:hover,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]:hover {\n background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);\n }\n .toolbar .export-menu button:disabled {\n color: var(--text-faint);\n background: transparent;\n opacity: 0.55;\n cursor: not-allowed;\n }\n .toolbar .export-menu .hint {\n color: var(--text-faint);\n font-size: 0.6875rem;\n }\n\n /* Toast — brief feedback for actions like \"copied\" */\n .archify-toast {\n position: fixed;\n top: 1rem;\n left: 50%;\n transform: translateX(-50%) translateY(-8px);\n background: var(--toolbar-menu-bg);\n color: var(--text);\n border: 1px solid var(--toolbar-border);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n font-family: inherit;\n font-size: 0.75rem;\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n z-index: 200;\n pointer-events: none;\n box-shadow: 0 4px 20px rgba(0,0,0,0.25);\n }\n .archify-toast.show {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n\n @media (max-width: 720px) {\n body { padding: 1rem; }\n .toolbar .preset-menu,\n .toolbar .export-menu {\n position: fixed;\n top: 4.5rem;\n right: 1rem;\n left: 1rem;\n width: auto;\n max-width: none;\n }\n .toolbar {\n position: relative;\n top: auto;\n right: auto;\n justify-content: flex-end;\n width: max-content;\n max-width: 100%;\n margin-left: auto;\n margin-bottom: 1rem;\n }\n .header { margin-bottom: 1.25rem; padding-right: 0; }\n html[data-preset=\"signal-flow\"] .header,\n html[data-preset=\"blueprint\"] .header,\n html[data-preset=\"editorial\"] .header { padding-right: 0; }\n .header-row {\n gap: 0.75rem;\n align-items: flex-start;\n }\n html[data-preset=\"signal-flow\"] .header-row,\n html[data-preset=\"blueprint\"] .header-row,\n html[data-preset=\"editorial\"] .header-row { flex-wrap: wrap; }\n html[data-preset=\"signal-flow\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n html[data-preset=\"blueprint\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n html[data-preset=\"editorial\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n h1 {\n font-size: 1.25rem;\n line-height: 1.25;\n }\n .subtitle {\n margin-left: 0;\n font-size: 0.8125rem;\n line-height: 1.55;\n }\n .diagram-container {\n padding: 0.75rem;\n border-radius: 0.75rem;\n }\n html:not([data-embed=\"true\"]) .diagram-container {\n padding: 0.75rem 0.75rem 4.25rem;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] {\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-x: contain;\n scrollbar-width: thin;\n scroll-behavior: smooth;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] \u003e svg {\n min-width: 720px;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .diagram-nav,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .overview-map,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .focus-chip,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .route-probe,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .semantic-lens,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .diagram-guide,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .node-finder {\n transform: translateX(var(--archify-scroll-x, 0px));\n }\n .diagram-nav { right: 0.5rem; bottom: 0.5rem; }\n .diagram-nav button {\n min-width: 2.75rem;\n height: 2.75rem;\n }\n .diagram-nav [data-view=\"reset\"] { min-width: 3.75rem; }\n .diagram-nav [data-view=\"reset\"][data-detail-visible] { min-width: 4.35rem; }\n .overview-map {\n right: 0.5rem;\n bottom: 3.7rem;\n width: min(10.25rem, calc(100% - 1rem));\n }\n .overview-map[data-docked=\"true\"] {\n right: var(--archify-radar-right, 0.5rem);\n top: var(--archify-radar-top, 0.5rem);\n bottom: auto;\n transform: none !important;\n }\n .overview-map[data-docked=\"true\"][data-dock-side=\"left\"] {\n right: auto;\n left: var(--archify-radar-left, 0.5rem);\n }\n .overview-map-surface { height: 4rem; }\n .overview-map-feedback { right: 0.5rem; bottom: 3.7rem; }\n .semantic-lens {\n right: 0.5rem;\n bottom: 3.7rem;\n width: calc(100% - 1rem);\n max-height: calc(100% - 4.2rem);\n }\n .semantic-lens[data-dock-side] { left: auto; right: 0.5rem; }\n .semantic-lens-kinds { max-height: min(12rem, 34vh); }\n .focus-chip {\n left: 0.5rem;\n top: 0.5rem;\n width: calc(100% - 1rem);\n max-width: none;\n }\n .relationship-lens-head { padding-top: 0.7rem; }\n .relationship-lens-drag-handle { display: none; }\n .relationship-lens-list { max-height: min(12rem, 38vh); }\n .relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }\n .focus-chip:not([data-relations-expanded=\"true\"]) .relationship-lens-head { border-bottom-color: transparent; }\n .focus-chip:not([data-relations-expanded=\"true\"]) .relationship-lens-list { display: none; }\n /* While a mobile reader previews one relationship, turn the full Lens\n into a compact peek card. This keeps the exact source and target on\n canvas instead of covering them with a long, scrollable list. */\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-list {\n max-height: none;\n padding: 0.35rem;\n overflow: hidden;\n }\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-group { margin: 0; }\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-group-title,\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-row:not([data-preview-active=\"true\"]) {\n display: none;\n }\n .node-finder {\n top: 0.5rem;\n left: 0.5rem;\n width: min(22rem, calc(100% - 1rem));\n max-height: calc(100% - 1rem);\n }\n .diagram-guide {\n top: 0.5rem;\n right: 0.5rem;\n left: 0.5rem;\n width: auto;\n max-height: calc(100% - 1rem);\n }\n .diagram-guide-head { padding: 0.62rem 0.7rem 0.52rem; }\n .diagram-guide-stats { padding: 0.42rem 0.7rem; }\n .diagram-guide-actions {\n grid-template-columns: 1fr;\n gap: 0.28rem;\n padding: 0.42rem;\n }\n .diagram-guide-action {\n min-height: 3.1rem;\n padding: 0.42rem 0.48rem;\n }\n .diagram-guide-action small {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .diagram-guide-index {\n width: 1.5rem;\n height: 1.5rem;\n }\n .diagram-guide-shortcuts { padding: 0.46rem 0.7rem 0.52rem; }\n .diagram-guide-action[data-guide-action=\"present\"] { grid-column: auto; }\n .route-probe[data-guide-open=\"true\"] {\n visibility: hidden;\n pointer-events: none;\n }\n .node-finder-results { max-height: min(16rem, 38vh); }\n .route-probe {\n left: 0.5rem;\n bottom: 3.7rem;\n width: calc(100% - 1rem);\n min-width: 0;\n }\n .route-probe[data-route-dock=\"top\"] {\n top: 0.5rem;\n bottom: auto;\n }\n .route-probe[data-finder-open=\"true\"] {\n visibility: hidden;\n pointer-events: none;\n }\n .route-probe-head { padding: 0.45rem 0.48rem 0.38rem; }\n .route-probe-path { padding: 0.35rem 0.48rem 0.2rem; }\n .route-probe-node { min-height: 2.75rem !important; }\n .route-journey-controls {\n grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem minmax(0, 1fr);\n padding: 0.08rem 0.48rem 0.32rem;\n }\n .route-journey-controls button { min-height: 2.75rem; }\n .route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }\n .route-probe-node { max-width: 7.5rem; }\n \n \n \n \n \n \n \n \n \n \n \n html[data-embed=\"true\"][data-share-playback=\"true\"] .diagram-container {\n padding-top: 4.25rem;\n }\n html[data-embed=\"true\"][data-share-moment=\"true\"] .diagram-container {\n padding-top: 4.25rem;\n }\n \n .cards {\n grid-template-columns: 1fr;\n margin-top: 1rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) body { padding: 0.5rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .container {\n gap: 0.5rem;\n height: calc(100dvh - 1rem);\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar {\n position: fixed;\n top: 0.5rem;\n right: 0.5rem;\n margin: 0;\n gap: 0.25rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar button {\n min-height: 2.75rem;\n padding: 0.42rem 0.58rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header {\n min-height: 2.25rem;\n padding: 3.5rem 0 0;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row {\n min-height: 2.25rem;\n margin: 0;\n align-items: center;\n flex-wrap: nowrap;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row::after,\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .pulse-dot,\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .subtitle { display: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) h1 {\n flex: 1 1 auto;\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n font-size: 0.875rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n \n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] \u003e svg {\n width: 720px;\n height: auto;\n min-width: 720px;\n }\n }\n\n @media (max-width: 420px) {\n .export-menu-section { grid-template-columns: 1fr; }\n .export-menu-heading,\n .toolbar .export-menu button[data-format=\"share-card\"],\n .toolbar .export-menu button[data-action=\"route-share-card\"],\n .toolbar .export-menu button[data-action=\"reach-share-card\"] { grid-column: 1; }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .toolbar .preset-menu.open,\n .toolbar .export-menu.open { animation: none; }\n .toolbar-chevron { transition: none; }\n }\n\n @media (max-width: 360px) {\n .toolbar { gap: 0.25rem; }\n .toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }\n .toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }\n #theme-label, #preset-label, #present-label { display: none; }\n }\n\n /* ==========================================================\n SVG SEMANTIC CLASSES — use these instead of inline fill/stroke\n ========================================================== */\n .c-grid { stroke: var(--grid); fill: none; }\n .c-mask { fill: var(--mask); stroke: none; }\n .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }\n .c-lane-wash { fill: var(--lane-fill); stroke: none; }\n\n .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }\n .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }\n .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }\n .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }\n .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }\n .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }\n .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }\n\n /* Text helpers */\n .t-primary { fill: var(--text); }\n .t-muted { fill: var(--text-muted); }\n .t-dim { fill: var(--text-dim); }\n .t-frontend { fill: var(--frontend-stroke); }\n .t-backend { fill: var(--backend-stroke); }\n .t-database { fill: var(--database-stroke); }\n .t-cloud { fill: var(--cloud-stroke); }\n .t-security { fill: var(--security-stroke); }\n .t-messagebus { fill: var(--messagebus-stroke); }\n .t-external { fill: var(--external-stroke); }\n\n /* Relationship labels share the exact color token used by their path. */\n .t-edge-default { fill: var(--arrow); }\n .t-edge-emphasis { fill: var(--arrow-emphasis); }\n .t-edge-security { fill: var(--security-stroke); }\n .t-edge-dashed { fill: var(--database-stroke); }\n\n /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes\n read as lifted cards with hairline strokes. Paint only; authored geometry,\n hit areas and exports keep their canonical shapes. */\n html[data-preset=\"classic\"] .diagram-container {\n background:\n radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,\n var(--panel);\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-grid { stroke: transparent; }\n html[data-preset=\"classic\"][data-theme=\"light\"] .diagram-container \u003e svg [data-node-id] \u003e rect:not(.c-mask) {\n filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));\n }\n html[data-preset=\"classic\"][data-theme=\"dark\"] .diagram-container \u003e svg [data-node-id] \u003e rect:not(.c-mask) {\n filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg [data-edge-from] {\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }\n html[data-preset=\"classic\"][data-theme=\"dark\"] .diagram-container \u003e svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }\n html[data-preset=\"classic\"] .diagram-container \u003e svg [data-node-id] {\n transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);\n }\n html[data-preset=\"classic\"]:not([data-motion=\"still\"]) .diagram-container \u003e svg [data-node-id]:hover {\n transform: translateY(-1.5px);\n }\n\n /* Semantic Sigils are small authored role stamps, not icons from a brand\n pack and not viewer controls. Prefix selectors with svg so the canonical\n export's SVG-only stylesheet collector keeps them automatically. */\n svg .semantic-sigil {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.35;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.76;\n pointer-events: none;\n }\n svg .semantic-sigil \u003e * { vector-effect: non-scaling-stroke; }\n svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }\n svg .s-frontend { color: var(--frontend-stroke); }\n svg .s-backend { color: var(--backend-stroke); }\n svg .s-database { color: var(--database-stroke); }\n svg .s-cloud { color: var(--cloud-stroke); }\n svg .s-security { color: var(--security-stroke); }\n svg .s-messagebus { color: var(--messagebus-stroke); }\n svg .s-external { color: var(--external-stroke); }\n\n /* Brand Marks are authored identity badges. Their color is contained\n inside one neutral plate so vendor color never replaces Archify's\n semantic node and relationship vocabulary. */\n svg .brand-mark { pointer-events: none; }\n svg .brand-mark-badge { fill: #fff; stroke: none; }\n svg .brand-mark-frame {\n fill: none;\n stroke: #cbd5e1;\n stroke-width: 0.8;\n vector-effect: non-scaling-stroke;\n }\n svg .brand-mark-fallback {\n fill: none;\n stroke: #475569;\n stroke-width: 1.15;\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n svg[data-preset=\"blueprint\"] .brand-mark-badge,\n svg[data-preset=\"blueprint\"] .brand-mark-frame { rx: 1px; }\n\n /* Reading Depth is a viewer-only level-of-detail layer. MAP preserves the\n authored structure and primary labels, READ restores relationship labels\n and node context, and FULL restores tags and fine annotations. Semantic\n intent can reveal the relevant detail without moving any geometry. */\n svg [data-detail] { transition: opacity 160ms ease; }\n svg [data-detail-anchor] {\n transform-box: fill-box;\n transform-origin: center;\n transition: transform 160ms ease;\n }\n .diagram-container[data-detail-level=\"map\"] svg [data-detail=\"context\"],\n .diagram-container[data-detail-level=\"map\"] svg [data-detail=\"fine\"],\n .diagram-container[data-detail-level=\"read\"] svg [data-detail=\"fine\"] {\n opacity: 0;\n pointer-events: none;\n }\n .diagram-container[data-detail-level=\"map\"] svg [data-detail-anchor] {\n transform: translateY(8px);\n }\n\n /* Focus, lens, preview, route, and story states are stronger reader intent than\n the global zoom level. Reveal only their exact semantic matches. */\n svg[data-focus-active] [data-focus-match][data-detail],\n svg[data-focus-active] [data-focus-match] [data-detail],\n svg[data-reach-active] [data-reach-match][data-detail],\n svg[data-reach-active] [data-reach-match] [data-detail],\n svg[data-lens-active] [data-lens-match][data-detail],\n svg[data-lens-active] [data-lens-match] [data-detail],\n svg[data-legend-preview-active] [data-legend-preview-match][data-detail],\n svg[data-legend-preview-active] [data-legend-preview-match] [data-detail],\n svg[data-intent-trace-active] [data-intent-trace-match][data-detail],\n svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],\n svg[data-route-active] [data-route-match][data-detail],\n svg[data-route-active] [data-route-match] [data-detail],\n svg[data-relationship-preview-active] [data-relationship-preview][data-detail],\n svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],\n svg [data-node-id]:hover [data-detail],\n svg [data-node-id]:focus-visible [data-detail] {\n opacity: 1;\n pointer-events: auto;\n }\n svg[data-focus-active] [data-focus-match] [data-detail-anchor],\n svg[data-reach-active] [data-reach-match] [data-detail-anchor],\n svg[data-lens-active] [data-lens-match] [data-detail-anchor],\n svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],\n svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],\n svg[data-route-active] [data-route-match] [data-detail-anchor],\n svg [data-node-id]:hover [data-detail-anchor],\n svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }\n\n /* Arrows */\n .a-default { stroke: var(--arrow); fill: none; }\n .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }\n .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }\n .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }\n\n /* Arrowhead markers reference these */\n .m-default { fill: var(--arrow); }\n .m-emphasis { fill: var(--arrow-emphasis); }\n .m-security { fill: var(--security-stroke); }\n .m-dashed { fill: var(--database-stroke); }\n\n /* Stable semantic exploration hooks emitted by every renderer. */\n svg [data-node-id] {\n cursor: pointer;\n transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;\n }\n svg [data-edge-from],\n svg [data-graph-role=\"automatic-crossover-underlay\"] { transition: opacity 0.18s ease, filter 0.18s ease; }\n svg [data-node-id]:hover,\n svg [data-node-id]:focus-visible {\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n outline: none;\n }\n /* Verified Source Beacons are installed at runtime only for nodes whose\n repository evidence passed the local revision/blob/line checks. They\n live inside the owning node so every focus, route, story, and guided\n view keeps one coherent opacity state. Export serialization removes\n them before producing the canonical SVG or any derived visual. */\n .source-evidence-beacon {\n pointer-events: none;\n opacity: 0.76;\n transition: opacity 160ms ease, filter 160ms ease;\n }\n .source-evidence-beacon rect {\n fill: color-mix(in srgb, var(--mask) 92%, var(--backend-stroke));\n stroke: color-mix(in srgb, var(--backend-stroke) 82%, var(--panel-border));\n stroke-width: 1;\n vector-effect: non-scaling-stroke;\n }\n .source-evidence-beacon text {\n fill: var(--backend-stroke);\n font-size: 5.5px;\n font-weight: 800;\n letter-spacing: 0.06em;\n text-anchor: middle;\n text-transform: uppercase;\n }\n svg [data-node-id]:hover .source-evidence-beacon,\n svg [data-node-id]:focus-visible .source-evidence-beacon,\n svg [data-node-id][data-focus-selected] .source-evidence-beacon {\n opacity: 1;\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));\n }\n svg[data-preset=\"signal-flow\"] .source-evidence-beacon { opacity: 0.9; }\n svg[data-preset=\"blueprint\"] .source-evidence-beacon rect {\n rx: 0.8px;\n filter: none;\n }\n svg [data-legend-kind][role=\"button\"] { cursor: pointer; }\n svg [data-legend-kind]:focus { outline: none; }\n svg [data-legend-hit] {\n fill: transparent;\n stroke: transparent;\n stroke-width: 1.4;\n pointer-events: all;\n vector-effect: non-scaling-stroke;\n transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;\n }\n svg [data-legend-count-badge] { pointer-events: none; }\n svg [data-legend-count-badge] rect {\n fill: var(--mask);\n stroke: var(--panel-border);\n stroke-width: 1;\n vector-effect: non-scaling-stroke;\n }\n svg [data-legend-count-badge] text {\n fill: var(--text-muted);\n font-size: 8px;\n font-weight: 700;\n text-anchor: middle;\n }\n svg [data-legend-kind][role=\"button\"]:hover [data-legend-hit] {\n stroke: color-mix(in srgb, var(--database-stroke) 58%, transparent);\n }\n svg [data-legend-kind][role=\"button\"]:focus-visible [data-legend-hit] {\n stroke: var(--frontend-stroke);\n stroke-width: 1.8;\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg [data-legend-kind][data-legend-selected] [data-legend-hit] {\n stroke: var(--database-stroke);\n stroke-width: 2.2;\n stroke-dasharray: 3 2;\n }\n svg [data-legend-kind][data-legend-selected] [data-legend-count-badge] rect {\n stroke: var(--database-stroke);\n stroke-width: 1.8;\n }\n svg [data-legend-kind][data-legend-zero] { opacity: 0.44; }\n svg[data-preset=\"signal-flow\"] [data-legend-kind][data-legend-selected] [data-legend-hit] {\n filter: drop-shadow(0 0 4px var(--database-stroke));\n }\n svg[data-preset=\"blueprint\"] [data-legend-hit],\n svg[data-preset=\"blueprint\"] [data-legend-count-badge] rect { rx: 0; filter: none; }\n svg[data-legend-preview-active] [data-node-id],\n svg[data-legend-preview-active] [data-edge-from] { opacity: 0.11; }\n svg[data-legend-preview-active] [data-legend-preview-match] { opacity: 1; }\n svg[data-legend-preview-active] [data-legend-preview-peer] { opacity: 0.62; }\n svg[data-legend-preview-active] [data-legend-preview-selected] {\n filter: drop-shadow(0 0 8px var(--database-stroke));\n }\n svg[data-lens-active] [data-node-id],\n svg[data-lens-active] [data-edge-from] { opacity: 0.11; }\n svg[data-lens-active] [data-lens-match] { opacity: 1; }\n svg[data-lens-active] [data-lens-peer] { opacity: 0.62; }\n svg[data-lens-active] [data-lens-selected] {\n filter: drop-shadow(0 0 10px var(--database-stroke));\n }\n .semantic-lens-overlay { pointer-events: none; }\n .semantic-lens-flow {\n fill: none;\n stroke-width: 3.05;\n stroke-linecap: round;\n stroke-dasharray: 0.075 0.925;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.9;\n animation: archify-semantic-lens-flow 1.35s linear 1 both;\n animation-delay: var(--lens-flow-delay, 0s);\n }\n .semantic-lens-flow[data-direction=\"out\"],\n .semantic-lens-flow[data-direction=\"forward\"] {\n stroke: var(--frontend-stroke);\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n .semantic-lens-flow[data-direction=\"in\"],\n .semantic-lens-flow[data-direction=\"reverse\"] {\n stroke: var(--database-stroke);\n filter: drop-shadow(0 0 3px var(--database-stroke));\n }\n .semantic-lens-flow[data-direction=\"within\"] {\n stroke: var(--messagebus-stroke);\n filter: drop-shadow(0 0 3px var(--messagebus-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow {\n stroke-width: 3.7;\n opacity: 1;\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"out\"],\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"forward\"] {\n filter: drop-shadow(0 0 6px var(--frontend-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"in\"],\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"reverse\"] {\n filter: drop-shadow(0 0 6px var(--database-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"within\"] {\n filter: drop-shadow(0 0 6px var(--messagebus-stroke));\n }\n svg[data-preset=\"blueprint\"] .semantic-lens-flow {\n stroke-width: 2.45;\n stroke-linecap: square;\n filter: none;\n opacity: 0.78;\n }\n html[data-embed=\"true\"] .semantic-lens-overlay { display: none; }\n /* Automatic crossover masks are visual companions of their one semantic\n edge. Keep the mask free of data-edge-* identity so graph traversal and\n export still observe exactly one edge, then mirror reader emphasis from\n the paired foreground path in this presentation-only wrapper. */\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.11; }\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-legend-preview-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-lens-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-legend-preview-peer]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-lens-peer]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.62; }\n svg[data-focus-active] [data-node-id],\n svg[data-focus-active] [data-edge-from] { opacity: 0.13; }\n svg[data-focus-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.13; }\n svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-focus-active] [data-focus-match] { opacity: 1; }\n svg[data-focus-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-focus-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n\n /* Authored Reachability is a bounded graph query over the relationships\n already present in the artifact. Upstream walks incoming edges;\n downstream walks outgoing edges. It never claims runtime causality and\n changes only viewer emphasis, not canonical geometry or export bytes. */\n svg[data-reach-active] [data-node-id],\n svg[data-reach-active] [data-edge-from] { opacity: 0.09; }\n svg[data-reach-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.09; }\n svg[data-reach-active] [data-reach-match] { opacity: 1; }\n svg[data-reach-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-reach-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-reach-active=\"upstream\"] [data-reach-origin] {\n filter: drop-shadow(0 0 11px var(--database-stroke));\n }\n svg[data-reach-active=\"downstream\"] [data-reach-origin] {\n filter: drop-shadow(0 0 11px var(--backend-stroke));\n }\n svg[data-reach-active=\"upstream\"] [data-edge-from][data-reach-match] {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));\n }\n svg[data-reach-active=\"downstream\"] [data-edge-from][data-reach-match] {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));\n }\n svg[data-preset=\"blueprint\"][data-reach-active] [data-reach-origin],\n svg[data-preset=\"blueprint\"][data-reach-active] [data-edge-from][data-reach-match] {\n filter: none;\n }\n\n /* Direct Relationship Explorer makes authored paths a real input surface\n without changing their visible stroke or canonical SVG. A transparent\n runtime rail supplies forgiving pointer geometry; the exact authored\n path and endpoints continue to carry every visible state. */\n .relationship-hit-overlay { pointer-events: none; }\n .relationship-hit-target { outline: none; }\n .relationship-hit-rail {\n fill: none;\n stroke: transparent;\n stroke-width: 24;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n pointer-events: stroke;\n cursor: pointer;\n }\n .relationship-focus-rail {\n fill: none;\n stroke: color-mix(in srgb, var(--frontend-stroke) 34%, transparent);\n stroke-width: 6;\n stroke-dasharray: 2 4;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n pointer-events: none;\n opacity: 0;\n }\n .relationship-hit-target:focus-visible .relationship-focus-rail {\n opacity: 1;\n }\n svg[data-preset=\"blueprint\"] .relationship-hit-target:focus-visible .relationship-focus-rail {\n stroke-linecap: square;\n filter: none;\n }\n svg[data-relationship-direct-active] [data-node-id],\n svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }\n svg[data-relationship-direct-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.16; }\n svg[data-relationship-direct-active] [data-relationship-preview],\n svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }\n svg[data-relationship-direct-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-relationship-preview]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,\n svg[data-route-picking] .relationship-hit-rail,\n svg[data-route-active] .relationship-hit-rail,\n svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }\n html[data-embed=\"true\"] .relationship-hit-overlay { display: none; }\n @media (hover: none), (pointer: coarse) {\n .relationship-hit-rail { stroke-width: 24; }\n }\n\n /* Relationship Preview is temporary exploration state layered on top of\n neighborhood focus. It changes emphasis only; exported geometry and the\n relationship's original solid/dashed visual language stay untouched. */\n svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }\n svg[data-relationship-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-focus-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-relationship-preview-active] [data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }\n svg[data-relationship-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-relationship-preview]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-relationship-preview-active] [data-relationship-preview] {\n filter: drop-shadow(0 0 5px var(--arrow-emphasis));\n }\n svg[data-relationship-preview-active] [data-relationship-preview] path,\n svg[data-relationship-preview-active] path[data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview] line,\n svg[data-relationship-preview-active] line[data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview] polyline,\n svg[data-relationship-preview-active] polyline[data-relationship-preview] {\n stroke-width: 2.75;\n }\n svg[data-relationship-preview-active] [data-relationship-preview-source] {\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n }\n svg[data-relationship-preview-active] [data-relationship-preview-target] {\n filter: drop-shadow(0 0 7px var(--database-stroke));\n }\n .relationship-pulse-overlay { pointer-events: none; }\n .relationship-flow-pulse {\n fill: none;\n stroke: var(--arrow-emphasis);\n stroke-width: 3.35;\n stroke-linecap: round;\n stroke-dasharray: 0.085 0.915;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0;\n filter: drop-shadow(0 0 4px var(--arrow-emphasis));\n animation: archify-relationship-pulse 1.2s linear 1 both;\n }\n svg[data-preset=\"signal-flow\"] .relationship-flow-pulse {\n stroke: var(--frontend-stroke);\n stroke-width: 3.85;\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"] .relationship-flow-pulse {\n stroke-width: 2.5;\n stroke-linecap: square;\n filter: none;\n }\n svg[data-preset=\"editorial\"] .relationship-flow-pulse {\n stroke: var(--arrow-emphasis);\n stroke-width: 2.75;\n filter: none;\n }\n .semantic-flow-token {\n color: var(--frontend-stroke);\n opacity: 0;\n pointer-events: none;\n }\n .relationship-flow-token {\n animation: archify-relationship-token-life 1.2s linear 1 both;\n }\n\n .semantic-flow-token-halo {\n fill: var(--mask);\n stroke: currentColor;\n stroke-width: 1.1;\n vector-effect: non-scaling-stroke;\n opacity: 0.96;\n }\n .relationship-flow-token-shape {\n fill: var(--mask);\n stroke: currentColor;\n stroke-width: 1.35;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n }\n .relationship-flow-token-ink {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.05;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n .relationship-flow-token-dot { fill: currentColor; stroke: none; }\n .semantic-flow-token[data-token-kind=\"data\"] { color: var(--database-stroke); }\n .semantic-flow-token[data-token-kind=\"event\"] { color: var(--messagebus-stroke); }\n .semantic-flow-token[data-token-kind=\"security\"] { color: var(--security-stroke); }\n .semantic-flow-token[data-token-kind=\"state\"] { color: var(--cloud-stroke); }\n svg[data-preset=\"signal-flow\"] .semantic-flow-token {\n filter: drop-shadow(0 0 5px currentColor);\n }\n svg[data-preset=\"blueprint\"] .semantic-flow-token { filter: none; }\n svg[data-preset=\"editorial\"] .semantic-flow-token { filter: none; }\n html[data-embed=\"true\"] .relationship-pulse-overlay { display: none; }\n\n /* Intent Trace is a temporary, pre-click exploration layer. Related\n topology stays readable while a short viewer-only signal runs over\n cloned edge geometry; the authored edge remains untouched underneath. */\n /* Keep the node's opaque backing mask intact while its visible ink dims.\n Fading the whole group also fades that mask and briefly exposes arrows\n routed underneath the node when the pointer leaves. */\n svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }\n svg [data-node-id] \u003e .c-mask { fill-opacity: 1; }\n svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }\n svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }\n svg[data-intent-trace-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.2; }\n svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }\n svg[data-intent-trace-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-intent-trace-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-intent-trace-active] [data-intent-trace-selected] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n .intent-trace-overlay { pointer-events: none; }\n .intent-trace-flow {\n fill: none;\n stroke-width: 3.1;\n stroke-linecap: round;\n stroke-dasharray: 0.1 0.9;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.94;\n animation: archify-intent-trace-flow 1.15s linear 1 both;\n }\n /* Direction names describe each edge relative to the focused node only.\n The cloned geometry already runs from the authored source to target, so\n incoming and outgoing signals must share the same playback direction. */\n .intent-trace-flow[data-direction=\"out\"] {\n stroke: var(--frontend-stroke);\n filter: drop-shadow(0 0 4px var(--frontend-stroke));\n }\n .intent-trace-flow[data-direction=\"in\"] {\n stroke: var(--database-stroke);\n filter: drop-shadow(0 0 4px var(--database-stroke));\n animation-direction: normal;\n }\n .intent-trace-flow[data-direction=\"loop\"] {\n stroke: var(--security-stroke);\n filter: drop-shadow(0 0 4px var(--security-stroke));\n }\n svg[data-preset=\"blueprint\"] [data-intent-trace-selected],\n svg[data-preset=\"blueprint\"] .intent-trace-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"editorial\"] [data-intent-trace-selected],\n svg[data-preset=\"editorial\"] .intent-trace-flow { filter: none; }\n .intent-trace-status {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n\n /* Route Probe separates a durable two-point query from selection and\n one-hop hover. Only the chosen shortest directed path stays prominent;\n the traveling signal is cloned viewer geometry and never authored SVG. */\n svg[data-route-picking=\"target\"] [data-node-id] { opacity: 0.24; }\n svg[data-route-picking=\"target\"] [data-route-candidate],\n svg[data-route-picking=\"target\"] [data-route-start] { opacity: 1; }\n svg[data-route-picking] [data-node-id] { cursor: crosshair; }\n svg[data-route-picking] [data-route-start] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n svg[data-route-active] [data-node-id],\n svg[data-route-active] [data-edge-from] { opacity: 0.11; }\n svg[data-route-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.11; }\n svg[data-route-active] [data-route-match] { opacity: 1; }\n svg[data-route-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-route-active] [data-route-start] {\n filter: drop-shadow(0 0 11px var(--frontend-stroke));\n }\n svg[data-route-active] [data-route-end] {\n filter: drop-shadow(0 0 11px var(--security-stroke));\n }\n svg[data-route-active] [data-route-step]:not([data-route-start]):not([data-route-end]) {\n filter: drop-shadow(0 0 7px var(--backend-stroke));\n }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"past\"] { opacity: 0.62; }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"future\"] { opacity: 0.34; }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"current\"] { opacity: 1; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"past\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.62; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"future\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.34; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"current\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-route-journey] [data-node-id][data-route-journey-current] {\n filter: drop-shadow(0 0 10px var(--backend-stroke));\n }\n svg[data-route-journey] [data-edge-from][data-route-journey-current] {\n opacity: 1;\n filter: drop-shadow(0 0 6px var(--backend-stroke));\n }\n .route-probe-overlay { pointer-events: none; }\n .route-journey-overlay { pointer-events: none; }\n .route-probe-flow {\n fill: none;\n stroke: var(--backend-stroke);\n stroke-width: 3.25;\n stroke-linecap: round;\n stroke-dasharray: 0.085 0.915;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.96;\n filter: drop-shadow(0 0 5px var(--backend-stroke));\n animation: archify-route-probe-flow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 1 both;\n animation-delay: calc(var(--route-step, 0) * 0.16s);\n }\n .route-journey-flow {\n fill: none;\n stroke: var(--backend-stroke);\n stroke-width: 3.5;\n stroke-linecap: round;\n stroke-dasharray: 0.1 0.9;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0;\n filter: drop-shadow(0 0 6px var(--backend-stroke));\n animation: archify-route-journey-flow 780ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;\n }\n svg[data-preset=\"blueprint\"] [data-route-start],\n svg[data-preset=\"blueprint\"] [data-route-end],\n svg[data-preset=\"blueprint\"] [data-route-step],\n svg[data-preset=\"blueprint\"] .route-probe-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"blueprint\"] .route-journey-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"editorial\"] [data-route-start],\n svg[data-preset=\"editorial\"] [data-route-end],\n svg[data-preset=\"editorial\"] [data-route-step],\n svg[data-preset=\"editorial\"] .route-probe-flow,\n svg[data-preset=\"editorial\"] .route-journey-flow { filter: none; }\n\n svg[data-preset=\"editorial\"] .c-grid {\n stroke-dasharray: 1 4;\n opacity: 0.48;\n }\n svg[data-preset=\"editorial\"] .c-region {\n fill: color-mix(in srgb, var(--cloud-fill) 48%, transparent);\n stroke-dasharray: 9 4;\n }\n svg[data-preset=\"editorial\"] [data-node-id]:hover,\n svg[data-preset=\"editorial\"] [data-node-id]:focus-visible,\n svg[data-preset=\"editorial\"][data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent));\n }\n\n svg[data-preset=\"blueprint\"] .c-grid {\n stroke-dasharray: 1 3;\n opacity: 0.78;\n }\n svg[data-preset=\"blueprint\"] .c-region {\n fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);\n stroke-dasharray: 12 4 2 4;\n }\n svg[data-preset=\"blueprint\"] .c-security-group,\n svg[data-preset=\"blueprint\"] .c-lane { stroke-dasharray: 7 3; }\n svg[data-preset=\"blueprint\"] [data-node-id]:hover,\n svg[data-preset=\"blueprint\"] [data-node-id]:focus-visible {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"][data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {\n filter: none;\n }\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview],\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview-source],\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview-target] {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n\n /* Dashed boundary variants */\n .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }\n .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }\n .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }\n\n /* Optional trace animation, enabled only by meta.animation = \"trace\".\n The ordinary viewer performs one ambient pass and then restores the\n authored solid/security/async line language. WebM samples the same\n authored geometry into an explicit canvas timeline. */\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-animate=\"edge\"] {\n animation: archify-edge-flow 2.4s linear 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: archify-edge-flow 2.4s linear 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-animate=\"node\"] {\n transform-box: fill-box;\n transform-origin: center;\n animation: archify-node-pulse 3.6s ease-in-out 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n stroke-linecap: round;\n filter: drop-shadow(0 0 3px var(--arrow-emphasis));\n animation-duration: 1.75s;\n }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 1.75s; }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-duration: 3.1s;\n }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n stroke-linecap: square;\n filter: none;\n animation-duration: 2.15s;\n }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 2.15s; }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-name: archify-blueprint-node-pulse;\n animation-duration: 3.8s;\n }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n filter: none;\n animation-duration: 2.2s;\n }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 2.2s; }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-name: archify-editorial-node-pulse;\n animation-duration: 3.5s;\n }\n /* Embedded proofs stay static so proof grids are calm instead of leaving\n ambient trace loops on. */\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n @keyframes archify-edge-flow {\n 0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }\n 88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }\n 99.9% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }\n 100% { stroke-dashoffset: 0; opacity: 1; }\n }\n @keyframes archify-node-pulse {\n 0%, 72%, 100% { filter: none; stroke-width: 1.5; }\n 18%, 36% {\n filter: drop-shadow(0 0 8px var(--arrow-emphasis));\n stroke-width: 2.4;\n }\n }\n @keyframes archify-blueprint-node-pulse {\n 0%, 72%, 100% { opacity: 1; filter: none; }\n 18%, 36% { opacity: 0.72; filter: drop-shadow(0 0 2px var(--frontend-stroke)); }\n }\n @keyframes archify-editorial-node-pulse {\n 0%, 72%, 100% { opacity: 1; filter: none; }\n 18%, 36% { opacity: 0.78; filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent)); }\n }\n @keyframes archify-signal-scan {\n 0%, 18% { opacity: 1; transform: translateX(-70%); }\n 70% { opacity: 1; transform: translateX(70%); }\n 100% { opacity: 0; transform: translateX(70%); }\n }\n @keyframes archify-radar-live {\n 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }\n 55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }\n }\n\n @keyframes archify-intent-trace-flow {\n 0% { opacity: 0.28; stroke-dashoffset: 0; }\n 12%, 78% { opacity: 0.94; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-route-probe-flow {\n 0% { stroke-dashoffset: 0; opacity: 0.96; }\n 78% { stroke-dashoffset: -1; opacity: 0.96; }\n 100% { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.58; }\n }\n @keyframes archify-route-journey-flow {\n 0% { opacity: 0.16; stroke-dashoffset: 0; }\n 14%, 76% { opacity: 1; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-semantic-lens-flow {\n 0% { opacity: 0.2; stroke-dashoffset: 0; }\n 12%, 78% { opacity: 0.9; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-relationship-pulse {\n 0% { opacity: 0.18; stroke-dashoffset: 0; }\n 10%, 76% { opacity: 0.98; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-relationship-token-life {\n 0%, 7% { opacity: 0; }\n 13%, 82% { opacity: 1; }\n 100% { opacity: 0; }\n }\n\n @keyframes archify-share-cue-enter {\n from { opacity: 0; transform: translate(-50%, -0.45rem); }\n to { opacity: 1; transform: translate(-50%, 0); }\n }\n @keyframes archify-share-cue-pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.48; transform: scale(0.78); }\n }\n @media (prefers-reduced-motion: reduce) {\n html[data-preset=\"signal-flow\"] .diagram-container::before {\n animation: none !important;\n }\n .pulse-dot { animation: none !important; }\n svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n .intent-trace-flow,\n .route-probe-flow,\n .semantic-lens,\n .diagram-guide,\n .overview-map-live { animation: none !important; }\n \n .intent-trace-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.72;\n }\n .route-probe-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.78;\n }\n .route-journey-overlay { display: none !important; }\n .semantic-lens-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-width: 2.2;\n opacity: 0.34;\n filter: none;\n }\n .relationship-pulse-overlay { display: none !important; }\n .source-evidence-beacon,\n svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }\n }\n ";
+ const exportCss = "\n /* ==========================================================\n THEME VARIABLES — switch by toggling [data-theme] on \u003chtml\u003e\n ========================================================== */\n :root,\n [data-theme=\"dark\"] {\n --bg: #020617;\n --grid: #1e293b;\n --canvas-dot: rgba(148, 163, 184, 0.16);\n --text: #ffffff;\n --text-muted: #94a3b8;\n --text-dim: #475569;\n /* UI chrome and menu hints need more contrast than SVG .t-dim accents */\n --text-faint: #7d8da1;\n\n --panel: rgba(15, 23, 42, 0.5);\n --panel-border: #1e293b;\n --lane-fill: rgba(15, 23, 42, 0.22);\n --lane-stroke: #334155;\n\n --arrow: #64748b;\n --arrow-emphasis: #34d399;\n\n /* Opaque mask color used behind semi-transparent component fills\n so the arrows drawn underneath are properly hidden. */\n --mask: #0f172a;\n\n --frontend-fill: rgba(8, 51, 68, 0.4);\n --frontend-stroke: #22d3ee;\n --backend-fill: rgba(6, 78, 59, 0.4);\n --backend-stroke: #34d399;\n --database-fill: rgba(76, 29, 149, 0.4);\n --database-stroke: #a78bfa;\n --cloud-fill: rgba(120, 53, 15, 0.3);\n --cloud-stroke: #fbbf24;\n --security-fill: rgba(136, 19, 55, 0.4);\n --security-stroke: #fb7185;\n --messagebus-fill: rgba(251, 146, 60, 0.3);\n --messagebus-stroke:#fb923c;\n --external-fill: rgba(30, 41, 59, 0.5);\n --external-stroke: #94a3b8;\n\n --toolbar-bg: rgba(15, 23, 42, 0.8);\n --toolbar-border: #334155;\n --toolbar-text: #e2e8f0;\n --toolbar-hover: rgba(15, 23, 42, 0.95);\n --toolbar-menu-bg: #0f172a;\n }\n\n [data-theme=\"light\"] {\n --bg: #f4f5f7;\n --grid: #e9edf2;\n --canvas-dot: #d9dee5;\n --text: #111827;\n --text-muted: #5b6474;\n --text-dim: #9aa3b2;\n --text-faint: #6b7280;\n\n --panel: #ffffff;\n --panel-border: #e5e7eb;\n --lane-fill: rgba(248, 250, 252, 0.65);\n --lane-stroke: #cbd5e1;\n\n --arrow: #94a3b8;\n --arrow-emphasis: #059669;\n\n --mask: #ffffff;\n\n --frontend-fill: rgba(34, 211, 238, 0.15);\n --frontend-stroke: #0891b2;\n --backend-fill: rgba(52, 211, 153, 0.18);\n --backend-stroke: #059669;\n --database-fill: rgba(167, 139, 250, 0.2);\n --database-stroke: #7c3aed;\n --cloud-fill: rgba(251, 191, 36, 0.18);\n --cloud-stroke: #d97706;\n --security-fill: rgba(251, 113, 133, 0.15);\n --security-stroke: #e11d48;\n --messagebus-fill: rgba(251, 146, 60, 0.15);\n --messagebus-stroke: #ea580c;\n --external-fill: rgba(148, 163, 184, 0.18);\n --external-stroke: #64748b;\n\n --toolbar-bg: rgba(255, 255, 255, 0.92);\n --toolbar-border: #cbd5e1;\n --toolbar-text: #334155;\n --toolbar-hover: #ffffff;\n --toolbar-menu-bg: #ffffff;\n }\n\n /* ==========================================================\n SIGNAL FLOW — an opt-in, motion-forward visual preset.\n The variables also target a standalone exported SVG, whose\n root carries data-preset and data-theme directly.\n ========================================================== */\n [data-preset=\"signal-flow\"][data-theme=\"dark\"] {\n --bg: #030711;\n --grid: #15233a;\n --panel: rgba(6, 14, 28, 0.78);\n --panel-border: #1d3350;\n --lane-fill: rgba(9, 22, 40, 0.5);\n --lane-stroke: #2c4564;\n --text: #f5fbff;\n --text-muted: #9eb0c7;\n --text-dim: #52667f;\n --text-faint: #7890ad;\n --mask: #07101e;\n --frontend-fill: rgba(6, 182, 212, 0.14);\n --frontend-stroke: #67e8f9;\n --backend-fill: rgba(16, 185, 129, 0.14);\n --backend-stroke: #5eead4;\n --database-fill: rgba(139, 92, 246, 0.16);\n --database-stroke: #c4b5fd;\n --cloud-fill: rgba(245, 158, 11, 0.13);\n --cloud-stroke: #fcd34d;\n --security-fill: rgba(244, 63, 94, 0.13);\n --security-stroke: #fda4af;\n --messagebus-fill: rgba(249, 115, 22, 0.13);\n --messagebus-stroke: #fdba74;\n --external-fill: rgba(71, 85, 105, 0.24);\n --external-stroke: #a5b4c7;\n --arrow: #7890ad;\n --arrow-emphasis: #2dd4bf;\n --toolbar-bg: rgba(7, 16, 30, 0.86);\n --toolbar-border: #29415f;\n --toolbar-menu-bg: #07101e;\n }\n\n [data-preset=\"signal-flow\"][data-theme=\"light\"] {\n --bg: #f4f9fc;\n --grid: #d4e5ee;\n --panel: rgba(255, 255, 255, 0.82);\n --panel-border: #bfd5e2;\n --lane-fill: rgba(232, 243, 248, 0.62);\n --lane-stroke: #a9c5d5;\n --text: #102638;\n --text-muted: #587287;\n --text-dim: #8aa2b4;\n --text-faint: #668397;\n --mask: #ffffff;\n --frontend-fill: rgba(6, 182, 212, 0.09);\n --frontend-stroke: #0789a1;\n --backend-fill: rgba(5, 150, 105, 0.09);\n --backend-stroke: #087f69;\n --database-fill: rgba(124, 58, 237, 0.09);\n --database-stroke: #7254c7;\n --cloud-fill: rgba(217, 119, 6, 0.08);\n --cloud-stroke: #b9670b;\n --security-fill: rgba(225, 29, 72, 0.08);\n --security-stroke: #c53a59;\n --messagebus-fill: rgba(234, 88, 12, 0.08);\n --messagebus-stroke: #c65f27;\n --external-fill: rgba(100, 116, 139, 0.1);\n --external-stroke: #607a8c;\n --arrow: #7b97aa;\n --arrow-emphasis: #0d9488;\n }\n\n /* ==========================================================\n BLUEPRINT — a review-first drafting preset for deployment,\n infrastructure, and technical design documentation. It keeps\n the same semantic palette and geometry while trading glow for\n precise grid contrast, squared materials, and drafting marks.\n ========================================================== */\n [data-preset=\"blueprint\"][data-theme=\"dark\"] {\n --bg: #06131f;\n --grid: #17425a;\n --panel: rgba(7, 27, 43, 0.9);\n --panel-border: #27627f;\n --lane-fill: rgba(10, 43, 66, 0.36);\n --lane-stroke: #34799a;\n --text: #e3f6ff;\n --text-muted: #91b8ca;\n --text-dim: #557e92;\n --text-faint: #739caf;\n --mask: #0a2031;\n --frontend-fill: rgba(26, 157, 193, 0.14);\n --frontend-stroke: #66d9ef;\n --backend-fill: rgba(31, 155, 124, 0.13);\n --backend-stroke: #69dfbd;\n --database-fill: rgba(120, 105, 196, 0.14);\n --database-stroke: #b4a8ff;\n --cloud-fill: rgba(197, 145, 43, 0.13);\n --cloud-stroke: #ffd166;\n --security-fill: rgba(199, 76, 104, 0.13);\n --security-stroke: #ff8da1;\n --messagebus-fill: rgba(207, 112, 49, 0.13);\n --messagebus-stroke: #ffad66;\n --external-fill: rgba(84, 119, 139, 0.18);\n --external-stroke: #a7cad9;\n --arrow: #78a3b7;\n --arrow-emphasis: #64dfc1;\n --toolbar-bg: rgba(7, 28, 45, 0.92);\n --toolbar-border: #34799a;\n --toolbar-text: #d8f3ff;\n --toolbar-hover: rgba(18, 58, 83, 0.95);\n --toolbar-menu-bg: #0a2031;\n }\n\n [data-preset=\"blueprint\"][data-theme=\"light\"] {\n --bg: #edf7fa;\n --grid: #b5d5e1;\n --panel: rgba(249, 253, 255, 0.94);\n --panel-border: #78aabd;\n --lane-fill: rgba(210, 232, 240, 0.42);\n --lane-stroke: #83b2c4;\n --text: #123344;\n --text-muted: #4e7486;\n --text-dim: #86a6b4;\n --text-faint: #668c9d;\n --mask: #f9fdff;\n --frontend-fill: rgba(8, 145, 178, 0.08);\n --frontend-stroke: #087f9c;\n --backend-fill: rgba(5, 128, 101, 0.08);\n --backend-stroke: #08755f;\n --database-fill: rgba(100, 75, 180, 0.08);\n --database-stroke: #6757a8;\n --cloud-fill: rgba(181, 120, 15, 0.08);\n --cloud-stroke: #a86609;\n --security-fill: rgba(190, 48, 80, 0.07);\n --security-stroke: #b32f50;\n --messagebus-fill: rgba(196, 81, 22, 0.07);\n --messagebus-stroke: #b65120;\n --external-fill: rgba(79, 112, 128, 0.08);\n --external-stroke: #506f7e;\n --arrow: #6d93a5;\n --arrow-emphasis: #087f69;\n --toolbar-bg: rgba(247, 252, 254, 0.94);\n --toolbar-border: #8ab5c5;\n --toolbar-text: #294f61;\n --toolbar-hover: #ffffff;\n --toolbar-menu-bg: #f9fdff;\n }\n\n /* ==========================================================\n EDITORIAL — a warm, publication-minded preset for design\n reviews, launch notes, and documentation. The diagram keeps\n the same semantic palette and exact geometry, but trades\n software chrome for paper, ink, ruled structure, and one\n restrained vermilion accent.\n ========================================================== */\n [data-preset=\"editorial\"][data-theme=\"dark\"] {\n --bg: #181611;\n --grid: #39342a;\n --panel: rgba(35, 31, 24, 0.96);\n --panel-border: #625a4a;\n --lane-fill: rgba(52, 46, 35, 0.46);\n --lane-stroke: #726957;\n --text: #f4eddf;\n --text-muted: #b9ae9b;\n --text-dim: #776e60;\n --text-faint: #9d917e;\n --mask: #231f18;\n --frontend-fill: rgba(43, 133, 142, 0.16);\n --frontend-stroke: #7fc6c7;\n --backend-fill: rgba(63, 132, 92, 0.16);\n --backend-stroke: #8fc29e;\n --database-fill: rgba(117, 91, 141, 0.17);\n --database-stroke: #c0a4d0;\n --cloud-fill: rgba(170, 119, 49, 0.16);\n --cloud-stroke: #d8ad68;\n --security-fill: rgba(157, 69, 65, 0.17);\n --security-stroke: #df9085;\n --messagebus-fill: rgba(174, 79, 42, 0.16);\n --messagebus-stroke: #df946f;\n --external-fill: rgba(126, 115, 96, 0.18);\n --external-stroke: #b8ad99;\n --arrow: #948978;\n --arrow-emphasis: #dd6b3d;\n --toolbar-bg: rgba(35, 31, 24, 0.92);\n --toolbar-border: #625a4a;\n --toolbar-text: #eee5d5;\n --toolbar-hover: #302a20;\n --toolbar-menu-bg: #231f18;\n }\n\n [data-preset=\"editorial\"][data-theme=\"light\"] {\n --bg: #f2eee5;\n --grid: #d8d0c2;\n --panel: rgba(251, 248, 241, 0.97);\n --panel-border: #c4b9a6;\n --lane-fill: rgba(229, 221, 207, 0.42);\n --lane-stroke: #b8aa94;\n --text: #242018;\n --text-muted: #6f6658;\n --text-dim: #a09788;\n --text-faint: #817767;\n --mask: #fbf8f1;\n --frontend-fill: rgba(31, 117, 126, 0.09);\n --frontend-stroke: #287e84;\n --backend-fill: rgba(42, 119, 75, 0.09);\n --backend-stroke: #397b53;\n --database-fill: rgba(105, 75, 130, 0.09);\n --database-stroke: #765d86;\n --cloud-fill: rgba(157, 103, 31, 0.1);\n --cloud-stroke: #9a671f;\n --security-fill: rgba(153, 58, 52, 0.09);\n --security-stroke: #9e463f;\n --messagebus-fill: rgba(182, 70, 27, 0.09);\n --messagebus-stroke: #ad4b25;\n --external-fill: rgba(101, 91, 75, 0.09);\n --external-stroke: #746b5e;\n --arrow: #8a806f;\n --arrow-emphasis: #bb4c23;\n --toolbar-bg: rgba(251, 248, 241, 0.94);\n --toolbar-border: #c4b9a6;\n --toolbar-text: #40392f;\n --toolbar-hover: #fffdf8;\n --toolbar-menu-bg: #fbf8f1;\n }\n\n * { margin: 0; padding: 0; box-sizing: border-box; }\n\n body {\n --archify-page-top: 2rem;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n background: var(--bg);\n min-height: 100vh;\n padding: var(--archify-page-top) 2rem 2rem;\n color: var(--text);\n /* Theme surfaces change together; animating the page background leaves it\n visibly out of sync with the SVG and panel for the first 200ms. */\n }\n\n html[data-preset=\"signal-flow\"] body {\n background-image:\n radial-gradient(circle at 18% -8%, rgba(34, 211, 238, 0.14), transparent 34rem),\n radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.12), transparent 30rem);\n background-attachment: fixed;\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] body {\n background-image:\n radial-gradient(circle at 18% -8%, rgba(6, 182, 212, 0.12), transparent 34rem),\n radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.08), transparent 30rem);\n }\n html[data-preset=\"blueprint\"] body {\n background-image:\n linear-gradient(var(--grid) 1px, transparent 1px),\n linear-gradient(90deg, var(--grid) 1px, transparent 1px);\n background-size: 32px 32px;\n background-position: -1px -1px;\n background-attachment: fixed;\n }\n html[data-preset=\"editorial\"] body {\n background-image:\n linear-gradient(90deg, transparent 0, transparent 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) calc(5.4rem + 1px), transparent calc(5.4rem + 1px)),\n repeating-linear-gradient(0deg, transparent 0, transparent 31px, color-mix(in srgb, var(--grid) 36%, transparent) 31px, color-mix(in srgb, var(--grid) 36%, transparent) 32px);\n background-attachment: fixed;\n }\n\n /* Gallery/embed mode keeps the generated artifact as the source of truth\n while presenting only its diagram surface inside a proof card. */\n html[data-embed=\"true\"] body {\n min-height: 0;\n padding: 0;\n overflow: hidden;\n background: var(--bg);\n background-image: none;\n }\n html[data-embed=\"true\"] .toolbar,\n html[data-embed=\"true\"] .header,\n html[data-embed=\"true\"] .cards,\n html[data-embed=\"true\"] .diagram-nav,\n html[data-embed=\"true\"] .overview-map,\n html[data-embed=\"true\"] .focus-chip,\n html[data-embed=\"true\"] .route-probe,\n html[data-embed=\"true\"] .semantic-lens,\n html[data-embed=\"true\"] .diagram-guide,\n html[data-embed=\"true\"] .node-finder,\n html[data-embed=\"true\"] .node-outline { display: none !important; }\n html[data-embed=\"true\"] .container { max-width: none; }\n html[data-embed=\"true\"] .diagram-container {\n padding: 0.5rem;\n border: 0;\n border-radius: 0;\n box-shadow: none;\n }\n html[data-embed=\"true\"] .diagram-container svg { min-width: 0; }\n\n /* Presentation Stage is a viewer-only layer: it gives the live diagram\n the viewport while keeping guided views, theme, focus, and exports real.\n Embed mode wins when both query parameters are present. */\n html[data-present=\"true\"]:not([data-embed=\"true\"]) body {\n --archify-page-top: 1rem;\n height: 100dvh;\n min-height: 0;\n padding: 1rem;\n overflow: hidden;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .container {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n width: 100%;\n max-width: none;\n height: calc(100dvh - 2rem);\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header {\n flex: none;\n min-width: 0;\n margin: 0;\n padding-right: 23rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row { margin-bottom: 0.25rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .subtitle {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n min-height: 0;\n padding: 0.75rem;\n padding-bottom: calc(0.75rem + var(--archify-nav-reserve));\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container \u003e svg {\n flex: 1 1 auto;\n height: 100%;\n min-height: 0;\n width: 100%;\n min-width: 0;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .cards { display: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) #btn-present {\n border-color: var(--frontend-stroke);\n color: var(--frontend-stroke);\n }\n\n /* The reader owns only the outer scale. Wide diagrams and measured tall workflows keep one authored\n SVG/viewBox while the runtime chooses a desktop width from the actual\n vertical budget. This avoids device-specific files and breakpoint\n jumps between a laptop and a tall monitor. */\n .container {\n width: 100%;\n max-width: var(--archify-reader-width, 1440px);\n margin: 0 auto;\n }\n @media (min-width: 768px) and (max-height: 920px) {\n .header { margin-bottom: 1rem; }\n .diagram-container { padding: 1rem; }\n .cards { margin-top: 1rem; }\n .card { padding: 1rem; }\n }\n\n .header { margin-bottom: 1.5rem; padding-right: 29.5rem; }\n\n html[data-preset=\"signal-flow\"] .header,\n html[data-preset=\"blueprint\"] .header,\n html[data-preset=\"editorial\"] .header { padding-right: 29.5rem; }\n\n .header-row {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n min-height: 2.75rem;\n margin-bottom: 0.25rem;\n }\n\n .pulse-dot {\n flex: none;\n width: 10px;\n height: 10px;\n background: var(--frontend-stroke);\n border-radius: 50%;\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);\n animation: none;\n }\n\n html[data-motion-capable=\"true\"] .pulse-dot { animation: pulse 2s infinite; }\n\n @keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n\n h1 {\n font-size: 1.5rem;\n font-weight: 650;\n line-height: 1.25;\n letter-spacing: -0.015em;\n }\n\n .subtitle {\n color: var(--text-muted);\n font-size: 0.875rem;\n line-height: 1.55;\n margin-left: 1.375rem;\n }\n\n html[data-preset=\"signal-flow\"] .header-row::after {\n content: attr(data-preset-badge-signal-flow);\n flex: none;\n margin-left: 0.25rem;\n color: var(--frontend-stroke);\n border: 1px solid var(--frontend-stroke);\n border-radius: 999px;\n padding: 0.28rem 0.6rem;\n font-size: 0.625rem;\n letter-spacing: 0.12em;\n opacity: 0.82;\n box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);\n white-space: nowrap;\n }\n\n html[data-preset=\"blueprint\"] .pulse-dot {\n width: 10px;\n height: 10px;\n border: 1px solid var(--frontend-stroke);\n border-radius: 1px;\n background: transparent;\n box-shadow: inset 0 0 0 2px var(--bg);\n transform: rotate(45deg);\n animation: none;\n }\n html[data-preset=\"blueprint\"] .header-row::after {\n content: attr(data-preset-badge-blueprint);\n flex: none;\n margin-left: 0.25rem;\n padding: 0.28rem 0.55rem;\n border-top: 1px solid var(--frontend-stroke);\n border-bottom: 1px solid var(--frontend-stroke);\n color: var(--frontend-stroke);\n font-size: 0.5625rem;\n font-weight: 700;\n letter-spacing: 0.14em;\n white-space: nowrap;\n }\n\n html[data-preset=\"editorial\"] h1,\n html[data-preset=\"editorial\"] .card h3 {\n font-family: Georgia, 'Times New Roman', 'Songti SC', STSong, serif;\n letter-spacing: -0.02em;\n }\n html[data-preset=\"editorial\"] h1 { font-size: 1.72rem; font-weight: 600; }\n html[data-preset=\"editorial\"] .pulse-dot {\n width: 9px;\n height: 9px;\n border: 1px solid var(--arrow-emphasis);\n border-radius: 0;\n background: var(--arrow-emphasis);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);\n transform: rotate(45deg);\n animation: none;\n }\n html[data-preset=\"editorial\"] .header-row::after {\n content: attr(data-preset-badge-editorial);\n flex: none;\n margin-left: 0.25rem;\n padding: 0.32rem 0 0.24rem;\n border-bottom: 2px solid var(--arrow-emphasis);\n color: var(--arrow-emphasis);\n font-family: Georgia, 'Times New Roman', serif;\n font-size: 0.625rem;\n font-style: italic;\n font-weight: 600;\n letter-spacing: 0.08em;\n white-space: nowrap;\n }\n\n .diagram-container {\n --archify-nav-reserve: 0px;\n background: var(--panel);\n border-radius: 1rem;\n border: 1px solid var(--panel-border);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);\n padding: 1.5rem;\n padding-bottom: calc(1.5rem + var(--archify-nav-reserve));\n overflow: hidden;\n position: relative;\n }\n\n html[data-preset=\"signal-flow\"] .diagram-container {\n position: relative;\n overflow: hidden;\n background: linear-gradient(180deg, rgba(8, 20, 38, 0.82), rgba(3, 8, 18, 0.94));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.34);\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] .diagram-container {\n background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 246, 250, 0.94));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 60px rgba(45, 78, 99, 0.12);\n }\n html[data-preset=\"blueprint\"] .diagram-container {\n border-color: var(--panel-border);\n border-radius: 0.35rem;\n background: var(--panel);\n box-shadow:\n inset 0 0 0 1px color-mix(in srgb, var(--panel-border) 34%, transparent),\n 0 18px 48px rgba(0, 0, 0, 0.16);\n }\n html[data-preset=\"blueprint\"] .diagram-container::after {\n content: \"\";\n position: absolute;\n z-index: 10;\n inset: 0.7rem;\n pointer-events: none;\n background:\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1px 1.35rem no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1.35rem 1px no-repeat,\n linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1px 1.35rem no-repeat;\n opacity: 0.58;\n }\n html[data-preset=\"editorial\"] .diagram-container {\n overflow: hidden;\n border-color: var(--panel-border);\n border-radius: 0.38rem;\n background:\n linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 12%),\n var(--panel);\n box-shadow:\n 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent),\n 0 18px 48px color-mix(in srgb, #000 19%, transparent);\n }\n html[data-preset=\"editorial\"] .diagram-container::after {\n position: absolute;\n z-index: 10;\n top: 0.72rem;\n right: 1.25rem;\n padding: 0.2rem 0.52rem;\n border: 1px solid var(--panel-border);\n background: var(--panel);\n color: var(--arrow-emphasis);\n content: attr(data-preset-badge-editorial-plate);\n font-family: Georgia, 'Times New Roman', serif;\n font-size: 0.52rem;\n font-style: italic;\n font-weight: 600;\n letter-spacing: 0.09em;\n pointer-events: none;\n }\n html[data-embed=\"true\"][data-preset=\"editorial\"] .diagram-container::after { display: none; }\n html[data-motion-capable=\"true\"][data-preset=\"signal-flow\"][data-ambient-motion=\"running\"] .diagram-container::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n background: linear-gradient(115deg, transparent 28%, rgba(103, 232, 249, 0.035) 48%, transparent 68%);\n transform: translateX(-70%);\n animation: archify-signal-scan 4.8s ease-in-out 1 both;\n }\n\n /* Motion Governor gives the reader a real static state and gives the\n strongest semantic action the only motion budget. Atmosphere resets to\n its authored base instead of freezing mid-cycle. Static artifacts never\n start a decorative pulse or scan. */\n html:not([data-motion-capable=\"true\"]) svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n }\n html:not([data-motion-capable=\"true\"]) svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n }\n html[data-motion=\"still\"] .pulse-dot,\n html[data-motion=\"still\"] .diagram-container::before,\n html[data-motion=\"still\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-motion-owner] .pulse-dot,\n html[data-motion-owner] .diagram-container::before,\n html[data-motion-owner] svg[data-animation=\"trace\"] [data-animate],\n html[data-embed=\"true\"] .pulse-dot,\n html[data-embed=\"true\"] .diagram-container::before,\n html[data-share-playback=\"true\"] .pulse-dot,\n html[data-share-playback=\"true\"] .diagram-container::before,\n html[data-document-hidden=\"true\"] .pulse-dot,\n html[data-document-hidden=\"true\"] .diagram-container::before,\n html[data-document-hidden=\"true\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-motion=\"still\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-motion-owner] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-document-hidden=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n }\n html[data-motion=\"still\"] .diagram-container::before,\n html[data-motion-owner] .diagram-container::before,\n html[data-embed=\"true\"] .diagram-container::before,\n html[data-share-playback=\"true\"] .diagram-container::before {\n opacity: 0;\n }\n html[data-motion=\"still\"] .intent-trace-flow,\n html[data-motion=\"still\"] .route-probe-flow,\n html[data-motion=\"still\"] .route-journey-flow,\n html[data-motion=\"still\"] .semantic-lens-flow,\n html[data-motion=\"still\"] .diagram-guide,\n html[data-motion=\"still\"] .overview-map-live,\n html[data-document-hidden=\"true\"] .intent-trace-flow,\n html[data-document-hidden=\"true\"] .route-probe-flow,\n html[data-document-hidden=\"true\"] .route-journey-flow,\n html[data-document-hidden=\"true\"] .semantic-lens-flow,\n html[data-document-hidden=\"true\"] .diagram-guide,\n html[data-document-hidden=\"true\"] .overview-map-live {\n animation: none !important;\n }\n\n html[data-motion=\"still\"] .intent-trace-flow,\n html[data-motion=\"still\"] .route-probe-flow {\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.72;\n }\n html[data-motion=\"still\"] .route-journey-overlay,\n html[data-document-hidden=\"true\"] .route-journey-overlay { display: none !important; }\n html[data-motion=\"still\"] .relationship-pulse-overlay { display: none !important; }\n\n html[data-motion=\"still\"] svg [data-node-id],\n html[data-motion=\"still\"] svg [data-edge-from],\n html[data-motion=\"still\"] svg [data-detail],\n html[data-motion=\"still\"] svg [data-detail-anchor],\n html[data-motion=\"still\"] svg [data-legend-hit],\n html[data-motion=\"still\"] svg {\n transition: none !important;\n }\n\n svg {\n font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;\n width: 100%;\n min-width: min(900px, 100%);\n display: block;\n transform-origin: 0 0;\n transition: transform 0.18s ease;\n }\n\n .diagram-container.is-camera-moving svg {\n transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);\n }\n .diagram-container.is-camera-transaction svg { transition: none; }\n .diagram-container.is-pannable { cursor: grab; }\n .diagram-container.is-panning { cursor: grabbing; user-select: none; }\n .diagram-container.is-panning svg { transition: none; }\n\n .diagram-nav {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n z-index: 12;\n translate: 0 calc(-1 * var(--archify-dock-lift, 0px));\n display: inline-flex;\n align-items: center;\n max-width: calc(100% - 2rem);\n padding: 0.25rem;\n gap: 0.0625rem;\n overflow-x: auto;\n border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);\n border-radius: 0.75rem;\n background: color-mix(in srgb, var(--panel) 84%, transparent);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);\n backdrop-filter: blur(14px) saturate(1.2);\n scrollbar-width: none;\n }\n .diagram-nav::-webkit-scrollbar { display: none; }\n .diagram-nav button,\n .focus-chip button {\n border: 0;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n cursor: pointer;\n }\n .diagram-nav button {\n min-width: 2rem;\n height: 2rem;\n padding: 0 0.4rem;\n border-radius: 0.5rem;\n color: var(--text-muted);\n font-size: 0.75rem;\n font-weight: 500;\n letter-spacing: 0;\n transition: background 0.15s, color 0.15s;\n }\n .diagram-nav button:hover,\n .diagram-nav button:focus-visible {\n color: var(--text);\n background: color-mix(in srgb, var(--text) 6%, transparent);\n }\n .diagram-nav button:hover,\n .diagram-nav button:focus-visible,\n .focus-chip button:hover,\n .focus-chip button:focus-visible { background: var(--toolbar-hover); }\n .diagram-nav button:focus-visible,\n .focus-chip button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .diagram-nav button:disabled { opacity: 0.38; cursor: default; }\n /* The Guide stays on the ? shortcut; Map only earns dock space once the\n reader has zoomed past the full diagram (or opened it from the keyboard). */\n .diagram-nav button[hidden] { display: none; }\n .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }\n .diagram-nav button:disabled:hover { background: transparent; }\n .diagram-nav #btn-route-probe,\n .diagram-nav #btn-overview-map,\n .diagram-nav #btn-semantic-lens {\n min-width: auto;\n padding-inline: 0.6rem;\n color: var(--text-muted);\n font-weight: 500;\n }\n .diagram-nav #btn-node-finder,\n .diagram-nav [data-view=\"out\"] {\n position: relative;\n margin-left: 0.375rem;\n }\n .diagram-nav #btn-node-finder::before,\n .diagram-nav [data-view=\"out\"]::before {\n position: absolute;\n top: 0.55rem;\n bottom: 0.55rem;\n left: -0.19rem;\n width: 1px;\n background: color-mix(in srgb, var(--panel-border) 90%, transparent);\n content: \"\";\n pointer-events: none;\n }\n .diagram-nav-icon {\n display: block;\n width: 0.875rem;\n height: 0.875rem;\n margin: auto;\n background: currentColor;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .diagram-nav-icon.find {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.guide {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.minus {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav-icon.plus {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .diagram-nav [data-view=\"reset\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.2rem;\n min-width: 3.1rem;\n padding-inline: 0.35rem;\n }\n .diagram-nav [data-view=\"reset\"][data-detail-visible] {\n min-width: 3.8rem;\n }\n .diagram-nav-detail {\n color: color-mix(in srgb, var(--toolbar-text) 52%, transparent);\n font-size: 0.44rem;\n font-weight: 700;\n line-height: 1;\n letter-spacing: 0.07em;\n }\n .diagram-nav-percent {\n color: var(--text-muted);\n font-size: 0.75rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n line-height: 1;\n }\n /* Mode buttons carry a small glyph so the dock reads as one icon language. */\n .diagram-nav #btn-route-probe,\n .diagram-nav #btn-overview-map,\n .diagram-nav #btn-semantic-lens {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n padding-inline: 0.55rem 0.65rem;\n }\n .diagram-nav #btn-route-probe::before,\n .diagram-nav #btn-overview-map::before,\n .diagram-nav #btn-semantic-lens::before {\n flex: none;\n width: 0.875rem;\n height: 0.875rem;\n background: currentColor;\n content: \"\";\n opacity: 0.85;\n -webkit-mask: var(--nav-glyph) center / contain no-repeat;\n mask: var(--nav-glyph) center / contain no-repeat;\n }\n .diagram-nav #btn-route-probe { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E\"); }\n .diagram-nav #btn-overview-map { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E\"); }\n .diagram-nav #btn-semantic-lens { --nav-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E\"); }\n /* Zoom out / level / zoom in join into one stepper well. */\n .diagram-nav [data-view=\"out\"],\n .diagram-nav [data-view=\"reset\"],\n .diagram-nav [data-view=\"in\"] {\n border-radius: 0;\n background: color-mix(in srgb, var(--text) 4.5%, transparent);\n }\n .diagram-nav [data-view=\"out\"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }\n .diagram-nav [data-view=\"out\"]::before { display: none; }\n .diagram-nav [data-view=\"reset\"],\n .diagram-nav [data-view=\"in\"] { margin-left: -0.0625rem; }\n .diagram-nav [data-view=\"in\"] { border-radius: 0 0.5rem 0.5rem 0; }\n .diagram-nav [data-view=\"out\"]:hover,\n .diagram-nav [data-view=\"reset\"]:hover,\n .diagram-nav [data-view=\"in\"]:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }\n .diagram-nav [data-view=\"out\"]:disabled,\n .diagram-nav [data-view=\"in\"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }\n .diagram-nav [data-view=\"out\"]:disabled:hover,\n .diagram-nav [data-view=\"in\"]:disabled:hover { background: color-mix(in srgb, var(--text) 4.5%, transparent); }\n .diagram-nav [data-view=\"reset\"] { min-width: 3.25rem; }\n .diagram-container[data-camera-indicator=\"true\"] .diagram-nav-detail,\n .diagram-container[data-camera-indicator=\"true\"] .diagram-nav-percent { color: var(--frontend-stroke); }\n .diagram-nav #btn-diagram-guide[aria-expanded=\"true\"] {\n color: var(--cloud-stroke);\n background: var(--toolbar-hover);\n }\n\n /* Semantic Radar is a deliberately simplified, viewer-only overview. It\n uses authored node bounds and the live camera viewport rather than\n cloning the canonical SVG, so IDs, filters, animation, and export state\n stay singular and deterministic. */\n .overview-map {\n position: absolute;\n right: 1rem;\n bottom: calc(4.15rem + var(--archify-nav-reserve));\n z-index: 12;\n width: 11.25rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));\n border-radius: 0.78rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.625rem;\n }\n .overview-map[hidden] { display: none; }\n .overview-map[data-docked=\"true\"] {\n position: fixed;\n right: var(--archify-radar-right, 1rem);\n top: var(--archify-radar-top, 1rem);\n bottom: auto;\n }\n .overview-map[data-docked=\"true\"][data-dock-side=\"left\"] {\n right: auto;\n left: var(--archify-radar-left, 1rem);\n }\n html[data-preset=\"blueprint\"] .overview-map { border-radius: 0.28rem; }\n .overview-map-head {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.45rem;\n min-height: 2.25rem;\n padding: 0.42rem 0.48rem 0.38rem 0.55rem;\n border-bottom: 1px solid var(--toolbar-border);\n background: linear-gradient(110deg, color-mix(in srgb, var(--frontend-fill) 45%, transparent), transparent 68%);\n cursor: grab;\n touch-action: none;\n user-select: none;\n }\n .overview-map[data-panel-dragging=\"true\"] .overview-map-head { cursor: grabbing; }\n .overview-map[data-placement-invalid=\"true\"] {\n border-color: var(--security-stroke);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--security-stroke) 34%, transparent), 0 16px 42px rgba(0, 0, 0, 0.3);\n }\n .overview-map[data-compact=\"true\"] {\n width: 7.4rem;\n }\n .overview-map[data-compact=\"true\"] .overview-map-head {\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.24rem;\n min-height: 1.5rem;\n padding: 0.05rem 0.16rem 0.05rem 0.32rem;\n border-bottom: 0;\n }\n .overview-map[data-compact=\"true\"] .overview-map-live,\n .overview-map[data-compact=\"true\"] .overview-map-copy,\n .overview-map[data-compact=\"true\"] .overview-map-surface,\n .overview-map[data-compact=\"true\"] .overview-map-hint {\n display: none;\n }\n .overview-map[data-compact=\"true\"] .overview-map-expand { display: inline-flex; }\n .overview-map[data-compact=\"true\"] .overview-map-close {\n width: 1.15rem;\n height: 1.15rem;\n font-size: 0.72rem;\n }\n .overview-map-live {\n width: 0.42rem;\n height: 0.42rem;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent);\n animation: archify-radar-live 2.4s ease-out infinite;\n }\n .overview-map-copy { min-width: 0; line-height: 1.1; }\n .overview-map-copy strong {\n display: block;\n overflow: hidden;\n color: var(--frontend-stroke);\n font-size: 0.59rem;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .overview-map-copy small {\n display: block;\n margin-top: 0.18rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.52rem;\n letter-spacing: 0.04em;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .overview-map-expand {\n display: none;\n align-items: center;\n justify-content: center;\n min-width: 0;\n height: 1.2rem;\n padding: 0 0.34rem;\n overflow: hidden;\n border: 0;\n border-radius: 0.3rem;\n background: transparent;\n color: var(--frontend-stroke);\n font: inherit;\n font-size: 0.49rem;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n white-space: nowrap;\n cursor: pointer;\n }\n .overview-map-close {\n width: 1.55rem;\n height: 1.55rem;\n padding: 0;\n border: 0;\n border-radius: 0.34rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n .overview-map-expand:hover,\n .overview-map-expand:focus-visible,\n .overview-map-close:hover,\n .overview-map-close:focus-visible { background: var(--toolbar-hover); }\n .overview-map-expand:focus-visible,\n .overview-map-close:focus-visible,\n .overview-map-surface:focus-visible,\n .overview-map-node:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .overview-map-surface {\n position: relative;\n height: 7rem;\n margin: 0.42rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--panel-border) 72%, transparent);\n border-radius: 0.42rem;\n background:\n linear-gradient(color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),\n linear-gradient(90deg, color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),\n color-mix(in srgb, var(--bg) 86%, transparent);\n background-size: 12px 12px;\n cursor: crosshair;\n touch-action: none;\n }\n html[data-preset=\"blueprint\"] .overview-map-surface { border-radius: 0.1rem; }\n .overview-map-surface \u003e svg {\n width: 100%;\n height: 100%;\n min-width: 0;\n transform: none !important;\n transition: none !important;\n display: block;\n overflow: visible;\n }\n .overview-map-node {\n fill: var(--backend-stroke);\n fill-opacity: 0.52;\n stroke: var(--backend-stroke);\n stroke-opacity: 0.86;\n vector-effect: non-scaling-stroke;\n cursor: pointer;\n transition: fill-opacity 140ms ease, stroke-width 140ms ease, filter 140ms ease;\n }\n .overview-map-node[data-kind=\"frontend\"],\n .overview-map-node[data-kind=\"start\"] { fill: var(--frontend-stroke); stroke: var(--frontend-stroke); }\n .overview-map-node[data-kind=\"database\"],\n .overview-map-node[data-kind=\"success\"] { fill: var(--database-stroke); stroke: var(--database-stroke); }\n .overview-map-node[data-kind=\"cloud\"],\n .overview-map-node[data-kind=\"waiting\"] { fill: var(--cloud-stroke); stroke: var(--cloud-stroke); }\n .overview-map-node[data-kind=\"messagebus\"] { fill: var(--messagebus-stroke); stroke: var(--messagebus-stroke); }\n .overview-map-node[data-kind=\"security\"],\n .overview-map-node[data-kind=\"decision\"],\n .overview-map-node[data-kind=\"failure\"] { fill: var(--security-stroke); stroke: var(--security-stroke); }\n .overview-map-node[data-kind=\"external\"],\n .overview-map-node[data-kind=\"neutral\"] { fill: var(--external-stroke); stroke: var(--external-stroke); }\n .overview-map-node[data-radar-active=\"true\"],\n .overview-map-node:hover,\n .overview-map-node:focus-visible {\n fill-opacity: 0.92;\n stroke-width: 2.2;\n filter: drop-shadow(0 0 3px currentColor);\n }\n .overview-map-viewport {\n fill: color-mix(in srgb, var(--frontend-fill) 56%, transparent);\n stroke: var(--frontend-stroke);\n stroke-width: 2;\n vector-effect: non-scaling-stroke;\n pointer-events: none;\n filter: drop-shadow(0 0 3px color-mix(in srgb, var(--frontend-stroke) 54%, transparent));\n }\n .overview-map-hint {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0 0.52rem 0.46rem;\n color: var(--text-faint);\n font-size: 0.49rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n }\n .diagram-nav #btn-overview-map[aria-expanded=\"true\"] {\n color: var(--frontend-stroke);\n background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);\n }\n .overview-map-feedback {\n position: absolute;\n right: 1rem;\n bottom: 4.15rem;\n z-index: 13;\n max-width: min(16rem, calc(100% - 2rem));\n padding: 0.38rem 0.55rem;\n border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));\n border-radius: 0.5rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n font-size: 0.52rem;\n line-height: 1.35;\n pointer-events: none;\n }\n .overview-map-feedback[hidden] { display: none; }\n .focus-chip[data-radar-yielded=\"true\"] { display: none !important; }\n .diagram-nav #btn-route-probe[aria-pressed=\"true\"] {\n color: var(--backend-stroke);\n background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);\n }\n .diagram-nav #btn-semantic-lens[aria-expanded=\"true\"],\n .diagram-nav #btn-semantic-lens[aria-pressed=\"true\"] {\n color: var(--database-stroke);\n background: color-mix(in srgb, var(--database-stroke) 11%, transparent);\n }\n\n /* Semantic Lens turns the compiled node-kind palette into an analytical\n legend. One kind reveals its real traffic; two kinds compare only their\n direct authored relationships. Geometry and the canonical SVG stay put. */\n .semantic-lens {\n position: absolute;\n right: 1rem;\n bottom: calc(4.15rem + var(--archify-nav-reserve));\n z-index: 24;\n width: min(20rem, calc(100% - 2rem));\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--database-stroke) 58%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(135deg, color-mix(in srgb, var(--database-fill) 34%, transparent), transparent 48%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);\n backdrop-filter: blur(18px);\n animation: archify-lens-in 180ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n .semantic-lens[hidden] { display: none; }\n .semantic-lens[data-dock-side=\"left\"] { left: 1rem; right: auto; }\n .semantic-lens[data-dock-side=\"right\"] { left: auto; right: 1rem; }\n html[data-preset=\"blueprint\"] .semantic-lens { border-radius: 0.28rem; }\n .semantic-lens-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.75rem;\n padding: 0.72rem 0.78rem 0.62rem;\n border-bottom: 1px solid var(--toolbar-border);\n }\n .semantic-lens-eyebrow {\n display: block;\n color: var(--database-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.16em;\n text-transform: uppercase;\n }\n .semantic-lens-title {\n display: block;\n margin-top: 0.16rem;\n color: var(--text);\n font-size: 0.82rem;\n letter-spacing: -0.02em;\n }\n .semantic-lens-close {\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .semantic-lens-close:hover,\n .semantic-lens-close:focus-visible { background: var(--toolbar-hover); }\n .semantic-lens-instruction {\n margin: 0;\n padding: 0.52rem 0.78rem 0.48rem;\n color: var(--text-faint);\n font-size: 0.55rem;\n line-height: 1.45;\n }\n .semantic-lens-kinds {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.3rem;\n max-height: min(15rem, 40vh);\n padding: 0 0.5rem 0.5rem;\n overflow-y: auto;\n scrollbar-width: thin;\n }\n .semantic-lens-kind {\n --lens-color: var(--external-stroke);\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.42rem;\n min-width: 0;\n min-height: 2.15rem;\n padding: 0.35rem 0.42rem;\n border: 1px solid color-mix(in srgb, var(--lens-color) 24%, var(--toolbar-border));\n border-radius: 0.45rem;\n background: color-mix(in srgb, var(--panel) 76%, transparent);\n color: var(--toolbar-text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;\n }\n html[data-preset=\"blueprint\"] .semantic-lens-kind { border-radius: 0.12rem; }\n .semantic-lens-kind[data-kind=\"frontend\"],\n .semantic-lens-kind[data-kind=\"start\"] { --lens-color: var(--frontend-stroke); }\n .semantic-lens-kind[data-kind=\"backend\"],\n .semantic-lens-kind[data-kind=\"active\"] { --lens-color: var(--backend-stroke); }\n .semantic-lens-kind[data-kind=\"database\"],\n .semantic-lens-kind[data-kind=\"success\"] { --lens-color: var(--database-stroke); }\n .semantic-lens-kind[data-kind=\"cloud\"],\n .semantic-lens-kind[data-kind=\"waiting\"] { --lens-color: var(--cloud-stroke); }\n .semantic-lens-kind[data-kind=\"messagebus\"] { --lens-color: var(--messagebus-stroke); }\n .semantic-lens-kind[data-kind=\"security\"],\n .semantic-lens-kind[data-kind=\"decision\"],\n .semantic-lens-kind[data-kind=\"failure\"] { --lens-color: var(--security-stroke); }\n .semantic-lens-kind:hover,\n .semantic-lens-kind:focus-visible,\n .semantic-lens-kind[aria-pressed=\"true\"] {\n border-color: color-mix(in srgb, var(--lens-color) 78%, var(--toolbar-border));\n background: color-mix(in srgb, var(--lens-color) 11%, var(--panel));\n }\n .semantic-lens-kind:focus-visible,\n .semantic-lens-close:focus-visible,\n .semantic-lens-actions button:focus-visible {\n outline: 2px solid var(--database-stroke);\n outline-offset: 1px;\n }\n .semantic-lens-kind:disabled { opacity: 0.34; cursor: default; }\n .semantic-lens-swatch {\n width: 0.48rem;\n height: 0.48rem;\n border-radius: 50%;\n background: var(--lens-color);\n box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color) 58%, transparent);\n }\n .semantic-lens-kind strong {\n overflow: hidden;\n color: var(--text);\n font-size: 0.61rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-lens-kind em {\n color: var(--lens-color);\n font-size: 0.54rem;\n font-style: normal;\n font-weight: 800;\n }\n .semantic-lens-status {\n min-height: 2.5rem;\n margin: 0;\n padding: 0.55rem 0.78rem;\n border-top: 1px solid var(--toolbar-border);\n color: var(--text-faint);\n font-size: 0.55rem;\n line-height: 1.45;\n }\n .semantic-lens-status strong { color: var(--database-stroke); font-weight: 800; }\n .semantic-lens-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.28rem;\n padding: 0 0.62rem 0.62rem;\n }\n .semantic-lens-actions button {\n min-height: 1.8rem;\n padding: 0.28rem 0.48rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 0.56rem;\n cursor: pointer;\n }\n .semantic-lens-actions button:hover { background: var(--toolbar-hover); }\n .semantic-lens-actions #semantic-lens-copy { color: var(--database-stroke); }\n @keyframes archify-lens-in {\n from { opacity: 0; transform: translateY(5px) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n\n /* Route Probe answers a reader question over the compiled semantic graph:\n choose two stable nodes and reveal the shortest authored directed route.\n The receipt and signal live entirely in the viewer layer. */\n .route-probe {\n position: absolute;\n left: 1rem;\n bottom: calc(1rem + var(--archify-nav-reserve));\n z-index: 12;\n width: min(46rem, calc(100% - 25rem));\n min-width: 18rem;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 62%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(115deg, color-mix(in srgb, var(--backend-fill) 50%, transparent), transparent 62%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.75rem;\n }\n .route-probe[hidden] { display: none; }\n /* Picking needs one line of guidance, not a wide empty card; the panel\n widens only when there is a traced route to show. */\n .route-probe:not([data-state=\"result\"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }\n .route-probe-path:has(\u003e .route-probe-placeholder:only-child) { display: none; }\n .route-probe[data-route-dock=\"top\"] {\n top: 1rem;\n bottom: auto;\n }\n html[data-preset=\"blueprint\"] .route-probe { border-radius: 0.25rem; }\n .route-probe-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.65rem;\n padding: 0.625rem 0.75rem 0.5rem;\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);\n }\n .route-probe-copy { min-width: 0; }\n .route-probe-eyebrow {\n display: block;\n color: var(--backend-stroke);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n }\n .route-probe-title {\n display: block;\n margin-top: 0.14rem;\n overflow: hidden;\n color: var(--toolbar-text);\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .route-probe-actions { display: flex; gap: 0.2rem; }\n .route-probe button {\n min-height: 1.55rem;\n padding: 0.25rem 0.42rem;\n border: 0;\n border-radius: 0.36rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n cursor: pointer;\n }\n .route-probe button:hover,\n .route-probe button:focus-visible { background: var(--toolbar-hover); }\n .route-probe button:focus-visible {\n outline: 2px solid var(--backend-stroke);\n outline-offset: 1px;\n }\n .route-probe-copy-link { color: var(--frontend-stroke) !important; }\n .route-probe-find { color: var(--backend-stroke) !important; }\n .route-probe-copy-link[hidden] { display: none; }\n .route-probe-find[hidden] { display: none; }\n .route-probe-path {\n display: flex;\n align-items: center;\n min-height: 2.2rem;\n padding: 0.42rem 0.58rem 0.24rem;\n overflow-x: auto;\n scrollbar-width: thin;\n white-space: nowrap;\n }\n .route-probe-node,\n .route-probe button.route-probe-node {\n flex: none;\n max-width: 9.5rem;\n overflow: hidden;\n min-height: 1.75rem !important;\n padding: 0.22rem 0.38rem;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 46%, var(--toolbar-border));\n border-radius: 999px;\n background: color-mix(in srgb, var(--backend-fill) 52%, transparent);\n color: var(--text);\n font-size: 0.56rem;\n font-weight: 700;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .route-probe-node[data-endpoint=\"start\"] {\n border-color: var(--frontend-stroke);\n color: var(--frontend-stroke);\n }\n .route-probe-node[data-endpoint=\"end\"] {\n border-color: var(--security-stroke);\n color: var(--security-stroke);\n }\n .route-probe-node[data-route-journey-state=\"past\"] { opacity: 0.66; }\n .route-probe-node[data-route-journey-state=\"future\"] { opacity: 0.48; }\n .route-probe-node[aria-current=\"step\"] {\n border-color: var(--backend-stroke);\n background: color-mix(in srgb, var(--backend-fill) 82%, var(--toolbar-menu-bg));\n color: var(--text);\n box-shadow: 0 0 0 1px color-mix(in srgb, var(--backend-stroke) 42%, transparent), 0 0 14px color-mix(in srgb, var(--backend-stroke) 34%, transparent);\n opacity: 1;\n }\n html[data-preset=\"blueprint\"] .route-probe-node[aria-current=\"step\"] {\n border-style: double;\n border-width: 3px;\n border-radius: 0.2rem;\n box-shadow: none;\n }\n .route-probe-arrow {\n flex: none;\n padding: 0 0.28rem;\n color: var(--text-faint);\n font-size: 0.65rem;\n }\n .route-probe-placeholder {\n color: var(--text-faint);\n font-size: 0.75rem;\n }\n .route-probe-status {\n display: block;\n min-height: 1.45rem;\n padding: 0.5rem 0.75rem 0.625rem;\n color: var(--text-muted, var(--text-faint));\n font-size: 0.75rem;\n line-height: 1.45;\n }\n .route-journey-controls {\n display: grid;\n grid-template-columns: 2rem minmax(5.8rem, auto) 2rem minmax(4.8rem, auto);\n justify-content: start;\n gap: 0.22rem;\n padding: 0.08rem 0.58rem 0.28rem;\n }\n .route-journey-controls[hidden] { display: none; }\n .route-journey-controls button {\n min-height: 1.8rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);\n background: color-mix(in srgb, var(--toolbar-bg) 72%, transparent);\n font-size: 0.54rem;\n font-weight: 700;\n }\n .route-journey-controls button:disabled {\n cursor: default;\n opacity: 0.34;\n }\n .route-journey-play { color: var(--backend-stroke) !important; }\n .route-journey-overview { color: var(--frontend-stroke) !important; }\n .route-journey-controls[data-playing=\"true\"] .route-journey-play {\n border-color: color-mix(in srgb, var(--backend-stroke) 64%, var(--toolbar-border));\n background: color-mix(in srgb, var(--backend-fill) 62%, transparent);\n }\n .route-probe[data-state=\"error\"] {\n border-color: color-mix(in srgb, var(--security-stroke) 72%, var(--toolbar-border));\n }\n .route-probe[data-state=\"error\"] .route-probe-status { color: var(--security-stroke); }\n\n .focus-chip {\n position: absolute;\n left: 1rem;\n top: 1rem;\n z-index: 12;\n display: block;\n width: min(22rem, calc(100% - 13rem));\n max-width: calc(100% - 13rem);\n overflow: hidden;\n border: 1px solid var(--frontend-stroke);\n border-radius: 0.85rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);\n backdrop-filter: blur(16px);\n font-size: 0.6875rem;\n }\n .focus-chip[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .focus-chip { border-radius: 0.3rem; }\n .focus-chip button {\n flex: none;\n padding: 0.3rem 0.45rem;\n border-radius: 0.35rem;\n font-size: 0.625rem;\n }\n .relationship-lens-head {\n position: relative;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 0.75rem;\n padding: 0.9rem 0.75rem 0.65rem;\n border-bottom: 1px solid var(--toolbar-border);\n background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);\n }\n .relationship-lens-drag-handle {\n position: absolute;\n top: 0.12rem;\n left: 50%;\n width: 2.5rem;\n height: 0.78rem;\n padding: 0 !important;\n transform: translateX(-50%);\n color: var(--text-faint) !important;\n cursor: grab;\n touch-action: none;\n user-select: none;\n }\n .relationship-lens-drag-handle::before {\n content: \"\";\n display: block;\n width: 1.25rem;\n margin: auto;\n border-top: 2px dotted currentColor;\n opacity: 0.72;\n }\n .focus-chip[data-panel-dragging=\"true\"] .relationship-lens-drag-handle { cursor: grabbing; }\n @media (hover: none), (pointer: coarse) {\n .relationship-lens-drag-handle { display: none; }\n }\n .relationship-lens-copy { min-width: 0; }\n .relationship-lens-actions {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.18rem;\n }\n .relationship-lens-actions button { white-space: nowrap; }\n .relationship-lens-actions #btn-focus-clear {\n display: grid;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n place-items: center;\n color: var(--text-muted);\n font-size: 1rem;\n line-height: 1;\n }\n .relationship-lens-actions #btn-focus-clear:hover,\n .relationship-lens-actions #btn-focus-clear:focus-visible {\n background: var(--toolbar-hover);\n color: var(--text);\n }\n .relationship-lens-actions #btn-focus-copy { color: var(--frontend-stroke); }\n .relationship-lens-actions #btn-focus-relations { display: none; }\n .relationship-lens-eyebrow {\n display: block;\n margin-bottom: 0.18rem;\n color: var(--frontend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.14em;\n text-transform: uppercase;\n }\n .relationship-lens-title {\n display: block;\n overflow: hidden;\n color: var(--text);\n font-size: 0.8rem;\n line-height: 1.35;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-detail {\n display: block;\n margin-top: 0.12rem;\n overflow: hidden;\n color: var(--text-muted);\n font-size: 0.625rem;\n line-height: 1.4;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-detail[hidden] { display: none; }\n .semantic-passport-meta {\n display: flex;\n flex-wrap: wrap;\n gap: 0.24rem;\n margin-top: 0.42rem;\n }\n .semantic-passport-meta span,\n .semantic-passport-meta code {\n max-width: 100%;\n overflow: hidden;\n padding: 0.14rem 0.34rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 82%, transparent);\n border-radius: 999px;\n background: color-mix(in srgb, var(--panel) 68%, transparent);\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5rem;\n letter-spacing: 0.04em;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-meta [data-passport=\"kind\"] {\n border-color: color-mix(in srgb, var(--frontend-stroke) 50%, var(--toolbar-border));\n color: var(--frontend-stroke);\n font-weight: 800;\n text-transform: uppercase;\n }\n .semantic-passport-meta [data-passport=\"tag\"] { color: var(--cloud-stroke); }\n .semantic-passport-meta [data-passport=\"brand\"] {\n border-color: color-mix(in srgb, var(--messagebus-stroke) 52%, var(--toolbar-border));\n color: var(--messagebus-stroke);\n font-weight: 700;\n }\n .semantic-passport-meta [hidden] { display: none; }\n html[data-preset=\"blueprint\"] .semantic-passport-meta span,\n html[data-preset=\"blueprint\"] .semantic-passport-meta code { border-radius: 0.1rem; }\n .semantic-passport-evidence {\n margin-top: 0.52rem;\n padding: 0.5rem;\n border: 1px solid color-mix(in srgb, var(--backend-stroke) 32%, var(--toolbar-border));\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--backend-fill) 18%, var(--panel));\n }\n .semantic-passport-evidence[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .semantic-passport-evidence { border-radius: 0.18rem; }\n .semantic-passport-evidence-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.55rem;\n margin-bottom: 0.35rem;\n }\n .semantic-passport-evidence-status {\n display: inline-flex;\n align-items: center;\n gap: 0.28rem;\n color: var(--backend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n }\n .semantic-passport-evidence-status::before {\n content: '';\n width: 0.38rem;\n height: 0.38rem;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--backend-stroke) 14%, transparent);\n }\n .semantic-passport-repository {\n min-width: 0;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n text-decoration: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-repository:hover,\n .semantic-passport-repository:focus-visible { color: var(--backend-stroke); }\n .semantic-passport-evidence-links { display: grid; gap: 0.22rem; }\n .semantic-passport-source {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.15rem 0.45rem;\n align-items: center;\n padding: 0.34rem 0.4rem;\n border: 1px solid transparent;\n border-radius: 0.38rem;\n color: var(--text-muted);\n text-decoration: none;\n }\n a.semantic-passport-source:hover,\n a.semantic-passport-source:focus-visible {\n border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);\n background: color-mix(in srgb, var(--backend-fill) 32%, transparent);\n color: var(--text);\n }\n .semantic-passport-source strong {\n overflow: hidden;\n font-size: 0.5625rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .semantic-passport-source code {\n color: var(--backend-stroke);\n font: inherit;\n font-size: 0.5rem;\n }\n .semantic-passport-source small {\n grid-column: 1 / -1;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-summary {\n display: block;\n margin-top: 0.12rem;\n color: var(--text-faint);\n font-size: 0.5625rem;\n }\n .semantic-passport-reach {\n display: grid;\n gap: 0.28rem;\n margin-top: 0.52rem;\n padding-top: 0.48rem;\n border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);\n }\n .semantic-passport-reach[hidden] { display: none; }\n .semantic-passport-reach-label {\n color: var(--text-faint);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n }\n .semantic-passport-reach-actions {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 0.25rem;\n }\n .semantic-passport-reach-actions button {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n min-width: 0;\n min-height: 2rem;\n padding: 0.32rem 0.42rem;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);\n background: color-mix(in srgb, var(--panel) 70%, transparent);\n color: var(--text-muted);\n text-align: left;\n }\n .semantic-passport-reach-actions button:hover:not(:disabled),\n .semantic-passport-reach-actions button:focus-visible {\n border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));\n color: var(--text);\n }\n .semantic-passport-reach-actions button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: 1px;\n }\n .semantic-passport-reach-actions button:disabled {\n cursor: default;\n opacity: 0.5;\n }\n .semantic-passport-reach-actions button[aria-pressed=\"true\"] {\n border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));\n background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);\n color: var(--text);\n }\n #btn-reach-upstream {\n --reach-color: var(--database-stroke);\n --reach-fill: var(--database-fill);\n }\n #btn-reach-downstream {\n --reach-color: var(--backend-stroke);\n --reach-fill: var(--backend-fill);\n }\n .semantic-passport-reach-actions strong {\n color: var(--reach-color, var(--frontend-stroke));\n font-size: 0.625rem;\n }\n .semantic-passport-reach-status {\n color: var(--text-faint);\n font-size: 0.525rem;\n line-height: 1.4;\n }\n .semantic-passport-reach-status[hidden] { display: none; }\n .relationship-lens-list {\n max-height: min(18rem, 46vh);\n overflow: auto;\n padding: 0.4rem;\n scrollbar-width: thin;\n scrollbar-color: var(--frontend-stroke) transparent;\n }\n .relationship-lens-list::-webkit-scrollbar { width: 4px; }\n .relationship-lens-list::-webkit-scrollbar-thumb {\n border-radius: 999px;\n background: color-mix(in srgb, var(--frontend-stroke) 68%, transparent);\n }\n .relationship-lens-group + .relationship-lens-group { margin-top: 0.35rem; }\n .relationship-lens-group-title {\n display: block;\n padding: 0.24rem 0.38rem 0.16rem;\n color: var(--text-faint);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n }\n .relationship-lens-row {\n display: grid;\n grid-template-columns: 2.1rem minmax(0, 1fr);\n gap: 0.06rem 0.45rem;\n width: 100%;\n padding: 0.45rem 0.5rem !important;\n text-align: left;\n }\n .relationship-lens-row:hover,\n .relationship-lens-row:focus-visible,\n .relationship-lens-row[data-preview-active=\"true\"] {\n background: var(--toolbar-hover);\n box-shadow: inset 2px 0 0 var(--frontend-stroke);\n }\n .relationship-lens-row:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -2px;\n }\n .relationship-lens-direction {\n grid-row: 1 / 3;\n align-self: center;\n color: var(--frontend-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.08em;\n }\n .relationship-lens-row[data-direction=\"in\"] .relationship-lens-direction { color: var(--database-stroke); }\n .relationship-lens-row[data-direction=\"loop\"] .relationship-lens-direction { color: var(--security-stroke); }\n .relationship-lens-row strong {\n overflow: hidden;\n color: var(--text);\n font-size: 0.6875rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-row small {\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5625rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .relationship-lens-empty {\n margin: 0;\n padding: 0.75rem;\n color: var(--text-faint);\n font-size: 0.625rem;\n text-align: center;\n }\n\n /* Diagram Guide keeps the artifact's growing reader vocabulary\n discoverable without widening the permanent control bar. It derives\n honest counts at runtime and delegates every action to an existing\n production interaction instead of creating a second command system. */\n .diagram-guide {\n position: absolute;\n top: 1rem;\n right: 1rem;\n z-index: 26;\n width: min(32rem, calc(100% - 2rem));\n max-height: min(42rem, calc(100% - 2rem));\n overflow: auto;\n border: 1px solid color-mix(in srgb, var(--cloud-stroke) 58%, var(--toolbar-border));\n border-radius: 0.82rem;\n background:\n linear-gradient(135deg, color-mix(in srgb, var(--cloud-fill) 32%, transparent), transparent 42%),\n var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);\n backdrop-filter: blur(18px);\n animation: archify-guide-in 180ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n .diagram-guide[hidden] { display: none; }\n html[data-preset=\"blueprint\"] .diagram-guide { border-radius: 0.28rem; }\n .diagram-guide-head {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: start;\n gap: 1rem;\n padding: 0.82rem 0.9rem 0.68rem;\n border-bottom: 1px solid var(--toolbar-border);\n }\n .diagram-guide-eyebrow {\n display: block;\n color: var(--cloud-stroke);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.16em;\n text-transform: uppercase;\n }\n .diagram-guide-title {\n display: block;\n margin-top: 0.16rem;\n color: var(--text);\n font-size: 0.86rem;\n letter-spacing: -0.02em;\n }\n .diagram-guide-close {\n width: 1.8rem;\n height: 1.8rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .diagram-guide-close:hover,\n .diagram-guide-close:focus-visible { background: var(--toolbar-hover); }\n .diagram-guide-stats {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin: 0;\n padding: 0.54rem 0.9rem;\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);\n color: var(--text-faint);\n font-size: 0.56rem;\n letter-spacing: 0.025em;\n }\n .diagram-guide-stats::before {\n content: '';\n width: 0.42rem;\n height: 0.42rem;\n flex: none;\n border-radius: 50%;\n background: var(--backend-stroke);\n box-shadow: 0 0 10px color-mix(in srgb, var(--backend-stroke) 72%, transparent);\n }\n .diagram-guide-actions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.38rem;\n padding: 0.62rem;\n }\n .diagram-guide-action {\n --guide-accent: var(--frontend-stroke);\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.55rem;\n min-height: 4.15rem;\n padding: 0.55rem 0.58rem;\n border: 1px solid color-mix(in srgb, var(--guide-accent) 22%, var(--toolbar-border));\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n color: var(--toolbar-text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;\n }\n .diagram-guide-action[data-guide-action=\"route\"] { --guide-accent: var(--backend-stroke); }\n .diagram-guide-action[data-guide-action=\"map\"] { --guide-accent: var(--database-stroke); }\n .diagram-guide-action[data-guide-action=\"lens\"] { --guide-accent: var(--messagebus-stroke); }\n\n .diagram-guide-action[data-guide-action=\"present\"] {\n --guide-accent: var(--cloud-stroke);\n }\n .diagram-guide-action:hover,\n .diagram-guide-action:focus-visible {\n border-color: color-mix(in srgb, var(--guide-accent) 76%, var(--toolbar-border));\n background: color-mix(in srgb, var(--guide-accent) 9%, var(--panel));\n transform: translateY(-1px);\n }\n .diagram-guide-action:focus-visible,\n .diagram-guide-close:focus-visible {\n outline: 2px solid var(--cloud-stroke);\n outline-offset: 1px;\n }\n .diagram-guide-action:disabled {\n opacity: 0.42;\n cursor: default;\n transform: none;\n }\n .diagram-guide-index {\n display: grid;\n place-items: center;\n width: 1.65rem;\n height: 1.65rem;\n border: 1px solid color-mix(in srgb, var(--guide-accent) 64%, var(--toolbar-border));\n border-radius: 0.35rem;\n color: var(--guide-accent);\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.06em;\n }\n .diagram-guide-action-copy { min-width: 0; }\n .diagram-guide-action strong {\n display: block;\n overflow: hidden;\n color: var(--text);\n font-size: 0.66rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .diagram-guide-action small {\n display: -webkit-box;\n margin-top: 0.18rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5rem;\n line-height: 1.35;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n .diagram-guide kbd {\n align-self: start;\n min-width: 1.45rem;\n padding: 0.12rem 0.3rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.25rem;\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5rem;\n text-align: center;\n }\n .diagram-guide-shortcuts {\n display: flex;\n flex-wrap: wrap;\n gap: 0.34rem 0.62rem;\n padding: 0.58rem 0.9rem 0.68rem;\n border-top: 1px solid var(--toolbar-border);\n color: var(--text-faint);\n font-size: 0.5rem;\n }\n .diagram-guide-shortcuts span {\n display: inline-flex;\n align-items: center;\n gap: 0.28rem;\n white-space: nowrap;\n }\n .diagram-guide-feedback {\n min-height: 1rem;\n margin: -0.18rem 0.9rem 0.62rem;\n color: var(--security-stroke);\n font-size: 0.5rem;\n }\n .diagram-guide-feedback:empty { display: none; }\n @keyframes archify-guide-in {\n from { opacity: 0; transform: translateY(-5px) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n\n .node-finder {\n position: absolute;\n top: 1rem;\n left: 1rem;\n z-index: 24;\n display: flex;\n flex-direction: column;\n width: min(22rem, calc(100% - 2rem));\n max-height: calc(100% - 2rem);\n overflow: hidden;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.85rem;\n background: var(--toolbar-menu-bg);\n color: var(--toolbar-text);\n box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);\n backdrop-filter: blur(16px);\n }\n .node-finder[hidden] { display: none; }\n .node-finder[data-context=\"route-source\"] {\n border-color: color-mix(in srgb, var(--frontend-stroke) 68%, var(--toolbar-border));\n }\n .node-finder[data-context=\"route-target\"] {\n border-color: color-mix(in srgb, var(--security-stroke) 68%, var(--toolbar-border));\n }\n html[data-preset=\"blueprint\"] .node-finder { border-radius: 0.3rem; }\n .node-finder-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.7rem 0.8rem 0.45rem;\n }\n .node-finder-head strong {\n color: var(--text);\n font-size: 0.6875rem;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n }\n .node-finder[data-context=\"route-source\"] .node-finder-head strong { color: var(--frontend-stroke); }\n .node-finder[data-context=\"route-target\"] .node-finder-head strong { color: var(--security-stroke); }\n .node-finder-close {\n width: 1.75rem;\n height: 1.75rem;\n border: 0;\n border-radius: 0.35rem;\n background: transparent;\n color: var(--toolbar-text);\n font: inherit;\n font-size: 1rem;\n cursor: pointer;\n }\n .node-finder-close:hover,\n .node-finder-close:focus-visible { background: var(--toolbar-hover); }\n .node-finder-close:focus-visible,\n .node-finder-result:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -2px;\n }\n .node-finder-search {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 0.55rem;\n margin: 0 0.55rem 0.55rem;\n padding: 0 0.7rem;\n min-height: 2.6rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n transition: border-color 160ms ease-out, box-shadow 160ms ease-out;\n }\n html[data-preset=\"blueprint\"] .node-finder-search { border-radius: 0.18rem; }\n .node-finder-search \u003e span { color: var(--frontend-stroke); font-size: 0.875rem; }\n .node-finder-search:focus-within {\n border-color: var(--frontend-stroke);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--frontend-stroke) 20%, transparent);\n }\n .node-finder-input {\n appearance: none;\n width: 100%;\n min-width: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: var(--text);\n font: inherit;\n font-size: 0.75rem;\n }\n .node-finder-input:focus-visible { outline: none; }\n .node-finder-input::placeholder { color: var(--text-faint); }\n .node-finder kbd {\n padding: 0.1rem 0.32rem;\n border: 1px solid var(--toolbar-border);\n border-radius: 0.25rem;\n color: var(--text-faint);\n font: inherit;\n font-size: 0.5625rem;\n }\n .node-finder-results {\n display: grid;\n flex: 1 1 auto;\n gap: 0;\n min-height: 0;\n max-height: min(18rem, 48vh);\n margin: 0 0.55rem 0.45rem;\n padding: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n border: 1px solid color-mix(in srgb, var(--toolbar-border) 78%, transparent);\n border-radius: 0.55rem;\n background: color-mix(in srgb, var(--panel) 54%, transparent);\n scroll-padding-block: 0.25rem;\n scrollbar-width: thin;\n }\n html[data-preset=\"blueprint\"] .node-finder-results { border-radius: 0.18rem; }\n .node-finder-result {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 0.2rem 0.75rem;\n width: 100%;\n min-height: 3.25rem;\n padding: 0.58rem 0.65rem;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background-color 160ms ease-out;\n }\n .node-finder-result:not(:last-child) {\n border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 62%, transparent);\n }\n .node-finder-result:hover,\n .node-finder-result:focus-visible {\n position: relative;\n z-index: 1;\n background: color-mix(in srgb, var(--frontend-fill) 48%, var(--toolbar-hover));\n }\n .node-finder-result strong {\n overflow: hidden;\n font-size: 0.75rem;\n line-height: 1.25;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-finder-result small {\n grid-column: 1 / -1;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.5625rem;\n letter-spacing: 0.015em;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-finder-result em {\n align-self: center;\n color: var(--frontend-stroke);\n font-size: 0.625rem;\n font-style: normal;\n }\n .node-finder[data-context^=\"route-\"] .node-finder-result em {\n padding: 0.1rem 0.3rem;\n border: 1px solid color-mix(in srgb, currentColor 52%, transparent);\n border-radius: 999px;\n font-size: 0.5rem;\n font-weight: 800;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n }\n .node-finder[data-context=\"route-target\"] .node-finder-result em { color: var(--security-stroke); }\n .node-finder-empty {\n padding: 1.1rem 0.75rem 1.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n text-align: center;\n }\n .node-finder-status {\n margin: 0;\n padding: 0.1rem 0.8rem 0.65rem;\n color: var(--text-faint);\n font-size: 0.5625rem;\n }\n\n .cards {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));\n gap: 1rem;\n margin-top: 2rem;\n }\n\n .card {\n background: var(--panel);\n border-radius: 0.75rem;\n border: 1px solid var(--panel-border);\n padding: 1.125rem 1.25rem;\n }\n\n html[data-preset=\"signal-flow\"] .card {\n background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);\n }\n html[data-preset=\"signal-flow\"][data-theme=\"light\"] .card {\n background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);\n }\n\n /* Preserve the one-screen guarantee on ordinary laptop displays. The\n high-screen expansion above must not trade a fuller canvas for page\n scrolling at 900–1080px heights. */\n @media (min-width: 768px) and (max-height: 1100px) {\n .header { margin-bottom: 1rem; }\n .diagram-container {\n padding: 0.875rem;\n padding-bottom: calc(0.875rem + var(--archify-nav-reserve));\n }\n .cards { margin-top: 1rem; }\n .card { padding: 1rem; }\n }\n @media (min-width: 768px) and (max-height: 920px) {\n body { padding-block: 1.25rem; }\n body { --archify-page-top: 1.25rem; }\n .header { margin-bottom: 0.875rem; }\n .cards { margin-top: 0.75rem; }\n html[data-nav-stage-rail=\"true\"] body { padding-block: 0.375rem; }\n /* Align the fixed toolbar with the compact title row. Reserve its hit area\n above the guide without taking extra height from a fitted diagram. */\n html[data-nav-stage-rail=\"true\"] .toolbar { top: 0.25rem; }\n html[data-nav-stage-rail=\"true\"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }\n html[data-nav-stage-rail=\"true\"] .diagram-container[data-nav-stage-rail=\"true\"] { padding-top: 0.5rem; }\n html[data-nav-stage-rail=\"true\"] .cards { margin-top: 0.375rem; }\n }\n\n html[data-preset=\"blueprint\"] .card {\n position: relative;\n border-color: var(--panel-border);\n border-radius: 0.3rem;\n background: var(--panel);\n box-shadow: none;\n }\n html[data-preset=\"blueprint\"] .card::before {\n content: \"\";\n position: absolute;\n top: -1px;\n left: 1rem;\n width: 2.5rem;\n border-top: 2px solid var(--frontend-stroke);\n }\n\n html[data-preset=\"editorial\"] .card {\n position: relative;\n border-radius: 0.28rem;\n background: var(--panel);\n box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);\n }\n html[data-preset=\"editorial\"] .card::before {\n position: absolute;\n top: -1px;\n left: 1.25rem;\n width: 3.25rem;\n border-top: 3px solid var(--arrow-emphasis);\n content: \"\";\n }\n html[data-preset=\"editorial\"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }\n\n /* Summary rail: the reader measures the viewport and enables it only when the\n diagram keeps its readable width beside the notes. */\n .reader-rail { display: contents; }\n html[data-reader-rail=\"true\"] .container {\n display: grid;\n grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);\n grid-auto-flow: row dense;\n column-gap: var(--archify-rail-gap);\n align-items: start;\n }\n html[data-reader-rail=\"true\"] .container \u003e .header { grid-column: 1 / -1; }\n html[data-reader-rail=\"true\"] .container \u003e .diagram-container { grid-column: 1; }\n /* The rail is at least the diagram's height and may run on to the viewport\n floor (--archify-rail-max, set by the reader); past that, notes scroll and\n the index keeps a usable share instead of collapsing to its header. */\n html[data-reader-rail=\"true\"] .reader-rail {\n display: flex;\n flex-direction: column;\n grid-column: 2;\n align-self: stretch;\n min-height: 0;\n max-height: var(--archify-rail-max, none);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards:empty { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards {\n display: flex;\n flex: 0 1 auto;\n flex-direction: column;\n gap: 0;\n min-height: 0;\n margin-top: 0;\n padding: 0.125rem 0 0;\n overflow-y: auto;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);\n mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards::-webkit-scrollbar { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card { flex: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card {\n padding: 0 0.25rem 1.125rem;\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card + .card {\n padding-top: 1.125rem;\n border-top: 1px solid var(--panel-border);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card::before { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }\n\n .node-outline { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .node-outline:not([hidden]) {\n display: flex;\n flex: 1 0 min(13rem, 55%);\n flex-direction: column;\n min-height: 0;\n margin-top: 0.25rem;\n overflow: hidden;\n border-top: 1px solid var(--panel-border);\n }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }\n /* Collapsed: only the reveal control remains, so the diagram takes the width. */\n html[data-reader-rail=\"collapsed\"] .reader-rail { display: none; }\n /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */\n html[data-reader-rail=\"overlay\"] .reader-rail {\n position: fixed;\n z-index: 150;\n top: 1rem;\n right: 1rem;\n bottom: 1rem;\n display: flex;\n flex-direction: column;\n width: var(--archify-rail-width);\n padding: 0.75rem 1rem 0.5rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n border-radius: 1rem;\n background: var(--toolbar-menu-bg);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);\n animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);\n }\n @keyframes rail-drawer-in {\n from { opacity: 0; transform: translateX(0.75rem); }\n to { opacity: 1; transform: translateX(0); }\n }\n /* Bottom (default): the notes keep their full-width card row and the index\n follows as one panel whose groups flow into columns, so nothing scrolls\n inside it. The placement toggle sits in the index header. */\n html[data-reader-rail=\"bottom\"] .reader-rail {\n display: grid;\n grid-template-areas: \"cards\" \"index\";\n grid-template-columns: minmax(0, 1fr);\n row-gap: 1rem;\n margin-top: 1rem;\n }\n html[data-reader-rail=\"bottom\"] .cards { grid-area: cards; margin-top: 0; }\n html[data-reader-rail=\"bottom\"] .cards:empty { display: none; }\n html[data-reader-rail=\"bottom\"] .node-outline:not([hidden]) {\n display: block;\n grid-area: index;\n padding: 0 1.25rem 0.75rem;\n border: 1px solid var(--panel-border);\n border-radius: 0.75rem;\n background: var(--panel);\n }\n html[data-reader-rail=\"bottom\"] .reader-rail \u003e .rail-controls {\n z-index: 1;\n grid-area: index;\n align-self: start;\n justify-self: end;\n margin: 0.625rem 0.625rem 0 0;\n }\n html[data-reader-rail=\"bottom\"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }\n html[data-reader-rail=\"bottom\"] .node-outline-list {\n columns: 15rem;\n column-gap: 1.75rem;\n padding: 0;\n overflow: visible;\n -webkit-mask-image: none;\n mask-image: none;\n }\n /* Named groups stay whole; a single unnamed group may split across columns,\n where a continuous spine would read as a broken line. */\n html[data-reader-rail=\"bottom\"] .node-outline-group + .node-outline-group { margin-top: 0; }\n html[data-reader-rail=\"bottom\"] .node-outline-group:has(\u003e .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }\n html[data-reader-rail=\"bottom\"] .node-outline-group:not(:has(\u003e .node-outline-heading)) \u003e ul::before { display: none; }\n html[data-reader-rail=\"bottom\"] .node-outline-group li { break-inside: avoid; }\n .rail-controls { display: none; }\n html:is([data-reader-rail=\"true\"], [data-reader-rail=\"overlay\"], [data-reader-rail=\"bottom\"]) .rail-controls {\n display: flex;\n flex: none;\n justify-content: flex-end;\n gap: 0.125rem;\n margin: -0.25rem -0.25rem 0.25rem 0;\n }\n .rail-control {\n display: inline-grid;\n place-items: center;\n width: 1.875rem;\n height: 1.875rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: var(--text-faint);\n cursor: pointer;\n transition: background 0.14s ease, color 0.14s ease;\n }\n .rail-control[hidden] { display: none; }\n .rail-control:hover,\n .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }\n .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }\n .rail-control-icon,\n .rail-reveal-icon {\n width: 1rem;\n height: 1rem;\n background: currentColor;\n -webkit-mask: var(--rail-glyph) center / contain no-repeat;\n mask: var(--rail-glyph) center / contain no-repeat;\n }\n /* Panel glyphs: a frame with the panel drawn on the side it moves to. */\n .rail-control-icon.placement,\n #rail-placement[data-placement=\"right\"] .rail-control-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E\"); }\n #rail-placement[data-placement=\"bottom\"] .rail-control-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E\"); }\n .rail-control-icon.collapse { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\"); }\n .rail-reveal-icon { --rail-glyph: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E\"); }\n .rail-reveal[hidden] { display: none; }\n /* The collapsed rail leaves one quiet pill in the canvas corner. */\n .rail-reveal {\n position: absolute;\n z-index: 13;\n top: 0.75rem;\n right: 0.75rem;\n display: inline-flex;\n align-items: center;\n gap: 0.45rem;\n min-height: 2rem;\n padding: 0 0.75rem 0 0.625rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);\n border-radius: 999px;\n background: color-mix(in srgb, var(--panel) 86%, transparent);\n color: var(--text-muted);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);\n backdrop-filter: blur(12px);\n font: inherit;\n font-size: 0.75rem;\n font-weight: 500;\n cursor: pointer;\n transition: color 0.14s ease, background 0.14s ease;\n }\n .rail-reveal:hover,\n .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }\n .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }\n html[data-motion=\"still\"] .reader-rail { animation: none !important; }\n .node-outline-head {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 1.125rem 0.25rem 0.375rem;\n }\n .node-outline-head strong {\n color: var(--text);\n font-size: 0.875rem;\n font-weight: 600;\n letter-spacing: -0.005em;\n }\n .node-outline-count {\n min-width: 1.35rem;\n padding: 0.1rem 0.4rem;\n border-radius: 999px;\n background: color-mix(in srgb, var(--text) 6%, transparent);\n color: var(--text-muted);\n font-size: 0.6875rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n .node-outline-list {\n flex: 1 1 auto;\n min-height: 0;\n margin: 0 -0.375rem;\n padding: 0 0 1.25rem;\n overflow-y: auto;\n list-style: none;\n scrollbar-width: none;\n -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);\n mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);\n }\n .node-outline-list::-webkit-scrollbar { display: none; }\n .node-outline-group + .node-outline-group { margin-top: 0.25rem; }\n .node-outline-group \u003e ul {\n position: relative;\n list-style: none;\n }\n /* A quiet spine ties each group's swatches together like a lane. */\n .node-outline-group \u003e ul::before {\n position: absolute;\n top: 0.95rem;\n bottom: 0.95rem;\n left: calc(0.625rem + 0.3125rem - 0.5px);\n width: 1px;\n background: var(--panel-border);\n content: \"\";\n }\n .node-outline-heading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n padding: 0.7rem 0.625rem 0.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n }\n .node-outline-heading small {\n color: var(--text-dim);\n font-size: 0.6875rem;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n }\n /* The rail frees the vertical budget, so compact viewports keep the normal\n title spacing instead of the stacked layout's tight stage rail. */\n html[data-reader-rail]:not([data-reader-rail=\"bottom\"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }\n html[data-reader-rail]:not([data-reader-rail=\"bottom\"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }\n html[data-reader-rail]:not([data-reader-rail=\"bottom\"]) .header { min-height: 0; margin-bottom: 1.125rem; }\n .node-outline-item {\n position: relative;\n display: grid;\n grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;\n align-items: center;\n column-gap: 0.625rem;\n width: 100%;\n min-height: 1.95rem;\n padding: 0.28rem 0.5rem 0.28rem 0.625rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: var(--text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background 0.16s ease;\n }\n /* Trailing chevron hints that a click focuses the node. */\n .node-outline-item::after {\n grid-column: 4;\n width: 0.75rem;\n height: 0.75rem;\n background: currentColor;\n color: var(--text-muted);\n content: \"\";\n opacity: 0;\n transform: translateX(-3px);\n transition: opacity 0.16s ease, transform 0.16s ease;\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / contain no-repeat;\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / contain no-repeat;\n }\n .node-outline-item:hover,\n .node-outline-item:focus-visible,\n .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }\n .node-outline-item:hover::after,\n .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }\n .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }\n .node-outline-item[aria-current=\"true\"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }\n .node-outline-item[aria-current=\"true\"]::after { opacity: 0; }\n /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */\n .node-outline-dot {\n width: 0.625rem;\n height: 0.5rem;\n border: 1.25px solid var(--outline-tone);\n border-radius: 0.15rem;\n background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));\n transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;\n }\n .node-outline-item:hover .node-outline-dot,\n .node-outline-item:focus-visible .node-outline-dot,\n .node-outline-item[data-previewing] .node-outline-dot,\n .node-outline-item[aria-current=\"true\"] .node-outline-dot {\n background: var(--outline-tone);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);\n transform: scale(1.08);\n }\n .node-outline-item strong {\n overflow: hidden;\n font-size: 0.8125rem;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .node-outline-item[aria-current=\"true\"] strong { font-weight: 600; }\n .node-outline-item small {\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.6875rem;\n text-align: right;\n text-overflow: ellipsis;\n white-space: nowrap;\n transition: color 0.16s ease;\n }\n .node-outline-item:hover small,\n .node-outline-item[data-previewing] small,\n .node-outline-item[aria-current=\"true\"] small { color: var(--text-muted); }\n\n .card-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 0.625rem;\n }\n\n .card-dot {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n }\n\n .card-dot.cyan { background: var(--frontend-stroke); }\n .card-dot.emerald { background: var(--backend-stroke); }\n .card-dot.violet { background: var(--database-stroke); }\n .card-dot.amber { background: var(--cloud-stroke); }\n .card-dot.rose { background: var(--security-stroke); }\n .card-dot.orange { background: var(--messagebus-stroke); }\n .card-dot.slate { background: var(--external-stroke); }\n\n .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }\n\n .card ul {\n list-style: none;\n color: var(--text-muted);\n font-size: 0.8125rem;\n line-height: 1.6;\n }\n\n .card li {\n position: relative;\n margin-bottom: 0.3rem;\n padding-left: 0.9rem;\n }\n .card li:last-child { margin-bottom: 0; }\n /* Hanging markers take the card's tone so wrapped lines align under text. */\n .card li::before {\n position: absolute;\n top: calc(0.8em - 2px);\n left: 0.2rem;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);\n content: \"\";\n }\n .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }\n .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }\n .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }\n .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }\n .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }\n .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }\n .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }\n .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }\n\n /* ==========================================================\n Print stylesheet — hide interactive controls, force light,\n drop the grid so the diagram doesn't waste ink, use landscape\n so wide diagrams fit, pack summary cards into 2 columns to\n avoid an orphan card on a trailing page.\n ========================================================== */\n @page { size: landscape; margin: 1.5cm; }\n\n @media print {\n /* Force the FULL light palette — including component fills/strokes and\n lane/arrow colors — so printing from dark theme doesn't put neon\n strokes and translucent dark fills on white paper. */\n :root, [data-theme=\"dark\"], [data-theme=\"light\"] {\n --bg: #ffffff;\n --grid: transparent;\n --panel: #ffffff;\n --panel-border: #e2e8f0;\n --text: #0f172a;\n --text-muted: #475569;\n --text-dim: #94a3b8;\n --text-faint: #64748b;\n --mask: #ffffff;\n --lane-fill: rgba(248, 250, 252, 0.65);\n --lane-stroke: #cbd5e1;\n --arrow: #94a3b8;\n --arrow-emphasis: #059669;\n --frontend-fill: rgba(34, 211, 238, 0.15);\n --frontend-stroke: #0891b2;\n --backend-fill: rgba(52, 211, 153, 0.18);\n --backend-stroke: #059669;\n --database-fill: rgba(167, 139, 250, 0.2);\n --database-stroke: #7c3aed;\n --cloud-fill: rgba(251, 191, 36, 0.18);\n --cloud-stroke: #d97706;\n --security-fill: rgba(251, 113, 133, 0.15);\n --security-stroke: #e11d48;\n --messagebus-fill: rgba(251, 146, 60, 0.15);\n --messagebus-stroke:#ea580c;\n --external-fill: rgba(148, 163, 184, 0.18);\n --external-stroke: #64748b;\n }\n body { background: #ffffff !important; padding: 0; }\n .container { max-width: none; }\n .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }\n \n .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }\n .diagram-container { --archify-nav-reserve: 0px !important; }\n html[data-preset=\"signal-flow\"] .diagram-container,\n html[data-preset=\"signal-flow\"] .card { background: #ffffff; }\n .cards { grid-template-columns: 1fr 1fr; }\n /* Ensure elements break sensibly across pages */\n .card { break-inside: avoid; page-break-inside: avoid; }\n .diagram-container { break-inside: avoid; page-break-inside: avoid; }\n .diagram-container svg [data-detail] {\n opacity: 1 !important;\n pointer-events: auto !important;\n }\n .diagram-container svg [data-detail-anchor] { transform: none !important; }\n .diagram-container svg[data-lens-active] [data-node-id],\n .diagram-container svg[data-lens-active] [data-edge-from],\n .diagram-container svg[data-legend-preview-active] [data-node-id],\n .diagram-container svg[data-legend-preview-active] [data-edge-from] {\n opacity: 1 !important;\n filter: none !important;\n }\n [data-legend-bridge-runtime] { display: none !important; }\n .semantic-lens-overlay { display: none !important; }\n .relationship-hit-overlay { display: none !important; }\n .relationship-pulse-overlay { display: none !important; }\n .route-probe-overlay, .route-journey-overlay { display: none !important; }\n .diagram-container svg[data-focus-active] [data-node-id],\n .diagram-container svg[data-focus-active] [data-edge-from],\n .diagram-container svg[data-focus-active] [data-graph-role=\"automatic-crossover-underlay\"],\n .diagram-container svg[data-reach-active] [data-node-id],\n .diagram-container svg[data-reach-active] [data-edge-from],\n .diagram-container svg[data-reach-active] [data-graph-role=\"automatic-crossover-underlay\"],\n .diagram-container svg[data-route-active] [data-node-id],\n .diagram-container svg[data-route-active] [data-edge-from],\n .diagram-container svg[data-route-active] [data-graph-role=\"automatic-crossover-underlay\"] {\n opacity: 1 !important;\n filter: none !important;\n animation: none !important;\n }\n h1, .subtitle { color: #0f172a; }\n }\n\n /* ==========================================================\n TOOLBAR (theme toggle + export menu)\n ========================================================== */\n /* The toolbar tracks the centered reader column and the title row, so\n an adaptive narrow reader does not leave its controls stranded at the\n viewport edge. */\n .toolbar {\n position: absolute;\n top: var(--archify-page-top);\n right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));\n display: flex;\n align-items: center;\n gap: 0.125rem;\n padding: 0;\n border: 0;\n background: transparent;\n box-shadow: none;\n z-index: 100;\n }\n /* Ghost controls keep a 44px hit area while the visible pill stays compact;\n Export is the one primary action. */\n .toolbar button {\n position: relative;\n isolation: isolate;\n background: transparent;\n color: var(--text-muted);\n border: 0;\n padding: 0.5rem 0.75rem;\n border-radius: 0.5625rem;\n font-family: inherit;\n font-size: 0.8125rem;\n font-weight: 500;\n cursor: pointer;\n white-space: nowrap;\n box-shadow: none;\n transition: color 0.15s;\n display: inline-flex;\n align-items: center;\n gap: 0.4rem;\n min-height: 2.75rem;\n }\n .toolbar button::before {\n position: absolute;\n z-index: -1;\n inset: 0.375rem 0;\n border-radius: 0.5rem;\n background: transparent;\n content: \"\";\n transition: background 0.15s, box-shadow 0.15s;\n }\n .toolbar button:hover { color: var(--text); }\n .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }\n .toolbar button[aria-expanded=\"true\"],\n .toolbar button[aria-pressed=\"true\"]:not(#btn-theme) { color: var(--text); }\n .toolbar button[aria-expanded=\"true\"]::before,\n .toolbar button[aria-pressed=\"true\"]:not(#btn-theme)::before {\n background: color-mix(in srgb, var(--text) 8%, transparent);\n }\n .toolbar #btn-export {\n margin-left: 0.375rem;\n padding-right: 0.95rem;\n padding-left: 1rem;\n color: var(--bg);\n font-weight: 550;\n }\n .toolbar #btn-export::before {\n background: var(--text);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);\n }\n .toolbar #btn-export:hover,\n .toolbar #btn-export[aria-expanded=\"true\"] { color: var(--bg); }\n .toolbar #btn-export:hover::before,\n .toolbar #btn-export[aria-expanded=\"true\"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }\n .toolbar button:focus-visible {\n outline: 2px solid var(--frontend-stroke);\n outline-offset: -4px;\n }\n .toolbar { gap: 0.5rem; }\n .toolbar #btn-export { margin-left: 0; }\n .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }\n /* Tools share one quiet capsule; the capsule is drawn inside the 44px row\n so the controls keep their hit area without a tall visible box. */\n .toolbar-group {\n position: relative;\n isolation: isolate;\n display: flex;\n align-items: center;\n gap: 0.0625rem;\n padding: 0 0.25rem;\n }\n .toolbar-group::before {\n position: absolute;\n z-index: -1;\n inset: 0.25rem 0;\n border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);\n border-radius: 0.6875rem;\n background: color-mix(in srgb, var(--panel) 78%, transparent);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);\n backdrop-filter: blur(12px);\n content: \"\";\n }\n .toolbar-group button { padding-inline: 0.625rem; }\n .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }\n /* Theme becomes a sliding switch; its label stays for assistive tech. */\n .toolbar #theme-label,\n .toolbar #present-label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n }\n .toolbar #btn-theme {\n width: 3.5rem;\n padding: 0;\n justify-content: center;\n }\n .toolbar #btn-theme::before {\n inset: 0.75rem 0.4375rem;\n border-radius: 999px;\n background: color-mix(in srgb, var(--text) 9%, transparent);\n box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);\n }\n .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }\n .toolbar #btn-theme::after {\n position: absolute;\n z-index: 0;\n top: 50%;\n left: 0.5625rem;\n width: 1.125rem;\n height: 1.125rem;\n border-radius: 50%;\n background: var(--panel);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);\n content: \"\";\n transform: translateY(-50%);\n transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);\n }\n .toolbar #theme-icon {\n position: absolute;\n z-index: 1;\n top: 50%;\n left: calc(0.5625rem + 0.1875rem);\n width: 0.75rem;\n height: 0.75rem;\n color: var(--cloud-stroke);\n transform: translateY(-50%);\n transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);\n }\n [data-theme=\"dark\"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }\n [data-theme=\"dark\"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }\n [data-theme=\"dark\"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }\n .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }\n .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }\n html[data-motion=\"still\"] .toolbar #btn-theme::after,\n html[data-motion=\"still\"] .toolbar #theme-icon { transition: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar { right: 1rem; }\n html[data-preset=\"editorial\"] .toolbar { border-radius: 0.45rem; }\n .toolbar #btn-motion[hidden] { display: none !important; }\n .toolbar #btn-motion { min-width: 4.4rem; }\n .toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }\n .toolbar .preset-wrap,\n .toolbar .export-wrap {\n position: relative;\n }\n .toolbar-icon {\n display: inline-block;\n width: 0.95rem;\n height: 0.95rem;\n flex: 0 0 auto;\n background: currentColor;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .toolbar-chevron {\n width: 0.65rem;\n height: 0.65rem;\n transition: transform 0.15s ease;\n }\n [aria-expanded=\"true\"] \u003e .toolbar-chevron { transform: rotate(180deg); }\n [data-theme=\"light\"] #theme-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E\");\n }\n [data-theme=\"dark\"] #theme-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E\");\n }\n #btn-present[aria-pressed=\"false\"] #present-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n #btn-present[aria-pressed=\"true\"] #present-icon {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n .toolbar-chevron {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n }\n .toolbar #btn-preset { min-width: 5.4rem; }\n .preset-control-mark {\n width: 0.58rem;\n height: 0.58rem;\n flex: 0 0 auto;\n border: 1px solid var(--frontend-stroke);\n border-radius: 0.2rem;\n background: color-mix(in srgb, var(--frontend-stroke) 28%, transparent);\n transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s;\n }\n #btn-preset[data-preset-option=\"signal-flow\"] .preset-control-mark {\n border-radius: 50%;\n box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 78%, transparent);\n }\n #btn-preset[data-preset-option=\"blueprint\"] .preset-control-mark {\n border-radius: 0.06rem;\n background: transparent;\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frontend-stroke) 32%, transparent);\n transform: rotate(45deg) scale(0.84);\n }\n #btn-preset[data-preset-option=\"editorial\"] .preset-control-mark {\n border-color: var(--arrow-emphasis);\n border-radius: 0;\n background: var(--arrow-emphasis);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);\n transform: rotate(45deg) scale(0.72);\n }\n /* Menus anchor to the tools capsule so they open flush under it. */\n .toolbar-group .preset-wrap { position: static; }\n .toolbar .preset-menu {\n position: absolute;\n top: calc(100% + 0.125rem);\n right: 0;\n display: none;\n width: 17.5rem;\n max-width: calc(100vw - 2rem);\n padding: 0.375rem;\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n border-radius: 0.875rem;\n background: var(--toolbar-menu-bg);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);\n }\n [data-theme=\"dark\"] .toolbar .preset-menu,\n [data-theme=\"dark\"] .toolbar .export-menu {\n border-color: rgba(148, 163, 184, 0.16);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);\n }\n /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */\n .toolbar .preset-menu button,\n .toolbar .export-menu button { isolation: auto; min-height: 0; }\n .toolbar .preset-menu button::before { display: none; }\n .toolbar .preset-menu.open { display: block; }\n .toolbar .preset-menu.open,\n .toolbar .export-menu.open {\n animation: toolbar-menu-in 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);\n transform-origin: top right;\n }\n @keyframes toolbar-menu-in {\n from { opacity: 0; transform: translateY(-0.25rem) scale(0.985); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n .preset-menu-heading {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.45rem 0.55rem 0.4rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.01em;\n }\n .preset-menu-shortcut {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n font-weight: 500;\n }\n .preset-menu-shortcut kbd {\n min-width: 1.125rem;\n padding: 0.05rem 0.3rem;\n border: 1px solid var(--panel-border);\n border-bottom-width: 2px;\n border-radius: 0.3rem;\n background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));\n color: var(--text-muted);\n font-family: inherit;\n font-size: 0.625rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n }\n .toolbar .preset-option {\n display: grid;\n grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;\n align-items: center;\n gap: 0.75rem;\n width: 100%;\n min-height: 3.125rem;\n margin-top: 0.125rem;\n padding: 0.45rem 0.6rem 0.45rem 0.5rem;\n border: 0;\n border-radius: 0.625rem;\n background: transparent;\n color: var(--text);\n box-shadow: none;\n backdrop-filter: none;\n text-align: left;\n transition: background 0.14s ease;\n }\n .toolbar .preset-option:hover,\n .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }\n .toolbar .preset-option[aria-checked=\"true\"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }\n .toolbar .preset-option:focus-visible {\n outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);\n outline-offset: -1.5px;\n }\n .preset-option-swatch {\n position: relative;\n width: 2.375rem;\n height: 1.75rem;\n overflow: hidden;\n border: 0;\n border-radius: 0.4375rem;\n background: #0f172a;\n box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);\n transition: box-shadow 0.14s ease, transform 0.14s ease;\n }\n .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }\n .toolbar .preset-option[aria-checked=\"true\"] .preset-option-swatch {\n box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);\n }\n .preset-option-swatch::before,\n .preset-option-swatch::after { position: absolute; content: \"\"; }\n .preset-option-swatch.classic::before {\n top: 0.42rem;\n right: 0.35rem;\n bottom: 0.42rem;\n left: 0.35rem;\n border: 1px solid #22d3ee;\n border-radius: 0.16rem;\n background: rgba(34, 211, 238, 0.14);\n }\n /* Classic previews the canvas it will actually produce in this theme. */\n [data-theme=\"light\"] .preset-option-swatch.classic {\n background:\n radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,\n #ffffff;\n }\n [data-theme=\"light\"] .preset-option-swatch.classic::before {\n border-color: #1b87a3;\n background: rgba(14, 116, 144, 0.08);\n box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);\n }\n .preset-option-swatch.signal-flow {\n border-color: #29415f;\n background: linear-gradient(135deg, #07101e 10%, #10243c 100%);\n }\n .preset-option-swatch.signal-flow::before {\n top: 50%;\n right: 0.2rem;\n left: 0.2rem;\n height: 1px;\n background: linear-gradient(90deg, #67e8f9, #c4b5fd);\n box-shadow: 0 0 8px #67e8f9;\n }\n .preset-option-swatch.signal-flow::after {\n top: calc(50% - 0.13rem);\n right: 0.28rem;\n width: 0.26rem;\n height: 0.26rem;\n border-radius: 50%;\n background: #67e8f9;\n box-shadow: 0 0 7px #67e8f9;\n }\n .preset-option-swatch.blueprint {\n border-color: #34799a;\n border-radius: 0.08rem;\n background-color: #0a2031;\n background-image:\n linear-gradient(rgba(102, 217, 239, 0.18) 1px, transparent 1px),\n linear-gradient(90deg, rgba(102, 217, 239, 0.18) 1px, transparent 1px);\n background-size: 0.42rem 0.42rem;\n }\n .preset-option-swatch.blueprint::before {\n top: 0.34rem;\n right: 0.38rem;\n bottom: 0.34rem;\n left: 0.38rem;\n border: 1px solid #66d9ef;\n }\n .preset-option-swatch.editorial {\n border-color: #b8aa94;\n border-radius: 0.08rem;\n background: repeating-linear-gradient(0deg, #f2eee5 0 0.34rem, #d8d0c2 0.36rem, #f2eee5 0.38rem);\n }\n .preset-option-swatch.editorial::before {\n top: 0;\n bottom: 0;\n left: 0.42rem;\n width: 1px;\n background: #c9502d;\n opacity: 0.72;\n }\n .preset-option-swatch.editorial::after {\n top: 0.52rem;\n right: 0.45rem;\n width: 0.38rem;\n height: 0.38rem;\n background: #c9502d;\n transform: rotate(45deg);\n }\n .preset-option-copy { min-width: 0; }\n .preset-option-copy strong,\n .preset-option-copy small { display: block; }\n .preset-option-copy strong {\n color: var(--text);\n font-size: 0.8125rem;\n font-weight: 550;\n letter-spacing: -0.005em;\n }\n .toolbar .preset-option[aria-checked=\"true\"] .preset-option-copy strong { font-weight: 650; }\n .preset-option-copy small {\n margin-top: 0.125rem;\n overflow: hidden;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 400;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n .preset-option-check {\n display: inline-block;\n width: 0.9rem;\n height: 0.9rem;\n color: var(--frontend-stroke);\n background: currentColor;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n opacity: 0;\n }\n .preset-option[aria-checked=\"true\"] .preset-option-check { opacity: 1; }\n html[data-preset=\"editorial\"] .toolbar button,\n html[data-preset=\"editorial\"] .preset-menu,\n html[data-preset=\"editorial\"] .export-menu,\n html[data-preset=\"editorial\"] .overview-map,\n html[data-preset=\"editorial\"] .semantic-lens,\n html[data-preset=\"editorial\"] .route-probe,\n html[data-preset=\"editorial\"] .focus-chip,\n html[data-preset=\"editorial\"] .diagram-guide,\n html[data-preset=\"editorial\"] .node-finder {\n border-radius: 0.3rem;\n }\n .motion-control-dot {\n width: 0.46rem;\n height: 0.46rem;\n flex: 0 0 auto;\n border: 1px solid var(--frontend-stroke);\n border-radius: 50%;\n background: var(--frontend-stroke);\n box-shadow: 0 0 9px color-mix(in srgb, var(--frontend-stroke) 72%, transparent);\n }\n #btn-motion[aria-pressed=\"false\"] .motion-control-dot {\n background: transparent;\n box-shadow: none;\n }\n .toolbar .export-menu {\n position: absolute;\n top: calc(100% + 0.125rem);\n right: 0;\n background: var(--toolbar-menu-bg);\n border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);\n width: 19rem;\n max-width: calc(100vw - 2rem);\n max-height: calc(100vh - 5.5rem);\n overflow-y: auto;\n border-radius: 0.875rem;\n padding: 0.375rem;\n display: none;\n flex-direction: column;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);\n scrollbar-width: thin;\n }\n .toolbar .export-menu.open { display: flex; }\n .export-menu-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.55rem 0.6rem 0.6rem;\n }\n .export-menu-header strong,\n .export-menu-header span { display: block; }\n .export-menu-header strong {\n color: var(--text);\n font-size: 0.875rem;\n font-weight: 600;\n letter-spacing: -0.005em;\n }\n .export-menu-header span {\n margin-top: 0.15rem;\n color: var(--text-faint);\n font-size: 0.75rem;\n }\n .export-menu-header kbd {\n min-width: 1.125rem;\n padding: 0.05rem 0.3rem;\n border: 1px solid var(--panel-border);\n border-bottom-width: 2px;\n border-radius: 0.3rem;\n background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));\n color: var(--text-muted);\n font-family: inherit;\n font-size: 0.625rem;\n font-weight: 600;\n line-height: 1.3;\n text-align: center;\n }\n .export-menu-section {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: 0.0625rem;\n }\n .export-menu-section + .export-menu-section {\n margin-top: 0.3rem;\n padding-top: 0.3rem;\n border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);\n }\n .export-menu-heading {\n grid-column: 1 / -1;\n display: block;\n padding: 0.4rem 0.6rem 0.25rem;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.01em;\n }\n .toolbar .export-menu button {\n display: grid;\n grid-template-columns: 1rem minmax(0, 1fr);\n align-items: center;\n column-gap: 0.7rem;\n background: transparent;\n border: 0;\n box-shadow: none;\n backdrop-filter: none;\n width: 100%;\n min-height: 2.5rem;\n text-align: left;\n padding: 0.4rem 0.6rem;\n border-radius: 0.5625rem;\n color: var(--text);\n white-space: nowrap;\n transition: background 0.14s ease;\n }\n .toolbar .export-menu button:hover,\n .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }\n .toolbar .export-menu button:focus-visible {\n outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);\n outline-offset: -1.5px;\n }\n /* Name and format hint share one line, so each row stays compact. */\n .export-item-copy {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 0.75rem;\n min-width: 0;\n }\n .export-item-copy strong {\n overflow: hidden;\n color: inherit;\n font-size: 0.8125rem;\n font-weight: 500;\n text-overflow: ellipsis;\n }\n .export-item-copy small {\n flex: none;\n color: var(--text-faint);\n font-size: 0.6875rem;\n font-weight: 450;\n }\n .toolbar .export-menu button::before {\n position: static;\n z-index: auto;\n inset: auto;\n border-radius: 0;\n display: block;\n width: 1rem;\n height: 1rem;\n background: currentColor;\n color: var(--text-muted);\n content: \"\";\n opacity: 0.8;\n -webkit-mask-position: center;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: contain;\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: contain;\n }\n .toolbar .export-menu button[data-format=\"share-card\"]::before,\n .toolbar .export-menu button[data-action=\"route-share-card\"]::before,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-action^=\"copy\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format=\"png\"]::before,\n .toolbar .export-menu button[data-format=\"jpeg\"]::before,\n .toolbar .export-menu button[data-format=\"webp\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format^=\"svg\"]::before,\n .toolbar .export-menu button[data-format=\"webm\"]::before {\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E\");\n }\n .toolbar .export-menu button[data-format=\"share-card\"],\n .toolbar .export-menu button[data-action=\"route-share-card\"],\n .toolbar .export-menu button[data-action=\"reach-share-card\"] {\n color: var(--text);\n background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);\n }\n .toolbar .export-menu button[data-format=\"share-card\"]::before,\n .toolbar .export-menu button[data-action=\"route-share-card\"]::before,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]::before { color: var(--frontend-stroke); opacity: 1; }\n .toolbar .export-menu button[hidden] { display: none; }\n .toolbar .export-menu button[data-format=\"share-card\"]:hover,\n .toolbar .export-menu button[data-action=\"route-share-card\"]:hover,\n .toolbar .export-menu button[data-action=\"reach-share-card\"]:hover {\n background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);\n }\n .toolbar .export-menu button:disabled {\n color: var(--text-faint);\n background: transparent;\n opacity: 0.55;\n cursor: not-allowed;\n }\n .toolbar .export-menu .hint {\n color: var(--text-faint);\n font-size: 0.6875rem;\n }\n\n /* Toast — brief feedback for actions like \"copied\" */\n .archify-toast {\n position: fixed;\n top: 1rem;\n left: 50%;\n transform: translateX(-50%) translateY(-8px);\n background: var(--toolbar-menu-bg);\n color: var(--text);\n border: 1px solid var(--toolbar-border);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n font-family: inherit;\n font-size: 0.75rem;\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n z-index: 200;\n pointer-events: none;\n box-shadow: 0 4px 20px rgba(0,0,0,0.25);\n }\n .archify-toast.show {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n\n @media (max-width: 720px) {\n body { padding: 1rem; }\n .toolbar .preset-menu,\n .toolbar .export-menu {\n position: fixed;\n top: 4.5rem;\n right: 1rem;\n left: 1rem;\n width: auto;\n max-width: none;\n }\n .toolbar {\n position: relative;\n top: auto;\n right: auto;\n justify-content: flex-end;\n width: max-content;\n max-width: 100%;\n margin-left: auto;\n margin-bottom: 1rem;\n }\n .header { margin-bottom: 1.25rem; padding-right: 0; }\n html[data-preset=\"signal-flow\"] .header,\n html[data-preset=\"blueprint\"] .header,\n html[data-preset=\"editorial\"] .header { padding-right: 0; }\n .header-row {\n gap: 0.75rem;\n align-items: flex-start;\n }\n html[data-preset=\"signal-flow\"] .header-row,\n html[data-preset=\"blueprint\"] .header-row,\n html[data-preset=\"editorial\"] .header-row { flex-wrap: wrap; }\n html[data-preset=\"signal-flow\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n html[data-preset=\"blueprint\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n html[data-preset=\"editorial\"] .header-row::after {\n margin-left: 0;\n order: 3;\n }\n h1 {\n font-size: 1.25rem;\n line-height: 1.25;\n }\n .subtitle {\n margin-left: 0;\n font-size: 0.8125rem;\n line-height: 1.55;\n }\n .diagram-container {\n padding: 0.75rem;\n border-radius: 0.75rem;\n }\n html:not([data-embed=\"true\"]) .diagram-container {\n padding: 0.75rem 0.75rem 4.25rem;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] {\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-x: contain;\n scrollbar-width: thin;\n scroll-behavior: smooth;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] \u003e svg {\n min-width: 720px;\n }\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .diagram-nav,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .overview-map,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .focus-chip,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .route-probe,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .semantic-lens,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .diagram-guide,\n html:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] .node-finder {\n transform: translateX(var(--archify-scroll-x, 0px));\n }\n .diagram-nav { right: 0.5rem; bottom: 0.5rem; }\n .diagram-nav button {\n min-width: 2.75rem;\n height: 2.75rem;\n }\n .diagram-nav [data-view=\"reset\"] { min-width: 3.75rem; }\n .diagram-nav [data-view=\"reset\"][data-detail-visible] { min-width: 4.35rem; }\n .overview-map {\n right: 0.5rem;\n bottom: 3.7rem;\n width: min(10.25rem, calc(100% - 1rem));\n }\n .overview-map[data-docked=\"true\"] {\n right: var(--archify-radar-right, 0.5rem);\n top: var(--archify-radar-top, 0.5rem);\n bottom: auto;\n transform: none !important;\n }\n .overview-map[data-docked=\"true\"][data-dock-side=\"left\"] {\n right: auto;\n left: var(--archify-radar-left, 0.5rem);\n }\n .overview-map-surface { height: 4rem; }\n .overview-map-feedback { right: 0.5rem; bottom: 3.7rem; }\n .semantic-lens {\n right: 0.5rem;\n bottom: 3.7rem;\n width: calc(100% - 1rem);\n max-height: calc(100% - 4.2rem);\n }\n .semantic-lens[data-dock-side] { left: auto; right: 0.5rem; }\n .semantic-lens-kinds { max-height: min(12rem, 34vh); }\n .focus-chip {\n left: 0.5rem;\n top: 0.5rem;\n width: calc(100% - 1rem);\n max-width: none;\n }\n .relationship-lens-head { padding-top: 0.7rem; }\n .relationship-lens-drag-handle { display: none; }\n .relationship-lens-list { max-height: min(12rem, 38vh); }\n .relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }\n .focus-chip:not([data-relations-expanded=\"true\"]) .relationship-lens-head { border-bottom-color: transparent; }\n .focus-chip:not([data-relations-expanded=\"true\"]) .relationship-lens-list { display: none; }\n /* While a mobile reader previews one relationship, turn the full Lens\n into a compact peek card. This keeps the exact source and target on\n canvas instead of covering them with a long, scrollable list. */\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-list {\n max-height: none;\n padding: 0.35rem;\n overflow: hidden;\n }\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-group { margin: 0; }\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-group-title,\n .focus-chip[data-relationship-previewing=\"true\"] .relationship-lens-row:not([data-preview-active=\"true\"]) {\n display: none;\n }\n .node-finder {\n top: 0.5rem;\n left: 0.5rem;\n width: min(22rem, calc(100% - 1rem));\n max-height: calc(100% - 1rem);\n }\n .diagram-guide {\n top: 0.5rem;\n right: 0.5rem;\n left: 0.5rem;\n width: auto;\n max-height: calc(100% - 1rem);\n }\n .diagram-guide-head { padding: 0.62rem 0.7rem 0.52rem; }\n .diagram-guide-stats { padding: 0.42rem 0.7rem; }\n .diagram-guide-actions {\n grid-template-columns: 1fr;\n gap: 0.28rem;\n padding: 0.42rem;\n }\n .diagram-guide-action {\n min-height: 3.1rem;\n padding: 0.42rem 0.48rem;\n }\n .diagram-guide-action small {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .diagram-guide-index {\n width: 1.5rem;\n height: 1.5rem;\n }\n .diagram-guide-shortcuts { padding: 0.46rem 0.7rem 0.52rem; }\n .diagram-guide-action[data-guide-action=\"present\"] { grid-column: auto; }\n .route-probe[data-guide-open=\"true\"] {\n visibility: hidden;\n pointer-events: none;\n }\n .node-finder-results { max-height: min(16rem, 38vh); }\n .route-probe {\n left: 0.5rem;\n bottom: 3.7rem;\n width: calc(100% - 1rem);\n min-width: 0;\n }\n .route-probe[data-route-dock=\"top\"] {\n top: 0.5rem;\n bottom: auto;\n }\n .route-probe[data-finder-open=\"true\"] {\n visibility: hidden;\n pointer-events: none;\n }\n .route-probe-head { padding: 0.45rem 0.48rem 0.38rem; }\n .route-probe-path { padding: 0.35rem 0.48rem 0.2rem; }\n .route-probe-node { min-height: 2.75rem !important; }\n .route-journey-controls {\n grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem minmax(0, 1fr);\n padding: 0.08rem 0.48rem 0.32rem;\n }\n .route-journey-controls button { min-height: 2.75rem; }\n .route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }\n .route-probe-node { max-width: 7.5rem; }\n \n \n \n \n \n \n \n \n \n \n \n html[data-embed=\"true\"][data-share-playback=\"true\"] .diagram-container {\n padding-top: 4.25rem;\n }\n html[data-embed=\"true\"][data-share-moment=\"true\"] .diagram-container {\n padding-top: 4.25rem;\n }\n \n .cards {\n grid-template-columns: 1fr;\n margin-top: 1rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) body { padding: 0.5rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .container {\n gap: 0.5rem;\n height: calc(100dvh - 1rem);\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar {\n position: fixed;\n top: 0.5rem;\n right: 0.5rem;\n margin: 0;\n gap: 0.25rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .toolbar button {\n min-height: 2.75rem;\n padding: 0.42rem 0.58rem;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header {\n min-height: 2.25rem;\n padding: 3.5rem 0 0;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row {\n min-height: 2.25rem;\n margin: 0;\n align-items: center;\n flex-wrap: nowrap;\n }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .header-row::after,\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .pulse-dot,\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .subtitle { display: none; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) h1 {\n flex: 1 1 auto;\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n font-size: 0.875rem;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n \n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }\n html[data-present=\"true\"]:not([data-embed=\"true\"]) .diagram-container[data-wide-diagram=\"true\"] \u003e svg {\n width: 720px;\n height: auto;\n min-width: 720px;\n }\n }\n\n @media (max-width: 420px) {\n .export-menu-section { grid-template-columns: 1fr; }\n .export-menu-heading,\n .toolbar .export-menu button[data-format=\"share-card\"],\n .toolbar .export-menu button[data-action=\"route-share-card\"],\n .toolbar .export-menu button[data-action=\"reach-share-card\"] { grid-column: 1; }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .toolbar .preset-menu.open,\n .toolbar .export-menu.open { animation: none; }\n .toolbar-chevron { transition: none; }\n }\n\n @media (max-width: 360px) {\n .toolbar { gap: 0.25rem; }\n .toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }\n .toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }\n #theme-label, #preset-label, #present-label { display: none; }\n }\n\n /* ==========================================================\n SVG SEMANTIC CLASSES — use these instead of inline fill/stroke\n ========================================================== */\n .c-grid { stroke: var(--grid); fill: none; }\n .c-mask { fill: var(--mask); stroke: none; }\n .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }\n .c-lane-wash { fill: var(--lane-fill); stroke: none; }\n\n .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }\n .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }\n .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }\n .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }\n .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }\n .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }\n .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }\n\n /* Text helpers */\n .t-primary { fill: var(--text); }\n .t-muted { fill: var(--text-muted); }\n .t-dim { fill: var(--text-dim); }\n .t-frontend { fill: var(--frontend-stroke); }\n .t-backend { fill: var(--backend-stroke); }\n .t-database { fill: var(--database-stroke); }\n .t-cloud { fill: var(--cloud-stroke); }\n .t-security { fill: var(--security-stroke); }\n .t-messagebus { fill: var(--messagebus-stroke); }\n .t-external { fill: var(--external-stroke); }\n\n /* Relationship labels share the exact color token used by their path. */\n .t-edge-default { fill: var(--arrow); }\n .t-edge-emphasis { fill: var(--arrow-emphasis); }\n .t-edge-security { fill: var(--security-stroke); }\n .t-edge-dashed { fill: var(--database-stroke); }\n\n /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes\n read as lifted cards with hairline strokes. Paint only; authored geometry,\n hit areas and exports keep their canonical shapes. */\n html[data-preset=\"classic\"] .diagram-container {\n background:\n radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,\n var(--panel);\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-grid { stroke: transparent; }\n html[data-preset=\"classic\"][data-theme=\"light\"] .diagram-container \u003e svg [data-node-id] \u003e rect:not(.c-mask) {\n filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));\n }\n html[data-preset=\"classic\"][data-theme=\"dark\"] .diagram-container \u003e svg [data-node-id] \u003e rect:not(.c-mask) {\n filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg [data-edge-from] {\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }\n html[data-preset=\"classic\"] .diagram-container \u003e svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }\n html[data-preset=\"classic\"][data-theme=\"dark\"] .diagram-container \u003e svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }\n html[data-preset=\"classic\"] .diagram-container \u003e svg [data-node-id] {\n transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);\n }\n html[data-preset=\"classic\"]:not([data-motion=\"still\"]) .diagram-container \u003e svg [data-node-id]:hover {\n transform: translateY(-1.5px);\n }\n\n /* Semantic Sigils are small authored role stamps, not icons from a brand\n pack and not viewer controls. Prefix selectors with svg so the canonical\n export's SVG-only stylesheet collector keeps them automatically. */\n svg .semantic-sigil {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.35;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.76;\n pointer-events: none;\n }\n svg .semantic-sigil \u003e * { vector-effect: non-scaling-stroke; }\n svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }\n svg .s-frontend { color: var(--frontend-stroke); }\n svg .s-backend { color: var(--backend-stroke); }\n svg .s-database { color: var(--database-stroke); }\n svg .s-cloud { color: var(--cloud-stroke); }\n svg .s-security { color: var(--security-stroke); }\n svg .s-messagebus { color: var(--messagebus-stroke); }\n svg .s-external { color: var(--external-stroke); }\n\n /* Brand Marks are authored identity badges. Their color is contained\n inside one neutral plate so vendor color never replaces Archify's\n semantic node and relationship vocabulary. */\n svg .brand-mark { pointer-events: none; }\n svg .brand-mark-badge { fill: #fff; stroke: none; }\n svg .brand-mark-frame {\n fill: none;\n stroke: #cbd5e1;\n stroke-width: 0.8;\n vector-effect: non-scaling-stroke;\n }\n svg .brand-mark-fallback {\n fill: none;\n stroke: #475569;\n stroke-width: 1.15;\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n svg[data-preset=\"blueprint\"] .brand-mark-badge,\n svg[data-preset=\"blueprint\"] .brand-mark-frame { rx: 1px; }\n\n /* Reading Depth is a viewer-only level-of-detail layer. MAP preserves the\n authored structure and primary labels, READ restores relationship labels\n and node context, and FULL restores tags and fine annotations. Semantic\n intent can reveal the relevant detail without moving any geometry. */\n svg [data-detail] { transition: opacity 160ms ease; }\n svg [data-detail-anchor] {\n transform-box: fill-box;\n transform-origin: center;\n transition: transform 160ms ease;\n }\n .diagram-container[data-detail-level=\"map\"] svg [data-detail=\"context\"],\n .diagram-container[data-detail-level=\"map\"] svg [data-detail=\"fine\"],\n .diagram-container[data-detail-level=\"read\"] svg [data-detail=\"fine\"] {\n opacity: 0;\n pointer-events: none;\n }\n .diagram-container[data-detail-level=\"map\"] svg [data-detail-anchor] {\n transform: translateY(8px);\n }\n\n /* Focus, lens, preview, route, and story states are stronger reader intent than\n the global zoom level. Reveal only their exact semantic matches. */\n svg[data-focus-active] [data-focus-match][data-detail],\n svg[data-focus-active] [data-focus-match] [data-detail],\n svg[data-reach-active] [data-reach-match][data-detail],\n svg[data-reach-active] [data-reach-match] [data-detail],\n svg[data-lens-active] [data-lens-match][data-detail],\n svg[data-lens-active] [data-lens-match] [data-detail],\n svg[data-legend-preview-active] [data-legend-preview-match][data-detail],\n svg[data-legend-preview-active] [data-legend-preview-match] [data-detail],\n svg[data-intent-trace-active] [data-intent-trace-match][data-detail],\n svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],\n svg[data-route-active] [data-route-match][data-detail],\n svg[data-route-active] [data-route-match] [data-detail],\n svg[data-relationship-preview-active] [data-relationship-preview][data-detail],\n svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],\n svg [data-node-id]:hover [data-detail],\n svg [data-node-id]:focus-visible [data-detail] {\n opacity: 1;\n pointer-events: auto;\n }\n svg[data-focus-active] [data-focus-match] [data-detail-anchor],\n svg[data-reach-active] [data-reach-match] [data-detail-anchor],\n svg[data-lens-active] [data-lens-match] [data-detail-anchor],\n svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],\n svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],\n svg[data-route-active] [data-route-match] [data-detail-anchor],\n svg [data-node-id]:hover [data-detail-anchor],\n svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }\n\n /* Arrows */\n .a-default { stroke: var(--arrow); fill: none; }\n .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }\n .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }\n .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }\n\n /* Arrowhead markers reference these */\n .m-default { fill: var(--arrow); }\n .m-emphasis { fill: var(--arrow-emphasis); }\n .m-security { fill: var(--security-stroke); }\n .m-dashed { fill: var(--database-stroke); }\n\n /* Stable semantic exploration hooks emitted by every renderer. */\n svg [data-node-id] {\n cursor: pointer;\n transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;\n }\n svg [data-edge-from],\n svg [data-graph-role=\"automatic-crossover-underlay\"] { transition: opacity 0.18s ease, filter 0.18s ease; }\n svg [data-node-id]:hover,\n svg [data-node-id]:focus-visible {\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n outline: none;\n }\n /* Verified Source Beacons are installed at runtime only for nodes whose\n repository evidence passed the local revision/blob/line checks. They\n live inside the owning node so every focus, route, story, and guided\n view keeps one coherent opacity state. Export serialization removes\n them before producing the canonical SVG or any derived visual. */\n .source-evidence-beacon {\n pointer-events: none;\n opacity: 0.76;\n transition: opacity 160ms ease, filter 160ms ease;\n }\n .source-evidence-beacon rect {\n fill: color-mix(in srgb, var(--mask) 92%, var(--backend-stroke));\n stroke: color-mix(in srgb, var(--backend-stroke) 82%, var(--panel-border));\n stroke-width: 1;\n vector-effect: non-scaling-stroke;\n }\n .source-evidence-beacon text {\n fill: var(--backend-stroke);\n font-size: 5.5px;\n font-weight: 800;\n letter-spacing: 0.06em;\n text-anchor: middle;\n text-transform: uppercase;\n }\n svg [data-node-id]:hover .source-evidence-beacon,\n svg [data-node-id]:focus-visible .source-evidence-beacon,\n svg [data-node-id][data-focus-selected] .source-evidence-beacon {\n opacity: 1;\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));\n }\n svg[data-preset=\"signal-flow\"] .source-evidence-beacon { opacity: 0.9; }\n svg[data-preset=\"blueprint\"] .source-evidence-beacon rect {\n rx: 0.8px;\n filter: none;\n }\n svg [data-legend-kind][role=\"button\"] { cursor: pointer; }\n svg [data-legend-kind]:focus { outline: none; }\n svg [data-legend-hit] {\n fill: transparent;\n stroke: transparent;\n stroke-width: 1.4;\n pointer-events: all;\n vector-effect: non-scaling-stroke;\n transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;\n }\n svg [data-legend-count-badge] { pointer-events: none; }\n svg [data-legend-count-badge] rect {\n fill: var(--mask);\n stroke: var(--panel-border);\n stroke-width: 1;\n vector-effect: non-scaling-stroke;\n }\n svg [data-legend-count-badge] text {\n fill: var(--text-muted);\n font-size: 8px;\n font-weight: 700;\n text-anchor: middle;\n }\n svg [data-legend-kind][role=\"button\"]:hover [data-legend-hit] {\n stroke: color-mix(in srgb, var(--database-stroke) 58%, transparent);\n }\n svg [data-legend-kind][role=\"button\"]:focus-visible [data-legend-hit] {\n stroke: var(--frontend-stroke);\n stroke-width: 1.8;\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg [data-legend-kind][data-legend-selected] [data-legend-hit] {\n stroke: var(--database-stroke);\n stroke-width: 2.2;\n stroke-dasharray: 3 2;\n }\n svg [data-legend-kind][data-legend-selected] [data-legend-count-badge] rect {\n stroke: var(--database-stroke);\n stroke-width: 1.8;\n }\n svg [data-legend-kind][data-legend-zero] { opacity: 0.44; }\n svg[data-preset=\"signal-flow\"] [data-legend-kind][data-legend-selected] [data-legend-hit] {\n filter: drop-shadow(0 0 4px var(--database-stroke));\n }\n svg[data-preset=\"blueprint\"] [data-legend-hit],\n svg[data-preset=\"blueprint\"] [data-legend-count-badge] rect { rx: 0; filter: none; }\n svg[data-legend-preview-active] [data-node-id],\n svg[data-legend-preview-active] [data-edge-from] { opacity: 0.11; }\n svg[data-legend-preview-active] [data-legend-preview-match] { opacity: 1; }\n svg[data-legend-preview-active] [data-legend-preview-peer] { opacity: 0.62; }\n svg[data-legend-preview-active] [data-legend-preview-selected] {\n filter: drop-shadow(0 0 8px var(--database-stroke));\n }\n svg[data-lens-active] [data-node-id],\n svg[data-lens-active] [data-edge-from] { opacity: 0.11; }\n svg[data-lens-active] [data-lens-match] { opacity: 1; }\n svg[data-lens-active] [data-lens-peer] { opacity: 0.62; }\n svg[data-lens-active] [data-lens-selected] {\n filter: drop-shadow(0 0 10px var(--database-stroke));\n }\n .semantic-lens-overlay { pointer-events: none; }\n .semantic-lens-flow {\n fill: none;\n stroke-width: 3.05;\n stroke-linecap: round;\n stroke-dasharray: 0.075 0.925;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.9;\n animation: archify-semantic-lens-flow 1.35s linear 1 both;\n animation-delay: var(--lens-flow-delay, 0s);\n }\n .semantic-lens-flow[data-direction=\"out\"],\n .semantic-lens-flow[data-direction=\"forward\"] {\n stroke: var(--frontend-stroke);\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n .semantic-lens-flow[data-direction=\"in\"],\n .semantic-lens-flow[data-direction=\"reverse\"] {\n stroke: var(--database-stroke);\n filter: drop-shadow(0 0 3px var(--database-stroke));\n }\n .semantic-lens-flow[data-direction=\"within\"] {\n stroke: var(--messagebus-stroke);\n filter: drop-shadow(0 0 3px var(--messagebus-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow {\n stroke-width: 3.7;\n opacity: 1;\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"out\"],\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"forward\"] {\n filter: drop-shadow(0 0 6px var(--frontend-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"in\"],\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"reverse\"] {\n filter: drop-shadow(0 0 6px var(--database-stroke));\n }\n svg[data-preset=\"signal-flow\"] .semantic-lens-flow[data-direction=\"within\"] {\n filter: drop-shadow(0 0 6px var(--messagebus-stroke));\n }\n svg[data-preset=\"blueprint\"] .semantic-lens-flow {\n stroke-width: 2.45;\n stroke-linecap: square;\n filter: none;\n opacity: 0.78;\n }\n html[data-embed=\"true\"] .semantic-lens-overlay { display: none; }\n /* Automatic crossover masks are visual companions of their one semantic\n edge. Keep the mask free of data-edge-* identity so graph traversal and\n export still observe exactly one edge, then mirror reader emphasis from\n the paired foreground path in this presentation-only wrapper. */\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.11; }\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-legend-preview-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-lens-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-legend-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-legend-preview-peer]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n svg[data-lens-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-lens-peer]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.62; }\n svg[data-focus-active] [data-node-id],\n svg[data-focus-active] [data-edge-from] { opacity: 0.13; }\n svg[data-focus-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.13; }\n svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-focus-active] [data-focus-match] { opacity: 1; }\n svg[data-focus-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-focus-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n\n /* Authored Reachability is a bounded graph query over the relationships\n already present in the artifact. Upstream walks incoming edges;\n downstream walks outgoing edges. It never claims runtime causality and\n changes only viewer emphasis, not canonical geometry or export bytes. */\n svg[data-reach-active] [data-node-id],\n svg[data-reach-active] [data-edge-from] { opacity: 0.09; }\n svg[data-reach-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.09; }\n svg[data-reach-active] [data-reach-match] { opacity: 1; }\n svg[data-reach-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-reach-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-reach-active=\"upstream\"] [data-reach-origin] {\n filter: drop-shadow(0 0 11px var(--database-stroke));\n }\n svg[data-reach-active=\"downstream\"] [data-reach-origin] {\n filter: drop-shadow(0 0 11px var(--backend-stroke));\n }\n svg[data-reach-active=\"upstream\"] [data-edge-from][data-reach-match] {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));\n }\n svg[data-reach-active=\"downstream\"] [data-edge-from][data-reach-match] {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));\n }\n svg[data-preset=\"blueprint\"][data-reach-active] [data-reach-origin],\n svg[data-preset=\"blueprint\"][data-reach-active] [data-edge-from][data-reach-match] {\n filter: none;\n }\n\n /* Direct Relationship Explorer makes authored paths a real input surface\n without changing their visible stroke or canonical SVG. A transparent\n runtime rail supplies forgiving pointer geometry; the exact authored\n path and endpoints continue to carry every visible state. */\n .relationship-hit-overlay { pointer-events: none; }\n .relationship-hit-target { outline: none; }\n .relationship-hit-rail {\n fill: none;\n stroke: transparent;\n stroke-width: 24;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n pointer-events: stroke;\n cursor: pointer;\n }\n .relationship-focus-rail {\n fill: none;\n stroke: color-mix(in srgb, var(--frontend-stroke) 34%, transparent);\n stroke-width: 6;\n stroke-dasharray: 2 4;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n pointer-events: none;\n opacity: 0;\n }\n .relationship-hit-target:focus-visible .relationship-focus-rail {\n opacity: 1;\n }\n svg[data-preset=\"blueprint\"] .relationship-hit-target:focus-visible .relationship-focus-rail {\n stroke-linecap: square;\n filter: none;\n }\n svg[data-relationship-direct-active] [data-node-id],\n svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }\n svg[data-relationship-direct-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.16; }\n svg[data-relationship-direct-active] [data-relationship-preview],\n svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }\n svg[data-relationship-direct-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-relationship-preview]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,\n svg[data-route-picking] .relationship-hit-rail,\n svg[data-route-active] .relationship-hit-rail,\n svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }\n html[data-embed=\"true\"] .relationship-hit-overlay { display: none; }\n @media (hover: none), (pointer: coarse) {\n .relationship-hit-rail { stroke-width: 24; }\n }\n\n /* Relationship Preview is temporary exploration state layered on top of\n neighborhood focus. It changes emphasis only; exported geometry and the\n relationship's original solid/dashed visual language stay untouched. */\n svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }\n svg[data-relationship-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-focus-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-relationship-preview-active] [data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }\n svg[data-relationship-preview-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-relationship-preview]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-relationship-preview-active] [data-relationship-preview] {\n filter: drop-shadow(0 0 5px var(--arrow-emphasis));\n }\n svg[data-relationship-preview-active] [data-relationship-preview] path,\n svg[data-relationship-preview-active] path[data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview] line,\n svg[data-relationship-preview-active] line[data-relationship-preview],\n svg[data-relationship-preview-active] [data-relationship-preview] polyline,\n svg[data-relationship-preview-active] polyline[data-relationship-preview] {\n stroke-width: 2.75;\n }\n svg[data-relationship-preview-active] [data-relationship-preview-source] {\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n }\n svg[data-relationship-preview-active] [data-relationship-preview-target] {\n filter: drop-shadow(0 0 7px var(--database-stroke));\n }\n .relationship-pulse-overlay { pointer-events: none; }\n .relationship-flow-pulse {\n fill: none;\n stroke: var(--arrow-emphasis);\n stroke-width: 3.35;\n stroke-linecap: round;\n stroke-dasharray: 0.085 0.915;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0;\n filter: drop-shadow(0 0 4px var(--arrow-emphasis));\n animation: archify-relationship-pulse 1.2s linear 1 both;\n }\n svg[data-preset=\"signal-flow\"] .relationship-flow-pulse {\n stroke: var(--frontend-stroke);\n stroke-width: 3.85;\n filter: drop-shadow(0 0 7px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"] .relationship-flow-pulse {\n stroke-width: 2.5;\n stroke-linecap: square;\n filter: none;\n }\n svg[data-preset=\"editorial\"] .relationship-flow-pulse {\n stroke: var(--arrow-emphasis);\n stroke-width: 2.75;\n filter: none;\n }\n .semantic-flow-token {\n color: var(--frontend-stroke);\n opacity: 0;\n pointer-events: none;\n }\n .relationship-flow-token {\n animation: archify-relationship-token-life 1.2s linear 1 both;\n }\n\n .semantic-flow-token-halo {\n fill: var(--mask);\n stroke: currentColor;\n stroke-width: 1.1;\n vector-effect: non-scaling-stroke;\n opacity: 0.96;\n }\n .relationship-flow-token-shape {\n fill: var(--mask);\n stroke: currentColor;\n stroke-width: 1.35;\n stroke-linecap: round;\n stroke-linejoin: round;\n vector-effect: non-scaling-stroke;\n }\n .relationship-flow-token-ink {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.05;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n .relationship-flow-token-dot { fill: currentColor; stroke: none; }\n .semantic-flow-token[data-token-kind=\"data\"] { color: var(--database-stroke); }\n .semantic-flow-token[data-token-kind=\"event\"] { color: var(--messagebus-stroke); }\n .semantic-flow-token[data-token-kind=\"security\"] { color: var(--security-stroke); }\n .semantic-flow-token[data-token-kind=\"state\"] { color: var(--cloud-stroke); }\n svg[data-preset=\"signal-flow\"] .semantic-flow-token {\n filter: drop-shadow(0 0 5px currentColor);\n }\n svg[data-preset=\"blueprint\"] .semantic-flow-token { filter: none; }\n svg[data-preset=\"editorial\"] .semantic-flow-token { filter: none; }\n html[data-embed=\"true\"] .relationship-pulse-overlay { display: none; }\n\n /* Intent Trace is a temporary, pre-click exploration layer. Related\n topology stays readable while a short viewer-only signal runs over\n cloned edge geometry; the authored edge remains untouched underneath. */\n /* Keep the node's opaque backing mask intact while its visible ink dims.\n Fading the whole group also fades that mask and briefly exposes arrows\n routed underneath the node when the pointer leaves. */\n svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }\n svg [data-node-id] \u003e .c-mask { fill-opacity: 1; }\n svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }\n svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }\n svg[data-intent-trace-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.2; }\n svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }\n svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }\n svg[data-intent-trace-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-intent-trace-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-intent-trace-active] [data-intent-trace-selected] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n .intent-trace-overlay { pointer-events: none; }\n .intent-trace-flow {\n fill: none;\n stroke-width: 3.1;\n stroke-linecap: round;\n stroke-dasharray: 0.1 0.9;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.94;\n animation: archify-intent-trace-flow 1.15s linear 1 both;\n }\n /* Direction names describe each edge relative to the focused node only.\n The cloned geometry already runs from the authored source to target, so\n incoming and outgoing signals must share the same playback direction. */\n .intent-trace-flow[data-direction=\"out\"] {\n stroke: var(--frontend-stroke);\n filter: drop-shadow(0 0 4px var(--frontend-stroke));\n }\n .intent-trace-flow[data-direction=\"in\"] {\n stroke: var(--database-stroke);\n filter: drop-shadow(0 0 4px var(--database-stroke));\n animation-direction: normal;\n }\n .intent-trace-flow[data-direction=\"loop\"] {\n stroke: var(--security-stroke);\n filter: drop-shadow(0 0 4px var(--security-stroke));\n }\n svg[data-preset=\"blueprint\"] [data-intent-trace-selected],\n svg[data-preset=\"blueprint\"] .intent-trace-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"editorial\"] [data-intent-trace-selected],\n svg[data-preset=\"editorial\"] .intent-trace-flow { filter: none; }\n .intent-trace-status {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n\n /* Route Probe separates a durable two-point query from selection and\n one-hop hover. Only the chosen shortest directed path stays prominent;\n the traveling signal is cloned viewer geometry and never authored SVG. */\n svg[data-route-picking=\"target\"] [data-node-id] { opacity: 0.24; }\n svg[data-route-picking=\"target\"] [data-route-candidate],\n svg[data-route-picking=\"target\"] [data-route-start] { opacity: 1; }\n svg[data-route-picking] [data-node-id] { cursor: crosshair; }\n svg[data-route-picking] [data-route-start] {\n filter: drop-shadow(0 0 10px var(--frontend-stroke));\n }\n svg[data-route-active] [data-node-id],\n svg[data-route-active] [data-edge-from] { opacity: 0.11; }\n svg[data-route-active] [data-graph-role=\"automatic-crossover\"] \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.11; }\n svg[data-route-active] [data-route-match] { opacity: 1; }\n svg[data-route-active] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-route-active] [data-route-start] {\n filter: drop-shadow(0 0 11px var(--frontend-stroke));\n }\n svg[data-route-active] [data-route-end] {\n filter: drop-shadow(0 0 11px var(--security-stroke));\n }\n svg[data-route-active] [data-route-step]:not([data-route-start]):not([data-route-end]) {\n filter: drop-shadow(0 0 7px var(--backend-stroke));\n }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"past\"] { opacity: 0.62; }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"future\"] { opacity: 0.34; }\n svg[data-route-journey] [data-route-match][data-route-journey-state=\"current\"] { opacity: 1; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"past\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.62; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"future\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.34; }\n svg[data-route-journey] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-route-match][data-route-journey-state=\"current\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n svg[data-route-journey] [data-node-id][data-route-journey-current] {\n filter: drop-shadow(0 0 10px var(--backend-stroke));\n }\n svg[data-route-journey] [data-edge-from][data-route-journey-current] {\n opacity: 1;\n filter: drop-shadow(0 0 6px var(--backend-stroke));\n }\n .route-probe-overlay { pointer-events: none; }\n .route-journey-overlay { pointer-events: none; }\n .route-probe-flow {\n fill: none;\n stroke: var(--backend-stroke);\n stroke-width: 3.25;\n stroke-linecap: round;\n stroke-dasharray: 0.085 0.915;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0.96;\n filter: drop-shadow(0 0 5px var(--backend-stroke));\n animation: archify-route-probe-flow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 1 both;\n animation-delay: calc(var(--route-step, 0) * 0.16s);\n }\n .route-journey-flow {\n fill: none;\n stroke: var(--backend-stroke);\n stroke-width: 3.5;\n stroke-linecap: round;\n stroke-dasharray: 0.1 0.9;\n stroke-dashoffset: 0;\n vector-effect: non-scaling-stroke;\n opacity: 0;\n filter: drop-shadow(0 0 6px var(--backend-stroke));\n animation: archify-route-journey-flow 780ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;\n }\n svg[data-preset=\"blueprint\"] [data-route-start],\n svg[data-preset=\"blueprint\"] [data-route-end],\n svg[data-preset=\"blueprint\"] [data-route-step],\n svg[data-preset=\"blueprint\"] .route-probe-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"blueprint\"] .route-journey-flow {\n filter: none;\n stroke-linecap: square;\n }\n svg[data-preset=\"editorial\"] [data-route-start],\n svg[data-preset=\"editorial\"] [data-route-end],\n svg[data-preset=\"editorial\"] [data-route-step],\n svg[data-preset=\"editorial\"] .route-probe-flow,\n svg[data-preset=\"editorial\"] .route-journey-flow { filter: none; }\n\n svg[data-preset=\"editorial\"] .c-grid {\n stroke-dasharray: 1 4;\n opacity: 0.48;\n }\n svg[data-preset=\"editorial\"] .c-region {\n fill: color-mix(in srgb, var(--cloud-fill) 48%, transparent);\n stroke-dasharray: 9 4;\n }\n svg[data-preset=\"editorial\"] [data-node-id]:hover,\n svg[data-preset=\"editorial\"] [data-node-id]:focus-visible,\n svg[data-preset=\"editorial\"][data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent));\n }\n\n svg[data-preset=\"blueprint\"] .c-grid {\n stroke-dasharray: 1 3;\n opacity: 0.78;\n }\n svg[data-preset=\"blueprint\"] .c-region {\n fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);\n stroke-dasharray: 12 4 2 4;\n }\n svg[data-preset=\"blueprint\"] .c-security-group,\n svg[data-preset=\"blueprint\"] .c-lane { stroke-dasharray: 7 3; }\n svg[data-preset=\"blueprint\"] [data-node-id]:hover,\n svg[data-preset=\"blueprint\"] [data-node-id]:focus-visible {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"][data-focus-active] [data-focus-selected] {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n svg[data-preset=\"blueprint\"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {\n filter: none;\n }\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview],\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview-source],\n svg[data-preset=\"blueprint\"][data-relationship-preview-active] [data-relationship-preview-target] {\n filter: drop-shadow(0 0 3px var(--frontend-stroke));\n }\n\n /* Dashed boundary variants */\n .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }\n .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }\n .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }\n\n /* Optional trace animation, enabled only by meta.animation = \"trace\".\n The ordinary viewer performs one ambient pass and then restores the\n authored solid/security/async line language. WebM samples the same\n authored geometry into an explicit canvas timeline. */\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-animate=\"edge\"] {\n animation: archify-edge-flow 2.4s linear 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: archify-edge-flow 2.4s linear 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n html[data-ambient-motion=\"running\"] svg[data-animation=\"trace\"] [data-animate=\"node\"] {\n transform-box: fill-box;\n transform-origin: center;\n animation: archify-node-pulse 3.6s ease-in-out 1;\n animation-delay: calc(var(--step, 0) * 160ms);\n }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n stroke-linecap: round;\n filter: drop-shadow(0 0 3px var(--arrow-emphasis));\n animation-duration: 1.75s;\n }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 1.75s; }\n svg[data-preset=\"signal-flow\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-duration: 3.1s;\n }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n stroke-linecap: square;\n filter: none;\n animation-duration: 2.15s;\n }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 2.15s; }\n svg[data-preset=\"blueprint\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-name: archify-blueprint-node-pulse;\n animation-duration: 3.8s;\n }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-animate=\"edge\"] {\n filter: none;\n animation-duration: 2.2s;\n }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] { animation-duration: 2.2s; }\n svg[data-preset=\"editorial\"][data-animation=\"trace\"] [data-animate=\"node\"] {\n animation-name: archify-editorial-node-pulse;\n animation-duration: 3.5s;\n }\n /* Embedded proofs stay static so proof grids are calm instead of leaving\n ambient trace loops on. */\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-animate],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n html[data-embed=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"],\n html[data-share-playback=\"true\"] svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n @keyframes archify-edge-flow {\n 0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }\n 88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }\n 99.9% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }\n 100% { stroke-dashoffset: 0; opacity: 1; }\n }\n @keyframes archify-node-pulse {\n 0%, 72%, 100% { filter: none; stroke-width: 1.5; }\n 18%, 36% {\n filter: drop-shadow(0 0 8px var(--arrow-emphasis));\n stroke-width: 2.4;\n }\n }\n @keyframes archify-blueprint-node-pulse {\n 0%, 72%, 100% { opacity: 1; filter: none; }\n 18%, 36% { opacity: 0.72; filter: drop-shadow(0 0 2px var(--frontend-stroke)); }\n }\n @keyframes archify-editorial-node-pulse {\n 0%, 72%, 100% { opacity: 1; filter: none; }\n 18%, 36% { opacity: 0.78; filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent)); }\n }\n @keyframes archify-signal-scan {\n 0%, 18% { opacity: 1; transform: translateX(-70%); }\n 70% { opacity: 1; transform: translateX(70%); }\n 100% { opacity: 0; transform: translateX(70%); }\n }\n @keyframes archify-radar-live {\n 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }\n 55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }\n }\n\n @keyframes archify-intent-trace-flow {\n 0% { opacity: 0.28; stroke-dashoffset: 0; }\n 12%, 78% { opacity: 0.94; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-route-probe-flow {\n 0% { stroke-dashoffset: 0; opacity: 0.96; }\n 78% { stroke-dashoffset: -1; opacity: 0.96; }\n 100% { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.58; }\n }\n @keyframes archify-route-journey-flow {\n 0% { opacity: 0.16; stroke-dashoffset: 0; }\n 14%, 76% { opacity: 1; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-semantic-lens-flow {\n 0% { opacity: 0.2; stroke-dashoffset: 0; }\n 12%, 78% { opacity: 0.9; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-relationship-pulse {\n 0% { opacity: 0.18; stroke-dashoffset: 0; }\n 10%, 76% { opacity: 0.98; }\n 100% { opacity: 0; stroke-dashoffset: -1; }\n }\n @keyframes archify-relationship-token-life {\n 0%, 7% { opacity: 0; }\n 13%, 82% { opacity: 1; }\n 100% { opacity: 0; }\n }\n\n @keyframes archify-share-cue-enter {\n from { opacity: 0; transform: translate(-50%, -0.45rem); }\n to { opacity: 1; transform: translate(-50%, 0); }\n }\n @keyframes archify-share-cue-pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.48; transform: scale(0.78); }\n }\n @media (prefers-reduced-motion: reduce) {\n html[data-preset=\"signal-flow\"] .diagram-container::before {\n animation: none !important;\n }\n .pulse-dot { animation: none !important; }\n svg[data-animation=\"trace\"] [data-animate] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n svg[data-animation=\"trace\"] [data-graph-role=\"automatic-crossover\"]:has(\u003e [data-animate=\"edge\"]) \u003e [data-graph-role=\"automatic-crossover-underlay\"] {\n animation: none !important;\n stroke-dashoffset: 0;\n }\n .intent-trace-flow,\n .route-probe-flow,\n .semantic-lens,\n .diagram-guide,\n .overview-map-live { animation: none !important; }\n \n .intent-trace-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.72;\n }\n .route-probe-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n opacity: 0.78;\n }\n .route-journey-overlay { display: none !important; }\n .semantic-lens-flow {\n animation: none !important;\n stroke-dasharray: none;\n stroke-width: 2.2;\n opacity: 0.34;\n filter: none;\n }\n .relationship-pulse-overlay { display: none !important; }\n .source-evidence-beacon,\n svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }\n }\n ";
let activeIndex = -1;
let playbackToken = 0;
let playbackTimer = 0;
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index a0e96259..a4447b83 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,8 +219,8 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "80a4ffba1f622f0c7bb9a5b1b408f5fc64be28d5f0f1b60e334de6c080d64087",
- "bytes": 2114532
+ "sha256": "0ea34716a1963e6d0649b0129f577b182b387f40b7332112e4babf1ff54c45c7",
+ "bytes": 2125890
},
"validation": {
"checksPassed": 28,
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index ad408f48..aea27401 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9611,16 +9633,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9646,10 +9682,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9687,23 +9724,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9945,8 +9989,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9960,7 +10032,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9980,7 +10052,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10002,7 +10074,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10057,7 +10129,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10083,6 +10155,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10115,6 +10188,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index 11115766..2126f666 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9546,16 +9568,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9581,10 +9617,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9622,23 +9659,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9880,8 +9924,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9895,7 +9967,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9915,7 +9987,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9937,7 +10009,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -9992,7 +10064,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10018,6 +10090,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10050,6 +10123,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index 67883a53..e272f8f0 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9626,16 +9648,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9661,10 +9697,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9702,23 +9739,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9960,8 +10004,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9975,7 +10047,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9995,7 +10067,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10017,7 +10089,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10072,7 +10144,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10098,6 +10170,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10130,6 +10203,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index 236603fd..9f01fb38 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9599,16 +9621,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9634,10 +9670,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9675,23 +9712,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9933,8 +9977,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9948,7 +10020,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9968,7 +10040,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9990,7 +10062,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10045,7 +10117,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10071,6 +10143,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10103,6 +10176,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/examples/web-app.html b/examples/web-app.html
index 236603fd..9f01fb38 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9599,16 +9621,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9634,10 +9670,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9675,23 +9712,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9933,8 +9977,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9948,7 +10020,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9968,7 +10040,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -9990,7 +10062,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10045,7 +10117,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10071,6 +10143,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10103,6 +10176,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index 813ff7fc..299790dd 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9617,16 +9639,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9652,10 +9688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9693,23 +9730,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9951,8 +9995,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9966,7 +10038,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9986,7 +10058,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10008,7 +10080,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10063,7 +10135,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10089,6 +10161,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10121,6 +10194,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/experiments/mco-showcase/mco-runtime.html b/experiments/mco-showcase/mco-runtime.html
index 46f7aa0b..b879280c 100644
--- a/experiments/mco-showcase/mco-runtime.html
+++ b/experiments/mco-showcase/mco-runtime.html
@@ -908,6 +908,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2538,15 +2539,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
- /* The rail takes exactly the diagram's height: notes scroll when long and
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2614,28 +2616,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
- /* Bottom: notes keep their card grid and the index sits beside them. */
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
- html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
- html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
- html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
- html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2771,9 +2793,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
- html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
- html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
- html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;
@@ -9624,16 +9646,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -9659,10 +9695,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -9700,23 +9737,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
@@ -9958,8 +10002,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -9973,7 +10045,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -9993,7 +10065,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -10015,7 +10087,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -10070,7 +10142,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -10096,6 +10168,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -10128,6 +10201,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/viewer/reader-layout.js b/viewer/reader-layout.js
index 6e5f1ec4..7002f8ee 100644
--- a/viewer/reader-layout.js
+++ b/viewer/reader-layout.js
@@ -146,16 +146,30 @@
railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
}
if (railPlacement) {
- railPlacement.hidden = !mode || mode === 'collapsed';
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
railPlacement.title = railPlacement.getAttribute('aria-label');
}
}
+ var outline = document.getElementById('node-outline');
function hasCards() {
- var outline = document.getElementById('node-outline');
return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
}
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
+ }
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
var diagramStyle = window.getComputedStyle(diagram);
@@ -181,10 +195,11 @@
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
+ ) - window.innerHeight - belowFold();
if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
settledCap = lastWidth;
@@ -222,23 +237,30 @@
minWidth = Math.min(readableMinimumWidth, viewportCap);
}
var primaryWidth = primaryReadingWidth();
- if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var railExtra = RAIL_WIDTH + RAIL_GAP;
var mode = null;
- if (hasCards() && window.innerWidth >= RAIL_MIN_VIEWPORT) {
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
- if (readPreference(RAIL_PLACEMENT_KEY) === 'bottom') mode = 'bottom';
- else if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
else mode = fitsReadable ? 'true' : 'overlay';
}
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
var docked = mode === 'true';
setRail(mode);
chrome = chromeMetrics();
if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
- var stackedBelow = mode === 'bottom' ? outerHeight(railPanel) : docked ? 0 : outerHeight(cards);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
diff --git a/viewer/viewer-chrome-layout.js b/viewer/viewer-chrome-layout.js
index cefa8f7e..d603a809 100644
--- a/viewer/viewer-chrome-layout.js
+++ b/viewer/viewer-chrome-layout.js
@@ -141,8 +141,36 @@
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -156,7 +184,7 @@
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -176,7 +204,7 @@
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -198,7 +226,7 @@
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -253,7 +281,7 @@
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -279,6 +307,7 @@
archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -311,6 +340,7 @@
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
diff --git a/viewer/viewer.css b/viewer/viewer.css
index 5ed36d86..8386b3d7 100644
--- a/viewer/viewer.css
+++ b/viewer/viewer.css
@@ -739,6 +739,7 @@ svg {
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
@@ -2369,15 +2370,16 @@ html[data-reader-rail="true"] .container {
}
html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
-/* The rail takes exactly the diagram's height: notes scroll when long and
+/* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
the index keeps a usable share instead of collapsing to its header. */
html[data-reader-rail="true"] .reader-rail {
display: flex;
flex-direction: column;
grid-column: 2;
align-self: stretch;
- contain: size;
min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
@@ -2445,28 +2447,48 @@ html[data-reader-rail="overlay"] .reader-rail {
from { opacity: 0; transform: translateX(0.75rem); }
to { opacity: 1; transform: translateX(0); }
}
-/* Bottom: notes keep their card grid and the index sits beside them. */
+/* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
html[data-reader-rail="bottom"] .reader-rail {
display: grid;
- grid-template-columns: minmax(0, 1fr) 18rem;
- gap: 0.5rem 1rem;
- align-items: start;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
margin-top: 1rem;
}
-html[data-reader-rail="bottom"] .rail-controls { grid-column: 1 / -1; }
-html[data-reader-rail="bottom"] .cards { margin-top: 0; }
+html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
html[data-reader-rail="bottom"] .cards:empty { display: none; }
-html[data-reader-rail="bottom"] .cards:empty ~ .node-outline { grid-column: 1 / -1; }
html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
- display: flex;
- flex-direction: column;
- max-height: 22rem;
- padding: 0 0.875rem 0.25rem;
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
border: 1px solid var(--panel-border);
border-radius: 0.75rem;
background: var(--panel);
}
-html[data-reader-rail="bottom"] .node-outline-head { padding-top: 0.875rem; }
+html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+}
+html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+}
+/* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
.rail-controls { display: none; }
html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
display: flex;
@@ -2602,9 +2624,9 @@ html[data-motion="still"] .reader-rail { animation: none !important; }
}
/* The rail frees the vertical budget, so compact viewports keep the normal
title spacing instead of the stacked layout's tight stage rail. */
-html[data-reader-rail] body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
-html[data-reader-rail] .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
-html[data-reader-rail] .header { min-height: 0; margin-bottom: 1.125rem; }
+html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
.node-outline-item {
position: relative;
display: grid;