/* ── 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; }
}

/* ── Masters › Operations Points: the point's facilities as a folding tree ──
   Native <details>; the summary's own marker is the caret. Nested nodes (a
   unit, a unit's production lines) indent under a rule. Palette variables only. */
.optree .optree-node {
  border: 1px solid var(--edge); border-radius: 8px; background: var(--panel);
  margin-bottom: 0.5rem;
}
.optree .optree-node > summary {
  cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 8px;
  color: var(--ink-2); font-weight: 600; font-size: 0.88rem;
}
.optree .optree-node > summary:hover { background: var(--rail); }
.optree .optree-node[open] > summary { border-bottom: 1px solid var(--edge); border-radius: 8px 8px 0 0; }
.optree .optree-body { padding: 0.5rem; }
.optree .optree-node .optree-node {
  margin: 0.5rem 0 0.5rem 1rem; border-width: 0 0 0 2px; border-radius: 0;
  background: transparent;
}
.optree .optree-node .optree-node > summary { font-size: 0.84rem; }

/* sortable heads in the tree: the reports' arrow (reports.css) */
.optree thead th a { color: inherit; text-decoration: none; }
.optree thead th a:hover { text-decoration: underline; }
.optree thead th a.sorted::after { content: " \25B4"; font-size: 0.7em; }
.optree thead th a.sorted.desc::after { content: " \25BE"; }
