:root {
  color-scheme: light;
  --ink: #14231f;
  --muted: #66766f;
  --line: #d7e5df;
  --paper: #fbfbf6;
  --surface: #ffffff;
  --brand: #146b55;
  --brand-2: #2c9a75;
  --rose: #bd3f64;
  --amber: #b47a1b;
  --blue: #315f91;
  --shadow: 0 16px 38px rgba(25, 50, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(240, 184, 79, 0.16), transparent 32%),
    linear-gradient(90deg, rgba(20, 107, 85, 0.08) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(251, 251, 246, 0));
}

.kicker {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.15;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.study-status,
.progress-panel,
.stage-card,
.panel,
.dialogue-card,
.review-card,
.review-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.study-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
  padding: 12px;
}

.study-status span,
.daily-main span,
.stage-eyebrow,
.dialogue-header span,
.review-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.study-status strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.progress-panel {
  margin-bottom: 12px;
  padding: 12px;
}

.daily-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.daily-main strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

#dailyAdvice {
  max-width: 66%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.progress-track {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f0ec;
}

.progress-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 180ms ease;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.stage-pill {
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 850;
}

.stage-pill span {
  display: grid;
  width: 22px;
  height: 22px;
  margin: 0 auto 3px;
  place-items: center;
  border-radius: 50%;
  background: #edf5f1;
}

.stage-pill.is-current {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.stage-pill.is-current span {
  color: var(--brand);
  background: #fff;
}

.completion-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 107, 85, 0.22);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #2c9a75 56%, #d79a31);
  box-shadow: var(--shadow);
}

.completion-strip span {
  font-size: 13px;
  font-weight: 900;
}

.completion-strip strong {
  font-size: 22px;
}

.stage-card {
  min-height: 430px;
  padding: 16px;
}

.stage-eyebrow {
  margin-bottom: 14px;
  color: var(--brand);
}

.word-hero,
.quiz-focus,
.sentence-focus {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 248px;
  padding: 20px 14px;
  border-radius: 8px;
  text-align: center;
  background: linear-gradient(180deg, #f8fcfa, #ffffff);
}

.word-hero span,
.quiz-focus span,
.sentence-focus span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.word-hero h2,
.quiz-focus h2,
.sentence-focus h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.12;
}

.word-hero strong {
  color: var(--brand);
  font-size: 24px;
}

.phonetic {
  margin-bottom: 0;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.daily-complete {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  min-height: min(76vh, 720px);
  overflow: hidden;
  padding: 34px 16px 24px;
  border-radius: 8px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 213, 95, 0.34), transparent 32%),
    linear-gradient(160deg, #ffffff 0%, #f2fff8 58%, #fff7df 100%);
}

.celebration-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.celebration-burst span {
  position: absolute;
  width: 10px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand-2);
  transform: rotate(22deg);
}

.celebration-burst span:nth-child(1) {
  top: 10%;
  left: 14%;
  background: #d79a31;
}

.celebration-burst span:nth-child(2) {
  top: 15%;
  right: 18%;
  background: var(--rose);
  transform: rotate(-28deg);
}

.celebration-burst span:nth-child(3) {
  top: 38%;
  left: 7%;
  background: var(--blue);
  transform: rotate(-12deg);
}

.celebration-burst span:nth-child(4) {
  right: 9%;
  bottom: 24%;
  background: var(--brand);
  transform: rotate(38deg);
}

.celebration-burst span:nth-child(5) {
  bottom: 12%;
  left: 23%;
  background: #d79a31;
  transform: rotate(-42deg);
}

.celebration-burst span:nth-child(6) {
  top: 27%;
  right: 6%;
  background: #d79a31;
  transform: rotate(12deg);
}

.celebration-burst span:nth-child(7) {
  top: 58%;
  left: 12%;
  background: var(--rose);
  transform: rotate(52deg);
}

.reward-medal {
  display: grid;
  width: 138px;
  height: 138px;
  align-content: center;
  gap: 2px;
  place-items: center;
  border: 10px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 42%),
    linear-gradient(135deg, #0f6b55, #25a36e 58%, #d9982e);
  box-shadow: 0 22px 54px rgba(20, 107, 85, 0.3);
}

.reward-medal span {
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

.reward-medal strong {
  font-size: 58px;
  font-weight: 1000;
  line-height: 1;
}

.daily-complete h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(36px, 7vw, 62px);
  line-height: 1.05;
}

