:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #23211d;
  --muted: #6a6258;
  --line: #ded6c8;
  --accent: #1f6f6d;
  --accent-strong: #155250;
  --accent-soft: #dfeeed;
  --gold: #a56a1f;
  --red: #a13d37;
  --green: #2f7a45;
  --shadow: 0 18px 40px rgba(40, 34, 25, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(31, 111, 109, 0.08), transparent 340px),
    var(--paper);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.lesson-active .topbar {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lesson-active .topbar > div:first-child {
  display: none;
}

.lesson-active .status-pill {
  min-width: 0;
  padding: 8px 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: 2.25rem;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-pill,
.timebox {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.status-pill small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 760px;
  margin: 0 auto;
}

.mode-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  max-width: 820px;
  margin: 0 auto;
  padding: 18px;
}

.mode-menu-copy {
  max-width: none;
}

.mode-menu:not(.daily-panel-open) .home-status-strip,
.mode-menu:not(.daily-panel-open) .home-streak-strip,
.mode-menu:not(.daily-panel-open) .home-path,
.mode-menu:not(.daily-panel-open) .home-main-path,
.mode-menu:not(.daily-panel-open) .mode-route,
.mode-menu:not(.daily-panel-open) .level-guide,
.mode-menu:not(.daily-panel-open) .resume-card {
  display: none;
}

.mode-lead {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
}

.mode-route {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 8px 12px;
}

.menu-audit-direct {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.support-footer {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.support-footer::before {
  content: "辅助功能";
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.mode-route span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.mode-route strong,
.mode-route em {
  font-style: normal;
  font-weight: 800;
}

.quality-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(161, 61, 55, 0.22);
  border-radius: 8px;
  background: rgba(161, 61, 55, 0.06);
  padding: 12px;
}

.support-footer .quality-note {
  border-color: rgba(222, 214, 200, 0.9);
  background: rgba(255, 253, 248, 0.72);
}

.usage-guide {
  margin-top: 12px;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: rgba(223, 238, 237, 0.62);
  padding: 10px 12px;
}

.usage-guide summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 900;
}

.usage-guide ol {
  margin: 10px 0 8px;
  padding-left: 20px;
}

.usage-guide li {
  margin-bottom: 7px;
  line-height: 1.55;
}

.usage-guide p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.usage-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.usage-guide-actions button {
  min-height: 40px;
}

.level-guide {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.level-guide button {
  appearance: none;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(222, 214, 200, 0.88);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.level-guide button.selected {
  border-color: rgba(31, 111, 109, 0.42);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(31, 111, 109, 0.08);
}

.level-guide button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.level-guide strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.level-guide span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.quality-note strong {
  color: var(--red);
  font-size: 0.9rem;
}

.quality-note span {
  color: var(--muted);
  line-height: 1.55;
}

.audit-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(31, 111, 109, 0.26);
  border-radius: 8px;
  background: rgba(223, 238, 237, 0.72);
  padding: 12px;
}

.audit-invite strong,
.audit-invite span {
  display: block;
}

.audit-invite strong {
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.audit-invite span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.55;
}

.audit-link {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.audit-link:hover,
.audit-link:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.resume-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid rgba(31, 111, 109, 0.3);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 14px;
}

.resume-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.resume-card strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.home-start-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 14px;
}

.home-start-card span {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.home-start-card strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.25;
}

.home-start-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.home-prep-preview {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.home-prep-label {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-prep-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-prep-chip {
  min-width: 92px;
  border: 1px solid rgba(31, 111, 109, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  padding: 7px 8px;
}

.home-prep-chip strong {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

.home-prep-chip em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.home-start-card button {
  min-width: 132px;
  min-height: 48px;
}

.home-start-card .primary-button {
  min-height: 56px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(31, 111, 109, 0.18);
}

.home-mobile-start-bar {
  display: none;
}

.first-three-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.first-three-copy {
  min-width: 0;
}

.first-three-copy span {
  display: block;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.first-three-copy strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.first-three-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.first-three-steps {
  display: flex;
  gap: 6px;
}

.first-three-steps span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(31, 111, 109, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 950;
}

.first-three-steps span.done {
  border-color: rgba(47, 122, 69, 0.32);
  background: var(--green);
  color: #fff;
}

.first-three-steps span.current {
  border-color: rgba(31, 111, 109, 0.42);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(31, 111, 109, 0.08);
}

.first-three-plan.complete {
  border-color: rgba(47, 122, 69, 0.24);
  background: #eef6ef;
}

.first-three-plan button {
  min-height: 42px;
  white-space: nowrap;
}

.stage-gate-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  border: 1px solid rgba(161, 61, 55, 0.22);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fff8ee;
  padding: 12px;
}

.stage-gate-notice[hidden] {
  display: none;
}

.stage-gate-notice span {
  display: block;
  color: var(--warn);
  font-size: 0.78rem;
  font-weight: 950;
}

.stage-gate-notice strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.stage-gate-notice p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.stage-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage-gate-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.home-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.home-status-strip div {
  min-height: 66px;
  border: 1px solid rgba(222, 214, 200, 0.86);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  padding: 10px;
}

.home-status-strip span {
  display: block;
  color: var(--accent-strong);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.1;
}

.home-status-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.home-streak-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(222, 214, 200, 0.86);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  padding: 10px;
}

.home-streak-head span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.home-streak-head strong {
  display: block;
  margin-top: 2px;
  color: var(--accent-strong);
  font-size: 0.88rem;
  line-height: 1.2;
}

.home-streak-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.home-streak-day {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(222, 214, 200, 0.78);
  border-radius: 8px;
  background: var(--surface);
}

.home-streak-day i {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.home-streak-day em {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(128, 116, 100, 0.12);
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
}

.home-streak-day.active {
  border-color: rgba(47, 122, 69, 0.3);
  background: #eef6ef;
}

.home-streak-day.active em {
  background: var(--green);
  color: #fff;
}

.home-streak-day.today {
  border-color: rgba(31, 111, 109, 0.36);
}

.home-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.daily-path-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: end;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(223, 238, 237, 0.62);
  padding: 9px 10px;
}

.daily-path-head span {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.daily-path-head strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.2;
}

.daily-path-head em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.home-path-step {
  appearance: none;
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: center;
  min-height: 78px;
  border: 1px solid rgba(222, 214, 200, 0.88);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 8px 6px;
  text-align: center;
  touch-action: manipulation;
}

.home-path-step:hover,
.home-path-step:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.home-path-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.12);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.home-path-step strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.2;
}

.home-path-step em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
}

.home-path-step.active {
  border-color: rgba(31, 111, 109, 0.42);
  background: var(--accent-soft);
}

.home-path-step.done {
  border-color: rgba(47, 122, 69, 0.3);
  background: #eef6ef;
}

.home-path-step.done span {
  background: var(--green);
  color: #fff;
}

.home-path-step.bonus,
.daily-path-step.bonus {
  border-style: dashed;
  background: rgba(255, 253, 248, 0.78);
}

.home-path-step.bonus span,
.daily-path-step.bonus span {
  background: rgba(165, 106, 31, 0.13);
  color: var(--gold);
}

.home-path-step.bonus.active,
.daily-path-step.bonus.active {
  border-color: rgba(165, 106, 31, 0.42);
  background: rgba(165, 106, 31, 0.08);
}

.home-main-path {
  margin-top: 10px;
  border: 1px solid rgba(222, 214, 200, 0.86);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  padding: 11px;
}

.home-main-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.home-main-path-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-main-path-head strong {
  color: var(--accent-strong);
  font-size: 0.9rem;
  line-height: 1.25;
}

.home-main-path-note {
  margin: -3px 0 9px;
  border-left: 3px solid rgba(165, 106, 31, 0.45);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
  padding-left: 8px;
}

.home-main-coach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
}

.home-main-coach span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.home-main-coach strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
}

.home-main-coach p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.38;
}

.home-main-path-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.home-main-stage {
  appearance: none;
  min-height: 72px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(222, 214, 200, 0.86);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 7px 5px;
  text-align: center;
  touch-action: manipulation;
}

.home-main-stage:hover,
.home-main-stage:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.home-main-stage:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.home-main-stage span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(128, 116, 100, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.home-main-stage strong {
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.18;
}

.home-main-stage em {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.12;
}

.home-main-stage.current {
  border-color: rgba(31, 111, 109, 0.38);
  background: var(--accent-soft);
}

.home-main-stage.current span {
  background: var(--accent);
  color: #fff;
}

.home-main-stage.complete {
  border-color: rgba(47, 122, 69, 0.28);
  background: #eef6ef;
}

.home-main-stage.complete span {
  background: var(--green);
  color: #fff;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.menu-actions .primary-button,
.menu-actions .secondary-button {
  min-height: 44px;
}

.daily-task-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid rgba(31, 111, 109, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf1, var(--surface-strong));
  padding: 16px;
}

.daily-task-head { order: 0; }
.daily-hero { order: 1; }
.daily-required-card { order: 2; }
.daily-bonus-section { order: 3; }
.daily-save-strip { order: 4; }
.save-progress-card { order: 5; }
.daily-path { order: 6; }
.daily-coach-card { order: 7; }
.daily-task-grid { order: 8; }

.daily-panel-open {
  max-width: 760px;
}

.daily-panel-open .mode-route,
.daily-panel-open .usage-guide,
.daily-panel-open .level-guide,
.daily-panel-open .resume-card,
.daily-panel-open .home-start-card,
.daily-panel-open .first-three-plan,
.daily-panel-open .home-mobile-start-bar,
.daily-panel-open .stage-gate-notice,
.daily-panel-open .home-status-strip,
.daily-panel-open .home-streak-strip,
.daily-panel-open .home-path,
.daily-panel-open .home-main-path,
.daily-panel-open .mode-options,
.daily-panel-open .support-footer {
  display: none;
}

.daily-panel-open .mode-lead,
.daily-panel-open .menu-actions {
  display: none;
}

.daily-panel-open .mode-menu-copy > .eyebrow,
.daily-panel-open .mode-menu-copy > #modeMenuTitle {
  display: none;
}

