#nap-root {
  /*
   * Fluid rem: 1em = 1rem at 1080px window height (16px when html is 16px).
   * Do not use document rem — that would resize Netflix's own UI.
   */
  font-size: max(8px, calc(100vh / 67.5));
  --nap-font-size: 1.5em;
  --nap-top: 8vh;
  --nap-width: 80vw;
  --nap-weight: 700;
  --nap-opacity: 0.7;
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-family: "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-sizing: border-box !important;
}

#nap-root.nap-hidden {
  display: none !important;
}

/* Fixed at top of the viewport / player chrome */
#nap-root.nap-placement-top {
  position: fixed !important;
  left: 50% !important;
  top: max(24px, var(--nap-top)) !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: 2147483647 !important;
  width: min(var(--nap-width), 960px);
}

/*
 * Mounted on body, outside Netflix's React-managed timedtext subtree.
 * Viewport coordinates are applied from JS to mirror the native cue position.
 */
#nap-root.nap-placement-bottom {
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 2147483647 !important;
  max-width: 100%;
}

#nap-root .nap-text {
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  color: #ffffff;
  font-size: var(--nap-font-size);
  font-weight: var(--nap-weight);
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  text-align: center;
  opacity: var(--nap-opacity);
  /* Netflix-style white fill + dark outline; em so the outline tracks font size */
  text-shadow:
    -0.045em -0.045em 0 #000,
    0.045em -0.045em 0 #000,
    -0.045em 0.045em 0 #000,
    0.045em 0.045em 0 #000,
    0 0 0.18em rgba(0, 0, 0, 0.85),
    0 0.08em 0.25em rgba(0, 0, 0, 0.65);
}

#nap-root .nap-text.nap-empty {
  display: none !important;
}

#nap-root .nap-skeleton {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  width: min(var(--nap-skeleton-width, 42ch), 100%);
  margin: 0 auto;
  pointer-events: none;
}

#nap-root .nap-skeleton.is-visible {
  display: flex;
}

#nap-root .nap-skeleton-bar {
  display: block;
  width: 100%;
  height: 0.72em;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.28) 45%,
    rgba(255, 255, 255, 0.12) 100%
  );
  background-size: 200% 100%;
  animation: nap-skeleton-shimmer 1.1s ease-in-out infinite;
  box-shadow:
    0 0 4px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

#nap-root .nap-skeleton-bar:nth-child(2) {
  width: 72%;
}

#nap-root .nap-text.nap-fade-in {
  animation: nap-overlay-fade-in 220ms ease-out;
}

@keyframes nap-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes nap-overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--nap-opacity);
  }
}

@media (prefers-reduced-motion: reduce) {
  #nap-root .nap-skeleton-bar {
    animation: none;
    background: rgba(255, 255, 255, 0.22);
  }

  #nap-root .nap-text.nap-fade-in {
    animation: none;
  }
}

/* --- Practice cards (top-right) --- */

#nap-cards {
  position: fixed !important;
  top: 24px !important;
  right: 24px !important;
  z-index: 2147483646 !important;
  width: 320px;
  max-width: calc(100vw - 48px);
  pointer-events: none;
  font-family: "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
}

/*
 * The explanation needs room for a word table, so it takes over the banner:
 * wider, higher up, and the practice panels step aside while it is open.
 */
#nap-cards.nap-explaining {
  top: 12px !important;
  right: 16px !important;
  width: min(680px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}

#nap-cards.nap-explaining .nap-line-panel,
#nap-cards.nap-explaining .nap-practice-card,
#nap-cards.nap-explaining .nap-subtitle-hint {
  display: none !important;
}

#nap-cards.nap-explaining .nap-explain-panel {
  margin-top: 0;
}

#nap-cards.nap-idle {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* First-run setup guidance has to survive the player chrome fading out. */
#nap-cards.nap-idle.nap-keep-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

#nap-cards * {
  box-sizing: border-box;
}

#nap-cards .nap-word,
#nap-cards .nap-word::after {
  box-sizing: content-box;
  overflow: visible;
}

.nap-practice-card,
.nap-level-sheet,
.nap-cards-chip,
.nap-line-panel,
.nap-subtitle-hint,
.nap-health-banner {
  pointer-events: auto;
}

