:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #fbfcfe;
  --ink: #101828;
  --muted: #667085;
  --muted-strong: #475467;
  --line: #e4e7ec;
  --line-strong: #cfd7e3;
  --red: #c71924;
  --theme: #c71924;
  --theme-hover: #a9151e;
  --theme-soft: #fff3f4;
  --theme-border: #f3b7bd;
  --theme-focus: rgba(199, 25, 36, 0.18);
  --theme-wash: rgba(199, 25, 36, 0.08);
  --theme-rule: rgba(199, 25, 36, 0.12);
  --header-control-height: 42px;
  --header-control-padding: 10px;
  --teal: #0f766e;
  --blue: #2563eb;
  --gold: #bd7a22;
  --green: #2f9461;
  --sidebar-width: 260px;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.06);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.05);
  --chinese-font:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-width: 320px;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  display: none;
}

body::after {
  display: none;
}

html {
  scroll-padding-top: 12px;
}

body[data-mode="reading"] {
  --theme: #c71924;
  --theme-hover: #a9151e;
  --theme-soft: #fff3f4;
  --theme-border: #f3b7bd;
  --theme-focus: rgba(199, 25, 36, 0.18);
  --theme-wash: rgba(199, 25, 36, 0.08);
  --theme-rule: rgba(199, 25, 36, 0.12);
}

body[data-mode="writing"] {
  --theme: #2563eb;
  --theme-hover: #1d4ed8;
  --theme-soft: #f2f6ff;
  --theme-border: #bfd0ff;
  --theme-focus: rgba(37, 99, 235, 0.18);
  --theme-wash: rgba(37, 99, 235, 0.08);
  --theme-rule: rgba(37, 99, 235, 0.12);
}

body[data-mode="listening"] {
  --theme: #198a5a;
  --theme-hover: #126d46;
  --theme-soft: #f0fbf5;
  --theme-border: #b8dec9;
  --theme-focus: rgba(25, 138, 90, 0.18);
  --theme-wash: rgba(25, 138, 90, 0.08);
  --theme-rule: rgba(25, 138, 90, 0.12);
}

body[data-tool="vocabulary"] {
  --theme: #0f766e;
  --theme-hover: #0c5f59;
  --theme-soft: #effcf9;
  --theme-border: #a8ddd7;
  --theme-focus: rgba(15, 118, 110, 0.18);
  --theme-wash: rgba(15, 118, 110, 0.08);
  --theme-rule: rgba(15, 118, 110, 0.12);
}

body[data-tool="review"] {
  --theme: #147d64;
  --theme-hover: #0f684f;
  --theme-soft: #eefaf5;
  --theme-border: #a9dcc9;
  --theme-focus: rgba(20, 125, 100, 0.18);
  --theme-wash: rgba(20, 125, 100, 0.08);
  --theme-rule: rgba(20, 125, 100, 0.12);
}

body[data-tool="grammar"] {
  --theme: #2563eb;
  --theme-hover: #1d4ed8;
  --theme-soft: #f2f6ff;
  --theme-border: #bfd0ff;
  --theme-focus: rgba(37, 99, 235, 0.18);
  --theme-wash: rgba(37, 99, 235, 0.08);
  --theme-rule: rgba(37, 99, 235, 0.12);
}

body[data-tool="dashboard"] {
  --theme: #147d64;
  --theme-hover: #0f684f;
  --theme-soft: #eefaf5;
  --theme-border: #a9dcc9;
  --theme-focus: rgba(20, 125, 100, 0.18);
  --theme-wash: rgba(20, 125, 100, 0.08);
  --theme-rule: rgba(20, 125, 100, 0.12);
}

body[data-tool="pronunciation"] {
  --theme: #0e7490;
  --theme-hover: #155e75;
  --theme-soft: #eefbfd;
  --theme-border: #a5dce8;
  --theme-focus: rgba(14, 116, 144, 0.18);
  --theme-wash: rgba(14, 116, 144, 0.08);
  --theme-rule: rgba(14, 116, 144, 0.12);
}

body[data-tool="map"] {
  --theme: #0d9488;
  --theme-hover: #0f766e;
  --theme-soft: #ecfdf9;
  --theme-border: #99d9cf;
  --theme-focus: rgba(13, 148, 136, 0.18);
  --theme-wash: rgba(13, 148, 136, 0.08);
  --theme-rule: rgba(13, 148, 136, 0.12);
}

body[data-tool="reader"] {
  --theme: #7c3f73;
  --theme-hover: #65325d;
  --theme-soft: #fcf4fa;
  --theme-border: #dfbdd9;
  --theme-focus: rgba(124, 63, 115, 0.18);
  --theme-wash: rgba(124, 63, 115, 0.08);
  --theme-rule: rgba(124, 63, 115, 0.12);
}

.vocabulary-only {
  display: none;
}

body:not([data-tool="drill"]) .drill-only,
body:not([data-tool="pronunciation"]) .pronunciation-only,
body:not([data-tool="pronunciation"]) .pronunciation-speaking-only,
body[data-tool="pronunciation"]:not([data-pronunciation-view="speaking"]) .pronunciation-speaking-only,
body:not([data-tool="vocabulary"]) .vocabulary-only {
  display: none !important;
}

body[data-tool="vocabulary"] .vocabulary-only {
  display: grid !important;
}

body[data-tool="vocabulary"] .vocabulary-quiz-only[hidden] {
  display: none !important;
}

.sentence-bank-only {
  display: none;
}

body[data-tool="drill"] .sentence-bank-only,
body[data-tool="pronunciation"][data-pronunciation-view="speaking"] .sentence-bank-only,
body[data-tool="pronunciation"] .pronunciation-only {
  display: grid !important;
}

.drill-only[hidden],
.pronunciation-only[hidden],
.pronunciation-speaking-only[hidden],
.sentence-bank-only[hidden],
.vocabulary-only[hidden],
.vocabulary-quiz-only[hidden] {
  display: none !important;
}

body[data-tool="history"] {
  --theme: #475467;
  --theme-hover: #344054;
  --theme-soft: #f8fafc;
  --theme-border: #d0d5dd;
  --theme-focus: rgba(71, 84, 103, 0.18);
  --theme-wash: rgba(71, 84, 103, 0.08);
  --theme-rule: rgba(71, 84, 103, 0.12);
}

body[data-tool="dashboard"] .tool-controls,
body[data-tool="history"] .tool-controls,
body[data-tool="reader"] .tool-controls {
  display: none;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0;
}

.noscript-message {
  margin: 12px auto 0;
  width: min(960px, calc(100% - 24px));
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  color: var(--ink);
  padding: 12px 14px;
  font-weight: 800;
}

.topbar,
.mode-nav,
.global-options,
.workspace-panel,
.results-table-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 16px;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 236px;
}

.brand-row {
  min-width: 0;
}

.brand-actions {
  display: grid;
  gap: 8px;
}

.global-search-trigger,
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0 10px 0 12px;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.global-search-trigger:hover,
.account-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  color: var(--ink);
}

.global-search-trigger:focus-visible,
.account-trigger:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

.global-search-trigger .button-icon,
.account-trigger .button-icon {
  width: 17px;
  height: 17px;
}

.global-search-trigger-label {
  min-width: 0;
  flex: 1;
}

.global-search-trigger-shortcut {
  min-width: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  padding: 3px 5px;
  font-size: 10px;
  line-height: 1;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.account-trigger {
  justify-content: flex-start;
}

.account-trigger-label {
  min-width: 0;
  flex: 1;
}

.account-trigger-badge {
  border: 1px solid #d7b66f;
  border-radius: 5px;
  background: #fff9e8;
  color: #76520d;
  padding: 3px 5px;
  font-size: 9px;
  line-height: 1;
  font-weight: 850;
  text-transform: uppercase;
}

.account-trigger.is-premium {
  border-color: #d7b66f;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
  box-shadow: var(--shadow-soft);
}

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

.brand h1 {
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 850;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tool-nav,
.mode-nav {
  display: grid;
  gap: 8px;
}

.tool-nav {
  grid-template-columns: repeat(7, minmax(80px, 1fr));
  width: min(920px, 100%);
}

.tool-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  line-height: 1.15;
  font-weight: 760;
}

.tool-tab-icon {
  width: 16px;
  height: 16px;
}

.tool-tab-label {
  min-width: 0;
}

.tool-controls {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.mode-nav {
  grid-template-columns: repeat(3, minmax(104px, 1fr));
  width: 100%;
  padding: var(--header-control-padding);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.mode-nav.vocabulary-mode-nav {
  grid-template-columns: repeat(2, minmax(104px, 1fr));
}

.mode-tab,
.tool-tab,
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: var(--header-control-height);
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  font-weight: 760;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.mode-tab:hover,
.tool-tab:hover,
.options-summary:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--theme);
  transform: translateY(-1px);
}

.mode-tab.active,
.tool-tab.active {
  border-color: var(--theme);
  background: var(--theme);
  color: white;
  box-shadow: 0 8px 20px var(--theme-wash);
}

.global-options {
  padding: var(--header-control-padding);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  overflow: visible;
}

.options-summary {
  min-height: var(--header-control-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  text-transform: uppercase;
}

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

.options-summary::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--theme);
  border-bottom: 2px solid var(--theme);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.global-options[open] .options-summary::after {
  transform: rotate(225deg);
}

.options-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: start;
  gap: 14px;
  padding: 14px 6px 4px;
}

body[data-tool="vocabulary"] .tool-controls {
  grid-template-columns: minmax(280px, 520px) minmax(260px, 1fr);
  justify-content: stretch;
}

body[data-tool="vocabulary"] .options-body {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
}

.option-group,
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.option-label,
.field span,
.field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pwa-access-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 38px;
}

body[data-tool="vocabulary"] .pwa-access {
  grid-column: 1 / -1;
}

.pwa-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 750;
}

.pwa-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a3b8;
  content: "";
}

.pwa-status[data-state="ready"]::before {
  background: var(--green);
}

.pwa-status[data-state="offline"]::before {
  background: #c47a1a;
}

.pwa-status[data-state="update"]::before {
  background: var(--theme);
}

.pwa-action-btn {
  width: auto;
  min-height: 34px;
  gap: 7px;
  padding: 0 10px;
  font-size: 11px;
}

.pwa-action-btn .button-icon {
  width: 15px;
  height: 15px;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.level-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.level-check input {
  accent-color: var(--theme);
}

.pool-count-pill {
  border-color: var(--theme-border);
  background: var(--theme-soft);
}

.pool-count-pill strong,
.pool-count-pill span {
  display: inline;
  margin: 0;
  font-size: inherit;
  line-height: 1;
  text-transform: none;
}

.pool-count-pill strong {
  color: var(--theme);
  font-weight: 900;
}

@media (min-width: 981px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-row: 1 / span 2;
    align-self: start;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 30px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 14px 18px;
    border-width: 0 1px 0 0;
    border-color: var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .brand {
    align-items: flex-start;
    min-width: 0;
    padding: 0 4px;
  }

  .brand-row {
    display: grid;
    gap: 20px;
  }

  .global-search-trigger {
    width: 100%;
  }

  .account-trigger {
    width: 100%;
  }

  .tool-nav {
    align-self: start;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .tool-tab {
    justify-content: flex-start;
    min-height: 48px;
    padding: 0 14px;
    border-color: transparent;
    background: transparent;
    color: var(--muted-strong);
  }

  .tool-tab:hover {
    background: var(--surface-strong);
    border-color: var(--line);
    transform: none;
  }

  .tool-tab.active {
    border-color: transparent;
    background: var(--theme-soft);
    color: var(--theme);
    box-shadow: inset 3px 0 0 var(--theme);
  }

  .tool-controls {
    grid-column: 2;
    grid-template-rows: auto auto;
    row-gap: 18px;
    padding: 30px 28px 0;
  }

  .tool-controls::before {
    content: "Sentence Drills";
    grid-column: 1 / -1;
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: 0;
  }

  body[data-tool="vocabulary"] .tool-controls::before {
    content: "Vocabulary Quiz";
  }

  body[data-tool="review"] .tool-controls::before {
    content: "Daily Review";
  }

  body[data-tool="grammar"] .tool-controls::before {
    content: "Grammar Lab";
  }

  body[data-tool="pronunciation"] .tool-controls::before {
    content: "Pronunciation";
  }

  body[data-tool="map"] .tool-controls::before {
    content: "Geography of China";
  }

  body[data-tool="history"] .tool-controls::before {
    content: "History";
  }

  body[data-tool="map"] .tool-controls {
    display: none;
  }

  body[data-tool="map"] .workspace {
    padding-top: 22px;
  }

  .workspace {
    grid-column: 2;
    padding: 20px 28px 32px;
  }

  body[data-tool="history"] .workspace {
    padding-top: 28px;
  }

  body[data-tool="dashboard"] .workspace {
    padding-top: 28px;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .tool-controls,
  body[data-tool="vocabulary"] .tool-controls {
    grid-template-columns: 1fr;
  }

  .map-quiz-workspace {
    height: auto;
    overflow: visible;
  }

  body[data-tool="map"] .workspace {
    padding-right: 18px;
    padding-left: 18px;
  }

}

select {
  width: 100%;
}

select {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  text-overflow: ellipsis;
}

.workspace {
  padding: 16px 18px 22px;
}

.workspace-panel {
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.mode-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.mode-heading h2 {
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 850;
}

.mode-heading p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.task-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 18px 0 20px;
}

.quiz-config {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(260px, 1.28fr);
  gap: 14px;
  margin-top: 18px;
}

.vocabulary-translation-check {
  min-height: 36px;
}

.vocabulary-view-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(510px, 100%);
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f5f8;
}

.vocabulary-view-switcher button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.vocabulary-view-switcher button:hover {
  color: var(--ink);
}

.vocabulary-view-switcher button.active {
  border-color: var(--line);
  color: var(--theme);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

.drill-view-switcher,
.pronunciation-view-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(360px, 100%);
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f5f8;
}

.drill-view-switcher button,
.pronunciation-view-switcher button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.drill-view-switcher button:hover,
.pronunciation-view-switcher button:hover {
  color: var(--ink);
}

.drill-view-switcher button.active,
.pronunciation-view-switcher button.active {
  border-color: var(--line);
  color: var(--theme);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

.sentence-library {
  min-width: 0;
}

.sentence-library-heading {
  align-items: center;
}

.sentence-library-heading > div {
  min-width: 0;
}

.sentence-library-practice-btn {
  flex: 0 0 auto;
  min-width: 160px;
}

.sentence-library-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(130px, auto) minmax(140px, auto);
  align-items: end;
  gap: 10px;
  margin-top: 22px;
}

.sentence-library-search-field {
  min-width: 0;
}

.sentence-library-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 780;
}

.sentence-library-toggle:has(input:checked) {
  border-color: var(--theme-border);
  color: var(--theme);
  background: var(--theme-soft);
}

.sentence-library-toggle input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--theme);
}

.sentence-library-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  min-height: 46px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.sentence-library-summary strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.sentence-library-list {
  border-top: 1px solid var(--line);
}

.sentence-library-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: start;
  gap: 14px;
  min-width: 0;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  transition: background 140ms ease;
}

.sentence-library-row:hover {
  background: #fbfcfd;
}

.sentence-library-row.is-saved {
  background: #f7fcfa;
}

.sentence-library-save,
.sentence-library-audio {
  width: 38px;
  min-height: 38px;
  border-color: transparent;
  color: var(--muted);
}

.sentence-library-save:hover,
.sentence-library-audio:hover {
  color: var(--theme);
}

.sentence-library-save.active {
  border-color: var(--theme-border);
  color: var(--theme);
  background: var(--theme-soft);
}

.sentence-library-copy {
  min-width: 0;
}

.sentence-library-copy .annotated-hanzi-line {
  font-size: 22px;
  font-weight: 620;
  line-height: 1.5;
}

.sentence-library-copy .annotated-pinyin-line {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
}

.sentence-library .annotated-word.has-gloss::after {
  display: none;
}

.sentence-library .annotated-word.has-gloss:hover::after,
.sentence-library .annotated-word.has-gloss:focus-visible::after {
  display: block;
}

.sentence-library-english {
  margin-top: 9px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.5;
}

.sentence-library-copy footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sentence-library-copy footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-strong);
  text-decoration: none;
}

.sentence-library-copy footer a:hover {
  color: var(--theme);
}

.sentence-library-copy footer .button-icon {
  width: 12px;
  height: 12px;
}

.sentence-library-more {
  display: flex;
  min-width: 180px;
  margin: 18px auto 0;
}

.sentence-library-loading,
.sentence-library-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 220px;
  align-content: center;
  margin-top: 20px;
  border-block: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.sentence-library-loading strong,
.sentence-library-empty strong {
  color: var(--ink);
  font-size: 17px;
}

.sentence-library-loading p,
.sentence-library-empty p {
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.5;
}

.sentence-library-loading .secondary-btn {
  width: auto;
  min-width: 110px;
  margin-top: 6px;
}

.vocabulary-library {
  min-width: 0;
}

.vocabulary-library-heading {
  align-items: center;
}

.vocabulary-library-heading > div {
  min-width: 0;
}

.vocabulary-saved-review-btn {
  flex: 0 0 auto;
  min-width: 150px;
}

.vocabulary-library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(130px, 0.28fr) minmax(150px, 0.34fr);
  align-items: end;
  gap: 12px;
  margin-top: 22px;
}

.vocabulary-library-search-field {
  min-width: 0;
}

.vocabulary-search-input-wrap {
  position: relative;
  display: block;
}

.vocabulary-search-input-wrap > .button-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
}

.vocabulary-search-input-wrap input {
  width: 100%;
  min-height: 42px;
  padding-right: 42px;
  padding-left: 40px;
}

.vocabulary-search-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 34px;
  min-height: 34px;
  transform: translateY(-50%);
}

.vocabulary-library-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 42px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.vocabulary-library-summary strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.vocabulary-library-summary span:last-child:not(:nth-child(2)) {
  margin-left: 5px;
}

.vocabulary-library-list {
  border-top: 1px solid var(--line);
}

.vocabulary-library-row {
  display: grid;
  grid-template-columns: 40px minmax(160px, 0.56fr) minmax(260px, 1.25fr) minmax(125px, 0.42fr) 82px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  transition: background 140ms ease;
}

.vocabulary-library-row:hover {
  background: #fbfcfd;
}

.vocabulary-save-button,
.vocabulary-library-audio,
.vocabulary-library-study {
  width: 38px;
  min-height: 38px;
  border-color: transparent;
  color: var(--muted);
}

.vocabulary-save-button:hover,
.vocabulary-library-audio:hover,
.vocabulary-library-study:hover {
  color: var(--theme);
}

.vocabulary-library-actions {
  display: grid;
  grid-template-columns: repeat(2, 38px);
  gap: 4px;
  justify-content: end;
}

.vocabulary-save-button.active {
  border-color: var(--theme-border);
  color: var(--theme);
  background: var(--theme-soft);
}

.bookmark-shape.filled {
  fill: currentColor;
}

.vocabulary-library-word {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.vocabulary-library-word > strong {
  font-size: 27px;
  line-height: 1;
}

.vocabulary-library-word > span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-library-meaning {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.vocabulary-library-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 10px;
  text-align: right;
}

.vocabulary-library-meta span {
  overflow: hidden;
  color: var(--muted);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-library-meta strong {
  color: var(--muted-strong);
  font-weight: 850;
  text-transform: uppercase;
}

.vocabulary-library-meta strong.is-due {
  color: var(--red);
}

.vocabulary-library-meta strong.is-learning,
.vocabulary-library-meta strong.is-strong {
  color: var(--theme);
}

.vocabulary-library-more {
  display: flex;
  min-width: 180px;
  margin: 18px auto 0;
}

.vocabulary-library-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 54px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.vocabulary-library-empty strong {
  color: var(--ink);
  font-size: 17px;
}

.vocabulary-library-empty p {
  font-size: 13px;
}

.vocabulary-path {
  min-width: 0;
}

.vocabulary-path-heading {
  align-items: center;
}

.vocabulary-path-heading > div {
  min-width: 0;
}

.vocabulary-path-continue {
  flex: 0 0 auto;
  min-width: 230px;
}

.vocabulary-path-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  border-block: 1px solid var(--line);
}

.vocabulary-path-overview > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 16px 18px;
}

