:root {
  --guided-navy: #102047;
  --guided-red: #df2027;
  --guided-red-dark: #b9161c;
  --guided-muted: #66738c;
  --guided-line: #d8e1ed;
  --guided-soft: #f4f7fb;
  --guided-success: #117a58;
}

.guided-experience {
  padding: 34px 0 56px;
}

.guided-experience-guide {
  width: min(calc(100% - 40px), 1120px);
  margin: 0 auto 18px;
  padding-top: 34px;
}

.vocabulary-page.is-experience-mode {
  padding-top: 0;
}

.guided-experience-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.guided-experience-intro h1 {
  margin: 0 0 10px;
  color: var(--guided-navy);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.guided-experience-intro p {
  max-width: 680px;
  margin: 0;
  color: var(--guided-muted);
  font-size: 1.04rem;
  line-height: 1.72;
}

.guided-language-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--guided-line);
  border-radius: 13px;
  background: #fff;
}

.guided-language-switch button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--guided-muted);
  font: inherit;
  font-size: .94rem;
  font-weight: 700;
  cursor: pointer;
}

.guided-language-switch button[aria-pressed="true"] {
  background: var(--guided-navy);
  color: #fff;
}

.guided-step-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0 0 18px;
  padding: 18px 14px;
  border: 1px solid var(--guided-line);
  border-radius: 16px;
  background: #fff;
}

.guided-step-rail button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--guided-muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.guided-step-rail button::before {
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 1px;
  background: var(--guided-line);
  content: "";
  transform: translateX(-16px);
  z-index: 0;
}

.guided-step-rail button:first-child::before {
  display: none;
}

.guided-step-rail span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--guided-line);
  border-radius: 50%;
  background: #fff;
  color: inherit;
}

.guided-step-rail button.is-complete span {
  border-color: var(--guided-navy);
  background: var(--guided-navy);
  color: #fff;
}

.guided-step-rail button.is-current {
  color: var(--guided-red);
}

.guided-step-rail button.is-current span {
  border: 2px solid var(--guided-red);
  color: var(--guided-red);
}

.guided-step-rail button:disabled {
  cursor: default;
  opacity: 1;
}

.guided-stage-copy {
  max-width: 690px;
  margin: 12px auto 0;
  color: var(--guided-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.guided-stage-heading {
  margin-bottom: 30px;
  text-align: center;
}

.guided-stage-progress {
  display: block;
  margin-bottom: 8px;
  color: var(--guided-red);
  font-size: .88rem;
  font-weight: 800;
}

.guided-welcome {
  display: grid;
  min-height: 380px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.guided-welcome-list,
.guided-capability-list {
  display: grid;
  width: min(100%, 720px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 32px;
  padding: 0;
  list-style: none;
}

.guided-welcome-list li,
.guided-capability-list li {
  padding: 15px 12px;
  border: 1px solid var(--guided-line);
  border-radius: 12px;
  background: var(--guided-soft);
  color: var(--guided-navy);
  font-weight: 750;
}

.guided-primary,
.guided-secondary,
.guided-audio-button {
  min-height: 46px;
  border-radius: 10px;
  font: inherit;
  font-size: .98rem;
  font-weight: 800;
  cursor: pointer;
}

.guided-primary {
  min-width: 190px;
  padding: 0 24px;
  border: 1px solid var(--guided-red);
  background: var(--guided-red);
  color: #fff;
  text-decoration: none;
}

.guided-primary:hover,
.guided-primary:focus-visible {
  border-color: var(--guided-red-dark);
  background: var(--guided-red-dark);
}

.guided-secondary {
  padding: 0 20px;
  border: 1px solid var(--guided-navy);
  background: #fff;
  color: var(--guided-navy);
}

.guided-audio-button {
  display: inline-flex;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--guided-line);
  background: #fff;
  color: var(--guided-navy);
}

.guided-audio-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.guided-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
}

.guided-audio-prompt strong {
  margin: 0;
  color: var(--guided-navy);
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -.035em;
}

.guided-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--guided-line);
}

.guided-actions-note {
  color: var(--guided-muted);
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
}

.guided-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.guided-choice {
  position: relative;
  padding: 10px 10px 13px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--guided-soft);
  color: var(--guided-navy);
  font: inherit;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
}

.guided-choice:hover,
.guided-choice:focus-visible {
  border-color: #9aaac0;
}

.guided-choice.is-correct {
  border-color: var(--guided-success);
}

