:root { --bg: #525659; --ink: #1f2933; --green: #20a464; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #fff; }

/* document pages, full width on phones */
.doc { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 80px; min-height: 100vh; }
.page { width: 100%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.page canvas { display: block; width: 100%; height: 100%; }
@media (min-width: 800px) { .doc { padding: 24px 24px 90px; gap: 18px; } .page { width: min(100%, 900px); } }

/* floating download button */
.dl {
  position: fixed; right: 18px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.dl svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dl:hover { filter: brightness(1.08); }

.loading { flex: 1; display: grid; place-items: center; width: 100%; min-height: 60vh; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.msg { max-width: 420px; text-align: center; margin: 40px auto; padding: 0 20px; }
.msg a { color: #9fe3c0; }