.mode-menu.daily-panel-open .level-guide {
  display: none;
}

.daily-panel-open .mode-menu-copy {
  margin-bottom: 0;
}

.daily-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-task-head > div {
  min-width: 0;
}

.daily-task-head > .small-button {
  flex: 0 0 auto;
  min-width: 76px;
  white-space: nowrap;
}

.daily-task-head p:last-child,
.daily-card-note {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.daily-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.daily-hero-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 14px;
}

.daily-hero-copy span {
  color: var(--accent-strong);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.1;
}

.daily-hero-copy strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.daily-hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.daily-power {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.daily-power > span {
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.daily-power-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.14);
}

.daily-power-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.daily-hero-copy em {
  width: fit-content;
  border: 1px solid rgba(31, 111, 109, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.daily-challenge-button {
  appearance: none;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(31, 111, 109, 0.34);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
  touch-action: manipulation;
}

.daily-challenge-button:hover,
.daily-challenge-button:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.daily-challenge-button span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
}

.daily-challenge-button strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.2;
}

.daily-task-panel.daily-complete .daily-hero-copy {
  border-color: rgba(47, 122, 69, 0.38);
  background: #eef6ef;
}

.daily-task-panel.daily-complete .daily-power-bar i {
  background: var(--green);
}

.daily-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(222, 214, 200, 0.82);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  padding: 10px;
}

.daily-path-step {
  appearance: none;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  min-height: 86px;
  border: 1px solid rgba(222, 214, 200, 0.9);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 8px 6px;
  text-align: center;
  touch-action: manipulation;
}

.daily-path-step:hover,
.daily-path-step:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.daily-path-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.12);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

.daily-path-step strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
}

.daily-path-step em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.daily-path-step.active {
  border-color: rgba(31, 111, 109, 0.42);
  background: var(--accent-soft);
}

.daily-path-step.done {
  border-color: rgba(47, 122, 69, 0.3);
  background: #eef6ef;
}

.daily-path-step.done span {
  background: var(--green);
  color: #fff;
}

.daily-task-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.daily-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(222, 214, 200, 0.82);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  padding: 10px;
}

.daily-required-card,
.daily-bonus-section {
  border: 1px solid rgba(222, 214, 200, 0.82);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  padding: 12px;
}

.daily-required-card {
  border-color: rgba(31, 111, 109, 0.24);
  background: #f6fbf8;
}

.daily-section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-bonus-section .daily-action-grid {
  margin-top: 10px;
  border: 0;
  background: transparent;
  padding: 0;
}

.daily-coach-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(31, 111, 109, 0.24);
  border-radius: 8px;
  background: #f2faf8;
  padding: 12px;
}

.daily-coach-card[hidden] {
  display: none;
}

.daily-coach-card span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.12);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
}

.daily-coach-card h3 {
  margin: 7px 0 4px;
  font-size: 1.02rem;
  line-height: 1.2;
}

.daily-coach-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.daily-coach-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.daily-coach-card li {
  border: 1px solid rgba(31, 111, 109, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

.daily-coach-card button {
  min-width: 132px;
  min-height: 48px;
}

.daily-action-grid button,
.save-progress-form button,
.progress-recovery-form button {
  min-height: 48px;
}

.daily-action-grid button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
}

.daily-action-grid button span {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0.82;
}

.daily-action-grid button strong {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.daily-action-grid .primary-button strong {
  font-size: 1.08rem;
}

.daily-save-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: #eef6ef;
  padding: 12px;
}

.daily-save-strip span {
  display: block;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
}

.daily-save-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
}

.daily-save-strip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.daily-save-strip button {
  min-width: 132px;
  min-height: 48px;
  white-space: nowrap;
}

.save-progress-priority {
  border-color: rgba(31, 111, 109, 0.28);
  background: #fffefa;
}

.save-progress-priority[open] {
  box-shadow: 0 10px 24px rgba(40, 34, 25, 0.08);
}

.daily-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.daily-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(222, 214, 200, 0.92);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.daily-card .section-heading > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.daily-wide {
  grid-column: 1 / -1;
}

.main-milestone-card > strong {
  color: var(--accent-strong);
  font-size: 1.15rem;
  line-height: 1.35;
}

.main-milestone-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.main-milestone-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.14);
}

.main-milestone-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

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

.achievement-badge {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(222, 214, 200, 0.88);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.achievement-badge .badge-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.12);
  color: var(--accent-strong);
  font-size: 1.02rem;
  font-weight: 900;
}

.achievement-badge strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.25;
}

.achievement-badge span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.28;
}

.achievement-badge.unlocked {
  border-color: rgba(47, 122, 69, 0.3);
  background: #eef6ef;
}

.achievement-badge.unlocked .badge-icon {
  background: var(--green);
  color: #fff;
}

.achievement-badge.locked {
  opacity: 0.68;
}

.achievement-badge.locked .badge-icon {
  background: rgba(128, 116, 100, 0.12);
  color: var(--muted);
}

.daily-task-list,
.prep-vocab-list,
.daily-review-list,
.daily-trend-list {
  display: grid;
  gap: 8px;
}

.daily-task-item {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(222, 214, 200, 0.86);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 9px 10px;
  text-align: left;
  touch-action: manipulation;
}

.daily-task-item:hover,
.daily-task-item:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.daily-task-item.done {
  border-color: rgba(47, 122, 69, 0.28);
  background: rgba(47, 122, 69, 0.08);
}

.daily-task-item.bonus {
  border-style: dashed;
  background: rgba(255, 253, 248, 0.72);
}

.daily-task-item.bonus .daily-check {
  border-color: rgba(165, 106, 31, 0.34);
  background: rgba(165, 106, 31, 0.12);
  color: var(--gold);
}

.daily-check {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 999px;
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.daily-task-item strong,
.prep-vocab-item strong,
.daily-review-item strong,
.daily-trend-item strong {
  display: block;
  color: var(--ink);
  font-weight: 900;
}

.daily-review-item {
  position: relative;
  padding-right: 92px;
}

.daily-review-item em {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: 78px;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 3px 7px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.daily-review-item.urgent {
  border-color: rgba(161, 61, 55, 0.28);
  background: rgba(161, 61, 55, 0.06);
}

.daily-review-item.urgent em {
  border-color: rgba(161, 61, 55, 0.22);
  background: rgba(161, 61, 55, 0.1);
  color: var(--red);
}

.daily-task-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.daily-task-item em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.prep-vocab-item,
.daily-trend-item,
.daily-review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.daily-review-item {
  appearance: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.daily-review-item:hover,
.daily-review-item:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.prep-vocab-item span,
.daily-review-item span,
.daily-trend-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.prep-vocab-bottom-action {
  width: 100%;
  margin-top: 10px;
}

.save-progress-card {
  align-content: start;
}

.save-progress-card summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 900;
  list-style-position: inside;
}

.save-progress-card summary::marker {
  color: var(--accent);
}

.save-progress-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.save-progress-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.progress-code-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(38, 125, 87, 0.18);
  border-radius: 8px;
  background: rgba(38, 125, 87, 0.06);
  padding: 12px;
}

.progress-code-box[hidden] {
  display: none;
}

.progress-code-box strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.progress-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.progress-code-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(38, 125, 87, 0.22);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.progress-recovery-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px dashed rgba(31, 111, 109, 0.24);
  padding-top: 12px;
}

.progress-recovery-box strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.progress-recovery-form {
  display: grid;
  grid-template-columns: 0.9fr 0.7fr auto;
  gap: 8px;
}

.progress-recovery-form select,
.progress-recovery-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mode-card {
  appearance: none;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 16px;
  text-align: left;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(31, 111, 109, 0.16);
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.mode-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mode-link-card {
  border-color: rgba(161, 61, 55, 0.3);
  background: rgba(161, 61, 55, 0.06);
}

.mode-link-card strong {
  color: var(--red);
}

.mode-card .mode-tag {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.mode-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 1.2rem;
}

.mode-card p,
.mode-card .mode-summary {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.42;
}

.mode-card .mode-summary {
  color: var(--ink);
  font-weight: 700;
}

.mode-progress {
  display: block;
  margin: auto 0 0;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(223, 238, 237, 0.64);
  color: var(--accent-strong);
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
}

.mode-link-card .mode-progress {
  border-color: rgba(161, 61, 55, 0.22);
  background: rgba(161, 61, 55, 0.08);
  color: var(--red);
}

.mode-details {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
}

.mode-detail-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 999px;
  background: #f3eee5;
  padding: 5px 8px;
}