.nap-practice-card,
.nap-line-panel,
.nap-level-sheet,
.nap-subtitle-hint {
  position: relative;
  overflow: visible;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 20px 18px 16px;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.nap-practice-card {
  opacity: 0.96;
  transform: translateY(-6px) scale(0.98);
  animation: nap-card-in 180ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.nap-practice-card.nap-card-exit {
  animation: nap-card-out 150ms ease-in forwards;
}

@keyframes nap-card-in {
  to {
    opacity: 0.96;
    transform: translateY(0) scale(1);
  }
}

@keyframes nap-card-out {
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.nap-subtitle-hint {
  animation: nap-card-in 180ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0.96;
  transform: translateY(-6px) scale(0.98);
  padding: 16px 16px 14px;
  border-left: 2px solid #aae73d;
}

.nap-subtitle-hint.nap-subtitle-hint-ok {
  border-left-color: rgba(255, 255, 255, 0.24);
}

/* Stacks under the line panel during the brief success state. */
.nap-subtitle-hint:not(:first-child) {
  margin-top: 10px;
}

.nap-subtitle-hint-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  padding: 4px 6px;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.nap-subtitle-hint-close:hover {
  color: rgba(255, 255, 255, 0.85);
}

.nap-subtitle-hint-step {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aae73d;
}

.nap-subtitle-hint-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.nap-subtitle-hint-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.nap-subtitle-hint-body strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.nap-health-banner {
  position: relative;
  overflow: visible;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid #aae73d;
  color: #fff;
  padding: 16px 16px 14px;
  animation: nap-card-in 180ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0.96;
  transform: translateY(-6px) scale(0.98);
}

.nap-health-banner.is-down {
  border-left-color: #ffd60a;
}

.nap-health-banner.is-down .nap-subtitle-hint-step {
  color: #ffd60a;
}

.nap-health-banner.is-checking {
  border-left-color: rgba(255, 255, 255, 0.28);
}

.nap-health-banner.is-checking .nap-subtitle-hint-step {
  color: rgba(255, 255, 255, 0.5);
}

.nap-health-banner + .nap-line-panel,
.nap-health-banner + .nap-practice-card,
.nap-health-banner + .nap-subtitle-hint,
.nap-health-banner + .nap-level-sheet {
  margin-top: 10px;
}

.nap-card-countdown {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.nap-card-countdown-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: #e50914;
}

.nap-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nap-card-prompt {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.nap-card-sentence {
  margin: 0;
  overflow: visible;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.nap-card-gloss {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.nap-word {
  --nap-word-line: rgba(255, 255, 255, 0.42);
  position: relative;
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: content-box;
  overflow: visible;
  margin: 0;
  padding: 0 0 0.28em;
  border: none;
  border-radius: 2px;
  background: transparent;
  background-repeat: no-repeat;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  vertical-align: baseline;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
}

.nap-word::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 2px;
  background: var(--nap-word-line);
  pointer-events: none;
}

.nap-word:hover,
.nap-word:focus-visible {
  --nap-word-line: transparent;
  color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nap-word.is-loading,
.nap-word.is-loading:hover,
.nap-word.is-loading:focus-visible {
  --nap-word-line: rgba(255, 255, 255, 0.55);
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
  background-image: none;
  animation: nap-word-wait 0.9s ease-in-out infinite;
}

.nap-word.is-playing,
.nap-word.is-playing:hover,
.nap-word.is-playing:focus-visible {
  --nap-word-line: rgba(255, 255, 255, 0.7);
  color: #fff;
  background-color: transparent;
  background-image:
    linear-gradient(
      105deg,
      transparent 35%,
      rgba(255, 255, 255, 0.42) 50%,
      transparent 65%
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0.08)
    );
  background-size:
    42% 100%,
    calc(var(--nap-play-p, 0) * 100%) 100%;
  background-position:
    calc(var(--nap-play-p, 0) * 160% - 30%) 0,
    left center;
  background-repeat: no-repeat;
  animation: none;
}

.nap-speak-word {
  border-radius: 2px;
  transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nap-speak-word.is-heard,
.nap-word.is-heard {
  --nap-word-line: transparent;
  opacity: 0;
  pointer-events: none;
  background: none;
}

span.nap-speak-word.is-spoken,
.nap-word.is-spoken {
  color: rgba(255, 255, 255, 0.4);
}

span.nap-speak-word.is-current,
.nap-word.is-current,
.nap-word.is-current:hover,
.nap-word.is-current:focus-visible {
  --nap-word-line: rgba(255, 255, 255, 0.72);
  color: #fff;
  background-color: rgba(229, 9, 20, 0.38);
  background-image: none;
}

@keyframes nap-word-wait {
  0%,
  100% {
    background-color: rgba(255, 255, 255, 0.06);
  }
  50% {
    background-color: rgba(255, 255, 255, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nap-speak-word {
    transition: none;
  }

  .nap-word.is-loading,
  .nap-word.is-loading:hover,
  .nap-word.is-loading:focus-visible {
    animation: none;
  }

  .nap-word.is-playing,
  .nap-word.is-playing:hover,
  .nap-word.is-playing:focus-visible {
    background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18),
      rgba(255, 255, 255, 0.18)
    );
    background-size: 100% 100%;
    background-position: 0 0;
  }
}

.nap-word-tip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: max-content;
  max-width: 240px;
  white-space: normal;
  background: #fff;
  color: #141414;
  font-family: "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  padding: 8px 10px;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 2147483647;
}

.nap-word-tip.is-open {
  display: flex;
}

.nap-word-tip-text {
  font-weight: 600;
}

.nap-word-tip-pron {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  color: rgba(20, 20, 20, 0.55);
}

/* Invisible bridge so the pointer can travel from the word into the tip. */
.nap-word-tip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  top: -14px;
}

.nap-word-tip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom-color: #fff;
  border-top-color: transparent;
}

.nap-word-tip.nap-word-tip-above::before {
  top: auto;
  bottom: -14px;
}

.nap-word-tip.nap-word-tip-above::after {
  bottom: auto;
  top: 100%;
  border-bottom-color: transparent;
  border-top-color: #fff;
}

.nap-choices {
  display: grid;
  gap: 8px;
}

.nap-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.nap-choice:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nap-choice input {
  margin-top: 2px;
}

.nap-choice.is-correct {
  background: rgba(34, 197, 94, 0.18);
}

.nap-card-primary {
  border: none;
  border-radius: 2px;
  background: #e50914;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  width: 100%;
}

.nap-card-primary:hover {
  background: #f40612;
}

.nap-card-primary:active {
  transform: scale(0.98);
}

.nap-practice-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 15px;
}

.nap-card-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.nap-card-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition:
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1),
    background 160ms ease,
    color 160ms ease;
}