.guided-choice.is-wrong {
  border-color: var(--guided-red);
}

.guided-choice span {
  display: block;
  margin-top: 10px;
}

.guided-audio-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 30px;
}

.guided-word-options {
  display: grid;
  width: min(100%, 780px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
}

.guided-word-options button {
  min-height: 62px;
  padding: 10px 18px;
  border: 1px solid var(--guided-line);
  border-radius: 12px;
  background: #fff;
  color: var(--guided-navy);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
}

.guided-word-options button.is-correct {
  border-color: var(--guided-success);
  color: var(--guided-success);
}

.guided-word-options button.is-wrong {
  border-color: var(--guided-red);
  color: var(--guided-red);
}

.guided-feedback {
  min-height: 26px;
  margin: 18px 0 0;
  color: var(--guided-muted);
  font-weight: 700;
  text-align: center;
}

.guided-feedback.is-success {
  color: var(--guided-success);
}

.guided-feedback.is-error {
  color: var(--guided-red);
}

.guided-spelling {
  width: min(100%, 760px);
  margin: 0 auto;
  text-align: center;
}

.guided-spelling-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.guided-spelling-cue strong {
  font-size: 1.15rem;
}

.guided-spelling input {
  width: min(100%, 460px);
  height: 56px;
  padding: 0 18px;
  border: 1px solid #9aaac0;
  border-radius: 11px;
  color: var(--guided-navy);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 750;
  text-align: center;
}

.guided-character-slots {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin-bottom: 24px;
}

.guided-character-slots span {
  display: grid;
  width: 48px;
  height: 52px;
  place-items: center;
  border: 1px solid #aebbd0;
  border-radius: 9px;
  background: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.guided-character-keyboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 7px;
  margin: 0 auto 14px;
}

.guided-character-keyboard button {
  min-height: 46px;
  border: 1px solid var(--guided-line);
  border-radius: 8px;
  background: #fff;
  color: var(--guided-navy);
  font: inherit;
  font-size: 1.12rem;
  cursor: pointer;
}

.guided-spelling-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.guided-sentence-card {
  display: grid;
  width: min(100%, 820px);
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  margin: 0 auto;
}

.guided-sentence-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
}

.guided-sentence-text {
  margin: 0 0 14px;
  color: var(--guided-navy);
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 750;
  line-height: 1.45;
}

.guided-sentence-text mark {
  padding: 0 .1em;
  background: transparent;
  color: var(--guided-red);
}

.guided-sentence-translation {
  margin: 0 0 22px;
  color: var(--guided-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.guided-completion {
  display: grid;
  justify-items: center;
  text-align: center;
}

.guided-completion .guided-capability-list {
  margin-bottom: 28px;
}

.guided-completion-note {
  max-width: 680px;
  margin: 0 0 24px;
  color: var(--guided-muted);
  line-height: 1.7;
}

.guided-error {
  display: grid;
  min-height: 360px;
  place-items: center;
  text-align: center;
}

.guided-error p {
  max-width: 560px;
  color: var(--guided-muted);
  line-height: 1.7;
}

@media (max-width: 820px) {
  .guided-experience-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .guided-step-rail {
    grid-template-columns: repeat(7, 70px);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .guided-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .guided-experience {
    padding-top: 20px;
  }

  .guided-experience-guide {
    width: min(calc(100% - 24px), 1120px);
  }

  .guided-experience-intro {
    gap: 18px;
    margin-bottom: 20px;
  }

  .guided-language-switch {
    width: 100%;
  }

  .guided-language-switch button {
    flex: 1;
  }

  .guided-step-rail {
    margin-inline: -12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .guided-welcome-list,
  .guided-capability-list {
    grid-template-columns: 1fr;
  }

  .guided-sentence-card {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .guided-sentence-card img {
    width: min(68vw, 250px);
    margin: 0 auto;
  }

  .guided-actions {
    position: sticky;
    bottom: 0;
    margin: 28px -18px -20px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #fff;
  }

  .guided-actions-note {
    display: none;
  }

  .guided-actions .guided-primary {
    flex: 1;
  }

  .guided-choice-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .guided-word-options {
    grid-template-columns: 1fr;
  }

  .guided-character-keyboard {
    grid-template-columns: repeat(6, minmax(36px, 1fr));
    gap: 5px;
  }

  .guided-character-keyboard button {
    min-height: 43px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes guided-stage-enter {
    from {
      opacity: .55;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
