/* ==========================================================================
   Speech results — light theme (design_handoff_speech_results).

   Loaded by index.html only, after speech-setup-live.css. Every rule is
   scoped to the light theme on the Speech results screen, so Shadow
   Interview / Shadow Pitch (separate pages) and dark Speech are untouched.

   Scope: html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container
   That carries an id, so it beats the dark base rules in
   speech-mode-results.css without !important. Dark-only rules that used to
   leak white text into light (speech-rehearsal.css) are now guarded with
   :where(html:not([data-kouli-theme='light'])) at the source.

   Colour contract: one teal element (the Talk mic disc). Amber marks
   problems only. No white text on light surfaces.
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Tokens                                                                   */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results {
  --sr-page: #F4F0EB;
  --sr-card: #FAF8F5;
  --sr-border: #E8E3DC;
  --sr-divider: #EFEAE3;
  --sr-chip-border: #E2DCD3;
  --sr-neutral: #EDE8E1;
  --sr-inset: #F1ECE5;
  --sr-skeleton: #EAE4DB;
  --sr-ink: #1E2224;
  --sr-body: #4A4743;
  --sr-muted: #6B6762;
  --sr-faint: #8C8781;
  --sr-strike: #B9B2A9;
  --sr-bar-past: #DDD6CC;
  --sr-teal: #0F6B5C;
  --sr-amber: #8A5A1E;
  --sr-amber-mark: #C9A25A;
  --sr-slate: #6E8496;
  --sr-slate-fill: #A9B8C4;
  --sr-video: #2B2E2F;
  --sr-sans: Inter, system-ui, -apple-system, sans-serif;
  --sr-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sr-flip-ease: cubic-bezier(.2, .8, .2, 1);
}

/* -------------------------------------------------------------------------- */
/* 2. Page + column                                                            */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-mode-page {
  background: var(--sr-page);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: transparent;
  color: var(--sr-ink);
  font-family: var(--sr-sans);
  text-align: left;
  overflow-x: hidden;
}

