:root {
  --ink: #20332d;
  --teal: #176657;
  --coral: #d76a50;
  --line: #e5e8e1;
  --muted: #6d7d74;
  --paper: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6f7f2;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--teal);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
button:hover { background: #f0f5f1; border-color: #cbd8cf; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #58a895;
  outline-offset: 3px;
}
header {
  max-width: 1360px;
  margin: auto;
  padding: 23px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { color: var(--teal); text-decoration: none; font-size: 27px; font-weight: 750; letter-spacing: -1px; }
.brand span { margin-left: 12px; font-size: 12px; font-weight: 500; letter-spacing: .1px; color: var(--muted); }
.draft { max-width: 340px; padding: 6px 10px; border-radius: 6px; font-size: 11px; line-height: 1.5; color: #7b7057; background: #eeeade; }
main { max-width: 1280px; margin: 28px auto 0; padding: 0 40px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 12px; font-size: 10px; font-weight: 650; letter-spacing: 1.5px; color: var(--teal); }
h1 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 39px); line-height: 1.15; font-weight: 650; letter-spacing: -1.2px; }
.sub { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.back { flex-shrink: 0; font-size: 12px; color: var(--muted); text-underline-offset: 4px; }
.example-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.example-picker select { width: 340px; max-width: 100%; min-width: 0; padding: 11px 14px; border: 1px solid #dce1d7; border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 13px; }
.lesson { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 30px #243d2b04; padding: 24px 32px; }
.toolbar { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.levels { display: flex; gap: 3px; padding: 4px; background: #f2f5f0; border-radius: 11px; }
.levels button { border: 0; background: transparent; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 10px 14px; }
.levels [aria-pressed=true] { background: var(--teal); color: white; box-shadow: 0 2px 4px #163d2220; }
.earlier { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.earlier select { min-height: 40px; max-width: 140px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 11px; }
#review-mode { font-size: 12px; }
.focusbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; background: #fffffff5; backdrop-filter: blur(12px); border-bottom: 1px solid #eef0eb; }
.focusbar p { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.7; color: var(--muted); }
.focusbar strong { color: var(--ink); font-weight: 650; }
.transport { flex-shrink: 0; display: flex; gap: 6px; }
.transport button { min-width: 44px; padding: 10px 14px; font-size: 12px; }
.primary { color: white; background: var(--teal); border-color: var(--teal); }
.primary:hover { background: #125344; border-color: #125344; }
.transport [aria-pressed=true], .practice-controls [aria-pressed=true], #review-mode[aria-pressed=true] { background: #e6f0e9; border-color: #88b3a4; color: var(--teal); }
.listening-legend { display: flex; flex-wrap: wrap; gap: 9px 22px; margin: 20px 0 8px; font-size: 11px; font-weight: 600; }
.inventory-note { max-width: 820px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.script { padding: 22px 0 20px; }
.thought { position: relative; isolation: isolate; padding: 62px 16px 32px; margin: 0 -16px; border-bottom: 1px solid #f0f1ec; border-radius: 10px; scroll-margin-top: 96px; transition: background .2s; }
.thought:last-child { border-bottom: 0; }
.thought.active { background: #f5f8f3; }
.thought:not(.active) .word { color: #64766b; }
.words { display: flex; flex-wrap: wrap; column-gap: .24em; row-gap: 76px; font-size: clamp(28px, 3vw, 36px); line-height: 1.35; letter-spacing: -.7px; }
.word { display: inline-block; max-width: 100%; position: relative; white-space: nowrap; font-weight: 400; transition: color .2s; }
.word.playing { background: #dcece0; border-radius: 4px; color: var(--teal); }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; color: var(--coral); z-index: 2; }
.annotation { pointer-events: all; cursor: pointer; color: var(--coral); outline: none; }
.annotation path, .annotation line { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.annotation text { fill: currentColor; font-family: Arial, sans-serif; font-size: 16px; letter-spacing: 0; font-weight: 500; }
.annotation .hit { stroke: transparent; stroke-width: 22; }
.annotation:focus path, .annotation:hover path, .annotation.selected path { stroke-width: 3.5; }
.annotation:focus text, .annotation:hover text { font-weight: 700; }
.annotation.selected { filter: drop-shadow(0 0 2px #125e5033); }
.annotation.rejected { opacity: .35; }
.annotation.listening-not_heard path:not(.hit) { stroke-dasharray: 7 4; }
.annotation.listening-uncertain path:not(.hit) { stroke-dasharray: 3 3; }
.helper { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 0 15px; }
.helper p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.helper button { flex-shrink: 0; font-size: 12px; border-color: transparent; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1.6; }
.annotation-key, #candidates, #pitch-discovery { border-top: 1px solid var(--line); padding: 16px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px 23px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.legend b { margin-right: 6px; color: var(--coral); font-size: 17px; font-weight: 500; }
#candidates > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
#candidate-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#candidate-list button { font-size: 12px; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
#candidate-list button[aria-pressed=true] { border-color: var(--teal); background: #edf5ee; }
#explanation { display: flex; align-items: flex-start; gap: 20px; margin: 0 0 20px; padding: 24px; border: 1px solid #dce7df; border-radius: 12px; background: #fafcf9; }
#explanation[hidden] { display: none; }
#explanation h2 { margin: 14px 0 8px; font-size: 19px; letter-spacing: -.3px; font-weight: 650; }
#explanation p { max-width: 740px; margin: 5px 0; font-size: 13px; line-height: 1.7; }
#explanation .source { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
#close { min-width: 40px; min-height: 40px; padding: 0; border: 0; background: transparent; font-size: 24px; }
.practice-content { width: 100%; min-width: 0; }
.practice-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; margin: 24px 0; }
.practice-field h3, .review-form h3 { margin: 0 0 6px; color: var(--muted); font-size: 10px; line-height: 1.6; text-transform: uppercase; letter-spacing: .7px; }
.practice-field.realization p { color: var(--teal); font-size: 21px !important; font-weight: 600; }
.practice-controls { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 18px; }
.practice-controls button, .review-toggle { font-size: 12px; }
.cue-status { display: inline-block; padding: 5px 9px; border-radius: 4px; background: #f1eee3; color: #776445; letter-spacing: .2px; font-size: 10px !important; }
.status-approved { background: #e4f0e7; color: var(--teal); }
.status-rejected { background: #f5e6e0; }
.review-toggle { margin-top: 14px; }
.review-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.review-form h3, .review-form .source { grid-column: 1 / -1; }
.review-form label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; }
.review-form textarea, .review-form input, .review-form select { width: 100%; min-width: 0; padding: 10px; border: 1px solid #d6dfd4; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 13px; }
.review-form textarea { resize: vertical; }
.review-form button { align-self: end; }
#review-message { color: var(--teal); }
.pitch-discovery-controls { display: flex; flex-wrap: wrap; gap: 20px; margin: 18px 0; font-size: 12px; }
.pitch-discovery-controls select { max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.pitch-discovery-content p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.pitch-candidate { display: flex; align-items: center; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.pitch-candidate > div { flex: 1; min-width: 0; }
.pitch-candidate svg { width: 180px; height: 72px; color: var(--coral); }
.pitch-candidate button { font-size: 12px; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 22px 3px 35px; color: var(--muted); font-size: 11px; line-height: 1.7; }
footer details { max-width: 480px; }
footer summary { text-align: right; font-size: 11px; }
footer p { margin-top: 10px; }
@media (max-width: 980px) {
  .toolbar { flex-wrap: wrap; gap: 12px; }
  .earlier { margin-left: auto; }
  #review-mode { padding: 10px; }
  .levels button { padding: 10px; }
}
@media (max-width: 740px) {
  header { padding: 18px 20px; }
  .brand span { font-size: 11px; margin-left: 8px; }
  .draft { max-width: 150px; font-size: 10px; }
  main { margin-top: 20px; padding: 0 18px; }
  .intro { display: block; margin-bottom: 20px; }
  h1 { font-size: 30px; }
  .sub { font-size: 13px; }
  .back { display: inline-block; margin-top: 14px; font-size: 11px; }
  .example-picker { align-items: stretch; flex-direction: column; gap: 8px; }
  .example-picker select { width: 100%; }
  .lesson { padding: 18px; border-radius: 14px; }
  .levels { width: 100%; }
  .levels button { flex: 1; padding: 10px 7px; font-size: 11px; }
  .earlier { margin-left: 0; }
  #review-mode { margin-left: auto; }
  .focusbar { flex-wrap: wrap; gap: 10px; padding: 14px 0; }
  .focusbar p { flex-basis: 100%; }
  .transport { width: 100%; gap: 6px; }
  .transport #listen, .transport #repeat { flex: 1; }
  .listening-legend { gap: 9px 14px; margin-top: 16px; }
  .inventory-note { font-size: 10px; }
  .thought { margin: 0 -8px; padding-left: 8px; padding-right: 8px; scroll-margin-top: 125px; }
  .words { font-size: 28px; letter-spacing: -.5px; }
  .helper { align-items: flex-start; gap: 8px; }
  .helper p { font-size: 11px; }
  .helper button { font-size: 11px; padding: 8px; }
  #explanation { padding: 17px; gap: 8px; }
  .practice-fields, .review-form { grid-template-columns: 1fr; }
  .practice-fields { gap: 18px; }
  .review-form { padding: 14px; }
  .pitch-candidate { flex-wrap: wrap; gap: 10px; }
  .pitch-candidate > div { flex-basis: 100%; }
  .pitch-candidate svg { width: 135px; }
  footer { display: block; padding-bottom: 25px; }
  footer details { margin-top: 10px; }
  footer summary { text-align: left; }
}
@media (max-width: 390px) {
  main { padding: 0 12px; }
  header { padding: 16px; }
  .lesson { padding: 14px; }
  .brand span { display: none; }
  .earlier { gap: 5px; font-size: 10px; }
  .earlier select { max-width: 119px; }
  #review-mode { padding: 8px; font-size: 11px; }
  .levels button { font-size: 10px; padding: 10px 5px; }
  .transport button { padding: 10px; }
  .helper { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  button, .word, .thought { transition: none; }
}
