:root {
  --brand-blue: #256c9b;
  --brand-blue-strong: #1d5d87;
  --brand-blue-ink: #15486a;
  --brand-blue-soft: #deedf6;
  --brand-blue-pale: #f1f8fc;
  --brand-orange: #e4572e;
  --brand-orange-strong: #c94720;
  --brand-orange-ink: #a93a19;
  --brand-orange-soft: #fdece6;
  --success: #2a704f;
  --success-soft: #eaf5ef;
  --warning: #8a6515;
  --warning-soft: #fff5dc;
  --info-blue: #26789a;
  --info-blue-ink: #245e78;
  --info-blue-soft: #e8f2f7;
  --forest-950: #19252e;
  --forest-900: var(--brand-blue);
  --forest-800: var(--brand-blue-strong);
  --forest-700: var(--brand-blue-ink);
  --forest-100: var(--brand-blue-soft);
  --forest-50: var(--brand-blue-pale);
  --ink-950: #182128;
  --ink-800: #343f46;
  --ink-600: #5f6c74;
  --ink-500: #7f8c94;
  --paper: #f4f7f9;
  --white: #ffffff;
  --line: #dfe7eb;
  --line-strong: #c8d6dd;
  --gold: var(--brand-orange);
  --gold-soft: var(--brand-orange-soft);
  --coral: var(--brand-orange-strong);
  --coral-soft: var(--brand-orange-soft);
  --blue-soft: var(--brand-blue-pale);
  --shadow-sm: 0 1px 2px rgba(26, 53, 69, 0.06);
  --shadow-md: 0 16px 40px rgba(26, 53, 69, 0.12);
  --shadow-book: 0 22px 44px rgba(26, 53, 69, 0.18);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink-950);
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

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

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

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--gold-soft);
  color: var(--forest-950);
}

:focus-visible {
  outline: 3px solid rgba(38, 120, 154, 0.58);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--white);
  color: var(--forest-900);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(203, 211, 205, 0.8);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, calc(100% - 48px));
  height: var(--header-height);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand--wordmark {
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-flower {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-copy--wordmark {
  gap: 3px;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.brand-copy .brand-name strong {
  color: var(--brand-blue-ink);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 0.9;
}

.brand-name span {
  color: var(--brand-orange);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy.brand-copy--wordmark small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 700;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--forest-900);
  color: var(--white);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.brand-mark::before {
  position: absolute;
  right: -9px;
  bottom: -10px;
  width: 25px;
  height: 25px;
  border: 5px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  content: "";
}

.brand-mark span {
  position: relative;
  z-index: 1;
  margin-top: -2px;
}

.brand-mark i {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.brand-copy strong {
  color: var(--forest-950);
  font-size: 16px;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 800;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-link,
.nav-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

.nav-link {
  padding: 0 13px;
}

.nav-action {
  padding: 0 12px;
}

.nav-link:hover,
.nav-action:hover {
  background: var(--forest-50);
  color: var(--forest-900);
}

.nav-action svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.nav-action kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-500);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.nav-action--icon {
  position: relative;
  width: 38px;
  padding: 0;
}

.favorite-count {
  position: absolute;
  top: 2px;
  right: 1px;
  display: none;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: var(--coral);
  color: var(--white);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.favorite-count.has-items {
  display: grid;
}

.mobile-book-bar {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

#mainContent {
  min-height: calc(100vh - var(--header-height));
}

.app-loading {
  display: grid;
  min-height: 60vh;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--ink-500);
}

.app-loading p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.loading-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--forest-900);
  color: var(--white);
  font-family: var(--serif);
  font-size: 32px;
  animation: loadingPulse 1.4s ease-in-out infinite;
}

@keyframes loadingPulse {
  50% {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(21, 63, 53, 0.2);
  }
}

.home-hero {
  position: relative;
  overflow: hidden;
  background: var(--forest-900);
  color: var(--white);
}

.home-hero::after {
  position: absolute;
  right: -75px;
  bottom: -150px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 52px rgba(255, 255, 255, 0.035),
    0 0 0 104px rgba(255, 255, 255, 0.025);
  content: "";
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 70px 0 90px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 72px;
  align-items: end;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.eyebrow::before {
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
}

.hero-eyebrow {
  margin-bottom: 21px;
}

.home-hero h1 {
  max-width: 800px;
  margin: 0;
  color: var(--white);
  font-size: clamp(44px, 5.4vw, 76px);
  font-weight: 700;
  line-height: 1.07;
}

.home-hero h1 span {
  color: #dcebdd;
}

.hero-description {
  max-width: 610px;
  margin: 23px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 31px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

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

.button--primary {
  background: var(--gold);
  color: var(--forest-950);
}

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

.button--ghost-light {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--white);
}

.button--ghost-light:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.button--forest {
  background: var(--forest-900);
  color: var(--white);
}

.button--forest:hover {
  background: var(--forest-800);
}

.button--outline {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--forest-900);
}

.button--outline:hover {
  border-color: var(--forest-700);
}

.hero-progress {
  display: flex;
  width: 250px;
  flex-direction: column;
  gap: 14px;
  padding-left: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 700;
}

.hero-progress-label strong {
  color: var(--white);
  font-size: 26px;
  font-weight: 700;
}

.hero-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.hero-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 300ms ease;
}

.hero-progress small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.5;
}

.library-section {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 88px;
}

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

.section-heading h2 {
  margin: 7px 0 0;
  color: var(--forest-950);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
}

.section-heading p {
  max-width: 500px;
  margin: 0;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.65;
}

.library-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.stat-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 700;
}

.stat-pill strong {
  color: var(--forest-900);
  font-size: 13px;
}

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

.book-card {
  min-width: 0;
}

.book-cover-link {
  position: relative;
  display: block;
  width: min(100%, 300px);
  padding: 0;
  border: 0;
  aspect-ratio: 0.72;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--forest-900);
  box-shadow: var(--shadow-book);
  color: var(--white);
  cursor: pointer;
  text-align: left;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.book-cover-link::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: inherit;
  box-shadow: inset 8px 0 0 rgba(255, 255, 255, 0.05);
  content: "";
  pointer-events: none;
}

.book-card--ready .book-cover-link:hover {
  transform: translateY(-6px) rotate(-0.3deg);
  box-shadow: 0 30px 56px rgba(15, 44, 38, 0.25);
}

.book-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.book-cover-image--contact1 {
  opacity: 1;
}

.book-cover-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 44%;
  padding: 54px 20px 19px;
  background: linear-gradient(to bottom, transparent, rgba(10, 34, 29, 0.98) 50%);
}

.book-cover-overlay small {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 8px;
  font-weight: 800;
}

.book-cover-overlay strong {
  display: block;
  color: var(--white);
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.05;
}

.book-cover-overlay span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.book-cover-corner {
  position: absolute;
  top: 16px;
  left: 15px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 5px;
  background: rgba(15, 44, 38, 0.68);
  color: var(--white);
  font-size: 8px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.book-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--book-accent, var(--forest-900));
}

.book-cover-placeholder::before {
  position: absolute;
  top: 22%;
  right: -18%;
  width: 75%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(255, 255, 255, 0.05),
    0 0 0 56px rgba(255, 255, 255, 0.035);
  content: "";
}

