:root {
  --navy: #17324d;
  --navy-soft: #24445f;
  --coral: #e65c4f;
  --coral-soft: #fbe8e5;
  --yellow: #f3c64f;
  --yellow-soft: #fff4cf;
  --teal: #2f7770;
  --teal-soft: #e2f1ee;
  --blue: #335f9d;
  --blue-soft: #e8eef8;
  --text: #22313e;
  --muted: #6c7b86;
  --faint: #97a3ab;
  --line: #dfe5e8;
  --line-strong: #cbd4d9;
  --surface: #ffffff;
  --surface-soft: #f6f8f9;
  --bg: #eef2f4;
  --danger: #bb4439;
  --success: #2f7770;
  --shadow-sm: 0 1px 2px rgba(23, 50, 77, 0.06);
  --shadow-md: 0 10px 30px rgba(23, 50, 77, 0.09);
  --sidebar-width: 228px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex: none;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  background: #fbfcfc;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 8px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 2px solid var(--navy);
  border-radius: 5px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  color: var(--navy);
  font-size: 16px;
  line-height: 1.25;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 28px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 6px;
  color: #586873;
  font-size: 14px;
  font-weight: 650;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.nav-item:hover {
  color: var(--navy);
  background: #f0f3f4;
}

.nav-item.active {
  color: var(--navy);
  background: #e9eff2;
}

.nav-item.active::before {
  position: absolute;
  left: -16px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--coral);
  content: "";
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 10px;
  color: #fff;
  background: var(--coral);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.sidebar-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.note-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 850;
}

.sidebar-note strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
}

.sidebar-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.main-shell {
  min-width: 0;
}

.app-view {
  width: min(100%, var(--content-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 34px 52px;
  outline: 0;
}

.app-view.view-enter > * {
  animation: view-rise 220ms ease both;
}

@keyframes view-rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-topbar,
.mobile-nav {
  display: none;
}

.page-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 850;
}

.page-title {
  margin-bottom: 7px;
  color: var(--navy);
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 800;
  line-height: 1.2;
}

.page-subtitle {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.date-chip,
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.streak-chip svg {
  width: 16px;
  height: 16px;
  color: var(--coral);
}

.mission-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
  min-height: 292px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow-md);
}

.mission-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 34px 38px;
  color: #fff;
}

.mission-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 850;
}

.mission-kicker::before {
  width: 17px;
  height: 3px;
  border-radius: 2px;
  background: var(--coral);
  content: "";
}

.mission-title {
  max-width: 560px;
  margin-bottom: 11px;
  color: #fff;
  font-size: clamp(27px, 3.1vw, 41px);
  font-weight: 800;
  line-height: 1.18;
  text-wrap: balance;
}

.mission-summary {
  max-width: 560px;
  margin-bottom: 20px;
  color: #d6e1e8;
  font-size: 13px;
  line-height: 1.72;
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  margin-bottom: 24px;
  color: #b9cad6;
  font-size: 11px;
  font-weight: 650;
}

.mission-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mission-meta svg {
  width: 14px;
  height: 14px;
}

.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mission-visual {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  background: #f8f3df;
}

.mission-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23, 50, 77, 0.2), transparent 24%);
  pointer-events: none;
  content: "";
}

.mission-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  color: var(--navy);
  background: var(--yellow);
}

.button-primary:hover {
  background: #ffd66b;
}

.button-dark {
  color: #fff;
  background: var(--navy);
}

.button-dark:hover {
  background: var(--navy-soft);
}

.button-white {
  color: var(--navy);
  background: #fff;
}

.button-outline {
  color: var(--navy);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
}

.button-outline:hover {
  border-color: #aebbc2;
  background: #fff;
}

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

.button-ghost {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.button-ghost:hover {
  color: var(--navy);
  background: #eef2f4;
}

.button-ghost-light {
  color: #dce8ee;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.button-ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.button-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.button-large {
  min-height: 50px;
  padding: 0 21px;
  font-size: 14px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  border-color: #bac6cc;
  background: var(--surface-soft);
}

.page-heading {
  min-width: 0;
}

.progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaed;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 260ms ease;
}

.full-width-button {
  width: 100%;
  margin-top: 14px;
}