.complete-copy {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.xp-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid rgba(180, 122, 27, 0.24);
  border-radius: 999px;
  color: #6a4307;
  background: #fff4c9;
  box-shadow: 0 10px 24px rgba(180, 122, 27, 0.12);
}

.xp-ribbon span {
  font-size: 13px;
  font-weight: 900;
}

.xp-ribbon strong {
  font-size: 24px;
}

.complete-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 520px);
}

.complete-stats div {
  padding: 12px 8px;
  border: 1px solid #dceae4;
  border-radius: 8px;
  background: #fff;
}

.complete-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.complete-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.complete-path {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  width: min(100%, 540px);
}

.complete-path span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d7e5df;
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 950;
}

.complete-path span.is-done {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.completed-lessons {
  display: grid;
  gap: 7px;
  width: min(100%, 560px);
  padding: 12px;
  border: 1px solid #dceae4;
  border-radius: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
}

.completed-lessons > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.completed-lessons p {
  display: grid;
  grid-template-columns: minmax(86px, 0.34fr) 1fr;
  gap: 8px;
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid #edf3f0;
}

.completed-lessons strong {
  color: var(--brand);
  font-size: 13px;
}

.completed-lessons em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.word-strip {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.word-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 11px 12px;
  border: 1px solid #dfebe6;
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: #fbfefa;
}

.word-chip strong {
  font-size: 17px;
}

.word-chip span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.word-chip em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
}

.word-chip.is-current {
  border-color: var(--brand);
  background: #eaf7f1;
}

.main-sentence {
  margin-bottom: 6px;
  font-size: 30px;
  font-weight: 850;
  line-height: 1.18;
}

.answer {
  margin-bottom: 0;
  color: var(--brand);
  font-size: 28px;
  font-weight: 900;
}

.is-hidden {
  visibility: hidden;
}

.quiz-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.score-line {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
}

.option-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quiz-option {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: #fff;
}

.quiz-option.is-right {
  border-color: var(--brand-2);
  background: #e8f8ef;
}

.quiz-option.is-wrong {
  border-color: var(--rose);
  background: #fff0f4;
}

.quiz-feedback {
  min-height: 42px;
  margin: 12px 0 10px;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f4f8f6;
}

.quiz-feedback.is-right {
  color: var(--brand);
  background: #e8f8ef;
}

.quiz-feedback.is-wrong {
  color: var(--rose);
  background: #fff0f4;
}