.placeholder-series {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 800;
}

.placeholder-main {
  position: relative;
  z-index: 1;
}

.placeholder-main span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 800;
}

.placeholder-main strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 56px);
  line-height: 0.95;
}

.placeholder-main small {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.placeholder-edition {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 700;
}

.book-info {
  max-width: 320px;
  margin: 0 auto;
}

.book-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.status-badge--ready {
  color: var(--forest-700);
}

.status-badge--ready::before {
  background: #4f9a73;
  box-shadow: 0 0 0 4px rgba(79, 154, 115, 0.1);
}

.status-badge--preparing {
  color: #9c7021;
}

.status-badge--preparing::before {
  background: var(--gold);
}

.book-info h3 {
  margin: 11px 0 4px;
  color: var(--forest-950);
  font-size: 21px;
  font-weight: 800;
}

.book-info > p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.65;
}

.book-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0 0;
}

.book-meta-line span {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 700;
}

.book-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.book-card-progress .track {
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.book-card-progress .track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-700);
}

.book-card-progress span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.book-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.book-card-actions .button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 11px;
}

.upcoming-strip {
  display: grid;
  margin-top: 54px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: 205px 1fr;
  gap: 30px;
  align-items: center;
}

.upcoming-strip h3 {
  margin: 0;
  color: var(--forest-900);
  font-size: 14px;
}

.upcoming-strip p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

.upcoming-books {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.upcoming-books span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 700;
}

/* Study layout */
.study-layout {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  grid-template-columns: 312px minmax(0, 1fr);
}

.study-sidebar {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: flex;
  height: calc(100vh - var(--header-height));
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--white);
}

.sidebar-summary {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-back:hover {
  color: var(--forest-900);
}

.sidebar-back svg {
  width: 14px;
  height: 14px;
}

.sidebar-book-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-book-title h1 {
  margin: 0;
  color: var(--forest-950);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-book-title p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.level-badge {
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--forest-100);
  color: var(--forest-800);
  font-size: 9px;
  font-weight: 800;
}

.sidebar-progress {
  margin-top: 17px;
}

.sidebar-progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.sidebar-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.sidebar-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-700);
}

.sidebar-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px 8px;
}

.sidebar-directory-head strong {
  color: var(--ink-800);
  font-size: 10px;
}

.sidebar-directory-head span {
  color: var(--ink-500);
  font-size: 9px;
}

.chapter-scroll {
  min-height: 0;
  padding: 2px 10px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chapter-item {
  border-bottom: 1px solid #edf0ed;
}

.chapter-toggle {
  display: grid;
  width: 100%;
  min-height: 53px;
  padding: 8px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-800);
  cursor: pointer;
  grid-template-columns: 30px minmax(0, 1fr) auto 16px;
  gap: 8px;
  align-items: center;
  text-align: left;
}

.chapter-toggle:hover {
  background: var(--forest-50);
}

.chapter-number {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
}

.chapter-toggle-copy {
  min-width: 0;
}

.chapter-toggle-copy strong {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-toggle-copy small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-word-count {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 700;
}

.chapter-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--ink-500);
  transition: transform 160ms ease;
}

.chapter-item.is-open > .chapter-toggle {
  color: var(--forest-900);
}

.chapter-item.is-open > .chapter-toggle .chapter-number {
  border-color: var(--forest-900);
  background: var(--forest-900);
  color: var(--white);
}

.chapter-item.is-open > .chapter-toggle svg {
  transform: rotate(180deg);
}

.chapter-panel {
  display: none;
  padding: 0 0 10px 39px;
}

.chapter-item.is-open .chapter-panel {
  display: block;
}

.part-block {
  padding: 7px 6px 7px 0;
}

.part-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.part-title strong {
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
}

.part-title small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-button {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 9px;
  text-align: left;
}

.group-button:hover {
  background: var(--forest-50);
  color: var(--forest-900);
}

.group-button.is-active {
  background: var(--forest-100);
  color: var(--forest-900);
  font-weight: 800;
}

.group-button small {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 600;
}

.study-main {
  min-width: 0;
  background: var(--paper);
}

.workspace-topbar {
  position: sticky;
  top: var(--header-height);
  z-index: 15;
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 242, 0.95);
  backdrop-filter: blur(12px);
}

.workspace-context {
  min-width: 0;
}

.workspace-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.workspace-breadcrumb span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.workspace-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
}

.workspace-title-line h2 {
  overflow: hidden;
  margin: 0;
  color: var(--forest-950);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-label {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink-600);
  font-size: 8px;
  font-weight: 800;
}

.workspace-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.view-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.view-switcher button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.view-switcher button.is-active {
  background: var(--forest-900);
  color: var(--white);
}

.view-switcher svg {
  width: 13px;
  height: 13px;
}

.mobile-directory-button {
  display: none;
}

.workspace-content {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 56px) 130px;
}

.study-panel {
  animation: panelIn 220ms ease both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.flashcard-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.word-card {
  position: relative;
  width: 100%;
  max-width: 860px;
  min-height: 580px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(15, 44, 38, 0.07);
}

.word-card-top {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid #edf0ed;
}

.word-position {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.word-position strong {
  color: var(--forest-900);
  font-size: 12px;
}

.word-position > span {
  font-size: 9px;
  white-space: nowrap;
}

.word-position-track {
  width: 72px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.word-position-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-700);
  transition: width 180ms ease;
}

.word-card-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-600);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--forest-50);
  color: var(--forest-900);
}

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

.icon-button--small {
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--paper);
}

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

.icon-button.is-active {
  border-color: var(--forest-900);
  background: var(--forest-900);
  color: var(--white);
}

.word-main {
  display: grid;
  min-height: 332px;
  padding: 52px 56px 38px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.word-kicker {
  margin-bottom: 15px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
}

.word-dutch {
  max-width: 100%;
  margin: 0;
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 74px);
  font-weight: 700;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.word-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.word-detail span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--forest-50);
  color: var(--forest-800);
  font-size: 9px;
  font-weight: 700;
}

.word-speak {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 25px;
  padding: 0 15px;
  border: 1px solid var(--forest-900);
  border-radius: 6px;
  background: var(--forest-900);
  color: var(--white);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.word-speak:hover {
  transform: translateY(-1px);
  background: var(--forest-800);
}

.word-speak.is-speaking svg {
  animation: soundPulse 650ms ease-in-out infinite alternate;
}

@keyframes soundPulse {
  to {
    opacity: 0.5;
    transform: scale(0.88);
  }
}

.word-speak svg {
  width: 17px;
  height: 17px;
}

.word-chinese {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--ink-800);
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 600;
  line-height: 1.65;
}

.example-band {
  padding: 28px 42px 32px;
  border-top: 1px solid var(--line);
  background: #f8f8f3;
}

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

.example-heading-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.example-heading strong {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
}

.source-badge {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--gold-soft);
  color: #785719;
  font-size: 8px;
  font-weight: 800;
}

.example-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
}

.example-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.example-marker i {
  display: block;
  width: 1px;
  min-height: 42px;
  background: var(--line-strong);
}

.example-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  color: var(--forest-900);
  font-size: 9px;
  font-weight: 800;
}