.muted-copy {
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.text-link svg {
  width: 14px;
  height: 14px;
}

.text-link:hover {
  color: var(--navy);
}

.cover-label {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  max-width: calc(100% - 32px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  color: #fff;
  background: rgba(23, 50, 77, 0.86);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 750;
}

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

.stat-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 6px;
  color: var(--navy);
  background: var(--surface-soft);
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.stat-tile-coral .stat-icon {
  color: #9f3c34;
  background: var(--coral-soft);
}

.stat-tile-yellow .stat-icon {
  color: #7a5b05;
  background: var(--yellow-soft);
}

.stat-tile-blue .stat-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-tile-teal .stat-icon {
  color: var(--teal);
  background: var(--teal-soft);
}

.stat-tile > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stat-tile strong {
  margin: 2px 0;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.15;
}

.stat-tile small {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-stat-grid {
  margin-top: 14px;
}

.section-panel {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.section-heading-spread {
  align-items: flex-end;
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.section-heading h2,
.section-block h2 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.3;
}

.section-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.section-heading > span:not(.count-badge):not(.section-progress) {
  color: var(--muted);
  font-size: 11px;
}

.count-badge {
  display: inline-grid;
  min-width: 26px;
  min-height: 22px;
  place-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.section-progress {
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
}

.route-progress {
  height: 5px;
  margin: -4px 0 17px;
}

.route-list {
  display: flex;
  flex-direction: column;
}

.route-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-top: 1px solid #edf0f2;
}

.route-item:first-child {
  border-top: 0;
}

.route-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.route-item.is-current .route-index {
  color: var(--navy);
  border-color: var(--yellow);
  background: var(--yellow);
}

.route-item.is-done .route-index {
  color: var(--teal);
  border-color: #c8e2de;
  background: var(--teal-soft);
}

.route-index svg {
  width: 15px;
  height: 15px;
}

.route-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.route-copy strong {
  color: var(--navy);
  font-size: 13px;
}

.route-copy span {
  color: var(--muted);
  font-size: 11px;
}

.route-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.route-link svg {
  width: 13px;
  height: 13px;
}

.route-link:disabled {
  color: var(--faint);
  cursor: default;
}

.due-list {
  display: flex;
  flex-direction: column;
}

.due-word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 51px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.due-word:first-child {
  border-top: 0;
}

.due-word > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.due-word strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-word small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-word svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.due-panel .text-link {
  margin-top: 10px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  flex-direction: column;
  padding: 22px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 14px;
}

.empty-state p {
  max-width: 300px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.section-block {
  margin-top: 27px;
}

.section-block > .section-heading {
  margin-bottom: 13px;
}

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

.scene-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.scene-card:hover {
  transform: translateY(-2px);
  border-color: #c4ced3;
  box-shadow: 0 9px 22px rgba(23, 50, 77, 0.1);
}

.scene-card-visual {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: #e7ecef;
}

.scene-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.scene-card:hover .scene-card-visual img {
  transform: scale(1.025);
}

.scene-card-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 35, 53, 0.06), rgba(15, 35, 53, 0.32));
  content: "";
}

.issue-badge {
  display: inline-grid;
  min-width: 28px;
  height: 23px;
  place-items: center;
  padding: 0 5px;
  border-radius: 4px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 10px;
  font-weight: 850;
}

.scene-card-visual .issue-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.accent-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 3px;
  color: #fff;
  font-size: 8px;
  font-weight: 750;
  backdrop-filter: blur(7px);
}

.accent-coral {
  background: rgba(193, 72, 61, 0.88);
}

.accent-teal {
  background: rgba(38, 113, 104, 0.88);
}

.accent-yellow {
  color: var(--navy);
  background: rgba(239, 192, 66, 0.92);
}

.accent-blue {
  background: rgba(51, 95, 157, 0.9);
}

.scene-card-body {
  padding: 13px 14px 14px;
}

.scene-module {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.scene-card h3 {
  margin: 4px 0 6px;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-card p {
  display: -webkit-box;
  min-height: 34px;
  margin: 0 0 11px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.scene-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
}

.scene-card .progress-track {
  height: 4px;
}

.learning-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #d8e2e5;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: #f9fbfb;
}

.learning-note > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow-soft);
}

.learning-note > span svg {
  width: 17px;
  height: 17px;
}

.learning-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 12px;
}

.learning-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.segment:hover {
  color: var(--navy);
  background: var(--surface-soft);
}

.segment.active {
  color: #fff;
  background: var(--navy);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(270px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--faint);
}

.library-scene-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-scene-grid .scene-card-visual {
  height: 145px;
}

.library-scene-grid .scene-card-body {
  padding: 16px;
}

.library-scene-grid .scene-card h3 {
  font-size: 17px;
}

.library-scene-grid .scene-card p {
  min-height: 39px;
  font-size: 11px;
}

.detail-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.back-link:hover {
  color: var(--navy);
}

.detail-issue {
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
}

.scene-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top-width: 4px;
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.accent-border-coral {
  border-top-color: var(--coral);
}

.accent-border-teal {
  border-top-color: var(--teal);
}

.accent-border-yellow {
  border-top-color: var(--yellow);
}

.accent-border-blue {
  border-top-color: var(--blue);
}

.scene-hero-copy {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  padding: 28px 32px;
}

.scene-hero-copy h1 {
  margin: 3px 0 10px;
  color: var(--navy);
  font-size: clamp(28px, 3vw, 39px);
  line-height: 1.18;
}

.scene-hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.scene-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.scene-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.scene-hero-meta svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
}

.scene-hero-image {
  min-height: 250px;
  overflow: hidden;
}

.scene-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 14px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.scene-action-progress {
  min-width: 240px;
  flex: 1;
}

