:root {
  /* Teachable reference primitives */
  --teach-navy: #294870;
  --teach-lime: #e6ff32;
  --teach-soft-blue: #d2d9e1;
  --teach-sage: var(--teach-soft-blue);
  --teach-pale-blue: #e7eef7;
  --teach-warm: #ffffff;
  --teach-flesh: #f6f2ee;
  --teach-warm-accent: #e77d4f;
  --teach-card-surface:
    radial-gradient(
      ellipse at 82% 100%,
      rgba(255, 153, 102, 0.1) 0%,
      rgba(255, 153, 102, 0.045) 30%,
      rgba(255, 153, 102, 0) 58%
    ),
    linear-gradient(
      180deg,
      rgba(41, 72, 112, 0.2) 0%,
      rgba(41, 72, 112, 0.12) 28%,
      rgba(231, 238, 247, 0.52) 66%,
      #fbf6f2 100%
    );
  --teach-pale-green: var(--teach-soft-blue);
  --teach-line: #eaeaea;
  --teach-control-line: #ddd8d3;
  --teach-black: #000000;

  /* Existing application semantics */
  --bg: var(--teach-warm);
  --ink: var(--teach-black);
  --muted: #5f5c58;
  --line: var(--teach-line);
  --panel: #ffffff;
  --panel-2: var(--teach-flesh);
  --accent: var(--teach-navy);
  --accent-deep: var(--teach-navy);
  --accent-soft: var(--teach-pale-green);
  --accent-2: var(--teach-navy);
  --shadow: 0 18px 48px rgba(24, 42, 68, 0.08);
  --shadow-soft: 0 8px 22px rgba(24, 42, 68, 0.06);
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-layout: 380ms;
  --ease-out-modern: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.2, 0, 0, 1);
}

/* Module hub concept previews. Enabled only with ?hubLayout=horizontal|vertical. */
.module-visual,
.module-eyebrow,
.module-entry-arrow {
  display: none;
}

.module-copy {
  display: contents;
}

html[data-hub-layout] .module-hub {
  width: 100%;
  margin-right: 0;
  margin-bottom: 22px;
  margin-left: 0;
  transform: none;
}

html[data-hub-layout] .module-tab {
  --module-tint: #efe8e0;
  --module-accent: #8a6d4f;
  --module-icon-bg: #e9ddcf;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 0 !important;
  border-radius: 20px;
  color: #101722 !important;
  background: var(--module-tint) !important;
  box-shadow: 0 12px 30px rgba(41, 54, 72, 0.055);
  text-align: left;
  white-space: normal;
  transition:
    transform 520ms var(--ease-out-modern),
    box-shadow 520ms var(--ease-out-modern);
}

html[data-hub-layout] .module-tab.essay-module {
  --module-tint: #dbe5f1;
  --module-accent: #3f6198;
  --module-icon-bg: #d4dfef;
}

html[data-hub-layout] .module-tab.practice-module {
  --module-tint: #e4ede8;
  --module-accent: #5c7d6e;
  --module-icon-bg: #d8e5de;
}

html[data-hub-layout] .module-visual {
  position: absolute;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

html[data-hub-layout] .module-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: none;
  transform: scale(1);
  transition: transform 1100ms var(--ease-out-modern);
}

html[data-hub-layout] .module-tab > .module-icon {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  display: block;
  color: var(--module-accent);
  background: var(--module-icon-bg);
  border: 0;
  border-radius: 8px;
  stroke-width: 1.72;
  opacity: 1;
}

html[data-hub-layout] .module-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

html[data-hub-layout] .module-eyebrow {
  display: block;
  color: var(--module-accent);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: uppercase;
}

html[data-hub-layout] .module-name {
  color: #4f5966;
  font-family: "Aptos", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
}

html[data-hub-layout] .module-entry-arrow {
  position: relative;
  z-index: 3;
  width: 58px;
  height: 58px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--module-accent) 14%, #ffffff);
  border-radius: 50%;
  color: var(--module-accent);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(41, 72, 112, 0.07);
  transition:
    color 320ms ease,
    background-color 320ms ease,
    transform 520ms var(--ease-out-modern);
}

html[data-hub-layout] .module-entry-arrow svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
  stroke: none;
}

html[data-hub-layout] .module-arrow {
  display: none;
}

html[data-hub-layout] .module-tab:focus-visible {
  outline: 2px solid var(--module-accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  html[data-hub-layout] .module-tab:hover {
    border: 0 !important;
    color: #101722 !important;
    background: var(--module-tint) !important;
    box-shadow: 0 20px 42px rgba(41, 54, 72, 0.11);
    transform: translateY(-3px);
  }

  html[data-hub-layout] .module-tab:hover .module-visual img {
    transform: scale(1.018);
  }

  html[data-hub-layout] .module-tab:hover .module-entry-arrow {
    color: #ffffff;
    background: var(--module-accent);
    transform: translateX(5px);
  }
}

/* Horizontal banners stacked vertically. */
html[data-hub-layout="horizontal"] .module-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

html[data-hub-layout="horizontal"] .module-tab {
  height: clamp(172px, 22.5vh, 238px);
  min-height: 0;
  display: grid;
  grid-template-columns: 80px minmax(250px, 1fr) 58px;
  align-items: center;
  justify-content: stretch;
  gap: 28px;
  padding: 0 44px;
}

html[data-hub-layout="horizontal"] .module-visual {
  inset: 0 0 0 auto;
  width: 69%;
  height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.24) 21%, #000000 48%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.24) 21%, #000000 48%);
}

html[data-hub-layout="horizontal"] .module-tab > .module-icon {
  width: 80px;
  height: 80px;
  padding: 22px;
}

html[data-hub-layout="horizontal"] .module-copy {
  width: min(500px, 100%);
}

html[data-hub-layout="horizontal"] .module-eyebrow {
  white-space: nowrap;
}

html[data-hub-layout="horizontal"] .module-entry-arrow {
  justify-self: end;
}

/* Portrait cards arranged horizontally. */
html[data-hub-layout="vertical"] .module-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

html[data-hub-layout="vertical"] .module-tab {
  height: calc(100svh - 152px);
  min-height: 640px;
  display: block;
  padding: 0;
}

