/* The Rack Builder: two faces side by side, one scroll, and a side panel. */
/* The font goes on .rk, not body.tool: the Explorer and Annotator get theirs from
   shell.js's body rule, which body.tool would override. Nothing else on this
   page sets one, so without it the tool falls back to the browser's serif. */
.rk { background: var(--pt-ground); color: var(--pt-ink); font-family: var(--pt-font-body); }
.rk-bar { display: flex; gap: 0.6rem; align-items: center; padding: 0.5rem 1rem;
          border-bottom: 1px solid var(--pt-line); background: var(--pt-surface); }
.rk-bar button, .rk-side button, .rk-lens button { background: var(--pt-surface-2); color: var(--pt-ink);
  border: 1px solid var(--pt-line); border-radius: 6px; padding: 0.3rem 0.7rem; cursor: pointer; font: inherit; }
.rk-bar button:hover, .rk-side button:hover { border-color: var(--pt-brass); }
.rk-note { color: var(--pt-warn); font-size: 0.85rem; }
.rk-zoom { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.rk-zoom button { min-width: 2rem; }
#zoomLevel { color: var(--pt-ink-muted); font-size: 0.85rem; min-width: 3.2rem; text-align: center; }
/* The 2D/3D switch and the stage swatches are the Explorer's and Annotate's:
   their shape is site/mode3d.js's MODE3D_CSS, which this page injects too, and
   these are the shell's button and swatch rules (vendor/shell.js), which this
   page does not otherwise load. The variables are the shell's, mapped onto the
   site's by site/tool-theme.css. #mode outranks .rk-bar button, so this page's
   own bar buttons do not reach it. The font is the shell's too (system-ui):
   `inherit` alone would take this page's body face, and the switch would
   read differently here than in the Explorer. */
#mode button { font: inherit; font-family: system-ui, sans-serif; font-size: 0.78rem; background: var(--control); color: var(--ink);
  border: 1px solid var(--control-line); padding: 0.26rem 0.5rem; cursor: pointer; }
#mode button:hover { background: var(--control-hover); border-color: var(--control-line); }
#mode button.on { background: var(--on-bg); border-color: var(--accent); color: var(--on-ink); }
#mode button:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
/* FRONT / REAR | LEFT / RIGHT (#187): which pair of the rack's sides the two
   panes show, beside the 2D/3D switch and dressed as it is (site/mode3d.js
   MODE3D_CSS and the rules above), so the two read as one row of switches. */
#view2d, #covers { display: flex; gap: 0.2rem; align-items: center; }
#view2d button, #covers button { font: inherit; font-family: system-ui, sans-serif; font-size: 0.78rem; background: var(--control); color: var(--ink);
  border: 1px solid var(--control-line); padding: 0.26rem 0.5rem; cursor: pointer; border-radius: 0; white-space: nowrap; }
#view2d button:first-child { border-radius: 6px 0 0 6px; }
#view2d button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
#view2d button:hover, #covers button:hover { background: var(--control-hover); border-color: var(--control-line); }
#view2d button.on, #covers button.on { background: var(--on-bg); border-color: var(--accent); color: var(--on-ink); }
#view2d button:focus-visible, #covers button:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
/* COVERS: ON, SEE-THROUGH OR OFF (#190, rack/covers.js): three buttons as one
   control, named by the word before them, the same in 2D and 3D. */
#covers button { border-radius: 0; margin-left: -1px; }
#covers button:first-of-type { border-radius: 6px 0 0 6px; margin-left: 0; }
#covers button:last-of-type { border-radius: 0 6px 6px 0; }
#covers .rk-covers-label { font-family: system-ui, sans-serif; font-size: 0.78rem; color: var(--pt-ink-muted); margin-right: 0.15rem; }
/* The panes follow the setting. See-through is the drawing as it is: the
   cover under the cables, and its copy over them at a third of its strength
   (cable-view.js drawInFront). On, that copy is opaque. Off, neither is
   painted: `visibility`, so the part keeps its box and its own hit target
   takes the click a cover no longer does. From the side a cover is the strip
   the drawing marks data-kind="cover". A rack-mounted part's cover has a copy
   over the cables too, the page's own (covers.js layCovers2d). A cover is a
   PLATE in a cover group (data-class="mechanical"): what fastens one, a
   thumbscrew in the same group, is left alone. Never in a file: a sheet is
   not in the panes. */
