/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5
 * genre: modern-minimal · macrostructure: Narrative Workflow · theme: Cobalt-on-warm-paper · nav: N13 · footer: Ft5 · enrichment:none
 * contrast: pass (40–41) · slop: pass (1–58) · honest: pass (46) · chrome: pass (47; product terminal, no fake window chrome) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34,49,50–57) · copy: beginner-clear · desktop-first episode map · mobile-specific scroll */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+JP:wght@400;500;600&family=JetBrains+Mono:wght@400;600&family=Space+Grotesk:wght@600;700&display=swap');
@import url('./tokens.css');

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 16px/1.55 var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  box-shadow: inset 0 0 0 2px color-mix(in oklch, var(--color-ink) 24%, transparent);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

h1,
h2,
h3 {
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--text-display);
}

h2 {
  font-size: var(--text-lg);
}

p {
  margin: var(--space-3xs) 0;
  overflow-wrap: anywhere;
}

.top-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-xs);
  min-height: 56px;
  border-bottom: 1px solid var(--color-rule);
  padding: var(--space-2xs) var(--space-sm);
}

.wordmark {
  min-width: 0;
  overflow: hidden;
  color: var(--color-ink);
  font: 700 var(--text-md) var(--font-display);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wordmark span {
  display: none;
}

.wordmark:active {
  color: var(--color-cobalt);
}

.palette-trigger {
  border: 1px solid var(--color-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  padding: 0 var(--space-xs);
  white-space: nowrap;
}

.palette-trigger kbd {
  color: var(--color-muted);
  font: var(--text-xs) var(--font-code);
}

.global-progress {
  display: flex;
  gap: var(--space-3xs);
  align-items: baseline;
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.global-progress strong {
  color: var(--color-ink);
  font-family: var(--font-display);
}

.episode-picker {
  border-bottom: 1px solid var(--color-rule);
}

.episode-picker-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: var(--space-3xs) var(--space-sm);
  color: var(--color-ink);
  cursor: pointer;
  list-style: none;
}

.episode-picker-summary::-webkit-details-marker {
  display: none;
}

.episode-picker-summary:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: -2px;
}

.episode-picker-label {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.episode-picker-current {
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.episode-picker-progress {
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.episode-picker-chevron {
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1;
  transition: transform var(--dur-short) var(--ease-out);
}

.episode-picker[open] .episode-picker-chevron {
  transform: rotate(180deg);
}

.episode-map {
  position: relative;
  display: flex;
  gap: var(--space-2xs);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-rule);
  padding: var(--space-3xs) var(--space-sm);
}

.episode-map::after {
  position: sticky;
  right: 0;
  flex: 0 0 1rem;
  width: 1rem;
  background: linear-gradient(90deg, transparent, var(--color-paper));
  content: "";
}

.episode-map::-webkit-scrollbar,
.mission-sequence::-webkit-scrollbar {
  display: none;
}

.episode-button {
  display: flex;
  align-items: center;
  flex: 0 0 150px;
  min-width: 150px;
  height: 44px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: var(--space-3xs) var(--space-2xs);
  text-align: left;
  white-space: nowrap;
}

.episode-button[aria-current="true"] {
  border-bottom-color: var(--color-cobalt);
  background: var(--color-cobalt-soft);
}

.episode-button span,
.episode-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-button span {
  flex: 1;
  min-width: 0;
}

.episode-button small {
  flex: none;
  margin-left: var(--space-3xs);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.episode-button:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--color-surface-2);
}

.episode-button:disabled span,
.episode-button:disabled small {
  color: var(--color-muted);
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-sm);
  width: 100%;
  flex: 1;
  margin: 0;
  padding: var(--space-sm);
}

.story-column,
.practice-column,
.inspector {
  min-width: 0;
}

.story-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-ink);
  padding: 0;
  white-space: nowrap;
}

.story-toggle:hover,
.story-toggle:focus-visible {
  border-color: var(--color-cobalt);
  background: var(--color-cobalt-soft);
}

.story-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.story-toggle-glyph {
  color: var(--color-cobalt);
  font: 600 var(--text-lg)/1 var(--font-code);
}

.story-content {
  min-width: 0;
  grid-column: 1 / -1;
}

.story-content[hidden] {
  display: none;
}

.story-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2xs);
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: var(--space-2xs);
}

.story-column h1,
.story-column > p,
.story-content > p {
  grid-column: 1 / -1;
}

.story-column h1 {
  max-height: 2.3em;
  overflow: hidden;
  font-size: clamp(1.3rem, 5vw, 1.65rem);
}

#episodeSubtitle {
  min-width: 0;
  color: var(--color-muted);
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}

.episode-briefing,
#episodeBriefing {
  min-width: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.5;
}

.episode-progress {
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.mission-sequence {
  display: flex;
  grid-column: 1 / -1;
  gap: var(--space-2xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.mission-step {
  flex: 0 0 132px;
  min-width: 132px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--color-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  padding: 0 var(--space-2xs);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-step small {
  display: none;
}

.mission-step[aria-current="true"] {
  border-color: var(--color-cobalt);
  background: var(--color-cobalt-soft);
}

.practice-header {
  display: block;
  position: relative;
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: var(--space-xs);
}

.practice-header .section-label {
  overflow: hidden;
  padding-right: 150px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-header h2,
.practice-header p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.stats span {
  text-align: right;
}

.stats strong {
  display: block;
  color: var(--color-ink);
  font: 600 var(--text-md) var(--font-display);
}

.terminal {
  margin-top: var(--space-xs);
  border-radius: var(--radius-terminal);
  background: var(--color-graphite);
  color: var(--color-on-dark);
  padding: var(--space-sm);
}

.terminal-label {
  display: flex;
  justify-content: space-between;
  color: var(--color-cobalt-on-dark);
  font-size: var(--text-xs);
  letter-spacing: .08em;
  white-space: nowrap;
}

.typing-meta {
  display: flex;
  gap: var(--space-sm);
  color: var(--color-on-dark);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.command-line {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: var(--space-2xs);
  margin-top: var(--space-xs);
  font: 600 1.15rem var(--font-code);
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: var(--radius-control);
}

.command-line:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.command-line:has(.command-input:disabled) {
  cursor: not-allowed;
}

.prompt {
  color: var(--color-cobalt-on-dark);
}

#typingOutput {
  min-height: 2rem;
}

.correct {
  color: var(--color-success-on-dark);
}

.incorrect,
.extra {
  color: var(--color-warning-on-dark);
  text-decoration: underline;
}

.pending {
  color: color-mix(in oklch, var(--color-on-dark) 60%, var(--color-graphite));
}

.command-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  opacity: 1;
  padding: 0;
  font-size: max(1rem, 16px);
  cursor: text;
}

.command-input:hover {
  border-color: var(--color-cobalt);
}

.command-input:focus,
.command-input:focus-visible {
  outline: none;
}

.command-input:active {
  border-color: var(--color-cobalt);
}

.command-input:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: transparent;
  pointer-events: none;
}

.typing-feedback {
  min-height: 2rem;
  color: var(--color-cobalt-on-dark);
  font-size: var(--text-sm);
}

.action-row {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2xs);
  border-top: 1px solid color-mix(in oklch, var(--color-on-dark) 24%, transparent);
  padding-top: var(--space-xs);
}

.action-row > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xs);
}

.button {
  min-height: 44px;
  border: 1px solid var(--color-cobalt);
  border-radius: var(--radius-control);
  padding: 0 var(--space-xs);
  white-space: nowrap;
}

.primary {
  background: var(--color-cobalt);
  color: var(--color-accent-on);
}

.secondary {
  background: transparent;
  color: var(--color-ink);
}

.terminal .secondary {
  border-color: var(--color-cobalt-on-dark);
  color: var(--color-cobalt-on-dark);
}

.evidence,
.quiz-card,
.sponsor,
.inspector {
  border-top: 1px solid var(--color-rule);
  padding-top: var(--space-sm);
}

.evidence pre {
  min-height: 4rem;
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font: var(--text-md)/1.6 var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sponsor strong {
  display: block;
  color: var(--color-ink);
  font: 700 var(--text-lg) var(--font-display);
}

.sponsor > p {
  margin: var(--space-3xs) 0 0;
}

.affiliate-books {
  display: grid;
  gap: var(--space-3xs);
  margin: var(--space-xs) 0 0;
  padding-left: 0;
  list-style: none;
}

.affiliate-books a {
  color: var(--color-cobalt);
}

.affiliate-disclosure {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.quiz-card[hidden],
.sponsor[hidden] {
  display: none;
}

.choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs);
  margin-top: var(--space-xs);
}