.nap-card-icon:active {
  transform: scale(0.92);
}

.nap-card-icon.is-playing {
  background: rgba(229, 9, 20, 0.28);
  color: #fff;
}

.nap-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.nap-card-action-speak {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #e50914;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  transition:
    background 160ms ease,
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nap-card-action-speak:active {
  transform: scale(0.97);
}

.nap-speak-label {
  pointer-events: none;
}

.nap-speak-stop {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #fff;
  pointer-events: none;
}

.nap-card-action-speak.is-listening {
  flex: 1 1 auto;
  width: 100%;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: #e50914;
}

.nap-card-action-speak.is-listening .nap-speak-label {
  display: none;
}

.nap-card-action-speak.is-listening .nap-speak-stop {
  display: block;
}

.nap-card-action-speak.is-listening:active {
  transform: scale(0.97);
}

.nap-card-action-speak.is-checking {
  flex: 1 1 auto;
  width: 100%;
  height: 40px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: transparent;
  box-shadow: none;
  cursor: default;
}

.nap-card-action-speak.is-checking .nap-speak-label,
.nap-card-action-speak.is-checking .nap-speak-stop {
  display: none;
}

.nap-card-action-speak.is-checking::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: nap-speak-wait 700ms ease-in-out infinite;
}

.nap-card-action-speak.is-checking:active {
  transform: none;
}

