/* The in-page PDF reader's own rules (the overlay #cvDoc, its header, the pdf.js toolbar, the comment dialog) and the a.dk link
 * they use: split out of litigation-case.css so a page that only opens documents (an expert's page) loads the reader and not the
 * whole case view. Ported from the private litigation app (litigation-worker/public/index.html); the phone-width rules at the end
 * are the same ones the app carries. The case page loads this file as well as litigation-case.css. */
:root {
  --link-hover:#82b2d9;    --link-hover:light-dark(#24486b, #82b2d9);
  --gold-bg:#d4a03c;       /* same value in both themes: one declaration */
  --gold-hover:#e8c27a;    --gold-hover:light-dark(#6e5210, #e8c27a);
}
#cvDocSlot { flex: 1 1 auto; display: flex; min-height: 0; }
#cvDoc .cv-view, #cvDoc .cv-doc-body { min-width: 0; }
#cvDoc input { margin: 0; }
/* The citation generator in the reader: the citation itself, a page box, and
   the 24px minimum) — it is normally the sole content of a table cell or
   card title, not text inline in a sentence, so it does not qualify for
   the inline-text exception. display:inline-block is what lets padding
   actually grow the box, the way .bb-c and the pin-cite input already do
   it above. Covers .hit .key a and table.cases td.nm a too: both carry
   this same class — and table.cases sets its own smaller 12.5px font, which
   padding alone landed at 23.75px, just under the minimum; min-height is a
   floor that holds regardless of which font-size context a .dk ends up in. */
a.dk { color:var(--blue); text-decoration:none; cursor:pointer;
       border-bottom:1px dotted var(--blue);
       display:inline-block; padding:2px 0; min-height:24px; }
a.dk:hover { color:var(--link-hover); border-bottom-style:solid; }
/* external (CourtListener) citation links get a trailing ↗ */
a.dk.ext::after { content:"\2197"; font-size:.85em; opacity:.75;
                  margin-left:1px; }
/* An arrow-only link is a ~8px click target. Where the arrow IS the whole
   link (the cases table, where the name links in-page instead), pad it out
   to something a person can actually hit — 24px minimum (WCAG 2.5.8,
   litigation-12's target-size fix applied the same way here: this was
   still ~18px tall, under the minimum, even after the earlier 2px pad). */
a.dk.ext:empty { display:inline-block; padding:6px 7px; border-bottom:none;
                 line-height:1; }
a.dk.ext:empty::after { font-size:1em; opacity:.9; }
a.dk.ext:empty:hover::after { opacity:1; }
/* Reading pane for a filing's text. Rendered as a fixed overlay, NOT inline:
   the filings table can be hundreds of rows, so an inline pane opens far
   below the viewport and reads as "the link did nothing". */
#cvDoc { display:none; position:fixed; z-index:60;
         top:6vh; bottom:6vh; left:50%; transform:translateX(-50%);
         width:min(880px, 92vw); border:1px solid var(--border-strong);
         border-radius:8px; background:#0d0d0d; overflow:hidden;
         box-shadow:0 18px 60px rgba(0,0,0,.75); }
#cvDoc.on { display:flex; flex-direction:column; }
/* A flex item's default min-height is `auto` — its CONTENT height — so a
   tall transcript pushes the slot past the pane and the body below never
   gets a bounded height to scroll inside. min-height:0 is what lets the
   chain shrink to the pane and hand the overflow to .cv-doc-body. */
#cvDocSlot { min-height:0; }
#cvDocBack { display:none; position:fixed; inset:0; z-index:59;
             background:rgba(0,0,0,.6); }
#cvDocBack.on { display:block; }
/* Reader chrome uses dark-palette LITERALS, not theme vars: the shell above
   stays #0d0d0d in both themes, and the light theme's --text/--muted are
   near-black — the title would vanish into its own background. */
/* flex-wrap (litigation-4): at phone width the title, PDF/Text toggle,
   CourtListener link, download link and close control do not all fit one
   row — "PDF" truncated to "PD" and the Text toggle was pushed off-screen
   entirely, with no way to reach it. Wrapping costs nothing at normal
   widths (the row already fits there) and keeps every control reachable. */
.cv-doc-head { padding:10px 14px; border-bottom:1px solid var(--border);
               display:flex; flex-wrap:wrap; gap:12px; align-items:baseline;
               flex:0 0 auto; }