html[data-hub-layout="vertical"] .module-visual {
  inset: 0 0 auto;
  width: 100%;
  height: 73%;
  -webkit-mask-image: linear-gradient(180deg, #000000 0%, #000000 76%, rgba(0, 0, 0, 0.72) 88%, transparent 100%);
  mask-image: linear-gradient(180deg, #000000 0%, #000000 76%, rgba(0, 0, 0, 0.72) 88%, transparent 100%);
}

html[data-hub-layout="vertical"] .vocab-module .module-visual {
  -webkit-mask-image: linear-gradient(180deg, #000000 0%, #000000 78%, rgba(0, 0, 0, 0.86) 89%, rgba(0, 0, 0, 0.48) 95%, transparent 100%);
  mask-image: linear-gradient(180deg, #000000 0%, #000000 78%, rgba(0, 0, 0, 0.86) 89%, rgba(0, 0, 0, 0.48) 95%, transparent 100%);
}

html[data-hub-layout="vertical"] .module-visual img {
  object-position: center top;
}

html[data-hub-layout="vertical"] .module-tab > .module-icon {
  position: absolute;
  left: 22px;
  bottom: 46px;
  width: 52px;
  height: 52px;
  padding: 11px;
}

html[data-hub-layout="vertical"] .module-copy {
  position: absolute;
  right: 64px;
  bottom: 38px;
  left: 84px;
  height: 58px;
  justify-content: center;
  gap: 6px;
  transform: translateY(-5px);
}

html[data-hub-layout="vertical"] .module-name {
  font-size: 16px;
  line-height: 1.1;
}

html[data-hub-layout="vertical"] .module-eyebrow {
  font-size: 26px;
  line-height: 1.08;
  white-space: nowrap;
}

html[data-hub-layout="vertical"] .module-entry-arrow {
  position: absolute;
  right: 24px;
  bottom: 50px;
  width: 44px;
  height: 44px;
}

@media (max-width: 900px) {
  html[data-hub-layout] .module-hub {
    width: 100%;
  }

  html[data-hub-layout="horizontal"] .module-tab {
    grid-template-columns: 62px minmax(0, 1fr) 48px;
    gap: 18px;
    padding: 0 24px;
  }

  html[data-hub-layout="horizontal"] .module-tab > .module-icon {
    width: 62px;
    height: 62px;
    padding: 17px;
  }

  html[data-hub-layout="horizontal"] .module-eyebrow {
    font-size: 29px;
  }

  html[data-hub-layout="horizontal"] .module-entry-arrow {
    width: 48px;
    height: 48px;
  }

  html[data-hub-layout="vertical"] .module-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-hub-layout="vertical"] .module-tab {
    height: 214px;
    min-height: 0;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 18px;
    padding: 0 26px;
  }

  html[data-hub-layout="vertical"] .module-visual {
    inset: 0 0 0 auto;
    width: 72%;
    height: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.28) 22%, #000000 50%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.28) 22%, #000000 50%);
  }

  html[data-hub-layout="vertical"] .vocab-module .module-visual img {
    object-position: center 18%;
  }

  html[data-hub-layout="vertical"] .practice-module .module-visual img {
    object-position: center 37%;
  }

  html[data-hub-layout="vertical"] .essay-module .module-visual img {
    object-position: center 17%;
  }

  html[data-hub-layout="vertical"] .module-tab > .module-icon {
    position: relative;
    left: auto;
    bottom: auto;
    width: 64px;
    height: 64px;
    padding: 16px;
  }

  html[data-hub-layout="vertical"] .module-copy {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    height: 64px;
  }

  html[data-hub-layout="vertical"] .module-entry-arrow {
    position: relative;
    right: auto;
    bottom: auto;
    width: 48px;
    height: 48px;
  }

  html[data-hub-layout="vertical"] .module-eyebrow {
    font-size: 25px;
  }
}

@media (max-width: 560px) {
  html[data-hub-layout="horizontal"] .module-tab {
    height: 158px;
    grid-template-columns: 52px minmax(0, 1fr) 42px;
    gap: 13px;
    padding: 0 16px;
  }

  html[data-hub-layout="horizontal"] .module-visual {
    width: 78%;
    opacity: 0.72;
  }

  html[data-hub-layout="horizontal"] .module-tab > .module-icon {
    width: 52px;
    height: 52px;
    padding: 14px;
  }

  html[data-hub-layout] .module-eyebrow {
    font-size: 22px;
  }

  html[data-hub-layout="horizontal"] .module-name {
    font-size: 14px;
  }

  html[data-hub-layout="horizontal"] .module-entry-arrow {
    width: 42px;
    height: 42px;
  }

  html[data-hub-layout="horizontal"] .module-entry-arrow svg {
    width: 20px;
    height: 20px;
  }

  html[data-hub-layout="vertical"] .module-tab {
    height: 176px;
    grid-template-columns: 56px minmax(0, 1fr) 44px;
    gap: 14px;
    padding: 0 16px;
  }

  html[data-hub-layout="vertical"] .module-tab > .module-icon {
    left: auto;
    bottom: auto;
    width: 56px;
    height: 56px;
    padding: 14px;
  }

  html[data-hub-layout="vertical"] .module-copy {
    right: auto;
    bottom: auto;
    left: auto;
    height: 56px;
  }

  html[data-hub-layout="vertical"] .module-name {
    font-size: 14px;
  }

  html[data-hub-layout="vertical"] .module-eyebrow {
    font-size: 22px;
  }

  html[data-hub-layout="vertical"] .module-entry-arrow {
    right: auto;
    bottom: auto;
    width: 44px;
    height: 44px;
  }
}

body {
  background: #ffffff;
}

body.screening-focus-mode {
  overflow: hidden;
}

body.screening-focus-mode .screening-embed-view {
  position: fixed;
  z-index: 500;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: #ffffff;
}

body.screening-focus-mode .screening-embed-frame {
  width: 100%;
  height: 100%;
}

/* Full-width product header */
.topbar {
  width: 100vw;
  min-height: 82px;
  align-items: center;
  margin-top: -22px;
  margin-right: calc(50% - 50vw);
  margin-bottom: 18px;
  margin-left: calc(50% - 50vw);
  padding: 17px max(16px, calc((100vw - 1320px) / 2)) 11px;
  color: var(--teach-black);
  background: transparent;
}

.topbar-brand img {
  filter: none;
}

.brand-title h1 {
  color: var(--teach-navy);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.brand-title {
  align-items: center;
}

.brand-logo {
  margin-top: 0;
}

.brand-copy {
  padding-top: 0;
}

.official-home-button,
.module-quick-button {
  border-color: var(--teach-flesh);
  color: var(--teach-black);
  background: var(--teach-flesh);
}

.official-home-button:hover,
.module-quick-button:hover,
.module-quick-button[aria-expanded="true"] {
  border-color: var(--teach-lime);
  color: var(--teach-black);
  background: var(--teach-lime);
}

.time-breakdown {
  color: var(--teach-black);
  background: var(--teach-flesh);
}

.time-breakdown span {
  color: #514e4a;
}

.time-breakdown span + span::before {
  color: rgba(0, 0, 0, 0.24);
}

.practice-time-summary b,
.time-breakdown b {
  color: var(--teach-black);
}

.student-identity,
.student-identity strong {
  color: var(--teach-black);
}

.student-identity:hover {
  background: var(--teach-flesh);
}

.student-role {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

.student-avatar {
  color: var(--teach-navy);
}

body.screening-mode .student-avatar {
  color: var(--teach-navy);
}

.student-caret {
  border-top-color: var(--teach-black);
}

.practice-time-toggle {
  border-color: var(--teach-flesh);
  background: var(--teach-flesh);
}

/* Menus and inputs */
.module-quick-menu,
.student-dropdown,
.unified-select-menu,
.control-module-menu,
.leaderboard-dialog,
.terminate-practice-dialog {
  border-color: var(--teach-line);
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(24, 42, 68, 0.16);
}

.module-quick-menu button:hover:not(:disabled),
.module-quick-menu button.active,
.module-quick-menu button:disabled,
.student-dropdown button:hover,
.unified-select-menu button:hover:not(:disabled),
.unified-select-menu button.active {
  color: var(--teach-navy);
  background: var(--teach-pale-green);
}

.module-quick-menu button.active,
.module-quick-menu button:disabled {
  color: var(--teach-navy);
}

select.unified-select-open {
  border-color: var(--teach-control-line) !important;
  box-shadow: none;
}

select.unified-select-open:focus,
select.unified-select-open:focus-visible {
  outline: none !important;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--teach-black) 50%),
    linear-gradient(135deg, var(--teach-black) 50%, transparent 50%);
}

.screening-controls select,
.screening-controls input[type="number"],
select,
.random-count-select,
.timed-toggle-wrap,
.mode-select-wrap select,
.time-limit-select-wrap select,
.range-select-group,
.word-field {
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background-color: var(--teach-flesh);
}

.range-select-group {
  background: var(--teach-flesh);
}

.word-inputs:not(.is-vocabulary) .word-field {
  background-color: transparent;
}

.word-inputs:not(.is-vocabulary) .word-field:focus {
  background-color: var(--teach-flesh);
}

.word-field:focus {
  border-radius: var(--radius) var(--radius) 0 0;
}

.range-select-group select + select {
  border-left-color: transparent;
}

.range-select-group > select {
  border-radius: 0 !important;
}

.range-select-group > select + select {
  border-left: 0 !important;
}

.range-select-group > select.unified-select-open {
  box-shadow: none !important;
}

.range-select-group > select:focus,
.range-select-group > select:focus-visible,
.random-count-select > select:focus,
.random-count-select > select:focus-visible {
  outline: none !important;
}

.range-select-group:has(> select.unified-select-open) {
  border-color: var(--teach-control-line);
  box-shadow: none;
}

#screeningBankProxy {
  flex: 1 1 160px;
  min-width: 150px;
  max-width: 220px;
}

#screeningCountProxy {
  width: auto;
  min-width: 115px;
  max-width: 180px;
  flex: 1 1 115px;
}