@keyframes nap-speak-wait {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  .nap-card-icon:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  .nap-card-action-speak:hover {
    background: #f40612;
  }

  .nap-card-action-speak.is-listening:hover {
    background: #f6121d;
  }

  .nap-card-action-speak.is-checking:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .nap-practice-card.is-speak-ok .nap-card-action-speak:hover,
  .nap-line-panel.is-speak-ok .nap-card-action-speak:hover {
    background: #46d369;
  }

  .nap-practice-card.is-speak-miss .nap-card-action-speak:hover,
  .nap-line-panel.is-speak-miss .nap-card-action-speak:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

.nap-speak-rec {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(229, 9, 20, 0.12);
}

.nap-speak-rec.is-live {
  display: flex;
}

.nap-practice-card.is-recording .nap-card-gloss,
.nap-line-panel.is-recording .nap-card-gloss,
.nap-practice-card.is-recording .nap-card-icon,
.nap-line-panel.is-recording .nap-card-icon,
.nap-practice-card.is-recording .nap-card-prompt,
.nap-practice-card.is-recording .nap-choices,
.nap-practice-card.is-recording .nap-card-primary,
.nap-practice-card.is-recording .nap-card-hide-ep,
.nap-practice-card.is-recording .nap-choice-feedback,
.nap-line-panel.is-recording .nap-line-label {
  display: none;
}

.nap-practice-card.is-recording .nap-card-actions,
.nap-line-panel.is-recording .nap-card-actions {
  width: 100%;
}

.nap-practice-card.is-recording .nap-card-action-speak,
.nap-line-panel.is-recording .nap-card-action-speak {
  flex: 1 1 auto;
  width: 100%;
}

.nap-practice-card.is-recording .nap-speak-rec.is-live,
.nap-line-panel.is-recording .nap-speak-rec.is-live {
  padding: 10px 12px;
}

.nap-practice-card.is-recording .nap-rec-wave,
.nap-line-panel.is-recording .nap-rec-wave {
  height: 32px;
}

.nap-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e50914;
  flex: 0 0 auto;
  animation: nap-rec-pulse 1.1s ease-in-out infinite;
}

.nap-rec-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  flex: 1 1 auto;
  height: 24px;
}

.nap-rec-bar {
  --nap-bar: 0.12;
  flex: 0 0 auto;
  width: 3px;
  height: calc(4px + var(--nap-bar) * 28px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  transition: height 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nap-rec-time {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.72);
}

@keyframes nap-rec-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nap-rec-dot,
  .nap-card-action-speak.is-checking::after {
    animation: none;
  }
  .nap-rec-bar,
  .nap-speak-dots i {
    transition: none;
  }
}

.nap-choice-feedback,
.nap-speak-status {
  margin: 0;
  font-size: 13px;
  min-height: 1.2em;
  color: rgba(255, 255, 255, 0.65);
}

.nap-speak-status:empty {
  display: none;
  min-height: 0;
}

.nap-speak-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 22px;
}

.nap-speak-score[hidden] {
  display: none;
}

.nap-speak-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nap-speak-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition:
    background 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nap-speak-dots i.is-on {
  background: #fff;
  transform: scale(1.08);
}

.nap-speak-score-num {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
}

