#attach-note-menu { position: fixed; z-index: 1600; max-width: calc(100vw - 16px); }
#attach-note-btn { white-space: normal; background: var(--bg-panel); border-radius: 6px; }
#attach-note-btn:hover, #attach-note-btn:focus-visible { background: var(--amber); color: #171310; }
#attach-note-btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
::highlight(case-location-quotes) { background: #66502b; color: #fff0cb; }
::highlight(case-pdf-quotes) { background: rgba(231, 180, 65, .38); }
#pdf-modal { z-index: 1200; padding: 16px; }
.case-pdf { width: min(1100px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border: 1px solid var(--border-dim); background: var(--bg-panel); box-shadow: 0 16px 60px #0009; }
.pdf-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.pdf-toolbar h2 { margin: 0; flex: 1; font-size: 1rem; min-width: 140px; }
.pdf-toolbar button { background: var(--bg-panel-2); color: var(--paper); border: 1px solid var(--border-dim); border-radius: 4px; min-width: 36px; min-height: 36px; }
.pdf-toolbar button:disabled { opacity: .4; cursor: default; }
.pdf-toolbar a { color: var(--amber-bright); font-size: .85rem; }
#pdf-status { margin: 0; padding: 0 16px 12px; color: var(--paper-dim); font-size: .85rem; }
#pdf-status:empty { display: none; }
#pdf-pages { position: relative; min-height: 0; overflow: auto; scrollbar-gutter: stable; padding: 14px; background: #302b26; }
.pdf-sheet { position: relative; margin: 0 auto 24px; background: white; }
.pdf-sheet:last-child { margin-bottom: 0; }
.pdf-sheet canvas { display: block; }
.pdf-sheet .textLayer { opacity: 1; }
.manual-note .note-source { display: block; margin-top: 6px; color: var(--amber-bright); font-size: .78rem; }
.note-remove { display: block; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--paper-dim); font: inherit; font-size: .78rem; text-decoration: underline; cursor: pointer; }
.note-remove:hover { color: var(--amber-bright); }
.note-remove:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.note-remove:disabled { opacity: .5; cursor: wait; }
@media (max-width: 600px) {
  #pdf-modal { padding: 0; }
  .case-pdf { max-height: 100dvh; }
  .pdf-toolbar { gap: 8px; padding: 10px; }
  #pdf-title { flex-basis: calc(100% - 50px); order: -2; }
  #pdf-close { order: -1; }
}
