/* Library (13 Oct 2026): every deal document by section, opened over the page in the browser's PDF viewer. */
.topbar .lib-search { flex: 0 1 280px; min-width: 160px; width: auto; }
.lib-sum { margin: -8px 0 12px; color: var(--text-2); font-size: 14px; }
.lib-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.lib-jump { margin-bottom: 18px; }
.lib-body { display: grid; gap: 22px; }
.lib-sec { scroll-margin-top: 76px; }
.lib-sec h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--text); }
.lib-count { min-width: 26px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--gold-line); color: var(--gold-2); font: 600 12.5px/1.6 var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.lib-only { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--terracotta) 18%, transparent); color: var(--terracotta); font: 600 11.5px/1.6 var(--font); letter-spacing: .02em; vertical-align: 2px; }
.lib-sec h4 .lib-only { margin-left: 0; }
details.lib-sec > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; }
details.lib-sec > summary::-webkit-details-marker { display: none; }
details.lib-sec > summary h4 { margin-bottom: 10px; }
details.lib-sec > summary h4::before { content: '▸'; color: var(--gold); font-size: 16px; transition: transform .15s; }
details.lib-sec[open] > summary h4::before { transform: rotate(90deg); }
details.lib-sec[open] > summary .muted { display: none; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lib-doc { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.lib-doc:hover { border-color: var(--gold-line); }
.lib-open { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.lib-open:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lib-icon { flex: none; display: grid; place-items: end center; width: 34px; height: 42px; padding-bottom: 5px; border-radius: 4px 12px 4px 4px; background: linear-gradient(160deg, var(--surface-4), var(--surface-3)); border: 1px solid var(--line-strong); box-shadow: inset -8px 8px 0 -6px var(--gold-line); }
.lib-icon span { font: 700 9.5px/1 var(--font); letter-spacing: .08em; color: var(--gold-2); }
.lib-text { display: grid; gap: 2px; min-width: 0; }
.lib-title { font-weight: 600; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.lib-open:hover .lib-title { color: var(--gold-2); }
.lib-meta { font-size: 12.5px; color: var(--text-3); }
.lib-opened { color: var(--olive); }
.lib-note { font-size: 13px; color: var(--text-2); }
.lib-acts { flex: none; display: flex; gap: 6px; }
.lib-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); }
.lib-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 14px; color: var(--text-2); }
.lib-drive { margin: 0 0 12px; overflow-wrap: anywhere; }
.lib-drive code { font-size: 12px; }
.lib-progress { width: 100%; height: 8px; margin: 4px 0 12px; accent-color: var(--gold); }
body.face .lib-doc { background: rgba(18, 18, 18, .7); }

/* The viewer: the PDF over the page, a slim bar on top. */
.lib-viewer { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto 1fr; gap: 8px; padding: 14px 18px 18px; background: rgba(6, 6, 6, .82); backdrop-filter: blur(3px); }
.lib-viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.lib-viewer-title { flex: 1 1 auto; min-width: 0; display: grid; }
.lib-viewer-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lib-viewer-title span { font-size: 12.5px; }
.lib-frame { width: 100%; height: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #525659; }

@media (max-width: 760px) {
  .topbar .lib-search { flex: 1 1 100%; order: 3; }
  .lib-doc { flex-wrap: wrap; padding: 8px; }
  .lib-acts { width: 100%; justify-content: flex-end; }
  .lib-acts .btn { min-height: 40px; }
  .lib-title { font-size: 15.5px; }
}