.rk-panes[data-covers="on"] :is([data-in-front], [data-covers-front]) [data-front="cover"] { opacity: 1; }
.rk-panes[data-covers="off"] :is([data-in-front], [data-covers-front]) [data-front="cover"],
.rk-panes[data-covers="off"] :is([data-zerou-id], [data-item-id]) :is([data-group="cover"][data-class="mechanical"], [data-kind="cover"]) { visibility: hidden; }
/* SHOW: WHICH LAYERS THE PANES DRAW (#197, rack/layers.js): a menu of five
   presets and five layer toggles. The panes carry the layers that are off in
   data-hide, and what each layer holds carries data-layer; a hidden layer is
   display: none, which also takes it out of the pointer's way. What is selected
   (rk-selected) stays shown, and a cable the reader picked from the list (on)
   with it. Never in a file: a sheet is not in the panes. */
/* The panel hangs from the control's right edge (the control sits toward the
   right of the bar), never wider than the window less 8px each side; layers.js
   shifts it into the window when the control is too near either edge. */
#layersMenu > #layers { left: auto; right: 0; box-sizing: border-box; min-width: min(22rem, calc(100vw - 16px)); max-width: calc(100vw - 16px); }
.rk-layers-row { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.rk-layers-label { width: 4rem; font-family: system-ui, sans-serif; font-size: 0.78rem; color: var(--pt-ink-muted); }
#layers button { font: inherit; font-family: system-ui, sans-serif; font-size: 0.78rem; background: var(--control); color: var(--ink);
  border: 1px solid var(--control-line); border-radius: 6px; padding: 0.26rem 0.5rem; cursor: pointer; white-space: nowrap; text-align: center; }
#layers button:hover { background: var(--control-hover); border-color: var(--control-line); }
#layers button.on { background: var(--on-bg); border-color: var(--accent); color: var(--on-ink); }
#layers button:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
.rk-panes[data-hide~="data"] [data-layer="data"]:not(.on, .rk-selected),
.rk-panes[data-hide~="power"] [data-layer="power"]:not(.on, .rk-selected),
.rk-panes[data-hide~="bundles"] [data-layer="bundles"]:not(.on, .rk-selected),
.rk-panes[data-hide~="managers"] [data-layer="managers"]:not(.rk-selected),
.rk-panes[data-hide~="pdus"] [data-layer="pdus"]:not(.rk-selected) { display: none; }
#stagebg { display: flex; align-items: center; gap: 0.25rem; }
#stagebg .sw { width: 0.95rem; height: 0.95rem; border-radius: 3px; cursor: pointer; padding: 0;
  min-width: 0; border: 1px solid var(--control-line); }
#stagebg .sw:hover { border-color: var(--control-line); }
#stagebg .sw.on { outline: 2px solid var(--ink); outline-offset: 1px; }
#stagebg .sw:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
/* THE PAGE IS NOT FINISHED, and says so: a brass pill that opens a short note
   on what works and what is coming. Brass, the site's accent - not a marking
   color, which the drawings reserve for what a person marks. */
.rk-devnote { position: relative; }
.rk-devnote > summary { list-style: none; cursor: pointer; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.02em; color: var(--pt-brass); border: 1px solid var(--pt-brass);
  border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap; }
.rk-devnote > summary::-webkit-details-marker { display: none; }
.rk-devnote[open] > summary { background: var(--pt-brass-wash, transparent); }
.rk-devnote-body { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0;
  width: min(22rem, calc(100vw - 2rem)); background: var(--pt-surface); color: var(--pt-ink);
  border: 1px solid var(--pt-line); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.85rem; }
.rk-devnote-body p { margin: 0 0 0.5rem; }
.rk-devnote-body p:last-child { margin-bottom: 0; }
.rk-menu { position: relative; }
.rk-menu > summary { list-style: none; cursor: pointer; font-weight: 600; padding: 0.3rem 0.6rem;
  border: 1px solid var(--pt-line); border-radius: 6px; background: var(--pt-surface-2); }