.nap-practice-card.is-speak-ok,
.nap-line-panel.is-speak-ok {
  background: rgba(16, 92, 48, 0.92);
  border-color: rgba(70, 211, 105, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(70, 211, 105, 0.55);
}

.nap-practice-card.is-speak-ok .nap-card-action-speak,
.nap-line-panel.is-speak-ok .nap-card-action-speak {
  background: #46d369;
}

.nap-practice-card.is-speak-miss,
.nap-line-panel.is-speak-miss {
  background: rgba(28, 28, 28, 0.92);
}

.nap-practice-card.is-speak-miss .nap-card-action-speak,
.nap-line-panel.is-speak-miss .nap-card-action-speak {
  background: rgba(255, 255, 255, 0.16);
}

.nap-choice-feedback.ok,
.nap-speak-status.ok,
.nap-choice-feedback.err,
.nap-speak-status.err {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.nap-choice-feedback.ok,
.nap-speak-status.ok {
  color: #46d369;
}

.nap-choice-feedback.err,
.nap-speak-status.err {
  color: #e50914;
}

.nap-card-hide-ep {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  padding: 4px 0 0;
  cursor: pointer;
  text-align: left;
}

.nap-card-hide-ep:hover {
  color: rgba(255, 255, 255, 0.8);
}

.nap-level-sheet {
  animation: nap-card-in 180ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.nap-onboard-sheet {
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(170, 231, 61, 0.12), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(91, 140, 255, 0.14), transparent 50%),
    rgba(0, 0, 0, 0.86);
}

.nap-level-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.nap-level-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.nap-level-options {
  display: grid;
  gap: 8px;
}

.nap-level-btn,
.nap-lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 120ms ease;
}

.nap-level-btn:hover,
.nap-lang-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nap-level-btn:active,
.nap-lang-btn:active {
  transform: scale(0.98);
}

.nap-level-btn:disabled,
.nap-lang-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.nap-level-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nap-level-btn[data-level="A1"] {
  --nap-level-accent: #7cff6b;
  background: rgba(124, 255, 107, 0.14);
  border-color: rgba(124, 255, 107, 0.38);
}

.nap-level-btn[data-level="A2"] {
  --nap-level-accent: #f5d90a;
  background: rgba(245, 217, 10, 0.14);
  border-color: rgba(245, 217, 10, 0.38);
}

.nap-level-btn[data-level="B1"] {
  --nap-level-accent: #ff8a3d;
  background: rgba(255, 138, 61, 0.14);
  border-color: rgba(255, 138, 61, 0.38);
}

.nap-level-btn[data-level="B2"] {
  --nap-level-accent: #ff5c7a;
  background: rgba(255, 92, 122, 0.14);
  border-color: rgba(255, 92, 122, 0.38);
}

.nap-level-btn[data-level="A1"]:hover {
  background: rgba(124, 255, 107, 0.22);
}

.nap-level-btn[data-level="A2"]:hover {
  background: rgba(245, 217, 10, 0.22);
}

.nap-level-btn[data-level="B1"]:hover {
  background: rgba(255, 138, 61, 0.22);
}

.nap-level-btn[data-level="B2"]:hover {
  background: rgba(255, 92, 122, 0.22);
}

.nap-level-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex-shrink: 0;
  background: var(--nap-level-accent, #fff);
  box-shadow: 0 0 8px var(--nap-level-accent, transparent);
}

.nap-level-copy {
  flex: 1;
  min-width: 0;
}

.nap-level-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--nap-level-accent, #fff);
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 7px;
  border-radius: 999px;
}

.nap-lang-options {
  grid-template-columns: 1fr 1fr;
}

.nap-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 12px 10px;
}

.nap-lang-btn[data-lang="fr"] {
  background: rgba(91, 140, 255, 0.2);
  border-color: rgba(91, 140, 255, 0.42);
}

.nap-lang-btn[data-lang="es"] {
  background: rgba(255, 176, 32, 0.2);
  border-color: rgba(255, 176, 32, 0.42);
}

.nap-lang-btn[data-lang="de"] {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.42);
}

.nap-lang-btn[data-lang="it"] {
  background: rgba(61, 214, 140, 0.2);
  border-color: rgba(61, 214, 140, 0.42);
}

.nap-lang-btn[data-lang="fr"]:hover {
  background: rgba(91, 140, 255, 0.3);
}

.nap-lang-btn[data-lang="es"]:hover {
  background: rgba(255, 176, 32, 0.3);
}

.nap-lang-btn[data-lang="de"]:hover {
  background: rgba(255, 107, 107, 0.3);
}

.nap-lang-btn[data-lang="it"]:hover {
  background: rgba(61, 214, 140, 0.3);
}

.nap-lang-flag {
  font-size: 18px;
  line-height: 1;
}

.nap-google-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.nap-google-btn:hover {
  background: rgba(255, 255, 255, 0.92);
}

.nap-google-btn:active {
  transform: scale(0.98);
}

.nap-google-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.nap-google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nap-onboard-error {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: #ff6961;
}

.nap-cards-chip {
  margin-left: auto;
  display: block;
  border: none;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.nap-line-panel {
  margin-top: 10px;
  opacity: 0.96;
  animation: nap-line-in 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes nap-line-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.96;
  }
}