.action-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.action-progress-copy strong {
  color: var(--navy);
  font-size: 12px;
}

.action-progress-copy span {
  color: var(--muted);
  font-size: 10px;
}

.scene-action-buttons {
  display: flex;
  gap: 8px;
  flex: none;
}

.scene-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 14px;
}

.word-panel {
  padding: 20px 0 0;
  overflow: hidden;
}

.word-panel > .section-heading {
  padding: 0 21px;
}

.word-table-head,
.word-row {
  display: grid;
  grid-template-columns: 38px minmax(190px, 0.95fr) minmax(180px, 1.25fr) 62px;
  align-items: center;
  gap: 12px;
}

.word-table-head {
  min-height: 34px;
  padding: 0 21px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 750;
}

.word-table {
  max-height: 590px;
  overflow: auto;
  scrollbar-color: #cbd5da transparent;
  scrollbar-width: thin;
}

.word-row {
  width: 100%;
  min-height: 58px;
  padding: 8px 21px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.word-row:hover {
  background: #f9fbfb;
}

.word-index {
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
}

.word-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.word-main strong {
  overflow: hidden;
  color: var(--blue);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-main small {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-meaning {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-meaning b {
  flex: none;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
}

.word-state {
  justify-self: end;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
  font-weight: 700;
}

.scene-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scene-summary-card h2 {
  margin: 0 0 15px;
  color: var(--navy);
  font-size: 18px;
}

.mini-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 16px;
}

.mini-facts span {
  display: flex;
  align-items: center;
  min-height: 53px;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.mini-facts b {
  color: var(--navy);
  font-size: 18px;
}

.scene-summary-card > p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.dialogue-section {
  margin-top: 14px;
}

.dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.dialogue-turn {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 38px;
  align-items: end;
  gap: 12px;
  max-width: 880px;
}

.dialogue-speaker {
  align-self: start;
  padding-top: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.dialogue-bubble {
  padding: 12px 15px;
  border: 1px solid #dce5e8;
  border-radius: 6px 6px 6px 2px;
  background: #f7faf9;
}

.dialogue-turn.is-secondary .dialogue-bubble {
  border-color: #e0e5eb;
  background: var(--blue-soft);
}

.dialogue-bubble p {
  margin: 0;
}

.dialogue-en {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.dialogue-zh {
  margin-top: 6px !important;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dialogue-turn .icon-button {
  width: 32px;
  height: 32px;
  align-self: center;
}

.dialogue-section.hide-translation .dialogue-zh {
  display: none;
}

.study-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(760px, 100%);
  margin: 0 auto 18px;
}

.study-counter {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.study-shell,
.quiz-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.study-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.study-progress {
  height: 5px;
  margin-bottom: 20px;
}

.word-card,
.quiz-card,
.review-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(23, 50, 77, 0.1);
}

.word-card {
  padding: 24px 28px 28px;
}

.word-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-card-head .icon-button {
  margin-left: auto;
}

.word-order {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

.pos-chip {
  padding: 3px 7px;
  border-radius: 3px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 9px;
  font-weight: 800;
}

.word-card-title {
  padding: 25px 0 22px;
  text-align: center;
}

.word-card-title h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.phonetics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.phonetics-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.phonetics-row b {
  color: var(--navy);
  font-size: 9px;
}

.word-card-meaning {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.example-block {
  padding: 17px 19px;
  border-left: 3px solid var(--yellow);
  border-radius: 5px;
  background: #f8faf9;
}

.example-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.example-label > span {
  color: var(--coral);
  font-size: 9px;
  font-weight: 850;
}

.example-label .icon-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
}

.example-en {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.7;
}

.example-en mark,
.review-example mark {
  padding: 0 2px;
  color: var(--blue);
  background: #fff0ad;
}

.example-zh {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.study-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: 14px;
}

.study-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
}

.study-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd4d9;
}

.study-dots span.done {
  background: var(--teal);
}

.study-dots span.active {
  width: 18px;
  border-radius: 5px;
  background: var(--yellow);
}

.completion-shell,
.result-shell {
  display: flex;
  align-items: center;
  width: min(760px, 100%);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  justify-content: center;
  flex-direction: column;
  padding: 38px 20px;
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 0 0 10px var(--teal-soft);
}

.completion-mark svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

.completion-mark.teal {
  background: var(--teal);
}

.completion-shell h1,
.result-shell h1 {
  margin: 2px 0 9px;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
}

.completion-shell > p,
.result-shell > p {
  max-width: 530px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.completion-stats,
.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  width: min(470px, 100%);
  margin: 27px 0 22px;
}

.completion-stats > div,
.result-summary-grid > div {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.completion-stats strong,
.result-summary-grid strong {
  color: var(--navy);
  font-size: 25px;
}

.completion-stats span,
.result-summary-grid span {
  color: var(--muted);
  font-size: 9px;
}

.completion-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.completion-preview {
  width: min(540px, 100%);
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.completion-preview > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.word-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.word-chip {
  padding: 5px 9px;
  border: 1px solid #d8e2e8;
  border-radius: 4px;
  color: var(--blue);
  background: var(--blue-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.quiz-card {
  padding: 24px;
}

.quiz-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--coral);
  background: var(--coral-soft);
  font-size: 9px;
  font-weight: 800;
}

.quiz-prompt {
  padding: 26px 0 22px;
  text-align: center;
}

.quiz-prompt h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(32px, 5vw, 51px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.quiz-prompt p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.option-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.option-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #b9c8cf;
  background: #fafcfc;
}

.option-button > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 800;
}

.option-button strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.option-button svg {
  width: 17px;
  height: 17px;
}

.option-button.is-correct {
  border-color: #9dcfc8;
  background: var(--teal-soft);
}

.option-button.is-correct > span {
  color: #fff;
  background: var(--teal);
}

.option-button.is-correct svg {
  color: var(--teal);
}

.option-button.is-wrong {
  border-color: #efb4ad;
  background: var(--coral-soft);
}

.option-button.is-wrong > span {
  color: #fff;
  background: var(--coral);
}

.option-button.is-wrong svg {
  color: var(--coral);
}

.option-button:disabled {
  cursor: default;
}

.option-button:disabled:not(.is-correct):not(.is-wrong) {
  opacity: 0.55;
}

.answer-feedback {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 5px;
}

.answer-feedback.correct {
  color: #1f605a;
  background: var(--teal-soft);
}

.answer-feedback.wrong {
  color: #983b32;
  background: var(--coral-soft);
}

.answer-feedback > svg {
  width: 22px;
  height: 22px;
}

.answer-feedback > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.answer-feedback strong {
  font-size: 12px;
}

.answer-feedback span {
  color: var(--muted);
  font-size: 10px;
}

.quiz-next {
  width: 100%;
  margin-top: 12px;
}

.result-ring {
  --ring-color: var(--teal);
  display: grid;
  width: 144px;
  height: 144px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), #e7ecef 0);
}

.result-ring::before {
  grid-area: 1 / 1;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--bg);
  content: "";
}

.result-ring > span {
  z-index: 1;
  display: flex;
  grid-area: 1 / 1;
  align-items: center;
  flex-direction: column;
}

.result-ring strong {
  color: var(--navy);
  font-size: 31px;
}

.result-ring small {
  color: var(--muted);
  font-size: 9px;
}

.result-ring.tone-mid {
  --ring-color: var(--yellow);
}

.result-ring.tone-low {
  --ring-color: var(--coral);
}

.result-word-review {
  width: min(560px, 100%);
  margin-top: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.result-word-review .section-heading {
  margin-bottom: 8px;
}

.result-word-list {
  display: flex;
  flex-direction: column;
}

.result-word-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.result-word-list button > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.result-word-list strong {
  color: var(--blue);
  font-size: 13px;
}

.result-word-list small {
  color: var(--muted);
  font-size: 10px;
}

.result-word-list svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.perfect-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 15px;
  border-radius: 5px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 700;
}

.perfect-note svg {
  width: 18px;
  height: 18px;
}

.result-actions {
  margin-top: 23px;
}

.review-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
  padding: 23px 25px;
  border-radius: 7px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow-md);
}

.review-hero-clear {
  background: var(--teal);
}

.review-hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.review-count {
  display: grid;
  width: 67px;
  height: 67px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
  font-size: 28px;
  font-weight: 850;
}

.review-hero .section-kicker {
  color: var(--yellow);
}

.review-hero h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 24px;
}

.review-hero p {
  max-width: 590px;
  margin: 0;
  color: #ccdae2;
  font-size: 11px;
  line-height: 1.65;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 14px;
}

.review-word-list {
  display: flex;
  flex-direction: column;
}

.review-word-row {
  display: grid;
  grid-template-columns: 14px minmax(160px, 1fr) minmax(100px, 0.6fr) 64px 16px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.review-word-row:first-child {
  border-top: 0;
}

.review-word-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.review-word-main strong {
  overflow: hidden;
  color: var(--blue);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-word-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-scene {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-overdue {
  justify-self: end;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
}

.review-word-row > svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #c3ccd1;
}

.stage-1 {
  background: var(--coral);
}

.stage-2 {
  background: var(--yellow);
}

.stage-3 {
  background: var(--blue);
}

.stage-4,
.stage-5 {
  background: var(--teal);
}

.review-method-card h2 {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 18px;
}

.stage-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border-top: 1px solid #edf0f2;
  color: var(--text);
  font-size: 11px;
}

.stage-row:first-of-type {
  border-top: 0;
}

.stage-row small {
  color: var(--muted);
  font-size: 9px;
}

.review-study-shell {
  width: min(700px, 100%);
}

.review-card {
  padding: 29px;
  text-align: center;
}

.review-card h1 {
  margin: 25px 0 8px;
  color: var(--blue);
  font-size: clamp(39px, 7vw, 64px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.review-card-phonetic {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.review-card > .icon-button {
  margin-top: 17px;
}

.review-reveal {
  display: none;
  margin-top: 25px;
  padding: 18px;
  border-radius: 6px;
  background: var(--surface-soft);
  text-align: left;
}

.review-reveal.is-visible {
  display: block;
}

.review-reveal > p {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 13px;
  color: var(--text);
  font-size: 14px;
}

.review-reveal b {
  color: var(--teal);
  font-size: 10px;
}

.review-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.review-example > span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.review-example small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.reveal-button {
  width: min(280px, 100%);
  margin-top: 21px;
}

.review-answer-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9px;
  margin-top: 21px;
}

.test-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--coral);
  border-radius: 7px;
  background: #fff;
}

.test-intro h2 {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 22px;
}

.test-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.test-intro-metrics {
  display: flex;
  gap: 20px;
  flex: none;
}

.test-intro-metrics span {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--muted);
  font-size: 9px;
}

.test-intro-metrics strong {
  margin-bottom: 2px;
  color: var(--navy);
  font-size: 20px;
}

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

.test-pack-card {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.test-pack-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(23, 50, 77, 0.1);
}

.test-pack-card > img {
  width: 100%;
  height: 100%;
  min-height: 173px;
  object-fit: cover;
}

.test-pack-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 15px;
}