.rk-menu > summary::after { content: ' ▾'; color: var(--pt-ink-muted); }
.rk-menu-items { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 16rem;
  background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: 8px; padding: 0.4rem;
  display: flex; flex-direction: column; gap: 0.15rem; }
.rk-menu-items button { text-align: left; border: none; background: none; }
.rk-menu-items button:hover { background: var(--pt-surface-2); }
.rk-menu-items hr { border: none; border-top: 1px solid var(--pt-line); margin: 0.3rem 0; width: 100%; }
.rk-menu-items .rk-current { color: var(--pt-brass); }
.rk-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 20rem; }
.rk-panes { overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 1rem 1.5rem; }
/* THE STAGE IN 2D. The reader's stage colour (site/rack/stage.js, the Explorer's
   swatches) is the panes' ground, as it is the Explorer's #stage. What is drawn
   on it in the site's tokens - rails, U numbers, tags, outlines, the headings -
   takes the site's dark or light palette by the stage's lightness, whatever the
   page's own theme: the values are brand/tokens.css's two sets, for the ground,
   the inks and the brass. Device faces are their own drawing and do not turn. */
.rk-panes[data-stage] { background: var(--rk-stage); }
.rk-panes[data-stage="dark"] {
  --pt-brass: #C79350; --pt-brass-wash: rgba(199, 147, 80, 0.13); --pt-warn: #F5A623;
  --pt-void: #0A0C0E; --pt-ground: #0E1013; --pt-surface: #16181B; --pt-surface-2: #1C1F23;
  --pt-line: #2C3137; --pt-line-soft: #21252A;
  --pt-ink: #E4E7EA; --pt-ink-muted: #9AA1A8; --pt-ink-faint: #8A9199;
}
.rk-panes[data-stage="light"] {
  --pt-brass: #8A6426; --pt-brass-wash: rgba(142, 103, 41, 0.10); --pt-warn: #8F4E05;
  --pt-void: #DDE1E6; --pt-ground: #EDEFF2; --pt-surface: #FFFFFF; --pt-surface-2: #F4F6F8;
  --pt-line: #D2D8DE; --pt-line-soft: #E4E8ED;
  --pt-ink: #13171B; --pt-ink-muted: #565E67; --pt-ink-faint: #5F666E;
}
.rk-pane h2 { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--pt-ink-muted);
  text-transform: uppercase; letter-spacing: 0.06em; }
.rk-pane svg { width: 100%; height: auto; display: block; }
/* The 3D view, standing in the same grid cell #panes occupies (rack-page.js's
   showMode() toggles which of the two is shown, setting BOTH `hidden` and an
   explicit inline `display` on whichever one is hidden - `.rk-panes` sets its
   own `display: grid`, an author rule that a plain [hidden] alone would lose
   to). Filled by rack3d.js's own canvas, sized off this element. */
.rk-stage3d { grid-column: 1; position: relative; overflow: hidden; background: var(--pt-ground); }
.rk-stage3d canvas { display: block; }
.rk-stage3d .rk-notice { position: absolute; inset: 0; margin: 0; padding: 1rem;
  color: var(--pt-ink-muted); }
.rk-u { cursor: pointer; }
.rk-u:hover { fill: var(--pt-brass); fill-opacity: 0.12; }
.rk-u-selected { fill: var(--pt-brass); fill-opacity: 0.22; }
[data-item-id] { cursor: pointer; }
[data-panel="through"] { opacity: 0.9; }
[data-panel="mounted"], [data-panel="through"], [data-panel="missing"], .rk-ears { touch-action: none; }
.rk-drop { pointer-events: none; }
#undoShrink { margin-top: 0.5rem; }
.rk-side { border-left: 1px solid var(--pt-line); background: var(--pt-surface); overflow: auto; padding: 1rem; }
.rk-side h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.rk-side label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0 0 0.6rem; font-size: 0.85rem;
  color: var(--pt-ink-muted); }
.rk-side input, .rk-side select { font: inherit; color: var(--pt-ink); background: var(--pt-surface-2);
  border: 1px solid var(--pt-line); border-radius: 6px; padding: 0.3rem 0.4rem; }