#screeningModeProxy {
  width: auto;
  min-width: 145px;
  max-width: 200px;
  flex: 1 1 145px;
}

@media (min-width: 1201px) and (max-width: 1320px) {
  .screening-controls {
    gap: 6px;
  }

  .screening-range-select-group {
    flex-basis: 172px;
    min-width: 172px;
  }

  #screeningBankProxy {
    flex: 1 1 145px;
    min-width: 145px;
  }

  #screeningCountProxy {
    flex: 1 1 112px;
    min-width: 112px;
  }

  #screeningModeProxy {
    flex: 1 1 139px;
    min-width: 139px;
  }
}

/* Main module hierarchy */
.module-tab {
  border-color: var(--teach-line);
  color: var(--teach-black);
  background: var(--teach-flesh);
  box-shadow: var(--shadow-soft);
}

.module-tab:hover {
  border-color: var(--teach-navy);
  color: var(--teach-navy);
  background: var(--teach-pale-green);
}

.module-tab.active {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
  box-shadow: 0 12px 28px rgba(24, 42, 68, 0.18);
}

.active-module-label,
.primary-button {
  border-color: var(--teach-soft-blue);
  color: var(--teach-black);
  background: var(--teach-pale-green);
}

#screeningStartProxy,
#startRandom {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

body.screening-mode .screening-module-entry .active-module-label,
body.screening-mode #screeningStartProxy {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

