/* ─────────────────────────────────────────────────────────────────
   css/build-rail.css — right-rail [My Library | Build] tab mode.
   2026-06-12 v2 (Luke: "My Library needs a button next to it, and
   that same rail will be the Build"). v1's separate-column styles are
   GONE — the Build content lives inside #sidebarRight behind a tab
   strip that reuses the left rail's .ai-rail-tab look.
───────────────────────────────────────────────────────────────── */

/* Tab strip: sticky at the top of the rail scroll. The .ai-helper-tabs
   / .ai-rail-tab classes carry the left rail's visual recipe; these
   rules only handle placement inside the right rail. */
#sidebarRight .build-rail-tabs{
  /* Only PLACEMENT here. The modern segmented look — subtle gray "track" so the
     active tab reads as a raised white pill (.ai-rail-tab.active) — comes from
     the .ai-helper-tabs class this strip ALSO carries, so [My Library | Build]
     now matches the [Community | Assistant] tabs exactly, dark mode included
     (Luke 2026-06-19). Previously this override painted the track white +
     flattened the pill. align-items:stretch + gap + padding + border-bottom all
     inherited from .ai-helper-tabs. */
  position:sticky;top:0;z-index:5;
  /* 2026-07-01 (Luke): the inherited .ai-helper-tabs track is translucent
     (rgba(0,0,0,0.04)), so while sticky the template cards scrolled UNDER it
     and showed through — the gray "bar" looked like it vanished on scroll.
     Composite the same subtle track over an OPAQUE panel surface so it stays
     solid. Theme-aware via --surface (light + dark both stay opaque). */
  background:linear-gradient(rgba(0,0,0,0.04),rgba(0,0,0,0.04)),var(--surface,#fff);
}
/* flex:1 + center come from the base .ai-rail-tab; min-height stays at the base
   44px (WCAG) — the old 40px override is dropped. */
#sidebarRight .build-rail-tab{flex:1;justify-content:center}

/* Mode switching. Library mode (default): build content hidden.
   Build mode: every library section hidden, build content shown.
   The selectors target the scroll body's top-level sections so new
   library sections added later inherit the behavior. */
#sidebarRight #buildRail{display:none;padding:4px 8px 16px}
#sidebarRight.rail-mode-build #buildRail{display:block}
/* 2026-06-12 (Luke: "we have the 326 templates inside the library —
   that's what we need back"): the TEMPLATES catalog (#accTemplates,
   326 searchable boards) is a BUILD tool — it stays visible in build
   mode alongside the generators. Everything else library-side hides. */
#sidebarRight.rail-mode-build .sidebar-scroll > .sidebar-acc:not(#accTemplates),
#sidebarRight.rail-mode-build .sidebar-scroll > :not(#rightRailTabs):not(#buildRail):not(#accTemplates){
  display:none;
}
/* (The tab strip itself always shows — re-assert against the blanket
   hide above for safety in older engines.) */
#sidebarRight.rail-mode-build .sidebar-scroll > #rightRailTabs{display:flex}

/* Build content inherits the left rail's card sizing; the generator
   cards carry their own classes from smart-templates.js. Keep taps
   AAC-grade in the rail context. */
#buildRail .build-rail-body button{min-height:44px}