.rk-side .rk-error { color: var(--pt-warn); font-size: 0.85rem; min-height: 1.2em; }
.rk-side .rk-muted { color: var(--pt-ink-muted); font-size: 0.85rem; }
/* the frame form's rack products: what the frame holds, a search, and the catalogue's products */
.rk-side .rk-picker { border: 1px solid var(--pt-line); border-radius: 6px; margin: 0 0 0.8rem; padding: 0.5rem 0.7rem; min-width: 0; }
.rk-side .rk-picker legend { font-size: 0.85rem; padding: 0 0.3rem; }
.rk-side .rk-product-held { margin: 0 0 0.5rem; }
.rk-side .rk-products { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.3rem; }
.rk-side .rk-products button { width: 100%; text-align: left; }
.rk-side .rk-products button[aria-pressed="true"] { border-color: var(--pt-brass); color: var(--pt-brass); }
.rk-side input:disabled, .rk-side select:disabled { opacity: 0.6; cursor: not-allowed; }
.rk-lens-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, 0.35); }
.rk-lens { position: fixed; inset: 3vh 3vw; z-index: 20; display: flex; flex-direction: column;
  background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); overflow: hidden; }
.rk-lens-bar { display: flex; gap: 0.8rem; align-items: center; padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--pt-line); }
.rk-lens-status { color: var(--pt-ink-muted); font-size: 0.85rem; flex: 1; }
.rk-lens iframe { flex: 1; border: 0; width: 100%; }
@media (max-width: 900px) {
  .rk-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rk-side { border-left: none; border-top: 1px solid var(--pt-line); max-height: 45vh; }
}
.rk-check { flex-direction: row !important; align-items: center; gap: 0.4rem !important; }
.rk-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0; }
.rk-picker select[size] { min-height: 12rem; width: 100%; }
.rk-picker option[data-fits="false"] { color: var(--pt-ink-muted); }
/* The export status sits between the Export menu and the zoom controls;
   .rk-zoom's margin-left: auto absorbs its width, so the 2D/3D switch never
   moves when it changes. */