.vocabulary-path-overview > div + div {
  border-left: 1px solid var(--line);
}

.vocabulary-path-overview span,
.vocabulary-path-overview small {
  color: var(--muted);
}

.vocabulary-path-overview span {
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.vocabulary-path-overview strong {
  margin-top: 2px;
  font-size: 25px;
  line-height: 1;
  font-weight: 850;
}

.vocabulary-path-overview small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-path-legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 16px 2px 10px;
}

.vocabulary-path-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.vocabulary-path-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #cbd3df;
}

.vocabulary-path-legend .is-strong::before,
.vocabulary-path-bar .is-strong {
  background: #147d64;
}

.vocabulary-path-legend .is-learning::before,
.vocabulary-path-bar .is-learning {
  background: #d08b18;
}

.vocabulary-path-legend .is-due::before,
.vocabulary-path-bar .is-due {
  background: #d94964;
}

.vocabulary-path-levels {
  border-top: 1px solid var(--line);
}

.vocabulary-path-level {
  --set-accent: var(--theme);
  --set-border: var(--theme-border);
  --set-soft: var(--theme-soft);
  border-bottom: 1px solid var(--line);
}

.vocabulary-path-level.hsk-level-1 {
  --set-accent: #0f766e;
  --set-border: #a8ddd7;
  --set-soft: #effcf9;
}

.vocabulary-path-level.hsk-level-2 {
  --set-accent: #2563eb;
  --set-border: #bfd0ff;
  --set-soft: #f2f6ff;
}

.vocabulary-path-level.hsk-level-3 {
  --set-accent: #be185d;
  --set-border: #f2b8d2;
  --set-soft: #fff4f8;
}

.vocabulary-path-level > summary {
  display: grid;
  grid-template-columns: 46px minmax(170px, 1fr) minmax(180px, 0.42fr) 14px;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 4px;
  cursor: pointer;
  list-style: none;
}

.vocabulary-path-level > summary::-webkit-details-marker {
  display: none;
}

.vocabulary-path-level > summary:hover {
  background: #fbfcfd;
}

.vocabulary-path-level-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--set-border);
  border-radius: 8px;
  color: var(--set-accent);
  background: var(--set-soft);
  font-size: 24px;
  font-weight: 900;
}

.vocabulary-path-level-copy,
.vocabulary-path-level-copy strong,
.vocabulary-path-level-copy small {
  display: block;
  min-width: 0;
}

.vocabulary-path-level-copy strong {
  font-size: 16px;
  font-weight: 850;
}

.vocabulary-path-level-copy small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-path-level-progress {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 38px;
  align-items: center;
  gap: 10px;
}

.vocabulary-path-level-progress > span {
  height: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edf2;
}

.vocabulary-path-level-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--set-accent);
}

.vocabulary-path-level-progress strong {
  color: var(--muted-strong);
  font-size: 11px;
  text-align: right;
}

.vocabulary-path-level-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform 150ms ease;
}

.vocabulary-path-level[open] .vocabulary-path-level-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.vocabulary-path-parts {
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.vocabulary-path-part {
  display: grid;
  grid-template-columns: 64px minmax(220px, 1fr) 66px auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 92px;
  padding: 12px 4px 12px 16px;
  border-bottom: 1px solid #e8ebef;
}

.vocabulary-path-part:last-child {
  border-bottom: 0;
}

.vocabulary-path-part.is-recommended {
  box-shadow: inset 3px 0 0 var(--set-accent);
  background: var(--set-soft);
}

.vocabulary-path-part-copy {
  min-width: 0;
}

.vocabulary-path-part-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocabulary-path-part-title strong {
  font-size: 14px;
  font-weight: 850;
}

.vocabulary-path-part-title span {
  border-radius: 4px;
  padding: 3px 6px;
  color: var(--set-accent);
  background: var(--surface);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.vocabulary-path-part-copy p {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocabulary-path-bar {
  display: flex;
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: #e4e9ef;
}

.vocabulary-path-bar > span {
  display: block;
  height: 100%;
}

.vocabulary-path-part-progress {
  display: grid;
  gap: 2px;
  text-align: right;
}

.vocabulary-path-part-progress strong {
  font-size: 17px;
  font-weight: 850;
}

.vocabulary-path-part-progress span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.vocabulary-path-part-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, auto));
  gap: 7px;
}

.vocabulary-path-part-actions .secondary-btn,
.vocabulary-path-part-actions .ghost-btn {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 11px;
}

@media (max-width: 980px) {
  .vocabulary-path-heading {
    align-items: stretch;
  }

  .vocabulary-path-continue {
    width: 100%;
    min-width: 0;
  }

  .vocabulary-path-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vocabulary-path-overview > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .vocabulary-path-overview > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .vocabulary-path-level > summary {
    grid-template-columns: 46px minmax(0, 1fr) 14px;
  }

  .vocabulary-path-level-progress {
    grid-column: 2;
    margin-top: -5px;
  }

  .vocabulary-path-level-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .vocabulary-path-part {
    grid-template-columns: 64px minmax(0, 1fr) 58px;
    gap: 12px;
    padding-right: 8px;
  }

  .vocabulary-path-part-actions {
    grid-column: 2 / 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vocabulary-path-part-actions .secondary-btn,
  .vocabulary-path-part-actions .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .vocabulary-path-overview > div {
    padding: 13px 10px;
  }

  .vocabulary-path-overview strong {
    font-size: 21px;
  }

  .vocabulary-path-legend {
    justify-content: flex-start;
    gap: 11px;
    overflow-x: auto;
  }

  .vocabulary-path-level > summary {
    gap: 10px;
    padding-right: 2px;
  }

  .vocabulary-path-level-copy small {
    white-space: normal;
  }

  .vocabulary-path-level-progress {
    grid-template-columns: minmax(70px, 1fr) 34px;
  }

  .vocabulary-path-part {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding-left: 10px;
  }

  .vocabulary-path-part .quiz-set-icon {
    min-height: 54px;
    padding: 6px 9px 6px 6px;
  }

  .vocabulary-path-part .quiz-set-icon-level {
    font-size: 28px;
  }

  .vocabulary-path-part-progress {
    display: none;
  }

  .vocabulary-path-part-actions {
    grid-column: 1 / 3;
  }
}

body.global-search-open {
  overflow: hidden;
}

.global-search-dialog {
  width: min(720px, calc(100% - 32px));
  max-width: none;
  max-height: min(76vh, 720px);
  max-height: min(76dvh, 720px);
  margin: max(7vh, 48px) auto auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.22);
  color: var(--ink);
}

.global-search-dialog::backdrop {
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(4px);
}

.global-search-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: min(76vh, 720px);
  max-height: min(76dvh, 720px);
}

.global-search-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 6px 12px;
}

.global-search-view-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  padding: 2px;
}

.global-search-view-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-strong);
  padding: 0 11px;
  font-size: 11px;
  font-weight: 800;
}

.global-search-view-switcher button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.global-search-view-switcher button:focus-visible,
.global-search-saved-actions button:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 1px;
}

.global-search-view-switcher span {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted-strong);
  font-size: 9px;
}

.global-search-view-switcher button.active span {
  background: var(--theme-soft);
  color: var(--theme);
}

.global-search-saved-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.global-search-saved-actions[hidden] {
  display: none;
}

.global-search-saved-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0 9px;
  font-size: 10px;
  font-weight: 780;
}

.global-search-saved-actions button:hover:not(:disabled) {
  border-color: var(--theme-border);
  background: var(--theme-soft);
  color: var(--theme);
}

.global-search-saved-actions .button-icon {
  width: 14px;
  height: 14px;
}

.global-search-input-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px 0 20px;
}

.global-search-input-icon {
  width: 21px;
  height: 21px;
  color: var(--muted);
}

.global-search-input-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 650;
}

.global-search-input-row input::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.global-search-input-row input::-webkit-search-cancel-button {
  display: none;
}

.global-search-close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.global-search-close:hover,
.global-search-close:focus-visible {
  background: var(--bg);
  color: var(--ink);
}

.global-search-close:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 1px;
}

.global-search-close .button-icon {
  width: 18px;
  height: 18px;
}

.global-search-results {
  min-height: 190px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.global-search-group + .global-search-group {
  margin-top: 4px;
}

.global-search-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 6px 10px 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
  text-transform: uppercase;
}

.global-search-group-heading small {
  font-size: inherit;
}

.global-search-list {
  display: grid;
}

.global-search-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}

.global-search-result:hover,
.global-search-result.active {
  background: var(--theme-soft);
}

.global-search-result.active {
  box-shadow: inset 3px 0 0 var(--theme);
}

.global-search-result:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: -2px;
}

.global-search-result-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--theme);
}

.global-search-result-icon .button-icon {
  width: 20px;
  height: 20px;
}

.global-search-result-character {
  font-size: 21px;
  line-height: 1;
  font-weight: 760;
}

.global-search-result-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.global-search-result-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 780;
}

.global-search-result-title > span {
  min-width: 0;
}

.global-search-result-hanzi {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 19px;
}

.global-search-result-pinyin {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.global-search-result-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result-meta {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 760;
  white-space: nowrap;
}

.global-search-result-arrow {
  width: 17px;
  height: 17px;
  color: var(--line-strong);
}

.global-search-result.active .global-search-result-arrow {
  color: var(--theme);
}

.global-search-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 210px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.global-search-empty .button-icon,
.global-search-loader {
  width: 28px;
  height: 28px;
  margin-bottom: 13px;
  color: var(--line-strong);
}

.global-search-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.global-search-empty > span:last-child {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

.global-search-loader {
  display: block;
  border: 2px solid var(--line);
  border-top-color: var(--theme);
  border-radius: 50%;
  animation: global-search-spin 700ms linear infinite;
}

@keyframes global-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.word-detail-dialog {
  width: min(780px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.2);
  color: var(--ink);
}

.word-detail-dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(3px);
}

.word-detail-shell {
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
}

.word-detail-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.word-detail-header span,
.word-detail-header h2 {
  display: block;
}

.word-detail-header span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.word-detail-header h2 {
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
}

.word-detail-hero {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
  align-items: center;
  min-height: 180px;
  padding: 28px 24px;
}

.word-detail-identity {
  min-width: 0;
}

.word-detail-character-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.word-detail-character-row > strong {
  font-size: 72px;
  line-height: 1;
  font-weight: 680;
}

.word-detail-audio {
  flex: 0 0 auto;
  color: var(--theme);
}

.word-detail-identity > p {
  margin: 13px 0 0;
  font-size: 19px;
  font-weight: 780;
}

.word-detail-meaning {
  margin: 0;
  color: var(--muted-strong);
  font-size: 19px;
  line-height: 1.55;
}

.word-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 24px;
  border-block: 1px solid var(--line);
}

.word-detail-metrics > div {
  min-width: 0;
  padding: 14px 16px;
}

.word-detail-metrics > div + div {
  border-left: 1px solid var(--line);
}

.word-detail-metrics dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.word-detail-metrics dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-detail-status.is-due {
  color: var(--red);
}

.word-detail-status.is-learning,
.word-detail-status.is-strong {
  color: var(--theme);
}

.word-detail-actions {
  display: flex;
  gap: 10px;
  padding: 18px 24px 6px;
}

.word-detail-actions .secondary-btn,
.word-detail-actions .ghost-btn {
  width: auto;
  min-height: 42px;
}

.word-detail-actions [data-word-detail-save].active {
  border-color: var(--theme-border);
  background: var(--theme-soft);
  color: var(--theme);
}

