@font-face {
  font-family: "Smiley Sans";
  src: url("../fonts/smiley-sans-oblique.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3 Vocab";
  src: url("../fonts/source-sans-3-vocab.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Han Sans SC Vocab";
  src: url("../fonts/source-han-sans-sc-regular-vocab.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Han Sans SC Vocab";
  src: url("../fonts/source-han-sans-sc-bold-vocab.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --paper: #f8f3eb;
  --paper-deep: #f3efe7;
  --surface: #fffdf8;
  --surface-soft: rgba(255, 253, 248, 0.72);
  --ink: #242115;
  --body: rgba(36, 33, 21, 0.82);
  --cn: rgba(36, 33, 21, 0.68);
  --muted: #8b8374;
  --muted-soft: #a69d8e;
  --olive: #625c3b;
  --olive-dark: #4d4830;
  --olive-soft: rgba(98, 92, 59, 0.12);
  --dark: #272619;
  --dark-soft: #393724;
  --sage: #dfe8d6;
  --amber: #efe2bf;
  --sand: #e8dec9;
  --aqua: #dfe8e6;
  --line: #e5dccd;
  --line-strong: rgba(98, 92, 59, 0.42);
  --relation-synonym-surface: #EEF4E9;
  --relation-synonym-border: #CBD8C1;
  --relation-antonym-surface: #FFF2DF;
  --relation-antonym-border: #E6C89A;
  --relation-confusable-surface: #EDF5F6;
  --relation-confusable-border: #C2D9DC;
  --relation-related-surface: #F4EFE5;
  --relation-related-border: #D9CEBA;
  --hairline: var(--line);
  --font-display: Georgia, "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, system-ui, sans-serif;
  --font-learning: "Source Sans 3 Vocab", "Source Han Sans SC Vocab", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --info: #586e75;
  --shadow: 0 16px 36px rgba(57, 49, 32, 0.1);
  --shadow-high: 0 28px 80px rgba(36, 33, 21, 0.22);
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

/* Author-level display rules (grid/flex cards and navigation links) must not
   override the platform's hidden state used by search, filters and paging. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: auto;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.56 var(--font-ui);
}

body[data-page="home"] {
  --muted: #746c60;
  --muted-soft: #746c60;
  background:
    linear-gradient(rgba(243, 239, 231, 0.58), rgba(243, 239, 231, 0.72)),
    url("../images/home-landscape-bg.webp") center top / cover fixed,
    var(--paper-deep);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(36, 33, 21, 0.014) 1px, transparent 1px),
    linear-gradient(rgba(36, 33, 21, 0.012) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.24), transparent 76%);
}

button,
input,
select {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(98, 92, 59, 0.3);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 5000;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--paper);
  text-decoration: none;
  font-weight: 850;
}

.skip-link:focus {
  top: 10px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 max(18px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 235, 0.93);
  backdrop-filter: blur(18px) saturate(1.06);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--olive-dark);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--olive);
  color: var(--paper);
  font: 800 14px/1 Georgia, serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.site-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a,
.top-action,
.pill-button,
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.top-action:hover,
.pill-button:hover,
.button.secondary:hover {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.82);
  color: var(--olive-dark);
}

.button.primary,
.pill-button.primary {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
  box-shadow: 0 8px 18px rgba(57, 49, 32, 0.14);
}

.button.primary:hover,
.pill-button.primary:hover {
  border-color: var(--olive-dark);
  background: var(--olive-dark);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.icon {
  width: 17px;
  height: 17px;
}

.search-input {
  width: min(300px, 38vw);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.84);
  padding: 8px 13px;
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(98, 92, 59, 0.15);
}

.search-input::placeholder {
  color: var(--muted-soft);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--olive);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 76px;
}

.home-shell {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 20px 70px;
}

.home-guide-link {
  position: fixed;
  top: 44px;
  left: 14px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--olive-dark);
  cursor: pointer;
}

.home-guide-label,
.home-guide-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(57, 49, 32, 0.12);
  backdrop-filter: blur(10px);
}

.home-guide-label {
  min-height: 44px;
  padding: 8px 15px;
  border-radius: 9px;
  background: var(--olive-dark);
  color: #fffdf8;
  font-size: 14px;
  font-weight: 900;
}

.home-guide-hint {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid rgba(98, 92, 59, 0.26);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  font-size: 12px;
  font-weight: 850;
}

.home-hero {
  position: relative;
  min-height: 322px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 34px 42px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.82), rgba(248, 243, 235, 0.64));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86), var(--shadow);
  backdrop-filter: blur(8px) saturate(1.04);
}

.home-family-collage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-family-collage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 253, 248, 0.9) 0%, rgba(255, 253, 248, 0.74) 38%, rgba(255, 253, 248, 0.3) 66%, rgba(255, 253, 248, 0.06) 100%);
}

.family-collage-card {
  position: absolute;
  width: 248px;
  border: 1px solid rgba(98, 92, 59, 0.22);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  box-shadow: 0 14px 38px rgba(57, 49, 32, 0.12);
  opacity: 0.56;
  filter: saturate(0.72) contrast(0.94) brightness(1.04);
}

.family-collage-effect { right: 396px; top: -72px; transform: rotate(-2deg); }
.family-collage-respond { right: 116px; top: -66px; transform: rotate(1.4deg); }
.family-collage-offer { right: 532px; top: 164px; transform: rotate(1.5deg); }
.family-collage-definite { right: 250px; top: 136px; transform: rotate(-1.4deg); }
.family-collage-receive { right: -30px; top: 160px; transform: rotate(2deg); }
.family-collage-serve { right: 682px; top: 74px; transform: rotate(-1deg); }

.home-hero-copy {
  position: relative;
  z-index: 2;
  width: min(650px, 100%);
}

.home-brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--olive-dark);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.home-hero h1 {
  margin: 0;
  color: var(--olive-dark);
  font: 850 clamp(40px, 5vw, 60px) / 1.03 "Smiley Sans", "Songti SC", serif;
  letter-spacing: -0.025em;
}

.home-hero p {
  margin: 0;
  color: var(--body);
}

.home-hero .home-feature-line {
  margin-top: 16px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.home-hero .home-note {
  max-width: 650px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.daily-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin: 16px 0 0;
  min-height: 238px;
  padding: 24px 26px 18px;
  border: 1px solid rgba(98, 92, 59, 0.22);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86), 0 16px 34px rgba(57, 49, 32, 0.1);
  backdrop-filter: blur(9px) saturate(1.04);
}

.daily-overview {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(270px, 1fr);
  gap: 7px 26px;
  align-items: center;
}

.daily-panel h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 24px;
}

.daily-panel p {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.daily-plan-summary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  display: grid;
  gap: 1px;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
}

.daily-plan-summary span,
.daily-plan-summary small {
  color: var(--muted);
  font-size: 12px;
}

.daily-plan-summary strong {
  color: var(--olive-dark);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.daily-help-link {
  grid-column: 1 / -1;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.daily-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.daily-actions .button {
  min-height: 48px;
  padding-inline: 17px;
}

.daily-actions .button.primary {
  min-height: 54px;
  padding-inline: 21px;
}

.daily-actions .button.secondary {
  min-height: 50px;
  padding-inline: 20px;
  border-color: rgba(98, 92, 59, 0.28);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 5px 14px rgba(57, 49, 32, 0.08);
  font-weight: 850;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.unit-card {
  position: relative;
  min-width: 0;
  min-height: 204px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.56);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px) saturate(1.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.unit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 68%, rgba(215, 221, 203, 0.62), transparent 46%), linear-gradient(135deg, rgba(255, 253, 248, 0), rgba(236, 226, 202, 0.28));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.unit-card:hover,
.unit-card:focus-within {
  transform: translateY(-5px);
  border-color: rgba(98, 92, 59, 0.58);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 20px 38px rgba(57, 49, 32, 0.15);
}

.unit-card:hover::before,
.unit-card:focus-within::before {
  opacity: 1;
}

.unit-card-overview {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.unit-card-overview:focus-visible {
  outline: 3px solid rgba(98, 92, 59, 0.3);
  outline-offset: -4px;
}

.unit-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.unit-focus-button {
  position: relative;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--olive-dark);
  cursor: pointer;
  pointer-events: auto;
}

.unit-focus-button img {
  width: 18px;
  height: 18px;
  opacity: 0.82;
}

.unit-focus-button[aria-pressed="true"] {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.unit-focus-button[aria-pressed="true"] img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.unit-card h3 {
  margin: 0;
  color: var(--olive-dark);
  font: 850 22px/1.08 "Smiley Sans", "Songti SC", serif;
}

.unit-meta,
.unit-card-meta {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.unit-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  margin-top: 8px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}

.unit-card-meta > span:first-child {
  color: var(--body);
  font-weight: 760;
}

.exam-tags,
.chip-row,
.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-tags {
  position: relative;
  z-index: 2;
  margin-top: 12px;
}

.tag,
.chip,
.pattern-row code {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.07);
  color: var(--body);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-card-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.unit-card-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  gap: 7px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  color: var(--olive-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}

.unit-card-actions img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.82;
}

.unit-card-actions .unit-action-primary {
  grid-column: 1 / -1;
  border-color: var(--olive);
  background: linear-gradient(135deg, var(--olive), var(--olive-dark));
  color: var(--paper);
  box-shadow: 0 10px 20px rgba(77, 72, 48, 0.18);
}

.unit-card-actions .unit-action-primary img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.unit-card-actions .unit-action-assessment {
  border-color: rgba(98, 92, 59, 0.28);
  background: rgba(255, 253, 248, 0.92);
}

.unit-card-actions .unit-action-test {
  border-color: rgba(96, 118, 122, 0.34);
  background: rgba(223, 232, 230, 0.58);
  color: #40575b;
}

.unit-card-actions a:hover,
.unit-card-actions a:focus-visible {
  transform: translateY(-1px);
  border-color: var(--olive);
  box-shadow: 0 8px 18px rgba(57, 49, 32, 0.11);
}

.unit-page {
  min-height: calc(100vh - var(--header-h));
  background:
    linear-gradient(rgba(243, 239, 231, 0.72), rgba(243, 239, 231, 0.82)),
    url("../images/home-landscape-bg.webp") center / cover fixed;
}

.unit-page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.unit-hero {
  position: relative;
  min-height: 250px;
  display: grid;
  align-content: center;
  padding: clamp(30px, 5vw, 52px);
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(255, 253, 248, 0.94), rgba(248, 243, 235, 0.7));
  box-shadow: var(--shadow);
}

.unit-hero h1 {
  margin: 0 0 10px;
  color: var(--olive-dark);
  font: 850 clamp(44px, 7vw, 66px) / 1 Georgia, "Songti SC", serif;
}

.unit-hero .unit-meta {
  max-width: 650px;
  font-size: 16px;
}

.unit-hero .unit-focus-button {
  position: absolute;
  right: 34px;
  bottom: 34px;
  width: auto;
  min-width: 148px;
  padding: 0 15px;
  gap: 8px;
  font-weight: 850;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
  gap: 14px;
  margin-top: 16px;
}

body[data-page="unit-home"] .unit-page-shell {
  width: min(1180px, calc(100% - 32px));
  padding-top: 20px;
}

body[data-page="unit-home"] .unit-hero {
  min-height: 0;
  padding: 24px 28px;
}

body[data-page="unit-home"] .unit-hero h1 {
  font-size: clamp(34px, 5vw, 48px);
}

.unit-learning-hub {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.unit-module-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.unit-module-card > p {
  min-height: 3em;
  margin: 0;
  color: var(--body);
  line-height: 1.5;
}

.unit-module-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.unit-module-head > img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 9px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 10px;
  background: rgba(98, 92, 59, 0.1);
}

.unit-module-head .eyebrow,
.unit-module-head h2 {
  margin: 0;
}

.unit-module-state {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.unit-module-state > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.unit-module-state strong {
  color: var(--ink);
  font-size: 13px;
}

.unit-module-state span {
  color: var(--body);
  font-size: 12px;
  text-align: right;
}

.unit-module-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.12);
}

.unit-module-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--olive);
  transition: width 180ms ease;
}

.unit-practice-inventory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.62);
}

.unit-practice-inventory > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 7px;
  text-align: center;
}

.unit-practice-inventory > div + div {
  border-left: 1px solid var(--line);
}

.unit-practice-inventory span,
.unit-practice-inventory small {
  overflow: hidden;
  color: var(--body);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-practice-inventory strong {
  color: var(--olive-dark);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.unit-module-card .entry-list {
  margin-top: auto;
}

.entry-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.76);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.entry-panel h2 {
  margin: 0 0 13px;
  color: var(--olive-dark);
  font-size: 22px;
}

.entry-list {
  display: grid;
  gap: 9px;
}

.entry-link {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--olive-dark);
  text-decoration: none;
  font-weight: 850;
}

.entry-link.primary {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.entry-link:hover {
  transform: translateX(2px);
  border-color: var(--olive);
}

.entry-link small {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.map-teaser {
  display: grid;
  gap: 13px;
}

.map-teaser p {
  margin: 0;
  color: var(--muted);
}

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

.map-stat-grid div {
  min-width: 0;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(248, 243, 235, 0.72);
}

.map-stat-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.map-stat-grid dd {
  margin: 3px 0 0;
  color: var(--olive-dark);
  font-size: 20px;
  font-weight: 900;
}

.grouped-page {
  --header-h: 56px;
}

.study-topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 235, 0.95);
  backdrop-filter: blur(18px) saturate(1.06);
}

.study-topbar-inner {
  width: min(1440px, 100%);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  padding: 7px 16px;
}

.study-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--olive-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.study-brand-stack {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.unit-breadcrumb {
  width: min(1200px, calc(100% - 32px));
  min-height: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px auto 0;
  padding: 7px 11px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.unit-breadcrumb a {
  color: var(--olive-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.unit-breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 900;
}

.unit-breadcrumb--compact {
  width: auto;
  min-height: 0;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  line-height: 1.2;
}

.global-breadcrumb {
  margin-bottom: 0;
}

.study-topbar-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.current-learning-btn {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.current-learning-btn[aria-pressed="true"] {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.study-search-wrap {
  display: block;
}

.study-search {
  width: min(280px, 30vw);
  height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  color: var(--ink);
  outline: none;
}

.study-search:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(98, 92, 59, 0.14);
}

.study-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  align-items: start;
  min-height: calc(100vh - var(--header-h));
}

.study-sidebar,
.word-rail,
.reference-sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 20px 14px 30px;
  background: rgba(248, 243, 235, 0.82);
}

.group-section,
.word-card,
.reference-card {
  scroll-margin-top: calc(var(--header-h) + 14px);
}

.reference-mobile-toolbar {
  display: none;
}

.study-sidebar,
.reference-sidebar {
  border-right: 1px solid var(--line);
}

.word-rail {
  border-left: 1px solid var(--line);
}

.study-sidebar h2,
.reference-sidebar h2 {
  margin: 0 0 5px;
  color: var(--olive-dark);
  font-size: 21px;
}

.study-sidebar > p,
.reference-sidebar > p,
.word-rail > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-search {
  width: 100%;
  height: 39px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  padding: 8px 11px;
  outline: none;
}

.sidebar-search:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(98, 92, 59, 0.14);
}

.group-nav,
.word-jump,
.reference-word-link {
  width: 100%;
  min-height: 38px;
  display: grid;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.group-nav {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  padding: 7px 9px;
}

.group-nav span,
.group-nav em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.group-nav strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.group-nav:hover,
.group-nav.active,
.word-jump:hover,
.word-jump.active,
.reference-word-link:hover,
.reference-word-link.active {
  border-color: var(--line);
  background: var(--olive-soft);
  color: var(--ink);
}

.word-rail h2 {
  margin: 0 0 4px;
  color: var(--olive-dark);
  font-size: 19px;
}

.word-nav-panel {
  display: none;
}

.word-nav-panel.active {
  display: block;
}

.word-jump,
.reference-word-link {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  overflow-wrap: anywhere;
}

.word-jump small,
.reference-word-link small {
  color: var(--muted);
  font-size: 11px;
}

.study-main,
.reference-main {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 80px;
}

.reference-main {
  padding-top: 28px;
}

.study-hero,
.reference-hero,
.assessment-hero,
.map-hero,
.practice-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 221, 203, 0.62), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(223, 232, 230, 0.52), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow);
}

.reference-hero,
.assessment-hero,
.map-hero,
.practice-hero {
  padding: 30px 32px;
}

.study-hero h1,
.reference-hero h1,
.assessment-hero h1,
.map-hero h1,
.practice-hero h1 {
  margin: 0;
  color: var(--olive-dark);
  font: 850 clamp(34px, 5vw, 54px) / 1.04 Georgia, "Songti SC", serif;
}

.study-hero h1 {
  font: 850 36px/1.08 "Smiley Sans", "Songti SC", serif;
  letter-spacing: -0.015em;
}

.study-hero p,
.reference-hero p,
.assessment-hero p,
.map-hero p,
.practice-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
}

.study-hero .eyebrow {
  margin: 0 0 5px;
  color: var(--olive);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mobile-word-nav {
  display: none;
}

.group-section {
  margin: 16px 0 26px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.68);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84);
  scroll-margin-top: calc(var(--header-h) + 14px);
  contain: layout paint style;
}

.group-section[hidden],
.word-card[hidden],
.reference-card[hidden] {
  display: none !important;
}

.group-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.group-number,
.word-index {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--dark);
  color: var(--paper);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.group-number {
  width: 42px;
  height: 42px;
}

.group-header h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 34px;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.group-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.group-learning {
  margin-top: 10px;
}

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

.group-word-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.group-shared-logic {
  max-width: 760px;
  color: var(--body) !important;
  font-size: 16px;
  line-height: 1.65;
}

.group-family-map-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
  text-underline-offset: 3px;
}

.group-family-map-link:hover,
.group-family-map-link:focus-visible {
  color: var(--olive);
}

.group-supporting-details {
  margin: 12px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.group-supporting-details summary {
  width: max-content;
  max-width: 100%;
  padding: 11px 2px;
  color: var(--olive-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.group-supporting-details summary:hover,
.group-supporting-details summary:focus-visible {
  color: var(--olive);
}

.group-supporting-section {
  padding: 2px 2px 12px;
}

.group-supporting-section + .group-supporting-section {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.group-supporting-section h3 {
  margin: 0 0 6px;
  color: var(--olive-dark);
  font-size: 14px;
}

.group-supporting-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--cn);
}

.group-supporting-section li {
  margin: 5px 0;
  line-height: 1.65;
}

.word-card,
.reference-card {
  margin: 16px 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.72);
  scroll-margin-top: calc(var(--header-h) + 14px);
}

.word-head,
.reference-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.word-index {
  width: 35px;
  height: 35px;
}

.word-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.word-title-row h3,
.word-title-row h2 {
  margin: 0;
  color: var(--olive-dark);
  font: 800 clamp(27px, 4vw, 38px) / 1 Georgia, serif;
  overflow-wrap: anywhere;
}

.word-audio-trigger {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.word-audio-trigger:hover {
  color: var(--olive);
}

.word-audio-trigger:focus-visible,
.audio-button:focus-visible,
.pronunciation-variant:focus-visible {
  outline: 3px solid rgba(98, 92, 59, 0.28);
  outline-offset: 3px;
}

.pronunciation-variants {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.pronunciation-variant {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  cursor: pointer;
}

.pronunciation-variant:hover,
.pronunciation-variant.is-playing {
  border-color: var(--olive);
  background: var(--sage);
}

.pron-pos {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 900;
}

.pron-ipa {
  font: 700 14px/1.2 Georgia, serif;
}

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

.pron-play {
  color: var(--olive-dark);
  font-size: 10px;
}

.phonetic,
.pos-summary {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.core-cn {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 18px;
  font-weight: 800;
}

.core-en {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.learning-block {
  margin-top: 16px;
  padding: 14px 0 4px 16px;
  border-top: 1px solid var(--line);
  border-left: 3px solid rgba(98, 92, 59, 0.24);
}

.learning-block.bridge-block {
  border-top: 0;
}

.learning-block h4,
.learning-block h3 {
  margin: 0 0 8px;
  color: var(--olive-dark);
  font-size: 17px;
}

.learning-block > p {
  margin: 7px 0;
  color: var(--cn);
}

.usage-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.usage-group:first-of-type {
  border-top: 0;
}

.usage-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 850;
}

.pos-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.08);
  color: var(--olive-dark);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
}

.usage-focus {
  margin: 6px 0 8px;
  color: var(--cn);
}

.example {
  margin: 9px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.example > p:first-child {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.example details {
  margin-top: 7px;
}

.example summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.translation,
.teaching-note {
  margin: 7px 0 0;
  color: var(--cn);
}

.detail-label {
  display: block;
  margin-top: 8px;
  color: var(--olive-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mini-list {
  display: grid;
}

.meaning-relation-list {
  display: grid;
  gap: 12px;
}

.learning-block.meaning-relations {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.meaning-relation-card {
  --relation-card-surface: var(--surface);
  --relation-card-border: var(--line);
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--relation-card-border);
  border-radius: 10px;
  background: var(--relation-card-surface);
  box-shadow: inset 4px 0 0 var(--relation-card-border);
}

.meaning-relation-card[data-relation-tone="synonym"] {
  --relation-card-surface: var(--relation-synonym-surface);
  --relation-card-border: var(--relation-synonym-border);
}

.meaning-relation-card[data-relation-tone="antonym"] {
  --relation-card-surface: var(--relation-antonym-surface);
  --relation-card-border: var(--relation-antonym-border);
}

.meaning-relation-card[data-relation-tone="confusable"] {
  --relation-card-surface: var(--relation-confusable-surface);
  --relation-card-border: var(--relation-confusable-border);
}

.meaning-relation-card[data-relation-tone="related"] {
  --relation-card-surface: var(--relation-related-surface);
  --relation-card-border: var(--relation-related-border);
}

.learning-block .meaning-relation-card__title {
  margin: 0 0 8px;
  color: var(--ink);
}

.meaning-relation-card .mini-item {
  border-top-color: var(--relation-card-border);
}

.mini-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(140px, 185px) minmax(240px, 1fr) minmax(150px, 0.7fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

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

.mini-word {
  color: var(--olive-dark);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.mini-meaning,
.mini-note {
  color: var(--cn);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mini-example {
  color: var(--body);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reference-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.filter-chip {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pagination button {
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--olive-dark);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.assessment-shell,
.map-shell,
.practice-shell,
.review-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 76px;
}

.assessment-return-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(98, 92, 59, 0.18);
  background: rgba(248, 243, 235, 0.9);
  backdrop-filter: blur(12px);
}

.assessment-return-bar a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(98, 92, 59, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--olive-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.assessment-return-bar a:hover,
.assessment-return-bar a:focus-visible {
  border-color: var(--olive);
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(57, 49, 32, 0.1);
}

.assessment-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 28px;
  align-items: end;
  padding: 20px 0 32px;
}

.assessment-page-hero h1 {
  margin: 0 0 12px;
  color: var(--olive-dark);
  font: 750 clamp(34px, 5.2vw, 58px) / 1.06 "Songti SC", "Noto Serif CJK SC", "STSong", serif;
}

.assessment-page-copy {
  margin: 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.45;
}

.assessment-page-copy strong {
  color: var(--olive-dark);
  font-variant-numeric: tabular-nums;
}

.assessment-session-panel {
  min-height: 148px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 22px 28px;
  border-radius: 10px;
  background: var(--dark);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.assessment-panel-kicker {
  margin: 0 0 4px;
  color: #c8c0b0;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.assessment-session-panel > div > strong {
  display: block;
  font-size: 22px;
  font-weight: 650;
}

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

.assessment-panel-actions .button {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 750;
}

.assessment-panel-actions .button.primary {
  box-shadow: none;
}

.assessment-panel-actions .assessment-on-dark {
  border-color: var(--dark-soft);
  background: var(--dark-soft);
  color: var(--paper);
}

.assessment-panel-actions .assessment-on-dark:hover,
.assessment-panel-actions .assessment-on-dark:focus-visible {
  border-color: rgba(255, 253, 248, 0.34);
  background: #45422b;
}

.assessment-controls {
  position: sticky;
  top: calc(var(--header-h) + 51px);
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(240px, 460px) auto auto;
  gap: 14px;
  align-items: end;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 235, 0.94);
  backdrop-filter: blur(12px);
}

.assessment-search-wrap {
  display: grid;
  gap: 6px;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.assessment-search-wrap .search-input {
  width: 100%;
  height: 42px;
}

.assessment-controls > .button {
  justify-self: end;
  white-space: nowrap;
}

.assessment-tools {
  justify-self: end;
  min-width: 150px;
}

.assessment-tools summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--olive-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.assessment-tools > div {
  position: absolute;
  right: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-deep);
}

.segmented button {
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.segmented button.active,
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(36, 33, 21, 0.08);
}

.assessment-status {
  min-height: 28px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 750;
}

.assessment-page-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 9px;
}

.assessment-word {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.assessment-word:hover,
.assessment-word:focus-visible {
  border-color: var(--olive);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(57, 49, 32, 0.08);
}

.assessment-word.marked {
  border-color: var(--olive);
  background: var(--sand);
}

.assessment-word .word-label {
  min-width: 0;
  font-size: 16px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.assessment-word .serial {
  color: var(--muted-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

dialog {
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-high);
}

dialog::backdrop {
  background: rgba(36, 33, 21, 0.36);
  backdrop-filter: blur(7px);
}

.dialog-card {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(98, 92, 59, 0.24);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--surface), var(--paper-deep));
}

.rhythm-dialog-card {
  width: min(620px, calc(100vw - 28px));
}

.rhythm-explainer {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rhythm-explainer li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.72);
}

.rhythm-explainer strong {
  color: var(--olive-dark);
}

.rhythm-explainer span {
  color: var(--muted);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.dialog-head h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 27px;
}

.dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--olive-dark);
  font-size: 21px;
  cursor: pointer;
}

.assessment-detail-card {
  width: min(780px, calc(100vw - 28px));
  padding: 28px;
  border-radius: 12px;
  background: var(--dark);
  color: var(--paper);
}

.assessment-detail-card h2 {
  margin: 0;
  font: 700 clamp(44px, 7vw, 70px) / 1 Georgia, serif;
  overflow-wrap: anywhere;
}

.assessment-detail-card .meta,
.assessment-detail-card .assessment-cue,
.assessment-detail-card .assessment-related {
  color: #c8c0b0;
}

.assessment-detail-card .pattern-row code {
  border-color: var(--dark-soft);
  background: var(--dark-soft);
  color: var(--paper);
}

.assessment-detail-card .example {
  border-color: var(--dark-soft);
  background: #302f20;
  color: var(--paper);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

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

.plan-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
}

.plan-form-grid input,
.plan-form-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  padding: 8px 10px;
  color: var(--ink);
}

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#dailyPlanDialog::backdrop {
  background: rgba(36, 33, 21, 0.34);
  backdrop-filter: blur(7px);
}

html.has-modal-dialog,
html.has-modal-dialog body {
  overflow: hidden;
}

.daily-plan-dialog-card {
  width: min(700px, calc(100vw - 40px));
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.99), rgba(243, 239, 231, 0.98));
  box-shadow: 0 28px 82px rgba(36, 33, 21, 0.3);
}

.daily-plan-dialog-head {
  align-items: flex-start;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(98, 92, 59, 0.14);
}

.daily-plan-dialog-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.daily-plan-dialog-title h2 {
  font: 800 21px/1.2 var(--font-ui);
}

.daily-plan-dialog-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.daily-plan-dialog-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.local-save-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(98, 92, 59, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#dailyPlanDialog .plan-form-grid {
  grid-template-columns: 110px 110px minmax(250px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

#dailyPlanDialog .plan-form-grid > label,
#dailyPlanDialog .unit-focus-control {
  min-width: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
}

#dailyPlanDialog .plan-form-grid input[type="number"] {
  height: 46px;
  min-height: 46px;
  border-color: rgba(98, 92, 59, 0.28);
  background: rgba(255, 253, 248, 0.96);
  font-size: 15px;
  font-weight: 700;
}

#dailyPlanDialog .form-note {
  margin-top: 14px;
  line-height: 1.55;
}

#dailyPlanDialog .dialog-actions {
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

#dailyPlanDialog .dialog-actions .button {
  min-height: 46px;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
}

#dailyPlanDialog .dialog-actions .button.primary {
  min-width: 104px;
  box-shadow: 0 8px 18px rgba(57, 49, 32, 0.14);
}

#dailyPlanDialog .dialog-actions .button.secondary {
  border-color: rgba(98, 92, 59, 0.24);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.audio-button,
.audio-play {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--olive-dark);
  cursor: pointer;
}

.audio-button:hover,
.audio-play:hover {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.audio-button.is-playing,
.audio-play.is-playing {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.audio-status {
  min-height: 16px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.audio-status:empty {
  min-height: 0;
  margin: 0;
}

.review-mark-group,
.review-feedback-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.review-mark-group {
  margin-left: auto;
}

.word-card.hash-target,
.reference-card.hash-target {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(98, 92, 59, 0.12);
}

.review-feedback,
.primary-btn,
.ghost-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
}

.review-feedback.known {
  background: var(--sage);
  color: #26341f;
}

.review-feedback.vague {
  background: var(--amber);
  color: #3d331b;
}

.review-feedback.unfamiliar {
  background: var(--sand);
  color: #302812;
}

.review-feedback.active,
.review-feedback[aria-pressed="true"] {
  box-shadow: 0 0 0 3px rgba(98, 92, 59, 0.24);
}

.review-feedback:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.review-runner-card {
  width: min(820px, 100%);
  color: var(--paper);
}

.review-runner-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--dark-soft);
}

.review-runner-head h2 {
  margin: 0;
  color: var(--paper);
  font: 650 clamp(48px, 7vw, 76px) / 0.98 Georgia, serif;
  overflow-wrap: anywhere;
}

.review-word-meta,
.runner-status,
.review-core-en,
.review-core-cn {
  color: #c8c0b0;
}

.audio-first-label {
  margin: 0 0 8px;
  color: var(--paper);
  font-size: 25px;
  font-weight: 850;
}

.review-reveal-actions,
.review-commit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.review-example-cues,
.review-full-meaning {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-soft);
}

.review-example-cues h3 {
  margin: 0 0 9px;
  color: #c8c0b0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-example-cues p,
.review-examples p {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--olive);
  border-radius: 7px;
  background: #302f20;
  color: var(--paper);
}

.review-examples small {
  display: block;
  margin-top: 5px;
  color: #c8c0b0;
}

/* W / 完整提示：使用与逐词精讲一致的浅色长文节奏。内容区独立滚动，
   因而较长的多义词不会把提交控件推到视口之外。 */
.review-full-meaning {
  max-height: min(64vh, 700px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  border: 1px solid rgba(98, 92, 59, 0.22);
  border-radius: 14px;
  background: #fbf9f2;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.review-full-meaning .review-learning-section + .review-learning-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(98, 92, 59, 0.18);
}

.review-full-meaning .review-learning-section > h3 {
  margin: 0 0 11px;
  color: var(--olive-dark);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.review-full-meaning .review-core-en,
.review-full-meaning .review-core-cn,
.review-full-meaning .review-bridge-section p {
  margin: 6px 0;
  color: var(--ink);
}

.review-full-meaning .review-core-en {
  font-family: Georgia, serif;
  font-size: 18px;
}

.review-usage-group {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(98, 92, 59, 0.18);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.88);
}

.review-usage-group > header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.review-usage-group > header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.review-pos-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(98, 92, 59, 0.28);
  border-radius: 999px;
  background: #f0eddf;
  color: var(--olive-dark);
  font: 750 12px/1.2 var(--font-ui);
}

.review-meaning-focus,
.review-when-to-use,
.review-student-note {
  margin: 9px 0 0;
  color: var(--body);
}

.review-when-to-use strong {
  margin-right: 7px;
  color: var(--olive-dark);
}

.review-pattern-row,
.review-phrase-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 11px;
}

.review-pattern-row code,
.review-phrase-row > span {
  padding: 5px 8px;
  border: 1px solid rgba(98, 92, 59, 0.16);
  border-radius: 7px;
  background: #efecdf;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.review-phrase-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.review-teaching-examples {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.review-teaching-example {
  padding: 11px 13px;
  border-left: 3px solid var(--olive);
  border-radius: 8px;
  background: #f1eee3;
}

.review-teaching-example p { margin: 0; }

.review-example-en {
  color: var(--ink);
  font: 17px/1.55 Georgia, serif;
}

.review-example-cn,
.review-example-note {
  margin-top: 7px !important;
  color: var(--body);
  font-size: 13px;
}

.review-example-cn span,
.review-example-note span {
  display: inline-block;
  min-width: 4.4em;
  margin-right: 7px;
  color: var(--olive-dark);
  font-weight: 800;
}

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

.review-relation-block {
  padding: 12px;
  border: 1px solid #bfd0b8;
  border-radius: 10px;
  background: #eef5ea;
}

.review-relation-block[data-relation-key="antonyms"],
.review-relation-block[data-relation-key="basic_antonyms"] {
  border-color: #e4bd81;
  background: #fff3df;
}

.review-relation-block[data-relation-key="confusable_words"] {
  border-color: #b8cedc;
  background: #edf5f9;
}

.review-relation-block[data-relation-key="word_family"],
.review-relation-block[data-relation-key="related_words"],
.review-relation-block[data-relation-key="memory_links"] {
  border-color: #d4c8ad;
  background: #f6f1e5;
}

.review-relation-block > h4 {
  margin: 0 0 8px;
  color: var(--olive-dark);
  font-size: 13px;
}

.review-relation-item + .review-relation-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(98, 92, 59, 0.16);
}

.review-relation-item h5 {
  margin: 0;
  color: var(--ink);
  font: 700 16px/1.35 Georgia, serif;
}

.review-relation-item h5 small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 12px/1.45 var(--font-ui);
}

.review-relation-example,
.review-relation-translation,
.review-relation-note,
.review-root-affix {
  margin: 6px 0 0;
  color: var(--body);
  font-size: 13px;
}

.review-relation-example {
  color: var(--ink);
  font-family: Georgia, serif;
}

.review-relation-note { color: var(--olive-dark); }

.review-root-affix {
  padding: 10px 12px;
  border-left: 3px solid #b7a77e;
  background: #f1eddf;
}

@media (max-width: 680px) {
  .review-full-meaning {
    max-height: min(58vh, 560px);
    padding: 13px;
  }

  .review-relation-grid { grid-template-columns: minmax(0, 1fr); }
  .review-usage-group { padding: 12px; }
}

.review-control-panel {
  display: grid;
  gap: 10px;
}

.review-controls-host .review-feedback-row {
  display: grid;
  grid-template-columns: 1fr;
}

.review-controls-host .review-feedback {
  min-height: 43px;
}

.word-btn,
.auditory-card {
  min-width: 0;
  min-height: 68px;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--ink);
  text-align: left;
}

.word-btn {
  cursor: pointer;
}

.word-btn:hover,
.word-btn:focus-visible,
.auditory-card:focus-within {
  border-color: var(--olive);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(57, 49, 32, 0.08);
}

.word-btn.unknown,
.auditory-card.unknown {
  border-color: var(--olive);
  background: var(--sand);
}

.word-btn span,
.auditory-card > span {
  color: var(--muted-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.word-btn strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-family: var(--font-ui);
  font-weight: 750;
  font-style: normal;
  line-height: 1.25;
}

.auditory-card button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--olive-dark);
  cursor: pointer;
}

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

