:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #1457a6;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  min-height: 4rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d8dee8;
  background: #ffffff;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header form {
  margin: 0;
}

.brand {
  color: #172033;
  font-weight: 750;
  text-decoration: none;
}

.page {
  width: min(100% - 2rem, 70rem);
  margin: 0 auto;
  padding: 2rem 0;
}

.workspace,
.auth-panel,
.study-flow {
  max-width: 38rem;
}

.home-hero {
  min-height: 22rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid #d8dee8;
}

.section-label {
  margin: 0 0 0.75rem;
  color: #596579;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 14ch;
  margin: 0;
  font-size: 4rem;
  line-height: 1;
}

.home-lede {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  color: #364154;
  font-size: 1.25rem;
  line-height: 1.5;
}

.data-use-disclosure {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: #364154;
  line-height: 1.55;
}

.data-use-disclosure p {
  margin: 0 0 1rem;
}

.data-use-disclosure p:last-child {
  margin-bottom: 0;
}

.home-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.button-link {
  width: fit-content;
  padding: 0.65rem 1rem;
  border: 1px solid #aeb8c7;
  border-radius: 0.375rem;
  background: #ffffff;
  color: #172033;
  font-weight: 700;
  text-decoration: none;
}

.home-paths {
  display: grid;
  grid-template-columns: minmax(0, 42rem);
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid #d8dee8;
}

.home-path {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.home-path h2,
.home-path p {
  margin: 0;
}

.home-path p,
.home-note p {
  color: #364154;
  line-height: 1.5;
}

.home-note {
  max-width: 48rem;
  padding: 1.5rem 0 0;
}

.home-note p {
  margin: 0;
}

.auth-panel form,
.study-form {
  display: grid;
  gap: 1rem;
}

.auth-panel p {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.auth-panel input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #aeb8c7;
  border-radius: 0.375rem;
  background: #ffffff;
}

.primary-action,
button {
  width: fit-content;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.375rem;
  background: #1769c2;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.step-label {
  margin-bottom: 0.4rem;
  color: #596579;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.study-flow h1 {
  margin-top: 0;
}

.study-form {
  margin-top: 1.5rem;
}

.study-form fieldset {
  margin: 0;
  padding: 1rem;
  border: 1px solid #cbd3df;
  border-radius: 0.375rem;
  background: #ffffff;
}

.study-form legend {
  padding: 0 0.35rem;
  font-weight: 700;
}

.choice-list > div {
  display: grid;
  gap: 0.75rem;
}

.choice-list label,
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.choice-list input,
.checkbox-option input {
  margin-top: 0.2rem;
}

.errorlist {
  color: #a62121;
}

.study-summary {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.study-summary div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
}

.study-summary dt {
  font-weight: 700;
}

.study-summary dd {
  margin: 0;
}

.start-experiment-form {
  margin-top: 1.5rem;
}

.practice-item-list {
  display: grid;
  gap: 1rem;
  padding-left: 1.5rem;
}

.practice-item-list p {
  margin: 0.2rem 0;
}

.recorder {
  min-height: calc(100vh - 8rem);
  display: grid;
  align-items: center;
}

.recorder-screen {
  width: min(100%, 56rem);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
}

.recorder-screen h1,
.recorder-screen p {
  margin: 0;
}

.recorder-index {
  min-height: 1.5rem;
  color: #596579;
  font-weight: 700;
}

.recorder-stimulus {
  min-height: 9rem;
  display: grid;
  place-items: center;
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
}

.recorder-details {
  min-height: 1.75rem;
  color: #596579;
  font-size: 1.1rem;
  font-weight: 650;
}

.recorder-progress {
  width: min(100%, 28rem);
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.recorder-progress-item {
  display: grid;
  gap: 0.35rem;
}

.recorder-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #364154;
  font-size: 0.9rem;
  font-weight: 700;
}

.recorder-progress-bar {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: #d8dee8;
}

.recorder-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #167342;
}

.recorder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.recorder-actions button {
  min-width: 9rem;
  min-height: 3.25rem;
}

.recorder-actions .button-accept {
  min-width: 12rem;
  background: #167342;
  font-size: 1.35rem;
}

.button-secondary {
  background: #49576b;
}

.button-danger {
  background: #b4232c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.recorder-status {
  min-height: 1.5rem;
  color: #596579;
}

.recorder-state-message {
  color: #364154;
  font-size: 1.2rem;
  font-weight: 700;
}

.practice-session {
  width: min(100%, 56rem);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

.practice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.practice-header h1 {
  margin: 0;
}

.practice-progress {
  margin: 0.2rem 0 0;
  color: #596579;
  font-weight: 700;
}

.practice-recorder {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #364154;
  font-weight: 700;
}

.recording-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #b4232c;
}

.practice-timer {
  min-width: 3.5rem;
  font-variant-numeric: tabular-nums;
}

.practice-prompt {
  min-height: 10rem;
  display: grid;
  place-items: center;
  padding: 1rem 0;
  font-size: 3rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  user-select: text;
}

.practice-prompt:hover {
  color: #1457a6;
}

.practice-pinyin {
  min-height: 2rem;
  margin: 0;
  color: #364154;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.practice-pinyin-slot {
  display: inline-block;
  min-width: 2.5rem;
  color: #7a8495;
}

.practice-pinyin-slot.is-revealed {
  color: #172033;
}

.practice-pinyin-punctuation {
  display: inline-block;
  min-width: 1rem;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.practice-actions form {
  margin: 0;
}

.practice-actions button {
  min-width: 12rem;
  min-height: 3.25rem;
}

.practice-actions .button-accept {
  background: #167342;
  font-size: 1.25rem;
}

.is-hidden {
  display: none;
}

@media (max-width: 40rem) {
  .site-header {
    padding: 0 1rem;
  }

  .page {
    padding: 1.25rem 0;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 2rem 0 1.5rem;
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .home-primary-actions,
  .home-paths {
    display: grid;
  }

  .home-primary-actions a {
    width: 100%;
  }

  .home-paths {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .recorder {
    min-height: calc(100vh - 6.5rem);
  }

  .recorder-stimulus {
    min-height: 6rem;
    font-size: 4.75rem;
  }

  .recorder-actions {
    width: 100%;
    display: grid;
  }

  .recorder-actions button {
    width: 100%;
  }

  .practice-header,
  .practice-actions {
    display: grid;
  }

  .practice-prompt {
    min-height: 8rem;
    font-size: 3rem;
  }

  .practice-actions button {
    width: 100%;
  }
}