.mode-detail-key {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-detail-value {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

@media (min-width: 901px) {
  .mode-menu:not(.daily-panel-open) {
    max-width: 1080px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 16px;
    align-items: start;
  }

  .mode-menu:not(.daily-panel-open) .mode-menu-copy {
    display: contents;
  }

  .mode-menu:not(.daily-panel-open) .mode-menu-copy > .eyebrow,
  .mode-menu:not(.daily-panel-open) .mode-menu-copy > h2,
  .mode-menu:not(.daily-panel-open) .mode-menu-copy > .mode-lead,
  .mode-menu:not(.daily-panel-open) .mode-menu-copy > .home-start-card,
  .mode-menu:not(.daily-panel-open) .mode-menu-copy > .first-three-plan,
  .mode-menu:not(.daily-panel-open) .mode-menu-copy > .menu-actions,
  .mode-menu:not(.daily-panel-open) .mode-options {
    grid-column: 1;
  }

  .mode-menu:not(.daily-panel-open) .support-footer {
    grid-column: 2;
    grid-row: 1 / span 8;
    margin-top: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-top: 0;
    padding-left: 16px;
  }

  .mode-menu:not(.daily-panel-open) .mode-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
  }

  .mode-menu:not(.daily-panel-open) .mode-card {
    padding: 13px;
  }

  .mode-menu:not(.daily-panel-open) .home-start-card {
    margin-top: 8px;
  }
}

.lesson-stage,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.lesson-stage {
  padding: 16px;
}

.side-panel {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  position: static;
}

.lesson-meta,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.lesson-meta .eyebrow {
  display: none;
}

.lesson-meta h2 {
  font-size: 1.2rem;
}

.mode-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.mode-inline span {
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 800;
}

.timebox,
.step-strip,
.ladder-actions,
.completion-gate,
.mode-suggestion,
.shadow-tools {
  display: none !important;
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.lesson-active:not(.immersion-active) .step-strip {
  display: grid !important;
}

.step {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.step.done {
  border-color: rgba(47, 122, 69, 0.42);
  background: #eef6ef;
  color: var(--green);
}

.step.done.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.listen-panel,
.choice-area,
.reveal-area,
.queue-panel,
.vocab-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.reading-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf6ec;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.reading-panel span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.reading-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ladder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
  margin-bottom: 12px;
}

.ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.ladder-head strong {
  color: var(--accent-strong);
}

.ladder-panel p {
  min-height: 56px;
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ladder-panel ruby {
  ruby-position: over;
}

.ladder-panel rt {
  color: var(--accent-strong);
  font-size: 0.58em;
  font-weight: 700;
}

.pending-reading {
  display: inline-block;
  border-bottom: 3px solid var(--accent);
  color: var(--accent-strong);
}

.ladder-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ladder-dots span {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e8dfd0;
}

.ladder-dots span.active {
  background: var(--accent);
}

.ladder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.completion-gate {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 8px;
  background: #eef6ef;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.completion-gate.locked {
  border-color: var(--line);
  background: #fbf6ec;
}

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

.gate-copy span {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.gate-copy strong {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: right;
}

.gate-meter {
  height: 8px;
  border-radius: 999px;
  background: #e8dfd0;
  overflow: hidden;
}

.gate-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.first-three-study {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: #f5fbf8;
  padding: 10px 12px;
}

.first-three-study[hidden] {
  display: none;
}

.first-three-study.card-complete {
  border-color: rgba(47, 122, 69, 0.34);
  background: #eef6ef;
}

.first-three-study.complete {
  border-color: rgba(47, 122, 69, 0.38);
}

.first-three-study span {
  display: inline-block;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.2;
}

.first-three-study strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.3;
}

.first-three-study p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.first-three-study-steps {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.first-three-study-steps span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(31, 111, 109, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
}

.first-three-study-steps span.current {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(31, 111, 109, 0.12);
}

.first-three-study-steps span.done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.short-clip-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 12px;
  border: 1px solid rgba(188, 111, 33, 0.28);
  border-radius: 8px;
  background: #fff8ee;
  padding: 10px 12px;
}

.short-clip-hint[hidden] {
  display: none;
}

.short-clip-hint strong {
  display: block;
  color: #8b4a12;
  font-size: 0.96rem;
  line-height: 1.3;
}

.short-clip-hint p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 560px) {
  .first-three-study {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 8px 10px;
  }

  .first-three-study p {
    display: none;
  }

  .short-clip-hint {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .first-three-study-steps {
    width: auto;
  }

  .first-three-study-steps span {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
  }
}

.audio-display {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
}

.audio-copy {
  min-width: 0;
}

.prompt-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.prompt-text {
  margin-bottom: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
}

.icon-button {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-size: 1.4rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.icon-button.primary {
  width: 68px;
  height: 68px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 1.8rem;
}

.control-row,
.stage-actions,
.shadow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.control-row {
  margin-top: 12px;
}

.simple-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.simple-actions .text-button {
  min-width: 118px;
}

.quick-speed-button.active {
  border-color: rgba(161, 61, 55, 0.45);
  background: rgba(161, 61, 55, 0.1);
  color: var(--danger);
}

.advanced-controls,
.advanced-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  padding: 10px 12px;
}

.advanced-controls {
  margin-top: 10px;
}

.advanced-controls summary,
.advanced-panel summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.advanced-controls summary::-webkit-details-marker,
.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-controls summary::after,
.advanced-panel summary::after {
  content: "展开";
  float: right;
  color: var(--accent-strong);
  font-size: 0.84rem;
}

.advanced-controls[open] summary::after,
.advanced-panel[open] summary::after {
  content: "收起";
}

.advanced-controls .control-row,
.advanced-panel > section {
  margin-top: 12px;
}

.advanced-controls:not([open]) .control-row,
.advanced-panel:not([open]) > section {
  display: none;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.preview-subtitle {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.preview-subtitle.masked {
  background: #fbf6ec;
}

.immersion-active .step-strip,
.immersion-active .listen-panel,
.immersion-active .choice-area,
.immersion-active .reveal-area,
.immersion-active .stage-actions,
.immersion-active .mobile-bottom-actions,
.immersion-active .side-panel {
  display: none !important;
}

.immersion-panel {
  display: grid;
  gap: 14px;
}

.immersion-panel[hidden] {
  display: none;
}

.immersion-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(31, 111, 109, 0.24);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 16px;
}

.immersion-round-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.immersion-round-status span {
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 900;
}

.immersion-hero h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.immersion-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--accent-strong);
  line-height: 1.55;
}

.immersion-subtitles {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf6ec;
  padding: 10px;
}

.immersion-line {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.immersion-line.active {
  border-color: rgba(31, 111, 109, 0.48);
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, rgba(31, 111, 109, 0.1) var(--karaoke-progress, 0%), #fff var(--karaoke-progress, 0%));
  box-shadow: 0 12px 28px rgba(40, 34, 25, 0.08);
}

.immersion-line.context {
  border-color: rgba(222, 214, 200, 0.72);
  background: rgba(255, 253, 248, 0.72);
  opacity: 0.78;
}

.immersion-line.complete:not(.active) {
  opacity: 0.74;
}

.immersion-line-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.immersion-ja {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.45;
}

.immersion-line.active .immersion-ja {
  font-size: 1.9rem;
}

.karaoke-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.karaoke-char {
  transition: color 120ms ease, text-shadow 120ms ease;
}

.immersion-line.active .karaoke-char {
  color: #8d877d;
}

.immersion-line.active .immersion-ja .karaoke-char.heard {
  color: var(--accent-strong);
  text-shadow: 0 0 1px rgba(31, 111, 109, 0.22);
}

.immersion-line.active .immersion-reading .karaoke-char.heard {
  color: #7b4a13;
  font-weight: 900;
}

.immersion-reading,
.immersion-zh {
  color: var(--muted);
  line-height: 1.55;
}

.immersion-reading {
  font-size: 1.05rem;
  font-weight: 800;
}

.immersion-line.active .immersion-reading {
  color: #7b4a13;
  font-size: 1.18rem;
}

.immersion-zh {
  border-top: 1px solid rgba(222, 214, 200, 0.9);
  padding-top: 6px;
  font-weight: 700;
}

.immersion-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.immersion-controls .speed-control {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  padding: 0 10px;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 10px;
}

.text-button,
.secondary-button,
.primary-button,
.small-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
}

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

.secondary-button {
  color: var(--accent-strong);
}

.text-button:disabled,
.secondary-button:disabled,
.primary-button:disabled,
.small-button:disabled,
.list-item:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary-button.locked-next {
  border-color: var(--line);
  background: #e8dfd0;
  color: var(--muted);
}

.small-button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.88rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.choice-step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.choice-step-actions .primary-button {
  min-width: 160px;
}

.choice-button {
  min-height: 76px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.choice-lock {
  grid-column: 1 / -1;
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbf6ec;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.choice-button strong {
  font-size: 1.2rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.choice-button ruby {
  ruby-position: over;
}

.choice-button rt {
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
}

.choice-button span {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.choice-button .unit-meaning {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.choice-button.sentence-choice {
  min-height: 92px;
  align-content: center;
}

.choice-button.sentence-choice strong {
  font-size: 1rem;
  line-height: 1.55;
}

.choice-area.repeated-unit {
  border-color: rgba(23, 111, 104, 0.32);
}

.choice-area.repeated-unit #choiceTitle {
  color: var(--accent-strong);
}

.choice-button.correct {
  border-color: var(--green);
  background: #e9f4ec;
}

.choice-button.wrong {
  border-color: var(--red);
  background: #f9e9e7;
}

.choice-button:disabled:not(.correct):not(.wrong) {
  cursor: not-allowed;
  opacity: 0.58;
}

.learning-pulse {
  margin-top: 10px;
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(31, 111, 109, 0.08);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
  padding: 8px 10px;
}

.learning-pulse > span {
  display: block;
}

.learning-burst {
  display: grid;
  gap: 5px;
  margin-bottom: 7px;
}

.learning-burst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.learning-burst-head strong,
.learning-burst-head span {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.2;
}

.learning-burst-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 111, 109, 0.15);
}

.learning-burst-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.learning-burst p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.learning-burst.complete .learning-burst-bar i {
  background: var(--green);
}

.learning-rhythm-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
}

.learning-pulse > span + .learning-rhythm-suggestion {
  margin-top: 7px;
  border-top: 1px solid rgba(31, 111, 109, 0.14);
  padding-top: 7px;
}

.learning-rhythm-suggestion strong {
  color: var(--accent-strong);
  font-size: 0.92rem;
  line-height: 1.25;
}

.learning-rhythm-suggestion p {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.learning-rhythm-suggestion button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 38px;
  white-space: nowrap;
}

.answer-rescue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: 8px;
  background: #fff7ed;
}

.answer-rescue[hidden] {
  display: none;
}

.answer-rescue strong {
  display: block;
  color: #9a3412;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.35;
}

.answer-rescue p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.answer-rescue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.answer-rescue-actions .secondary-button {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.daily-challenge-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 8px;
  background: rgba(238, 247, 244, 0.9);
  padding: 10px;
}

.daily-challenge-ribbon[hidden] {
  display: none;
}

.daily-challenge-ribbon strong {
  display: block;
  color: var(--accent-strong);
  font-size: 0.98rem;
  line-height: 1.25;
}

.daily-challenge-ribbon p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.daily-challenge-ribbon button {
  flex: 0 0 auto;
  min-height: 42px;
}

.learning-reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47, 122, 69, 0.32);
  border-radius: 8px;
  background: #eef6ef;
  padding: 12px;
}