.example-copy p {
  margin: 0;
}

.example-dutch {
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.5;
}

.example-chinese {
  margin-top: 9px !important;
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.7;
}

.example-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
}

.small-audio-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  color: var(--forest-900);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.small-audio-button:hover {
  border-color: var(--forest-700);
}

.small-audio-button svg {
  width: 14px;
  height: 14px;
}

.audio-status {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 600;
}

.flashcard-controls {
  display: grid;
  width: 100%;
  max-width: 860px;
  margin-top: 16px;
  grid-template-columns: 46px 46px minmax(0, 1fr) 46px 46px;
  gap: 8px;
}

.control-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--forest-900);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-size: 10px;
  font-weight: 800;
}

.control-button:hover {
  border-color: var(--line-strong);
  background: var(--forest-50);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.control-button--square {
  width: 46px;
  padding: 0;
}

.control-button--play {
  min-width: 0;
  background: var(--forest-900);
  color: var(--white);
}

.control-button--play:hover {
  border-color: var(--forest-900);
  background: var(--forest-800);
}

.control-button.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--forest-950);
}

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

.controls-note {
  display: flex;
  width: 100%;
  max-width: 860px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
  color: var(--ink-500);
  font-size: 8px;
}

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

.controls-note kbd {
  min-width: 18px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink-600);
  font-family: var(--sans);
  font-size: 8px;
  text-align: center;
}

/* Vocabulary list view */
.word-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.word-list-head h3 {
  margin: 0;
  color: var(--forest-950);
  font-size: 24px;
  font-weight: 800;
}

.word-list-head p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.word-row {
  display: grid;
  width: 100%;
  min-height: 88px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: inherit;
  cursor: pointer;
  grid-template-columns: 44px minmax(180px, 0.9fr) minmax(180px, 1.35fr) auto;
  gap: 18px;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease;
}

.word-row:hover {
  border-color: var(--line-strong);
  transform: translateX(2px);
}

.word-row-index {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.word-row-dutch strong {
  display: block;
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
}

.word-row-chinese {
  color: var(--ink-800);
  font-size: 12px;
  line-height: 1.6;
}

.word-row-chinese small {
  display: block;
  margin-top: 4px;
  color: var(--ink-500);
  font-family: var(--serif);
  font-size: 11px;
}

.word-row-actions {
  display: flex;
  gap: 5px;
}

.word-row-actions .icon-button {
  width: 32px;
  height: 32px;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--ink-500);
  text-align: center;
}

.empty-state svg {
  width: 25px;
  height: 25px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  color: var(--ink-800);
  font-size: 15px;
}

.empty-state p {
  font-size: 11px;
}

/* Dialogs and overlays */
dialog {
  padding: 0;
  border: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(15, 44, 38, 0.48);
  backdrop-filter: blur(4px);
}

.command-dialog {
  width: min(680px, calc(100% - 32px));
  margin-top: min(14vh, 130px);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.command-shell {
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
}

.command-head {
  display: grid;
  padding: 20px 22px 14px;
  grid-template-columns: 27px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.command-head > svg {
  width: 19px;
  height: 19px;
  color: var(--forest-900);
}

.command-head h2 {
  margin: 0;
  color: var(--forest-950);
  font-size: 16px;
}

.command-head p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 9px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 22px 14px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
}

.search-field:focus-within {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 3px rgba(40, 101, 82, 0.1);
}

.search-field input {
  min-width: 0;
  flex: 1;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-950);
  font-size: 14px;
}

.search-field input::placeholder {
  color: #98a29d;
}

.search-field kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink-500);
  font-family: var(--sans);
  font-size: 8px;
}

.search-hint {
  margin: 0 22px 13px;
  color: var(--ink-500);
  font-size: 9px;
}

.search-results {
  max-height: min(54vh, 480px);
  padding: 0 10px 12px;
  overflow-y: auto;
}

.search-result {
  display: grid;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--forest-50);
}

.search-result strong {
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 18px;
}

.search-result p {
  margin: 3px 0 0;
  color: var(--ink-600);
  font-size: 10px;
}

.search-result-meta {
  align-self: center;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
}

.favorites-dialog {
  width: min(620px, calc(100% - 32px));
  margin-top: min(10vh, 90px);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.favorites-shell {
  max-height: min(78vh, 760px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
}

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

.dialog-heading h2 {
  margin: 7px 0 0;
  color: var(--forest-950);
  font-size: 22px;
}

.favorites-list {
  max-height: calc(min(78vh, 760px) - 83px);
  padding: 12px;
  overflow-y: auto;
}

.favorite-item {
  display: grid;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  text-align: left;
}

.favorite-item:hover {
  background: var(--forest-50);
}

.favorite-item strong {
  color: var(--forest-950);
  font-family: var(--serif);
  font-size: 19px;
}

.favorite-item p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 10px;
}

.favorite-item small {
  align-self: center;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 700;
}

.settings-popover {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: max(16px, calc((100vw - 1320px) / 2));
  z-index: 80;
  width: min(350px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  animation: popoverIn 150ms ease both;
}

@keyframes popoverIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

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

.popover-heading h2 {
  margin: 5px 0 0;
  color: var(--forest-950);
  font-size: 18px;
}

.control-group {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.control-group legend {
  margin-bottom: 9px;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 4px;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 700;
}

.segmented-control small {
  color: var(--ink-500);
  font-size: 8px;
}

.segmented-control input:checked + span {
  background: var(--white);
  color: var(--forest-900);
  box-shadow: var(--shadow-sm);
}

.range-control {
  display: block;
  margin-bottom: 20px;
}

.range-control > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  font-size: 10px;
}

.range-control strong {
  color: var(--ink-600);
  font-size: 9px;
}

.range-control output {
  color: var(--forest-900);
  font-size: 10px;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  accent-color: var(--forest-800);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--ink-500);
  font-size: 8px;
}

.switch-row {
  display: grid;
  min-height: 50px;
  align-items: center;
  border-top: 1px solid var(--line);
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 12px;
}

.switch-row--highlight {
  margin-bottom: 4px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: var(--ink-800);
  font-size: 10px;
}

.switch-row small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 8px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 150ms ease;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  content: "";
  transition: transform 150ms ease;
}

.switch-row input:checked + i {
  background: var(--forest-800);
}

.switch-row input:checked + i::after {
  transform: translateX(14px);
}

.voice-status {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 5px;
  background: var(--forest-50);
  color: var(--forest-800);
  font-size: 8px;
  line-height: 1.5;
}

.voice-status.is-fallback {
  background: var(--gold-soft);
  color: #765316;
}