.word-detail-section {
  margin: 0 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.word-detail-section:first-of-type {
  margin-top: 18px;
}

.word-detail-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.word-detail-section-heading h3 {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.word-detail-section-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

#wordDetailDictionary > p,
.word-detail-unavailable {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.6;
}

.word-detail-loading {
  display: grid;
  gap: 9px;
  min-height: 52px;
  align-content: center;
}

.word-detail-loading > span {
  width: 86%;
  height: 10px;
  border-radius: 5px;
  background: #edf0f4;
  animation: word-detail-loading 1.2s ease-in-out infinite alternate;
}

.word-detail-loading > span:nth-child(2) {
  width: 68%;
  animation-delay: 120ms;
}

.word-detail-loading > span:nth-child(3) {
  width: 48%;
  animation-delay: 240ms;
}

.word-detail-example-list {
  border-block: 1px solid var(--line);
}

.word-detail-example {
  position: relative;
  padding: 16px 46px 16px 2px;
}

.word-detail-example + .word-detail-example {
  border-top: 1px solid var(--line);
}

.word-detail-example-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.word-detail-example-heading span + span {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.word-detail-example-zh {
  margin: 0;
  font-size: 22px;
  line-height: 1.45;
}

.word-detail-highlight {
  border-radius: 3px;
  padding: 0 2px;
  background: #fff0b8;
  color: inherit;
}

.word-detail-example-pinyin {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.word-detail-example-pinyin .is-target {
  color: var(--theme);
  font-weight: 850;
}

.word-detail-example-en {
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.word-detail-example footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.word-detail-example footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
}

.word-detail-example footer a:hover {
  color: var(--theme);
}

.word-detail-example footer .button-icon {
  width: 12px;
  height: 12px;
}

.word-detail-example footer .icon-btn {
  position: absolute;
  top: 50%;
  right: 2px;
  width: 36px;
  min-height: 36px;
  transform: translateY(-50%);
}

@keyframes word-detail-loading {
  from { opacity: 0.48; }
  to { opacity: 1; }
}

.quiz-set-picker {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.quiz-set-group {
  display: block;
}

.quiz-set-group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  user-select: none;
}

.quiz-set-group-heading::-webkit-details-marker {
  display: none;
}

.quiz-set-group-heading::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.quiz-set-group[open] .quiz-set-group-heading::before {
  transform: rotate(45deg);
}

.quiz-set-group-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.quiz-set-group-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quiz-set-group[open] .quiz-set-grid {
  margin-top: 9px;
}

.quiz-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}

.quiz-set-card {
  --set-accent: var(--theme);
  --set-border: var(--theme-border);
  --set-soft: var(--theme-soft);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.quiz-set-card.hsk-level-1 {
  --set-accent: #0f766e;
  --set-border: #a8ddd7;
  --set-soft: #effcf9;
}

.quiz-set-card.hsk-level-2 {
  --set-accent: #2563eb;
  --set-border: #bfd0ff;
  --set-soft: #f2f6ff;
}

.quiz-set-card.hsk-level-3 {
  --set-accent: #be185d;
  --set-border: #f2b8d2;
  --set-soft: #fff4f8;
}

.vocabulary-curriculum-source {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.vocabulary-curriculum-source a {
  color: var(--theme-strong);
  font-weight: 800;
  text-decoration: none;
}

.vocabulary-curriculum-source a:hover {
  text-decoration: underline;
}

.quiz-set-card:hover {
  border-color: var(--set-accent);
  background: var(--set-soft);
  transform: translateY(-1px);
}

.quiz-set-card.selected {
  border-color: var(--set-accent);
  background: var(--set-soft);
  box-shadow: inset 3px 0 0 var(--set-accent), var(--shadow-soft);
}

.quiz-set-icon {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px;
  min-height: 58px;
  padding: 7px 11px 7px 7px;
  border: 1px solid var(--set-border);
  border-radius: 8px;
  background: var(--surface);
}

.quiz-set-icon-level {
  grid-row: span 2;
  align-self: center;
  color: var(--set-accent);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.quiz-set-icon-part {
  align-self: end;
  color: var(--set-accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.quiz-set-part-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 24px;
  align-self: start;
}

.quiz-set-part-marks span {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #e3e8e7;
}

.quiz-set-part-marks span.active {
  background: var(--set-accent);
}

.quiz-set-card-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quiz-set-card-text strong {
  font-size: 16px;
  line-height: 1.15;
}

.quiz-set-card-text span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-start-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 0.5fr)) minmax(240px, 1fr);
  column-gap: 16px;
  row-gap: 12px;
  align-items: stretch;
  margin: 16px 0 18px;
}

.quiz-start-metric {
  min-height: 62px;
  padding: 5px 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.quiz-start-metric + .quiz-start-metric {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.quiz-start-metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 780;
}

.quiz-start-metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-start-strip .primary-btn {
  width: 100%;
  min-height: 62px;
}

.quiz-preview {
  grid-template-columns: minmax(0, 0.86fr) minmax(260px, 1.14fr);
}

.preview-cell {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.preview-cell strong {
  display: block;
  color: var(--theme);
  font-size: 34px;
  line-height: 1;
}

.preview-cell span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.selected-set-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.selected-set-card span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.primary-btn {
  border-color: var(--theme);
  background: var(--theme);
  color: white;
  font-weight: 800;
  padding: 0 18px;
  box-shadow: 0 10px 20px var(--theme-wash);
}

.primary-btn:hover {
  background: var(--theme-hover);
}

.secondary-btn,
.ghost-btn,
.icon-btn {
  padding: 0 14px;
  font-weight: 800;
}

.icon-label-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.secondary-btn {
  background: var(--theme-soft);
  color: var(--theme);
  border-color: var(--theme-border);
}

.ghost-btn {
  background: var(--surface);
  box-shadow: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.session-shell {
  display: grid;
  gap: 16px;
}

.vocabulary-session {
  overflow-anchor: none;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.progress-track {
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.quiz-play-header {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(120px, 0.5fr) auto;
  gap: 10px;
  align-items: stretch;
}

.quiz-meter {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quiz-meter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-meter strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
  line-height: 1.05;
}

.vocab-guess-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.vocab-guess-form .secondary-btn,
.vocab-guess-form .ghost-btn {
  min-height: 52px;
}

.mobile-current-word {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  box-shadow: 0 6px 18px rgba(28, 35, 33, 0.08);
}

.mobile-current-word span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-current-word strong {
  font-size: 34px;
  line-height: 1.12;
}

.vocab-table-section {
  display: grid;
  gap: 10px;
}

.vocab-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.vocab-section-heading h3 {
  font-size: 18px;
  line-height: 1.2;
}

.vocab-section-heading span,
.table-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-note {
  line-height: 1.4;
}

.vocab-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: auto;
  max-height: min(62vh, 720px);
}

.preview-table-wrap {
  max-height: 360px;
}

.vocab-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}

.vocab-table th,
.vocab-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  line-height: 1.28;
}

.vocab-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.vocab-table td:first-child {
  width: 20%;
  font-size: 17px;
}

.vocab-table td:nth-child(2) {
  width: 22%;
  font-weight: 800;
}

.vocab-table tr.found td {
  background: #f4fbf6;
}

.vocab-table tr.missed td {
  background: #fff8f4;
}

.vocab-table tr.current td {
  background: var(--theme-soft);
}

.vocab-table tr.current td:first-child {
  box-shadow: inset 4px 0 var(--theme);
  font-weight: 800;
}

.vocab-table tr.selectable {
  cursor: pointer;
}

.vocab-table tr.selectable:hover td {
  background: var(--theme-soft);
}

.vocab-table tr.selectable:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: -3px;
}

.vocab-table tr.current .pinyin-slot:empty::before {
  background: var(--theme-border);
}

.vocab-word-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(13, 148, 136, 0.38);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.vocab-word-link:hover,
.vocab-word-link:focus-visible {
  color: var(--theme-hover);
  text-decoration-color: currentColor;
}

.pinyin-slot {
  min-width: 96px;
  color: var(--theme);
}

.tone-pinyin {
  color: var(--tone-color, currentColor);
}

.tone-pinyin {
  font-weight: 850;
}

.tone-one {
  --tone-color: #d43d3d;
}

.tone-two {
  --tone-color: #16833d;
}

.tone-three {
  --tone-color: #2563d8;
}

.tone-four {
  --tone-color: #7c3aed;
}

.tone-neutral {
  --tone-color: #667085;
}

.pinyin-slot:empty::before {
  content: "";
  display: block;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #eef1f2;
}

.muted-slot {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.muted-slot::before {
  display: none;
}

.translation-hidden {
  color: var(--muted);
  font-weight: 800;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--theme);
}

.progress-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sentence-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.sentence-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.sentence-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sentence-text {
  font-size: 25px;
  line-height: 1.42;
  word-break: break-word;
}

.sentence-text.zh {
  line-height: 1.45;
}

.quiz-word {
  font-size: 42px;
  line-height: 1.2;
}

.audio-sentence {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-revealed-word {
  margin: 0;
}

.pronunciation-session {
  max-width: 980px;
}

.pronunciation-card {
  gap: 18px;
}

.pronunciation-prompt {
  display: grid;
  gap: 10px;
}

.pronunciation-hanzi-line,
.pronunciation-pinyin-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0;
}

.pronunciation-hanzi-line {
  gap: 4px 1px;
  font-size: 34px;
  line-height: 1.45;
}

.pronunciation-pinyin-line {
  gap: 6px 4px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.55;
}

.pronunciation-token,
.pronunciation-pinyin-token {
  border-radius: 7px;
}

.pronunciation-token {
  padding: 0 2px;
}

.pronunciation-token.pending {
  padding-right: 0;
  padding-left: 0;
}

.pronunciation-pinyin-token {
  padding: 1px 4px;
}

.pronunciation-token.good,
.pronunciation-pinyin-token.good {
  background: #e9f8ef;
  color: #166534;
}

.pronunciation-token.missed,
.pronunciation-pinyin-token.missed {
  background: #fff1f2;
  color: #b42318;
}

.pronunciation-punctuation,
.pronunciation-pinyin-punctuation {
  color: inherit;
}

.pronunciation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.recording-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.pronunciation-feedback {
  margin-top: 0;
}

.pronunciation-breakdown {
  display: grid;
  gap: 12px;
}

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

.pronunciation-breakdown-card {
  display: grid;
  gap: 12px;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.pronunciation-breakdown-card h4 {
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.pronunciation-metric-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pronunciation-metric-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 800;
}

.pronunciation-metric-list li.empty {
  justify-content: flex-start;
  color: var(--muted);
  font-weight: 760;
}

.pronunciation-metric-list strong {
  color: var(--theme);
}

.tone-pool-note {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.tone-pool-note strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.tone-listening-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tone-prompt-panel,
.tone-response-panel {
  min-width: 0;
  padding: 26px;
}

.tone-prompt-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-strong);
}

.tone-audio-controls {
  align-items: center;
}

.tone-word-concealment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 116px;
  border-block: 1px solid var(--line);
}

.tone-word-concealment span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.tone-word-concealment span:nth-child(2) {
  background: var(--theme-border);
}

.tone-answer-reveal {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
}

.tone-answer-word {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.tone-answer-word > strong,
.tone-answer-word > strong a {
  color: var(--ink);
  font-size: 38px;
  line-height: 1.1;
}

.tone-answer-word > span {
  font-size: 17px;
  font-weight: 850;
}

.tone-answer-reveal p {
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.tone-answer-pattern {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tone-answer-pattern strong {
  color: var(--ink);
  font-size: 14px;
}

.tone-end-btn {
  align-self: flex-start;
  margin-top: auto;
}

.tone-response-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.tone-choice-grid {
  gap: 9px;
}

.tone-choice-option {
  align-items: center;
  min-height: 62px;
}

.tone-choice-text {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.tone-choice-text strong {
  min-width: 0;
  font-size: 18px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.tone-choice-text > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.tone-next-btn {
  align-self: flex-start;
}

.stat-grid.tone-result-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.tone-results-table .tone-pinyin {
  font-weight: 800;
}

.tone-results-table table {
  min-width: 980px;
}

.tone-results-table th:nth-child(2),
.tone-results-table td:nth-child(2) {
  min-width: 88px;
}

.tone-results-table td:nth-child(2) a,
.tone-results-table th:nth-child(4),
.tone-results-table td:nth-child(4),
.tone-results-table th:nth-child(5),
.tone-results-table td:nth-child(5) {
  white-space: nowrap;
}

.map-quiz-workspace {
  display: flex;
  flex-direction: column;
  height: min(820px, calc(100vh - 54px));
  overflow: hidden;
  padding: 0;
  background: #ffffff;
}

.map-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.map-mode-heading {
  display: grid;
  gap: 3px;
  min-width: 136px;
}

.map-mode-heading span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-mode-heading strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.15;
}

.map-mode-header .map-mode-picker {
  width: min(430px, 100%);
}

.map-name-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 830;
  line-height: 1.2;
  white-space: nowrap;
}

.map-name-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--theme);
}

.map-name-toggle.compact {
  min-height: 32px;
  padding: 0 9px;
  box-shadow: none;
}

.map-question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.map-game-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.map-question-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 10px 0 30px rgba(16, 24, 40, 0.035);
}

.map-score-card,
.map-prompt-card,
.map-answer-card,
.map-fact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.map-score-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  padding: 16px;
}

.map-score-card > div:not(.map-progress-line) {
  min-width: 0;
}

.map-score-card > div:not(.map-progress-line) + div:not(.map-progress-line) {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.map-score-card span,
.map-answer-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.map-score-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.map-score-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.map-progress-line {
  grid-column: 1 / -1;
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.map-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}

.map-question-count {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 760;
}

.map-prompt-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.map-prompt-card p,
.map-answer-card p,
.map-hint-note,
.map-tip {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.45;
}

.map-prompt {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

.map-prompt-pinyin {
  margin-top: -3px;
  color: var(--theme-hover);
  font-size: 15px;
  font-weight: 820;
}

.map-hint-btn {
  justify-content: flex-start;
  gap: 8px;
}

.map-hint-note {
  padding: 10px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  color: var(--theme-hover);
  font-weight: 800;
}

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

.map-mode-option {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted-strong);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.map-mode-option:hover {
  border-color: var(--theme-border);
  background: var(--theme-soft);
  transform: none;
}

.map-mode-option:disabled {
  cursor: default;
  opacity: 1;
}

.map-mode-option:disabled:not(.active) {
  opacity: 0.54;
}

.map-mode-option:disabled:hover {
  border-color: var(--line);
  background: var(--surface);
}

.map-mode-option.active {
  border-color: rgba(13, 148, 136, 0.54);
  background: linear-gradient(180deg, #ecfdf9, #ffffff);
  color: var(--theme);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.14), var(--shadow-soft);
}

.map-mode-option strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
  font-weight: 850;
}

.map-mode-option span {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.map-answer-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.map-answer-card.good {
  border-color: #a7dcca;
  background: linear-gradient(180deg, #f2fcf7, #ffffff);
}

.map-answer-card.review {
  border-color: #f0b8bf;
  background: linear-gradient(180deg, #fff5f6, #ffffff);
}

.map-answer-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

.map-answer-card .map-result-name {
  color: var(--ink);
  font-family: var(--chinese-font);
  font-size: 26px;
  font-weight: 850;
}

.map-panel-actions {
  display: grid;
  gap: 10px;
}

.map-next-btn {
  width: 100%;
}

.map-stage-panel {
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(255, 255, 255, 0.96)),
    #f8fafc;
}

.china-map-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #eff8f8;
}

.china-map-canvas {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 28%, rgba(13, 148, 136, 0.08), transparent 32%),
    linear-gradient(180deg, #f5fbfb, #edf7f8);
  touch-action: none;
  user-select: none;
}

.china-map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  background:
    radial-gradient(circle at 60% 28%, rgba(20, 184, 166, 0.12), transparent 36%),
    #f8fafc;
  color: var(--muted-strong);
  text-align: center;
  font-weight: 760;
}

.china-map-fallback strong {
  display: block;
  max-width: min(420px, calc(100% - 48px));
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  text-wrap: balance;
}

.china-map-fallback span {
  max-width: 420px;
  font-size: 14px;
  line-height: 1.45;
}

.china-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.china-map-canvas.is-zoomed .china-map-svg {
  cursor: grab;
}

.china-map-canvas.is-zoomed .china-map-svg:active {
  cursor: grabbing;
}

.china-map-zoom-layer {
  transform-origin: 0 0;
}

.china-map-svg *:focus {
  outline: none;
}

.china-map-water {
  fill: #edf8f8;
}

.china-province-shape {
  fill: #fff8e8;
  stroke: #78c8c3;
  stroke-width: 0.85;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 160ms ease, stroke 160ms ease, filter 160ms ease;
}

.china-province-shape:hover,
.china-province-shape:focus,
.china-province-shape:focus-visible {
  fill: #f5fbf4;
  outline: none;
}

.china-map-wrap.city-mode .china-province-shape {
  cursor: default;
}

.china-map-wrap.city-mode .china-province-shape:hover {
  fill: #fff8e8;
  stroke: #78c8c3;
}

.china-province-shape.is-hint {
  fill: #e7fbf5;
}

.china-province-shape.is-correct {
  fill: #c9f6eb;
}

.china-province-shape.is-wrong {
  fill: #ffe8ec;
}

.china-province-outline {
  fill: none;
  pointer-events: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
  vector-effect: non-scaling-stroke;
  transition: stroke 160ms ease, stroke-width 160ms ease;
}

.china-province-outline.is-hovered,
.china-province-outline.is-hint {
  stroke: #0d9488;
  stroke-width: 2.3;
}

.china-province-outline.is-hint {
  stroke-dasharray: 5 4;
}

.china-province-outline.is-correct {
  stroke: #0d9488;
  stroke-width: 2.5;
  animation: map-correct-pulse 420ms ease-out;
}

.china-province-outline.is-wrong {
  stroke: #e14b64;
  stroke-width: 2.5;
}

.china-small-region-selector {
  color: #0d9488;
  cursor: pointer;
  outline: none;
}

.china-small-region-leader {
  fill: none;
  pointer-events: none;
  stroke: currentColor;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  opacity: 0.7;
}

.china-small-region-anchor {
  fill: #ffffff;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.china-small-region-hit {
  fill: transparent;
  pointer-events: all;
}

.china-small-region-ring {
  fill: rgba(255, 255, 255, 0.96);
  stroke: currentColor;
  stroke-width: 2.4;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.16));
  transition: fill 160ms ease, stroke-width 160ms ease;
}

.china-small-region-dot {
  fill: currentColor;
  pointer-events: none;
}

.china-small-region-selector:hover,
.china-small-region-selector:focus-visible {
  color: #0f766e;
}

.china-small-region-selector:hover .china-small-region-ring,
.china-small-region-selector:focus-visible .china-small-region-ring {
  fill: #ecfdf9;
  stroke-width: 3;
}

.china-small-region-selector.is-correct,
.china-small-region-selector.is-hint {
  color: #0d9488;
}

.china-small-region-selector.is-wrong {
  color: #e14b64;
}

.china-small-region-selector.is-correct .china-small-region-ring,
.china-small-region-selector.is-hint .china-small-region-ring {
  fill: #e7fbf5;
  animation: map-correct-pulse 420ms ease-out;
}

.china-small-region-selector.is-wrong .china-small-region-ring {
  fill: #fff0f3;
}

.china-city-pin {
  color: #0d9488;
  cursor: pointer;
  outline: none;
}

.china-city-pin-hit {
  fill: transparent;
  pointer-events: all;
}

.china-city-pin-halo {
  fill: rgba(13, 148, 136, 0.2);
  opacity: 0.92;
  pointer-events: none;
  stroke: rgba(13, 148, 136, 0.52);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: city-correct-halo 900ms ease-out 1;
}

.china-city-pin-ring {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 2.4;
  filter: drop-shadow(0 5px 8px rgba(15, 23, 42, 0.2));
  transition: fill 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.china-city-pin-dot {
  fill: currentColor;
}

.china-city-pin:hover,
.china-city-pin:focus-visible {
  color: #0f766e;
}

.china-city-pin:hover .china-city-pin-ring,
.china-city-pin:focus-visible .china-city-pin-ring {
  stroke-width: 3;
}

.china-city-pin.is-correct,
.china-city-pin.is-hint {
  color: #0d9488;
}

.china-city-pin.is-wrong {
  color: #e14b64;
}

.china-city-pin.is-correct .china-city-pin-ring,
.china-city-pin.is-hint .china-city-pin-ring {
  fill: #ecfdf9;
  stroke-width: 3.2;
  filter: drop-shadow(0 8px 14px rgba(13, 148, 136, 0.34));
  animation: map-correct-pulse 420ms ease-out;
}

.china-city-pin-label {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 4;
  fill: #163c39;
  font-family: var(--chinese-font);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

.china-city-pin-label-backdrop {
  fill: rgba(236, 253, 249, 0.94);
  pointer-events: none;
  stroke: rgba(13, 148, 136, 0.38);
  stroke-width: 1;
  filter: drop-shadow(0 7px 12px rgba(13, 148, 136, 0.18));
}

.china-city-pin.is-correct .china-city-pin-label {
  fill: #064e3b;
  font-size: 14px;
  stroke-width: 5;
}

.china-city-pin.is-wrong .china-city-pin-label {
  fill: #8f1d33;
}

.south-china-sea-inset-frame {
  fill: rgba(255, 255, 255, 0.82);
  stroke: rgba(115, 188, 182, 0.74);
  stroke-width: 1.2;
}

.china-map-inset-shape {
  fill: #fff8e8;
  stroke: #78c8c3;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.south-china-sea-inset-label {
  fill: #55726f;
  font-family: var(--chinese-font);
  font-size: 10px;
  font-weight: 850;
  text-anchor: middle;
}

.map-answer-toast {
  position: absolute;
  left: 50%;
  top: 24px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%);
  animation: map-toast-in 220ms ease;
}

.map-answer-toast.good {
  border-bottom: 3px solid #16a34a;
}

.map-answer-toast.review {
  border-bottom: 3px solid #e14b64;
}

.map-answer-toast-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #16a34a;
  color: white;
  font-weight: 900;
}

.map-answer-toast.review .map-answer-toast-icon {
  background: #e14b64;
}

.map-answer-toast strong {
  font-size: 16px;
  font-weight: 850;
}

.map-answer-toast span:last-child {
  font-family: var(--chinese-font);
  font-size: 16px;
  font-weight: 760;
}

.map-zoom-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 7;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(196, 207, 219, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.map-zoom-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  border: 0;
  border-right: 1px solid rgba(196, 207, 219, 0.86);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}

.map-zoom-btn:last-child {
  border-right: 0;
}

.map-zoom-reset {
  width: 46px;
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: 0;
}

.map-zoom-btn:not(:disabled):hover,
.map-zoom-btn:not(:disabled):focus-visible {
  background: var(--theme-soft);
  color: var(--theme);
  outline: none;
}

.map-zoom-btn:disabled {
  color: #98a2b3;
  cursor: default;
  opacity: 0.52;
}

.map-legend-row {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.map-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #98a2b3;
}

.legend-dot.correct {
  background: #0d9488;
}

.legend-dot.incorrect {
  background: #e14b64;
}

.map-tip {
  position: absolute;
  right: 18px;
  bottom: 20px;
  z-index: 5;
  max-width: min(360px, calc(100% - 36px));
  padding: 9px 11px;
  border: 1px solid rgba(228, 231, 236, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.map-tip.attention {
  border-color: var(--theme-border);
  color: var(--theme-hover);
  animation: correct-highlight 360ms ease-out;
}

@media (min-width: 981px) and (max-width: 1180px) {
  .map-tip {
    right: 18px;
    bottom: 66px;
    left: 18px;
    max-width: none;
    text-align: center;
  }

  .map-legend-row {
    max-width: calc(100% - 36px);
    gap: 12px;
  }
}

@keyframes map-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes city-correct-halo {
  0% {
    opacity: 0.32;
    transform: scale(0.55);
  }

  70% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 0.92;
    transform: scale(1);
  }
}

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

.map-feedback.good {
  border-color: #9ed4bb;
  background: #f1fbf6;
}

.map-feedback.review {
  border-color: #e7b49a;
  background: #fff7ed;
}

.map-feedback strong,
.map-feedback span {
  display: block;
}

.map-feedback strong {
  color: var(--ink);
  font-size: 16px;
}

.map-feedback span,
.map-feedback p {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.map-correct-answer-card {
  display: grid;
  gap: 3px;
  margin: 2px 0;
  padding: 12px;
  border: 1px solid rgba(13, 148, 136, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #ecfdf9, #ffffff);
  box-shadow: inset 3px 0 0 rgba(13, 148, 136, 0.72);
}

.map-correct-answer-card span {
  color: var(--theme-hover);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-correct-answer-card strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.map-correct-answer-card em {
  color: var(--theme);
  font-size: 13px;
  font-style: normal;
  font-weight: 820;
}

.shortcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.shortcut-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: currentColor;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.shortcut-separator,
.shortcut-plus {
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.82;
}

.shortcut-plus {
  font-size: 12px;
  margin-left: 1px;
}

.secondary-btn .shortcut-hint kbd {
  border-color: var(--theme-border);
  background: rgba(255, 255, 255, 0.72);
}

.sound-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  color: var(--theme);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sound-indicator.active {
  display: inline-flex;
}

.answer-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.answer-status-pill.correct {
  border-color: #9ed4bb;
  background: #f1fbf6;
  color: #14765b;
}

.answer-status-pill.wrong {
  border-color: #e0b3aa;
  background: #fff6f2;
  color: #a04635;
}

.audio-warning {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #e2c2b5;
  border-radius: 8px;
  background: #fff8f4;
  color: #8f3d20;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sound-bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 15px;
}

.sound-bars span {
  width: 3px;
  height: 7px;
  border-radius: 999px;
  background: var(--theme);
  animation: sound-pulse 680ms ease-in-out infinite;
}

.sound-bars span:nth-child(2) {
  animation-delay: 120ms;
}

.sound-bars span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes sound-pulse {
  0%,
  100% {
    height: 5px;
    opacity: 0.65;
  }

  50% {
    height: 15px;
    opacity: 1;
  }
}

.correct-celebration {
  outline: 3px solid transparent;
  animation: correct-highlight 560ms cubic-bezier(0.2, 0.9, 0.24, 1);
}

.choice-option.correct-celebration,
.feedback.correct-celebration,
.answer-status-pill.correct-celebration {
  transform-origin: center;
}

.vocab-table tr.correct-celebration td {
  animation: correct-cell-glow 680ms ease-out;
}

@keyframes correct-highlight {
  0% {
    outline-color: rgba(20, 118, 91, 0);
    outline-offset: 0;
  }

  42% {
    outline-color: rgba(20, 118, 91, 0.28);
    outline-offset: 2px;
  }

  100% {
    outline-color: rgba(20, 118, 91, 0);
    outline-offset: 6px;
  }
}

@keyframes map-correct-pulse {
  0% {
    opacity: 0.62;
  }

  55%,
  100% {
    opacity: 1;
  }
}

@keyframes correct-cell-glow {
  0% {
    background: #f1fbf6;
  }

  45% {
    background: #e2f6ea;
  }

  100% {
    background: #f1fbf6;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.answer-form {
  display: grid;
  gap: 12px;
}

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

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.choice-option:hover:not(:disabled) {
  border-color: var(--theme);
  background: var(--theme-soft);
  transform: translateY(-1px);
}

.choice-option:disabled {
  opacity: 1;
}

.choice-option.correct {
  border-color: #b8dec9;
  background: #f0fbf5;
}

.choice-option.incorrect {
  border-color: #f3b7bd;
  background: #fff3f4;
}

.choice-key {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  color: var(--theme);
  background: var(--theme-soft);
  font-size: 13px;
  font-weight: 900;
}

.choice-text {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}

.answer-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.4;
}

.chinese-text,
textarea[lang="zh-CN"] {
  font-family: var(--chinese-font);
  font-size: 25px;
  font-weight: 400;
}

.sentence-text.quiz-word {
  font-size: 42px;
}

textarea:focus,
.answer-input:focus,
select:focus,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

.form-actions,
.result-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.feedback {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  scroll-margin-top: 12px;
  scroll-margin-bottom: calc(24px + env(safe-area-inset-bottom));
}

.feedback.good {
  border-color: #b8dec9;
  background: #f0fbf5;
}

.feedback.okay {
  border-color: #e9c78e;
  background: #fff8ed;
}

.feedback.review {
  border-color: #f3b7bd;
  background: #fff3f4;
}

.feedback-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 12px;
}

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

.answer-box {
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.answer-box-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.answer-text,
.answer-box p {
  line-height: 1.45;
  word-break: break-word;
}

.annotated-chinese {
  display: grid;
  gap: 3px;
  overflow: visible;
}

.annotated-hanzi-line,
.annotated-pinyin-line {
  display: block;
  margin: 0;
  word-break: break-word;
}

.annotated-hanzi-line {
  overflow: visible;
  line-height: 1.45;
}

.annotated-pinyin-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.annotated-word {
  position: relative;
  display: inline;
  margin: 0;
  padding: 0;
  border-radius: 5px;
  color: var(--ink);
  cursor: default;
  outline: none;
  text-decoration-color: transparent;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.annotated-word.has-gloss {
  cursor: help;
}

.annotated-word.has-gloss:hover,
.annotated-word.has-gloss:focus-visible {
  background: linear-gradient(transparent 68%, var(--theme-soft) 68%);
  text-decoration-color: var(--theme);
}

.annotated-word.has-gloss::after {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(100% + 7px);
  z-index: 20;
  width: max-content;
  max-width: min(260px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 24px rgba(31, 36, 42, 0.18);
  content: attr(data-gloss);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  white-space: normal;
}

.annotated-word.has-gloss[data-tooltip-align="left"]::after {
  left: 0;
  right: auto;
  transform: translate(0, 4px);
}

.annotated-word.has-gloss[data-tooltip-align="right"]::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.annotated-word.has-gloss:hover::after,
.annotated-word.has-gloss:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.annotated-word.has-gloss[data-tooltip-align="left"]:hover::after,
.annotated-word.has-gloss[data-tooltip-align="left"]:focus-visible::after,
.annotated-word.has-gloss[data-tooltip-align="right"]:hover::after,
.annotated-word.has-gloss[data-tooltip-align="right"]:focus-visible::after {
  transform: translate(0, 0);
}

.gloss-tooltip-measurer {
  position: fixed;
  top: -9999px;
  left: 0;
  z-index: -1;
  width: max-content;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
  visibility: hidden;
  white-space: normal;
}

.annotation-punctuation {
  display: inline;
}

.annotation-pinyin-word,
.annotation-pinyin-punctuation {
  display: inline;
}

.annotation-pinyin-word + .annotation-pinyin-word::before,
.annotation-pinyin-punctuation + .annotation-pinyin-word::before,
.annotation-pinyin-word + .annotation-pinyin-punctuation::before {
  content: " ";
}

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

.stat {
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  overflow-wrap: anywhere;
  font-weight: 780;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pronunciation-start-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 24px 0 8px;
}

.pronunciation-start-row .primary-btn {
  max-width: 100%;
}


.results-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.results-header h2 {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 850;
}

.results-header p {
  margin-top: 7px;
  color: var(--muted);
}

.history-data-action-wrap {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.history-data-actions {
  flex-wrap: nowrap;
}

.history-data-actions .ghost-btn {
  min-height: 40px;
  padding: 9px 11px;
  font-size: 12px;
}

.history-data-status {
  max-width: 360px;
  margin: 0;
  color: #20744a;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.history-data-status.is-error {
  color: #a9151e;
}

.results-header + .stat-grid,
.high-score-celebration + .stat-grid {
  margin-bottom: 18px;
}

.high-score-celebration {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 18px;
  border: 1px solid #e9c78e;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff8ed;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  animation: high-score-in 360ms ease-out, high-score-halo 900ms ease-out;
}

.high-score-celebration.dismissed {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.high-score-celebration > div > strong,
.high-score-celebration > div > span {
  display: block;
}

.high-score-celebration > div > strong {
  font-size: 15px;
  line-height: 1.2;
}

.high-score-celebration > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.high-score-icon {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #16857c;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.28);
}

.high-score-icon::before,
.high-score-icon::after,
.high-score-icon span {
  position: absolute;
  display: block;
  content: "";
  border-radius: 999px;
  background: #f3c642;
}

.high-score-icon::before {
  width: 8px;
  height: 8px;
  top: -3px;
  right: 2px;
  animation: high-score-spark 620ms ease-out;
}

.high-score-icon::after {
  width: 6px;
  height: 6px;
  right: -2px;
  bottom: 7px;
  animation: high-score-spark 620ms ease-out 80ms;
}

.high-score-icon span {
  width: 10px;
  height: 10px;
  left: 12px;
  top: 12px;
  background: #ffffff;
}

@keyframes high-score-in {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes high-score-halo {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 133, 124, 0.2);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(22, 133, 124, 0);
  }

  100% {
    box-shadow: 0 12px 24px rgba(144, 111, 20, 0.08);
  }
}

@keyframes high-score-spark {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.dashboard-panel {
  padding: 28px;
}

.study-plan-setup {
  overflow: hidden;
  padding: 0;
}

.study-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 26px;
  border-bottom: 1px solid var(--line);
}

.study-plan-header > div > span,
.study-plan-preview > span {
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.study-plan-header h2 {
  margin-top: 7px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 850;
}

.study-plan-header p {
  max-width: 66ch;
  margin-top: 9px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.55;
}

.study-plan-cancel {
  flex: 0 0 auto;
}

.study-plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.study-plan-form {
  padding: 30px 32px 34px;
  border-right: 1px solid var(--line);
}

.study-plan-field + .study-plan-field {
  margin-top: 30px;
}

.study-plan-field-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.study-plan-field-heading > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--theme-soft);
  color: var(--theme);
  font-size: 12px;
  font-weight: 850;
}

.study-plan-field-heading h3 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 850;
}

.study-plan-field-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.study-plan-level-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.study-plan-choice {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 88px;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.study-plan-choice:hover {
  border-color: var(--theme-border);
  background: var(--theme-soft);
}

.study-plan-choice.active {
  border-color: var(--theme);
  background: var(--theme-soft);
  box-shadow: inset 0 0 0 1px var(--theme);
}

.study-plan-choice strong {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 820;
}

.study-plan-choice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.study-plan-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 30px 28px 28px;
  background: #f8fafc;
}

.study-plan-preview h3 {
  margin-top: 7px;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 850;
}

.study-plan-preview > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.study-plan-preview ol {
  display: grid;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.study-plan-preview li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.study-plan-preview li > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 850;
}

.study-plan-preview li div {
  display: grid;
  gap: 3px;
}

.study-plan-preview li strong {
  font-size: 13px;
  line-height: 1.35;
}

.study-plan-preview li small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.study-plan-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.study-plan-actions .primary-btn {
  width: 100%;
  min-height: 48px;
}

.study-plan-actions > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.dashboard-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-hero h2 {
  margin-top: 7px;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 850;
}

.dashboard-hero-copy > p:last-of-type {
  max-width: 61ch;
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.55;
}

.dashboard-primary {
  min-height: 50px;
  margin-top: 0;
}

.dashboard-hero-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 20px;
}

.dashboard-edit-plan {
  min-height: 50px;
}

.dashboard-goal {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 220px;
}

.dashboard-goal-ring {
  position: relative;
  display: grid;
  width: 90px;
  height: 90px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--theme) var(--dashboard-goal-angle), #e9edf2 0);
}

.dashboard-goal-ring::before {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.dashboard-goal-ring strong {
  position: relative;
  font-size: 21px;
  font-weight: 850;
}

.dashboard-goal > div:last-child {
  display: grid;
  gap: 5px;
}

.dashboard-goal > div:last-child strong {
  font-size: 16px;
}

.dashboard-goal > div:last-child span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 0;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-section {
  min-width: 0;
}

.dashboard-plan {
  padding-right: 28px;
  border-right: 1px solid var(--line);
}

.dashboard-snapshot {
  padding-left: 28px;
}

.dashboard-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-section-heading h3 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
}

.dashboard-section-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-section-heading > strong,
.dashboard-section-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-plan-list {
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.dashboard-plan-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-plan-row.is-next {
  background: linear-gradient(90deg, var(--theme-soft), transparent 78%);
}

.dashboard-plan-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-plan-row.is-complete .dashboard-plan-index {
  border-color: #a9dcc9;
  color: #147d64;
  background: #eefaf5;
}

.dashboard-plan-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.dashboard-plan-copy strong {
  font-size: 15px;
  line-height: 1.25;
}

.dashboard-plan-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-plan-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-plan-row.is-next .dashboard-plan-status,
.dashboard-plan-row.is-complete .dashboard-plan-status {
  color: var(--theme);
}

.dashboard-plan-button {
  min-width: 74px;
  min-height: 38px;
}

.dashboard-metric-list {
  display: grid;
  margin: 15px 0 0;
  border-top: 1px solid var(--line);
}

.dashboard-metric-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-metric-list dt {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-metric-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.dashboard-notebook-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.dashboard-notebook-button:hover {
  border-color: var(--theme-border);
  background: var(--theme-soft);
}

.dashboard-notebook-button:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

.dashboard-notebook-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--theme-soft);
  color: var(--theme);
}

.dashboard-notebook-icon .button-icon,
.dashboard-notebook-button > .button-icon {
  width: 16px;
  height: 16px;
}

.dashboard-notebook-button > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-notebook-button strong {
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-notebook-button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-notebook-button > .button-icon {
  color: var(--line-strong);
}

.dashboard-focus {
  display: grid;
  align-items: start;
  margin-top: 18px;
  padding: 16px;
  border-left: 3px solid var(--theme);
  background: var(--theme-soft);
}

.dashboard-focus > span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-focus > strong {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.3;
}

.dashboard-focus p {
  margin-top: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-focus-button {
  justify-self: start;
  min-height: 38px;
  margin-top: 12px;
}

.dashboard-roadmap {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-roadmap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-roadmap-header h3 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
}

.dashboard-roadmap-header p {
  max-width: 68ch;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-roadmap-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f6f8;
}

.dashboard-roadmap-controls {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 0 0 auto;
}

.dashboard-placement-control {
  display: grid;
  justify-items: stretch;
  gap: 4px;
}

.dashboard-placement-start {
  min-height: 42px;
  white-space: nowrap;
}

.dashboard-placement-control small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.dashboard-roadmap-levels button {
  min-height: 34px;
  padding: 6px 13px;
  border: 0;
  border-radius: 5px;
  color: var(--muted-strong);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-roadmap-levels button:hover {
  color: var(--ink);
}

.dashboard-roadmap-levels button.active {
  color: #155e75;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.dashboard-roadmap-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 20px;
}

.dashboard-roadmap-summary {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 28px;
  border-right: 1px solid var(--line);
}

.dashboard-roadmap-summary > span,
.dashboard-roadmap-next > span {
  color: #155e75;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-roadmap-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-roadmap-score strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
}

.dashboard-roadmap-score small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-roadmap-summary .progress-track,
.dashboard-roadmap-milestone .progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edf1;
}

.dashboard-roadmap-summary .progress-track > div,
.dashboard-roadmap-milestone .progress-track > div {
  height: 100%;
  border-radius: inherit;
  background: #1786a0;
}

.dashboard-roadmap-next {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.dashboard-roadmap-next strong {
  font-size: 15px;
  line-height: 1.3;
}

.dashboard-roadmap-next small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.dashboard-roadmap-continue {
  min-height: 42px;
  margin-top: 3px;
}

.dashboard-roadmap-milestones {
  display: grid;
  border-top: 1px solid var(--line);
}

.dashboard-roadmap-milestone {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-roadmap-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #b9d9df;
  border-radius: 50%;
  color: #155e75;
  background: #f1fafb;
  font-size: 11px;
  font-weight: 850;
}

.dashboard-roadmap-milestone.is-complete .dashboard-roadmap-index {
  border-color: #a9dcc9;
  color: #147d64;
  background: #eefaf5;
}

.dashboard-roadmap-milestone-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.dashboard-roadmap-milestone-copy > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-roadmap-milestone-copy strong {
  font-size: 13px;
}

.dashboard-roadmap-milestone-copy span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-roadmap-milestone-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-roadmap-milestone .progress-track {
  width: min(100%, 340px);
  height: 5px;
}

.dashboard-roadmap-count {
  min-width: 72px;
  color: var(--muted-strong);
  font-size: 12px;
  text-align: right;
}

.dashboard-week {
  padding-top: 26px;
}

.dashboard-week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(36px, 1fr));
  gap: 10px;
  min-height: 154px;
  margin-top: 20px;
}

.dashboard-week-day {
  display: grid;
  grid-template-rows: 18px 1fr auto;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.dashboard-week-day > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-week-day > div {
  display: flex;
  min-height: 90px;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line-strong);
}

.dashboard-week-day i {
  display: block;
  width: min(32px, 58%);
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--theme);
  opacity: 0.84;
  transition: height 220ms ease;
}

.dashboard-week-day strong {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-session,
.placement-results {
  overflow: hidden;
  padding: 0;
}

.placement-session-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  min-height: 80px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
}

.placement-session-header > div:first-child,
.placement-session-score {
  display: grid;
  gap: 4px;
}

.placement-session-header > div:first-child > span,
.placement-session-score > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.placement-session-header > div:first-child > strong {
  font-size: 17px;
}

.placement-session-score {
  padding-right: 22px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.placement-session-score strong {
  font-size: 20px;
  line-height: 1;
}

.placement-session-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}

.placement-session-progress span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.placement-question-panel {
  display: flex;
  width: min(100%, 920px);
  min-height: 540px;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
  padding: 38px 34px;
}

.placement-question-copy {
  text-align: center;
}

.placement-question-copy > span,
.placement-recommendation span {
  color: #155e75;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.placement-question-copy h2 {
  margin: 13px 0 0;
  font-size: 31px;
  line-height: 1.45;
  font-weight: 750;
}

.placement-question-copy h2.is-vocabulary {
  font-size: 56px;
  line-height: 1.2;
}

.placement-question-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.placement-choice-option {
  min-height: 62px;
}

.placement-choice-option .choice-text {
  font-size: 15px;
  font-weight: 750;
}

.placement-choice-option .choice-text.chinese-text {
  font-size: 17px;
}

.placement-feedback {
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 13px 15px;
  background: #f1faf6;
}

.placement-feedback.is-wrong {
  border-left-color: var(--red);
  background: #fff5f5;
}

.placement-feedback > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.placement-feedback > div > strong {
  color: var(--green);
  font-size: 13px;
}

.placement-feedback.is-wrong > div > strong {
  color: var(--red);
}

.placement-feedback > div > span {
  color: var(--muted-strong);
  font-size: 11px;
}

.placement-feedback > div b {
  color: var(--ink);
  font-size: 14px;
}

.placement-feedback p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.placement-feedback .tone-pinyin {
  font-size: 15px;
  font-weight: 750;
}

.placement-next-button {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
}

.placement-results > .results-header {
  padding: 24px 24px 0;
}

.placement-recommendation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin: 22px 24px 0;
  padding: 22px 24px;
  border-left: 3px solid #1786a0;
  background: #f1f8fa;
}

.placement-recommendation h3 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.placement-recommendation p {
  max-width: 68ch;
  margin: 7px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.5;
}

.placement-recommendation .primary-btn {
  min-width: 200px;
}

.placement-result-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 22px 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.placement-result-stats > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 18px 18px 18px 0;
}

.placement-result-stats > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.placement-result-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.placement-result-stats strong {
  font-size: 24px;
  line-height: 1;
}

.placement-result-stats small {
  color: var(--muted-strong);
  font-size: 10px;
}

.placement-result-stats .progress-track {
  height: 5px;
  margin-top: 4px;
}

.placement-result-stats .progress-track > div {
  background: #1786a0;
}

.placement-results-heading {
  padding: 22px 24px 12px;
}

.placement-results-heading h3 {
  font-size: 17px;
}

.placement-results-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.placement-results .results-table-wrap {
  margin: 0 24px 24px;
}

.placement-results-table {
  min-width: 900px;
}

.placement-results-table td small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
}

.history-panel {
  display: grid;
  gap: 26px;
}

.history-panel .stat-grid {
  margin-bottom: 0;
}

.history-section {
  display: grid;
  gap: 10px;
}

.history-table-wrap {
  max-height: 360px;
}

.progress-header {
  margin-bottom: 0;
}

.progress-kicker {
  margin: 0 0 7px !important;
  color: var(--teal) !important;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.progress-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--surface-strong);
}

.progress-metric-strip > div {
  min-width: 0;
  padding: 18px 20px;
}

.progress-metric-strip > div + div {
  border-left: 1px solid var(--line);
}

.progress-metric-strip span,
.progress-metric-strip small {
  display: block;
  color: var(--muted);
}

.progress-metric-strip span {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.progress-metric-strip strong {
  display: inline;
  font-size: 30px;
  line-height: 1;
  font-weight: 820;
}

.progress-metric-strip small {
  display: inline;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 650;
}

.progress-section,
.progress-activity {
  min-width: 0;
}

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

.progress-section-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 820;
}

.progress-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-section-heading > span {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 750;
}

.progress-activity {
  padding-bottom: 2px;
}

.progress-activity-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(24px, 1fr));
  gap: 7px;
}