.practice-module-entry .active-module-label {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

.active-module-label:hover,
.active-module-label[aria-expanded="true"],
#screeningStartProxy:hover,
#startRandom:hover,
.primary-button:hover {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

.segmented {
  border: 1px solid var(--teach-line);
  background: var(--teach-flesh);
  padding: 5px 11px;
}

.segment.active {
  color: #ffffff;
  background: var(--teach-navy);
}

.timed-practice-control.is-enabled .timed-toggle-wrap {
  border-color: var(--teach-navy);
  color: var(--teach-navy);
  background: var(--teach-pale-green);
}

.toggle-wrap input,
.timed-toggle-wrap input,
.screening-supplement-proxy input {
  accent-color: var(--teach-navy);
}

/* Content surfaces */
.random-panel,
.practice-side,
.practice-card,
.topic-card,
.word-bank-card {
  border-color: var(--teach-line);
  background: var(--teach-flesh);
  box-shadow: var(--shadow-soft);
}

.random-panel,
.practice-side {
  background: var(--teach-flesh);
}

.topic-chip {
  border-color: transparent;
  color: #5f5c58;
  background: #ffffff;
}

.topic-chip:hover {
  border-color: var(--teach-navy);
  color: var(--teach-navy);
}

.topic-chip:has(input:checked),
.topic-chip.is-selected {
  border-color: var(--teach-navy);
  color: var(--teach-navy);
  background: var(--teach-pale-green);
}

.topic-card,
.word-bank-card {
  isolation: isolate;
  background: var(--teach-card-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 2px 5px rgba(41, 72, 112, 0.08),
    0 12px 26px rgba(41, 72, 112, 0.08);
}

.topic-card::before,
.word-bank-card::before {
  top: 18px;
  left: 0;
  width: 3px;
  height: 41px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(
    to bottom,
    var(--teach-warm-accent) 0 40%,
    var(--teach-navy) 40% 100%
  );
  opacity: 1;
}

.topic-card:hover,
.topic-card.is-disabled:hover {
  border-color: var(--teach-navy);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 7px rgba(41, 72, 112, 0.09),
    0 16px 32px rgba(41, 72, 112, 0.11);
}

.topic-card.is-selected {
  border-color: var(--teach-navy);
  background: var(--teach-card-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 7px rgba(41, 72, 112, 0.09),
    0 16px 32px rgba(41, 72, 112, 0.11);
}

.topic-card::after {
  z-index: 3;
  background: var(--teach-navy);
  box-shadow: none;
}

.topic-card::before,
.word-bank-card::before {
  z-index: 2;
}

.topic-card > :not(.topic-watermark) {
  position: relative;
  z-index: 1;
}

.topic-watermark {
  position: absolute;
  z-index: 0;
  top: 46px;
  right: 32px;
  width: 90px;
  height: 90px;
  pointer-events: none;
  color: var(--teach-navy);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.042;
}

.word-bank-watermark {
  top: 18px;
  right: 8px;
  opacity: 0.036;
}

.topic-card:not(.word-bank-card) .topic-watermark {
  top: 30px;
}

.topic-meta,
.topic-frequency {
  color: var(--teach-navy);
}

.topic-frequency {
  font-style: italic;
  font-weight: 800;
}

.topic-meta::before {
  background: var(--teach-warm-accent);
}

.progress-bar {
  background: var(--teach-navy);
}

.ghost-button,
.icon-button {
  border-color: var(--teach-line);
  color: var(--teach-black);
  background: var(--teach-flesh);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--teach-navy);
  color: var(--teach-navy);
  background: var(--teach-pale-green);
}

#backButton,
#checkButton,
#previousItemButton,
#nextItemButton,
#backButton:hover,
#checkButton:hover,
#previousItemButton:hover:not(:disabled),
#nextItemButton:hover:not(:disabled) {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

#previousItemButton:disabled,
#nextItemButton:disabled {
  border-color: transparent;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(41, 72, 112, 0.46);
}

#skipButton,
#skipButton:hover,
#showInitialButton,
#showInitialButton:hover,
#showAnswerButton,
#showAnswerButton:hover {
  border-color: var(--teach-line);
  color: var(--teach-black);
  background: #ffffff;
}

.zh-prompt,
.audio-prompt {
  background:
    linear-gradient(90deg, rgba(41, 72, 112, 0.28), rgba(41, 72, 112, 0.05) 34%, rgba(41, 72, 112, 0.05) 66%, rgba(41, 72, 112, 0.28)) top left / 100% 4px no-repeat,
    linear-gradient(180deg, rgba(231, 238, 247, 0.94), #ffffff 48%);
}

.zh-prompt.is-complete::after,
.success-mark {
  background: var(--teach-navy);
  box-shadow: 0 8px 18px rgba(41, 72, 112, 0.22);
}

.letter-slot,
.word-field,
.word-field:focus,
.word-field.correct,
.word-field:focus + .letter-slots .letter-slot,
.word-field.correct + .letter-slots .letter-slot {
  border-bottom-color: var(--teach-black);
}

.word-field.wrong,
.word-field.wrong + .letter-slots .letter-slot {
  border-bottom-color: var(--bad);
}

.word-field + .letter-slots .letter-slot.is-wrong {
  border-bottom-color: var(--bad);
}

.topic-badge.is-listening-basic {
  border-color: var(--teach-soft-blue);
  color: var(--teach-black);
  background: var(--teach-sage);
}

.mistake-reason {
  border-color: var(--teach-soft-blue);
  color: var(--teach-black);
  background: var(--teach-soft-blue);
}

/* White, borderless controls sit cleanly inside the flesh random-practice panel. */
.random-panel .random-count-select,
.random-panel .range-select-group,
.random-panel .ghost-button {
  border-color: transparent;
  background: #ffffff;
}

.random-panel .random-count-select,
.random-panel .random-count-select select {
  font-size: 14px;
}

.random-panel .range-select-group select + select {
  border-left-color: transparent;
}

.random-panel .random-count-select:hover,
.random-panel .range-select-group:hover {
  border-color: var(--teach-navy);
}

.random-panel .random-count-select select.unified-select-open,
.random-panel .range-select-group select.unified-select-open {
  box-shadow: none;
}

.random-panel .random-count-select:has(select.unified-select-open),
.random-panel .range-select-group:has(select.unified-select-open) {
  border-color: var(--teach-control-line);
  box-shadow: none;
}

/* Motion system: tactile controls, directional menus, quiet selected states. */
:where(
  .official-home-button,
  .module-quick-button,
  .student-identity,
  .practice-time-toggle,
  .module-tab:not(.active),
  .active-module-label,
  #screeningStartProxy,
  .segment,
  .timed-toggle-wrap,
  .toggle-wrap,
  .primary-button,
  .ghost-button,
  .icon-button,
  .export-practice-button,
  .review-nav-button,
  .leaderboard-close,
  .leaderboard-trigger
) {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-base) ease,
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease,
    transform var(--motion-fast) var(--ease-press);
}

:where(
  select,
  .random-count-select,
  .range-select-group,
  .mode-select-wrap select,
  .time-limit-select-wrap select
) {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-base) ease,
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) var(--ease-out-modern);
}

.topic-chip {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-base) ease,
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) var(--ease-out-modern),
    transform var(--motion-fast) var(--ease-press);
}

.topic-card,
.word-bank-card {
  transition:
    color var(--motion-base) ease,
    background-color var(--motion-base) ease,
    border-color var(--motion-base) ease,
    box-shadow 280ms var(--ease-out-modern),
    transform 280ms var(--ease-out-modern);
}

.topic-card::after,
.topic-chip input {
  transition:
    opacity var(--motion-base) ease,
    color var(--motion-base) ease,
    transform 280ms var(--ease-out-modern);
}

.topic-chip:has(input:checked),
.topic-chip.is-selected {
  box-shadow: 0 0 0 1px rgba(24, 42, 68, 0.08);
}

@media (hover: hover) {
  :where(
    .official-home-button,
    .module-quick-button,
    .student-identity,
    .practice-time-toggle,
    .module-tab,
    .active-module-label,
    #screeningStartProxy,
    .segment,
    .primary-button,
    .ghost-button,
    .icon-button,
    .export-practice-button,
    .review-nav-button,
    .leaderboard-close,
    .leaderboard-trigger
  ):not(:disabled):hover {
    transform: translateY(-1px);
  }

  .topic-card:not(.is-disabled):hover,
  .word-bank-card:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.84),
      0 4px 8px rgba(41, 72, 112, 0.1),
      0 18px 34px rgba(41, 72, 112, 0.12);
  }

  .topic-chip:not(.is-disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(24, 42, 68, 0.08);
  }
}

.mistake-list {
  scrollbar-color: var(--teach-navy) transparent;
}

.mistake-list::-webkit-scrollbar-thumb {
  background: var(--teach-navy);
}

.mistake-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.mistake-reason {
  border: 0;
  color: var(--teach-black);
  background: var(--teach-lime);
}

:where(
  .official-home-button,
  .module-quick-button,
  .student-identity,
  .practice-time-toggle,
  .module-tab,
  .active-module-label,
  #screeningStartProxy,
  .segment,
  .primary-button,
  .ghost-button,
  .icon-button,
  .export-practice-button,
  .review-nav-button,
  .leaderboard-close,
  .leaderboard-trigger
):not(:disabled):active {
  transform: translateY(0) scale(0.985);
  transition-duration: 80ms;
}

.module-quick-menu,
.student-dropdown,
.unified-select-menu,
.control-module-menu {
  opacity: 1;
  clip-path: inset(0 round var(--radius));
  transform: translateY(0) scaleY(1);
  transform-origin: top center;
  transform-origin: top center;
  transition:
    opacity 150ms ease,
    clip-path var(--motion-base) var(--ease-out-modern),
    transform var(--motion-base) var(--ease-out-modern),
    display var(--motion-base) allow-discrete;
}

.module-quick-menu.hidden,
.student-dropdown.hidden,
.unified-select-menu.hidden,
.control-module-menu.hidden {
  display: none !important;
  opacity: 0;
  clip-path: inset(0 0 16% 0 round var(--radius));
  transform: translateY(-7px) scale(0.985);
  pointer-events: none;
}

@starting-style {
  .module-quick-menu:not(.hidden),
  .student-dropdown:not(.hidden),
  .unified-select-menu:not(.hidden),
  .control-module-menu:not(.hidden) {
    opacity: 0;
    clip-path: inset(0 0 16% 0 round var(--radius));
    transform: translateY(-7px) scale(0.985);
  }
}

.module-quick-menu button,
.student-dropdown button,
.unified-select-menu button {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out-modern);
}

@media (hover: hover) {
  .module-quick-menu button:hover:not(:disabled),
  .student-dropdown button:hover:not(:disabled),
  .unified-select-menu button:hover:not(:disabled) {
    transform: translateY(-1px);
  }
}

.leaderboard-dialog,
.terminate-practice-dialog {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 170ms ease,
    transform 280ms var(--ease-out-modern),
    display 280ms allow-discrete,
    overlay 280ms allow-discrete;
}

.leaderboard-dialog[open],
.terminate-practice-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.leaderboard-dialog::backdrop,
.terminate-practice-dialog::backdrop {
  opacity: 0;
  transition:
    opacity 220ms ease,
    display 220ms allow-discrete,
    overlay 220ms allow-discrete;
}

.leaderboard-dialog[open]::backdrop,
.terminate-practice-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .leaderboard-dialog[open],
  .terminate-practice-dialog[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  .leaderboard-dialog[open]::backdrop,
  .terminate-practice-dialog[open]::backdrop {
    opacity: 0;
  }
}

.zh-prompt,
.audio-prompt,
.ready-word {
  color: #8f8b86;
}

.ready-word {
  color: #9f9b97;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline-color: var(--teach-lime);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .topbar {
    min-height: 72px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand-title h1 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-dashboard,
  .practice-time-summary,
  .time-breakdown,
  .module-quick-menu,
  .student-dropdown,
  .unified-select-menu,
  .control-module-menu,
  .leaderboard-dialog,
  .terminate-practice-dialog,
  .module-tab,
  .segment,
  .topic-card,
  .topic-chip,
  button,
  select {
    transition: none !important;
    transform: none !important;
  }

  .time-breakdown,
  .student-dashboard.is-expanded .time-breakdown {
    clip-path: none !important;
  }
}

/* Keep screening and practice control rows on the same vertical baseline. */
.control-strip {
  margin-top: -8px;
}

.topbar-right {
  margin-right: 2px;
}

.screening-controls,
.practice-controls {
  width: calc(100% - 2px);
  max-width: calc(100% - 2px);
}

@media (min-width: 861px) {
  .topbar {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }
}

/* One dropdown language: fixed solid chevrons, stable labels and aligned menus. */
.unified-select-chevron-host {
  position: relative;
}

select {
  background-image: none !important;
  background-position: initial !important;
}

.unified-select-chevron,
.student-caret,
.control-module-chevron,
.quick-entry-chevron {
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 6px solid currentColor;
  transform-origin: 50% 50%;
  transition: transform var(--dropdown-motion) var(--dropdown-ease);
}

.unified-select-chevron {
  position: absolute;
  z-index: 2;
  color: var(--teach-black);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(0deg);
  visibility: hidden;
}

.unified-select-chevron.is-positioned {
  opacity: 1;
  visibility: visible;
}

.unified-select-chevron.is-open {
  transform: translate(-50%, -50%) rotate(180deg);
}

#studentMenuButton[aria-expanded="true"] .student-caret,
.control-module-button[aria-expanded="true"] .control-module-chevron,
.module-quick-button[aria-expanded="true"] .quick-entry-chevron {
  transform: rotate(180deg);
}

.module-quick-button[aria-expanded="true"] > svg {
  transform: rotate(90deg);
}

.module-quick-menu,
.student-dropdown,
.unified-select-menu,
.control-module-menu {
  box-sizing: border-box;
}

.range-select-group > select + select {
  border-left-color: #c9c3bd !important;
}

:where(
  .official-home-button,
  .module-quick-button,
  .ghost-button,
  .icon-button,
  .export-practice-button,
  .review-nav-button
) > svg {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .unified-select-chevron,
  .student-caret,
  .control-module-chevron,
  .quick-entry-chevron {
    transition: none !important;
  }
}

/* Final interaction and completion-state polish. */
:root {
  --dropdown-motion: 460ms;
  --dropdown-fade: 320ms;
  --dropdown-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

select {
  --select-chevron-left: calc(100% - 24px);
  --select-chevron-right: calc(100% - 18px);
  background-position: var(--select-chevron-left) 50%, var(--select-chevron-right) 50%;
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-base) ease,
    background-position var(--dropdown-motion) var(--dropdown-ease),
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) var(--ease-out-modern);
}

.mode-select-wrap select {
  --select-chevron-left: calc(100% - 20px);
  --select-chevron-right: calc(100% - 14px);
}

.time-limit-select-wrap select,
.range-select-group select {
  --select-chevron-left: calc(100% - 18px);
  --select-chevron-right: calc(100% - 12px);
}

select.unified-select-open {
  background-position: var(--select-chevron-right) 50%, var(--select-chevron-left) 50%;
}

select:focus,
select:focus-visible,
select.unified-select-open:focus,
select.unified-select-open:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

button:focus-visible,
input:focus-visible {
  outline-color: rgba(41, 72, 112, 0.55);
}

html.pointer-input :where(button, [role="button"]):focus,
html.pointer-input :where(button, [role="button"]):focus-visible {
  outline: none !important;
}

.student-caret,
.control-module-chevron {
  transition: transform var(--dropdown-motion) var(--dropdown-ease);
}

#studentMenuButton[aria-expanded="true"] .student-caret,
.control-module-button[aria-expanded="true"] .control-module-chevron {
  transform: rotate(180deg);
}

.module-quick-menu,
.student-dropdown,
.unified-select-menu,
.control-module-menu {
  opacity: 1;
  clip-path: inset(0 round var(--radius));
  transform: translateY(0) scale(1);
  transition:
    opacity var(--dropdown-fade) ease,
    clip-path var(--dropdown-motion) var(--dropdown-ease),
    transform var(--dropdown-motion) var(--dropdown-ease),
    display var(--dropdown-motion) allow-discrete;
  transition-behavior: allow-discrete;
}

.module-quick-menu.hidden,
.student-dropdown.hidden,
.unified-select-menu.hidden,
.control-module-menu.hidden,
.unified-select-menu.is-opening,
.unified-select-menu.is-closing {
  opacity: 0;
  clip-path: inset(0 0 20% 0 round var(--radius));
  transform: translateY(-9px) scaleY(0.96);
  pointer-events: none;
}

@starting-style {
  .module-quick-menu:not(.hidden),
  .student-dropdown:not(.hidden),
    .unified-select-menu:not(.hidden),
    .control-module-menu:not(.hidden) {
    opacity: 0;
    clip-path: inset(0 0 20% 0 round var(--radius));
    transform: translateY(-9px) scaleY(0.96);
  }
}

.segment {
  color: var(--teach-black);
}

.topic-card p {
  color: #8b8782;
}

.zh-prompt,
.audio-prompt {
  background:
    linear-gradient(90deg, rgba(41, 72, 112, 0.28), rgba(41, 72, 112, 0.05) 34%, rgba(41, 72, 112, 0.05) 66%, rgba(41, 72, 112, 0.28)) top left / 100% 4px no-repeat,
    #ffffff;
}

.topic-badge,
.topic-badge.is-listening-basic {
  border: 0;
  color: var(--teach-black);
  background: var(--teach-sage);
}

.feedback.round-summary,
.feedback.round-summary .completion-summary-text {
  color: var(--teach-navy);
}

#newRoundButton,
#newRoundButton:hover {
  border-color: var(--teach-navy);
  color: #ffffff;
  background: var(--teach-navy);
}

#returnTopicsButton,
#returnTopicsButton:hover,
#returnTopicsButton.is-leaderboard,
#returnTopicsButton.is-leaderboard:hover {
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background: #ffffff;
}

.play-row #returnTopicsButton.is-leaderboard {
  width: 112px;
  min-width: 112px;
}

#previousItemButton:disabled,
#nextItemButton:disabled {
  border-color: transparent;
  color: #ffffff;
  background: #c9c7c4;
}

#playButton:hover {
  border-color: var(--teach-line);
  color: var(--teach-black);
  background: var(--teach-flesh);
}

.audio-toggle-button:hover:not(.is-muted) {
  color: var(--teach-navy);
  background: #ffffff;
}

.audio-toggle-button.is-muted:hover {
  color: var(--muted);
  background: #f2f5f4;
}

.audio-toggle-button.is-muted,
.audio-toggle-button.is-muted:hover {
  border-color: transparent;
  color: #ffffff;
  background: #aeb8ca;
  box-shadow: none;
}

.audio-toggle-button.is-muted .audio-icon-wave {
  display: initial;
}

.audio-toggle-button.is-muted .audio-off-mark {
  display: none;
}

.audio-toggle-button.is-muted svg {
  width: 19px;
  height: 19px;
  color: #ffffff;
  transform: none;
}

.speed-select::after {
  display: none;
  content: none;
}

.practice-time-summary {
  font-size: 13px;
}

.timed-practice-control.is-enabled .timed-toggle-wrap {
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background: var(--teach-flesh);
}

.topic-mini p,
.topic-mini strong {
  color: #74706c;
}

.module-quick-menu button,
.student-dropdown button,
.unified-select-menu button,
.control-module-menu button,
.module-quick-menu button.active,
.student-dropdown button.active,
.unified-select-menu button.active,
.control-module-menu button.active {
  color: var(--teach-black);
  background: #ffffff;
}

@media (hover: hover) {
  .module-quick-menu button:hover:not(:disabled),
  .student-dropdown button:hover:not(:disabled),
  .unified-select-menu button:hover:not(:disabled),
  .control-module-menu button:hover:not(:disabled) {
    color: var(--teach-black);
    background: var(--teach-sage);
  }
}

@media (prefers-reduced-motion: reduce) {
  .module-quick-menu,
  .student-dropdown,
  .unified-select-menu,
  .control-module-menu,
  .student-caret,
  .control-module-chevron,
  select {
    transition: none !important;
  }
}

.module-quick-menu button:hover:not(:disabled),
.student-dropdown button:hover:not(:disabled),
.unified-select-menu button:hover:not(:disabled),
.control-module-menu button:hover:not(:disabled) {
  color: var(--teach-black);
  background: var(--teach-sage);
}

