/* ═══════════════════════════════════════════════════════════════
   doc-hub.css — Document Hub v2 · DH-1 hub home (aa, 2026-10-24; Ed approved the design 2026-10-23).
   Skin B: radius 0, the body's Archivo, skin fills (ok / warn / bad / violet / info / neutral) with ink text.
   Every colour is a theme token, so light, dark, dim and high-contrast follow skin-b.css — no theme selectors here.
   ═══════════════════════════════════════════════════════════════ */
.dh-home { display: flex; flex-direction: column; gap: 16px; padding-block: 4px 16px; }
.dh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dh-home :focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Header: search + Upload */
.dh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dh-search { flex: 999 1 420px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 2px solid var(--text); background: var(--bg2); color: var(--text); box-sizing: border-box; }
.dh-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.dh-search kbd { font: inherit; font-size: 11px; color: var(--text3); border: 1px solid var(--border2); padding: 1px 6px; }
.dh-btn { height: 32px; padding: 0 12px; border: 1px solid var(--text); background: var(--bg2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 0; white-space: nowrap; }
.dh-btn:hover { background: var(--bg3); }
.dh-btn:disabled { opacity: .6; cursor: default; }
.dh-primary { height: 40px; padding: 0 20px; border: 0; background: var(--gold); color: var(--skin-fill-ink); font-weight: 700; }
.dh-primary:hover { background: var(--gold); filter: brightness(1.05); }

/* Attention strip */
.dh-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dh-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--bg2); border: 1px solid var(--border); }
.dh-card.is-loading { color: var(--text3); font-size: 13px; }
.dh-card-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.dh-dot { width: 10px; height: 10px; display: inline-block; background: var(--text3); }
.dh-card.is-warn .dh-dot { background: var(--gold); }
.dh-card.is-violet .dh-dot { background: var(--emr-status-purple, var(--skin-fill-violet)); }
.dh-card.is-info .dh-dot { background: var(--blue, var(--skin-fill-info)); }
.dh-card.is-bad .dh-dot { background: var(--red, var(--skin-fill-bad)); }
.dh-card-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.dh-num { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.dh-card-detail { font-size: 12px; color: var(--text2); }
.dh-card .dh-btn { align-self: flex-start; }

/* Browse by + main */
.dh-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dh-browse { flex: 0 0 220px; display: flex; flex-direction: column; padding: 8px 0; background: var(--bg2); border: 1px solid var(--border); }
.dh-label { padding: 10px 14px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.dh-browse-item { display: flex; justify-content: space-between; gap: 8px; padding: 7px 14px; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.dh-browse-item:hover { background: var(--bg3); }
.dh-browse-item.is-on { background: var(--bg3); font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
.dh-count { color: var(--text3); font-variant-numeric: tabular-nums; }
.dh-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Chips */
.dh-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dh-chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border2);
  background: var(--bg2); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 0; box-sizing: border-box; }
.dh-chip.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }
.dh-chip-select { padding: 0 6px; }
.dh-chip-select select { border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dh-chip-select.is-on select option { color: var(--text); background: var(--bg2); }
.dh-chips-note { margin-left: auto; font-size: 12px; color: var(--text3); }

/* Table */
.dh-table-wrap { background: var(--bg2); border: 1px solid var(--border); overflow-x: auto; }
.dh-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; color: var(--text); }
.dh-table th { padding: 10px 8px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.dh-table td { padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
.dh-table th:first-child, .dh-table td:first-child { padding-left: 12px; }
.dh-doc { display: flex; align-items: center; gap: 12px; }
.dh-thumb { flex: none; width: 32px; height: 40px; box-sizing: border-box; border: 1px solid var(--border2); background: var(--bg);
  background-image: linear-gradient(var(--text) 0 0), linear-gradient(var(--border2) 0 0), linear-gradient(var(--border2) 0 0);
  background-size: 60% 3px, 80% 2px, 50% 2px; background-position: 5px 6px, 5px 12px, 5px 17px; background-repeat: no-repeat; }
.dh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dh-doc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dh-name { font-weight: 600; overflow-wrap: anywhere; }
.dh-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dh-type { padding: 2px 6px; background: var(--skin-fill-neutral); color: var(--skin-fill-ink); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dh-meta, .dh-muted { font-size: 12px; color: var(--text3); }
.dh-linked { color: var(--text2); }
.dh-exp { min-width: 120px; }
.dh-exp-text { display: block; font-variant-numeric: tabular-nums; }
.dh-exp-text.is-warn { font-weight: 700; }
.dh-exp-text.is-bad { font-weight: 700; color: var(--red, var(--text)); }
.dh-bar { display: block; width: 120px; height: 4px; margin-top: 4px; background: var(--bg3); }
.dh-bar > span { display: block; height: 4px; background: var(--skin-fill-ok); }
.dh-bar.is-warn > span { background: var(--gold); }
.dh-bar.is-bad > span { background: var(--red, var(--skin-fill-bad)); }
.dh-pill { display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--skin-fill-ink); background: var(--skin-fill-neutral); }
.dh-pill.is-ok { background: var(--skin-fill-ok); }
.dh-pill.is-warn { background: var(--skin-fill-warn); }
.dh-pill.is-bad { background: var(--skin-fill-bad); }
.dh-pill.is-violet { background: var(--skin-fill-violet); }
.dh-next { position: relative; text-align: right; white-space: nowrap; }
.dh-more { width: 32px; height: 32px; margin-left: 4px; border: 0; background: transparent; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.dh-more:hover { background: var(--bg3); }
.dh-menu { position: fixed; top: 0; left: 0; z-index: 1000; min-width: 168px; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); text-align: left; }
.dh-menu button { padding: 9px 14px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.dh-menu button:hover, .dh-menu button:focus-visible { background: var(--bg3); }
.dh-empty { padding: 32px 16px; text-align: center; color: var(--text3); background: var(--bg2); border: 1px solid var(--border); }
.dh-empty.is-error { color: var(--text); }
.dh-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text3); }
.dh-link { border: 0; background: transparent; padding: 0 6px; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.dh-classic { color: var(--text3); font-weight: 400; }

/* Bulk bar (documents/hubBulk.js): a slot above the table that keeps its height when nothing is ticked, so ticking
   the first row never moves the rows under the pointer; while rows are ticked it stays in view as the list scrolls. */
.dh-table th.dh-sel, .dh-table td.dh-sel { width: 20px; padding-right: 0; }
.dh-sel input { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--gold); }
.dh-table tr.is-checked td { background: var(--bg3); }
.dh-table tr.is-checked td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.dh-bulk-slot { display: flex; flex-direction: column; }
.dh-bulk-slot:has(> .dh-bulk) { position: sticky; top: 0; z-index: 5; }
.dh-bulk-idle, .dh-bulk { min-height: 52px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; }
.dh-bulk-idle { border: 1px solid var(--border); background: var(--bg2); color: var(--text3); font-size: 13px; }
.dh-bulk { background: var(--text); color: var(--bg); }
.dh-bulk-count { margin-right: 4px; font-size: 14px; font-weight: 700; }
.dh-bulk-btn { height: 32px; padding: 0 12px; border: 1px solid var(--bg); border-radius: 0; background: transparent; color: var(--bg);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.dh-bulk-btn:hover:not(:disabled), .dh-bulk-btn[aria-expanded="true"] { background: var(--bg); color: var(--text); }
.dh-bulk-primary { border-color: var(--gold); background: var(--gold); color: var(--skin-fill-ink); font-weight: 700; }
.dh-bulk-primary:hover:not(:disabled) { background: var(--gold); color: var(--skin-fill-ink); filter: brightness(1.05); }
.dh-bulk-btn:disabled, .dh-bulk-clear:disabled { opacity: .6; cursor: default; }
.dh-bulk-clear { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; color: var(--bg); font-size: 20px; line-height: 1; cursor: pointer; }
.dh-bulk-status { flex-basis: 100%; font-size: 12px; }
.dh-bulk-status.is-bad { font-weight: 700; }
.dh-bulk-idle .dh-bulk-status { flex-basis: auto; color: var(--text); }
.dh-bulk-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--text); border-top: 0;
  background: var(--bg2); color: var(--text2); font-size: 13px; }
.dh-bulk-panel label { display: flex; flex-direction: column; gap: 4px; }
.dh-bulk-grow { flex: 1 1 260px; }
.dh-bulk-panel select, .dh-bulk-panel input { height: 32px; padding: 0 8px; border: 1px solid var(--border2); border-radius: 0; background: var(--bg); color: var(--text); font: inherit; }
.dh-bulk-results { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.dh-bulk-results:empty { display: none; }
.dh-bulk-pick { height: 30px; padding: 0 10px; border: 1px solid var(--border2); border-radius: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.dh-bulk-pick:hover, .dh-bulk-pick:focus-visible { border-color: var(--text); background: var(--bg3); }

/* Preview panel: a third column on wide screens, a right-hand overlay below 1500px */
.dh-table tr[data-dh-row] { cursor: pointer; }
.dh-table tr[data-dh-row]:hover td, .dh-table tr.is-selected td { background: var(--bg3); }
.dh-layout.has-preview .dh-main { flex: 999 1 480px; }
.dh-preview { flex: 0 0 360px; max-width: 400px; align-self: flex-start; position: sticky; top: 8px; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text); }
.dh-preview:focus { outline: none; }
.dh-preview:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.dh-pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dh-pv-title { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; color: var(--text); }
.dh-pv-close { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.dh-pv-close:hover { background: var(--bg3); }
.dh-pv-page { display: flex; justify-content: center; padding: 16px; background: var(--bg3); }
.dh-pv-page img { max-width: 100%; max-height: 320px; border: 1px solid var(--border2); background: var(--bg); }
.dh-thumb-lg { width: 160px; height: 200px; background-size: 60% 6px, 80% 4px, 50% 4px; background-position: 16px 20px, 16px 34px, 16px 46px; }
.dh-pv-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.dh-pv-ai { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; }
.dh-label-inline { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.dh-pv-fields { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.dh-pv-fields dt { color: var(--text2); }
.dh-pv-fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dh-pv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dh-primary-s { background: var(--gold); border-color: var(--gold); color: var(--skin-fill-ink); font-weight: 700; }
.dh-primary-s:hover { background: var(--gold); filter: brightness(1.05); }
.dh-pv-fix { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; }
.dh-pv-fix label { display: flex; flex-direction: column; gap: 4px; color: var(--text2); }
.dh-pv-fix select, .dh-pv-fix input { height: 32px; padding: 0 8px; border: 1px solid var(--border2); border-radius: 0; background: var(--bg2); color: var(--text); font: inherit; }
.dh-pv-history { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.dh-pv-history .dh-label { padding: 0 0 2px; }
@media (max-width: 1499px) {
  /* align-self back to stretch: Chrome aligns absolutely positioned boxes too, and flex-start would shrink the overlay to its content */
  .dh-preview { position: fixed; top: 0; right: 0; bottom: 0; z-index: 950; width: min(400px, 100vw); max-width: none; overflow-y: auto;
    align-self: stretch; box-shadow: -8px 0 24px rgba(0, 0, 0, .18); }
}

@media (max-width: 900px) {
  .dh-browse { flex: 1 1 100%; }
  .dh-chips-note { margin-left: 0; flex-basis: 100%; }
}

/* ═══ Full-size viewer (3b #317 Part 1 / #318, aa 2026-11-10; design DocsHub.dc.html) ═══
   A modal <dialog> ~92% of the window: name + actions on top, Chrome's own PDF viewer (or the fitted image) filling the
   body, Previous / Next below. Theme tokens only (skin-b.css drives light / dark); the document pane keeps Chrome's grey. */
.dh-fv { width: min(92vw, 1760px); height: 92vh; max-width: 92vw; max-height: 92vh; padding: 0; margin: auto;
  border: 1px solid var(--border2); border-radius: 0; background: var(--bg); color: var(--text); box-sizing: border-box; overflow: hidden; }
.dh-fv[open] { display: flex; flex-direction: column; }
.dh-fv:not([open]) { display: none; }
.dh-fv::backdrop { background: rgba(0, 0, 0, .6); }
.dh-fv :focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.dh-fv-head { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px;
  background: var(--bg2); border-bottom: 1px solid var(--border); }
.dh-fv-titles { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dh-fv-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-fv-meta { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-fv-acts { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.dh-fv-btn { height: 34px; padding: 0 12px; border: 1px solid var(--border2); background: var(--bg); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 0; white-space: nowrap; }
.dh-fv-btn:hover:not(:disabled) { background: var(--bg3); }
.dh-fv-btn:disabled { opacity: .55; cursor: default; }
.dh-fv-btn.is-on { border-color: var(--text); }
.dh-fv-primary { border: 0; background: var(--gold); color: var(--skin-fill-ink); font-weight: 700; }
.dh-fv-primary:hover:not(:disabled) { background: var(--gold); filter: brightness(1.05); }
.dh-fv-close { min-width: 34px; padding: 0 10px; font-size: 15px; }
.dh-fv-more-wrap { position: relative; display: inline-flex; }
.dh-fv-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 2; min-width: 200px; display: flex; flex-direction: column;
  padding: 4px 0; background: var(--bg2); border: 1px solid var(--border2); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.dh-fv-menu[hidden] { display: none; }
.dh-fv-menu button { padding: 9px 14px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer; white-space: nowrap; }
.dh-fv-menu button:hover:not(:disabled) { background: var(--bg3); }
.dh-fv-menu button:disabled { color: var(--text3); cursor: default; }
.dh-fv-body { flex: 1 1 auto; min-height: 0; display: flex; background: #525659; }
.dh-fv-body > .emr-doc-viewer { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; }
.dh-fv-body .emr-doc-viewer__header { display: none; }   /* the dialog's own head already names the document */
.dh-fv-body .emr-doc-viewer__body { min-height: 0; }
.dh-fv-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: var(--bg2); border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.dh-fv-pos { font-variant-numeric: tabular-nums; }
.dh-fv-printframe { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }
