/* ── Browsing Growel's own masters: the raw-material tree ──
   The Tally masters browser's shape (.mlayout / .bookrail in tally_browse.css)
   one domain over — tree on the left, the picked material's detail on the
   right. Its own prefix rather than a reuse of .mlayout: that file's selectors
   are documented as staying under .mlayout so its short names cannot leak, and
   borrowing the container would drag .bookrail / .mtab styling in behind it.

   No colour is spelled out here that is not one of the paper-palette variables
   at the end of layout.css — nothing must reach back for Bootstrap's blue.
   Every selector sits under .orglayout, .orgtree or .orgpane so the short names
   (.caret, .on) cannot land on anyone else's page. */

.orglayout { display: flex; gap: 1.4rem; align-items: flex-start; }

.orglayout .orgtree {
  flex: 0 0 300px; position: sticky; top: 1rem;
  max-height: calc(100vh - 2rem); overflow: auto;
  padding: 0.75rem; border: 1px solid var(--edge); border-radius: 10px;
  background: var(--panel); font-size: 0.83rem;
}

.orglayout .orgpane { flex: 1 1 auto; min-width: 0; }

/* ── nodes ── */
.orgtree .orgnode > summary {
  display: flex; align-items: center; gap: 0.4rem;
  cursor: pointer; list-style: none; padding: 0.3rem 0.35rem; border-radius: 6px;
  color: var(--ink-2); font-weight: 600;
}
.orgtree .orgnode > summary::-webkit-details-marker { display: none; }
.orgtree .orgnode > summary:hover { background: var(--rail); }
.orgtree .orgnode[open] > summary .caret { transform: rotate(90deg); }

.orgtree .caret {
  display: inline-block; flex: 0 0 auto; color: var(--ink-4);
  transition: transform 0.12s ease-in-out;
}

.orgtree .orgchildren { margin-left: 0.85rem; border-left: 1px solid var(--edge); padding-left: 0.5rem; }

.orgtree .orgleaf {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.35rem; border-radius: 6px;
}
.orgtree .orgleaf:hover { background: var(--rail); }

.orgtree a { text-decoration: none; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orgtree a:hover { color: var(--ink); }
.orgtree a.on { color: var(--deck); background: var(--green); border-radius: 5px; padding: 0.1rem 0.4rem; font-weight: 600; }

.orgtree .orgcount {
  margin-left: auto; flex: 0 0 auto;
  font-family: var(--bs-font-monospace); font-size: 0.66rem; color: var(--ink-4);
}

/* Stacks under the tree on a narrow screen rather than squeezing both. */
@media (max-width: 991.98px) {
  .orglayout { flex-direction: column; }
  .orglayout .orgtree { flex: 1 1 auto; width: 100%; position: static; max-height: 22rem; }
}