.module-quick-menu button:disabled,
.control-module-menu button:disabled {
  color: var(--teach-black);
  background: #ffffff;
}

.module-quick-menu button:hover,
.control-module-menu button:hover {
  color: var(--teach-black);
  background: var(--teach-soft-blue);
}

/* Final shared component contract: quiet flesh controls, stable menus and black selection copy. */
@media screen {
  .question-timer,
  .question-timer.is-urgent {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--teach-navy);
    box-shadow: none;
  }

  .zh-prompt,
  .audio-prompt {
    background: #ffffff !important;
  }

  .zh-prompt::before,
  .audio-prompt::before {
    content: none !important;
    display: none !important;
  }

  .screening-controls select,
  .screening-controls input[type="number"],
  .range-select-group,
  .mode-select-wrap select,
  .time-limit-select-wrap select,
  .random-count-select,
  .timed-toggle-wrap,
  .toggle-wrap,
  .official-home-button,
  .module-quick-button,
  .practice-time-toggle,
  .module-tab,
  .ghost-button,
  .icon-button,
  .export-practice-button,
  .random-panel .ghost-button,
  #playButton {
    border-color: var(--teach-line) !important;
    box-shadow: none !important;
  }

  .range-select-group > select {
    border-color: transparent !important;
  }

  .screening-controls select {
    padding-top: 0;
    padding-bottom: 2px;
  }

  .range-select-group > select + select {
    border-left: 0 !important;
  }

  .unified-select-menu {
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
  }

  .unified-select-menu button {
    padding-right: 8px;
    padding-left: 8px;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .official-home-button:hover,
  .module-quick-button:hover,
  .module-quick-button[aria-expanded="true"],
  .module-tab:not(.active):hover,
  .random-panel .ghost-button:hover,
  #playButton:hover {
    border-color: var(--teach-line) !important;
    color: var(--teach-black);
    background: var(--teach-flesh);
    box-shadow: none;
  }

  .topic-chip:has(input:checked),
  .topic-chip.is-selected,
  .topic-chip:has(input:checked):hover,
  .topic-chip.is-selected:hover {
    border-color: transparent;
    color: #5f5c58;
    background: #ffffff;
    box-shadow: none;
  }

  .topic-badge,
  .topic-badge.is-listening-basic,
  .mistake-reason {
    border: 0;
    color: var(--teach-black);
    background: var(--teach-sage);
  }

  .topic-badge *,
  .mistake-reason * {
    color: var(--teach-black);
  }

  #playButton,
  #playButton:hover,
  #playButton.is-playing {
    border-color: var(--teach-navy) !important;
    color: #ffffff !important;
    background: var(--teach-navy) !important;
    box-shadow: none !important;
  }

  .feedback.good,
  .success-feedback {
    color: var(--teach-navy);
  }

  #exportImageButton,
  #exportImageButton:hover {
    border-color: var(--teach-line) !important;
    color: var(--teach-black);
    background: #ffffff;
    box-shadow: none;
  }

  #backButton,
  #backButton:hover {
    border-color: var(--teach-navy) !important;
    color: #ffffff;
    background: var(--teach-navy);
    box-shadow: none;
  }

  .student-dashboard,
  .student-identity,
  .student-avatar {
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .practice-time-toggle {
    align-items: center;
  }

  .practice-time-summary {
    display: inline-flex;
    align-items: center;
    padding-bottom: 0;
    line-height: normal;
  }
}

body.hub-mode #practiceTimeDashboard {
  display: none !important;
}

.official-home-button,
.official-home-button:hover {
  border-color: var(--teach-navy) !important;
  color: #ffffff !important;
  background: var(--teach-navy) !important;
  box-shadow: none !important;
}

/* Site-wide navigation continuity: anchored header, smoothly changing content stage. */
html.platform-page-ready .app-shell {
  animation: platform-page-enter 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.page-is-leaving .app-shell {
  pointer-events: none;
  will-change: opacity;
  animation: platform-page-exit 190ms cubic-bezier(0.4, 0, 1, 1) both;
}

html.platform-view-transitioning {
  view-transition-name: none;
}

html.platform-view-transitioning:not([data-platform-transition-scope="level"]) :is(#moduleHub, #screeningEmbedView, #trainingContent):not(.hidden) {
  view-transition-name: platform-stage;
}

html.platform-view-transitioning:not([data-platform-transition-scope="level"]) .control-strip:not(.hidden) {
  view-transition-name: platform-controls;
}

html.platform-view-transitioning[data-platform-transition-scope="level"] .random-panel:not(.hidden) {
  view-transition-name: practice-level-options;
}

html.platform-view-transitioning[data-platform-transition-scope="level"] #topicView:not(.hidden) {
  view-transition-name: practice-level-topics;
}

body.platform-view-transitioning {
  pointer-events: none;
}

body.platform-view-transitioning :is(.screening-controls, .practice-controls) {
  transition: none !important;
  will-change: auto;
}