.test-pack-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.test-pack-content h3 {
  margin: 8px 0 5px;
  color: var(--navy);
  font-size: 17px;
}

.test-pack-content > p {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.test-pack-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: var(--faint);
  font-size: 9px;
}

.test-start {
  display: grid;
  width: 26px;
  height: 26px;
  margin-left: auto;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow);
}

.test-start svg {
  width: 13px;
  height: 13px;
}

.recent-tests {
  margin-top: 14px;
}

.recent-test-list {
  display: flex;
  flex-direction: column;
}

.recent-test-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.recent-test-row:first-child {
  border-top: 0;
}

.test-score {
  display: grid;
  width: 42px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.test-score.good {
  background: var(--teal);
}

.test-score.mid {
  color: var(--navy);
  background: var(--yellow);
}

.test-score.low {
  background: var(--coral);
}

.recent-test-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.recent-test-copy strong {
  color: var(--navy);
  font-size: 12px;
}

.recent-test-copy small {
  color: var(--muted);
  font-size: 9px;
}

.recent-test-row > svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.test-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-number {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
}

.cloze-prompt {
  padding: 28px 3px 22px;
}

.cloze-prompt p {
  margin: 0 0 13px;
  color: var(--text);
  font-size: clamp(19px, 2.8vw, 28px);
  font-weight: 600;
  line-height: 1.55;
}

.cloze-prompt span {
  color: var(--muted);
  font-size: 11px;
}

.blank-mark {
  padding: 0 4px;
  color: var(--blue);
  background: transparent;
  border-bottom: 2px solid var(--yellow);
}

.cloze-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.cloze-input-wrap input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--text);
  background: #fff;
  font-size: 14px;
}

