:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #262626; font-family: Arial, Helvetica, sans-serif; }
body { display: grid; grid-template-rows: 48px minmax(0, 1fr); }
.toolbar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 10px; background: #333; border-bottom: 1px solid #444; color: #fff; user-select: none; }
.toolbar button { width: 34px; height: 34px; border: 0; border-radius: 4px; background: #444; color: #fff; font-size: 22px; cursor: pointer; }
.toolbar button:disabled { opacity: .4; cursor: default; }
.toolbar button:focus-visible, .toolbar input:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.page-info { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 14px; }
.page-info input { width: 48px; height: 32px; border: 1px solid #666; border-radius: 3px; background: #222; color: #fff; text-align: center; font-size: 14px; }
.separator { width: 1px; height: 24px; background: #666; margin: 0 2px; }
#zoomLabel { min-width: 46px; text-align: center; font-size: 13px; }
#viewer { position: relative; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 16px; -webkit-overflow-scrolling: touch; }
#pdfCanvas { display: block; background: #fff; box-shadow: 0 3px 18px rgba(0,0,0,.45); max-width: none; }
#loading, #error { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; text-align: center; padding: 20px; }
#error { color: #ffd0d0; max-width: 90%; }
@media (max-width: 640px) {
  body { grid-template-rows: 46px minmax(0, 1fr); }
  .toolbar { gap: 5px; padding: 5px 6px; }
  .toolbar button { width: 32px; height: 32px; }
  .separator { margin: 0; }
  #viewer { padding: 8px; }
}
