.pdf-editor {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  background: var(--bg, #0a1220);
  color: var(--text, #f2f5fa);
  font: inherit;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
}
.pdf-editor *, .pdf-editor *::before, .pdf-editor *::after { box-sizing: border-box; }
.pdf-editor-head, .pdf-editor-footer {
  flex: 0 0 auto;
  padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  background: var(--surface, #111e31);
  border-bottom: 1px solid var(--border, #2a3c55);
}
.pdf-editor-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.pdf-editor-head h2 { margin: 0; font-size: 1.15rem; }
.pdf-editor-head p { margin: 4px 0 0; color: var(--muted, #b0bfd0); font-size: .85rem; }
.pdf-editor-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }
.pdf-editor-body > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.pdf-editor-hint, .pdf-editor-limits { line-height: 1.55; font-size: .87rem; color: var(--muted, #b0bfd0); }
.pdf-editor-hint { margin-top: 0; }
.pdf-editor-limits { padding: 10px 12px; border: 1px solid var(--border, #2a3c55); border-radius: 10px; }
.pdf-editor-limits summary { cursor: pointer; color: var(--text, #f2f5fa); font-weight: 600; }
.pdf-editor-limits p { margin: 8px 0 0; }
.pdf-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 0; }
#pdfEditorCount { margin-left: auto; color: var(--muted, #b0bfd0); font-size: .85rem; }
.pdf-editor-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pdf-editor-page { border: 1px solid var(--border, #2a3c55); background: var(--surface, #111e31); border-radius: 14px; padding: 14px; min-width: 0; }
.pdf-editor-page-top { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pdf-editor-page-top input { width: 22px; height: 22px; accent-color: var(--accent, #79b5ff); }
.pdf-editor-number { font-size: 1.65rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pdf-editor-source { margin-top: 10px; font-weight: 600; overflow-wrap: anywhere; }
.pdf-editor-meta { font-size: .84rem; line-height: 1.5; color: var(--muted, #b0bfd0); margin: 6px 0 12px; }
.pdf-editor-page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pdf-editor .btn { min-height: 44px; white-space: normal; line-height: 1.25; }
.pdf-editor .btn:disabled { opacity: .45; cursor: default; }
.pdf-editor :focus-visible { outline: 2px solid var(--accent, #79b5ff); outline-offset: 3px; }
.pdf-editor-footer { border-bottom: 0; border-top: 1px solid var(--border, #2a3c55); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
#pdfEditorStatus { margin: 0 0 10px; font-size: .85rem; line-height: 1.45; }
.pdf-editor-error { color: #ffc5b7; }
.pdf-editor-export { display: flex; flex-wrap: wrap; gap: 8px; }
.pdf-editor-empty { grid-column: 1 / -1; color: var(--muted, #b0bfd0); padding: 18px 0; }
@media (max-width: 520px) {
  .pdf-editor-head { gap: 8px; padding: 12px; }
  .pdf-editor-body { padding: 12px; }
  .pdf-editor-pages { grid-template-columns: 1fr; }
  .pdf-editor-footer { padding-left: 12px; padding-right: 12px; }
  .pdf-editor-export > .btn { flex: 1 1 45%; font-size: .83rem; }
  .pdf-editor-export > .btn:last-child { flex-basis: 100%; }
  #pdfEditorCount { flex-basis: 100%; margin-left: 0; }
}