.cloze-input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(51, 95, 157, 0.1);
}

.cloze-input-wrap .button {
  min-width: 84px;
  height: 48px;
}

.test-result-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
  width: min(500px, 100%);
  margin: 25px 0 0;
}

.test-result-breakdown > div {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.test-result-breakdown svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.test-result-breakdown strong {
  color: var(--navy);
  font-size: 20px;
}

.test-result-breakdown small {
  color: var(--muted);
  font-size: 8px;
}

/* Learning profile */
.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.profile-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: none;
  place-items: center;
  border: 1px solid #d7e3e6;
  border-radius: 7px;
  color: var(--teal);
  background: var(--teal-soft);
}

.profile-avatar svg {
  width: 23px;
  height: 23px;
}

.profile-main h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.35;
}

.profile-main p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.profile-numbers {
  display: flex;
  align-items: center;
  flex: none;
  gap: 25px;
}

.profile-numbers span {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.profile-numbers strong {
  color: var(--navy);
  font-size: 22px;
  line-height: 1.2;
}

.stats-page-grid {
  margin-bottom: 14px;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.activity-panel,
.mastery-panel {
  min-height: 318px;
}

.activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  align-items: end;
  gap: 9px;
  min-height: 188px;
  padding: 12px 4px 0;
}

.activity-day {
  display: grid;
  grid-template-rows: 18px 132px 18px 16px;
  align-items: end;
  justify-items: center;
  min-width: 0;
}

.activity-value {
  align-self: start;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.activity-bar-wrap {
  display: flex;
  width: min(28px, 74%);
  height: 126px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 4px 4px 2px 2px;
  background: #f0f3f4;
}

.activity-bar {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--teal);
}

.activity-day:nth-child(3n + 2) .activity-bar {
  background: var(--blue);
}

.activity-day:nth-child(3n) .activity-bar {
  background: var(--yellow);
}

.activity-day strong {
  color: var(--navy);
  font-size: 9px;
}

.activity-day small {
  color: var(--faint);
  font-size: 8px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #edf0f2;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.learned {
  background: var(--yellow);
}

.legend-dot.reviewed {
  background: var(--blue);
}

.legend-dot.quizzed {
  background: var(--teal);
}

.mastery-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 17px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f2;
}

