.paleoquiz-section {
  width: min(90%, 1160px);
  margin: 0 auto;
  padding: 0 0 70px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f7f5ed;
  color: #193f39;
  font: 1rem/1.6 system-ui, sans-serif;
}
.quiz-header {
  width: min(90%, 1160px);
  margin: 0 auto 28px;
  padding: 16px 0;
  border-bottom: 1px solid #d0d8c4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.quiz-header a { color: inherit; text-underline-offset: .2em; }
.quiz-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}
.quiz-brand img { object-fit: contain; }
h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}
button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid #bdcabc;
  border-radius: 7px;
  cursor: pointer;
}
button.primary { background: #234e40; color: #fff; font-weight: 700; }
button.primary:hover { background: #193f39; }
:focus-visible { outline: 3px solid #a34a24; outline-offset: 3px; }

.paleoquiz-card {
  max-width: 760px;
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid #d0d8c4;
  border-radius: 16px;
  background: #fcfaf0;
  color: #234637;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.paleoquiz-card h3 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.paleoquiz-card h4 {
  margin: 0;
  font-size: 1.125rem;
}

.paleoquiz-card p {
  margin: 0 0 12px;
  font-size: 1rem;
}

.paleoquiz-card :is(h3, h4) {
  scroll-margin-top: 20px;
}

.paleoquiz-card .paleoquiz-progress {
  color: #4a665a;
  font-size: .9rem;
  font-weight: 700;
}

.paleoquiz-options {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
  border: 0;
  padding: 0;
  margin: 16px 0;
}

.paleoquiz-options legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 700;
}

.paleoquiz-options label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid #c7d2c0;
  border-radius: 8px;
  background: #fffdf6;
}

.paleoquiz-options label:has(input:checked) {
  border-color: #37624f;
  background: #edf2e8;
}

.paleoquiz-options input {
  flex: none;
  margin: .35em 0 0;
  accent-color: #234e40;
}

.paleoquiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.paleoquiz-actions:empty {
  display: none;
}

.paleoquiz-card button {
  min-height: 42px;
  padding: 9px 14px;
  font-size: .9rem;
  white-space: normal;
  text-align: left;
}

.paleoquiz-feedback {
  padding: 14px 16px;
  margin: 16px 0;
  border-inline-start: 4px solid #37624f;
  border-radius: 8px;
  background: #edf2e8;
}

.paleoquiz-feedback.is-incorrect {
  border-color: #936334;
  background: #f7eedc;
}

.paleoquiz-feedback p,
.paleoquiz-card details p {
  margin: 8px 0 0;
}

.paleoquiz-card details {
  margin: 16px 0;
}

.paleoquiz-card summary {
  cursor: pointer;
  font-weight: 700;
}

.paleoquiz-card details button {
  margin-top: 8px;
}

.paleoquiz-emphasis,
.paleoquiz-card .paleoquiz-score {
  font-weight: 700;
}

.paleoquiz-card .paleoquiz-score {
  font-size: 1.3rem;
}

.paleoquiz-review {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
}

.paleoquiz-review button {
  width: 100%;
}

.paleoquiz-closing {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #d0d8c4;
}

@media (max-width: 640px) {
  .paleoquiz-section {
    padding-bottom: 40px;
  }
}

.paleoquiz-card:has(.paleoquiz-home) {
  max-width: 1160px;
}

.paleoquiz-home {
  display: grid;
  grid-template-columns: minmax(0,1.65fr) minmax(225px,1fr);
  align-items: start;
  gap: clamp(18px,4vw,36px);
}

.paleoquiz-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
}

@media (max-width: 760px) {
  .paleoquiz-home {
    grid-template-columns: minmax(0,1fr);
  }

  .paleoquiz-art {
    order: -1;
    aspect-ratio: 4/3;
    object-position: center 24%;
  }
}