.voice-status svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.mobile-scrim {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 18;
  background: rgba(15, 44, 38, 0.45);
  backdrop-filter: blur(2px);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  max-width: min(380px, calc(100vw - 40px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 5px;
  background: var(--forest-950);
  color: var(--white);
  box-shadow: var(--shadow-md);
  font-size: 10px;
  line-height: 1.5;
  animation: toastIn 170ms ease both;
}

.toast svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.toast.is-leaving {
  animation: toastOut 170ms ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

.study-sidebar-close {
  display: none;
}

@media (max-width: 1120px) {
  .home-hero-inner {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 44px;
  }

  .hero-progress {
    width: 210px;
  }

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

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

  .word-main {
    padding-right: 36px;
    padding-left: 36px;
  }

  .example-band {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .header-inner,
  .home-hero-inner,
  .library-section {
    width: min(100% - 32px, 720px);
  }

  .brand-copy small {
    display: none;
  }

  .nav-link {
    display: none;
  }

  .nav-action {
    width: 38px;
    padding: 0;
  }

  .nav-action span:not(.favorite-count),
  .nav-action kbd {
    display: none;
  }

  .home-hero-inner {
    padding: 54px 0 66px;
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-progress {
    width: min(100%, 420px);
    padding: 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
  }

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

  .study-layout {
    display: block;
    min-height: calc(100vh - var(--header-height));
  }

  .study-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(340px, calc(100vw - 48px));
    height: auto;
    transform: translateX(-102%);
    box-shadow: var(--shadow-md);
    transition: transform 220ms ease;
  }

  body.is-directory-open .study-sidebar {
    transform: translateX(0);
  }

  .study-sidebar-close {
    display: inline-grid;
  }

  .mobile-directory-button {
    display: inline-flex;
  }

  .workspace-topbar {
    top: var(--header-height);
    padding-right: 20px;
    padding-left: 20px;
  }

  .workspace-content {
    padding-top: 24px;
  }

  .word-list-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .header-inner {
    width: calc(100% - 24px);
  }

  .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .home-hero-inner,
  .library-section {
    width: calc(100% - 28px);
  }

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

  .hero-description {
    font-size: 14px;
  }

  .library-section {
    padding-top: 38px;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  .book-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .book-cover-link {
    width: min(100%, 270px);
  }

  .book-info {
    width: min(100%, 320px);
  }

  .upcoming-strip {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .workspace-topbar {
    min-height: 58px;
    gap: 10px;
  }

  .workspace-breadcrumb {
    display: none;
  }

  .workspace-title-line {
    margin-top: 0;
  }

  .workspace-title-line h2 {
    max-width: 42vw;
    font-size: 13px;
  }

  .workspace-actions {
    gap: 5px;
  }

  .view-switcher button {
    width: 32px;
    padding: 0;
  }

  .view-switcher button span {
    display: none;
  }

  .workspace-content {
    padding: 16px 12px 120px;
  }

  .word-card {
    min-height: 0;
    border-radius: 7px;
  }

  .word-card-top {
    min-height: 51px;
    padding: 10px 13px;
  }

  .word-position-track {
    width: 47px;
  }

  .word-main {
    min-height: 310px;
    padding: 36px 18px 31px;
  }

  .word-dutch {
    font-size: clamp(40px, 13vw, 55px);
  }

  .word-chinese {
    margin-top: 19px;
    font-size: 20px;
  }

  .example-band {
    padding: 23px 18px 25px;
  }

  .example-node {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
  }

  .example-number {
    width: 24px;
    height: 24px;
  }

  .example-dutch {
    font-size: 20px;
  }

  .flashcard-controls {
    grid-template-columns: 42px 42px minmax(0, 1fr) 42px 42px;
    gap: 5px;
  }

  .control-button {
    min-height: 42px;
  }

  .control-button--square {
    width: 42px;
  }

  .control-button--play span {
    display: none;
  }

  .controls-note {
    display: none;
  }

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

  .word-row-chinese {
    display: none;
  }

  .word-row-dutch strong {
    font-size: 18px;
  }

  .command-dialog {
    margin-top: 5vh;
  }

  .settings-popover {
    top: calc(var(--header-height) + 5px);
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - var(--header-height) - 13px);
    overflow-y: auto;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
  }
}

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

/* Simplified learning-first interface */
.library-kicker {
  display: block;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
}

.library-intro {
  display: grid;
  align-items: center;
  padding: 38px max(24px, calc((100vw - 1320px) / 2)) 42px;
  background: var(--forest-900);
  color: var(--white);
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  gap: clamp(42px, 8vw, 120px);
}

.library-intro-copy h1 {
  margin: 10px 0 0;
  color: var(--white);
  font-size: clamp(36px, 4.2vw, 52px);
  font-weight: 700;
  line-height: 1.08;
}

.library-intro-copy p {
  margin: 13px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.7;
}

.continue-card {
  position: relative;
  display: flex;
  min-height: 138px;
  flex-direction: column;
  justify-content: center;
  padding: 22px 52px 22px 25px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
  transition: background 160ms ease, border-color 160ms ease;
}

.continue-card:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.085);
}

.continue-card > svg {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}

.continue-card-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 800;
}

.continue-card-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: 9px;
}

.continue-card-main strong {
  font-size: 17px;
  font-weight: 700;
}

.continue-card-main span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

.continue-card-track {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.continue-card-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.continue-card small {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
}

.library-section--simple {
  padding-top: 44px;
}

.section-heading--simple {
  align-items: flex-end;
  margin-bottom: 24px;
}

.section-heading--simple .library-kicker {
  color: var(--forest-700);
}

.section-heading--simple h2 {
  margin-top: 7px;
  font-size: 28px;
}

.section-heading--simple p {
  max-width: none;
  font-size: 11px;
}

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

.featured-book-grid--primary {
  display: block;
}

.book-card--primary {
  display: grid;
  max-width: 880px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(31, 75, 102, 0.08);
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  gap: 36px;
}

.book-card--primary .book-cover-link {
  width: 100%;
  max-width: 270px;
  margin: 0;
}

.book-card--primary .book-info {
  width: 100%;
  max-width: none;
}

.book-card--primary .book-info h3 {
  margin-top: 12px;
  font-size: 28px;
}

.book-card--primary .book-info > p {
  max-width: 470px;
  font-size: 13px;
}

.book-card--primary .book-card-actions {
  margin-top: 24px;
}

.book-card--primary .book-card-actions .button {
  width: auto;
  min-width: 170px;
  min-height: 44px;
  padding: 0 20px;
  font-size: 12px;
}

.featured-book-grid .book-card--primary .book-info {
  max-width: none;
}

.featured-book-grid .book-card--primary .book-info > p {
  max-width: 470px;
}

.featured-book-grid .book-card--primary .book-card-actions .button {
  width: auto;
}

.featured-book-grid .book-cover-link {
  width: min(100%, 255px);
  margin-bottom: 16px;
  box-shadow: 0 18px 38px rgba(15, 44, 38, 0.16);
}

.featured-book-grid .book-cover-overlay {
  min-height: 40%;
  padding: 45px 17px 16px;
}

.featured-book-grid .book-cover-overlay strong {
  font-size: 27px;
}

.featured-book-grid .book-info {
  max-width: 255px;
}

.featured-book-grid .book-info h3 {
  font-size: 19px;
}

.featured-book-grid .book-info > p {
  max-width: 250px;
}

.featured-book-grid .book-card-actions .button {
  width: 100%;
}

.more-books {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.more-books-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.more-books-head h3 {
  margin: 0;
  color: var(--ink-800);
  font-size: 13px;
}

.more-books-head span {
  color: var(--ink-500);
  font-size: 9px;
}

.more-book-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.upcoming-materials .more-book-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-book-row {
  display: grid;
  min-height: 62px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: inherit;
  grid-template-columns: 35px minmax(0, 1fr) auto 15px;
  gap: 10px;
  transition: border-color 150ms ease, transform 150ms ease;
}

.compact-book-row:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.compact-book-mark {
  display: grid;
  width: 35px;
  height: 42px;
  place-items: center;
  border-radius: 4px;
  background: var(--book-accent, var(--forest-900));
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
}

.compact-book-copy {
  min-width: 0;
}

.compact-book-copy strong,
.compact-book-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-book-copy strong {
  color: var(--forest-950);
  font-size: 12px;
}

.compact-book-copy small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.compact-book-status {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.compact-book-row > svg {
  width: 14px;
  height: 14px;
  color: var(--ink-500);
}

.nav-action kbd {
  display: none;
}

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

.study-sidebar .sidebar-summary {
  padding-top: 19px;
  padding-bottom: 16px;
}

.study-sidebar .chapter-toggle {
  min-height: 49px;
}

.workspace-topbar {
  min-height: 58px;
  padding-top: 9px;
  padding-bottom: 9px;
  background: rgba(255, 255, 255, 0.96);
}

.workspace-breadcrumb {
  display: none;
}

.workspace-title-line {
  margin-top: 0;
}

.workspace-title-line h2 {
  font-size: 14px;
}

.workspace-word-count {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.workspace-content {
  width: min(100%, 920px);
  padding-top: 28px;
  padding-bottom: 76px;
}

.word-card {
  max-width: 800px;
  min-height: 0;
  box-shadow: 0 10px 30px rgba(15, 44, 38, 0.055);
}

.word-card-top {
  min-height: 52px;
  padding: 10px 17px;
}

.word-card-tools {
  gap: 3px;
}

.word-card-tools .icon-button {
  width: 34px;
  height: 34px;
  border-color: transparent;
}

.word-card-tools .icon-button:hover {
  border-color: var(--line);
}

.word-main {
  min-height: 300px;
  padding: 40px 44px 31px;
}

.word-kicker {
  margin-bottom: 10px;
  color: var(--ink-500);
  font-size: 8px;
}

.word-headline {
  display: flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.word-dutch {
  font-size: clamp(44px, 5.3vw, 64px);
}

.word-audio-orb {
  display: inline-grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  min-height: 43px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--forest-100);
  color: var(--forest-900);
}

.word-audio-orb:hover {
  transform: none;
  background: #d7e6dd;
}

.word-audio-orb svg {
  width: 18px;
  height: 18px;
}

.word-chinese {
  margin-top: 18px;
  font-size: clamp(19px, 2vw, 23px);
}

.example-band {
  padding: 24px 34px 26px;
}

.example-band--review {
  min-height: 112px;
}

.source-badge--review {
  background: #f0f3f5;
  color: var(--ink-600);
}

.example-review-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dce7ec;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-600);
}

.example-review-state > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--brand-blue-strong);
}

.example-review-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.example-review-state strong {
  color: var(--ink-800);
  font-size: 12px;
  white-space: nowrap;
}

.example-review-copy span {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-heading {
  margin-bottom: 15px;
}

.example-node {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
}

.example-dutch {
  font-size: 21px;
}

.example-chinese {
  margin-top: 7px !important;
}

.example-actions {
  margin-top: 13px;
}

.small-audio-button {
  min-height: 31px;
  border-color: transparent;
  background: var(--white);
  color: var(--ink-600);
  font-size: 8px;
}

.flashcard-controls {
  max-width: 800px;
  margin-top: 13px;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 7px;
}

.flashcard-controls .control-button {
  min-height: 48px;
}

.flashcard-controls .control-button--play {
  font-size: 10px;
}

.flashcard-stage {
  gap: 0;
}

@media (max-width: 1120px) {
  .library-intro {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
    gap: 54px;
  }

  .featured-book-grid {
    gap: 24px;
  }

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

@media (max-width: 900px) {
  .library-intro {
    padding-right: 24px;
    padding-left: 24px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .library-intro-copy h1 {
    font-size: 42px;
  }

  .continue-card {
    width: min(100%, 520px);
  }

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

  .featured-book-grid .book-cover-link,
  .featured-book-grid .book-info {
    width: 100%;
    max-width: none;
  }

  .featured-book-grid .book-cover-link {
    aspect-ratio: 0.74;
  }
}

@media (max-width: 700px) {
  .library-intro {
    padding: 28px 16px 30px;
  }

  .library-intro-copy h1 {
    font-size: 36px;
  }

  .library-intro-copy p {
    max-width: 290px;
  }

  .continue-card {
    min-height: 126px;
    padding: 18px 44px 18px 18px;
  }

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

  .library-section--simple {
    width: calc(100% - 28px);
    padding-top: 32px;
  }

  .section-heading--simple {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .section-heading--simple p {
    display: none;
  }

  .featured-book-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .featured-book-grid .book-card {
    display: grid;
    min-height: 152px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
  }

  .featured-book-grid--primary .book-card--primary {
    max-width: none;
    min-height: 0;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
  }

  .featured-book-grid .book-cover-link {
    width: 94px;
    margin: 0;
    border-radius: 5px;
    box-shadow: 0 10px 22px rgba(15, 44, 38, 0.17);
  }

  .featured-book-grid .book-cover-overlay {
    display: none;
  }

  .featured-book-grid .book-cover-corner {
    top: 8px;
    left: 7px;
    padding: 4px 5px;
    font-size: 7px;
  }

  .featured-book-grid .book-info {
    max-width: none;
  }

  .featured-book-grid .book-info h3 {
    margin-top: 8px;
    font-size: 18px;
  }

  .featured-book-grid .book-info > p {
    max-width: 100%;
    font-size: 10px;
  }

  .featured-book-grid .book-meta-line {
    margin-top: 8px;
  }

  .featured-book-grid .book-card-progress {
    margin-top: 9px;
  }

  .featured-book-grid .book-card-actions {
    margin-top: 9px;
  }

  .featured-book-grid .book-card-actions .button {
    width: auto;
    min-height: 32px;
    padding: 0 10px;
    font-size: 9px;
  }

  .more-books {
    margin-top: 32px;
    padding-top: 22px;
  }

  .more-book-list {
    grid-template-columns: 1fr;
  }

  .upcoming-materials .more-book-list {
    grid-template-columns: 1fr;
  }

  .more-books-head span {
    display: none;
  }

  .workspace-word-count {
    display: none;
  }

  .workspace-content {
    padding-top: 12px;
  }

  .word-main {
    padding: 33px 15px 28px;
  }

  .word-headline {
    gap: 9px;
  }

  .word-position {
    gap: 7px;
  }

  .word-position > span {
    font-size: 8px;
  }

  .word-dutch {
    font-size: clamp(37px, 12vw, 48px);
  }

  .word-audio-orb {
    flex-basis: 39px;
    width: 39px;
    height: 39px;
    min-height: 39px;
  }

  .word-chinese {
    margin-top: 15px;
    font-size: 19px;
  }

  .example-band {
    padding: 21px 16px 23px;
  }

  .example-dutch {
    font-size: 19px;
  }

  .flashcard-controls {
    grid-template-columns: 43px minmax(0, 1fr) 43px;
  }

  .flashcard-controls .control-button {
    min-height: 43px;
  }

  .flashcard-controls .control-button--play span {
    display: inline;
  }
}

/* Orange editorial theme */
.site-header {
  border-bottom-color: rgba(215, 204, 196, 0.82);
  background: rgba(255, 255, 255, 0.94);
}

.brand-mark {
  border-radius: 9px;
  background: var(--forest-900);
  box-shadow: 0 7px 18px rgba(228, 87, 46, 0.24);
}

.brand-copy strong {
  color: var(--ink-950);
}

.brand-copy small {
  color: var(--ink-500);
}

.nav-action:hover,
.nav-action.is-active {
  background: var(--forest-50);
  color: var(--forest-800);
}

.library-intro {
  background: var(--brand-blue-strong);
  box-shadow: inset 0 -5px 0 var(--brand-blue-ink);
}

.library-intro .library-kicker {
  color: var(--white);
}

.library-intro-copy p,
.library-intro .stat-pill {
  color: var(--white);
}

.continue-card {
  border: 0;
  background: var(--white);
  color: var(--ink-950);
  box-shadow: 0 16px 34px rgba(95, 42, 24, 0.2);
}

.continue-card:hover {
  background: #fffaf7;
}

.continue-card-label,
.continue-card small {
  color: var(--ink-500);
}

.continue-card-main span,
.continue-card > svg {
  color: var(--forest-800);
}

.continue-card-track {
  background: #f2e5de;
}

.continue-card-track i {
  background: var(--forest-900);
}

.button--forest {
  background: var(--forest-900);
  box-shadow: 0 8px 18px rgba(228, 87, 46, 0.17);
}

.button--forest:hover {
  background: var(--forest-800);
}

.featured-book-grid .book-cover-link {
  box-shadow: 0 18px 38px rgba(57, 34, 24, 0.15);
}

.status-badge--ready {
  background: var(--forest-100);
  color: var(--forest-800);
}

.status-badge--ready::before {
  background: var(--forest-900);
}

.status-badge--preparing {
  color: var(--forest-700);
}

.study-sidebar {
  background: #fffdfb;
  box-shadow: 8px 0 26px rgba(57, 34, 24, 0.025);
}

.chapter-item {
  border-bottom-color: #f0eae6;
}

.group-button.is-active {
  background: var(--forest-100);
  color: var(--forest-800);
}

.group-button.is-active small {
  color: var(--forest-700);
}

.level-badge {
  background: var(--forest-100);
  color: var(--forest-800);
}

.workspace-topbar {
  border-bottom-color: var(--line);
}

.word-card {
  border-color: #e9e2dc;
  box-shadow: 0 12px 32px rgba(57, 34, 24, 0.065);
}

.word-card-top {
  border-bottom-color: #f0ebe7;
}

.word-audio-orb {
  background: var(--forest-100);
  color: var(--forest-800);
}

.word-audio-orb:hover {
  background: #f8d8ca;
}

.example-band {
  border-top-color: #dae4e9;
  background: #f2f7f9;
}

.source-badge {
  background: var(--gold-soft);
  color: #1f6685;
}

.example-marker i {
  background: #c8d8df;
}

.example-number {
  border-color: #d5b7aa;
  color: var(--forest-800);
}

.small-audio-button {
  border-color: #d8e2e7;
  color: #245e78;
}

.small-audio-button:hover {
  border-color: #afcbd7;
  background: #f8fcfe;
}

.control-button--play {
  border-color: var(--forest-900);
  background: var(--forest-900);
  box-shadow: 0 9px 20px rgba(228, 87, 46, 0.2);
}

.control-button--play:hover {
  border-color: var(--forest-800);
  background: var(--forest-800);
}

.control-button.is-active {
  border-color: #afcbd7;
  background: var(--gold-soft);
  color: #245e78;
}

.settings-popover {
  border-color: var(--line);
  box-shadow: 0 22px 56px rgba(57, 34, 24, 0.16);
}

.segmented-control input:checked + span {
  color: var(--forest-800);
}

.switch-row input:checked + i {
  background: var(--forest-900);
}

.voice-status {
  background: var(--forest-50);
  color: var(--forest-800);
}

.toast {
  background: var(--forest-950);
}

/* Orange and blue semantic finish */
.library-intro .library-stats {
  margin-top: 24px;
}

.library-intro .stat-pill {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
}

.library-intro .stat-pill strong {
  color: var(--white);
}

.button--forest,
.control-button--play {
  border-color: var(--brand-blue-strong);
  background: var(--brand-blue-strong);
}

.button--forest:hover,
.control-button--play:hover {
  border-color: var(--brand-blue-ink);
  background: var(--brand-blue-ink);
}

.continue-card-track i,
.book-card-progress .track i,
.sidebar-progress-track i,
.word-position-track i {
  background: var(--brand-orange);
}

.brand-mark {
  background: var(--brand-blue-strong);
  box-shadow: 0 7px 18px rgba(29, 93, 135, 0.2);
}

.chapter-item.is-open > .chapter-toggle .chapter-number {
  border-color: var(--brand-blue-strong);
  background: var(--brand-blue-strong);
}

.status-badge--ready {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge--ready::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(47, 125, 92, 0.1);
}

.status-badge--preparing {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge--preparing::before {
  background: #c58a16;
  box-shadow: 0 0 0 4px rgba(197, 138, 22, 0.1);
}

.sidebar-directory-head {
  align-items: flex-start;
  gap: 12px;
}

.sidebar-directory-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.sidebar-directory-title small {
  overflow: hidden;
  color: var(--brand-orange-ink);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-directory-count {
  flex: 0 0 auto;
  padding-top: 1px;
  white-space: nowrap;
}

.workspace-audio-state {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #d4e4eb;
  border-radius: 5px;
  background: var(--info-blue-soft);
  color: var(--info-blue-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-audio-state:hover {
  border-color: #a9c8d6;
  background: #e4f1f6;
}

.workspace-audio-state.is-off {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink-500);
}

.workspace-audio-state svg {
  width: 13px;
  height: 13px;
}

.word-audio-orb {
  background: var(--info-blue-soft);
  color: var(--info-blue-ink);
}

.word-audio-orb:hover {
  background: #dcecf3;
}

.voice-status {
  background: var(--info-blue-soft);
  color: var(--info-blue-ink);
}

.continue-card-main span,
.word-position strong {
  color: var(--brand-orange-ink);
}

.continue-card > svg {
  color: var(--brand-blue-strong);
}

@media (max-width: 700px) {
  .site-header .nav-action {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .header-nav {
    gap: 3px;
  }

  .group-button {
    min-height: 44px;
    padding: 8px 7px;
    font-size: 10px;
  }

  .study-sidebar .chapter-toggle {
    min-height: 56px;
  }

  .mobile-directory-button,
  .word-card-tools .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .word-card-tools {
    flex: 0 0 auto;
    gap: 1px;
  }

  .word-audio-orb {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .small-audio-button {
    min-height: 44px;
    padding: 0 13px;
    font-size: 9px;
  }

  .flashcard-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .flashcard-controls .control-button {
    min-height: 44px;
  }

  .flashcard-controls .control-button--square {
    width: 44px;
  }

  .popover-heading .icon-button--small,
  .dialog-heading .icon-button,
  .command-head .icon-button,
  .study-sidebar-close {
    width: 44px;
    height: 44px;
  }

  .workspace-title-line h2 {
    max-width: 38vw;
  }

  .workspace-audio-state {
    min-height: 44px;
    padding: 0 8px;
    font-size: 10px;
  }

  .audio-status {
    display: none;
  }

  .word-position-track {
    flex: 0 0 34px;
    width: 34px;
  }

  .word-position {
    min-width: 0;
    flex: 1;
  }

  .word-position strong {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .word-position > span {
    min-width: 0;
    max-width: 130px;
    overflow: hidden;
    flex: 1;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .featured-book-grid .book-card-actions .button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 11px;
  }

  .featured-book-grid--primary .book-card--primary {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 24px rgba(31, 75, 102, 0.08);
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
  }

  .featured-book-grid--primary .book-cover-link {
    width: 78px;
  }

  .featured-book-grid--primary .book-info > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .featured-book-grid .book-card--primary .book-card-actions .button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 340px) {
  html,
  body {
    min-width: 0;
  }

  .header-inner {
    width: calc(100% - 20px);
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand--wordmark {
    gap: 7px;
  }

  .brand-flower {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .brand-copy .brand-name strong {
    font-size: 19px;
  }

  .brand-name span {
    font-size: 12px;
  }

  .brand-copy.brand-copy--wordmark small {
    font-size: 7px;
  }

  .header-nav {
    gap: 0;
  }
}

.settings-popover .eyebrow {
  color: var(--brand-orange-ink);
}

.mobile-directory-button {
  display: none;
}

@media (max-width: 900px) {
  .mobile-directory-button {
    display: inline-flex;
  }
}

/* Word-only study card: the source vocabulary list does not include examples. */
.study-panel .word-card {
  min-height: 440px;
}

.study-panel .word-main {
  min-height: 384px;
  padding: 54px 48px;
}

.study-panel .word-chinese {
  margin-top: 24px;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .study-panel .word-card {
    min-height: 360px;
  }

  .study-panel .word-main {
    min-height: 304px;
    padding: 44px 22px;
  }

  .study-panel .word-dutch {
    font-size: clamp(38px, 12vw, 52px);
  }

  .study-panel .word-chinese {
    margin-top: 18px;
    font-size: 20px;
  }
}

/* Fangfei Dutch vocabulary platform aligned with the KNM / A2 Spreken site. */
:root {
  --brand-blue: #285888;
  --brand-blue-strong: #2b548c;
  --brand-blue-ink: #154273;
  --brand-blue-soft: #f2f7fc;
  --brand-blue-pale: #f6f9fc;
  --brand-orange: #f5954d;
  --brand-orange-strong: #ee8640;
  --brand-orange-ink: #c2410c;
  --brand-orange-soft: #fdf1e7;
  --ink-950: #192a31;
  --ink-800: #3c3c3c;
  --ink-600: #667079;
  --ink-500: #66727a;
  --paper: #f6f6f6;
  --line: #ececec;
  --line-strong: #e0e0e0;
  --serif: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(25, 42, 49, 0.06);
  --shadow-md: 0 8px 24px rgba(25, 42, 49, 0.12);
  --header-height: 80px;
}

body {
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--sans);
  letter-spacing: 0;
}

.site-header {
  border-bottom: 0;
  background: linear-gradient(135deg, #16324f 0%, #2f5d8a 100%);
  box-shadow: none;
  backdrop-filter: none;
}

.header-inner {
  width: 100%;
  max-width: 1120px;
  min-height: 80px;
  height: auto;
  padding: 14px 22px;
  gap: 16px;
}

.brand--wordmark {
  gap: 14px;
  min-width: 0;
}

.brand-flower {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.brand-copy--wordmark {
  min-width: 0;
  gap: 2px;
}

.brand-title,
.brand-copy .brand-title {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy.brand-copy--wordmark small {
  overflow: hidden;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-nav {
  gap: 8px;
}

.header-nav .nav-link,
.header-nav .nav-action {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

.header-nav .nav-action--icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.header-nav .nav-link:hover,
.header-nav .nav-action:hover,
.header-nav .nav-action.is-active {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.header-nav kbd {
  display: none;
}

.header-nav svg {
  width: 17px;
  height: 17px;
}

.header-nav .favorite-count {
  background: var(--brand-orange);
  color: #fff;
}

.library-intro {
  display: block;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 22px 0;
  background: transparent;
  box-shadow: none;
}

.library-intro-copy .library-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.library-intro-copy h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
}

.library-intro-copy p {
  max-width: none;
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 15px;
  line-height: 1.7;
}

.library-intro-copy .library-intro-hint {
  margin-top: 4px;
  font-size: 13px;
}

.library-stats {
  display: none;
}

.library-section--simple {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

.platform-footer {
  display: flex;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 22px 26px;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-600);
  font-size: 13px;
  flex-wrap: wrap;
}

.section-heading--simple {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.section-number {
  display: inline-flex;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border-radius: 9px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.section-heading-copy {
  min-width: 0;
}

.section-heading-copy .library-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-heading-copy h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 22px;
  font-weight: 700;
}

.section-heading-copy p {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: 13px;
}

.section-progress {
  margin-left: auto;
  padding-top: 23px;
  color: var(--ink-600);
  font-size: 13px;
  white-space: nowrap;
}

.book-card--primary {
  max-width: 100%;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 26px;
}

.featured-book-grid .book-card--primary .book-cover-link {
  width: 205px;
  max-width: 205px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(22, 50, 79, 0.16);
}

.book-card--primary .book-info h3 {
  margin-top: 10px;
  color: var(--ink-950);
  font-size: 24px;
}

.book-card--primary .book-info > p {
  max-width: 640px;
  color: var(--ink-600);
  font-size: 14px;
}

.book-card--primary .book-status {
  color: var(--ink-600);
  font-size: 12px;
}

.book-card--primary .status-badge {
  border-radius: 999px;
  font-size: 12px;
}

.book-card--primary .book-meta-line {
  margin-top: 14px;
}

.book-card--primary .book-meta-line span {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-600);
  font-size: 12px;
}

.book-card--primary .book-card-progress {
  max-width: 640px;
  margin-top: 16px;
  color: var(--ink-600);
  font-size: 12px;
}

.book-card--primary .book-card-actions {
  margin-top: 20px;
}

.featured-book-grid .book-card--primary .book-card-actions .button {
  width: auto;
  min-width: 138px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--brand-blue);
  border-radius: 8px;
  background: var(--brand-blue);
  color: #fff;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}

.featured-book-grid .book-card--primary .book-card-actions .button:hover {
  border-color: var(--brand-blue-ink);
  background: var(--brand-blue-ink);
}

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

.study-sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
}

.sidebar-summary {
  padding: 20px 18px 16px;
}

.sidebar-book-title h1 {
  color: var(--ink-950);
  font-size: 22px;
}

.sidebar-book-title p {
  color: var(--ink-600);
  font-size: 11px;
}

.level-badge {
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 11px;
}

.sidebar-progress-top {
  color: var(--ink-600);
  font-size: 11px;
}

.chapter-toggle {
  border-radius: 7px;
}

.chapter-toggle:hover {
  background: var(--brand-blue-pale);
}

.chapter-number {
  border-radius: 7px;
  color: var(--ink-600);
  font-size: 10px;
}

.chapter-toggle-copy strong {
  font-size: 12px;
}

.chapter-toggle-copy small,
.chapter-word-count {
  font-size: 9px;
}

.workspace-topbar {
  background: rgba(246, 246, 246, 0.96);
}

.workspace-breadcrumb {
  color: var(--ink-600);
  font-size: 10px;
}

.workspace-title-line h2 {
  color: var(--ink-950);
}

.exercise-label {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-600);
  font-size: 10px;
}

.view-switcher {
  border-color: var(--line-strong);
  border-radius: 8px;
}

.view-switcher button {
  border-radius: 6px;
  color: var(--ink-600);
  font-size: 11px;
}

.view-switcher button.is-active {
  background: var(--brand-blue);
  color: #fff;
}

.workspace-content {
  max-width: 1040px;
  padding: 24px 28px 110px;
}

.word-card {
  max-width: 820px;
  min-height: 520px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.word-card-top {
  min-height: 56px;
  border-bottom-color: var(--line);
}

.word-position {
  color: var(--ink-600);
  font-size: 11px;
}

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

.word-position > span {
  font-size: 10px;
}

.word-main {
  min-height: 310px;
  padding: 44px 40px 34px;
}

.word-kicker {
  color: var(--ink-600);
  font-size: 10px;
}

.word-dutch {
  color: var(--ink-950);
  font-family: var(--sans);
  font-size: clamp(44px, 5.4vw, 64px);
  font-weight: 700;
  line-height: 1.12;
}

.word-detail span {
  min-height: 28px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 11px;
}

.word-speak {
  border-radius: 8px;
  background: var(--brand-blue);
}

.word-audio-orb,
.word-speak.word-audio-orb {
  background: var(--brand-blue);
  color: #fff;
}

.word-speak:hover {
  background: var(--brand-blue-ink);
}

.word-audio-orb:hover,
.word-speak.word-audio-orb:hover {
  background: var(--brand-blue-ink);
}

.word-chinese {
  margin-top: 20px;
  color: var(--ink-950);
  font-size: 22px;
  font-weight: 600;
}

.example-band {
  padding: 24px 32px 28px;
  background: #f8fafb;
}

.example-heading strong {
  color: var(--ink-600);
  font-size: 10px;
}

.source-badge {
  border: 1px solid #f0d9c4;
  border-radius: 999px;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-ink);
  font-size: 10px;
}

.example-marker .example-number {
  color: var(--brand-orange-ink);
}

.example-dutch {
  color: var(--ink-950);
}

.example-chinese {
  color: var(--ink-600);
}

.example-band--review {
  min-height: 112px;
}

.example-review-state {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.example-review-state > svg {
  color: var(--brand-blue);
}

.example-review-copy strong {
  color: var(--ink-950);
  font-size: 13px;
}

.example-review-copy span {
  color: var(--ink-600);
  font-size: 11px;
}

.flashcard-controls {
  max-width: 820px;
}

.control-button {
  border-color: var(--line-strong);
  border-radius: 8px;
  color: var(--brand-blue);
  box-shadow: none;
  font-size: 13px;
}

.control-button:hover {
  background: var(--brand-blue-pale);
}

.control-button--play {
  background: var(--brand-blue);
  color: #fff;
}

.control-button--play:hover {
  border-color: var(--brand-blue-ink);
  background: var(--brand-blue-ink);
  color: #fff;
}

.control-button--play.is-active {
  border-color: #f0d9c4;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-ink);
}

.icon-button {
  border-color: var(--line-strong);
}

.icon-button:hover {
  background: var(--brand-blue-pale);
  color: var(--brand-blue);
}

.workspace-audio-state {
  border-radius: 999px;
}

.command-dialog,
.favorites-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.settings-popover {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.button--forest {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  border-radius: 8px;
}

@media (max-width: 760px) {
  :root {
    --header-height: 68px;
  }

  .header-inner {
    max-width: none;
    min-height: 68px;
    padding: 10px 14px;
    gap: 10px;
  }

  .brand--wordmark {
    gap: 11px;
  }

  .brand-flower {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 9px;
  }

  .brand-title,
  .brand-copy .brand-title {
    font-size: 17px;
  }

  .brand-copy.brand-copy--wordmark small {
    font-size: 11px;
    line-height: 15px;
  }

  .header-nav {
    gap: 4px;
  }

  .header-nav .nav-link {
    display: none;
  }

  .header-nav .nav-action {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .header-nav .nav-action > span:not(.favorite-count) {
    display: none;
  }

  .header-nav kbd {
    display: none;
  }

  .library-intro {
    padding: 24px 16px 0;
  }

  .library-intro-copy h1 {
    font-size: 24px;
  }

  .library-intro-copy p {
    font-size: 13px;
  }

  .library-intro-copy .library-intro-hint {
    font-size: 12px;
  }

  .library-section--simple {
    padding: 24px 16px 36px;
  }

  .platform-footer {
    padding: 16px 16px 24px;
  }

  .section-heading--simple {
    gap: 11px;
  }

  .section-number {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
  }

  .section-heading-copy h2 {
    font-size: 21px;
  }

  .section-progress {
    display: none;
  }

  .book-card--primary,
  .featured-book-grid--primary .book-card--primary {
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
  }

  .featured-book-grid .book-card--primary .book-cover-link,
  .featured-book-grid--primary .book-cover-link {
    width: 82px;
    max-width: 82px;
  }

  .book-card--primary .book-info h3 {
    font-size: 20px;
  }

  .book-card--primary .book-info > p {
    font-size: 12px;
  }

  .book-card--primary .book-status {
    font-size: 11px;
  }

  .book-card--primary .book-meta-line span,
  .book-card--primary .book-card-progress,
  .book-card--primary .status-badge {
    font-size: 11px;
  }

  .featured-book-grid .book-card--primary .book-card-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

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

  .workspace-content {
    padding: 18px 14px 96px;
  }

  .word-card {
    min-height: 0;
  }

  .word-main {
    min-height: 290px;
    padding: 38px 20px 30px;
  }

  .word-dutch {
    font-size: clamp(40px, 13vw, 52px);
  }

  .word-chinese {
    margin-top: 16px;
    font-size: 20px;
  }

  .example-band {
    padding: 20px 18px 22px;
  }

  .example-review-copy {
    gap: 6px;
  }
}

@media (max-width: 460px) {
  .brand-title-suffix {
    display: none;
  }

  .brand-copy.brand-copy--wordmark small {
    max-width: 128px;
  }
}

@media (max-width: 340px) {
  .header-inner {
    padding: 9px 10px;
    gap: 6px;
  }

  .brand-flower {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .brand-title,
  .brand-copy .brand-title {
    font-size: 15px;
  }

  .brand-copy.brand-copy--wordmark small {
    display: none;
  }

  .header-nav .nav-action {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }
}
