/* Language Studio — phone-first design system reconstructed from the approved mockups.
   Tokens come from 07_Traceability_and_Decisions/Design_Tokens.json. Layout is fluid from 320 px up;
   at 600 px+ the same phone layout is centred with roomier cards (tablet/desktop parity, not a new design). */

@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 800;
  font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 400 800;
  font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-cyrillic.woff2") format("woff2"); font-weight: 400 800;
  font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #eef2f8; --surface: #ffffff; --navy: #142847; --blue: #135dd4; --blue-2: #1d6fe6; --purple: #6059ed;
  --muted: #556480; --border: #dfe6f1; --pale: #ecf3ff; --success: #0a884b; --success-bg: #e8f7ee; --warn: #9a5b00;
  --warn-bg: #fff6e5; --danger: #b42318; --danger-bg: #fdecea; --focus: #6059ed;
  --radius-card: 18px; --radius-ctl: 14px; --shadow: 0 1px 2px rgba(20,40,71,.06), 0 6px 18px rgba(20,40,71,.06);
  --scale: 1; --nav-h: 64px; --gutter: 16px; --maxw: 560px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-target: "Inter", system-ui, "Noto Sans", "Noto Sans CJK JP", "Noto Sans CJK SC", "Noto Sans CJK KR",
                 "Noto Naskh Arabic", "Noto Sans Devanagari", sans-serif;
}
:root.hc { --muted: #3d4b63; --border: #9aa8bf; --blue: #0b4bb3; }
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--navy); font-family: var(--font); line-height: 1.45;
  min-height: 100dvh; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:root.reduced-motion *, :root.reduced-motion *::before, :root.reduced-motion *::after { animation: none !important; transition: none !important; }

a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.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; }
h1:focus, main:focus { outline: none; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }

/* ---- shell ---- */
#app { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-top: env(safe-area-inset-top); }
.topbar h1, .topbar .title { flex: 1; text-align: center; font-size: 1.06rem; font-weight: 700; margin: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.12rem; flex: 1; min-width: 0; }
.brand-mark { width: 30px; height: 30px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--navy);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:hover { background: rgba(19,93,212,.07); }
.iconbtn svg { width: 24px; height: 24px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center;
  font-weight: 700; border: 0; cursor: pointer; }

nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
nav.bottom ul { list-style: none; display: flex; margin: 0 auto; padding: 0; max-width: var(--maxw); }
nav.bottom li { flex: 1 1 0; min-width: 0; }
nav.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h);
  color: var(--navy); text-decoration: none; font-size: min(.74rem, 12.5px); font-weight: 600; }
nav.bottom a svg { width: 24px; height: 24px; }
nav.bottom a[aria-current="page"] { color: var(--blue); }
nav.bottom a[aria-current="page"] span::after { content: ""; display: block; height: 3px; border-radius: 3px; background: var(--blue); margin-top: 3px; }