.rk-export-status { font-size: 0.85rem; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#exportItems { min-width: 19rem; }

/* CABLES (spec §9). cables.js draws them; these are the showcase's own rules
   for a cable and its tag, copied from site/site.css, which this page does
   not load. */
[data-cables] [data-cable] { pointer-events: none; transition: opacity 120ms; }
.cable-focus [data-cable]:not(.on), .cable-focus [data-cable-tag]:not(.on) { opacity: 0.18; }
[data-cable].ghost, [data-cable-tag].ghost, [data-strap].ghost { opacity: 0.12; }
/* Bundles (portrayal-site#142). A bundle is its members; its ENVELOPE (the
   band at its diameter, cable-view.js drawBundles2d) is hidden until the
   bundle, or a cable that rides it, is hovered or selected. A selected
   bundle's envelope is outlined in brass. */
[data-bundle-id] [data-envelope] { visibility: hidden; }
[data-bundle-id]:is(.hot, .hot-member, .on, .on-member) [data-envelope] { visibility: visible; }
[data-bundle-id].on [data-envelope-rim] { opacity: 1; }
[data-bundle-id].on [data-envelope-rim] path { stroke: var(--pt-brass); }
/* STRAPS. In 2D a strap is a quiet band: a muted dark grey on a light stage and
   a muted light grey on a dark one, with a hairline rim in the stage's line
   tone, never white (stage.js STRAP_PAINT_2D, which a test holds these to;
   strap-size.js narrows it). Sheets and files keep the paper's black and white.
   A strap goes with its bundle: it stays lit while its bundle, or a cable
   that rides it, is the one selected or hovered (.on, .hot), and dims with
   the rest when another cable or bundle is. */
.cable-focus [data-strap]:not(.on) { opacity: 0.18; }
.rk-panes[data-stage="light"] [data-strap] [data-strap-part="core"] { stroke: #5b6169; }
.rk-panes[data-stage="light"] [data-strap] [data-strap-part="rim"] { stroke: #c9cdd2; }
.rk-panes[data-stage="dark"] [data-strap] [data-strap-part="core"] { stroke: #8a9199; }
.rk-panes[data-stage="dark"] [data-strap] [data-strap-part="rim"] { stroke: #2a2f35; }
/* HOVER (#169): a cable or bundle under the pointer, on the stage or in the
   list, stays lit and every other one dims (site/rack/hover.js). It outranks
   a selection's focus and the filter's ghosts while it lasts, and takes
   nothing away when it ends: the classes go and these rules with them. */
[data-bundle-id], [data-strap] { transition: opacity 120ms; }
.cable-hover [data-cable]:not(.hot), .cable-hover [data-cable-tag]:not(.hot),
.cable-hover [data-bundle-id]:not(.hot), .cable-hover [data-strap]:not(.hot) { opacity: 0.15; }
.cable-hover [data-cable].hot, .cable-hover [data-cable-tag].hot,
.cable-hover [data-bundle-id]:is(.hot, .hot-member), .cable-hover [data-strap].hot { opacity: 1; }
.cable-hover [data-bundles], .cable-hover [data-bundle-straps] { opacity: 1; }
/* A STORED LOOP OF SPARE (spare-loops.js) goes with its cable: selected, filtered and hovered. */
[data-spare-loop] { transition: opacity 120ms; }
[data-spare-loop].ghost { opacity: 0.12; }
.cable-focus [data-spare-loop]:not(.on) { opacity: 0.18; }
.cable-hover [data-spare-loop]:not(.hot) { opacity: 0.15; }
.cable-hover [data-spare-loop].hot { opacity: 1; }
/* BUSY (#187): the panes while the pair just asked for is being drawn
   (rack-page.js setView). The old pair fades and the pointer says to wait. */
.rk-panes[aria-busy="true"] { cursor: progress; }
.rk-panes[aria-busy="true"] > .rk-pane > div { opacity: 0.35; transition: opacity 60ms; }
/* A CROSS-FACE TAG IS HIDDEN UNTIL IT IS ASKED FOR (#194): a cable's own
   while that cable is hovered (on the drawing, or on its row in the list,
   which keyboard focus hovers too) or pinned, a bundle's one tag while the
   bundle is (.hot-tag from hover.js, .on-tag from cable-view.js paintCables).
   Hidden, it takes no pointer and no focus. A not-connected tag always shows. */
.cable-hover [data-bundle-tag]:not(.hot-tag) { opacity: 0.15; }
[data-cable-tags] .cable-tag:not(.not-connected):not(.hot-tag):not(.on-tag) { visibility: hidden; pointer-events: none; }
.cable-tag { cursor: pointer; pointer-events: all; }
.cable-tag rect { fill: var(--pt-surface); stroke: var(--pt-line); }
.cable-tag text { font: 500 11px var(--pt-font-mono); fill: var(--pt-ink); }
.cable-tag:hover rect, .cable-tag:focus-visible rect { stroke: var(--pt-brass); }
.cable-tag.not-connected rect { stroke-dasharray: 3 2; }

/* The cable form, in the side panel. A warning takes no room until it has
   something to say. */
.rk-side .rk-warn { color: var(--pt-warn); font-size: 0.85rem; margin: 0 0 0.6rem; }
.rk-side .rk-warn:empty { display: none; }
.rk-side .rk-cable-form p { margin: 0 0 0.4rem; }
.rk-side .rk-cable-form .rk-length { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; gap: 0.5rem; }

/* Cable mode: the pressed button; ports as the thing to click; the cables out
   of the pointer's way, so a port under one can be clicked (their tags, in
   their own layer, still take a click); and the outline round a picked end. */
.rk-bar > button[aria-pressed="true"] { border-color: var(--pt-brass); color: var(--pt-brass); }
.rk-cabling [data-class="port"], .rk-cabling [data-class="port"] *,
.rk-cabling [data-class="transceiver"], .rk-cabling [data-class="transceiver"] * { cursor: crosshair; }
.rk-cabling [data-cables] { pointer-events: none; }
.rk-end-pick { fill: none; stroke: var(--pt-brass); stroke-width: 1.5; pointer-events: none; }

/* The cable list, under the summary. A row the filter leaves out is hidden
   (li is a grid here, which would otherwise outrank the hidden attribute). */
.rk-side .rk-cables { margin-top: 1rem; }
.rk-side .rk-cables ul { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.rk-side .rk-cables li { display: grid; gap: 0.2rem; font-size: 0.85rem; }
.rk-side .rk-cables li[hidden] { display: none; }
.rk-side .rk-cables [data-cable-row] { text-align: left; }
.rk-side .rk-cables button[aria-pressed="true"] { border-color: var(--pt-brass); color: var(--pt-brass); }
/* a row reached with the keyboard is ringed: Enter or Space on it pins its cable or bundle */
.rk-side .rk-cables [data-cable-row]:focus-visible, .rk-side .rk-cables [data-bundle-row]:focus-visible {
  outline: 2px solid var(--pt-brass); outline-offset: 1px; }
.rk-side .rk-cables .rk-warn { margin: 0; }
/* The Warnings section above the cable tree (cable-panel.js warningsSection, portrayal-site#192): one row when
   closed, in the warning colour, with the tree's own disclosure mark; opened, its kinds and their findings. */
.rk-side .rk-cables .rk-warnings { margin: 0.4rem 0 0; font-size: 0.85rem; }
.rk-side .rk-cables .rk-warnings-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: 0.15rem; align-items: center;
  width: 100%; padding: 0.15rem 0; border: 0; background: none; color: var(--pt-warn); font: inherit; text-align: left; cursor: pointer; }
.rk-side .rk-cables .rk-warnings-row > .rk-twist { display: grid; place-items: center; }
.rk-side .rk-cables .rk-warnings-row[aria-expanded="true"] > .rk-twist::before { content: '\25BE'; }
.rk-side .rk-cables .rk-warnings-row:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
.rk-side .rk-cables .rk-warnings-body { display: grid; gap: 0.4rem; margin: 0.2rem 0 0.2rem 1.65rem; }
.rk-side .rk-cables .rk-warnings-body[hidden] { display: none; }
.rk-side .rk-cables .rk-warnings-title { margin: 0; font-weight: 600; color: var(--pt-warn); }
.rk-side .rk-cables .rk-warnings-list { margin: 0.2rem 0 0; display: grid; gap: 0.5rem; }
.rk-side .rk-cables .rk-warnings-list[hidden] { display: none; }
.rk-side .rk-cables .rk-warnings-list > [data-warning-row] { display: grid; gap: 0.2rem; }
.rk-side .rk-cables .rk-warnings-list [data-warning-pick] { text-align: left; }
/* What a hovered cable is, beside the pointer on either stage (rack-page.js
   paintTip). It takes no pointer, so it never ends the hover it describes. */
.rk-cable-tip { position: fixed; z-index: 18; max-width: 22rem; padding: 0.3rem 0.5rem; pointer-events: none;
  display: grid; gap: 0.1rem; font: 0.8rem/1.3 var(--pt-font-body); color: var(--pt-ink);
  background: var(--pt-surface, var(--pt-ground)); border: 1px solid var(--pt-line); border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.rk-cable-tip[hidden] { display: none; }
.rk-cable-tip span + span { color: var(--pt-ink-muted); }
.rk-cable-tip span[data-tip-short] { color: var(--pt-warn); }
.rk-side .rk-cables li.rk-bundled { padding-left: 0.9rem; border-left: 2px solid var(--pt-line); }
.rk-side .rk-cables [data-bundle-row] { text-align: left; font-weight: 600; }
/* THE LIST IS A TREE (#190, cable-tree.js). A row that opens (a bundle, the
   cables in no bundle) has its disclosure mark in a column of its own, a
   click target beside the name and never part of it; its members are the
   group beneath. A closed row keeps its name, its summary and its warnings,
   and folds the rest of what is said of it away. A group is a grid here too,
   which would otherwise outrank the hidden attribute. */
.rk-side .rk-cables ul[hidden] { display: none; }
.rk-side .rk-cables li.rk-tree-parent { grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: 0.15rem; }
.rk-side .rk-cables li.rk-tree-parent > * { grid-column: 2; }
.rk-side .rk-cables li.rk-tree-parent > .rk-twist { grid-column: 1; grid-row: 1; align-self: stretch; display: grid; place-items: center;
  min-height: 1.5rem; cursor: pointer; color: var(--pt-ink-muted); border-radius: 4px; user-select: none; }
.rk-side .rk-cables li.rk-tree-parent > .rk-twist:hover { color: var(--pt-brass); background: var(--pt-surface-2); }
.rk-side .rk-cables .rk-twist::before { content: '\25B8'; font-size: 1.05rem; line-height: 1; }
.rk-side .rk-cables li[aria-expanded="true"] > .rk-twist::before { content: '\25BE'; }
.rk-side .rk-cables li.rk-tree-parent > ul { grid-column: 1 / -1; margin-top: 0.3rem; }
.rk-side .rk-cables li[aria-expanded="false"] > :is([data-bundle-size], [data-bundle-bend], [data-bundle-note]) { display: none; }
.rk-side .rk-cables .rk-tree-name { font-weight: 600; cursor: pointer; align-self: center; }
/* what is under the pointer on the stage marks its row, or the closed row it is under: a mark, never a move */
.rk-side .rk-cables li[data-hover-mark] > :is([data-cable-row], [data-bundle-row]) { border-color: var(--pt-brass); background: var(--pt-surface); box-shadow: inset 3px 0 0 var(--pt-brass); }
.rk-side .rk-cables li[data-hover-mark] > .rk-tree-name { color: var(--pt-brass); }
/* the row the keyboard is on is ringed as its name is */
.rk-side .rk-cables li[role="treeitem"]:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: 2px; border-radius: 3px; }
.rk-side .rk-bundle-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.rk-side .rk-bundle-title button[aria-pressed="true"] { border-color: var(--pt-brass); color: var(--pt-brass); }
.rk-side .rk-bundle-picks { display: grid; gap: 0.25rem; border: 0; padding: 0; margin: 0 0 0.6rem; font-size: 0.85rem; }
.rk-side .rk-bundle-members { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.5rem; font-size: 0.85rem; }
.rk-side .rk-bundle-members li { display: grid; gap: 0.2rem; }
.rk-side .rk-bundle-findings { display: grid; gap: 0.2rem; font-size: 0.85rem; }
.rk-side .rk-filter { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin: 0 0 0.4rem; }
.rk-side .rk-filter button { padding: 0.15rem 0.5rem; font-size: 0.8rem; }
.rk-side .rk-loose { color: var(--pt-warn); }
.rk-bar button:disabled { opacity: 0.5; cursor: not-allowed; }

/* A cable's route in its form: the selected row (new waypoints go after it),
   and a waypoint whose pathway is gone. */
.rk-side .rk-route li.rk-selected { outline: 2px solid var(--pt-brass); outline-offset: 1px; }
.rk-side .rk-route li.rk-gone { color: var(--pt-warn); text-decoration: line-through; }

/* An agent's edit, outlined for a moment (rack-page.js paintAgentMark). SVG has
   no outline, so the brass is a tight double drop shadow. */
svg .rk-agent-touched {
  filter: drop-shadow(0 0 1.5px var(--accent)) drop-shadow(0 0 1.5px var(--accent));
}

/* CONNECT YOUR AI: the panel under the toolbar's AI menu. */
.rk-agent { width: min(30rem, calc(100vw - 2rem)); display: grid; gap: .5rem; }
.rk-agent-switch { display: flex; gap: .5rem; align-items: center; }
.rk-agent-copy { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; align-items: start; }
.rk-agent-copy > span { grid-column: 1 / -1; }
.rk-agent-copy code { white-space: pre-wrap; word-break: break-all; font-size: .8rem; }
/* At phone width the toolbar wraps, the button shortens to AI, and the panel
   spans the screen instead of hanging from wherever the button landed. */
@media (max-width: 30rem) {
  .rk-bar { flex-wrap: wrap; position: relative; }
  #agentMenu { position: static; }
  #agentMenu > .rk-agent { left: 1rem; right: 1rem; width: auto; }
  #agentMenu > summary { font-size: 0; white-space: nowrap; }
  #agentMenu > summary::before { content: 'AI'; font-size: 1rem; }
  #agentMenu > summary::after { font-size: 1rem; }
}

/* Visually hidden, still in the page's text and its accessibility tree: the
   one-line hint for agents that read the page (rack.html #webmcp-hint-text). */
.rk-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
         clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