.auditory-play-group {
  min-width: 0;
}

.floating-card-host {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  overflow: auto;
  box-sizing: border-box;
}

.floating-card-host[open] {
  display: grid;
  place-items: center;
}

.floating-card-host::backdrop {
  background: rgba(36, 33, 21, 0.38);
  backdrop-filter: blur(8px);
}

body.dialog-open {
  overflow: hidden;
}

.assessment-card {
  width: min(760px, calc(100vw - 28px));
  max-width: 100%;
  max-height: calc(100dvh - 36px);
  overflow: auto;
  box-sizing: border-box;
  padding: 26px;
  border: 1px solid var(--dark-soft);
  border-radius: 12px;
  background: var(--dark);
  color: var(--paper);
  box-shadow: var(--shadow-high);
}

.assessment-card h2 {
  margin: 0;
  color: var(--paper);
  font: 650 clamp(36px, 7vw, 68px) / 0.98 Georgia, serif;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.assessment-pronunciations,
.auditory-play-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.assessment-pronunciations {
  margin-top: 12px;
}

.assessment-pronunciations button[aria-pressed="true"] {
  border-color: var(--paper);
  background: rgba(255, 253, 248, 0.2);
}

.assessment-card header p,
.assessment-card .review-core-en {
  color: #c8c0b0;
}

.assessment-card > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.assessment-card button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--dark-soft);
  border-radius: 999px;
  background: var(--dark-soft);
  color: var(--paper);
  cursor: pointer;
}