.progress-activity-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1.55;
  min-height: 28px;
  border: 1px solid #e5e9ee;
  border-radius: 5px;
  background: #f2f4f7;
  color: #98a2b3;
}

.progress-activity-day b {
  font-size: 9px;
  font-weight: 750;
}

.progress-activity-day.level-1 {
  border-color: #cce8dd;
  background: #e9f7f1;
  color: #2f765c;
}

.progress-activity-day.level-2 {
  border-color: #a8d7c4;
  background: #cdebdc;
  color: #236c50;
}

.progress-activity-day.level-3 {
  border-color: #65b491;
  background: #88c9aa;
  color: #123e30;
}

.progress-activity-day.level-4 {
  border-color: #28795b;
  background: #2f9461;
  color: #ffffff;
}

.progress-activity-day.is-today {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.progress-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 34px;
  padding-block: 24px;
  border-block: 1px solid var(--line);
}

.progress-skill-list {
  display: grid;
  gap: 3px;
}

.progress-skill-row {
  --skill-color: var(--teal);
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) minmax(120px, 1fr) 72px;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 8px 0;
}

.progress-skill-row:nth-child(2) {
  --skill-color: #0e7490;
}

.progress-skill-row:nth-child(3) {
  --skill-color: #c71924;
}

.progress-skill-row:nth-child(4) {
  --skill-color: #2563eb;
}

.progress-skill-row:nth-child(5) {
  --skill-color: #198a5a;
}

.progress-skill-row:nth-child(6) {
  --skill-color: #b56a18;
}

.progress-skill-heading {
  min-width: 0;
}

