/**
 * left-chrome-mode.css — declarative left-chrome region switch
 * (2026-06-07 library-left-rail-dedicated-mount).
 *
 * The library left rail no longer mounts into [data-project-nav-mount].
 * It has its own dedicated sibling region [data-library-nav-mount]
 * inside [data-chrome-left-panel]. ONE owner (syncProjectNavChrome in
 * admin-shell.js, via js/lib/left-chrome-mode.js) writes a single mode
 * attribute on the panel; CSS shows exactly one region and hides the
 * others. Region selection is show/hide of independently-owned DOM —
 * NOT scrubbing a shared host.
 *
 * Mode contract:
 *   "library"  → [data-library-nav-mount] visible, [data-project-nav-mount] hidden.
 *   "notebook" → [data-project-nav-mount] visible, [data-library-nav-mount] hidden.
 *   "project"  → same as "notebook"; the project-nav (not notebook rail)
 *                paints into [data-project-nav-mount]. Both share the
 *                project-nav region; project-nav.css decorates it
 *                independently.
 *   "none"     → both mounts hidden (no surface owns the left chrome).
 *
 * The `hidden` HTML attribute is the source of truth for region
 * visibility (the helper sets it). The CSS below treats the attribute
 * as authoritative and also pins the layout primitives — flex column,
 * intrinsic min-height — so the visible region grows correctly inside
 * the chrome panel.
 */

/* ── Library mount: idle (hidden) and visible (mode=library) ────────── */

[data-library-nav-mount] {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

[data-chrome-left-panel][data-left-chrome-mode="library"]
  [data-library-nav-mount]:not([hidden]) {
  display: flex;
}

/* ── Project-nav mount visibility under library mode ─────────────────
 *
 * project-nav.css owns the default visibility for [data-project-nav-mount]
 * (display:none until [data-project-nav-active] is on the column).
 * Notebook surface paints into the same mount and uses
 * data-notebook-chrome-active for its toggle. When library mode is
 * active, force-hide the project mount regardless of those attrs so the
 * library region is the sole visible container.
 */

[data-chrome-left-panel][data-left-chrome-mode="library"]
  [data-project-nav-mount] {
  display: none !important;
}

/* ── Library sidebar / ribbon wrapping inside the dedicated mount ───
 *
 * Mirrors the layout previously applied via [data-project-nav-mount]
 * [data-library-chrome=""] (rail-chrome.css) — now scoped to the
 * library-owned region. Library DOM still lives under a single
 * container so collapse-to-ribbon, manual resize, and per-surface
 * persistence all keep working unchanged.
 */

[data-library-nav-mount] {
  width: 100%;
  height: 100%;
}

[data-library-nav-mount] > .library-sidebar,
[data-library-nav-mount] > .rail-chrome__ribbon {
  width: 100%;
}

[data-library-nav-mount] > .library-sidebar {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
