:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e9e9ee;
  --muted: #a7aab5;
  --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.toolbar button {
  appearance: none;
  border: 1px solid var(--border);
  background: #10131a;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.toolbar button:hover { filter: brightness(1.1); }
.toolbar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.toolbar .muted { color: var(--muted); }
#zoomLabel { min-width: 52px; display: inline-block; text-align: center; }

.stage {
  height: calc(100vh - 52px);
  display: grid;
  place-items: center;
  padding: 14px;
}

.book {
  width: min(1100px, 96vw);
  height: min(720px, 82vh);
  border-radius: 14px;
  overflow: hidden;
}

/* Jede PDF-Seite wird als HTML-Page mit Canvas gerendert */
.page {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.page canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.page .loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #333;
  font-weight: 600;
  background: linear-gradient(135deg, #f3f3f3, #e9e9e9);
}