:root {
  color-scheme: dark;
  --bg: #202020;
  --surface: #2a2a2a;
  --border: #3a3a3a;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --accent: #6eab43;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Security: disable text/image selection and drag affordances */
body,
canvas,
.shield {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.brand {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.page-counter {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.viewer-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0 0 1.25rem;
  gap: 0.75rem;
}

.status {
  min-height: 1.25rem;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.is-error {
  color: #ff8f8f;
}

.canvas-frame {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #111;
  box-shadow: none;
}

#pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Security: transparent overlay above canvas blocks direct interaction */
.shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.nav-btn {
  min-width: 132px;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav-btn:hover:not(:disabled) {
  background: #333;
  border-color: #4a4a4a;
}

.nav-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-btn {
    width: 100%;
    max-width: 280px;
  }
}