.nap-line-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Explain panel ---------- */

.nap-explain-panel {
  pointer-events: auto;
  position: relative;
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 18px 20px 16px;
  animation: nap-card-in 160ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.nap-explain-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nap-explain-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.nap-explain-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nap-explain-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nap-explain-close:active {
  transform: scale(0.9);
}

.nap-explain-sentence {
  margin: 10px 0 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.nap-explain-body {
  max-height: 58vh;
  overflow-y: auto;
  /* Long words and wide tables wrap; the panel never scrolls sideways. */
  overflow-x: hidden;
  overscroll-behavior: contain;
  margin-top: 14px;
  padding-right: 4px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

.nap-explain-body::-webkit-scrollbar {
  width: 6px;
}

.nap-explain-body::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
}

/* A caret while tokens are still arriving. */
.nap-explain-body.is-streaming > :last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: #e50914;
  animation: nap-explain-caret 900ms steps(2, start) infinite;
}

@keyframes nap-explain-caret {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.nap-explain-thinking {
  margin: 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  animation: nap-explain-pulse 1400ms ease-in-out infinite;
}

@keyframes nap-explain-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

.nap-explain-error {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #ff6961;
}

.nap-explain-body h1,
.nap-explain-body h2,
.nap-explain-body h3,
.nap-explain-body h4,
.nap-explain-body h5,
.nap-explain-body h6 {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.nap-explain-body > :first-child {
  margin-top: 0;
}

.nap-explain-body p {
  margin: 0 0 10px;
}

.nap-explain-body strong {
  color: #fff;
  font-weight: 700;
}

.nap-explain-body em {
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
}

.nap-explain-body ul,
.nap-explain-body ol {
  margin: 0 0 8px;
  padding-left: 18px;
}

.nap-explain-body li {
  margin: 0 0 4px;
}

.nap-explain-body ul ul,
.nap-explain-body ol ol,
.nap-explain-body ul ol,
.nap-explain-body ol ul {
  margin: 4px 0 0;
}

.nap-explain-body code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.nap-explain-body pre {
  margin: 0 0 8px;
  padding: 8px 10px;
  overflow-x: auto;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.nap-explain-body pre code {
  padding: 0;
  background: none;
}

.nap-explain-body blockquote {
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(229, 9, 20, 0.6);
  color: rgba(255, 255, 255, 0.7);
}

.nap-explain-body hr {
  margin: 12px 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nap-explain-body a {
  color: #6fb3ff;
}

.nap-explain-body table {
  width: 100%;
  margin: 0 0 8px;
  border-collapse: collapse;
  font-size: 15px;
}

.nap-explain-body th,
.nap-explain-body td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  overflow-wrap: anywhere;
}

/* The word itself should stay on one line; the prose columns absorb the wrap. */
.nap-explain-body td:first-child {
  white-space: nowrap;
  color: #fff;
}

.nap-explain-body th {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Follow-up questions ---------- */

.nap-explain-followups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 260ms ease,
    transform 260ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nap-explain-followups:empty {
  margin-top: 0;
}

.nap-explain-followups.is-ready {
  opacity: 1;
  transform: none;
}

.nap-explain-followup {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nap-explain-followup:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.nap-explain-followup:active {
  transform: scale(0.99);
}

/* Deliberately quiet: the custom question is a last resort, not the headline. */
.nap-explain-ask {
  align-self: flex-start;
  width: auto;
  padding: 4px 2px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  font-weight: 600;
}

.nap-explain-ask:hover {
  background: none;
  color: rgba(255, 255, 255, 0.7);
}

.nap-explain-ask-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nap-explain-ask-form[hidden] {
  display: none;
}

.nap-explain-ask-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
}

.nap-explain-ask-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.nap-explain-ask-input:focus {
  outline: none;
  border-color: rgba(229, 9, 20, 0.7);
}

.nap-explain-ask-send {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #e50914;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.nap-explain-ask-send:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .nap-explain-panel,
  .nap-explain-followups,
  .nap-explain-thinking,
  .nap-explain-body.is-streaming > :last-child::after {
    animation: none;
    transition: none;
  }

  .nap-explain-followups {
    opacity: 1;
    transform: none;
  }
}