.assessment-card .assessment-choice {
  min-width: 112px;
  border-color: rgba(255, 253, 248, 0.35);
  background: transparent;
  font-weight: 850;
}

.assessment-card .assessment-choice.primary {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--dark);
}

.test-setup {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.74);
}

.test-setup h2 {
  margin: 0 0 8px;
  color: var(--olive-dark);
  font-size: 14px;
}

.test-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-setup[data-session-active="true"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  padding-block: 12px;
  background: rgba(255, 253, 248, 0.5);
}

.test-setup[data-session-active="true"] h2,
.test-setup[data-session-active="true"] .segmented {
  opacity: 0.72;
}

.unit-test-export {
  margin-top: 14px;
}

.unit-test-export summary {
  width: fit-content;
  color: var(--olive-dark);
  cursor: pointer;
  font-weight: 850;
}

.unit-test-export button {
  min-height: 38px;
  margin-top: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--olive-dark);
  cursor: pointer;
}

.unit-test-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
}

.unit-test-host {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--dark);
  color: var(--paper);
}

.unit-test-host:empty {
  min-height: 0;
  padding: 0;
  border: 0;
}

.unit-test-controls {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.8);
}

.unit-test-controls:empty {
  display: none;
}

.unit-test-summary,
.state-tools {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.76);
}

