/* Shared public reader tools. Intentionally isolated from page-specific UI. */
.ov-reader, .ov-citation { font-family: var(--font-ui); color: var(--color-text); }
.ov-reader *, .ov-citation * { box-sizing: border-box; letter-spacing: 0; }
.ov-reader [hidden], .ov-citation [hidden], .ov-reader[hidden] { display: none !important; }
.ov-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ov-reader { --ov-edge: 24px; --ov-bottom: 24px; position: fixed; right: var(--ov-edge); bottom: var(--ov-bottom); z-index: 1000; }
html:has(#ov-reader) { scrollbar-gutter: stable; }
html.ov-reader-modal, body.ov-reader-modal { overflow: hidden; overscroll-behavior: none; }
.ov-reader.is-open { inset: 0; display: grid; place-items: center; padding: 24px; }
.ov-reader-backdrop { position: absolute; inset: 0; background: rgba(31, 57, 49, .18); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ov-reader.is-open .ov-reader-dock { display: none; }
.ov-reader button, .ov-reader input, .ov-reader select, .ov-reader textarea, .ov-citation button { font: inherit; }
.ov-reader button, .ov-citation button { cursor: pointer; }
:where(.ov-reader, .ov-citation) button { width: auto; }
.ov-reader svg, .ov-citation svg { flex: 0 0 auto; vertical-align: middle; }
.ov-reader :focus-visible, .ov-citation :focus-visible, .ov-home-paper a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.ov-reader-dock { display: flex; align-items: stretch; height: 46px; border: 1px solid #cbded9; border-radius: 8px; background: #fff; box-shadow: 0 3px 14px rgba(20, 52, 45, .1); }
.ov-reader-dock > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 0; background: transparent; color: var(--color-primary); font-size: 14px; font-weight: 650; }
.ov-reader-dock .ov-reader-cite { padding: 0 14px; border-radius: 7px 0 0 7px; }
.ov-reader-dock .ov-reader-feedback { position: relative; width: 46px; border-left: 1px solid var(--color-border); border-radius: 0 7px 7px 0; }
.ov-reader-dock > button:hover, .ov-reader-dock > button[aria-expanded="true"] { background: #edf7f4; }
.ov-reader-tooltip { position: absolute; right: 0; bottom: calc(100% + 10px); padding: 7px 10px; border-radius: 4px; background: #253932; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; visibility: hidden; }
.ov-reader-feedback:hover .ov-reader-tooltip, .ov-reader-feedback:focus-visible .ov-reader-tooltip { visibility: visible; }
.ov-reader.is-open .ov-reader-tooltip { visibility: hidden; }
.ov-reader-panel { position: relative; z-index: 1; width: 408px; max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #ceded9; border-radius: 8px; box-shadow: 0 12px 42px rgba(25, 50, 44, .15), 0 2px 6px rgba(25, 50, 44, .05); transform-origin: center; }
.ov-reader.is-animating .ov-reader-panel { will-change: transform, opacity; }
.ov-reader.is-animating .ov-reader-backdrop { will-change: opacity; }
.ov-reader.is-closing .ov-reader-panel { pointer-events: none; }
.ov-reader-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; padding: 10px 10px 0 22px; }
.ov-reader-header h2 { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.ov-reader-icon-button { width: 44px; height: 44px; flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #687971; }
.ov-reader-icon-button:hover { background: #f0f5f3; color: var(--color-primary); }
.ov-reader-tabs { display: flex; flex-shrink: 0; gap: 24px; margin: 0 22px; border-bottom: 1px solid var(--color-border); }
.ov-reader-tabs button { min-height: 44px; padding: 9px 0 10px; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: #68736e; font-size: 14px; font-weight: 600; }
.ov-reader-tabs button[aria-selected="true"] { border-bottom-color: var(--color-primary); color: var(--color-primary); }
.ov-reader-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 22px 22px; scrollbar-width: thin; }
.ov-reader-intro { margin: 0 0 20px; font-size: 13px; line-height: 1.6; color: #68736e; }
.ov-citation-authors { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: #56665e; }
.ov-citation-title { margin: 0 0 12px; font-family: var(--font-academic); font-size: 20px; line-height: 1.38; font-weight: 400; color: #202d27; overflow-wrap: anywhere; }
.ov-citation-title a { color: inherit; text-decoration: none; }
.ov-citation-title a:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.ov-citation-journal { margin: 0 0 9px; font-size: 13px; line-height: 1.7; color: #4a5b53; }
.ov-citation-journal span { margin-left: 4px; }
.ov-citation-doi { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 13px; color: var(--color-primary); overflow-wrap: anywhere; }
.ov-citation-doi svg { width: 14px; height: 14px; }
.ov-citation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 22px; }
.ov-reader-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--color-primary); border-radius: 6px; background: var(--color-primary); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4; }
.ov-reader-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.ov-reader-primary:disabled { cursor: wait; opacity: .65; }
.ov-reader-download { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 0; font-size: 13px; font-weight: 550; color: #455c51; }
.ov-reader-download svg { width: 16px; height: 16px; }
.ov-reader-download:hover, .ov-reader-note a:hover, .ov-reader-full-feedback:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.ov-copy-status { margin: 0; font-size: 12px; line-height: 1.5; color: #8a4512; }
.ov-copy-status:not(:empty) { margin-top: 10px; }
.ov-reader-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.ov-reader-note p { margin: 0; font-size: 12px; line-height: 1.65; color: #68736e; }
.ov-reader-note a, .ov-reader-full-feedback { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 12px; font-weight: 600; color: var(--color-primary); }
.ov-reader-note a svg, .ov-reader-full-feedback svg { width: 14px; height: 14px; }
.ov-reader-note a { margin-bottom: -12px; }
.ov-reader-hint { position: absolute; right: 0; bottom: 58px; width: 320px; max-width: calc(100vw - 48px); display: flex; align-items: flex-start; gap: 4px; padding: 10px 6px 9px 16px; border: 1px solid #cbded9; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(25, 50, 44, .1); animation: ov-reader-enter 180ms ease-out; }
.ov-reader-hint > div { flex: 1; padding-top: 5px; }
.ov-reader-hint strong { display: block; font-size: 13px; font-weight: 650; }
.ov-reader-hint a { display: inline-flex; align-items: center; min-height: 36px; gap: 5px; font-size: 12px; color: var(--color-primary); }
.ov-reader-hint a svg { width: 14px; height: 14px; }
.ov-reader-form { display: flex; flex-direction: column; gap: 7px; }
.ov-reader-field { display: block; margin-top: 9px; color: #3a5045; font-size: 12px; font-weight: 650; }
.ov-reader-field:first-child { margin-top: 0; }
.ov-reader-field > span { font-weight: 400; color: #6b756f; }
.ov-reader-form input:not([type="checkbox"]), .ov-reader-form select, .ov-reader-form textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #cfdcd6; border-radius: 5px; padding: 10px 11px; background: #fff; color: #253d30; font-size: 14px; line-height: 1.5; }
.ov-reader-form textarea { min-height: 104px; resize: vertical; }
.ov-reader-form [aria-invalid="true"] { border-color: var(--color-danger) !important; }
.ov-reader-field-help { font-size: 11px; color: #77827b; }
.ov-reader-check { display: flex; gap: 9px; align-items: center; min-height: 44px; font-size: 12px; line-height: 1.5; color: #53655a; cursor: pointer; }
.ov-reader-check input { flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; min-height: 16px; max-width: 16px; padding: 0; margin: 0; accent-color: var(--color-primary); }
.ov-reader-context { margin: 6px 0 10px; padding-top: 10px; border-top: 1px solid var(--color-border); }
.ov-reader-context > span { display: block; margin-left: 25px; font-size: 11px; line-height: 1.6; color: #77827b; overflow-wrap: anywhere; }
.ov-reader-form-status { margin: 0 0 6px; font-size: 12px; line-height: 1.6; color: var(--color-danger); }
.ov-reader-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ov-reader-full-feedback { margin-top: 8px; }
.ov-reader-success { padding: 24px 0; }
.ov-reader-success > svg { width: 28px; height: 28px; color: var(--color-primary); }
.ov-reader-success h3 { margin: 14px 0 8px; font-size: 18px; }
.ov-reader-success p { font-size: 13px; color: #5e6e64; overflow-wrap: anywhere; }
.ov-reader-text-button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--color-primary); }
.ov-home-paper { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 5px 12px; margin: 22px 0 0; font-size: 13px; color: #64776d; }
.ov-home-paper cite { font-style: normal; font-weight: 600; }
.ov-home-paper a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
body:has(#ov-reader) .site-footer { padding-bottom: 88px; }
.docs-citation-guide .ov-citation { max-width: 650px; padding: 14px 0 22px; }
.docs-citation-guide .ov-citation-title { font-size: 22px; }
@keyframes ov-reader-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1023px) {
  .ov-reader { --ov-edge: 16px; --ov-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .ov-reader-hint { display: none !important; }
  .ov-reader-panel { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: calc(85dvh - env(safe-area-inset-bottom)); }
  .ov-reader-header { padding-left: 20px; }
  .ov-reader-tabs { margin-inline: 20px; }
  .ov-reader-scroll { padding: 18px 20px 20px; }
  .ov-reader-form input:not([type="checkbox"]), .ov-reader-form select, .ov-reader-form textarea { font-size: 16px; }
}
@media (max-width: 359px) {
  .ov-reader-panel { left: 8px; right: 8px; }
  .ov-reader-scroll { padding-inline: 16px; }
  .ov-citation-actions { gap: 4px 10px; }
  .ov-citation-actions .ov-reader-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-reader-panel, .ov-reader-hint { animation: none; }
}
@media print { .ov-reader, .ov-citation-actions { display: none !important; } }