/* index.html carries inline style="" margins/padding/max-width on the results
   container and its sections; !important is the only way past an inline
   attribute, so it is used for those layout properties and nothing else. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container {
  max-width: 100% !important;
  padding: 0 16px calc(84px + env(safe-area-inset-bottom, 0px)) !important;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container > * {
  margin: 0 !important;
  padding: 0 !important;
}

/* Card stack: Talk/Quick read → As Delivered → Replay (video). */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-score-section { order: 1 !important; }
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-analysis-cards {
  order: 2 !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px !important;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-speech-replay-slot { order: 3 !important; }
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-transcription-section { order: 4 !important; }
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-audio-player-section,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-feedback-summary-section {
  order: 5 !important;
}

/* The score section holds top bar + Talk + Quick read; same rhythm as the page. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-redesign,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-coach-first {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  max-width: none;
  background: transparent;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-coach-cards {
  display: block;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container {
    max-width: 552px !important; /* 520px column + 16px side padding */
    gap: 14px;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-redesign,
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-coach-first,
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-analysis-cards {
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  /* No bottom nav on desktop. */
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* -------------------------------------------------------------------------- */
/* 3. Card shell (every card except Talk)                                      */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  perspective: 1400px;
  color: var(--sr-ink);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition:
    transform 420ms var(--sr-flip-ease),
    height 420ms var(--sr-flip-ease);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-front,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-back,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-card {
  /* Override speech-mode-results.css absolute + backface-hidden — those leave
     Replay <video> black in Chromium (compositor / preserve-3d). */
  position: relative !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--sr-border);
  border-radius: 20px;
  background: var(--sr-card);
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
  text-align: left;
  color: var(--sr-ink);
  transform: none !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
}

/* Flat swap instead of rotateY so video paints immediately. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-inner {
  transform: none !important;
  transform-style: flat !important;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card .ted-flip-card-back {
  display: none !important;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card.is-flipped .ted-flip-card-front {
  display: none !important;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card.is-flipped .ted-flip-card-back {
  display: flex !important;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card:focus-visible .ted-flip-card-inner {
  border-radius: 20px;
  box-shadow: 0 0 0 2px var(--sr-page), 0 0 0 4px var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  min-width: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-kicker,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-results-card-kicker,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-delivered-kicker,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-replay-card-kicker {
  display: block;
  margin: 0;
  width: auto;
  font-family: var(--sr-sans);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--sr-muted);
  outline: none;
}

/* Footers: front "See the …" and back "← Back". */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-foot {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: auto 0 0;
  padding: 0 20px;
  border: 0;
  border-top: 1px solid var(--sr-divider);
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--sr-ink);
  cursor: pointer;
  user-select: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-foot-icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container button.sr-foot:hover,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container button.sr-foot:focus-visible {
  background: var(--sr-inset);
  outline: none;
}

/* Base button reset inside results: the light layer paints every <button>
   teal and app CSS adds a 44px min-height. Component rules below restyle. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container button {
  min-height: 0;
  background: transparent;
  color: var(--sr-ink);
  box-shadow: none;
  text-shadow: none;
}

/* Shared serif lines */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-serif {
  font-family: var(--sr-serif);
  font-weight: 500;
  color: var(--sr-ink);
  letter-spacing: 0;
  text-wrap: pretty;
}

/* Skeleton */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-skel {
  display: inline-block;
  border-radius: 6px;
  background: var(--sr-skeleton);
  color: transparent;
  animation: sr-skel-pulse 1.4s ease-in-out infinite;
}

@keyframes sr-skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* Reduced motion: 150ms cross-fade instead of rotateY. */
@media (prefers-reduced-motion: reduce) {
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-inner {
    transform: none !important;
    transition: height 150ms linear;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-front,
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card-back {
    transform: none !important;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    transition: opacity 150ms linear, visibility 0s linear 150ms;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card .ted-flip-card-back,
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card.is-flipped .ted-flip-card-front {
    opacity: 0;
    visibility: hidden;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card .ted-flip-card-front,
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-flip-card.is-flipped .ted-flip-card-back {
    opacity: 1;
    visibility: visible;
    transition: opacity 150ms linear, visibility 0s;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-skel {
    animation: none;
  }
}

/* -------------------------------------------------------------------------- */
/* 4. Top bar, heading, meta                                                   */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 0;
  box-sizing: content-box;
  background: transparent;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar-left {
  display: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-wordmark {
  font-family: var(--sr-sans);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--sr-ink);
  text-shadow: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar-right {
  display: flex;
  justify-content: flex-end;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--sr-chip-border);
  border-radius: 999px;
  background: transparent;
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sr-body);
  cursor: default;
  width: auto;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin: 0;
  padding: 0 14px 0 12px;
  border: 1px solid var(--sr-border);
  border-radius: 999px;
  background: var(--sr-card);
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--sr-ink);
  cursor: pointer;
  width: auto;
  box-shadow: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-home:hover,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-home:focus-visible {
  background: var(--sr-inset);
  outline: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-title {
  display: none;
  margin: 0;
  font-family: var(--sr-serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-meta {
  margin: 0;
  font-family: var(--sr-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--sr-muted);
}

@media (min-width: 768px) {
  /* Centred 520px column; the top bar runs full width above it. */
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container {
    max-width: none !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container > * {
    width: 100%;
    max-width: 520px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container > #ted-score-section {
    max-width: none;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-score > * {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-score > .sr-topbar {
    max-width: none;
  }
}

@media (min-width: 1024px) {
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    height: 76px;
    min-height: 76px;
    margin: 0 -24px 8px;
    padding: 0 40px;
    box-sizing: border-box;
    width: calc(100% + 48px);
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-score > .sr-topbar {
    max-width: none;
    margin-left: -24px;
    margin-right: -24px;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar-left {
    display: flex;
    justify-content: flex-start;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-topbar .sr-home {
    display: inline-flex !important; /* beats speech-setup-live.css phone hide */
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-title {
    display: block;
  }
  html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-heading {
    margin-bottom: 6px;
  }
}

/* -------------------------------------------------------------------------- */
/* 5. Talk to KoLi                                                             */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-talk {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 20px 28px;
  border: 1px solid var(--sr-border);
  border-radius: 24px;
  background: var(--sr-card);
  overflow: hidden;
  isolation: isolate;
  box-sizing: border-box;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-talk-mist {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(30% 55% at 22% 105%, rgba(150, 205, 205, .5), transparent 70%),
    radial-gradient(28% 50% at 48% 95%, rgba(210, 215, 160, .55), transparent 70%),
    radial-gradient(30% 55% at 76% 105%, rgba(150, 210, 205, .45), transparent 70%),
    radial-gradient(26% 45% at 60% 70%, rgba(250, 215, 190, .4), transparent 70%);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .kouli-mist-button.sr-talk-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: auto;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0 28px 0 9px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(40, 60, 55, .1), inset 0 1px 0 #fff;
  color: var(--sr-ink);
  cursor: pointer;
  font-family: var(--sr-sans);
  transition: transform 120ms ease, box-shadow 160ms ease;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .kouli-mist-button.sr-talk-btn:hover {
  box-shadow: 0 10px 28px rgba(40, 60, 55, .14), inset 0 1px 0 #fff;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .kouli-mist-button.sr-talk-btn:active {
  transform: scale(.98);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .kouli-mist-button.sr-talk-btn:focus-visible {
  outline: 2px solid var(--sr-ink);
  outline-offset: 3px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-talk-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sr-teal);
  color: #fff;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-talk-disc .sr-icon {
  width: 19px;
  height: 19px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .kouli-mist-label.sr-talk-label {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-shadow: none;
  font-family: var(--sr-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-talk-help {
  max-width: 280px;
  margin: 0;
  font-family: var(--sr-sans);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: #3F3C39;
}

/* -------------------------------------------------------------------------- */
/* 6. Quick read — front                                                       */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .ted-kouli-read-card .sr-verdict {
  max-width: none;
  margin: 8px 0 0;
  font-family: var(--sr-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: left;
  text-wrap: pretty;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--sr-neutral);
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sr-ink);
  box-shadow: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pill .sr-icon {
  width: 14px;
  height: 14px;
  margin-left: -2px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-delta {
  font-family: var(--sr-sans);
  font-size: 13px;
  color: var(--sr-muted);
}

/* -------------------------------------------------------------------------- */
/* 7. Quick read — back ("This take")                                          */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-read-back {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-back-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-back-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-overall {
  font-family: var(--sr-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--sr-ink);
  font-variant-numeric: tabular-nums;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-back-delta {
  font-family: var(--sr-sans);
  font-size: 13px;
  color: var(--sr-muted);
  text-align: right;
  white-space: nowrap;
}

/* Take history */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-history {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 0;
  padding: 0 0 16px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-history-cols {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 36px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col-score {
  font-family: var(--sr-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col-bar {
  display: block;
  width: 20px;
  border-radius: 5px;
  background: var(--sr-bar-past);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col-label {
  font-family: var(--sr-sans);
  font-size: 11px;
  color: var(--sr-muted);
  white-space: nowrap;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col.is-now .sr-col-score {
  font-weight: 600;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-col.is-now .sr-col-bar {
  background: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-history-sum {
  max-width: 150px;
  margin: 0;
  font-family: var(--sr-sans);
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
  color: var(--sr-body);
}

/* Pillar rows */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillars {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 14px 0 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-history + .sr-pillars {
  margin-top: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--sr-divider);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar:last-child {
  padding-bottom: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 28px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-name {
  flex: 1 1 auto;
  font-family: var(--sr-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-change {
  font-family: var(--sr-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-change.is-up {
  font-weight: 600;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-change.is-down {
  font-weight: 600;
  color: var(--sr-amber);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-score {
  min-width: 2ch;
  font-family: var(--sr-sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-score.is-empty {
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar.is-weak .sr-pillar-score,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar.is-weak .sr-pillar-tip {
  color: var(--sr-amber);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-tip {
  margin: 0;
  font-family: var(--sr-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--sr-body);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-pillar-subs {
  margin: 0;
  font-family: var(--sr-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-skel--score {
  width: 30px;
  height: 22px;
  vertical-align: middle;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-skel--line {
  width: 190px;
  max-width: 100%;
  height: 13px;
  vertical-align: middle;
}

/* -------------------------------------------------------------------------- */
/* 8. As delivered — front                                                     */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-delivered .sr-line {
  margin: 8px 0 0;
  font-family: var(--sr-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-wrap: pretty;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-note {
  margin: 10px 0 0;
  font-family: var(--sr-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 18px 0 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-stat-num {
  font-family: var(--sr-sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-stat-label {
  font-family: var(--sr-sans);
  font-size: 12px;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-stat.is-warn .sr-stat-num {
  color: var(--sr-amber);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-try-btn.sr-try {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  width: auto;
  height: 44px;
  margin: 20px 0 0;
  padding: 0 18px;
  border: 1px solid var(--sr-ink);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-family: var(--sr-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--sr-ink);
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-try-btn.sr-try:hover,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-try-btn.sr-try:focus-visible {
  background: var(--sr-inset);
  outline: none;
}

/* -------------------------------------------------------------------------- */
/* 9. As delivered — back ("The words")                                        */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-words-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-words-meta {
  font-family: var(--sr-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--sr-muted);
  white-space: nowrap;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-as-toggle.sr-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 220px;
  height: 36px;
  margin: 14px 0 0;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: var(--sr-neutral);
  box-sizing: border-box;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-seg .speech-as-toggle-btn {
  width: auto;
  height: 30px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-family: var(--sr-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--sr-ink);
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-seg .speech-as-toggle-btn.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  font-weight: 600;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-seg .speech-as-toggle-btn:focus-visible {
  outline: 2px solid var(--sr-ink);
  outline-offset: 1px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0 0;
  font-family: var(--sr-sans);
  font-size: 12px;
  color: var(--sr-body);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-legend-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-legend .speech-mark {
  font-family: var(--sr-serif);
  font-size: 14px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-words-panel {
  width: 100%;
  margin: 14px 0 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-words-panel[hidden],
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container [data-speech-take-chrome][hidden] {
  display: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-transcript {
  margin: 0;
  font-family: var(--sr-serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--sr-ink);
  white-space: normal;
}

/* Marks: fillers and hedges struck in amber; off-script dotted slate. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-mark {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-mark--hesitation,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-mark--hedge {
  color: var(--sr-amber);
  text-decoration: line-through;
  text-decoration-color: var(--sr-amber-mark);
  text-decoration-thickness: 2px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-mark--offscript {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--sr-slate);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-script-line.is-skipped {
  color: var(--sr-faint);
  text-decoration: line-through;
  text-decoration-color: var(--sr-strike);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-insight {
  width: 100%;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--sr-inset);
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--sr-body);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-insight[hidden] {
  display: none;
}

/* Time on each slide */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-slide-timing--compact.sr-slides {
  width: 100%;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--sr-divider);
  border-radius: 0;
  background: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slides .speech-slide-timing-title {
  margin: 0 0 4px;
  font-family: var(--sr-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slides .speech-slide-timing-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sr-sans);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-row.is-extra {
  display: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slides.is-expanded .sr-slide-row.is-extra {
  display: flex;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-n {
  flex: none;
  width: 56px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-t {
  flex: none;
  width: 40px;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-flag {
  font-size: 13px;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-slide-flag.is-warn {
  color: var(--sr-amber);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-show-all {
  width: auto;
  height: 36px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-family: var(--sr-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--sr-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-show-all[hidden] {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* 10. Replay — front (video + audio-only)                                     */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-replay-stack {
  display: block;
  margin: 0;
  padding: 0;
  background: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-replay-card.sr-replay {
  background: transparent;
  background-image: none;
  border: 0;
  box-shadow: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-title {
  margin: 8px 0 0;
  font-family: var(--sr-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 16px 0 0;
  border-radius: 14px;
  background: var(--sr-video);
  overflow: hidden;
  cursor: default;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--video .sr-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  background: var(--sr-video);
  cursor: pointer;
}

/* Native controls path — video must not be position:absolute under a
   zero-height compositor layer or it stays black. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--native {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--sr-video);
  border-radius: 14px;
  overflow: hidden;
}
/* Gate state: center the quiet play control on the stage. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--native:has(.sr-replay-gate-btn) {
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio.sr-player--native {
  aspect-ratio: auto;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(12, 19, 24, 0.04);
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--native .sr-video,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--native video {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
  background: #111;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--native audio {
  width: 100%;
  margin-top: 0;
}
/* Neutral play gate — teal is reserved for Talk to KoLi on this screen. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(247, 243, 238, 0.82);
  font-family: var(--sr-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(247, 243, 238, 0.94);
  color: var(--sr-ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn .sr-icon--play {
  width: 22px;
  height: 22px;
  margin-left: 2px; /* optically center the triangle */
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-label {
  font: inherit;
  color: inherit;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn:hover .sr-replay-gate-disc,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn:focus-visible .sr-replay-gate-disc {
  background: #fff;
  transform: scale(1.04);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn:focus-visible {
  outline: none;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-gate-btn:focus-visible .sr-replay-gate-disc {
  outline: 2px solid #00E5C0;
  outline-offset: 3px;
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio .sr-replay-gate-btn {
  color: rgba(30, 34, 36, 0.62);
}
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio .sr-replay-gate-disc {
  background: #fff;
  box-shadow: 0 6px 18px rgba(40, 28, 15, 0.12);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-big {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--sr-ink);
  cursor: pointer;
  transition: opacity 160ms ease;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-big .sr-icon,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-disc .sr-icon {
  width: 22px;
  height: 22px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player .sr-icon--pause,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player.is-playing .sr-icon--play {
  display: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player.is-playing .sr-icon--pause {
  display: block;
}

/* Video: hide the big button while playing, show it again on hover/focus. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--video.is-playing .sr-player-big {
  opacity: 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--video.is-playing:hover .sr-player-big,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--video .sr-player-big:focus-visible {
  opacity: 1;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-big:focus-visible,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-disc:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent);
  font-family: var(--sr-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-track {
  position: relative;
  flex: 1 1 auto;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
}

/* Taller hit area for the 3px track. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  bottom: -10px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-track:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 3px;
  background: #fff;
}

/* Audio-only strip */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  margin: 16px 0 0;
  padding: 0 16px 0 8px;
  border-radius: 14px;
  background: var(--sr-inset);
  box-sizing: border-box;
  font-family: var(--sr-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio audio {
  display: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sr-ink);
  color: #fff;
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-disc .sr-icon {
  width: 18px;
  height: 18px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player-disc:focus-visible {
  outline-color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio .sr-player-track {
  background: var(--sr-chip-border);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-player--audio .sr-player-fill {
  background: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-replay-note {
  margin: 12px 0 0;
  font-family: var(--sr-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--sr-muted);
}

/* -------------------------------------------------------------------------- */
/* 11. Replay — back ("What KoLi heard")                                       */
/* -------------------------------------------------------------------------- */

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .speech-replay-annotations.sr-heard {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sr-ink);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-heard-stats {
  margin-top: 14px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-timeline {
  margin: 20px 0 0;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-tl-track {
  position: relative;
  height: 20px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-tl-base {
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 2px;
  background: var(--sr-chip-border);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-tl-pause {
  position: absolute;
  top: 7px;
  height: 6px;
  min-width: 4px;
  border-radius: 3px;
  background: var(--sr-slate-fill);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-tl-filler {
  position: absolute;
  top: 3px;
  width: 10px;
  height: 10px;
  margin-left: -7px;
  border: 2px solid var(--sr-card);
  border-radius: 50%;
  background: var(--sr-amber-mark);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-tl-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--sr-sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--sr-muted);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moments {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moments li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sr-divider);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--sr-sans);
  font-size: 14px;
  text-align: left;
  color: var(--sr-ink);
  cursor: pointer;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment:hover .sr-moment-label,
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment:focus-visible .sr-moment-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment:focus-visible {
  outline: 2px solid var(--sr-ink);
  outline-offset: -2px;
  border-radius: 6px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-t {
  flex: none;
  width: 40px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sr-slate);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-dot--filler {
  background: var(--sr-amber-mark);
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-approx {
  color: var(--sr-muted);
  font-size: 12px;
}

html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-moment-play {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--sr-muted);
}

/* -------------------------------------------------------------------------- */
/* 12. States                                                                  */
/* -------------------------------------------------------------------------- */

/* Take too short — the existing overlay, restyled as a calm card. */
html[data-kouli-theme='light'] #ted-too-short-overlay.ted-too-short {
  background: #F4F0EB;
  color: #1E2224;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  padding: 0 16px;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-card {
  width: 100%;
  max-width: 520px;
  align-items: flex-start;
  gap: 0;
  padding: 20px;
  border: 1px solid #E8E3DC;
  border-radius: 20px;
  background: #FAF8F5;
  box-sizing: border-box;
  text-align: left;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-card::before {
  content: 'Quick read';
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6B6762;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-label {
  margin: 8px 0 0;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  animation: none;
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  text-wrap: pretty;
  color: #1E2224;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-body {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4A4743;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-retry {
  display: inline-flex;
  width: auto;
  align-items: center;
  min-height: 0;
  height: 44px;
  margin: 20px 0 0;
  padding: 0 18px;
  border: 1px solid #1E2224;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #1E2224;
}

html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-retry:hover,
html[data-kouli-theme='light'] #ted-too-short-overlay .ted-too-short-retry:focus-visible {
  background: #F1ECE5;
  color: #1E2224;
  outline: none;
}

/* Quick read failed in the early shell: quiet retry, not a teal button. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container .sr-read-retry {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sr-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--sr-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* The Replay card is the player; the legacy audio bar never shows on results. */
html[data-kouli-theme='light'] body.kouli-speech-results #ted-results-container #ted-audio-player-section {
  display: none !important;
}