.mastery-summary strong {
  color: var(--navy);
  font-size: 32px;
  line-height: 1;
}

.mastery-summary span {
  color: var(--muted);
  font-size: 10px;
}

.mastery-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.mastery-row {
  display: grid;
  grid-template-columns: 9px 35px minmax(50px, 1fr) 21px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 10px;
}

.mastery-row b {
  color: var(--navy);
  font-size: 10px;
  text-align: right;
}

.mastery-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f3;
}

.mastery-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--blue);
}

.mastery-row:nth-child(1) .mastery-track i {
  background: var(--coral);
}

.mastery-row:nth-child(2) .mastery-track i {
  background: var(--yellow);
}

.mastery-row:nth-child(4) .mastery-track i,
.mastery-row:nth-child(5) .mastery-track i,
.mastery-row:nth-child(6) .mastery-track i {
  background: var(--teal);
}

.stats-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.mistake-list {
  display: flex;
  flex-direction: column;
}

.mistake-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mistake-row:first-child {
  border-top: 0;
}

.mistake-row:hover strong {
  color: var(--blue);
}

.mistake-count {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #9f3c34;
  background: var(--coral-soft);
  font-size: 9px;
  font-weight: 850;
}

.mistake-row > span:not(.mistake-count) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.mistake-row strong {
  color: var(--navy);
  font-size: 12px;
  transition: color 140ms ease;
}

.mistake-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-row > svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.test-history-panel .empty-state {
  min-height: 220px;
}

/* Dialogs and feedback */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow-y: auto;
  padding: 24px;
  place-items: center;
  background: rgba(15, 34, 51, 0.58);
  backdrop-filter: blur(3px);
  animation: modal-fade-in 150ms ease both;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.word-modal,
.settings-modal {
  position: relative;
  width: min(580px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 27, 42, 0.3);
  animation: modal-rise 180ms ease both;
}

@keyframes modal-rise {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--navy);
  background: var(--surface-soft);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 42px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.modal-kicker span {
  padding: 4px 7px;
  border-radius: 3px;
  background: var(--surface-soft);
}

.modal-kicker span:last-child {
  color: var(--teal);
  background: var(--teal-soft);
}

.modal-word-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 15px 0 17px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-word-head > div {
  min-width: 0;
}