::view-transition-group(platform-stage) {
  z-index: 2;
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(platform-stage) {
  animation: platform-stage-exit 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(platform-stage) {
  animation: platform-stage-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-platform-transition-direction="back"]::view-transition-new(platform-stage) {
  animation-name: platform-stage-enter-back;
}

::view-transition-group(platform-controls) {
  z-index: 3;
  animation-duration: 400ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(platform-controls) {
  animation: platform-controls-exit 130ms ease-in both;
}

::view-transition-new(platform-controls) {
  animation: platform-controls-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

::view-transition-group(practice-level-options),
::view-transition-group(practice-level-topics) {
  z-index: 2;
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(practice-level-options),
::view-transition-old(practice-level-topics) {
  animation: practice-level-exit 140ms ease-in both;
}

::view-transition-new(practice-level-options),
::view-transition-new(practice-level-topics) {
  animation: practice-level-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.screening-embed-frame.screening-frame-arriving {
  animation: screening-frame-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes platform-page-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes platform-page-exit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes platform-stage-exit {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -7px, 0);
    filter: blur(1.5px);
  }
}

@keyframes platform-stage-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes platform-stage-enter-back {
  from {
    opacity: 0;
    transform: translate3d(0, -12px, 0);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes platform-controls-exit {
  to {
    opacity: 0;
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes platform-controls-enter {
  from {
    opacity: 0;
    transform: translate3d(0, -7px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes practice-level-exit {
  to {
    opacity: 0;
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes practice-level-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 7px, 0);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes screening-frame-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    filter: blur(1.5px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

/* Round settings stay in the prompt header without changing its vertical rhythm. */
.prompt-head.has-word-round-controls,
.prompt-title-line.has-word-round-controls {
  min-height: 40px;
  align-items: center;
}

.prompt-head.has-word-round-controls {
  transform: translateY(-2px);
}

.prompt-title-line.has-word-round-controls {
  flex: 1 1 auto;
  gap: 0;
}

.practice-word-round-controls {
  min-width: 0;
  height: 40px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.practice-word-round-controls .word-range-panel {
  height: 40px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.practice-word-round-controls .word-range-panel label {
  height: 40px;
  gap: 4px;
  color: var(--teach-black);
  font-size: 13px;
  line-height: 1;
}

.practice-word-round-controls .word-range-select-group {
  width: auto;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  border-color: var(--teach-control-line);
  background: #ffffff;
}

.practice-word-round-controls .word-range-select-group select {
  width: 95px;
  min-width: 95px;
  height: 38px;
  min-height: 38px;
  padding-right: 28px;
  padding-left: 8px;
  color: var(--teach-black);
  font-size: 13px;
  line-height: 1;
  text-align: center;
  text-align-last: center;
}

.practice-word-round-controls .word-range-select-group select + select {
  width: 95px;
  min-width: 95px;
}

.practice-word-round-controls .random-count-select {
  width: 114px;
  min-width: 114px;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding-left: 12px;
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background: #ffffff;
  font-size: 13px;
  line-height: 1;
}

.practice-word-round-controls .random-count-select span {
  color: var(--teach-black);
  font-size: 13px;
  font-weight: 800;
}

.practice-word-round-controls .random-count-select select {
  width: 62px;
  min-width: 62px;
  height: 38px;
  min-height: 38px;
  padding-right: 22px;
  padding-left: 6px;
  color: var(--teach-black);
  font-size: 13px;
  line-height: 1;
}

.unified-select-menu[data-select-id="randomSize"] {
  scrollbar-gutter: auto;
}

.unified-select-menu[data-select-id="randomSize"] button {
  width: calc(100% - 24px);
  margin-right: auto;
  margin-left: auto;
}

.practice-word-round-controls.is-locked {
  color: #888684;
}

.practice-word-round-controls.is-locked :is(.range-select-group, .random-count-select) {
  border-color: transparent !important;
  background: #c9c7c4;
}

.practice-word-round-controls.is-locked :is(select, .random-count-select span, .unified-select-chevron) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.practice-word-round-controls select:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.prompt-head.has-word-round-controls .prompt-meta {
  flex: 0 1 auto;
  gap: 10px;
}

.prompt-head.has-word-round-controls .completion-meta {
  font-size: 11px;
  white-space: nowrap;
}

.prompt-head.has-word-round-controls .topic-badge {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-topic-select {
  width: 136px;
  min-width: 136px;
  height: 40px;
  min-height: 40px;
  padding: 0 30px 0 10px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--teach-navy);
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-align-last: center;
}

.practice-collocation-round-controls {
  height: 40px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.practice-collocation-round-controls .random-count-select {
  width: 131px;
  min-width: 131px;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background: #ffffff;
  font-size: 15px;
  line-height: 1;
}

.practice-collocation-round-controls .random-count-select span {
  color: var(--teach-black);
  font-size: 15px;
  font-weight: 850;
}

.practice-collocation-round-controls .random-count-select select {
  width: 62px;
  min-width: 62px;
  height: 38px;
  min-height: 38px;
  padding-right: 22px;
  padding-left: 6px;
  color: var(--teach-black);
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.practice-topic-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.practice-collocation-round-controls.is-locked .random-count-select {
  border-color: transparent !important;
  background: #c9c7c4;
}

.practice-collocation-round-controls.is-locked .random-count-select :is(span, select),
.practice-collocation-round-controls.is-locked .unified-select-chevron {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

.practice-collocation-round-controls select:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.practice-topic-select:disabled {
  cursor: not-allowed;
  color: #ffffff;
  background: #c9c7c4;
  opacity: 1;
  -webkit-text-fill-color: #ffffff;
}

.practice-topic-select-wrap .unified-select-chevron {
  color: #ffffff !important;
}

.practice-collocation-round-controls.is-locked .practice-topic-select-wrap .unified-select-chevron {
  color: #ffffff !important;
}

.terminate-practice-dialog[data-mode="round-settings"] {
  width: min(560px, calc(100vw - 32px));
}

.terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-content {
  padding: 34px 40px 40px;
}

.terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-content h2 {
  margin-bottom: 28px;
  font-size: 28px;
}

.terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-actions {
  gap: 14px;
}

.terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-actions button {
  min-height: 62px;
  padding: 0 16px;
  font-size: 16px;
  line-height: 1.3;
}

.terminate-practice-dialog[data-mode="round-settings"] .continue-button {
  border-color: var(--teach-navy);
  background: var(--teach-navy);
}

.terminate-practice-dialog[data-mode="round-settings"] .terminate-button {
  border-color: var(--teach-control-line);
  color: var(--teach-black);
  background: var(--teach-flesh);
}

@media (max-width: 860px) {
  .prompt-head.has-word-round-controls {
    flex-wrap: wrap;
  }

  .prompt-title-line.has-word-round-controls,
  .practice-word-round-controls {
    width: 100%;
  }

  .practice-word-round-controls {
    overflow-x: auto;
    overflow-y: hidden;
  }
}

@media (max-width: 560px) {
  .terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-content {
    padding: 28px 24px 30px;
  }

  .terminate-practice-dialog[data-mode="round-settings"] .terminate-practice-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.platform-page-ready .app-shell,
  body.page-is-leaving .app-shell,
  .screening-embed-frame.screening-frame-arriving {
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }

  ::view-transition-group(platform-stage),
  ::view-transition-old(platform-stage),
  ::view-transition-new(platform-stage),
  ::view-transition-group(platform-controls),
  ::view-transition-old(platform-controls),
  ::view-transition-new(platform-controls),
  ::view-transition-group(practice-level-options),
  ::view-transition-old(practice-level-options),
  ::view-transition-new(practice-level-options),
  ::view-transition-group(practice-level-topics),
  ::view-transition-old(practice-level-topics),
  ::view-transition-new(practice-level-topics) {
    animation-duration: 1ms !important;
  }
}