.cv-doc-head b { color:#e8e6e3; }
.cv-doc-x { margin-left:auto; font-size:11.5px; white-space:nowrap; }
/* PDF | Text switch — the PDF is the real document, so it leads */
.cv-seg { display:inline-flex; border:1px solid var(--border-strong);
          border-radius:5px; overflow:hidden; margin-left:8px; }
.cv-seg button { background:none; border:none; border-radius:0;
                 color:#a09c97; font-size:11px; letter-spacing:.7px;
                 text-transform:uppercase; padding:3px 11px; }
.cv-seg button.on { background:var(--gold-bg); color:#1a1408; font-weight:600; }
.cv-doc-frame { flex:1 1 auto; width:100%; border:0; background:#525659;
                border-radius:0 0 7px 7px; }
/* The document's two views, PDF and text, each in a host of its own. The PDF
   view is built once and then hidden, never rebuilt, while the text is shown:
   the marks made on it live only in it. .cv-view carries a display, which
   beats [hidden], so hiding needs its own rule. */
.cv-view { flex:1 1 auto; display:flex; flex-direction:column; min-width:0; min-height:0; }
.cv-view[hidden] { display:none !important; }
/* The PDF, drawn in the page by pdf.js's own viewer (renderPdf) rather than
   handed to the browser's, which is a window nothing out here can see into —
   so the citation can follow it — and carrying pdf.js's editor for marking it
   up. The viewer's own stylesheet (vendor/pdfjs-6.3.289/pdf_viewer.css) comes with it. */
.cv-pdf-bar { display:flex; align-items:center; gap:6px; flex:0 0 auto;
              flex-wrap:wrap; padding:5px 12px; background:#2b2f33; color:#c9c5bf;
              font:12px/1.4 "Segoe UI", system-ui, sans-serif;
              border-bottom:1px solid #1e2124; }
.cv-pdf-bar .cv-pdf-at { margin-right:auto; }
.cv-pdf-bar input { width:3.4em; text-align:right; background:#1e2124;
                    color:#f2eee8; border:1px solid #4a5056; border-radius:4px;
                    padding:2px 5px; font:inherit; }
.cv-pdf-bar button, .cv-cmt button {
                     background:#3a3f44; color:#e6e2dc; border:1px solid #4a5056;
                     border-radius:4px; min-width:30px; padding:2px 8px;
                     font:inherit; cursor:pointer; white-space:nowrap; flex:0 0 auto; }
.cv-pdf-bar button:hover, .cv-cmt button:hover { background:#474d53; }
.cv-pdf-bar button[aria-pressed="true"], .cv-cmt button.on {
                     background:#d6b36a; color:#1a1408; border-color:#d6b36a; }
.cv-pdf-bar button:disabled { opacity:.45; cursor:default; }
.cv-pdf-sep { width:1px; align-self:stretch; background:#4a5056; margin:0 3px; }
/* pdf.js requires the scrolling container to be absolutely positioned */
.cv-pdf-stage { position:relative; flex:1 1 auto; min-height:0; }
/* color-scheme: pdf.js colours its editor with light-dark() pairs, which follow
   the scheme — and this page's is dark, which drew light icons on pdf.js's
   light toolbar. The paper is white; its tools take the light side. */
.cv-doc-body.cv-pdf { position:absolute; inset:0; overflow:auto; padding:0;
                      background:#525659; white-space:normal; color-scheme:light;
                      font:12px/1.4 system-ui, sans-serif; color:#1a1a1a; }
/* a comment on a mark: the dialog that writes it and the popup that shows it */
.cv-cmt { position:absolute; z-index:5; width:min(320px, calc(100% - 24px));
          box-sizing:border-box; padding:10px; background:#1e2124; color:#f2eee8;
          border:1px solid #4a5056; border-radius:8px;
          box-shadow:0 6px 24px rgba(0,0,0,.55);
          font:13px/1.45 "Segoe UI", system-ui, sans-serif; }
.cv-cmt label { display:block; color:#a09c97; font-size:11.5px; }
.cv-cmt textarea { display:block; width:100%; min-height:84px; margin-top:4px;
                   box-sizing:border-box; resize:vertical; padding:6px;
                   background:#0d0d0d; color:#fff; border:1px solid #57524d;
                   border-radius:5px; font:inherit; }
.cv-cmt-row { display:flex; gap:6px; justify-content:flex-end; margin-top:8px; }
.cv-cmt-t { white-space:pre-wrap; overflow-wrap:anywhere; max-height:40vh; overflow:auto; }
.cv-doc-meta { padding:5px 14px; color:#a09c97; font-size:11.5px;
               border-bottom:1px solid var(--border); flex:0 0 auto; }
/* the document itself reads as paper: dark chrome, light page */
.cv-doc-body { padding:26px 32px; overflow:auto; flex:1 1 auto; min-height:0;
               white-space:pre-wrap; background:#fbfaf7; color:#16130f;
               font:15px/1.62 Georgia, "Iowan Old Style", "Times New Roman", serif;
               border-radius:0 0 7px 7px; }
.cv-doc-body .pg { display:block; margin:18px 0 6px; padding-top:10px;
                   border-top:1px solid #d9d4cb; color:#8a8378;
                   font:11px/1 "Segoe UI", system-ui, sans-serif;
                   letter-spacing:.6px; text-transform:uppercase; }
.cv-doc-body .cap { display:block; text-align:center; font-weight:700;
                    margin:4px 0; }
#cvDoc .cv-doc-meta { display:flex; align-items:center; gap:8px; }
/* links in the reader chrome sit on the dark shell in both themes; the
   light theme's --blue is unreadable there */
#cvDoc a.dk { color:#5b8fb9; border-bottom-color:#5b8fb9; }
#cvDoc a.dk:hover { color:#82b2d9; }
/* A long docket-entry title must not crowd the document out. The header's title is held to two lines with an ellipsis (the full
   text is still in the page, so a screen reader reads all of it); tapping it opens it in full, in a box that scrolls, and
   tapping again folds it. On a phone the pane is the whole screen and the header, the meta line and the PDF toolbar are each
   one slim row, so the PDF gets the rest. */
.cv-doc-head b { flex:1 1 auto; min-width:0; max-width:100%; display:-webkit-box; -webkit-box-orient:vertical;
                 -webkit-line-clamp:2; line-clamp:2; overflow:hidden; overflow-wrap:anywhere; cursor:pointer; }
.cv-doc-head b.open { display:block; -webkit-line-clamp:unset; line-clamp:unset; max-height:35vh; overflow:auto; }
@media (max-width:640px) {
  #cvDoc { top:0; bottom:0; left:0; transform:none; width:100%; border:0; border-radius:0; }
  .cv-doc-head { padding:6px 10px; gap:2px 12px; }
  .cv-doc-head b { flex-basis:100%; font-size:13px; line-height:1.3; }
  #cvDoc .cv-doc-meta:not(.cv-cite-tool) { display:block; padding:3px 10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cv-pdf-bar { flex-wrap:nowrap; overflow-x:auto; padding:4px 8px; }
  .cv-pdf-bar .cv-pdf-at { white-space:nowrap; margin-right:6px; }
}
