body {
  background: #f4f4f4;
  color: #2b2b2b;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  margin: 0;
}

.experiment-shell {
  box-sizing: border-box;
  max-width: 1380px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px 24px 60px;
}

.screen-host {
  width: 100%;
}

/* Introductory, consent, break, and completion screens are centered in the
   available viewport. Long information pages still expand normally. */
body[data-screen-kind="navigation"] .experiment-shell,
body[data-screen-kind="consent"] .experiment-shell,
body[data-screen-kind="done"] .experiment-shell,
body[data-screen-kind="categorization"] .experiment-shell {
  align-items: center;
  display: flex;
}

/* Slightly lower placement feels more balanced than the exact geometric
   center once headings and continue prompts are taken into account. */
body[data-screen-kind="navigation"] .screen-host {
  transform: translateY(3vh);
}

.task-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  margin: 24px auto;
  max-width: 1220px;
  padding: 40px 48px;
  text-align: left;
}

.task-card> :first-child {
  margin-top: 0;
}

.task-card> :last-child {
  margin-bottom: 0;
}

.task-card h1,
.task-card h2,
.continue-instruction {
  text-align: center;
}

.task-card h1 {
  margin-bottom: 28px;
}

.task-card h2 {
  margin: 34px 0 16px;
}

.task-card h4 {
  line-height: 1.5;
  margin: 22px 0;
}

.task-card p {
  margin: 18px 0;
}

.participant-summary {
  align-items: top;
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(0, 1.7fr) minmax(500px, 0.9fr);
}

.participant-logo-frame {
  height: 120px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* The supplied image has generous white space around the wordmark. The
   viewport crops that space without modifying the original logo asset. */
.participant-logo {
  display: block;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

.instruction-screen {
  font-size: 20px;
  text-align: center;
}

.instruction-screen p {
  margin: 20px auto;
  max-width: 760px;
}

.continue-instruction {
  font-size: 20px;
  margin-top: 38px !important;
}

kbd {
  background: #292929;
  border-radius: 5px;
  color: white;
  display: inline-block;
  font-size: 1.1em;
  min-width: 2em;
  padding: 5px 10px;
  text-align: center;
}

.key-instruction-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: 1fr 1fr;
  margin: 36px auto;
  max-width: 520px;
  text-align: center;
}

.key-instruction-grid>div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#wait-overlay {
  align-items: center;
  background: rgba(244, 244, 244, 0.97);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 10000;
}

#wait-overlay[hidden] {
  display: none;
}

.wait-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.12);
  max-width: 600px;
  padding: 40px;
  text-align: center;
}

.wait-spinner {
  animation: wait-spin 0.9s linear infinite;
  border: 5px solid #d6d6d6;
  border-radius: 50%;
  border-top-color: #2c7be5;
  height: 48px;
  margin: 0 auto 22px;
  width: 48px;
}

@keyframes wait-spin {
  to {
    transform: rotate(360deg);
  }
}

.task-status {
  min-height: 1.5em;
  text-align: center;
}

.task-status.error {
  color: #a61b1b;
}

.task-status.success {
  color: #176b36;
}

.big-continue-btn {
  background: #2c7be5;
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 18px;
  margin: 36px auto 0;
  padding: 14px 30px;
}

.big-continue-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .experiment-shell {
    padding: 20px 12px 36px;
  }

  .task-card {
    margin: 12px auto;
    padding: 28px 22px;
  }

  .key-instruction-grid {
    gap: 18px;
  }

  .participant-summary {
    gap: 16px;
    grid-template-columns: 1fr;
  }

  .participant-logo-frame {
    height: 100px;
    margin: 0 auto;
    max-width: 360px;
  }
}