.learning-reward[hidden] {
  display: none;
}

.learning-reward span {
  display: inline-block;
  margin-bottom: 4px;
  border-radius: 999px;
  background: rgba(47, 122, 69, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  padding: 5px 8px;
}

.learning-reward strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.25;
}

.learning-reward p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.learning-reward-stage {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid rgba(47, 122, 69, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 9px;
}

.learning-reward-stage[hidden] {
  display: none;
}

.learning-reward-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.learning-reward .learning-reward-stage-head span,
.learning-reward .learning-reward-stage-head strong {
  display: block;
  margin: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  padding: 0;
}

.learning-reward-stage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 122, 69, 0.14);
}

.learning-reward-stage-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.learning-reward .learning-reward-stage p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.learning-reward-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.learning-reward-meta li {
  border: 1px solid rgba(31, 111, 109, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  padding: 4px 8px;
}

.learning-reward button {
  flex: 0 0 auto;
  min-height: 44px;
}

.learning-reward .primary-button {
  min-width: 168px;
  box-shadow: 0 8px 18px rgba(47, 122, 69, 0.16);
}

.learning-reward-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.learning-reward-actions button {
  white-space: nowrap;
}

.daily-goal-reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(165, 106, 31, 0.34);
  border-radius: 8px;
  background: #fff5dd;
  padding: 13px;
}

.daily-goal-reward[hidden] {
  display: none;
}

.daily-goal-reward span {
  display: inline-block;
  margin-bottom: 4px;
  border-radius: 999px;
  background: rgba(165, 106, 31, 0.13);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  padding: 5px 8px;
}

.daily-goal-reward strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
}

.daily-goal-reward p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.daily-goal-reward-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.daily-goal-reward-actions button {
  min-height: 44px;
}

.answer-status {
  margin-bottom: 14px;
  border-radius: 6px;
  padding: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.answer-status.wrong {
  background: #f9e9e7;
  color: var(--red);
}

.subtitle-stack {
  display: grid;
  gap: 10px;
}

.shadow-practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.shadow-tools {
  display: grid;
  gap: 12px;
}

.lesson-active.sentence-active .shadow-tools {
  display: grid !important;
}

.mode-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 8px;
  background: #eef6ef;
  padding: 12px 14px;
}

.mode-suggestion:not([hidden]) {
  display: flex !important;
}

.mode-suggestion strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
}

.mode-suggestion p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.mode-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.save-progress-inline-action[hidden],
.mobile-save-action[hidden] {
  display: none !important;
}

.save-progress-inline-action {
  box-shadow: 0 8px 18px rgba(31, 111, 109, 0.16);
}

.subtitle-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.subtitle-block span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.subtitle-block p {
  margin-bottom: 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.subtitle-block ruby,
.word-card ruby {
  ruby-position: over;
}

.subtitle-block rt,
.word-card rt {
  color: var(--accent-strong);
  font-size: 0.62em;
  font-weight: 700;
}

.subtitle-block.ja p {
  font-size: 1.48rem;
}

.context-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px 14px;
}

.context-panel summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
}

.context-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.context-panel:not([open]) .context-grid {
  display: none;
}

.context-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.context-grid span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.context-grid p {
  margin-bottom: 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.word-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbf6ec;
}

