/* Split-screen reference viewer (assets/refpane.js). */
:root{--refpane-w:50vw}
.refpane{display:none;position:fixed;top:0;right:0;bottom:0;width:var(--refpane-w);z-index:50;flex-direction:column;background:#fff;border-left:1px solid var(--rule,#e6e6e6);box-shadow:-2px 0 8px rgba(0,0,0,.06)}
body.refpane-shown .refpane{display:flex}
html body.refpane-shown{padding-right:var(--refpane-w)}
.refpane-grip{position:absolute;left:-4px;top:0;bottom:0;width:8px;cursor:col-resize}
.refpane-dragging .refpane-frame{pointer-events:none}
.refpane-head{display:flex;align-items:center;gap:12px;padding:8px 12px;border-bottom:1px solid var(--rule,#e6e6e6);font-size:var(--small,12.5px)}
.refpane-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.refpane-open,.refpane-close{flex-shrink:0}
.refpane-close{border:0;background:none;font-size:20px;line-height:1;cursor:pointer;padding:0 4px}
.refpane-body{flex:1;min-height:0;overflow:auto}
.refpane-frame{display:block;width:100%;height:100%;border:0}
.refpane-body img{display:block;width:100%;height:auto;border-bottom:1px solid var(--rule,#e6e6e6)}
.refpane-missing{padding:12px;font-size:var(--small,12.5px)}
/* pane:'pages' sources (the paper draft): the page with the cited statement in a light highlight. */
.refpane-page{position:relative}
.refpane-page img{border-bottom:1px solid var(--rule,#e6e6e6)}
.refpane-hl{position:absolute;pointer-events:none;background:rgba(255,213,79,.38);mix-blend-mode:multiply;border-radius:3px;box-shadow:0 0 0 4px rgba(255,213,79,.38);outline:1px solid rgba(190,140,0,.28);outline-offset:4px}
body.refpane-shown .cg-hint{right:calc(var(--refpane-w) + 14px)}
a.refpane-current{background:rgba(51,139,222,.12);border-radius:2px}
.refpane-card{padding:16px 20px;overflow-wrap:anywhere}
.refpane-card h2{font-size:var(--h2,16px);line-height:1.4;margin:0 0 12px}
.refpane-card p{margin:12px 0}.refpane-card a{color:var(--accent-ink,#276c9f)}
.refpane-card .small{font-size:var(--small,12.5px);color:var(--muted,#666)}
.refpane-has-card.refpane-reading-source{display:flex;flex-direction:column;overflow:hidden}
.refpane-reading-source .refpane-card{flex:0 1 auto;min-height:0;max-height:42%;overflow:auto;border-bottom:1px solid var(--rule,#e6e6e6)}
.refpane-reading-source .refpane-frame{flex:1;min-height:0}
/* Direct original-source reader; no bibliography or commentary above the PDF. */
.refpane-body.source-reader:has(.source-toolbar){display:flex;flex-direction:column;overflow:hidden}
.source-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid #ddd;font:var(--small,12.5px)/1.5 Georgia,serif}
.source-toolbar label{display:flex;align-items:center;gap:4px}
.source-toolbar input{width:48px}.source-toolbar button,.source-toolbar input,.source-toolbar select{font:inherit;padding:3px 5px;border:1px solid #ccc;border-radius:3px;background:#fff;color:#222}
.source-pdf-scroll{position:relative;flex:1;min-height:0;overflow:auto;background:#f4f4f4;overflow-anchor:none}
.source-pdf-pages{position:relative;margin:10px auto}
.source-pdf-page{position:relative;width:100%;background:white;box-shadow:0 1px 3px #ccc;margin:0 0 12px}
.source-pdf-page canvas{display:block;width:100%;height:100%}
.source-pdf-highlight{position:absolute;background:rgba(255,210,60,.28);outline:1px solid rgba(190,140,0,.3);pointer-events:none;z-index:2}
.source-pdf-text{position:absolute;inset:0;overflow:hidden;line-height:1;text-align:initial;opacity:1}
.source-pdf-text :is(span,br){position:absolute;white-space:pre;color:transparent;transform-origin:0% 0%;cursor:text}
.source-pdf-text ::selection{background:rgba(40,110,200,.3)}
.source-pdf-status{padding:8px 12px;margin:0;font-size:var(--small,12.5px)}
.source-extract{padding:22px;font:var(--body,14px)/1.7 Georgia,serif;overflow-wrap:anywhere}
.source-extract h2{font-size:var(--h2,16px)}
.source-extract blockquote{margin:24px 0;padding:12px;border-left:2px solid #d5b463}
.source-extract mark{background:#fff1b8;color:#222}
.source-original-math .katex-display{overflow:auto}
.source-access-note{font-size:var(--small,12.5px);color:#666}
.source-code{white-space:pre;overflow:auto;font:var(--small,12.5px)/1.7 monospace}
.source-code-line{display:block;min-width:max-content}
.source-line-highlight{background:#fff1b8}
/* Phones: the pane becomes a bottom sheet over the page. */
@media (max-width:760px){
  .refpane{top:auto;left:0;width:auto;height:65vh;border-left:0;border-top:1px solid var(--rule,#e6e6e6)}
  html body.refpane-shown{padding-right:0;padding-bottom:65vh}
  .refpane-grip{display:none}
  body.refpane-shown .cg-hint{right:14px;bottom:calc(65vh + 14px)}
}
