@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@1,600&display=swap');

:root {
  --ink: #17342d;
  --muted: #6f7d75;
  --paper: #f8f2e8;
  --cream: #fffaf2;
  --card: #fffdf8;
  --line: #ddd8cd;
  --coral: #ee765e;
  --coral-soft: #f7d8cc;
  --sage: #8baa86;
  --blue: #648aa0;
  --shadow: 0 18px 50px rgba(30, 50, 42, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(238,118,94,.09), transparent 25rem),
    radial-gradient(circle at 92% 40%, rgba(139,170,134,.12), transparent 28rem),
    var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  min-height: 100vh;
}
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23,52,45,.14); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.coach-avatar { display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; font-family: "Playfair Display", serif; font-size: 22px; }
.mkc-logo { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(30,50,42,.12)); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.header-status { display: flex; align-items: center; gap: 15px; }
.compact-progress { min-width: 205px; display: grid; grid-template-columns: auto auto auto 58px; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.compact-progress strong { color: var(--ink); font-size: 18px; letter-spacing: -.04em; }
.compact-progress .mini-bars { width: 58px; height: 22px; margin: 0 0 0 4px; }
.connection-pill { padding: 8px 13px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; background: rgba(255,255,255,.45); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #cf9f54; box-shadow: 0 0 0 4px rgba(207,159,84,.12); }
.connection-pill.connected .status-dot { background: #59926c; box-shadow: 0 0 0 4px rgba(89,146,108,.12); }
.account-menu { position: relative; }
.menu-button { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.55); display: grid; place-content: center; gap: 4px; cursor: pointer; }
.menu-button span { width: 16px; height: 2px; border-radius: 2px; background: var(--ink); }
.account-menu-panel { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; width: min(300px, calc(100vw - 28px)); padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.menu-row, .audio-settings summary { width: 100%; min-height: 42px; padding: 0 11px; border: 0; background: transparent; color: inherit; display: flex; align-items: center; justify-content: space-between; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; }
.menu-row small { max-width: 155px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.menu-row:hover, .audio-settings summary:hover { background: var(--paper); }
.audio-settings[open] summary span { transform: rotate(90deg); }
.account-menu-panel .device-picker { width: auto; margin: 3px 7px 7px; padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; text-align: left; }
.account-menu-panel .device-picker label, .account-menu-panel .device-picker select, .account-menu-panel .device-help { grid-column: 1 / -1; }
.account-menu-panel .device-picker button { grid-column: 2; grid-row: 2; }
.site-footer { max-width: 1180px; margin: 0 auto; padding: 20px 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.site-footer a { color: var(--ink); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; padding: 74px 5% 66px; }
.eyebrow { margin: 0 0 10px; color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 700px; font-size: clamp(46px, 7vw, 82px); line-height: .98; letter-spacing: -.06em; font-weight: 600; }
.hero h1 em { font-family: "Playfair Display", serif; color: var(--coral); font-weight: 600; }
.hero-copy { max-width: 585px; margin: 27px 0 0; color: var(--muted); line-height: 1.7; font-size: 16px; }
.today-card { width: 155px; height: 175px; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,253,248,.66); padding: 20px; display: flex; flex-direction: column; }
.today-card span, .today-card small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.today-card strong { margin-top: 5px; font-size: 48px; line-height: 1; letter-spacing: -.06em; }
.mini-bars { height: 36px; margin-top: auto; display: flex; align-items: end; gap: 4px; }
.mini-bars i { flex: 1; min-height: 4px; border-radius: 3px; background: #ddd8cd; transition: height .4s; }
.mini-bars i.filled { background: var(--sage); }
.lesson-strip { margin: 38px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.section-heading h2, .how-it-works h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.text-button { border: 0; padding: 8px 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.text-button:hover { color: var(--coral); }
.lesson-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lesson-card { min-height: 88px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.65); text-align: left; display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; }
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 9px 25px rgba(30,50,42,.08); }
.lesson-card.active { background: var(--card); box-shadow: 0 9px 25px rgba(30,50,42,.08); border-color: var(--ink); }
.lesson-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; }
.coral .lesson-icon { background: var(--coral-soft); color: #a6402f; }
.sage .lesson-icon { background: #dce8d8; color: #4d7254; }
.blue .lesson-icon { background: #d9e6eb; color: #3c6579; }
.lesson-card strong, .lesson-card small { display: block; }
.lesson-card strong { font-size: 14px; margin-bottom: 3px; }
.lesson-card small { color: var(--muted); font-size: 11px; }
.lesson-arrow { opacity: 0; transform: translateX(-5px); transition: .2s; }
.lesson-card.active .lesson-arrow { opacity: 1; transform: none; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); background: var(--card); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(23,52,45,.08); }
.practice-card { min-height: 620px; padding: 30px 55px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.practice-meta { align-self: stretch; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.target-kind { padding: 5px 9px; border-radius: 999px; background: #edf0e8; }
.target-visual { width: 112px; height: 112px; margin: 45px 0 21px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 50%; font-size: 50px; box-shadow: inset 0 0 0 8px var(--card); }
.translation { margin: 0 0 7px; color: var(--muted); font-size: 14px; }
.target-text { margin: 0; font-size: clamp(48px, 6vw, 72px); line-height: 1; letter-spacing: -.06em; }
.target-text.long-target { max-width: 620px; font-size: clamp(31px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.045em; }
.syllable-preview { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 21px; font-size: 19px; font-weight: 600; }
.syllable-preview i { color: var(--coral); font-style: normal; }
.phonetic { color: var(--muted); font-size: 14px; margin: 8px 0 35px; }
.practice-actions { display: flex; justify-content: center; align-items: center; gap: 13px; }
.secondary-button { min-width: 104px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; transition: .2s; }
.secondary-button:hover { border-color: var(--ink); background: #fff; }
.secondary-button.is-active { border-color: var(--coral); color: #a6402f; background: var(--coral-soft); transform: scale(.96); }
.secondary-button.was-clicked { border-color: var(--sage); color: #3f6d4b; background: #dce8d8; transform: scale(.97); }
.record-button { width: 100px; height: 100px; border: 9px solid var(--coral-soft); border-radius: 50%; background: var(--coral); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; box-shadow: 0 8px 22px rgba(238,118,94,.3); cursor: pointer; transition: transform .2s; }
.record-button:hover { transform: scale(1.04); }
.record-button.listening { animation: pulse 1.2s infinite; }
.record-button.hearing { border-color: #cce1ce; background: #5f906a; animation: heard-pulse .7s infinite alternate; }
.record-button.analysing { border-color: #d9e6eb; background: var(--blue); animation: analyse-pulse .85s infinite alternate; }
.record-button:disabled { cursor: wait; opacity: .8; }
.mic-icon { width: 13px; height: 20px; border: 2px solid currentColor; border-radius: 8px; position: relative; }
.mic-icon::after { content: ""; position: absolute; width: 20px; height: 12px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 12px 12px; left: -5.5px; top: 10px; }
.record-button span:last-child { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.device-picker { width: min(100%, 420px); margin-top: 24px; padding: 7px 8px 7px 13px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(248,242,232,.55); }
.device-picker label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.device-picker select { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; text-overflow: ellipsis; }
.device-picker button { border: 0; border-radius: 8px; padding: 7px 9px; color: var(--ink); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.device-picker button:disabled { opacity: .55; cursor: wait; }
.device-help { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.record-hint { color: var(--muted); font-size: 11px; margin: 12px 0 0; }
.feedback-card { min-height: 620px; padding: 38px; background: #edf0e8; border-left: 1px solid rgba(23,52,45,.08); }
.empty-feedback { min-height: 540px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.ear-icon { width: 68px; height: 68px; display: grid; place-items: center; border: 1px solid #cbd3c8; border-radius: 50%; font-size: 44px; color: var(--sage); }
.empty-feedback h3 { margin: 22px 0 8px; font-size: 20px; }
.empty-feedback p { max-width: 310px; margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.analysis-state { min-height: 540px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.analysis-state h3 { margin: 3px 0 10px; font-size: 25px; letter-spacing: -.03em; }
.analysis-state > p:not(.eyebrow) { max-width: 330px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.analysis-orbit { position: relative; width: 92px; height: 92px; margin-bottom: 27px; border: 2px solid rgba(100,138,160,.22); border-radius: 50%; animation: orbit 1.25s linear infinite; }
.analysis-orbit::before, .analysis-orbit::after { content: ""; position: absolute; border-radius: 50%; }
.analysis-orbit::before { inset: 12px; border: 2px dashed rgba(238,118,94,.55); animation: orbit-reverse .9s linear infinite; }
.analysis-orbit::after { width: 13px; height: 13px; top: -7px; left: 38px; background: var(--coral); box-shadow: 0 0 0 7px rgba(238,118,94,.13); }
.analysis-orbit span { position: absolute; inset: 31px; border-radius: 50%; background: var(--blue); animation: analysis-breathe .7s ease-in-out infinite alternate; }
.analysis-steps { margin-top: 28px; display: flex; align-items: center; gap: 9px; color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.analysis-steps i { width: 22px; height: 2px; overflow: hidden; background: #cad7da; position: relative; }
.analysis-steps i::after { content: ""; position: absolute; inset: 0; background: var(--coral); transform: translateX(-100%); animation: scan-line 1.2s ease-in-out infinite; }
.hidden { display: none !important; }
.result-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 29px; }
.result-heading h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.overall-score { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 25px; font-weight: 700; }
.overall-score.strong { background: #5f906a; }
.overall-score.close { background: #c39545; }
.overall-score.repair { background: #cb654f; }
.score-legend { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.syllable-results { display: flex; flex-direction: column; gap: 11px; }
.syllable-row { display: grid; grid-template-columns: 72px 1fr 30px; gap: 12px; align-items: center; padding: 10px 11px; margin: 0 -11px; border-radius: 12px; }
.syllable-row.weakest { background: rgba(238,118,94,.1); }
.syllable-row strong, .syllable-row small { display: block; }
.syllable-row strong { font-size: 16px; }
.syllable-row small { color: var(--muted); font-size: 9px; margin-top: 1px; }
.syllable-row b { font-size: 13px; }
.score-track { height: 7px; background: #d9ddd4; border-radius: 99px; overflow: hidden; }
.score-track i { display: block; height: 100%; border-radius: inherit; }
.score-track i.strong { background: #64916c; }
.score-track i.close { background: #d2a64e; }
.score-track i.repair { background: var(--coral); }
.coach-note { display: grid; grid-template-columns: 42px 1fr; gap: 13px; margin-top: 27px; padding: 18px; background: var(--card); border-radius: 16px; box-shadow: 0 7px 20px rgba(30,50,42,.06); }
.coach-avatar { width: 42px; height: 42px; font-size: 18px; }
.coach-note strong { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.coach-note p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.coach-note mark { color: var(--coral); background: transparent; font-weight: 700; }
.improvement { min-height: 17px; margin: 15px 3px 0; color: var(--muted); font-size: 11px; }
.raw-result { margin-top: 16px; color: var(--muted); font-size: 11px; }
.raw-result summary { cursor: pointer; }
.raw-result pre { max-height: 160px; overflow: auto; padding: 10px; background: rgba(255,255,255,.5); border-radius: 8px; font: 9px/1.4 monospace; white-space: pre-wrap; }
.step-nav { position: absolute; left: 18px; right: 18px; bottom: 13px; display: flex; justify-content: space-between; align-items: center; }
.step-nav > button { border: 0; background: transparent; cursor: pointer; font-size: 12px; }
.step-nav > button:disabled { opacity: .3; cursor: default; }
.step-dots { display: flex; gap: 7px; }
.step-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #c7c7bc; cursor: pointer; }
.step-dots button.active { width: 22px; border-radius: 99px; background: var(--coral); }
.how-it-works { padding: 0 5% 100px; }
.how-it-works > h2 { font-size: 38px; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px; margin-top: 40px; }
.proof-grid span { color: var(--coral); font: italic 18px "Playfair Display", serif; }
.proof-grid h3 { margin: 10px 0 8px; font-size: 16px; }
.proof-grid p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.install-button { display: none; position: fixed; z-index: 9; right: 18px; bottom: 18px; align-items: center; gap: 10px; padding: 9px 15px 9px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; color: #fff; background: var(--ink); box-shadow: 0 14px 34px rgba(23,52,45,.28); cursor: pointer; text-align: left; }
.install-button img { width: 40px; height: 40px; object-fit: contain; }
.install-button strong, .install-button small { display: block; }
.install-button strong { font-size: 12px; }
.install-button small { margin-top: 2px; color: rgba(255,255,255,.7); font-size: 9px; }
.settings-dialog { width: min(420px, calc(100% - 28px)); padding: 27px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.settings-dialog::backdrop { background: rgba(12,31,27,.48); backdrop-filter: blur(3px); }
.settings-dialog h2 { margin: 0 0 20px; font-size: 25px; }
.dialog-close { position: absolute; top: 11px; right: 11px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--paper); font-size: 23px; cursor: pointer; }
.settings-form { display: grid; gap: 15px; }
.settings-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.settings-form input, .settings-form select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.settings-form select:disabled { opacity: .72; }
.settings-form label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.form-error { margin: 0; color: #a6402f; font-size: 11px; }
.dialog-primary, .dialog-secondary { min-height: 42px; padding: 0 16px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.dialog-primary { border: 1px solid var(--ink); color: #fff; background: var(--ink); }
.dialog-secondary { border: 1px solid var(--line); background: transparent; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.account-facts { display: grid; gap: 2px; margin: 0 0 22px; }
.account-facts div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.account-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.account-facts dd { margin: 3px 0 0; font-size: 14px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 13px rgba(238,118,94,.14), 0 8px 22px rgba(238,118,94,.3); } }
@keyframes heard-pulse { to { box-shadow: 0 0 0 15px rgba(95,144,106,.16), 0 8px 22px rgba(95,144,106,.25); } }
@keyframes analyse-pulse { to { box-shadow: 0 0 0 15px rgba(100,138,160,.16), 0 8px 22px rgba(100,138,160,.25); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes orbit-reverse { to { transform: rotate(-720deg); } }
@keyframes analysis-breathe { to { transform: scale(.68); opacity: .55; } }
@keyframes scan-line { 50%, 100% { transform: translateX(100%); } }

@media (max-width: 820px) {
  html { scroll-snap-type: y proximity; scroll-padding-top: 8px; }
  .app-shell { width: min(100% - 24px, 680px); }
  .hero { padding: 55px 2% 48px; }
  .compact-progress { display: none; }
  .lesson-strip { margin: 22px 0 14px; scroll-margin-top: 8px; }
  .section-heading { align-items: end; margin-bottom: 10px; }
  .section-heading .eyebrow { margin-bottom: 4px; font-size: 9px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading .text-button { font-size: 10px; }
  .lesson-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 78vw); grid-template-columns: none; gap: 10px; margin-inline: -12px; padding: 2px 12px 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline mandatory; scrollbar-width: none; }
  .lesson-list::-webkit-scrollbar { display: none; }
  .lesson-card { min-height: 72px; padding: 10px 12px; grid-template-columns: 42px 1fr auto; scroll-snap-align: center; }
  .lesson-icon { width: 42px; height: 42px; border-radius: 12px; }
  .lesson-strip, .practice-layout { scroll-snap-align: start; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-card { min-height: 0; padding: 17px 18px 48px; }
  .practice-meta { font-size: 9px; }
  .target-kind { padding: 4px 7px; }
  .target-visual { width: 72px; height: 72px; margin: 13px 0 8px; box-shadow: inset 0 0 0 5px var(--card); font-size: 34px; }
  .translation { margin-bottom: 3px; font-size: 12px; }
  .target-text { font-size: 39px; letter-spacing: 0; }
  .target-text.long-target { font-size: 27px; letter-spacing: 0; }
  .syllable-preview { margin-top: 9px; font-size: 15px; }
  .phonetic { margin: 4px 0 13px; font-size: 11px; }
  .practice-actions { gap: 8px; }
  .secondary-button { min-width: 80px; padding: 0 8px; font-size: 11px; }
  .record-button { width: 76px; height: 76px; border-width: 7px; }
  .record-hint { margin: 7px 0 0; }
  .feedback-card { min-height: 150px; padding: 17px 18px; border-left: 0; border-top: 1px solid rgba(23,52,45,.08); }
  .empty-feedback, .analysis-state { min-height: 116px; }
  .ear-icon { width: 38px; height: 38px; font-size: 23px; }
  .empty-feedback h3 { margin: 9px 0 3px; font-size: 15px; }
  .empty-feedback p { font-size: 10px; line-height: 1.4; }
  .analysis-orbit { width: 54px; height: 54px; margin-bottom: 10px; }
  .analysis-orbit span { inset: 18px; }
  .analysis-state h3 { font-size: 18px; }
  .analysis-state > p:not(.eyebrow), .analysis-steps { display: none; }
  .result-heading { margin-bottom: 12px; }
  .result-heading h3 { font-size: 19px; }
  .overall-score { width: 48px; height: 48px; font-size: 19px; }
  .syllable-results { gap: 5px; }
  .syllable-row { padding-block: 6px; }
  .coach-note { margin-top: 10px; padding: 10px; }
  .improvement, .raw-result { margin-top: 8px; }
  .step-nav { left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: minmax(72px, auto) 1fr minmax(72px, auto); }
  .step-nav > button:first-child { justify-self: start; }
  .step-nav > button:last-child { justify-self: end; }
  .step-dots { justify-self: center; }
  .proof-grid { grid-template-columns: 1fr; gap: 28px; }
  .install-button:not([hidden]) { display: flex; }
}

@media (max-width: 520px) {
  .settings-dialog { padding: 23px 19px; }
  .topbar { height: 75px; }
  .app-shell { width: calc(100% - 16px); }
  .header-status { gap: 7px; }
  .connection-pill { padding: 7px 9px; }
  .mkc-logo { width: 49px; height: 49px; }
  .brand small { max-width: 145px; font-size: 8px; letter-spacing: .08em; }
  #connection-label { max-width: 115px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero { grid-template-columns: 1fr; padding-top: 43px; }
  .hero-copy { font-size: 14px; }
  .practice-layout { border-radius: 20px; }
  .practice-card { padding-inline: 16px; }
  .practice-meta { font-size: 9px; }
  .target-kind { padding: 4px 7px; }
  .target-visual { width: 72px; height: 72px; margin: 13px 0 8px; box-shadow: inset 0 0 0 5px var(--card); font-size: 34px; }
  .translation { margin-bottom: 3px; font-size: 12px; }
  .target-text { font-size: 39px; letter-spacing: 0; }
  .target-text.long-target { font-size: 27px; letter-spacing: 0; }
  .syllable-preview { margin-top: 9px; font-size: 15px; }
  .phonetic { margin: 4px 0 13px; font-size: 11px; }
  .practice-actions { gap: 8px; }
  .secondary-button { min-width: 80px; padding: 0 8px; font-size: 11px; }
  .record-button { width: 76px; height: 76px; border-width: 7px; }
  .record-hint { margin-top: 8px; }
  .feedback-card { min-height: 150px; padding: 17px 18px; }
  .empty-feedback, .analysis-state { min-height: 116px; }
  .ear-icon { width: 38px; height: 38px; font-size: 23px; }
  .empty-feedback h3 { margin: 9px 0 3px; font-size: 15px; }
  .empty-feedback p { font-size: 10px; line-height: 1.4; }
  .analysis-orbit { width: 54px; height: 54px; margin-bottom: 10px; }
  .analysis-orbit span { inset: 18px; }
  .analysis-state h3 { font-size: 18px; }
  .analysis-state > p:not(.eyebrow), .analysis-steps { display: none; }
}