.choice {
  min-height: 44px;
  border: 1px solid var(--color-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  padding: 0 var(--space-xs);
  overflow: hidden;
  font-size: var(--text-sm);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice.correct {
  border-color: var(--color-success);
}

.choice.correct:disabled {
  opacity: 1;
}

.choice.wrong {
  border-color: var(--color-warning);
}

.quiz-status {
  min-height: 2rem;
  white-space: pre-line;
}

.quiz-status[data-state="correct"] {
  background: color-mix(in oklch, var(--color-success) 10%, var(--color-surface));
  border-left: 3px solid var(--color-success);
  padding: var(--space-2xs) var(--space-xs);
}

.quiz-status[data-state="incorrect"] {
  background: color-mix(in oklch, var(--color-warning) 10%, var(--color-surface));
  border-left: 3px solid var(--color-warning);
  padding: var(--space-2xs) var(--space-xs);
}

.inspector {
  padding-bottom: var(--space-sm);
}

.token-card {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  align-items: baseline;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  margin: var(--space-xs) 0;
  padding: var(--space-xs) 0;
}

.token-card code {
  color: var(--color-cobalt);
  font: 600 var(--text-lg) var(--font-code);
  overflow-wrap: anywhere;
}

.token-kind {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs);
}

dt {
  color: var(--color-cobalt);
  font-weight: 600;
}

dd {
  margin: 0;
  color: var(--color-muted);
}

.handoff {
  margin-top: var(--space-xs);
  color: var(--color-muted);
}

.statement {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs);
  border-top: 1px solid var(--color-rule);
  padding: var(--space-sm);
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-top: auto;
  align-items: center;
}

.statement strong {
  color: var(--color-ink);
  font: 700 var(--text-lg) var(--font-display);
}

.statement button {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}

dialog {
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  border: 1px solid var(--color-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  padding: var(--space-sm);
}

.palette-dialog {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 4rem);
  min-height: 0;
}

dialog::backdrop {
  background: color-mix(in oklch, var(--color-ink) 48%, transparent);
}

dialog label {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
}

dialog input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-control);
  border-radius: var(--radius-control);
  outline: 2px solid transparent;
  outline-offset: 1px;
  padding: 0 var(--space-xs);
}

dialog input:hover {
  border-color: var(--color-cobalt);
}

dialog input:active {
  background: var(--color-surface-2);
}

dialog input:disabled {
  cursor: not-allowed;
  opacity: .55;
  background: var(--color-surface-2);
  color: var(--color-muted);
}

.palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.palette-head button {
  border: 1px solid transparent;
  background: transparent;
  min-width: 44px;
}

.palette-head button:hover,
.palette-head button:focus-visible {
  border: 1px solid var(--color-control);
  background: var(--color-surface-2);
}

.palette-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  padding: var(--space-2xs);
  text-align: left;
}

.palette-result small {
  flex: none;
  width: 100%;
  overflow: hidden;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.palette-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}

.palette-command {
  font-family: var(--font-code);
  overflow-wrap: anywhere;
}

.palette-section {
  margin-top: var(--space-xs);
  padding-inline: var(--space-2xs);
}

#paletteResults {
  min-height: 0;
  max-height: min(30rem, calc(100dvh - 13rem));
  overflow: auto;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}

