:root {
  --ink: #22241f;
  --muted-ink: #62665d;
  --paper: #fbfaf4;
  --panel: #ffffff;
  --line: #22241f;
  --mint: #9bd4bd;
  --mint-soft: #d9efe2;
  --coral: #ff715b;
  --gold: #ffcf48;
  --sky: #36a9e1;
  --lilac: #c9b8ff;
  --shadow: 0 14px 34px rgba(34, 36, 31, 0.11);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(54, 169, 225, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 207, 72, 0.22), transparent 24rem),
    linear-gradient(135deg, #fbfaf4 0%, #eef7f2 48%, #f6f1e6 100%);
  font-family: ui-serif, Georgia, "Times New Roman", "Songti SC", serif;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  display: grid;
  grid-template-columns: 16.75rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  border-right: 2px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--gold);
  font-size: 1.55rem;
  font-weight: 900;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.12rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.78rem;
}

.nav-list {
  display: grid;
  gap: 0.45rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.78rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-item span {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 0.82rem;
}

.nav-item:hover {
  transform: translateX(0.15rem);
  background: rgba(155, 212, 189, 0.18);
}

.nav-item.is-active {
  border-color: var(--line);
  background: var(--mint);
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
}

.streak-panel {
  margin-top: auto;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.streak-panel h2,
.streak-panel strong,
.streak-panel small {
  margin: 0;
}

.streak-panel h2 {
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.86rem;
  color: var(--muted-ink);
}

.streak-panel strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 2.1rem;
  line-height: 1;
}

.streak-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
  margin-top: 0.9rem;
}

.streak-days span {
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f5f1e8;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.streak-days .done {
  background: var(--coral);
  color: #fff;
}

.main-content {
  width: 100%;
  max-width: 86rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--coral);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1.02;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
  line-height: 1.1;
}

.top-actions,
.trainer-controls,
.section-heading,
.segmented-control,
.reply-dock {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 0.65rem;
}

.icon-button,
.primary-button,
.secondary-button,
.segmented-control button,
.reply-dock button,
.answer-slots button,
.phrase-bank button {
  min-height: 2.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.segmented-control button:hover,
.reply-dock button:hover,
.answer-slots button:hover,
.phrase-bank button:hover {
  transform: translateY(-0.08rem);
  box-shadow: 0.18rem 0.18rem 0 var(--ink);
}

.icon-button {
  width: 2.75rem;
  display: grid;
  place-items: center;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 850;
  white-space: nowrap;
}

a.primary-button,
a.secondary-button {
  color: inherit;
  text-decoration: none;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.secondary-button {
  background: var(--gold);
}

.secondary-button.is-recording {
  background: var(--coral);
  color: #fff;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
  animation: showView 220ms ease both;
}

@keyframes showView {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.today-layout,
.speak-layout,
.progress-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 1rem;
  align-items: start;
}

.training-stage,
.daily-panel,
.reaction-lab,
.phrase-bank,
.roleplay-shell,
.metrics-panel {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.training-stage,
.reaction-lab,
.roleplay-shell {
  padding: 1rem;
}

.daily-panel,
.phrase-bank,
.metrics-panel {
  padding: 1rem;
}

.section-heading {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading.compact h2 {
  font-size: 1.45rem;
}

.level-pill,
.time-badge,
.countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

.time-badge {
  background: var(--mint);
}

.countdown {
  min-width: 4.35rem;
  background: var(--coral);
  color: #fff;
}

.scene-frame {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #f4efe4;
}

.scene-svg {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
}

.train {
  animation: trainFloat 4.5s ease-in-out infinite;
}

.runner {
  transform-origin: 180px 230px;
  animation: runnerBounce 700ms ease-in-out infinite alternate;
}

.arm-one,
.leg-two {
  transform-origin: 180px 210px;
  animation: limbForward 700ms ease-in-out infinite alternate;
}

.arm-two,
.leg-one {
  transform-origin: 180px 210px;
  animation: limbBack 700ms ease-in-out infinite alternate;
}

.clock-hand {
  transform-origin: 146px 92px;
  animation: clockTick 1.5s steps(8) infinite;
}

.speech-pop {
  animation: speechPulse 2.4s ease-in-out infinite;
}

@keyframes trainFloat {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(1.2rem);
  }
}

@keyframes runnerBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-0.45rem);
  }
}