.progress-skill-heading strong,
.progress-skill-heading span {
  display: block;
}

.progress-skill-heading strong {
  font-size: 13px;
  font-weight: 800;
}

.progress-skill-heading span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-skill-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edf2;
}

.progress-skill-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--skill-color);
}

.progress-skill-action {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 11px;
}

.progress-focus-list {
  display: grid;
  gap: 10px;
}

.progress-focus-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  padding: 14px 14px 14px 16px;
  background: var(--surface);
}

.progress-focus-item:nth-child(2) {
  border-left-color: var(--blue);
}

.progress-focus-item:nth-child(3) {
  border-left-color: var(--gold);
}

.progress-focus-item > span,
.progress-focus-item > strong,
.progress-focus-item > p {
  grid-column: 1;
}

.progress-focus-item > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.progress-focus-item > strong {
  font-size: 13px;
  line-height: 1.25;
}

.progress-focus-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.progress-focus-item .secondary-btn {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-height: 36px;
  padding: 8px 11px;
  font-size: 11px;
}

.progress-words {
  padding-bottom: 2px;
}

.progress-word-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.progress-word-row {
  display: grid;
  grid-template-columns: 38px minmax(140px, 0.72fr) minmax(220px, 1.35fr) auto 38px;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 10px 13px;
  background: var(--surface);
}

.progress-word-row + .progress-word-row {
  border-top: 1px solid var(--line);
}

.progress-word-term,
.progress-word-term strong,
.progress-word-term span {
  min-width: 0;
}

.progress-word-term strong,
.progress-word-term > span {
  display: block;
}

.progress-word-term strong {
  font-size: 24px;
  line-height: 1.1;
}

.progress-word-term > span {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.progress-word-row > p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.4;
}

.progress-word-count {
  border-radius: 4px;
  padding: 5px 7px;
  background: #fff3f4;
  color: #a9151e;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.progress-disclosure {
  border-block: 1px solid var(--line);
}

.progress-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 2px;
  cursor: pointer;
  list-style: none;
}

.progress-disclosure > summary::-webkit-details-marker,
.history-session-item > summary::-webkit-details-marker {
  display: none;
}

.progress-disclosure > summary span,
.progress-disclosure > summary strong,
.progress-disclosure > summary small {
  display: block;
}

.progress-disclosure > summary strong {
  font-size: 14px;
}

.progress-disclosure > summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.progress-disclosure > summary b {
  min-width: 30px;
  border-radius: 4px;
  padding: 5px 8px;
  background: #eef2f6;
  color: var(--muted-strong);
  font-size: 11px;
  text-align: center;
}

.progress-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.progress-disclosure .history-table-wrap {
  margin: 14px 0;
}

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

.history-session-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.history-session-item > summary {
  display: grid;
  grid-template-columns: 112px minmax(190px, 0.9fr) minmax(220px, 1.1fr) 18px;
  gap: 16px;
  align-items: center;
  min-height: 66px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}

.history-session-item > summary:hover {
  background: #fbfcfe;
}

.history-session-date,
.history-session-result {
  color: var(--muted-strong);
  font-size: 11px;
}

.history-session-title,
.history-session-title strong,
.history-session-title small {
  min-width: 0;
}

.history-session-title strong,
.history-session-title small {
  display: block;
}

.history-session-title strong {
  font-size: 13px;
}

.history-session-title small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-session-result {
  text-align: right;
}

.history-session-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform 180ms ease;
}

.history-session-item[open] .history-session-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.history-session-review {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.history-session-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-session-review-heading > div strong,
.history-session-review-heading > div span {
  display: block;
}

.history-session-review-heading > div strong {
  font-size: 12px;
}

.history-session-review-heading > div span,
.history-session-empty,
.history-session-perfect {
  color: var(--muted);
  font-size: 11px;
}

.history-retry-btn {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 11px;
}

.history-session-empty,
.history-session-perfect {
  margin: 0;
  border-radius: 6px;
  padding: 12px;
  background: var(--surface);
}

.history-session-perfect {
  color: #20744a;
}

.history-mistake-list {
  display: grid;
  gap: 6px;
}

.history-mistake-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.68fr) minmax(180px, 1.2fr) minmax(140px, 0.8fr) 34px;
  gap: 12px;
  align-items: center;
  border: 1px solid #e6eaf0;
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--surface);
}

.history-mistake-word strong,
.history-mistake-word span {
  display: block;
}

.history-mistake-word strong {
  font-size: 21px;
  line-height: 1.1;
}

.history-mistake-word span,
.history-mistake-row > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.history-mistake-row > p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.35;
}

.history-mistake-row.is-sentence {
  grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 1.1fr) minmax(160px, 0.8fr) auto;
}

.history-mistake-row.is-sentence > strong {
  font-size: 13px;
  line-height: 1.35;
}

.history-mistake-row.is-sentence > strong.chinese-text {
  font-size: 18px;
}

.history-mistake-row.is-sentence > b {
  font-size: 12px;
}

.history-mistake-overflow {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.history-empty-state {
  display: grid;
  justify-items: start;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  padding: 22px;
  background: #fbfcfe;
}

.history-empty-state strong {
  font-size: 14px;
}

.history-empty-state p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.quiz-stat-grid {
  margin-bottom: 18px;
}

.results-table-wrap {
  border-radius: 8px;
  overflow: auto;
  max-height: 58vh;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td.status-good {
  color: var(--green);
  font-weight: 900;
}

td.status-okay {
  color: var(--gold);
  font-weight: 900;
}

td.status-review {
  color: var(--red);
  font-weight: 900;
}

.empty-note {
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}

.error-note {
  border-color: #e2c2b5;
  color: #8f3d20;
  background: #fff8f4;
}

.review-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.review-streak {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-streak strong {
  color: var(--theme);
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.review-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.review-metrics > div {
  min-width: 0;
  padding: 16px 18px;
}

.review-metrics > div + div {
  border-left: 1px solid var(--line);
}

.review-metrics strong,
.review-metrics span {
  display: block;
}

.review-metrics strong {
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  font-weight: 850;
}

.review-metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-home-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 0;
  margin-top: 22px;
}

.review-start-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 28px 16px 0;
  border-right: 1px solid var(--line);
}

.review-eyebrow,
.review-section-heading span,
.review-session-header > div:first-child span {
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.review-start-panel h3 {
  margin-top: 8px;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 850;
}

.review-start-panel p {
  max-width: 42ch;
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.55;
}

.review-start-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
}

.review-quiz-link {
  width: 100%;
  margin-top: 9px;
}

.review-queue-panel {
  min-width: 0;
  padding: 16px 0 16px 28px;
}

.review-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
}

.review-section-heading h3 {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 850;
}

.review-section-heading > strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.review-word-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.review-word-row {
  display: grid;
  grid-template-columns: 28px minmax(112px, 0.45fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 57px;
  border-bottom: 1px solid var(--line);
}

.review-word-rank {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.review-word-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.review-word-identity strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.review-word-identity span,
.review-word-meaning {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-word-identity span {
  font-size: 12px;
  font-weight: 800;
}

.review-word-meaning {
  color: var(--muted-strong);
  font-size: 13px;
}

.review-word-state {
  min-width: 62px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  text-transform: uppercase;
}

.review-word-state.is-due {
  color: var(--red);
}

.review-word-state.is-new {
  color: var(--theme);
}

.review-session {
  padding: 0;
  overflow: hidden;
}

.review-session-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  min-height: 82px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.review-session-header > div:first-child {
  display: grid;
  gap: 4px;
}

.review-session-header > div:first-child strong {
  font-size: 18px;
  font-weight: 850;
}

.review-session-score {
  display: grid;
  padding-right: 22px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.review-session-score span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.review-session-score strong {
  margin-top: 3px;
  font-size: 21px;
  line-height: 1;
}

.review-progress-row {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.review-practice-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  min-height: 430px;
}

.review-prompt-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  min-width: 0;
  padding: 34px;
  border-right: 1px solid var(--line);
  background: #f8fbfa;
  text-align: center;
}

.review-prompt-word {
  color: var(--ink);
  font-size: 72px;
  line-height: 1.1;
  font-weight: 700;
}

.review-prompt-panel .audio-sentence {
  justify-content: center;
}

.review-prompt-panel .audio-revealed-word {
  font-size: 52px;
}

.review-response-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

.review-response-panel:not(.is-answered) {
  justify-content: center;
}

.review-answer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.review-choice-grid {
  gap: 10px;
}

.review-feedback {
  margin-top: 2px;
}

.review-answer-reveal {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding-top: 2px;
}

.review-answer-reveal > strong,
.review-answer-reveal > strong a {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.review-answer-reveal > span {
  font-size: 13px;
  font-weight: 850;
}

.review-answer-reveal p,
.review-answer-note {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.review-answer-note {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.review-next-btn {
  width: 100%;
  min-height: 50px;
  margin-top: auto;
}

.review-results-table {
  min-width: 980px;
}

.grammar-home,
.grammar-lesson-view,
.grammar-session,
.grammar-results {
  overflow: hidden;
  padding: 0;
}

.grammar-home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 28px 30px 24px;
  border-bottom: 1px solid var(--line);
}

.grammar-home-header h2,
.grammar-lesson-copy h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 850;
}

.grammar-home-header p,
.grammar-lesson-copy p {
  max-width: 68ch;
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.55;
}

.grammar-mixed-start {
  min-width: 210px;
}

.grammar-level-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 30px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.grammar-level-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted-strong);
  text-align: left;
}

.grammar-level-button:first-child {
  border-radius: 7px 0 0 7px;
}

.grammar-level-button:last-child {
  border-radius: 0 7px 7px 0;
}

.grammar-level-button:hover {
  position: relative;
  z-index: 1;
  border-color: var(--theme-border);
  color: var(--ink);
}

.grammar-level-button.active {
  position: relative;
  z-index: 2;
  border-color: var(--theme);
  background: var(--theme-soft);
  color: var(--theme);
}

.grammar-level-button strong {
  font-size: 14px;
  font-weight: 850;
}

.grammar-level-button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.grammar-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 30px;
  border-bottom: 1px solid var(--line);
}

.grammar-metric-strip > div {
  min-width: 0;
  padding: 17px 18px 17px 0;
}

.grammar-metric-strip > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.grammar-metric-strip strong,
.grammar-metric-strip span {
  display: block;
}

.grammar-metric-strip strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
}

.grammar-metric-strip span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.grammar-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 30px 13px;
}

.grammar-list-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
}

.grammar-list-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.grammar-list-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.grammar-lesson-list {
  margin: 0 30px;
  border-top: 1px solid var(--line);
}

