/* The Rack Builder: two faces side by side, one scroll, and a side panel. */
.rk { background: var(--pt-ground); color: var(--pt-ink); }
.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, in the showcase's own #stageMode style (site/site.css's
   .stage-mode) - the two toggles should read as the same control even though
   they live on different pages. */
.rk-mode { display: inline-flex; border: 1px solid var(--pt-line); border-radius: 6px; overflow: hidden; }
.rk-mode button { background: none; border: none; color: var(--pt-ink-muted); cursor: pointer;
  font: inherit; font-size: 0.85rem; padding: 0.3rem 0.7rem; }
.rk-mode button + button { border-left: 1px solid var(--pt-line); }
.rk-mode button:hover { color: var(--pt-ink); }
.rk-mode button[aria-pressed="true"] { color: var(--pt-ink); background: var(--pt-surface-2); }
.rk-mode button:focus-visible { outline: 2px solid var(--pt-brass); outline-offset: -2px; }
/* 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; }
.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; }
.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); }
