body {
  padding: 1.25rem;
}

.question-img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.sidebar {
  max-height: 70vh;
  overflow: auto;
}

.timer {
  font-family: monospace;
  font-weight: 700;
}

.marked-correct {
  border-left: 6px solid #198754;
}

.marked-incorrect {
  border-left: 6px solid #dc3545;
}

.marked-unsure {
  border-left: 6px solid #ffc107;
}

/* hide scrollbars nicely when full-width view */
.no-side {
  padding-left: 0;
  padding-right: 0;
}

/* Question palette (floating on the right) - expanded grid */
#qPalette {
  position: fixed;
  right: 12px;
  top: 120px;
  width: 220px;
  /* increased width to accommodate grid */
  max-height: 78vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e6e6e6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 8px;
  z-index: 1050;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.palette-btn {
  display: block;
  width: 100%;
  height: 36px;
  border-radius: 6px;
  text-align: center;
  line-height: 36px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

.pal-unmarked {
  background: #f1f3f5;
  color: #333;
}

.pal-correct {
  background: #198754;
  color: white;
}

.pal-incorrect {
  background: #dc3545;
  color: white;
}

.pal-unsure {
  background: #ffc107;
  color: #212529;
}

.palette-title {
  font-size: 12px;
  text-align: center;
  margin-bottom: 6px;
  color: #555;
}

@media (max-width: 1100px) {
  #qPalette {
    display: none;
  }
}

/* when palette visible, give right margin so it doesn't overlap content */
.with-palette {
  margin-right: 240px;
}