.grammar-lesson-row {
  display: grid;
  grid-template-columns: 30px minmax(230px, 1.25fr) minmax(140px, 0.7fr) 82px 20px;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 84px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 3px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.grammar-lesson-row:hover {
  background: #fbfcfe;
}

.grammar-lesson-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.grammar-lesson-main,
.grammar-lesson-main > span,
.grammar-lesson-main > strong,
.grammar-lesson-progress,
.grammar-lesson-progress > span,
.grammar-lesson-progress > strong {
  display: block;
  min-width: 0;
}

.grammar-lesson-meta {
  color: var(--theme);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.grammar-lesson-main > strong {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 820;
}

.grammar-lesson-main > span:last-child {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grammar-lesson-pattern {
  color: var(--muted-strong);
  font-size: 17px;
  font-weight: 750;
}

.grammar-lesson-progress {
  text-align: right;
}

.grammar-lesson-progress strong {
  font-size: 13px;
  font-weight: 850;
}

.grammar-lesson-progress span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.grammar-lesson-progress.strong strong {
  color: var(--green);
}

.grammar-lesson-progress.learning strong {
  color: var(--gold);
}

.grammar-lesson-arrow {
  color: var(--muted);
  font-size: 18px;
  transition: transform 160ms ease;
}

.grammar-lesson-row:hover .grammar-lesson-arrow {
  color: var(--theme);
  transform: translateX(3px);
}

.grammar-source-note {
  margin: 0;
  padding: 17px 30px 22px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.grammar-source-note a {
  color: var(--muted-strong);
  font-weight: 750;
}

.grammar-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 30px 0;
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.grammar-back-button:hover {
  color: var(--theme);
}

.grammar-lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 34px;
  align-items: center;
  margin: 12px 30px 0;
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--line);
}

.grammar-lesson-copy > span,
.grammar-context-panel > span,
.grammar-question-copy > span,
.grammar-pattern-display > span,
.grammar-explanation > div > span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.grammar-pattern-display {
  display: grid;
  gap: 8px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.grammar-pattern-display strong {
  font-size: 29px;
  line-height: 1.2;
}

.grammar-pattern-display small {
  color: var(--muted);
  font-size: 11px;
}

.grammar-lesson-body {
  padding: 0 30px;
}

.grammar-explanation {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 38px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.grammar-explanation h3 {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.45;
}

.grammar-explanation p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.6;
}

.grammar-example-section .grammar-list-heading {
  padding-inline: 0;
}

.grammar-example-list {
  border-top: 1px solid var(--line);
}

.grammar-example-row {
  display: grid;
  grid-template-columns: 26px minmax(220px, 0.9fr) minmax(220px, 1.1fr) 36px;
  gap: 16px;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.grammar-example-index {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.grammar-example-row > div strong,
.grammar-example-row > div span {
  display: block;
}

.grammar-example-row > div strong {
  font-size: 20px;
  line-height: 1.3;
}

.grammar-example-row > div span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
}

.grammar-example-row .tone-pinyin {
  display: inline;
}

.grammar-example-row > p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.grammar-lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 25px;
  padding: 20px 30px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.grammar-lesson-footer > div strong,
.grammar-lesson-footer > div span {
  display: block;
}

.grammar-lesson-footer > div strong {
  font-size: 14px;
}

.grammar-lesson-footer > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.grammar-session-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  min-height: 80px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
}

.grammar-session-header > div:first-child,
.grammar-session-score {
  display: grid;
  gap: 4px;
}

.grammar-session-header > div:first-child > span,
.grammar-session-score > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.grammar-session-header > div:first-child > strong {
  font-size: 17px;
}

.grammar-session-score {
  padding-right: 22px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.grammar-session-score strong {
  font-size: 20px;
  line-height: 1;
}

.grammar-session-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.grammar-session-progress span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.grammar-practice-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(420px, 1.38fr);
  min-height: 470px;
}

.grammar-context-panel {
  display: grid;
  align-content: center;
  gap: 13px;
  min-width: 0;
  padding: 34px;
  border-right: 1px solid var(--line);
  background: #f8fbff;
}

.grammar-context-panel > strong {
  font-size: 31px;
  line-height: 1.25;
}

.grammar-context-panel > p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.grammar-question-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 29px;
}

.grammar-question-copy h2 {
  margin: 10px 0 0;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 750;
}

.grammar-question-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.grammar-blank {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  min-height: 34px;
  margin-inline: 4px;
  border-bottom: 2px solid var(--theme);
  color: var(--theme);
  font-size: 0;
  vertical-align: baseline;
}

.grammar-blank::after {
  content: "?";
  font-size: 18px;
  line-height: 1;
}

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

.grammar-choice-option {
  min-height: 58px;
}

.grammar-choice-option .choice-text {
  font-size: 17px;
  font-weight: 750;
}

.grammar-feedback {
  display: grid;
  gap: 9px;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 13px 15px;
  background: #f1faf6;
}

.grammar-feedback.is-wrong {
  border-left-color: var(--red);
  background: #fff5f5;
}

.grammar-feedback > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.grammar-feedback > div > strong {
  color: var(--green);
  font-size: 13px;
}

.grammar-feedback.is-wrong > div > strong {
  color: var(--red);
}

.grammar-feedback > div > span {
  color: var(--muted-strong);
  font-size: 11px;
}

.grammar-feedback > div b {
  color: var(--ink);
  font-size: 15px;
}

.grammar-feedback p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.grammar-next-button {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
}

.grammar-result-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 24px 18px;
}

.grammar-results > .results-header {
  padding: 24px 24px 0;
}

.grammar-result-focus {
  margin: 0 24px 24px;
}

.grammar-result-focus .grammar-list-heading {
  padding-inline: 0;
}

.grammar-result-focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.grammar-result-focus-list button {
  display: grid;
  gap: 5px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--theme);
  border-radius: 7px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.grammar-result-focus-list button:hover {
  border-color: var(--theme-border);
  border-left-color: var(--theme);
  background: var(--theme-soft);
}

.grammar-result-focus-list span {
  color: var(--theme);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.grammar-result-focus-list strong {
  font-size: 13px;
}

.grammar-result-focus-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.grammar-results .results-table-wrap {
  margin: 0 24px 24px;
}

.grammar-results-table {
  min-width: 900px;
}

.history-mistake-row.is-grammar > strong .grammar-blank {
  min-width: 26px;
  min-height: 20px;
}

.history-mistake-row.is-grammar > strong .grammar-blank::after {
  font-size: 11px;
}

@media (min-width: 981px) and (max-width: 1180px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-plan {
    padding-right: 0;
    padding-bottom: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-snapshot {
    padding-top: 26px;
    padding-left: 0;
  }

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

  .vocabulary-library-search-field {
    grid-column: 1 / -1;
  }

  .vocabulary-library-row {
    grid-template-columns: 40px minmax(155px, 0.62fr) minmax(0, 1.38fr) 82px;
    gap: 12px;
  }

  .vocabulary-save-button {
    grid-row: 1 / span 2;
  }

  .vocabulary-library-meta {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .vocabulary-library-actions {
    grid-column: 4;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .topbar,
  .global-options,
  .results-header {
    grid-template-columns: 1fr;
  }

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

  .brand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
  }

  .global-search-trigger {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .global-search-trigger-label,
  .global-search-trigger-shortcut {
    display: none;
  }

  .mode-nav {
    width: 100%;
  }

  .tool-controls,
  body[data-tool="vocabulary"] .tool-controls {
    grid-template-columns: 1fr;
  }

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

  .mode-heading {
    display: grid;
  }

  .review-home-grid,
  .review-practice-layout,
  .tone-listening-layout,
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .study-plan-layout {
    grid-template-columns: 1fr;
  }

  .study-plan-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tone-prompt-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-plan {
    padding-right: 0;
    padding-bottom: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-snapshot {
    padding-top: 26px;
    padding-left: 0;
  }

  .review-start-panel {
    padding-right: 0;
    padding-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .review-queue-panel {
    padding: 24px 0 0;
  }

  .review-prompt-panel {
    min-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grammar-home-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .placement-session-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .placement-session-header > div:first-child {
    grid-column: 1 / -1;
  }

  .placement-session-score {
    padding-right: 0;
    border-right: 0;
    text-align: left;
  }

  .placement-question-panel {
    width: 100%;
    min-height: 0;
    padding: 28px 24px;
  }

  .placement-recommendation {
    grid-template-columns: 1fr;
  }

  .placement-recommendation .primary-btn {
    width: 100%;
  }

  .placement-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .placement-result-stats > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .placement-result-stats > div:nth-child(5) {
    padding-left: 0;
    border-left: 0;
  }

  .placement-result-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .grammar-mixed-start {
    width: 100%;
  }

  .grammar-lesson-hero,
  .grammar-explanation,
  .grammar-practice-layout {
    grid-template-columns: 1fr;
  }

  .grammar-pattern-display {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .grammar-context-panel {
    min-height: 180px;
    padding: 26px 30px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grammar-result-focus-list {
    grid-template-columns: 1fr;
  }

  .progress-main-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .history-session-item > summary {
    grid-template-columns: 104px minmax(170px, 0.8fr) minmax(180px, 1fr) 18px;
    gap: 12px;
  }

  .history-mistake-row,
  .history-mistake-row.is-sentence {
    grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1.3fr) minmax(130px, 0.8fr) auto;
  }

  .sentence-library-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sentence-library-practice-btn {
    width: 100%;
  }

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

  .sentence-library-search-field {
    grid-column: 1 / -1;
  }

}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .topbar,
  .workspace-panel {
    padding: 12px;
  }

  .study-plan-setup {
    padding: 0;
  }

  .study-plan-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 20px 18px 18px;
  }

  .study-plan-header h2 {
    font-size: 25px;
  }

  .study-plan-cancel {
    width: 100%;
  }

  .study-plan-form,
  .study-plan-preview {
    padding: 20px 18px;
  }

  .study-plan-field + .study-plan-field {
    margin-top: 24px;
  }

  .study-plan-choice-grid {
    gap: 7px;
    margin-top: 12px;
  }

  .study-plan-level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-plan-choice {
    min-height: 76px;
    padding: 11px 10px;
  }

  .study-plan-level-grid .study-plan-choice {
    text-align: center;
  }

  .study-plan-level-grid .study-plan-choice span {
    display: none;
  }

  .study-plan-focus-grid {
    grid-template-columns: 1fr;
  }

  .study-plan-focus-grid .study-plan-choice {
    min-height: 68px;
  }

  .study-plan-preview ol {
    margin-top: 14px;
  }

  .study-plan-preview li {
    padding: 11px 0;
  }

  .topbar {
    min-height: 0;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand p {
    font-size: 12px;
  }

  .global-search-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 6px auto auto;
  }

  .global-search-dialog::backdrop {
    backdrop-filter: none;
  }

  .global-search-shell {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .global-search-input-row {
    grid-template-columns: 20px minmax(0, 1fr) 38px;
    min-height: 58px;
    gap: 8px;
    padding: 0 8px 0 14px;
  }

  .global-search-input-row input {
    font-size: 16px;
  }

  .global-search-results {
    padding: 5px;
  }

  .global-search-view-row {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 6px;
  }

  .global-search-view-switcher {
    align-self: center;
  }

  .global-search-saved-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .global-search-saved-actions button {
    min-width: 0;
    padding-inline: 6px;
  }

  .global-search-result {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
    gap: 9px;
    min-height: 64px;
    padding: 8px;
  }

  .global-search-result-icon {
    width: 38px;
    height: 38px;
  }

  .global-search-result-meta {
    display: none;
  }

  .global-search-result-title {
    gap: 7px;
  }

  .global-search-result-hanzi {
    font-size: 18px;
  }

  .options-summary {
    min-height: 44px;
    padding: 0 12px;
  }

  .options-body {
    padding: 12px 2px 2px;
  }

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

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

  .tool-tab[data-tool="dashboard"] {
    grid-column: 1 / -1;
  }

  .mode-tab,
  .tool-tab {
    min-height: 44px;
    padding: 0 6px;
    font-size: 13px;
  }

  .drill-view-switcher,
  .pronunciation-view-switcher {
    width: 100%;
    margin-bottom: 16px;
  }

  .sentence-library-toolbar {
    margin-top: 18px;
  }

  .sentence-library-toggle {
    min-height: 40px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .sentence-library-summary {
    padding-top: 13px;
  }

  .sentence-library-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 5px;
    padding: 14px 0;
  }

  .sentence-library-save,
  .sentence-library-audio {
    width: 44px;
    min-height: 44px;
  }

  .sentence-library-copy .annotated-hanzi-line {
    font-size: 20px;
  }

  .sentence-library-copy .annotated-pinyin-line {
    font-size: 11px;
  }

  .sentence-library-english {
    margin-top: 7px;
    font-size: 13px;
  }

  .sentence-library-copy footer {
    flex-wrap: wrap;
    gap: 7px 10px;
    margin-top: 8px;
  }

  .review-heading {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dashboard-panel {
    padding: 14px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-bottom: 22px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .dashboard-hero-copy > p:last-of-type {
    font-size: 14px;
  }

  .dashboard-primary {
    width: 100%;
  }

  .dashboard-hero-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-edit-plan {
    width: 100%;
  }

  .dashboard-goal {
    min-width: 0;
  }

  .dashboard-goal-ring {
    width: 76px;
    height: 76px;
  }

  .dashboard-goal-ring strong {
    font-size: 18px;
  }

  .dashboard-main-grid {
    padding: 22px 0;
  }

  .dashboard-section-heading {
    gap: 10px;
  }

  .dashboard-section-heading h3 {
    font-size: 18px;
  }

  .dashboard-plan-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 76px;
  }

  .dashboard-plan-index {
    width: 28px;
    height: 28px;
  }

  .dashboard-plan-status {
    display: none;
  }

  .dashboard-plan-button {
    min-width: 64px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .dashboard-focus-button {
    width: 100%;
  }

  .dashboard-roadmap-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-roadmap-controls {
    display: grid;
    width: 100%;
  }

  .dashboard-placement-control {
    width: 100%;
  }

  .dashboard-placement-start {
    width: 100%;
  }

  .dashboard-roadmap-levels {
    width: 100%;
  }

  .dashboard-roadmap-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dashboard-roadmap-summary {
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-roadmap-continue {
    width: 100%;
  }

  .dashboard-roadmap-count {
    min-width: 56px;
  }

  .dashboard-roadmap-milestone-copy small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .dashboard-week-chart {
    grid-template-columns: repeat(7, minmax(28px, 1fr));
    gap: 4px;
    min-height: 138px;
    margin-top: 16px;
  }

  .dashboard-week-day > div {
    min-height: 78px;
  }

  .dashboard-week-day strong {
    font-size: 9px;
  }

  .vocabulary-view-switcher {
    width: 100%;
    margin-bottom: 16px;
  }

  .vocabulary-library-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .vocabulary-saved-review-btn {
    width: 100%;
  }

  .vocabulary-library-toolbar {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .vocabulary-library-search-field {
    grid-column: auto;
  }

  .vocabulary-library-summary {
    padding-top: 13px;
  }

  .vocabulary-library-row {
    grid-template-columns: 34px minmax(0, 1fr) 76px;
    gap: 10px;
    min-height: 0;
    padding: 13px 0;
  }

  .vocabulary-save-button {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 34px;
    min-height: 34px;
  }

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

  .vocabulary-library-word > strong {
    font-size: 25px;
  }

  .vocabulary-library-meaning {
    grid-column: 2 / 4;
    grid-row: 2;
    font-size: 12px;
  }

  .vocabulary-library-meta {
    grid-column: 2 / 4;
    grid-row: 3;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  .vocabulary-library-actions {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: repeat(2, 34px);
  }

  .vocabulary-library-audio,
  .vocabulary-library-study {
    width: 34px;
    min-height: 34px;
  }

  .review-streak {
    justify-self: start;
    padding: 0;
    border-left: 0;
  }

  .review-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .review-metrics > div {
    padding: 12px;
  }

  .review-metrics > div:nth-child(3) {
    border-left: 0;
  }

  .review-metrics > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .review-start-panel {
    padding-top: 10px;
  }

  .review-word-row {
    grid-template-columns: 22px minmax(105px, 0.72fr) minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 54px;
  }

  .review-word-identity {
    grid-template-columns: auto;
    gap: 3px;
  }

  .review-word-identity strong {
    font-size: 22px;
  }

  .review-word-identity span,
  .review-word-meaning {
    font-size: 11px;
  }

  .review-word-state {
    min-width: 44px;
    font-size: 9px;
  }

  .review-session {
    padding: 0;
  }

  .review-session-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .review-session-header > div:first-child {
    grid-column: 1 / -1;
  }

  .review-session-score {
    padding-right: 0;
    border-right: 0;
    text-align: left;
  }

  .review-session-header .ghost-btn {
    width: auto;
  }

  .grammar-home,
  .grammar-lesson-view,
  .grammar-session,
  .grammar-results {
    padding: 0;
  }

  .grammar-home-header {
    gap: 18px;
    padding: 20px 16px;
  }

  .grammar-home-header h2,
  .grammar-lesson-copy h2 {
    font-size: 25px;
  }

  .grammar-level-switcher,
  .grammar-metric-strip,
  .grammar-lesson-list {
    margin-inline: 16px;
  }

  .grammar-level-switcher {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-block: 14px;
  }

  .grammar-level-button:first-child,
  .grammar-level-button:last-child {
    border-radius: 7px;
  }

  .grammar-metric-strip > div {
    padding: 13px 8px 13px 0;
  }

  .grammar-metric-strip > div + div {
    padding-left: 8px;
  }

  .grammar-metric-strip strong {
    font-size: 20px;
  }

  .grammar-metric-strip span {
    font-size: 8px;
    line-height: 1.25;
  }

  .grammar-list-heading {
    align-items: start;
    padding: 19px 16px 11px;
  }

  .grammar-lesson-row {
    grid-template-columns: 24px minmax(0, 1fr) 58px 16px;
    gap: 9px;
    min-height: 98px;
  }

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

  .grammar-lesson-main > span:last-child {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .grammar-lesson-pattern {
    grid-column: 2 / 4;
    grid-row: 2;
    font-size: 14px;
  }

  .grammar-lesson-progress {
    grid-column: 3;
    grid-row: 1;
  }

  .grammar-lesson-arrow {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  .grammar-source-note {
    padding-inline: 16px;
  }

  .grammar-back-button {
    margin: 12px 16px 0;
  }

  .grammar-lesson-hero {
    gap: 20px;
    margin-inline: 16px;
    padding-top: 17px;
  }

  .grammar-pattern-display strong {
    font-size: 25px;
  }

  .grammar-lesson-body {
    padding-inline: 16px;
  }

  .grammar-explanation {
    gap: 16px;
    padding-block: 20px;
  }

  .grammar-example-row {
    grid-template-columns: 22px minmax(0, 1fr) 36px;
    gap: 8px 10px;
    padding-block: 13px;
  }

  .grammar-example-row > div {
    grid-column: 2;
  }

  .grammar-example-row > p {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .grammar-example-row > .icon-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .grammar-lesson-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 17px 16px;
  }

  .grammar-session-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .grammar-session-header > div:first-child {
    grid-column: 1 / -1;
  }

  .grammar-session-score {
    padding-right: 0;
    border-right: 0;
    text-align: left;
  }

  .grammar-session-header .ghost-btn {
    width: auto;
  }

  .placement-session,
  .placement-results {
    padding: 0;
  }

  .placement-session-header {
    min-height: 0;
    padding: 12px;
  }

  .placement-session-header .ghost-btn {
    width: auto;
  }

  .placement-session-progress {
    gap: 10px;
    padding: 10px 12px;
  }

  .placement-question-panel {
    gap: 14px;
    padding: 22px 12px 14px;
  }

  .placement-question-copy h2 {
    margin-top: 9px;
    font-size: 24px;
  }

  .placement-question-copy h2.is-vocabulary {
    font-size: 46px;
  }

  .placement-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .placement-choice-option {
    min-height: 54px;
  }

  .placement-feedback > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .placement-results > .results-header {
    padding: 16px 12px 0;
  }

  .placement-recommendation,
  .placement-result-stats,
  .placement-results .results-table-wrap {
    margin-inline: 12px;
  }

  .placement-recommendation {
    gap: 16px;
    margin-top: 16px;
    padding: 18px 16px;
  }

  .placement-recommendation h3 {
    font-size: 21px;
  }

  .placement-result-stats {
    margin-top: 16px;
  }

  .placement-result-stats > div {
    padding: 14px 10px 14px 0;
  }

  .placement-result-stats > div + div {
    padding-left: 10px;
  }

  .placement-result-stats > div:nth-child(2n + 1) {
    padding-left: 0;
    border-left: 0;
  }

  .placement-result-stats strong {
    font-size: 21px;
  }

  .placement-results-heading {
    padding: 18px 12px 10px;
  }

  .grammar-session-progress {
    padding: 10px 12px;
  }

  .grammar-context-panel {
    min-height: 0;
    padding: 18px 14px;
  }

  .grammar-context-panel > strong {
    font-size: 23px;
  }

  .grammar-context-panel > p {
    font-size: 12px;
  }

  .grammar-question-panel {
    gap: 12px;
    padding: 16px 14px;
  }

  .grammar-question-copy h2 {
    font-size: 24px;
  }

  .grammar-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .grammar-choice-option {
    min-height: 52px;
  }

  .grammar-feedback > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .grammar-result-stats {
    grid-template-columns: 1fr;
    margin-inline: 12px;
  }

  .grammar-results > .results-header {
    padding: 16px 12px 0;
  }

  .grammar-result-focus,
  .grammar-results .results-table-wrap {
    margin-inline: 12px;
  }

  .review-progress-row {
    padding: 10px 12px;
  }

  .review-prompt-panel {
    min-height: 210px;
    padding: 22px 14px;
  }

  .review-prompt-word {
    font-size: 52px;
  }

  .review-prompt-panel .audio-revealed-word {
    font-size: 40px;
  }

  .review-response-panel {
    gap: 12px;
    padding: 14px;
  }

  .review-answer-form {
    grid-template-columns: 1fr;
  }

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

  .review-answer-reveal p {
    grid-column: 1 / -1;
  }

  .task-preview,
  .quiz-preview,
  .quiz-config,
  .vocabulary-home .quiz-config,
  .quiz-start-strip,
  .quiz-play-header,
  .vocab-guess-form,
  .answer-pair,
  .stat-grid,
  .pronunciation-breakdown-grid,
  .map-game-shell {
    grid-template-columns: 1fr;
  }

  .stat-grid.tone-result-stats {
    grid-template-columns: 1fr;
  }

  .quiz-start-metric {
    min-height: 0;
    padding: 0 0 10px;
  }

  .quiz-start-metric + .quiz-start-metric {
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .sentence-text {
    font-size: 21px;
  }

  .quiz-word {
    font-size: 34px;
  }

  .chinese-text {
    font-size: 21px;
  }

  .sentence-text.quiz-word {
    font-size: 34px;
  }

  .mode-heading {
    padding-bottom: 14px;
  }

  .mode-heading h2 {
    font-size: 23px;
  }

  .mode-heading p {
    font-size: 14px;
    line-height: 1.45;
  }

  .sentence-card,
  .feedback {
    padding: 14px;
  }

  .sentence-card-header,
  .pronunciation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pronunciation-hanzi-line {
    font-size: 28px;
  }

  .pronunciation-pinyin-line {
    font-size: 14px;
  }

  .tone-prompt-panel,
  .tone-response-panel {
    padding: 14px;
  }

  .tone-prompt-panel {
    gap: 12px;
  }

  .tone-word-concealment,
  .tone-answer-reveal {
    min-height: 92px;
  }

  .tone-answer-word > strong,
  .tone-answer-word > strong a {
    font-size: 32px;
  }

  .tone-choice-option {
    min-height: 54px;
    padding: 10px;
  }

  .tone-choice-text strong {
    font-size: 16px;
  }

  .tone-next-btn,
  .tone-end-btn {
    align-self: stretch;
  }

  .map-prompt {
    font-size: 34px;
  }

  .map-question-panel {
    gap: 10px;
    padding: 12px;
  }

  .map-score-card {
    padding: 12px;
  }

  .map-score-card > div:not(.map-progress-line) + div:not(.map-progress-line) {
    padding-left: 12px;
  }

  .map-score-card span,
  .map-score-card small {
    font-size: 11px;
  }

  .map-score-card strong {
    margin-top: 4px;
    font-size: 21px;
  }

  .map-score-card small {
    margin-top: 5px;
  }

  .map-progress-line {
    height: 6px;
    margin-top: 10px;
  }

  .map-question-count {
    margin: 0;
    font-size: 12px;
  }

  .map-prompt-card {
    gap: 7px;
    padding: 12px;
  }

  .map-prompt-card p,
  .map-hint-note {
    font-size: 12px;
    line-height: 1.35;
  }

  .map-prompt-pinyin {
    font-size: 13px;
  }

  .map-quiz-session .map-prompt {
    font-size: 30px;
  }

  .map-quiz-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

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

  .map-mode-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .map-mode-heading {
    min-width: 0;
  }

  .map-mode-header .map-mode-picker {
    width: 100%;
  }

  .map-name-toggle {
    justify-content: flex-start;
    width: 100%;
    min-height: 42px;
  }

  .map-name-toggle.compact {
    width: auto;
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .map-mode-header .map-mode-option {
    min-height: 56px;
  }

  .map-question-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-home .map-stage-panel,
  .map-home .china-map-wrap,
  .map-home .china-map-canvas {
    min-height: 380px;
  }

  .map-quiz-session .map-stage-panel,
  .map-quiz-session .china-map-wrap,
  .map-quiz-session .china-map-canvas {
    min-height: 0;
    height: clamp(320px, 48vh, 380px);
  }

  .map-quiz-session .china-map-canvas {
    padding: 0;
  }

  .map-quiz-session .china-map-svg {
    width: 100%;
    height: 100%;
  }

  .map-answer-toast {
    top: 12px;
    width: calc(100% - 24px);
    justify-content: center;
  }

  .map-zoom-controls {
    left: 12px;
    right: auto;
    top: auto;
    bottom: 12px;
  }

  .map-zoom-btn {
    width: 44px;
    min-height: 44px;
    font-size: 20px;
  }

  .map-zoom-reset {
    width: 50px;
    font-size: 13px;
  }

  .map-legend-row {
    left: 12px;
    right: 12px;
    bottom: 58px;
    justify-content: center;
  }

  .map-tip {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    text-align: center;
  }

  .mobile-current-word strong {
    font-size: 30px;
  }

  textarea {
    min-height: 118px;
    font-size: 16px;
  }

  textarea.chinese-text,
  textarea[lang="zh-CN"] {
    font-size: 21px;
  }

  .audio-sentence,
  .form-actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-data-action-wrap {
    justify-items: stretch;
  }

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

  .history-data-actions .ghost-btn {
    min-width: 0;
    padding-inline: 7px;
  }

  .history-data-status {
    max-width: none;
    text-align: left;
  }

  .history-session-review-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .history-retry-btn {
    width: 100%;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
    min-height: 46px;
  }

  .shortcut-btn {
    gap: 8px;
  }

  .pronunciation-start-row .shortcut-hint {
    display: none;
  }

  .tone-listening-session .shortcut-hint {
    display: none;
  }

  .shortcut-hint kbd {
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    font-size: 10px;
  }

  .sound-indicator,
  .audio-warning,
  .answer-status-pill {
    justify-content: center;
  }

  .vocab-section-heading {
    display: grid;
    align-items: start;
  }

  .vocab-table {
    min-width: 560px;
  }

  .vocab-table th,
  .vocab-table td {
    padding: 7px 8px;
  }

  .history-panel {
    gap: 22px;
  }

  .progress-header .result-actions {
    grid-template-columns: 1fr;
  }

  .progress-header .history-data-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .progress-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-metric-strip > div {
    padding: 14px 12px;
  }

  .progress-metric-strip > div:nth-child(3) {
    border-left: 0;
  }

  .progress-metric-strip > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .progress-metric-strip strong {
    font-size: 25px;
  }

  .progress-metric-strip small {
    display: block;
    margin: 4px 0 0;
  }

  .progress-section-heading {
    align-items: start;
  }

  .progress-activity-grid {
    grid-template-columns: repeat(7, minmax(28px, 1fr));
    gap: 6px;
  }

  .progress-activity-day {
    aspect-ratio: 1.35;
  }

  .progress-main-grid {
    gap: 24px;
    padding-block: 20px;
  }

  .progress-skill-row {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px 12px;
    min-height: 66px;
  }

  .progress-skill-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .progress-skill-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .progress-skill-action {
    grid-column: 2;
    grid-row: 1;
    width: 64px;
    min-height: 34px;
  }

  .progress-focus-item {
    grid-template-columns: 1fr;
  }

  .progress-focus-item > span,
  .progress-focus-item > strong,
  .progress-focus-item > p,
  .progress-focus-item .secondary-btn {
    grid-column: 1;
  }

  .progress-focus-item .secondary-btn {
    grid-row: auto;
    width: 100%;
    margin-top: 5px;
  }

  .progress-word-row {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 8px 10px;
    padding: 12px 10px;
  }

  .progress-word-row .vocabulary-save-button {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

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

  .progress-word-row > .icon-btn:last-child {
    grid-column: 3;
    grid-row: 1;
  }

  .progress-word-row > p {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .progress-word-count {
    grid-column: 2 / 4;
    grid-row: 3;
    justify-self: start;
  }

  .history-session-item > summary {
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 6px 12px;
    padding: 12px;
  }

  .history-session-date {
    grid-column: 1;
    grid-row: 1;
  }

  .history-session-title {
    grid-column: 1;
    grid-row: 2;
  }

  .history-session-title small {
    white-space: normal;
  }

  .history-session-result {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }

  .history-session-chevron {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .history-session-review {
    padding: 10px;
  }

  .history-mistake-row,
  .history-mistake-row.is-sentence {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 10px;
  }

  .history-mistake-row > :not(.icon-btn),
  .history-mistake-row.is-sentence > :not(.icon-btn) {
    grid-column: 1;
  }

  .history-mistake-row > .icon-btn,
  .history-mistake-row.is-sentence > b {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .word-detail-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .word-detail-dialog::backdrop {
    backdrop-filter: none;
  }

  .word-detail-shell {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .word-detail-header {
    min-height: 58px;
    padding: 9px 12px;
  }

  .word-detail-hero {
    grid-template-columns: 1fr;
    gap: 15px;
    min-height: 0;
    padding: 22px 16px;
  }

  .word-detail-character-row > strong {
    font-size: 58px;
  }

  .word-detail-identity > p {
    margin-top: 9px;
    font-size: 17px;
  }

  .word-detail-meaning {
    font-size: 16px;
  }

  .word-detail-metrics {
    margin-inline: 14px;
  }

  .word-detail-metrics > div {
    padding: 11px 9px;
  }

  .word-detail-metrics dt {
    font-size: 8px;
  }

  .word-detail-metrics dd {
    font-size: 11px;
  }

  .word-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 15px 14px 4px;
  }

  .word-detail-actions .secondary-btn,
  .word-detail-actions .ghost-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    font-size: 11px;
  }

  .word-detail-section {
    margin-inline: 14px;
    padding-block: 20px;
  }

  .word-detail-example {
    padding: 14px 42px 14px 0;
  }

  .word-detail-example-zh {
    font-size: 20px;
  }
}

@media (pointer: coarse) {
  .shortcut-hint {
    display: none;
  }

  .shortcut-btn {
    gap: 0;
  }
}

body[data-tool="exam"] {
  --theme: #16705d;
  --theme-hover: #115949;
  --theme-soft: #eef9f5;
  --theme-border: #a9d9cc;
  --theme-focus: rgba(22, 112, 93, 0.18);
  --theme-wash: rgba(22, 112, 93, 0.08);
  --theme-rule: rgba(22, 112, 93, 0.12);
}

body[data-tool="exam"] .tool-controls {
  display: none;
}

.hsk-exam-home,
.hsk-exam-ready,
.hsk-exam-results,
.hsk-speaking-preparation,
.hsk-speaking-session {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px;
}

.hsk-exam-home-header,
.hsk-exam-results-header,
.hsk-speaking-preparation > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.hsk-exam-home-header > div,
.hsk-exam-results-header > div:first-child,
.hsk-speaking-preparation > header > div:first-child {
  max-width: 720px;
}

.hsk-exam-kicker,
.hsk-exam-level-copy > span,
.hsk-exam-session-identity > span,
.hsk-speaking-open-prompt > span {
  display: block;
  margin-bottom: 7px;
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-home-header h2,
.hsk-exam-ready-main h2,
.hsk-exam-results-header h2,
.hsk-speaking-preparation h2 {
  font-size: 31px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hsk-exam-home-header p,
.hsk-exam-ready-main > p,
.hsk-exam-results-header p,
.hsk-speaking-preparation header p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.55;
}

.hsk-exam-source-link,
.hsk-exam-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.hsk-exam-source-link:hover,
.hsk-exam-back:hover {
  color: var(--theme);
}

.hsk-exam-resume {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 15px;
  margin: 22px 0;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  padding: 13px;
}

.hsk-exam-resume-icon,
.hsk-exam-level-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--theme);
  color: white;
  font-size: 23px;
  font-weight: 900;
}

.hsk-exam-resume > div:nth-child(2) span,
.hsk-exam-resume > div:nth-child(2) strong,
.hsk-exam-resume > div:nth-child(2) p {
  display: block;
}

.hsk-exam-resume > div:nth-child(2) span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-resume > div:nth-child(2) strong {
  margin-top: 2px;
  font-size: 16px;
}

.hsk-exam-resume > div:nth-child(2) p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hsk-exam-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hsk-exam-level-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-content: start;
  gap: 18px 14px;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 20px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.hsk-exam-level-card:hover {
  border-color: var(--theme-border);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.hsk-exam-level-copy h3 {
  font-size: 21px;
  line-height: 1.15;
}

.hsk-exam-level-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.hsk-exam-level-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hsk-exam-level-meta > div {
  padding: 14px 8px 14px 0;
}

.hsk-exam-level-meta > div + div {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.hsk-exam-level-meta dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-level-meta dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 820;
}

.hsk-exam-level-history {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 3px 12px;
}

.hsk-exam-level-history > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-level-history > strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--theme);
  font-size: 18px;
}

.hsk-exam-level-history > small {
  color: var(--muted);
  font-size: 11px;
}

.hsk-exam-level-history.is-empty > strong {
  color: var(--muted-strong);
  font-size: 13px;
}

.hsk-exam-level-action {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-inline: 14px;
}

.hsk-exam-notice {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.hsk-exam-notice strong {
  font-size: 13px;
}

.hsk-exam-notice p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hsk-exam-ready > .hsk-exam-back {
  margin-bottom: 18px;
}

.hsk-exam-ready-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.65fr);
  gap: 36px;
}

.hsk-exam-mode-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 4px;
}

.hsk-exam-mode-switcher button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
}

.hsk-exam-mode-switcher button.active {
  background: var(--surface);
  color: var(--theme);
  box-shadow: 0 1px 6px rgba(16, 24, 40, 0.08);
}

.hsk-exam-blueprint {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.hsk-exam-blueprint-row {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) auto minmax(110px, auto);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.hsk-exam-blueprint-row > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--theme-soft);
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
}

.hsk-exam-blueprint-row small,
.hsk-exam-blueprint-row b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hsk-exam-start-panel {
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.hsk-exam-start-time {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hsk-exam-start-time span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-start-time strong {
  margin-top: 5px;
  font-size: 44px;
  line-height: 1;
}

.hsk-exam-start-time small {
  color: var(--muted);
  padding-bottom: 4px;
  font-size: 12px;
}

.hsk-exam-start-panel ul {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.hsk-exam-audio-test,
.hsk-exam-start {
  width: 100%;
}

.hsk-exam-audio-test {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hsk-exam-start-panel > p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.hsk-exam-session-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
  overflow: clip;
}

.hsk-exam-session-header {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.hsk-exam-session-identity > strong {
  display: block;
  font-size: 17px;
}

.hsk-exam-session-progress > span,
.hsk-exam-session-clock > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-session-progress .progress-track {
  height: 5px;
  margin-top: 8px;
}

.hsk-exam-session-clock {
  min-width: 108px;
  text-align: right;
}

.hsk-exam-session-clock strong {
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  line-height: 1;
}

.hsk-exam-session-clock.is-urgent strong {
  color: var(--red);
}

.hsk-exam-session-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 590px;
}

.hsk-exam-navigator {
  border-right: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 16px;
}

.hsk-exam-nav-legend {
  display: flex;
  gap: 12px;
  padding-bottom: 13px;
  color: var(--muted);
  font-size: 10px;
}

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

.hsk-exam-nav-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--theme-soft);
  box-shadow: inset 0 0 0 1px var(--theme-border);
}

.hsk-exam-nav-legend span:last-child i {
  background: #fff5e8;
  box-shadow: inset 0 0 0 1px #e8ad62;
}

.hsk-exam-nav-section + .hsk-exam-nav-section {
  margin-top: 18px;
}

.hsk-exam-nav-section header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}

.hsk-exam-nav-section header span {
  color: var(--muted);
}

.hsk-exam-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 32px);
  gap: 5px;
}

.hsk-exam-nav-grid button {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0;
  font-size: 10px;
  font-weight: 800;
}

.hsk-exam-nav-grid button.is-answered {
  border-color: var(--theme-border);
  background: var(--theme-soft);
  color: var(--theme);
}

.hsk-exam-nav-grid button.is-flagged::after {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: #d97706;
  content: "";
}

.hsk-exam-nav-grid button.is-current {
  border-color: var(--theme);
  background: var(--theme);
  color: white;
  box-shadow: 0 0 0 2px var(--theme-focus);
}

.hsk-exam-question-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 590px;
  padding: 24px 28px;
}

.hsk-exam-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hsk-exam-question-header > div span,
.hsk-exam-question-header > div strong {
  display: block;
}

.hsk-exam-question-header > div span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-question-header > div strong {
  margin-top: 4px;
  font-size: 16px;
}

.hsk-exam-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0 11px;
  font-size: 11px;
  font-weight: 760;
}

.hsk-exam-flag .button-icon {
  width: 15px;
  height: 15px;
}

.hsk-exam-flag.is-active {
  border-color: #e8ad62;
  background: #fff8ed;
  color: #a15c05;
}

.hsk-exam-instruction {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.hsk-exam-audio-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-soft);
  padding: 12px;
}

.hsk-exam-play-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--theme);
  color: white;
  padding: 0 14px;
  font-weight: 820;
}

.hsk-exam-play-audio .button-icon {
  width: 18px;
  height: 18px;
}

.hsk-exam-audio-prompt > span {
  color: var(--muted);
  font-size: 11px;
}

.hsk-exam-audio-prompt > i {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.hsk-exam-audio-prompt > i.active {
  background: var(--theme);
  box-shadow: 0 0 0 5px var(--theme-focus);
}

.hsk-exam-hidden-prompt {
  margin-top: 26px;
  font-size: 23px;
  letter-spacing: 0;
}

.hsk-exam-chinese-copy {
  margin-top: 26px;
}

.hsk-exam-chinese-copy > p,
.hsk-exam-chinese-copy .annotated-hanzi-line {
  font-size: 23px;
  line-height: 1.45;
}

.hsk-exam-chinese-copy .annotated-pinyin-line {
  margin-top: 3px;
  font-size: 12px;
}

.hsk-exam-chinese-copy.is-compact {
  margin-top: 0;
}

.hsk-exam-chinese-copy.is-compact > p,
.hsk-exam-chinese-copy.is-compact .annotated-hanzi-line {
  font-size: 16px;
}

.hsk-exam-chinese-copy.is-compact .annotated-pinyin-line {
  font-size: 9px;
}

.hsk-exam-choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.hsk-exam-choice-grid.has-scenes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hsk-exam-choice {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.hsk-exam-choice:hover {
  border-color: var(--theme-border);
  background: var(--theme-soft);
}

.hsk-exam-choice.is-selected {
  border-color: var(--theme);
  background: var(--theme-soft);
  box-shadow: 0 0 0 2px var(--theme-focus);
}

.hsk-exam-choice-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.hsk-exam-choice.is-selected .hsk-exam-choice-key {
  border-color: var(--theme);
  background: var(--theme);
  color: white;
}

.hsk-exam-choice.is-scene {
  grid-template-columns: minmax(0, 1fr);
  aspect-ratio: 1.28;
  padding: 8px;
}

.hsk-exam-choice.is-scene .hsk-exam-choice-key {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 9px;
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.12);
}

.hsk-exam-choice.is-scene .hsk-exam-scene {
  justify-self: center;
  width: auto;
  max-width: 100%;
  height: 100%;
}

.hsk-exam-scene {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background-image: var(--hsk-scene-image);
  background-position: var(--hsk-scene-x) var(--hsk-scene-y);
  background-size: 400% 400%;
  background-repeat: no-repeat;
}

.hsk-exam-scene.is-large {
  width: min(330px, 100%);
}

.hsk-exam-writing-scene,
.hsk-speaking-picture-prompt {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.hsk-exam-pinyin-hint {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.hsk-exam-pinyin-hint span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-pinyin-hint strong {
  font-size: 18px;
}

.hsk-exam-reorder,
.hsk-exam-text-answer {
  margin-top: 24px;
}

.hsk-exam-reorder-answer,
.hsk-exam-word-bank {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.hsk-exam-reorder-answer {
  border-color: var(--theme-border);
  background: var(--theme-soft);
}

.hsk-exam-reorder-answer > span {
  color: var(--muted);
  font-size: 12px;
}

.hsk-exam-word-bank {
  margin-top: 10px;
}

.hsk-exam-word-tile {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-family: var(--chinese-font);
  font-size: 16px;
  font-weight: 700;
}

.hsk-exam-word-tile.is-selected {
  border-color: var(--theme-border);
  background: var(--surface);
}

.hsk-exam-clear-answer {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 0;
  font-size: 11px;
  font-weight: 750;
}

.hsk-exam-text-answer {
  display: grid;
  gap: 8px;
}

.hsk-exam-text-answer > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-text-answer input,
.hsk-exam-text-answer textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  font-size: 18px;
}

.hsk-exam-text-answer textarea {
  min-height: 120px;
  resize: vertical;
}

.hsk-exam-question-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 30px;
}

.hsk-exam-question-actions > span,
.hsk-speaking-actions > span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.hsk-exam-results-header {
  align-items: center;
}

.hsk-exam-score-ring,
.hsk-speaking-result-count {
  flex: 0 0 auto;
  min-width: 155px;
  border-left: 3px solid var(--theme);
  padding: 8px 0 8px 20px;
}

.hsk-exam-score-ring span,
.hsk-exam-score-ring strong,
.hsk-exam-score-ring small,
.hsk-speaking-result-count span,
.hsk-speaking-result-count strong,
.hsk-speaking-result-count small {
  display: block;
}

.hsk-exam-score-ring span,
.hsk-speaking-result-count span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-score-ring strong,
.hsk-speaking-result-count strong {
  margin-top: 3px;
  font-size: 38px;
  line-height: 1;
}

.hsk-exam-score-ring small,
.hsk-speaking-result-count small {
  margin-top: 3px;
  color: var(--muted);
}

.hsk-exam-result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hsk-exam-result-summary > div {
  padding: 16px 14px 16px 0;
}

.hsk-exam-result-summary > div + div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.hsk-exam-result-summary span,
.hsk-exam-result-summary strong {
  display: block;
}

.hsk-exam-result-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-result-summary strong {
  margin-top: 5px;
  font-size: 21px;
}

.hsk-exam-coach {
  margin: 30px -30px 0;
  border-top: 1px solid var(--theme-border);
  border-bottom: 1px solid var(--theme-border);
  background: #f6fbf9;
  padding: 26px 30px 0;
}

.hsk-exam-coach > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
}

.hsk-exam-coach > header > div:first-child {
  max-width: 720px;
}

.hsk-exam-coach h3 {
  font-size: 23px;
}

.hsk-exam-coach > header p {
  margin-top: 7px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.hsk-exam-attempt-trend {
  flex: 0 0 210px;
  border-left: 3px solid var(--theme);
  padding: 5px 0 5px 18px;
}

.hsk-exam-attempt-trend span,
.hsk-exam-attempt-trend strong,
.hsk-exam-attempt-trend small {
  display: block;
}

.hsk-exam-attempt-trend span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-attempt-trend strong {
  margin-top: 4px;
  font-size: 25px;
}

.hsk-exam-attempt-trend small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.hsk-exam-coach.is-personal-best .hsk-exam-attempt-trend {
  animation: hsk-personal-best-in 420ms ease-out both;
}

@keyframes hsk-personal-best-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hsk-exam-coach-priorities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--theme-border);
}

.hsk-exam-coach-priorities > article {
  display: flex;
  min-width: 0;
  min-height: 205px;
  flex-direction: column;
  padding: 22px 22px 22px 0;
}

.hsk-exam-coach-priorities > article + article {
  border-left: 1px solid var(--theme-border);
  padding-left: 22px;
}

.hsk-exam-coach-priorities article > span {
  color: var(--theme);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-exam-coach-priorities h4 {
  margin-top: 7px;
  font-size: 16px;
}

.hsk-exam-coach-priorities p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hsk-exam-coach-action {
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--theme);
  padding: 12px 0 0;
  font-size: 12px;
  font-weight: 850;
}

.hsk-exam-coach-action:hover {
  color: var(--theme-hover);
}

.hsk-exam-section-results,
.hsk-exam-review,
.hsk-speaking-review {
  margin-top: 30px;
}

.hsk-exam-results-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.hsk-exam-results-section-heading h3 {
  font-size: 18px;
}

.hsk-exam-results-section-heading p,
.hsk-exam-results-section-heading > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hsk-exam-section-result-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(100px, 0.8fr) minmax(160px, 1.4fr) 70px;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  border-top: 1px solid var(--line);
}

.hsk-exam-section-result-row span,
.hsk-exam-section-result-row b {
  color: var(--muted);
  font-size: 12px;
}

.hsk-exam-section-result-row b {
  color: var(--ink);
  text-align: right;
}

.hsk-exam-part-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0 0 12px;
}

.hsk-exam-part-results > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.hsk-exam-part-results b {
  color: var(--muted-strong);
}

.hsk-exam-review-list {
  border-top: 1px solid var(--line);
}

.hsk-exam-review-item {
  border-bottom: 1px solid var(--line);
}

.hsk-exam-review-item > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
}

.hsk-exam-review-item > summary::-webkit-details-marker {
  display: none;
}

.hsk-exam-review-item > summary > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fff2f3;
  color: var(--red);
  font-size: 10px;
  font-weight: 850;
}

.hsk-exam-review-item.is-correct > summary > span {
  background: var(--theme-soft);
  color: var(--theme);
}

.hsk-exam-review-item > summary > b {
  color: var(--red);
  font-size: 11px;
}

.hsk-exam-review-item.is-correct > summary > b {
  color: var(--theme);
}

.hsk-exam-review-body {
  padding: 0 0 18px 46px;
}

.hsk-exam-review-body .hsk-exam-chinese-copy {
  margin-top: 0;
}

.hsk-exam-review-body dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.hsk-exam-review-body dl > div {
  border-left: 2px solid var(--line);
  padding-left: 10px;
}

.hsk-exam-review-body dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-exam-review-body dd {
  margin: 4px 0 0;
  font-size: 13px;
}

.hsk-exam-review-body > p,
.hsk-exam-score-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.hsk-exam-coach-note {
  margin-top: 14px;
  border-left: 2px solid var(--theme);
  background: var(--theme-soft);
  padding: 10px 12px;
}

.hsk-exam-coach-note strong {
  color: var(--theme);
  font-size: 9px;
  text-transform: uppercase;
}

.hsk-exam-coach-note p {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.hsk-exam-score-note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.hsk-speaking-preparation > header {
  align-items: center;
}

.hsk-speaking-prep-clock {
  flex: 0 0 auto;
  min-width: 145px;
  border-left: 3px solid var(--theme);
  padding-left: 18px;
}

.hsk-speaking-prep-clock span,
.hsk-speaking-prep-clock strong,
.hsk-speaking-prep-clock small {
  display: block;
}

.hsk-speaking-prep-clock span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-speaking-prep-clock strong {
  margin-top: 3px;
  font-size: 31px;
  font-variant-numeric: tabular-nums;
}

.hsk-speaking-prep-clock small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.hsk-speaking-prep-pictures {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.hsk-speaking-prep-pictures > div {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}

.hsk-speaking-prep-pictures > div > span {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 9px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  font-size: 10px;
  font-weight: 850;
}

.hsk-speaking-prep-responses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hsk-speaking-prep-responses > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.hsk-speaking-prep-responses span {
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
}

.hsk-speaking-prep-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.hsk-speaking-prep-actions p {
  color: var(--muted);
  font-size: 12px;
}

.hsk-speaking-session {
  padding: 0;
  overflow: clip;
}

.hsk-speaking-question-panel {
  display: grid;
  justify-items: stretch;
  min-height: 600px;
  padding: 30px;
}

.hsk-speaking-question-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 14px;
}

.hsk-speaking-question-meta > span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.hsk-speaking-question-meta > strong {
  grid-column: 1;
}

.hsk-speaking-question-meta > b {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 12px;
}

.hsk-speaking-repeat-prompt,
.hsk-speaking-open-prompt {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 220px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.hsk-speaking-repeat-prompt > span {
  margin-bottom: 18px;
  color: var(--muted);
}

.hsk-speaking-open-prompt h2,
.hsk-speaking-question-panel > h2 {
  margin-top: 14px;
  font-size: 24px;
  letter-spacing: 0;
  text-align: center;
}

.hsk-speaking-picture-prompt .hsk-exam-scene {
  width: min(260px, 100%);
}

.hsk-speaking-recorder {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

.hsk-speaking-recorder.is-recording {
  border-color: #f0a8af;
  background: #fff7f7;
}

.hsk-speaking-recorder-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hsk-speaking-recorder-status > i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
}

.hsk-speaking-recorder.is-recording .hsk-speaking-recorder-status > i {
  background: var(--red);
  animation: hsk-recording-pulse 1.2s ease-in-out infinite;
}

@keyframes hsk-recording-pulse {
  50% { box-shadow: 0 0 0 7px rgba(199, 25, 36, 0.12); }
}

.hsk-speaking-recorder-status span,
.hsk-speaking-recorder-status strong {
  display: block;
}

.hsk-speaking-recorder-status span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hsk-speaking-recorder-status strong {
  margin-top: 3px;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.hsk-speaking-recorder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.hsk-speaking-recorder-actions audio {
  width: min(320px, 100%);
  height: 40px;
}

.hsk-speaking-microphone-error {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 12px;
}

.primary-btn.is-danger {
  border-color: var(--red);
  background: var(--red);
}

.hsk-speaking-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}

.hsk-speaking-review-list {
  border-top: 1px solid var(--line);
}

.hsk-speaking-review-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(220px, 320px);
  align-items: center;
  gap: 14px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.hsk-speaking-review-item > span {
  color: var(--theme);
  font-size: 11px;
  font-weight: 850;
}

.hsk-speaking-review-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hsk-speaking-review-item audio {
  width: 100%;
  height: 38px;
}

.hsk-speaking-review-item > b {
  color: var(--red);
  font-size: 11px;
  text-align: right;
}

@media (min-width: 981px) {
  body[data-tool="exam"] .workspace {
    padding-top: 28px;
  }
}

@media (max-width: 980px) {
  .hsk-exam-level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-exam-level-card:last-child {
    grid-column: 1 / -1;
  }

  .hsk-exam-session-layout {
    grid-template-columns: 1fr;
  }

  .hsk-exam-navigator {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    padding: 12px 14px;
    scrollbar-width: thin;
  }

  .hsk-exam-nav-legend {
    display: none;
  }

  .hsk-exam-nav-section {
    flex: 0 0 auto;
  }

  .hsk-exam-nav-section + .hsk-exam-nav-section {
    margin-top: 0;
  }

  .hsk-exam-nav-grid {
    display: flex;
  }

  .hsk-exam-question-panel {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .hsk-exam-home,
  .hsk-exam-ready,
  .hsk-exam-results,
  .hsk-speaking-preparation {
    padding: 18px;
  }

  .hsk-exam-home-header,
  .hsk-exam-results-header,
  .hsk-speaking-preparation > header {
    display: grid;
    gap: 14px;
  }

  .hsk-exam-coach {
    margin: 26px -18px 0;
    padding: 22px 18px 0;
  }

  .hsk-exam-coach > header {
    display: grid;
    gap: 18px;
  }

  .hsk-exam-attempt-trend {
    width: 100%;
  }

  .hsk-exam-coach-priorities {
    grid-template-columns: 1fr;
  }

  .hsk-exam-coach-priorities > article {
    min-height: 0;
    padding: 18px 0;
  }

  .hsk-exam-coach-priorities > article + article {
    border-top: 1px solid var(--theme-border);
    border-left: 0;
    padding-left: 0;
  }

  .hsk-exam-coach-action {
    margin-top: 8px;
  }

  .hsk-exam-home-header h2,
  .hsk-exam-ready-main h2,
  .hsk-exam-results-header h2,
  .hsk-speaking-preparation h2 {
    font-size: 26px;
  }

  .hsk-exam-level-grid {
    grid-template-columns: 1fr;
  }

  .hsk-exam-level-card:last-child {
    grid-column: auto;
  }

  .hsk-exam-level-card {
    min-height: 0;
  }

  .hsk-exam-resume {
    grid-template-columns: 44px minmax(0, 1fr) 40px;
  }

  .hsk-exam-resume .primary-btn {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hsk-exam-resume .icon-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .hsk-exam-notice {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hsk-exam-ready-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hsk-exam-start-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 22px;
    padding-left: 0;
  }

  .hsk-exam-blueprint-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .hsk-exam-blueprint-row b {
    display: none;
  }

  .hsk-exam-session-header,
  .hsk-speaking-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 11px 12px;
  }

  .hsk-exam-session-identity > span {
    display: none;
  }

  .hsk-exam-session-identity > strong {
    font-size: 14px;
  }

  .hsk-exam-session-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hsk-exam-session-clock {
    grid-column: 2;
    grid-row: 1;
  }

  .hsk-exam-session-clock strong {
    font-size: 19px;
  }

  .hsk-exam-finish {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 36px;
  }

  .hsk-exam-question-panel {
    min-height: 530px;
    padding: 18px 14px;
  }

  .hsk-exam-question-header {
    align-items: flex-start;
  }

  .hsk-exam-flag {
    width: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .hsk-exam-choice-grid.has-scenes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-exam-choice.is-scene {
    aspect-ratio: 1.1;
  }

  .hsk-exam-chinese-copy > p,
  .hsk-exam-chinese-copy .annotated-hanzi-line {
    font-size: 20px;
  }

  .hsk-exam-question-actions,
  .hsk-speaking-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-exam-question-actions > span,
  .hsk-speaking-actions > span {
    display: none;
  }

  .hsk-exam-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-exam-result-summary > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }

  .hsk-exam-result-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .hsk-exam-section-result-row {
    grid-template-columns: minmax(80px, 1fr) auto;
    gap: 5px 12px;
    padding: 11px 0;
  }

  .hsk-exam-section-result-row .progress-track {
    grid-column: 1;
  }

  .hsk-exam-section-result-row b {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .hsk-exam-review-body {
    padding-left: 0;
  }

  .hsk-exam-review-body dl {
    grid-template-columns: 1fr;
  }

  .hsk-speaking-prep-pictures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hsk-speaking-prep-responses {
    grid-template-columns: 1fr;
  }

  .hsk-speaking-prep-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hsk-speaking-question-panel {
    min-height: 540px;
    padding: 18px 14px;
  }

  .hsk-speaking-recorder {
    grid-template-columns: 1fr;
  }

  .hsk-speaking-recorder-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hsk-speaking-recorder-actions audio {
    width: 100%;
  }

  .hsk-speaking-review-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .hsk-speaking-review-item audio,
  .hsk-speaking-review-item > b {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .hsk-exam-level-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-exam-level-meta > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-left: 0;
  }

  .hsk-exam-mode-switcher {
    display: grid;
    width: 100%;
  }

  .hsk-exam-audio-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  .hsk-exam-audio-prompt > i {
    display: none;
  }

  .hsk-speaking-prep-pictures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hsk-exam-coach.is-personal-best .hsk-exam-attempt-trend,
  .hsk-speaking-recorder.is-recording .hsk-speaking-recorder-status > i {
    animation: none;
  }
}

/* Account and Premium */
.account-dialog {
  width: min(520px, calc(100% - 28px));
  max-width: none;
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
}

.account-dialog::backdrop {
  background: rgba(16, 24, 40, 0.48);
  backdrop-filter: blur(4px);
}

.account-dialog-shell {
  padding: 24px;
}

.account-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.account-dialog-header h2 {
  font-size: 24px;
  line-height: 1.15;
}

.account-dialog-header p {
  max-width: 400px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-dialog-close {
  width: 40px;
  height: 40px;
}

.account-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 3px;
}

.account-auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.account-auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.account-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.account-form label {
  display: grid;
  gap: 7px;
}

.account-form label > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 820;
}

.account-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 16px;
}

.account-form input:focus {
  outline: 3px solid var(--theme-focus);
  border-color: var(--theme);
}

.account-submit,
.premium-checkout {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.account-form-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--theme);
  padding: 6px;
  font-size: 12px;
  font-weight: 800;
}

.account-message {
  margin-top: 16px;
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  background: var(--theme-soft);
  color: var(--muted-strong);
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.account-message.is-error {
  border-color: #f0b6bd;
  background: #fff4f5;
  color: #a5192a;
}

.account-message.is-success {
  border-color: #a9dcc9;
  background: #eefaf5;
  color: #0f684f;
}

.account-plan {
  margin-top: 20px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-strong);
  padding: 16px;
}

.account-plan.is-premium {
  border-left-color: #b1872c;
  background: #fffaf0;
}

.account-plan-heading {
  display: grid;
  gap: 4px;
}

.account-plan-heading span {
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.account-plan-heading strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.account-plan p,
.account-security-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-action-stack {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.account-action-stack button {
  width: 100%;
  min-height: 44px;
}

.premium-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0;
}

.premium-price strong {
  font-size: 27px;
}

.premium-price span {
  max-width: 190px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.premium-comparison {
  border-top: 1px solid var(--line);
}

.premium-comparison > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.premium-comparison span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.premium-comparison strong {
  font-size: 13px;
  text-align: right;
}

.premium-checkout {
  margin-top: 20px;
}

.premium-account-back {
  display: block;
  margin: 10px auto 0;
}

/* Graded readers */
body[data-tool="reader"] .workspace {
  padding-top: 28px;
}

.reader-home,
.reader-detail,
.reader-quiz,
.reader-results {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px;
}

.reader-home-header,
.reader-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.reader-home-header > div:first-child {
  max-width: 720px;
}

.reader-kicker,
.reader-level-label,
.reader-quiz-kicker,
.reader-results-header > div:first-child > span {
  display: block;
  margin-bottom: 7px;
  color: var(--theme);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.reader-home-header h2 {
  font-size: 31px;
  line-height: 1.15;
}

.reader-home-header p,
.reader-story-header > p:last-child {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.55;
}

.reader-access-summary {
  min-width: 180px;
  border-left: 3px solid var(--line-strong);
  padding: 8px 0 8px 14px;
}

.reader-access-summary.is-premium {
  border-left-color: #b1872c;
}

.reader-access-summary span,
.reader-access-summary strong {
  display: block;
}

.reader-access-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.reader-access-summary strong {
  margin-top: 4px;
  font-size: 14px;
}

.reader-level-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 3px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 3px;
}

.reader-level-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 820;
}

.reader-level-tabs button.active {
  background: var(--surface);
  color: var(--theme);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.reader-tab-lock,
.reader-premium-badge,
.reader-complete-badge {
  border: 1px solid #d7b66f;
  border-radius: 5px;
  background: #fff9e8;
  color: #76520d;
  padding: 3px 5px;
  font-size: 8px;
  line-height: 1;
  font-weight: 850;
  text-transform: uppercase;
}

.reader-complete-badge {
  border-color: #a9dcc9;
  background: #eefaf5;
  color: #0f684f;
}

.reader-level-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  border-left: 3px solid #b1872c;
  background: #fffaf0;
  padding: 12px 14px;
}

.reader-level-notice div {
  display: grid;
  gap: 3px;
}

.reader-level-notice span {
  color: var(--muted);
  font-size: 12px;
}

.reader-level-notice button {
  min-height: 38px;
  white-space: nowrap;
}

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

.reader-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 18px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.reader-card:hover {
  border-color: var(--theme-border);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.reader-card.is-locked {
  background: #fafafa;
}

.reader-card-level {
  display: grid;
  place-items: center;
  align-content: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--theme);
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.reader-card.is-locked .reader-card-level {
  background: #667085;
}

.reader-card-level span {
  font-size: 8px;
  font-weight: 850;
}

.reader-card-copy {
  min-width: 0;
}

.reader-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.reader-card-heading h3 {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 21px;
  line-height: 1.2;
}

.reader-card-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reader-card-summary {
  margin-top: 13px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.5;
}

.reader-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.reader-card-action {
  grid-column: 1 / -1;
  align-self: end;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
}

.reader-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  padding: 8px 0;
  font-size: 12px;
  font-weight: 780;
}

.reader-back:hover {
  color: var(--theme);
}

.reader-detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.reader-detail-actions .ghost-btn,
.reader-toggle {
  min-height: 38px;
}

.reader-toggle {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
}

.reader-toggle.active {
  border-color: var(--theme-border);
  background: var(--theme-soft);
  color: var(--theme);
}

.reader-story-header {
  max-width: 760px;
  margin: 34px auto 28px;
  text-align: center;
}

.reader-story-header h2 {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 38px;
  line-height: 1.2;
}

.reader-story-title-pinyin {
  margin-top: 7px;
  font-size: 15px;
}

.reader-story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 34px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.reader-story {
  min-width: 0;
}

.reader-sentence {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 38px;
  gap: 12px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.reader-sentence-number {
  color: var(--muted);
  padding-top: 4px;
  font-size: 10px;
  font-weight: 800;
}

.reader-sentence-zh {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  line-height: 1.75;
  letter-spacing: 0;
}

.reader-sentence-pinyin {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.55;
}

.reader-sentence-translation {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reader-vocabulary {
  border-left: 1px solid var(--line);
  padding: 18px 0 0 24px;
}

.reader-vocabulary > span {
  color: var(--theme);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.reader-vocabulary h3 {
  margin-top: 4px;
  font-size: 17px;
}

.reader-vocabulary ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.reader-vocabulary li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.reader-vocabulary li > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reader-vocabulary li strong {
  font-size: 17px;
}

.reader-vocabulary li span,
.reader-vocabulary li p {
  color: var(--muted);
  font-size: 11px;
}

.reader-vocabulary li p {
  grid-column: 1;
}

.reader-vocabulary .icon-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
}

.reader-story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.reader-story-footer > div {
  display: grid;
  gap: 4px;
}

.reader-story-footer span {
  color: var(--muted);
  font-size: 12px;
}

.reader-quiz {
  max-width: 920px;
}

.reader-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.reader-quiz-header > div {
  display: grid;
  gap: 3px;
}

.reader-quiz-header span {
  color: var(--muted);
  font-size: 11px;
}

.reader-quiz-header strong {
  font-size: 14px;
}

.reader-quiz-panel {
  max-width: 700px;
  margin: 44px auto 10px;
}

.reader-quiz-panel h2 {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  line-height: 1.45;
}

.reader-choice-list {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.reader-choice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  text-align: left;
}

.reader-choice:not(:disabled):hover {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.reader-choice > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--theme);
  font-size: 12px;
  font-weight: 850;
}

.reader-choice strong {
  font-size: 16px;
  font-weight: 720;
}

.reader-choice.is-selected:not(.is-correct) {
  border-color: #e9a7b0;
  background: #fff5f6;
}

.reader-choice.is-correct {
  border-color: #7fc9ad;
  background: #eefaf5;
}

.reader-answer-feedback {
  margin-top: 18px;
  border-left: 3px solid #c71924;
  background: #fff5f6;
  padding: 12px 14px;
}

.reader-answer-feedback.is-correct {
  border-left-color: #198a5a;
  background: #eefaf5;
}

.reader-answer-feedback p {
  margin-top: 3px;
  color: var(--muted-strong);
  font-size: 13px;
}

.reader-next {
  margin-top: 16px;
}

.reader-keyboard-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.reader-results {
  max-width: 920px;
}

.reader-results-header h2 {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 30px;
}

.reader-results-header p {
  margin-top: 5px;
  color: var(--muted);
}

.reader-result-score {
  display: grid;
  min-width: 130px;
  border-left: 3px solid var(--theme);
  padding-left: 18px;
}

.reader-result-score strong {
  font-size: 29px;
}

.reader-result-score span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.reader-result-list {
  margin-top: 20px;
}

.reader-result-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.reader-result-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.reader-result-row > div > strong {
  font-size: 16px;
}

.reader-result-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.reader-result-row > b {
  color: #b42336;
  font-size: 11px;
}

.reader-result-row.is-correct > b {
  color: #147d64;
}

.reader-results-actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.hsk-exam-level-card.is-locked {
  background: #fafafa;
}

.hsk-exam-level-card.is-locked .hsk-exam-level-mark {
  background: #667085;
}

.hsk-exam-level-card.is-locked .hsk-exam-level-history {
  opacity: 0.72;
}

@media (max-width: 980px) {
  .brand-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-actions {
    display: flex;
  }

  .global-search-trigger,
  .account-trigger {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .account-trigger-label,
  .account-trigger-badge {
    display: none;
  }

  .reader-story-layout {
    grid-template-columns: 1fr;
  }

  .reader-vocabulary {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 22px 0 0;
  }

  .reader-vocabulary ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }
}

@media (max-width: 720px) {
  body[data-tool="reader"] .workspace {
    padding-top: 12px;
  }

  .account-dialog {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
  }

  .account-dialog::backdrop {
    backdrop-filter: none;
  }

  .account-dialog-shell {
    padding: 18px;
  }

  .premium-price {
    align-items: flex-start;
    flex-direction: column;
  }

  .premium-price span {
    max-width: none;
    text-align: left;
  }

  .premium-comparison > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .premium-comparison strong {
    text-align: left;
  }

  .reader-home,
  .reader-detail,
  .reader-quiz,
  .reader-results {
    padding: 18px;
  }

  .reader-home-header,
  .reader-results-header {
    display: grid;
    gap: 14px;
  }

  .reader-home-header h2 {
    font-size: 26px;
  }

  .reader-access-summary {
    min-width: 0;
  }

  .reader-level-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .reader-level-tabs button {
    padding: 0 5px;
  }

  .reader-tab-lock {
    display: none;
  }

  .reader-level-notice {
    align-items: stretch;
    flex-direction: column;
  }

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

  .reader-card {
    min-height: 0;
  }

  .reader-detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-detail-actions button {
    min-width: 0;
    padding-inline: 6px;
  }

  .reader-story-header {
    margin-top: 26px;
    text-align: left;
  }

  .reader-story-header h2 {
    font-size: 31px;
  }

  .reader-sentence {
    grid-template-columns: 22px minmax(0, 1fr) 36px;
    gap: 7px;
  }

  .reader-sentence-zh {
    font-size: 20px;
  }

  .reader-vocabulary ul {
    grid-template-columns: 1fr;
  }

  .reader-story-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-quiz-header {
    align-items: flex-start;
  }

  .reader-quiz-panel {
    margin-top: 32px;
  }

  .reader-quiz-panel h2 {
    font-size: 24px;
  }

  .reader-choice {
    min-height: 54px;
  }

  .reader-results-actions {
    display: grid;
  }

  .reader-result-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .reader-result-row > b {
    grid-column: 2;
  }
}
