/* Selection Pane (js/selection-pane.js). */
.udoc-textbox.tbox-hidden { display: none !important; }
.usp-pane { position: fixed; right: 12px; top: 120px; z-index: 900; width: 260px; max-height: calc(100vh - 180px); display: flex; flex-direction: column;
  border: .5px solid var(--ui-line, #c8c8cc); border-radius: 10px; background: var(--ui-bg, #fff); box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  font: 13px/1.4 var(--ui-sheet-font, system-ui, sans-serif); color: var(--ui-ink, #1d1d1f); }
.usp-pane[hidden] { display: none; }
.usp-pane header { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 8px 0 14px; font-weight: 600; }
.usp-pane header button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }
.usp-tools { display: flex; gap: 4px; padding: 0 10px 8px; flex-wrap: wrap; }
.usp-tools button { height: 26px; padding: 0 8px; border: .5px solid var(--ui-line, #c8c8cc); border-radius: 6px; background: var(--ui-bg, #fff); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.usp-list { margin: 0; padding: 0 6px 8px; list-style: none; overflow: auto; }
.usp-list li { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 6px; cursor: default; }
.usp-list li:hover { background: var(--ui-hover, rgba(0, 122, 255, .08)); }
.usp-list li[aria-selected="true"] { background: var(--ui-accent-soft, rgba(0, 122, 255, .16)); }
.usp-list li.is-hidden .usp-name { opacity: .5; }
.usp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usp-page { color: var(--ui-ink-2, #6e6e73); font-size: 11px; }
.usp-eye { width: 26px; height: 24px; border: 0; border-radius: 5px; background: none; cursor: pointer; font-size: 13px; }
.usp-empty { margin: 0 14px 12px; color: var(--ui-ink-2, #6e6e73); font-size: 12px; }
@media print { .usp-pane { display: none !important; } }

/* Styles pane (js/styles-pane.js): the same panel, beside the Selection Pane when both are open. */
body.udoc-selection-pane-open .usx-pane { right: 284px; }
.usx-list li { gap: 4px; }
.usx-list li button { width: 24px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--ui-ink-2, #6e6e73); cursor: pointer; opacity: 0; }
.usx-list li:hover button, .usx-list li[aria-selected="true"] button { opacity: 1; }
.usx-reveal { margin: 0 10px 10px; padding: 8px 10px; border: .5px solid var(--ui-line, #c8c8cc); border-radius: 8px; font-size: 12px; max-height: 220px; overflow: auto; }
.usx-reveal dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 0; }
.usx-reveal dt { color: var(--ui-ink-2, #6e6e73); }
.usx-reveal dd { margin: 0; word-break: break-all; }
.usx-dialog .usx-preview { margin: 10px 20px 0; padding: 14px; border: .5px solid var(--ui-line, #c8c8cc); border-radius: 9px; }

/* Navigation pane tabs (js/nav-pane.js): Headings, Pages, Results in the outline panel. */
#toc-panel .unav-tabs { display: flex; gap: 4px; padding: 0 10px 6px; }
#toc-panel .unav-tabs button { flex: 1; height: 26px; border: .5px solid var(--ui-line, #c8c8cc); border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
#toc-panel .unav-tabs button[aria-selected="true"] { border-color: transparent; background: var(--ui-accent, #007aff); color: var(--ui-accent-ink, #fff); }
#toc-panel .unav-pages, #toc-panel .unav-results { overflow: auto; max-height: calc(100vh - 220px); padding: 0 8px 8px; }
#toc-panel .unav-pages[hidden], #toc-panel .unav-results[hidden], #toc-panel .toc-body[hidden] { display: none; }
.unav-page { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-bottom: 6px; padding: 6px 8px; border: .5px solid var(--ui-line, #d9d9d9); border-radius: 6px; background: var(--ui-bg, #fff); color: inherit; text-align: left; font: inherit; cursor: pointer; }
.unav-page:hover { border-color: var(--ui-accent, #007aff); }
.unav-page-no { color: var(--ui-ink-2, #6e6e73); font-size: 11px; }
.unav-page-text { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.4; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.unav-query { width: 100%; height: 28px; box-sizing: border-box; padding: 0 8px; border: .5px solid var(--ui-line, #c8c8cc); border-radius: 6px; font: inherit; }
.unav-count { margin: 6px 2px; color: var(--ui-ink-2, #6e6e73); font-size: 12px; }
.unav-list { margin: 0; padding: 0; list-style: none; }
.unav-list li { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.unav-list li:hover { background: var(--ui-hover, rgba(0, 122, 255, .08)); }
.unav-list mark { background: #ffe58f; color: inherit; }