.unit-test-history {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.68);
}

.unit-test-history-head h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 19px;
}

.unit-test-history-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.unit-test-history details {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.unit-test-history summary {
  width: fit-content;
  color: var(--olive-dark);
  font-weight: 850;
  cursor: pointer;
}

#unitTestHistory ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 24px;
}

#unitTestHistory li {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

#unitTestHistory time,
#unitTestHistory span {
  display: block;
}

#unitTestHistory time {
  color: var(--olive-dark);
  font-weight: 850;
}

#unitTestHistory span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.unit-test-summary h2,
.state-tools h2 {
  margin: 0 0 7px;
  color: var(--olive-dark);
}

.unit-test-result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.unit-test-result-grid span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.unit-test-result-grid strong {
  display: block;
  color: var(--olive-dark);
  font-size: 21px;
}

.target-drawer-toggle {
  position: fixed;
  left: 0;
  top: 46%;
  z-index: 80;
  writing-mode: vertical-rl;
  border-left: 0;
  border-radius: 0 14px 14px 0;
}

.state-tools p {
  color: var(--muted);
}

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

.family-map-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.72);
  scroll-margin-top: calc(var(--header-h) + 14px);
}

.family-map-card h2 {
  margin: 0 0 5px;
  color: var(--olive-dark);
  font-size: 25px;
  overflow-wrap: anywhere;
}

.family-map-card > p {
  margin: 0;
  color: var(--muted);
}

.family-graph {
  margin-top: 15px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(98, 92, 59, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(98, 92, 59, 0.07) 1px, transparent 1px),
    rgba(248, 243, 235, 0.7);
  background-size: 28px 28px;
}

.family-edge-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-grid.single-result .family-map-card:not([hidden]) {
  grid-column: 1 / -1;
}

.family-edge-row {
  --family-edge-surface: var(--relation-related-surface);
  --family-edge-border: var(--relation-related-border);
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(76px, 0.7fr) minmax(88px, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--family-edge-border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--family-edge-surface) 88%, transparent);
}

.family-edge-row[data-relation-level="direct_derivation"] {
  --family-edge-surface: var(--relation-synonym-surface);
  --family-edge-border: var(--relation-synonym-border);
}

.family-edge-row[data-relation-level="shared_root"] {
  --family-edge-surface: var(--relation-confusable-surface);
  --family-edge-border: var(--relation-confusable-border);
}

.family-edge-row[data-relation-level="mnemonic_extension"] {
  --family-edge-surface: var(--relation-antonym-surface);
  --family-edge-border: var(--relation-antonym-border);
}

.family-edge-connector {
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--body);
  text-align: center;
}

.family-edge-rule {
  width: 100%;
  border-top: 3px solid var(--family-edge-border);
}

.family-edge-connector b {
  max-width: 100%;
  margin-top: -1px;
  padding: 3px 6px;
  border: 1px solid var(--family-edge-border);
  border-radius: 999px;
  background: var(--family-edge-surface);
  font-size: 10px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.family-node {
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--olive-dark);
  text-align: center;
  font-weight: 850;
  overflow-wrap: anywhere;
  box-shadow: 0 7px 16px rgba(57, 49, 32, 0.09);
}

.family-edge-row .family-node {
  width: 100%;
}

.family-node.core {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--paper);
}

.family-node.bridge {
  border-style: dashed;
  color: var(--muted);
}

.family-bridge-bank {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-strong);
}

.family-bridge-bank > strong {
  color: var(--muted);
  font-size: 12px;
}