@keyframes limbForward {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: rotate(8deg);
  }
}

@keyframes limbBack {
  from {
    transform: rotate(6deg);
  }
  to {
    transform: rotate(-8deg);
  }
}

@keyframes clockTick {
  to {
    transform: rotate(360deg);
  }
}

@keyframes speechPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.35rem);
  }
}

.phrase-panel {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.8rem;
  padding: 0.9rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.audio-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #f9f5eb;
}

.audio-status,
.recording-status {
  margin: 0;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  line-height: 1.45;
}

.audio-status.is-ready {
  color: var(--ink);
  font-weight: 800;
}

.audio-status.is-error,
.recording-status.is-error {
  color: #9d2d1d;
  font-weight: 850;
}

.recording-status {
  flex-basis: 100%;
  font-size: 0.84rem;
}

.recording-status.is-ready {
  color: var(--ink);
  font-weight: 850;
}

.voice-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.voice-switcher button {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.voice-switcher .is-selected {
  background: var(--ink);
  color: #fff;
}

.recording-playback {
  margin-top: 0.65rem;
}

.recording-playback figure {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0.65rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.recording-playback figcaption {
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 850;
}

.recording-playback audio {
  width: 100%;
}

.phrase-label,
.phrase-meaning {
  margin-bottom: 0;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
}

.phrase-label {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.phrase {
  margin-bottom: 0;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: clamp(1.6rem, 5vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
}

.trainer-controls {
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.step-track {
  min-width: 10rem;
  display: grid;
  flex: 1;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.step-track span {
  height: 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #e6e0d4;
}

.step-track span.is-current,
.step-track span.is-complete {
  background: var(--coral);
}

.daily-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-list li {
  display: flex;
  gap: 0.65rem;
  padding: 0.72rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #f9f5eb;
}

.daily-list li > span {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 900;
}

.daily-list strong,
.daily-list small {
  display: block;
}

.daily-list strong {
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
}

.daily-list small {
  margin-top: 0.2rem;
  color: var(--muted-ink);
}

.daily-list .is-done {
  background: var(--mint-soft);
}

.daily-list .is-done > span {
  background: var(--mint);
}

.daily-list .is-active {
  background: var(--gold);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.score-strip div {
  min-width: 0;
  padding: 0.65rem 0.35rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}

.score-strip strong,
.score-strip span {
  display: block;
}

.score-strip strong {
  font-size: 1.45rem;
  line-height: 1;
}

.score-strip span {
  margin-top: 0.25rem;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.75rem;
}

.segmented-control {
  gap: 0.25rem;
  padding: 0.25rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.segmented-control button {
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-width: 0;
  background: transparent;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 850;
}

.segmented-control .is-selected {
  background: var(--ink);
  color: #fff;
}

.scene-grid,
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.scene-tile,
.memory-card {
  min-height: 12rem;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scene-tile {
  width: 100%;
  display: grid;
  align-content: space-between;
  gap: 0.75rem;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scene-tile.is-current {
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  transform: translateY(-0.08rem);
}

.scene-tile-copy {
  display: grid;
  gap: 0.35rem;
}

.scene-tile-copy strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.scene-tile-copy small {
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  line-height: 1.45;
}

.scene-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 800;
}

.tile-kicker {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 900;
}

.scene-tile p,
.memory-card p {
  margin-bottom: 0.7rem;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  line-height: 1.45;
}

.scene-tile meter {
  width: 100%;
  height: 0.9rem;
  accent-color: var(--ink);
}

.accent-coral {
  background: #fff0ed;
}

.accent-mint {
  background: #edf8f2;
}

.accent-sky {
  background: #eaf7fc;
}

.accent-gold {
  background: #fff7d9;
}

.accent-ink {
  background: #eeeeea;
}

.prompt-board {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #f9f5eb;
}

.prompt-label {
  margin-bottom: 0;
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 850;
}

.prompt-text {
  margin-bottom: 0;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 950;
  line-height: 1;
}

.answer-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.answer-slots button,
.phrase-bank button,
.reply-dock button {
  padding: 0.55rem 0.8rem;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 800;
  text-align: left;
}

.answer-slots button {
  background: var(--panel);
}

.waveform {
  height: 5.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding: 0.65rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
}

.waveform span {
  width: 100%;
  max-width: 1.6rem;
  height: 25%;
  border-radius: 999px;
  background: var(--gold);
  animation: wave 900ms ease-in-out infinite alternate;
}

.waveform span:nth-child(2n) {
  height: 58%;
  background: var(--mint);
  animation-delay: 120ms;
}

.waveform span:nth-child(3n) {
  height: 82%;
  background: var(--coral);
  animation-delay: 240ms;
}

@keyframes wave {
  to {
    transform: scaleY(0.42);
  }
}

.phrase-bank {
  display: grid;
  gap: 0.6rem;
}

.phrase-bank h2 {
  margin-bottom: 0.25rem;
  font-size: 1.45rem;
}

.phrase-bank button {
  background: #f9f5eb;
}

.memory-card svg {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.memory-card h3 {
  margin-top: 0.85rem;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 1.45rem;
}

.water {
  animation: waterWobble 1.8s ease-in-out infinite alternate;
}

.awkward-hand {
  animation: awkwardShake 900ms ease-in-out infinite;
}

.shock {
  animation: shockPop 900ms ease-in-out infinite alternate;
}

@keyframes waterWobble {
  to {
    transform: translateY(-0.45rem) scaleY(1.05);
  }
}

@keyframes awkwardShake {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(0.45rem);
  }
}

@keyframes shockPop {
  to {
    transform: scale(1.05);
  }
}

.chat-window {
  min-height: 23rem;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #f9f5eb;
}

.message {
  max-width: min(32rem, 84%);
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.message span {
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
}

.message p {
  margin-bottom: 0;
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.message.user {
  justify-self: end;
  background: var(--mint);
}

.message.ai {
  justify-self: start;
}

.reply-dock {
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.reply-dock button {
  background: var(--gold);
}

.ability-map {
  min-height: 30rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(34, 36, 31, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(34, 36, 31, 0.08) 1px, transparent 1px),
    #f9f5eb;
  background-size: 3rem 3rem;
}

.ability-node {
  min-height: 6.25rem;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 900;
  text-align: center;
}

.ability-node.is-unlocked {
  background: var(--mint);
}

.ability-node.is-current {
  background: var(--coral);
  color: #fff;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}

.metrics-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: 2px solid rgba(34, 36, 31, 0.18);
}

.metric span {
  color: var(--muted-ink);
  font-family: ui-sans-serif, "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 800;
}

.metric strong {
  font-size: 1.8rem;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .streak-panel {
    display: none;
  }

  .today-layout,
  .speak-layout,
  .progress-layout {
    grid-template-columns: 1fr;
  }

  .scene-grid,
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main-content,
  .sidebar {
    padding: 0.9rem;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .primary-button {
    flex: 1;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    min-height: 3.25rem;
  }

  .scene-grid,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .scene-svg {
    aspect-ratio: 1.35 / 1;
  }

  .phrase {
    line-height: 1.08;
  }

  .audio-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .voice-switcher {
    justify-content: flex-start;
  }

  .score-strip,
  .ability-map {
    grid-template-columns: 1fr;
  }

  .ability-map {
    min-height: 0;
  }

  .segmented-control {
    align-self: start;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .nav-list {
    grid-template-columns: 1fr;
  }

  .trainer-controls .secondary-button,
  .trainer-controls .primary-button {
    width: 100%;
  }

  .step-track {
    order: -1;
    flex-basis: 100%;
  }

  .message {
    max-width: 100%;
  }
}
