:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #242321;
  --muted: #837a70;
  --line: #e7e1d8;
  --soft: #f5efe7;
  --accent: #ad6e38;
  --accent-dark: #8c5428;
  --success: #5c8968;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
textarea { display: block; width: 100%; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; resize: vertical; }
button:disabled { opacity: .55; cursor: default; }
body { margin: 0; background: var(--bg); }
button { font: inherit; cursor: pointer; }
.app-shell { max-width: 760px; min-height: 100vh; margin: 0 auto; padding: 18px 18px 96px; }
.topbar { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.network-status { display: inline-block; padding: 3px 6px; border-radius: 8px; background: #f5e7e4; color: #a04f43; font-size: 10px; font-weight: 700; }
.brand { color: var(--accent); font-weight: 800; letter-spacing: .08em; font-size: 11px; }
.screen-title { margin: 34px 0 8px; font-size: 30px; line-height: 1.08; letter-spacing: -.04em; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.hero { margin-top: 24px; padding: 20px; border: 1px solid #eadcc9; border-radius: 20px; background: var(--soft); }
.eyebrow, .label { font-size: 10px; color: #92785f; letter-spacing: .1em; text-transform: uppercase; }
.hero-amount { margin: 8px 0 2px; color: var(--accent); font-size: 30px; font-weight: 850; letter-spacing: -.04em; }
.hero-note { color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; margin-top: 14px; background: #e7dacb; border-radius: 20px; overflow: hidden; }
.progress-value { height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 12px; }
.card { padding: 16px; margin: 10px 0; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.card.soft { background: var(--soft); border-color: #eadcc9; }
.card h3 { margin: 6px 0 5px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dialogue-note { margin-top: 14px; padding: 11px 13px; border: 1px solid #eadcc9; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.55; }
.practice-settings { margin-top: 15px; background: #fffaf3; border-color: #eadcc9; }
.practice-settings strong { display: block; font-size: 13px; }
.practice-settings p { margin-top: 4px; }
.practice-switches { display: flex; gap: 6px; flex-wrap: wrap; }
.practice-switches .secondary.selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.dialogue-card { padding: 14px; }
.dialogue-card.dialogue-complete { border-color: #d8e6db; background: #fcfffc; }
.dialogue-goal { margin-top: 7px !important; color: var(--ink) !important; }
.dialogue-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.dialogue-meta span { padding: 4px 7px; border-radius: 20px; background: #f7f3ed; }
.dialogue-meta .dialogue-status-done { background: #e8f1e9; color: var(--success); font-weight: 700; }
.dialogue-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dialogue-list { display: grid; gap: 10px; margin-top: 13px; }
.dialogue-line { display: flex; flex-direction: column; max-width: 94%; }
.dialogue-line.from-sales { align-items: flex-end; justify-self: end; }
.dialogue-line.from-buyer { align-items: flex-start; justify-self: start; }
.dialogue-speaker { margin: 0 5px 4px; color: var(--muted); font-size: 10px; }
.dialogue-bubble { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f4; }
.from-sales .dialogue-bubble { border-color: #eadcc9; background: #fff8ef; border-bottom-right-radius: 4px; }
.from-buyer .dialogue-bubble { border-bottom-left-radius: 4px; }
.dialogue-en { color: var(--ink) !important; font-size: 13px !important; line-height: 1.55 !important; }
.dialogue-ipa { margin-top: 5px !important; color: #634d3b !important; font-family: "Segoe UI", "Arial", sans-serif; font-size: 12.5px !important; line-height: 1.65 !important; overflow-wrap: anywhere; }
.review-ipa { display: block; margin-top: 4px; color: #634d3b; font-family: "Segoe UI", "Arial", sans-serif; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.dialogue-zh { margin-top: 5px !important; font-size: 11px !important; }
.translation-hidden .dialogue-zh { display: none; }
.dialogue-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dialogue-actions .secondary { padding: 6px 8px; font-size: 10px; }
.practice-line.done { border-color: #b9d5c0; background: #edf6ef; color: var(--success); }
.roleplay-script { margin: 12px 0; padding: 12px; border: 1px solid #eadcc9; border-radius: 13px; background: #fffaf3; text-align: left; }
.roleplay-script > p { margin-top: 6px; }
.roleplay-line { display: grid; gap: 2px; margin-top: 9px; padding: 8px 9px; border-radius: 9px; background: #fff; }
.roleplay-line strong { color: var(--accent-dark); font-size: 10px; }
.roleplay-line span { color: var(--ink); font-size: 12px; line-height: 1.45; }
.roleplay-line small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.roleplay-buyer { border-left: 3px solid #d6cec3; }
.roleplay-sales { border-left: 3px solid var(--accent); }
.roleplay-script .secondary { margin-top: 11px; }
.exam-speaker { display: inline-block; margin: 8px 0 4px; padding: 4px 7px; border-radius: 20px; background: #f2eee7; color: var(--muted); font-size: 10px; }
.article-body p { margin-top: 13px; color: var(--ink); font-size: 14px; line-height: 1.75; }
.article-body p:first-of-type { margin-top: 10px; }
.article-tip { padding: 8px 10px; border-radius: 9px; background: var(--soft); color: var(--muted) !important; font-size: 11px !important; }
.article-word { border: 0; border-bottom: 1px dashed var(--accent); padding: 0 1px; background: transparent; color: var(--accent-dark); font: inherit; cursor: pointer; }
.vocab-popover { position: relative; margin-top: 10px; }
.vocab-popover .card { margin: 0; border-color: #d9c2aa; background: #fffaf3; }
.vocab-popover h3 { margin: 5px 0 0; }
.vocab-popover p { margin-top: 8px; }
.vocab-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.vocab-actions .secondary.selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.expression-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.expression-row:last-child { border-bottom: 0; }
.expression-row p { margin: 0 !important; color: var(--ink) !important; font-size: 14px !important; }
.brand-practice-card h3 { margin-top: 12px; font-size: 19px; line-height: 1.5; }
.vocab-row p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.card-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.meta { color: var(--accent); font-size: 11px; }
.status-badge { flex: none; padding: 4px 7px; border-radius: 20px; background: #e8f1e9; color: var(--success); font-size: 10px; }
.mastery-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.mastery-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mastery-row strong { display: block; font-size: 13px; }
.mastery-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.mini-progress { width: min(220px, 70vw); height: 4px; margin-top: 7px; overflow: hidden; border-radius: 10px; background: #eee7df; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.mastery-done, .mastery-pending { display: flex; flex: none; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; }
.mastery-done { background: var(--accent); color: #fff; }
.mastery-pending { background: var(--soft); color: var(--muted); }
.checkin-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 15px; }
.calendar-day { display: flex; min-height: 42px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.calendar-day span { font-size: 12px; font-weight: 700; }
.calendar-day small { margin-top: 3px; font-size: 9px; }
.calendar-day.checked { border-color: var(--accent); background: var(--accent); color: #fff; }
.review-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; padding-bottom: 0; }
.review-row > div:first-child { flex: 1; min-width: 0; }
.review-row strong { display: block; font-size: 13px; }
.review-row small { display: block; max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.review-row .review-ipa { overflow-wrap: anywhere; }
.review-actions { display: flex; gap: 6px; flex: none; }
.review-actions .secondary { padding: 6px 8px; font-size: 10px; }
.review-queue-card > .review-row:first-of-type { margin-top: 10px; }
.badge-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.badge-item { min-width: 0; padding: 8px 4px; border: 1px solid var(--line); border-radius: 11px; background: #faf8f4; color: #c4bbb0; text-align: center; }
.badge-item.unlocked { border-color: #e4c9ac; background: #fff8ef; color: var(--accent); }
.badge-icon { font-size: 20px; line-height: 1.1; }
.badge-item strong, .badge-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-item strong { margin-top: 5px; font-size: 10px; }
.badge-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
@media (max-width: 420px) { .badge-grid { gap: 4px; } .badge-item { padding-right: 2px; padding-left: 2px; } }
.backup-card { margin-top: 10px; }
.p2-actions { display: grid; gap: 9px; margin-top: 14px; }
.p2-actions .primary, .p2-actions .secondary { width: 100%; }
.coach-prompt { margin-top: 16px; }
.coach-prompt h3 { margin-top: 9px; font-size: 19px; line-height: 1.5; }
.coach-prompt p { margin-top: 6px; }
.coach-feedback { margin-top: 12px; }
.coach-match { margin-top: 10px !important; }
.coach-record-box { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border: 1px dashed #dacabb; border-radius: 12px; background: #fcfaf7; color: var(--muted); font-size: 11px; line-height: 1.4; }
.coach-record-box .record-button { flex: none; }
.recording-playback { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--soft); }
.recording-playback audio { width: min(100%, 250px); height: 32px; }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.coach-actions .primary, .coach-actions .secondary { margin-top: 0; }
.recording-error { margin-top: 8px !important; color: #a33e35 !important; }
.speech-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 13px 0 5px; }
.speech-metrics > div { padding: 8px 4px; border-radius: 10px; background: var(--soft); text-align: center; }
.speech-metrics strong, .speech-metrics small { display: block; }
.speech-metrics strong { color: var(--accent); font-size: 17px; }
.speech-metrics small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.metric-note { font-size: 10px !important; }
.negotiation-track { display: flex; justify-content: space-between; gap: 7px; margin: 16px 0 4px; }
.negotiation-track span { display: flex; flex: 1; height: 25px; align-items: center; justify-content: center; border-radius: 20px; background: #eee8e0; color: var(--muted); font-size: 10px; font-weight: 700; }
.negotiation-track span.current { background: var(--accent); color: #fff; }
.negotiation-track span.done { background: #e3efe5; color: var(--success); }
.report-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0; }
.report-stats span { padding: 6px 8px; border-radius: 18px; background: var(--soft); color: var(--accent-dark); font-size: 10px; }
.backup-card h3 { margin-bottom: 4px; }
.backup-actions { display: flex; gap: 8px; margin-top: 13px; }
.backup-actions .secondary { flex: 1; }
.primary { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; color: #fff; background: var(--accent); font-weight: 700; }
.primary:active { background: var(--accent-dark); }
.secondary { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink); background: #fff; font-size: 12px; }
.favorite-button { min-width: 38px; padding-right: 8px; padding-left: 8px; color: var(--muted); }
.favorite-button.selected { border-color: #d9c2aa; background: var(--soft); color: var(--accent); }
.pill { display: inline-block; padding: 5px 8px; margin: 8px 4px 0 0; border-radius: 20px; background: #f2eee7; color: #756b5f; font-size: 10px; }
.pill.active-pill { background: var(--accent); color: #fff; }
.level-pill { background: #edf3ee; color: var(--success); }
.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 0; padding: 10px max(18px, calc((100vw - 760px) / 2)); border-top: 1px solid var(--line); background: rgba(251,250,247,.96); backdrop-filter: blur(14px); }
.nav-item { flex: 1; max-width: 150px; border: 0; padding: 5px 3px; background: transparent; color: var(--muted); font-size: 11px; }
.nav-item.active { color: var(--accent); font-weight: 700; }
.nav-icon { display: block; margin-bottom: 4px; font-size: 18px; }
.back { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
.screen-header { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.screen-header .screen-title { margin: 0; }
.step-list { position: relative; margin-top: 20px; }
.step-line { position: absolute; top: 28px; bottom: 28px; left: 19px; width: 2px; background: var(--line); }
.step-item { position: relative; display: flex; gap: 13px; margin: 15px 0; align-items: flex-start; }
.step-dot { z-index: 1; display: flex; flex: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 2px solid #d9d0c4; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 800; }
.step-dot.done { border-color: var(--accent); background: var(--accent); color: #fff; }
.step-dot.current { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px #f3e8db; }
.step-copy { flex: 1; padding-top: 2px; }
.step-copy h3 { margin: 0 0 3px; font-size: 15px; }
.step-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.question { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.option { display: block; width: 100%; margin: 10px 0; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fff; text-align: left; color: var(--ink); font-size: 13px; }
.option.selected { border-color: var(--accent); background: var(--soft); }
.record-box { margin: 14px 0; padding: 16px; border: 1px dashed #d8c7b4; border-radius: 14px; background: #fcf7f0; text-align: center; }
.record-button { width: 68px; height: 68px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 24px; box-shadow: 0 0 0 7px #f2e5d7; }
.record-button.recording { background: #b44b40; animation: pulse 1.2s infinite; }
.record-status { margin-top: 10px; color: var(--muted); font-size: 11px; }
.feedback-box { margin-top: 14px; padding: 14px; border: 1px solid #e3d8cb; border-radius: 14px; background: #fff; text-align: left; }
.feedback-box h3 { margin: 5px 0 4px; font-size: 15px; }
.feedback-box p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.feedback-box .secondary { margin-top: 12px; }
.feedback-score { flex: none; color: var(--accent); font-size: 28px; font-weight: 850; line-height: 1; }
.feedback-score span { color: var(--muted); font-size: 11px; font-weight: 500; }
.transcript { margin-top: 13px; padding: 10px; border-radius: 10px; background: var(--soft); }
.transcript p { color: var(--ink); }
.feedback-list { margin-top: 13px; }
.feedback-list ul { margin: 7px 0 0; padding-left: 18px; color: var(--ink); font-size: 12px; line-height: 1.6; }
.feedback-list li { margin: 4px 0; }
.feedback-list small { display: block; color: var(--muted); line-height: 1.45; }
.next-step { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px #f3d6d2; } }
.result { padding: 20px; margin-top: 18px; border: 1px solid #d8e6db; border-radius: 17px; background: #f1f7f2; }
.score { font-size: 32px; font-weight: 850; color: var(--success); }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; margin-top: 14px; border: 1px solid #e8d9c8; border-radius: 14px; background: #fffaf3; }
.install-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.install-card .secondary { flex: none; color: var(--accent-dark); border-color: #d9c2aa; }
.update-note { margin-top: 10px; color: var(--muted); font-size: 10px; }
.parts-entry { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 18px; }
.parts-entry h3 { margin: 5px 0; }
.parts-entry .secondary { flex: none; }
.parts-tools { margin-top: 18px; }
.parts-tools .card-row { align-items: center; }
.parts-filters { margin: 8px 0 14px; }
.parts-filters .pill { border: 0; cursor: pointer; }
.parts-search { display: flex; gap: 8px; }
.parts-search input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); font: inherit; }
.parts-category { margin-top: 12px; }
.parts-category > p { margin: 5px 0 13px; }
.parts-row { border-top: 1px solid var(--line); padding: 12px 0; }
.parts-row-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.parts-row-heading strong { font-size: 14px; }
.parts-row-heading span { color: var(--muted); font-size: 11px; }
.parts-term { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; }
.parts-term-copy { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.parts-term-copy strong { font-weight: 650; }
.parts-term-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.parts-term-card { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.parts-term-card:last-child { padding-bottom: 0; border-bottom: 0; }
.parts-ipa { margin-top: 4px; color: #6b6259; font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.parts-learning-note { margin-top: 12px !important; line-height: 1.7; }
.parts-usage { margin-top: 8px; }
.parts-usage summary { color: var(--accent-dark); font-size: 12px; cursor: pointer; padding: 5px 0; }
.parts-reading { margin: 7px 0 !important; font-size: 12px; line-height: 1.7; }
.parts-example { padding: 12px; margin-top: 8px; border-radius: 12px; background: var(--soft); }
.parts-example .parts-example-en { margin-top: 8px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.parts-example .parts-example-zh { margin: 6px 0 9px; font-size: 12px; line-height: 1.65; }
.parts-example .secondary { margin: 4px 5px 0 0; font-size: 11px; padding: 7px 9px; }
.vocab-learning-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.vocab-learning-row:last-child { border-bottom: 0; }
.vocab-learning-row .review-row { border-bottom: 0; }
.vocab-learning-row .vocab-row > div { min-width: 0; }
.vocab-learning-row .vocab-row small { white-space: normal; }
.parts-term-actions { display: flex; flex: none; gap: 5px; }
.parts-term-actions .secondary { padding: 6px 8px; font-size: 11px; }
.parts-term-actions .selected { color: var(--accent); background: var(--soft); }
.parts-source-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
@media (max-width: 420px) { .parts-entry { align-items: flex-start; flex-direction: column; } .parts-entry .secondary { width: 100%; } }
@media (min-width: 620px) { .app-shell { padding-top: 30px; } .screen-title { font-size: 38px; } .content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