.family-bridge-bank .family-node {
  min-height: 36px;
  padding-block: 5px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.map-legend span {
  padding: 4px 8px;
  border: 1px solid var(--relation-related-border);
  border-radius: 999px;
  background: var(--relation-related-surface);
  color: var(--body);
  font-size: 12px;
  font-weight: 750;
}

.map-legend span[data-relation-level="direct_derivation"] {
  border-color: var(--relation-synonym-border);
  background: var(--relation-synonym-surface);
}

.map-legend span[data-relation-level="shared_root"] {
  border-color: var(--relation-confusable-border);
  background: var(--relation-confusable-surface);
}

.map-legend span[data-relation-level="mnemonic_extension"] {
  border-color: var(--relation-antonym-border);
  background: var(--relation-antonym-surface);
}

.map-cross-group-details,
.map-related-index {
  margin-top: 14px;
  border: 1px solid var(--relation-related-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--relation-related-surface) 72%, transparent);
}

.map-cross-group-details summary,
.map-related-index > summary {
  padding: 11px 13px;
  color: var(--olive-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.map-cross-group-details > p,
.map-related-index > p {
  margin: 0;
  padding: 0 13px 10px;
  color: var(--muted);
  font-size: 12px;
}

.map-cross-group-details nav,
.map-index-cross-links {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.map-cross-group-link {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--relation-related-border);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--olive-dark);
  text-decoration: none;
}

.map-cross-group-link:hover,
.map-cross-group-link:focus-visible {
  border-color: var(--olive);
  background: var(--olive-soft);
}

.map-cross-group-link strong {
  font-size: 13px;
}

.map-cross-group-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.map-related-index {
  margin-top: 18px;
  background: rgba(255, 253, 248, 0.66);
}

.map-related-index-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.map-related-index-entry {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.76);
  scroll-margin-top: calc(var(--header-h) + 14px);
}

.map-related-index-entry > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.map-related-index-entry h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 17px;
}

.map-related-index-entry > div > a {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.map-index-edge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.map-index-edge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--relation-related-border);
  border-radius: 999px;
  background: var(--relation-related-surface);
  color: var(--body);
  font-size: 11px;
}

.map-index-edge[data-relation-level="direct_derivation"] {
  border-color: var(--relation-synonym-border);
  background: var(--relation-synonym-surface);
}

.map-index-edge[data-relation-level="shared_root"] {
  border-color: var(--relation-confusable-border);
  background: var(--relation-confusable-surface);
}

.map-index-edge[data-relation-level="mnemonic_extension"] {
  border-color: var(--relation-antonym-border);
  background: var(--relation-antonym-surface);
}

.map-index-edge span {
  color: var(--muted);
}

.map-related-index-entry .map-index-cross-links {
  padding: 10px 0 0;
}

.guide-page {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 50px;
}

.home-guide-dialog-shell {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  height: min(568px, calc(100dvh - 28px));
  overflow: hidden;
  border: 1px solid rgba(98, 92, 59, 0.24);
  border-radius: 12px;
  background: var(--paper-deep);
}

.home-guide-dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  background: rgba(255, 253, 248, 0.92);
}

.home-guide-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}

body.guide-embedded {
  background: transparent;
}

body.guide-embedded .site-header {
  display: none;
}

body.guide-embedded .guide-page {
  width: 100%;
  padding: 0;
}

body.guide-embedded .guide-frame {
  min-height: calc(100vh - 1px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.guide-embedded .guide-top a {
  display: none;
}

.guide-frame {
  min-height: calc(100vh - var(--header-h) - 72px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(98, 92, 59, 0.22);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.97), rgba(243, 239, 231, 0.96));
  box-shadow: var(--shadow);
}

.guide-top,
.guide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.guide-stage {
  min-height: 0;
  overflow: auto;
}

.guide-slide {
  min-height: 430px;
  display: none;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: stretch;
}

.guide-slide.active {
  display: grid;
}

.guide-copy {
  display: grid;
  align-content: center;
  gap: 11px;
}

.guide-copy h1,
.guide-copy h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.05;
}

.guide-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
}

.guide-visual {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 243, 235, 0.72);
}

.guide-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 14px 28px rgba(57, 49, 32, 0.1);
}

.guide-window-bar {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.guide-window-bar i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.3);
}

.guide-window-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.guide-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.guide-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.26);
  cursor: pointer;
}

.guide-dot.active {
  background: var(--olive);
}

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

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

.feature-tile,
.rhythm-step {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--olive-dark);
  font-weight: 850;
}

.feature-tile small,
.rhythm-step small {
  color: var(--muted);
  font-size: 12px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
  min-height: calc(100vh - var(--header-h) - 56px);
}

.review-runner-host {
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--dark);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.review-runner-host .loading-state {
  max-width: 420px;
  text-align: center;
  color: #c8c0b0;
}

.review-controls-host {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.78);
}

.review-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--olive-dark);
  font-weight: 850;
}

.review-summary-bar h1 {
  margin: 0;
  font: inherit;
}

.review-keyboard-help {
  margin: -3px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.review-keyboard-help kbd {
  min-width: 24px;
  display: inline-grid;
  place-items: center;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--olive-dark);
  font: 800 12px/1.5 var(--font-ui);
  box-shadow: inset 0 -1px 0 rgba(98, 92, 59, 0.18);
}

.daily-completion-card {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(223, 232, 214, 0.72));
  box-shadow: var(--shadow);
}

.daily-completion-card h2,
.daily-completion-card p {
  margin: 0;
}

.daily-completion-card h2 {
  color: var(--olive-dark);
  font: 700 clamp(32px, 5vw, 52px) / 1.05 var(--font-display);
}

.daily-completion-card > p:not(.eyebrow) {
  color: var(--muted);
}

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

.daily-completion-grid span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.daily-completion-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--olive-dark);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.daily-completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.practice-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.74);
}

.practice-panel h2 {
  margin: 0 0 8px;
  color: var(--olive-dark);
}

.practice-panel p {
  max-width: 720px;
  margin: 0 0 15px;
  color: var(--muted);
}

.disabled-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--amber);
  color: #564923;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1160px) {
  .study-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .word-rail {
    display: none;
  }

  .mobile-word-nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 9px 0 2px;
    scrollbar-width: thin;
  }

  .mobile-word-nav .word-jump {
    flex: 0 0 auto;
    width: auto;
    min-height: 33px;
    padding: 5px 9px;
    border-color: var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.7);
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  :root {
    --header-h: 58px;
  }

  .site-header {
    min-height: var(--header-h);
    padding: 0 14px;
  }

  .site-nav a:not(.always-visible) {
    display: none;
  }

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

  .study-topbar-inner {
    flex-wrap: wrap;
  }

  .study-search {
    width: min(250px, 38vw);
  }

  .study-layout,
  .reference-layout {
    display: block;
  }

  .study-sidebar,
  .reference-sidebar {
    position: relative;
    top: auto;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .study-main,
  .reference-main {
    width: min(100% - 28px, 980px);
    padding-top: 22px;
  }

  .mini-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .reference-sidebar nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .reference-word-link {
    min-width: 0;
  }

  .reference-mobile-toolbar {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(248, 243, 235, 0.96);
    box-shadow: 0 8px 22px rgba(57, 49, 32, 0.08);
    backdrop-filter: blur(12px);
  }

  .reference-mobile-toolbar .sidebar-search {
    margin: 0;
  }

  .reference-mobile-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .reference-mobile-toolbar select {
    min-width: 0;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    padding: 7px 9px;
  }

  /* Mobile reference navigation occupies a second sticky row below the
     course header.  Keep a selected word's complete heading (including its
     pronunciation controls) below both sticky layers. */
  .reference-card {
    scroll-margin-top: calc(var(--header-h) + 118px);
  }
}

