.main-nav[data-normal-navigation] {
  grid-template-columns: 1fr 1fr;
}

.main-nav[data-normal-navigation] .nav-primary-action {
  grid-column: 1 / -1;
  min-height: 88px;
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
}

.main-nav[data-normal-navigation] .nav-secondary-action {
  min-height: 62px;
  font-size: 1.08rem;
}

.main-nav[data-normal-navigation] .nav-quiet-action {
  min-height: 52px;
  border-width: 1px;
  color: var(--muted);
  background: transparent;
}

.developer-navigation {
  grid-template-columns: 1fr;
}

.therapy-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.therapy-entry {
  display: grid;
  gap: 6px;
  min-height: 138px;
  padding: 22px;
  border: 2px solid var(--primary);
  border-radius: 18px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.therapy-entry strong {
  font-size: 1.35rem;
}

.therapy-entry span {
  color: var(--muted);
  font-size: 1rem;
}

.simple-settings {
  display: grid;
  gap: 14px;
}

.simple-settings p {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  font-size: 1.05rem;
  line-height: 1.6;
}

.developer-view .professional-panel {
  display: block;
}

.home-link {
  min-height: 48px;
  margin-bottom: 16px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
}

.word-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.word-navigation[hidden] {
  display: none;
}

#therapy[data-section="words"] .therapy-card {
  font-size: 1.05rem;
}

#therapy[data-section="words"] .therapy-target {
  font-size: clamp(4.5rem, 14vw, 8rem);
  line-height: 1;
}

#therapy[data-section="words"] .therapy-actions {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#therapy[data-section="words"] #therapy-repeat {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

#therapy[data-section="words"] #therapy-help,
#therapy[data-section="words"] #therapy-unable,
#therapy[data-section="words"] #therapy-rest,
#therapy[data-section="words"] #therapy-camera-stop {
  display: none;
}

#therapy[data-section="words"] .word-recording {
  margin-top: 18px;
}

#therapy[data-section="words"] .word-result {
  display: grid;
  place-items: center;
  min-height: 88px;
  margin: 18px 0;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--text);
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 850;
  line-height: 1.35;
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

#therapy[data-section="words"] .word-result.is-achieved {
  border-color: var(--primary);
  animation: achieved-pulse 850ms ease-out 1;
}

#therapy[data-section="words"] .word-result.is-achieved::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-right: 10px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 1.35rem;
  line-height: 1;
  animation: achieved-check 850ms ease-out 1;
}

#therapy[data-section="words"] .word-result.is-achieved::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
  animation: achieved-halo 850ms ease-out 1;
  pointer-events: none;
}

@keyframes achieved-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes achieved-check {
  0% { opacity: 0; transform: scale(.75); }
  35% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes achieved-halo {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #therapy[data-section="words"] .word-result.is-achieved,
  #therapy[data-section="words"] .word-result.is-achieved::before,
  #therapy[data-section="words"] .word-result.is-achieved::after {
    animation: none;
    transform: none;
  }

  #therapy[data-section="words"] .word-result.is-achieved::after {
    display: none;
  }
}

#therapy[data-section="words"] .control,
#therapy[data-section="words"] .word-navigation .control {
  min-height: 68px;
  font-size: 1.08rem;
}

#therapy[data-section="words"] #phoneme-practice,
#therapy[data-section="words"] .therapy-assistance-control,
#therapy[data-section="words"] #guided-session-start,
#therapy[data-section="words"] #guided-session-stop,
#therapy[data-section="words"] #therapy-attempt-start {
  display: none;
}

@media (max-width: 720px) {
  .therapy-entry-grid {
    grid-template-columns: 1fr;
  }

  #therapy[data-section="words"] .therapy-actions,
  .word-navigation {
    grid-template-columns: 1fr;
  }
}