.palette-hint {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.palette-result.active {
  background: var(--color-cobalt-soft);
  color: var(--color-ink);
}

@media (hover: hover) and (pointer: fine) {
  .palette-trigger:hover,
  .palette-head button:hover {
    border-color: var(--color-cobalt);
    background: var(--color-cobalt-soft);
    color: var(--color-ink);
  }

  .button:hover {
    background: var(--color-cobalt);
    color: var(--color-accent-on);
  }

  .choice:hover,
  .mission-step:hover,
  .episode-button:hover,
  .palette-result:hover {
    border-color: var(--color-cobalt);
    background: var(--color-cobalt-soft);
  }
}

@media (min-width: 35rem) {
  .lab-layout {
    padding: var(--space-md);
  }

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

  .action-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 40rem) and (max-width: 59.99rem) {
  .episode-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .episode-map::after {
    display: none;
  }

  .episode-button {
    min-width: 0;
    width: 100%;
  }
}

@media (min-width: 40rem) {
  .episode-button {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    height: auto;
    white-space: normal;
  }

  .episode-button span {
    width: 100%;
    flex: 0 1 auto;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .episode-button small {
    margin-left: 0;
    line-height: 1.1;
  }
}

@media (min-width: 60rem) {
  .top-nav {
    padding-inline: var(--space-lg);
  }

  .lab-layout {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(300px, 340px);
    align-items: start;
    gap: var(--space-lg);
    padding-block: var(--space-xl);
    padding-inline-start: 0;
    padding-inline-end: var(--space-lg);
  }

  .lab-layout.story-panel-collapsed {
    grid-template-columns: 48px minmax(0, 1fr) minmax(300px, 340px);
  }

  .story-column {
    position: relative;
    display: block;
    border-bottom: 0;
    border-inline-end: 1px solid var(--color-rule);
    padding-inline-start: var(--space-lg);
    padding-inline-end: calc(44px + var(--space-2xs));
  }

  .story-toggle {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: inline-flex;
  }

  .story-panel-collapsed .story-column {
    position: relative;
    display: flex;
    align-self: stretch;
    justify-content: center;
    min-width: 0;
    min-height: 100%;
    border-inline-end: 1px solid var(--color-rule);
    padding-inline: 0;
  }

  .story-panel-collapsed .story-toggle {
    position: relative;
    inset-block-start: 0;
    inset-inline-start: 2px;
  }

  .mission-sequence {
    display: grid;
    overflow: visible;
  }

  .mission-step {
    min-width: 0;
  }

  .inspector {
    border-left: 1px solid var(--color-rule);
    border-top: 0;
    padding-top: 0;
    padding-left: var(--space-md);
  }

  .episode-map {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .episode-map::after {
    display: none;
  }

  .episode-button {
    flex: none;
    min-width: 0;
    width: 100%;
  }

}

@media (min-width: 60rem) and (max-width: 71.99rem) {
  .episode-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .episode-map {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
@media (max-width: 35rem) {
  .lab-layout {
    gap: var(--space-xs);
    padding-block: var(--space-xs);
  }

  .top-nav {
    padding-block: 4px;
  }

  .episode-map {
    scroll-snap-type: x mandatory;
    padding-block: 4px;
  }

  .episode-picker-summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--space-2xs);
  }

  .episode-picker-label {
    display: none;
  }

  .episode-button {
    flex-basis: 19rem;
    scroll-snap-align: start;
  }

  .episode-button span {
    overflow: visible;
    text-overflow: clip;
  }

  .story-column {
    display: block;
    gap: 0;
  }

  .story-column .section-label {
    display: none;
  }

  .story-column h1 {
    margin: 0;
  }

  .story-column > p,
  .story-content > p {
    margin: var(--space-3xs) 0 0;
  }

  .episode-progress {
    margin-top: var(--space-3xs);
  }

  .mission-sequence {
    margin-top: var(--space-2xs);
  }

  .practice-header {
    min-height: 0;
  }

  .practice-header .section-label {
    display: block;
    width: calc(100% - 176px);
    overflow: hidden;
    padding-right: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats {
    gap: var(--space-2xs);
    font-size: .6875rem;
  }

  .practice-header p {
    white-space: nowrap;
  }

  .stats span {
    display: flex;
    gap: 4px;
    align-items: baseline;
  }

  .stats strong {
    display: inline;
    font-size: var(--text-sm);
  }

  .terminal {
    margin-top: var(--space-3xs);
  }

}

@media (max-width: 39.99rem) {
  .episode-picker[open] .episode-map {
    display: flex;
    flex-direction: column;
    max-height: min(28rem, calc(100dvh - 10rem));
    overflow-x: hidden;
    overflow-y: auto;
  }

  .episode-picker[open] .episode-button {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
  }

  .episode-picker[open] .episode-button span {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .episode-picker[open] .episode-button small {
    margin-left: 0;
  }
}

@media (min-width: 40rem) {
  .episode-picker[open] .episode-map {
    max-height: min(30rem, calc(100dvh - 10rem));
    overflow-x: hidden;
    overflow-y: auto;
  }
}

@media (max-width: 20rem) {
  .practice-header .section-label {
    width: 4.5rem;
  }

  .stats {
    gap: var(--space-3xs);
    font-size: .625rem;
  }
}