.pattern-focus {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pattern,
.line,
.review-step {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: #f4f8f6;
}

.pattern strong,
.line strong {
  display: block;
  margin-bottom: 4px;
}

.pattern span,
.line span {
  color: var(--muted);
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mode {
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

.mode.is-selected {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.dialogue-card,
.review-card,
.review-hero,
.panel {
  margin-top: 12px;
  padding: 14px;
}

.dialogue-header,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dialogue-header strong {
  display: block;
  margin-top: 2px;
}

.dialogue-lines {
  display: grid;
  gap: 10px;
}

.line {
  border-left: 4px solid var(--brand-2);
}

.line.user-turn {
  border-left-color: var(--rose);
  background: #fff5f8;
}

.line small {
  color: var(--muted);
  font-weight: 850;
}

.line .speak-yourself {
  color: var(--rose);
  font-size: 17px;
  font-weight: 850;
}

.coach-text {
  color: var(--muted);
  line-height: 1.6;
}

.review-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-hero h2,
.review-card h2 {
  margin-bottom: 0;
}

#reviewAnswer {
  min-height: 54px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 18px;
}

#reviewAnswer strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

#reviewAnswer span {
  display: block;
  color: var(--brand);
  font-size: 15px;
  line-height: 1.45;
}

.review-show-answer,
.review-start {
  width: 100%;
  margin-top: 10px;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.timeline,
.plan-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.review-step {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.flow-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.tiny-button,
.mode {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.secondary-button {
  color: var(--brand);
  background: #e8f4ef;
}

.danger-button {
  color: #fff;
  background: var(--rose);
}

.ghost-button,
.tiny-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.listen-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.focus-empty {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.intensity-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.intensity-control button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
}

.intensity-control button.is-selected {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.vocabulary-panel {
  display: grid;
  gap: 12px;
}

.vocab-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vocab-dashboard div,
.vocab-memory div {
  padding: 9px 8px;
  border: 1px solid #dceae4;
  border-radius: 8px;
  text-align: center;
  background: #f8fcfa;
}

.vocab-dashboard span,
.vocab-memory span,
.vocab-card-head span,
.vocab-source span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.vocab-dashboard strong,
.vocab-memory strong {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
}

.vocab-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vocab-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
}

.vocab-tabs button.is-selected {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.vocab-focus-shell {
  display: grid;
  gap: 12px;
}

.vocab-focus-meter {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dceae4;
  border-radius: 8px;
  background: #f8fcfa;
}

.vocab-focus-meter > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vocab-focus-meter span,
.vocab-preview > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.vocab-focus-meter strong {
  color: var(--brand);
  font-size: 14px;
}

.vocab-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3eee9;
}

.vocab-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #146b55, #f0b44c);
}

.vocab-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: 390px;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 252, 250, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(240, 180, 76, 0.16), transparent 42%);
}

.vocab-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vocab-term-block {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  margin: auto 0;
}

.vocab-card h2 {
  margin: 0;
  max-width: 100%;
  color: #10251f;
  font-size: 52px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.vocab-term-block > strong {
  color: var(--brand);
  font-size: 28px;
}

.vocab-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 10px;
}

.vocab-source {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 8px;
  background: #eef7f3;
}

.vocab-source p {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}

.vocab-source em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.vocab-memory,
.vocab-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vocab-memory {
  align-self: stretch;
}

.vocab-memory div {
  display: grid;
  align-content: center;
}

.vocab-actions {
  width: 100%;
}

.vocab-next {
  width: 100%;
}

.vocab-preview {
  display: grid;
  gap: 8px;
}

.vocab-preview > div {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.vocab-preview-item {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: 132px;
  max-width: 180px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #f4f8f6;
}

.vocab-preview-item strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocab-preview-item span {
  color: var(--muted);
  font-size: 13px;
}

.vocab-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 320px;
  padding: 30px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: #fff;
}

.vocab-empty h2 {
  margin: 0;
  font-size: 30px;
}

.vocab-empty p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.voice-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.voice-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.voice-picker select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.voice-status {
  margin: 8px 0 12px;
  padding: 10px;
  border-radius: 8px;
  color: var(--rose);
  background: #fff0f4;
  font-size: 13px;
  line-height: 1.45;
}

.voice-status.is-ready {
  color: var(--brand);
  background: #e8f8ef;
}

.plan-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #f4f8f6;
}

.plan-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  background: var(--brand);
}

.plan-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.record-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cloud-sync {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sync-status {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #f4f8f6;
  font-size: 13px;
  line-height: 1.45;
}

.github-login {
  width: 100%;
}

.sync-hint {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sync-email {
  display: grid;
  gap: 6px;
}

.sync-email span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.sync-email input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.nav-item {
  height: 48px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf4f1;
  font-size: 16px;
  font-weight: 900;
}

.nav-item.is-active {
  color: #fff;
  background: var(--brand);
}

@media (min-width: 700px) {
  .app-shell {
    padding-inline: 24px;
  }

  .stage-card,
  .panel {
    padding: 20px;
  }

  .word-strip,
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .stage-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-main {
    align-items: flex-start;
    flex-direction: column;
  }

  #dailyAdvice {
    max-width: none;
    text-align: left;
  }

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

  .word-hero h2,
  .quiz-focus h2,
  .main-sentence {
    font-size: 28px;
  }

  .daily-complete {
    min-height: 70vh;
    padding: 28px 10px;
  }

  .complete-stats {
    grid-template-columns: 1fr;
  }

  .complete-actions {
    width: 100%;
  }

  .complete-actions button {
    flex: 1 1 150px;
  }

  .reward-medal {
    width: 118px;
    height: 118px;
  }

  .completed-lessons p {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .vocab-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vocab-focus-meter > div:first-child {
    align-items: flex-start;
  }

  .vocab-card {
    min-height: 360px;
    padding: 20px 14px;
  }

  .vocab-card h2 {
    font-size: 40px;
  }

  .vocab-term-block > strong {
    font-size: 24px;
  }

  .vocab-actions,
  .vocab-memory,
  .vocab-context-grid {
    grid-template-columns: 1fr;
  }

  .vocab-preview-item {
    min-width: 118px;
  }

  .bottom-nav {
    gap: 6px;
  }

  .nav-item {
    font-size: 14px;
  }
}
