.quiz-main { padding: 32px 0 52px; }
.quiz-shell { width: calc(100% - 64px); max-width: 1020px; margin-inline: auto; }
.quiz-progress { display: block; appearance: none; border: 0; width: 100%; height: 4px; border-radius: 20px; overflow: hidden; background: #e9e2d9; color: var(--coral-strong); margin-bottom: 24px; }
.quiz-progress::-webkit-progress-bar { background: #e9e2d9; border-radius: 20px; }
.quiz-progress::-webkit-progress-value { background: var(--coral-strong); border-radius: 20px; transition: width .25s ease; }
.quiz-progress::-moz-progress-bar { background: var(--coral-strong); border-radius: 20px; }
.quiz-card { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: #fdfbf8; box-shadow: 0 12px 35px #27282004; }
.quiz-visual { display: flex; flex-direction: column; justify-content: center; padding: 30px; gap: 27px; min-width: 0; background: #f1ece4; }
.quiz-photo { width: 100%; aspect-ratio: 3 / 2; border-radius: 15px; overflow: hidden; background: #e8e3da; }
.quiz-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.quiz-visual-copy { padding: 0 5px; }
.quiz-visual-copy h2 { margin: 0 0 15px; color: var(--ink); font-size: clamp(31px, 3vw, 43px); line-height: 1.04; letter-spacing: -.04em; }
.quiz-visual-copy p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 29ch; }
.quiz-panel { padding: 43px 38px 36px; min-width: 0; min-height: 490px; display: flex; flex-direction: column; justify-content: center; }
.quiz-panel #quiz-title { margin: 0; font-size: clamp(34px, 3.2vw, 44px); line-height: 1.055; font-weight: 600; letter-spacing: -.038em; overflow-wrap: break-word; }
.quiz-panel #quiz-title:focus { outline: none; }
.quiz-description { color: var(--muted); font-size: var(--paragraph-font-size); line-height: 1.55; margin: 19px 0 26px; }
.quiz-controls { display: grid; gap: 12px; }
.quiz-controls .button { width: 100%; min-height: 54px; padding: 15px 20px; border-radius: 13px; font-size: 17px; font-weight: 600; }
.quiz-controls .button:hover { background: #b34638; }
.quiz-options { display: grid; gap: 9px; padding: 0; margin: 0; border: 0; }
.quiz-option { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 13px 15px; border: 1px solid #d2cbc2; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.quiz-option:hover { border-color: var(--coral-strong); }
.quiz-option:has(input:checked), .quiz-option[aria-pressed='true'] { border-color: var(--coral-strong); background: #f9e5de; }
.quiz-option:has(input:focus-visible) { outline: 3px solid #703b32; outline-offset: 3px; }
.quiz-option input { width: 19px; height: 19px; flex-shrink: 0; margin: 0; accent-color: var(--coral-strong); cursor: pointer; }
.quiz-option span { font-size: 15px; line-height: 1.35; }
.quiz-choice { min-height: 57px; justify-content: space-between; padding-block: 16px; font: inherit; }
.quiz-choice .quiz-option-arrow { color: #a13e30; font-size: 19px; }
.quiz-error { margin: 0; color: #a32d23; font-size: 13px; line-height: 1.45; }
.quiz-error:empty { display: none; }
.quiz-summary { margin: 0 0 9px; padding: 0; display: grid; gap: 13px; }
.quiz-summary div { padding-left: 15px; border-left: 2px solid #e6b7a7; }
.quiz-summary .quiz-summary-label { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8d4135; }
.quiz-loading { padding: 28px 0; }
.quiz-loading p { margin: 18px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.quiz-loading-dots { display: flex; gap: 8px; }
.quiz-loading-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--coral-strong); animation: quiz-pulse .8s ease-in-out infinite alternate; }
.quiz-loading-dots span:nth-child(2) { animation-delay: .15s; }
.quiz-loading-dots span:nth-child(3) { animation-delay: .3s; }
.quiz-panel.is-entering { animation: quiz-enter .22s ease both; }
.quiz-footer { justify-content: center; gap: 24px; }
.quiz-footer a { min-height: 44px; display: inline-flex; align-items: center; }
.quiz-noscript { max-width: 620px; margin: 20px auto; padding: 18px; background: #f9e5de; color: var(--ink); line-height: 1.6; }
@keyframes quiz-enter { from { transform: translateY(6px); } to { transform: none; } }
@keyframes quiz-pulse { from { opacity: .35; transform: translateY(0); } to { opacity: 1; transform: translateY(-4px); } }
@media (max-width: 1023px) {
  .quiz-shell { width: calc(100% - 48px); }
  .quiz-panel { padding: 32px 27px; }
  .quiz-visual { padding: 22px; }
  .quiz-visual-copy h2 { font-size: 35px; }
}
@media (max-width: 700px) {
  .quiz-main { padding-block: 14px 30px; }
  .quiz-shell { width: calc(100% - 28px); max-width: 520px; }
  .quiz-progress { margin-bottom: 17px; }
  .quiz-card { grid-template-columns: minmax(0, 1fr); border-radius: 19px; }
  .quiz-visual { padding: 0; display: block; }
  .quiz-photo { border-radius: 0; }
  .quiz-visual-copy { display: none; }
  .quiz-panel { min-height: 0; padding: 28px 23px 26px; }
  .quiz-panel #quiz-title { font-size: 36px; line-height: 1.07; }
  .quiz-description { margin: 16px 0 23px; font-size: var(--paragraph-font-size); }
  .quiz-footer { gap: 0; }
}
@media (max-width: 359px) {
  .quiz-shell { width: calc(100% - 20px); }
  .quiz-panel { padding-inline: 19px; }
  .quiz-panel #quiz-title { font-size: 32px; }
  .quiz-option { padding-inline: 12px; gap: 9px; }
  .quiz-option span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-panel.is-entering, .quiz-loading-dots span { animation: none; }
  .quiz-progress::-webkit-progress-value { transition: none; }
}

/* Give the controls their natural height; the image uses the remaining space. */
@media (max-width: 700px) {
  .quiz-page { height: 100svh; min-height: 100svh; }
  .quiz-page > .announcement, .quiz-page > .site-header, .quiz-page > .site-footer { flex-shrink: 0; }
  .quiz-page .navigation { height: 52px; }
  .quiz-main { display: flex; min-height: 0; padding-block: 10px; }
  .quiz-shell { display: flex; flex-direction: column; min-height: 0; }
  .quiz-progress { flex-shrink: 0; margin-bottom: 10px; }
  .quiz-card { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; overflow: visible; }
  .quiz-visual { flex: 0 1 auto; aspect-ratio: 3 / 2; min-height: 0; overflow: hidden; border-radius: 18px 18px 0 0; }
  .quiz-photo { height: 100%; aspect-ratio: auto; }
  .quiz-photo img { object-position: center 42%; }
  .quiz-panel { flex-shrink: 0; padding: 14px 16px; }
  .quiz-panel #quiz-title { font-size: clamp(26px, 7.2vw, 32px); line-height: 1.06; }
  .quiz-description { margin: 9px 0 12px; font-size: var(--paragraph-font-size); line-height: 1.35; }
  .quiz-controls { gap: 8px; }
  .quiz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quiz-option { min-height: 50px; padding: 9px; gap: 8px; }
  .quiz-option span { font-size: 14px; line-height: 1.2; }
  .quiz-option input { width: 18px; height: 18px; }
  .quiz-choice { min-height: 46px; }
  .quiz-controls .button { min-height: 46px; padding: 11px 15px; font-size: 16px; }
  .quiz-summary { gap: 8px; margin-bottom: 0; }
  .quiz-summary div { padding-left: 10px; }
  .quiz-summary .quiz-summary-label { font-size: 16px; margin: 0; }
  .quiz-page .footer-content { min-height: 30px; padding-block: 0; flex-direction: row; gap: 8px; font-size: 11px; }
  .quiz-page .footer-content a { min-height: 30px; padding-block: 7px; }
  .quiz-panel.is-entering { animation: none; }
}
@media (max-width: 700px) and (max-height: 650px) {
  .quiz-card:has([data-type='complete']) .quiz-visual { display: none; }
}

/* Fill the desktop image column and crop the wider GIF within its frame. */
@media (min-width: 701px) {
  .quiz-visual { position: relative; padding: 0; overflow: hidden; }
  .quiz-visual-copy { display: none; }
  .quiz-photo { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; overflow: hidden; }
  .quiz-photo img { display: block; position: absolute; top: 0; left: 50%; width: auto; min-width: 100%; max-width: none; height: 100%; object-fit: cover; transform: translateX(-50%); }
}

/* The progress bar belongs to the card, flush against its image/content edge. */
.quiz-card > .quiz-progress { width: 100%; margin: 0; border-radius: 0; flex-shrink: 0; }
.quiz-card > .quiz-progress::-webkit-progress-bar { border-radius: 0; }
.quiz-card > .quiz-progress::-webkit-progress-value { border-radius: 0; }
@media (min-width: 701px) {
  .quiz-card { grid-template-rows: 4px auto; }
  .quiz-visual { grid-column: 1; grid-row: 1 / span 2; }
  .quiz-card > .quiz-progress { grid-column: 2; grid-row: 1; }
  .quiz-panel { grid-column: 2; grid-row: 2; }
}

