* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #2b2b2b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 600;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  color: #f0f0f0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#pdf-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
}

/* Each PDF page wrapper */
.page-wrapper {
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #fff;
}

.page-wrapper canvas {
  display: block;
}

/* PDF.js text layer — matches pdf_viewer.css essentials */
.text-layer {
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: clip;
  line-height: 1;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
}

.text-layer > span {
  position: absolute;
  white-space: pre;
  color: transparent;
  pointer-events: all;
  transform-origin: 0 0;
}

.text-layer br {
  display: none;
}

/* Highlight overlay layer — sits above text layer */
.highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

/* Each highlight is an absolutely-positioned rect */
.def-highlight {
  position: absolute;
  background: rgba(255, 196, 0, 0.25);
  border-radius: 2px;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.15s ease;
}

.def-highlight:hover {
  background: rgba(255, 196, 0, 0.5);
}

/* ── Minimap ──────────────────────────────────────────────── */
#minimap {
  position: fixed;
  right: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: #1e1e1e;
  border-left: 1px solid #333;
  z-index: 500;
  cursor: pointer;
  overflow: hidden;
}

#minimap-pages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#minimap-pages canvas {
  display: block;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#minimap-viewport {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 2;
}

#minimap-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.minimap-dot {
  position: absolute;
  right: 4px;
  width: 8px;
  height: 3px;
  border-radius: 1px;
  background: rgba(255, 196, 0, 0.9);
  pointer-events: all;
  cursor: pointer;
  /* Override global border-box so height=3px is the content area,
     not the total box (padding would otherwise consume all 3px) */
  box-sizing: content-box;
  /* Larger hit area via padding, compensated by negative margin */
  padding: 6px 0;
  margin-top: -6px;
  background-clip: content-box;
}

.minimap-dot:hover {
  background: rgba(255, 196, 0, 1);
  background-clip: content-box;
}

.minimap-dot.pinned {
  background: rgba(255, 196, 0, 1);
  background-clip: content-box;
}

/* Minimap paragraph tooltip — appears to the left of the minimap */
.minimap-tooltip {
  position: fixed;
  z-index: 1000;
  right: 248px;
  width: 520px;
  padding: 12px 14px;
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.minimap-tooltip.visible {
  opacity: 1;
}

.minimap-tooltip-text mark {
  background: rgba(255, 196, 0, 0.4);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 420px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-term {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.tooltip-definition {
  font-size: 13px;
  font-weight: 400;
  color: #444;
  line-height: 1.5;
}