.word-main {
  margin-bottom: 4px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.word-kana,
.word-meaning {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.word-meaning {
  color: var(--ink);
  font-weight: 700;
}

.explain-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.explain-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.explain-card summary::-webkit-details-marker {
  display: none;
}

.explain-card summary em {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: normal;
  padding: 4px 9px;
}

.explain-card summary::after {
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 999px;
  color: var(--accent-strong);
  content: "展开";
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 9px;
}

.explain-card[open] summary::after {
  content: "收起";
}

.explain-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.explain-card:not([open]) .explain-list {
  display: none;
}

.explain-list div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.explain-list dt {
  color: var(--muted);
  font-weight: 800;
}

.explain-list dd {
  margin: 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.focus-chunk-list {
  display: grid;
  gap: 8px;
}

.focus-chunk {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 6px;
  background: #eef6ef;
  padding: 10px 12px;
}

.focus-chunk strong {
  color: var(--accent-strong);
  font-size: 1.15rem;
}

.focus-chunk small {
  color: var(--muted);
  font-weight: 800;
}

.focus-chunk span {
  color: var(--ink);
}

.focus-chunk em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.shadow-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.shadow-copy {
  min-width: 0;
}

.shadow-panel h3 {
  margin-bottom: 4px;
}

.shadow-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.shadow-action-button {
  width: auto;
  height: auto;
  min-width: 92px;
  min-height: 58px;
  grid-template-rows: auto auto;
  gap: 2px;
  border-radius: 8px;
  padding: 8px 12px;
}

.shadow-action-button.primary {
  width: auto;
  height: auto;
  min-height: 64px;
  border-radius: 8px;
}

.shadow-action-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.shadow-action-button small {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
}

.shadow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.shadow-steps span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 6px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.shadow-steps span.active {
  border-color: rgba(31, 111, 109, 0.42);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.shadow-steps span.done {
  border-color: rgba(47, 122, 69, 0.35);
  background: #eaf5ed;
  color: var(--green);
}

.shadow-status {
  border: 1px solid rgba(31, 111, 109, 0.28);
  border-radius: 8px;
  background: #eef6ef;
  color: var(--accent-strong);
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.45;
}

.shadow-status[data-status="recording"],
.shadow-status[data-status="checking"] {
  border-color: rgba(165, 106, 31, 0.32);
  background: #fff4dd;
  color: var(--gold);
}

.shadow-status[data-status="retry"],
.shadow-status[data-status="error"],
.shadow-status[data-status="unsupported"] {
  border-color: rgba(161, 61, 55, 0.28);
  background: #f9e9e7;
  color: var(--red);
}

.shadow-status[data-status="success"] {
  border-color: rgba(47, 122, 69, 0.34);
  background: #eaf5ed;
  color: var(--green);
}

.shadow-transcript {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.shadow-transcript span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.shadow-transcript p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

#recordingAudio {
  width: 100%;
  margin-top: 12px;
}

.stage-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.mobile-bottom-actions {
  display: none;
}

.mobile-rhythm-action {
  min-height: 44px;
  font-weight: 900;
}

.mobile-secondary-row {
  display: flex;
  gap: 8px;
}

.mobile-save-action,
.mobile-speed-action,
.mobile-feedback-action {
  flex: 1 1 0;
  min-height: 44px;
  font-weight: 900;
}

.mobile-speed-action.active {
  border-color: rgba(161, 61, 55, 0.45);
  background: rgba(161, 61, 55, 0.1);
  color: var(--danger);
}

.mobile-bottom-details {
  border: 1px solid rgba(31, 111, 109, 0.18);
  border-radius: 8px;
  background: #fffefa;
}

.mobile-bottom-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 900;
  color: var(--accent-strong);
  list-style: none;
}

.mobile-bottom-details summary::-webkit-details-marker {
  display: none;
}

.mobile-bottom-details summary::after {
  content: "展开";
  color: var(--muted);
  font-size: 0.78rem;
}

.mobile-bottom-details[open] summary::after {
  content: "收起";
}

.mobile-bottom-details summary em {
  margin-left: auto;
  margin-right: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.mobile-detail-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.mobile-detail-body div {
  border-top: 1px dashed rgba(31, 111, 109, 0.16);
  padding-top: 8px;
}

.mobile-detail-body span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.mobile-detail-body p {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mobile-detail-empty {
  color: var(--muted) !important;
}

.learning-report {
  display: grid;
  gap: 12px;
}

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

.report-metrics div,
.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px 8px;
  text-align: center;
}

.report-metrics span,
.metric-grid span {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.report-metrics p,
.metric-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.report-compare {
  margin: 0;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.45;
}

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

.report-columns h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.96rem;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.report-item strong {
  display: block;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.report-item span,
.report-empty {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.review-list,
.vocab-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
  margin-top: 12px;
}

.feedback-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.feedback-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(35, 33, 29, 0.42);
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

.feedback-modal {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 18px;
  box-shadow: 0 22px 60px rgba(35, 33, 29, 0.24);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.speech-test-backdrop {
  z-index: 130;
}

.speech-test-modal {
  width: min(960px, 100%);
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
  box-shadow: 0 24px 70px rgba(35, 33, 29, 0.28);
}

.speech-test-modal > .section-heading {
  align-items: center;
  flex-direction: row;
}

.speech-test-modal > .section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.speech-test-modal iframe {
  width: 100%;
  height: min(76dvh, 720px);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feedback-modal > .section-heading {
  align-items: center;
  flex-direction: row;
}

.feedback-modal > .section-heading .small-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
}

.feedback-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.feedback-modal label > span {
  color: var(--ink);
}

.feedback-intro {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.feedback-action-lead {
  margin: -4px 0 0;
  border: 2px solid rgba(31, 111, 109, 0.4);
  border-radius: 8px;
  background: #f2fbf8;
  color: var(--accent-strong);
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.35;
}

.feedback-action-line {
  margin: -2px 0 0;
  border: 1px solid rgba(31, 111, 109, 0.22);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--accent-strong);
  padding: 9px 12px;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.45;
}

.quick-feedback {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.quick-feedback p {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

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

.quick-feedback-grid button {
  min-height: 46px;
  position: relative;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: inherit;
  line-height: 1.35;
  padding: 9px 10px;
  font-weight: 900;
  text-align: left;
}

.quick-feedback-grid button:hover,
.quick-feedback-grid button:focus-visible {
  background: #f2fbf8;
  color: var(--accent-strong);
  outline: 2px solid rgba(31, 111, 109, 0.34);
  outline-offset: 2px;
}

.quick-feedback-grid button.selected,
.quick-feedback-grid button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  padding-right: 48px;
}

.quick-feedback-grid button.selected::after,
.quick-feedback-grid button[aria-pressed="true"]::after {
  content: "已选";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 0.75rem;
  line-height: 1;
  padding: 4px 6px;
}

.quick-feedback-grid button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.quick-feedback span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.feedback-modal input,
.feedback-modal select,
.feedback-modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.feedback-modal textarea {
  resize: vertical;
}

.feedback-note,
.feedback-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.feedback-status {
  color: var(--accent-strong);
  font-weight: 800;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.feedback-status.success {
  border-color: rgba(38, 125, 87, 0.24);
  background: rgba(38, 125, 87, 0.08);
  color: #1f6f4d;
}

.feedback-status.error {
  border-color: rgba(171, 63, 47, 0.24);
  background: rgba(171, 63, 47, 0.08);
  color: #9b392d;
}

.feedback-status.loading {
  border-color: rgba(33, 91, 133, 0.18);
  background: rgba(33, 91, 133, 0.08);
  color: #215b85;
}

.feedback-status.selected {
  border-color: rgba(31, 111, 109, 0.18);
  background: rgba(31, 111, 109, 0.08);
  color: var(--accent-strong);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  z-index: 1;
  bottom: -18px;
  margin: 0 -18px -18px;
  border-top: 1px solid rgba(31, 111, 109, 0.12);
  background: var(--surface-strong);
  padding: 12px 18px 18px;
}

.feedback-submit-hint {
  flex: 1 1 100%;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
}

.modal-actions .primary-button {
  min-width: 160px;
}

.list-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
  text-align: left;
}

.list-item strong {
  display: block;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.list-item span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.list-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.list-item.locked {
  background: #f3eee5;
}

.list-item em {
  display: inline-block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .mode-options {
    grid-template-columns: 1fr;
  }

  .shadow-practice-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  html,
  body {
    background: var(--surface);
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .feedback-modal {
    width: 100%;
    max-height: 92dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    padding: 16px 14px;
  }

  .feedback-modal > .section-heading {
    align-items: center;
    flex-direction: row;
  }

  .speech-test-backdrop {
    align-items: stretch;
    padding: 8px;
  }

  .speech-test-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 10px;
  }

  .speech-test-modal > .section-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .speech-test-modal iframe {
    height: calc(100dvh - 108px);
    min-height: 420px;
  }

  .quick-feedback-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    bottom: -16px;
    margin: 0 -14px -16px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .app-shell {
    width: 100%;
    padding: 0 0 18px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 0;
    border-bottom: 1px solid rgba(31, 111, 109, 0.12);
    background: rgba(255, 253, 248, 0.96);
    padding: 10px 14px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 1.05rem;
  }

  .status-pill {
    width: auto;
    min-width: 86px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .lesson-active .topbar {
    display: none;
  }

  .mode-menu {
    min-height: calc(100vh - 58px);
    border: 0;
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    padding: 18px 14px 24px;
  }

  .mode-menu-copy .eyebrow {
    display: none;
  }

  .mode-menu h2 {
    font-size: 1.65rem;
  }

  .mode-lead {
    font-size: 1rem;
    line-height: 1.4;
  }

  .mode-route {
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .menu-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .daily-task-panel {
    border-radius: 16px;
    margin: 12px -2px 0;
    padding: 12px;
  }

  .daily-task-head {
    align-items: flex-start;
  }

  .daily-task-head h3 {
    font-size: 1.35rem;
  }

  .home-start-card {
    grid-template-columns: 1fr;
  }

  .home-start-card button {
    width: 100%;
  }

  .home-status-strip {
    grid-template-columns: 1fr 1fr;
  }

  .home-status-strip div {
    min-height: 58px;
    padding: 8px;
  }

  .home-streak-strip {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }

  .home-streak-days {
    gap: 5px;
  }

  .home-streak-day {
    min-height: 44px;
  }

  .home-path {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .home-path-step {
    min-width: 58px;
    min-height: 72px;
    scroll-snap-align: start;
  }

  .home-main-path {
    padding: 10px;
  }

  .home-main-path-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .home-main-coach {
    grid-template-columns: 1fr;
  }

  .home-main-coach button {
    width: 100%;
  }

  .home-main-path-rail {
    grid-template-columns: repeat(7, minmax(78px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .home-main-stage {
    min-width: 78px;
    scroll-snap-align: start;
  }

  .daily-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .daily-hero-copy {
    border-radius: 14px;
    padding: 13px;
  }

  .daily-task-metrics,
  .daily-task-grid,
  .daily-save-strip,
  .save-progress-form,
  .progress-code-row,
  .progress-recovery-form {
    grid-template-columns: 1fr;
  }

  .daily-save-strip {
    gap: 9px;
    border-radius: 14px;
    padding: 12px;
  }

  .daily-save-strip button {
    width: 100%;
  }

  .daily-task-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .daily-task-metrics div {
    min-height: 72px;
    padding: 8px 5px;
  }

  .daily-task-metrics span {
    font-size: 1rem;
  }

  .daily-task-metrics p {
    font-size: 0.72rem;
  }

  .daily-action-grid {
    grid-template-columns: 1fr 1fr;
    border-radius: 10px;
    padding: 8px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: none;
  }

  .daily-coach-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px;
  }

  .daily-coach-card ul {
    display: grid;
    gap: 6px;
  }

  .daily-coach-card li {
    width: fit-content;
  }

  .daily-coach-card button {
    width: 100%;
  }

  .daily-action-grid .primary-button {
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .daily-action-grid .secondary-button {
    min-height: 44px;
  }

  .daily-action-grid button {
    padding: 8px 10px;
  }

  .daily-action-grid button span {
    font-size: 0.7rem;
  }

  .daily-action-grid button strong {
    font-size: 0.88rem;
  }

  .daily-challenge-ribbon {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-challenge-ribbon button {
    width: 100%;
  }

  .learning-rhythm-suggestion {
    grid-template-columns: 1fr;
  }

  .learning-rhythm-suggestion p,
  .learning-rhythm-suggestion button {
    grid-column: 1;
    grid-row: auto;
  }

  .learning-rhythm-suggestion button {
    width: 100%;
  }

  .learning-reward {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-reward button {
    width: 100%;
  }

  .learning-reward-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .daily-goal-reward {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-goal-reward-actions {
    flex-direction: column;
  }

  .daily-goal-reward-actions button {
    width: 100%;
  }

  .daily-task-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .daily-task-item em {
    grid-column: 2;
    justify-self: start;
  }

  .daily-review-item {
    padding-right: 10px;
  }

  .daily-review-item em {
    position: static;
    display: inline-block;
    max-width: none;
    margin-top: 7px;
  }

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

  .save-progress-card:not([open]) {
    padding: 12px;
  }

  .usage-guide {
    margin-top: 10px;
    padding: 10px;
  }

  .level-guide {
    margin-top: 10px;
  }

  .level-guide button {
    padding: 9px 10px;
  }

  .resume-card {
    margin-top: 12px;
    border-radius: 14px;
    padding: 12px;
  }

  .mode-options {
    gap: 10px;
    margin-top: 12px;
  }

  .support-footer {
    margin-top: 14px;
    padding-bottom: 8px;
  }

  .mode-card {
    border-radius: 16px;
    padding: 15px 14px;
    box-shadow: 0 8px 20px rgba(40, 34, 25, 0.06);
  }

  .mode-card .mode-tag {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  .mode-card strong {
    margin-bottom: 4px;
    font-size: 1.2rem;
  }

  .mode-card .mode-summary {
    margin-bottom: 8px;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .mode-progress {
    margin-bottom: 0;
    padding: 7px 9px;
    font-size: 0.84rem;
  }

  .mode-details {
    display: none;
  }

  .workspace {
    max-width: none;
    gap: 0;
  }

  .lesson-stage {
    border: 0;
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    padding: 10px 14px 0;
  }

  .lesson-meta,
  .section-heading,
  .audit-invite,
  .mode-suggestion,
  .shadow-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-suggestion-actions {
    justify-content: stretch;
  }

  .mode-suggestion-actions .secondary-button {
    flex: 1 1 140px;
  }

  .lesson-meta {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 -14px 8px;
    border-bottom: 1px solid rgba(31, 111, 109, 0.1);
    background: rgba(255, 253, 248, 0.97);
    padding: 9px 14px;
  }

  .lesson-meta h2 {
    display: none;
  }

  .mode-inline {
    width: 100%;
    justify-content: space-between;
    margin-top: 0;
  }

  .mode-inline span {
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .mode-inline .small-button {
    display: inline-flex !important;
    min-height: 34px;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .listen-panel,
  .choice-area,
  .reveal-area,
  .queue-panel,
  .vocab-panel {
    border-top: 0;
    margin-top: 10px;
    padding-top: 0;
  }

  .gate-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .gate-copy strong {
    text-align: left;
  }

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

  .reading-panel {
    margin-bottom: 8px;
    border: 0;
    border-radius: 14px;
    background: var(--accent-soft);
    padding: 10px 12px;
  }

  .reading-panel span {
    display: none;
  }

  .reading-panel p {
    color: var(--accent-strong);
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.45;
  }

  .ladder-panel {
    margin-bottom: 10px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(40, 34, 25, 0.08);
    padding: 14px;
  }

  .ladder-head {
    font-size: 0.78rem;
  }

  .ladder-panel p {
    min-height: 46px;
    margin: 8px 0;
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .ladder-dots {
    margin-bottom: 0;
  }

  .audio-display {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 10px 0 6px;
    place-items: center;
    text-align: center;
  }

  .icon-button.primary {
    width: 76px;
    height: 76px;
    font-size: 1.9rem;
  }

  .prompt-label {
    display: none;
  }

  .prompt-text {
    padding: 0 8px;
    font-size: 1.12rem;
    line-height: 1.35;
  }

  .simple-actions {
    justify-content: center;
    margin-top: 2px;
  }

  .simple-actions .text-button {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    padding: 8px 10px;
  }

  .advanced-controls {
    display: none;
  }

  .immersion-panel {
    gap: 10px;
  }

  .immersion-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    border: 0;
    border-radius: 18px;
    min-height: 96px;
    padding: 12px;
    text-align: left;
  }

  .immersion-hero .eyebrow {
    display: none;
  }

  .immersion-hero h3 {
    margin-bottom: 4px;
    font-size: 1.08rem;
  }

  .immersion-hero p:not(.eyebrow) {
    font-size: 0.86rem;
    line-height: 1.38;
  }

  .immersion-round-status {
    gap: 6px;
    margin-top: 8px;
  }

  .immersion-round-status span {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .immersion-hero .icon-button {
    justify-self: center;
    width: 58px;
    height: 58px;
    font-size: 1.45rem;
  }

  .immersion-subtitles {
    border: 0;
    border-radius: 18px;
    padding: 6px 0 8px;
  }

  .immersion-line {
    border-radius: 14px;
    padding: 12px;
  }

  .immersion-ja {
    font-size: 1.08rem;
  }

  .immersion-line.active .immersion-ja {
    font-size: 1.45rem;
  }

  .immersion-line.context {
    gap: 3px;
    padding: 10px 12px;
  }

  .immersion-line.context .immersion-reading {
    display: none;
  }

  .shadow-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

  .shadow-actions .icon-button {
    width: 100%;
    height: auto;
    min-height: 54px;
  }

  .immersion-line.context .immersion-line-meta {
    font-size: 0.72rem;
  }

  .immersion-line.active .immersion-reading {
    font-size: 1.05rem;
  }

  .immersion-controls {
    position: sticky;
    bottom: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 -14px;
    border-top: 1px solid rgba(31, 111, 109, 0.12);
    background: rgba(255, 253, 248, 0.97);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .immersion-controls .speed-control,
  .immersion-controls .text-button {
    justify-content: center;
  }

  .immersion-controls .secondary-button,
  .immersion-controls .primary-button,
  .immersion-controls .text-button,
  .immersion-controls .speed-control {
    min-height: 42px;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 0.86rem;
  }

  .immersion-controls .speed-control {
    gap: 5px;
  }

  .immersion-controls select {
    min-width: 0;
    width: 100%;
    padding: 0 6px;
  }

  .choice-area .section-heading {
    align-items: center;
    flex-direction: row;
  }

  #difficultyText {
    display: none;
  }

  .choice-grid,
  .word-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .choice-button {
    min-height: 60px;
    border-radius: 14px;
    padding: 12px;
  }

  .answer-rescue {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .answer-rescue-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  h2 {
    font-size: 1.25rem;
  }

  .subtitle-block.ja p {
    font-size: 1.25rem;
  }

  .word-main {
    font-size: 1.55rem;
  }

  .stage-actions .primary-button,
  .stage-actions .secondary-button,
  .control-row .text-button {
    flex: 1 1 140px;
  }

  .choice-step-actions {
    display: none;
  }

  .stage-actions {
    display: none;
  }

  .side-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 14px 20px;
  }

  .advanced-panel {
    margin-top: 10px;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .advanced-panel summary {
    border: 1px solid rgba(31, 111, 109, 0.18);
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
    text-align: center;
  }

  .advanced-panel > section {
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(40, 34, 25, 0.05);
    padding: 12px;
  }

  .speed-control {
    flex: 1 1 160px;
  }

  .speed-control select {
    flex: 1;
  }

  body.has-mobile-bottom-actions .app-shell {
    padding-bottom: calc(190px + env(safe-area-inset-bottom));
  }

  body.has-mobile-bottom-actions.has-mobile-rhythm-action .app-shell {
    padding-bottom: calc(244px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-actions:not([hidden]) {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(31, 111, 109, 0.18);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 -12px 26px rgba(35, 33, 29, 0.12);
  }

  .mobile-bottom-actions button[hidden] {
    display: none;
  }

  .mobile-bottom-actions .primary-button {
    flex: 1 1 100%;
    min-height: 52px;
    font-size: 1rem;
    font-weight: 900;
  }

  .mobile-bottom-actions .mobile-rhythm-action:not([hidden]) {
    display: block;
    width: 100%;
  }

  .mobile-bottom-actions .mobile-secondary-row {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  .mobile-bottom-actions .mobile-save-action,
  .mobile-bottom-actions .mobile-speed-action,
  .mobile-bottom-actions .mobile-feedback-action {
    min-height: 42px;
  }

  .mobile-bottom-details[open] {
    max-height: min(46vh, 360px);
    overflow: auto;
  }
}

@media (max-width: 620px) {
  .mode-menu:not(.daily-panel-open) {
    min-height: auto;
    gap: 9px;
    padding: 12px 12px 16px;
  }

  .mode-menu:not(.daily-panel-open) .mode-lead {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .mode-menu:not(.daily-panel-open) .home-start-card {
    gap: 10px;
    margin-top: 4px;
    border-radius: 14px;
    padding: 12px;
  }

  .mode-menu:not(.daily-panel-open) .home-start-card strong {
    font-size: 1.16rem;
  }

  .mode-menu:not(.daily-panel-open) .home-start-card p {
    font-size: 0.88rem;
    line-height: 1.34;
  }

  .mode-menu:not(.daily-panel-open) .home-start-card button {
    min-height: 48px;
  }

  .mode-menu:not(.daily-panel-open) .menu-actions {
    order: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .mode-menu:not(.daily-panel-open) .menu-actions .primary-button,
  .mode-menu:not(.daily-panel-open) .menu-actions .secondary-button {
    min-width: 0;
    white-space: normal;
  }

  .mode-menu:not(.daily-panel-open) .menu-actions .primary-button,
  .mode-menu:not(.daily-panel-open) .menu-actions .secondary-button {
    min-height: 42px;
    border-radius: 12px;
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  .mode-menu:not(.daily-panel-open) .mode-options {
    order: 6;
    gap: 7px;
    margin-top: 0;
  }

  .mode-menu:not(.daily-panel-open) .mode-card,
  .mode-menu:not(.daily-panel-open) .mode-card[data-mode-choice="word"] {
    min-height: 0;
    border-radius: 12px;
    padding: 10px 11px;
  }

  .mode-menu:not(.daily-panel-open) .mode-card strong,
  .mode-menu:not(.daily-panel-open) .mode-card[data-mode-choice="word"] strong {
    margin-bottom: 3px;
    font-size: 1.08rem;
  }

  .mode-menu:not(.daily-panel-open) .mode-card .mode-tag {
    margin-bottom: 4px;
    font-size: 0.72rem;
  }

  .mode-menu:not(.daily-panel-open) .mode-card .mode-summary {
    margin-bottom: 6px;
    font-size: 0.86rem;
    line-height: 1.28;
  }

  .mode-menu:not(.daily-panel-open) .mode-progress {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .mode-menu:not(.daily-panel-open) .support-footer {
    order: 6;
    margin-top: 6px;
  }

  .mode-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 12px 18px;
  }

  .mode-menu:not(.daily-panel-open) .mode-menu-copy {
    display: contents;
  }

  #modeMenuTitle {
    order: 1;
  }

  .mode-lead {
    order: 2;
  }

  .home-start-card {
    order: 3;
  }

  .first-three-plan {
    order: 4;
  }

  .stage-gate-notice {
    order: 5;
    grid-template-columns: 1fr;
  }

  .stage-gate-actions {
    justify-content: stretch;
  }

  .stage-gate-actions button {
    flex: 1 1 160px;
  }

  .menu-actions {
    order: 6;
  }

  .usage-guide {
    order: 7;
  }

  .mode-options {
    order: 8;
  }

  .support-footer {
    order: 9;
  }

  .mode-menu h2 {
    margin-bottom: 4px;
    font-size: 1.42rem;
    line-height: 1.18;
  }

  .mode-lead {
    margin-bottom: 8px;
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .home-start-card {
    border: 2px solid rgba(31, 111, 109, 0.32);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(40, 34, 25, 0.09);
    padding: 14px;
  }

  .home-start-card > div {
    min-width: 0;
  }

  .home-start-card span {
    font-size: 0.78rem;
  }

  .home-start-card strong {
    font-size: 1.28rem;
    line-height: 1.2;
  }

  .home-start-card p {
    font-size: 0.92rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .home-start-card button {
    min-height: 50px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .home-start-card .primary-button {
    min-height: 56px;
    font-size: 1.04rem;
  }

  .first-three-plan {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    border-radius: 8px;
    padding: 11px;
  }

  .first-three-copy p {
    font-size: 0.84rem;
    line-height: 1.34;
  }

  .first-three-steps {
    justify-content: flex-start;
  }

  .first-three-plan button {
    width: 100%;
    min-height: 42px;
  }

  .home-status-strip,
  .home-streak-strip,
  .home-path,
  .home-main-path,
  .mode-route,
  .level-guide,
  .resume-card {
    display: none;
  }

  .menu-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
  }

  .menu-actions .secondary-button {
    min-height: 42px;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .mode-options {
    gap: 8px;
    margin-top: 6px;
  }

  .mode-card {
    border-radius: 14px;
    padding: 12px;
    box-shadow: none;
  }

  .mode-card[data-mode-choice="word"] {
    order: -1;
    border-width: 2px;
    border-color: var(--accent);
    background: #eef6ef;
    box-shadow: 0 12px 24px rgba(31, 111, 109, 0.12);
    padding: 17px 15px;
  }

  .mode-card[data-mode-choice="word"] .mode-tag {
    background: #dceee5;
    color: var(--accent-strong);
  }

  .mode-card[data-mode-choice="word"] strong {
    font-size: 1.34rem;
  }

  .mode-card:not([data-mode-choice="word"]) {
    background: #fffdf8;
  }

  .mode-card:not([data-mode-choice="word"]) .mode-tag {
    background: #f2ede1;
  }

  .mode-card:not([data-mode-choice="word"]) .mode-progress {
    display: none;
  }

  .support-footer {
    gap: 8px;
    margin-top: 8px;
  }

  .support-footer .quality-note {
    display: none;
  }

  .audit-invite {
    border-radius: 12px;
    padding: 10px;
  }

  .audit-invite span {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .lesson-stage {
    padding: 8px 12px 0;
  }

  .lesson-meta {
    margin: 0 -12px 6px;
    padding: 7px 12px;
  }

  .mode-inline span {
    max-width: calc(100vw - 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .listen-panel,
  .choice-area,
  .reveal-area {
    margin-top: 8px;
  }

  .reading-panel {
    margin-bottom: 7px;
    border-radius: 12px;
    padding: 8px 10px;
  }

  .reading-panel p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .ladder-panel {
    margin-bottom: 7px;
    border-radius: 14px;
    box-shadow: none;
    padding: 11px 12px;
  }

  .ladder-head {
    font-size: 0.74rem;
  }

  .ladder-panel p {
    min-height: 38px;
    margin: 6px 0;
    font-size: 1.36rem;
    line-height: 1.32;
  }

  .audio-display {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(31, 111, 109, 0.14);
    border-radius: 14px;
    background: #fff;
    padding: 9px 10px;
    text-align: left;
  }

  .audio-display .icon-button.primary {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }

  .prompt-text {
    padding: 0;
    font-size: 1.02rem;
    line-height: 1.32;
  }

  .simple-actions {
    display: none;
  }

  .choice-area .section-heading {
    margin-bottom: 8px;
  }

  .choice-area .section-heading h3 {
    font-size: 1.04rem;
    line-height: 1.25;
  }

  .choice-grid {
    gap: 8px;
  }

  .choice-button {
    min-height: 54px;
    border-radius: 12px;
    padding: 10px 11px;
  }

  .choice-button strong {
    font-size: 1rem;
  }

  .choice-button span,
  .choice-button .unit-meaning {
    font-size: 0.82rem;
  }

  body.has-mobile-bottom-actions .app-shell {
    padding-bottom: calc(136px + env(safe-area-inset-bottom));
  }

  body.has-mobile-bottom-actions.has-mobile-rhythm-action .app-shell {
    padding-bottom: calc(188px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-actions:not([hidden]) {
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-actions .primary-button {
    min-height: 50px;
    border-radius: 12px;
  }

  .mobile-bottom-actions .mobile-secondary-row {
    gap: 8px;
  }

  .mobile-bottom-actions .mobile-save-action,
  .mobile-bottom-actions .mobile-speed-action,
  .mobile-bottom-actions .mobile-feedback-action {
    min-height: 44px;
    border-radius: 11px;
  }

  .mobile-bottom-details {
    display: none;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .status-pill {
    display: none;
  }

  .mode-menu:not(.daily-panel-open) .menu-actions {
    order: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .mode-menu:not(.daily-panel-open) .menu-actions .primary-button,
  .mode-menu:not(.daily-panel-open) .menu-actions .secondary-button {
    min-width: 0;
    white-space: normal;
  }

  .mode-menu:not(.daily-panel-open) .mode-options {
    order: 6;
    gap: 7px;
    margin-top: 0;
  }

  .mode-menu:not(.daily-panel-open) .support-footer {
    order: 7;
  }

  .daily-task-panel {
    gap: 10px;
  }

  .daily-hero {
    gap: 8px;
  }

  .daily-hero-copy {
    gap: 5px;
    padding: 11px;
  }

  .daily-hero-copy span {
    font-size: 1.14rem;
  }

  .daily-hero-copy p,
  .daily-hero-copy em {
    font-size: 0.82rem;
    line-height: 1.34;
  }

  .daily-challenge-button {
    min-height: 44px;
    padding: 8px 10px;
  }

  .daily-save-strip { order: 4; }

  .save-progress-priority { order: 5; }

  .save-progress-priority summary {
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  .daily-path {
    max-height: 96px;
  }

  .daily-task-grid {
    gap: 10px;
  }

  .choice-button {
    align-content: center;
    gap: 3px;
  }

  .choice-button strong {
    display: block;
    line-height: 1.22;
  }

  .choice-button span:not(.unit-meaning) {
    display: block;
    margin-top: 2px;
    line-height: 1.2;
  }

  .learning-reward,
  .daily-challenge-ribbon,
  .daily-goal-reward {
    margin-top: 8px;
    padding: 10px;
  }
}

/* UI design refresh preview. Visual-only overrides; do not change lesson data or flow. */
:root {
  --paper: #f4f7f4;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #1d2422;
  --muted: #5f6864;
  --line: #d8e0d9;
  --accent: #176f68;
  --accent-strong: #0f4f4b;
  --accent-soft: #e5f4ef;
  --gold: #b66f1d;
  --red: #b24845;
  --green: #2f7d50;
  --blue: #315f8c;
  --shadow: 0 16px 38px rgba(23, 35, 32, 0.11);
}

html,
body {
  background:
    linear-gradient(180deg, #e8f2ef 0, #f4f7f4 260px),
    var(--paper);
}

body {
  letter-spacing: 0;
}

.app-shell {
  width: min(1100px, 100%);
}

.topbar {
  border: 1px solid rgba(216, 224, 217, 0.82);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 10px 28px rgba(23, 35, 32, 0.06);
  padding: 12px 14px;
}

.topbar h1,
.mode-menu h2,
.daily-task-head h3,
.lesson-meta h2 {
  color: var(--ink);
  font-weight: 900;
}

.status-pill,
.timebox {
  border-color: rgba(23, 111, 104, 0.22);
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.mode-menu,
.lesson-stage,
.side-panel {
  border-color: rgba(216, 224, 217, 0.86);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
}

.mode-menu {
  max-width: 980px;
}

.mode-lead {
  color: #24312e;
}

.home-start-card,
.daily-save-strip,
.save-progress-card,
.daily-card,
.quality-note,
.audit-invite,
.learning-reward,
.daily-challenge-ribbon,
.daily-goal-reward,
.reading-panel,
.ladder-panel,
.audio-display,
.choice-button,
.reveal-area,
.vocab-panel,
.queue-panel,
.answer-rescue {
  border-radius: 8px;
}

.home-start-card {
  border: 1px solid rgba(23, 111, 104, 0.24);
  border-left: 6px solid var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 244, 239, 0.78));
  box-shadow: 0 14px 34px rgba(23, 35, 32, 0.1);
}

.home-start-card strong,
.mode-card strong,
.daily-action-grid button strong {
  color: #17241f;
}

.home-start-card p,
.mode-summary,
.daily-card-note {
  color: var(--muted);
}

.primary-button,
.secondary-button,
.text-button,
.audit-link {
  border-radius: 8px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button,
.audit-link {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(23, 111, 104, 0.18);
}

.primary-button:hover,
.primary-button:focus-visible,
.audit-link:hover,
.audit-link:focus-visible {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(23, 111, 104, 0.22);
}

.secondary-button,
.text-button {
  border-color: rgba(23, 111, 104, 0.22);
  background: #ffffff;
  color: var(--accent-strong);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.text-button:hover,
.text-button:focus-visible {
  border-color: rgba(23, 111, 104, 0.38);
  background: #edf7f3;
}

.mode-options {
  gap: 10px;
}

.mode-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(216, 224, 217, 0.88);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 35, 32, 0.06);
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.mode-card[data-mode-choice="sentence"]::before {
  background: var(--gold);
}

.mode-card[data-mode-choice="immersion"]::before {
  background: var(--blue);
}

.auxiliary-mode-note {
  cursor: default;
  background: #f7f2e8;
  box-shadow: none;
}

.auxiliary-mode-note::before {
  background: var(--muted);
}

.auxiliary-mode-note:hover,
.auxiliary-mode-note:focus-visible {
  border-color: rgba(216, 224, 217, 0.88);
  transform: none;
  box-shadow: none;
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: rgba(23, 111, 104, 0.38);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(23, 35, 32, 0.1);
}

.mode-card.active {
  background: #f2fbf7;
  box-shadow: 0 15px 34px rgba(23, 111, 104, 0.13);
}

.mode-card .mode-tag {
  width: fit-content;
  border-radius: 8px;
  background: #e8f4ef;
  color: var(--accent-strong);
  padding: 4px 8px;
}

.mode-card[data-mode-choice="sentence"] .mode-tag {
  background: #fff1dd;
  color: #8a5315;
}

.mode-card[data-mode-choice="immersion"] .mode-tag {
  background: #e9f1fb;
  color: #274f79;
}

.mode-progress {
  border-radius: 8px;
  background: rgba(245, 249, 246, 0.96);
}

.support-footer {
  border-color: rgba(216, 224, 217, 0.95);
}

.support-footer::before {
  color: #6d756f;
}

.daily-task-panel {
  border-color: rgba(23, 111, 104, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 35, 32, 0.08);
}

.daily-hero-copy,
.daily-save-strip,
.daily-action-grid button.primary-button {
  background: #e8f4ef;
}

.daily-hero-copy {
  border-color: rgba(23, 111, 104, 0.2);
}

.daily-power-bar,
.progress-track,
.mode-progress {
  overflow: hidden;
}

.daily-action-grid button,
.daily-task-item,
.daily-review-item {
  border-radius: 8px;
}

.lesson-stage {
  max-width: 780px;
}

.lesson-meta {
  border-radius: 8px;
}

.reading-panel {
  border-color: rgba(23, 111, 104, 0.16);
  background: #eaf6f1;
}

.ladder-panel {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 35, 32, 0.08);
}

.ladder-panel p {
  color: #12231f;
}

.audio-display {
  border-color: rgba(23, 111, 104, 0.16);
  background: #ffffff;
}

.icon-button.primary {
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(23, 111, 104, 0.2);
}

.choice-button {
  border-color: rgba(216, 224, 217, 0.95);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 35, 32, 0.05);
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: rgba(23, 111, 104, 0.36);
  background: #f7fbf8;
  transform: translateY(-1px);
}

.choice-button strong,
.choice-button span,
.choice-button .unit-meaning,
.home-start-card p,
.mode-card p,
.mode-summary,
.primary-button,
.secondary-button {
  overflow-wrap: anywhere;
}

.mobile-bottom-actions:not([hidden]) {
  border-color: rgba(216, 224, 217, 0.9);
  background: rgba(255, 254, 250, 0.98);
  box-shadow: 0 -14px 32px rgba(23, 35, 32, 0.13);
}

.mobile-bottom-actions .primary-button {
  box-shadow: 0 10px 22px rgba(23, 111, 104, 0.2);
}

@media (min-width: 901px) {
  .mode-menu:not(.daily-panel-open) {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
  }

  .mode-menu:not(.daily-panel-open) .support-footer {
    border-left-color: rgba(216, 224, 217, 0.96);
  }

  .workspace {
    max-width: 1040px;
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .lesson-stage {
    grid-column: 1;
  }

  .side-panel {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  body {
    background:
      linear-gradient(180deg, #e8f2ef 0, #f7faf7 180px),
      #f7faf7;
  }

  .app-shell {
    padding-bottom: 18px;
  }

  .topbar {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 14px;
  }

  .mode-menu:not(.daily-panel-open) {
    background: transparent;
  }

  .home-start-card {
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(23, 35, 32, 0.08);
  }

  .home-start-card p {
    max-height: 3.1em;
    overflow: hidden;
  }

  .mode-card,
  .mode-card[data-mode-choice="word"],
  .daily-task-panel,
  .lesson-stage,
  .reading-panel,
  .ladder-panel,
  .audio-display,
  .choice-button {
    border-radius: 8px;
  }

  .mode-card::before {
    width: 4px;
  }

  .mode-card[data-mode-choice="word"] {
    background: #f0faf6;
    box-shadow: 0 10px 22px rgba(23, 111, 104, 0.1);
  }

  .menu-actions .primary-button,
  .menu-actions .secondary-button {
    min-width: 0;
  }

  .lesson-stage {
    background: transparent;
    box-shadow: none;
  }

  .lesson-meta {
    border-radius: 0;
  }

  .reading-panel,
  .ladder-panel,
  .audio-display,
  .choice-button {
    box-shadow: 0 8px 18px rgba(23, 35, 32, 0.05);
  }
}

.mode-menu:not(.daily-panel-open) .home-start-card #homeStartButton {
  min-height: 56px;
  border-radius: 8px;
  font-size: 1.04rem;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(31, 111, 109, 0.18);
}

/* v2: keep the home and daily surfaces focused on the next learning action. */
.first-three-plan {
  display: none !important;
}

.support-tools {
  margin-top: 18px;
  border-top: 1px solid #cbd8d2;
}

.support-tools > summary {
  min-height: 52px;
  padding: 14px 4px;
  color: #174f49;
  font-weight: 700;
  cursor: pointer;
}

.support-tools[open] > summary {
  margin-bottom: 8px;
}

.daily-report-details {
  display: grid;
  gap: 12px;
  padding: 0;
}

.daily-report-details > summary {
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid #cbd8d2;
  border-radius: 8px;
  background: #f7faf8;
  color: #174f49;
  font-weight: 700;
  cursor: pointer;
}

.prep-vocab-card > summary {
  min-height: 46px;
  color: #174f49;
  font-weight: 700;
  cursor: pointer;
}

.prep-vocab-card:not([open]) > :not(summary) {
  display: none;
}

.save-progress-card:not([open]) {
  display: none;
}

@media (min-width: 901px) {
  .mode-menu:not(.daily-panel-open) .support-tools {
    grid-column: 2;
    grid-row: 1 / span 8;
    margin-top: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 16px;
  }

  .mode-menu:not(.daily-panel-open) .support-tools .support-footer {
    border: 0;
    padding: 0;
  }
}

.daily-report-details:not([open]) > :not(summary) {
  display: none;
}

.shadow-judge-controls {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.shadow-judge-controls label {
  color: #536962;
  font-size: 0.84rem;
  font-weight: 700;
}

.shadow-judge-controls select {
  min-height: 42px;
  border: 1px solid #b9cdc5;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: #163b36;
  font: inherit;
}

.shadow-judge-controls #shadowSelfConfirmButton {
  grid-column: 1 / -1;
  min-height: 44px;
}

@media (max-width: 720px) {
  .mode-menu:not(.daily-panel-open) .support-tools {
    order: 9;
  }
  .mode-menu:not(.daily-panel-open) .menu-actions {
    grid-template-columns: 1fr;
  }

  .mode-menu:not(.daily-panel-open) #prepQuickOpenButton {
    display: none;
  }

  .daily-path,
  .daily-coach-card {
    display: none !important;
  }

  .daily-task-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .daily-report-details {
    grid-column: 1;
  }

  .support-tools {
    margin-inline: 12px;
  }

  .support-tools .support-footer {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .mode-menu:not(.daily-panel-open) .home-start-card #homeStartButton {
    width: 100%;
    min-height: 58px;
  }

  .mode-menu.home-mobile-sticky-visible:not(.daily-panel-open) {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .mode-menu:not(.daily-panel-open) .home-mobile-start-bar {
    position: fixed;
    right: 12px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 70;
    display: none;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(31, 111, 109, 0.26);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 16px 36px rgba(40, 34, 25, 0.2);
    padding: 10px 10px 10px 12px;
  }

  .mode-menu.home-mobile-sticky-visible:not(.daily-panel-open) .home-mobile-start-bar {
    display: grid;
  }

  .home-mobile-start-bar span,
  .home-mobile-start-bar strong,
  .home-mobile-start-bar p {
    display: block;
  }

  .home-mobile-start-bar span {
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 900;
  }

  .home-mobile-start-bar strong {
    margin-top: 2px;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .home-mobile-start-bar p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .home-mobile-start-bar .primary-button {
    min-width: 118px;
    min-height: 52px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.95rem;
    white-space: nowrap;
  }
}