.modal-word-head h2 {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: clamp(31px, 7vw, 48px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.modal-word-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-meaning {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.modal-meaning b {
  color: var(--teal);
  font-size: 11px;
}

.modal-example {
  margin-top: 18px;
  padding: 17px 18px;
  border-left: 3px solid var(--yellow);
  border-radius: 5px;
  background: var(--surface-soft);
}

.modal-example p {
  margin: 8px 0 7px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.modal-example mark {
  padding: 0 2px;
  color: var(--blue);
  background: #fff0ad;
}

.modal-example small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 17px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 9px;
}

.modal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-meta svg {
  width: 13px;
  height: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.settings-modal {
  width: min(500px, 100%);
}

.settings-modal h2 {
  margin: 4px 0 7px;
  color: var(--navy);
  font-size: 25px;
}

.modal-description {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

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

.goal-picker button {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.goal-picker button:hover {
  border-color: #b9c6cc;
  color: var(--navy);
}

.goal-picker button.active {
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.goal-picker strong {
  font-size: 22px;
}

.goal-picker span {
  font-size: 9px;
}

.settings-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.settings-danger > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.settings-danger strong {
  color: var(--navy);
  font-size: 12px;
}

.settings-danger span {
  color: var(--muted);
  font-size: 9px;
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  color: #8f2f27;
  background: var(--coral-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 130;
  min-width: 168px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 9px 28px rgba(10, 27, 42, 0.24);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.not-found {
  display: flex;
  min-height: calc(100vh - 120px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto;
  padding: 38px 20px;
  text-align: center;
}

.not-found > svg {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: var(--coral);
}

.not-found h1 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 27px;
}

.not-found p {
  max-width: 420px;
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.review-aside {
  position: sticky;
  top: 20px;
}

.review-result-shell,
.test-result-shell {
  padding-bottom: 70px;
}

.test-session-shell .test-question-card {
  min-height: 420px;
}

@media (max-width: 1080px) {
  .app-view {
    padding: 26px 24px 44px;
  }

  .mission-panel {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 36%);
  }

  .home-grid,
  .scene-detail-grid,
  .review-layout,
  .stats-layout,
  .stats-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-scene-grid,
  .library-scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-pack-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-aside {
    position: static;
  }

  .stage-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }
}

@media (max-width: 780px) {
  body {
    background: #f3f6f7;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 40;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 252, 252, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--navy);
    font-size: 15px;
    font-weight: 800;
  }

  .mobile-brand .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 10px;
  }

  .mobile-topbar .icon-button {
    position: relative;
    width: 38px;
    height: 38px;
  }

  .topbar-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border: 2px solid #fbfcfc;
    border-radius: 50%;
    background: var(--coral);
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 62px;
    padding: 5px 5px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 28px rgba(23, 50, 77, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-nav a {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-nav a svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.9;
  }

  .mobile-nav a.active {
    color: var(--navy);
    background: #edf2f3;
  }

  .mobile-nav a.active::before {
    position: absolute;
    top: 1px;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--coral);
    content: "";
  }

  .app-view {
    min-height: 100vh;
    padding: 76px 16px 86px;
  }

  .page-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-title {
    font-size: 26px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .date-chip,
  .streak-chip {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .mission-panel {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .mission-visual {
    order: -1;
    height: 188px;
    min-height: 188px;
  }

  .mission-copy {
    padding: 22px 20px 23px;
  }

  .mission-title {
    font-size: 25px;
  }

  .mission-summary {
    font-size: 12px;
    line-height: 1.7;
  }

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

  .mission-actions .button {
    width: 100%;
  }

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

  .stat-tile {
    min-width: 0;
    padding: 13px;
  }

  .stat-tile strong {
    font-size: 25px;
  }

  .section-panel {
    padding: 17px;
  }

  .section-heading {
    gap: 10px;
  }

  .section-heading-spread {
    align-items: flex-start;
  }

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

  .scene-card-visual,
  .library-scene-grid .scene-card-visual {
    height: 112px;
  }

  .scene-card-body,
  .library-scene-grid .scene-card-body {
    padding: 12px;
  }

  .scene-card h3,
  .library-scene-grid .scene-card h3 {
    font-size: 14px;
  }

  .scene-card p,
  .library-scene-grid .scene-card p {
    min-height: 32px;
    font-size: 9px;
  }

  .learning-note {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 15px;
  }

  .learning-note p {
    font-size: 11px;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .segmented-control {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .scene-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-hero-image {
    order: -1;
    min-height: 190px;
    height: 190px;
  }

  .scene-hero-copy {
    padding: 22px 20px 25px;
  }

  .scene-hero-copy h1 {
    font-size: 29px;
  }

  .scene-action-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 15px;
  }

  .scene-action-progress {
    min-width: 0;
  }

  .scene-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .word-panel {
    padding-top: 17px;
  }

  .word-panel > .section-heading {
    padding: 0 17px;
  }

  .word-table-head {
    display: none;
  }

  .word-table {
    max-height: none;
    overflow: visible;
  }

  .word-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: start;
    gap: 4px 9px;
    min-height: 70px;
    padding: 11px 17px;
  }

  .word-index {
    grid-column: 1;
    grid-row: 1 / 3;
    padding-top: 2px;
  }

  .word-main {
    grid-column: 2;
    grid-row: 1;
  }

  .word-main strong {
    font-size: 14px;
  }

  .word-main small {
    font-size: 8px;
  }

  .word-meaning {
    grid-column: 2 / 4;
    grid-row: 2;
    align-items: baseline;
    font-size: 11px;
    white-space: normal;
  }

  .word-state {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .scene-side {
    gap: 10px;
  }

  .dialogue-turn {
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: start;
    gap: 6px 9px;
  }

  .dialogue-speaker {
    grid-column: 1 / -1;
    padding: 0;
    text-align: left;
  }

  .dialogue-bubble {
    grid-column: 1;
  }

  .dialogue-turn .icon-button {
    grid-column: 2;
  }

  .study-topbar {
    margin-bottom: 13px;
  }

  .word-card {
    padding: 19px 17px 20px;
  }

  .word-card-title {
    padding: 22px 0 18px;
  }

  .word-card-title h1 {
    font-size: 42px;
  }

  .phonetics-row {
    gap: 5px 11px;
    font-size: 10px;
  }

  .word-card-meaning {
    font-size: 14px;
  }

  .example-block {
    padding: 15px;
  }

  .example-en {
    font-size: 13px;
  }

  .study-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-actions .button {
    width: 100%;
  }

  .completion-shell,
  .result-shell {
    min-height: calc(100vh - 170px);
    padding: 28px 6px 42px;
  }

  .completion-shell h1,
  .result-shell h1 {
    font-size: 28px;
  }

  .completion-stats,
  .result-summary-grid {
    width: 100%;
  }

  .quiz-card {
    padding: 18px;
  }

  .quiz-prompt {
    padding: 23px 0 19px;
  }

  .quiz-prompt h1 {
    font-size: 33px;
  }

  .option-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .option-button {
    min-height: 57px;
  }

  .cloze-input-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .cloze-input-wrap .button {
    width: 100%;
  }

  .test-result-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .result-word-review {
    padding: 15px;
  }
}

@media (max-width: 780px) {
  .review-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    padding: 18px;
  }

  .review-hero-main {
    align-items: flex-start;
    gap: 13px;
  }

  .review-count {
    width: 55px;
    height: 55px;
    font-size: 23px;
  }

  .review-hero h2 {
    font-size: 21px;
  }

  .review-hero .button {
    width: 100%;
  }

  .review-word-row {
    grid-template-columns: 10px minmax(0, 1fr) auto 14px;
    gap: 3px 8px;
    min-height: 65px;
  }

  .review-word-row .stage-dot {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .review-word-main {
    grid-column: 2;
    grid-row: 1;
  }

  .review-scene {
    grid-column: 2;
    grid-row: 2;
  }

  .review-overdue {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .review-word-row > svg {
    grid-column: 4;
    grid-row: 1 / 3;
    align-self: center;
  }

  .review-card {
    padding: 24px 18px;
  }

  .review-card h1 {
    margin-top: 20px;
    font-size: 45px;
  }

  .review-reveal {
    padding: 15px;
  }

  .review-answer-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-intro {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    padding: 19px;
  }

  .test-intro-metrics {
    justify-content: space-between;
    gap: 10px;
  }

  .test-intro-metrics span {
    flex: 1;
  }

  .test-pack-card {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .test-pack-card > img {
    min-height: 160px;
  }

  .test-pack-content {
    padding: 13px;
  }

  .cloze-prompt {
    padding: 23px 0 19px;
  }

  .cloze-prompt p {
    font-size: 20px;
  }

  .profile-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  .profile-main {
    align-items: flex-start;
  }

  .profile-numbers {
    justify-content: space-between;
    gap: 8px;
  }

  .profile-numbers span {
    flex: 1;
  }

  .activity-panel,
  .mastery-panel {
    min-height: 0;
  }

  .activity-chart {
    gap: 5px;
    min-height: 164px;
  }

  .activity-day {
    grid-template-rows: 16px 112px 16px 14px;
  }

  .activity-bar-wrap {
    height: 106px;
  }

  .modal-backdrop {
    padding: 10px;
    place-items: center;
  }

  .word-modal,
  .settings-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 21px 18px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
  }

  .modal-word-head {
    align-items: flex-start;
    gap: 12px;
  }

  .modal-word-head h2 {
    font-size: 35px;
  }

  .modal-meaning {
    font-size: 15px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-actions .button {
    width: 100%;
  }

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

  .settings-danger {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-danger .button {
    width: 100%;
  }

  .toast {
    bottom: 78px;
  }
}

@media (max-width: 520px) {
  .app-view {
    padding-right: 12px;
    padding-left: 12px;
  }

  .page-title {
    font-size: 24px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .date-chip,
  .streak-chip {
    flex: 1;
    justify-content: center;
  }

  .mission-visual {
    height: 166px;
    min-height: 166px;
  }

  .mission-copy {
    padding: 20px 17px 21px;
  }

  .mission-title {
    font-size: 23px;
  }

  .mission-meta {
    gap: 8px 12px;
  }

  .home-scene-grid,
  .library-scene-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-card-visual,
  .library-scene-grid .scene-card-visual {
    height: 142px;
  }

  .scene-card h3,
  .library-scene-grid .scene-card h3 {
    font-size: 16px;
  }

  .scene-card p,
  .library-scene-grid .scene-card p {
    min-height: 34px;
    font-size: 10px;
  }

  .section-heading-spread {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading-spread > .text-link {
    align-self: flex-start;
  }

  .learning-note {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .learning-note > .icon-button {
    display: none;
  }

  .scene-action-buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-hero-copy h1 {
    font-size: 26px;
  }

  .word-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    padding-right: 14px;
    padding-left: 14px;
  }

  .word-panel > .section-heading {
    padding-right: 14px;
    padding-left: 14px;
  }

  .word-main small {
    white-space: normal;
  }

  .study-counter {
    font-size: 10px;
  }

  .word-card-title h1 {
    font-size: 37px;
  }

  .completion-stats,
  .result-summary-grid,
  .test-result-breakdown {
    gap: 7px;
  }

  .completion-stats > div,
  .result-summary-grid > div {
    min-width: 0;
    padding: 7px;
  }

  .completion-stats strong,
  .result-summary-grid strong {
    font-size: 22px;
  }

  .review-hero-main {
    align-items: center;
  }

  .review-word-row {
    grid-template-columns: 9px minmax(0, 1fr) 14px;
  }

  .review-overdue {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
    align-self: start;
  }

  .review-word-row > svg {
    grid-column: 3;
  }

  .review-card h1 {
    font-size: 39px;
  }

  .test-pack-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-pack-card > img {
    height: 125px;
    min-height: 0;
  }

  .test-pack-content h3 {
    font-size: 16px;
  }

  .profile-main h2 {
    font-size: 18px;
  }

  .profile-avatar {
    width: 44px;
    height: 44px;
  }

  .profile-numbers strong {
    font-size: 19px;
  }

  .modal-word-head {
    flex-direction: column;
  }

  .modal-word-head > .icon-button {
    align-self: flex-start;
  }

  .modal-example {
    padding: 15px;
  }

  .modal-example p {
    font-size: 13px;
  }
}
