/**
 * library-inspector — Library destination right-rail inspector (Brief
 * library-inspector-section-stack — Increment 2).
 *
 * Tokens-only (ds-audit). Hosts:
 *   - the context card (no/one/multi selection states)
 *   - the inspector-stack mount (six compound-centric section stubs)
 *
 * The inspector-stack primitive carries its own drag/reorder/announce CSS
 * (inspector-stack.css + notebook-shell.css for the card body). This file
 * contributes ONLY the library-specific framing + stub + skeleton chrome.
 *
 * Brief: research/flywheel/handoffs/briefs/library-inspector-section-stack.md
 */

/* ── Mount + outer container ─────────────────────────────────────────── */

.library-inspector-mount {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Library right-rail collapse chevron (Brief library-rail-convergence-
 *    and-collapse, 2026-06-07) — leading-edge affordance that mirrors the
 *    notebook inspector's .notebook-shell__insp-collapse. Tokens-only. ── */

.library-inspector__rail-collapse {
  align-self: flex-end;
  margin: var(--s-space-1) var(--s-space-2) 0 0;
}

/* Hide the collapse chevron + inspector mount + widgets list when the
 * library inspector is in collapsed (icon-rail) state. The shared CSS in
 * rail-chrome.css already hides the inspector mount; this rule covers the
 * sibling collapse chevron. */
.bilateral-right-rail[data-library-insp-collapsed=""]
  .library-inspector__rail-collapse {
  display: none;
}

.library-inspector {
  display: flex;
  flex-direction: column;
  gap: var(--s-space-3);
  padding: var(--s-space-3);
  min-width: 0;
}

/* ── Context card (no/one/multi selection) ───────────────────────────── */

.library-inspector__context {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.library-inspector__card {
  display: flex;
  flex-direction: column;
  gap: var(--s-space-2);
  padding: var(--s-space-3);
  background: var(--s-color-bg-surface);
  border: 1px solid var(--s-color-border-subtle);
  border-radius: var(--s-radius-md);
  min-width: 0;
}

.library-inspector__card-title {
  margin: 0;
  font-size: var(--s-font-size-1);
  font-weight: var(--s-font-weight-semibold);
  color: var(--s-color-fg-primary);
  line-height: var(--s-line-height-tight);
  word-break: break-word;
}

.library-inspector__card-row {
  margin: 0;
  font-size: var(--s-font-size-0);
  color: var(--s-color-fg-secondary);
  line-height: var(--s-line-height-standard);
}

.library-inspector__card-row--muted {
  color: var(--s-color-fg-tertiary);
}

.library-inspector__card-hint {
  margin: 0;
  font-size: var(--s-font-size-0);
  color: var(--s-color-fg-muted);
  font-style: italic;
  line-height: var(--s-line-height-standard);
}

/* ── Bulk-actions row (multi-selection) ──────────────────────────────── */

.library-inspector__bulk-actions {
  display: flex;
  gap: var(--s-space-2);
  margin-top: var(--s-space-2);
  flex-wrap: wrap;
}

.library-inspector__bulk-action {
  flex: 1 1 auto;
  padding: var(--s-space-2) var(--s-space-3);
  background: var(--s-color-bg-subtle);
  border: 1px solid var(--s-color-border-subtle);
  border-radius: var(--s-radius-sm);
  font-size: var(--s-font-size-0);
  color: var(--s-color-fg-tertiary);
  cursor: not-allowed;
}

.library-inspector__bulk-action[aria-disabled="true"] {
  opacity: 0.7;
}

/* ── Inspector-stack wrapper ─────────────────────────────────────────── */

.library-inspector__stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Section stub bodies (rendered inside each inspector-stack card) ──── */

.library-inspector__section-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-space-2);
  min-width: 0;
}

.library-inspector__stub {
  display: flex;
  flex-direction: column;
  gap: var(--s-space-1);
  padding: var(--s-space-2) 0;
  min-width: 0;
}

.library-inspector__stub-ref {
  margin: 0;
  font-size: var(--s-font-size-0);
  color: var(--s-color-fg-secondary);
  font-weight: var(--s-font-weight-semibold);
  line-height: var(--s-line-height-standard);
  word-break: break-word;
}

.library-inspector__stub-preview {
  margin: 0;
  font-size: var(--s-font-size-0);
  color: var(--s-color-fg-muted);
  font-style: italic;
  line-height: var(--s-line-height-standard);
}

/* ── Async section skeleton (literature / clinical) ──────────────────── */

.library-inspector__stub--async[data-loading-state="pending"] {
  opacity: 0.95;
}

.library-inspector__skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--s-space-1);
  margin: var(--s-space-1) 0;
}

.library-inspector__skeleton-row {
  display: block;
  height: var(--s-space-2);
  border-radius: var(--s-radius-sm);
  background: var(--s-color-bg-subtle);
}

.library-inspector__skeleton-row:nth-child(1) { width: 92%; }
.library-inspector__skeleton-row:nth-child(2) { width: 74%; }
.library-inspector__skeleton-row:nth-child(3) { width: 58%; }
