/* Document browser (assets/docs.js): the LC's documents in clear sections on one side, the open document beside
   them. In a narrow box (a document column beside the work, or a phone) the sections stack above the document. */
.doc-browser { container-type: inline-size; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.doc-browser-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0.75rem; }

.doc-nav {
  display: flex; flex-direction: column; gap: 0.125rem; min-height: 0; max-height: 14rem; overflow-y: auto;
  padding: 0.375rem; border-radius: var(--radius-card);
  background: var(--color-glass); border: 1px solid var(--color-glass-border);
}
.doc-sec + .doc-sec { border-top: 1px solid var(--color-divider); padding-top: 0.125rem; }
.doc-sec-head {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.25rem; padding: 0.25rem 0.5rem;
  border-radius: var(--radius-control); font-size: 0.8125rem; font-weight: 700; text-align: start;
}
.doc-sec-head:hover { background: var(--color-action-primary-soft); }
.doc-sec-icon { color: var(--color-action-primary); display: inline-flex; }
.doc-sec-name { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sec-flag { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--color-status-danger); flex-shrink: 0; }
.doc-sec-flag-warning { background: var(--color-status-warning); }
.doc-sec-count { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.doc-sec-chev { display: inline-flex; color: var(--color-text-muted); transform: rotate(90deg); transition: transform 150ms; }
.doc-sec.is-open .doc-sec-chev { transform: rotate(-90deg); }

.doc-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2rem; padding: 0.25rem 0.5rem;
  padding-inline-start: 1.75rem; border-radius: var(--radius-control); font-size: 0.8125rem; text-align: start;
}
.doc-item:hover { background: var(--color-action-primary-soft); }
.doc-item[aria-current="true"] { background: var(--gradient-primary); color: var(--color-action-primary-fg); font-weight: 600; }
.doc-item-name { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item-state { flex-shrink: 0; font-size: 0.6875rem; font-weight: 700; }
.doc-item[aria-current="true"] .doc-item-state { display: none; } /* the open document's state is in its header */
/* A document column beside the work (Compliance at 1280 px and up): a shorter list, and the page takes what is left. */
@media (min-width: 1280px) {
  .doc-pane .doc-nav { max-height: 10rem; }
  .doc-pane .doc-view .doc-fill { min-height: 0; }
}
/* Wide enough (a drawer, a wide column): the sections beside the document, as tall as the box. */
@container (min-width: 36rem) {
  .doc-browser-grid { grid-template-columns: 16rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .doc-nav { max-height: none; }
}
.doc-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; flex-shrink: 0; background: var(--color-status-success); }
.doc-dot-warning { background: var(--color-status-warning); }
.doc-dot-danger { background: var(--color-status-danger); }
.doc-dot-neutral { background: var(--color-border-strong); }
.doc-dot-info { background: var(--color-status-info); }
.doc-item[aria-current="true"] .doc-dot { box-shadow: 0 0 0 2px var(--color-action-primary-fg); }

/* The open document: its name and state on one line, the page, then one muted line. */
.doc-view { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.doc-view-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.doc-view-title { min-width: 0; font-size: 0.9375rem; font-weight: 700; }
.doc-view .doc-fill { flex: 1 1 auto; min-height: 16rem; }