@media (max-width: 820px) {
  body[data-page="home"] {
    background-attachment: scroll;
  }

  .home-hero {
    min-height: 360px;
    align-items: flex-start;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.9), rgba(248, 243, 235, 0.68));
  }

  .home-family-collage::after {
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.97) 0%, rgba(255, 253, 248, 0.86) 54%, rgba(255, 253, 248, 0.16) 100%);
  }

  .family-collage-card {
    width: 210px;
    opacity: 0.62;
  }

  .family-collage-effect { right: 154px; top: 246px; transform: rotate(-4deg); }
  .family-collage-respond { right: -20px; top: 236px; transform: rotate(4deg); }
  .family-collage-definite { display: block; right: 66px; top: 326px; transform: rotate(-2deg); }
  .family-collage-offer,
  .family-collage-receive,
  .family-collage-serve { display: none; }

  .home-hero h1 {
    font-size: clamp(38px, 10.5vw, 48px);
  }

  .daily-panel,
  .entry-grid,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .unit-breadcrumb {
    width: calc(100% - 20px);
    align-items: flex-start;
  }

  .unit-breadcrumb--compact {
    width: auto;
  }

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

  .daily-overview {
    grid-template-columns: 1fr;
  }

  .daily-panel p,
  .daily-plan-summary,
  .daily-help-link {
    grid-column: 1;
  }

  .daily-plan-summary {
    grid-row: auto;
    margin-top: 8px;
    padding: 11px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .plan-form-grid,
  .test-setup,
  .unit-test-stage {
    grid-template-columns: 1fr;
  }

  .unit-test-controls {
    position: relative;
    top: auto;
  }

  .unit-test-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-actions {
    justify-content: flex-start;
  }

  .entry-panel {
    padding: 18px;
  }

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

  .unit-module-card > p {
    min-height: 0;
  }

  .unit-module-state > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .unit-module-state span {
    text-align: left;
  }

  .unit-hero .unit-focus-button {
    position: static;
    min-width: 100%;
    margin-top: 18px;
  }

  .assessment-controls {
    grid-template-columns: 1fr;
    top: calc(var(--header-h) + 51px);
    padding: 10px 0;
  }

  .assessment-page-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
    padding: 20px 0 26px;
  }

  .assessment-session-panel {
    min-height: 0;
  }

  .assessment-controls > .button {
    width: 100%;
    justify-self: stretch;
  }

  .assessment-controls .search-input {
    width: 100%;
  }

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

  .guide-slide {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .guide-copy {
    align-content: start;
  }

  .review-controls-host {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    min-height: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(255, 253, 248, 0.97);
    box-shadow: 0 -9px 22px rgba(57, 49, 32, 0.13);
    backdrop-filter: blur(14px);
  }

  .review-layout {
    padding-bottom: 104px;
  }

  .review-controls-host .review-control-panel {
    width: min(760px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 7px;
  }

  .review-controls-host .review-feedback-row {
    flex: 1 1 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .review-controls-host .review-feedback,
  .review-controls-host .review-commit-wrap .primary-btn {
    min-height: 42px;
    padding: 7px 9px;
    white-space: nowrap;
  }

  .review-controls-host .review-commit-wrap {
    flex: 0 0 86px;
    display: grid;
    margin: 0;
  }

  .review-controls-host .review-commit-wrap span {
    display: none;
  }

  .review-controls-host .review-commit-wrap .primary-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .family-graph {
    padding: 10px;
  }

  .family-edge-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .family-edge-row {
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    gap: 5px;
    padding: 8px 6px;
  }

  .family-edge-row .family-node {
    min-height: 42px;
    padding: 6px;
    font-size: 12px;
  }

  .family-edge-connector b {
    padding-inline: 4px;
    font-size: 9px;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 7px;
    padding-block: 8px;
  }

  .site-brand {
    font-size: 14px;
  }

  .site-nav {
    gap: 1px;
  }

  .site-nav a {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .page-shell,
  .home-shell,
  .assessment-shell,
  .map-shell,
  .practice-shell,
  .review-shell {
    width: min(100% - 20px, 1200px);
  }

  .assessment-return-bar {
    justify-content: stretch;
    padding-inline: 10px;
  }

  .assessment-return-bar a {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .assessment-page-hero h1 {
    font-size: clamp(34px, 11vw, 46px);
  }

  .assessment-page-copy {
    font-size: 16px;
  }

  .assessment-session-panel {
    padding: 20px;
    border-radius: 12px;
  }

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

  .assessment-panel-actions .button {
    width: 100%;
    min-width: 0;
    padding-inline: 9px;
  }

  .assessment-controls {
    position: relative;
    top: auto;
  }

  .home-shell {
    padding-top: 12px;
  }

  .home-guide-link {
    position: relative;
    top: auto;
    left: auto;
    width: fit-content;
    display: flex;
    margin: 0 0 10px 0;
  }

  .home-guide-hint {
    min-height: 32px;
  }

  .home-brand-line {
    margin-bottom: 18px;
  }

  .home-hero h1 {
    font-size: clamp(38px, 10.5vw, 44px);
  }

  .study-topbar-inner {
    gap: 7px;
    padding: 7px 10px;
  }

  .study-brand {
    width: 100%;
  }

  .study-topbar-tools {
    width: 100%;
  }

  .current-learning-btn {
    flex: 0 1 auto;
    min-width: 0;
    padding-inline: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .study-search-wrap {
    min-width: 0;
    flex: 1;
  }

  .study-search {
    width: 100%;
    min-width: 0;
  }

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

  .unit-card {
    min-height: 206px;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 5px;
  }

  .daily-panel {
    min-height: 0;
    padding: 20px;
  }

  .daily-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .daily-actions .button.primary {
    order: -1;
  }

  .rhythm-explainer li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .home-guide-dialog-shell {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }

  .study-hero,
  .reference-hero,
  .assessment-hero,
  .map-hero,
  .practice-hero {
    padding: 24px 19px;
  }

  .group-section {
    padding: 20px 15px;
    scroll-margin-top: 112px;
  }

  .grouped-page .word-card {
    scroll-margin-top: 112px;
  }

  .study-hero h1,
  .group-header h2 {
    font-size: 29px;
  }

  .group-header {
    position: relative;
    display: block;
  }

  .group-header .group-number {
    position: absolute;
    top: 0;
    left: 0;
  }

  .group-header .group-heading > h2 {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding-left: 56px;
  }

  .word-head,
  .reference-head {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
  }

  .word-title-row .review-mark-group {
    width: 100%;
    margin-left: 0;
  }

  .word-card,
  .reference-card {
    padding: 17px 15px;
  }

  .reference-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-sidebar {
    display: none;
  }

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

  .assessment-word {
    min-height: 61px;
    padding: 9px;
  }

  .assessment-word .word-label {
    font-size: 14px;
  }

  .assessment-detail-card,
  .dialog-card {
    padding: 19px;
  }

  .floating-card-host {
    padding: 10px;
  }

  .assessment-card {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    padding: 20px 17px;
  }

  .assessment-card h2 {
    font-size: clamp(34px, 12vw, 54px);
  }

  .guide-frame {
    min-height: calc(100vh - var(--header-h) - 44px);
    padding: 12px;
  }

  .guide-slide {
    gap: 13px;
  }

  .guide-copy h1,
  .guide-copy h2 {
    font-size: 30px;
  }

  .guide-visual {
    padding: 11px;
  }

  .feature-tiles,
  .rhythm-row {
    grid-template-columns: 1fr;
  }

  .guide-controls {
    flex-wrap: wrap;
  }

  .guide-dots {
    order: -1;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .unit-breadcrumb {
    gap: 4px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .unit-breadcrumb--compact {
    width: 100%;
    padding: 0;
    font-size: 10px;
  }

  .study-brand-stack {
    width: 100%;
  }

  .daily-completion-card {
    min-height: 0;
    padding: 22px 16px;
  }

  .daily-completion-grid {
    grid-template-columns: 1fr;
  }

  .review-keyboard-help {
    line-height: 1.9;
  }

  .learning-block.meaning-relations {
    padding-left: 0;
    border-left: 0;
  }

  .meaning-relation-card {
    padding: 12px;
  }

  .meaning-relation-card .mini-word {
    font-size: 15px;
  }

  .meaning-relation-card .mini-meaning,
  .meaning-relation-card .mini-note {
    font-size: 14px;
    line-height: 1.55;
  }

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

  .unit-page-shell {
    width: calc(100% - 20px);
  }

  .unit-hero {
    padding: 26px 19px;
  }

  .unit-hero h1 {
    font-size: 42px;
  }

  .site-brand .brand-text-suffix {
    display: none;
  }
}

/* Vocabulary directory and learning-card clarity pass. */
body[data-page="home"] .home-shell {
  max-width: 1320px;
  padding-top: 22px;
}

body[data-page="home"] .home-hero {
  min-height: 206px;
  padding: 26px 34px;
}

body[data-page="home"] .home-brand-line {
  margin-bottom: 10px;
}

body[data-page="home"] .home-hero h1 {
  font-size: clamp(34px, 4vw, 48px);
}

body[data-page="home"] .home-hero .home-feature-line {
  max-width: 520px;
  margin-top: 10px;
  font-size: 15px;
}

body[data-page="home"] .daily-panel {
  padding: 18px 22px 14px;
}

body[data-page="home"] .daily-content {
  margin-top: 12px;
}

body[data-page="home"] .today-training {
  gap: 12px;
  padding-right: 24px;
}

body[data-page="home"] .daily-actions .button,
body[data-page="home"] .daily-actions .button.primary,
body[data-page="home"] .daily-actions .button.secondary {
  min-height: 46px;
}

body[data-page="home"] .library-progress {
  gap: 6px;
  padding-left: 24px;
}

body[data-page="home"] .library-forecast div {
  min-height: 34px;
}

body[data-page="home"] .daily-help-wrap {
  margin-top: 10px;
  padding-top: 6px;
}

body[data-page="home"] .unit-grid {
  margin-top: 16px;
}

body[data-page="home"] .unit-card {
  min-height: 226px;
  padding: 16px;
}

.unit-card.is-current-unit {
  border-color: var(--olive);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 0 0 2px rgba(98, 92, 59, 0.1), 0 14px 28px rgba(57, 49, 32, 0.11);
}

.unit-card-progress {
  position: relative;
  z-index: 2;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  pointer-events: none;
}

.unit-card-progress[data-evidence="ready"] {
  color: var(--olive-dark);
}

.unit-card-actions {
  gap: 7px;
  padding-top: 9px;
}

.unit-card-actions a {
  min-height: 38px;
  padding: 5px 8px;
  font-size: 12px;
}

.unit-card-actions .unit-action-primary {
  min-height: 44px;
  font-size: 13px;
}

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

.study-main {
  width: min(1040px, calc(100% - 36px));
  padding-top: 16px;
}

.study-hero {
  padding: 19px 24px;
}

.study-hero h1 {
  font-size: 30px;
}

.study-hero p {
  margin-top: 6px;
  font-size: 14px;
}

.group-section {
  padding: 22px 26px;
}

.group-word-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.group-word-nav .word-jump {
  width: auto;
  min-height: 34px;
  padding: 5px 10px;
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.78);
}

.group-word-nav .word-jump.active {
  border-color: var(--olive);
  background: var(--olive-soft);
}

.learning-block.bridge-block {
  margin-top: 12px;
  padding: 10px 0 2px 14px;
}

.learning-block.bridge-block h4 {
  margin-bottom: 5px;
  font-size: 14px;
}

.learning-block.bridge-block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.learning-disclosure {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.learning-disclosure > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  color: var(--olive-dark);
  cursor: pointer;
  font-size: 15px;
  font-weight: 850;
}

.learning-disclosure > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.learning-disclosure[open] > summary {
  margin-bottom: 10px;
}

.extension-disclosure-body {
  padding-bottom: 4px;
}

.extension-disclosure-body > :first-child {
  margin-top: 0;
}

@media (max-width: 1160px) {
  .study-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}

@media (forced-colors: active) {
  .meaning-relation-card {
    border: 2px solid CanvasText;
    background: Canvas;
    box-shadow: none;
  }

  .meaning-relation-card .mini-item {
    border-top-color: CanvasText;
  }
}

@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;
  }
}

/* Daily memory v5: library progress, forecasting and local training flow. */
body[data-page="home"] .daily-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  min-height: 0;
  padding: 24px 26px 18px;
}

body[data-page="home"] .daily-panel::before,
body[data-page="home"] .daily-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}

body[data-page="home"] .daily-panel::before {
  background: url("../images/home-landscape-bg.webp") center 56% / cover no-repeat;
  opacity: 0.14;
  filter: saturate(0.7) contrast(0.88) brightness(1.07);
}

body[data-page="home"] .daily-panel::after {
  background: linear-gradient(90deg, rgba(255, 253, 248, 0.96) 0%, rgba(255, 253, 248, 0.9) 46%, rgba(248, 243, 235, 0.72) 100%);
}

.file-mode-notice {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 720px;
  margin: 18px auto;
  padding: 24px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.file-mode-notice h2 {
  margin: 0 0 10px;
  color: var(--olive-dark);
  font-size: 21px;
}

.file-mode-notice p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

body[data-page="home"] .daily-overview {
  position: relative;
  z-index: 1;
  display: block;
}

.daily-heading {
  display: grid;
  gap: 5px;
}

.daily-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.daily-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
}

.today-training {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 2px 32px 2px 0;
}

body[data-page="home"] .daily-plan-summary {
  grid-column: auto;
  grid-row: auto;
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
}

body[data-page="home"] .daily-plan-summary > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

body[data-page="home"] .daily-plan-summary strong {
  color: var(--olive-dark);
  font-size: 22px;
  line-height: 1.35;
}

body[data-page="home"] .daily-plan-summary small {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body[data-page="home"] .daily-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 560px;
}

body[data-page="home"] .daily-actions .button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
}

body[data-page="home"] .daily-actions .button.primary {
  order: 0;
  min-height: 54px;
  border-color: rgba(77, 72, 48, 0.88);
  background: linear-gradient(135deg, var(--olive), var(--olive-dark));
  box-shadow: 0 15px 30px rgba(77, 72, 48, 0.29), 0 0 0 3px rgba(98, 92, 59, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body[data-page="home"] .daily-actions .button.primary .icon {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

body[data-page="home"] .daily-actions .button.secondary {
  min-height: 54px;
  border-color: rgba(98, 92, 59, 0.34);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

body[data-page="home"] .daily-actions .button:hover,
body[data-page="home"] .daily-actions .button:focus-visible {
  transform: translateY(-1px);
}

.library-progress {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 2px 0 2px 32px;
  border-left: 1px solid rgba(98, 92, 59, 0.2);
}

.library-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.library-progress-head strong {
  color: var(--olive-dark);
  font-size: 14px;
}

.library-progress-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.library-progress-track {
  width: 100%;
  height: 12px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(77, 72, 48, 0.17);
  border-radius: 4px;
  background: rgba(229, 220, 205, 0.62);
}

.library-progress-segment {
  display: block;
  width: 0;
  height: 100%;
  transition: width 0.28s ease;
}

.library-progress-segment.unseen { background: #cfc8bb; }
.library-progress-segment.learning { background: #c68c76; }
.library-progress-segment.consolidating { background: #d2b85f; }
.library-progress-segment.mastered { background: #6e8d5b; }

.library-progress[data-evidence="pending"] .library-progress-segment {
  width: 0 !important;
}

.library-progress-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.library-progress-legend span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.library-progress-legend i {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--legend-color);
}

.library-progress-metrics,
.library-forecast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.library-progress-metrics {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 760;
}

.library-forecast {
  padding-top: 8px;
  border-top: 1px solid rgba(98, 92, 59, 0.13);
}

.library-forecast div {
  min-width: 0;
  min-height: 46px;
  display: grid;
  align-content: start;
  gap: 1px;
}

.library-forecast span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.library-forecast strong {
  color: var(--olive-dark);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.daily-help-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 17px;
  padding-top: 10px;
  border-top: 1px solid rgba(98, 92, 59, 0.17);
}

body[data-page="home"] .daily-help-link {
  margin: 0;
  min-height: 44px;
}

.unit-focus-control {
  min-width: 250px;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.unit-focus-control legend { padding: 0; }

.unit-focus-options {
  height: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(98, 92, 59, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
}

.unit-focus-options label { position: relative; display: block; }
.unit-focus-options input { position: absolute; opacity: 0; pointer-events: none; }

.unit-focus-options span {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.unit-focus-options small { font-size: 10px; }

.unit-focus-options input:checked + span {
  background: var(--olive);
  color: var(--paper);
}

.unit-focus-options input:focus-visible + span {
  outline: 3px solid rgba(98, 92, 59, 0.26);
  outline-offset: 2px;
}

.task-workload-warning {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(182, 91, 76, 0.34);
  border-radius: 9px;
  background: #fff7f2;
  color: #6b3f35;
  font-size: 13px;
  line-height: 1.48;
}

.task-workload-warning p { margin: 0; }

.task-workload-warning label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #5c3028;
  font-weight: 750;
}

.task-workload-warning input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--olive);
}

body[data-page="review"] .review-shell {
  width: min(1280px, calc(100% - 32px));
  padding-top: 18px;
}

body[data-page="review"] .review-summary-bar {
  align-items: flex-start;
  padding: 13px 16px;
}

.review-summary-main,
.review-summary-context {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.review-summary-main h1 {
  font-size: 15px;
  font-weight: 900;
}

.review-summary-main > span {
  color: var(--olive-dark);
  font-size: 14px;
}

.review-summary-main small,
.review-summary-context span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-summary-context {
  justify-items: end;
  text-align: right;
}

body[data-page="review"] .review-keyboard-help {
  display: flex;
  justify-content: flex-end;
  gap: 6px 18px;
  flex-wrap: wrap;
  margin: 0 0 13px;
  text-align: right;
}

body[data-page="review"] .review-keyboard-help p { margin: 0; }

body[data-page="review"] .review-layout {
  grid-template-columns: minmax(0, 1fr) 238px;
  gap: 17px;
}

.review-center { min-width: 0; }

body[data-page="review"] .review-runner-host {
  min-height: 560px;
  padding: 34px;
  border-color: rgba(98, 92, 59, 0.24);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(245, 241, 231, 0.95));
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(57, 49, 32, 0.1);
}

body[data-page="review"] .review-runner-host .loading-state { color: var(--muted); }

body[data-page="review"] .review-runner-card {
  width: min(860px, 100%);
  color: var(--ink);
}

body[data-page="review"] .review-runner-head {
  border-bottom-color: rgba(98, 92, 59, 0.2);
}

body[data-page="review"] .review-runner-head h2 {
  color: var(--olive-dark);
}

body[data-page="review"] .audio-first-label { color: var(--olive-dark); }

body[data-page="review"] .review-word-meta,
body[data-page="review"] .runner-status,
body[data-page="review"] .review-core-en,
body[data-page="review"] .review-core-cn { color: var(--muted); }

body[data-page="review"] .review-example-cues,
body[data-page="review"] .review-full-meaning {
  border-top-color: rgba(98, 92, 59, 0.2);
}

body[data-page="review"] .review-example-cues h3 { color: var(--muted); }

body[data-page="review"] .review-example-cues p,
body[data-page="review"] .review-examples p {
  border-left-color: var(--olive);
  background: rgba(236, 232, 219, 0.72);
  color: var(--ink);
}

body[data-page="review"] .review-examples small { color: var(--muted); }

body[data-page="review"] .review-controls-host {
  min-height: 238px;
  padding: 14px;
  border-color: rgba(98, 92, 59, 0.22);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 12px 30px rgba(57, 49, 32, 0.08);
}

body[data-page="review"] .review-feedback {
  min-height: 58px;
  border-radius: 10px;
  font-size: 15px;
}

body[data-page="review"] .review-feedback.known { background: #e2efdc; border-color: #a8c49b; }
body[data-page="review"] .review-feedback.vague { background: #fff0d8; border-color: #e5bc79; }
body[data-page="review"] .review-feedback.unfamiliar { background: #e5eff6; border-color: #abc4d4; }

body[data-page="review"] .review-commit-wrap {
  display: grid;
  gap: 7px;
}

body[data-page="review"] .review-commit-wrap span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

body[data-page="review"] .review-commit-wrap .primary-btn {
  min-height: 48px;
  border-radius: 10px;
}

.challenge-progress-card {
  display: flex;
  align-items: baseline;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 12px 15px;
  border: 1px solid rgba(98, 92, 59, 0.2);
  border-radius: 10px;
  background: rgba(223, 232, 214, 0.52);
  color: var(--olive-dark);
}

.challenge-progress-card span { color: var(--muted); font-size: 13px; }

.challenge-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.completion-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.completion-check {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--olive);
  color: var(--paper);
  font-size: 24px;
  font-weight: 900;
}

.completion-streak {
  min-width: 128px;
  display: grid;
  justify-items: center;
  padding: 11px;
  border-left: 1px solid rgba(98, 92, 59, 0.2);
}

.completion-streak strong { color: var(--olive-dark); font-size: 32px; }
.completion-streak span { color: var(--muted); font-size: 11px; font-weight: 750; }
.completion-meta { color: var(--muted); font-size: 12px; }

.target-drawer-toggle {
  position: fixed;
  z-index: 92;
  left: 0;
  top: 48%;
  min-height: 98px;
  padding: 12px 8px;
  border: 1px solid rgba(98, 92, 59, 0.24);
  border-left: 0;
  border-radius: 0 9px 9px 0;
  background: var(--olive-dark);
  color: var(--paper);
  font-weight: 850;
  line-height: 1.3;
  writing-mode: vertical-rl;
  cursor: pointer;
  box-shadow: 6px 9px 22px rgba(57, 49, 32, 0.14);
}

.target-drawer-dialog {
  width: min(430px, calc(100vw - 24px));
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.target-drawer-dialog::backdrop { background: rgba(36, 33, 21, 0.3); backdrop-filter: blur(4px); }

.target-drawer-dialog .dialog-card {
  width: 100%;
  min-height: 100%;
  max-height: 100dvh;
  margin: 0;
  overflow: auto;
  border-radius: 0 14px 14px 0;
}

.target-drawer {
  display: grid;
  gap: 9px;
}

.target-drawer > header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
}

.target-drawer > header strong { color: var(--olive-dark); font-size: 22px; }

.target-row {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.78);
}

.target-row-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.target-row-head > div { display: grid; gap: 1px; }
.target-row-head strong { color: var(--olive-dark); font-size: 16px; }
.target-row-head span { color: var(--muted); font-size: 11px; font-weight: 750; }
.target-row-head > b { color: var(--olive-dark); font-size: 14px; }

.target-score-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(98, 92, 59, 0.12);
}

.target-score-track i { display: block; height: 100%; background: #c68c76; }
.target-row.mid .target-score-track i { background: #d2b85f; }
.target-row.high .target-score-track i,
.target-row.done .target-score-track i { background: #6e8d5b; }

.target-metrics {
  display: flex;
  gap: 5px 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.target-metrics b { color: var(--olive-dark); }

.retired-targets {
  margin-top: 5px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.retired-targets summary { color: var(--olive-dark); font-size: 12px; font-weight: 850; cursor: pointer; }
.retired-targets p { color: var(--muted); font-size: 11px; line-height: 1.45; }

.retired-target {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
}

.retired-target strong { color: var(--olive-dark); }

.migration-dialog .dialog-card { width: min(580px, calc(100vw - 30px)); }

.migration-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.migration-summary > div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.migration-summary strong { display: block; color: var(--olive-dark); font-size: 21px; }
.migration-summary span { color: var(--muted); font-size: 12px; font-weight: 750; }

.migration-warning {
  padding: 10px 12px;
  border-left: 3px solid #b65b4c;
  background: #fff7f2;
  color: #6b3f35;
  font-size: 13px;
}

.migration-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

body[data-page="review"] .state-tools {
  margin-top: 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.64);
}

body[data-page="review"] .state-tools summary {
  padding: 14px 17px;
  color: var(--olive-dark);
  font-weight: 850;
  cursor: pointer;
}

body[data-page="review"] .state-tools > p,
body[data-page="review"] .state-tools > .daily-actions { margin: 0 17px 15px; }

@media (max-width: 1080px) {
  body[data-page="home"] .unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .daily-content { grid-template-columns: 1fr; }
  .today-training { padding-right: 0; }
  .library-progress {
    margin-top: 20px;
    padding: 20px 0 0;
    border-top: 1px solid rgba(98, 92, 59, 0.2);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  body[data-page="home"] .daily-actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  body[data-page="home"] .home-shell {
    width: 100%;
    padding: 16px 12px 44px;
  }
  #dailyPlanDialog {
    width: calc(100vw - 20px);
    max-width: none;
    margin: auto 10px 10px;
  }
  .daily-plan-dialog-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 18px;
    border-radius: 16px 16px 10px 10px;
  }
  .daily-plan-dialog-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .daily-plan-dialog-tools {
    align-self: start;
  }
  #dailyPlanDialog .plan-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #dailyPlanDialog .unit-focus-control {
    grid-column: 1 / -1;
    min-width: 0;
  }
  body[data-page="review"] .review-summary-bar { display: grid; }
  .review-summary-context { justify-items: start; text-align: left; }
  body[data-page="review"] .review-keyboard-help { justify-content: flex-start; text-align: left; }
  body[data-page="review"] .review-layout { grid-template-columns: 1fr; padding-bottom: 112px; }
  body[data-page="review"] .review-runner-host { min-height: 500px; padding: 24px; }
  body[data-page="review"] .review-controls-host {
    position: fixed;
    z-index: 95;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    min-height: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(255, 253, 248, 0.97);
    box-shadow: 0 -9px 22px rgba(57, 49, 32, 0.13);
    backdrop-filter: blur(14px);
  }
  body[data-page="review"] .review-controls-host .review-control-panel {
    width: min(760px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 7px;
  }
  body[data-page="review"] .review-controls-host .review-feedback-row {
    flex: 1 1 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body[data-page="review"] .review-controls-host .review-feedback {
    min-height: 44px;
    padding: 7px 8px;
    font-size: 13px;
  }
  body[data-page="review"] .review-controls-host .review-commit-wrap {
    flex: 0 0 88px;
    margin: 0;
  }
  body[data-page="review"] .review-controls-host .review-commit-wrap span { display: none; }
  body[data-page="review"] .review-controls-host .review-commit-wrap .primary-btn {
    width: 100%;
    min-height: 44px;
    padding: 6px;
    font-size: 12px;
  }
}

@media (max-width: 620px) {
  body[data-page="home"] .home-shell { width: 100%; padding: 12px 10px 44px; }
  body[data-page="home"] .daily-panel { padding: 21px 18px 17px; }
  body[data-page="home"] .daily-actions { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 7px; }
  body[data-page="home"] .daily-actions .button { min-width: 0; padding-inline: 8px; font-size: 12px; white-space: nowrap; }
  body[data-page="home"] .unit-grid { grid-template-columns: 1fr; }
  .library-progress-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-progress-metrics,
  .library-forecast { grid-template-columns: 1fr; }
  .library-forecast div { min-height: 0; }
  .daily-help-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
  .plan-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-focus-control { grid-column: 1 / -1; min-width: 0; }
  .daily-plan-dialog-tools { gap: 6px; }
  .local-save-badge { padding-inline: 8px; }
  .unit-card-meta { gap: 6px; }
  .unit-exam-scope { font-size: 12px; }
  #dailyPlanDialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #dailyPlanDialog .dialog-actions .button { width: 100%; }
  .completion-title { grid-template-columns: auto minmax(0, 1fr); }
  .completion-streak { grid-column: 1 / -1; width: 100%; border-top: 1px solid rgba(98, 92, 59, 0.2); border-left: 0; }
  .migration-actions { display: grid; grid-template-columns: 1fr; }
  .migration-actions .button { width: 100%; }
}

@media (max-width: 390px) {
  body[data-page="review"] .review-shell { width: calc(100% - 20px); }
  body[data-page="review"] .review-runner-host { min-height: 440px; padding: 18px 14px; }
  body[data-page="review"] .review-runner-head h2 { font-size: clamp(41px, 14vw, 58px); }
  body[data-page="review"] .review-keyboard-help { font-size: 11px; line-height: 1.75; }
  .target-drawer-toggle { min-height: 82px; padding: 9px 6px; font-size: 12px; }
  .daily-completion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop learning workspace: compact reading rhythm with synchronized rails. */
.grouped-page,
body[data-page="reference"] {
  font-family: var(--font-learning);
}

.grouped-page .study-brand,
.grouped-page .study-hero h1,
.grouped-page .group-header h2,
.grouped-page .word-title-row h3,
body[data-page="reference"] .reference-hero h1,
body[data-page="reference"] .word-title-row h2,
.grouped-page .pron-ipa,
body[data-page="reference"] .pron-ipa {
  font-family: var(--font-learning);
}

.grouped-page .study-layout {
  grid-template-columns: 250px minmax(0, 1fr);
}

.grouped-page .study-main {
  width: min(980px, calc(100% - 30px));
}

.grouped-page .word-rail {
  display: none;
}

.grouped-page .group-word-nav {
  display: flex;
  margin-top: 9px;
}

.grouped-page .group-section {
  padding: 19px 22px;
}

.grouped-page .word-card,
body[data-page="reference"] .reference-card {
  margin: 11px 0;
  padding: 16px 17px;
}

.word-head,
.reference-head {
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 11px;
  padding-bottom: 10px;
}

.word-head-copy {
  min-width: 0;
}

.grouped-page .word-title-row h3,
body[data-page="reference"] .word-title-row h2 {
  font-size: clamp(28px, 3.2vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.018em;
}

.word-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px 9px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.word-meta-line .phonetic,
.word-meta-line .pos-summary,
.word-meta-line .core-cn {
  margin: 0;
  line-height: 1.4;
}

.word-meta-line .phonetic,
.word-meta-line .pos-summary {
  font-size: 13px;
}

.word-meta-line .pos-summary {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(98, 92, 59, 0.06);
}

.word-meta-line .core-cn {
  color: var(--body);
  font-size: 16px;
  font-weight: 800;
}

.word-head-copy > .core-en {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.word-meta-line .pronunciation-variants {
  gap: 5px;
  margin: 0;
}

.word-meta-line .pronunciation-variant {
  min-height: 30px;
  gap: 5px;
  padding: 3px 8px;
}

.word-meta-line .pron-ipa {
  font-size: 13px;
}

.memory-hint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  border-left: 3px solid rgba(98, 92, 59, 0.24);
  background: rgba(98, 92, 59, 0.035);
}

.memory-hint h4,
.memory-hint p {
  margin: 0;
}

.memory-hint h4 {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.memory-hint p {
  color: var(--cn);
  font-size: 14px;
  line-height: 1.5;
}

.learning-block {
  margin-top: 11px;
  padding: 10px 0 2px 12px;
}

.learning-block h4,
.learning-block h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.usage-group {
  padding: 10px 0;
}

.usage-focus {
  margin: 4px 0 6px;
}

.usage-scenario {
  margin: 4px 0 7px;
  color: var(--cn);
}

.usage-scenario > span {
  margin-right: 7px;
  color: var(--olive-dark);
  font-size: 11px;
  font-weight: 900;
}

.example {
  position: relative;
  margin: 7px 0;
  padding: 9px 47px 9px 11px;
}

.example-sentence {
  line-height: 1.55;
}

.example .example-translation-disclosure {
  margin: 0;
}

.example-translation-disclosure > summary {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--olive-dark);
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.example-translation-disclosure > summary::-webkit-details-marker {
  display: none;
}

.example-translation-disclosure > summary:hover,
.example-translation-disclosure[open] > summary {
  border-color: var(--olive);
  background: var(--olive-soft);
}

.example-translation-disclosure > summary:focus-visible {
  outline: 3px solid rgba(98, 92, 59, 0.28);
  outline-offset: 2px;
}

.example-detail {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.example-detail .detail-label {
  margin-top: 5px;
}

.example-detail .translation,
.example-detail .teaching-note {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.5;
}

.learning-disclosure {
  margin-top: 10px;
}

.learning-disclosure > summary {
  min-height: 40px;
  padding: 7px 2px;
}

.learning-disclosure[open] > summary {
  margin-bottom: 6px;
}

.meaning-relation-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meaning-relation-card,
.meaning-relation-card[data-relation-tone] {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.meaning-relation-card:first-child {
  border-top: 0;
}

.meaning-relation-card__title {
  margin: 0;
  padding: 9px 8px;
  border-right: 1px solid var(--line);
  background: rgba(98, 92, 59, 0.045);
  color: var(--olive-dark);
  font-size: 12px;
  line-height: 1.35;
}

.meaning-relation-card .mini-item {
  grid-template-columns: minmax(112px, 155px) minmax(190px, 1fr) minmax(135px, 0.72fr);
  gap: 8px;
  padding: 8px 10px;
}

.meaning-relation-card .mini-word,
.meaning-relation-card .mini-example {
  font-family: var(--font-learning);
}

.meaning-relation-card .mini-meaning,
.meaning-relation-card .mini-note,
.meaning-relation-card .mini-example {
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 1280px) {
  .grouped-page .study-layout {
    grid-template-columns: 250px minmax(0, 1fr) 210px;
  }

  .grouped-page .word-rail {
    display: block;
    padding: 18px 12px 28px;
  }

  .grouped-page .group-word-nav {
    display: none;
  }

  .grouped-page .word-rail h2 {
    font-size: 17px;
  }

  .grouped-page .word-rail > p {
    margin-bottom: 10px;
  }

  .grouped-page .word-rail .word-jump {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  .meaning-relation-card {
    grid-template-columns: 1fr;
  }

  .meaning-relation-card__title {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .meaning-relation-card .mini-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (forced-colors: active) {
  .meaning-relation-card,
  .meaning-relation-list,
  .example-translation-disclosure > summary {
    border: 1px solid CanvasText;
    background: Canvas;
    box-shadow: none;
  }
}
