:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #f1efe8;
  --ink: #16243a;
  --muted: #667085;
  --line: #dfe3e8;
  --teal: #177d78;
  --teal-dark: #0f625e;
  --teal-soft: #e4f3f1;
  --coral: #e86f5c;
  --coral-soft: #fff0ed;
  --yellow: #f6c65b;
  --yellow-soft: #fff7dc;
  --purple: #7268b0;
  --purple-soft: #eeebfa;
  --green: #287d5b;
  --green-soft: #e7f4ed;
  --shadow: 0 24px 70px rgb(42 56 72 / 12%);
  --reading-size: clamp(25px, 3.1vw, 37px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html[data-text-size='0'] {
  --reading-size: clamp(21px, 2.7vw, 31px);
}

html[data-text-size='2'] {
  --reading-size: clamp(30px, 3.7vw, 45px);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 9%, rgb(232 111 92 / 9%), transparent 25rem),
    radial-gradient(circle at 92% 28%, rgb(23 125 120 / 9%), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button,
a {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

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

.shell {
  width: min(1050px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgb(22 36 58 / 10%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.03em;
  text-decoration: none;
}

.brand strong {
  color: var(--teal);
}

.brand-mark {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 12px;
  background: var(--ink);
}

.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 4px;
  background: var(--yellow);
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(4) { height: 8px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; }

.header-actions,
.text-size,
.streak-badge {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 10px;
}

.text-size {
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 65%);
}

.text-size button {
  display: grid;
  min-width: 34px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.text-size button:hover:not(:disabled) {
  background: var(--surface-soft);
}

.text-size > span {
  color: var(--muted);
  font-size: 12px;
}

.streak-badge {
  gap: 7px;
  min-width: 81px;
  padding: 6px 10px;
  border: 1px solid #efd898;
  border-radius: 12px;
  background: var(--yellow-soft);
}

.streak-badge > span:first-child {
  font-size: 19px;
}

.streak-badge > span:last-child {
  display: grid;
  line-height: 1;
}

.streak-badge strong {
  font-size: 17px;
}

.streak-badge small {
  margin-top: 3px;
  color: #886c27;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-shell {
  padding-block: 60px 80px;
}

.intro {
  max-width: 780px;
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow,
.overline {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 9px 0 15px;
  font: 750 clamp(40px, 7vw, 72px)/.98 ui-serif, Georgia, 'Times New Roman', serif;
  letter-spacing: -.045em;
}

.intro h1 em {
  color: var(--teal);
  font-style: normal;
}

.intro > p:last-child {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

.practice-card,
.result-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(22 36 58 / 10%);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.practice-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--teal));
}

.card-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.level-picker {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.level-picker button {
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.level-picker button[aria-pressed='true'] {
  background: white;
  color: var(--teal-dark);
  box-shadow: 0 3px 10px rgb(42 56 72 / 9%);
}

.phrase-position {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--teal);
  font-size: 20px;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.reading-area {
  padding: 45px clamp(25px, 7vw, 75px) 40px;
}

.reading-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.difficulty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.reading-area blockquote {
  max-width: 880px;
  margin: 0 auto;
  color: var(--ink);
  font: 620 var(--reading-size)/1.48 ui-serif, Georgia, 'Times New Roman', serif;
  letter-spacing: -.018em;
  text-align: center;
  text-wrap: balance;
}

.listen-status {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 24px;
  border-block: 1px solid var(--line);
  background: #fafafa;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aab2be;
}

.is-recording .listen-status {
  border-color: #f2c8c1;
  background: var(--coral-soft);
  color: #9c473b;
}

.is-recording .status-indicator {
  background: var(--coral);
  animation: statusPulse 1.15s ease-out infinite;
}

.is-processing .listen-status {
  background: var(--purple-soft);
  color: #554d8a;
}

.live-transcript {
  margin: 18px 28px 0;
  padding: 12px 15px;
  border: 1px dashed #efb9b0;
  border-radius: 12px;
  background: #fffafa;
}

.live-transcript > span {
  display: block;
  margin-bottom: 4px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.live-transcript p {
  margin: 0;
  color: #785f5b;
  font-size: 13px;
}

.record-zone {
  display: grid;
  justify-items: center;
  padding: 28px;
}

.record-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: 15px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.record-button {
  min-width: 240px;
  padding: 13px 24px;
  border: 0;
  background: var(--teal);
  color: white;
  box-shadow: 0 11px 24px rgb(23 125 120 / 23%);
}

.record-button:hover:not(:disabled) {
  background: var(--teal-dark);
  box-shadow: 0 14px 28px rgb(23 125 120 / 29%);
  transform: translateY(-2px);
}

.record-button:active:not(:disabled),
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.record-icon {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.record-icon i {
  width: 10px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.record-icon::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 13px;
  top: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.record-icon::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 5px;
  top: 20px;
  background: currentColor;
}

.is-recording .record-button {
  background: var(--coral);
  box-shadow: 0 11px 24px rgb(232 111 92 / 24%);
}

.is-recording .record-icon i {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 3px;
  background: currentColor;
}

.is-recording .record-icon::before,
.is-recording .record-icon::after {
  display: none;
}

.is-recording .record-button::after {
  content: '';
  position: absolute;
  width: 245px;
  height: 64px;
  border: 1px solid var(--coral);
  border-radius: 20px;
  animation: buttonPulse 1.5s ease-out infinite;
  pointer-events: none;
}

.record-zone p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.compatibility-message {
  margin: 0 28px 28px;
  padding: 14px 16px;
  border: 1px solid #e5c67d;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: #70571d;
}

.compatibility-message strong,
.compatibility-message span {
  display: block;
}

.compatibility-message span {
  margin-top: 3px;
  font-size: 12px;
}

.model-loader {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(22 36 58 / 58%);
  backdrop-filter: blur(8px);
}

.model-loader[hidden] { display: none; }

.model-loader-card {
  width: min(470px, 100%);
  padding: clamp(26px, 6vw, 42px);
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(10 21 36 / 34%);
  text-align: center;
}

.local-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.model-loader-mark {
  display: flex;
  width: 62px;
  height: 62px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 18px auto;
  border-radius: 20px;
  background: var(--ink);
}

.model-loader-mark i {
  width: 4px;
  border-radius: 6px;
  background: var(--yellow);
  animation: modelWave 900ms ease-in-out infinite alternate;
}

.model-loader-mark i:nth-child(1) { height: 13px; }
.model-loader-mark i:nth-child(2) { height: 31px; animation-delay: 150ms; }
.model-loader-mark i:nth-child(3) { height: 23px; animation-delay: 300ms; }
.model-loader-mark i:nth-child(4) { height: 17px; animation-delay: 450ms; }

.model-loader h2 {
  margin: 0;
  font: 750 clamp(27px, 6vw, 36px)/1.08 ui-serif, Georgia, serif;
  letter-spacing: -.035em;
}

.model-loader-card > p {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.model-progress-track { position: relative; margin-top: 24px; }

.model-progress-track progress {
  display: block;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--teal-soft);
  appearance: none;
}

.model-progress-track progress::-webkit-progress-bar { border-radius: inherit; background: var(--teal-soft); }
.model-progress-track progress::-webkit-progress-value,
.model-progress-track progress::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--teal), #3da49e); }

.model-progress-track span {
  display: block;
  margin-top: 7px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.model-loader-card .model-loader-note { max-width: 360px; color: #758092; font-size: 11px; }
.model-loader-close { width: 100%; margin-top: 20px; }
.model-loader.has-error .model-loader-mark { background: #71372e; }
.model-loader.has-error .model-loader-mark i { animation: none; background: #ffd6cf; }

.result-card {
  padding: clamp(22px, 4vw, 42px);
}

.result-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.score-orbit {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--score) * 1%), var(--teal-soft) 0);
}

.score-orbit::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: white;
}

.score-inner {
  position: relative;
  display: flex;
  align-items: baseline;
}

.score-inner strong {
  font: 800 48px/1 ui-serif, Georgia, serif;
  letter-spacing: -.05em;
}

.score-inner span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
}

.result-heading h2 {
  margin: 4px 0 3px;
  font: 750 clamp(30px, 5vw, 45px)/1.1 ui-serif, Georgia, serif;
  letter-spacing: -.035em;
}

.stars {
  min-height: 29px;
  color: #e2a61f;
  font-size: 21px;
  letter-spacing: 2px;
}

.result-heading > p:last-child {
  max-width: 480px;
  margin: 5px 0 0;
  color: var(--muted);
}

.record-box {
  min-width: 150px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}

.record-box span,
.record-box small {
  display: block;
}

.record-box span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.record-box strong {
  display: block;
  margin: 4px 0;
  color: var(--teal);
  font: 800 34px/1 ui-serif, Georgia, serif;
}

.record-box small {
  color: var(--muted);
  font-size: 10px;
}

.record-box.is-new-record {
  border-color: #efd898;
  background: var(--yellow-soft);
}

.record-box.is-new-record strong,
.record-box.is-new-record small {
  color: #8b6711;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.metrics article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfcfb;
}

.metric-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 800;
}

.metrics article:nth-child(2) .metric-icon { background: var(--purple-soft); color: var(--purple); }
.metrics article:nth-child(3) .metric-icon { background: var(--green-soft); color: var(--green); }
.metrics article:nth-child(4) .metric-icon { background: var(--coral-soft); color: var(--coral); }

.metrics small,
.metrics strong {
  display: block;
}

.metrics small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics strong {
  overflow: hidden;
  margin-top: 2px;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics strong i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.reading-review {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fcfcfb;
}

.review-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.review-heading h3,
.score-breakdown h3 {
  margin: 3px 0 0;
  font: 750 22px/1.2 ui-serif, Georgia, serif;
}

.legend {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  list-style: none;
}

.legend i {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-right: 3px;
  border-radius: 5px;
  font-style: normal;
  font-weight: 800;
}

.legend-correct { background: var(--green-soft); color: var(--green); }
.legend-wrong { background: var(--yellow-soft); color: #8b6711; }
.legend-missed { background: var(--purple-soft); color: var(--purple); }

.annotated-text {
  margin: 0;
  font: 600 clamp(20px, 2.7vw, 28px)/1.85 ui-serif, Georgia, serif;
}

.word {
  position: relative;
  display: inline;
  padding: 2px 2px 3px;
  border-radius: 5px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.word::after {
  font: 800 9px/1 ui-sans-serif, system-ui, sans-serif;
  vertical-align: super;
}

.word-correct {
  background: var(--green-soft);
  color: #185f42;
  box-shadow: inset 0 -2px #7fbea2;
}

.word-correct::after { content: '✓'; }

.word-incorrect {
  background: var(--yellow-soft);
  color: #775716;
  box-shadow: inset 0 -2px #e1bd5c;
}

.word-incorrect::after { content: '≈'; }

.word-omitted {
  background: var(--purple-soft);
  color: #50477f;
  box-shadow: inset 0 -2px #a89fd4;
}

.word-omitted::after { content: '—'; }

.detected-transcript {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #cfdde5;
  border-radius: 14px;
  background: #f2f7f9;
}

.detected-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #dfecef;
  color: #2d6970;
  font: 700 28px/1 ui-serif, Georgia, serif;
}

.detected-transcript h4 {
  margin: 0 0 4px;
  color: #315f67;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.detected-transcript p {
  margin: 0;
  color: #344758;
  font-size: 12px;
  line-height: 1.55;
}

.extra-words {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.extra-words[hidden] {
  display: none;
}

.extra-words > strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.extra-words > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.extra-words span {
  padding: 3px 8px;
  border: 1px solid #efc4bc;
  border-radius: 999px;
  background: var(--coral-soft);
  color: #954d42;
  font-size: 12px;
}

.score-breakdown {
  margin-top: 20px;
  padding: 22px 25px;
  border-radius: 18px;
  background: var(--ink);
  color: white;
}

.score-breakdown h3 {
  margin-bottom: 15px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 150px 1fr 32px;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.breakdown-row > span {
  color: #edf2f7;
  font-size: 13px;
}

.breakdown-row small {
  color: #9da9b9;
}

.breakdown-row > div {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #344258;
}

.breakdown-row i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
  transition: width 600ms ease;
}

.breakdown-row strong {
  text-align: right;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.primary-button,
.secondary-button {
  min-height: 56px;
  padding: 12px 20px;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #b9c2cc;
  background: var(--surface-soft);
}

.is-perfect .score-orbit {
  background: conic-gradient(var(--yellow) 100%, var(--yellow-soft) 0);
  animation: perfectGlow 1.8s ease-in-out infinite alternate;
}

.celebration {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration span {
  position: absolute;
  top: -24px;
  left: var(--x);
  color: var(--coral);
  font-size: 13px;
  animation: confettiFall 2.1s var(--delay) cubic-bezier(.22, .61, .36, 1) forwards;
}

.celebration span:nth-child(3n) { color: var(--teal); }
.celebration span:nth-child(3n + 1) { color: #d7a322; }

.how-it-works {
  padding: 80px 0 5px;
  text-align: center;
}

.how-it-works h2 {
  margin: 5px 0 26px;
  font: 750 clamp(28px, 4vw, 38px)/1.15 ui-serif, Georgia, serif;
  letter-spacing: -.03em;
}

.how-it-works > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.how-it-works article {
  padding: 23px;
  border: 1px solid rgb(22 36 58 / 10%);
  border-radius: 18px;
  background: rgb(255 255 255 / 57%);
  text-align: left;
}

.how-it-works article > span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.how-it-works h3 {
  margin: 7px 0 2px;
  font: 750 21px ui-serif, Georgia, serif;
}

.how-it-works article p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgb(22 36 58 / 10%);
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(370px, calc(100% - 40px));
  padding: 13px 16px;
  border: 1px solid #3e4b5c;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  box-shadow: 0 15px 40px rgb(22 36 58 / 25%);
  font-size: 13px;
  animation: toastIn 220ms ease-out;
}

.toast[data-type='success'] {
  border-color: var(--green);
  background: #17553c;
}

.toast[data-type='error'] {
  border-color: var(--coral);
  background: #71372e;
}

.noscript {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border-radius: 10px;
  background: #71372e;
  color: white;
  text-align: center;
}

@keyframes statusPulse {
  from { box-shadow: 0 0 0 0 rgb(232 111 92 / 45%); }
  to { box-shadow: 0 0 0 8px rgb(232 111 92 / 0%); }
}

@keyframes buttonPulse {
  from { opacity: .65; transform: scale(.92); }
  to { opacity: 0; transform: scale(1.08); }
}

@keyframes confettiFall {
  0% { opacity: 0; transform: translate3d(0, -10px, 0) rotate(0); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 440px, 0) rotate(520deg); }
}

@keyframes perfectGlow {
  from { box-shadow: 0 0 0 0 rgb(246 198 91 / 10%); }
  to { box-shadow: 0 0 0 14px rgb(246 198 91 / 20%); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modelWave {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1); }
}

@media (max-width: 820px) {
  .app-shell {
    padding-top: 42px;
  }

  .result-hero {
    grid-template-columns: auto 1fr;
  }

  .record-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  .record-box strong {
    margin: 0;
    text-align: center;
  }

  .record-box small {
    text-align: right;
  }

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

  .review-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1050px);
  }

  .topbar {
    min-height: 70px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .text-size > span {
    display: none;
  }

  .streak-badge {
    min-width: 65px;
  }

  .app-shell {
    padding-block: 34px 55px;
  }

  .intro {
    margin-bottom: 25px;
  }

  .intro h1 {
    font-size: clamp(38px, 12vw, 55px);
  }

  .practice-card,
  .result-card {
    border-radius: 20px;
  }

  .card-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    padding: 22px 18px 16px;
  }

  .level-picker button {
    flex: 1;
    padding-inline: 8px;
  }

  .phrase-position {
    justify-content: space-between;
  }

  .reading-area {
    padding: 35px 18px 31px;
  }

  .reading-area blockquote {
    line-height: 1.43;
  }

  .listen-status {
    align-items: flex-start;
    padding: 12px 16px;
    text-align: left;
  }

  .status-indicator {
    margin-top: 6px;
  }

  .live-transcript {
    margin-inline: 16px;
  }

  .record-zone {
    padding: 25px 16px;
  }

  .record-button {
    width: 100%;
  }

  .is-recording .record-button::after {
    width: calc(100% - 22px);
  }

  .compatibility-message {
    margin-inline: 16px;
  }

  .result-card {
    padding: 18px;
  }

  .result-hero {
    grid-template-columns: 1fr;
    gap: 15px;
    justify-items: center;
    text-align: center;
  }

  .score-orbit {
    width: 135px;
    height: 135px;
  }

  .record-box {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .reading-review,
  .score-breakdown {
    padding: 18px;
  }

  .legend {
    gap: 8px;
  }

  .extra-words {
    align-items: flex-start;
    flex-direction: column;
  }

  .detected-transcript {
    grid-template-columns: 32px 1fr;
    padding: 14px;
  }

  .detected-icon {
    width: 32px;
    height: 32px;
    font-size: 24px;
  }

  .breakdown-row {
    grid-template-columns: 105px 1fr 28px;
    gap: 8px;
  }

  .result-actions,
  .how-it-works > div {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    padding-top: 58px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Nota discreta sobre cómo se ha corregido la lectura. Sirve para saber, sin
   abrir la consola, si el reconocedor guiado ha entrado en juego. */
.detected-mode {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  opacity: 0.65;
}