/* ---- type ---- */
.page { font-size: 1.9rem; line-height: 1.15; margin: 8px 0 4px; letter-spacing: -.01em; font-weight: 750; overflow-wrap: anywhere; }
.lead { color: var(--blue); margin: 0 0 16px; font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
h2.section { font-size: 1.1rem; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; }
h2.section a { font-size: .9rem; font-weight: 600; text-decoration: none; }
[lang]:not(html) { font-family: var(--font-target); }
.target { font-family: var(--font-target); }
bdi.target { unicode-bidi: isolate; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.pale { background: var(--pale); box-shadow: none; }
.card.note { background: var(--warn-bg); border-color: #f3dfb5; box-shadow: none; }
.card.ok { background: var(--success-bg); border-color: #bfe6cf; box-shadow: none; }
.card.err { background: var(--danger-bg); border-color: #f5c2bd; box-shadow: none; }
.card.flat { box-shadow: none; }
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 18px; color: var(--navy);
  background: linear-gradient(135deg, #f4f8ff 0%, #e8f0ff 55%, #efeaff 100%); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero .lang-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.02rem; }
.hero h2 { font-size: 1.9rem; line-height: 1.1; margin: 12px 0 8px; max-width: 70%; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero p { margin: 0 0 18px; max-width: 72%; }
.hero .art { position: absolute; right: -6px; top: 6px; width: 42%; max-width: 190px; opacity: .95; pointer-events: none; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: #c9d4e6; }
.dots i.on { width: 20px; background: var(--blue); }

.plan-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); text-decoration: none; color: var(--navy); min-height: 64px; }
.plan-item + .plan-item { margin-top: 10px; }
.plan-item .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--pale); color: var(--purple); display: grid; place-items: center; flex: none; }
.plan-item .ico svg { width: 22px; height: 22px; }
.plan-item b { display: block; font-size: 1.02rem; overflow-wrap: anywhere; }
.plan-item .grow { flex: 1; min-width: 0; }
.plan-time { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; font-size: .9rem; }
.status { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.status.next { background: var(--pale); color: var(--blue); }
.status.done { background: var(--success-bg); color: var(--success); }
.status.later, .status.optional { background: #f1f3f7; color: var(--muted); }

/* ---- controls ---- */
.btn { appearance: none; border: 0; border-radius: var(--radius-ctl); min-height: 52px; padding: 0 20px; font: inherit; font-weight: 700;
  font-size: 1.04rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn { max-width: 100%; }
.btn.primary { background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff; box-shadow: 0 6px 14px rgba(19,93,212,.25); }
.btn.primary:disabled { background: #a9bbdc; box-shadow: none; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--blue); border: 1.5px solid #c7d6f0; }
.btn.ghost { background: transparent; color: var(--blue); min-height: 44px; padding: 0 10px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row > .grow { flex: 1 1 0; min-width: 0; }
.row.wrap > .grow { flex: 1 1 140px; min-width: min-content; max-width: 100%; }
.stack > * + * { margin-top: 12px; }
.sticky-cta { position: sticky; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); padding-top: 12px; }
label.field { display: block; font-weight: 650; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=url], input[type=search], input[type=time], input:not([type]), select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 1rem; color: var(--navy); background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px; min-height: 48px; }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(19,93,212,.15); }
.pin { letter-spacing: .5em; text-align: center; font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid #c7d6f0; background: var(--surface); color: var(--navy); border-radius: 999px; min-height: 40px; padding: 0 14px;
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"], .chip.on { background: var(--pale); border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"]::after { content: "✓"; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px;
  background: var(--surface); min-height: 56px; cursor: pointer; }
.check-row + .check-row { margin-top: 10px; }
.check-row input { width: 24px; height: 24px; accent-color: var(--blue); flex: none; }
.check-row .grow { flex: 1; }
.check-row.on { border-color: var(--blue); background: #f6f9ff; }
.flag { font-size: 1.3rem; line-height: 1; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #f1f3f7; color: var(--muted); }
.badge.pilot { background: var(--pale); color: var(--blue); }
.badge.limited { background: var(--warn-bg); color: var(--warn); }
.badge.unavailable { background: #f1f3f7; color: var(--muted); }
.badge.supported { background: var(--success-bg); color: var(--success); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 48px; height: 28px; accent-color: var(--blue); flex: none; }
.switch > span { min-width: 0; }
.tabs { display: flex; background: var(--pale); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto; padding: 0 8px; border: 0; background: transparent; min-height: 42px; border-radius: 11px; font: inherit; font-weight: 650; color: var(--navy); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.langtabs { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 2px 0 6px; scrollbar-width: none; }
.langtabs button { border: 1.5px solid var(--border); background: var(--surface); border-radius: 14px; min-height: 42px; padding: 0 16px;
  font: inherit; font-weight: 750; cursor: pointer; color: var(--navy); white-space: nowrap; }
.langtabs button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- practice ---- */
.progress { height: 10px; background: #e3e9f3; border-radius: 6px; overflow: hidden; flex: 1; }
.progress > i { display: block; height: 100%; background: var(--success); border-radius: 6px; }
.stage-card { background: linear-gradient(180deg, #f3f7ff, #eef3ff); border-radius: 22px; padding: 18px 16px 20px; text-align: center; border: 1px solid var(--border); }
.pill { display: inline-block; background: #e1ebff; color: var(--navy); border-radius: 999px; padding: 6px 12px; font-size: .9rem; font-weight: 600; }
.phrase { font-size: 2.2rem; font-weight: 800; margin: 14px 0 2px; line-height: 1.2; overflow-wrap: anywhere; }
.phrase.long { font-size: 1.5rem; }
.gloss { color: var(--muted); margin: 0; }
.trio { display: flex; justify-content: space-around; align-items: flex-start; margin-top: 18px; gap: 8px; }
.trio .act { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; font: inherit; color: var(--navy); cursor: pointer; min-width: 72px; }
.circle { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--blue); }
.circle svg { width: 28px; height: 28px; }
.circle.big { width: 84px; height: 84px; background: linear-gradient(180deg, #2c7cf0, var(--blue)); color: #fff; box-shadow: 0 8px 18px rgba(19,93,212,.35); }
.circle.big svg { width: 38px; height: 38px; }
.circle.rec { background: linear-gradient(180deg, #e5484d, #c4262c); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,.4);} 50% { box-shadow: 0 0 0 12px rgba(229,72,77,0);} }
.act b { color: var(--blue); }
.reps { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.reps i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #a9bbdc; }
.reps i.on { background: var(--blue); border-color: var(--blue); }
.feedback { display: flex; gap: 12px; align-items: flex-start; }
.feedback .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--success); }
.feedback.unsure .ic { background: var(--warn); }
.feedback.info .ic { background: var(--blue); }
.metrics { width: 100%; border-collapse: collapse; }
.metrics td { padding: 9px 2px; border-bottom: 1px solid var(--border); }
.metrics tr:last-child td { border-bottom: 0; }
.metrics td:last-child { text-align: right; font-weight: 700; }
.reader { background: #fffbea; border: 1px solid #f1e7bf; border-radius: 18px; padding: 16px; }
.reader .text { font-size: 1.18rem; line-height: 1.6; margin: 0; }
.reader .text.spaced { letter-spacing: .04em; word-spacing: .16em; line-height: 2; max-width: 34em; }
.reader .chunk { display: block; margin-bottom: .6em; }
.reader .text [data-sel] { cursor: pointer; border-radius: 4px; }
.reader .text mark { background: #ffe58a; color: inherit; }
.option { display: flex; width: 100%; text-align: start; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid #cfdcf3;
  background: var(--surface); border-radius: 14px; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 1.02rem; color: var(--navy); cursor: pointer; }
.option + .option { margin-top: 10px; }
.option.right { background: var(--success-bg); border-color: var(--success); }
.option.wrong { background: var(--danger-bg); border-color: #e89a93; }
.chat { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 16px; }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 18px; font-size: 1.05rem; position: relative; }
.bubble.partner { background: #eaf2ff; align-self: flex-start; border-top-left-radius: 6px; }
.bubble.learner { background: #e5f6ea; align-self: flex-end; border-top-right-radius: 6px; }
.bubble.pending { opacity: .7; }
.composer { display: flex; gap: 10px; align-items: center; }
.composer input { flex: 1; }
.translation { background: #fffbea; border: 1px solid #f1e7bf; border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.skillrow { padding: 12px 0; border-bottom: 1px solid var(--border); }
.skillrow:last-child { border-bottom: 0; }
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.ladder i { height: 8px; border-radius: 4px; background: #e3e9f3; }
.ladder i.on { background: var(--blue); }
.ladder.provisional i.on { background: repeating-linear-gradient(45deg, var(--blue), var(--blue) 4px, #6c9cf0 4px, #6c9cf0 8px); }
.focus-card { background: #fff6e5; border: 1px solid #f3dfb5; border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--navy);
  color: #fff; padding: 12px 16px; border-radius: 12px; z-index: 40; max-width: min(92vw, 520px); box-shadow: var(--shadow); }
.banner { border-radius: 14px; padding: 12px 14px; margin: 8px 0; display: flex; gap: 10px; align-items: flex-start; }
.banner.offline { background: #fff1d6; }
.banner.info { background: var(--pale); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.welcome-art { width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); display: block; }
.feature-row { display: flex; justify-content: space-around; margin: 18px 0 22px; text-align: center; font-weight: 650; }
.feature-row svg { width: 34px; height: 34px; color: var(--blue); display: block; margin: 0 auto 6px; }
.stepper { text-align: center; font-weight: 650; color: var(--navy); flex: 1; }
.spinner { width: 22px; height: 22px; border: 3px solid #c7d6f0; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 0; border-radius: 20px; padding: 20px; max-width: min(92vw, 480px); color: var(--navy); }
dialog::backdrop { background: rgba(20,40,71,.45); }
.compare-grid { display: grid; gap: 10px; }
.compare-grid .cell { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.kbd-hint { font-size: .8rem; color: var(--muted); }
:root.big-text .phrase { font-size: 1.8rem; }

@media (min-width: 600px) {
  :root { --gutter: 24px; --maxw: 640px; }
  .hero h2 { font-size: 2.2rem; }
}
@media (min-width: 1024px) {
  :root { --maxw: 720px; }
  body { background: linear-gradient(180deg, #e9eef7, #eef2f8); }
}
@media (max-width: 350px) {
  :root { --gutter: 12px; }
  .page { font-size: 1.6rem; }
  .hero h2 { font-size: 1.55rem; max-width: 64%; }
  .phrase { font-size: 1.8rem; }
  nav.bottom a { font-size: min(.66rem, 10.5px); }
  .circle.big { width: 74px; height: 74px; }
}

/* Tap-a-word */
.w { appearance: none; background: none; border: 0; padding: 4px 0; margin: 0; font: inherit; color: inherit; text-align: inherit; cursor: pointer; display: inline;
  border-radius: 4px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; text-decoration: underline dotted rgba(19,93,212,.35) 1px; text-underline-offset: 4px; }
.w.sel { background: #cfe0ff; color: var(--navy); text-decoration: none; box-shadow: 0 0 0 2px #cfe0ff; }
.wordsheet { position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 40; max-width: 560px; margin: 0 auto; max-height: 52vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: 0 10px 34px rgba(20,40,71,.3); padding: 10px 14px 12px; }
.wordsheet-text { font-size: 1.2rem; overflow-wrap: anywhere; }
.gloss-line { margin: 6px 0 0; overflow-wrap: anywhere; }
/* Normal and slow playback */
.trio.playbar { margin-top: 12px; justify-content: center; gap: 22px; }
.act.small { flex-direction: row; min-height: 44px; font-size: .95rem; }
.act.small .circle { width: 40px; height: 40px; }
.act.small .circle svg { width: 20px; height: 20px; }
.act.playing .circle { outline: 3px solid var(--blue); outline-offset: 2px; }
.sentence { cursor: pointer; }
/* Word bubbles that reveal the target language */
.chip.idea { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 6px 14px; line-height: 1.25; cursor: pointer; }
.idea-word { font-weight: 700; color: var(--blue); }
.idea-word[hidden] { display: none; }
/* The resume banner goes somewhere */
a.banner.resume { align-items: center; color: inherit; text-decoration: none; min-height: 44px; }
a.banner.resume b, a.banner.resume .small { display: block; }
/* A slow request shows a thin moving bar */
html.busy body::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 40%; background: var(--blue); z-index: 60; animation: busybar 1.1s ease-in-out infinite; }
@keyframes busybar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.reduced-motion body::before { animation: none; width: 100%; }
.cta-inline { margin-top: 12px; }

/* Live microphone meter (v2.7): bars are real measured level; state text is the accessible signal */
.micmeter { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 14px; background: #f3f6fb; border: 1px solid var(--border); }
.micmeter .mm-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e3e9f3; color: var(--muted); flex: none; }
.micmeter .mm-ic svg { width: 16px; height: 16px; }
.micmeter .mm-bars { display: flex; align-items: center; gap: 3px; height: 28px; width: 108px; flex: none; }
.micmeter .mm-bars i { display: block; width: 3px; height: 8%; min-height: 2px; border-radius: 2px; background: #b7c3d6; transition: height 60ms linear; }
.micmeter .mm-text { font-size: .9rem; color: var(--muted); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.micmeter[data-state="listening"] .mm-bars i, .micmeter[data-state="quiet"] .mm-bars i { background: var(--blue); }
.micmeter[data-state="listening"] .mm-ic { background: var(--pale); color: var(--blue); }
.micmeter[data-state="listening"] .mm-text { color: var(--navy); font-weight: 600; }
.micmeter[data-state="quiet"], .micmeter[data-state="silent"], .micmeter[data-state="noisy"], .micmeter[data-state="clipped"] { background: var(--warn-bg); border-color: #f3dfb5; }
.micmeter[data-state="silent"] .mm-text, .micmeter[data-state="quiet"] .mm-text, .micmeter[data-state="noisy"] .mm-text, .micmeter[data-state="clipped"] .mm-text { color: var(--warn); font-weight: 600; }
.micmeter[data-state="noisy"] .mm-bars i, .micmeter[data-state="clipped"] .mm-bars i { background: var(--warn); }
.micmeter[data-state="denied"], .micmeter[data-state="missing"], .micmeter[data-state="error"], .micmeter[data-state="hidden"] { background: var(--danger-bg); border-color: #f5c2bd; }
.micmeter[data-state="denied"] .mm-text, .micmeter[data-state="missing"] .mm-text, .micmeter[data-state="error"] .mm-text, .micmeter[data-state="hidden"] .mm-text { color: var(--danger); }
@media (max-width: 360px) { .micmeter .mm-bars { width: 72px; gap: 2px; } }

/* Reader (v2.6): one question card, evidence highlight, source credit */
.reader .text .sent { border-radius: 4px; transition: background-color .2s; }
.reader .text .sent.speaking { background: #e7efff; }
.reader .text .sent.evidence { background: #ffe58a; box-shadow: 0 0 0 2px #ffe58a; }
.reader .playbar { margin: 6px 0 4px; justify-content: flex-start; }
.qcard .qprompt { font-size: 1.08rem; margin: 6px 0 12px; }
.qcard .options .option[disabled] { opacity: 1; cursor: default; }
.feedback-box { margin-top: 12px; border-radius: 14px; padding: 12px; border: 1px solid var(--border); }
.feedback-box.ok { background: var(--success-bg); border-color: #bfe6cf; }
.feedback-box.note { background: var(--warn-bg); border-color: #f3dfb5; }
.feedback-box .quote { margin: 2px 0 0; font-size: 1.05rem; }
.wordlist { list-style: none; padding: 0; margin: 4px 0 0; }
.wordlist li { padding: 3px 0; overflow-wrap: anywhere; }
.btn.small { min-height: 36px; padding: 0 10px; font-size: .88rem; }
.credit a { color: var(--blue); overflow-wrap: anywhere; }
details.about-source { font-size: .88rem; margin: 0 0 10px; }
details.about-source summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.about-source div { margin: 3px 0; overflow-wrap: anywhere; }
.shelf-card .shelf-title { display: block; font-size: 1.05rem; margin-top: 2px; overflow-wrap: anywhere; }

/* Hear the difference (v2.8): minimal-pairs drill */
.pp-top { display: flex; align-items: center; gap: 12px; }
.pp-bar { flex: 1; height: 8px; border-radius: 4px; background: #d8e0ec; overflow: hidden; }
.pp-bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.pp-head { text-align: center; }
.pp-head h1 { font-size: 1.55rem; margin: 10px 0 0; }
.pp-chip { display: inline-block; font-size: .82rem; font-weight: 700; color: var(--blue); background: var(--pale); border-radius: 12px; padding: 5px 12px; }
.pp-listen { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pp-play { width: 120px; height: 120px; border-radius: 60px; border: 0; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(19,93,212,.3); cursor: pointer; }
.pp-play svg { width: 52px; height: 52px; }
.pp-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pp-opt { min-height: 132px; border-radius: var(--radius-card); border: 2px solid #c9d4e6; background: var(--surface); color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: inherit; }
.pp-opt:disabled { cursor: default; opacity: 1; }
.pp-word { font-family: var(--font-target); font-size: 2.3rem; font-weight: 800; }
.pp-gloss { font-size: .9rem; color: var(--muted); }
.pp-opt.pp-heard { border: 3px solid var(--blue); }
.pp-opt.pp-wrong { border: 3px dashed #c45f00; background: var(--warn-bg); }
.pp-tag { font-size: .75rem; font-weight: 700; color: #fff; background: var(--blue); border-radius: 10px; padding: 3px 9px; }
.pp-tag.warn { color: #8a4300; background: #ffe6cc; }
.pp-result .row { gap: 10px; flex-wrap: wrap; }
.pp-verdict { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.pp-tips p { margin: 4px 0; }
.pp-credit { text-align: center; }
.pp-done { text-align: center; padding-top: 18px; }
.pp-done h1 { font-size: 1.7rem; margin: 8px 0 0; }
.pp-done-ic { display: inline-flex; width: 64px; height: 64px; border-radius: 32px; background: var(--pale); color: var(--blue); align-items: center; justify-content: center; }
.pp-row { padding: 6px 0; border-top: 1px solid var(--border); }
.pp-score { font-size: .8rem; font-weight: 700; border-radius: 12px; padding: 4px 10px; }
.pp-score.good { color: var(--success); background: var(--success-bg); }
.pp-score.warn { color: #8a4300; background: #ffe6cc; }
.pp-prow { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pp-prow:last-child { border-bottom: 0; }
.pp-meter { display: grid; grid-template-columns: 70px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font-size: .85rem; }
.pp-meter b { text-align: right; }
.pp-track { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.pp-track i { display: block; height: 100%; border-radius: 4px; }
.pp-track i.hear { background: var(--blue); }
.pp-track i.say { background: #c45f00; }
.pp-status { font-size: .75rem; font-weight: 700; border-radius: 10px; padding: 3px 9px; background: var(--bg); color: var(--muted); }
.pp-status.s-learning { color: #8a4300; background: #ffe6cc; }
.pp-status.s-steady { color: var(--blue); background: var(--pale); }
.pp-status.s-weeklycheck { color: var(--success); background: var(--success-bg); }
.pp-tipcard { border: 2px solid #c45f00; background: var(--warn-bg); }
.pp-tipcard p { margin: 6px 0 0; }

/* v2.10 conversation: mic, typing, Send and Finish in one bar that stays above the bottom navigation (and the
   keyboard, which shrinks the viewport), however long the chat gets. */
.dock { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; background: var(--surface);
  margin: 8px calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter) 10px; border-top: 1px solid var(--border);
  box-shadow: 0 -6px 16px rgba(23,51,88,.06); }
.dock .micmeter { margin: 0 0 6px; }
.dock > p.small:empty { display: none; }
.dockrow { display: flex; gap: 8px; align-items: center; }
.dockrow input { flex: 1; min-width: 0; min-height: 48px; }
.dockrow .btn { min-height: 48px; padding: 0 14px; }
.iconbtn.mic { width: 48px; height: 48px; flex: none; background: #e9edfc; }
.iconbtn.mic.rec { background: #d93a3a; color: #fff; }
.btn.finish { flex: none; background: #304c9f; color: #fff; gap: 4px; }
.btn.finish svg { width: 18px; height: 18px; }
.chat .narration { align-self: center; font-style: italic; color: var(--muted); text-align: center; margin: 0; }
.bubble .speaker { display: block; font-size: .75rem; font-weight: 800; color: #5965ad; margin-bottom: 4px; }
@media (max-width: 380px) { .dockrow .btn.send { padding: 0 10px; } .btn.finish { padding: 0 10px; } }
